@virtualdisplay.io/client 4.0.0-alpha.30 → 4.0.0-alpha.33

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.
@@ -1,1540 +0,0 @@
1
- function re(r, o) {
2
- for (var i = 0; i < o.length; i++) {
3
- const e = o[i];
4
- if (typeof e != "string" && !Array.isArray(e)) {
5
- for (const t in e)
6
- if (t !== "default" && !(t in r)) {
7
- const n = Object.getOwnPropertyDescriptor(e, t);
8
- n && Object.defineProperty(r, t, n.get ? n : {
9
- enumerable: !0,
10
- get: () => e[t]
11
- });
12
- }
13
- }
14
- }
15
- return Object.freeze(Object.defineProperty(r, Symbol.toStringTag, { value: "Module" }));
16
- }
17
- function oe(r) {
18
- return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
19
- }
20
- var z = {}, Q, Bt;
21
- function ie() {
22
- return Bt || (Bt = 1, Q = function() {
23
- return typeof Promise == "function" && Promise.prototype && Promise.prototype.then;
24
- }), Q;
25
- }
26
- var $ = {}, _ = {}, At;
27
- function U() {
28
- if (At) return _;
29
- At = 1;
30
- let r;
31
- const o = [
32
- 0,
33
- // Not used
34
- 26,
35
- 44,
36
- 70,
37
- 100,
38
- 134,
39
- 172,
40
- 196,
41
- 242,
42
- 292,
43
- 346,
44
- 404,
45
- 466,
46
- 532,
47
- 581,
48
- 655,
49
- 733,
50
- 815,
51
- 901,
52
- 991,
53
- 1085,
54
- 1156,
55
- 1258,
56
- 1364,
57
- 1474,
58
- 1588,
59
- 1706,
60
- 1828,
61
- 1921,
62
- 2051,
63
- 2185,
64
- 2323,
65
- 2465,
66
- 2611,
67
- 2761,
68
- 2876,
69
- 3034,
70
- 3196,
71
- 3362,
72
- 3532,
73
- 3706
74
- ];
75
- return _.getSymbolSize = function(e) {
76
- if (!e) throw new Error('"version" cannot be null or undefined');
77
- if (e < 1 || e > 40) throw new Error('"version" should be in range from 1 to 40');
78
- return e * 4 + 17;
79
- }, _.getSymbolTotalCodewords = function(e) {
80
- return o[e];
81
- }, _.getBCHDigit = function(i) {
82
- let e = 0;
83
- for (; i !== 0; )
84
- e++, i >>>= 1;
85
- return e;
86
- }, _.setToSJISFunction = function(e) {
87
- if (typeof e != "function")
88
- throw new Error('"toSJISFunc" is not a valid function.');
89
- r = e;
90
- }, _.isKanjiModeEnabled = function() {
91
- return typeof r < "u";
92
- }, _.toSJIS = function(e) {
93
- return r(e);
94
- }, _;
95
- }
96
- var W = {}, Rt;
97
- function yt() {
98
- return Rt || (Rt = 1, (function(r) {
99
- r.L = { bit: 1 }, r.M = { bit: 0 }, r.Q = { bit: 3 }, r.H = { bit: 2 };
100
- function o(i) {
101
- if (typeof i != "string")
102
- throw new Error("Param is not a string");
103
- switch (i.toLowerCase()) {
104
- case "l":
105
- case "low":
106
- return r.L;
107
- case "m":
108
- case "medium":
109
- return r.M;
110
- case "q":
111
- case "quartile":
112
- return r.Q;
113
- case "h":
114
- case "high":
115
- return r.H;
116
- default:
117
- throw new Error("Unknown EC Level: " + i);
118
- }
119
- }
120
- r.isValid = function(e) {
121
- return e && typeof e.bit < "u" && e.bit >= 0 && e.bit < 4;
122
- }, r.from = function(e, t) {
123
- if (r.isValid(e))
124
- return e;
125
- try {
126
- return o(e);
127
- } catch {
128
- return t;
129
- }
130
- };
131
- })(W)), W;
132
- }
133
- var Z, Tt;
134
- function ue() {
135
- if (Tt) return Z;
136
- Tt = 1;
137
- function r() {
138
- this.buffer = [], this.length = 0;
139
- }
140
- return r.prototype = {
141
- get: function(o) {
142
- const i = Math.floor(o / 8);
143
- return (this.buffer[i] >>> 7 - o % 8 & 1) === 1;
144
- },
145
- put: function(o, i) {
146
- for (let e = 0; e < i; e++)
147
- this.putBit((o >>> i - e - 1 & 1) === 1);
148
- },
149
- getLengthInBits: function() {
150
- return this.length;
151
- },
152
- putBit: function(o) {
153
- const i = Math.floor(this.length / 8);
154
- this.buffer.length <= i && this.buffer.push(0), o && (this.buffer[i] |= 128 >>> this.length % 8), this.length++;
155
- }
156
- }, Z = r, Z;
157
- }
158
- var X, Pt;
159
- function se() {
160
- if (Pt) return X;
161
- Pt = 1;
162
- function r(o) {
163
- if (!o || o < 1)
164
- throw new Error("BitMatrix size must be defined and greater than 0");
165
- this.size = o, this.data = new Uint8Array(o * o), this.reservedBit = new Uint8Array(o * o);
166
- }
167
- return r.prototype.set = function(o, i, e, t) {
168
- const n = o * this.size + i;
169
- this.data[n] = e, t && (this.reservedBit[n] = !0);
170
- }, r.prototype.get = function(o, i) {
171
- return this.data[o * this.size + i];
172
- }, r.prototype.xor = function(o, i, e) {
173
- this.data[o * this.size + i] ^= e;
174
- }, r.prototype.isReserved = function(o, i) {
175
- return this.reservedBit[o * this.size + i];
176
- }, X = r, X;
177
- }
178
- var x = {}, It;
179
- function ae() {
180
- return It || (It = 1, (function(r) {
181
- const o = U().getSymbolSize;
182
- r.getRowColCoords = function(e) {
183
- if (e === 1) return [];
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;
187
- return a.push(6), a.reverse();
188
- }, r.getPositions = function(e) {
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]]);
195
- return t;
196
- };
197
- })(x)), x;
198
- }
199
- var tt = {}, Nt;
200
- function ce() {
201
- if (Nt) return tt;
202
- Nt = 1;
203
- const r = U().getSymbolSize, o = 7;
204
- return tt.getPositions = function(e) {
205
- const t = r(e);
206
- return [
207
- // top-left
208
- [0, 0],
209
- // top-right
210
- [t - o, 0],
211
- // bottom-left
212
- [0, t - o]
213
- ];
214
- }, tt;
215
- }
216
- var et = {}, Mt;
217
- function fe() {
218
- return Mt || (Mt = 1, (function(r) {
219
- r.Patterns = {
220
- PATTERN000: 0,
221
- PATTERN001: 1,
222
- PATTERN010: 2,
223
- PATTERN011: 3,
224
- PATTERN100: 4,
225
- PATTERN101: 5,
226
- PATTERN110: 6,
227
- PATTERN111: 7
228
- };
229
- const o = {
230
- N1: 3,
231
- N2: 3,
232
- N3: 40,
233
- N4: 10
234
- };
235
- r.isValid = function(t) {
236
- return t != null && t !== "" && !isNaN(t) && t >= 0 && t <= 7;
237
- }, r.from = function(t) {
238
- return r.isValid(t) ? parseInt(t, 10) : void 0;
239
- }, r.getPenaltyN1 = function(t) {
240
- const n = t.size;
241
- let u = 0, a = 0, s = 0, c = null, d = null;
242
- for (let p = 0; p < n; p++) {
243
- a = s = 0, c = d = null;
244
- for (let h = 0; h < n; h++) {
245
- let f = t.get(p, h);
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);
247
- }
248
- a >= 5 && (u += o.N1 + (a - 5)), s >= 5 && (u += o.N1 + (s - 5));
249
- }
250
- return u;
251
- }, r.getPenaltyN2 = function(t) {
252
- const n = t.size;
253
- let u = 0;
254
- for (let a = 0; a < n - 1; a++)
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++;
258
- }
259
- return u * o.N2;
260
- }, r.getPenaltyN3 = function(t) {
261
- const n = t.size;
262
- let u = 0, a = 0, s = 0;
263
- for (let c = 0; c < n; c++) {
264
- a = s = 0;
265
- for (let d = 0; d < n; d++)
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++;
267
- }
268
- return u * o.N3;
269
- }, r.getPenaltyN4 = function(t) {
270
- let n = 0;
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;
274
- };
275
- function i(e, t, n) {
276
- switch (e) {
277
- case r.Patterns.PATTERN000:
278
- return (t + n) % 2 === 0;
279
- case r.Patterns.PATTERN001:
280
- return t % 2 === 0;
281
- case r.Patterns.PATTERN010:
282
- return n % 3 === 0;
283
- case r.Patterns.PATTERN011:
284
- return (t + n) % 3 === 0;
285
- case r.Patterns.PATTERN100:
286
- return (Math.floor(t / 2) + Math.floor(n / 3)) % 2 === 0;
287
- case r.Patterns.PATTERN101:
288
- return t * n % 2 + t * n % 3 === 0;
289
- case r.Patterns.PATTERN110:
290
- return (t * n % 2 + t * n % 3) % 2 === 0;
291
- case r.Patterns.PATTERN111:
292
- return (t * n % 3 + (t + n) % 2) % 2 === 0;
293
- default:
294
- throw new Error("bad maskPattern:" + e);
295
- }
296
- }
297
- r.applyMask = function(t, n) {
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));
302
- }, r.getBestMask = function(t, n) {
303
- const u = Object.keys(r.Patterns).length;
304
- let a = 0, s = 1 / 0;
305
- for (let c = 0; c < u; c++) {
306
- n(c), r.applyMask(c, t);
307
- const d = r.getPenaltyN1(t) + r.getPenaltyN2(t) + r.getPenaltyN3(t) + r.getPenaltyN4(t);
308
- r.applyMask(c, t), d < s && (s = d, a = c);
309
- }
310
- return a;
311
- };
312
- })(et)), et;
313
- }
314
- var O = {}, bt;
315
- function $t() {
316
- if (bt) return O;
317
- bt = 1;
318
- const r = yt(), o = [
319
- // L M Q H
320
- 1,
321
- 1,
322
- 1,
323
- 1,
324
- 1,
325
- 1,
326
- 1,
327
- 1,
328
- 1,
329
- 1,
330
- 2,
331
- 2,
332
- 1,
333
- 2,
334
- 2,
335
- 4,
336
- 1,
337
- 2,
338
- 4,
339
- 4,
340
- 2,
341
- 4,
342
- 4,
343
- 4,
344
- 2,
345
- 4,
346
- 6,
347
- 5,
348
- 2,
349
- 4,
350
- 6,
351
- 6,
352
- 2,
353
- 5,
354
- 8,
355
- 8,
356
- 4,
357
- 5,
358
- 8,
359
- 8,
360
- 4,
361
- 5,
362
- 8,
363
- 11,
364
- 4,
365
- 8,
366
- 10,
367
- 11,
368
- 4,
369
- 9,
370
- 12,
371
- 16,
372
- 4,
373
- 9,
374
- 16,
375
- 16,
376
- 6,
377
- 10,
378
- 12,
379
- 18,
380
- 6,
381
- 10,
382
- 17,
383
- 16,
384
- 6,
385
- 11,
386
- 16,
387
- 19,
388
- 6,
389
- 13,
390
- 18,
391
- 21,
392
- 7,
393
- 14,
394
- 21,
395
- 25,
396
- 8,
397
- 16,
398
- 20,
399
- 25,
400
- 8,
401
- 17,
402
- 23,
403
- 25,
404
- 9,
405
- 17,
406
- 23,
407
- 34,
408
- 9,
409
- 18,
410
- 25,
411
- 30,
412
- 10,
413
- 20,
414
- 27,
415
- 32,
416
- 12,
417
- 21,
418
- 29,
419
- 35,
420
- 12,
421
- 23,
422
- 34,
423
- 37,
424
- 12,
425
- 25,
426
- 34,
427
- 40,
428
- 13,
429
- 26,
430
- 35,
431
- 42,
432
- 14,
433
- 28,
434
- 38,
435
- 45,
436
- 15,
437
- 29,
438
- 40,
439
- 48,
440
- 16,
441
- 31,
442
- 43,
443
- 51,
444
- 17,
445
- 33,
446
- 45,
447
- 54,
448
- 18,
449
- 35,
450
- 48,
451
- 57,
452
- 19,
453
- 37,
454
- 51,
455
- 60,
456
- 19,
457
- 38,
458
- 53,
459
- 63,
460
- 20,
461
- 40,
462
- 56,
463
- 66,
464
- 21,
465
- 43,
466
- 59,
467
- 70,
468
- 22,
469
- 45,
470
- 62,
471
- 74,
472
- 24,
473
- 47,
474
- 65,
475
- 77,
476
- 25,
477
- 49,
478
- 68,
479
- 81
480
- ], i = [
481
- // L M Q H
482
- 7,
483
- 10,
484
- 13,
485
- 17,
486
- 10,
487
- 16,
488
- 22,
489
- 28,
490
- 15,
491
- 26,
492
- 36,
493
- 44,
494
- 20,
495
- 36,
496
- 52,
497
- 64,
498
- 26,
499
- 48,
500
- 72,
501
- 88,
502
- 36,
503
- 64,
504
- 96,
505
- 112,
506
- 40,
507
- 72,
508
- 108,
509
- 130,
510
- 48,
511
- 88,
512
- 132,
513
- 156,
514
- 60,
515
- 110,
516
- 160,
517
- 192,
518
- 72,
519
- 130,
520
- 192,
521
- 224,
522
- 80,
523
- 150,
524
- 224,
525
- 264,
526
- 96,
527
- 176,
528
- 260,
529
- 308,
530
- 104,
531
- 198,
532
- 288,
533
- 352,
534
- 120,
535
- 216,
536
- 320,
537
- 384,
538
- 132,
539
- 240,
540
- 360,
541
- 432,
542
- 144,
543
- 280,
544
- 408,
545
- 480,
546
- 168,
547
- 308,
548
- 448,
549
- 532,
550
- 180,
551
- 338,
552
- 504,
553
- 588,
554
- 196,
555
- 364,
556
- 546,
557
- 650,
558
- 224,
559
- 416,
560
- 600,
561
- 700,
562
- 224,
563
- 442,
564
- 644,
565
- 750,
566
- 252,
567
- 476,
568
- 690,
569
- 816,
570
- 270,
571
- 504,
572
- 750,
573
- 900,
574
- 300,
575
- 560,
576
- 810,
577
- 960,
578
- 312,
579
- 588,
580
- 870,
581
- 1050,
582
- 336,
583
- 644,
584
- 952,
585
- 1110,
586
- 360,
587
- 700,
588
- 1020,
589
- 1200,
590
- 390,
591
- 728,
592
- 1050,
593
- 1260,
594
- 420,
595
- 784,
596
- 1140,
597
- 1350,
598
- 450,
599
- 812,
600
- 1200,
601
- 1440,
602
- 480,
603
- 868,
604
- 1290,
605
- 1530,
606
- 510,
607
- 924,
608
- 1350,
609
- 1620,
610
- 540,
611
- 980,
612
- 1440,
613
- 1710,
614
- 570,
615
- 1036,
616
- 1530,
617
- 1800,
618
- 570,
619
- 1064,
620
- 1590,
621
- 1890,
622
- 600,
623
- 1120,
624
- 1680,
625
- 1980,
626
- 630,
627
- 1204,
628
- 1770,
629
- 2100,
630
- 660,
631
- 1260,
632
- 1860,
633
- 2220,
634
- 720,
635
- 1316,
636
- 1950,
637
- 2310,
638
- 750,
639
- 1372,
640
- 2040,
641
- 2430
642
- ];
643
- return O.getBlocksCount = function(t, n) {
644
- switch (n) {
645
- case r.L:
646
- return o[(t - 1) * 4 + 0];
647
- case r.M:
648
- return o[(t - 1) * 4 + 1];
649
- case r.Q:
650
- return o[(t - 1) * 4 + 2];
651
- case r.H:
652
- return o[(t - 1) * 4 + 3];
653
- default:
654
- return;
655
- }
656
- }, O.getTotalCodewordsCount = function(t, n) {
657
- switch (n) {
658
- case r.L:
659
- return i[(t - 1) * 4 + 0];
660
- case r.M:
661
- return i[(t - 1) * 4 + 1];
662
- case r.Q:
663
- return i[(t - 1) * 4 + 2];
664
- case r.H:
665
- return i[(t - 1) * 4 + 3];
666
- default:
667
- return;
668
- }
669
- }, O;
670
- }
671
- var nt = {}, K = {}, St;
672
- function le() {
673
- if (St) return K;
674
- St = 1;
675
- const r = new Uint8Array(512), o = new Uint8Array(256);
676
- return (function() {
677
- let e = 1;
678
- for (let t = 0; t < 255; t++)
679
- r[t] = e, o[e] = t, e <<= 1, e & 256 && (e ^= 285);
680
- for (let t = 255; t < 512; t++)
681
- r[t] = r[t - 255];
682
- })(), K.log = function(e) {
683
- if (e < 1) throw new Error("log(" + e + ")");
684
- return o[e];
685
- }, K.exp = function(e) {
686
- return r[e];
687
- }, K.mul = function(e, t) {
688
- return e === 0 || t === 0 ? 0 : r[o[e] + o[t]];
689
- }, K;
690
- }
691
- var Lt;
692
- function de() {
693
- return Lt || (Lt = 1, (function(r) {
694
- const o = le();
695
- r.mul = function(e, t) {
696
- const n = new Uint8Array(e.length + t.length - 1);
697
- for (let u = 0; u < e.length; u++)
698
- for (let a = 0; a < t.length; a++)
699
- n[u + a] ^= o.mul(e[u], t[a]);
700
- return n;
701
- }, r.mod = function(e, t) {
702
- let n = new Uint8Array(e);
703
- for (; n.length - t.length >= 0; ) {
704
- const u = n[0];
705
- for (let s = 0; s < t.length; s++)
706
- n[s] ^= o.mul(t[s], u);
707
- let a = 0;
708
- for (; a < n.length && n[a] === 0; ) a++;
709
- n = n.slice(a);
710
- }
711
- return n;
712
- }, r.generateECPolynomial = function(e) {
713
- let t = new Uint8Array([1]);
714
- for (let n = 0; n < e; n++)
715
- t = r.mul(t, new Uint8Array([1, o.exp(n)]));
716
- return t;
717
- };
718
- })(nt)), nt;
719
- }
720
- var rt, Dt;
721
- function ge() {
722
- if (Dt) return rt;
723
- Dt = 1;
724
- const r = de();
725
- function o(i) {
726
- this.genPoly = void 0, this.degree = i, this.degree && this.initialize(this.degree);
727
- }
728
- return o.prototype.initialize = function(e) {
729
- this.degree = e, this.genPoly = r.generateECPolynomial(this.degree);
730
- }, o.prototype.encode = function(e) {
731
- if (!this.genPoly)
732
- throw new Error("Encoder not initialized");
733
- const t = new Uint8Array(e.length + this.degree);
734
- t.set(e);
735
- const n = r.mod(t, this.genPoly), u = this.degree - n.length;
736
- if (u > 0) {
737
- const a = new Uint8Array(this.degree);
738
- return a.set(n, u), a;
739
- }
740
- return n;
741
- }, rt = o, rt;
742
- }
743
- var ot = {}, it = {}, ut = {}, qt;
744
- function Wt() {
745
- return qt || (qt = 1, ut.isValid = function(o) {
746
- return !isNaN(o) && o >= 1 && o <= 40;
747
- }), ut;
748
- }
749
- var L = {}, vt;
750
- function Zt() {
751
- if (vt) return L;
752
- vt = 1;
753
- const r = "[0-9]+", o = "[A-Z $%*+\\-./:]+";
754
- let i = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
755
- i = i.replace(/u/g, "\\u");
756
- const e = "(?:(?![A-Z0-9 $%*+\\-./:]|" + i + `)(?:.|[\r
757
- ]))+`;
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");
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);
766
- }, L;
767
- }
768
- var _t;
769
- function F() {
770
- return _t || (_t = 1, (function(r) {
771
- const o = Wt(), i = Zt();
772
- r.NUMERIC = {
773
- id: "Numeric",
774
- bit: 1,
775
- ccBits: [10, 12, 14]
776
- }, r.ALPHANUMERIC = {
777
- id: "Alphanumeric",
778
- bit: 2,
779
- ccBits: [9, 11, 13]
780
- }, r.BYTE = {
781
- id: "Byte",
782
- bit: 4,
783
- ccBits: [8, 16, 16]
784
- }, r.KANJI = {
785
- id: "Kanji",
786
- bit: 8,
787
- ccBits: [8, 10, 12]
788
- }, r.MIXED = {
789
- bit: -1
790
- }, r.getCharCountIndicator = function(n, u) {
791
- if (!n.ccBits) throw new Error("Invalid mode: " + n);
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];
795
- }, r.getBestModeForData = function(n) {
796
- return i.testNumeric(n) ? r.NUMERIC : i.testAlphanumeric(n) ? r.ALPHANUMERIC : i.testKanji(n) ? r.KANJI : r.BYTE;
797
- }, r.toString = function(n) {
798
- if (n && n.id) return n.id;
799
- throw new Error("Invalid mode");
800
- }, r.isValid = function(n) {
801
- return n && n.bit && n.ccBits;
802
- };
803
- function e(t) {
804
- if (typeof t != "string")
805
- throw new Error("Param is not a string");
806
- switch (t.toLowerCase()) {
807
- case "numeric":
808
- return r.NUMERIC;
809
- case "alphanumeric":
810
- return r.ALPHANUMERIC;
811
- case "kanji":
812
- return r.KANJI;
813
- case "byte":
814
- return r.BYTE;
815
- default:
816
- throw new Error("Unknown mode: " + t);
817
- }
818
- }
819
- r.from = function(n, u) {
820
- if (r.isValid(n))
821
- return n;
822
- try {
823
- return e(n);
824
- } catch {
825
- return u;
826
- }
827
- };
828
- })(it)), it;
829
- }
830
- var Ut;
831
- function he() {
832
- return Ut || (Ut = 1, (function(r) {
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;
838
- }
839
- function c(h, f) {
840
- return t.getCharCountIndicator(h, f) + 4;
841
- }
842
- function d(h, f) {
843
- let I = 0;
844
- return h.forEach(function(N) {
845
- const b = c(N.mode, f);
846
- I += b + N.getBitsLength();
847
- }), I;
848
- }
849
- function p(h, f) {
850
- for (let I = 1; I <= 40; I++)
851
- if (d(h, I) <= r.getCapacity(I, f, t.MIXED))
852
- return I;
853
- }
854
- r.from = function(f, I) {
855
- return n.isValid(f) ? parseInt(f, 10) : I;
856
- }, r.getCapacity = function(f, I, N) {
857
- if (!n.isValid(f))
858
- throw new Error("Invalid QR Code version");
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) {
864
- case t.NUMERIC:
865
- return Math.floor(T / 10 * 3);
866
- case t.ALPHANUMERIC:
867
- return Math.floor(T / 11 * 2);
868
- case t.KANJI:
869
- return Math.floor(T / 13);
870
- case t.BYTE:
871
- default:
872
- return Math.floor(T / 8);
873
- }
874
- }, r.getBestVersionForData = function(f, I) {
875
- let N;
876
- const b = e.from(I, e.M);
877
- if (Array.isArray(f)) {
878
- if (f.length > 1)
879
- return p(f, b);
880
- if (f.length === 0)
881
- return 1;
882
- N = f[0];
883
- } else
884
- N = f;
885
- return s(N.mode, N.getLength(), b);
886
- }, r.getEncodedBits = function(f) {
887
- if (!n.isValid(f) || f < 7)
888
- throw new Error("Invalid QR Code version");
889
- let I = f << 12;
890
- for (; o.getBCHDigit(I) - a >= 0; )
891
- I ^= u << o.getBCHDigit(I) - a;
892
- return f << 12 | I;
893
- };
894
- })(ot)), ot;
895
- }
896
- var st = {}, Ft;
897
- function me() {
898
- if (Ft) return st;
899
- Ft = 1;
900
- const r = U(), o = 1335, i = 21522, e = r.getBCHDigit(o);
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;
908
- }
909
- var at = {}, ct, kt;
910
- function we() {
911
- if (kt) return ct;
912
- kt = 1;
913
- const r = F();
914
- function o(i) {
915
- this.mode = r.NUMERIC, this.data = i.toString();
916
- }
917
- return o.getBitsLength = function(e) {
918
- return 10 * Math.floor(e / 3) + (e % 3 ? e % 3 * 3 + 1 : 0);
919
- }, o.prototype.getLength = function() {
920
- return this.data.length;
921
- }, o.prototype.getBitsLength = function() {
922
- return o.getBitsLength(this.data.length);
923
- }, o.prototype.write = function(e) {
924
- let t, n, u;
925
- for (t = 0; t + 3 <= this.data.length; t += 3)
926
- n = this.data.substr(t, 3), u = parseInt(n, 10), e.put(u, 10);
927
- const a = this.data.length - t;
928
- a > 0 && (n = this.data.substr(t), u = parseInt(n, 10), e.put(u, a * 3 + 1));
929
- }, ct = o, ct;
930
- }
931
- var ft, zt;
932
- function ye() {
933
- if (zt) return ft;
934
- zt = 1;
935
- const r = F(), o = [
936
- "0",
937
- "1",
938
- "2",
939
- "3",
940
- "4",
941
- "5",
942
- "6",
943
- "7",
944
- "8",
945
- "9",
946
- "A",
947
- "B",
948
- "C",
949
- "D",
950
- "E",
951
- "F",
952
- "G",
953
- "H",
954
- "I",
955
- "J",
956
- "K",
957
- "L",
958
- "M",
959
- "N",
960
- "O",
961
- "P",
962
- "Q",
963
- "R",
964
- "S",
965
- "T",
966
- "U",
967
- "V",
968
- "W",
969
- "X",
970
- "Y",
971
- "Z",
972
- " ",
973
- "$",
974
- "%",
975
- "*",
976
- "+",
977
- "-",
978
- ".",
979
- "/",
980
- ":"
981
- ];
982
- function i(e) {
983
- this.mode = r.ALPHANUMERIC, this.data = e;
984
- }
985
- return i.getBitsLength = function(t) {
986
- return 11 * Math.floor(t / 2) + 6 * (t % 2);
987
- }, i.prototype.getLength = function() {
988
- return this.data.length;
989
- }, i.prototype.getBitsLength = function() {
990
- return i.getBitsLength(this.data.length);
991
- }, i.prototype.write = function(t) {
992
- let n;
993
- for (n = 0; n + 2 <= this.data.length; n += 2) {
994
- let u = o.indexOf(this.data[n]) * 45;
995
- u += o.indexOf(this.data[n + 1]), t.put(u, 11);
996
- }
997
- this.data.length % 2 && t.put(o.indexOf(this.data[n]), 6);
998
- }, ft = i, ft;
999
- }
1000
- var lt, Vt;
1001
- function Ce() {
1002
- if (Vt) return lt;
1003
- Vt = 1;
1004
- const r = F();
1005
- function o(i) {
1006
- this.mode = r.BYTE, typeof i == "string" ? this.data = new TextEncoder().encode(i) : this.data = new Uint8Array(i);
1007
- }
1008
- return o.getBitsLength = function(e) {
1009
- return e * 8;
1010
- }, o.prototype.getLength = function() {
1011
- return this.data.length;
1012
- }, o.prototype.getBitsLength = function() {
1013
- return o.getBitsLength(this.data.length);
1014
- }, o.prototype.write = function(i) {
1015
- for (let e = 0, t = this.data.length; e < t; e++)
1016
- i.put(this.data[e], 8);
1017
- }, lt = o, lt;
1018
- }
1019
- var dt, Kt;
1020
- function Ee() {
1021
- if (Kt) return dt;
1022
- Kt = 1;
1023
- const r = F(), o = U();
1024
- function i(e) {
1025
- this.mode = r.KANJI, this.data = e;
1026
- }
1027
- return i.getBitsLength = function(t) {
1028
- return t * 13;
1029
- }, i.prototype.getLength = function() {
1030
- return this.data.length;
1031
- }, i.prototype.getBitsLength = function() {
1032
- return i.getBitsLength(this.data.length);
1033
- }, i.prototype.write = function(e) {
1034
- let t;
1035
- for (t = 0; t < this.data.length; t++) {
1036
- let n = o.toSJIS(this.data[t]);
1037
- if (n >= 33088 && n <= 40956)
1038
- n -= 33088;
1039
- else if (n >= 57408 && n <= 60351)
1040
- n -= 49472;
1041
- else
1042
- throw new Error(
1043
- "Invalid SJIS character: " + this.data[t] + `
1044
- Make sure your charset is UTF-8`
1045
- );
1046
- n = (n >>> 8 & 255) * 192 + (n & 255), e.put(n, 13);
1047
- }
1048
- }, dt = i, dt;
1049
- }
1050
- var gt = { exports: {} }, Ht;
1051
- function pe() {
1052
- return Ht || (Ht = 1, (function(r) {
1053
- var o = {
1054
- single_source_shortest_paths: function(i, e, t) {
1055
- var n = {}, u = {};
1056
- u[e] = 0;
1057
- var a = o.PriorityQueue.make();
1058
- a.push(e, 0);
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] || {};
1061
- for (d in h)
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));
1063
- }
1064
- if (typeof t < "u" && typeof u[t] > "u") {
1065
- var R = ["Could not find a path from ", e, " to ", t, "."].join("");
1066
- throw new Error(R);
1067
- }
1068
- return n;
1069
- },
1070
- extract_shortest_path_from_predecessor_list: function(i, e) {
1071
- for (var t = [], n = e; n; )
1072
- t.push(n), i[n], n = i[n];
1073
- return t.reverse(), t;
1074
- },
1075
- find_path: function(i, e, t) {
1076
- var n = o.single_source_shortest_paths(i, e, t);
1077
- return o.extract_shortest_path_from_predecessor_list(
1078
- n,
1079
- t
1080
- );
1081
- },
1082
- /**
1083
- * A very naive priority queue implementation.
1084
- */
1085
- PriorityQueue: {
1086
- make: function(i) {
1087
- var e = o.PriorityQueue, t = {}, n;
1088
- i = i || {};
1089
- for (n in e)
1090
- e.hasOwnProperty(n) && (t[n] = e[n]);
1091
- return t.queue = [], t.sorter = i.sorter || e.default_sorter, t;
1092
- },
1093
- default_sorter: function(i, e) {
1094
- return i.cost - e.cost;
1095
- },
1096
- /**
1097
- * Add a new item to the queue and ensure the highest priority element
1098
- * is at the front of the queue.
1099
- */
1100
- push: function(i, e) {
1101
- var t = { value: i, cost: e };
1102
- this.queue.push(t), this.queue.sort(this.sorter);
1103
- },
1104
- /**
1105
- * Return the highest priority element in the queue.
1106
- */
1107
- pop: function() {
1108
- return this.queue.shift();
1109
- },
1110
- empty: function() {
1111
- return this.queue.length === 0;
1112
- }
1113
- }
1114
- };
1115
- r.exports = o;
1116
- })(gt)), gt.exports;
1117
- }
1118
- var Ot;
1119
- function Be() {
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();
1122
- function c(R) {
1123
- return unescape(encodeURIComponent(R)).length;
1124
- }
1125
- function d(R, M, T) {
1126
- const B = [];
1127
- let S;
1128
- for (; (S = R.exec(T)) !== null; )
1129
- B.push({
1130
- data: S[0],
1131
- index: S.index,
1132
- mode: M,
1133
- length: S[0].length
1134
- });
1135
- return B;
1136
- }
1137
- function p(R) {
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) {
1141
- return C.index - y.index;
1142
- }).map(function(C) {
1143
- return {
1144
- data: C.data,
1145
- mode: C.mode,
1146
- length: C.length
1147
- };
1148
- });
1149
- }
1150
- function h(R, M) {
1151
- switch (M) {
1152
- case o.NUMERIC:
1153
- return i.getBitsLength(R);
1154
- case o.ALPHANUMERIC:
1155
- return e.getBitsLength(R);
1156
- case o.KANJI:
1157
- return n.getBitsLength(R);
1158
- case o.BYTE:
1159
- return t.getBitsLength(R);
1160
- }
1161
- }
1162
- function f(R) {
1163
- return R.reduce(function(M, T) {
1164
- const B = M.length - 1 >= 0 ? M[M.length - 1] : null;
1165
- return B && B.mode === T.mode ? (M[M.length - 1].data += T.data, M) : (M.push(T), M);
1166
- }, []);
1167
- }
1168
- function I(R) {
1169
- const M = [];
1170
- for (let T = 0; T < R.length; T++) {
1171
- const B = R[T];
1172
- switch (B.mode) {
1173
- case o.NUMERIC:
1174
- M.push([
1175
- B,
1176
- { data: B.data, mode: o.ALPHANUMERIC, length: B.length },
1177
- { data: B.data, mode: o.BYTE, length: B.length }
1178
- ]);
1179
- break;
1180
- case o.ALPHANUMERIC:
1181
- M.push([
1182
- B,
1183
- { data: B.data, mode: o.BYTE, length: B.length }
1184
- ]);
1185
- break;
1186
- case o.KANJI:
1187
- M.push([
1188
- B,
1189
- { data: B.data, mode: o.BYTE, length: c(B.data) }
1190
- ]);
1191
- break;
1192
- case o.BYTE:
1193
- M.push([
1194
- { data: B.data, mode: o.BYTE, length: c(B.data) }
1195
- ]);
1196
- }
1197
- }
1198
- return M;
1199
- }
1200
- function N(R, M) {
1201
- const T = {}, B = { start: {} };
1202
- let S = ["start"];
1203
- for (let g = 0; g < R.length; g++) {
1204
- const C = R[g], y = [];
1205
- for (let l = 0; l < C.length; l++) {
1206
- const A = C[l], m = "" + g + l;
1207
- y.push(m), T[m] = { node: A, lastCount: 0 }, B[m] = {};
1208
- for (let E = 0; E < S.length; E++) {
1209
- const w = S[E];
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));
1211
- }
1212
- }
1213
- S = y;
1214
- }
1215
- for (let g = 0; g < S.length; g++)
1216
- B[S[g]].end = 0;
1217
- return { map: B, table: T };
1218
- }
1219
- function b(R, M) {
1220
- let T;
1221
- const B = o.getBestModeForData(R);
1222
- if (T = o.from(M, B), T !== o.BYTE && T.bit < B.bit)
1223
- throw new Error('"' + R + '" cannot be encoded with mode ' + o.toString(T) + `.
1224
- Suggested mode is: ` + o.toString(B));
1225
- switch (T === o.KANJI && !a.isKanjiModeEnabled() && (T = o.BYTE), T) {
1226
- case o.NUMERIC:
1227
- return new i(R);
1228
- case o.ALPHANUMERIC:
1229
- return new e(R);
1230
- case o.KANJI:
1231
- return new n(R);
1232
- case o.BYTE:
1233
- return new t(R);
1234
- }
1235
- }
1236
- r.fromArray = function(M) {
1237
- return M.reduce(function(T, B) {
1238
- return typeof B == "string" ? T.push(b(B, null)) : B.data && T.push(b(B.data, B.mode)), T;
1239
- }, []);
1240
- }, r.fromString = function(M, T) {
1241
- const B = p(M, a.isKanjiModeEnabled()), S = I(B), g = N(S, T), C = s.find_path(g.map, "start", "end"), y = [];
1242
- for (let l = 1; l < C.length - 1; l++)
1243
- y.push(g.table[C[l]].node);
1244
- return r.fromArray(f(y));
1245
- }, r.rawSplit = function(M) {
1246
- return r.fromArray(
1247
- p(M, a.isKanjiModeEnabled())
1248
- );
1249
- };
1250
- })(at)), at;
1251
- }
1252
- var jt;
1253
- function Ae() {
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();
1257
- function f(g, C) {
1258
- const y = g.size, l = n.getPositions(C);
1259
- for (let A = 0; A < l.length; A++) {
1260
- const m = l[A][0], E = l[A][1];
1261
- for (let w = -1; w <= 7; w++)
1262
- if (!(m + w <= -1 || y <= m + w))
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));
1265
- }
1266
- }
1267
- function I(g) {
1268
- const C = g.size;
1269
- for (let y = 8; y < C - 8; y++) {
1270
- const l = y % 2 === 0;
1271
- g.set(y, 6, l, !0), g.set(6, y, l, !0);
1272
- }
1273
- }
1274
- function N(g, C) {
1275
- const y = t.getPositions(C);
1276
- for (let l = 0; l < y.length; l++) {
1277
- const A = y[l][0], m = y[l][1];
1278
- for (let E = -2; E <= 2; E++)
1279
- for (let w = -2; w <= 2; w++)
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);
1281
- }
1282
- }
1283
- function b(g, C) {
1284
- const y = g.size, l = c.getEncodedBits(C);
1285
- let A, m, E;
1286
- for (let w = 0; w < 18; w++)
1287
- A = Math.floor(w / 3), m = w % 3 + y - 8 - 3, E = (l >> w & 1) === 1, g.set(A, m, E, !0), g.set(m, A, E, !0);
1288
- }
1289
- function R(g, C, y) {
1290
- const l = g.size, A = d.getEncodedBits(C, y);
1291
- let m, E;
1292
- for (m = 0; m < 15; m++)
1293
- E = (A >> m & 1) === 1, m < 6 ? g.set(m, 8, E, !0) : m < 8 ? g.set(m + 1, 8, E, !0) : g.set(l - 15 + m, 8, E, !0), m < 8 ? g.set(8, l - m - 1, E, !0) : m < 9 ? g.set(8, 15 - m - 1 + 1, E, !0) : g.set(8, 15 - m - 1, E, !0);
1294
- g.set(l - 8, 8, 1, !0);
1295
- }
1296
- function M(g, C) {
1297
- const y = g.size;
1298
- let l = -1, A = y - 1, m = 7, E = 0;
1299
- for (let w = y - 1; w > 0; w -= 2)
1300
- for (w === 6 && w--; ; ) {
1301
- for (let P = 0; P < 2; P++)
1302
- if (!g.isReserved(A, w - P)) {
1303
- let v = !1;
1304
- E < C.length && (v = (C[E] >>> m & 1) === 1), g.set(A, w - P, v), m--, m === -1 && (E++, m = 7);
1305
- }
1306
- if (A += l, A < 0 || y <= A) {
1307
- A -= l, l = -l;
1308
- break;
1309
- }
1310
- }
1311
- }
1312
- function T(g, C, y) {
1313
- const l = new i();
1314
- y.forEach(function(P) {
1315
- l.put(P.mode.bit, 4), l.put(P.getLength(), p.getCharCountIndicator(P.mode, g)), P.write(l);
1316
- });
1317
- const A = r.getSymbolTotalCodewords(g), m = a.getTotalCodewordsCount(g, C), E = (A - m) * 8;
1318
- for (l.getLengthInBits() + 4 <= E && l.put(0, 4); l.getLengthInBits() % 8 !== 0; )
1319
- l.putBit(0);
1320
- const w = (E - l.getLengthInBits()) / 8;
1321
- for (let P = 0; P < w; P++)
1322
- l.put(P % 2 ? 17 : 236, 8);
1323
- return B(l, g, C);
1324
- }
1325
- function B(g, C, y) {
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
- let j = 0;
1328
- const H = new Array(E), Et = new Array(E);
1329
- let J = 0;
1330
- const ne = new Uint8Array(g.buffer);
1331
- for (let k = 0; k < E; k++) {
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);
1334
- }
1335
- const Y = new Uint8Array(l);
1336
- let pt = 0, D, q;
1337
- for (D = 0; D < J; D++)
1338
- for (q = 0; q < E; q++)
1339
- D < H[q].length && (Y[pt++] = H[q][D]);
1340
- for (D = 0; D < Ct; D++)
1341
- for (q = 0; q < E; q++)
1342
- Y[pt++] = Et[q][D];
1343
- return Y;
1344
- }
1345
- function S(g, C, y, l) {
1346
- let A;
1347
- if (Array.isArray(g))
1348
- A = h.fromArray(g);
1349
- else if (typeof g == "string") {
1350
- let v = C;
1351
- if (!v) {
1352
- const V = h.rawSplit(g);
1353
- v = c.getBestVersionForData(V, y);
1354
- }
1355
- A = h.fromString(g, v || 40);
1356
- } else
1357
- throw new Error("Invalid data");
1358
- const m = c.getBestVersionForData(A, y);
1359
- if (!m)
1360
- throw new Error("The amount of data is too big to be stored in a QR Code");
1361
- if (!C)
1362
- C = m;
1363
- else if (C < m)
1364
- throw new Error(
1365
- `
1366
- The chosen QR Code version cannot contain this amount of data.
1367
- Minimum version required to store current data is: ` + m + `.
1368
- `
1369
- );
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,
1376
- version: C,
1377
- errorCorrectionLevel: y,
1378
- maskPattern: l,
1379
- segments: A
1380
- };
1381
- }
1382
- return $.create = function(C, y) {
1383
- if (typeof C > "u" || C === "")
1384
- throw new Error("No input text");
1385
- let l = o.M, A, 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);
1387
- }, $;
1388
- }
1389
- var ht = {}, mt = {}, Jt;
1390
- function Xt() {
1391
- return Jt || (Jt = 1, (function(r) {
1392
- function o(i) {
1393
- if (typeof i == "number" && (i = i.toString()), typeof i != "string")
1394
- throw new Error("Color should be defined as hex string");
1395
- let e = i.slice().replace("#", "").split("");
1396
- if (e.length < 3 || e.length === 5 || e.length > 8)
1397
- throw new Error("Invalid hex color: " + i);
1398
- (e.length === 3 || e.length === 4) && (e = Array.prototype.concat.apply([], e.map(function(n) {
1399
- return [n, n];
1400
- }))), e.length === 6 && e.push("F", "F");
1401
- const t = parseInt(e.join(""), 16);
1402
- return {
1403
- r: t >> 24 & 255,
1404
- g: t >> 16 & 255,
1405
- b: t >> 8 & 255,
1406
- a: t & 255,
1407
- hex: "#" + e.slice(0, 6).join("")
1408
- };
1409
- }
1410
- r.getOptions = function(e) {
1411
- e || (e = {}), e.color || (e.color = {});
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;
1413
- return {
1414
- width: n,
1415
- scale: n ? 4 : u,
1416
- margin: t,
1417
- color: {
1418
- dark: o(e.color.dark || "#000000ff"),
1419
- light: o(e.color.light || "#ffffffff")
1420
- },
1421
- type: e.type,
1422
- rendererOpts: e.rendererOpts || {}
1423
- };
1424
- }, r.getScale = function(e, t) {
1425
- return t.width && t.width >= e + t.margin * 2 ? t.width / (e + t.margin * 2) : t.scale;
1426
- }, r.getImageWidth = function(e, t) {
1427
- const n = r.getScale(e, t);
1428
- return Math.floor((e + t.margin * 2) * n);
1429
- }, r.qrToImageData = function(e, t, n) {
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];
1431
- for (let h = 0; h < c; h++)
1432
- for (let f = 0; f < c; f++) {
1433
- let I = (h * c + f) * 4, N = n.color.light;
1434
- if (h >= d && f >= d && h < c - d && f < c - d) {
1435
- const b = Math.floor((h - d) / s), R = Math.floor((f - d) / s);
1436
- N = p[a[b * u + R] ? 1 : 0];
1437
- }
1438
- e[I++] = N.r, e[I++] = N.g, e[I++] = N.b, e[I] = N.a;
1439
- }
1440
- };
1441
- })(mt)), mt;
1442
- }
1443
- var Yt;
1444
- function Re() {
1445
- return Yt || (Yt = 1, (function(r) {
1446
- const o = Xt();
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";
1449
- }
1450
- function e() {
1451
- try {
1452
- return document.createElement("canvas");
1453
- } catch {
1454
- throw new Error("You need to specify a canvas element");
1455
- }
1456
- }
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 || {};
1466
- return c.toDataURL(d, p.quality);
1467
- };
1468
- })(ht)), ht;
1469
- }
1470
- var wt = {}, Gt;
1471
- function Te() {
1472
- if (Gt) return wt;
1473
- Gt = 1;
1474
- const r = Xt();
1475
- function o(t, n) {
1476
- const u = t.a / 255, a = n + '="' + t.hex + '"';
1477
- return u < 1 ? a + " " + n + '-opacity="' + u.toFixed(2).slice(1) + '"' : a;
1478
- }
1479
- function i(t, n, u) {
1480
- let a = t + n;
1481
- return typeof u < "u" && (a += " " + u), a;
1482
- }
1483
- function e(t, n, u) {
1484
- let a = "", s = 0, c = !1, d = 0;
1485
- for (let p = 0; p < t.length; p++) {
1486
- const h = Math.floor(p % n), f = Math.floor(p / n);
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++;
1488
- }
1489
- return a;
1490
- }
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>
1493
- `;
1494
- return typeof a == "function" && a(null, b), b;
1495
- }, wt;
1496
- }
1497
- var Qt;
1498
- function Pe() {
1499
- if (Qt) return z;
1500
- Qt = 1;
1501
- const r = ie(), o = Ae(), i = Re(), e = Te();
1502
- function t(n, u, a, s, c) {
1503
- const d = [].slice.call(arguments, 1), p = d.length, h = typeof d[p - 1] == "function";
1504
- if (!h && !r())
1505
- throw new Error("Callback required as last argument");
1506
- if (h) {
1507
- if (p < 2)
1508
- throw new Error("Too few arguments provided");
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));
1510
- } else {
1511
- if (p < 1)
1512
- throw new Error("Too few arguments provided");
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) {
1514
- try {
1515
- const N = o.create(a, s);
1516
- f(n(N, u, s));
1517
- } catch (N) {
1518
- I(N);
1519
- }
1520
- });
1521
- }
1522
- try {
1523
- const f = o.create(a, s);
1524
- c(null, n(f, u, s));
1525
- } catch (f) {
1526
- c(f);
1527
- }
1528
- }
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) {
1530
- return e.render(n, a);
1531
- }), z;
1532
- }
1533
- var xt = Pe();
1534
- const Ie = /* @__PURE__ */ oe(xt), Ne = /* @__PURE__ */ re({
1535
- __proto__: null,
1536
- default: Ie
1537
- }, [xt]);
1538
- export {
1539
- Ne as b
1540
- };