@incodetech/web 0.0.0-dev-20260320-e46eb90 → 0.0.0-dev-20260320-c2feb04
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/flow/flow.es.js +512 -510
- package/dist/id/id.es.js +5 -5
- package/package.json +2 -2
package/dist/flow/flow.es.js
CHANGED
|
@@ -267,17 +267,17 @@ function In() {
|
|
|
267
267
|
const t = z().getSymbolSize;
|
|
268
268
|
e.getRowColCoords = function(r) {
|
|
269
269
|
if (r === 1) return [];
|
|
270
|
-
const n = Math.floor(r / 7) + 2, o = t(r), a = o === 145 ? 26 : Math.ceil((o - 13) / (2 * n - 2)) * 2,
|
|
271
|
-
for (let
|
|
272
|
-
s
|
|
273
|
-
return
|
|
270
|
+
const n = Math.floor(r / 7) + 2, o = t(r), a = o === 145 ? 26 : Math.ceil((o - 13) / (2 * n - 2)) * 2, c = [o - 7];
|
|
271
|
+
for (let s = 1; s < n - 1; s++)
|
|
272
|
+
c[s] = c[s - 1] - a;
|
|
273
|
+
return c.push(6), c.reverse();
|
|
274
274
|
}, e.getPositions = function(r) {
|
|
275
275
|
const n = [], o = e.getRowColCoords(r), a = o.length;
|
|
276
|
-
for (let
|
|
277
|
-
for (let
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
276
|
+
for (let c = 0; c < a; c++)
|
|
277
|
+
for (let s = 0; s < a; s++)
|
|
278
|
+
c === 0 && s === 0 || // top-left
|
|
279
|
+
c === 0 && s === a - 1 || // bottom-left
|
|
280
|
+
c === a - 1 && s === 0 || n.push([o[c], o[s]]);
|
|
281
281
|
return n;
|
|
282
282
|
};
|
|
283
283
|
})(he)), he;
|
|
@@ -324,38 +324,38 @@ function yn() {
|
|
|
324
324
|
return e.isValid(n) ? parseInt(n, 10) : void 0;
|
|
325
325
|
}, e.getPenaltyN1 = function(n) {
|
|
326
326
|
const o = n.size;
|
|
327
|
-
let a = 0,
|
|
328
|
-
for (let
|
|
329
|
-
|
|
327
|
+
let a = 0, c = 0, s = 0, u = null, h = null;
|
|
328
|
+
for (let g = 0; g < o; g++) {
|
|
329
|
+
c = s = 0, u = h = null;
|
|
330
330
|
for (let d = 0; d < o; d++) {
|
|
331
|
-
let
|
|
332
|
-
|
|
331
|
+
let f = n.get(g, d);
|
|
332
|
+
f === u ? c++ : (c >= 5 && (a += t.N1 + (c - 5)), u = f, c = 1), f = n.get(d, g), f === h ? s++ : (s >= 5 && (a += t.N1 + (s - 5)), h = f, s = 1);
|
|
333
333
|
}
|
|
334
|
-
|
|
334
|
+
c >= 5 && (a += t.N1 + (c - 5)), s >= 5 && (a += t.N1 + (s - 5));
|
|
335
335
|
}
|
|
336
336
|
return a;
|
|
337
337
|
}, e.getPenaltyN2 = function(n) {
|
|
338
338
|
const o = n.size;
|
|
339
339
|
let a = 0;
|
|
340
|
-
for (let
|
|
341
|
-
for (let
|
|
342
|
-
const
|
|
343
|
-
(
|
|
340
|
+
for (let c = 0; c < o - 1; c++)
|
|
341
|
+
for (let s = 0; s < o - 1; s++) {
|
|
342
|
+
const u = n.get(c, s) + n.get(c, s + 1) + n.get(c + 1, s) + n.get(c + 1, s + 1);
|
|
343
|
+
(u === 4 || u === 0) && a++;
|
|
344
344
|
}
|
|
345
345
|
return a * t.N2;
|
|
346
346
|
}, e.getPenaltyN3 = function(n) {
|
|
347
347
|
const o = n.size;
|
|
348
|
-
let a = 0,
|
|
349
|
-
for (let
|
|
350
|
-
|
|
351
|
-
for (let
|
|
352
|
-
|
|
348
|
+
let a = 0, c = 0, s = 0;
|
|
349
|
+
for (let u = 0; u < o; u++) {
|
|
350
|
+
c = s = 0;
|
|
351
|
+
for (let h = 0; h < o; h++)
|
|
352
|
+
c = c << 1 & 2047 | n.get(u, h), h >= 10 && (c === 1488 || c === 93) && a++, s = s << 1 & 2047 | n.get(h, u), h >= 10 && (s === 1488 || s === 93) && a++;
|
|
353
353
|
}
|
|
354
354
|
return a * t.N3;
|
|
355
355
|
}, e.getPenaltyN4 = function(n) {
|
|
356
356
|
let o = 0;
|
|
357
357
|
const a = n.data.length;
|
|
358
|
-
for (let
|
|
358
|
+
for (let s = 0; s < a; s++) o += n.data[s];
|
|
359
359
|
return Math.abs(Math.ceil(o * 100 / a / 5) - 10) * t.N4;
|
|
360
360
|
};
|
|
361
361
|
function i(r, n, o) {
|
|
@@ -382,18 +382,18 @@ function yn() {
|
|
|
382
382
|
}
|
|
383
383
|
e.applyMask = function(n, o) {
|
|
384
384
|
const a = o.size;
|
|
385
|
-
for (let
|
|
386
|
-
for (let
|
|
387
|
-
o.isReserved(
|
|
385
|
+
for (let c = 0; c < a; c++)
|
|
386
|
+
for (let s = 0; s < a; s++)
|
|
387
|
+
o.isReserved(s, c) || o.xor(s, c, i(n, s, c));
|
|
388
388
|
}, e.getBestMask = function(n, o) {
|
|
389
389
|
const a = Object.keys(e.Patterns).length;
|
|
390
|
-
let
|
|
391
|
-
for (let
|
|
392
|
-
o(
|
|
393
|
-
const
|
|
394
|
-
e.applyMask(
|
|
390
|
+
let c = 0, s = 1 / 0;
|
|
391
|
+
for (let u = 0; u < a; u++) {
|
|
392
|
+
o(u), e.applyMask(u, n);
|
|
393
|
+
const h = e.getPenaltyN1(n) + e.getPenaltyN2(n) + e.getPenaltyN3(n) + e.getPenaltyN4(n);
|
|
394
|
+
e.applyMask(u, n), h < s && (s = h, c = u);
|
|
395
395
|
}
|
|
396
|
-
return
|
|
396
|
+
return c;
|
|
397
397
|
};
|
|
398
398
|
})(me)), me;
|
|
399
399
|
}
|
|
@@ -781,18 +781,18 @@ function Mn() {
|
|
|
781
781
|
e.mul = function(r, n) {
|
|
782
782
|
const o = new Uint8Array(r.length + n.length - 1);
|
|
783
783
|
for (let a = 0; a < r.length; a++)
|
|
784
|
-
for (let
|
|
785
|
-
o[a +
|
|
784
|
+
for (let c = 0; c < n.length; c++)
|
|
785
|
+
o[a + c] ^= t.mul(r[a], n[c]);
|
|
786
786
|
return o;
|
|
787
787
|
}, e.mod = function(r, n) {
|
|
788
788
|
let o = new Uint8Array(r);
|
|
789
789
|
for (; o.length - n.length >= 0; ) {
|
|
790
790
|
const a = o[0];
|
|
791
|
-
for (let
|
|
792
|
-
o[
|
|
793
|
-
let
|
|
794
|
-
for (;
|
|
795
|
-
o = o.slice(
|
|
791
|
+
for (let s = 0; s < n.length; s++)
|
|
792
|
+
o[s] ^= t.mul(n[s], a);
|
|
793
|
+
let c = 0;
|
|
794
|
+
for (; c < o.length && o[c] === 0; ) c++;
|
|
795
|
+
o = o.slice(c);
|
|
796
796
|
}
|
|
797
797
|
return o;
|
|
798
798
|
}, e.generateECPolynomial = function(r) {
|
|
@@ -820,8 +820,8 @@ function bn() {
|
|
|
820
820
|
n.set(r);
|
|
821
821
|
const o = e.mod(n, this.genPoly), a = this.degree - o.length;
|
|
822
822
|
if (a > 0) {
|
|
823
|
-
const
|
|
824
|
-
return
|
|
823
|
+
const c = new Uint8Array(this.degree);
|
|
824
|
+
return c.set(o, a), c;
|
|
825
825
|
}
|
|
826
826
|
return o;
|
|
827
827
|
}, we = t, we;
|
|
@@ -843,12 +843,12 @@ function At() {
|
|
|
843
843
|
]))+`;
|
|
844
844
|
D.KANJI = new RegExp(i, "g"), D.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g"), D.BYTE = new RegExp(r, "g"), D.NUMERIC = new RegExp(e, "g"), D.ALPHANUMERIC = new RegExp(t, "g");
|
|
845
845
|
const n = new RegExp("^" + i + "$"), o = new RegExp("^" + e + "$"), a = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
|
|
846
|
-
return D.testKanji = function(
|
|
847
|
-
return n.test(
|
|
848
|
-
}, D.testNumeric = function(
|
|
849
|
-
return o.test(
|
|
850
|
-
}, D.testAlphanumeric = function(
|
|
851
|
-
return a.test(
|
|
846
|
+
return D.testKanji = function(s) {
|
|
847
|
+
return n.test(s);
|
|
848
|
+
}, D.testNumeric = function(s) {
|
|
849
|
+
return o.test(s);
|
|
850
|
+
}, D.testAlphanumeric = function(s) {
|
|
851
|
+
return a.test(s);
|
|
852
852
|
}, D;
|
|
853
853
|
}
|
|
854
854
|
var tt;
|
|
@@ -916,66 +916,66 @@ function H() {
|
|
|
916
916
|
var nt;
|
|
917
917
|
function Rn() {
|
|
918
918
|
return nt || (nt = 1, (function(e) {
|
|
919
|
-
const t = z(), i = Rt(), r = Ue(), n = H(), o = St(), a = 7973,
|
|
920
|
-
function
|
|
921
|
-
for (let
|
|
922
|
-
if (
|
|
923
|
-
return
|
|
919
|
+
const t = z(), i = Rt(), r = Ue(), n = H(), o = St(), a = 7973, c = t.getBCHDigit(a);
|
|
920
|
+
function s(d, f, M) {
|
|
921
|
+
for (let I = 1; I <= 40; I++)
|
|
922
|
+
if (f <= e.getCapacity(I, M, d))
|
|
923
|
+
return I;
|
|
924
924
|
}
|
|
925
|
-
function
|
|
926
|
-
return n.getCharCountIndicator(d,
|
|
925
|
+
function u(d, f) {
|
|
926
|
+
return n.getCharCountIndicator(d, f) + 4;
|
|
927
927
|
}
|
|
928
|
-
function
|
|
929
|
-
let
|
|
930
|
-
return d.forEach(function(
|
|
931
|
-
const
|
|
932
|
-
|
|
933
|
-
}),
|
|
928
|
+
function h(d, f) {
|
|
929
|
+
let M = 0;
|
|
930
|
+
return d.forEach(function(I) {
|
|
931
|
+
const P = u(I.mode, f);
|
|
932
|
+
M += P + I.getBitsLength();
|
|
933
|
+
}), M;
|
|
934
934
|
}
|
|
935
|
-
function
|
|
936
|
-
for (let
|
|
937
|
-
if (
|
|
938
|
-
return
|
|
935
|
+
function g(d, f) {
|
|
936
|
+
for (let M = 1; M <= 40; M++)
|
|
937
|
+
if (h(d, M) <= e.getCapacity(M, f, n.MIXED))
|
|
938
|
+
return M;
|
|
939
939
|
}
|
|
940
|
-
e.from = function(
|
|
941
|
-
return o.isValid(
|
|
942
|
-
}, e.getCapacity = function(
|
|
943
|
-
if (!o.isValid(
|
|
940
|
+
e.from = function(f, M) {
|
|
941
|
+
return o.isValid(f) ? parseInt(f, 10) : M;
|
|
942
|
+
}, e.getCapacity = function(f, M, I) {
|
|
943
|
+
if (!o.isValid(f))
|
|
944
944
|
throw new Error("Invalid QR Code version");
|
|
945
|
-
typeof
|
|
946
|
-
const
|
|
947
|
-
if (
|
|
948
|
-
const
|
|
949
|
-
switch (
|
|
945
|
+
typeof I > "u" && (I = n.BYTE);
|
|
946
|
+
const P = t.getSymbolTotalCodewords(f), A = i.getTotalCodewordsCount(f, M), E = (P - A) * 8;
|
|
947
|
+
if (I === n.MIXED) return E;
|
|
948
|
+
const m = E - u(I, f);
|
|
949
|
+
switch (I) {
|
|
950
950
|
case n.NUMERIC:
|
|
951
|
-
return Math.floor(
|
|
951
|
+
return Math.floor(m / 10 * 3);
|
|
952
952
|
case n.ALPHANUMERIC:
|
|
953
|
-
return Math.floor(
|
|
953
|
+
return Math.floor(m / 11 * 2);
|
|
954
954
|
case n.KANJI:
|
|
955
|
-
return Math.floor(
|
|
955
|
+
return Math.floor(m / 13);
|
|
956
956
|
case n.BYTE:
|
|
957
957
|
default:
|
|
958
|
-
return Math.floor(
|
|
958
|
+
return Math.floor(m / 8);
|
|
959
959
|
}
|
|
960
|
-
}, e.getBestVersionForData = function(
|
|
961
|
-
let
|
|
962
|
-
const
|
|
963
|
-
if (Array.isArray(
|
|
964
|
-
if (
|
|
965
|
-
return
|
|
966
|
-
if (
|
|
960
|
+
}, e.getBestVersionForData = function(f, M) {
|
|
961
|
+
let I;
|
|
962
|
+
const P = r.from(M, r.M);
|
|
963
|
+
if (Array.isArray(f)) {
|
|
964
|
+
if (f.length > 1)
|
|
965
|
+
return g(f, P);
|
|
966
|
+
if (f.length === 0)
|
|
967
967
|
return 1;
|
|
968
|
-
|
|
968
|
+
I = f[0];
|
|
969
969
|
} else
|
|
970
|
-
|
|
971
|
-
return
|
|
972
|
-
}, e.getEncodedBits = function(
|
|
973
|
-
if (!o.isValid(
|
|
970
|
+
I = f;
|
|
971
|
+
return s(I.mode, I.getLength(), P);
|
|
972
|
+
}, e.getEncodedBits = function(f) {
|
|
973
|
+
if (!o.isValid(f) || f < 7)
|
|
974
974
|
throw new Error("Invalid QR Code version");
|
|
975
|
-
let
|
|
976
|
-
for (; t.getBCHDigit(
|
|
977
|
-
|
|
978
|
-
return
|
|
975
|
+
let M = f << 12;
|
|
976
|
+
for (; t.getBCHDigit(M) - c >= 0; )
|
|
977
|
+
M ^= a << t.getBCHDigit(M) - c;
|
|
978
|
+
return f << 12 | M;
|
|
979
979
|
};
|
|
980
980
|
})(Ce)), Ce;
|
|
981
981
|
}
|
|
@@ -985,11 +985,11 @@ function Sn() {
|
|
|
985
985
|
rt = 1;
|
|
986
986
|
const e = z(), t = 1335, i = 21522, r = e.getBCHDigit(t);
|
|
987
987
|
return ye.getEncodedBits = function(o, a) {
|
|
988
|
-
const
|
|
989
|
-
let
|
|
990
|
-
for (; e.getBCHDigit(
|
|
991
|
-
|
|
992
|
-
return (
|
|
988
|
+
const c = o.bit << 3 | a;
|
|
989
|
+
let s = c << 10;
|
|
990
|
+
for (; e.getBCHDigit(s) - r >= 0; )
|
|
991
|
+
s ^= t << e.getBCHDigit(s) - r;
|
|
992
|
+
return (c << 10 | s) ^ i;
|
|
993
993
|
}, ye;
|
|
994
994
|
}
|
|
995
995
|
var Te = {}, Me, ot;
|
|
@@ -1010,8 +1010,8 @@ function An() {
|
|
|
1010
1010
|
let n, o, a;
|
|
1011
1011
|
for (n = 0; n + 3 <= this.data.length; n += 3)
|
|
1012
1012
|
o = this.data.substr(n, 3), a = parseInt(o, 10), r.put(a, 10);
|
|
1013
|
-
const
|
|
1014
|
-
|
|
1013
|
+
const c = this.data.length - n;
|
|
1014
|
+
c > 0 && (o = this.data.substr(n), a = parseInt(o, 10), r.put(a, c * 3 + 1));
|
|
1015
1015
|
}, Me = t, Me;
|
|
1016
1016
|
}
|
|
1017
1017
|
var be, it;
|
|
@@ -1140,16 +1140,16 @@ function Pn() {
|
|
|
1140
1140
|
single_source_shortest_paths: function(i, r, n) {
|
|
1141
1141
|
var o = {}, a = {};
|
|
1142
1142
|
a[r] = 0;
|
|
1143
|
-
var
|
|
1144
|
-
|
|
1145
|
-
for (var
|
|
1146
|
-
|
|
1147
|
-
for (
|
|
1148
|
-
d.hasOwnProperty(
|
|
1143
|
+
var c = t.PriorityQueue.make();
|
|
1144
|
+
c.push(r, 0);
|
|
1145
|
+
for (var s, u, h, g, d, f, M, I, P; !c.empty(); ) {
|
|
1146
|
+
s = c.pop(), u = s.value, g = s.cost, d = i[u] || {};
|
|
1147
|
+
for (h in d)
|
|
1148
|
+
d.hasOwnProperty(h) && (f = d[h], M = g + f, I = a[h], P = typeof a[h] > "u", (P || I > M) && (a[h] = M, c.push(h, M), o[h] = u));
|
|
1149
1149
|
}
|
|
1150
1150
|
if (typeof n < "u" && typeof a[n] > "u") {
|
|
1151
|
-
var
|
|
1152
|
-
throw new Error(
|
|
1151
|
+
var A = ["Could not find a path from ", r, " to ", n, "."].join("");
|
|
1152
|
+
throw new Error(A);
|
|
1153
1153
|
}
|
|
1154
1154
|
return o;
|
|
1155
1155
|
},
|
|
@@ -1204,133 +1204,133 @@ function Pn() {
|
|
|
1204
1204
|
var lt;
|
|
1205
1205
|
function Ln() {
|
|
1206
1206
|
return lt || (lt = 1, (function(e) {
|
|
1207
|
-
const t = H(), i = An(), r = vn(), n = Nn(), o = Bn(), a = At(),
|
|
1208
|
-
function
|
|
1209
|
-
return unescape(encodeURIComponent(
|
|
1207
|
+
const t = H(), i = An(), r = vn(), n = Nn(), o = Bn(), a = At(), c = z(), s = Pn();
|
|
1208
|
+
function u(A) {
|
|
1209
|
+
return unescape(encodeURIComponent(A)).length;
|
|
1210
1210
|
}
|
|
1211
|
-
function
|
|
1212
|
-
const
|
|
1213
|
-
let
|
|
1214
|
-
for (; (
|
|
1215
|
-
|
|
1216
|
-
data:
|
|
1217
|
-
index:
|
|
1218
|
-
mode:
|
|
1219
|
-
length:
|
|
1211
|
+
function h(A, E, m) {
|
|
1212
|
+
const p = [];
|
|
1213
|
+
let B;
|
|
1214
|
+
for (; (B = A.exec(m)) !== null; )
|
|
1215
|
+
p.push({
|
|
1216
|
+
data: B[0],
|
|
1217
|
+
index: B.index,
|
|
1218
|
+
mode: E,
|
|
1219
|
+
length: B[0].length
|
|
1220
1220
|
});
|
|
1221
|
-
return
|
|
1221
|
+
return p;
|
|
1222
1222
|
}
|
|
1223
|
-
function
|
|
1224
|
-
const
|
|
1225
|
-
let
|
|
1226
|
-
return
|
|
1227
|
-
return
|
|
1228
|
-
}).map(function(
|
|
1223
|
+
function g(A) {
|
|
1224
|
+
const E = h(a.NUMERIC, t.NUMERIC, A), m = h(a.ALPHANUMERIC, t.ALPHANUMERIC, A);
|
|
1225
|
+
let p, B;
|
|
1226
|
+
return c.isKanjiModeEnabled() ? (p = h(a.BYTE, t.BYTE, A), B = h(a.KANJI, t.KANJI, A)) : (p = h(a.BYTE_KANJI, t.BYTE, A), B = []), E.concat(m, p, B).sort(function(R, b) {
|
|
1227
|
+
return R.index - b.index;
|
|
1228
|
+
}).map(function(R) {
|
|
1229
1229
|
return {
|
|
1230
|
-
data:
|
|
1231
|
-
mode:
|
|
1232
|
-
length:
|
|
1230
|
+
data: R.data,
|
|
1231
|
+
mode: R.mode,
|
|
1232
|
+
length: R.length
|
|
1233
1233
|
};
|
|
1234
1234
|
});
|
|
1235
1235
|
}
|
|
1236
|
-
function d(
|
|
1237
|
-
switch (
|
|
1236
|
+
function d(A, E) {
|
|
1237
|
+
switch (E) {
|
|
1238
1238
|
case t.NUMERIC:
|
|
1239
|
-
return i.getBitsLength(
|
|
1239
|
+
return i.getBitsLength(A);
|
|
1240
1240
|
case t.ALPHANUMERIC:
|
|
1241
|
-
return r.getBitsLength(
|
|
1241
|
+
return r.getBitsLength(A);
|
|
1242
1242
|
case t.KANJI:
|
|
1243
|
-
return o.getBitsLength(
|
|
1243
|
+
return o.getBitsLength(A);
|
|
1244
1244
|
case t.BYTE:
|
|
1245
|
-
return n.getBitsLength(
|
|
1245
|
+
return n.getBitsLength(A);
|
|
1246
1246
|
}
|
|
1247
1247
|
}
|
|
1248
|
-
function
|
|
1249
|
-
return
|
|
1250
|
-
const
|
|
1251
|
-
return
|
|
1248
|
+
function f(A) {
|
|
1249
|
+
return A.reduce(function(E, m) {
|
|
1250
|
+
const p = E.length - 1 >= 0 ? E[E.length - 1] : null;
|
|
1251
|
+
return p && p.mode === m.mode ? (E[E.length - 1].data += m.data, E) : (E.push(m), E);
|
|
1252
1252
|
}, []);
|
|
1253
1253
|
}
|
|
1254
|
-
function
|
|
1255
|
-
const
|
|
1256
|
-
for (let
|
|
1257
|
-
const
|
|
1258
|
-
switch (
|
|
1254
|
+
function M(A) {
|
|
1255
|
+
const E = [];
|
|
1256
|
+
for (let m = 0; m < A.length; m++) {
|
|
1257
|
+
const p = A[m];
|
|
1258
|
+
switch (p.mode) {
|
|
1259
1259
|
case t.NUMERIC:
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
{ data:
|
|
1263
|
-
{ data:
|
|
1260
|
+
E.push([
|
|
1261
|
+
p,
|
|
1262
|
+
{ data: p.data, mode: t.ALPHANUMERIC, length: p.length },
|
|
1263
|
+
{ data: p.data, mode: t.BYTE, length: p.length }
|
|
1264
1264
|
]);
|
|
1265
1265
|
break;
|
|
1266
1266
|
case t.ALPHANUMERIC:
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
{ data:
|
|
1267
|
+
E.push([
|
|
1268
|
+
p,
|
|
1269
|
+
{ data: p.data, mode: t.BYTE, length: p.length }
|
|
1270
1270
|
]);
|
|
1271
1271
|
break;
|
|
1272
1272
|
case t.KANJI:
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
{ data:
|
|
1273
|
+
E.push([
|
|
1274
|
+
p,
|
|
1275
|
+
{ data: p.data, mode: t.BYTE, length: u(p.data) }
|
|
1276
1276
|
]);
|
|
1277
1277
|
break;
|
|
1278
1278
|
case t.BYTE:
|
|
1279
|
-
|
|
1280
|
-
{ data:
|
|
1279
|
+
E.push([
|
|
1280
|
+
{ data: p.data, mode: t.BYTE, length: u(p.data) }
|
|
1281
1281
|
]);
|
|
1282
1282
|
}
|
|
1283
1283
|
}
|
|
1284
|
-
return
|
|
1284
|
+
return E;
|
|
1285
1285
|
}
|
|
1286
|
-
function
|
|
1287
|
-
const
|
|
1288
|
-
let
|
|
1289
|
-
for (let
|
|
1290
|
-
const
|
|
1291
|
-
for (let C = 0; C <
|
|
1292
|
-
const v =
|
|
1293
|
-
b.push(
|
|
1294
|
-
for (let
|
|
1295
|
-
const
|
|
1296
|
-
|
|
1286
|
+
function I(A, E) {
|
|
1287
|
+
const m = {}, p = { start: {} };
|
|
1288
|
+
let B = ["start"];
|
|
1289
|
+
for (let w = 0; w < A.length; w++) {
|
|
1290
|
+
const R = A[w], b = [];
|
|
1291
|
+
for (let C = 0; C < R.length; C++) {
|
|
1292
|
+
const v = R[C], y = "" + w + C;
|
|
1293
|
+
b.push(y), m[y] = { node: v, lastCount: 0 }, p[y] = {};
|
|
1294
|
+
for (let S = 0; S < B.length; S++) {
|
|
1295
|
+
const T = B[S];
|
|
1296
|
+
m[T] && m[T].node.mode === v.mode ? (p[T][y] = d(m[T].lastCount + v.length, v.mode) - d(m[T].lastCount, v.mode), m[T].lastCount += v.length) : (m[T] && (m[T].lastCount = v.length), p[T][y] = d(v.length, v.mode) + 4 + t.getCharCountIndicator(v.mode, E));
|
|
1297
1297
|
}
|
|
1298
1298
|
}
|
|
1299
|
-
|
|
1299
|
+
B = b;
|
|
1300
1300
|
}
|
|
1301
|
-
for (let
|
|
1302
|
-
|
|
1303
|
-
return { map:
|
|
1301
|
+
for (let w = 0; w < B.length; w++)
|
|
1302
|
+
p[B[w]].end = 0;
|
|
1303
|
+
return { map: p, table: m };
|
|
1304
1304
|
}
|
|
1305
|
-
function
|
|
1306
|
-
let
|
|
1307
|
-
const
|
|
1308
|
-
if (
|
|
1309
|
-
throw new Error('"' +
|
|
1310
|
-
Suggested mode is: ` + t.toString(
|
|
1311
|
-
switch (
|
|
1305
|
+
function P(A, E) {
|
|
1306
|
+
let m;
|
|
1307
|
+
const p = t.getBestModeForData(A);
|
|
1308
|
+
if (m = t.from(E, p), m !== t.BYTE && m.bit < p.bit)
|
|
1309
|
+
throw new Error('"' + A + '" cannot be encoded with mode ' + t.toString(m) + `.
|
|
1310
|
+
Suggested mode is: ` + t.toString(p));
|
|
1311
|
+
switch (m === t.KANJI && !c.isKanjiModeEnabled() && (m = t.BYTE), m) {
|
|
1312
1312
|
case t.NUMERIC:
|
|
1313
|
-
return new i(
|
|
1313
|
+
return new i(A);
|
|
1314
1314
|
case t.ALPHANUMERIC:
|
|
1315
|
-
return new r(
|
|
1315
|
+
return new r(A);
|
|
1316
1316
|
case t.KANJI:
|
|
1317
|
-
return new o(
|
|
1317
|
+
return new o(A);
|
|
1318
1318
|
case t.BYTE:
|
|
1319
|
-
return new n(
|
|
1319
|
+
return new n(A);
|
|
1320
1320
|
}
|
|
1321
1321
|
}
|
|
1322
|
-
e.fromArray = function(
|
|
1323
|
-
return
|
|
1324
|
-
return typeof
|
|
1322
|
+
e.fromArray = function(E) {
|
|
1323
|
+
return E.reduce(function(m, p) {
|
|
1324
|
+
return typeof p == "string" ? m.push(P(p, null)) : p.data && m.push(P(p.data, p.mode)), m;
|
|
1325
1325
|
}, []);
|
|
1326
|
-
}, e.fromString = function(
|
|
1327
|
-
const
|
|
1328
|
-
for (let C = 1; C <
|
|
1329
|
-
b.push(
|
|
1330
|
-
return e.fromArray(
|
|
1331
|
-
}, e.rawSplit = function(
|
|
1326
|
+
}, e.fromString = function(E, m) {
|
|
1327
|
+
const p = g(E, c.isKanjiModeEnabled()), B = M(p), w = I(B, m), R = s.find_path(w.map, "start", "end"), b = [];
|
|
1328
|
+
for (let C = 1; C < R.length - 1; C++)
|
|
1329
|
+
b.push(w.table[R[C]].node);
|
|
1330
|
+
return e.fromArray(f(b));
|
|
1331
|
+
}, e.rawSplit = function(E) {
|
|
1332
1332
|
return e.fromArray(
|
|
1333
|
-
|
|
1333
|
+
g(E, c.isKanjiModeEnabled())
|
|
1334
1334
|
);
|
|
1335
1335
|
};
|
|
1336
1336
|
})(Te)), Te;
|
|
@@ -1339,55 +1339,55 @@ var ut;
|
|
|
1339
1339
|
function Dn() {
|
|
1340
1340
|
if (ut) return le;
|
|
1341
1341
|
ut = 1;
|
|
1342
|
-
const e = z(), t = Ue(), i = wn(), r = Cn(), n = In(), o = En(), a = yn(),
|
|
1343
|
-
function
|
|
1344
|
-
const b =
|
|
1342
|
+
const e = z(), t = Ue(), i = wn(), r = Cn(), n = In(), o = En(), a = yn(), c = Rt(), s = bn(), u = Rn(), h = Sn(), g = H(), d = Ln();
|
|
1343
|
+
function f(w, R) {
|
|
1344
|
+
const b = w.size, C = o.getPositions(R);
|
|
1345
1345
|
for (let v = 0; v < C.length; v++) {
|
|
1346
|
-
const
|
|
1347
|
-
for (let
|
|
1348
|
-
if (!(
|
|
1346
|
+
const y = C[v][0], S = C[v][1];
|
|
1347
|
+
for (let T = -1; T <= 7; T++)
|
|
1348
|
+
if (!(y + T <= -1 || b <= y + T))
|
|
1349
1349
|
for (let N = -1; N <= 7; N++)
|
|
1350
|
-
|
|
1350
|
+
S + N <= -1 || b <= S + N || (T >= 0 && T <= 6 && (N === 0 || N === 6) || N >= 0 && N <= 6 && (T === 0 || T === 6) || T >= 2 && T <= 4 && N >= 2 && N <= 4 ? w.set(y + T, S + N, !0, !0) : w.set(y + T, S + N, !1, !0));
|
|
1351
1351
|
}
|
|
1352
1352
|
}
|
|
1353
|
-
function
|
|
1354
|
-
const
|
|
1355
|
-
for (let b = 8; b <
|
|
1353
|
+
function M(w) {
|
|
1354
|
+
const R = w.size;
|
|
1355
|
+
for (let b = 8; b < R - 8; b++) {
|
|
1356
1356
|
const C = b % 2 === 0;
|
|
1357
|
-
|
|
1357
|
+
w.set(b, 6, C, !0), w.set(6, b, C, !0);
|
|
1358
1358
|
}
|
|
1359
1359
|
}
|
|
1360
|
-
function
|
|
1361
|
-
const b = n.getPositions(
|
|
1360
|
+
function I(w, R) {
|
|
1361
|
+
const b = n.getPositions(R);
|
|
1362
1362
|
for (let C = 0; C < b.length; C++) {
|
|
1363
|
-
const v = b[C][0],
|
|
1364
|
-
for (let
|
|
1365
|
-
for (let
|
|
1366
|
-
|
|
1363
|
+
const v = b[C][0], y = b[C][1];
|
|
1364
|
+
for (let S = -2; S <= 2; S++)
|
|
1365
|
+
for (let T = -2; T <= 2; T++)
|
|
1366
|
+
S === -2 || S === 2 || T === -2 || T === 2 || S === 0 && T === 0 ? w.set(v + S, y + T, !0, !0) : w.set(v + S, y + T, !1, !0);
|
|
1367
1367
|
}
|
|
1368
1368
|
}
|
|
1369
|
-
function
|
|
1370
|
-
const b =
|
|
1371
|
-
let v,
|
|
1372
|
-
for (let
|
|
1373
|
-
v = Math.floor(
|
|
1369
|
+
function P(w, R) {
|
|
1370
|
+
const b = w.size, C = u.getEncodedBits(R);
|
|
1371
|
+
let v, y, S;
|
|
1372
|
+
for (let T = 0; T < 18; T++)
|
|
1373
|
+
v = Math.floor(T / 3), y = T % 3 + b - 8 - 3, S = (C >> T & 1) === 1, w.set(v, y, S, !0), w.set(y, v, S, !0);
|
|
1374
1374
|
}
|
|
1375
|
-
function w
|
|
1376
|
-
const C =
|
|
1377
|
-
let
|
|
1378
|
-
for (
|
|
1379
|
-
|
|
1380
|
-
|
|
1375
|
+
function A(w, R, b) {
|
|
1376
|
+
const C = w.size, v = h.getEncodedBits(R, b);
|
|
1377
|
+
let y, S;
|
|
1378
|
+
for (y = 0; y < 15; y++)
|
|
1379
|
+
S = (v >> y & 1) === 1, y < 6 ? w.set(y, 8, S, !0) : y < 8 ? w.set(y + 1, 8, S, !0) : w.set(C - 15 + y, 8, S, !0), y < 8 ? w.set(8, C - y - 1, S, !0) : y < 9 ? w.set(8, 15 - y - 1 + 1, S, !0) : w.set(8, 15 - y - 1, S, !0);
|
|
1380
|
+
w.set(C - 8, 8, 1, !0);
|
|
1381
1381
|
}
|
|
1382
|
-
function
|
|
1383
|
-
const b =
|
|
1384
|
-
let C = -1, v = b - 1,
|
|
1385
|
-
for (let
|
|
1386
|
-
for (
|
|
1382
|
+
function E(w, R) {
|
|
1383
|
+
const b = w.size;
|
|
1384
|
+
let C = -1, v = b - 1, y = 7, S = 0;
|
|
1385
|
+
for (let T = b - 1; T > 0; T -= 2)
|
|
1386
|
+
for (T === 6 && T--; ; ) {
|
|
1387
1387
|
for (let N = 0; N < 2; N++)
|
|
1388
|
-
if (!
|
|
1388
|
+
if (!w.isReserved(v, T - N)) {
|
|
1389
1389
|
let O = !1;
|
|
1390
|
-
|
|
1390
|
+
S < R.length && (O = (R[S] >>> y & 1) === 1), w.set(v, T - N, O), y--, y === -1 && (S++, y = 7);
|
|
1391
1391
|
}
|
|
1392
1392
|
if (v += C, v < 0 || b <= v) {
|
|
1393
1393
|
v -= C, C = -C;
|
|
@@ -1395,81 +1395,81 @@ function Dn() {
|
|
|
1395
1395
|
}
|
|
1396
1396
|
}
|
|
1397
1397
|
}
|
|
1398
|
-
function
|
|
1398
|
+
function m(w, R, b) {
|
|
1399
1399
|
const C = new i();
|
|
1400
1400
|
b.forEach(function(N) {
|
|
1401
|
-
C.put(N.mode.bit, 4), C.put(N.getLength(),
|
|
1401
|
+
C.put(N.mode.bit, 4), C.put(N.getLength(), g.getCharCountIndicator(N.mode, w)), N.write(C);
|
|
1402
1402
|
});
|
|
1403
|
-
const v = e.getSymbolTotalCodewords(
|
|
1404
|
-
for (C.getLengthInBits() + 4 <=
|
|
1403
|
+
const v = e.getSymbolTotalCodewords(w), y = c.getTotalCodewordsCount(w, R), S = (v - y) * 8;
|
|
1404
|
+
for (C.getLengthInBits() + 4 <= S && C.put(0, 4); C.getLengthInBits() % 8 !== 0; )
|
|
1405
1405
|
C.putBit(0);
|
|
1406
|
-
const
|
|
1407
|
-
for (let N = 0; N <
|
|
1406
|
+
const T = (S - C.getLengthInBits()) / 8;
|
|
1407
|
+
for (let N = 0; N < T; N++)
|
|
1408
1408
|
C.put(N % 2 ? 17 : 236, 8);
|
|
1409
|
-
return
|
|
1409
|
+
return p(C, w, R);
|
|
1410
1410
|
}
|
|
1411
|
-
function
|
|
1412
|
-
const C = e.getSymbolTotalCodewords(
|
|
1411
|
+
function p(w, R, b) {
|
|
1412
|
+
const C = e.getSymbolTotalCodewords(R), v = c.getTotalCodewordsCount(R, b), y = C - v, S = c.getBlocksCount(R, b), T = C % S, N = S - T, O = Math.floor(C / S), Q = Math.floor(y / S), Ft = Q + 1, _e = O - Q, Ut = new s(_e);
|
|
1413
1413
|
let re = 0;
|
|
1414
|
-
const $ = new Array(
|
|
1414
|
+
const $ = new Array(S), Oe = new Array(S);
|
|
1415
1415
|
let oe = 0;
|
|
1416
|
-
const kt = new Uint8Array(
|
|
1417
|
-
for (let K = 0; K <
|
|
1416
|
+
const kt = new Uint8Array(w.buffer);
|
|
1417
|
+
for (let K = 0; K < S; K++) {
|
|
1418
1418
|
const se = K < N ? Q : Ft;
|
|
1419
1419
|
$[K] = kt.slice(re, re + se), Oe[K] = Ut.encode($[K]), re += se, oe = Math.max(oe, se);
|
|
1420
1420
|
}
|
|
1421
1421
|
const ie = new Uint8Array(C);
|
|
1422
1422
|
let qe = 0, U, k;
|
|
1423
1423
|
for (U = 0; U < oe; U++)
|
|
1424
|
-
for (k = 0; k <
|
|
1424
|
+
for (k = 0; k < S; k++)
|
|
1425
1425
|
U < $[k].length && (ie[qe++] = $[k][U]);
|
|
1426
1426
|
for (U = 0; U < _e; U++)
|
|
1427
|
-
for (k = 0; k <
|
|
1427
|
+
for (k = 0; k < S; k++)
|
|
1428
1428
|
ie[qe++] = Oe[k][U];
|
|
1429
1429
|
return ie;
|
|
1430
1430
|
}
|
|
1431
|
-
function
|
|
1431
|
+
function B(w, R, b, C) {
|
|
1432
1432
|
let v;
|
|
1433
|
-
if (Array.isArray(
|
|
1434
|
-
v = d.fromArray(
|
|
1435
|
-
else if (typeof
|
|
1436
|
-
let O =
|
|
1433
|
+
if (Array.isArray(w))
|
|
1434
|
+
v = d.fromArray(w);
|
|
1435
|
+
else if (typeof w == "string") {
|
|
1436
|
+
let O = R;
|
|
1437
1437
|
if (!O) {
|
|
1438
|
-
const Q = d.rawSplit(
|
|
1439
|
-
O =
|
|
1438
|
+
const Q = d.rawSplit(w);
|
|
1439
|
+
O = u.getBestVersionForData(Q, b);
|
|
1440
1440
|
}
|
|
1441
|
-
v = d.fromString(
|
|
1441
|
+
v = d.fromString(w, O || 40);
|
|
1442
1442
|
} else
|
|
1443
1443
|
throw new Error("Invalid data");
|
|
1444
|
-
const
|
|
1445
|
-
if (!
|
|
1444
|
+
const y = u.getBestVersionForData(v, b);
|
|
1445
|
+
if (!y)
|
|
1446
1446
|
throw new Error("The amount of data is too big to be stored in a QR Code");
|
|
1447
|
-
if (!
|
|
1448
|
-
|
|
1449
|
-
else if (
|
|
1447
|
+
if (!R)
|
|
1448
|
+
R = y;
|
|
1449
|
+
else if (R < y)
|
|
1450
1450
|
throw new Error(
|
|
1451
1451
|
`
|
|
1452
1452
|
The chosen QR Code version cannot contain this amount of data.
|
|
1453
|
-
Minimum version required to store current data is: ` +
|
|
1453
|
+
Minimum version required to store current data is: ` + y + `.
|
|
1454
1454
|
`
|
|
1455
1455
|
);
|
|
1456
|
-
const
|
|
1457
|
-
return
|
|
1456
|
+
const S = m(R, b, v), T = e.getSymbolSize(R), N = new r(T);
|
|
1457
|
+
return f(N, R), M(N), I(N, R), A(N, b, 0), R >= 7 && P(N, R), E(N, S), isNaN(C) && (C = a.getBestMask(
|
|
1458
1458
|
N,
|
|
1459
|
-
|
|
1460
|
-
)), a.applyMask(C, N),
|
|
1459
|
+
A.bind(null, N, b)
|
|
1460
|
+
)), a.applyMask(C, N), A(N, b, C), {
|
|
1461
1461
|
modules: N,
|
|
1462
|
-
version:
|
|
1462
|
+
version: R,
|
|
1463
1463
|
errorCorrectionLevel: b,
|
|
1464
1464
|
maskPattern: C,
|
|
1465
1465
|
segments: v
|
|
1466
1466
|
};
|
|
1467
1467
|
}
|
|
1468
|
-
return le.create = function(
|
|
1469
|
-
if (typeof
|
|
1468
|
+
return le.create = function(R, b) {
|
|
1469
|
+
if (typeof R > "u" || R === "")
|
|
1470
1470
|
throw new Error("No input text");
|
|
1471
|
-
let C = t.M, v,
|
|
1472
|
-
return typeof b < "u" && (C = t.from(b.errorCorrectionLevel, t.M), v =
|
|
1471
|
+
let C = t.M, v, y;
|
|
1472
|
+
return typeof b < "u" && (C = t.from(b.errorCorrectionLevel, t.M), v = u.from(b.version), y = a.from(b.maskPattern), b.toSJISFunc && e.setToSJISFunction(b.toSJISFunc)), B(R, v, C, y);
|
|
1473
1473
|
}, le;
|
|
1474
1474
|
}
|
|
1475
1475
|
var ve = {}, Ne = {}, dt;
|
|
@@ -1513,15 +1513,15 @@ function vt() {
|
|
|
1513
1513
|
const o = e.getScale(r, n);
|
|
1514
1514
|
return Math.floor((r + n.margin * 2) * o);
|
|
1515
1515
|
}, e.qrToImageData = function(r, n, o) {
|
|
1516
|
-
const a = n.modules.size,
|
|
1517
|
-
for (let d = 0; d <
|
|
1518
|
-
for (let
|
|
1519
|
-
let
|
|
1520
|
-
if (d >=
|
|
1521
|
-
const
|
|
1522
|
-
|
|
1516
|
+
const a = n.modules.size, c = n.modules.data, s = e.getScale(a, o), u = Math.floor((a + o.margin * 2) * s), h = o.margin * s, g = [o.color.light, o.color.dark];
|
|
1517
|
+
for (let d = 0; d < u; d++)
|
|
1518
|
+
for (let f = 0; f < u; f++) {
|
|
1519
|
+
let M = (d * u + f) * 4, I = o.color.light;
|
|
1520
|
+
if (d >= h && f >= h && d < u - h && f < u - h) {
|
|
1521
|
+
const P = Math.floor((d - h) / s), A = Math.floor((f - h) / s);
|
|
1522
|
+
I = g[c[P * a + A] ? 1 : 0];
|
|
1523
1523
|
}
|
|
1524
|
-
r[
|
|
1524
|
+
r[M++] = I.r, r[M++] = I.g, r[M++] = I.b, r[M] = I.a;
|
|
1525
1525
|
}
|
|
1526
1526
|
};
|
|
1527
1527
|
})(Ne)), Ne;
|
|
@@ -1540,16 +1540,16 @@ function Fn() {
|
|
|
1540
1540
|
throw new Error("You need to specify a canvas element");
|
|
1541
1541
|
}
|
|
1542
1542
|
}
|
|
1543
|
-
e.render = function(o, a,
|
|
1544
|
-
let
|
|
1545
|
-
typeof
|
|
1546
|
-
const
|
|
1547
|
-
return t.qrToImageData(d.data, o,
|
|
1548
|
-
}, e.renderToDataURL = function(o, a,
|
|
1549
|
-
let
|
|
1550
|
-
typeof
|
|
1551
|
-
const
|
|
1552
|
-
return
|
|
1543
|
+
e.render = function(o, a, c) {
|
|
1544
|
+
let s = c, u = a;
|
|
1545
|
+
typeof s > "u" && (!a || !a.getContext) && (s = a, a = void 0), a || (u = r()), s = t.getOptions(s);
|
|
1546
|
+
const h = t.getImageWidth(o.modules.size, s), g = u.getContext("2d"), d = g.createImageData(h, h);
|
|
1547
|
+
return t.qrToImageData(d.data, o, s), i(g, u, h), g.putImageData(d, 0, 0), u;
|
|
1548
|
+
}, e.renderToDataURL = function(o, a, c) {
|
|
1549
|
+
let s = c;
|
|
1550
|
+
typeof s > "u" && (!a || !a.getContext) && (s = a, a = void 0), s || (s = {});
|
|
1551
|
+
const u = e.render(o, a, s), h = s.type || "image/png", g = s.rendererOpts || {};
|
|
1552
|
+
return u.toDataURL(h, g.quality);
|
|
1553
1553
|
};
|
|
1554
1554
|
})(ve)), ve;
|
|
1555
1555
|
}
|
|
@@ -1559,25 +1559,25 @@ function Un() {
|
|
|
1559
1559
|
ht = 1;
|
|
1560
1560
|
const e = vt();
|
|
1561
1561
|
function t(n, o) {
|
|
1562
|
-
const a = n.a / 255,
|
|
1563
|
-
return a < 1 ?
|
|
1562
|
+
const a = n.a / 255, c = o + '="' + n.hex + '"';
|
|
1563
|
+
return a < 1 ? c + " " + o + '-opacity="' + a.toFixed(2).slice(1) + '"' : c;
|
|
1564
1564
|
}
|
|
1565
1565
|
function i(n, o, a) {
|
|
1566
|
-
let
|
|
1567
|
-
return typeof a < "u" && (
|
|
1566
|
+
let c = n + o;
|
|
1567
|
+
return typeof a < "u" && (c += " " + a), c;
|
|
1568
1568
|
}
|
|
1569
1569
|
function r(n, o, a) {
|
|
1570
|
-
let
|
|
1571
|
-
for (let
|
|
1572
|
-
const d = Math.floor(
|
|
1573
|
-
!d && !
|
|
1570
|
+
let c = "", s = 0, u = !1, h = 0;
|
|
1571
|
+
for (let g = 0; g < n.length; g++) {
|
|
1572
|
+
const d = Math.floor(g % o), f = Math.floor(g / o);
|
|
1573
|
+
!d && !u && (u = !0), n[g] ? (h++, g > 0 && d > 0 && n[g - 1] || (c += u ? i("M", d + a, 0.5 + f + a) : i("m", s, 0), s = 0, u = !1), d + 1 < o && n[g + 1] || (c += i("h", h), h = 0)) : s++;
|
|
1574
1574
|
}
|
|
1575
|
-
return
|
|
1575
|
+
return c;
|
|
1576
1576
|
}
|
|
1577
|
-
return Be.render = function(o, a,
|
|
1578
|
-
const
|
|
1577
|
+
return Be.render = function(o, a, c) {
|
|
1578
|
+
const s = e.getOptions(a), u = o.modules.size, h = o.modules.data, g = u + s.margin * 2, d = s.color.light.a ? "<path " + t(s.color.light, "fill") + ' d="M0 0h' + g + "v" + g + 'H0z"/>' : "", f = "<path " + t(s.color.dark, "stroke") + ' d="' + r(h, u, s.margin) + '"/>', M = 'viewBox="0 0 ' + g + " " + g + '"', P = '<svg xmlns="http://www.w3.org/2000/svg" ' + (s.width ? 'width="' + s.width + '" height="' + s.width + '" ' : "") + M + ' shape-rendering="crispEdges">' + d + f + `</svg>
|
|
1579
1579
|
`;
|
|
1580
|
-
return typeof
|
|
1580
|
+
return typeof c == "function" && c(null, P), P;
|
|
1581
1581
|
}, Be;
|
|
1582
1582
|
}
|
|
1583
1583
|
var gt;
|
|
@@ -1585,35 +1585,35 @@ function kn() {
|
|
|
1585
1585
|
if (gt) return j;
|
|
1586
1586
|
gt = 1;
|
|
1587
1587
|
const e = pn(), t = Dn(), i = Fn(), r = Un();
|
|
1588
|
-
function n(o, a,
|
|
1589
|
-
const
|
|
1588
|
+
function n(o, a, c, s, u) {
|
|
1589
|
+
const h = [].slice.call(arguments, 1), g = h.length, d = typeof h[g - 1] == "function";
|
|
1590
1590
|
if (!d && !e())
|
|
1591
1591
|
throw new Error("Callback required as last argument");
|
|
1592
1592
|
if (d) {
|
|
1593
|
-
if (
|
|
1593
|
+
if (g < 2)
|
|
1594
1594
|
throw new Error("Too few arguments provided");
|
|
1595
|
-
|
|
1595
|
+
g === 2 ? (u = c, c = a, a = s = void 0) : g === 3 && (a.getContext && typeof u > "u" ? (u = s, s = void 0) : (u = s, s = c, c = a, a = void 0));
|
|
1596
1596
|
} else {
|
|
1597
|
-
if (
|
|
1597
|
+
if (g < 1)
|
|
1598
1598
|
throw new Error("Too few arguments provided");
|
|
1599
|
-
return
|
|
1599
|
+
return g === 1 ? (c = a, a = s = void 0) : g === 2 && !a.getContext && (s = c, c = a, a = void 0), new Promise(function(f, M) {
|
|
1600
1600
|
try {
|
|
1601
|
-
const
|
|
1602
|
-
|
|
1603
|
-
} catch (
|
|
1604
|
-
|
|
1601
|
+
const I = t.create(c, s);
|
|
1602
|
+
f(o(I, a, s));
|
|
1603
|
+
} catch (I) {
|
|
1604
|
+
M(I);
|
|
1605
1605
|
}
|
|
1606
1606
|
});
|
|
1607
1607
|
}
|
|
1608
1608
|
try {
|
|
1609
|
-
const
|
|
1610
|
-
|
|
1611
|
-
} catch (
|
|
1612
|
-
|
|
1609
|
+
const f = t.create(c, s);
|
|
1610
|
+
u(null, o(f, a, s));
|
|
1611
|
+
} catch (f) {
|
|
1612
|
+
u(f);
|
|
1613
1613
|
}
|
|
1614
1614
|
}
|
|
1615
|
-
return j.create = t.create, j.toCanvas = n.bind(null, i.render), j.toDataURL = n.bind(null, i.renderToDataURL), j.toString = n.bind(null, function(o, a,
|
|
1616
|
-
return r.render(o,
|
|
1615
|
+
return j.create = t.create, j.toCanvas = n.bind(null, i.render), j.toDataURL = n.bind(null, i.renderToDataURL), j.toString = n.bind(null, function(o, a, c) {
|
|
1616
|
+
return r.render(o, c);
|
|
1617
1617
|
}), j;
|
|
1618
1618
|
}
|
|
1619
1619
|
var _n = kn();
|
|
@@ -1683,7 +1683,7 @@ const On = ({
|
|
|
1683
1683
|
onPhoneChange: o,
|
|
1684
1684
|
onSendSms: a
|
|
1685
1685
|
}) => {
|
|
1686
|
-
const { t:
|
|
1686
|
+
const { t: c } = F();
|
|
1687
1687
|
return /* @__PURE__ */ l(ne, { children: [
|
|
1688
1688
|
/* @__PURE__ */ l(Gt, { fallback: /* @__PURE__ */ l(J, {}), children: /* @__PURE__ */ l(
|
|
1689
1689
|
zn,
|
|
@@ -1703,7 +1703,7 @@ const On = ({
|
|
|
1703
1703
|
disabled: !n || r,
|
|
1704
1704
|
isLoading: r,
|
|
1705
1705
|
class: "IncodeRedirectSmsSendButton",
|
|
1706
|
-
children:
|
|
1706
|
+
children: c("redirect.sendLinkViaSms")
|
|
1707
1707
|
}
|
|
1708
1708
|
)
|
|
1709
1709
|
] });
|
|
@@ -1718,23 +1718,23 @@ const On = ({
|
|
|
1718
1718
|
manager: r,
|
|
1719
1719
|
onResend: n
|
|
1720
1720
|
}) => {
|
|
1721
|
-
const { t: o } = F(), [a,
|
|
1722
|
-
|
|
1723
|
-
}, []),
|
|
1724
|
-
|
|
1725
|
-
}, [r, a]),
|
|
1726
|
-
|
|
1727
|
-
}, [
|
|
1728
|
-
|
|
1721
|
+
const { t: o } = F(), [a, c] = _(e), [s, u] = _(!1), [h, g] = _(!1), d = Jt(e)?.code ?? "", f = Kn(a, e), M = x((E, m) => {
|
|
1722
|
+
c(E), u(m);
|
|
1723
|
+
}, []), I = x(() => {
|
|
1724
|
+
g(!0), r.sendSms(a), g(!1);
|
|
1725
|
+
}, [r, a]), P = x(() => {
|
|
1726
|
+
I(), n();
|
|
1727
|
+
}, [I, n]), A = x(() => {
|
|
1728
|
+
c(e), u(!1), r.resetSms();
|
|
1729
1729
|
}, [r, e]);
|
|
1730
1730
|
return /* @__PURE__ */ l(ne, { children: [
|
|
1731
1731
|
/* @__PURE__ */ l("p", { class: "IncodeRedirectTabDescription", children: o("v2.redirectToMobile.sms.description") }),
|
|
1732
1732
|
t ? /* @__PURE__ */ l(
|
|
1733
1733
|
Vn,
|
|
1734
1734
|
{
|
|
1735
|
-
formattedPhone:
|
|
1736
|
-
onResend:
|
|
1737
|
-
onChangePhone:
|
|
1735
|
+
formattedPhone: f,
|
|
1736
|
+
onResend: P,
|
|
1737
|
+
onChangePhone: A
|
|
1738
1738
|
}
|
|
1739
1739
|
) : /* @__PURE__ */ l(
|
|
1740
1740
|
Hn,
|
|
@@ -1742,10 +1742,10 @@ const On = ({
|
|
|
1742
1742
|
countryCode: d,
|
|
1743
1743
|
phonePrefix: e,
|
|
1744
1744
|
error: i,
|
|
1745
|
-
isSending:
|
|
1746
|
-
isPhoneValid:
|
|
1747
|
-
onPhoneChange:
|
|
1748
|
-
onSendSms:
|
|
1745
|
+
isSending: h,
|
|
1746
|
+
isPhoneValid: s,
|
|
1747
|
+
onPhoneChange: M,
|
|
1748
|
+
onSendSms: I
|
|
1749
1749
|
}
|
|
1750
1750
|
)
|
|
1751
1751
|
] });
|
|
@@ -1757,17 +1757,17 @@ const On = ({
|
|
|
1757
1757
|
addContinueToDesktop: n,
|
|
1758
1758
|
error: o,
|
|
1759
1759
|
manager: a,
|
|
1760
|
-
logoSrc:
|
|
1760
|
+
logoSrc: c
|
|
1761
1761
|
}) => {
|
|
1762
|
-
const { t:
|
|
1763
|
-
|
|
1762
|
+
const { t: s } = F(), [u, h] = _(!1), g = x(() => {
|
|
1763
|
+
h(!0), setTimeout(() => h(!1), 3e3);
|
|
1764
1764
|
}, []), d = x(() => {
|
|
1765
1765
|
a.continueOnDesktop();
|
|
1766
1766
|
}, [a]);
|
|
1767
1767
|
return /* @__PURE__ */ l("div", { class: "IncodeRedirectContainer", children: [
|
|
1768
|
-
/* @__PURE__ */ l(mn, { visible:
|
|
1768
|
+
/* @__PURE__ */ l(mn, { visible: u }),
|
|
1769
1769
|
/* @__PURE__ */ l("div", { class: "IncodeRedirectCard", children: [
|
|
1770
|
-
/* @__PURE__ */ l(hn, { logoSrc:
|
|
1770
|
+
/* @__PURE__ */ l(hn, { logoSrc: c }),
|
|
1771
1771
|
/* @__PURE__ */ l("div", { class: "IncodeRedirectOptions", children: /* @__PURE__ */ l(
|
|
1772
1772
|
G,
|
|
1773
1773
|
{
|
|
@@ -1777,8 +1777,8 @@ const On = ({
|
|
|
1777
1777
|
activeTriggerClassName: "IncodeRedirectTabActive",
|
|
1778
1778
|
children: [
|
|
1779
1779
|
/* @__PURE__ */ l(G.List, { children: [
|
|
1780
|
-
/* @__PURE__ */ l(G.Trigger, { value: "qr", children:
|
|
1781
|
-
r ? null : /* @__PURE__ */ l(G.Trigger, { value: "sms", children:
|
|
1780
|
+
/* @__PURE__ */ l(G.Trigger, { value: "qr", children: s("v2.redirectToMobile.tabs.0") }),
|
|
1781
|
+
r ? null : /* @__PURE__ */ l(G.Trigger, { value: "sms", children: s("v2.redirectToMobile.tabs.1") })
|
|
1782
1782
|
] }),
|
|
1783
1783
|
/* @__PURE__ */ l(G.Content, { value: "qr", children: /* @__PURE__ */ l(qn, { redirectUrl: e }) }),
|
|
1784
1784
|
r ? null : /* @__PURE__ */ l(G.Content, { value: "sms", children: /* @__PURE__ */ l(
|
|
@@ -1788,7 +1788,7 @@ const On = ({
|
|
|
1788
1788
|
smsSent: i,
|
|
1789
1789
|
error: o,
|
|
1790
1790
|
manager: a,
|
|
1791
|
-
onResend:
|
|
1791
|
+
onResend: g
|
|
1792
1792
|
}
|
|
1793
1793
|
) })
|
|
1794
1794
|
]
|
|
@@ -1822,7 +1822,7 @@ const On = ({
|
|
|
1822
1822
|
}) => {
|
|
1823
1823
|
const [n, o] = It(
|
|
1824
1824
|
() => xt({ config: e })
|
|
1825
|
-
), { logoSrc: a, logoHeightPx:
|
|
1825
|
+
), { logoSrc: a, logoHeightPx: c } = qt({
|
|
1826
1826
|
hideHeader: void 0,
|
|
1827
1827
|
hideFooterBranding: void 0,
|
|
1828
1828
|
logo: void 0,
|
|
@@ -1835,7 +1835,7 @@ const On = ({
|
|
|
1835
1835
|
}, [n.status, i]), L(() => {
|
|
1836
1836
|
n.status === "error" && r?.(n.error);
|
|
1837
1837
|
}, [n.status, r, n]);
|
|
1838
|
-
const
|
|
1838
|
+
const s = n.status === "idle" || n.status === "loading" ? /* @__PURE__ */ l(J, { fullScreen: !0 }) : n.status === "redirecting" ? /* @__PURE__ */ l(
|
|
1839
1839
|
jn,
|
|
1840
1840
|
{
|
|
1841
1841
|
redirectUrl: n.redirectUrl,
|
|
@@ -1852,8 +1852,8 @@ const On = ({
|
|
|
1852
1852
|
"div",
|
|
1853
1853
|
{
|
|
1854
1854
|
class: "IncodeRedirectRoot",
|
|
1855
|
-
style: { "--logo-height": `${
|
|
1856
|
-
children:
|
|
1855
|
+
style: { "--logo-height": `${c}px` },
|
|
1856
|
+
children: s
|
|
1857
1857
|
}
|
|
1858
1858
|
);
|
|
1859
1859
|
}, Nt = ({
|
|
@@ -1873,42 +1873,42 @@ const On = ({
|
|
|
1873
1873
|
Tt(Nt, "incode-redirect-to-mobile");
|
|
1874
1874
|
function Jn(e) {
|
|
1875
1875
|
let t = e.replace("#", "");
|
|
1876
|
-
t.length === 3 && (t = t.split("").map((
|
|
1876
|
+
t.length === 3 && (t = t.split("").map((g) => g + g).join(""));
|
|
1877
1877
|
const i = /^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);
|
|
1878
1878
|
if (!i) return null;
|
|
1879
|
-
const r = Number.parseInt(i[1], 16) / 255, n = Number.parseInt(i[2], 16) / 255, o = Number.parseInt(i[3], 16) / 255, a = Math.max(r, n, o),
|
|
1880
|
-
let
|
|
1881
|
-
const
|
|
1882
|
-
if (a !==
|
|
1883
|
-
const
|
|
1884
|
-
switch (
|
|
1879
|
+
const r = Number.parseInt(i[1], 16) / 255, n = Number.parseInt(i[2], 16) / 255, o = Number.parseInt(i[3], 16) / 255, a = Math.max(r, n, o), c = Math.min(r, n, o);
|
|
1880
|
+
let s = 0, u = 0;
|
|
1881
|
+
const h = (a + c) / 2;
|
|
1882
|
+
if (a !== c) {
|
|
1883
|
+
const g = a - c;
|
|
1884
|
+
switch (u = h > 0.5 ? g / (2 - a - c) : g / (a + c), a) {
|
|
1885
1885
|
case r:
|
|
1886
|
-
|
|
1886
|
+
s = ((n - o) / g + (n < o ? 6 : 0)) / 6;
|
|
1887
1887
|
break;
|
|
1888
1888
|
case n:
|
|
1889
|
-
|
|
1889
|
+
s = ((o - r) / g + 2) / 6;
|
|
1890
1890
|
break;
|
|
1891
1891
|
case o:
|
|
1892
|
-
|
|
1892
|
+
s = ((r - n) / g + 4) / 6;
|
|
1893
1893
|
break;
|
|
1894
1894
|
}
|
|
1895
1895
|
}
|
|
1896
|
-
return { h:
|
|
1896
|
+
return { h: s * 360, s: u * 100, l: h * 100 };
|
|
1897
1897
|
}
|
|
1898
1898
|
function Y(e, t, i) {
|
|
1899
1899
|
const r = e / 360, n = t / 100, o = i / 100;
|
|
1900
|
-
let a,
|
|
1900
|
+
let a, c, s;
|
|
1901
1901
|
if (n === 0)
|
|
1902
|
-
a =
|
|
1902
|
+
a = c = s = o;
|
|
1903
1903
|
else {
|
|
1904
|
-
const
|
|
1905
|
-
a =
|
|
1904
|
+
const h = (f, M, I) => (I < 0 && (I += 1), I > 1 && (I -= 1), I < 0.16666666666666666 ? f + (M - f) * 6 * I : I < 0.5 ? M : I < 0.6666666666666666 ? f + (M - f) * (0.6666666666666666 - I) * 6 : f), g = o < 0.5 ? o * (1 + n) : o + n - o * n, d = 2 * o - g;
|
|
1905
|
+
a = h(d, g, r + 1 / 3), c = h(d, g, r), s = h(d, g, r - 1 / 3);
|
|
1906
1906
|
}
|
|
1907
|
-
const
|
|
1908
|
-
const
|
|
1909
|
-
return
|
|
1907
|
+
const u = (h) => {
|
|
1908
|
+
const g = Math.round(h * 255).toString(16);
|
|
1909
|
+
return g.length === 1 ? `0${g}` : g;
|
|
1910
1910
|
};
|
|
1911
|
-
return `#${
|
|
1911
|
+
return `#${u(a)}${u(c)}${u(s)}`;
|
|
1912
1912
|
}
|
|
1913
1913
|
function Qn(e) {
|
|
1914
1914
|
const t = Jn(e);
|
|
@@ -1958,8 +1958,8 @@ async function Zn(e) {
|
|
|
1958
1958
|
if (t)
|
|
1959
1959
|
return t;
|
|
1960
1960
|
const r = await (await fetch(e)).blob(), n = await new Promise((o, a) => {
|
|
1961
|
-
const
|
|
1962
|
-
|
|
1961
|
+
const c = new FileReader();
|
|
1962
|
+
c.onloadend = () => o(c.result), c.onerror = a, c.readAsDataURL(r);
|
|
1963
1963
|
});
|
|
1964
1964
|
return mt.set(e, n), n;
|
|
1965
1965
|
}
|
|
@@ -2116,8 +2116,8 @@ function Dr(e) {
|
|
|
2116
2116
|
if (V.has(t))
|
|
2117
2117
|
return pt(t);
|
|
2118
2118
|
let i, r;
|
|
2119
|
-
const n = new Promise((
|
|
2120
|
-
i =
|
|
2119
|
+
const n = new Promise((s, u) => {
|
|
2120
|
+
i = s, r = u;
|
|
2121
2121
|
}), o = Bt(), a = {
|
|
2122
2122
|
status: "loading",
|
|
2123
2123
|
flowManager: o,
|
|
@@ -2133,18 +2133,18 @@ function Dr(e) {
|
|
|
2133
2133
|
token: e.token,
|
|
2134
2134
|
lang: e.lang
|
|
2135
2135
|
});
|
|
2136
|
-
const
|
|
2137
|
-
a.theme =
|
|
2138
|
-
}),
|
|
2139
|
-
if (
|
|
2140
|
-
const
|
|
2141
|
-
e.wasmConfig && Dt(
|
|
2142
|
-
} else
|
|
2136
|
+
const s = e.disableDashboardTheme ? Promise.resolve({}) : Lt().then((h) => {
|
|
2137
|
+
a.theme = h.theme, a.uiConfig = h.uiConfig;
|
|
2138
|
+
}), u = o.subscribe((h) => {
|
|
2139
|
+
if (h.status === "ready") {
|
|
2140
|
+
const g = h;
|
|
2141
|
+
e.wasmConfig && Dt(g, e.wasmConfig), tr(g), a.unsubscribe?.(), a.unsubscribe = void 0, a.status = "ready", a.readyResolve();
|
|
2142
|
+
} else h.status === "error" && (a.unsubscribe?.(), a.unsubscribe = void 0, a.status = "error", a.error = h.error, a.readyReject(new Error(h.error)));
|
|
2143
2143
|
});
|
|
2144
|
-
a.unsubscribe =
|
|
2145
|
-
} catch (
|
|
2146
|
-
a.status = "error", a.error =
|
|
2147
|
-
|
|
2144
|
+
a.unsubscribe = u, o.load(), await s;
|
|
2145
|
+
} catch (s) {
|
|
2146
|
+
a.status = "error", a.error = s instanceof Error ? s.message : "Failed to preload", a.readyReject(
|
|
2147
|
+
s instanceof Error ? s : new Error("Failed to preload")
|
|
2148
2148
|
), V.delete(t);
|
|
2149
2149
|
}
|
|
2150
2150
|
})(), pt(t);
|
|
@@ -2157,57 +2157,57 @@ function wt(e) {
|
|
|
2157
2157
|
return t && V.delete(e), t;
|
|
2158
2158
|
}
|
|
2159
2159
|
function rr(e) {
|
|
2160
|
-
const { apiURL: t, token: i, lang: r, disableDashboardTheme: n, onError: o } = e, a = Le(null), [
|
|
2161
|
-
const
|
|
2162
|
-
if (
|
|
2160
|
+
const { apiURL: t, token: i, lang: r, disableDashboardTheme: n, onError: o } = e, a = Le(null), [c, s] = _(() => {
|
|
2161
|
+
const h = De(i);
|
|
2162
|
+
if (h?.status === "ready") {
|
|
2163
2163
|
const d = wt(i);
|
|
2164
2164
|
if (d)
|
|
2165
2165
|
return a.current = d.flowManager, d.uiConfig && te(d.uiConfig), { status: "ready", flowManager: d.flowManager };
|
|
2166
2166
|
}
|
|
2167
|
-
const
|
|
2168
|
-
return a.current =
|
|
2167
|
+
const g = Bt();
|
|
2168
|
+
return a.current = g, h?.status === "error" ? {
|
|
2169
2169
|
status: "error",
|
|
2170
|
-
error:
|
|
2171
|
-
flowManager:
|
|
2172
|
-
} : { status: "initializing", flowManager:
|
|
2173
|
-
}),
|
|
2170
|
+
error: h.error ?? "Preload failed",
|
|
2171
|
+
flowManager: g
|
|
2172
|
+
} : { status: "initializing", flowManager: g };
|
|
2173
|
+
}), u = Le(!1);
|
|
2174
2174
|
return L(() => {
|
|
2175
|
-
if (
|
|
2175
|
+
if (c.status !== "initializing")
|
|
2176
2176
|
return;
|
|
2177
|
-
const
|
|
2178
|
-
if (
|
|
2179
|
-
|
|
2177
|
+
const h = De(i);
|
|
2178
|
+
if (h?.status === "loading") {
|
|
2179
|
+
h.readyPromise.then(() => {
|
|
2180
2180
|
const d = wt(i);
|
|
2181
|
-
d && (a.current = d.flowManager, d.uiConfig && te(d.uiConfig),
|
|
2181
|
+
d && (a.current = d.flowManager, d.uiConfig && te(d.uiConfig), s({ status: "ready", flowManager: d.flowManager }));
|
|
2182
2182
|
}).catch((d) => {
|
|
2183
|
-
const
|
|
2184
|
-
|
|
2183
|
+
const f = d instanceof Error ? d.message : "Preload failed";
|
|
2184
|
+
s({
|
|
2185
2185
|
status: "error",
|
|
2186
|
-
error:
|
|
2187
|
-
flowManager:
|
|
2188
|
-
}), o?.(
|
|
2186
|
+
error: f,
|
|
2187
|
+
flowManager: c.flowManager
|
|
2188
|
+
}), o?.(f);
|
|
2189
2189
|
});
|
|
2190
2190
|
return;
|
|
2191
2191
|
}
|
|
2192
|
-
if (
|
|
2192
|
+
if (u.current)
|
|
2193
2193
|
return;
|
|
2194
|
-
|
|
2194
|
+
u.current = !0, (async () => {
|
|
2195
2195
|
try {
|
|
2196
2196
|
await Pt({ apiURL: t, token: i, lang: r });
|
|
2197
|
-
const d = n ? Promise.resolve() : Lt().then((
|
|
2198
|
-
|
|
2197
|
+
const d = n ? Promise.resolve() : Lt().then((f) => {
|
|
2198
|
+
f.uiConfig && te(f.uiConfig);
|
|
2199
2199
|
});
|
|
2200
|
-
|
|
2200
|
+
c.flowManager.load(), await d, s({ status: "ready", flowManager: c.flowManager });
|
|
2201
2201
|
} catch (d) {
|
|
2202
|
-
const
|
|
2203
|
-
|
|
2202
|
+
const f = d instanceof Error ? d.message : "Failed to initialize SDK";
|
|
2203
|
+
s({
|
|
2204
2204
|
status: "error",
|
|
2205
|
-
error:
|
|
2206
|
-
flowManager:
|
|
2207
|
-
}), o?.(
|
|
2205
|
+
error: f,
|
|
2206
|
+
flowManager: c.flowManager
|
|
2207
|
+
}), o?.(f);
|
|
2208
2208
|
}
|
|
2209
2209
|
})();
|
|
2210
|
-
}, [t, i, r, n, o,
|
|
2210
|
+
}, [t, i, r, n, o, c]), c;
|
|
2211
2211
|
}
|
|
2212
2212
|
function or(e) {
|
|
2213
2213
|
const { moduleKey: t, onModuleLoading: i, onModuleLoaded: r, onError: n } = e, [o, a] = _({ status: "idle" });
|
|
@@ -2216,22 +2216,22 @@ function or(e) {
|
|
|
2216
2216
|
a({ status: "idle" });
|
|
2217
2217
|
return;
|
|
2218
2218
|
}
|
|
2219
|
-
const
|
|
2220
|
-
if (!
|
|
2219
|
+
const c = ke[t];
|
|
2220
|
+
if (!c) {
|
|
2221
2221
|
a({ status: "unsupported", moduleKey: t });
|
|
2222
2222
|
return;
|
|
2223
2223
|
}
|
|
2224
2224
|
a({ status: "loading", moduleKey: t }), i?.(t);
|
|
2225
|
-
let
|
|
2226
|
-
return
|
|
2227
|
-
|
|
2228
|
-
}).catch((
|
|
2229
|
-
if (!
|
|
2230
|
-
const
|
|
2231
|
-
a({ status: "error", moduleKey: t, error:
|
|
2225
|
+
let s = !1;
|
|
2226
|
+
return c().then((u) => {
|
|
2227
|
+
s || (a({ status: "loaded", moduleKey: t, Component: u }), r?.(t));
|
|
2228
|
+
}).catch((u) => {
|
|
2229
|
+
if (!s) {
|
|
2230
|
+
const h = u instanceof Error ? u.message : "Failed to load module";
|
|
2231
|
+
a({ status: "error", moduleKey: t, error: h }), n?.(`Failed to load ${t}: ${h}`);
|
|
2232
2232
|
}
|
|
2233
2233
|
}), () => {
|
|
2234
|
-
|
|
2234
|
+
s = !0;
|
|
2235
2235
|
};
|
|
2236
2236
|
}, [t, i, r, n]), o;
|
|
2237
2237
|
}
|
|
@@ -2255,15 +2255,15 @@ const sr = ({
|
|
|
2255
2255
|
onFinish: t,
|
|
2256
2256
|
onError: i
|
|
2257
2257
|
}) => {
|
|
2258
|
-
const { t: r } = F(), [
|
|
2258
|
+
const { t: r, i18n: n } = F(), [o, a] = _(!1), c = rr({
|
|
2259
2259
|
apiURL: e.apiURL,
|
|
2260
2260
|
token: e.token,
|
|
2261
2261
|
lang: e.lang,
|
|
2262
2262
|
disableDashboardTheme: e.disableDashboardTheme,
|
|
2263
2263
|
onError: i
|
|
2264
|
-
}), [s,
|
|
2264
|
+
}), [s, u] = It(() => c.flowManager, {
|
|
2265
2265
|
autoLoad: !1
|
|
2266
|
-
}), h = s?.status === "ready" && s.flow.redirectDesktopToMobile && !
|
|
2266
|
+
}), h = s?.status === "ready" && s.flow.redirectDesktopToMobile && !o, g = or({
|
|
2267
2267
|
moduleKey: s?.status === "ready" && !h ? s.currentStep : void 0,
|
|
2268
2268
|
onModuleLoading: e.onModuleLoading,
|
|
2269
2269
|
onModuleLoaded: e.onModuleLoaded,
|
|
@@ -2273,22 +2273,24 @@ const sr = ({
|
|
|
2273
2273
|
s?.status === "ready" ? s.steps : [],
|
|
2274
2274
|
s?.status === "ready" ? s.currentStepIndex : -1
|
|
2275
2275
|
), L(() => {
|
|
2276
|
+
e.lang && n.language !== e.lang && n.changeLanguage(e.lang);
|
|
2277
|
+
}, [e.lang, n]), L(() => {
|
|
2276
2278
|
if (s?.status === "ready" && e.wasmConfig) {
|
|
2277
|
-
const
|
|
2278
|
-
|
|
2279
|
+
const d = s, f = Et(d.flow);
|
|
2280
|
+
f.length > 0 && (e.onWasmWarmup?.(f), Dt(d, e.wasmConfig));
|
|
2279
2281
|
}
|
|
2280
2282
|
}, [s, e]), L(() => {
|
|
2281
2283
|
s?.status === "finished" && t(s.finishStatus);
|
|
2282
2284
|
}, [s?.status, t, s]), L(() => {
|
|
2283
2285
|
s?.status === "error" && i && i(s.error);
|
|
2284
2286
|
}, [s?.status, i, s]), L(() => {
|
|
2285
|
-
s?.status === "ready" && s.currentStep === "ID" && s.steps.includes("TUTORIAL_ID") &&
|
|
2286
|
-
}, [s,
|
|
2287
|
+
s?.status === "ready" && s.currentStep === "ID" && s.steps.includes("TUTORIAL_ID") && u.completeModule();
|
|
2288
|
+
}, [s, u]), c.status === "error")
|
|
2287
2289
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l("div", { children: [
|
|
2288
2290
|
"Error: ",
|
|
2289
|
-
|
|
2291
|
+
c.error
|
|
2290
2292
|
] }) });
|
|
2291
|
-
if (
|
|
2293
|
+
if (c.status === "initializing")
|
|
2292
2294
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
2293
2295
|
J,
|
|
2294
2296
|
{
|
|
@@ -2317,13 +2319,13 @@ const sr = ({
|
|
|
2317
2319
|
return null;
|
|
2318
2320
|
if (s.status === "ready") {
|
|
2319
2321
|
const {
|
|
2320
|
-
currentStep:
|
|
2321
|
-
config:
|
|
2322
|
+
currentStep: d,
|
|
2323
|
+
config: f,
|
|
2322
2324
|
flow: {
|
|
2323
|
-
flowId:
|
|
2324
|
-
disableSmsOption:
|
|
2325
|
-
addContinueToDesktop:
|
|
2326
|
-
qrPhishingResistance:
|
|
2325
|
+
flowId: M,
|
|
2326
|
+
disableSmsOption: I,
|
|
2327
|
+
addContinueToDesktop: P,
|
|
2328
|
+
qrPhishingResistance: A
|
|
2327
2329
|
}
|
|
2328
2330
|
} = s;
|
|
2329
2331
|
if (h)
|
|
@@ -2331,19 +2333,19 @@ const sr = ({
|
|
|
2331
2333
|
Nt,
|
|
2332
2334
|
{
|
|
2333
2335
|
config: {
|
|
2334
|
-
flowId:
|
|
2335
|
-
disableSmsOption:
|
|
2336
|
-
addContinueToDesktop:
|
|
2337
|
-
qrPhishingResistance:
|
|
2336
|
+
flowId: M,
|
|
2337
|
+
disableSmsOption: I,
|
|
2338
|
+
addContinueToDesktop: P,
|
|
2339
|
+
qrPhishingResistance: A,
|
|
2338
2340
|
authHint: e.authHint,
|
|
2339
2341
|
lang: e.lang
|
|
2340
2342
|
},
|
|
2341
|
-
onFinish: () =>
|
|
2342
|
-
onContinue: () =>
|
|
2343
|
+
onFinish: () => u.completeFlow(),
|
|
2344
|
+
onContinue: () => a(!0),
|
|
2343
2345
|
onError: i
|
|
2344
2346
|
}
|
|
2345
2347
|
) });
|
|
2346
|
-
if (!
|
|
2348
|
+
if (!d || !f)
|
|
2347
2349
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
2348
2350
|
J,
|
|
2349
2351
|
{
|
|
@@ -2353,15 +2355,15 @@ const sr = ({
|
|
|
2353
2355
|
fullScreen: !0
|
|
2354
2356
|
}
|
|
2355
2357
|
) });
|
|
2356
|
-
if (
|
|
2358
|
+
if (g.status === "unsupported")
|
|
2357
2359
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
2358
2360
|
nr,
|
|
2359
2361
|
{
|
|
2360
|
-
moduleKey:
|
|
2361
|
-
onNext: () =>
|
|
2362
|
+
moduleKey: d,
|
|
2363
|
+
onNext: () => u.completeModule()
|
|
2362
2364
|
}
|
|
2363
2365
|
) });
|
|
2364
|
-
if (
|
|
2366
|
+
if (g.status === "idle" || g.status === "loading" || g.status === "error")
|
|
2365
2367
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
2366
2368
|
J,
|
|
2367
2369
|
{
|
|
@@ -2371,53 +2373,53 @@ const sr = ({
|
|
|
2371
2373
|
fullScreen: !0
|
|
2372
2374
|
}
|
|
2373
2375
|
) });
|
|
2374
|
-
const { Component:
|
|
2375
|
-
if (
|
|
2376
|
+
const { Component: E } = g;
|
|
2377
|
+
if (d === "SELFIE")
|
|
2376
2378
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
2377
|
-
|
|
2379
|
+
E,
|
|
2378
2380
|
{
|
|
2379
|
-
config:
|
|
2380
|
-
onFinish: () =>
|
|
2381
|
+
config: f,
|
|
2382
|
+
onFinish: () => u.completeModule(),
|
|
2381
2383
|
onError: (p) => {
|
|
2382
2384
|
i?.(p ?? "Selfie verification error");
|
|
2383
2385
|
}
|
|
2384
2386
|
},
|
|
2385
2387
|
`selfie-${s.currentStepIndex}`
|
|
2386
2388
|
) });
|
|
2387
|
-
if (
|
|
2389
|
+
if (d === "AUTHENTICATION")
|
|
2388
2390
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
2389
|
-
|
|
2391
|
+
E,
|
|
2390
2392
|
{
|
|
2391
|
-
config: { ...
|
|
2392
|
-
onFinish: () =>
|
|
2393
|
+
config: { ...f, authHint: e.authHint },
|
|
2394
|
+
onFinish: () => u.completeModule(),
|
|
2393
2395
|
onError: (p) => {
|
|
2394
2396
|
i?.(p ?? "Authentication error");
|
|
2395
2397
|
}
|
|
2396
2398
|
},
|
|
2397
2399
|
`authentication-${s.currentStepIndex}`
|
|
2398
2400
|
) });
|
|
2399
|
-
if (
|
|
2401
|
+
if (d === "PHONE")
|
|
2400
2402
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
2401
|
-
|
|
2403
|
+
E,
|
|
2402
2404
|
{
|
|
2403
|
-
config:
|
|
2404
|
-
onFinish: () =>
|
|
2405
|
+
config: f,
|
|
2406
|
+
onFinish: () => u.completeModule(),
|
|
2405
2407
|
onError: (p) => {
|
|
2406
2408
|
i?.(p ?? "Phone verification error");
|
|
2407
2409
|
}
|
|
2408
2410
|
},
|
|
2409
2411
|
`phone-${s.currentStepIndex}`
|
|
2410
2412
|
) });
|
|
2411
|
-
if (
|
|
2412
|
-
const m =
|
|
2413
|
+
if (d === "EMAIL") {
|
|
2414
|
+
const m = f;
|
|
2413
2415
|
return !m || typeof m.otpVerification != "boolean" || typeof m.otpExpirationInMinutes != "number" ? /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l("div", { children: "Error: Invalid email configuration" }) }) : /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
2414
|
-
|
|
2416
|
+
E,
|
|
2415
2417
|
{
|
|
2416
2418
|
config: {
|
|
2417
2419
|
...m,
|
|
2418
2420
|
prefill: m.prefill ?? !1
|
|
2419
2421
|
},
|
|
2420
|
-
onFinish: () =>
|
|
2422
|
+
onFinish: () => u.completeModule(),
|
|
2421
2423
|
onError: (p) => {
|
|
2422
2424
|
i?.(p ?? "Email verification error");
|
|
2423
2425
|
}
|
|
@@ -2425,143 +2427,143 @@ const sr = ({
|
|
|
2425
2427
|
`email-${s.currentStepIndex}`
|
|
2426
2428
|
) });
|
|
2427
2429
|
}
|
|
2428
|
-
if (
|
|
2429
|
-
|
|
2430
|
-
const m =
|
|
2430
|
+
if (d === "TUTORIAL_ID" || d === "SECOND_ID" || // Only render ID if TUTORIAL_ID doesn't exist (otherwise useEffect will skip it)
|
|
2431
|
+
d === "ID" && !s.steps.includes("TUTORIAL_ID")) {
|
|
2432
|
+
const m = f, B = d === "SECOND_ID" ? { ...m, isSecondId: !0 } : m;
|
|
2431
2433
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
2432
|
-
|
|
2434
|
+
E,
|
|
2433
2435
|
{
|
|
2434
|
-
config:
|
|
2435
|
-
onFinish: () =>
|
|
2436
|
-
onError: (
|
|
2437
|
-
i?.(
|
|
2436
|
+
config: B,
|
|
2437
|
+
onFinish: () => u.completeModule(),
|
|
2438
|
+
onError: (w) => {
|
|
2439
|
+
i?.(w ?? "ID capture error");
|
|
2438
2440
|
}
|
|
2439
2441
|
},
|
|
2440
2442
|
`id-${s.currentStepIndex}`
|
|
2441
2443
|
) });
|
|
2442
2444
|
}
|
|
2443
|
-
if (
|
|
2444
|
-
const m =
|
|
2445
|
+
if (d === "FACE_MATCH") {
|
|
2446
|
+
const m = f, p = {
|
|
2445
2447
|
variant: m.matchingType,
|
|
2446
2448
|
disableFaceMatchAnimation: m.disableFaceMatchAnimation ?? !1
|
|
2447
2449
|
};
|
|
2448
2450
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
2449
|
-
|
|
2451
|
+
E,
|
|
2450
2452
|
{
|
|
2451
2453
|
config: p,
|
|
2452
|
-
onFinish: () =>
|
|
2453
|
-
onError: (
|
|
2454
|
-
i?.(
|
|
2454
|
+
onFinish: () => u.completeModule(),
|
|
2455
|
+
onError: (B) => {
|
|
2456
|
+
i?.(B ?? "Face match error");
|
|
2455
2457
|
}
|
|
2456
2458
|
},
|
|
2457
2459
|
`face-match-${s.currentStepIndex}`
|
|
2458
2460
|
) });
|
|
2459
2461
|
}
|
|
2460
|
-
if (
|
|
2462
|
+
if (d === "CURP_VALIDATION")
|
|
2461
2463
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
2462
|
-
|
|
2464
|
+
E,
|
|
2463
2465
|
{
|
|
2464
|
-
config:
|
|
2465
|
-
onFinish: () =>
|
|
2466
|
+
config: f,
|
|
2467
|
+
onFinish: () => u.completeModule(),
|
|
2466
2468
|
onError: (p) => {
|
|
2467
2469
|
i?.(p ?? "CURP validation error");
|
|
2468
2470
|
}
|
|
2469
2471
|
},
|
|
2470
2472
|
`curp-validation-${s.currentStepIndex}`
|
|
2471
2473
|
) });
|
|
2472
|
-
if (
|
|
2474
|
+
if (d === "GOVT_VALIDATION_PROVISIONING")
|
|
2473
2475
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
2474
|
-
|
|
2476
|
+
E,
|
|
2475
2477
|
{
|
|
2476
|
-
config:
|
|
2477
|
-
onFinish: () =>
|
|
2478
|
+
config: f,
|
|
2479
|
+
onFinish: () => u.completeModule(),
|
|
2478
2480
|
onError: (p) => {
|
|
2479
2481
|
i?.(p ?? "Government validation error");
|
|
2480
2482
|
}
|
|
2481
2483
|
},
|
|
2482
2484
|
`govt-validation-${s.currentStepIndex}`
|
|
2483
2485
|
) });
|
|
2484
|
-
if (
|
|
2486
|
+
if (d === "GEOLOCATION")
|
|
2485
2487
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
2486
|
-
|
|
2488
|
+
E,
|
|
2487
2489
|
{
|
|
2488
|
-
config: { allowSkip:
|
|
2489
|
-
onFinish: () =>
|
|
2490
|
+
config: { allowSkip: f.allowUserToSkipGeolocation },
|
|
2491
|
+
onFinish: () => u.completeModule(),
|
|
2490
2492
|
onError: (p) => {
|
|
2491
2493
|
i?.(p ?? "Geolocation error");
|
|
2492
2494
|
}
|
|
2493
2495
|
},
|
|
2494
2496
|
`geolocation-${s.currentStepIndex}`
|
|
2495
2497
|
) });
|
|
2496
|
-
if (
|
|
2498
|
+
if (d === "EXTERNAL_VERIFICATION")
|
|
2497
2499
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
2498
|
-
|
|
2500
|
+
E,
|
|
2499
2501
|
{
|
|
2500
2502
|
config: { flowId: s.flow.flowId },
|
|
2501
|
-
onFinish: () =>
|
|
2503
|
+
onFinish: () => u.completeModule(),
|
|
2502
2504
|
onError: (m) => {
|
|
2503
2505
|
i?.(m ?? "External verification error");
|
|
2504
2506
|
}
|
|
2505
2507
|
},
|
|
2506
2508
|
`ekyc-${s.currentStepIndex}`
|
|
2507
2509
|
) });
|
|
2508
|
-
if (
|
|
2510
|
+
if (d === "DOCUMENT_CAPTURE")
|
|
2509
2511
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
2510
|
-
|
|
2512
|
+
E,
|
|
2511
2513
|
{
|
|
2512
|
-
config:
|
|
2513
|
-
onFinish: () =>
|
|
2514
|
+
config: f,
|
|
2515
|
+
onFinish: () => u.completeModule(),
|
|
2514
2516
|
onError: (m) => {
|
|
2515
2517
|
i?.(m ?? "Document capture error");
|
|
2516
2518
|
}
|
|
2517
2519
|
},
|
|
2518
2520
|
`document-capture-${s.currentStepIndex}`
|
|
2519
2521
|
) });
|
|
2520
|
-
if (
|
|
2521
|
-
const m =
|
|
2522
|
+
if (d === "ADDRESS") {
|
|
2523
|
+
const m = f, p = {
|
|
2522
2524
|
processingType: "addressStatement",
|
|
2523
2525
|
allowSkipDocumentCapture: !m.disableSkipPoa,
|
|
2524
2526
|
title: m.title,
|
|
2525
2527
|
text: m.text
|
|
2526
2528
|
};
|
|
2527
2529
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
2528
|
-
|
|
2530
|
+
E,
|
|
2529
2531
|
{
|
|
2530
2532
|
config: p,
|
|
2531
|
-
onFinish: () =>
|
|
2532
|
-
onError: (
|
|
2533
|
-
i?.(
|
|
2533
|
+
onFinish: () => u.completeModule(),
|
|
2534
|
+
onError: (B) => {
|
|
2535
|
+
i?.(B ?? "Address capture error");
|
|
2534
2536
|
}
|
|
2535
2537
|
},
|
|
2536
2538
|
`address-${s.currentStepIndex}`
|
|
2537
2539
|
) });
|
|
2538
2540
|
}
|
|
2539
|
-
if (
|
|
2540
|
-
const m =
|
|
2541
|
-
flowId:
|
|
2541
|
+
if (d === "EKYB") {
|
|
2542
|
+
const m = f, p = {
|
|
2543
|
+
flowId: M,
|
|
2542
2544
|
checkBusinessName: m.checkBusinessName,
|
|
2543
2545
|
checkAddress: m.checkAddress,
|
|
2544
2546
|
checkTaxId: m.checkTaxId,
|
|
2545
2547
|
checkUniqueBeneficialOwner: m.checkUniqueBeneficialOwner
|
|
2546
2548
|
};
|
|
2547
2549
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
2548
|
-
|
|
2550
|
+
E,
|
|
2549
2551
|
{
|
|
2550
2552
|
config: p,
|
|
2551
|
-
onFinish: () =>
|
|
2552
|
-
onError: (
|
|
2553
|
-
i?.(
|
|
2553
|
+
onFinish: () => u.completeModule(),
|
|
2554
|
+
onError: (B) => {
|
|
2555
|
+
i?.(B ?? "eKYB verification error");
|
|
2554
2556
|
}
|
|
2555
2557
|
},
|
|
2556
2558
|
`ekyb-${s.currentStepIndex}`
|
|
2557
2559
|
) });
|
|
2558
2560
|
}
|
|
2559
|
-
if (
|
|
2561
|
+
if (d === "COMBINED_CONSENT")
|
|
2560
2562
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
2561
|
-
|
|
2563
|
+
E,
|
|
2562
2564
|
{
|
|
2563
|
-
config:
|
|
2564
|
-
onFinish: () =>
|
|
2565
|
+
config: f,
|
|
2566
|
+
onFinish: () => u.completeModule(),
|
|
2565
2567
|
onError: (p) => {
|
|
2566
2568
|
i?.(p ?? "Combined consent error");
|
|
2567
2569
|
}
|