@paynext/sdk 0.0.129 → 0.0.130

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/dist/index.es.js CHANGED
@@ -43,33 +43,35 @@ class nu {
43
43
  }
44
44
  mount(e, t) {
45
45
  return E(this, null, function* () {
46
+ var s, a, o, l, u, d, p, h, m, f, g;
46
47
  const i = document.getElementById(e);
47
48
  if (!i) {
48
49
  console.error(`Element with id "${e}" not found`);
49
50
  return;
50
51
  }
51
52
  if (!this.core) {
52
- const a = (yield import("./index-C6qOiJ-j.js")).Core;
53
- this.core = new a();
53
+ const C = (yield import("./index-C6qOiJ-j.js")).Core;
54
+ this.core = new C();
54
55
  }
55
- t.styles && this.core.state.styles.setState(t.styles), this.core.state.checkout.setState({
56
+ t.styles && ((o = (a = (s = this.core) == null ? void 0 : s.state) == null ? void 0 : a.styles) == null || o.setState(t.styles)), (d = (u = (l = this.core) == null ? void 0 : l.state) == null ? void 0 : u.checkout) == null || d.setState({
56
57
  clientToken: t.clientToken,
57
58
  environment: t.environment,
58
59
  apiVersion: t.apiVersion,
59
60
  errorMessageText: t.errorMessageText
60
61
  });
61
- const r = yield this.core.checkout.mount();
62
- i.innerHTML = "", i.appendChild(r), this.core.state.checkout.setState(t);
62
+ const r = yield (h = (p = this.core) == null ? void 0 : p.checkout) == null ? void 0 : h.mount();
63
+ i.innerHTML = "", i.appendChild(r), (g = (f = (m = this.core) == null ? void 0 : m.state) == null ? void 0 : f.checkout) == null || g.setState(t);
63
64
  });
64
65
  }
65
66
  unmount(e) {
66
67
  return E(this, null, function* () {
68
+ var i;
67
69
  const t = document.getElementById(e);
68
- !t || !this.core || (t.innerHTML = "", this.core.clearState());
70
+ !t || !this.core || (t.innerHTML = "", (i = this.core) == null || i.clearState());
69
71
  });
70
72
  }
71
73
  }
72
- var k = /* @__PURE__ */ ((n) => (n.PAYPAL = "PAYPAL", n.APPLE_PAY = "APPLEPAY", n.GOOGLE_PAY = "GPAY", n.CARD = "CARD", n.VENMO = "VENMO", n))(k || {}), Pt = /* @__PURE__ */ ((n) => (n.PENDING = "PENDING", n.FAILED = "FAILED", n.AUTHORIZED = "AUTHORIZED", n.SETTLING = "SETTLING", n.SETTLED = "SETTLED", n.DECLINED = "DECLINED", n.CANCELLED = "CANCELLED", n))(Pt || {});
74
+ var x = /* @__PURE__ */ ((n) => (n.PAYPAL = "PAYPAL", n.APPLE_PAY = "APPLEPAY", n.GOOGLE_PAY = "GPAY", n.CARD = "CARD", n.VENMO = "VENMO", n))(x || {}), Pt = /* @__PURE__ */ ((n) => (n.PENDING = "PENDING", n.FAILED = "FAILED", n.AUTHORIZED = "AUTHORIZED", n.SETTLING = "SETTLING", n.SETTLED = "SETTLED", n.DECLINED = "DECLINED", n.CANCELLED = "CANCELLED", n))(Pt || {});
73
75
  const Cn = {
74
76
  appIds: {
75
77
  develop: "app_00b96c0c3011",
@@ -85,26 +87,26 @@ const Cn = {
85
87
  production: "https://api.paynext.com"
86
88
  })[n], wr = [
87
89
  {
88
- type: k.PAYPAL,
90
+ type: x.PAYPAL,
89
91
  order: 1,
90
92
  is_active: !0
91
93
  },
92
94
  {
93
- type: k.APPLE_PAY,
95
+ type: x.APPLE_PAY,
94
96
  order: 2,
95
97
  is_active: !0
96
98
  },
97
99
  {
98
- type: k.GOOGLE_PAY,
100
+ type: x.GOOGLE_PAY,
99
101
  order: 3,
100
102
  is_active: !0
101
103
  },
102
104
  {
103
- type: k.CARD,
105
+ type: x.CARD,
104
106
  order: 4,
105
107
  is_active: !0
106
108
  }
107
- ], Tr = (n) => n.googlePay ? k.GOOGLE_PAY : n.applePay ? k.APPLE_PAY : n.paypal ? k.PAYPAL : n.braintree ? k.VENMO : k.CARD, Ar = (n) => {
109
+ ], Tr = (n) => n.googlePay ? x.GOOGLE_PAY : n.applePay ? x.APPLE_PAY : n.paypal ? x.PAYPAL : n.braintree ? x.VENMO : x.CARD, Ar = (n) => {
108
110
  const e = n.card;
109
111
  if (e)
110
112
  return {
@@ -131,15 +133,15 @@ const Cn = {
131
133
  billing_agreement_token: e.billing_agreement_token.paypalId
132
134
  };
133
135
  }, _r = (n) => {
134
- var t, i, r, s, a, o, l, u, d, p, h, m, g, b, v, x, _, T;
136
+ var t, i, r, s, a, o, l, u, d, p, h, m, f, g, v, C, w, T;
135
137
  const e = n.googlePay;
136
138
  if (e != null && e.token)
137
139
  return {
138
140
  cryptogram: e.cryptogram,
139
141
  eci: e.eci,
140
142
  exp_month: (i = (t = e.card) == null ? void 0 : t.expiry) != null && i.month || (s = (r = e.token) == null ? void 0 : r.expiry) != null && s.month ? Number(((o = (a = e.card) == null ? void 0 : a.expiry) == null ? void 0 : o.month) || ((u = (l = e.token) == null ? void 0 : l.expiry) == null ? void 0 : u.month)) : void 0,
141
- exp_year: (p = (d = e.card) == null ? void 0 : d.expiry) != null && p.year || (m = (h = e.token) == null ? void 0 : h.expiry) != null && m.year ? Number(((b = (g = e.card) == null ? void 0 : g.expiry) == null ? void 0 : b.year) || ((x = (v = e.token) == null ? void 0 : v.expiry) == null ? void 0 : x.year)) : void 0,
142
- token: (_ = e.token) == null ? void 0 : _.number,
143
+ exp_year: (p = (d = e.card) == null ? void 0 : d.expiry) != null && p.year || (m = (h = e.token) == null ? void 0 : h.expiry) != null && m.year ? Number(((g = (f = e.card) == null ? void 0 : f.expiry) == null ? void 0 : g.year) || ((C = (v = e.token) == null ? void 0 : v.expiry) == null ? void 0 : C.year)) : void 0,
144
+ token: (w = e.token) == null ? void 0 : w.number,
143
145
  token_service_provider: (T = e.token) == null ? void 0 : T.tokenServiceProvider
144
146
  };
145
147
  }, Vr = (n) => {
@@ -161,7 +163,7 @@ const Cn = {
161
163
  payment_method_nonce: e.nonce
162
164
  };
163
165
  }, kn = (n) => {
164
- var i, r, s, a, o, l, u, d, p, h, m, g, b, v;
166
+ var i, r, s, a, o, l, u, d, p, h, m, f, g, v;
165
167
  const { applePay: e, googlePay: t } = n;
166
168
  if (!(!e && !t))
167
169
  return {
@@ -169,11 +171,11 @@ const Cn = {
169
171
  country: ((s = e == null ? void 0 : e.billingContact) == null ? void 0 : s.countryCode) || ((a = t == null ? void 0 : t.billingAddress) == null ? void 0 : a.countryCode) || void 0,
170
172
  line1: ((l = (o = e == null ? void 0 : e.billingContact) == null ? void 0 : o.addressLines) == null ? void 0 : l.at(0)) || ((u = t == null ? void 0 : t.billingAddress) == null ? void 0 : u.address1) || void 0,
171
173
  line2: ((p = (d = e == null ? void 0 : e.billingContact) == null ? void 0 : d.addressLines) == null ? void 0 : p.at(1)) || ((h = t == null ? void 0 : t.billingAddress) == null ? void 0 : h.address2) || void 0,
172
- postal_code: ((m = e == null ? void 0 : e.billingContact) == null ? void 0 : m.postalCode) || ((g = t == null ? void 0 : t.billingAddress) == null ? void 0 : g.postalCode) || void 0,
173
- state: ((b = e == null ? void 0 : e.billingContact) == null ? void 0 : b.administrativeArea) || ((v = t == null ? void 0 : t.billingAddress) == null ? void 0 : v.administrativeArea) || void 0
174
+ postal_code: ((m = e == null ? void 0 : e.billingContact) == null ? void 0 : m.postalCode) || ((f = t == null ? void 0 : t.billingAddress) == null ? void 0 : f.postalCode) || void 0,
175
+ state: ((g = e == null ? void 0 : e.billingContact) == null ? void 0 : g.administrativeArea) || ((v = t == null ? void 0 : t.billingAddress) == null ? void 0 : v.administrativeArea) || void 0
174
176
  };
175
177
  }, xn = (n) => {
176
- var r, s, a, o, l, u, d, p, h, m, g, b, v, x, _, T, I, A, D, C, w, O, R;
178
+ var r, s, a, o, l, u, d, p, h, m, f, g, v, C, w, T, I, L, D, k, A, O, R;
177
179
  const { card: e, googlePay: t, applePay: i } = n;
178
180
  if (!(!e && !(t != null && t.card) && !(i != null && i.card)))
179
181
  return {
@@ -184,12 +186,12 @@ const Cn = {
184
186
  currency_code: (e == null ? void 0 : e.currency) || ((l = t == null ? void 0 : t.card) == null ? void 0 : l.currency) || ((u = i == null ? void 0 : i.card) == null ? void 0 : u.currency),
185
187
  funding: (e == null ? void 0 : e.funding) || ((d = t == null ? void 0 : t.card) == null ? void 0 : d.funding) || ((p = i == null ? void 0 : i.card) == null ? void 0 : p.funding),
186
188
  issuer: (e == null ? void 0 : e.issuer) || ((h = t == null ? void 0 : t.card) == null ? void 0 : h.issuer) || ((m = i == null ? void 0 : i.card) == null ? void 0 : m.issuer),
187
- type: (e == null ? void 0 : e.type) || ((g = t == null ? void 0 : t.card) == null ? void 0 : g.segment) || ((b = i == null ? void 0 : i.card) == null ? void 0 : b.segment)
189
+ type: (e == null ? void 0 : e.type) || ((f = t == null ? void 0 : t.card) == null ? void 0 : f.segment) || ((g = i == null ? void 0 : i.card) == null ? void 0 : g.segment)
188
190
  },
189
191
  cvc: e == null ? void 0 : e.cvc,
190
- exp_month: e != null && e.expMonth || (x = (v = t == null ? void 0 : t.card) == null ? void 0 : v.expiry) != null && x.month ? Number((e == null ? void 0 : e.expMonth) || ((T = (_ = t == null ? void 0 : t.card) == null ? void 0 : _.expiry) == null ? void 0 : T.month)) : void 0,
191
- exp_year: e != null && e.expYear || (A = (I = t == null ? void 0 : t.card) == null ? void 0 : I.expiry) != null && A.year ? Number((e == null ? void 0 : e.expYear) || ((C = (D = t == null ? void 0 : t.card) == null ? void 0 : D.expiry) == null ? void 0 : C.year)) : void 0,
192
- last4: (e == null ? void 0 : e.lastFourDigits) || ((w = t == null ? void 0 : t.card) == null ? void 0 : w.lastFour) || ((O = i == null ? void 0 : i.card) == null ? void 0 : O.lastFour),
192
+ exp_month: e != null && e.expMonth || (C = (v = t == null ? void 0 : t.card) == null ? void 0 : v.expiry) != null && C.month ? Number((e == null ? void 0 : e.expMonth) || ((T = (w = t == null ? void 0 : t.card) == null ? void 0 : w.expiry) == null ? void 0 : T.month)) : void 0,
193
+ exp_year: e != null && e.expYear || (L = (I = t == null ? void 0 : t.card) == null ? void 0 : I.expiry) != null && L.year ? Number((e == null ? void 0 : e.expYear) || ((k = (D = t == null ? void 0 : t.card) == null ? void 0 : D.expiry) == null ? void 0 : k.year)) : void 0,
194
+ last4: (e == null ? void 0 : e.lastFourDigits) || ((A = t == null ? void 0 : t.card) == null ? void 0 : A.lastFour) || ((O = i == null ? void 0 : i.card) == null ? void 0 : O.lastFour),
193
195
  number: (e == null ? void 0 : e.number) || ((R = t == null ? void 0 : t.card) == null ? void 0 : R.number)
194
196
  };
195
197
  }, En = (n) => {
@@ -204,16 +206,16 @@ const Cn = {
204
206
  type: e
205
207
  };
206
208
  switch (e) {
207
- case k.CARD:
209
+ case x.CARD:
208
210
  return M(y({}, t), {
209
211
  name: En(n),
210
212
  card: Ar(n)
211
213
  });
212
- case k.PAYPAL:
214
+ case x.PAYPAL:
213
215
  return M(y({}, t), {
214
216
  paypal: Lr(n)
215
217
  });
216
- case k.GOOGLE_PAY:
218
+ case x.GOOGLE_PAY:
217
219
  return M(y({}, t), {
218
220
  name: (r = (i = n.googlePay) == null ? void 0 : i.billingAddress) == null ? void 0 : r.name,
219
221
  phone: (l = (o = (a = (s = n.googlePay) == null ? void 0 : s.billingAddress) == null ? void 0 : a.phoneNumber) == null ? void 0 : o.replace(/ /g, "")) == null ? void 0 : l.replace(/-/g, ""),
@@ -221,7 +223,7 @@ const Cn = {
221
223
  google_pay: _r(n),
222
224
  billing_address: kn(n)
223
225
  });
224
- case k.APPLE_PAY:
226
+ case x.APPLE_PAY:
225
227
  return M(y({}, t), {
226
228
  name: En(n),
227
229
  card: xn(n),
@@ -229,7 +231,7 @@ const Cn = {
229
231
  phone: (d = (u = n.applePay) == null ? void 0 : u.shippingContact) == null ? void 0 : d.phoneNumber,
230
232
  billing_address: kn(n)
231
233
  });
232
- case k.VENMO:
234
+ case x.VENMO:
233
235
  return M(y({}, t), {
234
236
  venmo: Ir(n)
235
237
  });
@@ -255,8 +257,15 @@ const Cn = {
255
257
  }), Or = (n, e, t) => E(void 0, null, function* () {
256
258
  const i = new Headers();
257
259
  i.append("X-API-Version", t);
258
- const r = `${Jt(e)}/payments/config?client_session_id=${n}`, a = yield (yield fetch(r, { headers: i })).json();
259
- return a.checkout_config || (a.checkout_config = wr), a;
260
+ const r = `${Jt(e)}/payments/config?client_session_id=${n}`;
261
+ try {
262
+ const a = yield (yield fetch(r, { headers: i })).json();
263
+ return a.checkout_config || (a.checkout_config = wr), a;
264
+ } catch (s) {
265
+ console.error("Failed to get transaction config:", s);
266
+ const a = new Error("INVALID_SESSION");
267
+ throw a.name = "INVALID_SESSION", a;
268
+ }
260
269
  });
261
270
  let Rr = class {
262
271
  constructor(e) {
@@ -291,9 +300,9 @@ let Rr = class {
291
300
  allowedCardNetworks: ["visa", "masterCard"],
292
301
  requestBillingAddress: !0,
293
302
  requestPayerDetails: ["name", "email", "phone"],
294
- process: (g, b) => E(this, [g, b], function* (h, { fail: m }) {
303
+ process: (f, g) => E(this, [f, g], function* (h, { fail: m }) {
295
304
  o == null || o({
296
- paymentMethod: k.APPLE_PAY
305
+ paymentMethod: x.APPLE_PAY
297
306
  });
298
307
  try {
299
308
  s == null || s(h);
@@ -303,7 +312,7 @@ let Rr = class {
303
312
  });
304
313
  }
305
314
  })
306
- })), r && this.apple.on("error", (h) => r({ e: h, paymentMethod: k.APPLE_PAY })), a && this.apple.on("cancel", a), this.onReady = i;
315
+ })), r && this.apple.on("error", (h) => r({ e: h, paymentMethod: x.APPLE_PAY })), a && this.apple.on("cancel", a), this.onReady = i;
307
316
  });
308
317
  }
309
318
  render(e) {
@@ -342,9 +351,9 @@ let Rr = class {
342
351
  allowedAuthMethods: ["PAN_ONLY", "CRYPTOGRAM_3DS"],
343
352
  // ToDo: Temporary we have only Visa and Master card
344
353
  allowedCardNetworks: ["VISA", "MASTERCARD"],
345
- process: (g, b) => E(this, [g, b], function* (h, { fail: m }) {
354
+ process: (f, g) => E(this, [f, g], function* (h, { fail: m }) {
346
355
  o == null || o({
347
- paymentMethod: k.GOOGLE_PAY
356
+ paymentMethod: x.GOOGLE_PAY
348
357
  });
349
358
  try {
350
359
  s == null || s(h);
@@ -354,7 +363,7 @@ let Rr = class {
354
363
  });
355
364
  }
356
365
  })
357
- })), a && this.google.on("cancel", a), i && this.google.on("ready", i), r && this.google.on("error", (h) => r({ e: h, paymentMethod: k.GOOGLE_PAY }));
366
+ })), a && this.google.on("cancel", a), i && this.google.on("ready", i), r && this.google.on("error", (h) => r({ e: h, paymentMethod: x.GOOGLE_PAY }));
358
367
  });
