topiray-auth-react 1.1.2 → 1.1.4
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/README.md +194 -1
- package/dist/{browser-irxqvouE.js → browser-CWYgYqFg.js} +230 -228
- package/dist/i18n/I18nProvider.d.ts +13 -0
- package/dist/i18n/en.json.d.ts +93 -0
- package/dist/i18n/index.d.ts +3 -0
- package/dist/i18n/types.d.ts +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.es.js +6525 -22
- package/dist/index.umd.js +40 -118
- package/package.json +1 -1
- package/dist/index-BRHoy3Wf.js +0 -7730
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
function oe(r, o) {
|
|
1
|
+
function re(r, o) {
|
|
3
2
|
for (var i = 0; i < o.length; i++) {
|
|
4
3
|
const e = o[i];
|
|
5
4
|
if (typeof e != "string" && !Array.isArray(e)) {
|
|
@@ -15,6 +14,9 @@ function oe(r, o) {
|
|
|
15
14
|
}
|
|
16
15
|
return Object.freeze(Object.defineProperty(r, Symbol.toStringTag, { value: "Module" }));
|
|
17
16
|
}
|
|
17
|
+
function oe(r) {
|
|
18
|
+
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
19
|
+
}
|
|
18
20
|
var z = {}, Q, Bt;
|
|
19
21
|
function ie() {
|
|
20
22
|
return Bt || (Bt = 1, Q = function() {
|
|
@@ -129,7 +131,7 @@ function yt() {
|
|
|
129
131
|
}(W)), W;
|
|
130
132
|
}
|
|
131
133
|
var Z, Tt;
|
|
132
|
-
function
|
|
134
|
+
function ue() {
|
|
133
135
|
if (Tt) return Z;
|
|
134
136
|
Tt = 1;
|
|
135
137
|
function r() {
|
|
@@ -153,10 +155,10 @@ function se() {
|
|
|
153
155
|
}
|
|
154
156
|
}, Z = r, Z;
|
|
155
157
|
}
|
|
156
|
-
var X,
|
|
157
|
-
function
|
|
158
|
-
if (
|
|
159
|
-
|
|
158
|
+
var X, Pt;
|
|
159
|
+
function se() {
|
|
160
|
+
if (Pt) return X;
|
|
161
|
+
Pt = 1;
|
|
160
162
|
function r(o) {
|
|
161
163
|
if (!o || o < 1)
|
|
162
164
|
throw new Error("BitMatrix size must be defined and greater than 0");
|
|
@@ -173,31 +175,31 @@ function ue() {
|
|
|
173
175
|
return this.reservedBit[o * this.size + i];
|
|
174
176
|
}, X = r, X;
|
|
175
177
|
}
|
|
176
|
-
var x = {},
|
|
178
|
+
var x = {}, It;
|
|
177
179
|
function ae() {
|
|
178
|
-
return
|
|
180
|
+
return It || (It = 1, function(r) {
|
|
179
181
|
const o = U().getSymbolSize;
|
|
180
182
|
r.getRowColCoords = function(e) {
|
|
181
183
|
if (e === 1) return [];
|
|
182
|
-
const t = Math.floor(e / 7) + 2, n = o(e),
|
|
183
|
-
for (let
|
|
184
|
-
a[
|
|
184
|
+
const t = Math.floor(e / 7) + 2, n = o(e), u = n === 145 ? 26 : Math.ceil((n - 13) / (2 * t - 2)) * 2, a = [n - 7];
|
|
185
|
+
for (let s = 1; s < t - 1; s++)
|
|
186
|
+
a[s] = a[s - 1] - u;
|
|
185
187
|
return a.push(6), a.reverse();
|
|
186
188
|
}, r.getPositions = function(e) {
|
|
187
|
-
const t = [], n = r.getRowColCoords(e),
|
|
188
|
-
for (let a = 0; a <
|
|
189
|
-
for (let
|
|
190
|
-
a === 0 &&
|
|
191
|
-
a === 0 &&
|
|
192
|
-
a ===
|
|
189
|
+
const t = [], n = r.getRowColCoords(e), u = n.length;
|
|
190
|
+
for (let a = 0; a < u; a++)
|
|
191
|
+
for (let s = 0; s < u; s++)
|
|
192
|
+
a === 0 && s === 0 || // top-left
|
|
193
|
+
a === 0 && s === u - 1 || // bottom-left
|
|
194
|
+
a === u - 1 && s === 0 || t.push([n[a], n[s]]);
|
|
193
195
|
return t;
|
|
194
196
|
};
|
|
195
197
|
}(x)), x;
|
|
196
198
|
}
|
|
197
|
-
var tt = {},
|
|
199
|
+
var tt = {}, Nt;
|
|
198
200
|
function ce() {
|
|
199
|
-
if (
|
|
200
|
-
|
|
201
|
+
if (Nt) return tt;
|
|
202
|
+
Nt = 1;
|
|
201
203
|
const r = U().getSymbolSize, o = 7;
|
|
202
204
|
return tt.getPositions = function(e) {
|
|
203
205
|
const t = r(e);
|
|
@@ -236,39 +238,39 @@ function fe() {
|
|
|
236
238
|
return r.isValid(t) ? parseInt(t, 10) : void 0;
|
|
237
239
|
}, r.getPenaltyN1 = function(t) {
|
|
238
240
|
const n = t.size;
|
|
239
|
-
let
|
|
241
|
+
let u = 0, a = 0, s = 0, c = null, d = null;
|
|
240
242
|
for (let p = 0; p < n; p++) {
|
|
241
|
-
a =
|
|
243
|
+
a = s = 0, c = d = null;
|
|
242
244
|
for (let h = 0; h < n; h++) {
|
|
243
245
|
let f = t.get(p, h);
|
|
244
|
-
f === c ? a++ : (a >= 5 && (
|
|
246
|
+
f === c ? a++ : (a >= 5 && (u += o.N1 + (a - 5)), c = f, a = 1), f = t.get(h, p), f === d ? s++ : (s >= 5 && (u += o.N1 + (s - 5)), d = f, s = 1);
|
|
245
247
|
}
|
|
246
|
-
a >= 5 && (
|
|
248
|
+
a >= 5 && (u += o.N1 + (a - 5)), s >= 5 && (u += o.N1 + (s - 5));
|
|
247
249
|
}
|
|
248
|
-
return
|
|
250
|
+
return u;
|
|
249
251
|
}, r.getPenaltyN2 = function(t) {
|
|
250
252
|
const n = t.size;
|
|
251
|
-
let
|
|
253
|
+
let u = 0;
|
|
252
254
|
for (let a = 0; a < n - 1; a++)
|
|
253
|
-
for (let
|
|
254
|
-
const c = t.get(a,
|
|
255
|
-
(c === 4 || c === 0) &&
|
|
255
|
+
for (let s = 0; s < n - 1; s++) {
|
|
256
|
+
const c = t.get(a, s) + t.get(a, s + 1) + t.get(a + 1, s) + t.get(a + 1, s + 1);
|
|
257
|
+
(c === 4 || c === 0) && u++;
|
|
256
258
|
}
|
|
257
|
-
return
|
|
259
|
+
return u * o.N2;
|
|
258
260
|
}, r.getPenaltyN3 = function(t) {
|
|
259
261
|
const n = t.size;
|
|
260
|
-
let
|
|
262
|
+
let u = 0, a = 0, s = 0;
|
|
261
263
|
for (let c = 0; c < n; c++) {
|
|
262
|
-
a =
|
|
264
|
+
a = s = 0;
|
|
263
265
|
for (let d = 0; d < n; d++)
|
|
264
|
-
a = a << 1 & 2047 | t.get(c, d), d >= 10 && (a === 1488 || a === 93) &&
|
|
266
|
+
a = a << 1 & 2047 | t.get(c, d), d >= 10 && (a === 1488 || a === 93) && u++, s = s << 1 & 2047 | t.get(d, c), d >= 10 && (s === 1488 || s === 93) && u++;
|
|
265
267
|
}
|
|
266
|
-
return
|
|
268
|
+
return u * o.N3;
|
|
267
269
|
}, r.getPenaltyN4 = function(t) {
|
|
268
270
|
let n = 0;
|
|
269
|
-
const
|
|
270
|
-
for (let
|
|
271
|
-
return Math.abs(Math.ceil(n * 100 /
|
|
271
|
+
const u = t.data.length;
|
|
272
|
+
for (let s = 0; s < u; s++) n += t.data[s];
|
|
273
|
+
return Math.abs(Math.ceil(n * 100 / u / 5) - 10) * o.N4;
|
|
272
274
|
};
|
|
273
275
|
function i(e, t, n) {
|
|
274
276
|
switch (e) {
|
|
@@ -293,26 +295,26 @@ function fe() {
|
|
|
293
295
|
}
|
|
294
296
|
}
|
|
295
297
|
r.applyMask = function(t, n) {
|
|
296
|
-
const
|
|
297
|
-
for (let a = 0; a <
|
|
298
|
-
for (let
|
|
299
|
-
n.isReserved(
|
|
298
|
+
const u = n.size;
|
|
299
|
+
for (let a = 0; a < u; a++)
|
|
300
|
+
for (let s = 0; s < u; s++)
|
|
301
|
+
n.isReserved(s, a) || n.xor(s, a, i(t, s, a));
|
|
300
302
|
}, r.getBestMask = function(t, n) {
|
|
301
|
-
const
|
|
302
|
-
let a = 0,
|
|
303
|
-
for (let c = 0; c <
|
|
303
|
+
const u = Object.keys(r.Patterns).length;
|
|
304
|
+
let a = 0, s = 1 / 0;
|
|
305
|
+
for (let c = 0; c < u; c++) {
|
|
304
306
|
n(c), r.applyMask(c, t);
|
|
305
307
|
const d = r.getPenaltyN1(t) + r.getPenaltyN2(t) + r.getPenaltyN3(t) + r.getPenaltyN4(t);
|
|
306
|
-
r.applyMask(c, t), d <
|
|
308
|
+
r.applyMask(c, t), d < s && (s = d, a = c);
|
|
307
309
|
}
|
|
308
310
|
return a;
|
|
309
311
|
};
|
|
310
312
|
}(et)), et;
|
|
311
313
|
}
|
|
312
|
-
var
|
|
314
|
+
var O = {}, bt;
|
|
313
315
|
function $t() {
|
|
314
|
-
if (
|
|
315
|
-
|
|
316
|
+
if (bt) return O;
|
|
317
|
+
bt = 1;
|
|
316
318
|
const r = yt(), o = [
|
|
317
319
|
// L M Q H
|
|
318
320
|
1,
|
|
@@ -638,7 +640,7 @@ function $t() {
|
|
|
638
640
|
2040,
|
|
639
641
|
2430
|
|
640
642
|
];
|
|
641
|
-
return
|
|
643
|
+
return O.getBlocksCount = function(t, n) {
|
|
642
644
|
switch (n) {
|
|
643
645
|
case r.L:
|
|
644
646
|
return o[(t - 1) * 4 + 0];
|
|
@@ -651,7 +653,7 @@ function $t() {
|
|
|
651
653
|
default:
|
|
652
654
|
return;
|
|
653
655
|
}
|
|
654
|
-
},
|
|
656
|
+
}, O.getTotalCodewordsCount = function(t, n) {
|
|
655
657
|
switch (n) {
|
|
656
658
|
case r.L:
|
|
657
659
|
return i[(t - 1) * 4 + 0];
|
|
@@ -664,12 +666,12 @@ function $t() {
|
|
|
664
666
|
default:
|
|
665
667
|
return;
|
|
666
668
|
}
|
|
667
|
-
},
|
|
669
|
+
}, O;
|
|
668
670
|
}
|
|
669
|
-
var nt = {}, K = {},
|
|
671
|
+
var nt = {}, K = {}, St;
|
|
670
672
|
function le() {
|
|
671
|
-
if (
|
|
672
|
-
|
|
673
|
+
if (St) return K;
|
|
674
|
+
St = 1;
|
|
673
675
|
const r = new Uint8Array(512), o = new Uint8Array(256);
|
|
674
676
|
return function() {
|
|
675
677
|
let e = 1;
|
|
@@ -692,16 +694,16 @@ function de() {
|
|
|
692
694
|
const o = le();
|
|
693
695
|
r.mul = function(e, t) {
|
|
694
696
|
const n = new Uint8Array(e.length + t.length - 1);
|
|
695
|
-
for (let
|
|
697
|
+
for (let u = 0; u < e.length; u++)
|
|
696
698
|
for (let a = 0; a < t.length; a++)
|
|
697
|
-
n[
|
|
699
|
+
n[u + a] ^= o.mul(e[u], t[a]);
|
|
698
700
|
return n;
|
|
699
701
|
}, r.mod = function(e, t) {
|
|
700
702
|
let n = new Uint8Array(e);
|
|
701
703
|
for (; n.length - t.length >= 0; ) {
|
|
702
|
-
const
|
|
703
|
-
for (let
|
|
704
|
-
n[
|
|
704
|
+
const u = n[0];
|
|
705
|
+
for (let s = 0; s < t.length; s++)
|
|
706
|
+
n[s] ^= o.mul(t[s], u);
|
|
705
707
|
let a = 0;
|
|
706
708
|
for (; a < n.length && n[a] === 0; ) a++;
|
|
707
709
|
n = n.slice(a);
|
|
@@ -730,19 +732,19 @@ function ge() {
|
|
|
730
732
|
throw new Error("Encoder not initialized");
|
|
731
733
|
const t = new Uint8Array(e.length + this.degree);
|
|
732
734
|
t.set(e);
|
|
733
|
-
const n = r.mod(t, this.genPoly),
|
|
734
|
-
if (
|
|
735
|
+
const n = r.mod(t, this.genPoly), u = this.degree - n.length;
|
|
736
|
+
if (u > 0) {
|
|
735
737
|
const a = new Uint8Array(this.degree);
|
|
736
|
-
return a.set(n,
|
|
738
|
+
return a.set(n, u), a;
|
|
737
739
|
}
|
|
738
740
|
return n;
|
|
739
741
|
}, rt = o, rt;
|
|
740
742
|
}
|
|
741
|
-
var ot = {}, it = {},
|
|
743
|
+
var ot = {}, it = {}, ut = {}, qt;
|
|
742
744
|
function Wt() {
|
|
743
|
-
return qt || (qt = 1,
|
|
745
|
+
return qt || (qt = 1, ut.isValid = function(o) {
|
|
744
746
|
return !isNaN(o) && o >= 1 && o <= 40;
|
|
745
|
-
}),
|
|
747
|
+
}), ut;
|
|
746
748
|
}
|
|
747
749
|
var L = {}, vt;
|
|
748
750
|
function Zt() {
|
|
@@ -754,13 +756,13 @@ function Zt() {
|
|
|
754
756
|
const e = "(?:(?![A-Z0-9 $%*+\\-./:]|" + i + `)(?:.|[\r
|
|
755
757
|
]))+`;
|
|
756
758
|
L.KANJI = new RegExp(i, "g"), L.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g"), L.BYTE = new RegExp(e, "g"), L.NUMERIC = new RegExp(r, "g"), L.ALPHANUMERIC = new RegExp(o, "g");
|
|
757
|
-
const t = new RegExp("^" + i + "$"), n = new RegExp("^" + r + "$"),
|
|
758
|
-
return L.testKanji = function(
|
|
759
|
-
return t.test(
|
|
760
|
-
}, L.testNumeric = function(
|
|
761
|
-
return n.test(
|
|
762
|
-
}, L.testAlphanumeric = function(
|
|
763
|
-
return
|
|
759
|
+
const t = new RegExp("^" + i + "$"), n = new RegExp("^" + r + "$"), u = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
|
|
760
|
+
return L.testKanji = function(s) {
|
|
761
|
+
return t.test(s);
|
|
762
|
+
}, L.testNumeric = function(s) {
|
|
763
|
+
return n.test(s);
|
|
764
|
+
}, L.testAlphanumeric = function(s) {
|
|
765
|
+
return u.test(s);
|
|
764
766
|
}, L;
|
|
765
767
|
}
|
|
766
768
|
var _t;
|
|
@@ -785,11 +787,11 @@ function F() {
|
|
|
785
787
|
ccBits: [8, 10, 12]
|
|
786
788
|
}, r.MIXED = {
|
|
787
789
|
bit: -1
|
|
788
|
-
}, r.getCharCountIndicator = function(n,
|
|
790
|
+
}, r.getCharCountIndicator = function(n, u) {
|
|
789
791
|
if (!n.ccBits) throw new Error("Invalid mode: " + n);
|
|
790
|
-
if (!o.isValid(
|
|
791
|
-
throw new Error("Invalid version: " +
|
|
792
|
-
return
|
|
792
|
+
if (!o.isValid(u))
|
|
793
|
+
throw new Error("Invalid version: " + u);
|
|
794
|
+
return u >= 1 && u < 10 ? n.ccBits[0] : u < 27 ? n.ccBits[1] : n.ccBits[2];
|
|
793
795
|
}, r.getBestModeForData = function(n) {
|
|
794
796
|
return i.testNumeric(n) ? r.NUMERIC : i.testAlphanumeric(n) ? r.ALPHANUMERIC : i.testKanji(n) ? r.KANJI : r.BYTE;
|
|
795
797
|
}, r.toString = function(n) {
|
|
@@ -814,13 +816,13 @@ function F() {
|
|
|
814
816
|
throw new Error("Unknown mode: " + t);
|
|
815
817
|
}
|
|
816
818
|
}
|
|
817
|
-
r.from = function(n,
|
|
819
|
+
r.from = function(n, u) {
|
|
818
820
|
if (r.isValid(n))
|
|
819
821
|
return n;
|
|
820
822
|
try {
|
|
821
823
|
return e(n);
|
|
822
824
|
} catch {
|
|
823
|
-
return
|
|
825
|
+
return u;
|
|
824
826
|
}
|
|
825
827
|
};
|
|
826
828
|
}(it)), it;
|
|
@@ -828,37 +830,37 @@ function F() {
|
|
|
828
830
|
var Ut;
|
|
829
831
|
function he() {
|
|
830
832
|
return Ut || (Ut = 1, function(r) {
|
|
831
|
-
const o = U(), i = $t(), e = yt(), t = F(), n = Wt(),
|
|
832
|
-
function
|
|
833
|
-
for (let
|
|
834
|
-
if (f <= r.getCapacity(
|
|
835
|
-
return
|
|
833
|
+
const o = U(), i = $t(), e = yt(), t = F(), n = Wt(), u = 7973, a = o.getBCHDigit(u);
|
|
834
|
+
function s(h, f, I) {
|
|
835
|
+
for (let N = 1; N <= 40; N++)
|
|
836
|
+
if (f <= r.getCapacity(N, I, h))
|
|
837
|
+
return N;
|
|
836
838
|
}
|
|
837
839
|
function c(h, f) {
|
|
838
840
|
return t.getCharCountIndicator(h, f) + 4;
|
|
839
841
|
}
|
|
840
842
|
function d(h, f) {
|
|
841
|
-
let
|
|
842
|
-
return h.forEach(function(
|
|
843
|
-
const
|
|
844
|
-
|
|
845
|
-
}),
|
|
843
|
+
let I = 0;
|
|
844
|
+
return h.forEach(function(N) {
|
|
845
|
+
const b = c(N.mode, f);
|
|
846
|
+
I += b + N.getBitsLength();
|
|
847
|
+
}), I;
|
|
846
848
|
}
|
|
847
849
|
function p(h, f) {
|
|
848
|
-
for (let
|
|
849
|
-
if (d(h,
|
|
850
|
-
return
|
|
850
|
+
for (let I = 1; I <= 40; I++)
|
|
851
|
+
if (d(h, I) <= r.getCapacity(I, f, t.MIXED))
|
|
852
|
+
return I;
|
|
851
853
|
}
|
|
852
|
-
r.from = function(f,
|
|
853
|
-
return n.isValid(f) ? parseInt(f, 10) :
|
|
854
|
-
}, r.getCapacity = function(f,
|
|
854
|
+
r.from = function(f, I) {
|
|
855
|
+
return n.isValid(f) ? parseInt(f, 10) : I;
|
|
856
|
+
}, r.getCapacity = function(f, I, N) {
|
|
855
857
|
if (!n.isValid(f))
|
|
856
858
|
throw new Error("Invalid QR Code version");
|
|
857
|
-
typeof
|
|
858
|
-
const
|
|
859
|
-
if (
|
|
860
|
-
const T = M - c(
|
|
861
|
-
switch (
|
|
859
|
+
typeof N > "u" && (N = t.BYTE);
|
|
860
|
+
const b = o.getSymbolTotalCodewords(f), R = i.getTotalCodewordsCount(f, I), M = (b - R) * 8;
|
|
861
|
+
if (N === t.MIXED) return M;
|
|
862
|
+
const T = M - c(N, f);
|
|
863
|
+
switch (N) {
|
|
862
864
|
case t.NUMERIC:
|
|
863
865
|
return Math.floor(T / 10 * 3);
|
|
864
866
|
case t.ALPHANUMERIC:
|
|
@@ -869,40 +871,40 @@ function he() {
|
|
|
869
871
|
default:
|
|
870
872
|
return Math.floor(T / 8);
|
|
871
873
|
}
|
|
872
|
-
}, r.getBestVersionForData = function(f,
|
|
873
|
-
let
|
|
874
|
-
const
|
|
874
|
+
}, r.getBestVersionForData = function(f, I) {
|
|
875
|
+
let N;
|
|
876
|
+
const b = e.from(I, e.M);
|
|
875
877
|
if (Array.isArray(f)) {
|
|
876
878
|
if (f.length > 1)
|
|
877
|
-
return p(f,
|
|
879
|
+
return p(f, b);
|
|
878
880
|
if (f.length === 0)
|
|
879
881
|
return 1;
|
|
880
|
-
|
|
882
|
+
N = f[0];
|
|
881
883
|
} else
|
|
882
|
-
|
|
883
|
-
return
|
|
884
|
+
N = f;
|
|
885
|
+
return s(N.mode, N.getLength(), b);
|
|
884
886
|
}, r.getEncodedBits = function(f) {
|
|
885
887
|
if (!n.isValid(f) || f < 7)
|
|
886
888
|
throw new Error("Invalid QR Code version");
|
|
887
|
-
let
|
|
888
|
-
for (; o.getBCHDigit(
|
|
889
|
-
|
|
890
|
-
return f << 12 |
|
|
889
|
+
let I = f << 12;
|
|
890
|
+
for (; o.getBCHDigit(I) - a >= 0; )
|
|
891
|
+
I ^= u << o.getBCHDigit(I) - a;
|
|
892
|
+
return f << 12 | I;
|
|
891
893
|
};
|
|
892
894
|
}(ot)), ot;
|
|
893
895
|
}
|
|
894
|
-
var
|
|
896
|
+
var st = {}, Ft;
|
|
895
897
|
function me() {
|
|
896
|
-
if (Ft) return
|
|
898
|
+
if (Ft) return st;
|
|
897
899
|
Ft = 1;
|
|
898
900
|
const r = U(), o = 1335, i = 21522, e = r.getBCHDigit(o);
|
|
899
|
-
return
|
|
900
|
-
const a = n.bit << 3 |
|
|
901
|
-
let
|
|
902
|
-
for (; r.getBCHDigit(
|
|
903
|
-
|
|
904
|
-
return (a << 10 |
|
|
905
|
-
},
|
|
901
|
+
return st.getEncodedBits = function(n, u) {
|
|
902
|
+
const a = n.bit << 3 | u;
|
|
903
|
+
let s = a << 10;
|
|
904
|
+
for (; r.getBCHDigit(s) - e >= 0; )
|
|
905
|
+
s ^= o << r.getBCHDigit(s) - e;
|
|
906
|
+
return (a << 10 | s) ^ i;
|
|
907
|
+
}, st;
|
|
906
908
|
}
|
|
907
909
|
var at = {}, ct, kt;
|
|
908
910
|
function we() {
|
|
@@ -919,11 +921,11 @@ function we() {
|
|
|
919
921
|
}, o.prototype.getBitsLength = function() {
|
|
920
922
|
return o.getBitsLength(this.data.length);
|
|
921
923
|
}, o.prototype.write = function(e) {
|
|
922
|
-
let t, n,
|
|
924
|
+
let t, n, u;
|
|
923
925
|
for (t = 0; t + 3 <= this.data.length; t += 3)
|
|
924
|
-
n = this.data.substr(t, 3),
|
|
926
|
+
n = this.data.substr(t, 3), u = parseInt(n, 10), e.put(u, 10);
|
|
925
927
|
const a = this.data.length - t;
|
|
926
|
-
a > 0 && (n = this.data.substr(t),
|
|
928
|
+
a > 0 && (n = this.data.substr(t), u = parseInt(n, 10), e.put(u, a * 3 + 1));
|
|
927
929
|
}, ct = o, ct;
|
|
928
930
|
}
|
|
929
931
|
var ft, zt;
|
|
@@ -989,8 +991,8 @@ function ye() {
|
|
|
989
991
|
}, i.prototype.write = function(t) {
|
|
990
992
|
let n;
|
|
991
993
|
for (n = 0; n + 2 <= this.data.length; n += 2) {
|
|
992
|
-
let
|
|
993
|
-
|
|
994
|
+
let u = o.indexOf(this.data[n]) * 45;
|
|
995
|
+
u += o.indexOf(this.data[n + 1]), t.put(u, 11);
|
|
994
996
|
}
|
|
995
997
|
this.data.length % 2 && t.put(o.indexOf(this.data[n]), 6);
|
|
996
998
|
}, ft = i, ft;
|
|
@@ -1050,16 +1052,16 @@ function pe() {
|
|
|
1050
1052
|
return Ht || (Ht = 1, function(r) {
|
|
1051
1053
|
var o = {
|
|
1052
1054
|
single_source_shortest_paths: function(i, e, t) {
|
|
1053
|
-
var n = {},
|
|
1054
|
-
|
|
1055
|
+
var n = {}, u = {};
|
|
1056
|
+
u[e] = 0;
|
|
1055
1057
|
var a = o.PriorityQueue.make();
|
|
1056
1058
|
a.push(e, 0);
|
|
1057
|
-
for (var
|
|
1058
|
-
|
|
1059
|
+
for (var s, c, d, p, h, f, I, N, b; !a.empty(); ) {
|
|
1060
|
+
s = a.pop(), c = s.value, p = s.cost, h = i[c] || {};
|
|
1059
1061
|
for (d in h)
|
|
1060
|
-
h.hasOwnProperty(d) && (f = h[d],
|
|
1062
|
+
h.hasOwnProperty(d) && (f = h[d], I = p + f, N = u[d], b = typeof u[d] > "u", (b || N > I) && (u[d] = I, a.push(d, I), n[d] = c));
|
|
1061
1063
|
}
|
|
1062
|
-
if (typeof t < "u" && typeof
|
|
1064
|
+
if (typeof t < "u" && typeof u[t] > "u") {
|
|
1063
1065
|
var R = ["Could not find a path from ", e, " to ", t, "."].join("");
|
|
1064
1066
|
throw new Error(R);
|
|
1065
1067
|
}
|
|
@@ -1113,29 +1115,29 @@ function pe() {
|
|
|
1113
1115
|
r.exports = o;
|
|
1114
1116
|
}(gt)), gt.exports;
|
|
1115
1117
|
}
|
|
1116
|
-
var
|
|
1118
|
+
var Ot;
|
|
1117
1119
|
function Be() {
|
|
1118
|
-
return
|
|
1119
|
-
const o = F(), i = we(), e = ye(), t = Ce(), n = Ee(),
|
|
1120
|
+
return Ot || (Ot = 1, function(r) {
|
|
1121
|
+
const o = F(), i = we(), e = ye(), t = Ce(), n = Ee(), u = Zt(), a = U(), s = pe();
|
|
1120
1122
|
function c(R) {
|
|
1121
1123
|
return unescape(encodeURIComponent(R)).length;
|
|
1122
1124
|
}
|
|
1123
1125
|
function d(R, M, T) {
|
|
1124
1126
|
const B = [];
|
|
1125
|
-
let
|
|
1126
|
-
for (; (
|
|
1127
|
+
let S;
|
|
1128
|
+
for (; (S = R.exec(T)) !== null; )
|
|
1127
1129
|
B.push({
|
|
1128
|
-
data:
|
|
1129
|
-
index:
|
|
1130
|
+
data: S[0],
|
|
1131
|
+
index: S.index,
|
|
1130
1132
|
mode: M,
|
|
1131
|
-
length:
|
|
1133
|
+
length: S[0].length
|
|
1132
1134
|
});
|
|
1133
1135
|
return B;
|
|
1134
1136
|
}
|
|
1135
1137
|
function p(R) {
|
|
1136
|
-
const M = d(
|
|
1137
|
-
let B,
|
|
1138
|
-
return a.isKanjiModeEnabled() ? (B = d(
|
|
1138
|
+
const M = d(u.NUMERIC, o.NUMERIC, R), T = d(u.ALPHANUMERIC, o.ALPHANUMERIC, R);
|
|
1139
|
+
let B, S;
|
|
1140
|
+
return a.isKanjiModeEnabled() ? (B = d(u.BYTE, o.BYTE, R), S = d(u.KANJI, o.KANJI, R)) : (B = d(u.BYTE_KANJI, o.BYTE, R), S = []), M.concat(T, B, S).sort(function(C, y) {
|
|
1139
1141
|
return C.index - y.index;
|
|
1140
1142
|
}).map(function(C) {
|
|
1141
1143
|
return {
|
|
@@ -1163,7 +1165,7 @@ function Be() {
|
|
|
1163
1165
|
return B && B.mode === T.mode ? (M[M.length - 1].data += T.data, M) : (M.push(T), M);
|
|
1164
1166
|
}, []);
|
|
1165
1167
|
}
|
|
1166
|
-
function
|
|
1168
|
+
function I(R) {
|
|
1167
1169
|
const M = [];
|
|
1168
1170
|
for (let T = 0; T < R.length; T++) {
|
|
1169
1171
|
const B = R[T];
|
|
@@ -1195,26 +1197,26 @@ function Be() {
|
|
|
1195
1197
|
}
|
|
1196
1198
|
return M;
|
|
1197
1199
|
}
|
|
1198
|
-
function
|
|
1200
|
+
function N(R, M) {
|
|
1199
1201
|
const T = {}, B = { start: {} };
|
|
1200
|
-
let
|
|
1202
|
+
let S = ["start"];
|
|
1201
1203
|
for (let g = 0; g < R.length; g++) {
|
|
1202
1204
|
const C = R[g], y = [];
|
|
1203
1205
|
for (let l = 0; l < C.length; l++) {
|
|
1204
1206
|
const A = C[l], m = "" + g + l;
|
|
1205
1207
|
y.push(m), T[m] = { node: A, lastCount: 0 }, B[m] = {};
|
|
1206
|
-
for (let E = 0; E <
|
|
1207
|
-
const w =
|
|
1208
|
+
for (let E = 0; E < S.length; E++) {
|
|
1209
|
+
const w = S[E];
|
|
1208
1210
|
T[w] && T[w].node.mode === A.mode ? (B[w][m] = h(T[w].lastCount + A.length, A.mode) - h(T[w].lastCount, A.mode), T[w].lastCount += A.length) : (T[w] && (T[w].lastCount = A.length), B[w][m] = h(A.length, A.mode) + 4 + o.getCharCountIndicator(A.mode, M));
|
|
1209
1211
|
}
|
|
1210
1212
|
}
|
|
1211
|
-
|
|
1213
|
+
S = y;
|
|
1212
1214
|
}
|
|
1213
|
-
for (let g = 0; g <
|
|
1214
|
-
B[
|
|
1215
|
+
for (let g = 0; g < S.length; g++)
|
|
1216
|
+
B[S[g]].end = 0;
|
|
1215
1217
|
return { map: B, table: T };
|
|
1216
1218
|
}
|
|
1217
|
-
function
|
|
1219
|
+
function b(R, M) {
|
|
1218
1220
|
let T;
|
|
1219
1221
|
const B = o.getBestModeForData(R);
|
|
1220
1222
|
if (T = o.from(M, B), T !== o.BYTE && T.bit < B.bit)
|
|
@@ -1233,10 +1235,10 @@ function Be() {
|
|
|
1233
1235
|
}
|
|
1234
1236
|
r.fromArray = function(M) {
|
|
1235
1237
|
return M.reduce(function(T, B) {
|
|
1236
|
-
return typeof B == "string" ? T.push(
|
|
1238
|
+
return typeof B == "string" ? T.push(b(B, null)) : B.data && T.push(b(B.data, B.mode)), T;
|
|
1237
1239
|
}, []);
|
|
1238
1240
|
}, r.fromString = function(M, T) {
|
|
1239
|
-
const B = p(M, a.isKanjiModeEnabled()),
|
|
1241
|
+
const B = p(M, a.isKanjiModeEnabled()), S = I(B), g = N(S, T), C = s.find_path(g.map, "start", "end"), y = [];
|
|
1240
1242
|
for (let l = 1; l < C.length - 1; l++)
|
|
1241
1243
|
y.push(g.table[C[l]].node);
|
|
1242
1244
|
return r.fromArray(f(y));
|
|
@@ -1247,29 +1249,29 @@ function Be() {
|
|
|
1247
1249
|
};
|
|
1248
1250
|
}(at)), at;
|
|
1249
1251
|
}
|
|
1250
|
-
var
|
|
1252
|
+
var jt;
|
|
1251
1253
|
function Ae() {
|
|
1252
|
-
if (
|
|
1253
|
-
|
|
1254
|
-
const r = U(), o = yt(), i =
|
|
1254
|
+
if (jt) return $;
|
|
1255
|
+
jt = 1;
|
|
1256
|
+
const r = U(), o = yt(), i = ue(), e = se(), t = ae(), n = ce(), u = fe(), a = $t(), s = ge(), c = he(), d = me(), p = F(), h = Be();
|
|
1255
1257
|
function f(g, C) {
|
|
1256
1258
|
const y = g.size, l = n.getPositions(C);
|
|
1257
1259
|
for (let A = 0; A < l.length; A++) {
|
|
1258
1260
|
const m = l[A][0], E = l[A][1];
|
|
1259
1261
|
for (let w = -1; w <= 7; w++)
|
|
1260
1262
|
if (!(m + w <= -1 || y <= m + w))
|
|
1261
|
-
for (let
|
|
1262
|
-
E +
|
|
1263
|
+
for (let P = -1; P <= 7; P++)
|
|
1264
|
+
E + P <= -1 || y <= E + P || (w >= 0 && w <= 6 && (P === 0 || P === 6) || P >= 0 && P <= 6 && (w === 0 || w === 6) || w >= 2 && w <= 4 && P >= 2 && P <= 4 ? g.set(m + w, E + P, !0, !0) : g.set(m + w, E + P, !1, !0));
|
|
1263
1265
|
}
|
|
1264
1266
|
}
|
|
1265
|
-
function
|
|
1267
|
+
function I(g) {
|
|
1266
1268
|
const C = g.size;
|
|
1267
1269
|
for (let y = 8; y < C - 8; y++) {
|
|
1268
1270
|
const l = y % 2 === 0;
|
|
1269
1271
|
g.set(y, 6, l, !0), g.set(6, y, l, !0);
|
|
1270
1272
|
}
|
|
1271
1273
|
}
|
|
1272
|
-
function
|
|
1274
|
+
function N(g, C) {
|
|
1273
1275
|
const y = t.getPositions(C);
|
|
1274
1276
|
for (let l = 0; l < y.length; l++) {
|
|
1275
1277
|
const A = y[l][0], m = y[l][1];
|
|
@@ -1278,7 +1280,7 @@ function Ae() {
|
|
|
1278
1280
|
E === -2 || E === 2 || w === -2 || w === 2 || E === 0 && w === 0 ? g.set(A + E, m + w, !0, !0) : g.set(A + E, m + w, !1, !0);
|
|
1279
1281
|
}
|
|
1280
1282
|
}
|
|
1281
|
-
function
|
|
1283
|
+
function b(g, C) {
|
|
1282
1284
|
const y = g.size, l = c.getEncodedBits(C);
|
|
1283
1285
|
let A, m, E;
|
|
1284
1286
|
for (let w = 0; w < 18; w++)
|
|
@@ -1296,10 +1298,10 @@ function Ae() {
|
|
|
1296
1298
|
let l = -1, A = y - 1, m = 7, E = 0;
|
|
1297
1299
|
for (let w = y - 1; w > 0; w -= 2)
|
|
1298
1300
|
for (w === 6 && w--; ; ) {
|
|
1299
|
-
for (let
|
|
1300
|
-
if (!g.isReserved(A, w -
|
|
1301
|
+
for (let P = 0; P < 2; P++)
|
|
1302
|
+
if (!g.isReserved(A, w - P)) {
|
|
1301
1303
|
let v = !1;
|
|
1302
|
-
E < C.length && (v = (C[E] >>> m & 1) === 1), g.set(A, w -
|
|
1304
|
+
E < C.length && (v = (C[E] >>> m & 1) === 1), g.set(A, w - P, v), m--, m === -1 && (E++, m = 7);
|
|
1303
1305
|
}
|
|
1304
1306
|
if (A += l, A < 0 || y <= A) {
|
|
1305
1307
|
A -= l, l = -l;
|
|
@@ -1309,30 +1311,30 @@ function Ae() {
|
|
|
1309
1311
|
}
|
|
1310
1312
|
function T(g, C, y) {
|
|
1311
1313
|
const l = new i();
|
|
1312
|
-
y.forEach(function(
|
|
1313
|
-
l.put(
|
|
1314
|
+
y.forEach(function(P) {
|
|
1315
|
+
l.put(P.mode.bit, 4), l.put(P.getLength(), p.getCharCountIndicator(P.mode, g)), P.write(l);
|
|
1314
1316
|
});
|
|
1315
1317
|
const A = r.getSymbolTotalCodewords(g), m = a.getTotalCodewordsCount(g, C), E = (A - m) * 8;
|
|
1316
1318
|
for (l.getLengthInBits() + 4 <= E && l.put(0, 4); l.getLengthInBits() % 8 !== 0; )
|
|
1317
1319
|
l.putBit(0);
|
|
1318
1320
|
const w = (E - l.getLengthInBits()) / 8;
|
|
1319
|
-
for (let
|
|
1320
|
-
l.put(
|
|
1321
|
+
for (let P = 0; P < w; P++)
|
|
1322
|
+
l.put(P % 2 ? 17 : 236, 8);
|
|
1321
1323
|
return B(l, g, C);
|
|
1322
1324
|
}
|
|
1323
1325
|
function B(g, C, y) {
|
|
1324
|
-
const l = r.getSymbolTotalCodewords(C), A = a.getTotalCodewordsCount(C, y), m = l - A, E = a.getBlocksCount(C, y), w = l % E,
|
|
1325
|
-
let O = 0;
|
|
1326
|
-
const H = new Array(E), Et = new Array(E);
|
|
1326
|
+
const l = r.getSymbolTotalCodewords(C), A = a.getTotalCodewordsCount(C, y), m = l - A, E = a.getBlocksCount(C, y), w = l % E, P = E - w, v = Math.floor(l / E), V = Math.floor(m / E), te = V + 1, Ct = v - V, ee = new s(Ct);
|
|
1327
1327
|
let j = 0;
|
|
1328
|
+
const H = new Array(E), Et = new Array(E);
|
|
1329
|
+
let J = 0;
|
|
1328
1330
|
const ne = new Uint8Array(g.buffer);
|
|
1329
1331
|
for (let k = 0; k < E; k++) {
|
|
1330
|
-
const G = k <
|
|
1331
|
-
H[k] = ne.slice(
|
|
1332
|
+
const G = k < P ? V : te;
|
|
1333
|
+
H[k] = ne.slice(j, j + G), Et[k] = ee.encode(H[k]), j += G, J = Math.max(J, G);
|
|
1332
1334
|
}
|
|
1333
1335
|
const Y = new Uint8Array(l);
|
|
1334
1336
|
let pt = 0, D, q;
|
|
1335
|
-
for (D = 0; D <
|
|
1337
|
+
for (D = 0; D < J; D++)
|
|
1336
1338
|
for (q = 0; q < E; q++)
|
|
1337
1339
|
D < H[q].length && (Y[pt++] = H[q][D]);
|
|
1338
1340
|
for (D = 0; D < Ct; D++)
|
|
@@ -1340,7 +1342,7 @@ function Ae() {
|
|
|
1340
1342
|
Y[pt++] = Et[q][D];
|
|
1341
1343
|
return Y;
|
|
1342
1344
|
}
|
|
1343
|
-
function
|
|
1345
|
+
function S(g, C, y, l) {
|
|
1344
1346
|
let A;
|
|
1345
1347
|
if (Array.isArray(g))
|
|
1346
1348
|
A = h.fromArray(g);
|
|
@@ -1365,12 +1367,12 @@ The chosen QR Code version cannot contain this amount of data.
|
|
|
1365
1367
|
Minimum version required to store current data is: ` + m + `.
|
|
1366
1368
|
`
|
|
1367
1369
|
);
|
|
1368
|
-
const E = T(C, y, A), w = r.getSymbolSize(C),
|
|
1369
|
-
return f(
|
|
1370
|
-
|
|
1371
|
-
R.bind(null,
|
|
1372
|
-
)),
|
|
1373
|
-
modules:
|
|
1370
|
+
const E = T(C, y, A), w = r.getSymbolSize(C), P = new e(w);
|
|
1371
|
+
return f(P, C), I(P), N(P, C), R(P, y, 0), C >= 7 && b(P, C), M(P, E), isNaN(l) && (l = u.getBestMask(
|
|
1372
|
+
P,
|
|
1373
|
+
R.bind(null, P, y)
|
|
1374
|
+
)), u.applyMask(l, P), R(P, y, l), {
|
|
1375
|
+
modules: P,
|
|
1374
1376
|
version: C,
|
|
1375
1377
|
errorCorrectionLevel: y,
|
|
1376
1378
|
maskPattern: l,
|
|
@@ -1381,12 +1383,12 @@ Minimum version required to store current data is: ` + m + `.
|
|
|
1381
1383
|
if (typeof C > "u" || C === "")
|
|
1382
1384
|
throw new Error("No input text");
|
|
1383
1385
|
let l = o.M, A, m;
|
|
1384
|
-
return typeof y < "u" && (l = o.from(y.errorCorrectionLevel, o.M), A = c.from(y.version), m =
|
|
1386
|
+
return typeof y < "u" && (l = o.from(y.errorCorrectionLevel, o.M), A = c.from(y.version), m = u.from(y.maskPattern), y.toSJISFunc && r.setToSJISFunction(y.toSJISFunc)), S(C, A, l, m);
|
|
1385
1387
|
}, $;
|
|
1386
1388
|
}
|
|
1387
|
-
var ht = {}, mt = {},
|
|
1389
|
+
var ht = {}, mt = {}, Jt;
|
|
1388
1390
|
function Xt() {
|
|
1389
|
-
return
|
|
1391
|
+
return Jt || (Jt = 1, function(r) {
|
|
1390
1392
|
function o(i) {
|
|
1391
1393
|
if (typeof i == "number" && (i = i.toString()), typeof i != "string")
|
|
1392
1394
|
throw new Error("Color should be defined as hex string");
|
|
@@ -1407,10 +1409,10 @@ function Xt() {
|
|
|
1407
1409
|
}
|
|
1408
1410
|
r.getOptions = function(e) {
|
|
1409
1411
|
e || (e = {}), e.color || (e.color = {});
|
|
1410
|
-
const t = typeof e.margin > "u" || e.margin === null || e.margin < 0 ? 4 : e.margin, n = e.width && e.width >= 21 ? e.width : void 0,
|
|
1412
|
+
const t = typeof e.margin > "u" || e.margin === null || e.margin < 0 ? 4 : e.margin, n = e.width && e.width >= 21 ? e.width : void 0, u = e.scale || 4;
|
|
1411
1413
|
return {
|
|
1412
1414
|
width: n,
|
|
1413
|
-
scale: n ? 4 :
|
|
1415
|
+
scale: n ? 4 : u,
|
|
1414
1416
|
margin: t,
|
|
1415
1417
|
color: {
|
|
1416
1418
|
dark: o(e.color.dark || "#000000ff"),
|
|
@@ -1425,15 +1427,15 @@ function Xt() {
|
|
|
1425
1427
|
const n = r.getScale(e, t);
|
|
1426
1428
|
return Math.floor((e + t.margin * 2) * n);
|
|
1427
1429
|
}, r.qrToImageData = function(e, t, n) {
|
|
1428
|
-
const
|
|
1430
|
+
const u = t.modules.size, a = t.modules.data, s = r.getScale(u, n), c = Math.floor((u + n.margin * 2) * s), d = n.margin * s, p = [n.color.light, n.color.dark];
|
|
1429
1431
|
for (let h = 0; h < c; h++)
|
|
1430
1432
|
for (let f = 0; f < c; f++) {
|
|
1431
|
-
let
|
|
1433
|
+
let I = (h * c + f) * 4, N = n.color.light;
|
|
1432
1434
|
if (h >= d && f >= d && h < c - d && f < c - d) {
|
|
1433
|
-
const
|
|
1434
|
-
|
|
1435
|
+
const b = Math.floor((h - d) / s), R = Math.floor((f - d) / s);
|
|
1436
|
+
N = p[a[b * u + R] ? 1 : 0];
|
|
1435
1437
|
}
|
|
1436
|
-
e[
|
|
1438
|
+
e[I++] = N.r, e[I++] = N.g, e[I++] = N.b, e[I] = N.a;
|
|
1437
1439
|
}
|
|
1438
1440
|
};
|
|
1439
1441
|
}(mt)), mt;
|
|
@@ -1442,8 +1444,8 @@ var Yt;
|
|
|
1442
1444
|
function Re() {
|
|
1443
1445
|
return Yt || (Yt = 1, function(r) {
|
|
1444
1446
|
const o = Xt();
|
|
1445
|
-
function i(t, n,
|
|
1446
|
-
t.clearRect(0, 0, n.width, n.height), n.style || (n.style = {}), n.height =
|
|
1447
|
+
function i(t, n, u) {
|
|
1448
|
+
t.clearRect(0, 0, n.width, n.height), n.style || (n.style = {}), n.height = u, n.width = u, n.style.height = u + "px", n.style.width = u + "px";
|
|
1447
1449
|
}
|
|
1448
1450
|
function e() {
|
|
1449
1451
|
try {
|
|
@@ -1452,15 +1454,15 @@ function Re() {
|
|
|
1452
1454
|
throw new Error("You need to specify a canvas element");
|
|
1453
1455
|
}
|
|
1454
1456
|
}
|
|
1455
|
-
r.render = function(n,
|
|
1456
|
-
let
|
|
1457
|
-
typeof
|
|
1458
|
-
const d = o.getImageWidth(n.modules.size,
|
|
1459
|
-
return o.qrToImageData(h.data, n,
|
|
1460
|
-
}, r.renderToDataURL = function(n,
|
|
1461
|
-
let
|
|
1462
|
-
typeof
|
|
1463
|
-
const c = r.render(n,
|
|
1457
|
+
r.render = function(n, u, a) {
|
|
1458
|
+
let s = a, c = u;
|
|
1459
|
+
typeof s > "u" && (!u || !u.getContext) && (s = u, u = void 0), u || (c = e()), s = o.getOptions(s);
|
|
1460
|
+
const d = o.getImageWidth(n.modules.size, s), p = c.getContext("2d"), h = p.createImageData(d, d);
|
|
1461
|
+
return o.qrToImageData(h.data, n, s), i(p, c, d), p.putImageData(h, 0, 0), c;
|
|
1462
|
+
}, r.renderToDataURL = function(n, u, a) {
|
|
1463
|
+
let s = a;
|
|
1464
|
+
typeof s > "u" && (!u || !u.getContext) && (s = u, u = void 0), s || (s = {});
|
|
1465
|
+
const c = r.render(n, u, s), d = s.type || "image/png", p = s.rendererOpts || {};
|
|
1464
1466
|
return c.toDataURL(d, p.quality);
|
|
1465
1467
|
};
|
|
1466
1468
|
}(ht)), ht;
|
|
@@ -1471,68 +1473,68 @@ function Te() {
|
|
|
1471
1473
|
Gt = 1;
|
|
1472
1474
|
const r = Xt();
|
|
1473
1475
|
function o(t, n) {
|
|
1474
|
-
const
|
|
1475
|
-
return
|
|
1476
|
+
const u = t.a / 255, a = n + '="' + t.hex + '"';
|
|
1477
|
+
return u < 1 ? a + " " + n + '-opacity="' + u.toFixed(2).slice(1) + '"' : a;
|
|
1476
1478
|
}
|
|
1477
|
-
function i(t, n,
|
|
1479
|
+
function i(t, n, u) {
|
|
1478
1480
|
let a = t + n;
|
|
1479
|
-
return typeof
|
|
1481
|
+
return typeof u < "u" && (a += " " + u), a;
|
|
1480
1482
|
}
|
|
1481
|
-
function e(t, n,
|
|
1482
|
-
let a = "",
|
|
1483
|
+
function e(t, n, u) {
|
|
1484
|
+
let a = "", s = 0, c = !1, d = 0;
|
|
1483
1485
|
for (let p = 0; p < t.length; p++) {
|
|
1484
1486
|
const h = Math.floor(p % n), f = Math.floor(p / n);
|
|
1485
|
-
!h && !c && (c = !0), t[p] ? (d++, p > 0 && h > 0 && t[p - 1] || (a += c ? i("M", h +
|
|
1487
|
+
!h && !c && (c = !0), t[p] ? (d++, p > 0 && h > 0 && t[p - 1] || (a += c ? i("M", h + u, 0.5 + f + u) : i("m", s, 0), s = 0, c = !1), h + 1 < n && t[p + 1] || (a += i("h", d), d = 0)) : s++;
|
|
1486
1488
|
}
|
|
1487
1489
|
return a;
|
|
1488
1490
|
}
|
|
1489
|
-
return wt.render = function(n,
|
|
1490
|
-
const
|
|
1491
|
+
return wt.render = function(n, u, a) {
|
|
1492
|
+
const s = r.getOptions(u), c = n.modules.size, d = n.modules.data, p = c + s.margin * 2, h = s.color.light.a ? "<path " + o(s.color.light, "fill") + ' d="M0 0h' + p + "v" + p + 'H0z"/>' : "", f = "<path " + o(s.color.dark, "stroke") + ' d="' + e(d, c, s.margin) + '"/>', I = 'viewBox="0 0 ' + p + " " + p + '"', b = '<svg xmlns="http://www.w3.org/2000/svg" ' + (s.width ? 'width="' + s.width + '" height="' + s.width + '" ' : "") + I + ' shape-rendering="crispEdges">' + h + f + `</svg>
|
|
1491
1493
|
`;
|
|
1492
|
-
return typeof a == "function" && a(null,
|
|
1494
|
+
return typeof a == "function" && a(null, b), b;
|
|
1493
1495
|
}, wt;
|
|
1494
1496
|
}
|
|
1495
1497
|
var Qt;
|
|
1496
|
-
function
|
|
1498
|
+
function Pe() {
|
|
1497
1499
|
if (Qt) return z;
|
|
1498
1500
|
Qt = 1;
|
|
1499
1501
|
const r = ie(), o = Ae(), i = Re(), e = Te();
|
|
1500
|
-
function t(n,
|
|
1502
|
+
function t(n, u, a, s, c) {
|
|
1501
1503
|
const d = [].slice.call(arguments, 1), p = d.length, h = typeof d[p - 1] == "function";
|
|
1502
1504
|
if (!h && !r())
|
|
1503
1505
|
throw new Error("Callback required as last argument");
|
|
1504
1506
|
if (h) {
|
|
1505
1507
|
if (p < 2)
|
|
1506
1508
|
throw new Error("Too few arguments provided");
|
|
1507
|
-
p === 2 ? (c = a, a =
|
|
1509
|
+
p === 2 ? (c = a, a = u, u = s = void 0) : p === 3 && (u.getContext && typeof c > "u" ? (c = s, s = void 0) : (c = s, s = a, a = u, u = void 0));
|
|
1508
1510
|
} else {
|
|
1509
1511
|
if (p < 1)
|
|
1510
1512
|
throw new Error("Too few arguments provided");
|
|
1511
|
-
return p === 1 ? (a =
|
|
1513
|
+
return p === 1 ? (a = u, u = s = void 0) : p === 2 && !u.getContext && (s = a, a = u, u = void 0), new Promise(function(f, I) {
|
|
1512
1514
|
try {
|
|
1513
|
-
const
|
|
1514
|
-
f(n(
|
|
1515
|
-
} catch (
|
|
1516
|
-
N
|
|
1515
|
+
const N = o.create(a, s);
|
|
1516
|
+
f(n(N, u, s));
|
|
1517
|
+
} catch (N) {
|
|
1518
|
+
I(N);
|
|
1517
1519
|
}
|
|
1518
1520
|
});
|
|
1519
1521
|
}
|
|
1520
1522
|
try {
|
|
1521
|
-
const f = o.create(a,
|
|
1522
|
-
c(null, n(f,
|
|
1523
|
+
const f = o.create(a, s);
|
|
1524
|
+
c(null, n(f, u, s));
|
|
1523
1525
|
} catch (f) {
|
|
1524
1526
|
c(f);
|
|
1525
1527
|
}
|
|
1526
1528
|
}
|
|
1527
|
-
return z.create = o.create, z.toCanvas = t.bind(null, i.render), z.toDataURL = t.bind(null, i.renderToDataURL), z.toString = t.bind(null, function(n,
|
|
1529
|
+
return z.create = o.create, z.toCanvas = t.bind(null, i.render), z.toDataURL = t.bind(null, i.renderToDataURL), z.toString = t.bind(null, function(n, u, a) {
|
|
1528
1530
|
return e.render(n, a);
|
|
1529
1531
|
}), z;
|
|
1530
1532
|
}
|
|
1531
|
-
var xt =
|
|
1532
|
-
const
|
|
1533
|
+
var xt = Pe();
|
|
1534
|
+
const Ie = /* @__PURE__ */ oe(xt), Ne = /* @__PURE__ */ re({
|
|
1533
1535
|
__proto__: null,
|
|
1534
|
-
default:
|
|
1536
|
+
default: Ie
|
|
1535
1537
|
}, [xt]);
|
|
1536
1538
|
export {
|
|
1537
|
-
|
|
1539
|
+
Ne as b
|
|
1538
1540
|
};
|