@danidoble/webserial 4.4.0-beta.1 → 4.4.0-beta.3

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 (63) hide show
  1. package/dist/boardroid.cjs +1 -1
  2. package/dist/boardroid.js +106 -101
  3. package/dist/hopper.cjs +2 -2
  4. package/dist/hopper.js +66 -51
  5. package/dist/jofemar.cjs +1 -1
  6. package/dist/jofemar.js +62 -144
  7. package/dist/kernel-C1HLYiV1.cjs +1 -0
  8. package/dist/kernel-C8ISUhzV.cjs +1 -0
  9. package/dist/kernel-CQcZ_OiG.js +831 -0
  10. package/dist/{kernel-505KqpPU.js → kernel-DkC7Kj3m.js} +151 -125
  11. package/dist/kernel-DtXV8d8B.js +831 -0
  12. package/dist/kernel-DyNuXvtW.cjs +1 -0
  13. package/dist/kernel-aqBCxtkj.js +831 -0
  14. package/dist/kernel-pO_elWba.cjs +1 -0
  15. package/dist/kernel.cjs +2 -2
  16. package/dist/kernel.d.ts +14 -0
  17. package/dist/kernel.d.ts.map +1 -0
  18. package/dist/kernel.js +3 -4
  19. package/dist/locker.cjs +1 -1
  20. package/dist/locker.js +33 -26
  21. package/dist/main.d.ts +28 -0
  22. package/dist/main.d.ts.map +1 -0
  23. package/dist/pinpad.cjs +15 -20
  24. package/dist/pinpad.js +1405 -1259
  25. package/dist/pinpax.cjs +4 -4
  26. package/dist/pinpax.js +68 -68
  27. package/dist/{relay-CsdB0FSa.js → relay-DP8PLsDP.js} +2 -2
  28. package/dist/{relay-DGFymXOw.cjs → relay-E3NCcSjS.cjs} +1 -1
  29. package/dist/relay.cjs +1 -1
  30. package/dist/relay.js +11 -29
  31. package/dist/serial/boardroid.d.ts +206 -0
  32. package/dist/serial/boardroid.d.ts.map +1 -0
  33. package/dist/serial/hopper.d.ts +85 -0
  34. package/dist/serial/hopper.d.ts.map +1 -0
  35. package/dist/serial/jofemar.d.ts +218 -0
  36. package/dist/serial/jofemar.d.ts.map +1 -0
  37. package/dist/serial/kernel.d.ts +137 -0
  38. package/dist/serial/kernel.d.ts.map +1 -0
  39. package/dist/serial/locker.d.ts +33 -0
  40. package/dist/serial/locker.d.ts.map +1 -0
  41. package/dist/serial/pinpad.d.ts +263 -0
  42. package/dist/serial/pinpad.d.ts.map +1 -0
  43. package/dist/serial/pinpax.d.ts +60 -0
  44. package/dist/serial/pinpax.d.ts.map +1 -0
  45. package/dist/serial/relay.d.ts +13 -0
  46. package/dist/serial/relay.d.ts.map +1 -0
  47. package/dist/utils/devices.d.ts +26 -0
  48. package/dist/utils/devices.d.ts.map +1 -0
  49. package/dist/utils/dispatcher.d.ts +17 -0
  50. package/dist/utils/dispatcher.d.ts.map +1 -0
  51. package/dist/utils/emulator.d.ts +80 -0
  52. package/dist/utils/emulator.d.ts.map +1 -0
  53. package/dist/utils/utils.d.ts +7 -0
  54. package/dist/utils/utils.d.ts.map +1 -0
  55. package/dist/{webserial-core-C0ZbaNYy.js → webserial-core-CH2Xov2y.js} +943 -933
  56. package/dist/webserial-core-Cj_EZjAU.cjs +4 -0
  57. package/dist/webserial-core-D3luFguv.js +3325 -0
  58. package/dist/webserial-core-YjdXyVOx.cjs +4 -0
  59. package/dist/webserial.cjs +2 -2
  60. package/dist/webserial.js +19 -19
  61. package/package.json +17 -14
  62. package/dist/kernel-Dq3Fv1y8.cjs +0 -1
  63. package/dist/webserial-core-B7vfLzGH.cjs +0 -4
