@one-payments/web-components 1.1.19 → 1.1.20

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.
Files changed (2) hide show
  1. package/dist/index.js +60 -73
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -638,11 +638,7 @@ var ln = class {
638
638
  * Start polling for payment status
639
639
  */
640
640
  start() {
641
- if (this.isPolling) {
642
- console.warn("Polling already in progress");
643
- return;
644
- }
645
- this.isPolling = !0, this.attempts = 0, this.startTime = this.adapters.timer.now(), this.scheduleNextPoll();
641
+ this.isPolling || (this.isPolling = !0, this.attempts = 0, this.startTime = this.adapters.timer.now(), this.scheduleNextPoll());
646
642
  }
647
643
  /**
648
644
  * Stop polling
@@ -1149,11 +1145,7 @@ var cn = class {
1149
1145
  * @public
1150
1146
  */
1151
1147
  resumePolling() {
1152
- if (!this.paymentToken) {
1153
- console.warn("Cannot resume polling: no payment token available");
1154
- return;
1155
- }
1156
- this.ignore3DSInPolling = !0, this.ignoreQRInPolling = !0, this.startPolling();
1148
+ this.paymentToken && (this.ignore3DSInPolling = !0, this.ignoreQRInPolling = !0, this.startPolling());
1157
1149
  }
1158
1150
  /**
1159
1151
  * Destroy the SDK instance and clean up all resources
@@ -1189,11 +1181,7 @@ var cn = class {
1189
1181
  * Start polling for payment status
1190
1182
  */
1191
1183
  startPolling() {
1192
- if (!this.paymentToken) {
1193
- console.warn("Cannot start polling: no payment token available");
1194
- return;
1195
- }
1196
- this.stopPolling(), this.pollingService = new ln(
1184
+ this.paymentToken && (this.stopPolling(), this.pollingService = new ln(
1197
1185
  this.adapters,
1198
1186
  this.getApiBaseUrl(),
1199
1187
  this.paymentToken,
@@ -1212,7 +1200,7 @@ var cn = class {
1212
1200
  },
1213
1201
  this.handlePollStart.bind(this)
1214
1202
  // Pass poll start callback
1215
- ), this.pollingService.start();
1203
+ ), this.pollingService.start());
1216
1204
  }
1217
1205
  /**
1218
1206
  * Stop polling service
@@ -1243,7 +1231,7 @@ var cn = class {
1243
1231
  return;
1244
1232
  }
1245
1233
  if (t.qrCode && !this.ignoreQRInPolling) {
1246
- console.log("[SDK] QR code image detected:", t.qrCode.substring(0, 50)), this.emit({
1234
+ this.emit({
1247
1235
  type: "qr_code_received",
1248
1236
  payload: {
1249
1237
  qrCode: t.qrCode,
@@ -1254,7 +1242,7 @@ var cn = class {
1254
1242
  }
1255
1243
  if (t.nextActionUrl && !this.ignore3DSInPolling) {
1256
1244
  if (e.selectedMethod === "paynow" && !this.ignoreQRInPolling) {
1257
- console.log("[SDK] PayNow nextActionUrl detected, treating as QR page"), this.emit({
1245
+ this.emit({
1258
1246
  type: "qr_code_received",
1259
1247
  payload: {
1260
1248
  qrCode: t.nextActionUrl,
@@ -1264,7 +1252,6 @@ var cn = class {
1264
1252
  });
1265
1253
  return;
1266
1254
  }
1267
- console.log("[SDK] nextActionUrl detected for 3DS");
1268
1255
  const r = {
1269
1256
  id: t.paymentIntentId,
1270
1257
  amount: t.amount ?? e.paymentIntent.amount,
@@ -1422,21 +1409,21 @@ yt.prototype = {
1422
1409
  },
1423
1410
  getFixedDateString: function(t) {
1424
1411
  var e = this, n = e.datePattern, r = [], i = 0, o = 0, s = 0, l = 0, a = 0, d = 0, c, u, f, h = !1;
1425
- t.length === 4 && n[0].toLowerCase() !== "y" && n[1].toLowerCase() !== "y" && (l = n[0] === "d" ? 0 : 2, a = 2 - l, c = parseInt(t.slice(l, l + 2), 10), u = parseInt(t.slice(a, a + 2), 10), r = this.getFixedDate(c, u, 0)), t.length === 8 && (n.forEach(function(p, k) {
1412
+ t.length === 4 && n[0].toLowerCase() !== "y" && n[1].toLowerCase() !== "y" && (l = n[0] === "d" ? 0 : 2, a = 2 - l, c = parseInt(t.slice(l, l + 2), 10), u = parseInt(t.slice(a, a + 2), 10), r = this.getFixedDate(c, u, 0)), t.length === 8 && (n.forEach(function(p, C) {
1426
1413
  switch (p) {
1427
1414
  case "d":
1428
- i = k;
1415
+ i = C;
1429
1416
  break;
1430
1417
  case "m":
1431
- o = k;
1418
+ o = C;
1432
1419
  break;
1433
1420
  default:
1434
- s = k;
1421
+ s = C;
1435
1422
  break;
1436
1423
  }
1437
1424
  }), d = s * 2, l = i <= s ? i * 2 : i * 2 + 2, a = o <= s ? o * 2 : o * 2 + 2, c = parseInt(t.slice(l, l + 2), 10), u = parseInt(t.slice(a, a + 2), 10), f = parseInt(t.slice(d, d + 4), 10), h = t.slice(d, d + 4).length === 4, r = this.getFixedDate(c, u, f)), t.length === 4 && (n[0] === "y" || n[1] === "y") && (a = n[0] === "m" ? 0 : 2, d = 2 - a, u = parseInt(t.slice(a, a + 2), 10), f = parseInt(t.slice(d, d + 2), 10), h = t.slice(d, d + 2).length === 2, r = [0, u, f]), t.length === 6 && (n[0] === "Y" || n[1] === "Y") && (a = n[0] === "m" ? 0 : 4, d = 2 - 0.5 * a, u = parseInt(t.slice(a, a + 2), 10), f = parseInt(t.slice(d, d + 4), 10), h = t.slice(d, d + 4).length === 4, r = [0, u, f]), r = e.getRangeFixedDate(r), e.date = r;
1438
- var m = r.length === 0 ? t : n.reduce(function(p, k) {
1439
- switch (k) {
1425
+ var m = r.length === 0 ? t : n.reduce(function(p, C) {
1426
+ switch (C) {
1440
1427
  case "d":
1441
1428
  return p + (r[0] === 0 ? "" : e.addLeadingZero(r[0]));
1442
1429
  case "m":
@@ -2033,7 +2020,7 @@ D.isKanjiModeEnabled = function() {
2033
2020
  D.toSJIS = function(e) {
2034
2021
  return We(e);
2035
2022
  };
2036
- var Ce = {};
2023
+ var ke = {};
2037
2024
  (function(t) {
2038
2025
  t.L = { bit: 1 }, t.M = { bit: 0 }, t.Q = { bit: 3 }, t.H = { bit: 2 };
2039
2026
  function e(n) {
@@ -2067,7 +2054,7 @@ var Ce = {};
2067
2054
  return i;
2068
2055
  }
2069
2056
  };
2070
- })(Ce);
2057
+ })(ke);
2071
2058
  function xt() {
2072
2059
  this.buffer = [], this.length = 0;
2073
2060
  }
@@ -2107,7 +2094,7 @@ me.prototype.xor = function(t, e, n) {
2107
2094
  me.prototype.isReserved = function(t, e) {
2108
2095
  return this.reservedBit[t * this.size + e];
2109
2096
  };
2110
- var Cn = me, St = {};
2097
+ var kn = me, St = {};
2111
2098
  (function(t) {
2112
2099
  const e = D.getSymbolSize;
2113
2100
  t.getRowColCoords = function(r) {
@@ -2126,10 +2113,10 @@ var Cn = me, St = {};
2126
2113
  return i;
2127
2114
  };
2128
2115
  })(St);
2129
- var Ct = {};
2130
- const kn = D.getSymbolSize, lt = 7;
2131
- Ct.getPositions = function(e) {
2132
- const n = kn(e);
2116
+ var kt = {};
2117
+ const Cn = D.getSymbolSize, lt = 7;
2118
+ kt.getPositions = function(e) {
2119
+ const n = Cn(e);
2133
2120
  return [
2134
2121
  // top-left
2135
2122
  [0, 0],
@@ -2139,7 +2126,7 @@ Ct.getPositions = function(e) {
2139
2126
  [0, n - lt]
2140
2127
  ];
2141
2128
  };
2142
- var kt = {};
2129
+ var Ct = {};
2143
2130
  (function(t) {
2144
2131
  t.Patterns = {
2145
2132
  PATTERN000: 0,
@@ -2234,9 +2221,9 @@ var kt = {};
2234
2221
  }
2235
2222
  return l;
2236
2223
  };
2237
- })(kt);
2238
- var ke = {};
2239
- const q = Ce, pe = [
2224
+ })(Ct);
2225
+ var Ce = {};
2226
+ const q = ke, pe = [
2240
2227
  // L M Q H
2241
2228
  1,
2242
2229
  1,
@@ -2561,7 +2548,7 @@ const q = Ce, pe = [
2561
2548
  2040,
2562
2549
  2430
2563
2550
  ];
2564
- ke.getBlocksCount = function(e, n) {
2551
+ Ce.getBlocksCount = function(e, n) {
2565
2552
  switch (n) {
2566
2553
  case q.L:
2567
2554
  return pe[(e - 1) * 4 + 0];
@@ -2575,7 +2562,7 @@ ke.getBlocksCount = function(e, n) {
2575
2562
  return;
2576
2563
  }
2577
2564
  };
2578
- ke.getTotalCodewordsCount = function(e, n) {
2565
+ Ce.getTotalCodewordsCount = function(e, n) {
2579
2566
  switch (n) {
2580
2567
  case q.L:
2581
2568
  return ge[(e - 1) * 4 + 0];
@@ -2738,7 +2725,7 @@ L.testAlphanumeric = function(e) {
2738
2725
  };
2739
2726
  })(j);
2740
2727
  (function(t) {
2741
- const e = D, n = ke, r = Ce, i = j, o = Qe, s = 7973, l = e.getBCHDigit(s);
2728
+ const e = D, n = Ce, r = ke, i = j, o = Qe, s = 7973, l = e.getBCHDigit(s);
2742
2729
  function a(f, h, m) {
2743
2730
  for (let p = 1; p <= 40; p++)
2744
2731
  if (h <= t.getCapacity(p, m, f))
@@ -2750,8 +2737,8 @@ L.testAlphanumeric = function(e) {
2750
2737
  function c(f, h) {
2751
2738
  let m = 0;
2752
2739
  return f.forEach(function(p) {
2753
- const k = d(p.mode, h);
2754
- m += k + p.getBitsLength();
2740
+ const C = d(p.mode, h);
2741
+ m += C + p.getBitsLength();
2755
2742
  }), m;
2756
2743
  }
2757
2744
  function u(f, h) {
@@ -2765,7 +2752,7 @@ L.testAlphanumeric = function(e) {
2765
2752
  if (!o.isValid(h))
2766
2753
  throw new Error("Invalid QR Code version");
2767
2754
  typeof p > "u" && (p = i.BYTE);
2768
- const k = e.getSymbolTotalCodewords(h), b = n.getTotalCodewordsCount(h, m), w = (k - b) * 8;
2755
+ const C = e.getSymbolTotalCodewords(h), b = n.getTotalCodewordsCount(h, m), w = (C - b) * 8;
2769
2756
  if (p === i.MIXED) return w;
2770
2757
  const y = w - d(p, h);
2771
2758
  switch (p) {
@@ -2781,16 +2768,16 @@ L.testAlphanumeric = function(e) {
2781
2768
  }
2782
2769
  }, t.getBestVersionForData = function(h, m) {
2783
2770
  let p;
2784
- const k = r.from(m, r.M);
2771
+ const C = r.from(m, r.M);
2785
2772
  if (Array.isArray(h)) {
2786
2773
  if (h.length > 1)
2787
- return u(h, k);
2774
+ return u(h, C);
2788
2775
  if (h.length === 0)
2789
2776
  return 1;
2790
2777
  p = h[0];
2791
2778
  } else
2792
2779
  p = h;
2793
- return a(p.mode, p.getLength(), k);
2780
+ return a(p.mode, p.getLength(), C);
2794
2781
  }, t.getEncodedBits = function(h) {
2795
2782
  if (!o.isValid(h) || h < 7)
2796
2783
  throw new Error("Invalid QR Code version");
@@ -2954,10 +2941,10 @@ var On = te, Ft = { exports: {} };
2954
2941
  s[r] = 0;
2955
2942
  var l = e.PriorityQueue.make();
2956
2943
  l.push(r, 0);
2957
- for (var a, d, c, u, f, h, m, p, k; !l.empty(); ) {
2944
+ for (var a, d, c, u, f, h, m, p, C; !l.empty(); ) {
2958
2945
  a = l.pop(), d = a.value, u = a.cost, f = n[d] || {};
2959
2946
  for (c in f)
2960
- f.hasOwnProperty(c) && (h = f[c], m = u + h, p = s[c], k = typeof s[c] > "u", (k || p > m) && (s[c] = m, l.push(c, m), o[c] = d));
2947
+ f.hasOwnProperty(c) && (h = f[c], m = u + h, p = s[c], C = typeof s[c] > "u", (C || p > m) && (s[c] = m, l.push(c, m), o[c] = d));
2961
2948
  }
2962
2949
  if (typeof i < "u" && typeof s[i] > "u") {
2963
2950
  var b = ["Could not find a path from ", r, " to ", i, "."].join("");
@@ -3020,20 +3007,20 @@ var jn = Ft.exports;
3020
3007
  }
3021
3008
  function c(b, w, y) {
3022
3009
  const g = [];
3023
- let C;
3024
- for (; (C = b.exec(y)) !== null; )
3010
+ let k;
3011
+ for (; (k = b.exec(y)) !== null; )
3025
3012
  g.push({
3026
- data: C[0],
3027
- index: C.index,
3013
+ data: k[0],
3014
+ index: k.index,
3028
3015
  mode: w,
3029
- length: C[0].length
3016
+ length: k[0].length
3030
3017
  });
3031
3018
  return g;
3032
3019
  }
3033
3020
  function u(b) {
3034
3021
  const w = c(s.NUMERIC, e.NUMERIC, b), y = c(s.ALPHANUMERIC, e.ALPHANUMERIC, b);
3035
- let g, C;
3036
- return l.isKanjiModeEnabled() ? (g = c(s.BYTE, e.BYTE, b), C = c(s.KANJI, e.KANJI, b)) : (g = c(s.BYTE_KANJI, e.BYTE, b), C = []), w.concat(y, g, C).sort(function(A, N) {
3022
+ let g, k;
3023
+ return l.isKanjiModeEnabled() ? (g = c(s.BYTE, e.BYTE, b), k = c(s.KANJI, e.KANJI, b)) : (g = c(s.BYTE_KANJI, e.BYTE, b), k = []), w.concat(y, g, k).sort(function(A, N) {
3037
3024
  return A.index - N.index;
3038
3025
  }).map(function(A) {
3039
3026
  return {
@@ -3095,24 +3082,24 @@ var jn = Ft.exports;
3095
3082
  }
3096
3083
  function p(b, w) {
3097
3084
  const y = {}, g = { start: {} };
3098
- let C = ["start"];
3085
+ let k = ["start"];
3099
3086
  for (let E = 0; E < b.length; E++) {
3100
3087
  const A = b[E], N = [];
3101
3088
  for (let U = 0; U < A.length; U++) {
3102
3089
  const R = A[U], ne = "" + E + U;
3103
3090
  N.push(ne), y[ne] = { node: R, lastCount: 0 }, g[ne] = {};
3104
- for (let Ae = 0; Ae < C.length; Ae++) {
3105
- const B = C[Ae];
3091
+ for (let Ae = 0; Ae < k.length; Ae++) {
3092
+ const B = k[Ae];
3106
3093
  y[B] && y[B].node.mode === R.mode ? (g[B][ne] = f(y[B].lastCount + R.length, R.mode) - f(y[B].lastCount, R.mode), y[B].lastCount += R.length) : (y[B] && (y[B].lastCount = R.length), g[B][ne] = f(R.length, R.mode) + 4 + e.getCharCountIndicator(R.mode, w));
3107
3094
  }
3108
3095
  }
3109
- C = N;
3096
+ k = N;
3110
3097
  }
3111
- for (let E = 0; E < C.length; E++)
3112
- g[C[E]].end = 0;
3098
+ for (let E = 0; E < k.length; E++)
3099
+ g[k[E]].end = 0;
3113
3100
  return { map: g, table: y };
3114
3101
  }
3115
- function k(b, w) {
3102
+ function C(b, w) {
3116
3103
  let y;
3117
3104
  const g = e.getBestModeForData(b);
3118
3105
  if (y = e.from(w, g), y !== e.BYTE && y.bit < g.bit)
@@ -3131,10 +3118,10 @@ var jn = Ft.exports;
3131
3118
  }
3132
3119
  t.fromArray = function(w) {
3133
3120
  return w.reduce(function(y, g) {
3134
- return typeof g == "string" ? y.push(k(g, null)) : g.data && y.push(k(g.data, g.mode)), y;
3121
+ return typeof g == "string" ? y.push(C(g, null)) : g.data && y.push(C(g.data, g.mode)), y;
3135
3122
  }, []);
3136
3123
  }, t.fromString = function(w, y) {
3137
- const g = u(w, l.isKanjiModeEnabled()), C = m(g), E = p(C, y), A = a.find_path(E.map, "start", "end"), N = [];
3124
+ const g = u(w, l.isKanjiModeEnabled()), k = m(g), E = p(k, y), A = a.find_path(E.map, "start", "end"), N = [];
3138
3125
  for (let U = 1; U < A.length - 1; U++)
3139
3126
  N.push(E.table[A[U]].node);
3140
3127
  return t.fromArray(h(N));
@@ -3144,7 +3131,7 @@ var jn = Ft.exports;
3144
3131
  );
3145
3132
  };
3146
3133
  })(Tt);
3147
- const Pe = D, Ne = Ce, Vn = Sn, Zn = Cn, Yn = St, Hn = Ct, qe = kt, Oe = ke, Wn = En, xe = At, Kn = Mt, Qn = j, Re = Tt;
3134
+ const Pe = D, Ne = ke, Vn = Sn, Zn = kn, Yn = St, Hn = kt, qe = Ct, Oe = Ce, Wn = En, xe = At, Kn = Mt, Qn = j, Re = Tt;
3148
3135
  function Xn(t, e) {
3149
3136
  const n = t.size, r = Hn.getPositions(e);
3150
3137
  for (let i = 0; i < r.length; i++) {
@@ -3216,21 +3203,21 @@ function er(t, e, n) {
3216
3203
  function tr(t, e, n) {
3217
3204
  const r = Pe.getSymbolTotalCodewords(e), i = Oe.getTotalCodewordsCount(e, n), o = r - i, s = Oe.getBlocksCount(e, n), l = r % s, a = s - l, d = Math.floor(r / s), c = Math.floor(o / s), u = c + 1, f = d - c, h = new Wn(f);
3218
3205
  let m = 0;
3219
- const p = new Array(s), k = new Array(s);
3206
+ const p = new Array(s), C = new Array(s);
3220
3207
  let b = 0;
3221
3208
  const w = new Uint8Array(t.buffer);
3222
3209
  for (let A = 0; A < s; A++) {
3223
3210
  const N = A < a ? c : u;
3224
- p[A] = w.slice(m, m + N), k[A] = h.encode(p[A]), m += N, b = Math.max(b, N);
3211
+ p[A] = w.slice(m, m + N), C[A] = h.encode(p[A]), m += N, b = Math.max(b, N);
3225
3212
  }
3226
3213
  const y = new Uint8Array(r);
3227
- let g = 0, C, E;
3228
- for (C = 0; C < b; C++)
3214
+ let g = 0, k, E;
3215
+ for (k = 0; k < b; k++)
3229
3216
  for (E = 0; E < s; E++)
3230
- C < p[E].length && (y[g++] = p[E][C]);
3231
- for (C = 0; C < f; C++)
3217
+ k < p[E].length && (y[g++] = p[E][k]);
3218
+ for (k = 0; k < f; k++)
3232
3219
  for (E = 0; E < s; E++)
3233
- y[g++] = k[E][C];
3220
+ y[g++] = C[E][k];
3234
3221
  return y;
3235
3222
  }
3236
3223
  function nr(t, e, n, r) {
@@ -3321,8 +3308,8 @@ var Nt = {}, Xe = {};
3321
3308
  for (let h = 0; h < d; h++) {
3322
3309
  let m = (f * d + h) * 4, p = o.color.light;
3323
3310
  if (f >= c && h >= c && f < d - c && h < d - c) {
3324
- const k = Math.floor((f - c) / a), b = Math.floor((h - c) / a);
3325
- p = u[l[k * s + b] ? 1 : 0];
3311
+ const C = Math.floor((f - c) / a), b = Math.floor((h - c) / a);
3312
+ p = u[l[C * s + b] ? 1 : 0];
3326
3313
  }
3327
3314
  r[m++] = p.r, r[m++] = p.g, r[m++] = p.b, r[m] = p.a;
3328
3315
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@one-payments/web-components",
3
- "version": "1.1.19",
3
+ "version": "1.1.20",
4
4
  "description": "Universal web components for One Payments SDK built with Lit",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",