359
368
  }
360
369
  render(e) {
@@ -590,9 +599,9 @@ const Gr = "easeInOut", Ur = 20;
590
599
  function Wr(n, s = {}, i, r) {
591
600
  var a = s, { defaultTransition: e = {} } = a, t = se(a, ["defaultTransition"]);
592
601
  const o = e.duration || 0.3, l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), d = {}, p = /* @__PURE__ */ new Map();
593
- let h = 0, m = 0, g = 0;
594
- for (let b = 0; b < n.length; b++) {
595
- const v = n[b];
602
+ let h = 0, m = 0, f = 0;
603
+ for (let g = 0; g < n.length; g++) {
604
+ const v = n[g];
596
605
  if (typeof v == "string") {
597
606
  p.set(v, m);
598
607
  continue;
@@ -600,12 +609,12 @@ function Wr(n, s = {}, i, r) {
600
609
  p.set(v.name, wn(m, v.at, h, p));
601
610
  continue;
602
611
  }
603
- let [x, _, T = {}] = v;
612
+ let [C, w, T = {}] = v;
604
613
  T.at !== void 0 && (m = wn(m, T.at, h, p));
605
614
  let I = 0;
606
- const A = (D, C, w, O = 0, R = 0) => {
607
- const K = Zr(D), Le = C, { delay: Te = 0, times: te = bi(K), type: fe = "keyframes", repeat: he, repeatType: kt, repeatDelay: xt = 0 } = Le, st = se(Le, ["delay", "times", "type", "repeat", "repeatType", "repeatDelay"]);
608
- let { ease: ne = e.ease || "easeOut", duration: f } = C;
615
+ const L = (D, k, A, O = 0, R = 0) => {
616
+ const K = Zr(D), Le = k, { delay: Te = 0, times: te = bi(K), type: fe = "keyframes", repeat: he, repeatType: kt, repeatDelay: xt = 0 } = Le, st = se(Le, ["delay", "times", "type", "repeat", "repeatType", "repeatDelay"]);
617
+ let { ease: ne = e.ease || "easeOut", duration: b } = k;
609
618
  const P = typeof Te == "function" ? Te(O, R) : Te, N = K.length, Y = en(fe) ? fe : r == null ? void 0 : r[fe];
610
619
  if (N <= 2 && Y) {
611
620
  let z = 100;
@@ -614,16 +623,16 @@ function Wr(n, s = {}, i, r) {
614
623
  z = Math.abs(ge);
615
624
  }
616
625
  const re = y({}, st);
617
- f !== void 0 && (re.duration = /* @__PURE__ */ ae(f));
626
+ b !== void 0 && (re.duration = /* @__PURE__ */ ae(b));
618
627
  const pe = vi(re, z, Y);
619
- ne = pe.ease, f = pe.duration;
628
+ ne = pe.ease, b = pe.duration;
620
629
  }
621
- f != null || (f = o);
630
+ b != null || (b = o);
622
631
  const ie = m + P;
623
632
  te.length === 1 && te[0] === 0 && (te[1] = 1);
624
633
  const X = te.length - K.length;
625
634
  if (X > 0 && gi(te, X), K.length === 1 && K.unshift(null), he) {
626
- ce(he < Ur, "Repeat count too high, must be less than 20"), f = Br(f, he);
635
+ ce(he < Ur, "Repeat count too high, must be less than 20"), b = Br(b, he);
627
636
  const z = [...K], re = [...te];
628
637
  ne = Array.isArray(ne) ? [...ne] : [ne];
629
638
  const pe = [...ne];
@@ -634,40 +643,40 @@ function Wr(n, s = {}, i, r) {
634
643
  }
635
644
  Yr(te, he);
636
645
  }
637
- const Ae = ie + f;
638
- qr(w, K, ne, te, ie, Ae), I = Math.max(P + f, I), g = Math.max(Ae, g);
646
+ const Ae = ie + b;
647
+ qr(A, K, ne, te, ie, Ae), I = Math.max(P + b, I), f = Math.max(Ae, f);
639
648
  };
640
- if (J(x)) {
641
- const D = Tn(x, u);
642
- A(_, T, An("default", D));
649
+ if (J(C)) {
650
+ const D = Tn(C, u);
651
+ L(w, T, An("default", D));
643
652
  } else {
644
- const D = hi(x, _, i, d), C = D.length;
645
- for (let w = 0; w < C; w++) {
646
- _ = _, T = T;
647
- const O = D[w], R = Tn(O, u);
648
- for (const K in _)
649
- A(_[K], Jr(T, K), An(K, R), w, C);
653
+ const D = hi(C, w, i, d), k = D.length;
654
+ for (let A = 0; A < k; A++) {
655
+ w = w, T = T;
656
+ const O = D[A], R = Tn(O, u);
657
+ for (const K in w)
658
+ L(w[K], Jr(T, K), An(K, R), A, k);
650
659
  }
651
660
  }
652
661
  h = m, m += I;
653
662
  }
654
- return u.forEach((b, v) => {
655
- for (const x in b) {
656
- const _ = b[x];
657
- _.sort(Hr);
658
- const T = [], I = [], A = [];
659
- for (let C = 0; C < _.length; C++) {
660
- const { at: w, value: O, easing: R } = _[C];
661
- T.push(O), I.push(/* @__PURE__ */ Qt(0, g, w)), A.push(R || "easeOut");
663
+ return u.forEach((g, v) => {
664
+ for (const C in g) {
665
+ const w = g[C];
666
+ w.sort(Hr);
667
+ const T = [], I = [], L = [];
668
+ for (let k = 0; k < w.length; k++) {
669
+ const { at: A, value: O, easing: R } = w[k];
670
+ T.push(O), I.push(/* @__PURE__ */ Qt(0, f, A)), L.push(R || "easeOut");
662
671
  }
663
- I[0] !== 0 && (I.unshift(0), T.unshift(T[0]), A.unshift(Gr)), I[I.length - 1] !== 1 && (I.push(1), T.push(null)), l.has(v) || l.set(v, {
672
+ I[0] !== 0 && (I.unshift(0), T.unshift(T[0]), L.unshift(Gr)), I[I.length - 1] !== 1 && (I.push(1), T.push(null)), l.has(v) || l.set(v, {
664
673
  keyframes: {},
665
674
  transition: {}
666
675
  });
667
676
  const D = l.get(v);
668
- D.keyframes[x] = T, D.transition[x] = y(M(y({}, e), {
669
- duration: g,
670
- ease: A,
677
+ D.keyframes[C] = T, D.transition[C] = y(M(y({}, e), {
678
+ duration: f,
679
+ ease: L,
671
680
  times: I
672
681
  }), t);
673
682
  }
@@ -741,8 +750,8 @@ function ns(n, e) {
741
750
  * Schedule a process to run on the next frame.
742
751
  */
743
752
  schedule: (d, p = !1, h = !1) => {
744
- const g = h && r ? t : i;
745
- return p && a.add(d), g.has(d) || g.add(d), d;
753
+ const f = h && r ? t : i;
754
+ return p && a.add(d), f.has(d) || f.add(d), d;
746
755
  },
747
756
  /**
748
757
  * Cancel the provided callback from running on the next frame.
@@ -770,15 +779,15 @@ function rs(n, e) {
770
779
  delta: 0,
771
780
  timestamp: 0,
772
781
  isProcessing: !1
773
- }, s = () => t = !0, a = ot.reduce((T, I) => (T[I] = ns(s), T), {}), { setup: o, read: l, resolveKeyframes: u, preUpdate: d, update: p, preRender: h, render: m, postRender: g } = a, b = () => {
782
+ }, s = () => t = !0, a = ot.reduce((T, I) => (T[I] = ns(s), T), {}), { setup: o, read: l, resolveKeyframes: u, preUpdate: d, update: p, preRender: h, render: m, postRender: f } = a, g = () => {
774
783
  const T = de.useManualTiming ? r.timestamp : performance.now();
775
- t = !1, de.useManualTiming || (r.delta = i ? 1e3 / 60 : Math.max(Math.min(T - r.timestamp, is), 1)), r.timestamp = T, r.isProcessing = !0, o.process(r), l.process(r), u.process(r), d.process(r), p.process(r), h.process(r), m.process(r), g.process(r), r.isProcessing = !1, t && e && (i = !1, n(b));
784
+ t = !1, de.useManualTiming || (r.delta = i ? 1e3 / 60 : Math.max(Math.min(T - r.timestamp, is), 1)), r.timestamp = T, r.isProcessing = !0, o.process(r), l.process(r), u.process(r), d.process(r), p.process(r), h.process(r), m.process(r), f.process(r), r.isProcessing = !1, t && e && (i = !1, n(g));
776
785
  }, v = () => {
777
- t = !0, i = !0, r.isProcessing || n(b);
786
+ t = !0, i = !0, r.isProcessing || n(g);
778
787
  };
779
788
  return { schedule: ot.reduce((T, I) => {
780
- const A = a[I];
781
- return T[I] = (D, C = !1, w = !1) => (t || v(), A.schedule(D, C, w)), T;
789
+ const L = a[I];
790
+ return T[I] = (D, k = !1, A = !1) => (t || v(), L.schedule(D, k, A)), T;
782
791
  }, {}), cancel: (T) => {
783
792
  for (let I = 0; I < ot.length; I++)
784
793
  a[ot[I]].cancel(T);
@@ -1351,11 +1360,11 @@ function Zs({ duration: n = B.duration, bounce: e = B.bounce, velocity: t = B.ve
1351
1360
  nt(n <= /* @__PURE__ */ ae(B.maxDuration), "Spring duration must be 10 seconds or less");
1352
1361
  let a = 1 - e;
1353
1362
  a = Ee(B.minDamping, B.maxDamping, a), n = Ee(B.minDuration, B.maxDuration, /* @__PURE__ */ le(n)), a < 1 ? (r = (u) => {
1354
- const d = u * a, p = d * n, h = d - t, m = Nt(u, a), g = Math.exp(-p);
1355
- return Lt - h / m * g;
1363
+ const d = u * a, p = d * n, h = d - t, m = Nt(u, a), f = Math.exp(-p);
1364
+ return Lt - h / m * f;
1356
1365
  }, s = (u) => {
1357
- const p = u * a * n, h = p * t + t, m = Math.pow(a, 2) * Math.pow(u, 2) * n, g = Math.exp(-p), b = Nt(Math.pow(u, 2), a);
1358
- return (-r(u) + Lt > 0 ? -1 : 1) * ((h - m) * g) / b;
1366
+ const p = u * a * n, h = p * t + t, m = Math.pow(a, 2) * Math.pow(u, 2) * n, f = Math.exp(-p), g = Nt(Math.pow(u, 2), a);
1367
+ return (-r(u) + Lt > 0 ? -1 : 1) * ((h - m) * f) / g;
1359
1368
  }) : (r = (u) => {
1360
1369
  const d = Math.exp(-u * n), p = (u - t) * n + 1;
1361
1370
  return -Lt + d * p;
@@ -1426,41 +1435,41 @@ function et(n = B.visualDuration, e = B.bounce) {
1426
1435
  let { restSpeed: i, restDelta: r } = t;
1427
1436
  const s = t.keyframes[0], a = t.keyframes[t.keyframes.length - 1], o = { done: !1, value: s }, { stiffness: l, damping: u, mass: d, duration: p, velocity: h, isResolvedFromDuration: m } = ta(M(y({}, t), {
1428
1437
  velocity: -/* @__PURE__ */ le(t.velocity || 0)
1429
- })), g = h || 0, b = u / (2 * Math.sqrt(l * d)), v = a - s, x = /* @__PURE__ */ le(Math.sqrt(l / d)), _ = Math.abs(v) < 5;
1430
- i || (i = _ ? B.restSpeed.granular : B.restSpeed.default), r || (r = _ ? B.restDelta.granular : B.restDelta.default);
1438
+ })), f = h || 0, g = u / (2 * Math.sqrt(l * d)), v = a - s, C = /* @__PURE__ */ le(Math.sqrt(l / d)), w = Math.abs(v) < 5;
1439
+ i || (i = w ? B.restSpeed.granular : B.restSpeed.default), r || (r = w ? B.restDelta.granular : B.restDelta.default);
1431
1440
  let T;
1432
- if (b < 1) {
1433
- const A = Nt(x, b);
1441
+ if (g < 1) {
1442
+ const L = Nt(C, g);
1434
1443
  T = (D) => {
1435
- const C = Math.exp(-b * x * D);
1436
- return a - C * ((g + b * x * v) / A * Math.sin(A * D) + v * Math.cos(A * D));
1444
+ const k = Math.exp(-g * C * D);
1445
+ return a - k * ((f + g * C * v) / L * Math.sin(L * D) + v * Math.cos(L * D));
1437
1446
  };
1438
- } else if (b === 1)
1439
- T = (A) => a - Math.exp(-x * A) * (v + (g + x * v) * A);
1447
+ } else if (g === 1)
1448
+ T = (L) => a - Math.exp(-C * L) * (v + (f + C * v) * L);
1440
1449
  else {
1441
- const A = x * Math.sqrt(b * b - 1);
1450
+ const L = C * Math.sqrt(g * g - 1);
1442
1451
  T = (D) => {
1443
- const C = Math.exp(-b * x * D), w = Math.min(A * D, 300);
1444
- return a - C * ((g + b * x * v) * Math.sinh(w) + A * v * Math.cosh(w)) / A;
1452
+ const k = Math.exp(-g * C * D), A = Math.min(L * D, 300);
1453
+ return a - k * ((f + g * C * v) * Math.sinh(A) + L * v * Math.cosh(A)) / L;
1445
1454
  };
1446
1455
  }
1447
1456
  const I = {
1448
1457
  calculatedDuration: m && p || null,
1449
- next: (A) => {
1450
- const D = T(A);
1458
+ next: (L) => {
1459
+ const D = T(L);
1451
1460
  if (m)
1452
- o.done = A >= p;
1461
+ o.done = L >= p;
1453
1462
  else {
1454
- let C = A === 0 ? g : 0;
1455
- b < 1 && (C = A === 0 ? /* @__PURE__ */ ae(g) : Oi(T, A, D));
1456
- const w = Math.abs(C) <= i, O = Math.abs(a - D) <= r;
1457
- o.done = w && O;
1463
+ let k = L === 0 ? f : 0;
1464
+ g < 1 && (k = L === 0 ? /* @__PURE__ */ ae(f) : Oi(T, L, D));
1465
+ const A = Math.abs(k) <= i, O = Math.abs(a - D) <= r;
1466
+ o.done = A && O;
1458
1467
  }
1459
1468
  return o.value = o.done ? a : D, o;
1460
1469
  },
1461
1470
  toString: () => {
1462
- const A = Math.min(tn(I), pt), D = Di((C) => I.next(A * C).value, A, 30);
1463
- return A + "ms " + D;
1471
+ const L = Math.min(tn(I), pt), D = Di((k) => I.next(L * k).value, L, 30);
1472
+ return L + "ms " + D;
1464
1473
  },
1465
1474
  toTransition: () => {
1466
1475
  }
@@ -1475,19 +1484,19 @@ function St({ keyframes: n, velocity: e = 0, power: t = 0.8, timeConstant: i = 3
1475
1484
  const p = n[0], h = {
1476
1485
  done: !1,
1477
1486
  value: p
1478
- }, m = (w) => o !== void 0 && w < o || l !== void 0 && w > l, g = (w) => o === void 0 ? l : l === void 0 || Math.abs(o - w) < Math.abs(l - w) ? o : l;
1479
- let b = t * e;
1480
- const v = p + b, x = a === void 0 ? v : a(v);
1481
- x !== v && (b = x - p);
1482
- const _ = (w) => -b * Math.exp(-w / i), T = (w) => x + _(w), I = (w) => {
1483
- const O = _(w), R = T(w);
1484
- h.done = Math.abs(O) <= u, h.value = h.done ? x : R;
1487
+ }, m = (A) => o !== void 0 && A < o || l !== void 0 && A > l, f = (A) => o === void 0 ? l : l === void 0 || Math.abs(o - A) < Math.abs(l - A) ? o : l;
1488
+ let g = t * e;
1489
+ const v = p + g, C = a === void 0 ? v : a(v);
1490
+ C !== v && (g = C - p);
1491
+ const w = (A) => -g * Math.exp(-A / i), T = (A) => C + w(A), I = (A) => {
1492
+ const O = w(A), R = T(A);
1493
+ h.done = Math.abs(O) <= u, h.value = h.done ? C : R;
1485
1494
  };
1486
- let A, D;
1487
- const C = (w) => {
1488
- m(h.value) && (A = w, D = et({
1489
- keyframes: [h.value, g(h.value)],
1490
- velocity: Oi(T, w, h.value),
1495
+ let L, D;
1496
+ const k = (A) => {
1497
+ m(h.value) && (L = A, D = et({
1498
+ keyframes: [h.value, f(h.value)],
1499
+ velocity: Oi(T, A, h.value),
1491
1500
  // TODO: This should be passing * 1000
1492
1501
  damping: r,
1493
1502
  stiffness: s,
@@ -1495,11 +1504,11 @@ function St({ keyframes: n, velocity: e = 0, power: t = 0.8, timeConstant: i = 3
1495
1504
  restSpeed: d
1496
1505
  }));
1497
1506
  };
1498
- return C(0), {
1507
+ return k(0), {
1499
1508
  calculatedDuration: null,
1500
- next: (w) => {
1509
+ next: (A) => {
1501
1510
  let O = !1;
1502
- return !D && A === void 0 && (O = !0, I(w), C(w)), A !== void 0 && w >= A ? D.next(w - A) : (!O && I(w), h);
1511
+ return !D && L === void 0 && (O = !0, I(A), k(A)), L !== void 0 && A >= L ? D.next(A - L) : (!O && I(A), h);
1503
1512
  }
1504
1513
  };
1505
1514
  }
@@ -1664,22 +1673,22 @@ class pn extends hn {
1664
1673
  const { generator: i, totalDuration: r, mixKeyframes: s, mirroredGenerator: a, resolvedDuration: o, calculatedDuration: l } = this;
1665
1674
  if (this.startTime === null)
1666
1675
  return i.next(0);
1667
- const { delay: u = 0, keyframes: d, repeat: p, repeatType: h, repeatDelay: m, type: g, onUpdate: b, finalKeyframe: v } = this.options;
1676
+ const { delay: u = 0, keyframes: d, repeat: p, repeatType: h, repeatDelay: m, type: f, onUpdate: g, finalKeyframe: v } = this.options;
1668
1677
  this.speed > 0 ? this.startTime = Math.min(this.startTime, e) : this.speed < 0 && (this.startTime = Math.min(e - r / this.speed, this.startTime)), t ? this.currentTime = e : this.updateTime(e);
1669
- const x = this.currentTime - u * (this.playbackSpeed >= 0 ? 1 : -1), _ = this.playbackSpeed >= 0 ? x < 0 : x > r;
1670
- this.currentTime = Math.max(x, 0), this.state === "finished" && this.holdTime === null && (this.currentTime = r);
1678
+ const C = this.currentTime - u * (this.playbackSpeed >= 0 ? 1 : -1), w = this.playbackSpeed >= 0 ? C < 0 : C > r;
1679
+ this.currentTime = Math.max(C, 0), this.state === "finished" && this.holdTime === null && (this.currentTime = r);
1671
1680
  let T = this.currentTime, I = i;
1672
1681
  if (p) {
1673
- const w = Math.min(this.currentTime, r) / o;
1674
- let O = Math.floor(w), R = w % 1;
1675
- !R && w >= 1 && (R = 1), R === 1 && O--, O = Math.min(O, p + 1), !!(O % 2) && (h === "reverse" ? (R = 1 - R, m && (R -= m / o)) : h === "mirror" && (I = a)), T = Ee(0, 1, R) * o;
1682
+ const A = Math.min(this.currentTime, r) / o;
1683
+ let O = Math.floor(A), R = A % 1;
1684
+ !R && A >= 1 && (R = 1), R === 1 && O--, O = Math.min(O, p + 1), !!(O % 2) && (h === "reverse" ? (R = 1 - R, m && (R -= m / o)) : h === "mirror" && (I = a)), T = Ee(0, 1, R) * o;
1676
1685
  }
1677
- const A = _ ? { done: !1, value: d[0] } : I.next(T);
1678
- s && (A.value = s(A.value));
1679
- let { done: D } = A;
1680
- !_ && l !== null && (D = this.playbackSpeed >= 0 ? this.currentTime >= r : this.currentTime <= 0);
1681
- const C = this.holdTime === null && (this.state === "finished" || this.state === "running" && D);
1682
- return C && g !== St && (A.value = un(d, this.options, v, this.speed)), b && b(A.value), C && this.finish(), A;
1686
+ const L = w ? { done: !1, value: d[0] } : I.next(T);
1687
+ s && (L.value = s(L.value));
1688
+ let { done: D } = L;
1689
+ !w && l !== null && (D = this.playbackSpeed >= 0 ? this.currentTime >= r : this.currentTime <= 0);
1690
+ const k = this.holdTime === null && (this.state === "finished" || this.state === "running" && D);
1691
+ return k && f !== St && (L.value = un(d, this.options, v, this.speed)), g && g(L.value), k && this.finish(), L;
1683
1692
  }
1684
1693
  /**
1685
1694
  * Allows the returned animation to be awaited or promise-chained. Currently
@@ -2143,10 +2152,10 @@ class Ka extends hn {
2143
2152
  var m = h, { autoplay: e = !0, delay: t = 0, type: i = "keyframes", repeat: r = 0, repeatDelay: s = 0, repeatType: a = "loop", keyframes: o, name: l, motionValue: u, element: d } = m, p = se(m, ["autoplay", "delay", "type", "repeat", "repeatDelay", "repeatType", "keyframes", "name", "motionValue", "element"]);
2144
2153
  var v;
2145
2154
  super(), this.stop = () => {
2146
- var x, _;
2147
- this._animation && (this._animation.stop(), (x = this.stopTimeline) == null || x.call(this)), (_ = this.keyframeResolver) == null || _.cancel();
2155
+ var C, w;
2156
+ this._animation && (this._animation.stop(), (C = this.stopTimeline) == null || C.call(this)), (w = this.keyframeResolver) == null || w.cancel();
2148
2157
  }, this.createdAt = ee.now();
2149
- const g = y({
2158
+ const f = y({
2150
2159
  autoplay: e,
2151
2160
  delay: t,
2152
2161
  type: i,
@@ -2156,8 +2165,8 @@ class Ka extends hn {
2156
2165
  name: l,
2157
2166
  motionValue: u,
2158
2167
  element: d
2159
- }, p), b = (d == null ? void 0 : d.KeyframeResolver) || mn;
2160
- this.keyframeResolver = new b(o, (x, _, T) => this.onKeyframesResolved(x, _, g, !T), l, u, d), (v = this.keyframeResolver) == null || v.scheduleResolve();
2168
+ }, p), g = (d == null ? void 0 : d.KeyframeResolver) || mn;
2169
+ this.keyframeResolver = new g(o, (C, w, T) => this.onKeyframesResolved(C, w, f, !T), l, u, d), (v = this.keyframeResolver) == null || v.scheduleResolve();
2161
2170
  }
2162
2171
  onKeyframesResolved(e, t, i, r) {
2163
2172
  this.keyframeResolver = void 0;
@@ -2273,25 +2282,25 @@ function Ya(n, e, { delay: t = 0, transitionOverride: i, type: r } = {}) {
2273
2282
  i && (s = i);
2274
2283
  const l = [], u = r && n.animationState && n.animationState.getState()[r];
2275
2284
  for (const h in o) {
2276
- const m = n.getValue(h, (p = n.latestValues[h]) != null ? p : null), g = o[h];
2277
- if (g === void 0 || u && qa(u, h))
2285
+ const m = n.getValue(h, (p = n.latestValues[h]) != null ? p : null), f = o[h];
2286
+ if (f === void 0 || u && qa(u, h))
2278
2287
  continue;
2279
- const b = y({
2288
+ const g = y({
2280
2289
  delay: t
2281
2290
  }, Ei(s || {}, h)), v = m.get();
2282
- if (v !== void 0 && !m.isAnimating && !Array.isArray(g) && g === v && !b.velocity)
2291
+ if (v !== void 0 && !m.isAnimating && !Array.isArray(f) && f === v && !g.velocity)
2283
2292
  continue;
2284
- let x = !1;
2293
+ let C = !1;
2285
2294
  if (window.MotionHandoffAnimation) {
2286
2295
  const T = fs(n);
2287
2296
  if (T) {
2288
2297
  const I = window.MotionHandoffAnimation(T, h, ue);
2289
- I !== null && (b.startTime = I, x = !0);
2298
+ I !== null && (g.startTime = I, C = !0);
2290
2299
  }
2291
2300
  }
2292
- hs(n, h), m.start(Ji(h, m, g, n.shouldReduceMotion && Xi.has(h) ? { type: !1 } : b, n, x));
2293
- const _ = m.animation;
2294
- _ && l.push(_);
2301
+ hs(n, h), m.start(Ji(h, m, f, n.shouldReduceMotion && Xi.has(h) ? { type: !1 } : g, n, C));
2302
+ const w = m.animation;
2303
+ w && l.push(w);
2295
2304
  }
2296
2305
  return a && Promise.all(l).then(() => {
2297
2306
  ue.update(() => {
@@ -2536,8 +2545,8 @@ class or {
2536
2545
  this.latestValues = l, this.baseTarget = y({}, l), this.initialValues = t.initial ? y({}, l) : {}, this.renderState = u, this.parent = e, this.props = t, this.presenceContext = i, this.depth = e ? e.depth + 1 : 0, this.reducedMotionConfig = r, this.options = o, this.blockInitialAnimation = !!s, this.isControllingVariants = er(t), this.isVariantNode = to(t), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(e && e.current);
2537
2546
  const h = this.scrapeMotionValuesFromProps(t, {}, this), { willChange: d } = h, p = se(h, ["willChange"]);
2538
2547
  for (const m in p) {
2539
- const g = p[m];
2540
- l[m] !== void 0 && J(g) && g.set(l[m], !1);
2548
+ const f = p[m];
2549
+ l[m] !== void 0 && J(f) && f.set(l[m], !1);
2541
2550
  }
2542
2551
  }
2543
2552
  mount(e) {
@@ -2972,14 +2981,14 @@ function Mo(n, p, l, u, d) {
2972
2981
  "pathSpacing",
2973
2982
  "pathOffset"
2974
2983
  ]);
2975
- var b, v;
2984
+ var g, v;
2976
2985
  if (ur(n, o, u), l) {
2977
2986
  n.style.viewBox && (n.attrs.viewBox = n.style.viewBox);
2978
2987
  return;
2979
2988
  }
2980
2989
  n.attrs = n.style, n.style = {};
2981
- const { attrs: m, style: g } = n;
2982
- m.transform && (g.transform = m.transform, delete m.transform), (g.transform || m.transformOrigin) && (g.transformOrigin = (b = m.transformOrigin) != null ? b : "50% 50%", delete m.transformOrigin), g.transform && (g.transformBox = (v = d == null ? void 0 : d.transformBox) != null ? v : "fill-box", delete m.transformBox), e !== void 0 && (m.x = e), t !== void 0 && (m.y = t), i !== void 0 && (m.scale = i), r !== void 0 && Io(m, r, s, a, !1);
2990
+ const { attrs: m, style: f } = n;
2991
+ m.transform && (f.transform = m.transform, delete m.transform), (f.transform || m.transformOrigin) && (f.transformOrigin = (g = m.transformOrigin) != null ? g : "50% 50%", delete m.transformOrigin), f.transform && (f.transformBox = (v = d == null ? void 0 : d.transformBox) != null ? v : "fill-box", delete m.transformBox), e !== void 0 && (m.x = e), t !== void 0 && (m.y = t), i !== void 0 && (m.scale = i), r !== void 0 && Io(m, r, s, a, !1);
2983
2992
  }
2984
2993
  const mr = /* @__PURE__ */ new Set([
2985
2994
  "baseFrequency",
@@ -3532,12 +3541,12 @@ function vl() {
3532
3541
  if (ni) return Ye;
3533
3542
  ni = 1;
3534
3543
  var n = Ye && Ye.__assign || function() {
3535
- return n = Object.assign || function(g) {
3536
- for (var b, v = 1, x = arguments.length; v < x; v++) {
3537
- b = arguments[v];
3538
- for (var _ in b) Object.prototype.hasOwnProperty.call(b, _) && (g[_] = b[_]);
3544
+ return n = Object.assign || function(f) {
3545
+ for (var g, v = 1, C = arguments.length; v < C; v++) {
3546
+ g = arguments[v];
3547
+ for (var w in g) Object.prototype.hasOwnProperty.call(g, w) && (f[w] = g[w]);
3539
3548
  }
3540
- return g;
3549
+ return f;
3541
3550
  }, n.apply(this, arguments);
3542
3551
  }, e = pl(), t = fl(), i = gl(), r = bl(), s = vr(), a = {}, o = {
3543
3552
  VISA: "visa",
@@ -3566,53 +3575,53 @@ function vl() {
3566
3575
  o.HIPER,
3567
3576
  o.HIPERCARD
3568
3577
  ], u = (0, s.clone)(l);
3569
- function d(g) {
3570
- return a[g] || e[g];
3578
+ function d(f) {
3579
+ return a[f] || e[f];
3571
3580
  }
3572
3581
  function p() {
3573
- return u.map(function(g) {
3574
- return (0, s.clone)(d(g));
3582
+ return u.map(function(f) {
3583
+ return (0, s.clone)(d(f));
3575
3584
  });
3576
3585
  }
3577
- function h(g, b) {
3578
- b === void 0 && (b = !1);
3579
- var v = u.indexOf(g);
3580
- if (!b && v === -1)
3581
- throw new Error('"' + g + '" is not a supported card type.');
3586
+ function h(f, g) {
3587
+ g === void 0 && (g = !1);
3588
+ var v = u.indexOf(f);
3589
+ if (!g && v === -1)
3590
+ throw new Error('"' + f + '" is not a supported card type.');
3582
3591
  return v;
3583
3592
  }
3584
- function m(g) {
3585
- var b = [];
3586
- if (!(0, i.isValidInputType)(g))
3587
- return b;
3588
- if (g.length === 0)
3593
+ function m(f) {
3594
+ var g = [];
3595
+ if (!(0, i.isValidInputType)(f))
3596
+ return g;
3597
+ if (f.length === 0)
3589
3598
  return p();
3590
- u.forEach(function(x) {
3591
- var _ = d(x);
3592
- (0, t.addMatchingCardsToResults)(g, _, b);
3599
+ u.forEach(function(C) {
3600
+ var w = d(C);
3601
+ (0, t.addMatchingCardsToResults)(f, w, g);
3593
3602
  });
3594
- var v = (0, r.findBestMatch)(b);
3595
- return v ? [v] : b;
3596
- }
3597
- return m.getTypeInfo = function(g) {
3598
- return (0, s.clone)(d(g));
3599
- }, m.removeCard = function(g) {
3600
- var b = h(g);
3601
- u.splice(b, 1);
3602
- }, m.addCard = function(g) {
3603
- var b = h(g.type, !0);
3604
- a[g.type] = g, b === -1 && u.push(g.type);
3605
- }, m.updateCard = function(g, b) {
3606
- var v = a[g] || e[g];
3603
+ var v = (0, r.findBestMatch)(g);
3604
+ return v ? [v] : g;
3605
+ }
3606
+ return m.getTypeInfo = function(f) {
3607
+ return (0, s.clone)(d(f));
3608
+ }, m.removeCard = function(f) {
3609
+ var g = h(f);
3610
+ u.splice(g, 1);
3611
+ }, m.addCard = function(f) {
3612
+ var g = h(f.type, !0);
3613
+ a[f.type] = f, g === -1 && u.push(f.type);
3614
+ }, m.updateCard = function(f, g) {
3615
+ var v = a[f] || e[f];
3607
3616
  if (!v)
3608
- throw new Error('"'.concat(g, "\" is not a recognized type. Use `addCard` instead.'"));
3609
- if (b.type && v.type !== b.type)
3617
+ throw new Error('"'.concat(f, "\" is not a recognized type. Use `addCard` instead.'"));
3618
+ if (g.type && v.type !== g.type)
3610
3619
  throw new Error("Cannot overwrite type parameter.");
3611
- var x = (0, s.clone)(v);
3612
- x = n(n({}, x), b), a[x.type] = x;
3613
- }, m.changeOrder = function(g, b) {
3614
- var v = h(g);
3615
- u.splice(v, 1), u.splice(b, 0, g);
3620
+ var C = (0, s.clone)(v);
3621
+ C = n(n({}, C), g), a[C.type] = C;
3622
+ }, m.changeOrder = function(f, g) {
3623
+ var v = h(f);
3624
+ u.splice(v, 1), u.splice(g, 0, f);
3616
3625
  }, m.resetModifications = function() {
3617
3626
  u = (0, s.clone)(l), a = {};
3618
3627
  }, m.types = o, Ye = m, Ye;
@@ -3766,7 +3775,7 @@ const gt = [
3766
3775
  }, Vl = (n) => {
3767
3776
  var e;
3768
3777
  return n ? typeof n.amount != "number" ? (console.error("Transaction amount is missing or invalid for Google Pay"), null) : n.currency ? n.country ? n.merchant_id ? n.checkout_config && !((e = n.checkout_config) == null ? void 0 : e.find(
3769
- ({ is_active: i, type: r }) => i && r === k.GOOGLE_PAY
3778
+ ({ is_active: i, type: r }) => i && r === x.GOOGLE_PAY
3770
3779
  )) ? null : {
3771
3780
  amount: n.amount,
3772
3781
  currency: n.currency,
@@ -3777,7 +3786,7 @@ const gt = [
3777
3786
  }, Il = (n) => {
3778
3787
  var e, t;
3779
3788
  return n ? typeof n.amount != "number" ? (console.error("Transaction amount is missing or invalid for Apple Pay"), null) : n.currency ? n.country ? n.merchant_id ? n.checkout_config && !((e = n.checkout_config) == null ? void 0 : e.find(
3780
- ({ is_active: r, type: s }) => r && s === k.APPLE_PAY
3789
+ ({ is_active: r, type: s }) => r && s === x.APPLE_PAY
3781
3790
  )) ? null : {
3782
3791
  amount: n.amount,
3783
3792
  currency: n.currency,
@@ -3938,145 +3947,145 @@ var Ge = {};
3938
3947
  var ai;
3939
3948
  function Nl() {
3940
3949
  return ai || (ai = 1, process.env.NODE_ENV !== "production" && function() {
3941
- function n(f) {
3942
- if (f == null) return null;
3943
- if (typeof f == "function")
3944
- return f.$$typeof === R ? null : f.displayName || f.name || null;
3945
- if (typeof f == "string") return f;
3946
- switch (f) {
3947
- case b:
3950
+ function n(b) {
3951
+ if (b == null) return null;
3952
+ if (typeof b == "function")
3953
+ return b.$$typeof === R ? null : b.displayName || b.name || null;
3954
+ if (typeof b == "string") return b;
3955
+ switch (b) {
3956
+ case g:
3948
3957
  return "Fragment";
3949
- case x:
3958
+ case C:
3950
3959
  return "Profiler";
3951
3960
  case v:
3952
3961
  return "StrictMode";
3953
- case A:
3962
+ case L:
3954
3963
  return "Suspense";
3955
3964
  case D:
3956
3965
  return "SuspenseList";
3957
3966
  case O:
3958
3967
  return "Activity";
3959
3968
  }
3960
- if (typeof f == "object")
3961
- switch (typeof f.tag == "number" && console.error(
3969
+ if (typeof b == "object")
3970
+ switch (typeof b.tag == "number" && console.error(
3962
3971
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
3963
- ), f.$$typeof) {
3964
- case g:
3972
+ ), b.$$typeof) {
3973
+ case f:
3965
3974
  return "Portal";
3966
3975
  case T:
3967
- return (f.displayName || "Context") + ".Provider";
3968
- case _:
3969
- return (f._context.displayName || "Context") + ".Consumer";
3970
- case I:
3971
- var P = f.render;
3972
- return f = f.displayName, f || (f = P.displayName || P.name || "", f = f !== "" ? "ForwardRef(" + f + ")" : "ForwardRef"), f;
3973
- case C:
3974
- return P = f.displayName || null, P !== null ? P : n(f.type) || "Memo";
3976
+ return (b.displayName || "Context") + ".Provider";
3975
3977
  case w:
3976
- P = f._payload, f = f._init;
3978
+ return (b._context.displayName || "Context") + ".Consumer";
3979
+ case I:
3980
+ var P = b.render;
3981
+ return b = b.displayName, b || (b = P.displayName || P.name || "", b = b !== "" ? "ForwardRef(" + b + ")" : "ForwardRef"), b;
3982
+ case k:
3983
+ return P = b.displayName || null, P !== null ? P : n(b.type) || "Memo";
3984
+ case A:
3985
+ P = b._payload, b = b._init;
3977
3986
  try {
3978
- return n(f(P));
3987
+ return n(b(P));
3979
3988
  } catch (N) {
3980
3989
  }
3981
3990
  }
3982
3991
  return null;
3983
3992
  }
3984
- function e(f) {
3985
- return "" + f;
3993
+ function e(b) {
3994
+ return "" + b;
3986
3995
  }
3987
- function t(f) {
3996
+ function t(b) {
3988
3997
  try {
3989
- e(f);
3998
+ e(b);
3990
3999
  var P = !1;
3991
4000
  } catch (ie) {
3992
4001
  P = !0;
3993
4002
  }
3994
4003
  if (P) {
3995
4004
  P = console;
3996
- var N = P.error, Y = typeof Symbol == "function" && Symbol.toStringTag && f[Symbol.toStringTag] || f.constructor.name || "Object";
4005
+ var N = P.error, Y = typeof Symbol == "function" && Symbol.toStringTag && b[Symbol.toStringTag] || b.constructor.name || "Object";
3997
4006
  return N.call(
3998
4007
  P,
3999
4008
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
4000
4009
  Y
4001
- ), e(f);
4010
+ ), e(b);
4002
4011
  }
4003
4012
  }
4004
- function i(f) {
4005
- if (f === b) return "<>";
4006
- if (typeof f == "object" && f !== null && f.$$typeof === w)
4013
+ function i(b) {
4014
+ if (b === g) return "<>";
4015
+ if (typeof b == "object" && b !== null && b.$$typeof === A)
4007
4016
  return "<...>";
4008
4017
  try {
4009
- var P = n(f);
4018
+ var P = n(b);
4010
4019
  return P ? "<" + P + ">" : "<...>";
4011
4020
  } catch (N) {
4012
4021
  return "<...>";
4013
4022
  }
4014
4023
  }
4015
4024
  function r() {
4016
- var f = K.A;
4017
- return f === null ? null : f.getOwner();
4025
+ var b = K.A;
4026
+ return b === null ? null : b.getOwner();
4018
4027
  }
4019
4028
  function s() {
4020
4029
  return Error("react-stack-top-frame");
4021
4030
  }
4022
- function a(f) {
4023
- if (Te.call(f, "key")) {
4024
- var P = Object.getOwnPropertyDescriptor(f, "key").get;
4031
+ function a(b) {
4032
+ if (Te.call(b, "key")) {
4033
+ var P = Object.getOwnPropertyDescriptor(b, "key").get;
4025
4034
  if (P && P.isReactWarning) return !1;
4026
4035
  }
4027
- return f.key !== void 0;
4036
+ return b.key !== void 0;
4028
4037
  }
4029
- function o(f, P) {
4038
+ function o(b, P) {
4030
4039
  function N() {
4031
4040
  he || (he = !0, console.error(
4032
4041
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
4033
4042
  P
4034
4043
  ));
4035
4044
  }
4036
- N.isReactWarning = !0, Object.defineProperty(f, "key", {
4045
+ N.isReactWarning = !0, Object.defineProperty(b, "key", {
4037
4046
  get: N,
4038
4047
  configurable: !0
4039
4048
  });
4040
4049
  }
4041
4050
  function l() {
4042
- var f = n(this.type);
4043
- return kt[f] || (kt[f] = !0, console.error(
4051
+ var b = n(this.type);
4052
+ return kt[b] || (kt[b] = !0, console.error(
4044
4053
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
4045
- )), f = this.props.ref, f !== void 0 ? f : null;
4054
+ )), b = this.props.ref, b !== void 0 ? b : null;
4046
4055
  }
4047
- function u(f, P, N, Y, ie, X, Ae, Le) {
4048
- return N = X.ref, f = {
4056
+ function u(b, P, N, Y, ie, X, Ae, Le) {
4057
+ return N = X.ref, b = {
4049
4058
  $$typeof: m,
4050
- type: f,
4059
+ type: b,
4051
4060
  key: P,
4052
4061
  props: X,
4053
4062
  _owner: ie
4054
- }, (N !== void 0 ? N : null) !== null ? Object.defineProperty(f, "ref", {
4063
+ }, (N !== void 0 ? N : null) !== null ? Object.defineProperty(b, "ref", {
4055
4064
  enumerable: !1,
4056
4065
  get: l
4057
- }) : Object.defineProperty(f, "ref", { enumerable: !1, value: null }), f._store = {}, Object.defineProperty(f._store, "validated", {
4066
+ }) : Object.defineProperty(b, "ref", { enumerable: !1, value: null }), b._store = {}, Object.defineProperty(b._store, "validated", {
4058
4067
  configurable: !1,
4059
4068
  enumerable: !1,
4060
4069
  writable: !0,
4061
4070
  value: 0
4062
- }), Object.defineProperty(f, "_debugInfo", {
4071
+ }), Object.defineProperty(b, "_debugInfo", {
4063
4072
  configurable: !1,
4064
4073
  enumerable: !1,
4065
4074
  writable: !0,
4066
4075
  value: null
4067
- }), Object.defineProperty(f, "_debugStack", {
4076
+ }), Object.defineProperty(b, "_debugStack", {
4068
4077
  configurable: !1,
4069
4078
  enumerable: !1,
4070
4079
  writable: !0,
4071
4080
  value: Ae
4072
- }), Object.defineProperty(f, "_debugTask", {
4081
+ }), Object.defineProperty(b, "_debugTask", {
4073
4082
  configurable: !1,
4074
4083
  enumerable: !1,
4075
4084
  writable: !0,
4076
4085
  value: Le
4077
- }), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
4086
+ }), Object.freeze && (Object.freeze(b.props), Object.freeze(b)), b;
4078
4087
  }
4079
- function d(f, P, N, Y, ie, X, Ae, Le) {
4088
+ function d(b, P, N, Y, ie, X, Ae, Le) {
4080
4089
  var z = P.children;
4081
4090
  if (z !== void 0)
4082
4091
  if (Y)
@@ -4090,7 +4099,7 @@ function Nl() {
4090
4099
  );
4091
4100
  else p(z);
4092
4101
  if (Te.call(P, "key")) {
4093
- z = n(f);
4102
+ z = n(b);
4094
4103
  var re = Object.keys(P).filter(function(ge) {
4095
4104
  return ge !== "key";
4096
4105
  });
@@ -4114,9 +4123,9 @@ React keys must be passed directly to JSX without using spread:
4114
4123
  } else N = P;
4115
4124
  return z && o(
4116
4125
  N,
4117
- typeof f == "function" ? f.displayName || f.name || "Unknown" : f
4126
+ typeof b == "function" ? b.displayName || b.name || "Unknown" : b
4118
4127
  ), u(
4119
- f,
4128
+ b,
4120
4129
  z,
4121
4130
  X,
4122
4131
  ie,
@@ -4126,44 +4135,44 @@ React keys must be passed directly to JSX without using spread:
4126
4135
  Le
4127
4136
  );
4128
4137
  }
4129
- function p(f) {
4130
- typeof f == "object" && f !== null && f.$$typeof === m && f._store && (f._store.validated = 1);
4138
+ function p(b) {
4139
+ typeof b == "object" && b !== null && b.$$typeof === m && b._store && (b._store.validated = 1);
4131
4140
  }
4132
- var h = Er, m = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), x = Symbol.for("react.profiler"), _ = Symbol.for("react.consumer"), T = Symbol.for("react.context"), I = Symbol.for("react.forward_ref"), A = Symbol.for("react.suspense"), D = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), O = Symbol.for("react.activity"), R = Symbol.for("react.client.reference"), K = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Te = Object.prototype.hasOwnProperty, te = Array.isArray, fe = console.createTask ? console.createTask : function() {
4141
+ var h = Er, m = Symbol.for("react.transitional.element"), f = Symbol.for("react.portal"), g = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), C = Symbol.for("react.profiler"), w = Symbol.for("react.consumer"), T = Symbol.for("react.context"), I = Symbol.for("react.forward_ref"), L = Symbol.for("react.suspense"), D = Symbol.for("react.suspense_list"), k = Symbol.for("react.memo"), A = Symbol.for("react.lazy"), O = Symbol.for("react.activity"), R = Symbol.for("react.client.reference"), K = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Te = Object.prototype.hasOwnProperty, te = Array.isArray, fe = console.createTask ? console.createTask : function() {
4133
4142
  return null;
4134
4143
  };
4135
4144
  h = {
4136
- react_stack_bottom_frame: function(f) {
4137
- return f();
4145
+ react_stack_bottom_frame: function(b) {
4146
+ return b();
4138
4147
  }
4139
4148
  };
4140
4149
  var he, kt = {}, xt = h.react_stack_bottom_frame.bind(
4141
4150
  h,
4142
4151
  s
4143
4152
  )(), st = fe(i(s)), ne = {};
4144
- Ge.Fragment = b, Ge.jsx = function(f, P, N, Y, ie) {
4153
+ Ge.Fragment = g, Ge.jsx = function(b, P, N, Y, ie) {
4145
4154
  var X = 1e4 > K.recentlyCreatedOwnerStacks++;
4146
4155
  return d(
4147
- f,
4156
+ b,
4148
4157
  P,
4149
4158
  N,
4150
4159
  !1,
4151
4160
  Y,
4152
4161
  ie,
4153
4162
  X ? Error("react-stack-top-frame") : xt,
4154
- X ? fe(i(f)) : st
4163
+ X ? fe(i(b)) : st
4155
4164
  );
4156
- }, Ge.jsxs = function(f, P, N, Y, ie) {
4165
+ }, Ge.jsxs = function(b, P, N, Y, ie) {
4157
4166
  var X = 1e4 > K.recentlyCreatedOwnerStacks++;
4158
4167
  return d(
4159
- f,
4168
+ b,
4160
4169
  P,
4161
4170
  N,
4162
4171
  !0,
4163
4172
  Y,
4164
4173
  ie,
4165
4174
  X ? Error("react-stack-top-frame") : xt,
4166
- X ? fe(i(f)) : st
4175
+ X ? fe(i(b)) : st
4167
4176
  );
4168
4177
  };
4169
4178
  }()), Ge;
@@ -4211,7 +4220,7 @@ class jl {
4211
4220
  return;
4212
4221
  }
4213
4222
  const o = this.config.state.translate.messages();
4214
- a != null && a.toLowerCase().includes("cancelled") ? (l = e.onCancel) == null || l.call(e) : (bt(a, o), (u = e.onError) == null || u.call(e, { e: a, paymentMethod: k.APPLE_PAY }));
4223
+ a != null && a.toLowerCase().includes("cancelled") ? (l = e.onCancel) == null || l.call(e) : (bt(a, o), (u = e.onError) == null || u.call(e, { e: a, paymentMethod: x.APPLE_PAY }));
4215
4224
  },
4216
4225
  onSuccess: (a) => {
4217
4226
  var o;
@@ -4237,11 +4246,11 @@ class jl {
4237
4246
  }
4238
4247
  }
4239
4248
  const Bl = [
4240
- { type: k.PAYPAL, is_active: !1, order: 1 },
4241
- { type: k.APPLE_PAY, is_active: !1, order: 2 },
4242
- { type: k.GOOGLE_PAY, is_active: !1, order: 3 },
4243
- { type: k.VENMO, is_active: !1, order: 4 },
4244
- { type: k.CARD, is_active: !0, order: 5 }
4249
+ { type: x.PAYPAL, is_active: !1, order: 1 },
4250
+ { type: x.APPLE_PAY, is_active: !1, order: 2 },
4251
+ { type: x.GOOGLE_PAY, is_active: !1, order: 3 },
4252
+ { type: x.VENMO, is_active: !1, order: 4 },
4253
+ { type: x.CARD, is_active: !0, order: 5 }
4245
4254
  ], _e = {
4246
4255
  open: { y: 0, opacity: 1 },
4247
4256
  close: { y: 100, opacity: 0 },
@@ -4287,7 +4296,7 @@ class Kl {
4287
4296
  console.error("Google Pay error:", a);
4288
4297
  return;
4289
4298
  }
4290
- bt(a, this.config.state.translate.messages()), (o = e.onError) == null || o.call(e, { e: a, paymentMethod: k.GOOGLE_PAY });
4299
+ bt(a, this.config.state.translate.messages()), (o = e.onError) == null || o.call(e, { e: a, paymentMethod: x.GOOGLE_PAY });
4291
4300
  },
4292
4301
  onSuccess: (a) => {
4293
4302
  var o;
@@ -4363,7 +4372,7 @@ class Hl {
4363
4372
  console.error("PayPal error:", l);
4364
4373
  return;
4365
4374
  }
4366
- !this.isUserCancellationError(l) && l ? (d = e.onError) == null || d.call(e, { e: l, paymentMethod: k.PAYPAL }) : (p = e.onCancel) == null || p.call(e);
4375
+ !this.isUserCancellationError(l) && l ? (d = e.onError) == null || d.call(e, { e: l, paymentMethod: x.PAYPAL }) : (p = e.onCancel) == null || p.call(e);
4367
4376
  },
4368
4377
  onCancel: () => {
4369
4378
  var l;
@@ -4379,7 +4388,7 @@ class Hl {
4379
4388
  createBillingAgreement: r,
4380
4389
  onApprove: (u) => E(this, [u], function* ({ billingToken: l }) {
4381
4390
  var d;
4382
- this.events.onPaymentAttempt.emit(k.PAYPAL), (d = s == null ? void 0 : s.onSuccess) == null || d.call(s, l || "");
4391
+ this.events.onPaymentAttempt.emit(x.PAYPAL), (d = s == null ? void 0 : s.onSuccess) == null || d.call(s, l || "");
4383
4392
  }),
4384
4393
  style: (o = this.customButtonStyles) == null ? void 0 : o.styles,
4385
4394
  onCancel: () => {
@@ -4549,7 +4558,7 @@ class nc {
4549
4558
  // handle venmo errors
4550
4559
  handleVenmoError(e, t) {
4551
4560
  var i, r, s;
4552
- this.isInitialized && ((i = e == null ? void 0 : e.message) != null && i.toLowerCase().includes("close") ? (r = t == null ? void 0 : t.onCancel) == null || r.call(t) : (s = t == null ? void 0 : t.onError) == null || s.call(t, { e, paymentMethod: k.VENMO }));
4561
+ this.isInitialized && ((i = e == null ? void 0 : e.message) != null && i.toLowerCase().includes("close") ? (r = t == null ? void 0 : t.onCancel) == null || r.call(t) : (s = t == null ? void 0 : t.onError) == null || s.call(t, { e, paymentMethod: x.VENMO }));
4553
4562
  }
4554
4563
  // add event listener
4555
4564
  addEventListener(e, t) {
@@ -4599,13 +4608,13 @@ class ic {
4599
4608
  try {
4600
4609
  if (yield this.applePay.init({
4601
4610
  onError: (i) => {
4602
- this.events.error.emit(i), console.log("Apple Pay error:", i.e), e == null || e.remove(), this.attempted.delete(k.APPLE_PAY);
4611
+ this.events.error.emit(i), console.log("Apple Pay error:", i.e), e == null || e.remove(), this.attempted.delete(x.APPLE_PAY);
4603
4612
  },
4604
4613
  onCancel: () => {
4605
- this.events.cancel.emit(), this.attempted.delete(k.APPLE_PAY);
4614
+ this.events.cancel.emit(), this.attempted.delete(x.APPLE_PAY);
4606
4615
  },
4607
4616
  onSuccess: (i) => {
4608
- this.events.success.emit(M(y({}, i), { type: "apple" })), this.attempted.delete(k.APPLE_PAY);
4617
+ this.events.success.emit(M(y({}, i), { type: "apple" })), this.attempted.delete(x.APPLE_PAY);
4609
4618
  }
4610
4619
  })) {
4611
4620
  const i = this.applePay.render();
@@ -4628,13 +4637,13 @@ class ic {
4628
4637
  try {
4629
4638
  if (yield this.googlePay.init({
4630
4639
  onError: (i) => {
4631
- this.events.error.emit(i), e == null || e.remove(), this.attempted.delete(k.GOOGLE_PAY);
4640
+ this.events.error.emit(i), e == null || e.remove(), this.attempted.delete(x.GOOGLE_PAY);
4632
4641
  },
4633
4642
  onCancel: () => {
4634
- this.events.cancel.emit(), this.attempted.delete(k.GOOGLE_PAY);
4643
+ this.events.cancel.emit(), this.attempted.delete(x.GOOGLE_PAY);
4635
4644
  },
4636
4645
  onSuccess: (i) => {
4637
- this.events.success.emit(M(y({}, i), { type: "google" })), this.attempted.delete(k.GOOGLE_PAY);
4646
+ this.events.success.emit(M(y({}, i), { type: "google" })), this.attempted.delete(x.GOOGLE_PAY);
4638
4647
  }
4639
4648
  })) {
4640
4649
  const i = this.googlePay.render();
@@ -4658,13 +4667,13 @@ class ic {
4658
4667
  const t = this.paypal.render();
4659
4668
  e == null || e.appendChild(t), (yield this.paypal.init({
4660
4669
  onError: (r) => {
4661
- this.events.error.emit(r), this.attempted.delete(k.PAYPAL);
4670
+ this.events.error.emit(r), this.attempted.delete(x.PAYPAL);
4662
4671
  },
4663
4672
  onCancel: () => {
4664
- this.events.cancel.emit(), this.attempted.delete(k.PAYPAL);
4673
+ this.events.cancel.emit(), this.attempted.delete(x.PAYPAL);
4665
4674
  },
4666
4675
  onSuccess: (r) => {
4667
- this.events.success.emit({ paypalId: r, type: "paypal" }), this.attempted.delete(k.PAYPAL);
4676
+ this.events.success.emit({ paypalId: r, type: "paypal" }), this.attempted.delete(x.PAYPAL);
4668
4677
  }
4669
4678
  })) || e == null || e.remove();
4670
4679
  } catch (t) {
@@ -4683,11 +4692,11 @@ class ic {
4683
4692
  try {
4684
4693
  if (yield this.braintree.init({
4685
4694
  onError: (i) => {
4686
- this.events.onPaymentAttempt.emit(k.VENMO), this.events.error.emit(i), e == null || e.remove();
4695
+ this.events.onPaymentAttempt.emit(x.VENMO), this.events.error.emit(i), e == null || e.remove();
4687
4696
  },
4688
4697
  onCancel: () => this.events.cancel.emit(),
4689
4698
  onSuccess: (i) => {
4690
- this.events.onPaymentAttempt.emit(k.VENMO), this.events.success.emit({ nonce: i == null ? void 0 : i.nonce, type: "venmo" });
4699
+ this.events.onPaymentAttempt.emit(x.VENMO), this.events.success.emit({ nonce: i == null ? void 0 : i.nonce, type: "venmo" });
4691
4700
  }
4692
4701
  })) {
4693
4702
  const i = this.braintree.render();
@@ -4714,7 +4723,7 @@ class ic {
4714
4723
  return E(this, null, function* () {
4715
4724
  const e = this.config.state.transaction.getState(), t = Zl(Bl, (e == null ? void 0 : e.checkout_config) || [], (a, o) => a.type === o.type), i = this.config.state.checkout.getState();
4716
4725
  let r = t.filter(({ is_active: a }) => a);
4717
- (i == null ? void 0 : i.variant) === "default" && (r = r.filter(({ type: a }) => a !== k.CARD));
4726
+ (i == null ? void 0 : i.variant) === "default" && (r = r.filter(({ type: a }) => a !== x.CARD));
4718
4727
  const s = this.initializeButtonInstances(r);
4719
4728
  Promise.all(s).then(() => {
4720
4729
  this.handleOnFormLoaded();
@@ -4723,14 +4732,14 @@ class ic {
4723
4732
  }
4724
4733
  // initialize button instances
4725
4734
  initializeButtonInstances(e) {
4726
- const t = e.map(({ type: p }) => p), i = t.includes(k.APPLE_PAY), r = t.includes(k.GOOGLE_PAY), s = t.includes(k.PAYPAL), a = t.includes(k.VENMO), o = t.includes(k.CARD);
4735
+ const t = e.map(({ type: p }) => p), i = t.includes(x.APPLE_PAY), r = t.includes(x.GOOGLE_PAY), s = t.includes(x.PAYPAL), a = t.includes(x.VENMO), o = t.includes(x.CARD);
4727
4736
  i && !this.applePay && (this.applePay = new jl(this.config)), r && !this.googlePay && (this.googlePay = new Kl(this.config)), s && !this.paypal && (this.paypal = new Hl(this.config), this.paypal.addEventListener("onPaymentAttempt", (p) => this.events.onPaymentAttempt.emit(p))), a && !this.braintree && (this.braintree = new nc(this.config)), o && !this.card && (this.card = new Wl(this.config), this.card.addEventListener(() => {
4728
4737
  this.events.open.emit();
4729
4738
  }));
4730
4739
  const l = e.filter(({ type: p }) => {
4731
- var b, v, x, _, T, I;
4732
- const h = navigator, m = (x = (v = (b = h == null ? void 0 : h.userAgentData) == null ? void 0 : b.platform) == null ? void 0 : v.toLowerCase()) == null ? void 0 : x.includes("android"), g = (I = (T = (_ = h == null ? void 0 : h.userAgentData) == null ? void 0 : _.platform) == null ? void 0 : T.toLowerCase()) == null ? void 0 : I.includes("windows");
4733
- return !(p === k.APPLE_PAY && (m || g));
4740
+ var g, v, C, w, T, I;
4741
+ const h = navigator, m = (C = (v = (g = h == null ? void 0 : h.userAgentData) == null ? void 0 : g.platform) == null ? void 0 : v.toLowerCase()) == null ? void 0 : C.includes("android"), f = (I = (T = (w = h == null ? void 0 : h.userAgentData) == null ? void 0 : w.platform) == null ? void 0 : T.toLowerCase()) == null ? void 0 : I.includes("windows");
4742
+ return !(p === x.APPLE_PAY && (m || f));
4734
4743
  }).sort((p, h) => p.order - h.order), u = /* @__PURE__ */ new Map();
4735
4744
  for (const { type: p } of l) {
4736
4745
  const h = document.createElement("div");
@@ -4738,15 +4747,15 @@ class ic {
4738
4747
  }
4739
4748
  return l.map(({ type: p }) => {
4740
4749
  const h = u.get(p);
4741
- if (p === k.APPLE_PAY && this.applePay)
4750
+ if (p === x.APPLE_PAY && this.applePay)
4742
4751
  return this.initApple(h);
4743
- if (p === k.GOOGLE_PAY && this.googlePay)
4752
+ if (p === x.GOOGLE_PAY && this.googlePay)
4744
4753
  return this.initGoogle(h);
4745
- if (p === k.PAYPAL && this.paypal)
4754
+ if (p === x.PAYPAL && this.paypal)
4746
4755
  return this.initPayPal(h);
4747
- if (p === k.VENMO && this.braintree)
4756
+ if (p === x.VENMO && this.braintree)
4748
4757
  return this.initBraintreeVenmo(h);
4749
- if (p === k.CARD && this.card)
4758
+ if (p === x.CARD && this.card)
4750
4759
  return this.initCard(h);
4751
4760
  throw new Error("Unknown button type");
4752
4761
  });
@@ -4898,8 +4907,8 @@ class Tc {
4898
4907
  var r, s, a, o, l, u, d, p, h;
4899
4908
  const i = e.messages();
4900
4909
  if (this.element = document.createElement("div"), this.element.classList.add($.wrapper), this.inputContainer.classList.add($.inputContainer), (r = t == null ? void 0 : t.container) != null && r.className && F(this.inputContainer, t.container.className), (s = t == null ? void 0 : t.container) != null && s.styles && Object.assign(this.inputContainer.style, t.container.styles), this.input.setAttribute("id", this.id), this.input.setAttribute("autocomplete", "cc-name"), this.input.setAttribute("placeholder", i.card.name.placeholder), this.input.classList.add($.input), (a = t == null ? void 0 : t.field) != null && a.className && F(this.input, t.field.className), (o = t == null ? void 0 : t.field) != null && o.styles && Object.assign(this.input.style, t.field.styles), (l = t == null ? void 0 : t.placeholder) != null && l.styles && Object.keys(t.placeholder.styles).length) {
4901
- const m = (b) => b.replace(/[A-Z]/g, (v) => "-" + v.toLowerCase()), g = Object.entries(t.placeholder.styles).map(([b, v]) => `${m(b)}:${v};`).join("");
4902
- this.placeholderStyle.textContent = `#${this.id}::placeholder{${g}}`, this.element.appendChild(this.placeholderStyle);
4910
+ const m = (g) => g.replace(/[A-Z]/g, (v) => "-" + v.toLowerCase()), f = Object.entries(t.placeholder.styles).map(([g, v]) => `${m(g)}:${v};`).join("");
4911
+ this.placeholderStyle.textContent = `#${this.id}::placeholder{${f}}`, this.element.appendChild(this.placeholderStyle);
4903
4912
  }
4904
4913
  this.endContent.classList.add($.hidden), this.endContent.appendChild(this.warning.render()), this.inputContainer.append(this.input, this.endContent), this.label.setAttribute("for", this.id), this.label.classList.add($.label), (u = t == null ? void 0 : t.label) != null && u.className && F(this.label, t.label.className), (d = t == null ? void 0 : t.label) != null && d.styles && Object.assign(this.label.style, t.label.styles), this.labelText.textContent = i.card.name.label, this.labelError.textContent = i.card.required, this.labelError.classList.add($.labelError, $.hidden), (p = t == null ? void 0 : t.error) != null && p.className && F(this.labelError, t.error.className), (h = t == null ? void 0 : t.error) != null && h.styles && Object.assign(this.labelError.style, t.error.styles), this.label.append(this.labelText, this.labelError), this.element.append(this.label, this.inputContainer), this.input.addEventListener("input", () => this.handleChange(this.input.value)), this.input.addEventListener("paste", () => this.handleChange(this.input.value)), this.input.addEventListener("blur", () => this.validate(this.input.value)), e.subscribe(({ messages: m }) => {
4905
4914
  this.input.setAttribute("placeholder", m.card.name.placeholder), this.labelText.textContent = m.card.name.label, this.labelError.textContent = m.card.required;
@@ -5104,25 +5113,25 @@ class Bc {
5104
5113
  this.translate = e;
5105
5114
  const i = e.messages();
5106
5115
  if (this.element = document.createElement("div"), this.element.classList.add(j.wrapper), this.inputContainer.classList.add(j.inputContainer), (r = t == null ? void 0 : t.container) != null && r.className && F(this.inputContainer, t.container.className), (s = t == null ? void 0 : t.container) != null && s.styles && Object.assign(this.inputContainer.style, t.container.styles), this.input.setAttribute("id", this.id), this.input.setAttribute("autocomplete", "cc-number"), this.input.setAttribute("placeholder", "1234 1234 1234 1234"), this.input.setAttribute("inputmode", "numeric"), this.input.setAttribute("pattern", "[0-9]*"), this.input.setAttribute("enterkeyhint", "done"), this.input.classList.add(j.input), (a = t == null ? void 0 : t.field) != null && a.className && F(this.input, t.field.className), (o = t == null ? void 0 : t.field) != null && o.styles && Object.assign(this.input.style, t.field.styles), (l = t == null ? void 0 : t.placeholder) != null && l.styles && Object.keys(t.placeholder.styles).length) {
5107
- const m = (v) => v.replace(/[A-Z]/g, (x) => "-" + x.toLowerCase()), g = Object.entries(t.placeholder.styles).map(([v, x]) => `${m(v)}:${x} !important;`).join(""), b = `#${this.id}`;
5108
- this.placeholderStyle.textContent = `${b}::placeholder{${g}}
5109
- ${b}::-webkit-input-placeholder{${g}}
5110
- ${b}::-moz-placeholder{${g}}
5111
- ${b}:-ms-input-placeholder{${g}}
5112
- ${b}::-ms-input-placeholder{${g}}
5116
+ const m = (v) => v.replace(/[A-Z]/g, (C) => "-" + C.toLowerCase()), f = Object.entries(t.placeholder.styles).map(([v, C]) => `${m(v)}:${C} !important;`).join(""), g = `#${this.id}`;
5117
+ this.placeholderStyle.textContent = `${g}::placeholder{${f}}
5118
+ ${g}::-webkit-input-placeholder{${f}}
5119
+ ${g}::-moz-placeholder{${f}}
5120
+ ${g}:-ms-input-placeholder{${f}}
5121
+ ${g}::-ms-input-placeholder{${f}}
5113
5122
  `, document.head.appendChild(this.placeholderStyle);
5114
5123
  }
5115
5124
  this.endContent.classList.add(j.endContent), this.endContent.append(...this.getCardIcons()), this.inputContainer.append(this.input, this.endContent), this.label.setAttribute("for", this.id), this.label.classList.add(j.label), (u = t == null ? void 0 : t.label) != null && u.className && F(this.label, t.label.className), (d = t == null ? void 0 : t.label) != null && d.styles && Object.assign(this.label.style, t.label.styles), this.labelText.textContent = i.card.number.label, this.labelError.textContent = i.card.required, this.labelError.classList.add(j.labelError, j.hidden), (p = t == null ? void 0 : t.error) != null && p.className && F(this.labelError, t.error.className), (h = t == null ? void 0 : t.error) != null && h.styles && Object.assign(this.labelError.style, t.error.styles), this.label.append(this.labelText, this.labelError), this.error.classList.add(j.error, j.hidden), this.element.append(this.label, this.inputContainer, this.error), this.input.addEventListener("keydown", (m) => {
5116
5125
  this.isDisabled || ["Backspace", "Delete", "Tab", "ArrowLeft", "ArrowRight", "Home", "End"].includes(m.key) || m.ctrlKey || m.metaKey || /^\d$/.test(m.key) || m.preventDefault();
5117
5126
  }), this.input.addEventListener("input", (m) => {
5118
5127
  m.stopPropagation();
5119
- const b = this.input.value.replace(/\D/g, "");
5120
- this.handleChange(b);
5128
+ const g = this.input.value.replace(/\D/g, "");
5129
+ this.handleChange(g);
5121
5130
  }), this.input.addEventListener("paste", (m) => {
5122
5131
  var v;
5123
5132
  m.preventDefault();
5124
- const b = (((v = m.clipboardData) == null ? void 0 : v.getData("text")) || "").replace(/\D/g, "");
5125
- this.handleChange(b);
5133
+ const g = (((v = m.clipboardData) == null ? void 0 : v.getData("text")) || "").replace(/\D/g, "");
5134
+ this.handleChange(g);
5126
5135
  }), this.input.addEventListener("blur", () => this.validate(this.input.value)), this.translate.subscribe(({ messages: m }) => {
5127
5136
  this.labelText.textContent = m.card.number.label, this.labelError.textContent = m.card.required, this.render();
5128
5137
  });
@@ -5192,7 +5201,7 @@ ${b}::-ms-input-placeholder{${g}}
5192
5201
  return this.toggleLabelError(t), this.toggleErrorMessage(i), !t && !i ? (this.inputContainer.classList.remove(j.errorInput), this.endContent.innerHTML = "", this.endContent.append(...this.getCardIcons())) : (this.endContent.innerHTML = "", this.endContent.appendChild(this.unknownCard.render())), this.isDisabled ? (this.inputContainer.classList.add(j.disabled), this.input.classList.add(j.disabledInput)) : (this.inputContainer.classList.remove(j.disabled), this.input.classList.remove(j.disabledInput)), this.element;
5193
5202
  }
5194
5203
  }
5195
- const zc = "_inputContainer_41zd2_5", $c = "_disabled_41zd2_23", Kc = "_input_41zd2_5", qc = "_endContent_41zd2_39", Yc = "_errorInput_41zd2_18", Hc = "_error_41zd2_18", Gc = "_label_41zd2_56", Uc = "_labelError_41zd2_67", Wc = "_disabledInput_41zd2_75", Zc = "_hidden_41zd2_82", Jc = "_securityContent_41zd2_86", L = {
5204
+ const zc = "_inputContainer_41zd2_5", $c = "_disabled_41zd2_23", Kc = "_input_41zd2_5", qc = "_endContent_41zd2_39", Yc = "_errorInput_41zd2_18", Hc = "_error_41zd2_18", Gc = "_label_41zd2_56", Uc = "_labelError_41zd2_67", Wc = "_disabledInput_41zd2_75", Zc = "_hidden_41zd2_82", Jc = "_securityContent_41zd2_86", _ = {
5196
5205
  inputContainer: zc,
5197
5206
  disabled: $c,
5198
5207
  input: Kc,
@@ -5270,16 +5279,16 @@ class Qc {
5270
5279
  expiryChange: new q(),
5271
5280
  cvcChange: new q()
5272
5281
  });
5273
- var a, o, l, u, d, p, h, m, g, b, v, x, _, T, I, A, D;
5282
+ var a, o, l, u, d, p, h, m, f, g, v, C, w, T, I, L, D;
5274
5283
  this.translate = e;
5275
5284
  const i = e.messages();
5276
- this.element = document.createElement("div"), this.element.classList.add(L.securityContent), this.expiryInputContainer.classList.add(L.inputContainer), (a = t == null ? void 0 : t.container) != null && a.className && F(this.expiryInputContainer, t.container.className), (o = t == null ? void 0 : t.container) != null && o.styles && Object.assign(this.expiryInputContainer.style, t.container.styles), this.expiryInput.setAttribute("id", this.expiryId), this.expiryInput.setAttribute("autocomplete", "cc-exp"), this.expiryInput.setAttribute("placeholder", i.card.expiry.placeholder), this.expiryInput.setAttribute("inputmode", "numeric"), this.expiryInput.setAttribute("pattern", "[0-9]*"), this.expiryInput.setAttribute("enterkeyhint", "next"), this.expiryInput.classList.add(L.input), (l = t == null ? void 0 : t.field) != null && l.className && F(this.expiryInput, t.field.className), (u = t == null ? void 0 : t.field) != null && u.styles && Object.assign(this.expiryInput.style, t.field.styles), this.expiryEndContent.classList.add(L.endContent), this.expiryEndContent.appendChild(this.expiryWarning.render()), this.expiryInputContainer.append(this.expiryInput, this.expiryEndContent), this.expiryLabel.setAttribute("for", this.expiryId), this.expiryLabel.classList.add(L.label), (d = t == null ? void 0 : t.label) != null && d.className && F(this.expiryLabel, t.label.className), (p = t == null ? void 0 : t.label) != null && p.styles && Object.assign(this.expiryLabel.style, t.label.styles), this.expiryLabelText.contentEditable = "false", this.expiryLabelText.textContent = i.card.expiry.label, this.expiryLabelError.textContent = i.card.required, this.expiryLabelError.classList.add(L.labelError, L.hidden), this.expiryLabel.append(this.expiryLabelText, this.expiryLabelError), this.expiryError.classList.add(L.error, L.hidden), (h = t == null ? void 0 : t.error) != null && h.className && F(this.expiryError, t.error.className), (m = t == null ? void 0 : t.error) != null && m.styles && Object.assign(this.expiryError.style, t.error.styles);
5285
+ this.element = document.createElement("div"), this.element.classList.add(_.securityContent), this.expiryInputContainer.classList.add(_.inputContainer), (a = t == null ? void 0 : t.container) != null && a.className && F(this.expiryInputContainer, t.container.className), (o = t == null ? void 0 : t.container) != null && o.styles && Object.assign(this.expiryInputContainer.style, t.container.styles), this.expiryInput.setAttribute("id", this.expiryId), this.expiryInput.setAttribute("autocomplete", "cc-exp"), this.expiryInput.setAttribute("placeholder", i.card.expiry.placeholder), this.expiryInput.setAttribute("inputmode", "numeric"), this.expiryInput.setAttribute("pattern", "[0-9]*"), this.expiryInput.setAttribute("enterkeyhint", "next"), this.expiryInput.classList.add(_.input), (l = t == null ? void 0 : t.field) != null && l.className && F(this.expiryInput, t.field.className), (u = t == null ? void 0 : t.field) != null && u.styles && Object.assign(this.expiryInput.style, t.field.styles), this.expiryEndContent.classList.add(_.endContent), this.expiryEndContent.appendChild(this.expiryWarning.render()), this.expiryInputContainer.append(this.expiryInput, this.expiryEndContent), this.expiryLabel.setAttribute("for", this.expiryId), this.expiryLabel.classList.add(_.label), (d = t == null ? void 0 : t.label) != null && d.className && F(this.expiryLabel, t.label.className), (p = t == null ? void 0 : t.label) != null && p.styles && Object.assign(this.expiryLabel.style, t.label.styles), this.expiryLabelText.contentEditable = "false", this.expiryLabelText.textContent = i.card.expiry.label, this.expiryLabelError.textContent = i.card.required, this.expiryLabelError.classList.add(_.labelError, _.hidden), this.expiryLabel.append(this.expiryLabelText, this.expiryLabelError), this.expiryError.classList.add(_.error, _.hidden), (h = t == null ? void 0 : t.error) != null && h.className && F(this.expiryError, t.error.className), (m = t == null ? void 0 : t.error) != null && m.styles && Object.assign(this.expiryError.style, t.error.styles);
5277
5286
  const r = document.createElement("div");
5278
- if (r.appendChild(this.expiryError), this.cvcInputContainer.classList.add(L.inputContainer), (g = t == null ? void 0 : t.container) != null && g.className && F(this.cvcInputContainer, t.container.className), (b = t == null ? void 0 : t.container) != null && b.styles && Object.assign(this.cvcInputContainer.style, t.container.styles), this.cvcInput.setAttribute("id", this.cvcId), this.cvcInput.setAttribute("autocomplete", "cc-csc"), this.cvcInput.setAttribute("placeholder", i.card.cvc.placeholder), this.cvcInput.setAttribute("inputmode", "numeric"), this.cvcInput.setAttribute("pattern", "[0-9]*"), this.cvcInput.setAttribute("enterkeyhint", "done"), this.cvcInput.classList.add(L.input), (v = t == null ? void 0 : t.field) != null && v.className && F(this.cvcInput, t.field.className), (x = t == null ? void 0 : t.field) != null && x.styles && Object.assign(this.cvcInput.style, t.field.styles), (_ = t == null ? void 0 : t.placeholder) != null && _.styles && Object.keys(t.placeholder.styles).length) {
5279
- const C = (O) => O.replace(/[A-Z]/g, (R) => "-" + R.toLowerCase()), w = Object.entries(t.placeholder.styles).map(([O, R]) => `${C(O)}:${R};`).join("");
5280
- this.placeholderStyle.textContent = `#${this.expiryId}::placeholder{${w}}#${this.cvcId}::placeholder{${w}}`, this.element.appendChild(this.placeholderStyle);
5287
+ if (r.appendChild(this.expiryError), this.cvcInputContainer.classList.add(_.inputContainer), (f = t == null ? void 0 : t.container) != null && f.className && F(this.cvcInputContainer, t.container.className), (g = t == null ? void 0 : t.container) != null && g.styles && Object.assign(this.cvcInputContainer.style, t.container.styles), this.cvcInput.setAttribute("id", this.cvcId), this.cvcInput.setAttribute("autocomplete", "cc-csc"), this.cvcInput.setAttribute("placeholder", i.card.cvc.placeholder), this.cvcInput.setAttribute("inputmode", "numeric"), this.cvcInput.setAttribute("pattern", "[0-9]*"), this.cvcInput.setAttribute("enterkeyhint", "done"), this.cvcInput.classList.add(_.input), (v = t == null ? void 0 : t.field) != null && v.className && F(this.cvcInput, t.field.className), (C = t == null ? void 0 : t.field) != null && C.styles && Object.assign(this.cvcInput.style, t.field.styles), (w = t == null ? void 0 : t.placeholder) != null && w.styles && Object.keys(t.placeholder.styles).length) {
5288
+ const k = (O) => O.replace(/[A-Z]/g, (R) => "-" + R.toLowerCase()), A = Object.entries(t.placeholder.styles).map(([O, R]) => `${k(O)}:${R};`).join("");
5289
+ this.placeholderStyle.textContent = `#${this.expiryId}::placeholder{${A}}#${this.cvcId}::placeholder{${A}}`, this.element.appendChild(this.placeholderStyle);
5281
5290
  }
5282
- this.cvcEndContent.classList.add(L.endContent), this.cvcEndContent.appendChild(this.cardCvc.render()), this.cvcInputContainer.append(this.cvcInput, this.cvcEndContent), this.cvcLabel.setAttribute("for", this.cvcId), this.cvcLabel.classList.add(L.label), (T = t == null ? void 0 : t.label) != null && T.className && F(this.cvcLabel, t.label.className), (I = t == null ? void 0 : t.label) != null && I.styles && Object.assign(this.cvcLabel.style, t.label.styles), this.cvcLabelText.textContent = i.card.cvc.label, this.cvcLabelError.textContent = i.card.required, this.cvcLabelError.classList.add(L.labelError, L.hidden), (A = t == null ? void 0 : t.error) != null && A.className && F(this.cvcLabel, t.error.className), (D = t == null ? void 0 : t.error) != null && D.styles && Object.assign(this.cvcLabelError.style, t.error.styles), this.cvcLabel.append(this.cvcLabelText, this.cvcLabelError), this.cvcError.classList.add(L.error, L.hidden);
5291
+ this.cvcEndContent.classList.add(_.endContent), this.cvcEndContent.appendChild(this.cardCvc.render()), this.cvcInputContainer.append(this.cvcInput, this.cvcEndContent), this.cvcLabel.setAttribute("for", this.cvcId), this.cvcLabel.classList.add(_.label), (T = t == null ? void 0 : t.label) != null && T.className && F(this.cvcLabel, t.label.className), (I = t == null ? void 0 : t.label) != null && I.styles && Object.assign(this.cvcLabel.style, t.label.styles), this.cvcLabelText.textContent = i.card.cvc.label, this.cvcLabelError.textContent = i.card.required, this.cvcLabelError.classList.add(_.labelError, _.hidden), (L = t == null ? void 0 : t.error) != null && L.className && F(this.cvcLabel, t.error.className), (D = t == null ? void 0 : t.error) != null && D.styles && Object.assign(this.cvcLabelError.style, t.error.styles), this.cvcLabel.append(this.cvcLabelText, this.cvcLabelError), this.cvcError.classList.add(_.error, _.hidden);
5283
5292
  const s = document.createElement("div");
5284
5293
  s.appendChild(this.cvcError), this.element.append(
5285
5294
  this.expiryLabel,
@@ -5288,30 +5297,30 @@ class Qc {
5288
5297
  this.cvcInputContainer,
5289
5298
  r,
5290
5299
  s
5291
- ), this.expiryInput.addEventListener("input", (C) => {
5292
- C.preventDefault();
5300
+ ), this.expiryInput.addEventListener("input", (k) => {
5301
+ k.preventDefault();
5293
5302
  const O = this.expiryInput.value.replace(/\D/g, "");
5294
5303
  this.handleExpiryChange(O);
5295
- }), this.expiryInput.addEventListener("paste", (C) => {
5304
+ }), this.expiryInput.addEventListener("paste", (k) => {
5296
5305
  var R;
5297
- C.preventDefault();
5298
- const O = (((R = C.clipboardData) == null ? void 0 : R.getData("text")) || "").replace(/\D/g, "");
5306
+ k.preventDefault();
5307
+ const O = (((R = k.clipboardData) == null ? void 0 : R.getData("text")) || "").replace(/\D/g, "");
5299
5308
  this.handleExpiryChange(O);
5300
- }), this.expiryInput.addEventListener("keydown", (C) => {
5301
- this.isDisabled || ["Backspace", "Delete", "Tab", "ArrowLeft", "ArrowRight", "Home", "End"].includes(C.key) || C.ctrlKey || C.metaKey || /^\d$/.test(C.key) || C.preventDefault();
5302
- }), this.expiryInput.addEventListener("blur", () => this.validateExpiry(this.expiryInput.value)), this.cvcInput.addEventListener("input", (C) => {
5303
- C.preventDefault();
5309
+ }), this.expiryInput.addEventListener("keydown", (k) => {
5310
+ this.isDisabled || ["Backspace", "Delete", "Tab", "ArrowLeft", "ArrowRight", "Home", "End"].includes(k.key) || k.ctrlKey || k.metaKey || /^\d$/.test(k.key) || k.preventDefault();
5311
+ }), this.expiryInput.addEventListener("blur", () => this.validateExpiry(this.expiryInput.value)), this.cvcInput.addEventListener("input", (k) => {
5312
+ k.preventDefault();
5304
5313
  const O = this.cvcInput.value.replace(/\D/g, "");
5305
5314
  this.handleCvcChange(O);
5306
- }), this.cvcInput.addEventListener("paste", (C) => {
5315
+ }), this.cvcInput.addEventListener("paste", (k) => {
5307
5316
  var R;
5308
- C.preventDefault();
5309
- const O = (((R = C.clipboardData) == null ? void 0 : R.getData("text")) || "").replace(/\D/g, "");
5317
+ k.preventDefault();
5318
+ const O = (((R = k.clipboardData) == null ? void 0 : R.getData("text")) || "").replace(/\D/g, "");
5310
5319
  this.handleCvcChange(O);
5311
- }), this.cvcInput.addEventListener("keydown", (C) => {
5312
- this.isDisabled || ["Backspace", "Delete", "Tab", "ArrowLeft", "ArrowRight", "Home", "End"].includes(C.key) || C.ctrlKey || C.metaKey || /^\d$/.test(C.key) || C.preventDefault();
5313
- }), this.cvcInput.addEventListener("blur", () => this.validateCvc(this.cvcInput.value)), this.translate.subscribe(({ messages: C }) => {
5314
- this.cvcInput.setAttribute("placeholder", C.card.cvc.placeholder), this.expiryInput.setAttribute("placeholder", C.card.expiry.placeholder), this.expiryLabelText.textContent = C.card.expiry.label, this.cvcLabelText.textContent = C.card.cvc.label, this.expiryLabelError.textContent = C.card.required, this.cvcLabelError.textContent = C.card.required, this.render();
5320
+ }), this.cvcInput.addEventListener("keydown", (k) => {
5321
+ this.isDisabled || ["Backspace", "Delete", "Tab", "ArrowLeft", "ArrowRight", "Home", "End"].includes(k.key) || k.ctrlKey || k.metaKey || /^\d$/.test(k.key) || k.preventDefault();
5322
+ }), this.cvcInput.addEventListener("blur", () => this.validateCvc(this.cvcInput.value)), this.translate.subscribe(({ messages: k }) => {
5323
+ this.cvcInput.setAttribute("placeholder", k.card.cvc.placeholder), this.expiryInput.setAttribute("placeholder", k.card.expiry.placeholder), this.expiryLabelText.textContent = k.card.expiry.label, this.cvcLabelText.textContent = k.card.cvc.label, this.expiryLabelError.textContent = k.card.required, this.cvcLabelError.textContent = k.card.required, this.render();
5315
5324
  });
5316
5325
  }
5317
5326
  cvcValidator(e) {
@@ -5334,19 +5343,19 @@ class Qc {
5334
5343
  toggleCvcLabelError(e) {
5335
5344
  return E(this, null, function* () {
5336
5345
  if (e) {
5337
- this.cvcInputContainer.classList.add(L.errorInput), this.cvcLabelError.classList.remove(L.hidden), yield H(this.cvcLabelError, W.open, W.transition);
5346
+ this.cvcInputContainer.classList.add(_.errorInput), this.cvcLabelError.classList.remove(_.hidden), yield H(this.cvcLabelError, W.open, W.transition);
5338
5347
  return;
5339
5348
  }
5340
- yield H(this.cvcLabelError, W.close, W.transition), this.cvcLabelError.classList.add(L.hidden);
5349
+ yield H(this.cvcLabelError, W.close, W.transition), this.cvcLabelError.classList.add(_.hidden);
5341
5350
  });
5342
5351
  }
5343
5352
  toggleCvcErrorMessage(e) {
5344
5353
  return E(this, null, function* () {
5345
5354
  if (e) {
5346
- this.cvcInputContainer.classList.add(L.errorInput), this.cvcError.textContent = this.cvcErrorMessage, this.cvcError.classList.remove(L.hidden), yield H(this.cvcError, Q.open, Q.transition);
5355
+ this.cvcInputContainer.classList.add(_.errorInput), this.cvcError.textContent = this.cvcErrorMessage, this.cvcError.classList.remove(_.hidden), yield H(this.cvcError, Q.open, Q.transition);
5347
5356
  return;
5348
5357
  }
5349
- yield H(this.cvcError, Q.close, Q.transition), this.cvcError.classList.add(L.hidden);
5358
+ yield H(this.cvcError, Q.close, Q.transition), this.cvcError.classList.add(_.hidden);
5350
5359
  });
5351
5360
  }
5352
5361
  expiryValidator(e) {
@@ -5385,20 +5394,20 @@ class Qc {
5385
5394
  toggleExpiryLabelError(e) {
5386
5395
  return E(this, null, function* () {
5387
5396
  if (e) {
5388
- this.expiryInputContainer.classList.add(L.errorInput), this.expiryLabelError.classList.remove(L.hidden), yield H(this.expiryLabelError, W.open, W.transition);
5397
+ this.expiryInputContainer.classList.add(_.errorInput), this.expiryLabelError.classList.remove(_.hidden), yield H(this.expiryLabelError, W.open, W.transition);
5389
5398
  return;
5390
5399
  }
5391
- yield H(this.expiryLabelError, W.close, W.transition), this.expiryLabelError.classList.add(L.hidden);
5400
+ yield H(this.expiryLabelError, W.close, W.transition), this.expiryLabelError.classList.add(_.hidden);
5392
5401
  });
5393
5402
  }
5394
5403
  // toggle expiry error message
5395
5404
  toggleExpiryErrorMessage(e) {
5396
5405
  return E(this, null, function* () {
5397
5406
  if (e) {
5398
- this.expiryInputContainer.classList.add(L.errorInput), this.expiryError.textContent = this.expiryErrorMessage, this.expiryError.classList.remove(L.hidden), yield H(this.expiryError, Q.open, Q.transition);
5407
+ this.expiryInputContainer.classList.add(_.errorInput), this.expiryError.textContent = this.expiryErrorMessage, this.expiryError.classList.remove(_.hidden), yield H(this.expiryError, Q.open, Q.transition);
5399
5408
  return;
5400
5409
  }
5401
- yield H(this.expiryError, Q.close, Q.transition), this.expiryError.classList.add(L.hidden);
5410
+ yield H(this.expiryError, Q.close, Q.transition), this.expiryError.classList.add(_.hidden);
5402
5411
  });
5403
5412
  }
5404
5413
  // add event listener
@@ -5407,7 +5416,7 @@ class Qc {
5407
5416
  }
5408
5417
  // disable
5409
5418
  disable(e) {
5410
- e ? (this.expiryInput.setAttribute("disabled", "true"), this.expiryInput.classList.add(L.disabledInput), this.expiryInputContainer.classList.add(L.disabled), this.cvcInput.setAttribute("disabled", "true"), this.cvcInput.classList.add(L.disabledInput), this.cvcInputContainer.classList.add(L.disabled)) : (this.expiryInput.removeAttribute("disabled"), this.expiryInput.classList.remove(L.disabledInput), this.expiryInputContainer.classList.remove(L.disabled), this.cvcInput.removeAttribute("disabled"), this.cvcInput.classList.remove(L.disabledInput), this.cvcInputContainer.classList.remove(L.disabled));
5419
+ e ? (this.expiryInput.setAttribute("disabled", "true"), this.expiryInput.classList.add(_.disabledInput), this.expiryInputContainer.classList.add(_.disabled), this.cvcInput.setAttribute("disabled", "true"), this.cvcInput.classList.add(_.disabledInput), this.cvcInputContainer.classList.add(_.disabled)) : (this.expiryInput.removeAttribute("disabled"), this.expiryInput.classList.remove(_.disabledInput), this.expiryInputContainer.classList.remove(_.disabled), this.cvcInput.removeAttribute("disabled"), this.cvcInput.classList.remove(_.disabledInput), this.cvcInputContainer.classList.remove(_.disabled));
5411
5420
  }
5412
5421
  // touch submit
5413
5422
  touchSubmit() {
@@ -5432,9 +5441,9 @@ class Qc {
5432
5441
  // render
5433
5442
  render() {
5434
5443
  const e = this.isTouchSubmit || this.isExpiryChanged, t = e && !this.isDisabled && this.isExpiryRequired, i = e && !this.isDisabled && !!this.expiryErrorMessage;
5435
- this.toggleExpiryLabelError(t), this.toggleExpiryErrorMessage(i), !t && !i ? (this.expiryInputContainer.classList.remove(L.errorInput), this.expiryEndContent.classList.add(L.hidden)) : this.expiryEndContent.classList.remove(L.hidden);
5444
+ this.toggleExpiryLabelError(t), this.toggleExpiryErrorMessage(i), !t && !i ? (this.expiryInputContainer.classList.remove(_.errorInput), this.expiryEndContent.classList.add(_.hidden)) : this.expiryEndContent.classList.remove(_.hidden);
5436
5445
  const r = this.isTouchSubmit || this.isCvcChanged, s = r && !this.isDisabled && this.isCvcRequired, a = r && !this.isDisabled && !!this.cvcErrorMessage;
5437
- return this.toggleCvcLabelError(s), this.toggleCvcErrorMessage(a), !s && !a ? (this.cvcInputContainer.classList.remove(L.errorInput), this.cvcEndContent.innerHTML = "", this.cvcEndContent.appendChild(this.cardCvc.render())) : (this.cvcEndContent.innerHTML = "", this.cvcEndContent.appendChild(this.cvcWarning.render())), this.isDisabled ? (this.expiryInputContainer.classList.add(L.disabled), this.expiryInput.classList.add(L.disabledInput), this.cvcInputContainer.classList.add(L.disabled), this.cvcInput.classList.add(L.disabledInput)) : (this.expiryInputContainer.classList.remove(L.disabled), this.expiryInput.classList.remove(L.disabledInput), this.cvcInputContainer.classList.remove(L.disabled), this.cvcInput.classList.remove(L.disabledInput)), this.element;
5446
+ return this.toggleCvcLabelError(s), this.toggleCvcErrorMessage(a), !s && !a ? (this.cvcInputContainer.classList.remove(_.errorInput), this.cvcEndContent.innerHTML = "", this.cvcEndContent.appendChild(this.cardCvc.render())) : (this.cvcEndContent.innerHTML = "", this.cvcEndContent.appendChild(this.cvcWarning.render())), this.isDisabled ? (this.expiryInputContainer.classList.add(_.disabled), this.expiryInput.classList.add(_.disabledInput), this.cvcInputContainer.classList.add(_.disabled), this.cvcInput.classList.add(_.disabledInput)) : (this.expiryInputContainer.classList.remove(_.disabled), this.expiryInput.classList.remove(_.disabledInput), this.cvcInputContainer.classList.remove(_.disabled), this.cvcInput.classList.remove(_.disabledInput)), this.element;
5438
5447
  }
5439
5448
  }
5440
5449
  class ed {
@@ -5467,7 +5476,7 @@ class ed {
5467
5476
  var m;
5468
5477
  l.preventDefault();
5469
5478
  const { cvc: u, expiry: d } = this.cardSecurity.value(), { value: p, cardType: h } = this.number.value();
5470
- this.touchSubmit(), this.validate() && ((m = this.onPaymentAttempt) == null || m.call(this, { paymentMethod: k.CARD }), this.events.submit.emit({
5479
+ this.touchSubmit(), this.validate() && ((m = this.onPaymentAttempt) == null || m.call(this, { paymentMethod: x.CARD }), this.events.submit.emit({
5471
5480
  number: p,
5472
5481
  expiry: d,
5473
5482
  cvc: u,
@@ -5714,7 +5723,7 @@ class od {
5714
5723
  cardBrand: e.cardBrand || "",
5715
5724
  number: a,
5716
5725
  cvc: o,
5717
- type: k.CARD,
5726
+ type: x.CARD,
5718
5727
  metadata: {
5719
5728
  name: e.name,
5720
5729
  userAgent: navigator == null ? void 0 : navigator.userAgent
@@ -5759,7 +5768,7 @@ class od {
5759
5768
  }
5760
5769
  yield this.showSuccess(), this.setLoading(!1);
5761
5770
  } catch (o) {
5762
- const l = e.card ? k.CARD : e.applePay ? k.APPLE_PAY : e.googlePay ? k.GOOGLE_PAY : e.paypal ? k.PAYPAL : e.braintree ? k.VENMO : k.CARD;
5771
+ const l = e.card ? x.CARD : e.applePay ? x.APPLE_PAY : e.googlePay ? x.GOOGLE_PAY : e.paypal ? x.PAYPAL : e.braintree ? x.VENMO : x.CARD;
5763
5772
  return this.handleError({
5764
5773
  status: "sdk_failed",
5765
5774
  status_reason: {
@@ -5827,25 +5836,41 @@ class ld {
5827
5836
  init() {
5828
5837
  return E(this, null, function* () {
5829
5838
  const { checkout: e, transaction: t, translate: i, styles: r } = this.config.state, { apiVersion: s } = e.getState();
5830
- e.subscribe(({ clientToken: a, environment: o, locale: l, translate: u, styles: d }) => {
5831
- const p = Cn.teamId, h = Cn.appIds[o];
5832
- this.config.service.ev.preloadEvervault({ teamId: p, appId: h }).finally(), l && i.locale() !== l && i.setLocale(l), u && i.overrides() !== u && i.setMessages(u), d && r.setState(d), t.updateTransaction(a, o, s).then((m) => {
5833
- if (!m)
5834
- throw new Error("Payment config not found");
5835
- return this.config.service.ev.initEv({ teamId: p, appId: h });
5836
- }).catch((m) => {
5837
- if (console.error(m), this.component) {
5838
- const g = i.messages(), b = m.name === "INVALID_SESSION" ? g.status.invalidSession : m.message;
5839
- this.component.showError(b);
5839
+ e.subscribe((p) => E(this, [p], function* ({ clientToken: a, environment: o, locale: l, translate: u, styles: d }) {
5840
+ var f, g, v;
5841
+ const h = Cn.teamId, m = Cn.appIds[o];
5842
+ l && i.locale() !== l && i.setLocale(l), u && i.overrides() !== u && i.setMessages(u), d && r.setState(d);
5843
+ try {
5844
+ if (!a) {
5845
+ const w = new Error("INVALID_SESSION");
5846
+ throw w.name = "INVALID_SESSION", w;
5840
5847
  }
5841
- });
5842
- });
5848
+ this.config.service.ev.preloadEvervault({ teamId: h, appId: m });
5849
+ const C = yield t.updateTransaction(a, o, s);
5850
+ if (C != null && C.error) {
5851
+ const w = new Error("INVALID_SESSION");
5852
+ throw w.name = "INVALID_SESSION", w;
5853
+ }
5854
+ return yield this.config.service.ev.initEv({ teamId: h, appId: m });
5855
+ } catch (C) {
5856
+ console.error(C);
5857
+ const w = i.messages(), T = (C == null ? void 0 : C.name) === "INVALID_SESSION" ? (f = w == null ? void 0 : w.status) == null ? void 0 : f.invalidSession : C == null ? void 0 : C.message;
5858
+ (v = (g = this.component) == null ? void 0 : g.showError) == null || v.call(g, T);
5859
+ }
5860
+ }));
5843
5861
  });
5844
5862
  }
5845
5863
  // mount
5846
5864
  mount() {
5847
5865
  return E(this, null, function* () {
5848
- return this.component || (this.component = new od(this.config)), yield this.init(), yield this.component.init(), this.component.render();
5866
+ var e, t, i;
5867
+ this.component || (this.component = new od(this.config));
5868
+ try {
5869
+ yield this.init(), yield this.component.init();
5870
+ } catch (r) {
5871
+ console.error("Failed to mount checkout component:", r), (t = (e = this.component) == null ? void 0 : e.showError) == null || t.call(e, r == null ? void 0 : r.message);
5872
+ }
5873
+ return (i = this.component) == null ? void 0 : i.render();
5849
5874
  });
5850
5875
  }
5851
5876
  }
@@ -5894,7 +5919,8 @@ class pd extends Ct {
5894
5919
  // update transaction
5895
5920
  updateTransaction(t, i, r) {
5896
5921
  return E(this, null, function* () {
5897
- if (this.clientToken === t) return this.getState();
5922
+ if (this.clientToken === t)
5923
+ return this.getState();
5898
5924
  this.clientToken = t;
5899
5925
  try {
5900
5926
  const s = yield Or(t, i, r);
@@ -7709,6 +7735,6 @@ class su {
7709
7735
  export {
7710
7736
  su as Core,
7711
7737
  nu as PayNextCheckout,
7712
- k as PaymentMethod
7738
+ x as PaymentMethod
7713
7739
  };
7714
7740
  //# sourceMappingURL=index.es.js.map