package/dist/pinpad.js CHANGED
@@ -1,68 +1,67 @@
1
- import { K as Ze, a as Ye, i as K, b as Qt, w as Zt } from "./kernel-505KqpPU.js";
2
- import { a as Yt } from "./webserial-core-C0ZbaNYy.js";
3
- var ti = "0123456789abcdefghijklmnopqrstuvwxyz";
4
- function H(n) {
5
- return ti.charAt(n);
1
+ import { K as mi, a as yi, D as le, i as z, b as fe, w as pe } from "./kernel-DtXV8d8B.js";
2
+ var bi = "0123456789abcdefghijklmnopqrstuvwxyz";
3
+ function G(n) {
4
+ return bi.charAt(n);
6
5
  }
7
- function ei(n, t) {
6
+ function Pi(n, t) {
8
7
  return n & t;
9
8
  }
10
- function lt(n, t) {
9
+ function St(n, t) {
11
10
  return n | t;
12
11
  }
13
- function te(n, t) {
12
+ function de(n, t) {
14
13
  return n ^ t;
15
14
  }
16
- function ee(n, t) {
15
+ function _e(n, t) {
17
16
  return n & ~t;
18
17
  }
19
- function ii(n) {
18
+ function vi(n) {
20
19
  if (n == 0)
21
20
  return -1;
22
21
  var t = 0;
23
22
  return (n & 65535) == 0 && (n >>= 16, t += 16), (n & 255) == 0 && (n >>= 8, t += 8), (n & 15) == 0 && (n >>= 4, t += 4), (n & 3) == 0 && (n >>= 2, t += 2), (n & 1) == 0 && ++t, t;
24
23
  }
25
- function ni(n) {
24
+ function Ei(n) {
26
25
  for (var t = 0; n != 0; )
27
26
  n &= n - 1, ++t;
28
27
  return t;
29
28
  }
30
- var tt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Ee = "=";
31
- function vt(n) {
29
+ var ht = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", qe = "=";
30
+ function yt(n) {
32
31
  var t, e, i = "";
33
32
  for (t = 0; t + 3 <= n.length; t += 3)
34
- e = parseInt(n.substring(t, t + 3), 16), i += tt.charAt(e >> 6) + tt.charAt(e & 63);
35
- for (t + 1 == n.length ? (e = parseInt(n.substring(t, t + 1), 16), i += tt.charAt(e << 2)) : t + 2 == n.length && (e = parseInt(n.substring(t, t + 2), 16), i += tt.charAt(e >> 2) + tt.charAt((e & 3) << 4)); (i.length & 3) > 0; )
36
- i += Ee;
33
+ e = parseInt(n.substring(t, t + 3), 16), i += ht.charAt(e >> 6) + ht.charAt(e & 63);
34
+ for (t + 1 == n.length ? (e = parseInt(n.substring(t, t + 1), 16), i += ht.charAt(e << 2)) : t + 2 == n.length && (e = parseInt(n.substring(t, t + 2), 16), i += ht.charAt(e >> 2) + ht.charAt((e & 3) << 4)); (i.length & 3) > 0; )
35
+ i += qe;
37
36
  return i;
38
37
  }
39
- function ie(n) {
38
+ function ge(n) {
40
39
  var t = "", e, i = 0, r = 0;
41
- for (e = 0; e < n.length && n.charAt(e) != Ee; ++e) {
42
- var s = tt.indexOf(n.charAt(e));
43
- s < 0 || (i == 0 ? (t += H(s >> 2), r = s & 3, i = 1) : i == 1 ? (t += H(r << 2 | s >> 4), r = s & 15, i = 2) : i == 2 ? (t += H(r), t += H(s >> 2), r = s & 3, i = 3) : (t += H(r << 2 | s >> 4), t += H(s & 15), i = 0));
40
+ for (e = 0; e < n.length && n.charAt(e) != qe; ++e) {
41
+ var s = ht.indexOf(n.charAt(e));
42
+ s < 0 || (i == 0 ? (t += G(s >> 2), r = s & 3, i = 1) : i == 1 ? (t += G(r << 2 | s >> 4), r = s & 15, i = 2) : i == 2 ? (t += G(r), t += G(s >> 2), r = s & 3, i = 3) : (t += G(r << 2 | s >> 4), t += G(s & 15), i = 0));
44
43
  }
45
- return i == 1 && (t += H(r << 2)), t;
44
+ return i == 1 && (t += G(r << 2)), t;
46
45
  }
47
- var Z, ri = {
46
+ var ct, wi = {
48
47
  decode: function(n) {
49
48
  var t;
50
- if (Z === void 0) {
49
+ if (ct === void 0) {
51
50
  var e = "0123456789ABCDEF", i = ` \f
52
51
  \r  \u2028\u2029`;
53
- for (Z = {}, t = 0; t < 16; ++t)
54
- Z[e.charAt(t)] = t;
52
+ for (ct = {}, t = 0; t < 16; ++t)
53
+ ct[e.charAt(t)] = t;
55
54
  for (e = e.toLowerCase(), t = 10; t < 16; ++t)
56
- Z[e.charAt(t)] = t;
55
+ ct[e.charAt(t)] = t;
57
56
  for (t = 0; t < i.length; ++t)
58
- Z[i.charAt(t)] = -1;
57
+ ct[i.charAt(t)] = -1;
59
58
  }
60
59
  var r = [], s = 0, a = 0;
61
60
  for (t = 0; t < n.length; ++t) {
62
61
  var o = n.charAt(t);
63
62
  if (o == "=")
64
63
  break;
65
- if (o = Z[o], o != -1) {
64
+ if (o = ct[o], o != -1) {
66
65
  if (o === void 0)
67
66
  throw new Error("Illegal character at offset " + t);
68
67
  s |= o, ++a >= 2 ? (r[r.length] = s, s = 0, a = 0) : s <<= 4;
@@ -72,23 +71,23 @@ var Z, ri = {
72
71
  throw new Error("Hex encoding incomplete: 4 bits missing");
73
72
  return r;
74
73
  }
75
- }, G, kt = {
74
+ }, et, Jt = {
76
75
  decode: function(n) {
77
76
  var t;
78
- if (G === void 0) {
77
+ if (et === void 0) {
79
78
  var e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", i = `= \f
80
79
  \r  \u2028\u2029`;
81
- for (G = /* @__PURE__ */ Object.create(null), t = 0; t < 64; ++t)
82
- G[e.charAt(t)] = t;
83
- for (G["-"] = 62, G._ = 63, t = 0; t < i.length; ++t)
84
- G[i.charAt(t)] = -1;
80
+ for (et = /* @__PURE__ */ Object.create(null), t = 0; t < 64; ++t)
81
+ et[e.charAt(t)] = t;
82
+ for (et["-"] = 62, et._ = 63, t = 0; t < i.length; ++t)
83
+ et[i.charAt(t)] = -1;
85
84
  }
86
85
  var r = [], s = 0, a = 0;
87
86
  for (t = 0; t < n.length; ++t) {
88
87
  var o = n.charAt(t);
89
88
  if (o == "=")
90
89
  break;
91
- if (o = G[o], o != -1) {
90
+ if (o = et[o], o != -1) {
92
91
  if (o === void 0)
93
92
  throw new Error("Illegal character at offset " + t);
94
93
  s |= o, ++a >= 4 ? (r[r.length] = s >> 16, r[r.length] = s >> 8 & 255, r[r.length] = s & 255, s = 0, a = 0) : s <<= 6;
@@ -108,7 +107,7 @@ var Z, ri = {
108
107
  },
109
108
  re: /-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,
110
109
  unarmor: function(n) {
111
- var t = kt.re.exec(n);
110
+ var t = Jt.re.exec(n);
112
111
  if (t)
113
112
  if (t[1])
114
113
  n = t[1];
@@ -116,47 +115,47 @@ var Z, ri = {
116
115
  n = t[2];
117
116
  else
118
117
  throw new Error("RegExp out of sync");
119
- return kt.decode(n);
118
+ return Jt.decode(n);
120
119
  }
121
- }, Y = 1e13, at = (
120
+ }, ut = 1e13, mt = (
122
121
  /** @class */
123
- function() {
122
+ (function() {
124
123
  function n(t) {
125
124
  this.buf = [+t || 0];
126
125
  }
127
126
  return n.prototype.mulAdd = function(t, e) {
128
127
  var i = this.buf, r = i.length, s, a;
129
128
  for (s = 0; s < r; ++s)
130
- a = i[s] * t + e, a < Y ? e = 0 : (e = 0 | a / Y, a -= e * Y), i[s] = a;
129
+ a = i[s] * t + e, a < ut ? e = 0 : (e = 0 | a / ut, a -= e * ut), i[s] = a;
131
130
  e > 0 && (i[s] = e);
132
131
  }, n.prototype.sub = function(t) {
133
132
  var e = this.buf, i = e.length, r, s;
134
133
  for (r = 0; r < i; ++r)
135
- s = e[r] - t, s < 0 ? (s += Y, t = 1) : t = 0, e[r] = s;
134
+ s = e[r] - t, s < 0 ? (s += ut, t = 1) : t = 0, e[r] = s;
136
135
  for (; e[e.length - 1] === 0; )
137
136
  e.pop();
138
137
  }, n.prototype.toString = function(t) {
139
138
  if ((t || 10) != 10)
140
139
  throw new Error("only base 10 is supported");
141
140
  for (var e = this.buf, i = e[e.length - 1].toString(), r = e.length - 2; r >= 0; --r)
142
- i += (Y + e[r]).toString().substring(1);
141
+ i += (ut + e[r]).toString().substring(1);
143
142
  return i;
144
143
  }, n.prototype.valueOf = function() {
145
144
  for (var t = this.buf, e = 0, i = t.length - 1; i >= 0; --i)
146
- e = e * Y + t[i];
145
+ e = e * ut + t[i];
147
146
  return e;
148
147
  }, n.prototype.simplify = function() {
149
148
  var t = this.buf;
150
149
  return t.length == 1 ? t[0] : this;
151
150
  }, n;
152
- }()
153
- ), Se = "…", si = /^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/, ai = /^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;
154
- function et(n, t) {
155
- return n.length > t && (n = n.substring(0, t) + Se), n;
151
+ })()
152
+ ), Ke = "…", Si = /^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/, Ti = /^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;
153
+ function lt(n, t) {
154
+ return n.length > t && (n = n.substring(0, t) + Ke), n;
156
155
  }
157
- var Bt = (
156
+ var Ht = (
158
157
  /** @class */
159
- function() {
158
+ (function() {
160
159
  function n(t, e) {
161
160
  this.hexDigits = "0123456789ABCDEF", t instanceof n ? (this.enc = t.enc, this.pos = t.pos) : (this.enc = t, this.pos = e);
162
161
  }
@@ -203,7 +202,7 @@ var Bt = (
203
202
  r = this.get(a++), s = this.get(a++), i += String.fromCharCode(r << 8 | s);
204
203
  return i;
205
204
  }, n.prototype.parseTime = function(t, e, i) {
206
- var r = this.parseStringISO(t, e), s = (i ? si : ai).exec(r);
205
+ var r = this.parseStringISO(t, e), s = (i ? Si : Ti).exec(r);
207
206
  return s ? (i && (s[1] = +s[1], s[1] += +s[1] < 70 ? 2e3 : 1900), r = s[1] + "-" + s[2] + "-" + s[3] + " " + s[4], s[5] && (r += ":" + s[5], s[6] && (r += ":" + s[6], s[7] && (r += "." + s[7]))), s[8] && (r += " UTC", s[8] != "Z" && (r += s[8], s[9] && (r += ":" + s[9]))), r) : "Unrecognized time: " + r;
208
207
  }, n.prototype.parseInteger = function(t, e) {
209
208
  for (var i = this.get(t), r = i > 127, s = r ? 255 : 0, a, o = ""; i == s && ++t < e; )
@@ -217,7 +216,7 @@ var Bt = (
217
216
  `;
218
217
  }
219
218
  r && (i = i - 256);
220
- for (var c = new at(i), h = t + 1; h < e; ++h)
219
+ for (var c = new mt(i), h = t + 1; h < e; ++h)
221
220
  c.mulAdd(256, this.get(h));
222
221
  return o + c.toString();
223
222
  }, n.prototype.parseBitString = function(t, e, i) {
@@ -226,24 +225,24 @@ var Bt = (
226
225
  for (var h = this.get(c), u = c == e - 1 ? r : 0, f = 7; f >= u; --f)
227
226
  o += h >> f & 1 ? "1" : "0";
228
227
  if (o.length > i)
229
- return a + et(o, i);
228
+ return a + lt(o, i);
230
229
  }
231
230
  return a + o;
232
231
  }, n.prototype.parseOctetString = function(t, e, i) {
233
232
  if (this.isASCII(t, e))
234
- return et(this.parseStringISO(t, e), i);
233
+ return lt(this.parseStringISO(t, e), i);
235
234
  var r = e - t, s = "(" + r + ` byte)
236
235
  `;
237
236
  i /= 2, r > i && (e = t + i);
238
237
  for (var a = t; a < e; ++a)
239
238
  s += this.hexByte(this.get(a));
240
- return r > i && (s += Se), s;
239
+ return r > i && (s += Ke), s;
241
240
  }, n.prototype.parseOID = function(t, e, i) {
242
- for (var r = "", s = new at(), a = 0, o = t; o < e; ++o) {
241
+ for (var r = "", s = new mt(), a = 0, o = t; o < e; ++o) {
243
242
  var c = this.get(o);
244
243
  if (s.mulAdd(128, c & 127), a += 7, !(c & 128)) {
245
244
  if (r === "")
246
- if (s = s.simplify(), s instanceof at)
245
+ if (s = s.simplify(), s instanceof mt)
247
246
  s.sub(80), r = "2." + s.toString();
248
247
  else {
249
248
  var h = s < 80 ? s < 40 ? 0 : 1 : 2;
@@ -252,18 +251,18 @@ var Bt = (
252
251
  else
253
252
  r += "." + s.toString();
254
253
  if (r.length > i)
255
- return et(r, i);
256
- s = new at(), a = 0;
254
+ return lt(r, i);
255
+ s = new mt(), a = 0;
257
256
  }
258
257
  }
259
258
  return a > 0 && (r += ".incomplete"), r;
260
259
  }, n;
261
- }()
262
- ), oi = (
260
+ })()
261
+ ), Ai = (
263
262
  /** @class */
264
- function() {
263
+ (function() {
265
264
  function n(t, e, i, r, s) {
266
- if (!(r instanceof ne))
265
+ if (!(r instanceof me))
267
266
  throw new Error("Invalid tag value.");
268
267
  this.stream = t, this.header = e, this.length = i, this.tag = r, this.sub = s;
269
268
  }
@@ -368,7 +367,7 @@ var Bt = (
368
367
  case 17:
369
368
  return this.sub !== null ? "(" + this.sub.length + " elem)" : "(no elem)";
370
369
  case 12:
371
- return et(this.stream.parseStringUTF(e, e + i), t);
370
+ return lt(this.stream.parseStringUTF(e, e + i), t);
372
371
  case 18:
373
372
  // NumericString
374
373
  case 19:
@@ -381,9 +380,9 @@ var Bt = (
381
380
  // IA5String
382
381
  // case 0x19: // GraphicString
383
382
  case 26:
384
- return et(this.stream.parseStringISO(e, e + i), t);
383
+ return lt(this.stream.parseStringISO(e, e + i), t);
385
384
  case 30:
386
- return et(this.stream.parseStringBMP(e, e + i), t);
385
+ return lt(this.stream.parseStringBMP(e, e + i), t);
387
386
  case 23:
388
387
  // UTCTime
389
388
  case 24:
@@ -424,11 +423,11 @@ var Bt = (
424
423
  return e;
425
424
  }, n.prototype.getHexStringValue = function() {
426
425
  var t = this.toHexString(), e = this.header * 2, i = this.length * 2;
427
- return t.substr(e, i);
426
+ return t.substring(e, e + i);
428
427
  }, n.decode = function(t) {
429
428
  var e;
430
- t instanceof Bt ? e = t : e = new Bt(t, 0);
431
- var i = new Bt(e), r = new ne(e), s = n.decodeLength(e), a = e.pos, o = a - i.pos, c = null, h = function() {
429
+ t instanceof Ht ? e = t : e = new Ht(t, 0);
430
+ var i = new Ht(e), r = new me(e), s = n.decodeLength(e), a = e.pos, o = a - i.pos, c = null, h = function() {
432
431
  var f = [];
433
432
  if (s !== null) {
434
433
  for (var _ = a + s; e.pos < _; )
@@ -469,14 +468,14 @@ var Bt = (
469
468
  }
470
469
  return new n(i, o, s, r, c);
471
470
  }, n;
472
- }()
473
- ), ne = (
471
+ })()
472
+ ), me = (
474
473
  /** @class */
475
- function() {
474
+ (function() {
476
475
  function n(t) {
477
476
  var e = t.get();
478
477
  if (this.tagClass = e >> 6, this.tagConstructed = (e & 32) !== 0, this.tagNumber = e & 31, this.tagNumber == 31) {
479
- var i = new at();
478
+ var i = new mt();
480
479
  do
481
480
  e = t.get(), i.mulAdd(128, e & 127);
482
481
  while (e & 128);
@@ -488,10 +487,10 @@ var Bt = (
488
487
  }, n.prototype.isEOC = function() {
489
488
  return this.tagClass === 0 && this.tagNumber === 0;
490
489
  }, n;
491
- }()
492
- ), z, ci = 244837814094590, re = (ci & 16777215) == 15715070, D = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997], ui = (1 << 26) / D[D.length - 1], v = (
490
+ })()
491
+ ), Y, Ci = 244837814094590, ye = (Ci & 16777215) == 15715070, N = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997], Ri = (1 << 26) / N[N.length - 1], P = (
493
492
  /** @class */
494
- function() {
493
+ (function() {
495
494
  function n(t, e, i) {
496
495
  t != null && (typeof t == "number" ? this.fromNumber(t, e, i) : e == null && typeof t != "string" ? this.fromString(t, 256) : this.fromString(t, e));
497
496
  }
@@ -513,11 +512,11 @@ var Bt = (
513
512
  return this.toRadix(t);
514
513
  var i = (1 << e) - 1, r, s = !1, a = "", o = this.t, c = this.DB - o * this.DB % e;
515
514
  if (o-- > 0)
516
- for (c < this.DB && (r = this[o] >> c) > 0 && (s = !0, a = H(r)); o >= 0; )
517
- c < e ? (r = (this[o] & (1 << c) - 1) << e - c, r |= this[--o] >> (c += this.DB - e)) : (r = this[o] >> (c -= e) & i, c <= 0 && (c += this.DB, --o)), r > 0 && (s = !0), s && (a += H(r));
515
+ for (c < this.DB && (r = this[o] >> c) > 0 && (s = !0, a = G(r)); o >= 0; )
516
+ c < e ? (r = (this[o] & (1 << c) - 1) << e - c, r |= this[--o] >> (c += this.DB - e)) : (r = this[o] >> (c -= e) & i, c <= 0 && (c += this.DB, --o)), r > 0 && (s = !0), s && (a += G(r));
518
517
  return s ? a : "0";
519
518
  }, n.prototype.negate = function() {
520
- var t = w();
519
+ var t = E();
521
520
  return n.ZERO.subTo(this, t), t;
522
521
  }, n.prototype.abs = function() {
523
522
  return this.s < 0 ? this.negate() : this;
@@ -533,15 +532,15 @@ var Bt = (
533
532
  return e;
534
533
  return 0;
535
534
  }, n.prototype.bitLength = function() {
536
- return this.t <= 0 ? 0 : this.DB * (this.t - 1) + ft(this[this.t - 1] ^ this.s & this.DM);
535
+ return this.t <= 0 ? 0 : this.DB * (this.t - 1) + Tt(this[this.t - 1] ^ this.s & this.DM);
537
536
  }, n.prototype.mod = function(t) {
538
- var e = w();
537
+ var e = E();
539
538
  return this.abs().divRemTo(t, null, e), this.s < 0 && e.compareTo(n.ZERO) > 0 && t.subTo(e, e), e;
540
539
  }, n.prototype.modPowInt = function(t, e) {
541
540
  var i;
542
- return t < 256 || e.isEven() ? i = new se(e) : i = new ae(e), this.exp(t, i);
541
+ return t < 256 || e.isEven() ? i = new be(e) : i = new Pe(e), this.exp(t, i);
543
542
  }, n.prototype.clone = function() {
544
- var t = w();
543
+ var t = E();
545
544
  return this.copyTo(t), t;
546
545
  }, n.prototype.intValue = function() {
547
546
  if (this.s < 0) {
@@ -577,76 +576,76 @@ var Bt = (
577
576
  }, n.prototype.max = function(t) {
578
577
  return this.compareTo(t) > 0 ? this : t;
579
578
  }, n.prototype.and = function(t) {
580
- var e = w();
581
- return this.bitwiseTo(t, ei, e), e;
579
+ var e = E();
580
+ return this.bitwiseTo(t, Pi, e), e;
582
581
  }, n.prototype.or = function(t) {
583
- var e = w();
584
- return this.bitwiseTo(t, lt, e), e;
582
+ var e = E();
583
+ return this.bitwiseTo(t, St, e), e;
585
584
  }, n.prototype.xor = function(t) {
586
- var e = w();
587
- return this.bitwiseTo(t, te, e), e;
585
+ var e = E();
586
+ return this.bitwiseTo(t, de, e), e;
588
587
  }, n.prototype.andNot = function(t) {
589
- var e = w();
590
- return this.bitwiseTo(t, ee, e), e;
588
+ var e = E();
589
+ return this.bitwiseTo(t, _e, e), e;
591
590
  }, n.prototype.not = function() {
592
- for (var t = w(), e = 0; e < this.t; ++e)
591
+ for (var t = E(), e = 0; e < this.t; ++e)
593
592
  t[e] = this.DM & ~this[e];
594
593
  return t.t = this.t, t.s = ~this.s, t;
595
594
  }, n.prototype.shiftLeft = function(t) {
596
- var e = w();
595
+ var e = E();
597
596
  return t < 0 ? this.rShiftTo(-t, e) : this.lShiftTo(t, e), e;
598
597
  }, n.prototype.shiftRight = function(t) {
599
- var e = w();
598
+ var e = E();
600
599
  return t < 0 ? this.lShiftTo(-t, e) : this.rShiftTo(t, e), e;
601
600
  }, n.prototype.getLowestSetBit = function() {
602
601
  for (var t = 0; t < this.t; ++t)
603
602
  if (this[t] != 0)
604
- return t * this.DB + ii(this[t]);
603
+ return t * this.DB + vi(this[t]);
605
604
  return this.s < 0 ? this.t * this.DB : -1;
606
605
  }, n.prototype.bitCount = function() {
607
606
  for (var t = 0, e = this.s & this.DM, i = 0; i < this.t; ++i)
608
- t += ni(this[i] ^ e);
607
+ t += Ei(this[i] ^ e);
609
608
  return t;
610
609
  }, n.prototype.testBit = function(t) {
611
610
  var e = Math.floor(t / this.DB);
612
611
  return e >= this.t ? this.s != 0 : (this[e] & 1 << t % this.DB) != 0;
613
612
  }, n.prototype.setBit = function(t) {
614
- return this.changeBit(t, lt);
613
+ return this.changeBit(t, St);
615
614
  }, n.prototype.clearBit = function(t) {
616
- return this.changeBit(t, ee);
615
+ return this.changeBit(t, _e);
617
616
  }, n.prototype.flipBit = function(t) {
618
- return this.changeBit(t, te);
617
+ return this.changeBit(t, de);
619
618
  }, n.prototype.add = function(t) {
620
- var e = w();
619
+ var e = E();
621
620
  return this.addTo(t, e), e;
622
621
  }, n.prototype.subtract = function(t) {
623
- var e = w();
622
+ var e = E();
624
623
  return this.subTo(t, e), e;
625
624
  }, n.prototype.multiply = function(t) {
626
- var e = w();
625
+ var e = E();
627
626
  return this.multiplyTo(t, e), e;
628
627
  }, n.prototype.divide = function(t) {
629
- var e = w();
628
+ var e = E();
630
629
  return this.divRemTo(t, e, null), e;
631
630
  }, n.prototype.remainder = function(t) {
632
- var e = w();
631
+ var e = E();
633
632
  return this.divRemTo(t, null, e), e;
634
633
  }, n.prototype.divideAndRemainder = function(t) {
635
- var e = w(), i = w();
634
+ var e = E(), i = E();
636
635
  return this.divRemTo(t, e, i), [e, i];
637
636
  }, n.prototype.modPow = function(t, e) {
638
- var i = t.bitLength(), r, s = W(1), a;
637
+ var i = t.bitLength(), r, s = Q(1), a;
639
638
  if (i <= 0)
640
639
  return s;
641
- i < 18 ? r = 1 : i < 48 ? r = 3 : i < 144 ? r = 4 : i < 768 ? r = 5 : r = 6, i < 8 ? a = new se(e) : e.isEven() ? a = new li(e) : a = new ae(e);
640
+ i < 18 ? r = 1 : i < 48 ? r = 3 : i < 144 ? r = 4 : i < 768 ? r = 5 : r = 6, i < 8 ? a = new be(e) : e.isEven() ? a = new Di(e) : a = new Pe(e);
642
641
  var o = [], c = 3, h = r - 1, u = (1 << r) - 1;
643
642
  if (o[1] = a.convert(this), r > 1) {
644
- var f = w();
643
+ var f = E();
645
644
  for (a.sqrTo(o[1], f); c <= u; )
646
- o[c] = w(), a.mulTo(f, o[c - 2], o[c]), c += 2;
645
+ o[c] = E(), a.mulTo(f, o[c - 2], o[c]), c += 2;
647
646
  }
648
- var _ = t.t - 1, y, d = !0, m = w(), g;
649
- for (i = ft(t[_]) - 1; _ >= 0; ) {
647
+ var _ = t.t - 1, y, d = !0, m = E(), g;
648
+ for (i = Tt(t[_]) - 1; _ >= 0; ) {
650
649
  for (i >= h ? y = t[_] >> i - h & u : (y = (t[_] & (1 << i + 1) - 1) << h - i, _ > 0 && (y |= t[_ - 1] >> this.DB + i - h)), c = r; (y & 1) == 0; )
651
650
  y >>= 1, --c;
652
651
  if ((i -= c) < 0 && (i += this.DB, --_), d)
@@ -664,7 +663,7 @@ var Bt = (
664
663
  var e = t.isEven();
665
664
  if (this.isEven() && e || t.signum() == 0)
666
665
  return n.ZERO;
667
- for (var i = t.clone(), r = this.clone(), s = W(1), a = W(0), o = W(0), c = W(1); i.signum() != 0; ) {
666
+ for (var i = t.clone(), r = this.clone(), s = Q(1), a = Q(0), o = Q(0), c = Q(1); i.signum() != 0; ) {
668
667
  for (; i.isEven(); )
669
668
  i.rShiftTo(1, i), e ? ((!s.isEven() || !a.isEven()) && (s.addTo(this, s), a.subTo(t, a)), s.rShiftTo(1, s)) : a.isEven() || a.subTo(t, a), a.rShiftTo(1, a);
670
669
  for (; r.isEven(); )
@@ -681,7 +680,7 @@ var Bt = (
681
680
  return c;
682
681
  return c.signum() < 0 ? c.add(t) : c;
683
682
  }, n.prototype.pow = function(t) {
684
- return this.exp(t, new hi());
683
+ return this.exp(t, new Oi());
685
684
  }, n.prototype.gcd = function(t) {
686
685
  var e = this.s < 0 ? this.negate() : this.clone(), i = t.s < 0 ? t.negate() : t.clone();
687
686
  if (e.compareTo(i) < 0) {
@@ -696,19 +695,19 @@ var Bt = (
696
695
  return a > 0 && i.lShiftTo(a, i), i;
697
696
  }, n.prototype.isProbablePrime = function(t) {
698
697
  var e, i = this.abs();
699
- if (i.t == 1 && i[0] <= D[D.length - 1]) {
700
- for (e = 0; e < D.length; ++e)
701
- if (i[0] == D[e])
698
+ if (i.t == 1 && i[0] <= N[N.length - 1]) {
699
+ for (e = 0; e < N.length; ++e)
700
+ if (i[0] == N[e])
702
701
  return !0;
703
702
  return !1;
704
703
  }
705
704
  if (i.isEven())
706
705
  return !1;
707
- for (e = 1; e < D.length; ) {
708
- for (var r = D[e], s = e + 1; s < D.length && r < ui; )
709
- r *= D[s++];
706
+ for (e = 1; e < N.length; ) {
707
+ for (var r = N[e], s = e + 1; s < N.length && r < Ri; )
708
+ r *= N[s++];
710
709
  for (r = i.modInt(r); e < s; )
711
- if (r % D[e++] == 0)
710
+ if (r % N[e++] == 0)
712
711
  return !1;
713
712
  }
714
713
  return i.millerRabin(t);
@@ -738,7 +737,7 @@ var Bt = (
738
737
  }
739
738
  this.t = 0, this.s = 0;
740
739
  for (var r = t.length, s = !1, a = 0; --r >= 0; ) {
741
- var o = i == 8 ? +t[r] & 255 : ce(t, r);
740
+ var o = i == 8 ? +t[r] & 255 : Ee(t, r);
742
741
  if (o < 0) {
743
742
  t.charAt(r) == "-" && (s = !0);
744
743
  continue;
@@ -814,19 +813,19 @@ var Bt = (
814
813
  e?.fromInt(0), i != null && this.copyTo(i);
815
814
  return;
816
815
  }
817
- i == null && (i = w());
818
- var a = w(), o = this.s, c = t.s, h = this.DB - ft(r[r.t - 1]);
816
+ i == null && (i = E());
817
+ var a = E(), o = this.s, c = t.s, h = this.DB - Tt(r[r.t - 1]);
819
818
  h > 0 ? (r.lShiftTo(h, a), s.lShiftTo(h, i)) : (r.copyTo(a), s.copyTo(i));
820
819
  var u = a.t, f = a[u - 1];
821
820
  if (f != 0) {
822
- var _ = f * (1 << this.F1) + (u > 1 ? a[u - 2] >> this.F2 : 0), y = this.FV / _, d = (1 << this.F1) / _, m = 1 << this.F2, g = i.t, S = g - u, E = e ?? w();
823
- for (a.dlShiftTo(S, E), i.compareTo(E) >= 0 && (i[i.t++] = 1, i.subTo(E, i)), n.ONE.dlShiftTo(u, E), E.subTo(a, a); a.t < u; )
821
+ var _ = f * (1 << this.F1) + (u > 1 ? a[u - 2] >> this.F2 : 0), y = this.FV / _, d = (1 << this.F1) / _, m = 1 << this.F2, g = i.t, w = g - u, A = e ?? E();
822
+ for (a.dlShiftTo(w, A), i.compareTo(A) >= 0 && (i[i.t++] = 1, i.subTo(A, i)), n.ONE.dlShiftTo(u, A), A.subTo(a, a); a.t < u; )
824
823
  a[a.t++] = 0;
825
- for (; --S >= 0; ) {
826
- var C = i[--g] == f ? this.DM : Math.floor(i[g] * y + (i[g - 1] + m) * d);
827
- if ((i[g] += a.am(0, C, i, S, 0, u)) < C)
828
- for (a.dlShiftTo(S, E), i.subTo(E, i); i[g] < --C; )
829
- i.subTo(E, i);
824
+ for (; --w >= 0; ) {
825
+ var T = i[--g] == f ? this.DM : Math.floor(i[g] * y + (i[g - 1] + m) * d);
826
+ if ((i[g] += a.am(0, T, i, w, 0, u)) < T)
827
+ for (a.dlShiftTo(w, A), i.subTo(A, i); i[g] < --T; )
828
+ i.subTo(A, i);
830
829
  }
831
830
  e != null && (i.drShiftTo(u, e), o != c && n.ZERO.subTo(e, e)), i.t = u, i.clamp(), h > 0 && i.rShiftTo(h, i), o < 0 && n.ZERO.subTo(i, i);
832
831
  }
@@ -844,7 +843,7 @@ var Bt = (
844
843
  }, n.prototype.exp = function(t, e) {
845
844
  if (t > 4294967295 || t < 1)
846
845
  return n.ONE;
847
- var i = w(), r = w(), s = e.convert(this), a = ft(t) - 1;
846
+ var i = E(), r = E(), s = e.convert(this), a = Tt(t) - 1;
848
847
  for (s.copyTo(i); --a >= 0; )
849
848
  if (e.sqrTo(i, r), (t & 1 << a) > 0)
850
849
  e.mulTo(r, s, i);
@@ -858,14 +857,14 @@ var Bt = (
858
857
  }, n.prototype.toRadix = function(t) {
859
858
  if (t == null && (t = 10), this.signum() == 0 || t < 2 || t > 36)
860
859
  return "0";
861
- var e = this.chunkSize(t), i = Math.pow(t, e), r = W(i), s = w(), a = w(), o = "";
860
+ var e = this.chunkSize(t), i = Math.pow(t, e), r = Q(i), s = E(), a = E(), o = "";
862
861
  for (this.divRemTo(r, s, a); s.signum() > 0; )
863
- o = (i + a.intValue()).toString(t).substr(1) + o, s.divRemTo(r, s, a);
862
+ o = (i + a.intValue()).toString(t).substring(1) + o, s.divRemTo(r, s, a);
864
863
  return a.intValue().toString(t) + o;
865
864
  }, n.prototype.fromRadix = function(t, e) {
866
865
  this.fromInt(0), e == null && (e = 10);
867
866
  for (var i = this.chunkSize(e), r = Math.pow(e, i), s = !1, a = 0, o = 0, c = 0; c < t.length; ++c) {
868
- var h = ce(t, c);
867
+ var h = Ee(t, c);
869
868
  if (h < 0) {
870
869
  t.charAt(c) == "-" && this.signum() == 0 && (s = !0);
871
870
  continue;
@@ -878,7 +877,7 @@ var Bt = (
878
877
  if (t < 2)
879
878
  this.fromInt(1);
880
879
  else
881
- for (this.fromNumber(t, i), this.testBit(t - 1) || this.bitwiseTo(n.ONE.shiftLeft(t - 1), lt, this), this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(e); )
880
+ for (this.fromNumber(t, i), this.testBit(t - 1) || this.bitwiseTo(n.ONE.shiftLeft(t - 1), St, this), this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(e); )
882
881
  this.dAddOffset(2, 0), this.bitLength() > t && this.subTo(n.ONE.shiftLeft(t - 1), this);
883
882
  else {
884
883
  var r = [], s = t & 7;
@@ -956,9 +955,9 @@ var Bt = (
956
955
  if (i <= 0)
957
956
  return !1;
958
957
  var r = e.shiftRight(i);
959
- t = t + 1 >> 1, t > D.length && (t = D.length);
960
- for (var s = w(), a = 0; a < t; ++a) {
961
- s.fromInt(D[Math.floor(Math.random() * D.length)]);
958
+ t = t + 1 >> 1, t > N.length && (t = N.length);
959
+ for (var s = E(), a = 0; a < t; ++a) {
960
+ s.fromInt(N[Math.floor(Math.random() * N.length)]);
962
961
  var o = s.modPow(r, this);
963
962
  if (o.compareTo(n.ONE) != 0 && o.compareTo(e) != 0) {
964
963
  for (var c = 1; c++ < i && o.compareTo(e) != 0; )
@@ -970,7 +969,7 @@ var Bt = (
970
969
  }
971
970
  return !0;
972
971
  }, n.prototype.square = function() {
973
- var t = w();
972
+ var t = E();
974
973
  return this.squareTo(t), t;
975
974
  }, n.prototype.gcda = function(t, e) {
976
975
  var i = this.s < 0 ? this.negate() : this.clone(), r = t.s < 0 ? t.negate() : t.clone();
@@ -995,7 +994,7 @@ var Bt = (
995
994
  if (t < 2)
996
995
  this.fromInt(1);
997
996
  else {
998
- this.fromNumber(t, i), this.testBit(t - 1) || this.bitwiseTo(n.ONE.shiftLeft(t - 1), lt, this), this.isEven() && this.dAddOffset(1, 0);
997
+ this.fromNumber(t, i), this.testBit(t - 1) || this.bitwiseTo(n.ONE.shiftLeft(t - 1), St, this), this.isEven() && this.dAddOffset(1, 0);
999
998
  var s = this, a = function() {
1000
999
  s.dAddOffset(2, 0), s.bitLength() > t && s.subTo(n.ONE.shiftLeft(t - 1), s), s.isProbablePrime(e) ? setTimeout(function() {
1001
1000
  r();
@@ -1008,10 +1007,10 @@ var Bt = (
1008
1007
  o.length = (t >> 3) + 1, e.nextBytes(o), c > 0 ? o[0] &= (1 << c) - 1 : o[0] = 0, this.fromString(o, 256);
1009
1008
  }
1010
1009
  }, n;
1011
- }()
1012
- ), hi = (
1010
+ })()
1011
+ ), Oi = (
1013
1012
  /** @class */
1014
- function() {
1013
+ (function() {
1015
1014
  function n() {
1016
1015
  }
1017
1016
  return n.prototype.convert = function(t) {
@@ -1023,10 +1022,10 @@ var Bt = (
1023
1022
  }, n.prototype.sqrTo = function(t, e) {
1024
1023
  t.squareTo(e);
1025
1024
  }, n;
1026
- }()
1027
- ), se = (
1025
+ })()
1026
+ ), be = (
1028
1027
  /** @class */
1029
- function() {
1028
+ (function() {
1030
1029
  function n(t) {
1031
1030
  this.m = t;
1032
1031
  }
@@ -1041,18 +1040,18 @@ var Bt = (
1041
1040
  }, n.prototype.sqrTo = function(t, e) {
1042
1041
  t.squareTo(e), this.reduce(e);
1043
1042
  }, n;
1044
- }()
1045
- ), ae = (
1043
+ })()
1044
+ ), Pe = (
1046
1045
  /** @class */
1047
- function() {
1046
+ (function() {
1048
1047
  function n(t) {
1049
1048
  this.m = t, this.mp = t.invDigit(), this.mpl = this.mp & 32767, this.mph = this.mp >> 15, this.um = (1 << t.DB - 15) - 1, this.mt2 = 2 * t.t;
1050
1049
  }
1051
1050
  return n.prototype.convert = function(t) {
1052
- var e = w();
1053
- return t.abs().dlShiftTo(this.m.t, e), e.divRemTo(this.m, null, e), t.s < 0 && e.compareTo(v.ZERO) > 0 && this.m.subTo(e, e), e;
1051
+ var e = E();
1052
+ return t.abs().dlShiftTo(this.m.t, e), e.divRemTo(this.m, null, e), t.s < 0 && e.compareTo(P.ZERO) > 0 && this.m.subTo(e, e), e;
1054
1053
  }, n.prototype.revert = function(t) {
1055
- var e = w();
1054
+ var e = E();
1056
1055
  return t.copyTo(e), this.reduce(e), e;
1057
1056
  }, n.prototype.reduce = function(t) {
1058
1057
  for (; t.t <= this.mt2; )
@@ -1068,19 +1067,19 @@ var Bt = (
1068
1067
  }, n.prototype.sqrTo = function(t, e) {
1069
1068
  t.squareTo(e), this.reduce(e);
1070
1069
  }, n;
1071
- }()
1072
- ), li = (
1070
+ })()
1071
+ ), Di = (
1073
1072
  /** @class */
1074
- function() {
1073
+ (function() {
1075
1074
  function n(t) {
1076
- this.m = t, this.r2 = w(), this.q3 = w(), v.ONE.dlShiftTo(2 * t.t, this.r2), this.mu = this.r2.divide(t);
1075
+ this.m = t, this.r2 = E(), this.q3 = E(), P.ONE.dlShiftTo(2 * t.t, this.r2), this.mu = this.r2.divide(t);
1077
1076
  }
1078
1077
  return n.prototype.convert = function(t) {
1079
1078
  if (t.s < 0 || t.t > 2 * this.m.t)
1080
1079
  return t.mod(this.m);
1081
1080
  if (t.compareTo(this.m) < 0)
1082
1081
  return t;
1083
- var e = w();
1082
+ var e = E();
1084
1083
  return t.copyTo(e), this.reduce(e), e;
1085
1084
  }, n.prototype.revert = function(t) {
1086
1085
  return t;
@@ -1094,68 +1093,68 @@ var Bt = (
1094
1093
  }, n.prototype.sqrTo = function(t, e) {
1095
1094
  t.squareTo(e), this.reduce(e);
1096
1095
  }, n;
1097
- }()
1096
+ })()
1098
1097
  );
1099
- function w() {
1100
- return new v(null);
1098
+ function E() {
1099
+ return new P(null);
1101
1100
  }
1102
- function A(n, t) {
1103
- return new v(n, t);
1101
+ function C(n, t) {
1102
+ return new P(n, t);
1104
1103
  }
1105
- var oe = typeof navigator < "u";
1106
- oe && re && navigator.appName == "Microsoft Internet Explorer" ? (v.prototype.am = function(t, e, i, r, s, a) {
1104
+ var ve = typeof navigator < "u";
1105
+ ve && ye && navigator.appName == "Microsoft Internet Explorer" ? (P.prototype.am = function(t, e, i, r, s, a) {
1107
1106
  for (var o = e & 32767, c = e >> 15; --a >= 0; ) {
1108
1107
  var h = this[t] & 32767, u = this[t++] >> 15, f = c * h + u * o;
1109
1108
  h = o * h + ((f & 32767) << 15) + i[r] + (s & 1073741823), s = (h >>> 30) + (f >>> 15) + c * u + (s >>> 30), i[r++] = h & 1073741823;
1110
1109
  }
1111
1110
  return s;
1112
- }, z = 30) : oe && re && navigator.appName != "Netscape" ? (v.prototype.am = function(t, e, i, r, s, a) {
1111
+ }, Y = 30) : ve && ye && navigator.appName != "Netscape" ? (P.prototype.am = function(t, e, i, r, s, a) {
1113
1112
  for (; --a >= 0; ) {
1114
1113
  var o = e * this[t++] + i[r] + s;
1115
1114
  s = Math.floor(o / 67108864), i[r++] = o & 67108863;
1116
1115
  }
1117
1116
  return s;
1118
- }, z = 26) : (v.prototype.am = function(t, e, i, r, s, a) {
1117
+ }, Y = 26) : (P.prototype.am = function(t, e, i, r, s, a) {
1119
1118
  for (var o = e & 16383, c = e >> 14; --a >= 0; ) {
1120
1119
  var h = this[t] & 16383, u = this[t++] >> 14, f = c * h + u * o;
1121
1120
  h = o * h + ((f & 16383) << 14) + i[r] + s, s = (h >> 28) + (f >> 14) + c * u, i[r++] = h & 268435455;
1122
1121
  }
1123
1122
  return s;
1124
- }, z = 28);
1125
- v.prototype.DB = z;
1126
- v.prototype.DM = (1 << z) - 1;
1127
- v.prototype.DV = 1 << z;
1128
- var zt = 52;
1129
- v.prototype.FV = Math.pow(2, zt);
1130
- v.prototype.F1 = zt - z;
1131
- v.prototype.F2 = 2 * z - zt;
1132
- var St = [], it, U;
1133
- it = 48;
1134
- for (U = 0; U <= 9; ++U)
1135
- St[it++] = U;
1136
- it = 97;
1137
- for (U = 10; U < 36; ++U)
1138
- St[it++] = U;
1139
- it = 65;
1140
- for (U = 10; U < 36; ++U)
1141
- St[it++] = U;
1142
- function ce(n, t) {
1143
- var e = St[n.charCodeAt(t)];
1123
+ }, Y = 28);
1124
+ P.prototype.DB = Y;
1125
+ P.prototype.DM = (1 << Y) - 1;
1126
+ P.prototype.DV = 1 << Y;
1127
+ var ne = 52;
1128
+ P.prototype.FV = Math.pow(2, ne);
1129
+ P.prototype.F1 = ne - Y;
1130
+ P.prototype.F2 = 2 * Y - ne;
1131
+ var Lt = [], pt, k;
1132
+ pt = 48;
1133
+ for (k = 0; k <= 9; ++k)
1134
+ Lt[pt++] = k;
1135
+ pt = 97;
1136
+ for (k = 10; k < 36; ++k)
1137
+ Lt[pt++] = k;
1138
+ pt = 65;
1139
+ for (k = 10; k < 36; ++k)
1140
+ Lt[pt++] = k;
1141
+ function Ee(n, t) {
1142
+ var e = Lt[n.charCodeAt(t)];
1144
1143
  return e ?? -1;
1145
1144
  }
1146
- function W(n) {
1147
- var t = w();
1145
+ function Q(n) {
1146
+ var t = E();
1148
1147
  return t.fromInt(n), t;
1149
1148
  }
1150
- function ft(n) {
1149
+ function Tt(n) {
1151
1150
  var t = 1, e;
1152
1151
  return (e = n >>> 16) != 0 && (n = e, t += 16), (e = n >> 8) != 0 && (n = e, t += 8), (e = n >> 4) != 0 && (n = e, t += 4), (e = n >> 2) != 0 && (n = e, t += 2), (e = n >> 1) != 0 && (n = e, t += 1), t;
1153
1152
  }
1154
- v.ZERO = W(0);
1155
- v.ONE = W(1);
1156
- var fi = (
1153
+ P.ZERO = Q(0);
1154
+ P.ONE = Q(1);
1155
+ var Ii = (
1157
1156
  /** @class */
1158
- function() {
1157
+ (function() {
1159
1158
  function n() {
1160
1159
  this.i = 0, this.j = 0, this.S = [];
1161
1160
  }
@@ -1170,65 +1169,125 @@ var fi = (
1170
1169
  var t;
1171
1170
  return this.i = this.i + 1 & 255, this.j = this.j + this.S[this.i] & 255, t = this.S[this.i], this.S[this.i] = this.S[this.j], this.S[this.j] = t, this.S[t + this.S[this.i] & 255];
1172
1171
  }, n;
1173
- }()
1172
+ })()
1174
1173
  );
1175
- function pi() {
1176
- return new fi();
1174
+ function Bi() {
1175
+ return new Ii();
1177
1176
  }
1178
- var Te = 256, pt, X = null, M;
1179
- if (X == null) {
1180
- X = [], M = 0;
1181
- var dt = void 0;
1182
- if (typeof window < "u" && window.crypto && window.crypto.getRandomValues) {
1183
- var Nt = new Uint32Array(256);
1184
- for (window.crypto.getRandomValues(Nt), dt = 0; dt < Nt.length; ++dt)
1185
- X[M++] = Nt[dt] & 255;
1186
- }
1187
- var _t = 0, gt = function(n) {
1188
- if (_t = _t || 0, _t >= 256 || M >= Te) {
1189
- window.removeEventListener ? window.removeEventListener("mousemove", gt, !1) : window.detachEvent && window.detachEvent("onmousemove", gt);
1177
+ var He = 256, At, Z = null, F;
1178
+ if (Z == null) {
1179
+ Z = [], F = 0;
1180
+ var Ct = void 0;
1181
+ if (typeof window < "u" && self.crypto && self.crypto.getRandomValues) {
1182
+ var Wt = new Uint32Array(256);
1183
+ for (self.crypto.getRandomValues(Wt), Ct = 0; Ct < Wt.length; ++Ct)
1184
+ Z[F++] = Wt[Ct] & 255;
1185
+ }
1186
+ var Rt = 0, Ot = function(n) {
1187
+ if (Rt = Rt || 0, Rt >= 256 || F >= He) {
1188
+ self.removeEventListener ? self.removeEventListener("mousemove", Ot, !1) : self.detachEvent && self.detachEvent("onmousemove", Ot);
1190
1189
  return;
1191
1190
  }
1192
1191
  try {
1193
1192
  var t = n.x + n.y;
1194
- X[M++] = t & 255, _t += 1;
1193
+ Z[F++] = t & 255, Rt += 1;
1195
1194
  } catch {
1196
1195
  }
1197
1196
  };
1198
- typeof window < "u" && (window.addEventListener ? window.addEventListener("mousemove", gt, !1) : window.attachEvent && window.attachEvent("onmousemove", gt));
1197
+ typeof window < "u" && (self.addEventListener ? self.addEventListener("mousemove", Ot, !1) : self.attachEvent && self.attachEvent("onmousemove", Ot));
1199
1198
  }
1200
- function di() {
1201
- if (pt == null) {
1202
- for (pt = pi(); M < Te; ) {
1199
+ function Ni() {
1200
+ if (At == null) {
1201
+ for (At = Bi(); F < He; ) {
1203
1202
  var n = Math.floor(65536 * Math.random());
1204
- X[M++] = n & 255;
1203
+ Z[F++] = n & 255;
1205
1204
  }
1206
- for (pt.init(X), M = 0; M < X.length; ++M)
1207
- X[M] = 0;
1208
- M = 0;
1205
+ for (At.init(Z), F = 0; F < Z.length; ++F)
1206
+ Z[F] = 0;
1207
+ F = 0;
1209
1208
  }
1210
- return pt.next();
1209
+ return At.next();
1211
1210
  }
1212
- var Ft = (
1211
+ var Vt = (
1213
1212
  /** @class */
1214
- function() {
1213
+ (function() {
1215
1214
  function n() {
1216
1215
  }
1217
1216
  return n.prototype.nextBytes = function(t) {
1218
1217
  for (var e = 0; e < t.length; ++e)
1219
- t[e] = di();
1218
+ t[e] = Ni();
1220
1219
  }, n;
1221
- }()
1220
+ })()
1222
1221
  );
1223
- function _i(n, t) {
1222
+ function Qt(n) {
1223
+ return Vi(Ki(xi(n), n.length * 8));
1224
+ }
1225
+ function we(n) {
1226
+ for (var t = "0123456789abcdef", e = "", i = 0; i < n.length; i++) {
1227
+ var r = n.charCodeAt(i);
1228
+ e += t.charAt(r >>> 4 & 15) + t.charAt(r & 15);
1229
+ }
1230
+ return e;
1231
+ }
1232
+ function xi(n) {
1233
+ for (var t = Array(n.length >> 2), e = 0; e < t.length; e++)
1234
+ t[e] = 0;
1235
+ for (var e = 0; e < n.length * 8; e += 8)
1236
+ t[e >> 5] |= (n.charCodeAt(e / 8) & 255) << 24 - e % 32;
1237
+ return t;
1238
+ }
1239
+ function Vi(n) {
1240
+ for (var t = "", e = 0; e < n.length * 32; e += 8)
1241
+ t += String.fromCharCode(n[e >> 5] >>> 24 - e % 32 & 255);
1242
+ return t;
1243
+ }
1244
+ function W(n, t) {
1245
+ return n >>> t | n << 32 - t;
1246
+ }
1247
+ function We(n, t) {
1248
+ return n >>> t;
1249
+ }
1250
+ function Ui(n, t, e) {
1251
+ return n & t ^ ~n & e;
1252
+ }
1253
+ function Li(n, t, e) {
1254
+ return n & t ^ n & e ^ t & e;
1255
+ }
1256
+ function Mi(n) {
1257
+ return W(n, 2) ^ W(n, 13) ^ W(n, 22);
1258
+ }
1259
+ function ki(n) {
1260
+ return W(n, 6) ^ W(n, 11) ^ W(n, 25);
1261
+ }
1262
+ function Fi(n) {
1263
+ return W(n, 7) ^ W(n, 18) ^ We(n, 3);
1264
+ }
1265
+ function ji(n) {
1266
+ return W(n, 17) ^ W(n, 19) ^ We(n, 10);
1267
+ }
1268
+ var qi = new Array(1116352408, 1899447441, -1245643825, -373957723, 961987163, 1508970993, -1841331548, -1424204075, -670586216, 310598401, 607225278, 1426881987, 1925078388, -2132889090, -1680079193, -1046744716, -459576895, -272742522, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, -1740746414, -1473132947, -1341970488, -1084653625, -958395405, -710438585, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, -2117940946, -1838011259, -1564481375, -1474664885, -1035236496, -949202525, -778901479, -694614492, -200395387, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, -2067236844, -1933114872, -1866530822, -1538233109, -1090935817, -965641998);
1269
+ function Ki(n, t) {
1270
+ var e = new Array(1779033703, -1150833019, 1013904242, -1521486534, 1359893119, -1694144372, 528734635, 1541459225), i = new Array(64), r, s, a, o, c, h, u, f, _, y, d, m;
1271
+ for (n[t >> 5] |= 128 << 24 - t % 32, n[(t + 64 >> 9 << 4) + 15] = t, _ = 0; _ < n.length; _ += 16) {
1272
+ for (r = e[0], s = e[1], a = e[2], o = e[3], c = e[4], h = e[5], u = e[6], f = e[7], y = 0; y < 64; y++)
1273
+ y < 16 ? i[y] = n[y + _] : i[y] = I(I(I(ji(i[y - 2]), i[y - 7]), Fi(i[y - 15])), i[y - 16]), d = I(I(I(I(f, ki(c)), Ui(c, h, u)), qi[y]), i[y]), m = I(Mi(r), Li(r, s, a)), f = u, u = h, h = c, c = I(o, d), o = a, a = s, s = r, r = I(d, m);
1274
+ e[0] = I(r, e[0]), e[1] = I(s, e[1]), e[2] = I(a, e[2]), e[3] = I(o, e[3]), e[4] = I(c, e[4]), e[5] = I(h, e[5]), e[6] = I(u, e[6]), e[7] = I(f, e[7]);
1275
+ }
1276
+ return e;
1277
+ }
1278
+ function I(n, t) {
1279
+ var e = (n & 65535) + (t & 65535), i = (n >> 16) + (t >> 16) + (e >> 16);
1280
+ return i << 16 | e & 65535;
1281
+ }
1282
+ function Hi(n, t) {
1224
1283
  if (t < n.length + 22)
1225
1284
  return console.error("Message too long for RSA"), null;
1226
1285
  for (var e = t - n.length - 6, i = "", r = 0; r < e; r += 2)
1227
1286
  i += "ff";
1228
1287
  var s = "0001" + i + "00" + n;
1229
- return A(s, 16);
1288
+ return C(s, 16);
1230
1289
  }
1231
- function gi(n, t) {
1290
+ function Wi(n, t) {
1232
1291
  if (t < n.length + 11)
1233
1292
  return console.error("Message too long for RSA"), null;
1234
1293
  for (var e = [], i = n.length - 1; i >= 0 && t > 0; ) {
@@ -1236,16 +1295,44 @@ function gi(n, t) {
1236
1295
  r < 128 ? e[--t] = r : r > 127 && r < 2048 ? (e[--t] = r & 63 | 128, e[--t] = r >> 6 | 192) : (e[--t] = r & 63 | 128, e[--t] = r >> 6 & 63 | 128, e[--t] = r >> 12 | 224);
1237
1296
  }
1238
1297
  e[--t] = 0;
1239
- for (var s = new Ft(), a = []; t > 2; ) {
1298
+ for (var s = new Vt(), a = []; t > 2; ) {
1240
1299
  for (a[0] = 0; a[0] == 0; )
1241
1300
  s.nextBytes(a);
1242
1301
  e[--t] = a[0];
1243
1302
  }
1244
- return e[--t] = 2, e[--t] = 0, new v(e);
1303
+ return e[--t] = 2, e[--t] = 0, new P(e);
1304
+ }
1305
+ function Se(n, t, e) {
1306
+ for (var i = "", r = 0; i.length < t; )
1307
+ i += e(String.fromCharCode.apply(String, n.concat([
1308
+ (r & 4278190080) >> 24,
1309
+ (r & 16711680) >> 16,
1310
+ (r & 65280) >> 8,
1311
+ r & 255
1312
+ ]))), r += 1;
1313
+ return i;
1314
+ }
1315
+ var Xi = 32;
1316
+ function zi(n, t) {
1317
+ var e = Xi, i = Qt;
1318
+ if (n.length + 2 * e + 2 > t)
1319
+ throw "Message too long for RSA";
1320
+ var r = "", s;
1321
+ for (s = 0; s < t - n.length - 2 * e - 2; s += 1)
1322
+ r += "\0";
1323
+ var a = i("") + r + "" + n, o = new Array(e);
1324
+ new Vt().nextBytes(o);
1325
+ var c = Se(o, a.length, i), h = [];
1326
+ for (s = 0; s < a.length; s += 1)
1327
+ h[s] = a.charCodeAt(s) ^ c.charCodeAt(s);
1328
+ var u = Se(h, o.length, i), f = [0];
1329
+ for (s = 0; s < o.length; s += 1)
1330
+ f[s + 1] = o[s] ^ u.charCodeAt(s);
1331
+ return new P(f.concat(h));
1245
1332
  }
1246
- var mi = (
1333
+ var Gi = (
1247
1334
  /** @class */
1248
- function() {
1335
+ (function() {
1249
1336
  function n() {
1250
1337
  this.n = null, this.e = 0, this.d = null, this.p = null, this.q = null, this.dmp1 = null, this.dmq1 = null, this.coeff = null;
1251
1338
  }
@@ -1258,65 +1345,66 @@ var mi = (
1258
1345
  e = e.add(this.p);
1259
1346
  return e.subtract(i).multiply(this.coeff).mod(this.p).multiply(this.q).add(i);
1260
1347
  }, n.prototype.setPublic = function(t, e) {
1261
- t != null && e != null && t.length > 0 && e.length > 0 ? (this.n = A(t, 16), this.e = parseInt(e, 16)) : console.error("Invalid RSA public key");
1262
- }, n.prototype.encrypt = function(t) {
1263
- var e = this.n.bitLength() + 7 >> 3, i = gi(t, e);
1264
- if (i == null)
1265
- return null;
1266
- var r = this.doPublic(i);
1348
+ t != null && e != null && t.length > 0 && e.length > 0 ? (this.n = C(t, 16), this.e = parseInt(e, 16)) : console.error("Invalid RSA public key");
1349
+ }, n.prototype.encrypt = function(t, e) {
1350
+ typeof e > "u" && (e = Wi);
1351
+ var i = this.n.bitLength() + 7 >> 3, r = e(t, i);
1267
1352
  if (r == null)
1268
1353
  return null;
1269
- for (var s = r.toString(16), a = s.length, o = 0; o < e * 2 - a; o++)
1270
- s = "0" + s;
1271
- return s;
1354
+ var s = this.doPublic(r);
1355
+ if (s == null)
1356
+ return null;
1357
+ for (var a = s.toString(16), o = a.length, c = 0; c < i * 2 - o; c++)
1358
+ a = "0" + a;
1359
+ return a;
1272
1360
  }, n.prototype.setPrivate = function(t, e, i) {
1273
- t != null && e != null && t.length > 0 && e.length > 0 ? (this.n = A(t, 16), this.e = parseInt(e, 16), this.d = A(i, 16)) : console.error("Invalid RSA private key");
1361
+ t != null && e != null && t.length > 0 && e.length > 0 ? (this.n = C(t, 16), this.e = parseInt(e, 16), this.d = C(i, 16)) : console.error("Invalid RSA private key");
1274
1362
  }, n.prototype.setPrivateEx = function(t, e, i, r, s, a, o, c) {
1275
- t != null && e != null && t.length > 0 && e.length > 0 ? (this.n = A(t, 16), this.e = parseInt(e, 16), this.d = A(i, 16), this.p = A(r, 16), this.q = A(s, 16), this.dmp1 = A(a, 16), this.dmq1 = A(o, 16), this.coeff = A(c, 16)) : console.error("Invalid RSA private key");
1363
+ t != null && e != null && t.length > 0 && e.length > 0 ? (this.n = C(t, 16), this.e = parseInt(e, 16), this.d = C(i, 16), this.p = C(r, 16), this.q = C(s, 16), this.dmp1 = C(a, 16), this.dmq1 = C(o, 16), this.coeff = C(c, 16)) : console.error("Invalid RSA private key");
1276
1364
  }, n.prototype.generate = function(t, e) {
1277
- var i = new Ft(), r = t >> 1;
1365
+ var i = new Vt(), r = t >> 1;
1278
1366
  this.e = parseInt(e, 16);
1279
- for (var s = new v(e, 16); ; ) {
1280
- for (; this.p = new v(t - r, 1, i), !(this.p.subtract(v.ONE).gcd(s).compareTo(v.ONE) == 0 && this.p.isProbablePrime(10)); )
1367
+ for (var s = new P(e, 16); ; ) {
1368
+ for (; this.p = new P(t - r, 1, i), !(this.p.subtract(P.ONE).gcd(s).compareTo(P.ONE) == 0 && this.p.isProbablePrime(10)); )
1281
1369
  ;
1282
- for (; this.q = new v(r, 1, i), !(this.q.subtract(v.ONE).gcd(s).compareTo(v.ONE) == 0 && this.q.isProbablePrime(10)); )
1370
+ for (; this.q = new P(r, 1, i), !(this.q.subtract(P.ONE).gcd(s).compareTo(P.ONE) == 0 && this.q.isProbablePrime(10)); )
1283
1371
  ;
1284
1372
  if (this.p.compareTo(this.q) <= 0) {
1285
1373
  var a = this.p;
1286
1374
  this.p = this.q, this.q = a;
1287
1375
  }
1288
- var o = this.p.subtract(v.ONE), c = this.q.subtract(v.ONE), h = o.multiply(c);
1289
- if (h.gcd(s).compareTo(v.ONE) == 0) {
1376
+ var o = this.p.subtract(P.ONE), c = this.q.subtract(P.ONE), h = o.multiply(c);
1377
+ if (h.gcd(s).compareTo(P.ONE) == 0) {
1290
1378
  this.n = this.p.multiply(this.q), this.d = s.modInverse(h), this.dmp1 = this.d.mod(o), this.dmq1 = this.d.mod(c), this.coeff = this.q.modInverse(this.p);
1291
1379
  break;
1292
1380
  }
1293
1381
  }
1294
1382
  }, n.prototype.decrypt = function(t) {
1295
- var e = A(t, 16), i = this.doPrivate(e);
1296
- return i == null ? null : yi(i, this.n.bitLength() + 7 >> 3);
1383
+ var e = C(t, 16), i = this.doPrivate(e);
1384
+ return i == null ? null : $i(i, this.n.bitLength() + 7 >> 3);
1297
1385
  }, n.prototype.generateAsync = function(t, e, i) {
1298
- var r = new Ft(), s = t >> 1;
1386
+ var r = new Vt(), s = t >> 1;
1299
1387
  this.e = parseInt(e, 16);
1300
- var a = new v(e, 16), o = this, c = function() {
1388
+ var a = new P(e, 16), o = this, c = function() {
1301
1389
  var h = function() {
1302
1390
  if (o.p.compareTo(o.q) <= 0) {
1303
1391
  var _ = o.p;
1304
1392
  o.p = o.q, o.q = _;
1305
1393
  }
1306
- var y = o.p.subtract(v.ONE), d = o.q.subtract(v.ONE), m = y.multiply(d);
1307
- m.gcd(a).compareTo(v.ONE) == 0 ? (o.n = o.p.multiply(o.q), o.d = a.modInverse(m), o.dmp1 = o.d.mod(y), o.dmq1 = o.d.mod(d), o.coeff = o.q.modInverse(o.p), setTimeout(function() {
1394
+ var y = o.p.subtract(P.ONE), d = o.q.subtract(P.ONE), m = y.multiply(d);
1395
+ m.gcd(a).compareTo(P.ONE) == 0 ? (o.n = o.p.multiply(o.q), o.d = a.modInverse(m), o.dmp1 = o.d.mod(y), o.dmq1 = o.d.mod(d), o.coeff = o.q.modInverse(o.p), setTimeout(function() {
1308
1396
  i();
1309
1397
  }, 0)) : setTimeout(c, 0);
1310
1398
  }, u = function() {
1311
- o.q = w(), o.q.fromNumberAsync(s, 1, r, function() {
1312
- o.q.subtract(v.ONE).gcda(a, function(_) {
1313
- _.compareTo(v.ONE) == 0 && o.q.isProbablePrime(10) ? setTimeout(h, 0) : setTimeout(u, 0);
1399
+ o.q = E(), o.q.fromNumberAsync(s, 1, r, function() {
1400
+ o.q.subtract(P.ONE).gcda(a, function(_) {
1401
+ _.compareTo(P.ONE) == 0 && o.q.isProbablePrime(10) ? setTimeout(h, 0) : setTimeout(u, 0);
1314
1402
  });
1315
1403
  });
1316
1404
  }, f = function() {
1317
- o.p = w(), o.p.fromNumberAsync(t - s, 1, r, function() {
1318
- o.p.subtract(v.ONE).gcda(a, function(_) {
1319
- _.compareTo(v.ONE) == 0 && o.p.isProbablePrime(10) ? setTimeout(u, 0) : setTimeout(f, 0);
1405
+ o.p = E(), o.p.fromNumberAsync(t - s, 1, r, function() {
1406
+ o.p.subtract(P.ONE).gcda(a, function(_) {
1407
+ _.compareTo(P.ONE) == 0 && o.p.isProbablePrime(10) ? setTimeout(u, 0) : setTimeout(f, 0);
1320
1408
  });
1321
1409
  });
1322
1410
  };
@@ -1324,24 +1412,25 @@ var mi = (
1324
1412
  };
1325
1413
  setTimeout(c, 0);
1326
1414
  }, n.prototype.sign = function(t, e, i) {
1327
- var r = bi(i), s = r + e(t).toString(), a = _i(s, this.n.bitLength() / 4);
1328
- if (a == null)
1329
- return null;
1330
- var o = this.doPrivate(a);
1415
+ var r = Ji(i), s = r + e(t).toString(), a = this.n.bitLength() / 4, o = Hi(s, a);
1331
1416
  if (o == null)
1332
1417
  return null;
1333
- var c = o.toString(16);
1334
- return (c.length & 1) == 0 ? c : "0" + c;
1418
+ var c = this.doPrivate(o);
1419
+ if (c == null)
1420
+ return null;
1421
+ for (var h = c.toString(16), u = h.length, f = 0; f < a - u; f++)
1422
+ h = "0" + h;
1423
+ return h;
1335
1424
  }, n.prototype.verify = function(t, e, i) {
1336
- var r = A(e, 16), s = this.doPublic(r);
1425
+ var r = C(e, 16), s = this.doPublic(r);
1337
1426
  if (s == null)
1338
1427
  return null;
1339
- var a = s.toString(16).replace(/^1f+00/, ""), o = Pi(a);
1428
+ var a = s.toString(16).replace(/^1f+00/, ""), o = Qi(a);
1340
1429
  return o == i(t).toString();
1341
1430
  }, n;
1342
- }()
1431
+ })()
1343
1432
  );
1344
- function yi(n, t) {
1433
+ function $i(n, t) {
1345
1434
  for (var e = n.toByteArray(), i = 0; i < e.length && e[i] == 0; )
1346
1435
  ++i;
1347
1436
  if (e.length - i != t - 1 || e[i] != 2)
@@ -1355,7 +1444,7 @@ function yi(n, t) {
1355
1444
  }
1356
1445
  return r;
1357
1446
  }
1358
- var mt = {
1447
+ var It = {
1359
1448
  md2: "3020300c06082a864886f70d020205000410",
1360
1449
  md5: "3020300c06082a864886f70d020505000410",
1361
1450
  sha1: "3021300906052b0e03021a05000414",
@@ -1365,64 +1454,25 @@ var mt = {
1365
1454
  sha512: "3051300d060960864801650304020305000440",
1366
1455
  ripemd160: "3021300906052b2403020105000414"
1367
1456
  };
1368
- function bi(n) {
1369
- return mt[n] || "";
1457
+ function Ji(n) {
1458
+ return It[n] || "";
1370
1459
  }
1371
- function Pi(n) {
1372
- for (var t in mt)
1373
- if (mt.hasOwnProperty(t)) {
1374
- var e = mt[t], i = e.length;
1375
- if (n.substr(0, i) == e)
1376
- return n.substr(i);
1460
+ function Qi(n) {
1461
+ for (var t in It)
1462
+ if (It.hasOwnProperty(t)) {
1463
+ var e = It[t], i = e.length;
1464
+ if (n.substring(0, i) == e)
1465
+ return n.substring(i);
1377
1466
  }
1378
1467
  return n;
1379
1468
  }
1380
- /*!
1381
- Copyright (c) 2011, Yahoo! Inc. All rights reserved.
1382
- Code licensed under the BSD License:
1383
- http://developer.yahoo.com/yui/license.html
1384
- version: 2.9.0
1385
- */
1386
- var R = {};
1387
- R.lang = {
1388
- /**
1389
- * Utility to set up the prototype, constructor and superclass properties to
1390
- * support an inheritance strategy that can chain constructors and methods.
1391
- * Static members will not be inherited.
1392
- *
1393
- * @method extend
1394
- * @static
1395
- * @param {Function} subc the object to modify
1396
- * @param {Function} superc the object to inherit
1397
- * @param {Object} overrides additional properties/methods to add to the
1398
- * subclass prototype. These will override the
1399
- * matching items obtained from the superclass
1400
- * if present.
1401
- */
1402
- extend: function(n, t, e) {
1403
- if (!t || !n)
1404
- throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");
1405
- var i = function() {
1406
- };
1407
- if (i.prototype = t.prototype, n.prototype = new i(), n.prototype.constructor = n, n.superclass = t.prototype, t.prototype.constructor == Object.prototype.constructor && (t.prototype.constructor = t), e) {
1408
- var r;
1409
- for (r in e)
1410
- n.prototype[r] = e[r];
1411
- var s = function() {
1412
- }, a = ["toString", "valueOf"];
1413
- try {
1414
- /MSIE/.test(navigator.userAgent) && (s = function(o, c) {
1415
- for (r = 0; r < a.length; r = r + 1) {
1416
- var h = a[r], u = c[h];
1417
- typeof u == "function" && u != Object.prototype[h] && (o[h] = u);
1418
- }
1419
- });
1420
- } catch {
1421
- }
1422
- s(n.prototype, e);
1423
- }
1424
- }
1425
- };
1469
+ function R(n, t, e) {
1470
+ if (!t || !n)
1471
+ throw new Error("extend failed, please check that all dependencies are included.");
1472
+ var i = function() {
1473
+ };
1474
+ i.prototype = t.prototype, n.prototype = new i(), n.prototype.constructor = n, n.superclass = t.prototype, t.prototype.constructor == Object.prototype.constructor && (t.prototype.constructor = t);
1475
+ }
1426
1476
  /**
1427
1477
  * @fileOverview
1428
1478
  * @name asn1-1.0.js
@@ -1439,24 +1489,24 @@ p.asn1.ASN1Util = new function() {
1439
1489
  return t.length % 2 == 1 && (t = "0" + t), t;
1440
1490
  }, this.bigIntToMinTwosComplementsHex = function(n) {
1441
1491
  var t = n.toString(16);
1442
- if (t.substr(0, 1) != "-")
1492
+ if (t.substring(0, 1) != "-")
1443
1493
  t.length % 2 == 1 ? t = "0" + t : t.match(/^[0-7]/) || (t = "00" + t);
1444
1494
  else {
1445
- var e = t.substr(1), i = e.length;
1495
+ var e = t.substring(1), i = e.length;
1446
1496
  i % 2 == 1 ? i += 1 : t.match(/^[0-7]/) || (i += 2);
1447
1497
  for (var r = "", s = 0; s < i; s++)
1448
1498
  r += "f";
1449
- var a = new v(r, 16), o = a.xor(n).add(v.ONE);
1499
+ var a = new P(r, 16), o = a.xor(n).add(P.ONE);
1450
1500
  t = o.toString(16).replace(/^-/, "");
1451
1501
  }
1452
1502
  return t;
1453
1503
  }, this.getPEMStringFromHex = function(n, t) {
1454
1504
  return hextopem(n, t);
1455
1505
  }, this.newObject = function(n) {
1456
- var t = p, e = t.asn1, i = e.DERBoolean, r = e.DERInteger, s = e.DERBitString, a = e.DEROctetString, o = e.DERNull, c = e.DERObjectIdentifier, h = e.DEREnumerated, u = e.DERUTF8String, f = e.DERNumericString, _ = e.DERPrintableString, y = e.DERTeletexString, d = e.DERIA5String, m = e.DERUTCTime, g = e.DERGeneralizedTime, S = e.DERSequence, E = e.DERSet, C = e.DERTaggedObject, I = e.ASN1Util.newObject, O = Object.keys(n);
1457
- if (O.length != 1)
1506
+ var t = p, e = t.asn1, i = e.DERBoolean, r = e.DERInteger, s = e.DERBitString, a = e.DEROctetString, o = e.DERNull, c = e.DERObjectIdentifier, h = e.DEREnumerated, u = e.DERUTF8String, f = e.DERNumericString, _ = e.DERPrintableString, y = e.DERTeletexString, d = e.DERIA5String, m = e.DERUTCTime, g = e.DERGeneralizedTime, w = e.DERSequence, A = e.DERSet, T = e.DERTaggedObject, O = e.ASN1Util.newObject, x = Object.keys(n);
1507
+ if (x.length != 1)
1458
1508
  throw "key of param shall be only one.";
1459
- var b = O[0];
1509
+ var b = x[0];
1460
1510
  if (":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":" + b + ":") == -1)
1461
1511
  throw "undefined key: " + b;
1462
1512
  if (b == "bool")
@@ -1488,33 +1538,33 @@ p.asn1.ASN1Util = new function() {
1488
1538
  if (b == "gentime")
1489
1539
  return new g(n[b]);
1490
1540
  if (b == "seq") {
1491
- for (var V = n[b], F = [], j = 0; j < V.length; j++) {
1492
- var It = I(V[j]);
1493
- F.push(It);
1541
+ for (var D = n[b], X = [], M = 0; M < D.length; M++) {
1542
+ var st = O(D[M]);
1543
+ X.push(st);
1494
1544
  }
1495
- return new S({ array: F });
1545
+ return new w({ array: X });
1496
1546
  }
1497
1547
  if (b == "set") {
1498
- for (var V = n[b], F = [], j = 0; j < V.length; j++) {
1499
- var It = I(V[j]);
1500
- F.push(It);
1548
+ for (var D = n[b], X = [], M = 0; M < D.length; M++) {
1549
+ var st = O(D[M]);
1550
+ X.push(st);
1501
1551
  }
1502
- return new E({ array: F });
1552
+ return new A({ array: X });
1503
1553
  }
1504
1554
  if (b == "tag") {
1505
- var L = n[b];
1506
- if (Object.prototype.toString.call(L) === "[object Array]" && L.length == 3) {
1507
- var Qe = I(L[2]);
1508
- return new C({
1509
- tag: L[0],
1510
- explicit: L[1],
1511
- obj: Qe
1555
+ var V = n[b];
1556
+ if (Object.prototype.toString.call(V) === "[object Array]" && V.length == 3) {
1557
+ var at = O(V[2]);
1558
+ return new T({
1559
+ tag: V[0],
1560
+ explicit: V[1],
1561
+ obj: at
1512
1562
  });
1513
1563
  } else {
1514
- var ht = {};
1515
- if (L.explicit !== void 0 && (ht.explicit = L.explicit), L.tag !== void 0 && (ht.tag = L.tag), L.obj === void 0)
1564
+ var q = {};
1565
+ if (V.explicit !== void 0 && (q.explicit = V.explicit), V.tag !== void 0 && (q.tag = V.tag), V.obj === void 0)
1516
1566
  throw "obj shall be specified for 'tag'.";
1517
- return ht.obj = I(L.obj), new C(ht);
1567
+ return q.obj = O(V.obj), new T(q);
1518
1568
  }
1519
1569
  }
1520
1570
  }, this.jsonToASN1HEX = function(n) {
@@ -1523,10 +1573,10 @@ p.asn1.ASN1Util = new function() {
1523
1573
  };
1524
1574
  }();
1525
1575
  p.asn1.ASN1Util.oidHexToInt = function(n) {
1526
- for (var r = "", t = parseInt(n.substr(0, 2), 16), e = Math.floor(t / 40), i = t % 40, r = e + "." + i, s = "", a = 2; a < n.length; a += 2) {
1527
- var o = parseInt(n.substr(a, 2), 16), c = ("00000000" + o.toString(2)).slice(-8);
1528
- if (s = s + c.substr(1, 7), c.substr(0, 1) == "0") {
1529
- var h = new v(s, 2);
1576
+ for (var r = "", t = parseInt(n.substring(0, 2), 16), e = Math.floor(t / 40), i = t % 40, r = e + "." + i, s = "", a = 2; a < n.length; a += 2) {
1577
+ var o = parseInt(n.substring(a, a + 2), 16), c = ("00000000" + o.toString(2)).slice(-8);
1578
+ if (s = s + c.substring(1, 8), c.substring(0, 1) == "0") {
1579
+ var h = new P(s, 2);
1530
1580
  r = r + "." + h.toString(10), s = "";
1531
1581
  }
1532
1582
  }
@@ -1537,13 +1587,13 @@ p.asn1.ASN1Util.oidIntToHex = function(n) {
1537
1587
  var c = o.toString(16);
1538
1588
  return c.length == 1 && (c = "0" + c), c;
1539
1589
  }, e = function(o) {
1540
- var c = "", h = new v(o, 10), u = h.toString(2), f = 7 - u.length % 7;
1590
+ var c = "", h = new P(o, 10), u = h.toString(2), f = 7 - u.length % 7;
1541
1591
  f == 7 && (f = 0);
1542
1592
  for (var _ = "", y = 0; y < f; y++)
1543
1593
  _ += "0";
1544
1594
  u = _ + u;
1545
1595
  for (var y = 0; y < u.length - 1; y += 7) {
1546
- var d = u.substr(y, 7);
1596
+ var d = u.substring(y, y + 7);
1547
1597
  y != u.length - 7 && (d = "1" + d), c += t(parseInt(d, 2));
1548
1598
  }
1549
1599
  return c;
@@ -1590,7 +1640,7 @@ p.asn1.DERAbstractString = function(n) {
1590
1640
  return this.hV;
1591
1641
  }, typeof n < "u" && (typeof n == "string" ? this.setString(n) : typeof n.str < "u" ? this.setString(n.str) : typeof n.hex < "u" && this.setStringHex(n.hex));
1592
1642
  };
1593
- R.lang.extend(p.asn1.DERAbstractString, p.asn1.ASN1Object);
1643
+ R(p.asn1.DERAbstractString, p.asn1.ASN1Object);
1594
1644
  p.asn1.DERAbstractTime = function(n) {
1595
1645
  p.asn1.DERAbstractTime.superclass.constructor.call(this), this.localDateToUTC = function(t) {
1596
1646
  utc = t.getTime() + t.getTimezoneOffset() * 6e4;
@@ -1598,7 +1648,7 @@ p.asn1.DERAbstractTime = function(n) {
1598
1648
  return e;
1599
1649
  }, this.formatDate = function(t, e, i) {
1600
1650
  var r = this.zeroPadding, s = this.localDateToUTC(t), a = String(s.getFullYear());
1601
- e == "utc" && (a = a.substr(2, 2));
1651
+ e == "utc" && (a = a.substring(2, 4));
1602
1652
  var o = r(String(s.getMonth() + 1), 2), c = r(String(s.getDate()), 2), h = r(String(s.getHours()), 2), u = r(String(s.getMinutes()), 2), f = r(String(s.getSeconds()), 2), _ = a + o + c + h + u + f;
1603
1653
  if (i === !0) {
1604
1654
  var y = s.getMilliseconds();
@@ -1621,7 +1671,7 @@ p.asn1.DERAbstractTime = function(n) {
1621
1671
  return this.hV;
1622
1672
  };
1623
1673
  };
1624
- R.lang.extend(p.asn1.DERAbstractTime, p.asn1.ASN1Object);
1674
+ R(p.asn1.DERAbstractTime, p.asn1.ASN1Object);
1625
1675
  p.asn1.DERAbstractStructured = function(n) {
1626
1676
  p.asn1.DERAbstractString.superclass.constructor.call(this), this.setByASN1ObjectArray = function(t) {
1627
1677
  this.hTLV = null, this.isModified = !0, this.asn1Array = t;
@@ -1629,16 +1679,16 @@ p.asn1.DERAbstractStructured = function(n) {
1629
1679
  this.hTLV = null, this.isModified = !0, this.asn1Array.push(t);
1630
1680
  }, this.asn1Array = new Array(), typeof n < "u" && typeof n.array < "u" && (this.asn1Array = n.array);
1631
1681
  };
1632
- R.lang.extend(p.asn1.DERAbstractStructured, p.asn1.ASN1Object);
1682
+ R(p.asn1.DERAbstractStructured, p.asn1.ASN1Object);
1633
1683
  p.asn1.DERBoolean = function() {
1634
1684
  p.asn1.DERBoolean.superclass.constructor.call(this), this.hT = "01", this.hTLV = "0101ff";
1635
1685
  };
1636
- R.lang.extend(p.asn1.DERBoolean, p.asn1.ASN1Object);
1686
+ R(p.asn1.DERBoolean, p.asn1.ASN1Object);
1637
1687
  p.asn1.DERInteger = function(n) {
1638
1688
  p.asn1.DERInteger.superclass.constructor.call(this), this.hT = "02", this.setByBigInteger = function(t) {
1639
1689
  this.hTLV = null, this.isModified = !0, this.hV = p.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t);
1640
1690
  }, this.setByInteger = function(t) {
1641
- var e = new v(String(t), 10);
1691
+ var e = new P(String(t), 10);
1642
1692
  this.setByBigInteger(e);
1643
1693
  }, this.setValueHex = function(t) {
1644
1694
  this.hV = t;
@@ -1646,7 +1696,7 @@ p.asn1.DERInteger = function(n) {
1646
1696
  return this.hV;
1647
1697
  }, typeof n < "u" && (typeof n.bigint < "u" ? this.setByBigInteger(n.bigint) : typeof n.int < "u" ? this.setByInteger(n.int) : typeof n == "number" ? this.setByInteger(n) : typeof n.hex < "u" && this.setValueHex(n.hex));
1648
1698
  };
1649
- R.lang.extend(p.asn1.DERInteger, p.asn1.ASN1Object);
1699
+ R(p.asn1.DERInteger, p.asn1.ASN1Object);
1650
1700
  p.asn1.DERBitString = function(n) {
1651
1701
  if (n !== void 0 && typeof n.obj < "u") {
1652
1702
  var t = p.asn1.ASN1Util.newObject(n.obj);
@@ -1666,7 +1716,7 @@ p.asn1.DERBitString = function(n) {
1666
1716
  for (var r = 0; r <= i; r++)
1667
1717
  e += "0";
1668
1718
  for (var s = "", r = 0; r < e.length - 1; r += 8) {
1669
- var a = e.substr(r, 8), o = parseInt(a, 2).toString(16);
1719
+ var a = e.substring(r, r + 8), o = parseInt(a, 2).toString(16);
1670
1720
  o.length == 1 && (o = "0" + o), s += o;
1671
1721
  }
1672
1722
  this.hTLV = null, this.isModified = !0, this.hV = "0" + i + s;
@@ -1682,7 +1732,7 @@ p.asn1.DERBitString = function(n) {
1682
1732
  return this.hV;
1683
1733
  }, typeof n < "u" && (typeof n == "string" && n.toLowerCase().match(/^[0-9a-f]+$/) ? this.setHexValueIncludingUnusedBits(n) : typeof n.hex < "u" ? this.setHexValueIncludingUnusedBits(n.hex) : typeof n.bin < "u" ? this.setByBinaryString(n.bin) : typeof n.array < "u" && this.setByBooleanArray(n.array));
1684
1734
  };
1685
- R.lang.extend(p.asn1.DERBitString, p.asn1.ASN1Object);
1735
+ R(p.asn1.DERBitString, p.asn1.ASN1Object);
1686
1736
  p.asn1.DEROctetString = function(n) {
1687
1737
  if (n !== void 0 && typeof n.obj < "u") {
1688
1738
  var t = p.asn1.ASN1Util.newObject(n.obj);
@@ -1690,23 +1740,23 @@ p.asn1.DEROctetString = function(n) {
1690
1740
  }
1691
1741
  p.asn1.DEROctetString.superclass.constructor.call(this, n), this.hT = "04";
1692
1742
  };
1693
- R.lang.extend(p.asn1.DEROctetString, p.asn1.DERAbstractString);
1743
+ R(p.asn1.DEROctetString, p.asn1.DERAbstractString);
1694
1744
  p.asn1.DERNull = function() {
1695
1745
  p.asn1.DERNull.superclass.constructor.call(this), this.hT = "05", this.hTLV = "0500";
1696
1746
  };
1697
- R.lang.extend(p.asn1.DERNull, p.asn1.ASN1Object);
1747
+ R(p.asn1.DERNull, p.asn1.ASN1Object);
1698
1748
  p.asn1.DERObjectIdentifier = function(n) {
1699
1749
  var t = function(i) {
1700
1750
  var r = i.toString(16);
1701
1751
  return r.length == 1 && (r = "0" + r), r;
1702
1752
  }, e = function(i) {
1703
- var r = "", s = new v(i, 10), a = s.toString(2), o = 7 - a.length % 7;
1753
+ var r = "", s = new P(i, 10), a = s.toString(2), o = 7 - a.length % 7;
1704
1754
  o == 7 && (o = 0);
1705
1755
  for (var c = "", h = 0; h < o; h++)
1706
1756
  c += "0";
1707
1757
  a = c + a;
1708
1758
  for (var h = 0; h < a.length - 1; h += 7) {
1709
- var u = a.substr(h, 7);
1759
+ var u = a.substring(h, h + 7);
1710
1760
  h != a.length - 7 && (u = "1" + u), r += t(parseInt(u, 2));
1711
1761
  }
1712
1762
  return r;
@@ -1731,12 +1781,12 @@ p.asn1.DERObjectIdentifier = function(n) {
1731
1781
  return this.hV;
1732
1782
  }, n !== void 0 && (typeof n == "string" ? n.match(/^[0-2].[0-9.]+$/) ? this.setValueOidString(n) : this.setValueName(n) : n.oid !== void 0 ? this.setValueOidString(n.oid) : n.hex !== void 0 ? this.setValueHex(n.hex) : n.name !== void 0 && this.setValueName(n.name));
1733
1783
  };
1734
- R.lang.extend(p.asn1.DERObjectIdentifier, p.asn1.ASN1Object);
1784
+ R(p.asn1.DERObjectIdentifier, p.asn1.ASN1Object);
1735
1785
  p.asn1.DEREnumerated = function(n) {
1736
1786
  p.asn1.DEREnumerated.superclass.constructor.call(this), this.hT = "0a", this.setByBigInteger = function(t) {
1737
1787
  this.hTLV = null, this.isModified = !0, this.hV = p.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t);
1738
1788
  }, this.setByInteger = function(t) {
1739
- var e = new v(String(t), 10);
1789
+ var e = new P(String(t), 10);
1740
1790
  this.setByBigInteger(e);
1741
1791
  }, this.setValueHex = function(t) {
1742
1792
  this.hV = t;
@@ -1744,27 +1794,27 @@ p.asn1.DEREnumerated = function(n) {
1744
1794
  return this.hV;
1745
1795
  }, typeof n < "u" && (typeof n.int < "u" ? this.setByInteger(n.int) : typeof n == "number" ? this.setByInteger(n) : typeof n.hex < "u" && this.setValueHex(n.hex));
1746
1796
  };
1747
- R.lang.extend(p.asn1.DEREnumerated, p.asn1.ASN1Object);
1797
+ R(p.asn1.DEREnumerated, p.asn1.ASN1Object);
1748
1798
  p.asn1.DERUTF8String = function(n) {
1749
1799
  p.asn1.DERUTF8String.superclass.constructor.call(this, n), this.hT = "0c";
1750
1800
  };
1751
- R.lang.extend(p.asn1.DERUTF8String, p.asn1.DERAbstractString);
1801
+ R(p.asn1.DERUTF8String, p.asn1.DERAbstractString);
1752
1802
  p.asn1.DERNumericString = function(n) {
1753
1803
  p.asn1.DERNumericString.superclass.constructor.call(this, n), this.hT = "12";
1754
1804
  };
1755
- R.lang.extend(p.asn1.DERNumericString, p.asn1.DERAbstractString);
1805
+ R(p.asn1.DERNumericString, p.asn1.DERAbstractString);
1756
1806
  p.asn1.DERPrintableString = function(n) {
1757
1807
  p.asn1.DERPrintableString.superclass.constructor.call(this, n), this.hT = "13";
1758
1808
  };
1759
- R.lang.extend(p.asn1.DERPrintableString, p.asn1.DERAbstractString);
1809
+ R(p.asn1.DERPrintableString, p.asn1.DERAbstractString);
1760
1810
  p.asn1.DERTeletexString = function(n) {
1761
1811
  p.asn1.DERTeletexString.superclass.constructor.call(this, n), this.hT = "14";
1762
1812
  };
1763
- R.lang.extend(p.asn1.DERTeletexString, p.asn1.DERAbstractString);
1813
+ R(p.asn1.DERTeletexString, p.asn1.DERAbstractString);
1764
1814
  p.asn1.DERIA5String = function(n) {
1765
1815
  p.asn1.DERIA5String.superclass.constructor.call(this, n), this.hT = "16";
1766
1816
  };
1767
- R.lang.extend(p.asn1.DERIA5String, p.asn1.DERAbstractString);
1817
+ R(p.asn1.DERIA5String, p.asn1.DERAbstractString);
1768
1818
  p.asn1.DERUTCTime = function(n) {
1769
1819
  p.asn1.DERUTCTime.superclass.constructor.call(this, n), this.hT = "17", this.setByDate = function(t) {
1770
1820
  this.hTLV = null, this.isModified = !0, this.date = t, this.s = this.formatDate(this.date, "utc"), this.hV = stohex(this.s);
@@ -1772,7 +1822,7 @@ p.asn1.DERUTCTime = function(n) {
1772
1822
  return typeof this.date > "u" && typeof this.s > "u" && (this.date = /* @__PURE__ */ new Date(), this.s = this.formatDate(this.date, "utc"), this.hV = stohex(this.s)), this.hV;
1773
1823
  }, n !== void 0 && (n.str !== void 0 ? this.setString(n.str) : typeof n == "string" && n.match(/^[0-9]{12}Z$/) ? this.setString(n) : n.hex !== void 0 ? this.setStringHex(n.hex) : n.date !== void 0 && this.setByDate(n.date));
1774
1824
  };
1775
- R.lang.extend(p.asn1.DERUTCTime, p.asn1.DERAbstractTime);
1825
+ R(p.asn1.DERUTCTime, p.asn1.DERAbstractTime);
1776
1826
  p.asn1.DERGeneralizedTime = function(n) {
1777
1827
  p.asn1.DERGeneralizedTime.superclass.constructor.call(this, n), this.hT = "18", this.withMillis = !1, this.setByDate = function(t) {
1778
1828
  this.hTLV = null, this.isModified = !0, this.date = t, this.s = this.formatDate(this.date, "gen", this.withMillis), this.hV = stohex(this.s);
@@ -1780,7 +1830,7 @@ p.asn1.DERGeneralizedTime = function(n) {
1780
1830
  return this.date === void 0 && this.s === void 0 && (this.date = /* @__PURE__ */ new Date(), this.s = this.formatDate(this.date, "gen", this.withMillis), this.hV = stohex(this.s)), this.hV;
1781
1831
  }, n !== void 0 && (n.str !== void 0 ? this.setString(n.str) : typeof n == "string" && n.match(/^[0-9]{14}Z$/) ? this.setString(n) : n.hex !== void 0 ? this.setStringHex(n.hex) : n.date !== void 0 && this.setByDate(n.date), n.millis === !0 && (this.withMillis = !0));
1782
1832
  };
1783
- R.lang.extend(p.asn1.DERGeneralizedTime, p.asn1.DERAbstractTime);
1833
+ R(p.asn1.DERGeneralizedTime, p.asn1.DERAbstractTime);
1784
1834
  p.asn1.DERSequence = function(n) {
1785
1835
  p.asn1.DERSequence.superclass.constructor.call(this, n), this.hT = "30", this.getFreshValueHex = function() {
1786
1836
  for (var t = "", e = 0; e < this.asn1Array.length; e++) {
@@ -1790,7 +1840,7 @@ p.asn1.DERSequence = function(n) {
1790
1840
  return this.hV = t, this.hV;
1791
1841
  };
1792
1842
  };
1793
- R.lang.extend(p.asn1.DERSequence, p.asn1.DERAbstractStructured);
1843
+ R(p.asn1.DERSequence, p.asn1.DERAbstractStructured);
1794
1844
  p.asn1.DERSet = function(n) {
1795
1845
  p.asn1.DERSet.superclass.constructor.call(this, n), this.hT = "31", this.sortFlag = !0, this.getFreshValueHex = function() {
1796
1846
  for (var t = new Array(), e = 0; e < this.asn1Array.length; e++) {
@@ -1800,7 +1850,7 @@ p.asn1.DERSet = function(n) {
1800
1850
  return this.sortFlag == !0 && t.sort(), this.hV = t.join(""), this.hV;
1801
1851
  }, typeof n < "u" && typeof n.sortflag < "u" && n.sortflag == !1 && (this.sortFlag = !1);
1802
1852
  };
1803
- R.lang.extend(p.asn1.DERSet, p.asn1.DERAbstractStructured);
1853
+ R(p.asn1.DERSet, p.asn1.DERAbstractStructured);
1804
1854
  p.asn1.DERTaggedObject = function(n) {
1805
1855
  p.asn1.DERTaggedObject.superclass.constructor.call(this), this.hT = "a0", this.hV = "", this.isExplicit = !0, this.asn1Object = null, this.setASN1Object = function(t, e, i) {
1806
1856
  this.hT = e, this.isExplicit = t, this.asn1Object = i, this.isExplicit ? (this.hV = this.asn1Object.getEncodedHex(), this.hTLV = null, this.isModified = !0) : (this.hV = null, this.hTLV = i.getEncodedHex(), this.hTLV = this.hTLV.replace(/^../, e), this.isModified = !1);
@@ -1808,8 +1858,8 @@ p.asn1.DERTaggedObject = function(n) {
1808
1858
  return this.hV;
1809
1859
  }, typeof n < "u" && (typeof n.tag < "u" && (this.hT = n.tag), typeof n.explicit < "u" && (this.isExplicit = n.explicit), typeof n.obj < "u" && (this.asn1Object = n.obj, this.setASN1Object(this.isExplicit, this.hT, this.asn1Object)));
1810
1860
  };
1811
- R.lang.extend(p.asn1.DERTaggedObject, p.asn1.ASN1Object);
1812
- var vi = /* @__PURE__ */ function() {
1861
+ R(p.asn1.DERTaggedObject, p.asn1.ASN1Object);
1862
+ var Zi = /* @__PURE__ */ (function() {
1813
1863
  var n = function(t, e) {
1814
1864
  return n = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(i, r) {
1815
1865
  i.__proto__ = r;
@@ -1826,37 +1876,37 @@ var vi = /* @__PURE__ */ function() {
1826
1876
  }
1827
1877
  t.prototype = e === null ? Object.create(e) : (i.prototype = e.prototype, new i());
1828
1878
  };
1829
- }(), ue = (
1879
+ })(), Te = (
1830
1880
  /** @class */
1831
- function(n) {
1832
- vi(t, n);
1881
+ (function(n) {
1882
+ Zi(t, n);
1833
1883
  function t(e) {
1834
1884
  var i = n.call(this) || this;
1835
1885
  return e && (typeof e == "string" ? i.parseKey(e) : (t.hasPrivateKeyProperty(e) || t.hasPublicKeyProperty(e)) && i.parsePropertiesFrom(e)), i;
1836
1886
  }
1837
1887
  return t.prototype.parseKey = function(e) {
1838
1888
  try {
1839
- var i = 0, r = 0, s = /^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/, a = s.test(e) ? ri.decode(e) : kt.unarmor(e), o = oi.decode(a);
1889
+ var i = 0, r = 0, s = /^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/, a = s.test(e) ? wi.decode(e) : Jt.unarmor(e), o = Ai.decode(a);
1840
1890
  if (o.sub.length === 3 && (o = o.sub[2].sub[0]), o.sub.length === 9) {
1841
- i = o.sub[1].getHexStringValue(), this.n = A(i, 16), r = o.sub[2].getHexStringValue(), this.e = parseInt(r, 16);
1891
+ i = o.sub[1].getHexStringValue(), this.n = C(i, 16), r = o.sub[2].getHexStringValue(), this.e = parseInt(r, 16);
1842
1892
  var c = o.sub[3].getHexStringValue();
1843
- this.d = A(c, 16);
1893
+ this.d = C(c, 16);
1844
1894
  var h = o.sub[4].getHexStringValue();
1845
- this.p = A(h, 16);
1895
+ this.p = C(h, 16);
1846
1896
  var u = o.sub[5].getHexStringValue();
1847
- this.q = A(u, 16);
1897
+ this.q = C(u, 16);
1848
1898
  var f = o.sub[6].getHexStringValue();
1849
- this.dmp1 = A(f, 16);
1899
+ this.dmp1 = C(f, 16);
1850
1900
  var _ = o.sub[7].getHexStringValue();
1851
- this.dmq1 = A(_, 16);
1901
+ this.dmq1 = C(_, 16);
1852
1902
  var y = o.sub[8].getHexStringValue();
1853
- this.coeff = A(y, 16);
1903
+ this.coeff = C(y, 16);
1854
1904
  } else if (o.sub.length === 2)
1855
1905
  if (o.sub[0].sub) {
1856
1906
  var d = o.sub[1], m = d.sub[0];
1857
- i = m.sub[0].getHexStringValue(), this.n = A(i, 16), r = m.sub[1].getHexStringValue(), this.e = parseInt(r, 16);
1907
+ i = m.sub[0].getHexStringValue(), this.n = C(i, 16), r = m.sub[1].getHexStringValue(), this.e = parseInt(r, 16);
1858
1908
  } else
1859
- i = o.sub[0].getHexStringValue(), this.n = A(i, 16), r = o.sub[1].getHexStringValue(), this.e = parseInt(r, 16);
1909
+ i = o.sub[0].getHexStringValue(), this.n = C(i, 16), r = o.sub[1].getHexStringValue(), this.e = parseInt(r, 16);
1860
1910
  else
1861
1911
  return !1;
1862
1912
  return !0;
@@ -1879,11 +1929,12 @@ var vi = /* @__PURE__ */ function() {
1879
1929
  }, i = new p.asn1.DERSequence(e);
1880
1930
  return i.getEncodedHex();
1881
1931
  }, t.prototype.getPrivateBaseKeyB64 = function() {
1882
- return vt(this.getPrivateBaseKey());
1932
+ return yt(this.getPrivateBaseKey());
1883
1933
  }, t.prototype.getPublicBaseKey = function() {
1884
1934
  var e = new p.asn1.DERSequence({
1885
1935
  array: [
1886
1936
  new p.asn1.DERObjectIdentifier({ oid: "1.2.840.113549.1.1.1" }),
1937
+ // RSA Encryption pkcs #1 oid
1887
1938
  new p.asn1.DERNull()
1888
1939
  ]
1889
1940
  }), i = new p.asn1.DERSequence({
@@ -1898,7 +1949,7 @@ var vi = /* @__PURE__ */ function() {
1898
1949
  });
1899
1950
  return s.getEncodedHex();
1900
1951
  }, t.prototype.getPublicBaseKeyB64 = function() {
1901
- return vt(this.getPublicBaseKey());
1952
+ return yt(this.getPublicBaseKey());
1902
1953
  }, t.wordwrap = function(e, i) {
1903
1954
  if (i = i || 64, !e)
1904
1955
  return e;
@@ -1923,46 +1974,66 @@ var vi = /* @__PURE__ */ function() {
1923
1974
  }, t.prototype.parsePropertiesFrom = function(e) {
1924
1975
  this.n = e.n, this.e = e.e, e.hasOwnProperty("d") && (this.d = e.d, this.p = e.p, this.q = e.q, this.dmp1 = e.dmp1, this.dmq1 = e.dmq1, this.coeff = e.coeff);
1925
1976
  }, t;
1926
- }(mi)
1927
- ), Vt, wi = typeof process < "u" ? (Vt = process.env) === null || Vt === void 0 ? void 0 : Vt.npm_package_version : void 0, Ei = (
1977
+ })(Gi)
1978
+ ), Xt, Yi = typeof process < "u" ? (Xt = process.env) === null || Xt === void 0 ? void 0 : Xt.npm_package_version : void 0, tn = (
1928
1979
  /** @class */
1929
- function() {
1980
+ (function() {
1930
1981
  function n(t) {
1931
- t === void 0 && (t = {}), t = t || {}, this.default_key_size = t.default_key_size ? parseInt(t.default_key_size, 10) : 1024, this.default_public_exponent = t.default_public_exponent || "010001", this.log = t.log || !1, this.key = null;
1982
+ t === void 0 && (t = {}), this.default_key_size = t.default_key_size ? parseInt(t.default_key_size, 10) : 1024, this.default_public_exponent = t.default_public_exponent || "010001", this.log = t.log || !1, this.key = t.key || null;
1932
1983
  }
1933
1984
  return n.prototype.setKey = function(t) {
1934
- this.log && this.key && console.warn("A key was already set, overriding existing."), this.key = new ue(t);
1985
+ t ? (this.log && this.key && console.warn("A key was already set, overriding existing."), this.key = new Te(t)) : !this.key && this.log && console.error("A key was not set.");
1935
1986
  }, n.prototype.setPrivateKey = function(t) {
1936
1987
  this.setKey(t);
1937
1988
  }, n.prototype.setPublicKey = function(t) {
1938
1989
  this.setKey(t);
1939
1990
  }, n.prototype.decrypt = function(t) {
1940
1991
  try {
1941
- return this.getKey().decrypt(ie(t));
1992
+ return this.getKey().decrypt(ge(t));
1942
1993
  } catch {
1943
1994
  return !1;
1944
1995
  }
1945
1996
  }, n.prototype.encrypt = function(t) {
1946
1997
  try {
1947
- return vt(this.getKey().encrypt(t));
1998
+ return yt(this.getKey().encrypt(t));
1999
+ } catch {
2000
+ return !1;
2001
+ }
2002
+ }, n.prototype.encryptOAEP = function(t) {
2003
+ try {
2004
+ return yt(this.getKey().encrypt(t, zi));
1948
2005
  } catch {
1949
2006
  return !1;
1950
2007
  }
1951
2008
  }, n.prototype.sign = function(t, e, i) {
2009
+ e === void 0 && (e = function(r) {
2010
+ return r;
2011
+ }), i === void 0 && (i = "");
1952
2012
  try {
1953
- return vt(this.getKey().sign(t, e, i));
2013
+ return yt(this.getKey().sign(t, e, i));
1954
2014
  } catch {
1955
2015
  return !1;
1956
2016
  }
2017
+ }, n.prototype.signSha256 = function(t) {
2018
+ return this.sign(t, function(e) {
2019
+ return we(Qt(e));
2020
+ }, "sha256");
1957
2021
  }, n.prototype.verify = function(t, e, i) {
2022
+ i === void 0 && (i = function(r) {
2023
+ return r;
2024
+ });
1958
2025
  try {
1959
- return this.getKey().verify(t, ie(e), i);
2026
+ return this.getKey().verify(t, ge(e), i);
1960
2027
  } catch {
1961
2028
  return !1;
1962
2029
  }
2030
+ }, n.prototype.verifySha256 = function(t, e) {
2031
+ return this.verify(t, e, function(i) {
2032
+ return we(Qt(i));
2033
+ });
1963
2034
  }, n.prototype.getKey = function(t) {
1964
2035
  if (!this.key) {
1965
- if (this.key = new ue(), t && {}.toString.call(t) === "[object Function]") {
2036
+ if (this.key = new Te(), t && {}.toString.call(t) === "[object Function]") {
1966
2037
  this.key.generateAsync(this.default_key_size, this.default_public_exponent, t);
1967
2038
  return;
1968
2039
  }
@@ -1977,51 +2048,63 @@ var vi = /* @__PURE__ */ function() {
1977
2048
  return this.getKey().getPublicKey();
1978
2049
  }, n.prototype.getPublicKeyB64 = function() {
1979
2050
  return this.getKey().getPublicBaseKeyB64();
1980
- }, n.version = wi, n;
1981
- }()
2051
+ }, n.version = Yi, n;
2052
+ })()
1982
2053
  );
1983
- function Ce(n, t) {
2054
+ function Xe(n, t) {
1984
2055
  return function() {
1985
2056
  return n.apply(t, arguments);
1986
2057
  };
1987
2058
  }
1988
- const { toString: Si } = Object.prototype, { getPrototypeOf: Gt } = Object, { iterator: Tt, toStringTag: Ae } = Symbol, Ct = /* @__PURE__ */ ((n) => (t) => {
1989
- const e = Si.call(t);
2059
+ const { toString: en } = Object.prototype, { getPrototypeOf: re } = Object, { iterator: Mt, toStringTag: ze } = Symbol, kt = /* @__PURE__ */ ((n) => (t) => {
2060
+ const e = en.call(t);
1990
2061
  return n[e] || (n[e] = e.slice(8, -1).toLowerCase());
1991
- })(/* @__PURE__ */ Object.create(null)), k = (n) => (n = n.toLowerCase(), (t) => Ct(t) === n), At = (n) => (t) => typeof t === n, { isArray: nt } = Array, ot = At("undefined");
1992
- function Ti(n) {
1993
- return n !== null && !ot(n) && n.constructor !== null && !ot(n.constructor) && B(n.constructor.isBuffer) && n.constructor.isBuffer(n);
2062
+ })(/* @__PURE__ */ Object.create(null)), j = (n) => (n = n.toLowerCase(), (t) => kt(t) === n), Ft = (n) => (t) => typeof t === n, { isArray: dt } = Array, ft = Ft("undefined");
2063
+ function bt(n) {
2064
+ return n !== null && !ft(n) && n.constructor !== null && !ft(n.constructor) && U(n.constructor.isBuffer) && n.constructor.isBuffer(n);
1994
2065
  }
1995
- const Re = k("ArrayBuffer");
1996
- function Ci(n) {
2066
+ const Ge = j("ArrayBuffer");
2067
+ function nn(n) {
1997
2068
  let t;
1998
- return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(n) : t = n && n.buffer && Re(n.buffer), t;
2069
+ return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(n) : t = n && n.buffer && Ge(n.buffer), t;
1999
2070
  }
2000
- const Ai = At("string"), B = At("function"), Oe = At("number"), Rt = (n) => n !== null && typeof n == "object", Ri = (n) => n === !0 || n === !1, yt = (n) => {
2001
- if (Ct(n) !== "object")
2071
+ const rn = Ft("string"), U = Ft("function"), $e = Ft("number"), Pt = (n) => n !== null && typeof n == "object", sn = (n) => n === !0 || n === !1, Bt = (n) => {
2072
+ if (kt(n) !== "object")
2073
+ return !1;
2074
+ const t = re(n);
2075
+ return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(ze in n) && !(Mt in n);
2076
+ }, an = (n) => {
2077
+ if (!Pt(n) || bt(n))
2078
+ return !1;
2079
+ try {
2080
+ return Object.keys(n).length === 0 && Object.getPrototypeOf(n) === Object.prototype;
2081
+ } catch {
2002
2082
  return !1;
2003
- const t = Gt(n);
2004
- return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Ae in n) && !(Tt in n);
2005
- }, Oi = k("Date"), xi = k("File"), Di = k("Blob"), Ii = k("FileList"), Bi = (n) => Rt(n) && B(n.pipe), Ni = (n) => {
2083
+ }
2084
+ }, on = j("Date"), cn = j("File"), un = j("Blob"), hn = j("FileList"), ln = (n) => Pt(n) && U(n.pipe), fn = (n) => {
2006
2085
  let t;
2007
- return n && (typeof FormData == "function" && n instanceof FormData || B(n.append) && ((t = Ct(n)) === "formdata" || // detect form-data instance
2008
- t === "object" && B(n.toString) && n.toString() === "[object FormData]"));
2009
- }, Vi = k("URLSearchParams"), [Ui, Li, Mi, ki] = ["ReadableStream", "Request", "Response", "Headers"].map(k), Fi = (n) => n.trim ? n.trim() : n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
2010
- function ct(n, t, { allOwnKeys: e = !1 } = {}) {
2086
+ return n && (typeof FormData == "function" && n instanceof FormData || U(n.append) && ((t = kt(n)) === "formdata" || // detect form-data instance
2087
+ t === "object" && U(n.toString) && n.toString() === "[object FormData]"));
2088
+ }, pn = j("URLSearchParams"), [dn, _n, gn, mn] = ["ReadableStream", "Request", "Response", "Headers"].map(j), yn = (n) => n.trim ? n.trim() : n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
2089
+ function vt(n, t, { allOwnKeys: e = !1 } = {}) {
2011
2090
  if (n === null || typeof n > "u")
2012
2091
  return;
2013
2092
  let i, r;
2014
- if (typeof n != "object" && (n = [n]), nt(n))
2093
+ if (typeof n != "object" && (n = [n]), dt(n))
2015
2094
  for (i = 0, r = n.length; i < r; i++)
2016
2095
  t.call(null, n[i], i, n);
2017
2096
  else {
2097
+ if (bt(n))
2098
+ return;
2018
2099
  const s = e ? Object.getOwnPropertyNames(n) : Object.keys(n), a = s.length;
2019
2100
  let o;
2020
2101
  for (i = 0; i < a; i++)
2021
2102
  o = s[i], t.call(null, n[o], o, n);
2022
2103
  }
2023
2104
  }
2024
- function xe(n, t) {
2105
+ function Je(n, t) {
2106
+ if (bt(n))
2107
+ return null;
2025
2108
  t = t.toLowerCase();
2026
2109
  const e = Object.keys(n);
2027
2110
  let i = e.length, r;
@@ -2030,75 +2113,75 @@ function xe(n, t) {
2030
2113
  return r;
2031
2114
  return null;
2032
2115
  }
2033
- const $ = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, De = (n) => !ot(n) && n !== $;
2034
- function jt() {
2035
- const { caseless: n } = De(this) && this || {}, t = {}, e = (i, r) => {
2036
- const s = n && xe(t, r) || r;
2037
- yt(t[s]) && yt(i) ? t[s] = jt(t[s], i) : yt(i) ? t[s] = jt({}, i) : nt(i) ? t[s] = i.slice() : t[s] = i;
2116
+ const it = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Qe = (n) => !ft(n) && n !== it;
2117
+ function Zt() {
2118
+ const { caseless: n, skipUndefined: t } = Qe(this) && this || {}, e = {}, i = (r, s) => {
2119
+ const a = n && Je(e, s) || s;
2120
+ Bt(e[a]) && Bt(r) ? e[a] = Zt(e[a], r) : Bt(r) ? e[a] = Zt({}, r) : dt(r) ? e[a] = r.slice() : (!t || !ft(r)) && (e[a] = r);
2038
2121
  };
2039
- for (let i = 0, r = arguments.length; i < r; i++)
2040
- arguments[i] && ct(arguments[i], e);
2041
- return t;
2122
+ for (let r = 0, s = arguments.length; r < s; r++)
2123
+ arguments[r] && vt(arguments[r], i);
2124
+ return e;
2042
2125
  }
2043
- const ji = (n, t, e, { allOwnKeys: i } = {}) => (ct(t, (r, s) => {
2044
- e && B(r) ? n[s] = Ce(r, e) : n[s] = r;
2045
- }, { allOwnKeys: i }), n), qi = (n) => (n.charCodeAt(0) === 65279 && (n = n.slice(1)), n), Ki = (n, t, e, i) => {
2126
+ const bn = (n, t, e, { allOwnKeys: i } = {}) => (vt(t, (r, s) => {
2127
+ e && U(r) ? n[s] = Xe(r, e) : n[s] = r;
2128
+ }, { allOwnKeys: i }), n), Pn = (n) => (n.charCodeAt(0) === 65279 && (n = n.slice(1)), n), vn = (n, t, e, i) => {
2046
2129
  n.prototype = Object.create(t.prototype, i), n.prototype.constructor = n, Object.defineProperty(n, "super", {
2047
2130
  value: t.prototype
2048
2131
  }), e && Object.assign(n.prototype, e);
2049
- }, Hi = (n, t, e, i) => {
2132
+ }, En = (n, t, e, i) => {
2050
2133
  let r, s, a;
2051
2134
  const o = {};
2052
2135
  if (t = t || {}, n == null) return t;
2053
2136
  do {
2054
2137
  for (r = Object.getOwnPropertyNames(n), s = r.length; s-- > 0; )
2055
2138
  a = r[s], (!i || i(a, n, t)) && !o[a] && (t[a] = n[a], o[a] = !0);
2056
- n = e !== !1 && Gt(n);
2139
+ n = e !== !1 && re(n);
2057
2140
  } while (n && (!e || e(n, t)) && n !== Object.prototype);
2058
2141
  return t;
2059
- }, Wi = (n, t, e) => {
2142
+ }, wn = (n, t, e) => {
2060
2143
  n = String(n), (e === void 0 || e > n.length) && (e = n.length), e -= t.length;
2061
2144
  const i = n.indexOf(t, e);
2062
2145
  return i !== -1 && i === e;
2063
- }, Xi = (n) => {
2146
+ }, Sn = (n) => {
2064
2147
  if (!n) return null;
2065
- if (nt(n)) return n;
2148
+ if (dt(n)) return n;
2066
2149
  let t = n.length;
2067
- if (!Oe(t)) return null;
2150
+ if (!$e(t)) return null;
2068
2151
  const e = new Array(t);
2069
2152
  for (; t-- > 0; )
2070
2153
  e[t] = n[t];
2071
2154
  return e;
2072
- }, zi = /* @__PURE__ */ ((n) => (t) => n && t instanceof n)(typeof Uint8Array < "u" && Gt(Uint8Array)), Gi = (n, t) => {
2073
- const i = (n && n[Tt]).call(n);
2155
+ }, Tn = /* @__PURE__ */ ((n) => (t) => n && t instanceof n)(typeof Uint8Array < "u" && re(Uint8Array)), An = (n, t) => {
2156
+ const i = (n && n[Mt]).call(n);
2074
2157
  let r;
2075
2158
  for (; (r = i.next()) && !r.done; ) {
2076
2159
  const s = r.value;
2077
2160
  t.call(n, s[0], s[1]);
2078
2161
  }
2079
- }, $i = (n, t) => {
2162
+ }, Cn = (n, t) => {
2080
2163
  let e;
2081
2164
  const i = [];
2082
2165
  for (; (e = n.exec(t)) !== null; )
2083
2166
  i.push(e);
2084
2167
  return i;
2085
- }, Ji = k("HTMLFormElement"), Qi = (n) => n.toLowerCase().replace(
2168
+ }, Rn = j("HTMLFormElement"), On = (n) => n.toLowerCase().replace(
2086
2169
  /[-_\s]([a-z\d])(\w*)/g,
2087
2170
  function(e, i, r) {
2088
2171
  return i.toUpperCase() + r;
2089
2172
  }
2090
- ), he = (({ hasOwnProperty: n }) => (t, e) => n.call(t, e))(Object.prototype), Zi = k("RegExp"), Ie = (n, t) => {
2173
+ ), Ae = (({ hasOwnProperty: n }) => (t, e) => n.call(t, e))(Object.prototype), Dn = j("RegExp"), Ze = (n, t) => {
2091
2174
  const e = Object.getOwnPropertyDescriptors(n), i = {};
2092
- ct(e, (r, s) => {
2175
+ vt(e, (r, s) => {
2093
2176
  let a;
2094
2177
  (a = t(r, s, n)) !== !1 && (i[s] = a || r);
2095
2178
  }), Object.defineProperties(n, i);
2096
- }, Yi = (n) => {
2097
- Ie(n, (t, e) => {
2098
- if (B(n) && ["arguments", "caller", "callee"].indexOf(e) !== -1)
2179
+ }, In = (n) => {
2180
+ Ze(n, (t, e) => {
2181
+ if (U(n) && ["arguments", "caller", "callee"].indexOf(e) !== -1)
2099
2182
  return !1;
2100
2183
  const i = n[e];
2101
- if (B(i)) {
2184
+ if (U(i)) {
2102
2185
  if (t.enumerable = !1, "writable" in t) {
2103
2186
  t.writable = !1;
2104
2187
  return;
@@ -2108,105 +2191,108 @@ const ji = (n, t, e, { allOwnKeys: i } = {}) => (ct(t, (r, s) => {
2108
2191
  });
2109
2192
  }
2110
2193
  });
2111
- }, tn = (n, t) => {
2194
+ }, Bn = (n, t) => {
2112
2195
  const e = {}, i = (r) => {
2113
2196
  r.forEach((s) => {
2114
2197
  e[s] = !0;
2115
2198
  });
2116
2199
  };
2117
- return nt(n) ? i(n) : i(String(n).split(t)), e;
2118
- }, en = () => {
2119
- }, nn = (n, t) => n != null && Number.isFinite(n = +n) ? n : t;
2120
- function rn(n) {
2121
- return !!(n && B(n.append) && n[Ae] === "FormData" && n[Tt]);
2200
+ return dt(n) ? i(n) : i(String(n).split(t)), e;
2201
+ }, Nn = () => {
2202
+ }, xn = (n, t) => n != null && Number.isFinite(n = +n) ? n : t;
2203
+ function Vn(n) {
2204
+ return !!(n && U(n.append) && n[ze] === "FormData" && n[Mt]);
2122
2205
  }
2123
- const sn = (n) => {
2206
+ const Un = (n) => {
2124
2207
  const t = new Array(10), e = (i, r) => {
2125
- if (Rt(i)) {
2208
+ if (Pt(i)) {
2126
2209
  if (t.indexOf(i) >= 0)
2127
2210
  return;
2211
+ if (bt(i))
2212
+ return i;
2128
2213
  if (!("toJSON" in i)) {
2129
2214
  t[r] = i;
2130
- const s = nt(i) ? [] : {};
2131
- return ct(i, (a, o) => {
2215
+ const s = dt(i) ? [] : {};
2216
+ return vt(i, (a, o) => {
2132
2217
  const c = e(a, r + 1);
2133
- !ot(c) && (s[o] = c);
2218
+ !ft(c) && (s[o] = c);
2134
2219
  }), t[r] = void 0, s;
2135
2220
  }
2136
2221
  }
2137
2222
  return i;
2138
2223
  };
2139
2224
  return e(n, 0);
2140
- }, an = k("AsyncFunction"), on = (n) => n && (Rt(n) || B(n)) && B(n.then) && B(n.catch), Be = ((n, t) => n ? setImmediate : t ? ((e, i) => ($.addEventListener("message", ({ source: r, data: s }) => {
2141
- r === $ && s === e && i.length && i.shift()();
2225
+ }, Ln = j("AsyncFunction"), Mn = (n) => n && (Pt(n) || U(n)) && U(n.then) && U(n.catch), Ye = ((n, t) => n ? setImmediate : t ? ((e, i) => (it.addEventListener("message", ({ source: r, data: s }) => {
2226
+ r === it && s === e && i.length && i.shift()();
2142
2227
  }, !1), (r) => {
2143
- i.push(r), $.postMessage(e, "*");
2228
+ i.push(r), it.postMessage(e, "*");
2144
2229
  }))(`axios@${Math.random()}`, []) : (e) => setTimeout(e))(
2145
2230
  typeof setImmediate == "function",
2146
- B($.postMessage)
2147
- ), cn = typeof queueMicrotask < "u" ? queueMicrotask.bind($) : typeof process < "u" && process.nextTick || Be, un = (n) => n != null && B(n[Tt]), l = {
2148
- isArray: nt,
2149
- isArrayBuffer: Re,
2150
- isBuffer: Ti,
2151
- isFormData: Ni,
2152
- isArrayBufferView: Ci,
2153
- isString: Ai,
2154
- isNumber: Oe,
2155
- isBoolean: Ri,
2156
- isObject: Rt,
2157
- isPlainObject: yt,
2158
- isReadableStream: Ui,
2159
- isRequest: Li,
2160
- isResponse: Mi,
2161
- isHeaders: ki,
2162
- isUndefined: ot,
2163
- isDate: Oi,
2164
- isFile: xi,
2165
- isBlob: Di,
2166
- isRegExp: Zi,
2167
- isFunction: B,
2168
- isStream: Bi,
2169
- isURLSearchParams: Vi,
2170
- isTypedArray: zi,
2171
- isFileList: Ii,
2172
- forEach: ct,
2173
- merge: jt,
2174
- extend: ji,
2175
- trim: Fi,
2176
- stripBOM: qi,
2177
- inherits: Ki,
2178
- toFlatObject: Hi,
2179
- kindOf: Ct,
2180
- kindOfTest: k,
2181
- endsWith: Wi,
2182
- toArray: Xi,
2183
- forEachEntry: Gi,
2184
- matchAll: $i,
2185
- isHTMLForm: Ji,
2186
- hasOwnProperty: he,
2187
- hasOwnProp: he,
2231
+ U(it.postMessage)
2232
+ ), kn = typeof queueMicrotask < "u" ? queueMicrotask.bind(it) : typeof process < "u" && process.nextTick || Ye, Fn = (n) => n != null && U(n[Mt]), l = {
2233
+ isArray: dt,
2234
+ isArrayBuffer: Ge,
2235
+ isBuffer: bt,
2236
+ isFormData: fn,
2237
+ isArrayBufferView: nn,
2238
+ isString: rn,
2239
+ isNumber: $e,
2240
+ isBoolean: sn,
2241
+ isObject: Pt,
2242
+ isPlainObject: Bt,
2243
+ isEmptyObject: an,
2244
+ isReadableStream: dn,
2245
+ isRequest: _n,
2246
+ isResponse: gn,
2247
+ isHeaders: mn,
2248
+ isUndefined: ft,
2249
+ isDate: on,
2250
+ isFile: cn,
2251
+ isBlob: un,
2252
+ isRegExp: Dn,
2253
+ isFunction: U,
2254
+ isStream: ln,
2255
+ isURLSearchParams: pn,
2256
+ isTypedArray: Tn,
2257
+ isFileList: hn,
2258
+ forEach: vt,
2259
+ merge: Zt,
2260
+ extend: bn,
2261
+ trim: yn,
2262
+ stripBOM: Pn,
2263
+ inherits: vn,
2264
+ toFlatObject: En,
2265
+ kindOf: kt,
2266
+ kindOfTest: j,
2267
+ endsWith: wn,
2268
+ toArray: Sn,
2269
+ forEachEntry: An,
2270
+ matchAll: Cn,
2271
+ isHTMLForm: Rn,
2272
+ hasOwnProperty: Ae,
2273
+ hasOwnProp: Ae,
2188
2274
  // an alias to avoid ESLint no-prototype-builtins detection
2189
- reduceDescriptors: Ie,
2190
- freezeMethods: Yi,
2191
- toObjectSet: tn,
2192
- toCamelCase: Qi,
2193
- noop: en,
2194
- toFiniteNumber: nn,
2195
- findKey: xe,
2196
- global: $,
2197
- isContextDefined: De,
2198
- isSpecCompliantForm: rn,
2199
- toJSONObject: sn,
2200
- isAsyncFn: an,
2201
- isThenable: on,
2202
- setImmediate: Be,
2203
- asap: cn,
2204
- isIterable: un
2275
+ reduceDescriptors: Ze,
2276
+ freezeMethods: In,
2277
+ toObjectSet: Bn,
2278
+ toCamelCase: On,
2279
+ noop: Nn,
2280
+ toFiniteNumber: xn,
2281
+ findKey: Je,
2282
+ global: it,
2283
+ isContextDefined: Qe,
2284
+ isSpecCompliantForm: Vn,
2285
+ toJSONObject: Un,
2286
+ isAsyncFn: Ln,
2287
+ isThenable: Mn,
2288
+ setImmediate: Ye,
2289
+ asap: kn,
2290
+ isIterable: Fn
2205
2291
  };
2206
- function P(n, t, e, i, r) {
2292
+ function v(n, t, e, i, r) {
2207
2293
  Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = n, this.name = "AxiosError", t && (this.code = t), e && (this.config = e), i && (this.request = i), r && (this.response = r, this.status = r.status ? r.status : null);
2208
2294
  }
2209
- l.inherits(P, Error, {
2295
+ l.inherits(v, Error, {
2210
2296
  toJSON: function() {
2211
2297
  return {
2212
2298
  // Standard
@@ -2227,7 +2313,7 @@ l.inherits(P, Error, {
2227
2313
  };
2228
2314
  }
2229
2315
  });
2230
- const Ne = P.prototype, Ve = {};
2316
+ const ti = v.prototype, ei = {};
2231
2317
  [
2232
2318
  "ERR_BAD_OPTION_VALUE",
2233
2319
  "ERR_BAD_OPTION",
@@ -2243,35 +2329,37 @@ const Ne = P.prototype, Ve = {};
2243
2329
  "ERR_INVALID_URL"
2244
2330
  // eslint-disable-next-line func-names
2245
2331
  ].forEach((n) => {
2246
- Ve[n] = { value: n };
2332
+ ei[n] = { value: n };
2247
2333
  });
2248
- Object.defineProperties(P, Ve);
2249
- Object.defineProperty(Ne, "isAxiosError", { value: !0 });
2250
- P.from = (n, t, e, i, r, s) => {
2251
- const a = Object.create(Ne);
2252
- return l.toFlatObject(n, a, function(c) {
2253
- return c !== Error.prototype;
2254
- }, (o) => o !== "isAxiosError"), P.call(a, n.message, t, e, i, r), a.cause = n, a.name = n.name, s && Object.assign(a, s), a;
2334
+ Object.defineProperties(v, ei);
2335
+ Object.defineProperty(ti, "isAxiosError", { value: !0 });
2336
+ v.from = (n, t, e, i, r, s) => {
2337
+ const a = Object.create(ti);
2338
+ l.toFlatObject(n, a, function(u) {
2339
+ return u !== Error.prototype;
2340
+ }, (h) => h !== "isAxiosError");
2341
+ const o = n && n.message ? n.message : "Error", c = t == null && n ? n.code : t;
2342
+ return v.call(a, o, c, e, i, r), n && a.cause == null && Object.defineProperty(a, "cause", { value: n, configurable: !0 }), a.name = n && n.name || "Error", s && Object.assign(a, s), a;
2255
2343
  };
2256
- const hn = null;
2257
- function qt(n) {
2344
+ const jn = null;
2345
+ function Yt(n) {
2258
2346
  return l.isPlainObject(n) || l.isArray(n);
2259
2347
  }
2260
- function Ue(n) {
2348
+ function ii(n) {
2261
2349
  return l.endsWith(n, "[]") ? n.slice(0, -2) : n;
2262
2350
  }
2263
- function le(n, t, e) {
2351
+ function Ce(n, t, e) {
2264
2352
  return n ? n.concat(t).map(function(r, s) {
2265
- return r = Ue(r), !e && s ? "[" + r + "]" : r;
2353
+ return r = ii(r), !e && s ? "[" + r + "]" : r;
2266
2354
  }).join(e ? "." : "") : t;
2267
2355
  }
2268
- function ln(n) {
2269
- return l.isArray(n) && !n.some(qt);
2356
+ function qn(n) {
2357
+ return l.isArray(n) && !n.some(Yt);
2270
2358
  }
2271
- const fn = l.toFlatObject(l, {}, null, function(t) {
2359
+ const Kn = l.toFlatObject(l, {}, null, function(t) {
2272
2360
  return /^is[A-Z]/.test(t);
2273
2361
  });
2274
- function Ot(n, t, e) {
2362
+ function jt(n, t, e) {
2275
2363
  if (!l.isObject(n))
2276
2364
  throw new TypeError("target must be an object");
2277
2365
  t = t || new FormData(), e = l.toFlatObject(e, {
@@ -2291,42 +2379,42 @@ function Ot(n, t, e) {
2291
2379
  if (l.isBoolean(d))
2292
2380
  return d.toString();
2293
2381
  if (!c && l.isBlob(d))
2294
- throw new P("Blob is not supported. Use a Buffer instead.");
2382
+ throw new v("Blob is not supported. Use a Buffer instead.");
2295
2383
  return l.isArrayBuffer(d) || l.isTypedArray(d) ? c && typeof Blob == "function" ? new Blob([d]) : Buffer.from(d) : d;
2296
2384
  }
2297
2385
  function u(d, m, g) {
2298
- let S = d;
2386
+ let w = d;
2299
2387
  if (d && !g && typeof d == "object") {
2300
2388
  if (l.endsWith(m, "{}"))
2301
2389
  m = i ? m : m.slice(0, -2), d = JSON.stringify(d);
2302
- else if (l.isArray(d) && ln(d) || (l.isFileList(d) || l.endsWith(m, "[]")) && (S = l.toArray(d)))
2303
- return m = Ue(m), S.forEach(function(C, I) {
2304
- !(l.isUndefined(C) || C === null) && t.append(
2390
+ else if (l.isArray(d) && qn(d) || (l.isFileList(d) || l.endsWith(m, "[]")) && (w = l.toArray(d)))
2391
+ return m = ii(m), w.forEach(function(T, O) {
2392
+ !(l.isUndefined(T) || T === null) && t.append(
2305
2393
  // eslint-disable-next-line no-nested-ternary
2306
- a === !0 ? le([m], I, s) : a === null ? m : m + "[]",
2307
- h(C)
2394
+ a === !0 ? Ce([m], O, s) : a === null ? m : m + "[]",
2395
+ h(T)
2308
2396
  );
2309
2397
  }), !1;
2310
2398
  }
2311
- return qt(d) ? !0 : (t.append(le(g, m, s), h(d)), !1);
2399
+ return Yt(d) ? !0 : (t.append(Ce(g, m, s), h(d)), !1);
2312
2400
  }
2313
- const f = [], _ = Object.assign(fn, {
2401
+ const f = [], _ = Object.assign(Kn, {
2314
2402
  defaultVisitor: u,
2315
2403
  convertValue: h,
2316
- isVisitable: qt
2404
+ isVisitable: Yt
2317
2405
  });
2318
2406
  function y(d, m) {
2319
2407
  if (!l.isUndefined(d)) {
2320
2408
  if (f.indexOf(d) !== -1)
2321
2409
  throw Error("Circular reference detected in " + m.join("."));
2322
- f.push(d), l.forEach(d, function(S, E) {
2323
- (!(l.isUndefined(S) || S === null) && r.call(
2410
+ f.push(d), l.forEach(d, function(w, A) {
2411
+ (!(l.isUndefined(w) || w === null) && r.call(
2324
2412
  t,
2325
- S,
2326
- l.isString(E) ? E.trim() : E,
2413
+ w,
2414
+ l.isString(A) ? A.trim() : A,
2327
2415
  m,
2328
2416
  _
2329
- )) === !0 && y(S, m ? m.concat(E) : [E]);
2417
+ )) === !0 && y(w, m ? m.concat(A) : [A]);
2330
2418
  }), f.pop();
2331
2419
  }
2332
2420
  }
@@ -2334,7 +2422,7 @@ function Ot(n, t, e) {
2334
2422
  throw new TypeError("data must be an object");
2335
2423
  return y(n), t;
2336
2424
  }
2337
- function fe(n) {
2425
+ function Re(n) {
2338
2426
  const t = {
2339
2427
  "!": "%21",
2340
2428
  "'": "%27",
@@ -2348,40 +2436,40 @@ function fe(n) {
2348
2436
  return t[i];
2349
2437
  });
2350
2438
  }
2351
- function $t(n, t) {
2352
- this._pairs = [], n && Ot(n, this, t);
2439
+ function se(n, t) {
2440
+ this._pairs = [], n && jt(n, this, t);
2353
2441
  }
2354
- const Le = $t.prototype;
2355
- Le.append = function(t, e) {
2442
+ const ni = se.prototype;
2443
+ ni.append = function(t, e) {
2356
2444
  this._pairs.push([t, e]);
2357
2445
  };
2358
- Le.toString = function(t) {
2446
+ ni.toString = function(t) {
2359
2447
  const e = t ? function(i) {
2360
- return t.call(this, i, fe);
2361
- } : fe;
2448
+ return t.call(this, i, Re);
2449
+ } : Re;
2362
2450
  return this._pairs.map(function(r) {
2363
2451
  return e(r[0]) + "=" + e(r[1]);
2364
2452
  }, "").join("&");
2365
2453
  };
2366
- function pn(n) {
2367
- return encodeURIComponent(n).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
2454
+ function Hn(n) {
2455
+ return encodeURIComponent(n).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
2368
2456
  }
2369
- function Me(n, t, e) {
2457
+ function ri(n, t, e) {
2370
2458
  if (!t)
2371
2459
  return n;
2372
- const i = e && e.encode || pn;
2460
+ const i = e && e.encode || Hn;
2373
2461
  l.isFunction(e) && (e = {
2374
2462
  serialize: e
2375
2463
  });
2376
2464
  const r = e && e.serialize;
2377
2465
  let s;
2378
- if (r ? s = r(t, e) : s = l.isURLSearchParams(t) ? t.toString() : new $t(t, e).toString(i), s) {
2466
+ if (r ? s = r(t, e) : s = l.isURLSearchParams(t) ? t.toString() : new se(t, e).toString(i), s) {
2379
2467
  const a = n.indexOf("#");
2380
2468
  a !== -1 && (n = n.slice(0, a)), n += (n.indexOf("?") === -1 ? "?" : "&") + s;
2381
2469
  }
2382
2470
  return n;
2383
2471
  }
2384
- class pe {
2472
+ class Oe {
2385
2473
  constructor() {
2386
2474
  this.handlers = [];
2387
2475
  }
@@ -2435,41 +2523,42 @@ class pe {
2435
2523
  });
2436
2524
  }
2437
2525
  }
2438
- const ke = {
2526
+ const si = {
2439
2527
  silentJSONParsing: !0,
2440
2528
  forcedJSONParsing: !0,
2441
2529
  clarifyTimeoutError: !1
2442
- }, dn = typeof URLSearchParams < "u" ? URLSearchParams : $t, _n = typeof FormData < "u" ? FormData : null, gn = typeof Blob < "u" ? Blob : null, mn = {
2530
+ }, Wn = typeof URLSearchParams < "u" ? URLSearchParams : se, Xn = typeof FormData < "u" ? FormData : null, zn = typeof Blob < "u" ? Blob : null, Gn = {
2443
2531
  isBrowser: !0,
2444
2532
  classes: {
2445
- URLSearchParams: dn,
2446
- FormData: _n,
2447
- Blob: gn
2533
+ URLSearchParams: Wn,
2534
+ FormData: Xn,
2535
+ Blob: zn
2448
2536
  },
2449
2537
  protocols: ["http", "https", "file", "blob", "url", "data"]
2450
- }, Jt = typeof window < "u" && typeof document < "u", Kt = typeof navigator == "object" && navigator || void 0, yn = Jt && (!Kt || ["ReactNative", "NativeScript", "NS"].indexOf(Kt.product) < 0), bn = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
2451
- self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Pn = Jt && window.location.href || "http://localhost", vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2538
+ }, ae = typeof window < "u" && typeof document < "u", te = typeof navigator == "object" && navigator || void 0, $n = ae && (!te || ["ReactNative", "NativeScript", "NS"].indexOf(te.product) < 0), Jn = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
2539
+ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Qn = ae && window.location.href || "http://localhost", Zn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2452
2540
  __proto__: null,
2453
- hasBrowserEnv: Jt,
2454
- hasStandardBrowserEnv: yn,
2455
- hasStandardBrowserWebWorkerEnv: bn,
2456
- navigator: Kt,
2457
- origin: Pn
2458
- }, Symbol.toStringTag, { value: "Module" })), x = {
2459
- ...vn,
2460
- ...mn
2541
+ hasBrowserEnv: ae,
2542
+ hasStandardBrowserEnv: $n,
2543
+ hasStandardBrowserWebWorkerEnv: Jn,
2544
+ navigator: te,
2545
+ origin: Qn
2546
+ }, Symbol.toStringTag, { value: "Module" })), B = {
2547
+ ...Zn,
2548
+ ...Gn
2461
2549
  };
2462
- function wn(n, t) {
2463
- return Ot(n, new x.classes.URLSearchParams(), Object.assign({
2550
+ function Yn(n, t) {
2551
+ return jt(n, new B.classes.URLSearchParams(), {
2464
2552
  visitor: function(e, i, r, s) {
2465
- return x.isNode && l.isBuffer(e) ? (this.append(i, e.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
2466
- }
2467
- }, t));
2553
+ return B.isNode && l.isBuffer(e) ? (this.append(i, e.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
2554
+ },
2555
+ ...t
2556
+ });
2468
2557
  }
2469
- function En(n) {
2558
+ function tr(n) {
2470
2559
  return l.matchAll(/\w+|\[(\w*)]/g, n).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
2471
2560
  }
2472
- function Sn(n) {
2561
+ function er(n) {
2473
2562
  const t = {}, e = Object.keys(n);
2474
2563
  let i;
2475
2564
  const r = e.length;
@@ -2478,22 +2567,22 @@ function Sn(n) {
2478
2567
  s = e[i], t[s] = n[s];
2479
2568
  return t;
2480
2569
  }
2481
- function Fe(n) {
2570
+ function ai(n) {
2482
2571
  function t(e, i, r, s) {
2483
2572
  let a = e[s++];
2484
2573
  if (a === "__proto__") return !0;
2485
2574
  const o = Number.isFinite(+a), c = s >= e.length;
2486
- return a = !a && l.isArray(r) ? r.length : a, c ? (l.hasOwnProp(r, a) ? r[a] = [r[a], i] : r[a] = i, !o) : ((!r[a] || !l.isObject(r[a])) && (r[a] = []), t(e, i, r[a], s) && l.isArray(r[a]) && (r[a] = Sn(r[a])), !o);
2575
+ return a = !a && l.isArray(r) ? r.length : a, c ? (l.hasOwnProp(r, a) ? r[a] = [r[a], i] : r[a] = i, !o) : ((!r[a] || !l.isObject(r[a])) && (r[a] = []), t(e, i, r[a], s) && l.isArray(r[a]) && (r[a] = er(r[a])), !o);
2487
2576
  }
2488
2577
  if (l.isFormData(n) && l.isFunction(n.entries)) {
2489
2578
  const e = {};
2490
2579
  return l.forEachEntry(n, (i, r) => {
2491
- t(En(i), r, e, 0);
2580
+ t(tr(i), r, e, 0);
2492
2581
  }), e;
2493
2582
  }
2494
2583
  return null;
2495
2584
  }
2496
- function Tn(n, t, e) {
2585
+ function ir(n, t, e) {
2497
2586
  if (l.isString(n))
2498
2587
  try {
2499
2588
  return (t || JSON.parse)(n), l.trim(n);
@@ -2503,13 +2592,13 @@ function Tn(n, t, e) {
2503
2592
  }
2504
2593
  return (e || JSON.stringify)(n);
2505
2594
  }
2506
- const ut = {
2507
- transitional: ke,
2595
+ const Et = {
2596
+ transitional: si,
2508
2597
  adapter: ["xhr", "http", "fetch"],
2509
2598
  transformRequest: [function(t, e) {
2510
2599
  const i = e.getContentType() || "", r = i.indexOf("application/json") > -1, s = l.isObject(t);
2511
2600
  if (s && l.isHTMLForm(t) && (t = new FormData(t)), l.isFormData(t))
2512
- return r ? JSON.stringify(Fe(t)) : t;
2601
+ return r ? JSON.stringify(ai(t)) : t;
2513
2602
  if (l.isArrayBuffer(t) || l.isBuffer(t) || l.isStream(t) || l.isFile(t) || l.isBlob(t) || l.isReadableStream(t))
2514
2603
  return t;
2515
2604
  if (l.isArrayBufferView(t))
@@ -2519,29 +2608,29 @@ const ut = {
2519
2608
  let o;
2520
2609
  if (s) {
2521
2610
  if (i.indexOf("application/x-www-form-urlencoded") > -1)
2522
- return wn(t, this.formSerializer).toString();
2611
+ return Yn(t, this.formSerializer).toString();
2523
2612
  if ((o = l.isFileList(t)) || i.indexOf("multipart/form-data") > -1) {
2524
2613
  const c = this.env && this.env.FormData;
2525
- return Ot(
2614
+ return jt(
2526
2615
  o ? { "files[]": t } : t,
2527
2616
  c && new c(),
2528
2617
  this.formSerializer
2529
2618
  );
2530
2619
  }
2531
2620
  }
2532
- return s || r ? (e.setContentType("application/json", !1), Tn(t)) : t;
2621
+ return s || r ? (e.setContentType("application/json", !1), ir(t)) : t;
2533
2622
  }],
2534
2623
  transformResponse: [function(t) {
2535
- const e = this.transitional || ut.transitional, i = e && e.forcedJSONParsing, r = this.responseType === "json";
2624
+ const e = this.transitional || Et.transitional, i = e && e.forcedJSONParsing, r = this.responseType === "json";
2536
2625
  if (l.isResponse(t) || l.isReadableStream(t))
2537
2626
  return t;
2538
2627
  if (t && l.isString(t) && (i && !this.responseType || r)) {
2539
2628
  const a = !(e && e.silentJSONParsing) && r;
2540
2629
  try {
2541
- return JSON.parse(t);
2630
+ return JSON.parse(t, this.parseReviver);
2542
2631
  } catch (o) {
2543
2632
  if (a)
2544
- throw o.name === "SyntaxError" ? P.from(o, P.ERR_BAD_RESPONSE, this, null, this.response) : o;
2633
+ throw o.name === "SyntaxError" ? v.from(o, v.ERR_BAD_RESPONSE, this, null, this.response) : o;
2545
2634
  }
2546
2635
  }
2547
2636
  return t;
@@ -2556,8 +2645,8 @@ const ut = {
2556
2645
  maxContentLength: -1,
2557
2646
  maxBodyLength: -1,
2558
2647
  env: {
2559
- FormData: x.classes.FormData,
2560
- Blob: x.classes.Blob
2648
+ FormData: B.classes.FormData,
2649
+ Blob: B.classes.Blob
2561
2650
  },
2562
2651
  validateStatus: function(t) {
2563
2652
  return t >= 200 && t < 300;
@@ -2570,9 +2659,9 @@ const ut = {
2570
2659
  }
2571
2660
  };
2572
2661
  l.forEach(["delete", "get", "head", "post", "put", "patch"], (n) => {
2573
- ut.headers[n] = {};
2662
+ Et.headers[n] = {};
2574
2663
  });
2575
- const Cn = l.toObjectSet([
2664
+ const nr = l.toObjectSet([
2576
2665
  "age",
2577
2666
  "authorization",
2578
2667
  "content-length",
@@ -2590,29 +2679,29 @@ const Cn = l.toObjectSet([
2590
2679
  "referer",
2591
2680
  "retry-after",
2592
2681
  "user-agent"
2593
- ]), An = (n) => {
2682
+ ]), rr = (n) => {
2594
2683
  const t = {};
2595
2684
  let e, i, r;
2596
2685
  return n && n.split(`
2597
2686
  `).forEach(function(a) {
2598
- r = a.indexOf(":"), e = a.substring(0, r).trim().toLowerCase(), i = a.substring(r + 1).trim(), !(!e || t[e] && Cn[e]) && (e === "set-cookie" ? t[e] ? t[e].push(i) : t[e] = [i] : t[e] = t[e] ? t[e] + ", " + i : i);
2687
+ r = a.indexOf(":"), e = a.substring(0, r).trim().toLowerCase(), i = a.substring(r + 1).trim(), !(!e || t[e] && nr[e]) && (e === "set-cookie" ? t[e] ? t[e].push(i) : t[e] = [i] : t[e] = t[e] ? t[e] + ", " + i : i);
2599
2688
  }), t;
2600
- }, de = Symbol("internals");
2601
- function st(n) {
2689
+ }, De = Symbol("internals");
2690
+ function gt(n) {
2602
2691
  return n && String(n).trim().toLowerCase();
2603
2692
  }
2604
- function bt(n) {
2605
- return n === !1 || n == null ? n : l.isArray(n) ? n.map(bt) : String(n);
2693
+ function Nt(n) {
2694
+ return n === !1 || n == null ? n : l.isArray(n) ? n.map(Nt) : String(n);
2606
2695
  }
2607
- function Rn(n) {
2696
+ function sr(n) {
2608
2697
  const t = /* @__PURE__ */ Object.create(null), e = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
2609
2698
  let i;
2610
2699
  for (; i = e.exec(n); )
2611
2700
  t[i[1]] = i[2];
2612
2701
  return t;
2613
2702
  }
2614
- const On = (n) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());
2615
- function Ut(n, t, e, i, r) {
2703
+ const ar = (n) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());
2704
+ function zt(n, t, e, i, r) {
2616
2705
  if (l.isFunction(i))
2617
2706
  return i.call(this, t, e);
2618
2707
  if (r && (t = e), !!l.isString(t)) {
@@ -2622,10 +2711,10 @@ function Ut(n, t, e, i, r) {
2622
2711
  return i.test(t);
2623
2712
  }
2624
2713
  }
2625
- function xn(n) {
2714
+ function or(n) {
2626
2715
  return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, e, i) => e.toUpperCase() + i);
2627
2716
  }
2628
- function Dn(n, t) {
2717
+ function cr(n, t) {
2629
2718
  const e = l.toCamelCase(" " + t);
2630
2719
  ["get", "set", "has"].forEach((i) => {
2631
2720
  Object.defineProperty(n, i + e, {
@@ -2636,24 +2725,24 @@ function Dn(n, t) {
2636
2725
  });
2637
2726
  });
2638
2727
  }
2639
- let N = class {
2728
+ let L = class {
2640
2729
  constructor(t) {
2641
2730
  t && this.set(t);
2642
2731
  }
2643
2732
  set(t, e, i) {
2644
2733
  const r = this;
2645
2734
  function s(o, c, h) {
2646
- const u = st(c);
2735
+ const u = gt(c);
2647
2736
  if (!u)
2648
2737
  throw new Error("header name must be a non-empty string");
2649
2738
  const f = l.findKey(r, u);
2650
- (!f || r[f] === void 0 || h === !0 || h === void 0 && r[f] !== !1) && (r[f || c] = bt(o));
2739
+ (!f || r[f] === void 0 || h === !0 || h === void 0 && r[f] !== !1) && (r[f || c] = Nt(o));
2651
2740
  }
2652
2741
  const a = (o, c) => l.forEach(o, (h, u) => s(h, u, c));
2653
2742
  if (l.isPlainObject(t) || t instanceof this.constructor)
2654
2743
  a(t, e);
2655
- else if (l.isString(t) && (t = t.trim()) && !On(t))
2656
- a(An(t), e);
2744
+ else if (l.isString(t) && (t = t.trim()) && !ar(t))
2745
+ a(rr(t), e);
2657
2746
  else if (l.isObject(t) && l.isIterable(t)) {
2658
2747
  let o = {}, c, h;
2659
2748
  for (const u of t) {
@@ -2667,14 +2756,14 @@ let N = class {
2667
2756
  return this;
2668
2757
  }
2669
2758
  get(t, e) {
2670
- if (t = st(t), t) {
2759
+ if (t = gt(t), t) {
2671
2760
  const i = l.findKey(this, t);
2672
2761
  if (i) {
2673
2762
  const r = this[i];
2674
2763
  if (!e)
2675
2764
  return r;
2676
2765
  if (e === !0)
2677
- return Rn(r);
2766
+ return sr(r);
2678
2767
  if (l.isFunction(e))
2679
2768
  return e.call(this, r, i);
2680
2769
  if (l.isRegExp(e))
@@ -2684,9 +2773,9 @@ let N = class {
2684
2773
  }
2685
2774
  }
2686
2775
  has(t, e) {
2687
- if (t = st(t), t) {
2776
+ if (t = gt(t), t) {
2688
2777
  const i = l.findKey(this, t);
2689
- return !!(i && this[i] !== void 0 && (!e || Ut(this, this[i], i, e)));
2778
+ return !!(i && this[i] !== void 0 && (!e || zt(this, this[i], i, e)));
2690
2779
  }
2691
2780
  return !1;
2692
2781
  }
@@ -2694,9 +2783,9 @@ let N = class {
2694
2783
  const i = this;
2695
2784
  let r = !1;
2696
2785
  function s(a) {
2697
- if (a = st(a), a) {
2786
+ if (a = gt(a), a) {
2698
2787
  const o = l.findKey(i, a);
2699
- o && (!e || Ut(i, i[o], o, e)) && (delete i[o], r = !0);
2788
+ o && (!e || zt(i, i[o], o, e)) && (delete i[o], r = !0);
2700
2789
  }
2701
2790
  }
2702
2791
  return l.isArray(t) ? t.forEach(s) : s(t), r;
@@ -2706,7 +2795,7 @@ let N = class {
2706
2795
  let i = e.length, r = !1;
2707
2796
  for (; i--; ) {
2708
2797
  const s = e[i];
2709
- (!t || Ut(this, this[s], s, t, !0)) && (delete this[s], r = !0);
2798
+ (!t || zt(this, this[s], s, t, !0)) && (delete this[s], r = !0);
2710
2799
  }
2711
2800
  return r;
2712
2801
  }
@@ -2715,11 +2804,11 @@ let N = class {
2715
2804
  return l.forEach(this, (r, s) => {
2716
2805
  const a = l.findKey(i, s);
2717
2806
  if (a) {
2718
- e[a] = bt(r), delete e[s];
2807
+ e[a] = Nt(r), delete e[s];
2719
2808
  return;
2720
2809
  }
2721
- const o = t ? xn(s) : String(s).trim();
2722
- o !== s && delete e[s], e[o] = bt(r), i[o] = !0;
2810
+ const o = t ? or(s) : String(s).trim();
2811
+ o !== s && delete e[s], e[o] = Nt(r), i[o] = !0;
2723
2812
  }), this;
2724
2813
  }
2725
2814
  concat(...t) {
@@ -2752,18 +2841,18 @@ let N = class {
2752
2841
  return e.forEach((r) => i.set(r)), i;
2753
2842
  }
2754
2843
  static accessor(t) {
2755
- const i = (this[de] = this[de] = {
2844
+ const i = (this[De] = this[De] = {
2756
2845
  accessors: {}
2757
2846
  }).accessors, r = this.prototype;
2758
2847
  function s(a) {
2759
- const o = st(a);
2760
- i[o] || (Dn(r, a), i[o] = !0);
2848
+ const o = gt(a);
2849
+ i[o] || (cr(r, a), i[o] = !0);
2761
2850
  }
2762
2851
  return l.isArray(t) ? t.forEach(s) : s(t), this;
2763
2852
  }
2764
2853
  };
2765
- N.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
2766
- l.reduceDescriptors(N.prototype, ({ value: n }, t) => {
2854
+ L.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
2855
+ l.reduceDescriptors(L.prototype, ({ value: n }, t) => {
2767
2856
  let e = t[0].toUpperCase() + t.slice(1);
2768
2857
  return {
2769
2858
  get: () => n,
@@ -2772,38 +2861,38 @@ l.reduceDescriptors(N.prototype, ({ value: n }, t) => {
2772
2861
  }
2773
2862
  };
2774
2863
  });
2775
- l.freezeMethods(N);
2776
- function Lt(n, t) {
2777
- const e = this || ut, i = t || e, r = N.from(i.headers);
2864
+ l.freezeMethods(L);
2865
+ function Gt(n, t) {
2866
+ const e = this || Et, i = t || e, r = L.from(i.headers);
2778
2867
  let s = i.data;
2779
2868
  return l.forEach(n, function(o) {
2780
2869
  s = o.call(e, s, r.normalize(), t ? t.status : void 0);
2781
2870
  }), r.normalize(), s;
2782
2871
  }
2783
- function je(n) {
2872
+ function oi(n) {
2784
2873
  return !!(n && n.__CANCEL__);
2785
2874
  }
2786
- function rt(n, t, e) {
2787
- P.call(this, n ?? "canceled", P.ERR_CANCELED, t, e), this.name = "CanceledError";
2875
+ function _t(n, t, e) {
2876
+ v.call(this, n ?? "canceled", v.ERR_CANCELED, t, e), this.name = "CanceledError";
2788
2877
  }
2789
- l.inherits(rt, P, {
2878
+ l.inherits(_t, v, {
2790
2879
  __CANCEL__: !0
2791
2880
  });
2792
- function qe(n, t, e) {
2881
+ function ci(n, t, e) {
2793
2882
  const i = e.config.validateStatus;
2794
- !e.status || !i || i(e.status) ? n(e) : t(new P(
2883
+ !e.status || !i || i(e.status) ? n(e) : t(new v(
2795
2884
  "Request failed with status code " + e.status,
2796
- [P.ERR_BAD_REQUEST, P.ERR_BAD_RESPONSE][Math.floor(e.status / 100) - 4],
2885
+ [v.ERR_BAD_REQUEST, v.ERR_BAD_RESPONSE][Math.floor(e.status / 100) - 4],
2797
2886
  e.config,
2798
2887
  e.request,
2799
2888
  e
2800
2889
  ));
2801
2890
  }
2802
- function In(n) {
2891
+ function ur(n) {
2803
2892
  const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(n);
2804
2893
  return t && t[1] || "";
2805
2894
  }
2806
- function Bn(n, t) {
2895
+ function hr(n, t) {
2807
2896
  n = n || 10;
2808
2897
  const e = new Array(n), i = new Array(n);
2809
2898
  let r = 0, s = 0, a;
@@ -2819,10 +2908,10 @@ function Bn(n, t) {
2819
2908
  return y ? Math.round(_ * 1e3 / y) : void 0;
2820
2909
  };
2821
2910
  }
2822
- function Nn(n, t) {
2911
+ function lr(n, t) {
2823
2912
  let e = 0, i = 1e3 / t, r, s;
2824
2913
  const a = (h, u = Date.now()) => {
2825
- e = u, r = null, s && (clearTimeout(s), s = null), n.apply(null, h);
2914
+ e = u, r = null, s && (clearTimeout(s), s = null), n(...h);
2826
2915
  };
2827
2916
  return [(...h) => {
2828
2917
  const u = Date.now(), f = u - e;
@@ -2831,10 +2920,10 @@ function Nn(n, t) {
2831
2920
  }, i - f)));
2832
2921
  }, () => r && a(r)];
2833
2922
  }
2834
- const wt = (n, t, e = 3) => {
2923
+ const Ut = (n, t, e = 3) => {
2835
2924
  let i = 0;
2836
- const r = Bn(50, 250);
2837
- return Nn((s) => {
2925
+ const r = hr(50, 250);
2926
+ return lr((s) => {
2838
2927
  const a = s.loaded, o = s.lengthComputable ? s.total : void 0, c = a - i, h = r(c), u = a <= o;
2839
2928
  i = a;
2840
2929
  const f = {
@@ -2850,17 +2939,17 @@ const wt = (n, t, e = 3) => {
2850
2939
  };
2851
2940
  n(f);
2852
2941
  }, e);
2853
- }, _e = (n, t) => {
2942
+ }, Ie = (n, t) => {
2854
2943
  const e = n != null;
2855
2944
  return [(i) => t[0]({
2856
2945
  lengthComputable: e,
2857
2946
  total: n,
2858
2947
  loaded: i
2859
2948
  }), t[1]];
2860
- }, ge = (n) => (...t) => l.asap(() => n(...t)), Vn = x.hasStandardBrowserEnv ? /* @__PURE__ */ ((n, t) => (e) => (e = new URL(e, x.origin), n.protocol === e.protocol && n.host === e.host && (t || n.port === e.port)))(
2861
- new URL(x.origin),
2862
- x.navigator && /(msie|trident)/i.test(x.navigator.userAgent)
2863
- ) : () => !0, Un = x.hasStandardBrowserEnv ? (
2949
+ }, Be = (n) => (...t) => l.asap(() => n(...t)), fr = B.hasStandardBrowserEnv ? /* @__PURE__ */ ((n, t) => (e) => (e = new URL(e, B.origin), n.protocol === e.protocol && n.host === e.host && (t || n.port === e.port)))(
2950
+ new URL(B.origin),
2951
+ B.navigator && /(msie|trident)/i.test(B.navigator.userAgent)
2952
+ ) : () => !0, pr = B.hasStandardBrowserEnv ? (
2864
2953
  // Standard browser envs support document.cookie
2865
2954
  {
2866
2955
  write(n, t, e, i, r, s) {
@@ -2887,18 +2976,18 @@ const wt = (n, t, e = 3) => {
2887
2976
  }
2888
2977
  }
2889
2978
  );
2890
- function Ln(n) {
2979
+ function dr(n) {
2891
2980
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(n);
2892
2981
  }
2893
- function Mn(n, t) {
2982
+ function _r(n, t) {
2894
2983
  return t ? n.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : n;
2895
2984
  }
2896
- function Ke(n, t, e) {
2897
- let i = !Ln(t);
2898
- return n && (i || e == !1) ? Mn(n, t) : t;
2985
+ function ui(n, t, e) {
2986
+ let i = !dr(t);
2987
+ return n && (i || e == !1) ? _r(n, t) : t;
2899
2988
  }
2900
- const me = (n) => n instanceof N ? { ...n } : n;
2901
- function Q(n, t) {
2989
+ const Ne = (n) => n instanceof L ? { ...n } : n;
2990
+ function rt(n, t) {
2902
2991
  t = t || {};
2903
2992
  const e = {};
2904
2993
  function i(h, u, f, _) {
@@ -2955,92 +3044,93 @@ function Q(n, t) {
2955
3044
  socketPath: a,
2956
3045
  responseEncoding: a,
2957
3046
  validateStatus: o,
2958
- headers: (h, u, f) => r(me(h), me(u), f, !0)
3047
+ headers: (h, u, f) => r(Ne(h), Ne(u), f, !0)
2959
3048
  };
2960
- return l.forEach(Object.keys(Object.assign({}, n, t)), function(u) {
3049
+ return l.forEach(Object.keys({ ...n, ...t }), function(u) {
2961
3050
  const f = c[u] || r, _ = f(n[u], t[u], u);
2962
3051
  l.isUndefined(_) && f !== o || (e[u] = _);
2963
3052
  }), e;
2964
3053
  }
2965
- const He = (n) => {
2966
- const t = Q({}, n);
3054
+ const hi = (n) => {
3055
+ const t = rt({}, n);
2967
3056
  let { data: e, withXSRFToken: i, xsrfHeaderName: r, xsrfCookieName: s, headers: a, auth: o } = t;
2968
- t.headers = a = N.from(a), t.url = Me(Ke(t.baseURL, t.url, t.allowAbsoluteUrls), n.params, n.paramsSerializer), o && a.set(
3057
+ if (t.headers = a = L.from(a), t.url = ri(ui(t.baseURL, t.url, t.allowAbsoluteUrls), n.params, n.paramsSerializer), o && a.set(
2969
3058
  "Authorization",
2970
3059
  "Basic " + btoa((o.username || "") + ":" + (o.password ? unescape(encodeURIComponent(o.password)) : ""))
2971
- );
2972
- let c;
2973
- if (l.isFormData(e)) {
2974
- if (x.hasStandardBrowserEnv || x.hasStandardBrowserWebWorkerEnv)
3060
+ ), l.isFormData(e)) {
3061
+ if (B.hasStandardBrowserEnv || B.hasStandardBrowserWebWorkerEnv)
2975
3062
  a.setContentType(void 0);
2976
- else if ((c = a.getContentType()) !== !1) {
2977
- const [h, ...u] = c ? c.split(";").map((f) => f.trim()).filter(Boolean) : [];
2978
- a.setContentType([h || "multipart/form-data", ...u].join("; "));
3063
+ else if (l.isFunction(e.getHeaders)) {
3064
+ const c = e.getHeaders(), h = ["content-type", "content-length"];
3065
+ Object.entries(c).forEach(([u, f]) => {
3066
+ h.includes(u.toLowerCase()) && a.set(u, f);
3067
+ });
2979
3068
  }
2980
3069
  }
2981
- if (x.hasStandardBrowserEnv && (i && l.isFunction(i) && (i = i(t)), i || i !== !1 && Vn(t.url))) {
2982
- const h = r && s && Un.read(s);
2983
- h && a.set(r, h);
3070
+ if (B.hasStandardBrowserEnv && (i && l.isFunction(i) && (i = i(t)), i || i !== !1 && fr(t.url))) {
3071
+ const c = r && s && pr.read(s);
3072
+ c && a.set(r, c);
2984
3073
  }
2985
3074
  return t;
2986
- }, kn = typeof XMLHttpRequest < "u", Fn = kn && function(n) {
3075
+ }, gr = typeof XMLHttpRequest < "u", mr = gr && function(n) {
2987
3076
  return new Promise(function(e, i) {
2988
- const r = He(n);
3077
+ const r = hi(n);
2989
3078
  let s = r.data;
2990
- const a = N.from(r.headers).normalize();
3079
+ const a = L.from(r.headers).normalize();
2991
3080
  let { responseType: o, onUploadProgress: c, onDownloadProgress: h } = r, u, f, _, y, d;
2992
3081
  function m() {
2993
3082
  y && y(), d && d(), r.cancelToken && r.cancelToken.unsubscribe(u), r.signal && r.signal.removeEventListener("abort", u);
2994
3083
  }
2995
3084
  let g = new XMLHttpRequest();
2996
3085
  g.open(r.method.toUpperCase(), r.url, !0), g.timeout = r.timeout;
2997
- function S() {
3086
+ function w() {
2998
3087
  if (!g)
2999
3088
  return;
3000
- const C = N.from(
3089
+ const T = L.from(
3001
3090
  "getAllResponseHeaders" in g && g.getAllResponseHeaders()
3002
- ), O = {
3091
+ ), x = {
3003
3092
  data: !o || o === "text" || o === "json" ? g.responseText : g.response,
3004
3093
  status: g.status,
3005
3094
  statusText: g.statusText,
3006
- headers: C,
3095
+ headers: T,
3007
3096
  config: n,
3008
3097
  request: g
3009
3098
  };
3010
- qe(function(V) {
3011
- e(V), m();
3012
- }, function(V) {
3013
- i(V), m();
3014
- }, O), g = null;
3099
+ ci(function(D) {
3100
+ e(D), m();
3101
+ }, function(D) {
3102
+ i(D), m();
3103
+ }, x), g = null;
3015
3104
  }
3016
- "onloadend" in g ? g.onloadend = S : g.onreadystatechange = function() {
3017
- !g || g.readyState !== 4 || g.status === 0 && !(g.responseURL && g.responseURL.indexOf("file:") === 0) || setTimeout(S);
3105
+ "onloadend" in g ? g.onloadend = w : g.onreadystatechange = function() {
3106
+ !g || g.readyState !== 4 || g.status === 0 && !(g.responseURL && g.responseURL.indexOf("file:") === 0) || setTimeout(w);
3018
3107
  }, g.onabort = function() {
3019
- g && (i(new P("Request aborted", P.ECONNABORTED, n, g)), g = null);
3020
- }, g.onerror = function() {
3021
- i(new P("Network Error", P.ERR_NETWORK, n, g)), g = null;
3108
+ g && (i(new v("Request aborted", v.ECONNABORTED, n, g)), g = null);
3109
+ }, g.onerror = function(O) {
3110
+ const x = O && O.message ? O.message : "Network Error", b = new v(x, v.ERR_NETWORK, n, g);
3111
+ b.event = O || null, i(b), g = null;
3022
3112
  }, g.ontimeout = function() {
3023
- let I = r.timeout ? "timeout of " + r.timeout + "ms exceeded" : "timeout exceeded";
3024
- const O = r.transitional || ke;
3025
- r.timeoutErrorMessage && (I = r.timeoutErrorMessage), i(new P(
3026
- I,
3027
- O.clarifyTimeoutError ? P.ETIMEDOUT : P.ECONNABORTED,
3113
+ let O = r.timeout ? "timeout of " + r.timeout + "ms exceeded" : "timeout exceeded";
3114
+ const x = r.transitional || si;
3115
+ r.timeoutErrorMessage && (O = r.timeoutErrorMessage), i(new v(
3116
+ O,
3117
+ x.clarifyTimeoutError ? v.ETIMEDOUT : v.ECONNABORTED,
3028
3118
  n,
3029
3119
  g
3030
3120
  )), g = null;
3031
- }, s === void 0 && a.setContentType(null), "setRequestHeader" in g && l.forEach(a.toJSON(), function(I, O) {
3032
- g.setRequestHeader(O, I);
3033
- }), l.isUndefined(r.withCredentials) || (g.withCredentials = !!r.withCredentials), o && o !== "json" && (g.responseType = r.responseType), h && ([_, d] = wt(h, !0), g.addEventListener("progress", _)), c && g.upload && ([f, y] = wt(c), g.upload.addEventListener("progress", f), g.upload.addEventListener("loadend", y)), (r.cancelToken || r.signal) && (u = (C) => {
3034
- g && (i(!C || C.type ? new rt(null, n, g) : C), g.abort(), g = null);
3121
+ }, s === void 0 && a.setContentType(null), "setRequestHeader" in g && l.forEach(a.toJSON(), function(O, x) {
3122
+ g.setRequestHeader(x, O);
3123
+ }), l.isUndefined(r.withCredentials) || (g.withCredentials = !!r.withCredentials), o && o !== "json" && (g.responseType = r.responseType), h && ([_, d] = Ut(h, !0), g.addEventListener("progress", _)), c && g.upload && ([f, y] = Ut(c), g.upload.addEventListener("progress", f), g.upload.addEventListener("loadend", y)), (r.cancelToken || r.signal) && (u = (T) => {
3124
+ g && (i(!T || T.type ? new _t(null, n, g) : T), g.abort(), g = null);
3035
3125
  }, r.cancelToken && r.cancelToken.subscribe(u), r.signal && (r.signal.aborted ? u() : r.signal.addEventListener("abort", u)));
3036
- const E = In(r.url);
3037
- if (E && x.protocols.indexOf(E) === -1) {
3038
- i(new P("Unsupported protocol " + E + ":", P.ERR_BAD_REQUEST, n));
3126
+ const A = ur(r.url);
3127
+ if (A && B.protocols.indexOf(A) === -1) {
3128
+ i(new v("Unsupported protocol " + A + ":", v.ERR_BAD_REQUEST, n));
3039
3129
  return;
3040
3130
  }
3041
3131
  g.send(s || null);
3042
3132
  });
3043
- }, jn = (n, t) => {
3133
+ }, yr = (n, t) => {
3044
3134
  const { length: e } = n = n ? n.filter(Boolean) : [];
3045
3135
  if (t || e) {
3046
3136
  let i = new AbortController(), r;
@@ -3048,11 +3138,11 @@ const He = (n) => {
3048
3138
  if (!r) {
3049
3139
  r = !0, o();
3050
3140
  const u = h instanceof Error ? h : this.reason;
3051
- i.abort(u instanceof P ? u : new rt(u instanceof Error ? u.message : u));
3141
+ i.abort(u instanceof v ? u : new _t(u instanceof Error ? u.message : u));
3052
3142
  }
3053
3143
  };
3054
3144
  let a = t && setTimeout(() => {
3055
- a = null, s(new P(`timeout ${t} of ms exceeded`, P.ETIMEDOUT));
3145
+ a = null, s(new v(`timeout ${t} of ms exceeded`, v.ETIMEDOUT));
3056
3146
  }, t);
3057
3147
  const o = () => {
3058
3148
  n && (a && clearTimeout(a), a = null, n.forEach((h) => {
@@ -3063,7 +3153,7 @@ const He = (n) => {
3063
3153
  const { signal: c } = i;
3064
3154
  return c.unsubscribe = () => l.asap(o), c;
3065
3155
  }
3066
- }, qn = function* (n, t) {
3156
+ }, br = function* (n, t) {
3067
3157
  let e = n.byteLength;
3068
3158
  if (e < t) {
3069
3159
  yield n;
@@ -3072,10 +3162,10 @@ const He = (n) => {
3072
3162
  let i = 0, r;
3073
3163
  for (; i < e; )
3074
3164
  r = i + t, yield n.slice(i, r), i = r;
3075
- }, Kn = async function* (n, t) {
3076
- for await (const e of Hn(n))
3077
- yield* qn(e, t);
3078
- }, Hn = async function* (n) {
3165
+ }, Pr = async function* (n, t) {
3166
+ for await (const e of vr(n))
3167
+ yield* br(e, t);
3168
+ }, vr = async function* (n) {
3079
3169
  if (n[Symbol.asyncIterator]) {
3080
3170
  yield* n;
3081
3171
  return;
@@ -3091,8 +3181,8 @@ const He = (n) => {
3091
3181
  } finally {
3092
3182
  await t.cancel();
3093
3183
  }
3094
- }, ye = (n, t, e, i) => {
3095
- const r = Kn(n, t);
3184
+ }, xe = (n, t, e, i) => {
3185
+ const r = Pr(n, t);
3096
3186
  let s = 0, a, o = (c) => {
3097
3187
  a || (a = !0, i && i(c));
3098
3188
  };
@@ -3120,140 +3210,171 @@ const He = (n) => {
3120
3210
  }, {
3121
3211
  highWaterMark: 2
3122
3212
  });
3123
- }, xt = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", We = xt && typeof ReadableStream == "function", Wn = xt && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((n) => (t) => n.encode(t))(new TextEncoder()) : async (n) => new Uint8Array(await new Response(n).arrayBuffer())), Xe = (n, ...t) => {
3213
+ }, Ve = 64 * 1024, { isFunction: Dt } = l, Er = (({ Request: n, Response: t }) => ({
3214
+ Request: n,
3215
+ Response: t
3216
+ }))(l.global), {
3217
+ ReadableStream: Ue,
3218
+ TextEncoder: Le
3219
+ } = l.global, Me = (n, ...t) => {
3124
3220
  try {
3125
3221
  return !!n(...t);
3126
3222
  } catch {
3127
3223
  return !1;
3128
3224
  }
3129
- }, Xn = We && Xe(() => {
3130
- let n = !1;
3131
- const t = new Request(x.origin, {
3132
- body: new ReadableStream(),
3133
- method: "POST",
3134
- get duplex() {
3135
- return n = !0, "half";
3136
- }
3137
- }).headers.has("Content-Type");
3138
- return n && !t;
3139
- }), be = 64 * 1024, Ht = We && Xe(() => l.isReadableStream(new Response("").body)), Et = {
3140
- stream: Ht && ((n) => n.body)
3141
- };
3142
- xt && ((n) => {
3143
- ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => {
3144
- !Et[t] && (Et[t] = l.isFunction(n[t]) ? (e) => e[t]() : (e, i) => {
3145
- throw new P(`Response type '${t}' is not supported`, P.ERR_NOT_SUPPORT, i);
3146
- });
3147
- });
3148
- })(new Response());
3149
- const zn = async (n) => {
3150
- if (n == null)
3151
- return 0;
3152
- if (l.isBlob(n))
3153
- return n.size;
3154
- if (l.isSpecCompliantForm(n))
3155
- return (await new Request(x.origin, {
3225
+ }, wr = (n) => {
3226
+ n = l.merge.call({
3227
+ skipUndefined: !0
3228
+ }, Er, n);
3229
+ const { fetch: t, Request: e, Response: i } = n, r = t ? Dt(t) : typeof fetch == "function", s = Dt(e), a = Dt(i);
3230
+ if (!r)
3231
+ return !1;
3232
+ const o = r && Dt(Ue), c = r && (typeof Le == "function" ? /* @__PURE__ */ ((d) => (m) => d.encode(m))(new Le()) : async (d) => new Uint8Array(await new e(d).arrayBuffer())), h = s && o && Me(() => {
3233
+ let d = !1;
3234
+ const m = new e(B.origin, {
3235
+ body: new Ue(),
3156
3236
  method: "POST",
3157
- body: n
3158
- }).arrayBuffer()).byteLength;
3159
- if (l.isArrayBufferView(n) || l.isArrayBuffer(n))
3160
- return n.byteLength;
3161
- if (l.isURLSearchParams(n) && (n = n + ""), l.isString(n))
3162
- return (await Wn(n)).byteLength;
3163
- }, Gn = async (n, t) => {
3164
- const e = l.toFiniteNumber(n.getContentLength());
3165
- return e ?? zn(t);
3166
- }, $n = xt && (async (n) => {
3167
- let {
3168
- url: t,
3169
- method: e,
3170
- data: i,
3171
- signal: r,
3172
- cancelToken: s,
3173
- timeout: a,
3174
- onDownloadProgress: o,
3175
- onUploadProgress: c,
3176
- responseType: h,
3177
- headers: u,
3178
- withCredentials: f = "same-origin",
3179
- fetchOptions: _
3180
- } = He(n);
3181
- h = h ? (h + "").toLowerCase() : "text";
3182
- let y = jn([r, s && s.toAbortSignal()], a), d;
3183
- const m = y && y.unsubscribe && (() => {
3184
- y.unsubscribe();
3237
+ get duplex() {
3238
+ return d = !0, "half";
3239
+ }
3240
+ }).headers.has("Content-Type");
3241
+ return d && !m;
3242
+ }), u = a && o && Me(() => l.isReadableStream(new i("").body)), f = {
3243
+ stream: u && ((d) => d.body)
3244
+ };
3245
+ r && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((d) => {
3246
+ !f[d] && (f[d] = (m, g) => {
3247
+ let w = m && m[d];
3248
+ if (w)
3249
+ return w.call(m);
3250
+ throw new v(`Response type '${d}' is not supported`, v.ERR_NOT_SUPPORT, g);
3251
+ });
3185
3252
  });
3186
- let g;
3187
- try {
3188
- if (c && Xn && e !== "get" && e !== "head" && (g = await Gn(u, i)) !== 0) {
3189
- let O = new Request(t, {
3253
+ const _ = async (d) => {
3254
+ if (d == null)
3255
+ return 0;
3256
+ if (l.isBlob(d))
3257
+ return d.size;
3258
+ if (l.isSpecCompliantForm(d))
3259
+ return (await new e(B.origin, {
3190
3260
  method: "POST",
3191
- body: i,
3192
- duplex: "half"
3193
- }), b;
3194
- if (l.isFormData(i) && (b = O.headers.get("content-type")) && u.setContentType(b), O.body) {
3195
- const [V, F] = _e(
3196
- g,
3197
- wt(ge(c))
3261
+ body: d
3262
+ }).arrayBuffer()).byteLength;
3263
+ if (l.isArrayBufferView(d) || l.isArrayBuffer(d))
3264
+ return d.byteLength;
3265
+ if (l.isURLSearchParams(d) && (d = d + ""), l.isString(d))
3266
+ return (await c(d)).byteLength;
3267
+ }, y = async (d, m) => {
3268
+ const g = l.toFiniteNumber(d.getContentLength());
3269
+ return g ?? _(m);
3270
+ };
3271
+ return async (d) => {
3272
+ let {
3273
+ url: m,
3274
+ method: g,
3275
+ data: w,
3276
+ signal: A,
3277
+ cancelToken: T,
3278
+ timeout: O,
3279
+ onDownloadProgress: x,
3280
+ onUploadProgress: b,
3281
+ responseType: D,
3282
+ headers: X,
3283
+ withCredentials: M = "same-origin",
3284
+ fetchOptions: st
3285
+ } = hi(d), V = t || fetch;
3286
+ D = D ? (D + "").toLowerCase() : "text";
3287
+ let at = yr([A, T && T.toAbortSignal()], O), q = null;
3288
+ const tt = at && at.unsubscribe && (() => {
3289
+ at.unsubscribe();
3290
+ });
3291
+ let oe;
3292
+ try {
3293
+ if (b && h && g !== "get" && g !== "head" && (oe = await y(X, w)) !== 0) {
3294
+ let J = new e(m, {
3295
+ method: "POST",
3296
+ body: w,
3297
+ duplex: "half"
3298
+ }), ot;
3299
+ if (l.isFormData(w) && (ot = J.headers.get("content-type")) && X.setContentType(ot), J.body) {
3300
+ const [Kt, wt] = Ie(
3301
+ oe,
3302
+ Ut(Be(b))
3303
+ );
3304
+ w = xe(J.body, Ve, Kt, wt);
3305
+ }
3306
+ }
3307
+ l.isString(M) || (M = M ? "include" : "omit");
3308
+ const K = s && "credentials" in e.prototype, ce = {
3309
+ ...st,
3310
+ signal: at,
3311
+ method: g.toUpperCase(),
3312
+ headers: X.normalize().toJSON(),
3313
+ body: w,
3314
+ duplex: "half",
3315
+ credentials: K ? M : void 0
3316
+ };
3317
+ q = s && new e(m, ce);
3318
+ let $ = await (s ? V(q, st) : V(m, ce));
3319
+ const ue = u && (D === "stream" || D === "response");
3320
+ if (u && (x || ue && tt)) {
3321
+ const J = {};
3322
+ ["status", "statusText", "headers"].forEach((he) => {
3323
+ J[he] = $[he];
3324
+ });
3325
+ const ot = l.toFiniteNumber($.headers.get("content-length")), [Kt, wt] = x && Ie(
3326
+ ot,
3327
+ Ut(Be(x), !0)
3328
+ ) || [];
3329
+ $ = new i(
3330
+ xe($.body, Ve, Kt, () => {
3331
+ wt && wt(), tt && tt();
3332
+ }),
3333
+ J
3198
3334
  );
3199
- i = ye(O.body, be, V, F);
3200
3335
  }
3201
- }
3202
- l.isString(f) || (f = f ? "include" : "omit");
3203
- const S = "credentials" in Request.prototype;
3204
- d = new Request(t, {
3205
- ..._,
3206
- signal: y,
3207
- method: e.toUpperCase(),
3208
- headers: u.normalize().toJSON(),
3209
- body: i,
3210
- duplex: "half",
3211
- credentials: S ? f : void 0
3212
- });
3213
- let E = await fetch(d, _);
3214
- const C = Ht && (h === "stream" || h === "response");
3215
- if (Ht && (o || C && m)) {
3216
- const O = {};
3217
- ["status", "statusText", "headers"].forEach((j) => {
3218
- O[j] = E[j];
3336
+ D = D || "text";
3337
+ let gi = await f[l.findKey(f, D) || "text"]($, d);
3338
+ return !ue && tt && tt(), await new Promise((J, ot) => {
3339
+ ci(J, ot, {
3340
+ data: gi,
3341
+ headers: L.from($.headers),
3342
+ status: $.status,
3343
+ statusText: $.statusText,
3344
+ config: d,
3345
+ request: q
3346
+ });
3219
3347
  });
3220
- const b = l.toFiniteNumber(E.headers.get("content-length")), [V, F] = o && _e(
3221
- b,
3222
- wt(ge(o), !0)
3223
- ) || [];
3224
- E = new Response(
3225
- ye(E.body, be, V, () => {
3226
- F && F(), m && m();
3227
- }),
3228
- O
3229
- );
3348
+ } catch (K) {
3349
+ throw tt && tt(), K && K.name === "TypeError" && /Load failed|fetch/i.test(K.message) ? Object.assign(
3350
+ new v("Network Error", v.ERR_NETWORK, d, q),
3351
+ {
3352
+ cause: K.cause || K
3353
+ }
3354
+ ) : v.from(K, K && K.code, d, q);
3230
3355
  }
3231
- h = h || "text";
3232
- let I = await Et[l.findKey(Et, h) || "text"](E, n);
3233
- return !C && m && m(), await new Promise((O, b) => {
3234
- qe(O, b, {
3235
- data: I,
3236
- headers: N.from(E.headers),
3237
- status: E.status,
3238
- statusText: E.statusText,
3239
- config: n,
3240
- request: d
3241
- });
3242
- });
3243
- } catch (S) {
3244
- throw m && m(), S && S.name === "TypeError" && /Load failed|fetch/i.test(S.message) ? Object.assign(
3245
- new P("Network Error", P.ERR_NETWORK, n, d),
3246
- {
3247
- cause: S.cause || S
3248
- }
3249
- ) : P.from(S, S && S.code, n, d);
3356
+ };
3357
+ }, Sr = /* @__PURE__ */ new Map(), li = (n) => {
3358
+ let t = n ? n.env : {};
3359
+ const { fetch: e, Request: i, Response: r } = t, s = [
3360
+ i,
3361
+ r,
3362
+ e
3363
+ ];
3364
+ let a = s.length, o = a, c, h, u = Sr;
3365
+ for (; o--; )
3366
+ c = s[o], h = u.get(c), h === void 0 && u.set(c, h = o ? /* @__PURE__ */ new Map() : wr(t)), u = h;
3367
+ return h;
3368
+ };
3369
+ li();
3370
+ const ee = {
3371
+ http: jn,
3372
+ xhr: mr,
3373
+ fetch: {
3374
+ get: li
3250
3375
  }
3251
- }), Wt = {
3252
- http: hn,
3253
- xhr: Fn,
3254
- fetch: $n
3255
3376
  };
3256
- l.forEach(Wt, (n, t) => {
3377
+ l.forEach(ee, (n, t) => {
3257
3378
  if (n) {
3258
3379
  try {
3259
3380
  Object.defineProperty(n, "name", { value: t });
@@ -3262,77 +3383,77 @@ l.forEach(Wt, (n, t) => {
3262
3383
  Object.defineProperty(n, "adapterName", { value: t });
3263
3384
  }
3264
3385
  });
3265
- const Pe = (n) => `- ${n}`, Jn = (n) => l.isFunction(n) || n === null || n === !1, ze = {
3266
- getAdapter: (n) => {
3386
+ const ke = (n) => `- ${n}`, Tr = (n) => l.isFunction(n) || n === null || n === !1, fi = {
3387
+ getAdapter: (n, t) => {
3267
3388
  n = l.isArray(n) ? n : [n];
3268
- const { length: t } = n;
3269
- let e, i;
3270
- const r = {};
3271
- for (let s = 0; s < t; s++) {
3272
- e = n[s];
3273
- let a;
3274
- if (i = e, !Jn(e) && (i = Wt[(a = String(e)).toLowerCase()], i === void 0))
3275
- throw new P(`Unknown adapter '${a}'`);
3276
- if (i)
3389
+ const { length: e } = n;
3390
+ let i, r;
3391
+ const s = {};
3392
+ for (let a = 0; a < e; a++) {
3393
+ i = n[a];
3394
+ let o;
3395
+ if (r = i, !Tr(i) && (r = ee[(o = String(i)).toLowerCase()], r === void 0))
3396
+ throw new v(`Unknown adapter '${o}'`);
3397
+ if (r && (l.isFunction(r) || (r = r.get(t))))
3277
3398
  break;
3278
- r[a || "#" + s] = i;
3399
+ s[o || "#" + a] = r;
3279
3400
  }
3280
- if (!i) {
3281
- const s = Object.entries(r).map(
3282
- ([o, c]) => `adapter ${o} ` + (c === !1 ? "is not supported by the environment" : "is not available in the build")
3401
+ if (!r) {
3402
+ const a = Object.entries(s).map(
3403
+ ([c, h]) => `adapter ${c} ` + (h === !1 ? "is not supported by the environment" : "is not available in the build")
3283
3404
  );
3284
- let a = t ? s.length > 1 ? `since :
3285
- ` + s.map(Pe).join(`
3286
- `) : " " + Pe(s[0]) : "as no adapter specified";
3287
- throw new P(
3288
- "There is no suitable adapter to dispatch the request " + a,
3405
+ let o = e ? a.length > 1 ? `since :
3406
+ ` + a.map(ke).join(`
3407
+ `) : " " + ke(a[0]) : "as no adapter specified";
3408
+ throw new v(
3409
+ "There is no suitable adapter to dispatch the request " + o,
3289
3410
  "ERR_NOT_SUPPORT"
3290
3411
  );
3291
3412
  }
3292
- return i;
3413
+ return r;
3293
3414
  },
3294
- adapters: Wt
3415
+ adapters: ee
3295
3416
  };
3296
- function Mt(n) {
3417
+ function $t(n) {
3297
3418
  if (n.cancelToken && n.cancelToken.throwIfRequested(), n.signal && n.signal.aborted)
3298
- throw new rt(null, n);
3419
+ throw new _t(null, n);
3299
3420
  }
3300
- function ve(n) {
3301
- return Mt(n), n.headers = N.from(n.headers), n.data = Lt.call(
3421
+ function Fe(n) {
3422
+ return $t(n), n.headers = L.from(n.headers), n.data = Gt.call(
3302
3423
  n,
3303
3424
  n.transformRequest
3304
- ), ["post", "put", "patch"].indexOf(n.method) !== -1 && n.headers.setContentType("application/x-www-form-urlencoded", !1), ze.getAdapter(n.adapter || ut.adapter)(n).then(function(i) {
3305
- return Mt(n), i.data = Lt.call(
3425
+ ), ["post", "put", "patch"].indexOf(n.method) !== -1 && n.headers.setContentType("application/x-www-form-urlencoded", !1), fi.getAdapter(n.adapter || Et.adapter, n)(n).then(function(i) {
3426
+ return $t(n), i.data = Gt.call(
3306
3427
  n,
3307
3428
  n.transformResponse,
3308
3429
  i
3309
- ), i.headers = N.from(i.headers), i;
3430
+ ), i.headers = L.from(i.headers), i;
3310
3431
  }, function(i) {
3311
- return je(i) || (Mt(n), i && i.response && (i.response.data = Lt.call(
3432
+ return oi(i) || ($t(n), i && i.response && (i.response.data = Gt.call(
3312
3433
  n,
3313
3434
  n.transformResponse,
3314
3435
  i.response
3315
- ), i.response.headers = N.from(i.response.headers))), Promise.reject(i);
3436
+ ), i.response.headers = L.from(i.response.headers))), Promise.reject(i);
3316
3437
  });
3317
3438
  }
3318
- const Ge = "1.10.0", Dt = {};
3439
+ const pi = "1.12.2", qt = {};
3319
3440
  ["object", "boolean", "number", "function", "string", "symbol"].forEach((n, t) => {
3320
- Dt[n] = function(i) {
3441
+ qt[n] = function(i) {
3321
3442
  return typeof i === n || "a" + (t < 1 ? "n " : " ") + n;
3322
3443
  };
3323
3444
  });
3324
- const we = {};
3325
- Dt.transitional = function(t, e, i) {
3445
+ const je = {};
3446
+ qt.transitional = function(t, e, i) {
3326
3447
  function r(s, a) {
3327
- return "[Axios v" + Ge + "] Transitional option '" + s + "'" + a + (i ? ". " + i : "");
3448
+ return "[Axios v" + pi + "] Transitional option '" + s + "'" + a + (i ? ". " + i : "");
3328
3449
  }
3329
3450
  return (s, a, o) => {
3330
3451
  if (t === !1)
3331
- throw new P(
3452
+ throw new v(
3332
3453
  r(a, " has been removed" + (e ? " in " + e : "")),
3333
- P.ERR_DEPRECATED
3454
+ v.ERR_DEPRECATED
3334
3455
  );
3335
- return e && !we[a] && (we[a] = !0, console.warn(
3456
+ return e && !je[a] && (je[a] = !0, console.warn(
3336
3457
  r(
3337
3458
  a,
3338
3459
  " has been deprecated since v" + e + " and will be removed in the near future"
@@ -3340,12 +3461,12 @@ Dt.transitional = function(t, e, i) {
3340
3461
  )), t ? t(s, a, o) : !0;
3341
3462
  };
3342
3463
  };
3343
- Dt.spelling = function(t) {
3464
+ qt.spelling = function(t) {
3344
3465
  return (e, i) => (console.warn(`${i} is likely a misspelling of ${t}`), !0);
3345
3466
  };
3346
- function Qn(n, t, e) {
3467
+ function Ar(n, t, e) {
3347
3468
  if (typeof n != "object")
3348
- throw new P("options must be an object", P.ERR_BAD_OPTION_VALUE);
3469
+ throw new v("options must be an object", v.ERR_BAD_OPTION_VALUE);
3349
3470
  const i = Object.keys(n);
3350
3471
  let r = i.length;
3351
3472
  for (; r-- > 0; ) {
@@ -3353,22 +3474,22 @@ function Qn(n, t, e) {
3353
3474
  if (a) {
3354
3475
  const o = n[s], c = o === void 0 || a(o, s, n);
3355
3476
  if (c !== !0)
3356
- throw new P("option " + s + " must be " + c, P.ERR_BAD_OPTION_VALUE);
3477
+ throw new v("option " + s + " must be " + c, v.ERR_BAD_OPTION_VALUE);
3357
3478
  continue;
3358
3479
  }
3359
3480
  if (e !== !0)
3360
- throw new P("Unknown option " + s, P.ERR_BAD_OPTION);
3481
+ throw new v("Unknown option " + s, v.ERR_BAD_OPTION);
3361
3482
  }
3362
3483
  }
3363
- const Pt = {
3364
- assertOptions: Qn,
3365
- validators: Dt
3366
- }, q = Pt.validators;
3367
- let J = class {
3484
+ const xt = {
3485
+ assertOptions: Ar,
3486
+ validators: qt
3487
+ }, H = xt.validators;
3488
+ let nt = class {
3368
3489
  constructor(t) {
3369
3490
  this.defaults = t || {}, this.interceptors = {
3370
- request: new pe(),
3371
- response: new pe()
3491
+ request: new Oe(),
3492
+ response: new Oe()
3372
3493
  };
3373
3494
  }
3374
3495
  /**
@@ -3397,20 +3518,20 @@ let J = class {
3397
3518
  }
3398
3519
  }
3399
3520
  _request(t, e) {
3400
- typeof t == "string" ? (e = e || {}, e.url = t) : e = t || {}, e = Q(this.defaults, e);
3521
+ typeof t == "string" ? (e = e || {}, e.url = t) : e = t || {}, e = rt(this.defaults, e);
3401
3522
  const { transitional: i, paramsSerializer: r, headers: s } = e;
3402
- i !== void 0 && Pt.assertOptions(i, {
3403
- silentJSONParsing: q.transitional(q.boolean),
3404
- forcedJSONParsing: q.transitional(q.boolean),
3405
- clarifyTimeoutError: q.transitional(q.boolean)
3523
+ i !== void 0 && xt.assertOptions(i, {
3524
+ silentJSONParsing: H.transitional(H.boolean),
3525
+ forcedJSONParsing: H.transitional(H.boolean),
3526
+ clarifyTimeoutError: H.transitional(H.boolean)
3406
3527
  }, !1), r != null && (l.isFunction(r) ? e.paramsSerializer = {
3407
3528
  serialize: r
3408
- } : Pt.assertOptions(r, {
3409
- encode: q.function,
3410
- serialize: q.function
3411
- }, !0)), e.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? e.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : e.allowAbsoluteUrls = !0), Pt.assertOptions(e, {
3412
- baseUrl: q.spelling("baseURL"),
3413
- withXsrfToken: q.spelling("withXSRFToken")
3529
+ } : xt.assertOptions(r, {
3530
+ encode: H.function,
3531
+ serialize: H.function
3532
+ }, !0)), e.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? e.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : e.allowAbsoluteUrls = !0), xt.assertOptions(e, {
3533
+ baseUrl: H.spelling("baseURL"),
3534
+ withXsrfToken: H.spelling("withXSRFToken")
3414
3535
  }, !0), e.method = (e.method || this.defaults.method || "get").toLowerCase();
3415
3536
  let a = s && l.merge(
3416
3537
  s.common,
@@ -3421,7 +3542,7 @@ let J = class {
3421
3542
  (d) => {
3422
3543
  delete s[d];
3423
3544
  }
3424
- ), e.headers = N.concat(a, s);
3545
+ ), e.headers = L.concat(a, s);
3425
3546
  const o = [];
3426
3547
  let c = !0;
3427
3548
  this.interceptors.request.forEach(function(m) {
@@ -3433,14 +3554,14 @@ let J = class {
3433
3554
  });
3434
3555
  let u, f = 0, _;
3435
3556
  if (!c) {
3436
- const d = [ve.bind(this), void 0];
3437
- for (d.unshift.apply(d, o), d.push.apply(d, h), _ = d.length, u = Promise.resolve(e); f < _; )
3557
+ const d = [Fe.bind(this), void 0];
3558
+ for (d.unshift(...o), d.push(...h), _ = d.length, u = Promise.resolve(e); f < _; )
3438
3559
  u = u.then(d[f++], d[f++]);
3439
3560
  return u;
3440
3561
  }
3441
3562
  _ = o.length;
3442
3563
  let y = e;
3443
- for (f = 0; f < _; ) {
3564
+ for (; f < _; ) {
3444
3565
  const d = o[f++], m = o[f++];
3445
3566
  try {
3446
3567
  y = d(y);
@@ -3450,7 +3571,7 @@ let J = class {
3450
3571
  }
3451
3572
  }
3452
3573
  try {
3453
- u = ve.call(this, y);
3574
+ u = Fe.call(this, y);
3454
3575
  } catch (d) {
3455
3576
  return Promise.reject(d);
3456
3577
  }
@@ -3459,14 +3580,14 @@ let J = class {
3459
3580
  return u;
3460
3581
  }
3461
3582
  getUri(t) {
3462
- t = Q(this.defaults, t);
3463
- const e = Ke(t.baseURL, t.url, t.allowAbsoluteUrls);
3464
- return Me(e, t.params, t.paramsSerializer);
3583
+ t = rt(this.defaults, t);
3584
+ const e = ui(t.baseURL, t.url, t.allowAbsoluteUrls);
3585
+ return ri(e, t.params, t.paramsSerializer);
3465
3586
  }
3466
3587
  };
3467
3588
  l.forEach(["delete", "get", "head", "options"], function(t) {
3468
- J.prototype[t] = function(e, i) {
3469
- return this.request(Q(i || {}, {
3589
+ nt.prototype[t] = function(e, i) {
3590
+ return this.request(rt(i || {}, {
3470
3591
  method: t,
3471
3592
  url: e,
3472
3593
  data: (i || {}).data
@@ -3476,7 +3597,7 @@ l.forEach(["delete", "get", "head", "options"], function(t) {
3476
3597
  l.forEach(["post", "put", "patch"], function(t) {
3477
3598
  function e(i) {
3478
3599
  return function(s, a, o) {
3479
- return this.request(Q(o || {}, {
3600
+ return this.request(rt(o || {}, {
3480
3601
  method: t,
3481
3602
  headers: i ? {
3482
3603
  "Content-Type": "multipart/form-data"
@@ -3486,9 +3607,9 @@ l.forEach(["post", "put", "patch"], function(t) {
3486
3607
  }));
3487
3608
  };
3488
3609
  }
3489
- J.prototype[t] = e(), J.prototype[t + "Form"] = e(!0);
3610
+ nt.prototype[t] = e(), nt.prototype[t + "Form"] = e(!0);
3490
3611
  });
3491
- let Zn = class $e {
3612
+ let Cr = class di {
3492
3613
  constructor(t) {
3493
3614
  if (typeof t != "function")
3494
3615
  throw new TypeError("executor must be a function.");
@@ -3512,7 +3633,7 @@ let Zn = class $e {
3512
3633
  i.unsubscribe(s);
3513
3634
  }, a;
3514
3635
  }, t(function(s, a, o) {
3515
- i.reason || (i.reason = new rt(s, a, o), e(i.reason));
3636
+ i.reason || (i.reason = new _t(s, a, o), e(i.reason));
3516
3637
  });
3517
3638
  }
3518
3639
  /**
@@ -3554,22 +3675,22 @@ let Zn = class $e {
3554
3675
  static source() {
3555
3676
  let t;
3556
3677
  return {
3557
- token: new $e(function(r) {
3678
+ token: new di(function(r) {
3558
3679
  t = r;
3559
3680
  }),
3560
3681
  cancel: t
3561
3682
  };
3562
3683
  }
3563
3684
  };
3564
- function Yn(n) {
3685
+ function Rr(n) {
3565
3686
  return function(e) {
3566
3687
  return n.apply(null, e);
3567
3688
  };
3568
3689
  }
3569
- function tr(n) {
3690
+ function Or(n) {
3570
3691
  return l.isObject(n) && n.isAxiosError === !0;
3571
3692
  }
3572
- const Xt = {
3693
+ const ie = {
3573
3694
  Continue: 100,
3574
3695
  SwitchingProtocols: 101,
3575
3696
  Processing: 102,
@@ -3634,54 +3755,54 @@ const Xt = {
3634
3755
  NotExtended: 510,
3635
3756
  NetworkAuthenticationRequired: 511
3636
3757
  };
3637
- Object.entries(Xt).forEach(([n, t]) => {
3638
- Xt[t] = n;
3758
+ Object.entries(ie).forEach(([n, t]) => {
3759
+ ie[t] = n;
3639
3760
  });
3640
- function Je(n) {
3641
- const t = new J(n), e = Ce(J.prototype.request, t);
3642
- return l.extend(e, J.prototype, t, { allOwnKeys: !0 }), l.extend(e, t, null, { allOwnKeys: !0 }), e.create = function(r) {
3643
- return Je(Q(n, r));
3761
+ function _i(n) {
3762
+ const t = new nt(n), e = Xe(nt.prototype.request, t);
3763
+ return l.extend(e, nt.prototype, t, { allOwnKeys: !0 }), l.extend(e, t, null, { allOwnKeys: !0 }), e.create = function(r) {
3764
+ return _i(rt(n, r));
3644
3765
  }, e;
3645
3766
  }
3646
- const T = Je(ut);
3647
- T.Axios = J;
3648
- T.CanceledError = rt;
3649
- T.CancelToken = Zn;
3650
- T.isCancel = je;
3651
- T.VERSION = Ge;
3652
- T.toFormData = Ot;
3653
- T.AxiosError = P;
3654
- T.Cancel = T.CanceledError;
3655
- T.all = function(t) {
3767
+ const S = _i(Et);
3768
+ S.Axios = nt;
3769
+ S.CanceledError = _t;
3770
+ S.CancelToken = Cr;
3771
+ S.isCancel = oi;
3772
+ S.VERSION = pi;
3773
+ S.toFormData = jt;
3774
+ S.AxiosError = v;
3775
+ S.Cancel = S.CanceledError;
3776
+ S.all = function(t) {
3656
3777
  return Promise.all(t);
3657
3778
  };
3658
- T.spread = Yn;
3659
- T.isAxiosError = tr;
3660
- T.mergeConfig = Q;
3661
- T.AxiosHeaders = N;
3662
- T.formToJSON = (n) => Fe(l.isHTMLForm(n) ? new FormData(n) : n);
3663
- T.getAdapter = ze.getAdapter;
3664
- T.HttpStatusCode = Xt;
3665
- T.default = T;
3779
+ S.spread = Rr;
3780
+ S.isAxiosError = Or;
3781
+ S.mergeConfig = rt;
3782
+ S.AxiosHeaders = L;
3783
+ S.formToJSON = (n) => ai(l.isHTMLForm(n) ? new FormData(n) : n);
3784
+ S.getAdapter = fi.getAdapter;
3785
+ S.HttpStatusCode = ie;
3786
+ S.default = S;
3666
3787
  const {
3667
- Axios: sr,
3668
- AxiosError: ar,
3669
- CanceledError: or,
3670
- isCancel: cr,
3671
- CancelToken: ur,
3672
- VERSION: hr,
3673
- all: lr,
3674
- Cancel: fr,
3675
- isAxiosError: pr,
3676
- spread: dr,
3677
- toFormData: _r,
3678
- AxiosHeaders: gr,
3679
- HttpStatusCode: mr,
3680
- formToJSON: yr,
3681
- getAdapter: br,
3682
- mergeConfig: Pr
3683
- } = T;
3684
- class vr extends Ze {
3788
+ Axios: Nr,
3789
+ AxiosError: xr,
3790
+ CanceledError: Vr,
3791
+ isCancel: Ur,
3792
+ CancelToken: Lr,
3793
+ VERSION: Mr,
3794
+ all: kr,
3795
+ Cancel: Fr,
3796
+ isAxiosError: jr,
3797
+ spread: qr,
3798
+ toFormData: Kr,
3799
+ AxiosHeaders: Hr,
3800
+ HttpStatusCode: Wr,
3801
+ formToJSON: Xr,
3802
+ getAdapter: zr,
3803
+ mergeConfig: Gr
3804
+ } = S;
3805
+ class $r extends mi {
3685
3806
  __pinPad__ = {
3686
3807
  buffer: null,
3687
3808
  about: {
@@ -3789,7 +3910,7 @@ class vr extends Ze {
3789
3910
  }
3790
3911
  },
3791
3912
  operation: {
3792
- amount: 0,
3913
+ amount: "0",
3793
3914
  reference: null,
3794
3915
  folio: null,
3795
3916
  authorization: null,
@@ -3798,7 +3919,14 @@ class vr extends Ze {
3798
3919
  commerceVoucher: "",
3799
3920
  clientVoucher: "",
3800
3921
  consultDate: null,
3801
- ignore: { counter: !1, counterSale: !1, isError92TRX: !1, C93Global: !1, error: "" },
3922
+ ignore: {
3923
+ responseGlobal: {},
3924
+ counter: !1,
3925
+ counterSale: !1,
3926
+ isError92TRX: !1,
3927
+ C93Global: !1,
3928
+ error: ""
3929
+ },
3802
3930
  finalResult: {},
3803
3931
  moto: {
3804
3932
  ccType: "",
@@ -3824,7 +3952,9 @@ class vr extends Ze {
3824
3952
  statusAboutWaiting: null,
3825
3953
  statusInjectWaiting: null,
3826
3954
  statusReadCardWaiting: null,
3827
- statusSecondGenerateWaiting: null
3955
+ statusSecondGenerateWaiting: null,
3956
+ statusinitDUKPTWaiting: null,
3957
+ statuswritingDUKPTWaiting: null
3828
3958
  }
3829
3959
  };
3830
3960
  constructor({
@@ -3860,14 +3990,11 @@ class vr extends Ze {
3860
3990
  environment: "production",
3861
3991
  socket: !1
3862
3992
  }) {
3863
- if (super({ filters: t, config_port: e, no_device: i, device_listen_on_channel: r, socket: c }), this.__internal__.device.type = "pinpad", !Ye())
3993
+ if (super({ filters: t, config_port: e, no_device: i, device_listen_on_channel: r, socket: c }), this.__internal__.device.type = "pinpad", !yi())
3864
3994
  throw new Error("Crypto not supported in this browser");
3865
- if (Yt.getCustom(this.typeDevice, i))
3995
+ if (le.getCustom(this.typeDevice, i))
3866
3996
  throw new Error(`Device ${this.typeDevice} ${i} already exists`);
3867
- this.__internal__.time.response_connection = 3e3, this.__internal__.time.response_general = 5e3, this.__internal__.serial.delay_first_connection = 1e3, this.environment = o, s && (this.username = s), a && (this.password = a), this.#A(), this.#C();
3868
- }
3869
- #C() {
3870
- Yt.add(this);
3997
+ this.__internal__.time.response_connection = 3e3, this.__internal__.time.response_general = 5e3, this.__internal__.serial.delay_first_connection = 1e3, this.environment = o, s && (this.username = s), a && (this.password = a), this.#A(), le.add(this);
3871
3998
  }
3872
3999
  #A() {
3873
4000
  const t = [
@@ -3886,7 +4013,7 @@ class vr extends Ze {
3886
4013
  async timeout(t, e) {
3887
4014
  await super.timeout(t, e), this.__pinPad__.waiting.statusAboutWaiting && e === "about" ? this.__pinPad__.waiting.statusAboutWaiting = "rejected" : this.__pinPad__.waiting.statusInjectWaiting && e === "inject" ? this.__pinPad__.waiting.statusInjectWaiting = "rejected" : this.__pinPad__.waiting.statusinitDUKPTWaiting && e === "init-dukpt" ? this.__pinPad__.waiting.statusinitDUKPTWaiting = "rejected" : this.__pinPad__.waiting.statuswritingDUKPTWaiting && e === "dukpt" ? this.__pinPad__.waiting.statuswritingDUKPTWaiting = "rejected" : this.__pinPad__.waiting.statusReadCardWaiting && e === "read-card" ? this.__pinPad__.waiting.statusReadCardWaiting = "rejected" : this.__pinPad__.waiting.statusSecondGenerateWaiting && e === "second-generate" && (this.__pinPad__.waiting.statusSecondGenerateWaiting = "rejected");
3888
4015
  }
3889
- #R(t) {
4016
+ #C(t) {
3890
4017
  const e = this.__pinPad__.constants.STX, i = this.__pinPad__.constants.ETX, r = this.__pinPad__.constants.FS, s = this.__pinPad__.constants.getNULL;
3891
4018
  t = t.replace(new RegExp(e, "g"), "");
3892
4019
  const a = t.split(i);
@@ -3899,6 +4026,7 @@ class vr extends Ze {
3899
4026
  return { [f]: _.replace(new RegExp(s, "g"), "") };
3900
4027
  }).forEach((h) => Object.assign(c, h)), c;
3901
4028
  }
4029
+ // @ts-expect-error parts is not used
3902
4030
  #f(t, e) {
3903
4031
  const i = this.__pinPad__.constants.ETX, r = e.substring(e.indexOf("D") + 2, e.indexOf("E"));
3904
4032
  let s = 0;
@@ -3907,14 +4035,8 @@ class vr extends Ze {
3907
4035
  const h = r.replace("MITP_1.00.", "").replace("MITP_01.00.", "").replace("MITD_1.00.", "").replace("MITD_01.00.", "");
3908
4036
  s = parseInt(h), s >= 15 && (this.__pinPad__.about.hasCashback = !0);
3909
4037
  }
3910
- this.__pinPad__.about.supportInjection = a, e.indexOf("M") > 0 ? (this.__pinPad__.about.supportSign = e.substring(e.indexOf("L") + 2, e.indexOf("M")), this.__pinPad__.about.supportInjection ? this.__pinPad__.about.supportContactlessCollisionCard = e.substring(
3911
- e.indexOf("M") + 2,
3912
- e.indexOf("N")
3913
- ) : (this.__pinPad__.about.supportContactlessCollisionCard = e.substring(
3914
- e.indexOf("M") + 2,
3915
- e.indexOf(i)
3916
- ), this.__pinPad__.about.supportContactless = !0)) : (this.__pinPad__.about.supportSign = e.substring(e.indexOf("L") + 2, e.indexOf(i)), this.__pinPad__.about.supportContactless = !1), this.__pinPad__.about.supportDUKPT = e.substring(e.indexOf("J") + 2, e.indexOf("K")), this.__pinPad__.about.EMV = e.substring(e.indexOf("E") + 2, e.indexOf("F")), this.__pinPad__.about.serial = e.substring(e.indexOf("C") + 2, e.indexOf("D")), this.__pinPad__.about.printer = e.substring(e.indexOf("F") + 2, e.indexOf("G")), this.__pinPad__.about.model = e.substring(e.indexOf("B") + 2, e.indexOf("C")), this.__pinPad__.about.brand = o, this.__pinPad__.about.appVersion = r;
3917
- const c = e.substring(e.indexOf("K") + 2, e.indexOf("L"));
4038
+ this.__pinPad__.about.supportInjection = a, e.indexOf("M") > 0 ? (this.__pinPad__.about.supportSign = e.substring(e.indexOf("L") + 2, e.indexOf("M")) == "1", this.__pinPad__.about.supportInjection ? this.__pinPad__.about.supportContactlessCollisionCard = e.substring(e.indexOf("M") + 2, e.indexOf("N")) === "1" : (this.__pinPad__.about.supportContactlessCollisionCard = e.substring(e.indexOf("M") + 2, e.indexOf(i)) == "1", this.__pinPad__.about.supportContactless = !0)) : (this.__pinPad__.about.supportSign = e.substring(e.indexOf("L") + 2, e.indexOf(i)) == "1", this.__pinPad__.about.supportContactless = !1), this.__pinPad__.about.supportDUKPT = e.substring(e.indexOf("J") + 2, e.indexOf("K")), this.__pinPad__.about.EMV = e.substring(e.indexOf("E") + 2, e.indexOf("F")), this.__pinPad__.about.serial = e.substring(e.indexOf("C") + 2, e.indexOf("D")), this.__pinPad__.about.printer = e.substring(e.indexOf("F") + 2, e.indexOf("G")), this.__pinPad__.about.model = e.substring(e.indexOf("B") + 2, e.indexOf("C")), this.__pinPad__.about.brand = o, this.__pinPad__.about.appVersion = r;
4039
+ const c = e.substring(e.indexOf("K") + 2, e.indexOf("L")) == "1";
3918
4040
  this.__pinPad__.about.pp = {
3919
4041
  brand: o,
3920
4042
  appVersion: r,
@@ -3924,7 +4046,7 @@ class vr extends Ze {
3924
4046
  supportSign: this.__pinPad__.about.supportSign,
3925
4047
  supportContactlessCollisionCard: this.__pinPad__.about.supportContactlessCollisionCard,
3926
4048
  supportContactless: this.__pinPad__.about.supportContactless,
3927
- supportDUKPT: this.__pinPad__.about.supportDUKPT,
4049
+ supportDUKPT: this.__pinPad__.about.supportDUKPT == "1",
3928
4050
  hasDUKPTKeys: c,
3929
4051
  EMV: this.__pinPad__.about.EMV,
3930
4052
  serial: this.__pinPad__.about.serial,
@@ -3932,11 +4054,11 @@ class vr extends Ze {
3932
4054
  model: this.__pinPad__.about.model
3933
4055
  }, this.__pinPad__.waiting.statusAboutWaiting && (this.__pinPad__.waiting.statusAboutWaiting = "resolved");
3934
4056
  }
3935
- // eslint-disable-next-line no-unused-vars
3936
- #O(t, e) {
4057
+ #R() {
3937
4058
  this.__pinPad__.waiting.statusInjectWaiting = "resolved";
3938
4059
  }
3939
- #x(t, e) {
4060
+ // @ts-expect-error parts is not used
4061
+ #O(t, e) {
3940
4062
  e = e.replace("010P93A00B01t036P81AACERQUE, INSERTE CHIP O DESLICE*", ""), this.__pinPad__.config.terminal = {
3941
4063
  nb_kcv: e.substring(e.indexOf("E") + 2, e.indexOf("F")),
3942
4064
  nb_marca_terminal: e.substring(e.indexOf("P91A") + 4, e.indexOf("B")),
@@ -3946,12 +4068,12 @@ class vr extends Ze {
3946
4068
  nb_version_terminal: e.substring(e.indexOf("D") + 2, e.indexOf("E"))
3947
4069
  }, this.__pinPad__.waiting.statusinitDUKPTWaiting = "resolved";
3948
4070
  }
3949
- // eslint-disable-next-line no-unused-vars
3950
- #D(t, e) {
4071
+ #D() {
3951
4072
  this.__pinPad__.waiting.statuswritingDUKPTWaiting = "resolved";
3952
4073
  }
4074
+ // @ts-expect-error parts is not used
3953
4075
  #I(t, e) {
3954
- const i = this.__pinPad__.about.brand.toLowerCase(), r = this.__pinPad__.about.model.toLowerCase(), s = i === "ingenico" && r === "ipp320" ? 500 : 350;
4076
+ const i = this.__pinPad__.about?.brand?.toLowerCase(), r = this.__pinPad__.about?.model?.toLowerCase(), s = i === "ingenico" && r === "ipp320" ? 500 : 350;
3955
4077
  if (e.length < s) {
3956
4078
  e = e.replace("006P93A00.", "").replace("006P93A00,", ""), e.includes("E93") ? this.__pinPad__.operation.ignore.error = e.substring(e.indexOf("E93") + 3, e.indexOf("E93") + 6) : e.includes("E71") && (this.__pinPad__.operation.ignore.error = e.substring(e.indexOf("E71") + 3, e.indexOf("E71") + 6)), this.__pinPad__.operation.ignore.error !== "" && e.indexOf("OPERACION CANCELADA") === -1 && e.indexOf("TIEMPO EXCEDIDO") === -1 && this.__pinPad__.operation.ignore.error.length === 3 && (this.__pinPad__.operation.last_error = this.#T(this.__pinPad__.operation.ignore.error), this.__pinPad__.waiting.statusReadCardWaiting = "rejected");
3957
4079
  return;
@@ -3961,13 +4083,14 @@ class vr extends Ze {
3961
4083
  i === "verifone" && (a = e.replace("006P93A00.", "").substring(e.indexOf("P93A"), e.indexOf("P93A") + 7)), e.includes("P81APROCESANDO, NO RETIRE TARJETA") || e.includes("P81APROCESANDO TARJETA") || a.includes("P93A022") || a.includes("P81AINSERTE CHIP O DESLICE TARJETA") || a.includes("ACERQUE, INSERTE CHIP O DESLICE") || a.includes("P81AACERQUE, INSERTE CHIP O DESLICE TARJETA") ? this.dispatch("pp:processing-card", { waiting: !0 }) : e.length > s && this.#N(e);
3962
4084
  }
3963
4085
  }
4086
+ // @ts-expect-error parts is not used
3964
4087
  #B(t, e) {
3965
4088
  const i = this.__pinPad__.constants.ETX;
3966
4089
  let r = e.replace("023P81AFAVOR RETIRAR TARJ.", "").replace("020P81A DECLINADA EMV ", "").replace("020P81A DECLINADA EMV ", "");
3967
4090
  r = r.substring(r.indexOf("B") + 2, r.indexOf(i)), r.includes("006E93A16") && (r = "01"), this.__pinPad__.operation.applyReverse = r === "01" && this.__pinPad__.operation.responseMit._approved && this.__pinPad__.config.otherLogin.executeReverse === "1", this.__pinPad__.waiting.statusSecondGenerateWaiting = "resolved";
3968
4091
  }
3969
4092
  #N(t) {
3970
- const e = this.__pinPad__.constants.ETX, i = this.__pinPad__.about.brand.toLowerCase();
4093
+ const e = this.__pinPad__.constants.ETX, i = this.__pinPad__.about?.brand?.toLowerCase();
3971
4094
  let r, s, a, o, c;
3972
4095
  i === "verifone" ? t = t.replace("006P93A00.", "").replace("009P93A00", "").replace("010P93A00B01v", "") : t = t.replace("006P93A00,", ""), this.__pinPad__.config.read.POSEM = t.substring(t.indexOf("P93A") + 4, t.indexOf("B"));
3973
4096
  const h = this.__pinPad__.config.read.POSEM;
@@ -3999,7 +4122,7 @@ class vr extends Ze {
3999
4122
  u = t.substring(t.indexOf("P93A022"), t.indexOf("I") + 23), u = u.substring(u.indexOf("I") + 2, u.indexOf(e));
4000
4123
  else
4001
4124
  u = t.substring(t.indexOf("P93A800"), t.indexOf("I") + 23), u = u.substring(u.indexOf("I") + 2, u.indexOf(e));
4002
- this.__pinPad__.config.read.NB_ksn = u, this.__pinPad__.config.read.NB_Data = t.substring(t.indexOf("B") + 2, t.indexOf("C")), s = t.substring(t.indexOf("F") + 2, t.indexOf("G")), r = t.substring(t.indexOf("G") + 2, t.indexOf("H")), this.__pinPad__.about.model.toLowerCase() === "vx520" ? (a = t.substring(t.indexOf("H") + 2, t.indexOf("I")), this.__pinPad__.config.read.ChipName = a) : (a = t.substring(t.indexOf("H") + 2, t.indexOf("I")), this.__pinPad__.config.read.ChipName = a);
4125
+ this.__pinPad__.config.read.NB_ksn = u, this.__pinPad__.config.read.NB_Data = t.substring(t.indexOf("B") + 2, t.indexOf("C")), s = t.substring(t.indexOf("F") + 2, t.indexOf("G")), r = t.substring(t.indexOf("G") + 2, t.indexOf("H")), this.__pinPad__.about.model?.toLowerCase() === "vx520" ? (a = t.substring(t.indexOf("H") + 2, t.indexOf("I")), this.__pinPad__.config.read.ChipName = a) : (a = t.substring(t.indexOf("H") + 2, t.indexOf("I")), this.__pinPad__.config.read.ChipName = a);
4003
4126
  }
4004
4127
  r.includes("/") && (r = r.replace("/", "")), r.toString().length === 4 ? (c = r.toString().substring(0, 2), o = r.toString().substring(2)) : (c = "", o = ""), this.__pinPad__.config.read.Chip === "1" ? (this.__pinPad__.config.read.EMV = "3", this.__pinPad__.config.read.ChipNameEnc = "1") : (this.__pinPad__.config.read.ChipNameEnc = "", this.__pinPad__.config.read.EMV = "2"), this.__pinPad__.config.read.AppIdLabel.toLowerCase().includes("american") || this.__pinPad__.config.read.AppIdLabel.toLowerCase().includes("amex") ? this.__pinPad__.config.read.Type = "AMEX" : this.__pinPad__.config.read.Type = "V/MC", this.__pinPad__.operation.bin = s, s.length > 6 && (this.__pinPad__.operation.bin = s.substring(0, 6)), this.__pinPad__.waiting.statusReadCardWaiting = "resolved", this.dispatch("pp:read-card", {
4005
4128
  ERROR: "",
@@ -4009,41 +4132,42 @@ class vr extends Ze {
4009
4132
  year: o
4010
4133
  });
4011
4134
  }
4012
- #V(t, e) {
4135
+ // @ts-expect-error parts is not used
4136
+ #x(t, e) {
4013
4137
  e.length > 10 && e.includes("E93A10") && (this.__pinPad__.waiting.statusReadCardWaiting === "pending" && (this.__pinPad__.waiting.statusReadCardWaiting = "rejected"), this.dispatch("pp:error", { message: "Operation cancelled by user." }));
4014
4138
  }
4015
- #U(t, e) {
4016
- const i = this;
4017
- if (this.__pinPad__.about.model.toLowerCase() === "vx520") {
4139
+ // @ts-expect-error parts is not used
4140
+ #V(t, e) {
4141
+ if (this.__pinPad__.about.model?.toLowerCase() === "vx520") {
4018
4142
  if (e.length > 11)
4019
4143
  if (e.includes("P59A00"))
4020
- this.__pinPad__.operation.clientVoucher !== "" ? setTimeout(function() {
4021
- i.print("client").then(() => {
4022
- }).catch((r) => {
4023
- console.error(r);
4144
+ this.__pinPad__.operation.clientVoucher !== "" ? setTimeout(() => {
4145
+ this.print("client").then(() => {
4146
+ }).catch((i) => {
4147
+ console.error(i);
4024
4148
  });
4025
4149
  }, 1e3) : this.dispatch("pp:print", { type: "success" });
4026
4150
  else {
4027
- const r = e.includes("E17") || e.includes("A17") ? { type: "warning", message: "printer without paper" } : { type: "error", message: "The voucher could not be printed" };
4028
- this.dispatch("pp:print", r);
4151
+ const i = e.includes("E17") || e.includes("A17") ? { type: "warning", message: "printer without paper" } : { type: "error", message: "The voucher could not be printed" };
4152
+ this.dispatch("pp:print", i);
4029
4153
  }
4030
4154
  } else if (e.includes("P59A00"))
4031
- this.__pinPad__.operation.clientVoucher !== "" ? setTimeout(function() {
4032
- i.print("client").then(() => {
4033
- }).catch((r) => {
4034
- console.error(r);
4155
+ this.__pinPad__.operation.clientVoucher !== "" ? setTimeout(() => {
4156
+ this.print("client").then(() => {
4157
+ }).catch((i) => {
4158
+ console.error(i);
4035
4159
  });
4036
4160
  }, 1e3) : this.dispatch("pp:print", { type: "success" });
4037
4161
  else {
4038
- const r = e.includes("E17") || e.includes("A17") ? { type: "warning", message: "printer without paper" } : { type: "error", message: "The voucher could not be printed" };
4039
- this.dispatch("pp:print", r);
4162
+ const i = e.includes("E17") || e.includes("A17") ? { type: "warning", message: "printer without paper" } : { type: "error", message: "The voucher could not be printed" };
4163
+ this.dispatch("pp:print", i);
4040
4164
  }
4041
4165
  }
4042
- // eslint-disable-next-line no-unused-vars
4043
- #L(t, e) {
4166
+ #U(t, e) {
4167
+ console.log(t, e);
4044
4168
  }
4045
- // eslint-disable-next-line no-unused-vars
4046
- #M(t, e) {
4169
+ #L(t, e) {
4170
+ console.log(t, e);
4047
4171
  }
4048
4172
  serialMessage(t) {
4049
4173
  const e = {
@@ -4054,8 +4178,7 @@ class vr extends Ze {
4054
4178
  request: this.lastAction,
4055
4179
  no_code: 0,
4056
4180
  parsed: null
4057
- }, i = this.parseHexToUint8(t), r = this.parseUint8ArrayToString(i);
4058
- let s = this.#R(r);
4181
+ }, i = this.parseHexToUint8(t), r = this.parseUint8ArrayToString(i), s = this.#C(r);
4059
4182
  switch (this.__pinPad__.buffer = r, e.parsed = s, e.code = r, e.request) {
4060
4183
  case "connect":
4061
4184
  e.name = "connected", e.description = "Connection established", e.no_code = 100, this.#f(s, r);
@@ -4064,13 +4187,13 @@ class vr extends Ze {
4064
4187
  e.name = "About PinPad", e.description = "Response of about", e.no_code = 101, this.#f(s, r);
4065
4188
  break;
4066
4189
  case "inject":
4067
- e.name = "Inject", e.description = "Response of inject values", e.no_code = 102, this.#O(s, r);
4190
+ e.name = "Inject", e.description = "Response of inject values", e.no_code = 102, this.#R();
4068
4191
  break;
4069
4192
  case "init-dukpt":
4070
- e.name = "Init DUKPT", e.description = "Response of init DUKPT", e.no_code = 103, this.#x(s, r);
4193
+ e.name = "Init DUKPT", e.description = "Response of init DUKPT", e.no_code = 103, this.#O(s, r);
4071
4194
  break;
4072
4195
  case "dukpt":
4073
- e.name = "Write DUKPT", e.description = "Response of write DUKPT", e.no_code = 104, this.#D(s, r);
4196
+ e.name = "Write DUKPT", e.description = "Response of write DUKPT", e.no_code = 104, this.#D();
4074
4197
  break;
4075
4198
  case "read-card":
4076
4199
  e.name = "read card", e.description = "response of read card", e.no_code = 105, this.#I(s, r);
@@ -4082,16 +4205,16 @@ class vr extends Ze {
4082
4205
  e.name = "cancel pinpad", e.description = "response of cancel", e.no_code = 107;
4083
4206
  break;
4084
4207
  case "print":
4085
- this.#U(s, r), e.name = "print voucher", e.description = "response of print", e.no_code = 108;
4208
+ this.#V(s, r), e.name = "print voucher", e.description = "response of print", e.no_code = 108;
4086
4209
  break;
4087
4210
  case "cancel-read-card":
4088
- this.#V(s, r), e.name = "cancel read card", e.description = "response of cancel read card", e.no_code = 109;
4211
+ this.#x(s, r), e.name = "cancel read card", e.description = "response of cancel read card", e.no_code = 109;
4089
4212
  break;
4090
4213
  case "code93":
4091
- this.#L(s, r), e.name = "code 93", e.description = "response of code 93", e.no_code = 110;
4214
+ this.#U(s, r), e.name = "code 93", e.description = "response of code 93", e.no_code = 110;
4092
4215
  break;
4093
4216
  case "finish-emv-end":
4094
- this.#M(s, r), e.name = "Finish EMV End", e.description = "response of finish EMV End", e.no_code = 111;
4217
+ this.#L(s, r), e.name = "Finish EMV End", e.description = "response of finish EMV End", e.no_code = 111;
4095
4218
  break;
4096
4219
  default:
4097
4220
  e.name = "unknown", e.description = "Unknown command", e.no_code = 400;
@@ -4099,17 +4222,15 @@ class vr extends Ze {
4099
4222
  }
4100
4223
  this.dispatch("serial:message", e);
4101
4224
  }
4102
- // eslint-disable-next-line no-unused-vars
4103
- serialSetConnectionConstant(t = 1) {
4104
- const e = "", i = "";
4105
- let r = "C56AABOUT";
4106
- r = e + r.length.toString().padStart(3, "0") + r + i;
4107
- let s = 0;
4108
- for (let o = 0; o < r.length; o++)
4109
- s ^= r.charCodeAt(o);
4110
- r = r + String.fromCharCode(s);
4111
- const a = this.parseStringToBytes(r, "");
4112
- return this.add0x(a);
4225
+ serialSetConnectionConstant() {
4226
+ let i = "C56AABOUT";
4227
+ i = "" + i.length.toString().padStart(3, "0") + i + "";
4228
+ let r = 0;
4229
+ for (let a = 0; a < i.length; a++)
4230
+ r ^= i.charCodeAt(a);
4231
+ i = i + String.fromCharCode(r);
4232
+ const s = this.parseStringToBytes(i, "");
4233
+ return this.add0x(s);
4113
4234
  }
4114
4235
  async sendCustomCode({ code: t = "" } = {}) {
4115
4236
  if (typeof t != "string") throw new Error("Invalid string");
@@ -4144,7 +4265,7 @@ class vr extends Ze {
4144
4265
  this.__pinPad__.operation.reference = t.trim().toString().replaceAll(" ", "").toUpperCase();
4145
4266
  }
4146
4267
  get reference() {
4147
- return this.__pinPad__.operation.reference;
4268
+ return this.__pinPad__.operation.reference || "";
4148
4269
  }
4149
4270
  get url() {
4150
4271
  const t = this.environment;
@@ -4188,7 +4309,7 @@ class vr extends Ze {
4188
4309
  // Updated to WS v4
4189
4310
  // ========================================================================================
4190
4311
  #s(t, e) {
4191
- const i = new Ei();
4312
+ const i = new tn();
4192
4313
  return i.setPublicKey(t), i.encrypt(e);
4193
4314
  }
4194
4315
  #a(t) {
@@ -4200,7 +4321,7 @@ class vr extends Ze {
4200
4321
  }
4201
4322
  return i;
4202
4323
  }
4203
- #k(t) {
4324
+ #M(t) {
4204
4325
  const e = "0123456789abcdef", i = [], r = [];
4205
4326
  for (let s = 0; s < 256; s++)
4206
4327
  i[s] = e.charAt(s >> 4) + e.charAt(s & 15);
@@ -4226,8 +4347,8 @@ class vr extends Ze {
4226
4347
  // return decodedArray.join('');
4227
4348
  // }
4228
4349
  async #o(t, e) {
4229
- const i = new Uint8Array(t.match(/.{1,2}/g).map((f) => parseInt(f, 16))), r = crypto.getRandomValues(new Uint8Array(16)), a = new TextEncoder().encode(e), o = await crypto.subtle.importKey("raw", i, { name: "AES-CBC" }, !1, ["encrypt"]), c = await crypto.subtle.encrypt({ name: "AES-CBC", iv: r }, o, a), h = btoa(String.fromCharCode(...r)), u = btoa(String.fromCharCode(...new Uint8Array(c)));
4230
- return h + u;
4350
+ const i = t.match(/.{1,2}/g) || [], r = new Uint8Array(i.map((_) => parseInt(_, 16))), s = crypto.getRandomValues(new Uint8Array(16)), o = new TextEncoder().encode(e), c = await crypto.subtle.importKey("raw", r, { name: "AES-CBC" }, !1, ["encrypt"]), h = await crypto.subtle.encrypt({ name: "AES-CBC", iv: s }, c, o), u = btoa(String.fromCharCode(...s)), f = btoa(String.fromCharCode(...new Uint8Array(h)));
4351
+ return u + f;
4231
4352
  }
4232
4353
  // async AESDecrypt(key, encryptedMessage) {
4233
4354
  // const keyBytes = new Uint8Array(key.match(/.{1,2}/g).map((byte) => parseInt(byte, 16)));
@@ -4252,7 +4373,7 @@ class vr extends Ze {
4252
4373
  // const decoder = new TextDecoder();
4253
4374
  // return decoder.decode(decrypted);
4254
4375
  // }
4255
- #F(t, e, i = !1) {
4376
+ #k(t, e, i = !1) {
4256
4377
  const r = [];
4257
4378
  for (let h = 0; h < 256; h++)
4258
4379
  r[h] = h;
@@ -4262,15 +4383,15 @@ class vr extends Ze {
4262
4383
  let a = 0, o = 0, c = "";
4263
4384
  for (const h of e) {
4264
4385
  a = (a + 1) % 256, o = (o + r[a]) % 256, [r[a], r[o]] = [r[o], r[a]];
4265
- let u = r[(r[a] + r[o]) % 256];
4386
+ const u = r[(r[a] + r[o]) % 256];
4266
4387
  c += String.fromCharCode(h.charCodeAt(0) ^ u);
4267
4388
  }
4268
- return i ? this.#k(c).toUpperCase() : c;
4389
+ return i ? this.#M(c).toUpperCase() : c;
4269
4390
  }
4270
4391
  #n(t, e) {
4271
- return this.#F(t, this.hexToAscii(e));
4392
+ return this.#k(t, this.hexToAscii(e));
4272
4393
  }
4273
- #j(t) {
4394
+ #F(t) {
4274
4395
  return t.replaceAll("Á", "A"), t.replaceAll("É", "E"), t.replaceAll("Í", "I"), t.replaceAll("Ó", "O"), t.replaceAll("Ú", "U"), t.replaceAll("á", "a"), t.replaceAll("é", "e"), t.replaceAll("í", "i"), t.replaceAll("ó", "o"), t.replaceAll("ú", "u"), t.replaceAll("ñ", "n"), t.replaceAll("Ñ", "N"), t.replaceAll('Electr?a"', "Electronica"), t;
4275
4396
  }
4276
4397
  #t(t, e, i) {
@@ -4280,12 +4401,12 @@ class vr extends Ze {
4280
4401
  }
4281
4402
  return t.trim() + "@br @br @br @br @br";
4282
4403
  }
4283
- #q(t, e) {
4404
+ #j(t, e) {
4284
4405
  const i = "@logo3 @br", r = "@cnn " + e;
4285
4406
  return t.includes("@cnb Santander") ? (t = t.replace("@cnb Santander", "@logo1@br"), this.#t(t, i, r)) : t.includes("@cnb American Express") ? (t = t.replace("@cnb American Express", "@logo2@br"), this.#t(t, i, r)) : t.includes("@cnb HSBC") ? (t = t.replace("@cnb HSBC", "@logo7@br"), this.#t(t, i, r)) : t.includes("@cnb IXE") ? (t = t.replace("@cnb IXE", "@logo11@br"), this.#t(t, i, r)) : t.includes("@cnb MULTIVA") ? (t = t.replace("@cnb MULTIVA", "@logo15@br"), this.#t(t, i, r)) : t.includes("@cnb Multiva") ? (t = t.replace("@cnb Multiva", "@logo15@br"), this.#t(t, i, r)) : t.includes("@cnb SCOTIA BANK") ? (t = t.replace("@cnb SCOTIA BANK", "@logo16@br"), this.#t(t, i, r)) : t.includes("@cnb SCOTIABANK") ? (t = t.replace("@cnb SCOTIABANK", "@logo16@br"), this.#t(t, i, r)) : t.includes("@cnb BANCOMER") ? (t = t.replace("@cnb BANCOMER", "@logo17@br"), this.#t(t, i, r)) : t.includes("@cnb Bancomer") ? (t = t.replace("@cnb Bancomer", "@logo17@br"), this.#t(t, i, r)) : t.includes("@cnb BBVA") ? (t = t.replace("@cnb BBVA", "@logo17@br"), this.#t(t, i, r)) : t.includes("@cnb BANORTE") ? (t = t.replace("@cnb BANORTE", "@logo18@br"), this.#t(t, i, r)) : t.includes("@cnb Banorte") ? (t = t.replace("@cnb Banorte", "@logo18@br"), this.#t(t, i, r)) : t.includes("@cnb BANREGIO") ? (t = t.replace("@cnb BANREGIO", "@logo19@br"), this.#t(t, i, r)) : t.includes("@cnb Banregio") ? (t = t.replace("@cnb Banregio", "@logo19@br"), this.#t(t, i, r)) : t.includes("@cnb GETNET") ? (t = t.replace("@cnb GETNET", "@logo20@br"), this.#t(t, i, r)) : t.includes("@cnb GetNET") ? (t = t.replace("@cnb GetNET", "@logo20@br"), this.#t(t, i, r)) : this.#t(t, i, r);
4286
4407
  }
4287
- async #K(t = !1) {
4288
- if (this.#W(), this.__pinPad__.config.loginResponse && !t) return await this.#p();
4408
+ async #q(t = !1) {
4409
+ if (this.#H(), this.__pinPad__.config.loginResponse && !t) return await this.#p();
4289
4410
  const e = this.url + this.__pinPad__.constants.uris.login, i = {
4290
4411
  usuario: this.username,
4291
4412
  password: this.password,
@@ -4296,42 +4417,44 @@ class vr extends Ze {
4296
4417
  };
4297
4418
  if (await this.#c(), this.#d())
4298
4419
  throw new Error("Empty RSA Key");
4299
- const r = this.#a(32), s = this.#s(this.__pinPad__.config.publicKeyRSA, r), a = await this.#o(r, JSON.stringify(i)), o = await T.post(e, a, {
4420
+ const r = this.#a(32), s = this.#s(this.__pinPad__.config.publicKeyRSA || "", r), a = await this.#o(r, JSON.stringify(i)), o = await S.post(e, a, {
4300
4421
  headers: {
4301
4422
  "Content-Type": "application/json",
4302
4423
  "cache-control": "no-cache, must-revalidate, post-check=0, pre-check=0, max-age=0",
4303
4424
  data: s || ""
4304
4425
  }
4305
- }).catch((h) => {
4306
- throw new Error(`Error in request, verify internet connection: ${h.response?.status} ${h.message}`);
4307
- });
4308
- let c = this.#b(JSON.stringify(o.data));
4309
- if (typeof c == "string" && (c = JSON.parse(c)), !c)
4426
+ }).catch((u) => {
4427
+ throw new Error(`Error in request, verify internet connection: ${u.response?.status} ${u.message}`);
4428
+ }), c = this.#b(JSON.stringify(o.data));
4429
+ let h = c;
4430
+ if (typeof c == "string" && (h = JSON.parse(c)), !h)
4310
4431
  throw new Error("Invalid response JSON");
4311
- if (c.RESPUESTA === "error")
4312
- throw new Error(c);
4313
- return this.__pinPad__.config.loginResponse = c, localStorage.setItem(
4432
+ if (h.RESPUESTA === "error")
4433
+ throw new Error(h);
4434
+ return this.__pinPad__.config.loginResponse = h, localStorage.setItem(
4314
4435
  "ppLoginResponse",
4315
4436
  JSON.stringify({
4316
4437
  timestamp: (/* @__PURE__ */ new Date()).getTime(),
4317
- data: c
4438
+ data: h
4318
4439
  })
4319
4440
  ), await this.#p();
4320
4441
  }
4321
4442
  async #p() {
4322
- await this.#J();
4443
+ await this.#G();
4323
4444
  try {
4324
- await this.#$();
4445
+ await this.getPosition();
4325
4446
  } catch (t) {
4326
4447
  console.log("Error getting position", t);
4327
4448
  }
4328
- return this.__pinPad__.config.otherLogin = {}, this.#H(this.__pinPad__.config.loginResponse), this.__pinPad__.config.otherLogin;
4449
+ return this.__pinPad__.config.otherLogin = {}, this.#K(this.__pinPad__.config.loginResponse), this.__pinPad__.config.otherLogin;
4329
4450
  }
4330
- #H(t) {
4451
+ #K(t) {
4331
4452
  let e = "", i = "";
4332
4453
  t.xml?.ventaspropias?.merchant_currencyb && (e = t.xml.ventaspropias.merchant_currencyb), t.xml?.ventaspropias?.merchant_currencym && (i = t.xml.ventaspropias.merchant_currencym);
4333
4454
  let r = t.xml?.emvReverso;
4334
- r || (r = "0"), this.__pinPad__.config.internal.stTokenization = t.xml?.st_tokenizacion, !this.__pinPad__.config.internal.stTokenization || this.__pinPad__.config.internal.stTokenization === "false" || this.__pinPad__.config.internal.stTokenization === "0" ? this.__pinPad__.config.internal.stTokenization = !1 : this.__pinPad__.config.internal.stTokenization && (this.__pinPad__.config.internal.stTokenization = !0), this.__pinPad__.config.internal.emv = t.xml.importesPGS, this.__pinPad__.config.internal.qpsDomestic = this.__pinPad__.config.internal.emv.qps_dom, this.__pinPad__.config.internal.qpsInternational = this.__pinPad__.config.internal.emv.qps_il, this.__pinPad__.config.internal.cvmlVMCDomestic = this.__pinPad__.config.internal.emv.cvml_vm_dom, this.__pinPad__.config.internal.cvmlVMCInternational = this.__pinPad__.config.internal.emv.cvml_vm_il, this.__pinPad__.config.internal.cvmlAmex = this.__pinPad__.config.internal.emv.cvml_amex, this.__pinPad__.config.internal.translimitCTLSVMC = this.__pinPad__.config.internal.emv.tl_mc, this.__pinPad__.config.internal.translimitCTLSAmex = this.__pinPad__.config.internal.emv.tl_amex, this.__pinPad__.config.country = t.country.toUpperCase(), this.__pinPad__.config.idBranch = t.id_branch.toUpperCase(), this.__pinPad__.config.idCompany = t.id_company.toUpperCase(), this.__pinPad__.config.otherLogin = {
4455
+ r || (r = "0");
4456
+ const s = t.xml?.st_tokenizacion;
4457
+ !s || s === "false" || s === "0" ? this.__pinPad__.config.internal.stTokenization = !1 : this.__pinPad__.config.internal.stTokenization && (this.__pinPad__.config.internal.stTokenization = !0), this.__pinPad__.config.internal.emv = t.xml.importesPGS, this.__pinPad__.config.internal.qpsDomestic = this.__pinPad__.config.internal.emv.qps_dom, this.__pinPad__.config.internal.qpsInternational = this.__pinPad__.config.internal.emv.qps_il, this.__pinPad__.config.internal.cvmlVMCDomestic = this.__pinPad__.config.internal.emv.cvml_vm_dom, this.__pinPad__.config.internal.cvmlVMCInternational = this.__pinPad__.config.internal.emv.cvml_vm_il, this.__pinPad__.config.internal.cvmlAmex = this.__pinPad__.config.internal.emv.cvml_amex, this.__pinPad__.config.internal.translimitCTLSVMC = this.__pinPad__.config.internal.emv.tl_mc, this.__pinPad__.config.internal.translimitCTLSAmex = this.__pinPad__.config.internal.emv.tl_amex, this.__pinPad__.config.country = t.country.toUpperCase(), this.__pinPad__.config.idBranch = t.id_branch.toUpperCase(), this.__pinPad__.config.idCompany = t.id_company.toUpperCase(), this.__pinPad__.config.otherLogin = {
4335
4458
  bsUser: t.user,
4336
4459
  nbUser: t.nb_user,
4337
4460
  bsCompany: t.id_company,
@@ -4345,18 +4468,22 @@ class vr extends Ze {
4345
4468
  executeReverse: r
4346
4469
  };
4347
4470
  }
4348
- #W() {
4349
- let t = localStorage.getItem("ppLoginResponse");
4350
- t && (t = JSON.parse(t), this.__pinPad__.config.loginResponse || (this.__pinPad__.config.loginResponse = t.data), (/* @__PURE__ */ new Date()).getTime() - t.timestamp >= 864e5 && (this.__pinPad__.config.loginResponse = null));
4471
+ #H() {
4472
+ const t = localStorage.getItem("ppLoginResponse");
4473
+ let e = null;
4474
+ t && (e = JSON.parse(t), this.__pinPad__.config.loginResponse || (this.__pinPad__.config.loginResponse = e?.data), (/* @__PURE__ */ new Date()).getTime() - e?.timestamp >= 864e5 && (this.__pinPad__.config.loginResponse = null));
4351
4475
  }
4352
4476
  async login({ force: t = !1 } = {}) {
4353
- return await this.#K(t);
4477
+ return await this.#q(t);
4354
4478
  }
4355
- async #X() {
4356
- const t = this.url + this.__pinPad__.constants.uris.RSAKey, e = await T.get(t).catch((i) => {
4357
- throw new Error(`Error in request, verify internet connection: ${i.response.status} ${i.message}`);
4479
+ async #W() {
4480
+ const t = this.url + this.__pinPad__.constants.uris.RSAKey, e = await S.get(t).catch((r) => {
4481
+ throw new Error(`Error in request, verify internet connection: ${r.response.status} ${r.message}`);
4358
4482
  });
4359
- if (e.headers.get("content-type").indexOf("application/json") === -1)
4483
+ if (!e) return "";
4484
+ const i = e.headers;
4485
+ if (!i) return "";
4486
+ if (i.get("content-type").indexOf("application/json") === -1)
4360
4487
  throw new Error("Fail to fetch RSA public key");
4361
4488
  return this.__pinPad__.config.publicKeyRSA = e.data.key_public, localStorage.setItem(
4362
4489
  "ppRSAKey",
@@ -4370,11 +4497,13 @@ class vr extends Ze {
4370
4497
  localStorage.removeItem("ppLoginResponse"), localStorage.removeItem("ppRSAKey"), localStorage.removeItem("ppPublicIP");
4371
4498
  }
4372
4499
  #d() {
4373
- let t = localStorage.getItem("ppRSAKey");
4374
- return !t || (t = JSON.parse(t), this.__pinPad__.config.publicKeyRSA = t.data, (/* @__PURE__ */ new Date()).getTime() - t.timestamp >= 864e5) ? !0 : !this.__pinPad__.config.publicKeyRSA;
4500
+ const t = localStorage.getItem("ppRSAKey");
4501
+ if (!t) return !0;
4502
+ const e = JSON.parse(t);
4503
+ return !e.data || (this.__pinPad__.config.publicKeyRSA = e.data, (/* @__PURE__ */ new Date()).getTime() - e.timestamp >= 864e5) ? !0 : !this.__pinPad__.config.publicKeyRSA;
4375
4504
  }
4376
4505
  async #_() {
4377
- return this.#d() ? await this.#X() : this.__pinPad__.config.publicKeyRSA;
4506
+ return this.#d() ? await this.#W() : this.__pinPad__.config.publicKeyRSA;
4378
4507
  }
4379
4508
  async #c() {
4380
4509
  if (!await this.#_())
@@ -4383,8 +4512,8 @@ class vr extends Ze {
4383
4512
  #g(t) {
4384
4513
  return /^[A-Z-a-z0-9\s]+$/g.test(t);
4385
4514
  }
4386
- #z(t) {
4387
- if (K(t))
4515
+ #X(t) {
4516
+ if (z(t))
4388
4517
  return !0;
4389
4518
  const e = /^[A-Z-a-z0-9\s]+$/g.test(t) === !0;
4390
4519
  if (!e)
@@ -4421,7 +4550,7 @@ class vr extends Ze {
4421
4550
  if (typeof t != "string") throw new Error("Invalid string");
4422
4551
  return !t || /<html(?:\s+lang=["'][^"']*["'])?>/i.test(t) || (t = t.replace(/aaa/g, "á"), t = t.replace(/eee/g, "é"), t = t.replace(/iii/g, "í"), t = t.replace(/ooo/g, "ó"), t = t.replace(/uuu/g, "ú"), t = t.replace(/NNN/g, "Ñ"), t = t.replace(/nnn/g, "ñ"), t = t.replace(/á/g, "á")), t;
4423
4552
  }
4424
- async #G() {
4553
+ async #z() {
4425
4554
  const t = this.__pinPad__.constants.STX, e = this.__pinPad__.constants.ETX;
4426
4555
  let i = "C55ACANCEL";
4427
4556
  i = t + this.#e(i) + i + e, i = i + this.#i(i);
@@ -4437,7 +4566,7 @@ class vr extends Ze {
4437
4566
  return e + i;
4438
4567
  }
4439
4568
  async checkPositionPermission() {
4440
- if (!Qt())
4569
+ if (!fe())
4441
4570
  throw new Error("Geolocation not supported");
4442
4571
  return new Promise((t, e) => {
4443
4572
  navigator.permissions.query({ name: "geolocation" }).then((i) => {
@@ -4445,8 +4574,8 @@ class vr extends Ze {
4445
4574
  }).catch(() => e(!1));
4446
4575
  });
4447
4576
  }
4448
- async #$() {
4449
- return this.__pinPad__.config.latitude && this.__pinPad__.config.longitude ? this.latitudeLongitude : (this.__pinPad__.config.latitude = null, this.__pinPad__.config.longitude = null, Qt() ? new Promise((t) => {
4577
+ async getPosition() {
4578
+ return this.__pinPad__.config.latitude && this.__pinPad__.config.longitude ? this.latitudeLongitude : (this.__pinPad__.config.latitude = null, this.__pinPad__.config.longitude = null, fe() ? new Promise((t) => {
4450
4579
  navigator.geolocation.getCurrentPosition(
4451
4580
  (e) => {
4452
4581
  this.__pinPad__.config.latitude = e.coords.latitude, this.__pinPad__.config.longitude = e.coords.longitude, t(this.latitudeLongitude);
@@ -4457,23 +4586,30 @@ class vr extends Ze {
4457
4586
  );
4458
4587
  }) : this.latitudeLongitude);
4459
4588
  }
4460
- async #J() {
4461
- let t = localStorage.getItem("ppPublicIP");
4462
- if (t && (t = JSON.parse(t), this.__pinPad__.config.publicIP = t.data, (/* @__PURE__ */ new Date()).getTime() - t.timestamp >= 864e5 && (this.__pinPad__.config.publicIP = null)), this.__pinPad__.config.publicIP) return this.__pinPad__.config.publicIP;
4589
+ async #G() {
4590
+ const t = localStorage.getItem("ppPublicIP");
4591
+ if (t) {
4592
+ const s = JSON.parse(t);
4593
+ this.__pinPad__.config.publicIP = s.data, (/* @__PURE__ */ new Date()).getTime() - s.timestamp >= 864e5 && (this.__pinPad__.config.publicIP = null);
4594
+ }
4595
+ if (this.__pinPad__.config.publicIP) return this.__pinPad__.config.publicIP;
4463
4596
  this.__pinPad__.config.publicIP = null;
4464
4597
  let e = !1;
4465
- const i = await T.get("https://api.ipify.org?format=json").catch(() => e = !0);
4466
- return e ? null : (this.__pinPad__.config.publicIP = i.data.ip || null, localStorage.setItem(
4598
+ const i = await S.get("https://api.ipify.org?format=json").catch(() => e = !0);
4599
+ if (e || typeof i != "object" || !i || !i.data)
4600
+ return null;
4601
+ const r = i.data || {};
4602
+ return this.__pinPad__.config.publicIP = r.ip || null, localStorage.setItem(
4467
4603
  "ppPublicIP",
4468
4604
  JSON.stringify({
4469
4605
  timestamp: (/* @__PURE__ */ new Date()).getTime(),
4470
- data: i.data.ip
4606
+ data: r.ip
4471
4607
  })
4472
- ), this.__pinPad__.config.publicIP);
4608
+ ), this.__pinPad__.config.publicIP;
4473
4609
  }
4474
4610
  async cancelReadCard() {
4475
4611
  let t = "012VXVCANCELl";
4476
- this.__pinPad__.about.model.toLowerCase() === "ingenico" && (t = "029C50AOPERACION CANCELADA");
4612
+ this.__pinPad__.about.model?.toLowerCase() === "ingenico" && (t = "029C50AOPERACION CANCELADA");
4477
4613
  const e = this.parseStringToBytes(t, "");
4478
4614
  await this.appendToQueue(e, "cancel-read-card");
4479
4615
  }
@@ -4496,7 +4632,7 @@ class vr extends Ze {
4496
4632
  });
4497
4633
  return;
4498
4634
  }
4499
- r = this.#j(r), r = this.#q(r, this.__pinPad__.constants.appName + this.__pinPad__.constants.appVersion);
4635
+ r = this.#F(r), r = this.#j(r, this.__pinPad__.constants.appName + this.__pinPad__.constants.appVersion);
4500
4636
  let s = "C59A" + r;
4501
4637
  s = e + this.#e(s) + s + i, s = s + this.#i(s), t === "client" ? this.__pinPad__.operation.clientVoucher = "" : t === "commerce" && (this.__pinPad__.operation.commerceVoucher = "");
4502
4638
  const a = this.parseStringToBytes(s, "");
@@ -4504,9 +4640,8 @@ class vr extends Ze {
4504
4640
  }
4505
4641
  async #r(t, e) {
4506
4642
  await this.#c();
4507
- const i = this.#a(32);
4508
- let r = this.#s(this.__pinPad__.config.publicKeyRSA, i), s = await this.#o(i, JSON.stringify(e));
4509
- return (await T.post(t, s, {
4643
+ const i = this.#a(32), r = this.#s(this.__pinPad__.config.publicKeyRSA || "", i), s = await this.#o(i, JSON.stringify(e));
4644
+ return (await S.post(t, s, {
4510
4645
  headers: {
4511
4646
  "Content-Type": "application/json",
4512
4647
  "cache-control": "no-cache",
@@ -4540,10 +4675,14 @@ class vr extends Ze {
4540
4675
  // this.dispatch('pp:merchant-moto', response);
4541
4676
  // return response;
4542
4677
  // }
4543
- async #w({ data: t, url: e, cancelable: i = !1 } = {}) {
4678
+ async #E({ data: t, url: e, cancelable: i = !1 } = {
4679
+ data: null,
4680
+ url: "",
4681
+ cancelable: !1
4682
+ }) {
4544
4683
  await this.#c();
4545
- const r = this.#a(32), s = this.#s(this.__pinPad__.config.publicKeyRSA, r), a = await this.#o(r, JSON.stringify(t)), o = this;
4546
- return (await T.post(e, a, {
4684
+ const r = this.#a(32), s = this.#s(this.__pinPad__.config.publicKeyRSA || "", r), a = await this.#o(r, JSON.stringify(t)), o = this;
4685
+ return (await S.post(e, a, {
4547
4686
  headers: {
4548
4687
  "Content-Type": "application/json",
4549
4688
  "cache-control": "no-cache",
@@ -4551,10 +4690,10 @@ class vr extends Ze {
4551
4690
  }
4552
4691
  }).catch(async (h) => {
4553
4692
  let u = `Error in request, verify internet connection: ${h.status} ${h.message}`;
4554
- throw h.response.status >= 500 && h.response.status <= 599 ? u = "Service Temporarily Unavailable" : h.response.status >= 400 && h.response.status <= 499 && (u = "Bad Request"), i && await o.#G(), new Error(u);
4693
+ throw h.response.status >= 500 && h.response.status <= 599 ? u = "Service Temporarily Unavailable" : h.response.status >= 400 && h.response.status <= 499 && (u = "Bad Request"), i && await o.#z(), new Error(u);
4555
4694
  })).data;
4556
4695
  }
4557
- async #Q() {
4696
+ async #$() {
4558
4697
  const t = this.__pinPad__.constants.FS, e = this.__pinPad__.constants.ETX, i = this.__pinPad__.constants.STX;
4559
4698
  let r = "C57A" + this.__pinPad__.config.internal.qpsDomestic;
4560
4699
  if (r = r + t + "B" + this.__pinPad__.config.internal.qpsInternational, r = r + t + "C" + this.__pinPad__.config.internal.cvmlVMCDomestic, r = r + t + "D" + this.__pinPad__.config.internal.cvmlVMCInternational, r = r + t + "E" + this.__pinPad__.config.internal.cvmlAmex, r = r + t + "F" + this.__pinPad__.config.internal.translimitCTLSVMC, r = r + t + "G" + this.__pinPad__.config.internal.translimitCTLSAmex, r = i + this.#e(r) + r + e, r = r + this.#i(r), !this.__pinPad__.about.injectedValues) {
@@ -4562,13 +4701,13 @@ class vr extends Ze {
4562
4701
  await this.appendToQueue(s, "inject");
4563
4702
  }
4564
4703
  }
4565
- async #Z() {
4704
+ async #J() {
4566
4705
  this.__pinPad__.operation.bin8 && (this.__pinPad__.operation.bin = this.__pinPad__.operation.bin8), this.__pinPad__.operation.bin8 = "";
4567
- const t = await this.#w({
4706
+ const t = await this.#E({
4568
4707
  data: {
4569
4708
  accion: "tipoPagoInfo",
4570
4709
  cc_num: this.__pinPad__.operation.bin,
4571
- usuario: this.username.toUpperCase(),
4710
+ usuario: this.username?.toUpperCase(),
4572
4711
  canal: this.__pinPad__.constants.typeChannel,
4573
4712
  tp_canal: "1",
4574
4713
  tp_moneda: this.__pinPad__.config.currency.toUpperCase()
@@ -4589,34 +4728,41 @@ class vr extends Ze {
4589
4728
  * @param {function|null} callback
4590
4729
  * @return {Promise<unknown>}
4591
4730
  */
4592
- async #Y(t = null) {
4731
+ async #Q(t = null) {
4593
4732
  if (this.__pinPad__.waiting.statusAboutWaiting) throw new Error("AboutPP is already running");
4594
4733
  const e = this.__pinPad__.constants.STX, i = this.__pinPad__.constants.ETX;
4595
4734
  let r = "C56AABOUT";
4596
- if (r = e + this.#e(r) + r + i, r = r + this.#i(r), K(this.__pinPad__.about.pp)) {
4735
+ if (r = e + this.#e(r) + r + i, r = r + this.#i(r), z(this.__pinPad__.about.pp)) {
4597
4736
  this.__pinPad__.waiting.statusAboutWaiting = "pending";
4598
- const o = this.parseStringToBytes(r, "");
4599
- await this.appendToQueue(o, "about");
4737
+ const a = this.parseStringToBytes(r, "");
4738
+ await this.appendToQueue(a, "about");
4600
4739
  } else
4601
- return t ? t(this.__pinPad__.about.pp.supportDUKPT, this.__pinPad__.about.pp.hasDUKPTKeys) : !0;
4602
- const s = this;
4603
- let a = 0;
4604
- return new Promise((o, c) => {
4605
- a = setInterval(() => {
4606
- if (s.__pinPad__.waiting.statusAboutWaiting === "resolved") {
4607
- if (clearInterval(a), s.__pinPad__.waiting.statusAboutWaiting = null, K(s.__pinPad__.about.pp))
4740
+ return t ? t(this.__pinPad__.about.pp?.supportDUKPT || !1, this.__pinPad__.about.pp?.hasDUKPTKeys || !1) : !0;
4741
+ let s = 0;
4742
+ return new Promise((a, o) => {
4743
+ s = setInterval(() => {
4744
+ if (this.__pinPad__.waiting.statusAboutWaiting === "resolved") {
4745
+ if (clearInterval(s), this.__pinPad__.waiting.statusAboutWaiting = null, z(this.__pinPad__.about.pp))
4746
+ return;
4747
+ if (!t || typeof t != "function") {
4748
+ a(!0);
4608
4749
  return;
4609
- t || o(!0), o(t(s.__pinPad__.about.pp.supportDUKPT, s.__pinPad__.about.pp.hasDUKPTKeys));
4610
- } else s.__pinPad__.waiting.statusAboutWaiting === "rejected" && (clearInterval(a), s.__pinPad__.waiting.statusAboutWaiting = null, c("Error"));
4750
+ }
4751
+ const c = t(
4752
+ this.__pinPad__.about.pp?.supportDUKPT || !1,
4753
+ this.__pinPad__.about.pp?.hasDUKPTKeys || !1
4754
+ );
4755
+ a(c);
4756
+ } else this.__pinPad__.waiting.statusAboutWaiting === "rejected" && (clearInterval(s), this.__pinPad__.waiting.statusAboutWaiting = null, o("Error"));
4611
4757
  }, 500);
4612
4758
  });
4613
4759
  }
4614
4760
  async #l(t, e) {
4615
- if (t = t ? t.toString() : "", e = e ? e.toString() : "", K(t) || t === "0") {
4761
+ if (t = t ? t.toString() : "", e = e ? e.toString() : "", z(t) || t === "0") {
4616
4762
  this.dispatch("pp:dukpt", { status: "unsupported", already: !1 });
4617
4763
  return;
4618
4764
  }
4619
- if (K(e) || e === "1") {
4765
+ if (z(e) || e === "1") {
4620
4766
  this.dispatch("pp:dukpt", { status: "charged", already: !0 });
4621
4767
  return;
4622
4768
  }
@@ -4626,52 +4772,50 @@ class vr extends Ze {
4626
4772
  const h = this.parseStringToBytes(c, "");
4627
4773
  await this.appendToQueue(h, "init-dukpt");
4628
4774
  let u = 0;
4629
- this.__pinPad__.waiting.statusinitDUKPTWaiting = "pending";
4630
- const f = this;
4631
- return new Promise((_, y) => {
4775
+ return this.__pinPad__.waiting.statusinitDUKPTWaiting = "pending", new Promise((f, _) => {
4632
4776
  u = setInterval(async () => {
4633
- f.__pinPad__.waiting.statusinitDUKPTWaiting === "resolved" ? (clearInterval(u), f.__pinPad__.waiting.statusinitDUKPTWaiting = null, f.dispatch("pp:dukpt", { status: "charged", already: !1 }), await f.#tt(), _(!0)) : f.__pinPad__.waiting.statusinitDUKPTWaiting === "rejected" && (clearInterval(u), f.__pinPad__.waiting.statusinitDUKPTWaiting = null, y("Error"));
4777
+ this.__pinPad__.waiting.statusinitDUKPTWaiting === "resolved" ? (clearInterval(u), this.__pinPad__.waiting.statusinitDUKPTWaiting = null, this.dispatch("pp:dukpt", { status: "charged", already: !1 }), await this.#Z(), f(!0)) : this.__pinPad__.waiting.statusinitDUKPTWaiting === "rejected" && (clearInterval(u), this.__pinPad__.waiting.statusinitDUKPTWaiting = null, _("Error"));
4634
4778
  }, 500);
4635
4779
  });
4636
4780
  }
4637
- async #tt() {
4781
+ async #Z() {
4638
4782
  const t = {
4639
4783
  IPEK_REQUESTType: {
4640
4784
  business: {
4641
- country: this.__pinPad__.config.country.toUpperCase(),
4642
- id_branch: this.__pinPad__.config.idBranch.toUpperCase(),
4643
- id_company: this.__pinPad__.config.idCompany.toUpperCase(),
4644
- pwd: this.password.toUpperCase(),
4645
- user: this.username.toUpperCase()
4785
+ country: this.__pinPad__.config.country?.toUpperCase(),
4786
+ id_branch: this.__pinPad__.config.idBranch?.toUpperCase(),
4787
+ id_company: this.__pinPad__.config.idCompany?.toUpperCase(),
4788
+ pwd: this.password?.toUpperCase(),
4789
+ user: this.username?.toUpperCase()
4646
4790
  },
4647
4791
  terminal: this.__pinPad__.config.terminal
4648
4792
  }
4649
- }, e = await this.#w({
4793
+ }, e = await this.#E({
4650
4794
  data: t,
4651
4795
  url: this.url + this.__pinPad__.constants.uris.keysDUKPT
4652
4796
  });
4653
- await this.#ft(e);
4797
+ await this.#ht(e);
4654
4798
  }
4655
- async #et() {
4799
+ async #Y() {
4656
4800
  if (!await this.#_())
4657
4801
  throw new Error("RSA public key is empty");
4658
4802
  const e = this;
4659
- await this.#Y(async function(r, s) {
4803
+ await this.#Q(async function(r, s) {
4660
4804
  if (e.__pinPad__.about.supportInjection && e.__pinPad__.config.internal.emv && e.__pinPad__.about.injectedValues)
4661
4805
  return await e.#l(r, s), !0;
4662
4806
  let a = 0;
4663
- return e.__pinPad__.waiting.statusInjectWaiting = "pending", await e.#Q(), new Promise((o, c) => {
4807
+ return e.__pinPad__.waiting.statusInjectWaiting = "pending", await e.#$(), new Promise((o, c) => {
4664
4808
  a = setInterval(async () => {
4665
4809
  e.__pinPad__.waiting.statusInjectWaiting === "resolved" ? (clearInterval(a), e.__pinPad__.waiting.statusInjectWaiting = null, await e.#l(r, s), o(!0)) : e.__pinPad__.waiting.statusInjectWaiting === "rejected" && (clearInterval(a), e.__pinPad__.waiting.statusInjectWaiting = null, c("Error"));
4666
4810
  }, 500);
4667
4811
  });
4668
4812
  });
4669
4813
  }
4670
- #E(t, e = 0) {
4814
+ #w(t, e = 0) {
4671
4815
  if (t = parseFloat(t.toString().replace(/[^0-9.-]/g, "")), isNaN(t) || t === 0)
4672
4816
  return parseFloat("0").toFixed(e);
4673
4817
  t = t.toFixed(e);
4674
- let i = t.split(".");
4818
+ const i = t.split(".");
4675
4819
  return i[0] = i[0].replace(/\B(?=(\d{3})+(?!\d))/g, ""), i.join(".");
4676
4820
  }
4677
4821
  getClientVoucher() {
@@ -4680,43 +4824,44 @@ class vr extends Ze {
4680
4824
  getCommerceVoucher() {
4681
4825
  return this.__pinPad__.operation.commerceVoucher;
4682
4826
  }
4683
- async #it() {
4827
+ async #tt() {
4684
4828
  this.__pinPad__.operation.errors = 0;
4685
4829
  let t = "ACERQUE, INSERTE CHIP O DESLICE TARJETA";
4686
- if (this.__pinPad__.about.supportContactless || (t = "INSERTE CHIP O DESLICE TARJETA"), this.__pinPad__.about.model.toUpperCase().includes("UX300") && (t = "ACERQUE O INSERTE TARJETA"), K(this.amount) || this.amount <= 0)
4830
+ if (this.__pinPad__.about.supportContactless || (t = "INSERTE CHIP O DESLICE TARJETA"), this.__pinPad__.about.model?.toUpperCase().includes("UX300") && (t = "ACERQUE O INSERTE TARJETA"), z(this.amount) || isNaN(parseFloat(this.amount)))
4687
4831
  throw new Error("Amount required");
4832
+ if (parseFloat(this.amount) <= 0)
4833
+ throw new Error("Amount must be greater than 0");
4688
4834
  if (this.#m(this.amount) === !1)
4689
4835
  throw new Error("Invalid amount required");
4690
- if (this.#h(this.amount, 2) <= 0)
4836
+ if (parseFloat(this.#h(this.amount, 2)) <= 0)
4691
4837
  throw new Error("Amount must be greater than 0");
4692
4838
  const e = this.__pinPad__.constants.FS, i = this.__pinPad__.constants.STX, r = this.__pinPad__.constants.ETX;
4693
4839
  let s = "C93A" + t;
4694
- s = s + e + "B" + this.#P(), s = s + e + "C" + this.#v(), s = s + e + "D" + this.#h(this.amount, 2), s = s + e + "E0.00", s = s + e + "F" + this.__pinPad__.config.currencyCode, this.__pinPad__.about.supportDUKPT && this.__pinPad__.about.supportDUKPT !== "0" && this.__pinPad__.about.supportDUKPT !== "false" && (this.__pinPad__.about.supportContactless ? (s = s + e + "G" + this.timeoutPinPad, s = s + e + "HTAGS", s = s + e + "I" + this.__pinPad__.config.requireCVVAmex, s = s + e + "J" + this.__pinPad__.config.forceOnline, s = s + e + "K" + this.__pinPad__.about.supportContactless, s = s + e + "L" + this.__pinPad__.config.emvCard, this.__pinPad__.about.hasCashback && (s = s + e + "M0", s = s + e + "N00")) : (s = s + e + "G" + this.timeoutPinPad, s = s + e + "HTAGS", s = s + e + "I" + this.__pinPad__.config.requireCVVAmex, s = s + e + "L" + this.__pinPad__.config.emvCard), this.__pinPad__.about.supportInjection && (s = s + e + "O" + this.__pinPad__.config.validateQPS)), s = i + this.#e(s) + s + r, s = s + this.#i(s), this.#pt();
4840
+ s = s + e + "B" + this.#P(), s = s + e + "C" + this.#v(), s = s + e + "D" + this.#h(this.amount, 2), s = s + e + "E0.00", s = s + e + "F" + this.__pinPad__.config.currencyCode, this.__pinPad__.about.supportDUKPT && this.__pinPad__.about.supportDUKPT !== "0" && this.__pinPad__.about.supportDUKPT !== "false" && (this.__pinPad__.about.supportContactless ? (s = s + e + "G" + this.timeoutPinPad, s = s + e + "HTAGS", s = s + e + "I" + this.__pinPad__.config.requireCVVAmex, s = s + e + "J" + this.__pinPad__.config.forceOnline, s = s + e + "K" + this.__pinPad__.about.supportContactless, s = s + e + "L" + this.__pinPad__.config.emvCard, this.__pinPad__.about.hasCashback && (s = s + e + "M0", s = s + e + "N00")) : (s = s + e + "G" + this.timeoutPinPad, s = s + e + "HTAGS", s = s + e + "I" + this.__pinPad__.config.requireCVVAmex, s = s + e + "L" + this.__pinPad__.config.emvCard), this.__pinPad__.about.supportInjection && (s = s + e + "O" + this.__pinPad__.config.validateQPS)), s = i + this.#e(s) + s + r, s = s + this.#i(s), this.#lt();
4695
4841
  const a = this.parseStringToBytes(s, "");
4696
4842
  await this.appendToQueue(a, "read-card");
4697
4843
  let o = 0;
4698
- const c = this;
4699
- return this.__pinPad__.waiting.statusReadCardWaiting = "pending", new Promise((h, u) => {
4844
+ return this.__pinPad__.waiting.statusReadCardWaiting = "pending", new Promise((c, h) => {
4700
4845
  o = setInterval(() => {
4701
- if (c.__pinPad__.waiting.statusReadCardWaiting === "resolved")
4702
- clearInterval(o), c.__pinPad__.waiting.statusReadCardWaiting = null, h(!0);
4703
- else if (c.__pinPad__.waiting.statusReadCardWaiting === "rejected") {
4704
- clearInterval(o), c.__pinPad__.waiting.statusReadCardWaiting = null;
4705
- const f = c.__pinPad__.operation.last_error;
4706
- u(f ?? "Error reading card");
4846
+ if (this.__pinPad__.waiting.statusReadCardWaiting === "resolved")
4847
+ clearInterval(o), this.__pinPad__.waiting.statusReadCardWaiting = null, c(!0);
4848
+ else if (this.__pinPad__.waiting.statusReadCardWaiting === "rejected") {
4849
+ clearInterval(o), this.__pinPad__.waiting.statusReadCardWaiting = null;
4850
+ const u = this.__pinPad__.operation.last_error;
4851
+ h(u ?? "Error reading card");
4707
4852
  }
4708
4853
  }, 500);
4709
4854
  });
4710
4855
  }
4711
- async #nt(t) {
4712
- return await Zt(t * 1e3);
4856
+ async #et(t) {
4857
+ return await pe(t * 1e3);
4713
4858
  }
4714
4859
  /**
4715
4860
  * @param {null|string} reference
4716
4861
  * @return {Promise<any>}
4717
4862
  */
4718
- async consult({ reference: t = null }) {
4719
- return t || (t = this.reference), K(t) && (t = "--", this.reference = t), this.#z(this.reference), this.__pinPad__.operation.consultDate = (/* @__PURE__ */ new Date()).toLocaleDateString("en-GB"), await this.#u({
4863
+ async consult({ reference: t = null } = { reference: null }) {
4864
+ return t || (t = this.reference), z(t) && (t = "--", this.reference = t), this.#X(this.reference), this.__pinPad__.operation.consultDate = (/* @__PURE__ */ new Date()).toLocaleDateString("en-GB"), await this.#u({
4720
4865
  Ambiente: this.environment,
4721
4866
  User: this.username,
4722
4867
  Pwd: this.password,
@@ -4725,38 +4870,38 @@ class vr extends Ze {
4725
4870
  Country: this.__pinPad__.config.country,
4726
4871
  Tx_Date: this.__pinPad__.operation.consultDate
4727
4872
  }), this.#r(this.url + this.__pinPad__.constants.uris.consult, {
4728
- user: this.username.toUpperCase(),
4729
- pwd: this.password.toUpperCase(),
4730
- id_branch: this.__pinPad__.config.idBranch.toUpperCase(),
4731
- id_company: this.__pinPad__.config.idCompany.toUpperCase(),
4873
+ user: this.username?.toUpperCase(),
4874
+ pwd: this.password?.toUpperCase(),
4875
+ id_branch: this.__pinPad__.config.idBranch?.toUpperCase(),
4876
+ id_company: this.__pinPad__.config.idCompany?.toUpperCase(),
4732
4877
  date: this.__pinPad__.operation.consultDate,
4733
4878
  reference: this.reference
4734
4879
  });
4735
4880
  }
4736
- async #rt(t) {
4881
+ async #it(t) {
4737
4882
  let e = this.url + this.__pinPad__.constants.uris.consult;
4738
4883
  return t > 1 && this.environment === "production" && (e = e.replace(
4739
4884
  this.__pinPad__.constants.urls.production,
4740
4885
  this.__pinPad__.constants.urls.productionAlternative
4741
4886
  )), this.__pinPad__.operation.consultDate = (/* @__PURE__ */ new Date()).toLocaleDateString("en-GB"), await this.#r(e, {
4742
- user: this.username.toUpperCase(),
4743
- pwd: this.password.toUpperCase(),
4744
- id_branch: this.__pinPad__.config.idBranch.toUpperCase(),
4745
- id_company: this.__pinPad__.config.idCompany.toUpperCase(),
4887
+ user: this.username?.toUpperCase(),
4888
+ pwd: this.password?.toUpperCase(),
4889
+ id_branch: this.__pinPad__.config.idBranch?.toUpperCase(),
4890
+ id_company: this.__pinPad__.config.idCompany?.toUpperCase(),
4746
4891
  date: this.__pinPad__.operation.consultDate,
4747
4892
  reference: this.reference
4748
4893
  });
4749
4894
  }
4750
- async #st(t = "", e = {}) {
4895
+ async #nt(t = "", e = {}) {
4751
4896
  let i = 1, r = null;
4752
4897
  do {
4753
4898
  i > 1 && this.environment === "production" && (t = t.replace(
4754
4899
  this.__pinPad__.constants.urls.production,
4755
4900
  this.__pinPad__.constants.urls.productionAlternative
4756
- ), await this.#nt(5)), await this.#c();
4757
- const s = this.#a(32), a = this.#s(this.__pinPad__.config.publicKeyRSA, s), o = await this.#o(s, JSON.stringify(e));
4901
+ ), await this.#et(5)), await this.#c();
4902
+ const s = this.#a(32), a = this.#s(this.__pinPad__.config.publicKeyRSA || "", s), o = await this.#o(s, JSON.stringify(e));
4758
4903
  let c = !1;
4759
- const h = await T.post(t, o, {
4904
+ const h = await S.post(t, o, {
4760
4905
  headers: {
4761
4906
  "Content-Type": "application/json",
4762
4907
  data: a || ""
@@ -4764,16 +4909,21 @@ class vr extends Ze {
4764
4909
  }).catch(async (u) => {
4765
4910
  let f = `Error in request, verify internet connection: ${u.status} ${u.message}`;
4766
4911
  u.response.status >= 500 && u.response.status <= 599 ? f = "Service Temporarily Unavailable" : u.response.status >= 400 && u.response.status <= 499 && (f = "Bad Request"), console.warn(u), r = f;
4767
- const _ = await this.#rt(i);
4912
+ const _ = await this.#it(i);
4768
4913
  _ && _ !== "{}" && !_.includes('"transacciones":""') && _.includes("nu_operaion") && (i = 5, r = "EE32"), c = !0;
4769
4914
  });
4770
- if (!c)
4915
+ if (!c) {
4916
+ if (!h || typeof h != "object" || !h.data) {
4917
+ r = "It was not possible to obtain the affiliations.";
4918
+ continue;
4919
+ }
4771
4920
  return h.data;
4921
+ }
4772
4922
  } while (i++ <= 3);
4773
4923
  return r ? Promise.reject(r) : Promise.reject("Communication error with CDP. IL/MTY");
4774
4924
  }
4775
- #at(t) {
4776
- if (K(t)) throw new Error("Number of authorization invalid");
4925
+ #rt(t) {
4926
+ if (z(t)) throw new Error("Number of authorization invalid");
4777
4927
  if (/^[A-Za-z0-9]+$/g.test(t) !== !0) throw new Error("Number of authorization invalid");
4778
4928
  if (t.length !== 6) throw new Error("Number of authorization invalid");
4779
4929
  return !0;
@@ -4783,36 +4933,37 @@ class vr extends Ze {
4783
4933
  * @return {Promise<any>}
4784
4934
  */
4785
4935
  async rePrint({ folio: t = null } = {}) {
4786
- t === null && (t = this.__pinPad__.operation.folio || ""), this.#y(t), await this.#u({
4936
+ let e = "";
4937
+ t === null && (e = this.__pinPad__.operation.folio || ""), this.#y(e), await this.#u({
4787
4938
  Ambiente: this.environment,
4788
4939
  User: this.username,
4789
4940
  Pwd: this.password,
4790
4941
  IdBranch: this.__pinPad__.config.idBranch,
4791
4942
  IdCompany: this.__pinPad__.config.idCompany,
4792
4943
  Country: this.__pinPad__.config.country,
4793
- Tx_OperationNumber: t
4944
+ Tx_OperationNumber: e
4794
4945
  });
4795
- const e = await this.#r(this.url + this.__pinPad__.constants.uris.rePrint, {
4946
+ const i = await this.#r(this.url + this.__pinPad__.constants.uris.rePrint, {
4796
4947
  REPRINTVOUCHER: {
4797
4948
  business: {
4798
- country: this.__pinPad__.config.country.toUpperCase(),
4799
- id_branch: this.__pinPad__.config.idBranch.toUpperCase(),
4800
- id_company: this.__pinPad__.config.idCompany.toUpperCase(),
4801
- pwd: this.password.toUpperCase(),
4802
- user: this.username.toUpperCase()
4949
+ country: this.__pinPad__.config.country?.toUpperCase(),
4950
+ id_branch: this.__pinPad__.config.idBranch?.toUpperCase(),
4951
+ id_company: this.__pinPad__.config.idCompany?.toUpperCase(),
4952
+ pwd: this.password?.toUpperCase(),
4953
+ user: this.username?.toUpperCase()
4803
4954
  },
4804
4955
  no_operacion: t,
4805
4956
  crypto: "2"
4806
4957
  }
4807
4958
  });
4808
- let i = e.voucher_comercio;
4809
- return this.__pinPad__.operation.commerceVoucher = "", i && (e.voucher_comercio.includes(":") ? this.__pinPad__.operation.commerceVoucher = e.voucher_comercio : this.__pinPad__.operation.commerceVoucher = this.#n(
4959
+ let r = i.voucher_comercio;
4960
+ return this.__pinPad__.operation.commerceVoucher = "", r && (i.voucher_comercio.includes(":") ? this.__pinPad__.operation.commerceVoucher = i.voucher_comercio : this.__pinPad__.operation.commerceVoucher = this.#n(
4810
4961
  this.__pinPad__.config.RC4Key,
4811
- e.voucher_comercio
4812
- )), i = e.voucher_cliente, this.__pinPad__.operation.clientVoucher = "", i && (e.voucher_cliente.includes(":") ? this.__pinPad__.operation.clientVoucher = e.voucher_cliente : this.__pinPad__.operation.clientVoucher = this.#n(
4962
+ i.voucher_comercio
4963
+ )), r = i.voucher_cliente, this.__pinPad__.operation.clientVoucher = "", r && (i.voucher_cliente.includes(":") ? this.__pinPad__.operation.clientVoucher = i.voucher_cliente : this.__pinPad__.operation.clientVoucher = this.#n(
4813
4964
  this.__pinPad__.config.RC4Key,
4814
- e.voucher_cliente
4815
- )), e;
4965
+ i.voucher_cliente
4966
+ )), i;
4816
4967
  }
4817
4968
  // jsonTokenization() {
4818
4969
  // // build json "11"
@@ -4844,18 +4995,17 @@ class vr extends Ze {
4844
4995
  // },
4845
4996
  // };
4846
4997
  // }
4847
- #ot(t) {
4848
- const e = this;
4998
+ #st(t) {
4849
4999
  this.__pinPad__.operation.responseMit._approved = t.response === "approved", this.__pinPad__.operation.responseMit._status = t.response, this.__pinPad__.operation.responseMit._originalToken = t.number_tkn ?? "", this.__pinPad__.operation.folio = t.foliocpagos, this.__pinPad__.operation.authorization = t.auth;
4850
- let i = t.cd_response?.toUpperCase();
4851
- return i.toUpperCase() === "0C" || this.__pinPad__.operation.responseMit._approved ? i = "00" : (i !== "Z3" && i !== "05" || t.cd_error === "92") && (i = "01"), this.__pinPad__.operation.responseMit._cdResponse = i, this.__pinPad__.finishCommand.A = i, this.__pinPad__.finishCommand.B = "", this.__pinPad__.finishCommand.C = "", this.__pinPad__.finishCommand.D = "", this.__pinPad__.finishCommand.E = t.emv_key_date ? t.emv_key_date : "", this.__pinPad__.finishCommand.F = t.icc_csn ? t.icc_csn : "", this.__pinPad__.finishCommand.G = t.icc_atc ? t.icc_atc : "", this.__pinPad__.finishCommand.H = t.icc_arpc ? t.icc_arpc : "", this.__pinPad__.finishCommand.I = t.icc_issuer_script ? t.icc_issuer_script : "", this.__pinPad__.finishCommand.J = t.authorized_amount ? t.authorized_amount : "", this.__pinPad__.finishCommand.K = t.account_balance_1 ? t.account_balance_1 : "", {
5000
+ let e = t.cd_response?.toUpperCase();
5001
+ return e.toUpperCase() === "0C" || this.__pinPad__.operation.responseMit._approved ? e = "00" : (e !== "Z3" && e !== "05" || t.cd_error === "92") && (e = "01"), this.__pinPad__.operation.responseMit._cdResponse = e, this.__pinPad__.finishCommand.A = e, this.__pinPad__.finishCommand.B = "", this.__pinPad__.finishCommand.C = "", this.__pinPad__.finishCommand.D = "", this.__pinPad__.finishCommand.E = t.emv_key_date ? t.emv_key_date : "", this.__pinPad__.finishCommand.F = t.icc_csn ? t.icc_csn : "", this.__pinPad__.finishCommand.G = t.icc_atc ? t.icc_atc : "", this.__pinPad__.finishCommand.H = t.icc_arpc ? t.icc_arpc : "", this.__pinPad__.finishCommand.I = t.icc_issuer_script ? t.icc_issuer_script : "", this.__pinPad__.finishCommand.J = t.authorized_amount ? t.authorized_amount : "", this.__pinPad__.finishCommand.K = t.account_balance_1 ? t.account_balance_1 : "", {
4852
5002
  reference: t.reference,
4853
5003
  response: t.response,
4854
5004
  foliocpagos: t.foliocpagos,
4855
5005
  auth: t.auth,
4856
- cd_response: i,
5006
+ cd_response: e,
4857
5007
  cd_error: t.cd_error,
4858
- nb_error: e.#b(t.nb_error ?? ""),
5008
+ nb_error: this.#b(t.nb_error ?? ""),
4859
5009
  time: t.time,
4860
5010
  date: t.date,
4861
5011
  nb_company: t.nb_company,
@@ -4878,10 +5028,9 @@ class vr extends Ze {
4878
5028
  }
4879
5029
  async cancelPurchase({ amount: t = 0, authorization: e = "", folio: i = "" } = {}) {
4880
5030
  if (!this.#m(t)) throw new Error("Invalid amount");
4881
- if (!this.#at(e)) throw new Error("Invalid authorization");
5031
+ if (!this.#rt(e)) throw new Error("Invalid authorization");
4882
5032
  if (!this.#y(i)) throw new Error("Invalid folio");
4883
- t = this.#E(t, 2);
4884
- const r = {
5033
+ const r = this.#w(t, 2), s = {
4885
5034
  Ambiente: this.environment,
4886
5035
  User: this.username,
4887
5036
  Pwd: this.password,
@@ -4891,50 +5040,49 @@ class vr extends Ze {
4891
5040
  UserTRX: "userPinpadWeb",
4892
5041
  Tx_OperationNumber: i,
4893
5042
  Tx_Auth: e,
4894
- Amount: t
5043
+ Amount: r
4895
5044
  };
4896
- await this.#u(r);
4897
- const s = this.#r(this.url + this.__pinPad__.constants.uris.cancellation, {
5045
+ await this.#u(s);
5046
+ const a = await this.#r(this.url + this.__pinPad__.constants.uris.cancellation, {
4898
5047
  VMCAMEXMCANCELACION: {
4899
5048
  business: {
4900
- country: this.__pinPad__.config.country.toUpperCase(),
4901
- id_branch: this.__pinPad__.config.idBranch.toUpperCase(),
4902
- id_company: this.__pinPad__.config.idCompany.toUpperCase(),
4903
- pwd: this.password.toUpperCase(),
4904
- user: this.username.toUpperCase()
5049
+ country: this.__pinPad__.config.country?.toUpperCase(),
5050
+ id_branch: this.__pinPad__.config.idBranch?.toUpperCase(),
5051
+ id_company: this.__pinPad__.config.idCompany?.toUpperCase(),
5052
+ pwd: this.password?.toUpperCase(),
5053
+ user: this.username?.toUpperCase()
4905
5054
  },
4906
5055
  transacction: {
4907
5056
  amount: t,
4908
5057
  auth: e.toUpperCase(),
4909
5058
  crypto: "2",
4910
5059
  no_operacion: i,
4911
- usrtransacction: this.username.toUpperCase(),
5060
+ usrtransacction: this.username?.toUpperCase(),
4912
5061
  version: this.__pinPad__.constants.appName + this.__pinPad__.constants.appVersion
4913
5062
  }
4914
5063
  }
4915
5064
  });
4916
- return this.__pinPad__.operation.commerceVoucher = "", s.voucher_comercio && (s.voucher_comercio.includes(":") ? this.__pinPad__.operation.commerceVoucher = s.voucher_comercio : this.__pinPad__.operation.commerceVoucher = this.#n(
5065
+ return this.__pinPad__.operation.commerceVoucher = "", a.voucher_comercio && (a.voucher_comercio.includes(":") ? this.__pinPad__.operation.commerceVoucher = a.voucher_comercio : this.__pinPad__.operation.commerceVoucher = this.#n(
4917
5066
  this.__pinPad__.config.RC4Key,
4918
- s.voucher_comercio
4919
- )), this.__pinPad__.operation.clientVoucher = "", s.voucher_cliente && (s.voucher_cliente.includes(":") ? this.__pinPad__.operation.clientVoucher = s.voucher_cliente : this.__pinPad__.operation.clientVoucher = this.#n(
5067
+ a.voucher_comercio
5068
+ )), this.__pinPad__.operation.clientVoucher = "", a.voucher_cliente && (a.voucher_cliente.includes(":") ? this.__pinPad__.operation.clientVoucher = a.voucher_cliente : this.__pinPad__.operation.clientVoucher = this.#n(
4920
5069
  this.__pinPad__.config.RC4Key,
4921
- s.voucher_cliente
4922
- )), JSON.stringify(s);
5070
+ a.voucher_cliente
5071
+ )), JSON.stringify(a);
4923
5072
  }
4924
- async #ct() {
4925
- const t = this;
5073
+ async #at() {
4926
5074
  this.__pinPad__.operation.errors = 0, this.__pinPad__.operation.ignore.counterSale = !1;
4927
- const e = this.__pinPad__.operation.onlyMerchant;
4928
- if (/^[0-9]+$/.test(e) === !1) throw new Error("Invalid merchant");
5075
+ const t = this.__pinPad__.operation.onlyMerchant;
5076
+ if (/^[0-9]+$/.test(t) === !1) throw new Error("Invalid merchant");
4929
5077
  this.__pinPad__.operation.typeOperation = "29";
4930
- let i = {
5078
+ const e = {
4931
5079
  error: !1,
4932
5080
  message: null,
4933
5081
  approved: !1,
4934
5082
  object: {}
4935
5083
  };
4936
5084
  try {
4937
- const r = await this.#E(this.amount, 2);
5085
+ const i = await this.#w(this.amount, 2);
4938
5086
  await this.#u({
4939
5087
  Ambiente: this.environment,
4940
5088
  Country: this.__pinPad__.config.country,
@@ -4951,26 +5099,28 @@ class vr extends Ze {
4951
5099
  VersionTerminal: this.__pinPad__.about.appVersion,
4952
5100
  TpOperation: this.__pinPad__.operation.typeOperation,
4953
5101
  Reference: this.reference,
4954
- Amount: r,
5102
+ Amount: i,
4955
5103
  Currency: this.__pinPad__.config.currency,
4956
- Merchant: e,
5104
+ Merchant: t,
4957
5105
  Reverse: this.__pinPad__.config.otherLogin.executeReverse
4958
5106
  });
4959
- const s = this.__pinPad__.about.supportContactless && this.__pinPad__.about.supportContactless !== "0" ? "1" : "0", a = await this.#st(this.url + this.__pinPad__.constants.uris.sale, {
5107
+ let r = this.__pinPad__.about.supportContactless;
5108
+ typeof r == "string" && (r = r !== "0");
5109
+ const s = this.__pinPad__.about.supportContactless && r, a = await this.#nt(this.url + this.__pinPad__.constants.uris.sale, {
4960
5110
  VMCAMEXB: {
4961
5111
  business: {
4962
- country: this.__pinPad__.config.country.toUpperCase(),
4963
- id_branch: this.__pinPad__.config.idBranch.toUpperCase(),
4964
- id_company: this.__pinPad__.config.idCompany.toUpperCase(),
4965
- pwd: this.password.toUpperCase(),
4966
- user: this.username.toUpperCase()
5112
+ country: this.__pinPad__.config.country?.toUpperCase(),
5113
+ id_branch: this.__pinPad__.config.idBranch?.toUpperCase(),
5114
+ id_company: this.__pinPad__.config.idCompany?.toUpperCase(),
5115
+ pwd: this.password?.toUpperCase(),
5116
+ user: this.username?.toUpperCase()
4967
5117
  },
4968
5118
  dcc: {
4969
5119
  dcc_amount: "0",
4970
5120
  dcc_status: "0"
4971
5121
  },
4972
5122
  transacction: {
4973
- amount: r,
5123
+ amount: i,
4974
5124
  creditcard: {
4975
5125
  appid: this.__pinPad__.config.read.AppId,
4976
5126
  appidlabel: this.__pinPad__.config.read.AppIdLabel,
@@ -5004,7 +5154,7 @@ class vr extends Ze {
5004
5154
  },
5005
5155
  tp_operation: this.__pinPad__.operation.typeOperation,
5006
5156
  tp_resp: this.__pinPad__.operation.typeResponse,
5007
- usrtransacction: this.username.toUpperCase(),
5157
+ usrtransacction: this.username?.toUpperCase(),
5008
5158
  version: this.__pinPad__.constants.appName + this.__pinPad__.constants.appVersion,
5009
5159
  version_terminal: this.__pinPad__.about.appVersion
5010
5160
  },
@@ -5015,14 +5165,14 @@ class vr extends Ze {
5015
5165
  }
5016
5166
  }
5017
5167
  });
5018
- a.response === "error" && (i.error = !0, i.message = a.nb_error || "Error in response");
5019
- const o = this.#ot(a);
5020
- return i.object = o, await this.#ut(o), i.approved = this.__pinPad__.operation.responseMit._approved, this.__pinPad__.operation.finalResult = o, i;
5021
- } catch (r) {
5022
- throw t.__pinPad__.finishCommand.A = "01", t.__pinPad__.finishCommand.B = "", t.__pinPad__.finishCommand.C = "", t.__pinPad__.finishCommand.D = "", t.__pinPad__.finishCommand.E = "", t.__pinPad__.finishCommand.F = "", t.__pinPad__.finishCommand.G = "", t.__pinPad__.finishCommand.H = "", t.__pinPad__.finishCommand.I = "", t.__pinPad__.finishCommand.J = "", t.__pinPad__.finishCommand.K = "", await t.#lt(t.#T(r)), r;
5168
+ a.response === "error" && (e.error = !0, e.message = a.nb_error || "Error in response");
5169
+ const o = this.#st(a);
5170
+ return e.object = o, await this.#ot(o), e.approved = this.__pinPad__.operation.responseMit._approved, this.__pinPad__.operation.finalResult = o, e;
5171
+ } catch (i) {
5172
+ throw this.__pinPad__.finishCommand.A = "01", this.__pinPad__.finishCommand.B = "", this.__pinPad__.finishCommand.C = "", this.__pinPad__.finishCommand.D = "", this.__pinPad__.finishCommand.E = "", this.__pinPad__.finishCommand.F = "", this.__pinPad__.finishCommand.G = "", this.__pinPad__.finishCommand.H = "", this.__pinPad__.finishCommand.I = "", this.__pinPad__.finishCommand.J = "", this.__pinPad__.finishCommand.K = "", await this.#ut(this.#T(i)), i;
5023
5173
  }
5024
5174
  }
5025
- async #ut(t) {
5175
+ async #ot(t) {
5026
5176
  if (this.__pinPad__.config.read.POSEM === "022" || this.__pinPad__.config.read.POSEM === "800" || this.__pinPad__.config.read.ReadCTLS === "1")
5027
5177
  return this.dispatch("pp:finish-emv", t), !0;
5028
5178
  const e = this.__pinPad__.constants.FS, i = this.__pinPad__.constants.STX, r = this.__pinPad__.constants.ETX;
@@ -5031,49 +5181,48 @@ class vr extends Ze {
5031
5181
  const a = this.parseStringToBytes(s, "");
5032
5182
  this.__pinPad__.waiting.statusSecondGenerateWaiting = "pending", await this.appendToQueue(a, "second-generate");
5033
5183
  let o = 0;
5034
- const c = this;
5035
- return new Promise((h, u) => {
5184
+ return new Promise((c, h) => {
5036
5185
  o = setInterval(async () => {
5037
- if (c.__pinPad__.waiting.statusSecondGenerateWaiting === "resolved") {
5038
- if (clearInterval(o), c.__pinPad__.waiting.statusSecondGenerateWaiting = null, c.__pinPad__.operation.applyReverse) {
5039
- const f = await c.#r(c.url + c.__pinPad__.constants.uris.reverse, {
5186
+ if (this.__pinPad__.waiting.statusSecondGenerateWaiting === "resolved") {
5187
+ if (clearInterval(o), this.__pinPad__.waiting.statusSecondGenerateWaiting = null, this.__pinPad__.operation.applyReverse) {
5188
+ const u = await this.#r(this.url + this.__pinPad__.constants.uris.reverse, {
5040
5189
  VMCAMEXMREVERSO: {
5041
5190
  business: {
5042
- id_company: this.__pinPad__.config.idCompany.toUpperCase(),
5043
- id_branch: this.__pinPad__.config.idBranch.toUpperCase(),
5044
- country: this.__pinPad__.config.country.toUpperCase(),
5045
- user: this.username.toUpperCase(),
5046
- pwd: this.password.toUpperCase()
5191
+ id_company: this.__pinPad__.config.idCompany?.toUpperCase(),
5192
+ id_branch: this.__pinPad__.config.idBranch?.toUpperCase(),
5193
+ country: this.__pinPad__.config.country?.toUpperCase(),
5194
+ user: this.username?.toUpperCase(),
5195
+ pwd: this.password?.toUpperCase()
5047
5196
  },
5048
5197
  transacction: {
5049
5198
  amount: this.#h(this.amount, 2),
5050
5199
  no_operacion: this.__pinPad__.operation.folio,
5051
- auth: this.__pinPad__.operation.authorization.toUpperCase(),
5200
+ auth: this.__pinPad__.operation.authorization?.toUpperCase(),
5052
5201
  tracks: "",
5053
- usrtransacction: this.username.toUpperCase(),
5202
+ usrtransacction: this.username?.toUpperCase(),
5054
5203
  crypto: "2",
5055
5204
  version: this.__pinPad__.constants.appName + this.__pinPad__.constants.appVersion
5056
5205
  }
5057
5206
  }
5058
- }), _ = JSON.parse(f);
5059
- let y;
5060
- _.response === "approved" ? y = { message: "Transaction rejected by PinPad." } : y = { message: "No communication, please check your report." }, c.__pinPad__.operation.ignore.counterSale || (c.dispatch("pp:finish-emv", y), c.__pinPad__.operation.ignore.counterSale = !0);
5207
+ }), f = JSON.parse(u);
5208
+ let _;
5209
+ f.response === "approved" ? _ = { message: "Transaction rejected by PinPad." } : _ = { message: "No communication, please check your report." }, this.__pinPad__.operation.ignore.counterSale || (this.dispatch("pp:finish-emv", _), this.__pinPad__.operation.ignore.counterSale = !0);
5061
5210
  } else
5062
- c.__pinPad__.operation.ignore.counterSale || (c.dispatch("pp:finish-emv", t), c.__pinPad__.operation.ignore.counterSale = !0);
5063
- t.cd_error === "92" && await c.#ht(t, s), h(!0);
5064
- } else c.__pinPad__.waiting.statusSecondGenerateWaiting === "rejected" && (clearInterval(o), c.__pinPad__.waiting.statusSecondGenerateWaiting = null, u("There is no response from the reader, check that it is connected."));
5211
+ this.__pinPad__.operation.ignore.counterSale || (this.dispatch("pp:finish-emv", t), this.__pinPad__.operation.ignore.counterSale = !0);
5212
+ t.cd_error === "92" && await this.#ct(t, s), c(!0);
5213
+ } else this.__pinPad__.waiting.statusSecondGenerateWaiting === "rejected" && (clearInterval(o), this.__pinPad__.waiting.statusSecondGenerateWaiting = null, h("There is no response from the reader, check that it is connected."));
5065
5214
  }, 500);
5066
5215
  });
5067
5216
  }
5068
- async #ht(t, e) {
5069
- this.__pinPad__.operation.ignore.responseGlobal = t, this.__pinPad__.operation.ignore.C93Global = e, this.__pinPad__.operation.ignore.isError92TRX = !0, await this.#l(1, 0);
5217
+ async #ct(t, e) {
5218
+ this.__pinPad__.operation.ignore.responseGlobal = t, this.__pinPad__.operation.ignore.C93Global = e, this.__pinPad__.operation.ignore.isError92TRX = !0, await this.#l(!0, !1);
5070
5219
  }
5071
5220
  async #S() {
5072
5221
  if (this.__pinPad__.operation.ignore.isError92TRX = !1, this.__pinPad__.config.read.POSEM === "022" || this.__pinPad__.config.read.POSEM === "800" || this.__pinPad__.config.read.ReadCTLS === "1")
5073
5222
  this.dispatch("pp:response", this.__pinPad__.operation.ignore.responseGlobal);
5074
5223
  else {
5075
5224
  const t = this.parseStringToBytes(this.__pinPad__.operation.ignore.C93Global, "");
5076
- await this.appendToQueue(t, "code93"), await Zt(1400), this.dispatch("pp:response", this.__pinPad__.operation.ignore.responseGlobal);
5225
+ await this.appendToQueue(t, "code93"), await pe(1400), this.dispatch("pp:response", this.__pinPad__.operation.ignore.responseGlobal);
5077
5226
  }
5078
5227
  }
5079
5228
  #T(t) {
@@ -5115,14 +5264,13 @@ class vr extends Ze {
5115
5264
  EE33: "Error de comunicacion con CDP. IL/MTY",
5116
5265
  EE20: "La Referencia contiene caracteres inválidos",
5117
5266
  EE99: "Error código 99."
5118
- };
5119
- let i = e[t] ? {
5267
+ }, i = e[t] ? {
5120
5268
  error: t,
5121
5269
  message: e[t]
5122
5270
  } : { error: t, message: "Error desconocido" };
5123
5271
  return this.dispatch("pp:error", i), i;
5124
5272
  }
5125
- async #lt(t) {
5273
+ async #ut(t) {
5126
5274
  const e = this.__pinPad__.constants.FS, i = this.__pinPad__.constants.STX, r = this.__pinPad__.constants.ETX;
5127
5275
  let s = "C93A" + this.__pinPad__.finishCommand.A;
5128
5276
  if (s = s + e + "B" + this.__pinPad__.finishCommand.B, s = s + e + "C" + this.__pinPad__.finishCommand.C, s = s + e + "D" + this.__pinPad__.finishCommand.D, s = s + e + "E" + this.__pinPad__.finishCommand.E, s = s + e + "F" + this.__pinPad__.finishCommand.F, s = s + e + "G" + this.__pinPad__.finishCommand.G, s = s + e + "H" + this.__pinPad__.finishCommand.H, s = s + e + "I" + this.__pinPad__.finishCommand.I, s = s + e + "J" + this.__pinPad__.finishCommand.J, s = s + e + "K" + this.__pinPad__.finishCommand.K, s = i + this.#e(s) + s + r, s = s + this.#i(s), this.__pinPad__.config.read.POSEM === "022" || this.__pinPad__.config.read.POSEM === "800" || this.__pinPad__.config.read.ReadCTLS === "1") {
@@ -5132,7 +5280,7 @@ class vr extends Ze {
5132
5280
  const a = this.parseStringToBytes(s, "");
5133
5281
  await this.appendToQueue(a, "finish-emv-end");
5134
5282
  }
5135
- async #ft(t) {
5283
+ async #ht(t) {
5136
5284
  if (t.cd_estatus = t.cd_estatus ? t.cd_estatus : "0", t.cd_estatus !== "1") {
5137
5285
  this.__pinPad__.operation.ignore.isError92TRX && await this.#S();
5138
5286
  return;
@@ -5143,15 +5291,13 @@ class vr extends Ze {
5143
5291
  const h = this.parseStringToBytes(c, "");
5144
5292
  await this.appendToQueue(h, "dukpt");
5145
5293
  let u = 0;
5146
- this.__pinPad__.waiting.statuswritingDUKPTWaiting = "pending";
5147
- const f = this;
5148
- return new Promise((_, y) => {
5294
+ return this.__pinPad__.waiting.statuswritingDUKPTWaiting = "pending", new Promise((f, _) => {
5149
5295
  u = setInterval(async () => {
5150
- f.__pinPad__.waiting.statuswritingDUKPTWaiting === "resolved" ? (clearInterval(u), f.__pinPad__.waiting.statuswritingDUKPTWaiting = null, this.__pinPad__.operation.ignore.isError92TRX && await f.#S(), _(!0)) : f.__pinPad__.waiting.statuswritingDUKPTWaiting === "rejected" && (clearInterval(u), f.__pinPad__.waiting.statuswritingDUKPTWaiting = null, y("Error writing DUKPT keys"));
5296
+ this.__pinPad__.waiting.statuswritingDUKPTWaiting === "resolved" ? (clearInterval(u), this.__pinPad__.waiting.statuswritingDUKPTWaiting = null, this.__pinPad__.operation.ignore.isError92TRX && await this.#S(), f(!0)) : this.__pinPad__.waiting.statuswritingDUKPTWaiting === "rejected" && (clearInterval(u), this.__pinPad__.waiting.statuswritingDUKPTWaiting = null, _("Error writing DUKPT keys"));
5151
5297
  }, 500);
5152
5298
  });
5153
5299
  }
5154
- #pt() {
5300
+ #lt() {
5155
5301
  this.__pinPad__.config.read.AppId = "", this.__pinPad__.config.read.AppIdLabel = "", this.__pinPad__.config.read.Arqc = "", this.__pinPad__.config.read.ChipName = "", this.__pinPad__.config.read.ReadCTLS = "", this.__pinPad__.config.read.NB_Data = "", this.__pinPad__.config.read.NB_ksn = "", this.__pinPad__.config.read.PIN = "", this.__pinPad__.config.read.POSEM = "", this.__pinPad__.config.read.Tags = "", this.__pinPad__.config.read.Type = "", this.__pinPad__.config.read.Chip = "", this.__pinPad__.config.read.ChipNameEnc = "", this.__pinPad__.operation.ignore.error = "", this.__pinPad__.operation.ignore.C93Global = "", this.__pinPad__.operation.folio = "", this.__pinPad__.operation.authorization = "", this.__pinPad__.config.tokenizeTRX = !1;
5156
5302
  }
5157
5303
  // ========================================================================================
@@ -5165,18 +5311,18 @@ class vr extends Ze {
5165
5311
  async makeSale({ amount: t = 0, reference: e = null } = {}) {
5166
5312
  if (t = parseFloat(t.toString()), isNaN(t) || t <= 0)
5167
5313
  throw new Error("Amount is required and must be greater than 0");
5168
- if (this.amount = t, !e || K(e) || !this.#g(e))
5314
+ if (this.amount = t, !e || z(e) || !this.#g(e))
5169
5315
  throw new Error("Reference is required and must be alphanumeric");
5170
5316
  if (this.reference = e, /^[A-Z-a-z\s]+$/g.test(this.__pinPad__.config.currency) === !1)
5171
5317
  throw new Error("Invalid currency");
5172
- let i = {
5318
+ const i = {
5173
5319
  error: !1,
5174
5320
  message: null,
5175
5321
  approved: !1,
5176
5322
  object: {}
5177
5323
  };
5178
5324
  try {
5179
- return await this.login(), await this.#et(), !await this.#it() || !await this.#Z() ? i : await this.#ct();
5325
+ return await this.login(), await this.#Y(), !await this.#tt() || !await this.#J() ? i : await this.#at();
5180
5326
  } catch (r) {
5181
5327
  console.warn(r), i.error = !0, i.message = r.message, i.approved = !1, i.object = r;
5182
5328
  }
@@ -5184,5 +5330,5 @@ class vr extends Ze {
5184
5330
  }
5185
5331
  }
5186
5332
  export {
5187
- vr as PinPad
5333
+ $r as PinPad
5188
5334
  };