@plattar/plattar-qrcode 1.112.1 → 1.119.1
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/build/es2015/plattar-qrcode.js +854 -1622
- package/build/es2015/plattar-qrcode.min.js +1 -1
- package/build/es2019/plattar-qrcode.js +30 -8
- package/build/es2019/plattar-qrcode.min.js +1 -1
- package/elements/base/base-element.js +27 -5
- package/index.d.ts +3 -1
- package/index.js +1 -1
- package/package.json +5 -5
- package/version.js +1 -1
|
@@ -125,11 +125,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
125
125
|
throw new Error("BaseElement.renderQRCode() - required attribute \"url\" is missing or invalid");
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
var width = this.hasAttribute("width") ? this.getAttribute("width") : 512;
|
|
129
|
-
var height = this.hasAttribute("height") ? this.getAttribute("height") : 512;
|
|
128
|
+
var width = this.hasAttribute("width") ? parseInt(this.getAttribute("width")) : 512;
|
|
129
|
+
var height = this.hasAttribute("height") ? parseInt(this.getAttribute("height")) : 512;
|
|
130
130
|
var margin = this.hasAttribute("margin") ? this.getAttribute("margin") : 0;
|
|
131
131
|
var image = this.hasAttribute("image") ? this.getAttribute("image") : undefined;
|
|
132
132
|
var color = this.hasAttribute("color") ? this.getAttribute("color") : "#000000";
|
|
133
|
+
var style = this.hasAttribute("qr-type") ? this.getAttribute("qr-type") : "default";
|
|
133
134
|
this._options = this._options || {
|
|
134
135
|
imageOptions: {
|
|
135
136
|
hideBackgroundDots: true,
|
|
@@ -201,8 +202,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
201
202
|
}
|
|
202
203
|
}
|
|
203
204
|
};
|
|
204
|
-
this._options.width =
|
|
205
|
-
this._options.height =
|
|
205
|
+
this._options.width = 2048;
|
|
206
|
+
this._options.height = 2048;
|
|
206
207
|
this._options.data = url;
|
|
207
208
|
this._options.margin = margin;
|
|
208
209
|
this._options.image = image; // set the colors
|
|
@@ -210,15 +211,37 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
210
211
|
this._options.dotsOptions.color = color;
|
|
211
212
|
this._options.cornersDotOptions.color = color;
|
|
212
213
|
this._options.cornersSquareOptions.color = color;
|
|
214
|
+
|
|
215
|
+
switch (style) {
|
|
216
|
+
case "dots":
|
|
217
|
+
this._options.dotsOptions.type = "dots";
|
|
218
|
+
break;
|
|
219
|
+
|
|
220
|
+
case "default":
|
|
221
|
+
default:
|
|
222
|
+
this._options.dotsOptions.type = "rounded";
|
|
223
|
+
}
|
|
224
|
+
|
|
213
225
|
var shadow = this.shadowRoot || this.attachShadow({
|
|
214
226
|
mode: 'open'
|
|
215
227
|
});
|
|
216
228
|
var qrCode = this._qrCode;
|
|
217
229
|
|
|
218
230
|
if (!qrCode) {
|
|
231
|
+
var div = document.createElement("div");
|
|
232
|
+
div.style.width = width + "px";
|
|
233
|
+
div.style.height = height + "px";
|
|
234
|
+
shadow.appendChild(div);
|
|
219
235
|
this._qrCode = new QRCodeStyling(this._options);
|
|
220
236
|
|
|
221
|
-
this._qrCode.append(
|
|
237
|
+
this._qrCode.append(div);
|
|
238
|
+
|
|
239
|
+
var canvas = this._qrCode._canvas;
|
|
240
|
+
|
|
241
|
+
if (canvas) {
|
|
242
|
+
canvas.style.width = "100%";
|
|
243
|
+
canvas.style.height = "100%";
|
|
244
|
+
}
|
|
222
245
|
|
|
223
246
|
return;
|
|
224
247
|
}
|
|
@@ -265,7 +288,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
265
288
|
console.log("using @plattar/plattar-qrcode v" + Version);
|
|
266
289
|
customElements.define("plattar-qrcode", QRCodeElement);
|
|
267
290
|
module.exports = {
|
|
268
|
-
|
|
291
|
+
version: Version
|
|
269
292
|
};
|
|
270
293
|
}, {
|
|
271
294
|
"./elements/qrcode-element.js": 2,
|
|
@@ -288,8 +311,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
288
311
|
i = 0,
|
|
289
312
|
u = null,
|
|
290
313
|
v = [],
|
|
291
|
-
|
|
292
|
-
|
|
314
|
+
w = {},
|
|
315
|
+
m = function m(t, e) {
|
|
293
316
|
o = function (t) {
|
|
294
317
|
for (var e = new Array(t), r = 0; r < t; r += 1) {
|
|
295
318
|
e[r] = new Array(t);
|
|
@@ -300,16 +323,16 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
300
323
|
}
|
|
301
324
|
|
|
302
325
|
return e;
|
|
303
|
-
}(i = 4 * r + 17),
|
|
326
|
+
}(i = 4 * r + 17), b(0, 0), b(i - 7, 0), b(0, i - 7), x(), _(), M(t, e), r >= 7 && S(t), null == u && (u = A(r, n, v)), C(u, e);
|
|
304
327
|
},
|
|
305
|
-
|
|
328
|
+
b = function b(t, e) {
|
|
306
329
|
for (var r = -1; r <= 7; r += 1) {
|
|
307
330
|
if (!(t + r <= -1 || i <= t + r)) for (var n = -1; n <= 7; n += 1) {
|
|
308
331
|
e + n <= -1 || i <= e + n || (o[t + r][e + n] = 0 <= r && r <= 6 && (0 == n || 6 == n) || 0 <= n && n <= 6 && (0 == r || 6 == r) || 2 <= r && r <= 4 && 2 <= n && n <= 4);
|
|
309
332
|
}
|
|
310
333
|
}
|
|
311
334
|
},
|
|
312
|
-
|
|
335
|
+
_ = function _() {
|
|
313
336
|
for (var t = 8; t < i - 8; t += 1) {
|
|
314
337
|
null == o[t][6] && (o[t][6] = t % 2 == 0);
|
|
315
338
|
}
|
|
@@ -324,14 +347,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
324
347
|
var i = t[e],
|
|
325
348
|
a = t[n];
|
|
326
349
|
if (null == o[i][a]) for (var u = -2; u <= 2; u += 1) {
|
|
327
|
-
for (var
|
|
328
|
-
o[i + u][a +
|
|
350
|
+
for (var h = -2; h <= 2; h += 1) {
|
|
351
|
+
o[i + u][a + h] = -2 == u || 2 == u || -2 == h || 2 == h || 0 == u && 0 == h;
|
|
329
352
|
}
|
|
330
353
|
}
|
|
331
354
|
}
|
|
332
355
|
}
|
|
333
356
|
},
|
|
334
|
-
|
|
357
|
+
S = function S(t) {
|
|
335
358
|
for (var e = s.getBCHTypeNumber(r), n = 0; n < 18; n += 1) {
|
|
336
359
|
var a = !t && 1 == (e >> n & 1);
|
|
337
360
|
o[Math.floor(n / 3)][n % 3 + i - 8 - 3] = a;
|
|
@@ -341,25 +364,25 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
341
364
|
a = !t && 1 == (e >> n & 1), o[n % 3 + i - 8 - 3][Math.floor(n / 3)] = a;
|
|
342
365
|
}
|
|
343
366
|
},
|
|
344
|
-
|
|
367
|
+
M = function M(t, e) {
|
|
345
368
|
for (var r = n << 3 | e, a = s.getBCHTypeInfo(r), u = 0; u < 15; u += 1) {
|
|
346
|
-
var
|
|
347
|
-
u < 6 ? o[u][8] =
|
|
369
|
+
var h = !t && 1 == (a >> u & 1);
|
|
370
|
+
u < 6 ? o[u][8] = h : u < 8 ? o[u + 1][8] = h : o[i - 15 + u][8] = h;
|
|
348
371
|
}
|
|
349
372
|
|
|
350
373
|
for (u = 0; u < 15; u += 1) {
|
|
351
|
-
|
|
374
|
+
h = !t && 1 == (a >> u & 1), u < 8 ? o[8][i - u - 1] = h : u < 9 ? o[8][15 - u - 1 + 1] = h : o[8][15 - u - 1] = h;
|
|
352
375
|
}
|
|
353
376
|
|
|
354
377
|
o[i - 8][8] = !t;
|
|
355
378
|
},
|
|
356
379
|
C = function C(t, e) {
|
|
357
|
-
for (var r = -1, n = i - 1, a = 7, u = 0,
|
|
358
|
-
for (6 ==
|
|
359
|
-
for (var
|
|
360
|
-
if (null == o[n][
|
|
361
|
-
var
|
|
362
|
-
u < t.length && (
|
|
380
|
+
for (var r = -1, n = i - 1, a = 7, u = 0, h = s.getMaskFunction(e), c = i - 1; c > 0; c -= 2) {
|
|
381
|
+
for (6 == c && (c -= 1);;) {
|
|
382
|
+
for (var l = 0; l < 2; l += 1) {
|
|
383
|
+
if (null == o[n][c - l]) {
|
|
384
|
+
var d = !1;
|
|
385
|
+
u < t.length && (d = 1 == (t[u] >>> a & 1)), h(n, c - l) && (d = !d), o[n][c - l] = d, -1 == (a -= 1) && (u += 1, a = 7);
|
|
363
386
|
}
|
|
364
387
|
}
|
|
365
388
|
|
|
@@ -370,8 +393,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
370
393
|
}
|
|
371
394
|
}
|
|
372
395
|
},
|
|
373
|
-
|
|
374
|
-
for (var n =
|
|
396
|
+
A = function A(t, e, r) {
|
|
397
|
+
for (var n = c.getRSBlocks(t, e), o = l(), i = 0; i < r.length; i += 1) {
|
|
375
398
|
var a = r[i];
|
|
376
399
|
o.put(a.getMode(), 4), o.put(a.getLength(), s.getLengthInBits(a.getMode(), t)), a.write(o);
|
|
377
400
|
}
|
|
@@ -394,55 +417,55 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
394
417
|
|
|
395
418
|
return function (t, e) {
|
|
396
419
|
for (var r = 0, n = 0, o = 0, i = new Array(e.length), a = new Array(e.length), u = 0; u < e.length; u += 1) {
|
|
397
|
-
var
|
|
398
|
-
|
|
399
|
-
n = Math.max(n,
|
|
420
|
+
var c = e[u].dataCount,
|
|
421
|
+
l = e[u].totalCount - c;
|
|
422
|
+
n = Math.max(n, c), o = Math.max(o, l), i[u] = new Array(c);
|
|
400
423
|
|
|
401
|
-
for (var
|
|
402
|
-
i[u][
|
|
424
|
+
for (var d = 0; d < i[u].length; d += 1) {
|
|
425
|
+
i[u][d] = 255 & t.getBuffer()[d + r];
|
|
403
426
|
}
|
|
404
427
|
|
|
405
|
-
r +=
|
|
406
|
-
var f = s.getErrorCorrectPolynomial(
|
|
407
|
-
|
|
428
|
+
r += c;
|
|
429
|
+
var f = s.getErrorCorrectPolynomial(l),
|
|
430
|
+
g = h(i[u], f.getLength() - 1).mod(f);
|
|
408
431
|
|
|
409
|
-
for (a[u] = new Array(f.getLength() - 1),
|
|
410
|
-
var
|
|
411
|
-
a[u][
|
|
432
|
+
for (a[u] = new Array(f.getLength() - 1), d = 0; d < a[u].length; d += 1) {
|
|
433
|
+
var p = d + g.getLength() - a[u].length;
|
|
434
|
+
a[u][d] = p >= 0 ? g.getAt(p) : 0;
|
|
412
435
|
}
|
|
413
436
|
}
|
|
414
437
|
|
|
415
438
|
var v = 0;
|
|
416
439
|
|
|
417
|
-
for (
|
|
418
|
-
v += e[
|
|
440
|
+
for (d = 0; d < e.length; d += 1) {
|
|
441
|
+
v += e[d].totalCount;
|
|
419
442
|
}
|
|
420
443
|
|
|
421
|
-
var
|
|
422
|
-
|
|
444
|
+
var w = new Array(v),
|
|
445
|
+
y = 0;
|
|
423
446
|
|
|
424
|
-
for (
|
|
447
|
+
for (d = 0; d < n; d += 1) {
|
|
425
448
|
for (u = 0; u < e.length; u += 1) {
|
|
426
|
-
|
|
449
|
+
d < i[u].length && (w[y] = i[u][d], y += 1);
|
|
427
450
|
}
|
|
428
451
|
}
|
|
429
452
|
|
|
430
|
-
for (
|
|
453
|
+
for (d = 0; d < o; d += 1) {
|
|
431
454
|
for (u = 0; u < e.length; u += 1) {
|
|
432
|
-
|
|
455
|
+
d < a[u].length && (w[y] = a[u][d], y += 1);
|
|
433
456
|
}
|
|
434
457
|
}
|
|
435
458
|
|
|
436
|
-
return
|
|
459
|
+
return w;
|
|
437
460
|
}(o, n);
|
|
438
461
|
};
|
|
439
462
|
|
|
440
|
-
|
|
463
|
+
w.addData = function (t, e) {
|
|
441
464
|
var r = null;
|
|
442
465
|
|
|
443
466
|
switch (e = e || "Byte") {
|
|
444
467
|
case "Numeric":
|
|
445
|
-
r =
|
|
468
|
+
r = d(t);
|
|
446
469
|
break;
|
|
447
470
|
|
|
448
471
|
case "Alphanumeric":
|
|
@@ -450,11 +473,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
450
473
|
break;
|
|
451
474
|
|
|
452
475
|
case "Byte":
|
|
453
|
-
r =
|
|
476
|
+
r = g(t);
|
|
454
477
|
break;
|
|
455
478
|
|
|
456
479
|
case "Kanji":
|
|
457
|
-
r =
|
|
480
|
+
r = p(t);
|
|
458
481
|
break;
|
|
459
482
|
|
|
460
483
|
default:
|
|
@@ -462,15 +485,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
462
485
|
}
|
|
463
486
|
|
|
464
487
|
v.push(r), u = null;
|
|
465
|
-
},
|
|
488
|
+
}, w.isDark = function (t, e) {
|
|
466
489
|
if (t < 0 || i <= t || e < 0 || i <= e) throw t + "," + e;
|
|
467
490
|
return o[t][e];
|
|
468
|
-
},
|
|
491
|
+
}, w.getModuleCount = function () {
|
|
469
492
|
return i;
|
|
470
|
-
},
|
|
493
|
+
}, w.make = function () {
|
|
471
494
|
if (r < 1) {
|
|
472
495
|
for (var t = 1; t < 40; t++) {
|
|
473
|
-
for (var e =
|
|
496
|
+
for (var e = c.getRSBlocks(t, n), o = l(), i = 0; i < v.length; i++) {
|
|
474
497
|
var a = v[i];
|
|
475
498
|
o.put(a.getMode(), 4), o.put(a.getLength(), s.getLengthInBits(a.getMode(), t)), a.write(o);
|
|
476
499
|
}
|
|
@@ -487,33 +510,32 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
487
510
|
r = t;
|
|
488
511
|
}
|
|
489
512
|
|
|
490
|
-
|
|
513
|
+
m(!1, function () {
|
|
491
514
|
for (var t = 0, e = 0, r = 0; r < 8; r += 1) {
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
var n = s.getLostPoint(y);
|
|
515
|
+
m(!0, r);
|
|
516
|
+
var n = s.getLostPoint(w);
|
|
495
517
|
(0 == r || t > n) && (t = n, e = r);
|
|
496
518
|
}
|
|
497
519
|
|
|
498
520
|
return e;
|
|
499
521
|
}());
|
|
500
|
-
},
|
|
522
|
+
}, w.createTableTag = function (t, e) {
|
|
501
523
|
t = t || 2;
|
|
502
524
|
var r = "";
|
|
503
525
|
r += '<table style="', r += " border-width: 0px; border-style: none;", r += " border-collapse: collapse;", r += " padding: 0px; margin: " + (e = void 0 === e ? 4 * t : e) + "px;", r += '">', r += "<tbody>";
|
|
504
526
|
|
|
505
|
-
for (var n = 0; n <
|
|
527
|
+
for (var n = 0; n < w.getModuleCount(); n += 1) {
|
|
506
528
|
r += "<tr>";
|
|
507
529
|
|
|
508
|
-
for (var o = 0; o <
|
|
509
|
-
r += '<td style="', r += " border-width: 0px; border-style: none;", r += " border-collapse: collapse;", r += " padding: 0px; margin: 0px;", r += " width: " + t + "px;", r += " height: " + t + "px;", r += " background-color: ", r +=
|
|
530
|
+
for (var o = 0; o < w.getModuleCount(); o += 1) {
|
|
531
|
+
r += '<td style="', r += " border-width: 0px; border-style: none;", r += " border-collapse: collapse;", r += " padding: 0px; margin: 0px;", r += " width: " + t + "px;", r += " height: " + t + "px;", r += " background-color: ", r += w.isDark(n, o) ? "#000000" : "#ffffff", r += ";", r += '"/>';
|
|
510
532
|
}
|
|
511
533
|
|
|
512
534
|
r += "</tr>";
|
|
513
535
|
}
|
|
514
536
|
|
|
515
537
|
return (r += "</tbody>") + "</table>";
|
|
516
|
-
},
|
|
538
|
+
}, w.createSvgTag = function (t, e, r, n) {
|
|
517
539
|
var o = {};
|
|
518
540
|
"object" == _typeof(arguments[0]) && (t = (o = arguments[0]).cellSize, e = o.margin, r = o.alt, n = o.title), t = t || 2, e = void 0 === e ? 4 * t : e, (r = "string" == typeof r ? {
|
|
519
541
|
text: r
|
|
@@ -524,38 +546,38 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
524
546
|
a,
|
|
525
547
|
s,
|
|
526
548
|
u,
|
|
527
|
-
|
|
528
|
-
|
|
549
|
+
h = w.getModuleCount() * t + 2 * e,
|
|
550
|
+
c = "";
|
|
529
551
|
|
|
530
|
-
for (u = "l" + t + ",0 0," + t + " -" + t + ",0 0,-" + t + "z ",
|
|
531
|
-
for (s = a * t + e, i = 0; i <
|
|
532
|
-
|
|
552
|
+
for (u = "l" + t + ",0 0," + t + " -" + t + ",0 0,-" + t + "z ", c += '<svg version="1.1" xmlns="http://www.w3.org/2000/svg"', c += o.scalable ? "" : ' width="' + h + 'px" height="' + h + 'px"', c += ' viewBox="0 0 ' + h + " " + h + '" ', c += ' preserveAspectRatio="xMinYMin meet"', c += n.text || r.text ? ' role="img" aria-labelledby="' + k([n.id, r.id].join(" ").trim()) + '"' : "", c += ">", c += n.text ? '<title id="' + k(n.id) + '">' + k(n.text) + "</title>" : "", c += r.text ? '<description id="' + k(r.id) + '">' + k(r.text) + "</description>" : "", c += '<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>', c += '<path d="', a = 0; a < w.getModuleCount(); a += 1) {
|
|
553
|
+
for (s = a * t + e, i = 0; i < w.getModuleCount(); i += 1) {
|
|
554
|
+
w.isDark(a, i) && (c += "M" + (i * t + e) + "," + s + u);
|
|
533
555
|
}
|
|
534
556
|
}
|
|
535
557
|
|
|
536
|
-
return (
|
|
537
|
-
},
|
|
558
|
+
return (c += '" stroke="transparent" fill="black"/>') + "</svg>";
|
|
559
|
+
}, w.createDataURL = function (t, e) {
|
|
538
560
|
t = t || 2, e = void 0 === e ? 4 * t : e;
|
|
539
|
-
var r =
|
|
561
|
+
var r = w.getModuleCount() * t + 2 * e,
|
|
540
562
|
n = e,
|
|
541
563
|
o = r - e;
|
|
542
|
-
return
|
|
564
|
+
return y(r, r, function (e, r) {
|
|
543
565
|
if (n <= e && e < o && n <= r && r < o) {
|
|
544
566
|
var i = Math.floor((e - n) / t),
|
|
545
567
|
a = Math.floor((r - n) / t);
|
|
546
|
-
return
|
|
568
|
+
return w.isDark(a, i) ? 0 : 1;
|
|
547
569
|
}
|
|
548
570
|
|
|
549
571
|
return 1;
|
|
550
572
|
});
|
|
551
|
-
},
|
|
573
|
+
}, w.createImgTag = function (t, e, r) {
|
|
552
574
|
t = t || 2, e = void 0 === e ? 4 * t : e;
|
|
553
|
-
var n =
|
|
575
|
+
var n = w.getModuleCount() * t + 2 * e,
|
|
554
576
|
o = "";
|
|
555
|
-
return o += "<img", o += ' src="', o +=
|
|
577
|
+
return o += "<img", o += ' src="', o += w.createDataURL(t, e), o += '"', o += ' width="', o += n, o += '"', o += ' height="', o += n, o += '"', r && (o += ' alt="', o += k(r), o += '"'), o + "/>";
|
|
556
578
|
};
|
|
557
579
|
|
|
558
|
-
var
|
|
580
|
+
var k = function k(t) {
|
|
559
581
|
for (var e = "", r = 0; r < t.length; r += 1) {
|
|
560
582
|
var n = t.charAt(r);
|
|
561
583
|
|
|
@@ -584,7 +606,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
584
606
|
return e;
|
|
585
607
|
};
|
|
586
608
|
|
|
587
|
-
return
|
|
609
|
+
return w.createASCII = function (t, e) {
|
|
588
610
|
if ((t = t || 1) < 2) return function (t) {
|
|
589
611
|
t = void 0 === t ? 2 : t;
|
|
590
612
|
var e,
|
|
@@ -592,66 +614,66 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
592
614
|
n,
|
|
593
615
|
o,
|
|
594
616
|
i,
|
|
595
|
-
a = 1 *
|
|
617
|
+
a = 1 * w.getModuleCount() + 2 * t,
|
|
596
618
|
s = t,
|
|
597
619
|
u = a - t,
|
|
598
|
-
|
|
620
|
+
h = {
|
|
599
621
|
"██": "█",
|
|
600
622
|
"█ ": "▀",
|
|
601
623
|
" █": "▄",
|
|
602
624
|
" ": " "
|
|
603
625
|
},
|
|
604
|
-
|
|
626
|
+
c = {
|
|
605
627
|
"██": "▀",
|
|
606
628
|
"█ ": "▀",
|
|
607
629
|
" █": " ",
|
|
608
630
|
" ": " "
|
|
609
631
|
},
|
|
610
|
-
|
|
632
|
+
l = "";
|
|
611
633
|
|
|
612
634
|
for (e = 0; e < a; e += 2) {
|
|
613
635
|
for (n = Math.floor((e - s) / 1), o = Math.floor((e + 1 - s) / 1), r = 0; r < a; r += 1) {
|
|
614
|
-
i = "█", s <= r && r < u && s <= e && e < u &&
|
|
636
|
+
i = "█", s <= r && r < u && s <= e && e < u && w.isDark(n, Math.floor((r - s) / 1)) && (i = " "), s <= r && r < u && s <= e + 1 && e + 1 < u && w.isDark(o, Math.floor((r - s) / 1)) ? i += " " : i += "█", l += t < 1 && e + 1 >= u ? c[i] : h[i];
|
|
615
637
|
}
|
|
616
638
|
|
|
617
|
-
|
|
639
|
+
l += "\n";
|
|
618
640
|
}
|
|
619
641
|
|
|
620
|
-
return a % 2 && t > 0 ?
|
|
642
|
+
return a % 2 && t > 0 ? l.substring(0, l.length - a - 1) + Array(a + 1).join("▀") : l.substring(0, l.length - 1);
|
|
621
643
|
}(e);
|
|
622
644
|
t -= 1, e = void 0 === e ? 2 * t : e;
|
|
623
645
|
var r,
|
|
624
646
|
n,
|
|
625
647
|
o,
|
|
626
648
|
i,
|
|
627
|
-
a =
|
|
649
|
+
a = w.getModuleCount() * t + 2 * e,
|
|
628
650
|
s = e,
|
|
629
651
|
u = a - e,
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
652
|
+
h = Array(t + 1).join("██"),
|
|
653
|
+
c = Array(t + 1).join(" "),
|
|
654
|
+
l = "",
|
|
655
|
+
d = "";
|
|
634
656
|
|
|
635
657
|
for (r = 0; r < a; r += 1) {
|
|
636
|
-
for (o = Math.floor((r - s) / t),
|
|
637
|
-
i = 1, s <= n && n < u && s <= r && r < u &&
|
|
658
|
+
for (o = Math.floor((r - s) / t), d = "", n = 0; n < a; n += 1) {
|
|
659
|
+
i = 1, s <= n && n < u && s <= r && r < u && w.isDark(o, Math.floor((n - s) / t)) && (i = 0), d += i ? h : c;
|
|
638
660
|
}
|
|
639
661
|
|
|
640
662
|
for (o = 0; o < t; o += 1) {
|
|
641
|
-
|
|
663
|
+
l += d + "\n";
|
|
642
664
|
}
|
|
643
665
|
}
|
|
644
666
|
|
|
645
|
-
return
|
|
646
|
-
},
|
|
667
|
+
return l.substring(0, l.length - 1);
|
|
668
|
+
}, w.renderTo2dContext = function (t, e) {
|
|
647
669
|
e = e || 2;
|
|
648
670
|
|
|
649
|
-
for (var r =
|
|
671
|
+
for (var r = w.getModuleCount(), n = 0; n < r; n++) {
|
|
650
672
|
for (var o = 0; o < r; o++) {
|
|
651
|
-
t.fillStyle =
|
|
673
|
+
t.fillStyle = w.isDark(n, o) ? "black" : "white", t.fillRect(n * e, o * e, e, e);
|
|
652
674
|
}
|
|
653
675
|
}
|
|
654
|
-
},
|
|
676
|
+
}, w;
|
|
655
677
|
};
|
|
656
678
|
|
|
657
679
|
t.stringToBytes = (t.stringToBytesFuncs = {
|
|
@@ -665,7 +687,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
665
687
|
}
|
|
666
688
|
})["default"], t.createStringToBytes = function (t, e) {
|
|
667
689
|
var r = function () {
|
|
668
|
-
for (var r =
|
|
690
|
+
for (var r = w(t), n = function n() {
|
|
669
691
|
var t = r.read();
|
|
670
692
|
if (-1 == t) throw "eof";
|
|
671
693
|
return t;
|
|
@@ -772,8 +794,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
772
794
|
throw "bad maskPattern:" + t;
|
|
773
795
|
}
|
|
774
796
|
}, o.getErrorCorrectPolynomial = function (t) {
|
|
775
|
-
for (var e =
|
|
776
|
-
e = e.multiply(
|
|
797
|
+
for (var e = h([1], 0), r = 0; r < t; r += 1) {
|
|
798
|
+
e = e.multiply(h([1, u.gexp(r)], 0));
|
|
777
799
|
}
|
|
778
800
|
|
|
779
801
|
return e;
|
|
@@ -841,8 +863,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
841
863
|
|
|
842
864
|
for (n = 0; n < e - 1; n += 1) {
|
|
843
865
|
for (o = 0; o < e - 1; o += 1) {
|
|
844
|
-
var
|
|
845
|
-
t.isDark(n, o) && (
|
|
866
|
+
var h = 0;
|
|
867
|
+
t.isDark(n, o) && (h += 1), t.isDark(n + 1, o) && (h += 1), t.isDark(n, o + 1) && (h += 1), t.isDark(n + 1, o + 1) && (h += 1), 0 != h && 4 != h || (r += 3);
|
|
846
868
|
}
|
|
847
869
|
}
|
|
848
870
|
|
|
@@ -858,15 +880,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
858
880
|
}
|
|
859
881
|
}
|
|
860
882
|
|
|
861
|
-
var
|
|
883
|
+
var c = 0;
|
|
862
884
|
|
|
863
885
|
for (o = 0; o < e; o += 1) {
|
|
864
886
|
for (n = 0; n < e; n += 1) {
|
|
865
|
-
t.isDark(n, o) && (
|
|
887
|
+
t.isDark(n, o) && (c += 1);
|
|
866
888
|
}
|
|
867
889
|
}
|
|
868
890
|
|
|
869
|
-
return r + Math.abs(100 *
|
|
891
|
+
return r + Math.abs(100 * c / e / e - 50) / 5 * 10;
|
|
870
892
|
}, o),
|
|
871
893
|
u = function () {
|
|
872
894
|
for (var t = new Array(256), e = new Array(256), r = 0; r < 8; r += 1) {
|
|
@@ -900,7 +922,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
900
922
|
};
|
|
901
923
|
}();
|
|
902
924
|
|
|
903
|
-
function
|
|
925
|
+
function h(t, e) {
|
|
904
926
|
if (void 0 === t.length) throw t.length + "/" + e;
|
|
905
927
|
|
|
906
928
|
var r = function () {
|
|
@@ -928,7 +950,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
928
950
|
}
|
|
929
951
|
}
|
|
930
952
|
|
|
931
|
-
return
|
|
953
|
+
return h(e, 0);
|
|
932
954
|
},
|
|
933
955
|
mod: function mod(t) {
|
|
934
956
|
if (n.getLength() - t.getLength() < 0) return n;
|
|
@@ -941,14 +963,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
941
963
|
r[o] ^= u.gexp(u.glog(t.getAt(o)) + e);
|
|
942
964
|
}
|
|
943
965
|
|
|
944
|
-
return
|
|
966
|
+
return h(r, 0).mod(t);
|
|
945
967
|
}
|
|
946
968
|
};
|
|
947
969
|
|
|
948
970
|
return n;
|
|
949
971
|
}
|
|
950
972
|
|
|
951
|
-
var
|
|
973
|
+
var c = function () {
|
|
952
974
|
var t = [[1, 26, 19], [1, 26, 16], [1, 26, 13], [1, 26, 9], [1, 44, 34], [1, 44, 28], [1, 44, 22], [1, 44, 16], [1, 70, 55], [1, 70, 44], [2, 35, 17], [2, 35, 13], [1, 100, 80], [2, 50, 32], [2, 50, 24], [4, 25, 9], [1, 134, 108], [2, 67, 43], [2, 33, 15, 2, 34, 16], [2, 33, 11, 2, 34, 12], [2, 86, 68], [4, 43, 27], [4, 43, 19], [4, 43, 15], [2, 98, 78], [4, 49, 31], [2, 32, 14, 4, 33, 15], [4, 39, 13, 1, 40, 14], [2, 121, 97], [2, 60, 38, 2, 61, 39], [4, 40, 18, 2, 41, 19], [4, 40, 14, 2, 41, 15], [2, 146, 116], [3, 58, 36, 2, 59, 37], [4, 36, 16, 4, 37, 17], [4, 36, 12, 4, 37, 13], [2, 86, 68, 2, 87, 69], [4, 69, 43, 1, 70, 44], [6, 43, 19, 2, 44, 20], [6, 43, 15, 2, 44, 16], [4, 101, 81], [1, 80, 50, 4, 81, 51], [4, 50, 22, 4, 51, 23], [3, 36, 12, 8, 37, 13], [2, 116, 92, 2, 117, 93], [6, 58, 36, 2, 59, 37], [4, 46, 20, 6, 47, 21], [7, 42, 14, 4, 43, 15], [4, 133, 107], [8, 59, 37, 1, 60, 38], [8, 44, 20, 4, 45, 21], [12, 33, 11, 4, 34, 12], [3, 145, 115, 1, 146, 116], [4, 64, 40, 5, 65, 41], [11, 36, 16, 5, 37, 17], [11, 36, 12, 5, 37, 13], [5, 109, 87, 1, 110, 88], [5, 65, 41, 5, 66, 42], [5, 54, 24, 7, 55, 25], [11, 36, 12, 7, 37, 13], [5, 122, 98, 1, 123, 99], [7, 73, 45, 3, 74, 46], [15, 43, 19, 2, 44, 20], [3, 45, 15, 13, 46, 16], [1, 135, 107, 5, 136, 108], [10, 74, 46, 1, 75, 47], [1, 50, 22, 15, 51, 23], [2, 42, 14, 17, 43, 15], [5, 150, 120, 1, 151, 121], [9, 69, 43, 4, 70, 44], [17, 50, 22, 1, 51, 23], [2, 42, 14, 19, 43, 15], [3, 141, 113, 4, 142, 114], [3, 70, 44, 11, 71, 45], [17, 47, 21, 4, 48, 22], [9, 39, 13, 16, 40, 14], [3, 135, 107, 5, 136, 108], [3, 67, 41, 13, 68, 42], [15, 54, 24, 5, 55, 25], [15, 43, 15, 10, 44, 16], [4, 144, 116, 4, 145, 117], [17, 68, 42], [17, 50, 22, 6, 51, 23], [19, 46, 16, 6, 47, 17], [2, 139, 111, 7, 140, 112], [17, 74, 46], [7, 54, 24, 16, 55, 25], [34, 37, 13], [4, 151, 121, 5, 152, 122], [4, 75, 47, 14, 76, 48], [11, 54, 24, 14, 55, 25], [16, 45, 15, 14, 46, 16], [6, 147, 117, 4, 148, 118], [6, 73, 45, 14, 74, 46], [11, 54, 24, 16, 55, 25], [30, 46, 16, 2, 47, 17], [8, 132, 106, 4, 133, 107], [8, 75, 47, 13, 76, 48], [7, 54, 24, 22, 55, 25], [22, 45, 15, 13, 46, 16], [10, 142, 114, 2, 143, 115], [19, 74, 46, 4, 75, 47], [28, 50, 22, 6, 51, 23], [33, 46, 16, 4, 47, 17], [8, 152, 122, 4, 153, 123], [22, 73, 45, 3, 74, 46], [8, 53, 23, 26, 54, 24], [12, 45, 15, 28, 46, 16], [3, 147, 117, 10, 148, 118], [3, 73, 45, 23, 74, 46], [4, 54, 24, 31, 55, 25], [11, 45, 15, 31, 46, 16], [7, 146, 116, 7, 147, 117], [21, 73, 45, 7, 74, 46], [1, 53, 23, 37, 54, 24], [19, 45, 15, 26, 46, 16], [5, 145, 115, 10, 146, 116], [19, 75, 47, 10, 76, 48], [15, 54, 24, 25, 55, 25], [23, 45, 15, 25, 46, 16], [13, 145, 115, 3, 146, 116], [2, 74, 46, 29, 75, 47], [42, 54, 24, 1, 55, 25], [23, 45, 15, 28, 46, 16], [17, 145, 115], [10, 74, 46, 23, 75, 47], [10, 54, 24, 35, 55, 25], [19, 45, 15, 35, 46, 16], [17, 145, 115, 1, 146, 116], [14, 74, 46, 21, 75, 47], [29, 54, 24, 19, 55, 25], [11, 45, 15, 46, 46, 16], [13, 145, 115, 6, 146, 116], [14, 74, 46, 23, 75, 47], [44, 54, 24, 7, 55, 25], [59, 46, 16, 1, 47, 17], [12, 151, 121, 7, 152, 122], [12, 75, 47, 26, 76, 48], [39, 54, 24, 14, 55, 25], [22, 45, 15, 41, 46, 16], [6, 151, 121, 14, 152, 122], [6, 75, 47, 34, 76, 48], [46, 54, 24, 10, 55, 25], [2, 45, 15, 64, 46, 16], [17, 152, 122, 4, 153, 123], [29, 74, 46, 14, 75, 47], [49, 54, 24, 10, 55, 25], [24, 45, 15, 46, 46, 16], [4, 152, 122, 18, 153, 123], [13, 74, 46, 32, 75, 47], [48, 54, 24, 14, 55, 25], [42, 45, 15, 32, 46, 16], [20, 147, 117, 4, 148, 118], [40, 75, 47, 7, 76, 48], [43, 54, 24, 22, 55, 25], [10, 45, 15, 67, 46, 16], [19, 148, 118, 6, 149, 119], [18, 75, 47, 31, 76, 48], [34, 54, 24, 34, 55, 25], [20, 45, 15, 61, 46, 16]],
|
|
953
975
|
e = function e(t, _e) {
|
|
954
976
|
var r = {};
|
|
@@ -978,8 +1000,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
978
1000
|
if (void 0 === o) throw "bad rs block @ typeNumber:" + r + "/errorCorrectionLevel:" + n;
|
|
979
1001
|
|
|
980
1002
|
for (var i = o.length / 3, s = [], u = 0; u < i; u += 1) {
|
|
981
|
-
for (var
|
|
982
|
-
s.push(e(
|
|
1003
|
+
for (var h = o[3 * u + 0], c = o[3 * u + 1], l = o[3 * u + 2], d = 0; d < h; d += 1) {
|
|
1004
|
+
s.push(e(c, l));
|
|
983
1005
|
}
|
|
984
1006
|
}
|
|
985
1007
|
|
|
@@ -989,7 +1011,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
989
1011
|
|
|
990
1012
|
return r;
|
|
991
1013
|
}(),
|
|
992
|
-
|
|
1014
|
+
l = function l() {
|
|
993
1015
|
var t = [],
|
|
994
1016
|
e = 0,
|
|
995
1017
|
r = {
|
|
@@ -1015,7 +1037,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1015
1037
|
};
|
|
1016
1038
|
return r;
|
|
1017
1039
|
},
|
|
1018
|
-
|
|
1040
|
+
d = function d(t) {
|
|
1019
1041
|
var e = t,
|
|
1020
1042
|
r = {
|
|
1021
1043
|
getMode: function getMode() {
|
|
@@ -1102,7 +1124,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1102
1124
|
|
|
1103
1125
|
return r;
|
|
1104
1126
|
},
|
|
1105
|
-
|
|
1127
|
+
g = function g(e) {
|
|
1106
1128
|
var r = t.stringToBytes(e);
|
|
1107
1129
|
return {
|
|
1108
1130
|
getMode: function getMode() {
|
|
@@ -1118,7 +1140,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1118
1140
|
}
|
|
1119
1141
|
};
|
|
1120
1142
|
},
|
|
1121
|
-
|
|
1143
|
+
p = function p(e) {
|
|
1122
1144
|
var r = t.stringToBytesFuncs.SJIS;
|
|
1123
1145
|
if (!r) throw "sjis not supported.";
|
|
1124
1146
|
!function (t, e) {
|
|
@@ -1184,7 +1206,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1184
1206
|
};
|
|
1185
1207
|
return e;
|
|
1186
1208
|
},
|
|
1187
|
-
|
|
1209
|
+
w = function w(t) {
|
|
1188
1210
|
var e = t,
|
|
1189
1211
|
r = 0,
|
|
1190
1212
|
n = 0,
|
|
@@ -1217,7 +1239,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1217
1239
|
|
|
1218
1240
|
return i;
|
|
1219
1241
|
},
|
|
1220
|
-
|
|
1242
|
+
y = function y(t, e, r) {
|
|
1221
1243
|
for (var n = function (t, e) {
|
|
1222
1244
|
var r = t,
|
|
1223
1245
|
n = e,
|
|
@@ -1245,33 +1267,33 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1245
1267
|
|
|
1246
1268
|
i.add(String.fromCharCode(e)), i.add(String.fromCharCode(r));
|
|
1247
1269
|
var u,
|
|
1248
|
-
c,
|
|
1249
1270
|
h,
|
|
1250
|
-
|
|
1251
|
-
l = (
|
|
1271
|
+
c,
|
|
1272
|
+
l = v(),
|
|
1273
|
+
d = (u = l, h = 0, c = 0, {
|
|
1252
1274
|
write: function write(t, e) {
|
|
1253
1275
|
if (t >>> e != 0) throw "length over";
|
|
1254
1276
|
|
|
1255
|
-
for (;
|
|
1256
|
-
u.writeByte(255 & (t <<
|
|
1277
|
+
for (; h + e >= 8;) {
|
|
1278
|
+
u.writeByte(255 & (t << h | c)), e -= 8 - h, t >>>= 8 - h, c = 0, h = 0;
|
|
1257
1279
|
}
|
|
1258
1280
|
|
|
1259
|
-
|
|
1281
|
+
c |= t << h, h += e;
|
|
1260
1282
|
},
|
|
1261
1283
|
flush: function flush() {
|
|
1262
|
-
|
|
1284
|
+
h > 0 && u.writeByte(c);
|
|
1263
1285
|
}
|
|
1264
1286
|
});
|
|
1265
|
-
|
|
1287
|
+
d.write(e, n);
|
|
1266
1288
|
var f = 0,
|
|
1267
|
-
|
|
1289
|
+
g = String.fromCharCode(o[f]);
|
|
1268
1290
|
|
|
1269
1291
|
for (f += 1; f < o.length;) {
|
|
1270
|
-
var
|
|
1271
|
-
f += 1, i.contains(
|
|
1292
|
+
var p = String.fromCharCode(o[f]);
|
|
1293
|
+
f += 1, i.contains(g + p) ? g += p : (d.write(i.indexOf(g), n), i.size() < 4095 && (i.size() == 1 << n && (n += 1), i.add(g + p)), g = p);
|
|
1272
1294
|
}
|
|
1273
1295
|
|
|
1274
|
-
return
|
|
1296
|
+
return d.write(i.indexOf(g), n), d.write(r, n), d.flush(), l.toByteArray();
|
|
1275
1297
|
},
|
|
1276
1298
|
s = function s() {
|
|
1277
1299
|
var t = {},
|
|
@@ -1335,8 +1357,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1335
1357
|
}, o.toString = function () {
|
|
1336
1358
|
return n;
|
|
1337
1359
|
}, o;
|
|
1338
|
-
}(), u = a.toByteArray(),
|
|
1339
|
-
s.writeByte(u[
|
|
1360
|
+
}(), u = a.toByteArray(), h = 0; h < u.length; h += 1) {
|
|
1361
|
+
s.writeByte(u[h]);
|
|
1340
1362
|
}
|
|
1341
1363
|
|
|
1342
1364
|
return s.flush(), "data:image/gif;base64," + s;
|
|
@@ -1358,12 +1380,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1358
1380
|
return o;
|
|
1359
1381
|
}) ? r.apply(e, []) : r) || (t.exports = n);
|
|
1360
1382
|
},
|
|
1361
|
-
|
|
1383
|
+
676: function _(t, e, r) {
|
|
1362
1384
|
"use strict";
|
|
1363
1385
|
|
|
1364
1386
|
r.d(e, {
|
|
1365
1387
|
"default": function _default() {
|
|
1366
|
-
return
|
|
1388
|
+
return q;
|
|
1367
1389
|
}
|
|
1368
1390
|
});
|
|
1369
1391
|
|
|
@@ -1418,49 +1440,148 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1418
1440
|
}
|
|
1419
1441
|
|
|
1420
1442
|
function u(t) {
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1443
|
+
return e = this, r = void 0, o = function o() {
|
|
1444
|
+
return function (t, e) {
|
|
1445
|
+
var r,
|
|
1446
|
+
n,
|
|
1447
|
+
o,
|
|
1448
|
+
i,
|
|
1449
|
+
a = {
|
|
1450
|
+
label: 0,
|
|
1451
|
+
sent: function sent() {
|
|
1452
|
+
if (1 & o[0]) throw o[1];
|
|
1453
|
+
return o[1];
|
|
1454
|
+
},
|
|
1455
|
+
trys: [],
|
|
1456
|
+
ops: []
|
|
1457
|
+
};
|
|
1458
|
+
return i = {
|
|
1459
|
+
next: s(0),
|
|
1460
|
+
"throw": s(1),
|
|
1461
|
+
"return": s(2)
|
|
1462
|
+
}, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
|
|
1463
|
+
return this;
|
|
1464
|
+
}), i;
|
|
1465
|
+
|
|
1466
|
+
function s(i) {
|
|
1467
|
+
return function (s) {
|
|
1468
|
+
return function (i) {
|
|
1469
|
+
if (r) throw new TypeError("Generator is already executing.");
|
|
1470
|
+
|
|
1471
|
+
for (; a;) {
|
|
1472
|
+
try {
|
|
1473
|
+
if (r = 1, n && (o = 2 & i[0] ? n["return"] : i[0] ? n["throw"] || ((o = n["return"]) && o.call(n), 0) : n.next) && !(o = o.call(n, i[1])).done) return o;
|
|
1474
|
+
|
|
1475
|
+
switch (n = 0, o && (i = [2 & i[0], o.value]), i[0]) {
|
|
1476
|
+
case 0:
|
|
1477
|
+
case 1:
|
|
1478
|
+
o = i;
|
|
1479
|
+
break;
|
|
1480
|
+
|
|
1481
|
+
case 4:
|
|
1482
|
+
return a.label++, {
|
|
1483
|
+
value: i[1],
|
|
1484
|
+
done: !1
|
|
1485
|
+
};
|
|
1486
|
+
|
|
1487
|
+
case 5:
|
|
1488
|
+
a.label++, n = i[1], i = [0];
|
|
1489
|
+
continue;
|
|
1490
|
+
|
|
1491
|
+
case 7:
|
|
1492
|
+
i = a.ops.pop(), a.trys.pop();
|
|
1493
|
+
continue;
|
|
1494
|
+
|
|
1495
|
+
default:
|
|
1496
|
+
if (!((o = (o = a.trys).length > 0 && o[o.length - 1]) || 6 !== i[0] && 2 !== i[0])) {
|
|
1497
|
+
a = 0;
|
|
1498
|
+
continue;
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
if (3 === i[0] && (!o || i[1] > o[0] && i[1] < o[3])) {
|
|
1502
|
+
a.label = i[1];
|
|
1503
|
+
break;
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
if (6 === i[0] && a.label < o[1]) {
|
|
1507
|
+
a.label = o[1], o = i;
|
|
1508
|
+
break;
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
if (o && a.label < o[2]) {
|
|
1512
|
+
a.label = o[2], a.ops.push(i);
|
|
1513
|
+
break;
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1516
|
+
o[2] && a.ops.pop(), a.trys.pop();
|
|
1517
|
+
continue;
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
i = e.call(t, a);
|
|
1521
|
+
} catch (t) {
|
|
1522
|
+
i = [6, t], n = 0;
|
|
1523
|
+
} finally {
|
|
1524
|
+
r = o = 0;
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
if (5 & i[0]) throw i[1];
|
|
1529
|
+
return {
|
|
1530
|
+
value: i[0] ? i[1] : void 0,
|
|
1531
|
+
done: !0
|
|
1532
|
+
};
|
|
1533
|
+
}([i, s]);
|
|
1534
|
+
};
|
|
1535
|
+
}
|
|
1536
|
+
}(this, function (e) {
|
|
1537
|
+
return [2, new Promise(function (e) {
|
|
1538
|
+
var r = new XMLHttpRequest();
|
|
1539
|
+
r.onload = function () {
|
|
1540
|
+
var t = new FileReader();
|
|
1541
|
+
t.onloadend = function () {
|
|
1542
|
+
e(t.result);
|
|
1543
|
+
}, t.readAsDataURL(r.response);
|
|
1544
|
+
}, r.open("GET", t), r.responseType = "blob", r.send();
|
|
1545
|
+
})];
|
|
1546
|
+
});
|
|
1547
|
+
}, new ((n = void 0) || (n = Promise))(function (t, i) {
|
|
1548
|
+
function a(t) {
|
|
1549
|
+
try {
|
|
1550
|
+
u(o.next(t));
|
|
1551
|
+
} catch (t) {
|
|
1552
|
+
i(t);
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
function s(t) {
|
|
1557
|
+
try {
|
|
1558
|
+
u(o["throw"](t));
|
|
1559
|
+
} catch (t) {
|
|
1560
|
+
i(t);
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
function u(e) {
|
|
1565
|
+
var r;
|
|
1566
|
+
e.done ? t(e.value) : (r = e.value, r instanceof n ? r : new n(function (t) {
|
|
1567
|
+
t(r);
|
|
1568
|
+
})).then(a, s);
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
u((o = o.apply(e, r || [])).next());
|
|
1572
|
+
});
|
|
1573
|
+
var e, r, n, o;
|
|
1447
1574
|
}
|
|
1448
1575
|
|
|
1449
|
-
var
|
|
1576
|
+
var h = {
|
|
1450
1577
|
L: .07,
|
|
1451
1578
|
M: .15,
|
|
1452
1579
|
Q: .25,
|
|
1453
1580
|
H: .3
|
|
1454
|
-
}
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
f = "classy-rounded",
|
|
1459
|
-
p = "square",
|
|
1460
|
-
g = "extra-rounded";
|
|
1461
|
-
|
|
1462
|
-
var _v = function v() {
|
|
1463
|
-
return (_v = Object.assign || function (t) {
|
|
1581
|
+
};
|
|
1582
|
+
|
|
1583
|
+
var _c = function c() {
|
|
1584
|
+
return (_c = Object.assign || function (t) {
|
|
1464
1585
|
for (var e, r = 1, n = arguments.length; r < n; r++) {
|
|
1465
1586
|
for (var o in e = arguments[r]) {
|
|
1466
1587
|
Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
|
|
@@ -1471,39 +1592,38 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1471
1592
|
}).apply(this, arguments);
|
|
1472
1593
|
};
|
|
1473
1594
|
|
|
1474
|
-
var
|
|
1595
|
+
var l = function () {
|
|
1475
1596
|
function t(t) {
|
|
1476
|
-
var e = t.
|
|
1597
|
+
var e = t.svg,
|
|
1477
1598
|
r = t.type;
|
|
1478
|
-
this.
|
|
1599
|
+
this._svg = e, this._type = r;
|
|
1479
1600
|
}
|
|
1480
1601
|
|
|
1481
1602
|
return t.prototype.draw = function (t, e, r, n) {
|
|
1482
|
-
var o
|
|
1483
|
-
i = this._context;
|
|
1603
|
+
var o;
|
|
1484
1604
|
|
|
1485
1605
|
switch (this._type) {
|
|
1486
|
-
case
|
|
1606
|
+
case "dots":
|
|
1487
1607
|
o = this._drawDot;
|
|
1488
1608
|
break;
|
|
1489
1609
|
|
|
1490
|
-
case
|
|
1610
|
+
case "classy":
|
|
1491
1611
|
o = this._drawClassy;
|
|
1492
1612
|
break;
|
|
1493
1613
|
|
|
1494
|
-
case
|
|
1614
|
+
case "classy-rounded":
|
|
1495
1615
|
o = this._drawClassyRounded;
|
|
1496
1616
|
break;
|
|
1497
1617
|
|
|
1498
|
-
case
|
|
1618
|
+
case "rounded":
|
|
1499
1619
|
o = this._drawRounded;
|
|
1500
1620
|
break;
|
|
1501
1621
|
|
|
1502
|
-
case
|
|
1622
|
+
case "extra-rounded":
|
|
1503
1623
|
o = this._drawExtraRounded;
|
|
1504
1624
|
break;
|
|
1505
1625
|
|
|
1506
|
-
case
|
|
1626
|
+
case "square":
|
|
1507
1627
|
default:
|
|
1508
1628
|
o = this._drawSquare;
|
|
1509
1629
|
}
|
|
@@ -1512,276 +1632,251 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1512
1632
|
x: t,
|
|
1513
1633
|
y: e,
|
|
1514
1634
|
size: r,
|
|
1515
|
-
context: i,
|
|
1516
1635
|
getNeighbor: n
|
|
1517
1636
|
});
|
|
1518
1637
|
}, t.prototype._rotateFigure = function (t) {
|
|
1519
|
-
var e
|
|
1520
|
-
r = t.
|
|
1521
|
-
n = t.
|
|
1522
|
-
o = t.
|
|
1638
|
+
var e,
|
|
1639
|
+
r = t.x,
|
|
1640
|
+
n = t.y,
|
|
1641
|
+
o = t.size,
|
|
1523
1642
|
i = t.rotation,
|
|
1524
1643
|
a = void 0 === i ? 0 : i,
|
|
1525
|
-
s =
|
|
1526
|
-
u =
|
|
1527
|
-
|
|
1528
|
-
o.translate(u, c), a && o.rotate(a), s(), o.closePath(), a && o.rotate(-a), o.translate(-u, -c);
|
|
1644
|
+
s = r + o / 2,
|
|
1645
|
+
u = n + o / 2;
|
|
1646
|
+
(0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
|
|
1529
1647
|
}, t.prototype._basicDot = function (t) {
|
|
1530
|
-
var e =
|
|
1531
|
-
r = t.
|
|
1648
|
+
var e = this,
|
|
1649
|
+
r = t.size,
|
|
1650
|
+
n = t.x,
|
|
1651
|
+
o = t.y;
|
|
1532
1652
|
|
|
1533
|
-
this._rotateFigure(
|
|
1653
|
+
this._rotateFigure(_c(_c({}, t), {
|
|
1534
1654
|
draw: function draw() {
|
|
1535
|
-
|
|
1655
|
+
e._element = document.createElementNS("http://www.w3.org/2000/svg", "circle"), e._element.setAttribute("cx", String(n + r / 2)), e._element.setAttribute("cy", String(o + r / 2)), e._element.setAttribute("r", String(r / 2));
|
|
1536
1656
|
}
|
|
1537
1657
|
}));
|
|
1538
1658
|
}, t.prototype._basicSquare = function (t) {
|
|
1539
|
-
var e =
|
|
1540
|
-
r = t.
|
|
1659
|
+
var e = this,
|
|
1660
|
+
r = t.size,
|
|
1661
|
+
n = t.x,
|
|
1662
|
+
o = t.y;
|
|
1541
1663
|
|
|
1542
|
-
this._rotateFigure(
|
|
1664
|
+
this._rotateFigure(_c(_c({}, t), {
|
|
1543
1665
|
draw: function draw() {
|
|
1544
|
-
|
|
1666
|
+
e._element = document.createElementNS("http://www.w3.org/2000/svg", "rect"), e._element.setAttribute("x", String(n)), e._element.setAttribute("y", String(o)), e._element.setAttribute("width", String(r)), e._element.setAttribute("height", String(r));
|
|
1545
1667
|
}
|
|
1546
1668
|
}));
|
|
1547
1669
|
}, t.prototype._basicSideRounded = function (t) {
|
|
1548
|
-
var e =
|
|
1549
|
-
r = t.
|
|
1670
|
+
var e = this,
|
|
1671
|
+
r = t.size,
|
|
1672
|
+
n = t.x,
|
|
1673
|
+
o = t.y;
|
|
1550
1674
|
|
|
1551
|
-
this._rotateFigure(
|
|
1675
|
+
this._rotateFigure(_c(_c({}, t), {
|
|
1552
1676
|
draw: function draw() {
|
|
1553
|
-
|
|
1677
|
+
e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("d", "M " + n + " " + o + "v " + r + "h " + r / 2 + "a " + r / 2 + " " + r / 2 + ", 0, 0, 0, 0 " + -r);
|
|
1554
1678
|
}
|
|
1555
1679
|
}));
|
|
1556
1680
|
}, t.prototype._basicCornerRounded = function (t) {
|
|
1557
|
-
var e =
|
|
1558
|
-
r = t.
|
|
1681
|
+
var e = this,
|
|
1682
|
+
r = t.size,
|
|
1683
|
+
n = t.x,
|
|
1684
|
+
o = t.y;
|
|
1559
1685
|
|
|
1560
|
-
this._rotateFigure(
|
|
1686
|
+
this._rotateFigure(_c(_c({}, t), {
|
|
1561
1687
|
draw: function draw() {
|
|
1562
|
-
|
|
1688
|
+
e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("d", "M " + n + " " + o + "v " + r + "h " + r + "v " + -r / 2 + "a " + r / 2 + " " + r / 2 + ", 0, 0, 0, " + -r / 2 + " " + -r / 2);
|
|
1563
1689
|
}
|
|
1564
1690
|
}));
|
|
1565
1691
|
}, t.prototype._basicCornerExtraRounded = function (t) {
|
|
1566
|
-
var e =
|
|
1567
|
-
r = t.
|
|
1692
|
+
var e = this,
|
|
1693
|
+
r = t.size,
|
|
1694
|
+
n = t.x,
|
|
1695
|
+
o = t.y;
|
|
1568
1696
|
|
|
1569
|
-
this._rotateFigure(
|
|
1697
|
+
this._rotateFigure(_c(_c({}, t), {
|
|
1570
1698
|
draw: function draw() {
|
|
1571
|
-
|
|
1699
|
+
e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("d", "M " + n + " " + o + "v " + r + "h " + r + "a " + r + " " + r + ", 0, 0, 0, " + -r + " " + -r);
|
|
1572
1700
|
}
|
|
1573
1701
|
}));
|
|
1574
1702
|
}, t.prototype._basicCornersRounded = function (t) {
|
|
1575
|
-
var e =
|
|
1576
|
-
r = t.
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
draw: function draw() {
|
|
1580
|
-
r.arc(0, 0, e / 2, -Math.PI / 2, 0), r.lineTo(e / 2, e / 2), r.lineTo(0, e / 2), r.arc(0, 0, e / 2, Math.PI / 2, Math.PI), r.lineTo(-e / 2, -e / 2), r.lineTo(0, -e / 2);
|
|
1581
|
-
}
|
|
1582
|
-
}));
|
|
1583
|
-
}, t.prototype._basicCornersExtraRounded = function (t) {
|
|
1584
|
-
var e = t.size,
|
|
1585
|
-
r = t.context;
|
|
1703
|
+
var e = this,
|
|
1704
|
+
r = t.size,
|
|
1705
|
+
n = t.x,
|
|
1706
|
+
o = t.y;
|
|
1586
1707
|
|
|
1587
|
-
this._rotateFigure(
|
|
1708
|
+
this._rotateFigure(_c(_c({}, t), {
|
|
1588
1709
|
draw: function draw() {
|
|
1589
|
-
|
|
1710
|
+
e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("d", "M " + n + " " + o + "v " + r / 2 + "a " + r / 2 + " " + r / 2 + ", 0, 0, 0, " + r / 2 + " " + r / 2 + "h " + r / 2 + "v " + -r / 2 + "a " + r / 2 + " " + r / 2 + ", 0, 0, 0, " + -r / 2 + " " + -r / 2);
|
|
1590
1711
|
}
|
|
1591
1712
|
}));
|
|
1592
1713
|
}, t.prototype._drawDot = function (t) {
|
|
1593
1714
|
var e = t.x,
|
|
1594
1715
|
r = t.y,
|
|
1595
|
-
n = t.size
|
|
1596
|
-
o = t.context;
|
|
1716
|
+
n = t.size;
|
|
1597
1717
|
|
|
1598
1718
|
this._basicDot({
|
|
1599
1719
|
x: e,
|
|
1600
1720
|
y: r,
|
|
1601
1721
|
size: n,
|
|
1602
|
-
context: o,
|
|
1603
1722
|
rotation: 0
|
|
1604
1723
|
});
|
|
1605
1724
|
}, t.prototype._drawSquare = function (t) {
|
|
1606
1725
|
var e = t.x,
|
|
1607
1726
|
r = t.y,
|
|
1608
|
-
n = t.size
|
|
1609
|
-
o = t.context;
|
|
1727
|
+
n = t.size;
|
|
1610
1728
|
|
|
1611
1729
|
this._basicSquare({
|
|
1612
1730
|
x: e,
|
|
1613
1731
|
y: r,
|
|
1614
1732
|
size: n,
|
|
1615
|
-
context: o,
|
|
1616
1733
|
rotation: 0
|
|
1617
1734
|
});
|
|
1618
1735
|
}, t.prototype._drawRounded = function (t) {
|
|
1619
1736
|
var e = t.x,
|
|
1620
1737
|
r = t.y,
|
|
1621
1738
|
n = t.size,
|
|
1622
|
-
o = t.
|
|
1623
|
-
i =
|
|
1624
|
-
a =
|
|
1625
|
-
s =
|
|
1626
|
-
u =
|
|
1627
|
-
|
|
1628
|
-
h = a + s + u + c;
|
|
1739
|
+
o = t.getNeighbor,
|
|
1740
|
+
i = o ? +o(-1, 0) : 0,
|
|
1741
|
+
a = o ? +o(1, 0) : 0,
|
|
1742
|
+
s = o ? +o(0, -1) : 0,
|
|
1743
|
+
u = o ? +o(0, 1) : 0,
|
|
1744
|
+
h = i + a + s + u;
|
|
1629
1745
|
if (0 !== h) {
|
|
1630
|
-
if (h > 2 ||
|
|
1746
|
+
if (h > 2 || i && a || s && u) this._basicSquare({
|
|
1631
1747
|
x: e,
|
|
1632
1748
|
y: r,
|
|
1633
1749
|
size: n,
|
|
1634
|
-
context: o,
|
|
1635
1750
|
rotation: 0
|
|
1636
1751
|
});else {
|
|
1637
1752
|
if (2 === h) {
|
|
1638
|
-
var
|
|
1639
|
-
return
|
|
1753
|
+
var c = 0;
|
|
1754
|
+
return i && s ? c = Math.PI / 2 : s && a ? c = Math.PI : a && u && (c = -Math.PI / 2), void this._basicCornerRounded({
|
|
1640
1755
|
x: e,
|
|
1641
1756
|
y: r,
|
|
1642
1757
|
size: n,
|
|
1643
|
-
|
|
1644
|
-
rotation: d
|
|
1758
|
+
rotation: c
|
|
1645
1759
|
});
|
|
1646
1760
|
}
|
|
1647
1761
|
|
|
1648
|
-
if (1 === h) return
|
|
1762
|
+
if (1 === h) return c = 0, s ? c = Math.PI / 2 : a ? c = Math.PI : u && (c = -Math.PI / 2), void this._basicSideRounded({
|
|
1649
1763
|
x: e,
|
|
1650
1764
|
y: r,
|
|
1651
1765
|
size: n,
|
|
1652
|
-
|
|
1653
|
-
rotation: d
|
|
1766
|
+
rotation: c
|
|
1654
1767
|
});
|
|
1655
1768
|
}
|
|
1656
1769
|
} else this._basicDot({
|
|
1657
1770
|
x: e,
|
|
1658
1771
|
y: r,
|
|
1659
1772
|
size: n,
|
|
1660
|
-
context: o,
|
|
1661
1773
|
rotation: 0
|
|
1662
1774
|
});
|
|
1663
1775
|
}, t.prototype._drawExtraRounded = function (t) {
|
|
1664
1776
|
var e = t.x,
|
|
1665
1777
|
r = t.y,
|
|
1666
1778
|
n = t.size,
|
|
1667
|
-
o = t.
|
|
1668
|
-
i =
|
|
1669
|
-
a =
|
|
1670
|
-
s =
|
|
1671
|
-
u =
|
|
1672
|
-
|
|
1673
|
-
h = a + s + u + c;
|
|
1779
|
+
o = t.getNeighbor,
|
|
1780
|
+
i = o ? +o(-1, 0) : 0,
|
|
1781
|
+
a = o ? +o(1, 0) : 0,
|
|
1782
|
+
s = o ? +o(0, -1) : 0,
|
|
1783
|
+
u = o ? +o(0, 1) : 0,
|
|
1784
|
+
h = i + a + s + u;
|
|
1674
1785
|
if (0 !== h) {
|
|
1675
|
-
if (h > 2 ||
|
|
1786
|
+
if (h > 2 || i && a || s && u) this._basicSquare({
|
|
1676
1787
|
x: e,
|
|
1677
1788
|
y: r,
|
|
1678
1789
|
size: n,
|
|
1679
|
-
context: o,
|
|
1680
1790
|
rotation: 0
|
|
1681
1791
|
});else {
|
|
1682
1792
|
if (2 === h) {
|
|
1683
|
-
var
|
|
1684
|
-
return
|
|
1793
|
+
var c = 0;
|
|
1794
|
+
return i && s ? c = Math.PI / 2 : s && a ? c = Math.PI : a && u && (c = -Math.PI / 2), void this._basicCornerExtraRounded({
|
|
1685
1795
|
x: e,
|
|
1686
1796
|
y: r,
|
|
1687
1797
|
size: n,
|
|
1688
|
-
|
|
1689
|
-
rotation: d
|
|
1798
|
+
rotation: c
|
|
1690
1799
|
});
|
|
1691
1800
|
}
|
|
1692
1801
|
|
|
1693
|
-
if (1 === h) return
|
|
1802
|
+
if (1 === h) return c = 0, s ? c = Math.PI / 2 : a ? c = Math.PI : u && (c = -Math.PI / 2), void this._basicSideRounded({
|
|
1694
1803
|
x: e,
|
|
1695
1804
|
y: r,
|
|
1696
1805
|
size: n,
|
|
1697
|
-
|
|
1698
|
-
rotation: d
|
|
1806
|
+
rotation: c
|
|
1699
1807
|
});
|
|
1700
1808
|
}
|
|
1701
1809
|
} else this._basicDot({
|
|
1702
1810
|
x: e,
|
|
1703
1811
|
y: r,
|
|
1704
1812
|
size: n,
|
|
1705
|
-
context: o,
|
|
1706
1813
|
rotation: 0
|
|
1707
1814
|
});
|
|
1708
1815
|
}, t.prototype._drawClassy = function (t) {
|
|
1709
1816
|
var e = t.x,
|
|
1710
1817
|
r = t.y,
|
|
1711
1818
|
n = t.size,
|
|
1712
|
-
o = t.
|
|
1713
|
-
i =
|
|
1714
|
-
a =
|
|
1715
|
-
s =
|
|
1716
|
-
u =
|
|
1717
|
-
|
|
1718
|
-
0 !== a + s + u + c ? a || u ? s || c ? this._basicSquare({
|
|
1819
|
+
o = t.getNeighbor,
|
|
1820
|
+
i = o ? +o(-1, 0) : 0,
|
|
1821
|
+
a = o ? +o(1, 0) : 0,
|
|
1822
|
+
s = o ? +o(0, -1) : 0,
|
|
1823
|
+
u = o ? +o(0, 1) : 0;
|
|
1824
|
+
0 !== i + a + s + u ? i || s ? a || u ? this._basicSquare({
|
|
1719
1825
|
x: e,
|
|
1720
1826
|
y: r,
|
|
1721
1827
|
size: n,
|
|
1722
|
-
context: o,
|
|
1723
1828
|
rotation: 0
|
|
1724
1829
|
}) : this._basicCornerRounded({
|
|
1725
1830
|
x: e,
|
|
1726
1831
|
y: r,
|
|
1727
1832
|
size: n,
|
|
1728
|
-
context: o,
|
|
1729
1833
|
rotation: Math.PI / 2
|
|
1730
1834
|
}) : this._basicCornerRounded({
|
|
1731
1835
|
x: e,
|
|
1732
1836
|
y: r,
|
|
1733
1837
|
size: n,
|
|
1734
|
-
context: o,
|
|
1735
1838
|
rotation: -Math.PI / 2
|
|
1736
1839
|
}) : this._basicCornersRounded({
|
|
1737
1840
|
x: e,
|
|
1738
1841
|
y: r,
|
|
1739
1842
|
size: n,
|
|
1740
|
-
context: o,
|
|
1741
1843
|
rotation: Math.PI / 2
|
|
1742
1844
|
});
|
|
1743
1845
|
}, t.prototype._drawClassyRounded = function (t) {
|
|
1744
1846
|
var e = t.x,
|
|
1745
1847
|
r = t.y,
|
|
1746
1848
|
n = t.size,
|
|
1747
|
-
o = t.
|
|
1748
|
-
i =
|
|
1749
|
-
a =
|
|
1750
|
-
s =
|
|
1751
|
-
u =
|
|
1752
|
-
|
|
1753
|
-
0 !== a + s + u + c ? a || u ? s || c ? this._basicSquare({
|
|
1849
|
+
o = t.getNeighbor,
|
|
1850
|
+
i = o ? +o(-1, 0) : 0,
|
|
1851
|
+
a = o ? +o(1, 0) : 0,
|
|
1852
|
+
s = o ? +o(0, -1) : 0,
|
|
1853
|
+
u = o ? +o(0, 1) : 0;
|
|
1854
|
+
0 !== i + a + s + u ? i || s ? a || u ? this._basicSquare({
|
|
1754
1855
|
x: e,
|
|
1755
1856
|
y: r,
|
|
1756
1857
|
size: n,
|
|
1757
|
-
context: o,
|
|
1758
1858
|
rotation: 0
|
|
1759
1859
|
}) : this._basicCornerExtraRounded({
|
|
1760
1860
|
x: e,
|
|
1761
1861
|
y: r,
|
|
1762
1862
|
size: n,
|
|
1763
|
-
context: o,
|
|
1764
1863
|
rotation: Math.PI / 2
|
|
1765
1864
|
}) : this._basicCornerExtraRounded({
|
|
1766
1865
|
x: e,
|
|
1767
1866
|
y: r,
|
|
1768
1867
|
size: n,
|
|
1769
|
-
context: o,
|
|
1770
1868
|
rotation: -Math.PI / 2
|
|
1771
1869
|
}) : this._basicCornersRounded({
|
|
1772
1870
|
x: e,
|
|
1773
1871
|
y: r,
|
|
1774
1872
|
size: n,
|
|
1775
|
-
context: o,
|
|
1776
1873
|
rotation: Math.PI / 2
|
|
1777
1874
|
});
|
|
1778
1875
|
}, t;
|
|
1779
|
-
}()
|
|
1780
|
-
w = "square",
|
|
1781
|
-
_ = "extra-rounded";
|
|
1876
|
+
}();
|
|
1782
1877
|
|
|
1783
|
-
var
|
|
1784
|
-
return (
|
|
1878
|
+
var _d = function d() {
|
|
1879
|
+
return (_d = Object.assign || function (t) {
|
|
1785
1880
|
for (var e, r = 1, n = arguments.length; r < n; r++) {
|
|
1786
1881
|
for (var o in e = arguments[r]) {
|
|
1787
1882
|
Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
|
|
@@ -1792,23 +1887,22 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1792
1887
|
}).apply(this, arguments);
|
|
1793
1888
|
};
|
|
1794
1889
|
|
|
1795
|
-
var
|
|
1890
|
+
var f = function () {
|
|
1796
1891
|
function t(t) {
|
|
1797
|
-
var e = t.
|
|
1892
|
+
var e = t.svg,
|
|
1798
1893
|
r = t.type;
|
|
1799
|
-
this.
|
|
1894
|
+
this._svg = e, this._type = r;
|
|
1800
1895
|
}
|
|
1801
1896
|
|
|
1802
1897
|
return t.prototype.draw = function (t, e, r, n) {
|
|
1803
|
-
var o
|
|
1804
|
-
i = this._context;
|
|
1898
|
+
var o;
|
|
1805
1899
|
|
|
1806
1900
|
switch (this._type) {
|
|
1807
|
-
case
|
|
1901
|
+
case "square":
|
|
1808
1902
|
o = this._drawSquare;
|
|
1809
1903
|
break;
|
|
1810
1904
|
|
|
1811
|
-
case
|
|
1905
|
+
case "extra-rounded":
|
|
1812
1906
|
o = this._drawExtraRounded;
|
|
1813
1907
|
break;
|
|
1814
1908
|
|
|
@@ -1821,98 +1915,95 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1821
1915
|
x: t,
|
|
1822
1916
|
y: e,
|
|
1823
1917
|
size: r,
|
|
1824
|
-
context: i,
|
|
1825
1918
|
rotation: n
|
|
1826
1919
|
});
|
|
1827
1920
|
}, t.prototype._rotateFigure = function (t) {
|
|
1828
|
-
var e
|
|
1829
|
-
r = t.
|
|
1830
|
-
n = t.
|
|
1831
|
-
o = t.
|
|
1921
|
+
var e,
|
|
1922
|
+
r = t.x,
|
|
1923
|
+
n = t.y,
|
|
1924
|
+
o = t.size,
|
|
1832
1925
|
i = t.rotation,
|
|
1833
1926
|
a = void 0 === i ? 0 : i,
|
|
1834
|
-
s =
|
|
1835
|
-
u =
|
|
1836
|
-
|
|
1837
|
-
o.translate(u, c), a && o.rotate(a), s(), o.closePath(), a && o.rotate(-a), o.translate(-u, -c);
|
|
1927
|
+
s = r + o / 2,
|
|
1928
|
+
u = n + o / 2;
|
|
1929
|
+
(0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
|
|
1838
1930
|
}, t.prototype._basicDot = function (t) {
|
|
1839
|
-
var e =
|
|
1840
|
-
r = t.
|
|
1841
|
-
n =
|
|
1931
|
+
var e = this,
|
|
1932
|
+
r = t.size,
|
|
1933
|
+
n = t.x,
|
|
1934
|
+
o = t.y,
|
|
1935
|
+
i = r / 7;
|
|
1842
1936
|
|
|
1843
|
-
this._rotateFigure(
|
|
1937
|
+
this._rotateFigure(_d(_d({}, t), {
|
|
1844
1938
|
draw: function draw() {
|
|
1845
|
-
|
|
1939
|
+
e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("clip-rule", "evenodd"), e._element.setAttribute("d", "M " + (n + r / 2) + " " + o + "a " + r / 2 + " " + r / 2 + " 0 1 0 0.1 0zm 0 " + i + "a " + (r / 2 - i) + " " + (r / 2 - i) + " 0 1 1 -0.1 0Z");
|
|
1846
1940
|
}
|
|
1847
1941
|
}));
|
|
1848
1942
|
}, t.prototype._basicSquare = function (t) {
|
|
1849
|
-
var e =
|
|
1850
|
-
r = t.
|
|
1851
|
-
n =
|
|
1943
|
+
var e = this,
|
|
1944
|
+
r = t.size,
|
|
1945
|
+
n = t.x,
|
|
1946
|
+
o = t.y,
|
|
1947
|
+
i = r / 7;
|
|
1852
1948
|
|
|
1853
|
-
this._rotateFigure(
|
|
1949
|
+
this._rotateFigure(_d(_d({}, t), {
|
|
1854
1950
|
draw: function draw() {
|
|
1855
|
-
|
|
1951
|
+
e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("clip-rule", "evenodd"), e._element.setAttribute("d", "M " + n + " " + o + "v " + r + "h " + r + "v " + -r + "zM " + (n + i) + " " + (o + i) + "h " + (r - 2 * i) + "v " + (r - 2 * i) + "h " + (2 * i - r) + "z");
|
|
1856
1952
|
}
|
|
1857
1953
|
}));
|
|
1858
1954
|
}, t.prototype._basicExtraRounded = function (t) {
|
|
1859
|
-
var e =
|
|
1860
|
-
r = t.
|
|
1861
|
-
n =
|
|
1955
|
+
var e = this,
|
|
1956
|
+
r = t.size,
|
|
1957
|
+
n = t.x,
|
|
1958
|
+
o = t.y,
|
|
1959
|
+
i = r / 7;
|
|
1862
1960
|
|
|
1863
|
-
this._rotateFigure(
|
|
1961
|
+
this._rotateFigure(_d(_d({}, t), {
|
|
1864
1962
|
draw: function draw() {
|
|
1865
|
-
|
|
1963
|
+
e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("clip-rule", "evenodd"), e._element.setAttribute("d", "M " + n + " " + (o + 2.5 * i) + "v " + 2 * i + "a " + 2.5 * i + " " + 2.5 * i + ", 0, 0, 0, " + 2.5 * i + " " + 2.5 * i + "h " + 2 * i + "a " + 2.5 * i + " " + 2.5 * i + ", 0, 0, 0, " + 2.5 * i + " " + 2.5 * -i + "v " + -2 * i + "a " + 2.5 * i + " " + 2.5 * i + ", 0, 0, 0, " + 2.5 * -i + " " + 2.5 * -i + "h " + -2 * i + "a " + 2.5 * i + " " + 2.5 * i + ", 0, 0, 0, " + 2.5 * -i + " " + 2.5 * i + "M " + (n + 2.5 * i) + " " + (o + i) + "h " + 2 * i + "a " + 1.5 * i + " " + 1.5 * i + ", 0, 0, 1, " + 1.5 * i + " " + 1.5 * i + "v " + 2 * i + "a " + 1.5 * i + " " + 1.5 * i + ", 0, 0, 1, " + 1.5 * -i + " " + 1.5 * i + "h " + -2 * i + "a " + 1.5 * i + " " + 1.5 * i + ", 0, 0, 1, " + 1.5 * -i + " " + 1.5 * -i + "v " + -2 * i + "a " + 1.5 * i + " " + 1.5 * i + ", 0, 0, 1, " + 1.5 * i + " " + 1.5 * -i);
|
|
1866
1964
|
}
|
|
1867
1965
|
}));
|
|
1868
1966
|
}, t.prototype._drawDot = function (t) {
|
|
1869
1967
|
var e = t.x,
|
|
1870
1968
|
r = t.y,
|
|
1871
1969
|
n = t.size,
|
|
1872
|
-
o = t.
|
|
1873
|
-
i = t.rotation;
|
|
1970
|
+
o = t.rotation;
|
|
1874
1971
|
|
|
1875
1972
|
this._basicDot({
|
|
1876
1973
|
x: e,
|
|
1877
1974
|
y: r,
|
|
1878
1975
|
size: n,
|
|
1879
|
-
|
|
1880
|
-
rotation: i
|
|
1976
|
+
rotation: o
|
|
1881
1977
|
});
|
|
1882
1978
|
}, t.prototype._drawSquare = function (t) {
|
|
1883
1979
|
var e = t.x,
|
|
1884
1980
|
r = t.y,
|
|
1885
1981
|
n = t.size,
|
|
1886
|
-
o = t.
|
|
1887
|
-
i = t.rotation;
|
|
1982
|
+
o = t.rotation;
|
|
1888
1983
|
|
|
1889
1984
|
this._basicSquare({
|
|
1890
1985
|
x: e,
|
|
1891
1986
|
y: r,
|
|
1892
1987
|
size: n,
|
|
1893
|
-
|
|
1894
|
-
rotation: i
|
|
1988
|
+
rotation: o
|
|
1895
1989
|
});
|
|
1896
1990
|
}, t.prototype._drawExtraRounded = function (t) {
|
|
1897
1991
|
var e = t.x,
|
|
1898
1992
|
r = t.y,
|
|
1899
1993
|
n = t.size,
|
|
1900
|
-
o = t.
|
|
1901
|
-
i = t.rotation;
|
|
1994
|
+
o = t.rotation;
|
|
1902
1995
|
|
|
1903
1996
|
this._basicExtraRounded({
|
|
1904
1997
|
x: e,
|
|
1905
1998
|
y: r,
|
|
1906
1999
|
size: n,
|
|
1907
|
-
|
|
1908
|
-
rotation: i
|
|
2000
|
+
rotation: o
|
|
1909
2001
|
});
|
|
1910
2002
|
}, t;
|
|
1911
|
-
}()
|
|
1912
|
-
x = "square";
|
|
2003
|
+
}();
|
|
1913
2004
|
|
|
1914
|
-
var
|
|
1915
|
-
return (
|
|
2005
|
+
var _g = function g() {
|
|
2006
|
+
return (_g = Object.assign || function (t) {
|
|
1916
2007
|
for (var e, r = 1, n = arguments.length; r < n; r++) {
|
|
1917
2008
|
for (var o in e = arguments[r]) {
|
|
1918
2009
|
Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
|
|
@@ -1923,19 +2014,18 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1923
2014
|
}).apply(this, arguments);
|
|
1924
2015
|
};
|
|
1925
2016
|
|
|
1926
|
-
var
|
|
2017
|
+
var p = function () {
|
|
1927
2018
|
function t(t) {
|
|
1928
|
-
var e = t.
|
|
2019
|
+
var e = t.svg,
|
|
1929
2020
|
r = t.type;
|
|
1930
|
-
this.
|
|
2021
|
+
this._svg = e, this._type = r;
|
|
1931
2022
|
}
|
|
1932
2023
|
|
|
1933
2024
|
return t.prototype.draw = function (t, e, r, n) {
|
|
1934
|
-
var o
|
|
1935
|
-
i = this._context;
|
|
2025
|
+
var o;
|
|
1936
2026
|
|
|
1937
2027
|
switch (this._type) {
|
|
1938
|
-
case
|
|
2028
|
+
case "square":
|
|
1939
2029
|
o = this._drawSquare;
|
|
1940
2030
|
break;
|
|
1941
2031
|
|
|
@@ -1948,1041 +2038,193 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1948
2038
|
x: t,
|
|
1949
2039
|
y: e,
|
|
1950
2040
|
size: r,
|
|
1951
|
-
context: i,
|
|
1952
2041
|
rotation: n
|
|
1953
2042
|
});
|
|
1954
2043
|
}, t.prototype._rotateFigure = function (t) {
|
|
1955
|
-
var e
|
|
1956
|
-
r = t.
|
|
1957
|
-
n = t.
|
|
1958
|
-
o = t.
|
|
2044
|
+
var e,
|
|
2045
|
+
r = t.x,
|
|
2046
|
+
n = t.y,
|
|
2047
|
+
o = t.size,
|
|
1959
2048
|
i = t.rotation,
|
|
1960
2049
|
a = void 0 === i ? 0 : i,
|
|
1961
|
-
s =
|
|
1962
|
-
u =
|
|
1963
|
-
|
|
1964
|
-
o.translate(u, c), a && o.rotate(a), s(), o.closePath(), a && o.rotate(-a), o.translate(-u, -c);
|
|
2050
|
+
s = r + o / 2,
|
|
2051
|
+
u = n + o / 2;
|
|
2052
|
+
(0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
|
|
1965
2053
|
}, t.prototype._basicDot = function (t) {
|
|
1966
|
-
var e =
|
|
1967
|
-
r = t.
|
|
2054
|
+
var e = this,
|
|
2055
|
+
r = t.size,
|
|
2056
|
+
n = t.x,
|
|
2057
|
+
o = t.y;
|
|
1968
2058
|
|
|
1969
|
-
this._rotateFigure(
|
|
2059
|
+
this._rotateFigure(_g(_g({}, t), {
|
|
1970
2060
|
draw: function draw() {
|
|
1971
|
-
|
|
2061
|
+
e._element = document.createElementNS("http://www.w3.org/2000/svg", "circle"), e._element.setAttribute("cx", String(n + r / 2)), e._element.setAttribute("cy", String(o + r / 2)), e._element.setAttribute("r", String(r / 2));
|
|
1972
2062
|
}
|
|
1973
2063
|
}));
|
|
1974
2064
|
}, t.prototype._basicSquare = function (t) {
|
|
1975
|
-
var e =
|
|
1976
|
-
r = t.
|
|
2065
|
+
var e = this,
|
|
2066
|
+
r = t.size,
|
|
2067
|
+
n = t.x,
|
|
2068
|
+
o = t.y;
|
|
1977
2069
|
|
|
1978
|
-
this._rotateFigure(
|
|
2070
|
+
this._rotateFigure(_g(_g({}, t), {
|
|
1979
2071
|
draw: function draw() {
|
|
1980
|
-
|
|
2072
|
+
e._element = document.createElementNS("http://www.w3.org/2000/svg", "rect"), e._element.setAttribute("x", String(n)), e._element.setAttribute("y", String(o)), e._element.setAttribute("width", String(r)), e._element.setAttribute("height", String(r));
|
|
1981
2073
|
}
|
|
1982
2074
|
}));
|
|
1983
2075
|
}, t.prototype._drawDot = function (t) {
|
|
1984
2076
|
var e = t.x,
|
|
1985
2077
|
r = t.y,
|
|
1986
2078
|
n = t.size,
|
|
1987
|
-
o = t.
|
|
1988
|
-
i = t.rotation;
|
|
2079
|
+
o = t.rotation;
|
|
1989
2080
|
|
|
1990
2081
|
this._basicDot({
|
|
1991
2082
|
x: e,
|
|
1992
2083
|
y: r,
|
|
1993
2084
|
size: n,
|
|
1994
|
-
|
|
1995
|
-
rotation: i
|
|
2085
|
+
rotation: o
|
|
1996
2086
|
});
|
|
1997
2087
|
}, t.prototype._drawSquare = function (t) {
|
|
1998
2088
|
var e = t.x,
|
|
1999
2089
|
r = t.y,
|
|
2000
2090
|
n = t.size,
|
|
2001
|
-
o = t.
|
|
2002
|
-
i = t.rotation;
|
|
2091
|
+
o = t.rotation;
|
|
2003
2092
|
|
|
2004
2093
|
this._basicSquare({
|
|
2005
2094
|
x: e,
|
|
2006
2095
|
y: r,
|
|
2007
2096
|
size: n,
|
|
2008
|
-
|
|
2009
|
-
rotation: i
|
|
2097
|
+
rotation: o
|
|
2010
2098
|
});
|
|
2011
2099
|
}, t;
|
|
2012
2100
|
}(),
|
|
2013
|
-
|
|
2101
|
+
v = "circle";
|
|
2014
2102
|
|
|
2015
|
-
var
|
|
2016
|
-
|
|
2103
|
+
var w = function w(t, e, r, n) {
|
|
2104
|
+
return new (r || (r = Promise))(function (o, i) {
|
|
2105
|
+
function a(t) {
|
|
2106
|
+
try {
|
|
2107
|
+
u(n.next(t));
|
|
2108
|
+
} catch (t) {
|
|
2109
|
+
i(t);
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2017
2112
|
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2113
|
+
function s(t) {
|
|
2114
|
+
try {
|
|
2115
|
+
u(n["throw"](t));
|
|
2116
|
+
} catch (t) {
|
|
2117
|
+
i(t);
|
|
2118
|
+
}
|
|
2119
|
+
}
|
|
2022
2120
|
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2121
|
+
function u(t) {
|
|
2122
|
+
var e;
|
|
2123
|
+
t.done ? o(t.value) : (e = t.value, e instanceof r ? e : new r(function (t) {
|
|
2124
|
+
t(e);
|
|
2125
|
+
})).then(a, s);
|
|
2126
|
+
}
|
|
2127
|
+
|
|
2128
|
+
u((n = n.apply(t, e || [])).next());
|
|
2129
|
+
});
|
|
2130
|
+
},
|
|
2131
|
+
y = function y(t, e) {
|
|
2132
|
+
var r,
|
|
2133
|
+
n,
|
|
2134
|
+
o,
|
|
2135
|
+
i,
|
|
2136
|
+
a = {
|
|
2137
|
+
label: 0,
|
|
2138
|
+
sent: function sent() {
|
|
2139
|
+
if (1 & o[0]) throw o[1];
|
|
2140
|
+
return o[1];
|
|
2032
2141
|
},
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
}
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
}, t.prototype.clear = function () {
|
|
2044
|
-
var t = this.context;
|
|
2045
|
-
t && t.clearRect(0, 0, this._canvas.width, this._canvas.height);
|
|
2046
|
-
}, t.prototype.drawQR = function (t) {
|
|
2047
|
-
return e = this, r = void 0, o = function o() {
|
|
2048
|
-
var e,
|
|
2049
|
-
r,
|
|
2050
|
-
n,
|
|
2051
|
-
o,
|
|
2052
|
-
i,
|
|
2053
|
-
a,
|
|
2054
|
-
s,
|
|
2055
|
-
h,
|
|
2056
|
-
d,
|
|
2057
|
-
l = this;
|
|
2058
|
-
return function (t, e) {
|
|
2059
|
-
var r,
|
|
2060
|
-
n,
|
|
2061
|
-
o,
|
|
2062
|
-
i,
|
|
2063
|
-
a = {
|
|
2064
|
-
label: 0,
|
|
2065
|
-
sent: function sent() {
|
|
2066
|
-
if (1 & o[0]) throw o[1];
|
|
2067
|
-
return o[1];
|
|
2068
|
-
},
|
|
2069
|
-
trys: [],
|
|
2070
|
-
ops: []
|
|
2071
|
-
};
|
|
2072
|
-
return i = {
|
|
2073
|
-
next: s(0),
|
|
2074
|
-
"throw": s(1),
|
|
2075
|
-
"return": s(2)
|
|
2076
|
-
}, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
|
|
2077
|
-
return this;
|
|
2078
|
-
}), i;
|
|
2079
|
-
|
|
2080
|
-
function s(i) {
|
|
2081
|
-
return function (s) {
|
|
2082
|
-
return function (i) {
|
|
2083
|
-
if (r) throw new TypeError("Generator is already executing.");
|
|
2084
|
-
|
|
2085
|
-
for (; a;) {
|
|
2086
|
-
try {
|
|
2087
|
-
if (r = 1, n && (o = 2 & i[0] ? n["return"] : i[0] ? n["throw"] || ((o = n["return"]) && o.call(n), 0) : n.next) && !(o = o.call(n, i[1])).done) return o;
|
|
2088
|
-
|
|
2089
|
-
switch (n = 0, o && (i = [2 & i[0], o.value]), i[0]) {
|
|
2090
|
-
case 0:
|
|
2091
|
-
case 1:
|
|
2092
|
-
o = i;
|
|
2093
|
-
break;
|
|
2094
|
-
|
|
2095
|
-
case 4:
|
|
2096
|
-
return a.label++, {
|
|
2097
|
-
value: i[1],
|
|
2098
|
-
done: !1
|
|
2099
|
-
};
|
|
2100
|
-
|
|
2101
|
-
case 5:
|
|
2102
|
-
a.label++, n = i[1], i = [0];
|
|
2103
|
-
continue;
|
|
2104
|
-
|
|
2105
|
-
case 7:
|
|
2106
|
-
i = a.ops.pop(), a.trys.pop();
|
|
2107
|
-
continue;
|
|
2108
|
-
|
|
2109
|
-
default:
|
|
2110
|
-
if (!((o = (o = a.trys).length > 0 && o[o.length - 1]) || 6 !== i[0] && 2 !== i[0])) {
|
|
2111
|
-
a = 0;
|
|
2112
|
-
continue;
|
|
2113
|
-
}
|
|
2114
|
-
|
|
2115
|
-
if (3 === i[0] && (!o || i[1] > o[0] && i[1] < o[3])) {
|
|
2116
|
-
a.label = i[1];
|
|
2117
|
-
break;
|
|
2118
|
-
}
|
|
2119
|
-
|
|
2120
|
-
if (6 === i[0] && a.label < o[1]) {
|
|
2121
|
-
a.label = o[1], o = i;
|
|
2122
|
-
break;
|
|
2123
|
-
}
|
|
2124
|
-
|
|
2125
|
-
if (o && a.label < o[2]) {
|
|
2126
|
-
a.label = o[2], a.ops.push(i);
|
|
2127
|
-
break;
|
|
2128
|
-
}
|
|
2129
|
-
|
|
2130
|
-
o[2] && a.ops.pop(), a.trys.pop();
|
|
2131
|
-
continue;
|
|
2132
|
-
}
|
|
2133
|
-
|
|
2134
|
-
i = e.call(t, a);
|
|
2135
|
-
} catch (t) {
|
|
2136
|
-
i = [6, t], n = 0;
|
|
2137
|
-
} finally {
|
|
2138
|
-
r = o = 0;
|
|
2139
|
-
}
|
|
2140
|
-
}
|
|
2141
|
-
|
|
2142
|
-
if (5 & i[0]) throw i[1];
|
|
2143
|
-
return {
|
|
2144
|
-
value: i[0] ? i[1] : void 0,
|
|
2145
|
-
done: !0
|
|
2146
|
-
};
|
|
2147
|
-
}([i, s]);
|
|
2148
|
-
};
|
|
2149
|
-
}
|
|
2150
|
-
}(this, function (f) {
|
|
2151
|
-
switch (f.label) {
|
|
2152
|
-
case 0:
|
|
2153
|
-
return e = t.getModuleCount(), r = Math.min(this._options.width, this._options.height) - 2 * this._options.margin, n = Math.floor(r / e), o = {
|
|
2154
|
-
hideXDots: 0,
|
|
2155
|
-
hideYDots: 0,
|
|
2156
|
-
width: 0,
|
|
2157
|
-
height: 0
|
|
2158
|
-
}, this._qr = t, this._options.image ? [4, this.loadImage()] : [3, 2];
|
|
2159
|
-
|
|
2160
|
-
case 1:
|
|
2161
|
-
if (f.sent(), !this._image) return [2];
|
|
2162
|
-
i = this._options, a = i.imageOptions, s = i.qrOptions, h = a.imageSize * c[s.errorCorrectionLevel], d = Math.floor(h * e * e), o = u({
|
|
2163
|
-
originalWidth: this._image.width,
|
|
2164
|
-
originalHeight: this._image.height,
|
|
2165
|
-
maxHiddenDots: d,
|
|
2166
|
-
maxHiddenAxisDots: e - 14,
|
|
2167
|
-
dotSize: n
|
|
2168
|
-
}), f.label = 2;
|
|
2169
|
-
|
|
2170
|
-
case 2:
|
|
2171
|
-
return this.clear(), this.drawBackground(), this.drawDots(function (t, r) {
|
|
2172
|
-
var n, i, a, s, u, c;
|
|
2173
|
-
return !(l._options.imageOptions.hideBackgroundDots && t >= (e - o.hideXDots) / 2 && t < (e + o.hideXDots) / 2 && r >= (e - o.hideYDots) / 2 && r < (e + o.hideYDots) / 2 || (null === (n = P[t]) || void 0 === n ? void 0 : n[r]) || (null === (i = P[t - e + 7]) || void 0 === i ? void 0 : i[r]) || (null === (a = P[t]) || void 0 === a ? void 0 : a[r - e + 7]) || (null === (s = O[t]) || void 0 === s ? void 0 : s[r]) || (null === (u = O[t - e + 7]) || void 0 === u ? void 0 : u[r]) || (null === (c = O[t]) || void 0 === c ? void 0 : c[r - e + 7]));
|
|
2174
|
-
}), this.drawCorners(), this._options.image && this.drawImage({
|
|
2175
|
-
width: o.width,
|
|
2176
|
-
height: o.height,
|
|
2177
|
-
count: e,
|
|
2178
|
-
dotSize: n
|
|
2179
|
-
}), [2];
|
|
2180
|
-
}
|
|
2181
|
-
});
|
|
2182
|
-
}, new ((n = void 0) || (n = Promise))(function (t, i) {
|
|
2183
|
-
function a(t) {
|
|
2184
|
-
try {
|
|
2185
|
-
u(o.next(t));
|
|
2186
|
-
} catch (t) {
|
|
2187
|
-
i(t);
|
|
2188
|
-
}
|
|
2189
|
-
}
|
|
2190
|
-
|
|
2191
|
-
function s(t) {
|
|
2192
|
-
try {
|
|
2193
|
-
u(o["throw"](t));
|
|
2194
|
-
} catch (t) {
|
|
2195
|
-
i(t);
|
|
2196
|
-
}
|
|
2197
|
-
}
|
|
2198
|
-
|
|
2199
|
-
function u(e) {
|
|
2200
|
-
var r;
|
|
2201
|
-
e.done ? t(e.value) : (r = e.value, r instanceof n ? r : new n(function (t) {
|
|
2202
|
-
t(r);
|
|
2203
|
-
})).then(a, s);
|
|
2204
|
-
}
|
|
2205
|
-
|
|
2206
|
-
u((o = o.apply(e, r || [])).next());
|
|
2207
|
-
});
|
|
2208
|
-
var e, r, n, o;
|
|
2209
|
-
}, t.prototype.drawBackground = function () {
|
|
2210
|
-
var t = this.context,
|
|
2211
|
-
e = this._options;
|
|
2212
|
-
|
|
2213
|
-
if (t) {
|
|
2214
|
-
if (e.backgroundOptions.gradient) {
|
|
2215
|
-
var r = e.backgroundOptions.gradient,
|
|
2216
|
-
n = this._createGradient({
|
|
2217
|
-
context: t,
|
|
2218
|
-
options: r,
|
|
2219
|
-
additionalRotation: 0,
|
|
2220
|
-
x: 0,
|
|
2221
|
-
y: 0,
|
|
2222
|
-
size: this._canvas.width > this._canvas.height ? this._canvas.width : this._canvas.height
|
|
2223
|
-
});
|
|
2224
|
-
|
|
2225
|
-
r.colorStops.forEach(function (t) {
|
|
2226
|
-
var e = t.offset,
|
|
2227
|
-
r = t.color;
|
|
2228
|
-
n.addColorStop(e, r);
|
|
2229
|
-
}), t.fillStyle = n;
|
|
2230
|
-
} else e.backgroundOptions.color && (t.fillStyle = e.backgroundOptions.color);
|
|
2231
|
-
|
|
2232
|
-
t.fillRect(0, 0, this._canvas.width, this._canvas.height);
|
|
2233
|
-
}
|
|
2234
|
-
}, t.prototype.drawDots = function (t) {
|
|
2235
|
-
var e = this;
|
|
2236
|
-
if (!this._qr) throw "QR code is not defined";
|
|
2237
|
-
var r = this.context;
|
|
2238
|
-
if (!r) throw "QR code is not defined";
|
|
2239
|
-
|
|
2240
|
-
var n = this._options,
|
|
2241
|
-
o = this._qr.getModuleCount();
|
|
2242
|
-
|
|
2243
|
-
if (o > n.width || o > n.height) throw "The canvas is too small.";
|
|
2244
|
-
var i = Math.min(n.width, n.height) - 2 * n.margin,
|
|
2245
|
-
a = Math.floor(i / o),
|
|
2246
|
-
s = Math.floor((n.width - o * a) / 2),
|
|
2247
|
-
u = Math.floor((n.height - o * a) / 2),
|
|
2248
|
-
c = new y({
|
|
2249
|
-
context: r,
|
|
2250
|
-
type: n.dotsOptions.type
|
|
2251
|
-
});
|
|
2252
|
-
r.beginPath();
|
|
2253
|
-
|
|
2254
|
-
for (var h = function h(r) {
|
|
2255
|
-
for (var n = function n(_n2) {
|
|
2256
|
-
return t && !t(r, _n2) ? "continue" : d._qr.isDark(r, _n2) ? void c.draw(s + r * a, u + _n2 * a, a, function (i, a) {
|
|
2257
|
-
return !(r + i < 0 || _n2 + a < 0 || r + i >= o || _n2 + a >= o) && !(t && !t(r + i, _n2 + a)) && !!e._qr && e._qr.isDark(r + i, _n2 + a);
|
|
2258
|
-
}) : "continue";
|
|
2259
|
-
}, i = 0; i < o; i++) {
|
|
2260
|
-
n(i);
|
|
2261
|
-
}
|
|
2262
|
-
}, d = this, l = 0; l < o; l++) {
|
|
2263
|
-
h(l);
|
|
2264
|
-
}
|
|
2265
|
-
|
|
2266
|
-
if (n.dotsOptions.gradient) {
|
|
2267
|
-
var f = n.dotsOptions.gradient,
|
|
2268
|
-
p = this._createGradient({
|
|
2269
|
-
context: r,
|
|
2270
|
-
options: f,
|
|
2271
|
-
additionalRotation: 0,
|
|
2272
|
-
x: s,
|
|
2273
|
-
y: u,
|
|
2274
|
-
size: o * a
|
|
2275
|
-
});
|
|
2276
|
-
|
|
2277
|
-
f.colorStops.forEach(function (t) {
|
|
2278
|
-
var e = t.offset,
|
|
2279
|
-
r = t.color;
|
|
2280
|
-
p.addColorStop(e, r);
|
|
2281
|
-
}), r.fillStyle = r.strokeStyle = p;
|
|
2282
|
-
} else n.dotsOptions.color && (r.fillStyle = r.strokeStyle = n.dotsOptions.color);
|
|
2283
|
-
|
|
2284
|
-
r.fill("evenodd");
|
|
2285
|
-
}, t.prototype.drawCorners = function (t) {
|
|
2286
|
-
var e = this;
|
|
2287
|
-
if (!this._qr) throw "QR code is not defined";
|
|
2288
|
-
var r = this.context;
|
|
2289
|
-
if (!r) throw "QR code is not defined";
|
|
2290
|
-
|
|
2291
|
-
var n = this._options,
|
|
2292
|
-
o = this._qr.getModuleCount(),
|
|
2293
|
-
i = Math.min(n.width, n.height) - 2 * n.margin,
|
|
2294
|
-
a = Math.floor(i / o),
|
|
2295
|
-
s = 7 * a,
|
|
2296
|
-
u = 3 * a,
|
|
2297
|
-
c = Math.floor((n.width - o * a) / 2),
|
|
2298
|
-
h = Math.floor((n.height - o * a) / 2);
|
|
2299
|
-
|
|
2300
|
-
[[0, 0, 0], [1, 0, Math.PI / 2], [0, 1, -Math.PI / 2]].forEach(function (i) {
|
|
2301
|
-
var d,
|
|
2302
|
-
l,
|
|
2303
|
-
f,
|
|
2304
|
-
p,
|
|
2305
|
-
g,
|
|
2306
|
-
v,
|
|
2307
|
-
w,
|
|
2308
|
-
_,
|
|
2309
|
-
m,
|
|
2310
|
-
x,
|
|
2311
|
-
M = i[0],
|
|
2312
|
-
C = i[1],
|
|
2313
|
-
z = i[2];
|
|
2314
|
-
|
|
2315
|
-
if (!t || t(M, C)) {
|
|
2316
|
-
var D = c + M * a * (o - 7),
|
|
2317
|
-
I = h + C * a * (o - 7);
|
|
2318
|
-
|
|
2319
|
-
if (null === (d = n.cornersSquareOptions) || void 0 === d ? void 0 : d.type) {
|
|
2320
|
-
var A = new b({
|
|
2321
|
-
context: r,
|
|
2322
|
-
type: null === (l = n.cornersSquareOptions) || void 0 === l ? void 0 : l.type
|
|
2323
|
-
});
|
|
2324
|
-
r.beginPath(), A.draw(D, I, s, z);
|
|
2325
|
-
} else {
|
|
2326
|
-
var k = new y({
|
|
2327
|
-
context: r,
|
|
2328
|
-
type: n.dotsOptions.type
|
|
2329
|
-
});
|
|
2330
|
-
r.beginPath();
|
|
2331
|
-
|
|
2332
|
-
for (var q = function q(t) {
|
|
2333
|
-
for (var e = function e(_e2) {
|
|
2334
|
-
if (!(null === (f = P[t]) || void 0 === f ? void 0 : f[_e2])) return "continue";
|
|
2335
|
-
k.draw(D + t * a, I + _e2 * a, a, function (r, n) {
|
|
2336
|
-
var o;
|
|
2337
|
-
return !!(null === (o = P[t + r]) || void 0 === o ? void 0 : o[_e2 + n]);
|
|
2338
|
-
});
|
|
2339
|
-
}, r = 0; r < P[t].length; r++) {
|
|
2340
|
-
e(r);
|
|
2341
|
-
}
|
|
2342
|
-
}, R = 0; R < P.length; R++) {
|
|
2343
|
-
q(R);
|
|
2344
|
-
}
|
|
2345
|
-
}
|
|
2346
|
-
|
|
2347
|
-
if (null === (p = n.cornersSquareOptions) || void 0 === p ? void 0 : p.gradient) {
|
|
2348
|
-
var B = n.cornersSquareOptions.gradient,
|
|
2349
|
-
E = e._createGradient({
|
|
2350
|
-
context: r,
|
|
2351
|
-
options: B,
|
|
2352
|
-
additionalRotation: z,
|
|
2353
|
-
x: D,
|
|
2354
|
-
y: I,
|
|
2355
|
-
size: s
|
|
2356
|
-
});
|
|
2357
|
-
|
|
2358
|
-
B.colorStops.forEach(function (t) {
|
|
2359
|
-
var e = t.offset,
|
|
2360
|
-
r = t.color;
|
|
2361
|
-
E.addColorStop(e, r);
|
|
2362
|
-
}), r.fillStyle = r.strokeStyle = E;
|
|
2363
|
-
} else (null === (g = n.cornersSquareOptions) || void 0 === g ? void 0 : g.color) && (r.fillStyle = r.strokeStyle = n.cornersSquareOptions.color);
|
|
2364
|
-
|
|
2365
|
-
if (r.fill("evenodd"), null === (v = n.cornersDotOptions) || void 0 === v ? void 0 : v.type) {
|
|
2366
|
-
var L = new S({
|
|
2367
|
-
context: r,
|
|
2368
|
-
type: null === (w = n.cornersDotOptions) || void 0 === w ? void 0 : w.type
|
|
2369
|
-
});
|
|
2370
|
-
r.beginPath(), L.draw(D + 2 * a, I + 2 * a, u, z);
|
|
2371
|
-
} else {
|
|
2372
|
-
k = new y({
|
|
2373
|
-
context: r,
|
|
2374
|
-
type: n.dotsOptions.type
|
|
2375
|
-
}), r.beginPath();
|
|
2376
|
-
|
|
2377
|
-
var N = function N(t) {
|
|
2378
|
-
for (var e = function e(_e3) {
|
|
2379
|
-
if (!(null === (_ = O[t]) || void 0 === _ ? void 0 : _[_e3])) return "continue";
|
|
2380
|
-
k.draw(D + t * a, I + _e3 * a, a, function (r, n) {
|
|
2381
|
-
var o;
|
|
2382
|
-
return !!(null === (o = O[t + r]) || void 0 === o ? void 0 : o[_e3 + n]);
|
|
2383
|
-
});
|
|
2384
|
-
}, r = 0; r < O[t].length; r++) {
|
|
2385
|
-
e(r);
|
|
2386
|
-
}
|
|
2387
|
-
};
|
|
2388
|
-
|
|
2389
|
-
for (R = 0; R < O.length; R++) {
|
|
2390
|
-
N(R);
|
|
2391
|
-
}
|
|
2392
|
-
}
|
|
2393
|
-
|
|
2394
|
-
if (null === (m = n.cornersDotOptions) || void 0 === m ? void 0 : m.gradient) {
|
|
2395
|
-
B = n.cornersDotOptions.gradient;
|
|
2396
|
-
|
|
2397
|
-
var T = e._createGradient({
|
|
2398
|
-
context: r,
|
|
2399
|
-
options: B,
|
|
2400
|
-
additionalRotation: z,
|
|
2401
|
-
x: D + 2 * a,
|
|
2402
|
-
y: I + 2 * a,
|
|
2403
|
-
size: u
|
|
2404
|
-
});
|
|
2405
|
-
|
|
2406
|
-
B.colorStops.forEach(function (t) {
|
|
2407
|
-
var e = t.offset,
|
|
2408
|
-
r = t.color;
|
|
2409
|
-
T.addColorStop(e, r);
|
|
2410
|
-
}), r.fillStyle = r.strokeStyle = T;
|
|
2411
|
-
} else (null === (x = n.cornersDotOptions) || void 0 === x ? void 0 : x.color) && (r.fillStyle = r.strokeStyle = n.cornersDotOptions.color);
|
|
2412
|
-
|
|
2413
|
-
r.fill("evenodd");
|
|
2414
|
-
}
|
|
2415
|
-
});
|
|
2416
|
-
}, t.prototype.loadImage = function () {
|
|
2417
|
-
var t = this;
|
|
2418
|
-
return new Promise(function (e, r) {
|
|
2419
|
-
var n = t._options,
|
|
2420
|
-
o = new Image();
|
|
2421
|
-
if (!n.image) return r("Image is not defined");
|
|
2422
|
-
"string" == typeof n.imageOptions.crossOrigin && (o.crossOrigin = n.imageOptions.crossOrigin), t._image = o, o.onload = function () {
|
|
2423
|
-
e();
|
|
2424
|
-
}, o.src = n.image;
|
|
2425
|
-
});
|
|
2426
|
-
}, t.prototype.drawImage = function (t) {
|
|
2427
|
-
var e = t.width,
|
|
2428
|
-
r = t.height,
|
|
2429
|
-
n = t.count,
|
|
2430
|
-
o = t.dotSize,
|
|
2431
|
-
i = this.context;
|
|
2432
|
-
if (!i) throw "canvasContext is not defined";
|
|
2433
|
-
if (!this._image) throw "image is not defined";
|
|
2434
|
-
var a = this._options,
|
|
2435
|
-
s = Math.floor((a.width - n * o) / 2),
|
|
2436
|
-
u = Math.floor((a.height - n * o) / 2),
|
|
2437
|
-
c = s + a.imageOptions.margin + (n * o - e) / 2,
|
|
2438
|
-
h = u + a.imageOptions.margin + (n * o - r) / 2,
|
|
2439
|
-
d = e - 2 * a.imageOptions.margin,
|
|
2440
|
-
l = r - 2 * a.imageOptions.margin;
|
|
2441
|
-
i.drawImage(this._image, c, h, d < 0 ? 0 : d, l < 0 ? 0 : l);
|
|
2442
|
-
}, t.prototype._createGradient = function (t) {
|
|
2443
|
-
var e,
|
|
2444
|
-
r = t.context,
|
|
2445
|
-
n = t.options,
|
|
2446
|
-
o = t.additionalRotation,
|
|
2447
|
-
i = t.x,
|
|
2448
|
-
a = t.y,
|
|
2449
|
-
s = t.size;
|
|
2450
|
-
if (n.type === C) e = r.createRadialGradient(i + s / 2, a + s / 2, 0, i + s / 2, a + s / 2, s / 2);else {
|
|
2451
|
-
var u = ((n.rotation || 0) + o) % (2 * Math.PI),
|
|
2452
|
-
c = (u + 2 * Math.PI) % (2 * Math.PI),
|
|
2453
|
-
h = i + s / 2,
|
|
2454
|
-
d = a + s / 2,
|
|
2455
|
-
l = i + s / 2,
|
|
2456
|
-
f = a + s / 2;
|
|
2457
|
-
c >= 0 && c <= .25 * Math.PI || c > 1.75 * Math.PI && c <= 2 * Math.PI ? (h -= s / 2, d -= s / 2 * Math.tan(u), l += s / 2, f += s / 2 * Math.tan(u)) : c > .25 * Math.PI && c <= .75 * Math.PI ? (d -= s / 2, h -= s / 2 / Math.tan(u), f += s / 2, l += s / 2 / Math.tan(u)) : c > .75 * Math.PI && c <= 1.25 * Math.PI ? (h += s / 2, d += s / 2 * Math.tan(u), l -= s / 2, f -= s / 2 * Math.tan(u)) : c > 1.25 * Math.PI && c <= 1.75 * Math.PI && (d += s / 2, h += s / 2 / Math.tan(u), f -= s / 2, l -= s / 2 / Math.tan(u)), e = r.createLinearGradient(Math.round(h), Math.round(d), Math.round(l), Math.round(f));
|
|
2458
|
-
}
|
|
2459
|
-
return e;
|
|
2460
|
-
}, t;
|
|
2461
|
-
}();
|
|
2462
|
-
|
|
2463
|
-
var _D = function D() {
|
|
2464
|
-
return (_D = Object.assign || function (t) {
|
|
2465
|
-
for (var e, r = 1, n = arguments.length; r < n; r++) {
|
|
2466
|
-
for (var o in e = arguments[r]) {
|
|
2467
|
-
Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
|
|
2468
|
-
}
|
|
2469
|
-
}
|
|
2470
|
-
|
|
2471
|
-
return t;
|
|
2472
|
-
}).apply(this, arguments);
|
|
2473
|
-
};
|
|
2474
|
-
|
|
2475
|
-
var I = function () {
|
|
2476
|
-
function t(t) {
|
|
2477
|
-
var e = t.svg,
|
|
2478
|
-
r = t.type;
|
|
2479
|
-
this._svg = e, this._type = r;
|
|
2480
|
-
}
|
|
2481
|
-
|
|
2482
|
-
return t.prototype.draw = function (t, e, r, n) {
|
|
2483
|
-
var o;
|
|
2484
|
-
|
|
2485
|
-
switch (this._type) {
|
|
2486
|
-
case h:
|
|
2487
|
-
o = this._drawDot;
|
|
2488
|
-
break;
|
|
2489
|
-
|
|
2490
|
-
case l:
|
|
2491
|
-
o = this._drawClassy;
|
|
2492
|
-
break;
|
|
2493
|
-
|
|
2494
|
-
case f:
|
|
2495
|
-
o = this._drawClassyRounded;
|
|
2496
|
-
break;
|
|
2497
|
-
|
|
2498
|
-
case d:
|
|
2499
|
-
o = this._drawRounded;
|
|
2500
|
-
break;
|
|
2501
|
-
|
|
2502
|
-
case g:
|
|
2503
|
-
o = this._drawExtraRounded;
|
|
2504
|
-
break;
|
|
2505
|
-
|
|
2506
|
-
case p:
|
|
2507
|
-
default:
|
|
2508
|
-
o = this._drawSquare;
|
|
2509
|
-
}
|
|
2510
|
-
|
|
2511
|
-
o.call(this, {
|
|
2512
|
-
x: t,
|
|
2513
|
-
y: e,
|
|
2514
|
-
size: r,
|
|
2515
|
-
getNeighbor: n
|
|
2516
|
-
});
|
|
2517
|
-
}, t.prototype._rotateFigure = function (t) {
|
|
2518
|
-
var e,
|
|
2519
|
-
r = t.x,
|
|
2520
|
-
n = t.y,
|
|
2521
|
-
o = t.size,
|
|
2522
|
-
i = t.rotation,
|
|
2523
|
-
a = void 0 === i ? 0 : i,
|
|
2524
|
-
s = r + o / 2,
|
|
2525
|
-
u = n + o / 2;
|
|
2526
|
-
(0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
|
|
2527
|
-
}, t.prototype._basicDot = function (t) {
|
|
2528
|
-
var e = this,
|
|
2529
|
-
r = t.size,
|
|
2530
|
-
n = t.x,
|
|
2531
|
-
o = t.y;
|
|
2532
|
-
|
|
2533
|
-
this._rotateFigure(_D(_D({}, t), {
|
|
2534
|
-
draw: function draw() {
|
|
2535
|
-
e._element = document.createElementNS("http://www.w3.org/2000/svg", "circle"), e._element.setAttribute("cx", String(n + r / 2)), e._element.setAttribute("cy", String(o + r / 2)), e._element.setAttribute("r", String(r / 2));
|
|
2536
|
-
}
|
|
2537
|
-
}));
|
|
2538
|
-
}, t.prototype._basicSquare = function (t) {
|
|
2539
|
-
var e = this,
|
|
2540
|
-
r = t.size,
|
|
2541
|
-
n = t.x,
|
|
2542
|
-
o = t.y;
|
|
2543
|
-
|
|
2544
|
-
this._rotateFigure(_D(_D({}, t), {
|
|
2545
|
-
draw: function draw() {
|
|
2546
|
-
e._element = document.createElementNS("http://www.w3.org/2000/svg", "rect"), e._element.setAttribute("x", String(n)), e._element.setAttribute("y", String(o)), e._element.setAttribute("width", String(r)), e._element.setAttribute("height", String(r));
|
|
2547
|
-
}
|
|
2548
|
-
}));
|
|
2549
|
-
}, t.prototype._basicSideRounded = function (t) {
|
|
2550
|
-
var e = this,
|
|
2551
|
-
r = t.size,
|
|
2552
|
-
n = t.x,
|
|
2553
|
-
o = t.y;
|
|
2554
|
-
|
|
2555
|
-
this._rotateFigure(_D(_D({}, t), {
|
|
2556
|
-
draw: function draw() {
|
|
2557
|
-
e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("d", "M " + n + " " + o + "v " + r + "h " + r / 2 + "a " + r / 2 + " " + r / 2 + ", 0, 0, 0, 0 " + -r);
|
|
2558
|
-
}
|
|
2559
|
-
}));
|
|
2560
|
-
}, t.prototype._basicCornerRounded = function (t) {
|
|
2561
|
-
var e = this,
|
|
2562
|
-
r = t.size,
|
|
2563
|
-
n = t.x,
|
|
2564
|
-
o = t.y;
|
|
2565
|
-
|
|
2566
|
-
this._rotateFigure(_D(_D({}, t), {
|
|
2567
|
-
draw: function draw() {
|
|
2568
|
-
e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("d", "M " + n + " " + o + "v " + r + "h " + r + "v " + -r / 2 + "a " + r / 2 + " " + r / 2 + ", 0, 0, 0, " + -r / 2 + " " + -r / 2);
|
|
2569
|
-
}
|
|
2570
|
-
}));
|
|
2571
|
-
}, t.prototype._basicCornerExtraRounded = function (t) {
|
|
2572
|
-
var e = this,
|
|
2573
|
-
r = t.size,
|
|
2574
|
-
n = t.x,
|
|
2575
|
-
o = t.y;
|
|
2576
|
-
|
|
2577
|
-
this._rotateFigure(_D(_D({}, t), {
|
|
2578
|
-
draw: function draw() {
|
|
2579
|
-
e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("d", "M " + n + " " + o + "v " + r + "h " + r + "a " + r + " " + r + ", 0, 0, 0, " + -r + " " + -r);
|
|
2580
|
-
}
|
|
2581
|
-
}));
|
|
2582
|
-
}, t.prototype._basicCornersRounded = function (t) {
|
|
2583
|
-
var e = this,
|
|
2584
|
-
r = t.size,
|
|
2585
|
-
n = t.x,
|
|
2586
|
-
o = t.y;
|
|
2587
|
-
|
|
2588
|
-
this._rotateFigure(_D(_D({}, t), {
|
|
2589
|
-
draw: function draw() {
|
|
2590
|
-
e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("d", "M " + n + " " + o + "v " + r / 2 + "a " + r / 2 + " " + r / 2 + ", 0, 0, 0, " + r / 2 + " " + r / 2 + "h " + r / 2 + "v " + -r / 2 + "a " + r / 2 + " " + r / 2 + ", 0, 0, 0, " + -r / 2 + " " + -r / 2);
|
|
2591
|
-
}
|
|
2592
|
-
}));
|
|
2593
|
-
}, t.prototype._drawDot = function (t) {
|
|
2594
|
-
var e = t.x,
|
|
2595
|
-
r = t.y,
|
|
2596
|
-
n = t.size;
|
|
2597
|
-
|
|
2598
|
-
this._basicDot({
|
|
2599
|
-
x: e,
|
|
2600
|
-
y: r,
|
|
2601
|
-
size: n,
|
|
2602
|
-
rotation: 0
|
|
2603
|
-
});
|
|
2604
|
-
}, t.prototype._drawSquare = function (t) {
|
|
2605
|
-
var e = t.x,
|
|
2606
|
-
r = t.y,
|
|
2607
|
-
n = t.size;
|
|
2608
|
-
|
|
2609
|
-
this._basicSquare({
|
|
2610
|
-
x: e,
|
|
2611
|
-
y: r,
|
|
2612
|
-
size: n,
|
|
2613
|
-
rotation: 0
|
|
2614
|
-
});
|
|
2615
|
-
}, t.prototype._drawRounded = function (t) {
|
|
2616
|
-
var e = t.x,
|
|
2617
|
-
r = t.y,
|
|
2618
|
-
n = t.size,
|
|
2619
|
-
o = t.getNeighbor,
|
|
2620
|
-
i = o ? +o(-1, 0) : 0,
|
|
2621
|
-
a = o ? +o(1, 0) : 0,
|
|
2622
|
-
s = o ? +o(0, -1) : 0,
|
|
2623
|
-
u = o ? +o(0, 1) : 0,
|
|
2624
|
-
c = i + a + s + u;
|
|
2625
|
-
if (0 !== c) {
|
|
2626
|
-
if (c > 2 || i && a || s && u) this._basicSquare({
|
|
2627
|
-
x: e,
|
|
2628
|
-
y: r,
|
|
2629
|
-
size: n,
|
|
2630
|
-
rotation: 0
|
|
2631
|
-
});else {
|
|
2632
|
-
if (2 === c) {
|
|
2633
|
-
var h = 0;
|
|
2634
|
-
return i && s ? h = Math.PI / 2 : s && a ? h = Math.PI : a && u && (h = -Math.PI / 2), void this._basicCornerRounded({
|
|
2635
|
-
x: e,
|
|
2636
|
-
y: r,
|
|
2637
|
-
size: n,
|
|
2638
|
-
rotation: h
|
|
2639
|
-
});
|
|
2640
|
-
}
|
|
2641
|
-
|
|
2642
|
-
if (1 === c) return h = 0, s ? h = Math.PI / 2 : a ? h = Math.PI : u && (h = -Math.PI / 2), void this._basicSideRounded({
|
|
2643
|
-
x: e,
|
|
2644
|
-
y: r,
|
|
2645
|
-
size: n,
|
|
2646
|
-
rotation: h
|
|
2647
|
-
});
|
|
2648
|
-
}
|
|
2649
|
-
} else this._basicDot({
|
|
2650
|
-
x: e,
|
|
2651
|
-
y: r,
|
|
2652
|
-
size: n,
|
|
2653
|
-
rotation: 0
|
|
2654
|
-
});
|
|
2655
|
-
}, t.prototype._drawExtraRounded = function (t) {
|
|
2656
|
-
var e = t.x,
|
|
2657
|
-
r = t.y,
|
|
2658
|
-
n = t.size,
|
|
2659
|
-
o = t.getNeighbor,
|
|
2660
|
-
i = o ? +o(-1, 0) : 0,
|
|
2661
|
-
a = o ? +o(1, 0) : 0,
|
|
2662
|
-
s = o ? +o(0, -1) : 0,
|
|
2663
|
-
u = o ? +o(0, 1) : 0,
|
|
2664
|
-
c = i + a + s + u;
|
|
2665
|
-
if (0 !== c) {
|
|
2666
|
-
if (c > 2 || i && a || s && u) this._basicSquare({
|
|
2667
|
-
x: e,
|
|
2668
|
-
y: r,
|
|
2669
|
-
size: n,
|
|
2670
|
-
rotation: 0
|
|
2671
|
-
});else {
|
|
2672
|
-
if (2 === c) {
|
|
2673
|
-
var h = 0;
|
|
2674
|
-
return i && s ? h = Math.PI / 2 : s && a ? h = Math.PI : a && u && (h = -Math.PI / 2), void this._basicCornerExtraRounded({
|
|
2675
|
-
x: e,
|
|
2676
|
-
y: r,
|
|
2677
|
-
size: n,
|
|
2678
|
-
rotation: h
|
|
2679
|
-
});
|
|
2680
|
-
}
|
|
2681
|
-
|
|
2682
|
-
if (1 === c) return h = 0, s ? h = Math.PI / 2 : a ? h = Math.PI : u && (h = -Math.PI / 2), void this._basicSideRounded({
|
|
2683
|
-
x: e,
|
|
2684
|
-
y: r,
|
|
2685
|
-
size: n,
|
|
2686
|
-
rotation: h
|
|
2687
|
-
});
|
|
2688
|
-
}
|
|
2689
|
-
} else this._basicDot({
|
|
2690
|
-
x: e,
|
|
2691
|
-
y: r,
|
|
2692
|
-
size: n,
|
|
2693
|
-
rotation: 0
|
|
2694
|
-
});
|
|
2695
|
-
}, t.prototype._drawClassy = function (t) {
|
|
2696
|
-
var e = t.x,
|
|
2697
|
-
r = t.y,
|
|
2698
|
-
n = t.size,
|
|
2699
|
-
o = t.getNeighbor,
|
|
2700
|
-
i = o ? +o(-1, 0) : 0,
|
|
2701
|
-
a = o ? +o(1, 0) : 0,
|
|
2702
|
-
s = o ? +o(0, -1) : 0,
|
|
2703
|
-
u = o ? +o(0, 1) : 0;
|
|
2704
|
-
0 !== i + a + s + u ? i || s ? a || u ? this._basicSquare({
|
|
2705
|
-
x: e,
|
|
2706
|
-
y: r,
|
|
2707
|
-
size: n,
|
|
2708
|
-
rotation: 0
|
|
2709
|
-
}) : this._basicCornerRounded({
|
|
2710
|
-
x: e,
|
|
2711
|
-
y: r,
|
|
2712
|
-
size: n,
|
|
2713
|
-
rotation: Math.PI / 2
|
|
2714
|
-
}) : this._basicCornerRounded({
|
|
2715
|
-
x: e,
|
|
2716
|
-
y: r,
|
|
2717
|
-
size: n,
|
|
2718
|
-
rotation: -Math.PI / 2
|
|
2719
|
-
}) : this._basicCornersRounded({
|
|
2720
|
-
x: e,
|
|
2721
|
-
y: r,
|
|
2722
|
-
size: n,
|
|
2723
|
-
rotation: Math.PI / 2
|
|
2724
|
-
});
|
|
2725
|
-
}, t.prototype._drawClassyRounded = function (t) {
|
|
2726
|
-
var e = t.x,
|
|
2727
|
-
r = t.y,
|
|
2728
|
-
n = t.size,
|
|
2729
|
-
o = t.getNeighbor,
|
|
2730
|
-
i = o ? +o(-1, 0) : 0,
|
|
2731
|
-
a = o ? +o(1, 0) : 0,
|
|
2732
|
-
s = o ? +o(0, -1) : 0,
|
|
2733
|
-
u = o ? +o(0, 1) : 0;
|
|
2734
|
-
0 !== i + a + s + u ? i || s ? a || u ? this._basicSquare({
|
|
2735
|
-
x: e,
|
|
2736
|
-
y: r,
|
|
2737
|
-
size: n,
|
|
2738
|
-
rotation: 0
|
|
2739
|
-
}) : this._basicCornerExtraRounded({
|
|
2740
|
-
x: e,
|
|
2741
|
-
y: r,
|
|
2742
|
-
size: n,
|
|
2743
|
-
rotation: Math.PI / 2
|
|
2744
|
-
}) : this._basicCornerExtraRounded({
|
|
2745
|
-
x: e,
|
|
2746
|
-
y: r,
|
|
2747
|
-
size: n,
|
|
2748
|
-
rotation: -Math.PI / 2
|
|
2749
|
-
}) : this._basicCornersRounded({
|
|
2750
|
-
x: e,
|
|
2751
|
-
y: r,
|
|
2752
|
-
size: n,
|
|
2753
|
-
rotation: Math.PI / 2
|
|
2754
|
-
});
|
|
2755
|
-
}, t;
|
|
2756
|
-
}();
|
|
2757
|
-
|
|
2758
|
-
var _A = function A() {
|
|
2759
|
-
return (_A = Object.assign || function (t) {
|
|
2760
|
-
for (var e, r = 1, n = arguments.length; r < n; r++) {
|
|
2761
|
-
for (var o in e = arguments[r]) {
|
|
2762
|
-
Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
|
|
2763
|
-
}
|
|
2764
|
-
}
|
|
2765
|
-
|
|
2766
|
-
return t;
|
|
2767
|
-
}).apply(this, arguments);
|
|
2768
|
-
};
|
|
2769
|
-
|
|
2770
|
-
var k = function () {
|
|
2771
|
-
function t(t) {
|
|
2772
|
-
var e = t.svg,
|
|
2773
|
-
r = t.type;
|
|
2774
|
-
this._svg = e, this._type = r;
|
|
2775
|
-
}
|
|
2776
|
-
|
|
2777
|
-
return t.prototype.draw = function (t, e, r, n) {
|
|
2778
|
-
var o;
|
|
2779
|
-
|
|
2780
|
-
switch (this._type) {
|
|
2781
|
-
case w:
|
|
2782
|
-
o = this._drawSquare;
|
|
2783
|
-
break;
|
|
2784
|
-
|
|
2785
|
-
case _:
|
|
2786
|
-
o = this._drawExtraRounded;
|
|
2787
|
-
break;
|
|
2788
|
-
|
|
2789
|
-
case "dot":
|
|
2790
|
-
default:
|
|
2791
|
-
o = this._drawDot;
|
|
2792
|
-
}
|
|
2793
|
-
|
|
2794
|
-
o.call(this, {
|
|
2795
|
-
x: t,
|
|
2796
|
-
y: e,
|
|
2797
|
-
size: r,
|
|
2798
|
-
rotation: n
|
|
2799
|
-
});
|
|
2800
|
-
}, t.prototype._rotateFigure = function (t) {
|
|
2801
|
-
var e,
|
|
2802
|
-
r = t.x,
|
|
2803
|
-
n = t.y,
|
|
2804
|
-
o = t.size,
|
|
2805
|
-
i = t.rotation,
|
|
2806
|
-
a = void 0 === i ? 0 : i,
|
|
2807
|
-
s = r + o / 2,
|
|
2808
|
-
u = n + o / 2;
|
|
2809
|
-
(0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
|
|
2810
|
-
}, t.prototype._basicDot = function (t) {
|
|
2811
|
-
var e = this,
|
|
2812
|
-
r = t.size,
|
|
2813
|
-
n = t.x,
|
|
2814
|
-
o = t.y,
|
|
2815
|
-
i = r / 7;
|
|
2816
|
-
|
|
2817
|
-
this._rotateFigure(_A(_A({}, t), {
|
|
2818
|
-
draw: function draw() {
|
|
2819
|
-
e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("clip-rule", "evenodd"), e._element.setAttribute("d", "M " + (n + r / 2) + " " + o + "a " + r / 2 + " " + r / 2 + " 0 1 0 0.1 0zm 0 " + i + "a " + (r / 2 - i) + " " + (r / 2 - i) + " 0 1 1 -0.1 0Z");
|
|
2820
|
-
}
|
|
2821
|
-
}));
|
|
2822
|
-
}, t.prototype._basicSquare = function (t) {
|
|
2823
|
-
var e = this,
|
|
2824
|
-
r = t.size,
|
|
2825
|
-
n = t.x,
|
|
2826
|
-
o = t.y,
|
|
2827
|
-
i = r / 7;
|
|
2828
|
-
|
|
2829
|
-
this._rotateFigure(_A(_A({}, t), {
|
|
2830
|
-
draw: function draw() {
|
|
2831
|
-
e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("clip-rule", "evenodd"), e._element.setAttribute("d", "M " + n + " " + o + "v " + r + "h " + r + "v " + -r + "zM " + (n + i) + " " + (o + i) + "h " + (r - 2 * i) + "v " + (r - 2 * i) + "h " + (2 * i - r) + "z");
|
|
2832
|
-
}
|
|
2833
|
-
}));
|
|
2834
|
-
}, t.prototype._basicExtraRounded = function (t) {
|
|
2835
|
-
var e = this,
|
|
2836
|
-
r = t.size,
|
|
2837
|
-
n = t.x,
|
|
2838
|
-
o = t.y,
|
|
2839
|
-
i = r / 7;
|
|
2840
|
-
|
|
2841
|
-
this._rotateFigure(_A(_A({}, t), {
|
|
2842
|
-
draw: function draw() {
|
|
2843
|
-
e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("clip-rule", "evenodd"), e._element.setAttribute("d", "M " + n + " " + (o + 2.5 * i) + "v " + 2 * i + "a " + 2.5 * i + " " + 2.5 * i + ", 0, 0, 0, " + 2.5 * i + " " + 2.5 * i + "h " + 2 * i + "a " + 2.5 * i + " " + 2.5 * i + ", 0, 0, 0, " + 2.5 * i + " " + 2.5 * -i + "v " + -2 * i + "a " + 2.5 * i + " " + 2.5 * i + ", 0, 0, 0, " + 2.5 * -i + " " + 2.5 * -i + "h " + -2 * i + "a " + 2.5 * i + " " + 2.5 * i + ", 0, 0, 0, " + 2.5 * -i + " " + 2.5 * i + "M " + (n + 2.5 * i) + " " + (o + i) + "h " + 2 * i + "a " + 1.5 * i + " " + 1.5 * i + ", 0, 0, 1, " + 1.5 * i + " " + 1.5 * i + "v " + 2 * i + "a " + 1.5 * i + " " + 1.5 * i + ", 0, 0, 1, " + 1.5 * -i + " " + 1.5 * i + "h " + -2 * i + "a " + 1.5 * i + " " + 1.5 * i + ", 0, 0, 1, " + 1.5 * -i + " " + 1.5 * -i + "v " + -2 * i + "a " + 1.5 * i + " " + 1.5 * i + ", 0, 0, 1, " + 1.5 * i + " " + 1.5 * -i);
|
|
2844
|
-
}
|
|
2845
|
-
}));
|
|
2846
|
-
}, t.prototype._drawDot = function (t) {
|
|
2847
|
-
var e = t.x,
|
|
2848
|
-
r = t.y,
|
|
2849
|
-
n = t.size,
|
|
2850
|
-
o = t.rotation;
|
|
2851
|
-
|
|
2852
|
-
this._basicDot({
|
|
2853
|
-
x: e,
|
|
2854
|
-
y: r,
|
|
2855
|
-
size: n,
|
|
2856
|
-
rotation: o
|
|
2857
|
-
});
|
|
2858
|
-
}, t.prototype._drawSquare = function (t) {
|
|
2859
|
-
var e = t.x,
|
|
2860
|
-
r = t.y,
|
|
2861
|
-
n = t.size,
|
|
2862
|
-
o = t.rotation;
|
|
2863
|
-
|
|
2864
|
-
this._basicSquare({
|
|
2865
|
-
x: e,
|
|
2866
|
-
y: r,
|
|
2867
|
-
size: n,
|
|
2868
|
-
rotation: o
|
|
2869
|
-
});
|
|
2870
|
-
}, t.prototype._drawExtraRounded = function (t) {
|
|
2871
|
-
var e = t.x,
|
|
2872
|
-
r = t.y,
|
|
2873
|
-
n = t.size,
|
|
2874
|
-
o = t.rotation;
|
|
2142
|
+
trys: [],
|
|
2143
|
+
ops: []
|
|
2144
|
+
};
|
|
2145
|
+
return i = {
|
|
2146
|
+
next: s(0),
|
|
2147
|
+
"throw": s(1),
|
|
2148
|
+
"return": s(2)
|
|
2149
|
+
}, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
|
|
2150
|
+
return this;
|
|
2151
|
+
}), i;
|
|
2875
2152
|
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
rotation: o
|
|
2881
|
-
});
|
|
2882
|
-
}, t;
|
|
2883
|
-
}();
|
|
2153
|
+
function s(i) {
|
|
2154
|
+
return function (s) {
|
|
2155
|
+
return function (i) {
|
|
2156
|
+
if (r) throw new TypeError("Generator is already executing.");
|
|
2884
2157
|
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
for (var o in e = arguments[r]) {
|
|
2889
|
-
Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
|
|
2890
|
-
}
|
|
2891
|
-
}
|
|
2158
|
+
for (; a;) {
|
|
2159
|
+
try {
|
|
2160
|
+
if (r = 1, n && (o = 2 & i[0] ? n["return"] : i[0] ? n["throw"] || ((o = n["return"]) && o.call(n), 0) : n.next) && !(o = o.call(n, i[1])).done) return o;
|
|
2892
2161
|
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2162
|
+
switch (n = 0, o && (i = [2 & i[0], o.value]), i[0]) {
|
|
2163
|
+
case 0:
|
|
2164
|
+
case 1:
|
|
2165
|
+
o = i;
|
|
2166
|
+
break;
|
|
2896
2167
|
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
}
|
|
2168
|
+
case 4:
|
|
2169
|
+
return a.label++, {
|
|
2170
|
+
value: i[1],
|
|
2171
|
+
done: !1
|
|
2172
|
+
};
|
|
2903
2173
|
|
|
2904
|
-
|
|
2905
|
-
|
|
2174
|
+
case 5:
|
|
2175
|
+
a.label++, n = i[1], i = [0];
|
|
2176
|
+
continue;
|
|
2906
2177
|
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
break;
|
|
2178
|
+
case 7:
|
|
2179
|
+
i = a.ops.pop(), a.trys.pop();
|
|
2180
|
+
continue;
|
|
2911
2181
|
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2182
|
+
default:
|
|
2183
|
+
if (!((o = (o = a.trys).length > 0 && o[o.length - 1]) || 6 !== i[0] && 2 !== i[0])) {
|
|
2184
|
+
a = 0;
|
|
2185
|
+
continue;
|
|
2186
|
+
}
|
|
2916
2187
|
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
rotation: n
|
|
2922
|
-
});
|
|
2923
|
-
}, t.prototype._rotateFigure = function (t) {
|
|
2924
|
-
var e,
|
|
2925
|
-
r = t.x,
|
|
2926
|
-
n = t.y,
|
|
2927
|
-
o = t.size,
|
|
2928
|
-
i = t.rotation,
|
|
2929
|
-
a = void 0 === i ? 0 : i,
|
|
2930
|
-
s = r + o / 2,
|
|
2931
|
-
u = n + o / 2;
|
|
2932
|
-
(0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
|
|
2933
|
-
}, t.prototype._basicDot = function (t) {
|
|
2934
|
-
var e = this,
|
|
2935
|
-
r = t.size,
|
|
2936
|
-
n = t.x,
|
|
2937
|
-
o = t.y;
|
|
2188
|
+
if (3 === i[0] && (!o || i[1] > o[0] && i[1] < o[3])) {
|
|
2189
|
+
a.label = i[1];
|
|
2190
|
+
break;
|
|
2191
|
+
}
|
|
2938
2192
|
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
}));
|
|
2944
|
-
}, t.prototype._basicSquare = function (t) {
|
|
2945
|
-
var e = this,
|
|
2946
|
-
r = t.size,
|
|
2947
|
-
n = t.x,
|
|
2948
|
-
o = t.y;
|
|
2193
|
+
if (6 === i[0] && a.label < o[1]) {
|
|
2194
|
+
a.label = o[1], o = i;
|
|
2195
|
+
break;
|
|
2196
|
+
}
|
|
2949
2197
|
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
}));
|
|
2955
|
-
}, t.prototype._drawDot = function (t) {
|
|
2956
|
-
var e = t.x,
|
|
2957
|
-
r = t.y,
|
|
2958
|
-
n = t.size,
|
|
2959
|
-
o = t.rotation;
|
|
2198
|
+
if (o && a.label < o[2]) {
|
|
2199
|
+
a.label = o[2], a.ops.push(i);
|
|
2200
|
+
break;
|
|
2201
|
+
}
|
|
2960
2202
|
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
size: n,
|
|
2965
|
-
rotation: o
|
|
2966
|
-
});
|
|
2967
|
-
}, t.prototype._drawSquare = function (t) {
|
|
2968
|
-
var e = t.x,
|
|
2969
|
-
r = t.y,
|
|
2970
|
-
n = t.size,
|
|
2971
|
-
o = t.rotation;
|
|
2203
|
+
o[2] && a.ops.pop(), a.trys.pop();
|
|
2204
|
+
continue;
|
|
2205
|
+
}
|
|
2972
2206
|
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
}();
|
|
2207
|
+
i = e.call(t, a);
|
|
2208
|
+
} catch (t) {
|
|
2209
|
+
i = [6, t], n = 0;
|
|
2210
|
+
} finally {
|
|
2211
|
+
r = o = 0;
|
|
2212
|
+
}
|
|
2213
|
+
}
|
|
2981
2214
|
|
|
2982
|
-
|
|
2983
|
-
|
|
2215
|
+
if (5 & i[0]) throw i[1];
|
|
2216
|
+
return {
|
|
2217
|
+
value: i[0] ? i[1] : void 0,
|
|
2218
|
+
done: !0
|
|
2219
|
+
};
|
|
2220
|
+
}([i, s]);
|
|
2221
|
+
};
|
|
2222
|
+
}
|
|
2223
|
+
},
|
|
2224
|
+
m = [[1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1]],
|
|
2225
|
+
b = [[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]];
|
|
2984
2226
|
|
|
2985
|
-
var
|
|
2227
|
+
var _ = function () {
|
|
2986
2228
|
function t(t) {
|
|
2987
2229
|
this._element = document.createElementNS("http://www.w3.org/2000/svg", "svg"), this._element.setAttribute("width", String(t.width)), this._element.setAttribute("height", String(t.height)), this._defs = document.createElementNS("http://www.w3.org/2000/svg", "defs"), this._element.appendChild(this._defs), this._options = t;
|
|
2988
2230
|
}
|
|
@@ -3001,12 +2243,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3001
2243
|
configurable: !0
|
|
3002
2244
|
}), t.prototype.getElement = function () {
|
|
3003
2245
|
return this._element;
|
|
3004
|
-
}, t.prototype.clear = function () {
|
|
3005
|
-
var t,
|
|
3006
|
-
e = this._element;
|
|
3007
|
-
this._element = e.cloneNode(!1), null === (t = null == e ? void 0 : e.parentNode) || void 0 === t || t.replaceChild(this._element, e), this._defs = document.createElementNS("http://www.w3.org/2000/svg", "defs"), this._element.appendChild(this._defs);
|
|
3008
2246
|
}, t.prototype.drawQR = function (t) {
|
|
3009
|
-
return
|
|
2247
|
+
return w(this, void 0, void 0, function () {
|
|
3010
2248
|
var e,
|
|
3011
2249
|
r,
|
|
3012
2250
|
n,
|
|
@@ -3014,105 +2252,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3014
2252
|
i,
|
|
3015
2253
|
a,
|
|
3016
2254
|
s,
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
l
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
n,
|
|
3023
|
-
o,
|
|
3024
|
-
i,
|
|
3025
|
-
a = {
|
|
3026
|
-
label: 0,
|
|
3027
|
-
sent: function sent() {
|
|
3028
|
-
if (1 & o[0]) throw o[1];
|
|
3029
|
-
return o[1];
|
|
3030
|
-
},
|
|
3031
|
-
trys: [],
|
|
3032
|
-
ops: []
|
|
3033
|
-
};
|
|
3034
|
-
return i = {
|
|
3035
|
-
next: s(0),
|
|
3036
|
-
"throw": s(1),
|
|
3037
|
-
"return": s(2)
|
|
3038
|
-
}, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
|
|
3039
|
-
return this;
|
|
3040
|
-
}), i;
|
|
3041
|
-
|
|
3042
|
-
function s(i) {
|
|
3043
|
-
return function (s) {
|
|
3044
|
-
return function (i) {
|
|
3045
|
-
if (r) throw new TypeError("Generator is already executing.");
|
|
3046
|
-
|
|
3047
|
-
for (; a;) {
|
|
3048
|
-
try {
|
|
3049
|
-
if (r = 1, n && (o = 2 & i[0] ? n["return"] : i[0] ? n["throw"] || ((o = n["return"]) && o.call(n), 0) : n.next) && !(o = o.call(n, i[1])).done) return o;
|
|
3050
|
-
|
|
3051
|
-
switch (n = 0, o && (i = [2 & i[0], o.value]), i[0]) {
|
|
3052
|
-
case 0:
|
|
3053
|
-
case 1:
|
|
3054
|
-
o = i;
|
|
3055
|
-
break;
|
|
3056
|
-
|
|
3057
|
-
case 4:
|
|
3058
|
-
return a.label++, {
|
|
3059
|
-
value: i[1],
|
|
3060
|
-
done: !1
|
|
3061
|
-
};
|
|
3062
|
-
|
|
3063
|
-
case 5:
|
|
3064
|
-
a.label++, n = i[1], i = [0];
|
|
3065
|
-
continue;
|
|
3066
|
-
|
|
3067
|
-
case 7:
|
|
3068
|
-
i = a.ops.pop(), a.trys.pop();
|
|
3069
|
-
continue;
|
|
3070
|
-
|
|
3071
|
-
default:
|
|
3072
|
-
if (!((o = (o = a.trys).length > 0 && o[o.length - 1]) || 6 !== i[0] && 2 !== i[0])) {
|
|
3073
|
-
a = 0;
|
|
3074
|
-
continue;
|
|
3075
|
-
}
|
|
3076
|
-
|
|
3077
|
-
if (3 === i[0] && (!o || i[1] > o[0] && i[1] < o[3])) {
|
|
3078
|
-
a.label = i[1];
|
|
3079
|
-
break;
|
|
3080
|
-
}
|
|
3081
|
-
|
|
3082
|
-
if (6 === i[0] && a.label < o[1]) {
|
|
3083
|
-
a.label = o[1], o = i;
|
|
3084
|
-
break;
|
|
3085
|
-
}
|
|
3086
|
-
|
|
3087
|
-
if (o && a.label < o[2]) {
|
|
3088
|
-
a.label = o[2], a.ops.push(i);
|
|
3089
|
-
break;
|
|
3090
|
-
}
|
|
3091
|
-
|
|
3092
|
-
o[2] && a.ops.pop(), a.trys.pop();
|
|
3093
|
-
continue;
|
|
3094
|
-
}
|
|
3095
|
-
|
|
3096
|
-
i = e.call(t, a);
|
|
3097
|
-
} catch (t) {
|
|
3098
|
-
i = [6, t], n = 0;
|
|
3099
|
-
} finally {
|
|
3100
|
-
r = o = 0;
|
|
3101
|
-
}
|
|
3102
|
-
}
|
|
3103
|
-
|
|
3104
|
-
if (5 & i[0]) throw i[1];
|
|
3105
|
-
return {
|
|
3106
|
-
value: i[0] ? i[1] : void 0,
|
|
3107
|
-
done: !0
|
|
3108
|
-
};
|
|
3109
|
-
}([i, s]);
|
|
3110
|
-
};
|
|
3111
|
-
}
|
|
3112
|
-
}(this, function (f) {
|
|
2255
|
+
u,
|
|
2256
|
+
c,
|
|
2257
|
+
l,
|
|
2258
|
+
d = this;
|
|
2259
|
+
return y(this, function (f) {
|
|
3113
2260
|
switch (f.label) {
|
|
3114
2261
|
case 0:
|
|
3115
|
-
return e = t.getModuleCount(), r = Math.min(this._options.width, this._options.height) - 2 * this._options.margin, n = Math.
|
|
2262
|
+
return e = t.getModuleCount(), r = Math.min(this._options.width, this._options.height) - 2 * this._options.margin, n = this._options.shape === v ? r / Math.sqrt(2) : r, o = Math.floor(n / e), i = {
|
|
3116
2263
|
hideXDots: 0,
|
|
3117
2264
|
hideYDots: 0,
|
|
3118
2265
|
width: 0,
|
|
@@ -3121,72 +2268,85 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3121
2268
|
|
|
3122
2269
|
case 1:
|
|
3123
2270
|
if (f.sent(), !this._image) return [2];
|
|
3124
|
-
|
|
2271
|
+
a = this._options, s = a.imageOptions, u = a.qrOptions, c = s.imageSize * h[u.errorCorrectionLevel], l = Math.floor(c * e * e), i = function (t) {
|
|
2272
|
+
var e = t.originalHeight,
|
|
2273
|
+
r = t.originalWidth,
|
|
2274
|
+
n = t.maxHiddenDots,
|
|
2275
|
+
o = t.maxHiddenAxisDots,
|
|
2276
|
+
i = t.dotSize,
|
|
2277
|
+
a = {
|
|
2278
|
+
x: 0,
|
|
2279
|
+
y: 0
|
|
2280
|
+
},
|
|
2281
|
+
s = {
|
|
2282
|
+
x: 0,
|
|
2283
|
+
y: 0
|
|
2284
|
+
};
|
|
2285
|
+
if (e <= 0 || r <= 0 || n <= 0 || i <= 0) return {
|
|
2286
|
+
height: 0,
|
|
2287
|
+
width: 0,
|
|
2288
|
+
hideYDots: 0,
|
|
2289
|
+
hideXDots: 0
|
|
2290
|
+
};
|
|
2291
|
+
var u = e / r;
|
|
2292
|
+
return a.x = Math.floor(Math.sqrt(n / u)), a.x <= 0 && (a.x = 1), o && o < a.x && (a.x = o), a.x % 2 == 0 && a.x--, s.x = a.x * i, a.y = 1 + 2 * Math.ceil((a.x * u - 1) / 2), s.y = Math.round(s.x * u), (a.y * a.x > n || o && o < a.y) && (o && o < a.y ? (a.y = o, a.y % 2 == 0 && a.x--) : a.y -= 2, s.y = a.y * i, a.x = 1 + 2 * Math.ceil((a.y / u - 1) / 2), s.x = Math.round(s.y / u)), {
|
|
2293
|
+
height: s.y,
|
|
2294
|
+
width: s.x,
|
|
2295
|
+
hideYDots: a.y,
|
|
2296
|
+
hideXDots: a.x
|
|
2297
|
+
};
|
|
2298
|
+
}({
|
|
3125
2299
|
originalWidth: this._image.width,
|
|
3126
2300
|
originalHeight: this._image.height,
|
|
3127
|
-
maxHiddenDots:
|
|
2301
|
+
maxHiddenDots: l,
|
|
3128
2302
|
maxHiddenAxisDots: e - 14,
|
|
3129
|
-
dotSize:
|
|
2303
|
+
dotSize: o
|
|
3130
2304
|
}), f.label = 2;
|
|
3131
2305
|
|
|
3132
2306
|
case 2:
|
|
3133
|
-
return this.
|
|
3134
|
-
var n,
|
|
3135
|
-
return !(
|
|
3136
|
-
}), this.drawCorners(), this._options.image
|
|
3137
|
-
width:
|
|
3138
|
-
height:
|
|
2307
|
+
return this.drawBackground(), this.drawDots(function (t, r) {
|
|
2308
|
+
var n, o, a, s, u, h;
|
|
2309
|
+
return !(d._options.imageOptions.hideBackgroundDots && t >= (e - i.hideXDots) / 2 && t < (e + i.hideXDots) / 2 && r >= (e - i.hideYDots) / 2 && r < (e + i.hideYDots) / 2 || (null === (n = m[t]) || void 0 === n ? void 0 : n[r]) || (null === (o = m[t - e + 7]) || void 0 === o ? void 0 : o[r]) || (null === (a = m[t]) || void 0 === a ? void 0 : a[r - e + 7]) || (null === (s = b[t]) || void 0 === s ? void 0 : s[r]) || (null === (u = b[t - e + 7]) || void 0 === u ? void 0 : u[r]) || (null === (h = b[t]) || void 0 === h ? void 0 : h[r - e + 7]));
|
|
2310
|
+
}), this.drawCorners(), this._options.image ? [4, this.drawImage({
|
|
2311
|
+
width: i.width,
|
|
2312
|
+
height: i.height,
|
|
3139
2313
|
count: e,
|
|
3140
|
-
dotSize:
|
|
3141
|
-
}),
|
|
3142
|
-
}
|
|
3143
|
-
});
|
|
3144
|
-
}, new ((n = void 0) || (n = Promise))(function (t, i) {
|
|
3145
|
-
function a(t) {
|
|
3146
|
-
try {
|
|
3147
|
-
u(o.next(t));
|
|
3148
|
-
} catch (t) {
|
|
3149
|
-
i(t);
|
|
3150
|
-
}
|
|
3151
|
-
}
|
|
3152
|
-
|
|
3153
|
-
function s(t) {
|
|
3154
|
-
try {
|
|
3155
|
-
u(o["throw"](t));
|
|
3156
|
-
} catch (t) {
|
|
3157
|
-
i(t);
|
|
3158
|
-
}
|
|
3159
|
-
}
|
|
2314
|
+
dotSize: o
|
|
2315
|
+
})] : [3, 4];
|
|
3160
2316
|
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
e.done ? t(e.value) : (r = e.value, r instanceof n ? r : new n(function (t) {
|
|
3164
|
-
t(r);
|
|
3165
|
-
})).then(a, s);
|
|
3166
|
-
}
|
|
2317
|
+
case 3:
|
|
2318
|
+
f.sent(), f.label = 4;
|
|
3167
2319
|
|
|
3168
|
-
|
|
2320
|
+
case 4:
|
|
2321
|
+
return [2];
|
|
2322
|
+
}
|
|
2323
|
+
});
|
|
3169
2324
|
});
|
|
3170
|
-
var e, r, n, o;
|
|
3171
2325
|
}, t.prototype.drawBackground = function () {
|
|
3172
2326
|
var t,
|
|
3173
2327
|
e,
|
|
3174
|
-
r
|
|
3175
|
-
n = this.
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
2328
|
+
r,
|
|
2329
|
+
n = this._element,
|
|
2330
|
+
o = this._options;
|
|
2331
|
+
|
|
2332
|
+
if (n) {
|
|
2333
|
+
var i = null === (t = o.backgroundOptions) || void 0 === t ? void 0 : t.gradient,
|
|
2334
|
+
a = null === (e = o.backgroundOptions) || void 0 === e ? void 0 : e.color;
|
|
2335
|
+
|
|
2336
|
+
if ((i || a) && this._createColor({
|
|
2337
|
+
options: i,
|
|
2338
|
+
color: a,
|
|
3183
2339
|
additionalRotation: 0,
|
|
3184
2340
|
x: 0,
|
|
3185
2341
|
y: 0,
|
|
3186
|
-
height:
|
|
3187
|
-
width:
|
|
2342
|
+
height: o.height,
|
|
2343
|
+
width: o.width,
|
|
3188
2344
|
name: "background-color"
|
|
3189
|
-
})
|
|
2345
|
+
}), null === (r = o.backgroundOptions) || void 0 === r ? void 0 : r.round) {
|
|
2346
|
+
var s = Math.min(o.width, o.height),
|
|
2347
|
+
u = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
2348
|
+
this._backgroundClipPath = document.createElementNS("http://www.w3.org/2000/svg", "clipPath"), this._backgroundClipPath.setAttribute("id", "clip-path-background-color"), this._defs.appendChild(this._backgroundClipPath), u.setAttribute("x", String((o.width - s) / 2)), u.setAttribute("y", String((o.height - s) / 2)), u.setAttribute("width", String(s)), u.setAttribute("height", String(s)), u.setAttribute("rx", String(s / 2 * o.backgroundOptions.round)), this._backgroundClipPath.appendChild(u);
|
|
2349
|
+
}
|
|
3190
2350
|
}
|
|
3191
2351
|
}, t.prototype.drawDots = function (t) {
|
|
3192
2352
|
var e,
|
|
@@ -3199,10 +2359,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3199
2359
|
|
|
3200
2360
|
if (i > o.width || i > o.height) throw "The canvas is too small.";
|
|
3201
2361
|
var a = Math.min(o.width, o.height) - 2 * o.margin,
|
|
3202
|
-
s =
|
|
3203
|
-
u = Math.floor(
|
|
3204
|
-
|
|
3205
|
-
|
|
2362
|
+
s = o.shape === v ? a / Math.sqrt(2) : a,
|
|
2363
|
+
u = Math.floor(s / i),
|
|
2364
|
+
h = Math.floor((o.width - i * u) / 2),
|
|
2365
|
+
c = Math.floor((o.height - i * u) / 2),
|
|
2366
|
+
d = new l({
|
|
3206
2367
|
svg: this._element,
|
|
3207
2368
|
type: o.dotsOptions.type
|
|
3208
2369
|
});
|
|
@@ -3210,23 +2371,57 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3210
2371
|
options: null === (e = o.dotsOptions) || void 0 === e ? void 0 : e.gradient,
|
|
3211
2372
|
color: o.dotsOptions.color,
|
|
3212
2373
|
additionalRotation: 0,
|
|
3213
|
-
x:
|
|
3214
|
-
y:
|
|
3215
|
-
height:
|
|
3216
|
-
width:
|
|
2374
|
+
x: 0,
|
|
2375
|
+
y: 0,
|
|
2376
|
+
height: o.height,
|
|
2377
|
+
width: o.width,
|
|
3217
2378
|
name: "dot-color"
|
|
3218
2379
|
});
|
|
3219
2380
|
|
|
3220
|
-
for (var
|
|
2381
|
+
for (var f = function f(e) {
|
|
3221
2382
|
for (var o = function o(_o) {
|
|
3222
|
-
return t && !t(e, _o) ? "continue" : (null === (r =
|
|
2383
|
+
return t && !t(e, _o) ? "continue" : (null === (r = g._qr) || void 0 === r ? void 0 : r.isDark(e, _o)) ? (d.draw(h + e * u, c + _o * u, u, function (r, a) {
|
|
3223
2384
|
return !(e + r < 0 || _o + a < 0 || e + r >= i || _o + a >= i) && !(t && !t(e + r, _o + a)) && !!n._qr && n._qr.isDark(e + r, _o + a);
|
|
3224
|
-
}), void (
|
|
2385
|
+
}), void (d._element && g._dotsClipPath && g._dotsClipPath.appendChild(d._element))) : "continue";
|
|
3225
2386
|
}, a = 0; a < i; a++) {
|
|
3226
2387
|
o(a);
|
|
3227
2388
|
}
|
|
3228
|
-
},
|
|
3229
|
-
|
|
2389
|
+
}, g = this, p = 0; p < i; p++) {
|
|
2390
|
+
f(p);
|
|
2391
|
+
}
|
|
2392
|
+
|
|
2393
|
+
if (o.shape === v) {
|
|
2394
|
+
var w = Math.floor((a / u - i) / 2),
|
|
2395
|
+
y = i + 2 * w,
|
|
2396
|
+
m = h - w * u,
|
|
2397
|
+
b = c - w * u,
|
|
2398
|
+
_ = [],
|
|
2399
|
+
x = Math.floor(y / 2);
|
|
2400
|
+
|
|
2401
|
+
for (p = 0; p < y; p++) {
|
|
2402
|
+
_[p] = [];
|
|
2403
|
+
|
|
2404
|
+
for (var S = 0; S < y; S++) {
|
|
2405
|
+
p >= w - 1 && p <= y - w && S >= w - 1 && S <= y - w || Math.sqrt((p - x) * (p - x) + (S - x) * (S - x)) > x ? _[p][S] = 0 : _[p][S] = this._qr.isDark(S - 2 * w < 0 ? S : S >= i ? S - 2 * w : S - w, p - 2 * w < 0 ? p : p >= i ? p - 2 * w : p - w) ? 1 : 0;
|
|
2406
|
+
}
|
|
2407
|
+
}
|
|
2408
|
+
|
|
2409
|
+
var M = function M(t) {
|
|
2410
|
+
for (var e = function e(_e2) {
|
|
2411
|
+
if (!_[t][_e2]) return "continue";
|
|
2412
|
+
d.draw(m + t * u, b + _e2 * u, u, function (r, n) {
|
|
2413
|
+
var o;
|
|
2414
|
+
return !!(null === (o = _[t + r]) || void 0 === o ? void 0 : o[_e2 + n]);
|
|
2415
|
+
}), d._element && C._dotsClipPath && C._dotsClipPath.appendChild(d._element);
|
|
2416
|
+
}, r = 0; r < y; r++) {
|
|
2417
|
+
e(r);
|
|
2418
|
+
}
|
|
2419
|
+
},
|
|
2420
|
+
C = this;
|
|
2421
|
+
|
|
2422
|
+
for (p = 0; p < y; p++) {
|
|
2423
|
+
M(p);
|
|
2424
|
+
}
|
|
3230
2425
|
}
|
|
3231
2426
|
}, t.prototype.drawCorners = function () {
|
|
3232
2427
|
var t = this;
|
|
@@ -3237,100 +2432,101 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3237
2432
|
|
|
3238
2433
|
var n = this._qr.getModuleCount(),
|
|
3239
2434
|
o = Math.min(r.width, r.height) - 2 * r.margin,
|
|
3240
|
-
i =
|
|
3241
|
-
a =
|
|
3242
|
-
s =
|
|
3243
|
-
u =
|
|
3244
|
-
|
|
2435
|
+
i = r.shape === v ? o / Math.sqrt(2) : o,
|
|
2436
|
+
a = Math.floor(i / n),
|
|
2437
|
+
s = 7 * a,
|
|
2438
|
+
u = 3 * a,
|
|
2439
|
+
h = Math.floor((r.width - n * a) / 2),
|
|
2440
|
+
c = Math.floor((r.height - n * a) / 2);
|
|
3245
2441
|
|
|
3246
2442
|
[[0, 0, 0], [1, 0, Math.PI / 2], [0, 1, -Math.PI / 2]].forEach(function (e) {
|
|
3247
2443
|
var o,
|
|
3248
|
-
|
|
2444
|
+
i,
|
|
3249
2445
|
d,
|
|
3250
|
-
l,
|
|
3251
|
-
f,
|
|
3252
|
-
p,
|
|
3253
2446
|
g,
|
|
3254
2447
|
v,
|
|
3255
|
-
y,
|
|
3256
2448
|
w,
|
|
2449
|
+
y,
|
|
3257
2450
|
_,
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
2451
|
+
x,
|
|
2452
|
+
S,
|
|
2453
|
+
M,
|
|
2454
|
+
C,
|
|
2455
|
+
A = e[0],
|
|
2456
|
+
k = e[1],
|
|
2457
|
+
O = e[2],
|
|
2458
|
+
D = h + A * a * (n - 7),
|
|
2459
|
+
P = c + k * a * (n - 7),
|
|
2460
|
+
z = t._dotsClipPath,
|
|
2461
|
+
B = t._dotsClipPath;
|
|
2462
|
+
|
|
2463
|
+
if (((null === (o = r.cornersSquareOptions) || void 0 === o ? void 0 : o.gradient) || (null === (i = r.cornersSquareOptions) || void 0 === i ? void 0 : i.color)) && ((z = document.createElementNS("http://www.w3.org/2000/svg", "clipPath")).setAttribute("id", "clip-path-corners-square-color-" + A + "-" + k), t._defs.appendChild(z), t._cornersSquareClipPath = t._cornersDotClipPath = B = z, t._createColor({
|
|
3268
2464
|
options: null === (d = r.cornersSquareOptions) || void 0 === d ? void 0 : d.gradient,
|
|
3269
|
-
color: null === (
|
|
3270
|
-
additionalRotation:
|
|
3271
|
-
x:
|
|
3272
|
-
y:
|
|
3273
|
-
height:
|
|
3274
|
-
width:
|
|
3275
|
-
name: "corners-square-color-" +
|
|
3276
|
-
})), null === (
|
|
3277
|
-
var
|
|
2465
|
+
color: null === (g = r.cornersSquareOptions) || void 0 === g ? void 0 : g.color,
|
|
2466
|
+
additionalRotation: O,
|
|
2467
|
+
x: D,
|
|
2468
|
+
y: P,
|
|
2469
|
+
height: s,
|
|
2470
|
+
width: s,
|
|
2471
|
+
name: "corners-square-color-" + A + "-" + k
|
|
2472
|
+
})), null === (v = r.cornersSquareOptions) || void 0 === v ? void 0 : v.type) {
|
|
2473
|
+
var q = new f({
|
|
3278
2474
|
svg: t._element,
|
|
3279
2475
|
type: r.cornersSquareOptions.type
|
|
3280
2476
|
});
|
|
3281
|
-
|
|
3282
|
-
} else for (var
|
|
2477
|
+
q.draw(D, P, s, O), q._element && z && z.appendChild(q._element);
|
|
2478
|
+
} else for (var I = new l({
|
|
3283
2479
|
svg: t._element,
|
|
3284
2480
|
type: r.dotsOptions.type
|
|
3285
|
-
}),
|
|
3286
|
-
for (var e = function e(
|
|
3287
|
-
if (!(null === (
|
|
3288
|
-
|
|
2481
|
+
}), E = function E(t) {
|
|
2482
|
+
for (var e = function e(_e3) {
|
|
2483
|
+
if (!(null === (w = m[t]) || void 0 === w ? void 0 : w[_e3])) return "continue";
|
|
2484
|
+
I.draw(D + t * a, P + _e3 * a, a, function (r, n) {
|
|
3289
2485
|
var o;
|
|
3290
|
-
return !!(null === (o =
|
|
3291
|
-
}),
|
|
3292
|
-
}, r = 0; r <
|
|
2486
|
+
return !!(null === (o = m[t + r]) || void 0 === o ? void 0 : o[_e3 + n]);
|
|
2487
|
+
}), I._element && z && z.appendChild(I._element);
|
|
2488
|
+
}, r = 0; r < m[t].length; r++) {
|
|
3293
2489
|
e(r);
|
|
3294
2490
|
}
|
|
3295
|
-
},
|
|
3296
|
-
|
|
3297
|
-
}
|
|
3298
|
-
|
|
3299
|
-
if (((null === (
|
|
3300
|
-
options: null === (
|
|
3301
|
-
color: null === (
|
|
3302
|
-
additionalRotation:
|
|
3303
|
-
x:
|
|
3304
|
-
y:
|
|
3305
|
-
height:
|
|
3306
|
-
width:
|
|
3307
|
-
name: "corners-dot-color-" +
|
|
3308
|
-
})), null === (
|
|
3309
|
-
var
|
|
2491
|
+
}, L = 0; L < m.length; L++) {
|
|
2492
|
+
E(L);
|
|
2493
|
+
}
|
|
2494
|
+
|
|
2495
|
+
if (((null === (y = r.cornersDotOptions) || void 0 === y ? void 0 : y.gradient) || (null === (_ = r.cornersDotOptions) || void 0 === _ ? void 0 : _.color)) && ((B = document.createElementNS("http://www.w3.org/2000/svg", "clipPath")).setAttribute("id", "clip-path-corners-dot-color-" + A + "-" + k), t._defs.appendChild(B), t._cornersDotClipPath = B, t._createColor({
|
|
2496
|
+
options: null === (x = r.cornersDotOptions) || void 0 === x ? void 0 : x.gradient,
|
|
2497
|
+
color: null === (S = r.cornersDotOptions) || void 0 === S ? void 0 : S.color,
|
|
2498
|
+
additionalRotation: O,
|
|
2499
|
+
x: D + 2 * a,
|
|
2500
|
+
y: P + 2 * a,
|
|
2501
|
+
height: u,
|
|
2502
|
+
width: u,
|
|
2503
|
+
name: "corners-dot-color-" + A + "-" + k
|
|
2504
|
+
})), null === (M = r.cornersDotOptions) || void 0 === M ? void 0 : M.type) {
|
|
2505
|
+
var R = new p({
|
|
3310
2506
|
svg: t._element,
|
|
3311
2507
|
type: r.cornersDotOptions.type
|
|
3312
2508
|
});
|
|
3313
|
-
|
|
2509
|
+
R.draw(D + 2 * a, P + 2 * a, u, O), R._element && B && B.appendChild(R._element);
|
|
3314
2510
|
} else {
|
|
3315
|
-
|
|
2511
|
+
I = new l({
|
|
3316
2512
|
svg: t._element,
|
|
3317
2513
|
type: r.dotsOptions.type
|
|
3318
2514
|
});
|
|
3319
2515
|
|
|
3320
2516
|
var N = function N(t) {
|
|
3321
|
-
for (var e = function e(
|
|
3322
|
-
if (!(null === (
|
|
3323
|
-
|
|
2517
|
+
for (var e = function e(_e4) {
|
|
2518
|
+
if (!(null === (C = b[t]) || void 0 === C ? void 0 : C[_e4])) return "continue";
|
|
2519
|
+
I.draw(D + t * a, P + _e4 * a, a, function (r, n) {
|
|
3324
2520
|
var o;
|
|
3325
|
-
return !!(null === (o =
|
|
3326
|
-
}),
|
|
3327
|
-
}, r = 0; r <
|
|
2521
|
+
return !!(null === (o = b[t + r]) || void 0 === o ? void 0 : o[_e4 + n]);
|
|
2522
|
+
}), I._element && B && B.appendChild(I._element);
|
|
2523
|
+
}, r = 0; r < b[t].length; r++) {
|
|
3328
2524
|
e(r);
|
|
3329
2525
|
}
|
|
3330
2526
|
};
|
|
3331
2527
|
|
|
3332
|
-
for (
|
|
3333
|
-
N(
|
|
2528
|
+
for (L = 0; L < b.length; L++) {
|
|
2529
|
+
N(L);
|
|
3334
2530
|
}
|
|
3335
2531
|
}
|
|
3336
2532
|
});
|
|
@@ -3348,16 +2544,19 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3348
2544
|
var e = t.width,
|
|
3349
2545
|
r = t.height,
|
|
3350
2546
|
n = t.count,
|
|
3351
|
-
o = t.dotSize
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
2547
|
+
o = t.dotSize;
|
|
2548
|
+
return w(this, void 0, void 0, function () {
|
|
2549
|
+
var t, i, a, s, h, c, l, d, f;
|
|
2550
|
+
return y(this, function (g) {
|
|
2551
|
+
switch (g.label) {
|
|
2552
|
+
case 0:
|
|
2553
|
+
return t = this._options, i = Math.floor((t.width - n * o) / 2), a = Math.floor((t.height - n * o) / 2), s = i + t.imageOptions.margin + (n * o - e) / 2, h = a + t.imageOptions.margin + (n * o - r) / 2, c = e - 2 * t.imageOptions.margin, l = r - 2 * t.imageOptions.margin, (d = document.createElementNS("http://www.w3.org/2000/svg", "image")).setAttribute("x", String(s)), d.setAttribute("y", String(h)), d.setAttribute("width", c + "px"), d.setAttribute("height", l + "px"), [4, u(t.image || "")];
|
|
2554
|
+
|
|
2555
|
+
case 1:
|
|
2556
|
+
return f = g.sent(), d.setAttribute("href", f || ""), this._element.appendChild(d), [2];
|
|
2557
|
+
}
|
|
2558
|
+
});
|
|
2559
|
+
});
|
|
3361
2560
|
}, t.prototype._createColor = function (t) {
|
|
3362
2561
|
var e = t.options,
|
|
3363
2562
|
r = t.color,
|
|
@@ -3367,45 +2566,46 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3367
2566
|
a = t.height,
|
|
3368
2567
|
s = t.width,
|
|
3369
2568
|
u = t.name,
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
if (
|
|
3374
|
-
var
|
|
3375
|
-
if (e.type
|
|
3376
|
-
var
|
|
3377
|
-
f = (
|
|
3378
|
-
|
|
3379
|
-
|
|
2569
|
+
h = s > a ? s : a,
|
|
2570
|
+
c = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
2571
|
+
|
|
2572
|
+
if (c.setAttribute("x", String(o)), c.setAttribute("y", String(i)), c.setAttribute("height", String(a)), c.setAttribute("width", String(s)), c.setAttribute("clip-path", "url('#clip-path-" + u + "')"), e) {
|
|
2573
|
+
var l;
|
|
2574
|
+
if ("radial" === e.type) (l = document.createElementNS("http://www.w3.org/2000/svg", "radialGradient")).setAttribute("id", u), l.setAttribute("gradientUnits", "userSpaceOnUse"), l.setAttribute("fx", String(o + s / 2)), l.setAttribute("fy", String(i + a / 2)), l.setAttribute("cx", String(o + s / 2)), l.setAttribute("cy", String(i + a / 2)), l.setAttribute("r", String(h / 2));else {
|
|
2575
|
+
var d = ((e.rotation || 0) + n) % (2 * Math.PI),
|
|
2576
|
+
f = (d + 2 * Math.PI) % (2 * Math.PI),
|
|
2577
|
+
g = o + s / 2,
|
|
2578
|
+
p = i + a / 2,
|
|
3380
2579
|
v = o + s / 2,
|
|
3381
|
-
|
|
3382
|
-
f >= 0 && f <= .25 * Math.PI || f > 1.75 * Math.PI && f <= 2 * Math.PI ? (
|
|
2580
|
+
w = i + a / 2;
|
|
2581
|
+
f >= 0 && f <= .25 * Math.PI || f > 1.75 * Math.PI && f <= 2 * Math.PI ? (g -= s / 2, p -= a / 2 * Math.tan(d), v += s / 2, w += a / 2 * Math.tan(d)) : f > .25 * Math.PI && f <= .75 * Math.PI ? (p -= a / 2, g -= s / 2 / Math.tan(d), w += a / 2, v += s / 2 / Math.tan(d)) : f > .75 * Math.PI && f <= 1.25 * Math.PI ? (g += s / 2, p += a / 2 * Math.tan(d), v -= s / 2, w -= a / 2 * Math.tan(d)) : f > 1.25 * Math.PI && f <= 1.75 * Math.PI && (p += a / 2, g += s / 2 / Math.tan(d), w -= a / 2, v -= s / 2 / Math.tan(d)), (l = document.createElementNS("http://www.w3.org/2000/svg", "linearGradient")).setAttribute("id", u), l.setAttribute("gradientUnits", "userSpaceOnUse"), l.setAttribute("x1", String(Math.round(g))), l.setAttribute("y1", String(Math.round(p))), l.setAttribute("x2", String(Math.round(v))), l.setAttribute("y2", String(Math.round(w)));
|
|
3383
2582
|
}
|
|
3384
2583
|
e.colorStops.forEach(function (t) {
|
|
3385
2584
|
var e = t.offset,
|
|
3386
2585
|
r = t.color,
|
|
3387
2586
|
n = document.createElementNS("http://www.w3.org/2000/svg", "stop");
|
|
3388
|
-
n.setAttribute("offset", 100 * e + "%"), n.setAttribute("stop-color", r),
|
|
3389
|
-
}),
|
|
3390
|
-
} else r &&
|
|
2587
|
+
n.setAttribute("offset", 100 * e + "%"), n.setAttribute("stop-color", r), l.appendChild(n);
|
|
2588
|
+
}), c.setAttribute("fill", "url('#" + u + "')"), this._defs.appendChild(l);
|
|
2589
|
+
} else r && c.setAttribute("fill", r);
|
|
3391
2590
|
|
|
3392
|
-
this._element.appendChild(
|
|
2591
|
+
this._element.appendChild(c);
|
|
3393
2592
|
}, t;
|
|
3394
2593
|
}(),
|
|
3395
|
-
|
|
2594
|
+
x = "canvas";
|
|
3396
2595
|
|
|
3397
|
-
for (var
|
|
3398
|
-
|
|
2596
|
+
for (var S = {}, M = 0; M <= 40; M++) {
|
|
2597
|
+
S[M] = M;
|
|
3399
2598
|
}
|
|
3400
2599
|
|
|
3401
|
-
var
|
|
3402
|
-
type:
|
|
2600
|
+
var C = {
|
|
2601
|
+
type: x,
|
|
2602
|
+
shape: "square",
|
|
3403
2603
|
width: 300,
|
|
3404
2604
|
height: 300,
|
|
3405
2605
|
data: "",
|
|
3406
2606
|
margin: 0,
|
|
3407
2607
|
qrOptions: {
|
|
3408
|
-
typeNumber:
|
|
2608
|
+
typeNumber: S[0],
|
|
3409
2609
|
mode: void 0,
|
|
3410
2610
|
errorCorrectionLevel: "Q"
|
|
3411
2611
|
},
|
|
@@ -3420,12 +2620,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3420
2620
|
color: "#000"
|
|
3421
2621
|
},
|
|
3422
2622
|
backgroundOptions: {
|
|
2623
|
+
round: 0,
|
|
3423
2624
|
color: "#fff"
|
|
3424
2625
|
}
|
|
3425
2626
|
};
|
|
3426
2627
|
|
|
3427
|
-
var
|
|
3428
|
-
return (
|
|
2628
|
+
var _A = function A() {
|
|
2629
|
+
return (_A = Object.assign || function (t) {
|
|
3429
2630
|
for (var e, r = 1, n = arguments.length; r < n; r++) {
|
|
3430
2631
|
for (var o in e = arguments[r]) {
|
|
3431
2632
|
Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
|
|
@@ -3436,30 +2637,30 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3436
2637
|
}).apply(this, arguments);
|
|
3437
2638
|
};
|
|
3438
2639
|
|
|
3439
|
-
function
|
|
3440
|
-
var e =
|
|
2640
|
+
function k(t) {
|
|
2641
|
+
var e = _A({}, t);
|
|
3441
2642
|
|
|
3442
2643
|
if (!e.colorStops || !e.colorStops.length) throw "Field 'colorStops' is required in gradient";
|
|
3443
2644
|
return e.rotation ? e.rotation = Number(e.rotation) : e.rotation = 0, e.colorStops = e.colorStops.map(function (t) {
|
|
3444
|
-
return
|
|
2645
|
+
return _A(_A({}, t), {
|
|
3445
2646
|
offset: Number(t.offset)
|
|
3446
2647
|
});
|
|
3447
2648
|
}), e;
|
|
3448
2649
|
}
|
|
3449
2650
|
|
|
3450
|
-
function
|
|
3451
|
-
var e =
|
|
2651
|
+
function O(t) {
|
|
2652
|
+
var e = _A({}, t);
|
|
3452
2653
|
|
|
3453
|
-
return e.width = Number(e.width), e.height = Number(e.height), e.margin = Number(e.margin), e.imageOptions =
|
|
2654
|
+
return e.width = Number(e.width), e.height = Number(e.height), e.margin = Number(e.margin), e.imageOptions = _A(_A({}, e.imageOptions), {
|
|
3454
2655
|
hideBackgroundDots: Boolean(e.imageOptions.hideBackgroundDots),
|
|
3455
2656
|
imageSize: Number(e.imageOptions.imageSize),
|
|
3456
2657
|
margin: Number(e.imageOptions.margin)
|
|
3457
|
-
}), e.margin > Math.min(e.width, e.height) && (e.margin = Math.min(e.width, e.height)), e.dotsOptions =
|
|
2658
|
+
}), e.margin > Math.min(e.width, e.height) && (e.margin = Math.min(e.width, e.height)), e.dotsOptions = _A({}, e.dotsOptions), e.dotsOptions.gradient && (e.dotsOptions.gradient = k(e.dotsOptions.gradient)), e.cornersSquareOptions && (e.cornersSquareOptions = _A({}, e.cornersSquareOptions), e.cornersSquareOptions.gradient && (e.cornersSquareOptions.gradient = k(e.cornersSquareOptions.gradient))), e.cornersDotOptions && (e.cornersDotOptions = _A({}, e.cornersDotOptions), e.cornersDotOptions.gradient && (e.cornersDotOptions.gradient = k(e.cornersDotOptions.gradient))), e.backgroundOptions && (e.backgroundOptions = _A({}, e.backgroundOptions), e.backgroundOptions.gradient && (e.backgroundOptions.gradient = k(e.backgroundOptions.gradient))), e;
|
|
3458
2659
|
}
|
|
3459
2660
|
|
|
3460
|
-
var
|
|
3461
|
-
|
|
3462
|
-
|
|
2661
|
+
var D = r(192),
|
|
2662
|
+
P = r.n(D),
|
|
2663
|
+
z = function z(t, e, r, n) {
|
|
3463
2664
|
return new (r || (r = Promise))(function (o, i) {
|
|
3464
2665
|
function a(t) {
|
|
3465
2666
|
try {
|
|
@@ -3487,7 +2688,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3487
2688
|
u((n = n.apply(t, e || [])).next());
|
|
3488
2689
|
});
|
|
3489
2690
|
},
|
|
3490
|
-
|
|
2691
|
+
B = function B(t, e) {
|
|
3491
2692
|
var r,
|
|
3492
2693
|
n,
|
|
3493
2694
|
o,
|
|
@@ -3581,35 +2782,61 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3581
2782
|
}
|
|
3582
2783
|
};
|
|
3583
2784
|
|
|
3584
|
-
var
|
|
2785
|
+
var q = function () {
|
|
3585
2786
|
function t(t) {
|
|
3586
|
-
this._options = t ?
|
|
2787
|
+
this._options = t ? O(a(C, t)) : C, this.update();
|
|
3587
2788
|
}
|
|
3588
2789
|
|
|
3589
2790
|
return t._clearContainer = function (t) {
|
|
3590
2791
|
t && (t.innerHTML = "");
|
|
3591
|
-
}, t.prototype.
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
2792
|
+
}, t.prototype._setupSvg = function () {
|
|
2793
|
+
var t = this;
|
|
2794
|
+
|
|
2795
|
+
if (this._qr) {
|
|
2796
|
+
var e = new _(this._options);
|
|
2797
|
+
this._svg = e.getElement(), this._svgDrawingPromise = e.drawQR(this._qr).then(function () {
|
|
2798
|
+
var r;
|
|
2799
|
+
t._svg && (null === (r = t._extension) || void 0 === r || r.call(t, e.getElement(), t._options));
|
|
2800
|
+
});
|
|
2801
|
+
}
|
|
2802
|
+
}, t.prototype._setupCanvas = function () {
|
|
2803
|
+
var t,
|
|
2804
|
+
e = this;
|
|
2805
|
+
this._qr && (this._canvas = document.createElement("canvas"), this._canvas.width = this._options.width, this._canvas.height = this._options.height, this._setupSvg(), this._canvasDrawingPromise = null === (t = this._svgDrawingPromise) || void 0 === t ? void 0 : t.then(function () {
|
|
2806
|
+
if (e._svg) {
|
|
2807
|
+
var t = e._svg,
|
|
2808
|
+
r = new XMLSerializer().serializeToString(t),
|
|
2809
|
+
n = "data:image/svg+xml;base64," + btoa(r),
|
|
2810
|
+
o = new Image();
|
|
2811
|
+
return new Promise(function (t) {
|
|
2812
|
+
o.onload = function () {
|
|
2813
|
+
var r, n;
|
|
2814
|
+
null === (n = null === (r = e._canvas) || void 0 === r ? void 0 : r.getContext("2d")) || void 0 === n || n.drawImage(o, 0, 0), t();
|
|
2815
|
+
}, o.src = n;
|
|
2816
|
+
});
|
|
2817
|
+
}
|
|
2818
|
+
}));
|
|
2819
|
+
}, t.prototype._getElement = function (t) {
|
|
2820
|
+
return void 0 === t && (t = "png"), z(this, void 0, void 0, function () {
|
|
2821
|
+
return B(this, function (e) {
|
|
2822
|
+
switch (e.label) {
|
|
3596
2823
|
case 0:
|
|
3597
2824
|
if (!this._qr) throw "QR code is empty";
|
|
3598
|
-
return "svg" !== t.toLowerCase() ? [3, 2] : (
|
|
2825
|
+
return "svg" !== t.toLowerCase() ? [3, 2] : (this._svg && this._svgDrawingPromise || this._setupSvg(), [4, this._svgDrawingPromise]);
|
|
3599
2826
|
|
|
3600
2827
|
case 1:
|
|
3601
|
-
return
|
|
2828
|
+
return e.sent(), [2, this._svg];
|
|
3602
2829
|
|
|
3603
2830
|
case 2:
|
|
3604
|
-
return
|
|
2831
|
+
return this._canvas && this._canvasDrawingPromise || this._setupCanvas(), [4, this._canvasDrawingPromise];
|
|
3605
2832
|
|
|
3606
2833
|
case 3:
|
|
3607
|
-
return
|
|
2834
|
+
return e.sent(), [2, this._canvas];
|
|
3608
2835
|
}
|
|
3609
2836
|
});
|
|
3610
2837
|
});
|
|
3611
2838
|
}, t.prototype.update = function (e) {
|
|
3612
|
-
t._clearContainer(this._container), this._options = e ?
|
|
2839
|
+
t._clearContainer(this._container), this._options = e ? O(a(this._options, e)) : this._options, this._options.data && (this._qr = P()(this._options.qrOptions.typeNumber, this._options.qrOptions.errorCorrectionLevel), this._qr.addData(this._options.data, this._options.qrOptions.mode || function (t) {
|
|
3613
2840
|
switch (!0) {
|
|
3614
2841
|
case /^[0-9]*$/.test(t):
|
|
3615
2842
|
return "Numeric";
|
|
@@ -3620,41 +2847,46 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3620
2847
|
default:
|
|
3621
2848
|
return "Byte";
|
|
3622
2849
|
}
|
|
3623
|
-
}(this._options.data)), this._qr.make(), this._options.type ===
|
|
2850
|
+
}(this._options.data)), this._qr.make(), this._options.type === x ? this._setupCanvas() : this._setupSvg(), this.append(this._container));
|
|
3624
2851
|
}, t.prototype.append = function (t) {
|
|
3625
2852
|
if (t) {
|
|
3626
2853
|
if ("function" != typeof t.appendChild) throw "Container should be a single DOM node";
|
|
3627
|
-
this._options.type ===
|
|
2854
|
+
this._options.type === x ? this._canvas && t.appendChild(this._canvas) : this._svg && t.appendChild(this._svg), this._container = t;
|
|
3628
2855
|
}
|
|
2856
|
+
}, t.prototype.applyExtension = function (t) {
|
|
2857
|
+
if (!t) throw "Extension function should be defined.";
|
|
2858
|
+
this._extension = t, this.update();
|
|
2859
|
+
}, t.prototype.deleteExtension = function () {
|
|
2860
|
+
this._extension = void 0, this.update();
|
|
3629
2861
|
}, t.prototype.getRawData = function (t) {
|
|
3630
|
-
return void 0 === t && (t = "png"),
|
|
2862
|
+
return void 0 === t && (t = "png"), z(this, void 0, void 0, function () {
|
|
3631
2863
|
var e, r, n;
|
|
3632
|
-
return
|
|
2864
|
+
return B(this, function (o) {
|
|
3633
2865
|
switch (o.label) {
|
|
3634
2866
|
case 0:
|
|
3635
2867
|
if (!this._qr) throw "QR code is empty";
|
|
3636
|
-
return [4, this.
|
|
2868
|
+
return [4, this._getElement(t)];
|
|
3637
2869
|
|
|
3638
2870
|
case 1:
|
|
3639
|
-
return e = o.sent()
|
|
2871
|
+
return (e = o.sent()) ? "svg" === t.toLowerCase() ? (r = new XMLSerializer(), n = r.serializeToString(e), [2, new Blob(['<?xml version="1.0" standalone="no"?>\r\n' + n], {
|
|
3640
2872
|
type: "image/svg+xml"
|
|
3641
2873
|
})]) : [2, new Promise(function (r) {
|
|
3642
|
-
return e.
|
|
3643
|
-
})];
|
|
2874
|
+
return e.toBlob(r, "image/" + t, 1);
|
|
2875
|
+
})] : [2, null];
|
|
3644
2876
|
}
|
|
3645
2877
|
});
|
|
3646
2878
|
});
|
|
3647
2879
|
}, t.prototype.download = function (t) {
|
|
3648
|
-
return
|
|
2880
|
+
return z(this, void 0, void 0, function () {
|
|
3649
2881
|
var e, r, n, o, i;
|
|
3650
|
-
return
|
|
2882
|
+
return B(this, function (a) {
|
|
3651
2883
|
switch (a.label) {
|
|
3652
2884
|
case 0:
|
|
3653
2885
|
if (!this._qr) throw "QR code is empty";
|
|
3654
|
-
return e = "png", r = "qr", "string" == typeof t ? (e = t, console.warn("Extension is deprecated as argument for 'download' method, please pass object { name: '...', extension: '...' } as argument")) : "object" == _typeof(t) && null !== t && (t.name && (r = t.name), t.extension && (e = t.extension)), [4, this.
|
|
2886
|
+
return e = "png", r = "qr", "string" == typeof t ? (e = t, console.warn("Extension is deprecated as argument for 'download' method, please pass object { name: '...', extension: '...' } as argument")) : "object" == _typeof(t) && null !== t && (t.name && (r = t.name), t.extension && (e = t.extension)), [4, this._getElement(e)];
|
|
3655
2887
|
|
|
3656
2888
|
case 1:
|
|
3657
|
-
return n = a.sent()
|
|
2889
|
+
return (n = a.sent()) ? ("svg" === e.toLowerCase() ? (o = new XMLSerializer(), i = '<?xml version="1.0" standalone="no"?>\r\n' + (i = o.serializeToString(n)), s("data:image/svg+xml;charset=utf-8," + encodeURIComponent(i), r + ".svg")) : s(n.toDataURL("image/" + e), r + "." + e), [2]) : [2];
|
|
3658
2890
|
}
|
|
3659
2891
|
});
|
|
3660
2892
|
});
|
|
@@ -3690,12 +2922,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3690
2922
|
}
|
|
3691
2923
|
}, r.o = function (t, e) {
|
|
3692
2924
|
return Object.prototype.hasOwnProperty.call(t, e);
|
|
3693
|
-
}, r(
|
|
2925
|
+
}, r(676);
|
|
3694
2926
|
}()["default"];
|
|
3695
2927
|
});
|
|
3696
2928
|
}, {}],
|
|
3697
2929
|
5: [function (require, module, exports) {
|
|
3698
|
-
module.exports = "1.
|
|
2930
|
+
module.exports = "1.119.1";
|
|
3699
2931
|
}, {}]
|
|
3700
2932
|
}, {}, [3])(3);
|
|
3701
2933
|
});
|