@plattar/plattar-qrcode 1.114.1 → 1.120.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.
|
@@ -100,9 +100,24 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
100
100
|
_createClass(BaseElement, [{
|
|
101
101
|
key: "connectedCallback",
|
|
102
102
|
value: function connectedCallback() {
|
|
103
|
+
var _this = this;
|
|
104
|
+
|
|
103
105
|
if (this.hasAttribute("url")) {
|
|
104
106
|
this.renderQRCode();
|
|
105
107
|
}
|
|
108
|
+
|
|
109
|
+
var observer = new MutationObserver(function (mutations) {
|
|
110
|
+
mutations.forEach(function (mutation) {
|
|
111
|
+
if (mutation.type === "attributes") {
|
|
112
|
+
if (_this.hasAttribute("url")) {
|
|
113
|
+
_this.renderQRCode();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
observer.observe(this, {
|
|
119
|
+
attributes: true
|
|
120
|
+
});
|
|
106
121
|
}
|
|
107
122
|
}, {
|
|
108
123
|
key: "download",
|
|
@@ -130,6 +145,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
130
145
|
var margin = this.hasAttribute("margin") ? this.getAttribute("margin") : 0;
|
|
131
146
|
var image = this.hasAttribute("image") ? this.getAttribute("image") : undefined;
|
|
132
147
|
var color = this.hasAttribute("color") ? this.getAttribute("color") : "#000000";
|
|
148
|
+
var style = this.hasAttribute("qr-type") ? this.getAttribute("qr-type") : "default";
|
|
133
149
|
this._options = this._options || {
|
|
134
150
|
imageOptions: {
|
|
135
151
|
hideBackgroundDots: true,
|
|
@@ -201,8 +217,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
201
217
|
}
|
|
202
218
|
}
|
|
203
219
|
};
|
|
204
|
-
this._options.width =
|
|
205
|
-
this._options.height =
|
|
220
|
+
this._options.width = 2048;
|
|
221
|
+
this._options.height = 2048;
|
|
206
222
|
this._options.data = url;
|
|
207
223
|
this._options.margin = margin;
|
|
208
224
|
this._options.image = image; // set the colors
|
|
@@ -210,20 +226,58 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
210
226
|
this._options.dotsOptions.color = color;
|
|
211
227
|
this._options.cornersDotOptions.color = color;
|
|
212
228
|
this._options.cornersSquareOptions.color = color;
|
|
229
|
+
|
|
230
|
+
switch (style) {
|
|
231
|
+
case "dots":
|
|
232
|
+
this._options.dotsOptions.type = "dots";
|
|
233
|
+
break;
|
|
234
|
+
|
|
235
|
+
case "default":
|
|
236
|
+
default:
|
|
237
|
+
this._options.dotsOptions.type = "rounded";
|
|
238
|
+
}
|
|
239
|
+
|
|
213
240
|
var shadow = this.shadowRoot || this.attachShadow({
|
|
214
241
|
mode: 'open'
|
|
215
242
|
});
|
|
216
243
|
var qrCode = this._qrCode;
|
|
217
244
|
|
|
218
245
|
if (!qrCode) {
|
|
246
|
+
var div = document.createElement("div");
|
|
247
|
+
shadow.appendChild(div);
|
|
248
|
+
this._divContainer = div;
|
|
219
249
|
this._qrCode = new QRCodeStyling(this._options);
|
|
220
250
|
|
|
221
|
-
this._qrCode.append(
|
|
251
|
+
this._qrCode.append(div);
|
|
252
|
+
|
|
253
|
+
this._UpdateCanvas(width, height);
|
|
222
254
|
|
|
223
255
|
return;
|
|
224
256
|
}
|
|
225
257
|
|
|
226
258
|
this._qrCode.update(this._options);
|
|
259
|
+
|
|
260
|
+
this._UpdateCanvas(width, height);
|
|
261
|
+
}
|
|
262
|
+
}, {
|
|
263
|
+
key: "_UpdateCanvas",
|
|
264
|
+
value: function _UpdateCanvas(width, height) {
|
|
265
|
+
if (!this._qrCode) {
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
var canvas = this._qrCode._canvas;
|
|
270
|
+
|
|
271
|
+
if (canvas) {
|
|
272
|
+
canvas.style.width = "100%";
|
|
273
|
+
canvas.style.height = "100%";
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
if (this._divContainer) {
|
|
277
|
+
var div = this._divContainer;
|
|
278
|
+
div.style.width = width + "px";
|
|
279
|
+
div.style.height = height + "px";
|
|
280
|
+
}
|
|
227
281
|
}
|
|
228
282
|
}]);
|
|
229
283
|
|
|
@@ -288,8 +342,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
288
342
|
i = 0,
|
|
289
343
|
u = null,
|
|
290
344
|
v = [],
|
|
291
|
-
|
|
292
|
-
|
|
345
|
+
w = {},
|
|
346
|
+
m = function m(t, e) {
|
|
293
347
|
o = function (t) {
|
|
294
348
|
for (var e = new Array(t), r = 0; r < t; r += 1) {
|
|
295
349
|
e[r] = new Array(t);
|
|
@@ -300,16 +354,16 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
300
354
|
}
|
|
301
355
|
|
|
302
356
|
return e;
|
|
303
|
-
}(i = 4 * r + 17),
|
|
357
|
+
}(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
358
|
},
|
|
305
|
-
|
|
359
|
+
b = function b(t, e) {
|
|
306
360
|
for (var r = -1; r <= 7; r += 1) {
|
|
307
361
|
if (!(t + r <= -1 || i <= t + r)) for (var n = -1; n <= 7; n += 1) {
|
|
308
362
|
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
363
|
}
|
|
310
364
|
}
|
|
311
365
|
},
|
|
312
|
-
|
|
366
|
+
_ = function _() {
|
|
313
367
|
for (var t = 8; t < i - 8; t += 1) {
|
|
314
368
|
null == o[t][6] && (o[t][6] = t % 2 == 0);
|
|
315
369
|
}
|
|
@@ -324,14 +378,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
324
378
|
var i = t[e],
|
|
325
379
|
a = t[n];
|
|
326
380
|
if (null == o[i][a]) for (var u = -2; u <= 2; u += 1) {
|
|
327
|
-
for (var
|
|
328
|
-
o[i + u][a +
|
|
381
|
+
for (var h = -2; h <= 2; h += 1) {
|
|
382
|
+
o[i + u][a + h] = -2 == u || 2 == u || -2 == h || 2 == h || 0 == u && 0 == h;
|
|
329
383
|
}
|
|
330
384
|
}
|
|
331
385
|
}
|
|
332
386
|
}
|
|
333
387
|
},
|
|
334
|
-
|
|
388
|
+
S = function S(t) {
|
|
335
389
|
for (var e = s.getBCHTypeNumber(r), n = 0; n < 18; n += 1) {
|
|
336
390
|
var a = !t && 1 == (e >> n & 1);
|
|
337
391
|
o[Math.floor(n / 3)][n % 3 + i - 8 - 3] = a;
|
|
@@ -341,25 +395,25 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
341
395
|
a = !t && 1 == (e >> n & 1), o[n % 3 + i - 8 - 3][Math.floor(n / 3)] = a;
|
|
342
396
|
}
|
|
343
397
|
},
|
|
344
|
-
|
|
398
|
+
M = function M(t, e) {
|
|
345
399
|
for (var r = n << 3 | e, a = s.getBCHTypeInfo(r), u = 0; u < 15; u += 1) {
|
|
346
|
-
var
|
|
347
|
-
u < 6 ? o[u][8] =
|
|
400
|
+
var h = !t && 1 == (a >> u & 1);
|
|
401
|
+
u < 6 ? o[u][8] = h : u < 8 ? o[u + 1][8] = h : o[i - 15 + u][8] = h;
|
|
348
402
|
}
|
|
349
403
|
|
|
350
404
|
for (u = 0; u < 15; u += 1) {
|
|
351
|
-
|
|
405
|
+
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
406
|
}
|
|
353
407
|
|
|
354
408
|
o[i - 8][8] = !t;
|
|
355
409
|
},
|
|
356
410
|
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 && (
|
|
411
|
+
for (var r = -1, n = i - 1, a = 7, u = 0, h = s.getMaskFunction(e), c = i - 1; c > 0; c -= 2) {
|
|
412
|
+
for (6 == c && (c -= 1);;) {
|
|
413
|
+
for (var l = 0; l < 2; l += 1) {
|
|
414
|
+
if (null == o[n][c - l]) {
|
|
415
|
+
var d = !1;
|
|
416
|
+
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
417
|
}
|
|
364
418
|
}
|
|
365
419
|
|
|
@@ -370,8 +424,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
370
424
|
}
|
|
371
425
|
}
|
|
372
426
|
},
|
|
373
|
-
|
|
374
|
-
for (var n =
|
|
427
|
+
A = function A(t, e, r) {
|
|
428
|
+
for (var n = c.getRSBlocks(t, e), o = l(), i = 0; i < r.length; i += 1) {
|
|
375
429
|
var a = r[i];
|
|
376
430
|
o.put(a.getMode(), 4), o.put(a.getLength(), s.getLengthInBits(a.getMode(), t)), a.write(o);
|
|
377
431
|
}
|
|
@@ -394,55 +448,55 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
394
448
|
|
|
395
449
|
return function (t, e) {
|
|
396
450
|
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,
|
|
451
|
+
var c = e[u].dataCount,
|
|
452
|
+
l = e[u].totalCount - c;
|
|
453
|
+
n = Math.max(n, c), o = Math.max(o, l), i[u] = new Array(c);
|
|
400
454
|
|
|
401
|
-
for (var
|
|
402
|
-
i[u][
|
|
455
|
+
for (var d = 0; d < i[u].length; d += 1) {
|
|
456
|
+
i[u][d] = 255 & t.getBuffer()[d + r];
|
|
403
457
|
}
|
|
404
458
|
|
|
405
|
-
r +=
|
|
406
|
-
var f = s.getErrorCorrectPolynomial(
|
|
407
|
-
|
|
459
|
+
r += c;
|
|
460
|
+
var f = s.getErrorCorrectPolynomial(l),
|
|
461
|
+
g = h(i[u], f.getLength() - 1).mod(f);
|
|
408
462
|
|
|
409
|
-
for (a[u] = new Array(f.getLength() - 1),
|
|
410
|
-
var
|
|
411
|
-
a[u][
|
|
463
|
+
for (a[u] = new Array(f.getLength() - 1), d = 0; d < a[u].length; d += 1) {
|
|
464
|
+
var p = d + g.getLength() - a[u].length;
|
|
465
|
+
a[u][d] = p >= 0 ? g.getAt(p) : 0;
|
|
412
466
|
}
|
|
413
467
|
}
|
|
414
468
|
|
|
415
469
|
var v = 0;
|
|
416
470
|
|
|
417
|
-
for (
|
|
418
|
-
v += e[
|
|
471
|
+
for (d = 0; d < e.length; d += 1) {
|
|
472
|
+
v += e[d].totalCount;
|
|
419
473
|
}
|
|
420
474
|
|
|
421
|
-
var
|
|
422
|
-
|
|
475
|
+
var w = new Array(v),
|
|
476
|
+
y = 0;
|
|
423
477
|
|
|
424
|
-
for (
|
|
478
|
+
for (d = 0; d < n; d += 1) {
|
|
425
479
|
for (u = 0; u < e.length; u += 1) {
|
|
426
|
-
|
|
480
|
+
d < i[u].length && (w[y] = i[u][d], y += 1);
|
|
427
481
|
}
|
|
428
482
|
}
|
|
429
483
|
|
|
430
|
-
for (
|
|
484
|
+
for (d = 0; d < o; d += 1) {
|
|
431
485
|
for (u = 0; u < e.length; u += 1) {
|
|
432
|
-
|
|
486
|
+
d < a[u].length && (w[y] = a[u][d], y += 1);
|
|
433
487
|
}
|
|
434
488
|
}
|
|
435
489
|
|
|
436
|
-
return
|
|
490
|
+
return w;
|
|
437
491
|
}(o, n);
|
|
438
492
|
};
|
|
439
493
|
|
|
440
|
-
|
|
494
|
+
w.addData = function (t, e) {
|
|
441
495
|
var r = null;
|
|
442
496
|
|
|
443
497
|
switch (e = e || "Byte") {
|
|
444
498
|
case "Numeric":
|
|
445
|
-
r =
|
|
499
|
+
r = d(t);
|
|
446
500
|
break;
|
|
447
501
|
|
|
448
502
|
case "Alphanumeric":
|
|
@@ -450,11 +504,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
450
504
|
break;
|
|
451
505
|
|
|
452
506
|
case "Byte":
|
|
453
|
-
r =
|
|
507
|
+
r = g(t);
|
|
454
508
|
break;
|
|
455
509
|
|
|
456
510
|
case "Kanji":
|
|
457
|
-
r =
|
|
511
|
+
r = p(t);
|
|
458
512
|
break;
|
|
459
513
|
|
|
460
514
|
default:
|
|
@@ -462,15 +516,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
462
516
|
}
|
|
463
517
|
|
|
464
518
|
v.push(r), u = null;
|
|
465
|
-
},
|
|
519
|
+
}, w.isDark = function (t, e) {
|
|
466
520
|
if (t < 0 || i <= t || e < 0 || i <= e) throw t + "," + e;
|
|
467
521
|
return o[t][e];
|
|
468
|
-
},
|
|
522
|
+
}, w.getModuleCount = function () {
|
|
469
523
|
return i;
|
|
470
|
-
},
|
|
524
|
+
}, w.make = function () {
|
|
471
525
|
if (r < 1) {
|
|
472
526
|
for (var t = 1; t < 40; t++) {
|
|
473
|
-
for (var e =
|
|
527
|
+
for (var e = c.getRSBlocks(t, n), o = l(), i = 0; i < v.length; i++) {
|
|
474
528
|
var a = v[i];
|
|
475
529
|
o.put(a.getMode(), 4), o.put(a.getLength(), s.getLengthInBits(a.getMode(), t)), a.write(o);
|
|
476
530
|
}
|
|
@@ -487,33 +541,32 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
487
541
|
r = t;
|
|
488
542
|
}
|
|
489
543
|
|
|
490
|
-
|
|
544
|
+
m(!1, function () {
|
|
491
545
|
for (var t = 0, e = 0, r = 0; r < 8; r += 1) {
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
var n = s.getLostPoint(y);
|
|
546
|
+
m(!0, r);
|
|
547
|
+
var n = s.getLostPoint(w);
|
|
495
548
|
(0 == r || t > n) && (t = n, e = r);
|
|
496
549
|
}
|
|
497
550
|
|
|
498
551
|
return e;
|
|
499
552
|
}());
|
|
500
|
-
},
|
|
553
|
+
}, w.createTableTag = function (t, e) {
|
|
501
554
|
t = t || 2;
|
|
502
555
|
var r = "";
|
|
503
556
|
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
557
|
|
|
505
|
-
for (var n = 0; n <
|
|
558
|
+
for (var n = 0; n < w.getModuleCount(); n += 1) {
|
|
506
559
|
r += "<tr>";
|
|
507
560
|
|
|
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 +=
|
|
561
|
+
for (var o = 0; o < w.getModuleCount(); o += 1) {
|
|
562
|
+
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
563
|
}
|
|
511
564
|
|
|
512
565
|
r += "</tr>";
|
|
513
566
|
}
|
|
514
567
|
|
|
515
568
|
return (r += "</tbody>") + "</table>";
|
|
516
|
-
},
|
|
569
|
+
}, w.createSvgTag = function (t, e, r, n) {
|
|
517
570
|
var o = {};
|
|
518
571
|
"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
572
|
text: r
|
|
@@ -524,38 +577,38 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
524
577
|
a,
|
|
525
578
|
s,
|
|
526
579
|
u,
|
|
527
|
-
|
|
528
|
-
|
|
580
|
+
h = w.getModuleCount() * t + 2 * e,
|
|
581
|
+
c = "";
|
|
529
582
|
|
|
530
|
-
for (u = "l" + t + ",0 0," + t + " -" + t + ",0 0,-" + t + "z ",
|
|
531
|
-
for (s = a * t + e, i = 0; i <
|
|
532
|
-
|
|
583
|
+
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) {
|
|
584
|
+
for (s = a * t + e, i = 0; i < w.getModuleCount(); i += 1) {
|
|
585
|
+
w.isDark(a, i) && (c += "M" + (i * t + e) + "," + s + u);
|
|
533
586
|
}
|
|
534
587
|
}
|
|
535
588
|
|
|
536
|
-
return (
|
|
537
|
-
},
|
|
589
|
+
return (c += '" stroke="transparent" fill="black"/>') + "</svg>";
|
|
590
|
+
}, w.createDataURL = function (t, e) {
|
|
538
591
|
t = t || 2, e = void 0 === e ? 4 * t : e;
|
|
539
|
-
var r =
|
|
592
|
+
var r = w.getModuleCount() * t + 2 * e,
|
|
540
593
|
n = e,
|
|
541
594
|
o = r - e;
|
|
542
|
-
return
|
|
595
|
+
return y(r, r, function (e, r) {
|
|
543
596
|
if (n <= e && e < o && n <= r && r < o) {
|
|
544
597
|
var i = Math.floor((e - n) / t),
|
|
545
598
|
a = Math.floor((r - n) / t);
|
|
546
|
-
return
|
|
599
|
+
return w.isDark(a, i) ? 0 : 1;
|
|
547
600
|
}
|
|
548
601
|
|
|
549
602
|
return 1;
|
|
550
603
|
});
|
|
551
|
-
},
|
|
604
|
+
}, w.createImgTag = function (t, e, r) {
|
|
552
605
|
t = t || 2, e = void 0 === e ? 4 * t : e;
|
|
553
|
-
var n =
|
|
606
|
+
var n = w.getModuleCount() * t + 2 * e,
|
|
554
607
|
o = "";
|
|
555
|
-
return o += "<img", o += ' src="', o +=
|
|
608
|
+
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
609
|
};
|
|
557
610
|
|
|
558
|
-
var
|
|
611
|
+
var k = function k(t) {
|
|
559
612
|
for (var e = "", r = 0; r < t.length; r += 1) {
|
|
560
613
|
var n = t.charAt(r);
|
|
561
614
|
|
|
@@ -584,7 +637,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
584
637
|
return e;
|
|
585
638
|
};
|
|
586
639
|
|
|
587
|
-
return
|
|
640
|
+
return w.createASCII = function (t, e) {
|
|
588
641
|
if ((t = t || 1) < 2) return function (t) {
|
|
589
642
|
t = void 0 === t ? 2 : t;
|
|
590
643
|
var e,
|
|
@@ -592,66 +645,66 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
592
645
|
n,
|
|
593
646
|
o,
|
|
594
647
|
i,
|
|
595
|
-
a = 1 *
|
|
648
|
+
a = 1 * w.getModuleCount() + 2 * t,
|
|
596
649
|
s = t,
|
|
597
650
|
u = a - t,
|
|
598
|
-
|
|
651
|
+
h = {
|
|
599
652
|
"██": "█",
|
|
600
653
|
"█ ": "▀",
|
|
601
654
|
" █": "▄",
|
|
602
655
|
" ": " "
|
|
603
656
|
},
|
|
604
|
-
|
|
657
|
+
c = {
|
|
605
658
|
"██": "▀",
|
|
606
659
|
"█ ": "▀",
|
|
607
660
|
" █": " ",
|
|
608
661
|
" ": " "
|
|
609
662
|
},
|
|
610
|
-
|
|
663
|
+
l = "";
|
|
611
664
|
|
|
612
665
|
for (e = 0; e < a; e += 2) {
|
|
613
666
|
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 &&
|
|
667
|
+
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
668
|
}
|
|
616
669
|
|
|
617
|
-
|
|
670
|
+
l += "\n";
|
|
618
671
|
}
|
|
619
672
|
|
|
620
|
-
return a % 2 && t > 0 ?
|
|
673
|
+
return a % 2 && t > 0 ? l.substring(0, l.length - a - 1) + Array(a + 1).join("▀") : l.substring(0, l.length - 1);
|
|
621
674
|
}(e);
|
|
622
675
|
t -= 1, e = void 0 === e ? 2 * t : e;
|
|
623
676
|
var r,
|
|
624
677
|
n,
|
|
625
678
|
o,
|
|
626
679
|
i,
|
|
627
|
-
a =
|
|
680
|
+
a = w.getModuleCount() * t + 2 * e,
|
|
628
681
|
s = e,
|
|
629
682
|
u = a - e,
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
683
|
+
h = Array(t + 1).join("██"),
|
|
684
|
+
c = Array(t + 1).join(" "),
|
|
685
|
+
l = "",
|
|
686
|
+
d = "";
|
|
634
687
|
|
|
635
688
|
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 &&
|
|
689
|
+
for (o = Math.floor((r - s) / t), d = "", n = 0; n < a; n += 1) {
|
|
690
|
+
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
691
|
}
|
|
639
692
|
|
|
640
693
|
for (o = 0; o < t; o += 1) {
|
|
641
|
-
|
|
694
|
+
l += d + "\n";
|
|
642
695
|
}
|
|
643
696
|
}
|
|
644
697
|
|
|
645
|
-
return
|
|
646
|
-
},
|
|
698
|
+
return l.substring(0, l.length - 1);
|
|
699
|
+
}, w.renderTo2dContext = function (t, e) {
|
|
647
700
|
e = e || 2;
|
|
648
701
|
|
|
649
|
-
for (var r =
|
|
702
|
+
for (var r = w.getModuleCount(), n = 0; n < r; n++) {
|
|
650
703
|
for (var o = 0; o < r; o++) {
|
|
651
|
-
t.fillStyle =
|
|
704
|
+
t.fillStyle = w.isDark(n, o) ? "black" : "white", t.fillRect(n * e, o * e, e, e);
|
|
652
705
|
}
|
|
653
706
|
}
|
|
654
|
-
},
|
|
707
|
+
}, w;
|
|
655
708
|
};
|
|
656
709
|
|
|
657
710
|
t.stringToBytes = (t.stringToBytesFuncs = {
|
|
@@ -665,7 +718,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
665
718
|
}
|
|
666
719
|
})["default"], t.createStringToBytes = function (t, e) {
|
|
667
720
|
var r = function () {
|
|
668
|
-
for (var r =
|
|
721
|
+
for (var r = w(t), n = function n() {
|
|
669
722
|
var t = r.read();
|
|
670
723
|
if (-1 == t) throw "eof";
|
|
671
724
|
return t;
|
|
@@ -772,8 +825,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
772
825
|
throw "bad maskPattern:" + t;
|
|
773
826
|
}
|
|
774
827
|
}, o.getErrorCorrectPolynomial = function (t) {
|
|
775
|
-
for (var e =
|
|
776
|
-
e = e.multiply(
|
|
828
|
+
for (var e = h([1], 0), r = 0; r < t; r += 1) {
|
|
829
|
+
e = e.multiply(h([1, u.gexp(r)], 0));
|
|
777
830
|
}
|
|
778
831
|
|
|
779
832
|
return e;
|
|
@@ -841,8 +894,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
841
894
|
|
|
842
895
|
for (n = 0; n < e - 1; n += 1) {
|
|
843
896
|
for (o = 0; o < e - 1; o += 1) {
|
|
844
|
-
var
|
|
845
|
-
t.isDark(n, o) && (
|
|
897
|
+
var h = 0;
|
|
898
|
+
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
899
|
}
|
|
847
900
|
}
|
|
848
901
|
|
|
@@ -858,15 +911,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
858
911
|
}
|
|
859
912
|
}
|
|
860
913
|
|
|
861
|
-
var
|
|
914
|
+
var c = 0;
|
|
862
915
|
|
|
863
916
|
for (o = 0; o < e; o += 1) {
|
|
864
917
|
for (n = 0; n < e; n += 1) {
|
|
865
|
-
t.isDark(n, o) && (
|
|
918
|
+
t.isDark(n, o) && (c += 1);
|
|
866
919
|
}
|
|
867
920
|
}
|
|
868
921
|
|
|
869
|
-
return r + Math.abs(100 *
|
|
922
|
+
return r + Math.abs(100 * c / e / e - 50) / 5 * 10;
|
|
870
923
|
}, o),
|
|
871
924
|
u = function () {
|
|
872
925
|
for (var t = new Array(256), e = new Array(256), r = 0; r < 8; r += 1) {
|
|
@@ -900,7 +953,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
900
953
|
};
|
|
901
954
|
}();
|
|
902
955
|
|
|
903
|
-
function
|
|
956
|
+
function h(t, e) {
|
|
904
957
|
if (void 0 === t.length) throw t.length + "/" + e;
|
|
905
958
|
|
|
906
959
|
var r = function () {
|
|
@@ -928,7 +981,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
928
981
|
}
|
|
929
982
|
}
|
|
930
983
|
|
|
931
|
-
return
|
|
984
|
+
return h(e, 0);
|
|
932
985
|
},
|
|
933
986
|
mod: function mod(t) {
|
|
934
987
|
if (n.getLength() - t.getLength() < 0) return n;
|
|
@@ -941,14 +994,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
941
994
|
r[o] ^= u.gexp(u.glog(t.getAt(o)) + e);
|
|
942
995
|
}
|
|
943
996
|
|
|
944
|
-
return
|
|
997
|
+
return h(r, 0).mod(t);
|
|
945
998
|
}
|
|
946
999
|
};
|
|
947
1000
|
|
|
948
1001
|
return n;
|
|
949
1002
|
}
|
|
950
1003
|
|
|
951
|
-
var
|
|
1004
|
+
var c = function () {
|
|
952
1005
|
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
1006
|
e = function e(t, _e) {
|
|
954
1007
|
var r = {};
|
|
@@ -978,8 +1031,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
978
1031
|
if (void 0 === o) throw "bad rs block @ typeNumber:" + r + "/errorCorrectionLevel:" + n;
|
|
979
1032
|
|
|
980
1033
|
for (var i = o.length / 3, s = [], u = 0; u < i; u += 1) {
|
|
981
|
-
for (var
|
|
982
|
-
s.push(e(
|
|
1034
|
+
for (var h = o[3 * u + 0], c = o[3 * u + 1], l = o[3 * u + 2], d = 0; d < h; d += 1) {
|
|
1035
|
+
s.push(e(c, l));
|
|
983
1036
|
}
|
|
984
1037
|
}
|
|
985
1038
|
|
|
@@ -989,7 +1042,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
989
1042
|
|
|
990
1043
|
return r;
|
|
991
1044
|
}(),
|
|
992
|
-
|
|
1045
|
+
l = function l() {
|
|
993
1046
|
var t = [],
|
|
994
1047
|
e = 0,
|
|
995
1048
|
r = {
|
|
@@ -1015,7 +1068,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1015
1068
|
};
|
|
1016
1069
|
return r;
|
|
1017
1070
|
},
|
|
1018
|
-
|
|
1071
|
+
d = function d(t) {
|
|
1019
1072
|
var e = t,
|
|
1020
1073
|
r = {
|
|
1021
1074
|
getMode: function getMode() {
|
|
@@ -1102,7 +1155,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1102
1155
|
|
|
1103
1156
|
return r;
|
|
1104
1157
|
},
|
|
1105
|
-
|
|
1158
|
+
g = function g(e) {
|
|
1106
1159
|
var r = t.stringToBytes(e);
|
|
1107
1160
|
return {
|
|
1108
1161
|
getMode: function getMode() {
|
|
@@ -1118,7 +1171,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1118
1171
|
}
|
|
1119
1172
|
};
|
|
1120
1173
|
},
|
|
1121
|
-
|
|
1174
|
+
p = function p(e) {
|
|
1122
1175
|
var r = t.stringToBytesFuncs.SJIS;
|
|
1123
1176
|
if (!r) throw "sjis not supported.";
|
|
1124
1177
|
!function (t, e) {
|
|
@@ -1184,7 +1237,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1184
1237
|
};
|
|
1185
1238
|
return e;
|
|
1186
1239
|
},
|
|
1187
|
-
|
|
1240
|
+
w = function w(t) {
|
|
1188
1241
|
var e = t,
|
|
1189
1242
|
r = 0,
|
|
1190
1243
|
n = 0,
|
|
@@ -1217,7 +1270,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1217
1270
|
|
|
1218
1271
|
return i;
|
|
1219
1272
|
},
|
|
1220
|
-
|
|
1273
|
+
y = function y(t, e, r) {
|
|
1221
1274
|
for (var n = function (t, e) {
|
|
1222
1275
|
var r = t,
|
|
1223
1276
|
n = e,
|
|
@@ -1245,33 +1298,33 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1245
1298
|
|
|
1246
1299
|
i.add(String.fromCharCode(e)), i.add(String.fromCharCode(r));
|
|
1247
1300
|
var u,
|
|
1248
|
-
c,
|
|
1249
1301
|
h,
|
|
1250
|
-
|
|
1251
|
-
l = (
|
|
1302
|
+
c,
|
|
1303
|
+
l = v(),
|
|
1304
|
+
d = (u = l, h = 0, c = 0, {
|
|
1252
1305
|
write: function write(t, e) {
|
|
1253
1306
|
if (t >>> e != 0) throw "length over";
|
|
1254
1307
|
|
|
1255
|
-
for (;
|
|
1256
|
-
u.writeByte(255 & (t <<
|
|
1308
|
+
for (; h + e >= 8;) {
|
|
1309
|
+
u.writeByte(255 & (t << h | c)), e -= 8 - h, t >>>= 8 - h, c = 0, h = 0;
|
|
1257
1310
|
}
|
|
1258
1311
|
|
|
1259
|
-
|
|
1312
|
+
c |= t << h, h += e;
|
|
1260
1313
|
},
|
|
1261
1314
|
flush: function flush() {
|
|
1262
|
-
|
|
1315
|
+
h > 0 && u.writeByte(c);
|
|
1263
1316
|
}
|
|
1264
1317
|
});
|
|
1265
|
-
|
|
1318
|
+
d.write(e, n);
|
|
1266
1319
|
var f = 0,
|
|
1267
|
-
|
|
1320
|
+
g = String.fromCharCode(o[f]);
|
|
1268
1321
|
|
|
1269
1322
|
for (f += 1; f < o.length;) {
|
|
1270
|
-
var
|
|
1271
|
-
f += 1, i.contains(
|
|
1323
|
+
var p = String.fromCharCode(o[f]);
|
|
1324
|
+
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
1325
|
}
|
|
1273
1326
|
|
|
1274
|
-
return
|
|
1327
|
+
return d.write(i.indexOf(g), n), d.write(r, n), d.flush(), l.toByteArray();
|
|
1275
1328
|
},
|
|
1276
1329
|
s = function s() {
|
|
1277
1330
|
var t = {},
|
|
@@ -1335,8 +1388,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1335
1388
|
}, o.toString = function () {
|
|
1336
1389
|
return n;
|
|
1337
1390
|
}, o;
|
|
1338
|
-
}(), u = a.toByteArray(),
|
|
1339
|
-
s.writeByte(u[
|
|
1391
|
+
}(), u = a.toByteArray(), h = 0; h < u.length; h += 1) {
|
|
1392
|
+
s.writeByte(u[h]);
|
|
1340
1393
|
}
|
|
1341
1394
|
|
|
1342
1395
|
return s.flush(), "data:image/gif;base64," + s;
|
|
@@ -1358,12 +1411,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1358
1411
|
return o;
|
|
1359
1412
|
}) ? r.apply(e, []) : r) || (t.exports = n);
|
|
1360
1413
|
},
|
|
1361
|
-
|
|
1414
|
+
676: function _(t, e, r) {
|
|
1362
1415
|
"use strict";
|
|
1363
1416
|
|
|
1364
1417
|
r.d(e, {
|
|
1365
1418
|
"default": function _default() {
|
|
1366
|
-
return
|
|
1419
|
+
return q;
|
|
1367
1420
|
}
|
|
1368
1421
|
});
|
|
1369
1422
|
|
|
@@ -1418,49 +1471,148 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1418
1471
|
}
|
|
1419
1472
|
|
|
1420
1473
|
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
|
-
|
|
1474
|
+
return e = this, r = void 0, o = function o() {
|
|
1475
|
+
return function (t, e) {
|
|
1476
|
+
var r,
|
|
1477
|
+
n,
|
|
1478
|
+
o,
|
|
1479
|
+
i,
|
|
1480
|
+
a = {
|
|
1481
|
+
label: 0,
|
|
1482
|
+
sent: function sent() {
|
|
1483
|
+
if (1 & o[0]) throw o[1];
|
|
1484
|
+
return o[1];
|
|
1485
|
+
},
|
|
1486
|
+
trys: [],
|
|
1487
|
+
ops: []
|
|
1488
|
+
};
|
|
1489
|
+
return i = {
|
|
1490
|
+
next: s(0),
|
|
1491
|
+
"throw": s(1),
|
|
1492
|
+
"return": s(2)
|
|
1493
|
+
}, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
|
|
1494
|
+
return this;
|
|
1495
|
+
}), i;
|
|
1496
|
+
|
|
1497
|
+
function s(i) {
|
|
1498
|
+
return function (s) {
|
|
1499
|
+
return function (i) {
|
|
1500
|
+
if (r) throw new TypeError("Generator is already executing.");
|
|
1501
|
+
|
|
1502
|
+
for (; a;) {
|
|
1503
|
+
try {
|
|
1504
|
+
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;
|
|
1505
|
+
|
|
1506
|
+
switch (n = 0, o && (i = [2 & i[0], o.value]), i[0]) {
|
|
1507
|
+
case 0:
|
|
1508
|
+
case 1:
|
|
1509
|
+
o = i;
|
|
1510
|
+
break;
|
|
1511
|
+
|
|
1512
|
+
case 4:
|
|
1513
|
+
return a.label++, {
|
|
1514
|
+
value: i[1],
|
|
1515
|
+
done: !1
|
|
1516
|
+
};
|
|
1517
|
+
|
|
1518
|
+
case 5:
|
|
1519
|
+
a.label++, n = i[1], i = [0];
|
|
1520
|
+
continue;
|
|
1521
|
+
|
|
1522
|
+
case 7:
|
|
1523
|
+
i = a.ops.pop(), a.trys.pop();
|
|
1524
|
+
continue;
|
|
1525
|
+
|
|
1526
|
+
default:
|
|
1527
|
+
if (!((o = (o = a.trys).length > 0 && o[o.length - 1]) || 6 !== i[0] && 2 !== i[0])) {
|
|
1528
|
+
a = 0;
|
|
1529
|
+
continue;
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
if (3 === i[0] && (!o || i[1] > o[0] && i[1] < o[3])) {
|
|
1533
|
+
a.label = i[1];
|
|
1534
|
+
break;
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
if (6 === i[0] && a.label < o[1]) {
|
|
1538
|
+
a.label = o[1], o = i;
|
|
1539
|
+
break;
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
if (o && a.label < o[2]) {
|
|
1543
|
+
a.label = o[2], a.ops.push(i);
|
|
1544
|
+
break;
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
o[2] && a.ops.pop(), a.trys.pop();
|
|
1548
|
+
continue;
|
|
1549
|
+
}
|
|
1550
|
+
|
|
1551
|
+
i = e.call(t, a);
|
|
1552
|
+
} catch (t) {
|
|
1553
|
+
i = [6, t], n = 0;
|
|
1554
|
+
} finally {
|
|
1555
|
+
r = o = 0;
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
if (5 & i[0]) throw i[1];
|
|
1560
|
+
return {
|
|
1561
|
+
value: i[0] ? i[1] : void 0,
|
|
1562
|
+
done: !0
|
|
1563
|
+
};
|
|
1564
|
+
}([i, s]);
|
|
1565
|
+
};
|
|
1566
|
+
}
|
|
1567
|
+
}(this, function (e) {
|
|
1568
|
+
return [2, new Promise(function (e) {
|
|
1569
|
+
var r = new XMLHttpRequest();
|
|
1570
|
+
r.onload = function () {
|
|
1571
|
+
var t = new FileReader();
|
|
1572
|
+
t.onloadend = function () {
|
|
1573
|
+
e(t.result);
|
|
1574
|
+
}, t.readAsDataURL(r.response);
|
|
1575
|
+
}, r.open("GET", t), r.responseType = "blob", r.send();
|
|
1576
|
+
})];
|
|
1577
|
+
});
|
|
1578
|
+
}, new ((n = void 0) || (n = Promise))(function (t, i) {
|
|
1579
|
+
function a(t) {
|
|
1580
|
+
try {
|
|
1581
|
+
u(o.next(t));
|
|
1582
|
+
} catch (t) {
|
|
1583
|
+
i(t);
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1587
|
+
function s(t) {
|
|
1588
|
+
try {
|
|
1589
|
+
u(o["throw"](t));
|
|
1590
|
+
} catch (t) {
|
|
1591
|
+
i(t);
|
|
1592
|
+
}
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1595
|
+
function u(e) {
|
|
1596
|
+
var r;
|
|
1597
|
+
e.done ? t(e.value) : (r = e.value, r instanceof n ? r : new n(function (t) {
|
|
1598
|
+
t(r);
|
|
1599
|
+
})).then(a, s);
|
|
1600
|
+
}
|
|
1601
|
+
|
|
1602
|
+
u((o = o.apply(e, r || [])).next());
|
|
1603
|
+
});
|
|
1604
|
+
var e, r, n, o;
|
|
1447
1605
|
}
|
|
1448
1606
|
|
|
1449
|
-
var
|
|
1607
|
+
var h = {
|
|
1450
1608
|
L: .07,
|
|
1451
1609
|
M: .15,
|
|
1452
1610
|
Q: .25,
|
|
1453
1611
|
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) {
|
|
1612
|
+
};
|
|
1613
|
+
|
|
1614
|
+
var _c = function c() {
|
|
1615
|
+
return (_c = Object.assign || function (t) {
|
|
1464
1616
|
for (var e, r = 1, n = arguments.length; r < n; r++) {
|
|
1465
1617
|
for (var o in e = arguments[r]) {
|
|
1466
1618
|
Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
|
|
@@ -1471,39 +1623,38 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1471
1623
|
}).apply(this, arguments);
|
|
1472
1624
|
};
|
|
1473
1625
|
|
|
1474
|
-
var
|
|
1626
|
+
var l = function () {
|
|
1475
1627
|
function t(t) {
|
|
1476
|
-
var e = t.
|
|
1628
|
+
var e = t.svg,
|
|
1477
1629
|
r = t.type;
|
|
1478
|
-
this.
|
|
1630
|
+
this._svg = e, this._type = r;
|
|
1479
1631
|
}
|
|
1480
1632
|
|
|
1481
1633
|
return t.prototype.draw = function (t, e, r, n) {
|
|
1482
|
-
var o
|
|
1483
|
-
i = this._context;
|
|
1634
|
+
var o;
|
|
1484
1635
|
|
|
1485
1636
|
switch (this._type) {
|
|
1486
|
-
case
|
|
1637
|
+
case "dots":
|
|
1487
1638
|
o = this._drawDot;
|
|
1488
1639
|
break;
|
|
1489
1640
|
|
|
1490
|
-
case
|
|
1641
|
+
case "classy":
|
|
1491
1642
|
o = this._drawClassy;
|
|
1492
1643
|
break;
|
|
1493
1644
|
|
|
1494
|
-
case
|
|
1645
|
+
case "classy-rounded":
|
|
1495
1646
|
o = this._drawClassyRounded;
|
|
1496
1647
|
break;
|
|
1497
1648
|
|
|
1498
|
-
case
|
|
1649
|
+
case "rounded":
|
|
1499
1650
|
o = this._drawRounded;
|
|
1500
1651
|
break;
|
|
1501
1652
|
|
|
1502
|
-
case
|
|
1653
|
+
case "extra-rounded":
|
|
1503
1654
|
o = this._drawExtraRounded;
|
|
1504
1655
|
break;
|
|
1505
1656
|
|
|
1506
|
-
case
|
|
1657
|
+
case "square":
|
|
1507
1658
|
default:
|
|
1508
1659
|
o = this._drawSquare;
|
|
1509
1660
|
}
|
|
@@ -1512,276 +1663,251 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1512
1663
|
x: t,
|
|
1513
1664
|
y: e,
|
|
1514
1665
|
size: r,
|
|
1515
|
-
context: i,
|
|
1516
1666
|
getNeighbor: n
|
|
1517
1667
|
});
|
|
1518
1668
|
}, t.prototype._rotateFigure = function (t) {
|
|
1519
|
-
var e
|
|
1520
|
-
r = t.
|
|
1521
|
-
n = t.
|
|
1522
|
-
o = t.
|
|
1669
|
+
var e,
|
|
1670
|
+
r = t.x,
|
|
1671
|
+
n = t.y,
|
|
1672
|
+
o = t.size,
|
|
1523
1673
|
i = t.rotation,
|
|
1524
1674
|
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);
|
|
1675
|
+
s = r + o / 2,
|
|
1676
|
+
u = n + o / 2;
|
|
1677
|
+
(0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
|
|
1529
1678
|
}, t.prototype._basicDot = function (t) {
|
|
1530
|
-
var e =
|
|
1531
|
-
r = t.
|
|
1679
|
+
var e = this,
|
|
1680
|
+
r = t.size,
|
|
1681
|
+
n = t.x,
|
|
1682
|
+
o = t.y;
|
|
1532
1683
|
|
|
1533
|
-
this._rotateFigure(
|
|
1684
|
+
this._rotateFigure(_c(_c({}, t), {
|
|
1534
1685
|
draw: function draw() {
|
|
1535
|
-
|
|
1686
|
+
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
1687
|
}
|
|
1537
1688
|
}));
|
|
1538
1689
|
}, t.prototype._basicSquare = function (t) {
|
|
1539
|
-
var e =
|
|
1540
|
-
r = t.
|
|
1690
|
+
var e = this,
|
|
1691
|
+
r = t.size,
|
|
1692
|
+
n = t.x,
|
|
1693
|
+
o = t.y;
|
|
1541
1694
|
|
|
1542
|
-
this._rotateFigure(
|
|
1695
|
+
this._rotateFigure(_c(_c({}, t), {
|
|
1543
1696
|
draw: function draw() {
|
|
1544
|
-
|
|
1697
|
+
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
1698
|
}
|
|
1546
1699
|
}));
|
|
1547
1700
|
}, t.prototype._basicSideRounded = function (t) {
|
|
1548
|
-
var e =
|
|
1549
|
-
r = t.
|
|
1701
|
+
var e = this,
|
|
1702
|
+
r = t.size,
|
|
1703
|
+
n = t.x,
|
|
1704
|
+
o = t.y;
|
|
1550
1705
|
|
|
1551
|
-
this._rotateFigure(
|
|
1706
|
+
this._rotateFigure(_c(_c({}, t), {
|
|
1552
1707
|
draw: function draw() {
|
|
1553
|
-
|
|
1708
|
+
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
1709
|
}
|
|
1555
1710
|
}));
|
|
1556
1711
|
}, t.prototype._basicCornerRounded = function (t) {
|
|
1557
|
-
var e =
|
|
1558
|
-
r = t.
|
|
1712
|
+
var e = this,
|
|
1713
|
+
r = t.size,
|
|
1714
|
+
n = t.x,
|
|
1715
|
+
o = t.y;
|
|
1559
1716
|
|
|
1560
|
-
this._rotateFigure(
|
|
1717
|
+
this._rotateFigure(_c(_c({}, t), {
|
|
1561
1718
|
draw: function draw() {
|
|
1562
|
-
|
|
1719
|
+
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
1720
|
}
|
|
1564
1721
|
}));
|
|
1565
1722
|
}, t.prototype._basicCornerExtraRounded = function (t) {
|
|
1566
|
-
var e =
|
|
1567
|
-
r = t.
|
|
1723
|
+
var e = this,
|
|
1724
|
+
r = t.size,
|
|
1725
|
+
n = t.x,
|
|
1726
|
+
o = t.y;
|
|
1568
1727
|
|
|
1569
|
-
this._rotateFigure(
|
|
1728
|
+
this._rotateFigure(_c(_c({}, t), {
|
|
1570
1729
|
draw: function draw() {
|
|
1571
|
-
|
|
1730
|
+
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
1731
|
}
|
|
1573
1732
|
}));
|
|
1574
1733
|
}, 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;
|
|
1734
|
+
var e = this,
|
|
1735
|
+
r = t.size,
|
|
1736
|
+
n = t.x,
|
|
1737
|
+
o = t.y;
|
|
1586
1738
|
|
|
1587
|
-
this._rotateFigure(
|
|
1739
|
+
this._rotateFigure(_c(_c({}, t), {
|
|
1588
1740
|
draw: function draw() {
|
|
1589
|
-
|
|
1741
|
+
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
1742
|
}
|
|
1591
1743
|
}));
|
|
1592
1744
|
}, t.prototype._drawDot = function (t) {
|
|
1593
1745
|
var e = t.x,
|
|
1594
1746
|
r = t.y,
|
|
1595
|
-
n = t.size
|
|
1596
|
-
o = t.context;
|
|
1747
|
+
n = t.size;
|
|
1597
1748
|
|
|
1598
1749
|
this._basicDot({
|
|
1599
1750
|
x: e,
|
|
1600
1751
|
y: r,
|
|
1601
1752
|
size: n,
|
|
1602
|
-
context: o,
|
|
1603
1753
|
rotation: 0
|
|
1604
1754
|
});
|
|
1605
1755
|
}, t.prototype._drawSquare = function (t) {
|
|
1606
1756
|
var e = t.x,
|
|
1607
1757
|
r = t.y,
|
|
1608
|
-
n = t.size
|
|
1609
|
-
o = t.context;
|
|
1758
|
+
n = t.size;
|
|
1610
1759
|
|
|
1611
1760
|
this._basicSquare({
|
|
1612
1761
|
x: e,
|
|
1613
1762
|
y: r,
|
|
1614
1763
|
size: n,
|
|
1615
|
-
context: o,
|
|
1616
1764
|
rotation: 0
|
|
1617
1765
|
});
|
|
1618
1766
|
}, t.prototype._drawRounded = function (t) {
|
|
1619
1767
|
var e = t.x,
|
|
1620
1768
|
r = t.y,
|
|
1621
1769
|
n = t.size,
|
|
1622
|
-
o = t.
|
|
1623
|
-
i =
|
|
1624
|
-
a =
|
|
1625
|
-
s =
|
|
1626
|
-
u =
|
|
1627
|
-
|
|
1628
|
-
h = a + s + u + c;
|
|
1770
|
+
o = t.getNeighbor,
|
|
1771
|
+
i = o ? +o(-1, 0) : 0,
|
|
1772
|
+
a = o ? +o(1, 0) : 0,
|
|
1773
|
+
s = o ? +o(0, -1) : 0,
|
|
1774
|
+
u = o ? +o(0, 1) : 0,
|
|
1775
|
+
h = i + a + s + u;
|
|
1629
1776
|
if (0 !== h) {
|
|
1630
|
-
if (h > 2 ||
|
|
1777
|
+
if (h > 2 || i && a || s && u) this._basicSquare({
|
|
1631
1778
|
x: e,
|
|
1632
1779
|
y: r,
|
|
1633
1780
|
size: n,
|
|
1634
|
-
context: o,
|
|
1635
1781
|
rotation: 0
|
|
1636
1782
|
});else {
|
|
1637
1783
|
if (2 === h) {
|
|
1638
|
-
var
|
|
1639
|
-
return
|
|
1784
|
+
var c = 0;
|
|
1785
|
+
return i && s ? c = Math.PI / 2 : s && a ? c = Math.PI : a && u && (c = -Math.PI / 2), void this._basicCornerRounded({
|
|
1640
1786
|
x: e,
|
|
1641
1787
|
y: r,
|
|
1642
1788
|
size: n,
|
|
1643
|
-
|
|
1644
|
-
rotation: d
|
|
1789
|
+
rotation: c
|
|
1645
1790
|
});
|
|
1646
1791
|
}
|
|
1647
1792
|
|
|
1648
|
-
if (1 === h) return
|
|
1793
|
+
if (1 === h) return c = 0, s ? c = Math.PI / 2 : a ? c = Math.PI : u && (c = -Math.PI / 2), void this._basicSideRounded({
|
|
1649
1794
|
x: e,
|
|
1650
1795
|
y: r,
|
|
1651
1796
|
size: n,
|
|
1652
|
-
|
|
1653
|
-
rotation: d
|
|
1797
|
+
rotation: c
|
|
1654
1798
|
});
|
|
1655
1799
|
}
|
|
1656
1800
|
} else this._basicDot({
|
|
1657
1801
|
x: e,
|
|
1658
1802
|
y: r,
|
|
1659
1803
|
size: n,
|
|
1660
|
-
context: o,
|
|
1661
1804
|
rotation: 0
|
|
1662
1805
|
});
|
|
1663
1806
|
}, t.prototype._drawExtraRounded = function (t) {
|
|
1664
1807
|
var e = t.x,
|
|
1665
1808
|
r = t.y,
|
|
1666
1809
|
n = t.size,
|
|
1667
|
-
o = t.
|
|
1668
|
-
i =
|
|
1669
|
-
a =
|
|
1670
|
-
s =
|
|
1671
|
-
u =
|
|
1672
|
-
|
|
1673
|
-
h = a + s + u + c;
|
|
1810
|
+
o = t.getNeighbor,
|
|
1811
|
+
i = o ? +o(-1, 0) : 0,
|
|
1812
|
+
a = o ? +o(1, 0) : 0,
|
|
1813
|
+
s = o ? +o(0, -1) : 0,
|
|
1814
|
+
u = o ? +o(0, 1) : 0,
|
|
1815
|
+
h = i + a + s + u;
|
|
1674
1816
|
if (0 !== h) {
|
|
1675
|
-
if (h > 2 ||
|
|
1817
|
+
if (h > 2 || i && a || s && u) this._basicSquare({
|
|
1676
1818
|
x: e,
|
|
1677
1819
|
y: r,
|
|
1678
1820
|
size: n,
|
|
1679
|
-
context: o,
|
|
1680
1821
|
rotation: 0
|
|
1681
1822
|
});else {
|
|
1682
1823
|
if (2 === h) {
|
|
1683
|
-
var
|
|
1684
|
-
return
|
|
1824
|
+
var c = 0;
|
|
1825
|
+
return i && s ? c = Math.PI / 2 : s && a ? c = Math.PI : a && u && (c = -Math.PI / 2), void this._basicCornerExtraRounded({
|
|
1685
1826
|
x: e,
|
|
1686
1827
|
y: r,
|
|
1687
1828
|
size: n,
|
|
1688
|
-
|
|
1689
|
-
rotation: d
|
|
1829
|
+
rotation: c
|
|
1690
1830
|
});
|
|
1691
1831
|
}
|
|
1692
1832
|
|
|
1693
|
-
if (1 === h) return
|
|
1833
|
+
if (1 === h) return c = 0, s ? c = Math.PI / 2 : a ? c = Math.PI : u && (c = -Math.PI / 2), void this._basicSideRounded({
|
|
1694
1834
|
x: e,
|
|
1695
1835
|
y: r,
|
|
1696
1836
|
size: n,
|
|
1697
|
-
|
|
1698
|
-
rotation: d
|
|
1837
|
+
rotation: c
|
|
1699
1838
|
});
|
|
1700
1839
|
}
|
|
1701
1840
|
} else this._basicDot({
|
|
1702
1841
|
x: e,
|
|
1703
1842
|
y: r,
|
|
1704
1843
|
size: n,
|
|
1705
|
-
context: o,
|
|
1706
1844
|
rotation: 0
|
|
1707
1845
|
});
|
|
1708
1846
|
}, t.prototype._drawClassy = function (t) {
|
|
1709
1847
|
var e = t.x,
|
|
1710
1848
|
r = t.y,
|
|
1711
1849
|
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({
|
|
1850
|
+
o = t.getNeighbor,
|
|
1851
|
+
i = o ? +o(-1, 0) : 0,
|
|
1852
|
+
a = o ? +o(1, 0) : 0,
|
|
1853
|
+
s = o ? +o(0, -1) : 0,
|
|
1854
|
+
u = o ? +o(0, 1) : 0;
|
|
1855
|
+
0 !== i + a + s + u ? i || s ? a || u ? this._basicSquare({
|
|
1719
1856
|
x: e,
|
|
1720
1857
|
y: r,
|
|
1721
1858
|
size: n,
|
|
1722
|
-
context: o,
|
|
1723
1859
|
rotation: 0
|
|
1724
1860
|
}) : this._basicCornerRounded({
|
|
1725
1861
|
x: e,
|
|
1726
1862
|
y: r,
|
|
1727
1863
|
size: n,
|
|
1728
|
-
context: o,
|
|
1729
1864
|
rotation: Math.PI / 2
|
|
1730
1865
|
}) : this._basicCornerRounded({
|
|
1731
1866
|
x: e,
|
|
1732
1867
|
y: r,
|
|
1733
1868
|
size: n,
|
|
1734
|
-
context: o,
|
|
1735
1869
|
rotation: -Math.PI / 2
|
|
1736
1870
|
}) : this._basicCornersRounded({
|
|
1737
1871
|
x: e,
|
|
1738
1872
|
y: r,
|
|
1739
1873
|
size: n,
|
|
1740
|
-
context: o,
|
|
1741
1874
|
rotation: Math.PI / 2
|
|
1742
1875
|
});
|
|
1743
1876
|
}, t.prototype._drawClassyRounded = function (t) {
|
|
1744
1877
|
var e = t.x,
|
|
1745
1878
|
r = t.y,
|
|
1746
1879
|
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({
|
|
1880
|
+
o = t.getNeighbor,
|
|
1881
|
+
i = o ? +o(-1, 0) : 0,
|
|
1882
|
+
a = o ? +o(1, 0) : 0,
|
|
1883
|
+
s = o ? +o(0, -1) : 0,
|
|
1884
|
+
u = o ? +o(0, 1) : 0;
|
|
1885
|
+
0 !== i + a + s + u ? i || s ? a || u ? this._basicSquare({
|
|
1754
1886
|
x: e,
|
|
1755
1887
|
y: r,
|
|
1756
1888
|
size: n,
|
|
1757
|
-
context: o,
|
|
1758
1889
|
rotation: 0
|
|
1759
1890
|
}) : this._basicCornerExtraRounded({
|
|
1760
1891
|
x: e,
|
|
1761
1892
|
y: r,
|
|
1762
1893
|
size: n,
|
|
1763
|
-
context: o,
|
|
1764
1894
|
rotation: Math.PI / 2
|
|
1765
1895
|
}) : this._basicCornerExtraRounded({
|
|
1766
1896
|
x: e,
|
|
1767
1897
|
y: r,
|
|
1768
1898
|
size: n,
|
|
1769
|
-
context: o,
|
|
1770
1899
|
rotation: -Math.PI / 2
|
|
1771
1900
|
}) : this._basicCornersRounded({
|
|
1772
1901
|
x: e,
|
|
1773
1902
|
y: r,
|
|
1774
1903
|
size: n,
|
|
1775
|
-
context: o,
|
|
1776
1904
|
rotation: Math.PI / 2
|
|
1777
1905
|
});
|
|
1778
1906
|
}, t;
|
|
1779
|
-
}()
|
|
1780
|
-
w = "square",
|
|
1781
|
-
_ = "extra-rounded";
|
|
1907
|
+
}();
|
|
1782
1908
|
|
|
1783
|
-
var
|
|
1784
|
-
return (
|
|
1909
|
+
var _d = function d() {
|
|
1910
|
+
return (_d = Object.assign || function (t) {
|
|
1785
1911
|
for (var e, r = 1, n = arguments.length; r < n; r++) {
|
|
1786
1912
|
for (var o in e = arguments[r]) {
|
|
1787
1913
|
Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
|
|
@@ -1792,23 +1918,22 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1792
1918
|
}).apply(this, arguments);
|
|
1793
1919
|
};
|
|
1794
1920
|
|
|
1795
|
-
var
|
|
1921
|
+
var f = function () {
|
|
1796
1922
|
function t(t) {
|
|
1797
|
-
var e = t.
|
|
1923
|
+
var e = t.svg,
|
|
1798
1924
|
r = t.type;
|
|
1799
|
-
this.
|
|
1925
|
+
this._svg = e, this._type = r;
|
|
1800
1926
|
}
|
|
1801
1927
|
|
|
1802
1928
|
return t.prototype.draw = function (t, e, r, n) {
|
|
1803
|
-
var o
|
|
1804
|
-
i = this._context;
|
|
1929
|
+
var o;
|
|
1805
1930
|
|
|
1806
1931
|
switch (this._type) {
|
|
1807
|
-
case
|
|
1932
|
+
case "square":
|
|
1808
1933
|
o = this._drawSquare;
|
|
1809
1934
|
break;
|
|
1810
1935
|
|
|
1811
|
-
case
|
|
1936
|
+
case "extra-rounded":
|
|
1812
1937
|
o = this._drawExtraRounded;
|
|
1813
1938
|
break;
|
|
1814
1939
|
|
|
@@ -1821,98 +1946,95 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1821
1946
|
x: t,
|
|
1822
1947
|
y: e,
|
|
1823
1948
|
size: r,
|
|
1824
|
-
context: i,
|
|
1825
1949
|
rotation: n
|
|
1826
1950
|
});
|
|
1827
1951
|
}, t.prototype._rotateFigure = function (t) {
|
|
1828
|
-
var e
|
|
1829
|
-
r = t.
|
|
1830
|
-
n = t.
|
|
1831
|
-
o = t.
|
|
1952
|
+
var e,
|
|
1953
|
+
r = t.x,
|
|
1954
|
+
n = t.y,
|
|
1955
|
+
o = t.size,
|
|
1832
1956
|
i = t.rotation,
|
|
1833
1957
|
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);
|
|
1958
|
+
s = r + o / 2,
|
|
1959
|
+
u = n + o / 2;
|
|
1960
|
+
(0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
|
|
1838
1961
|
}, t.prototype._basicDot = function (t) {
|
|
1839
|
-
var e =
|
|
1840
|
-
r = t.
|
|
1841
|
-
n =
|
|
1962
|
+
var e = this,
|
|
1963
|
+
r = t.size,
|
|
1964
|
+
n = t.x,
|
|
1965
|
+
o = t.y,
|
|
1966
|
+
i = r / 7;
|
|
1842
1967
|
|
|
1843
|
-
this._rotateFigure(
|
|
1968
|
+
this._rotateFigure(_d(_d({}, t), {
|
|
1844
1969
|
draw: function draw() {
|
|
1845
|
-
|
|
1970
|
+
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
1971
|
}
|
|
1847
1972
|
}));
|
|
1848
1973
|
}, t.prototype._basicSquare = function (t) {
|
|
1849
|
-
var e =
|
|
1850
|
-
r = t.
|
|
1851
|
-
n =
|
|
1974
|
+
var e = this,
|
|
1975
|
+
r = t.size,
|
|
1976
|
+
n = t.x,
|
|
1977
|
+
o = t.y,
|
|
1978
|
+
i = r / 7;
|
|
1852
1979
|
|
|
1853
|
-
this._rotateFigure(
|
|
1980
|
+
this._rotateFigure(_d(_d({}, t), {
|
|
1854
1981
|
draw: function draw() {
|
|
1855
|
-
|
|
1982
|
+
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
1983
|
}
|
|
1857
1984
|
}));
|
|
1858
1985
|
}, t.prototype._basicExtraRounded = function (t) {
|
|
1859
|
-
var e =
|
|
1860
|
-
r = t.
|
|
1861
|
-
n =
|
|
1986
|
+
var e = this,
|
|
1987
|
+
r = t.size,
|
|
1988
|
+
n = t.x,
|
|
1989
|
+
o = t.y,
|
|
1990
|
+
i = r / 7;
|
|
1862
1991
|
|
|
1863
|
-
this._rotateFigure(
|
|
1992
|
+
this._rotateFigure(_d(_d({}, t), {
|
|
1864
1993
|
draw: function draw() {
|
|
1865
|
-
|
|
1994
|
+
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
1995
|
}
|
|
1867
1996
|
}));
|
|
1868
1997
|
}, t.prototype._drawDot = function (t) {
|
|
1869
1998
|
var e = t.x,
|
|
1870
1999
|
r = t.y,
|
|
1871
2000
|
n = t.size,
|
|
1872
|
-
o = t.
|
|
1873
|
-
i = t.rotation;
|
|
2001
|
+
o = t.rotation;
|
|
1874
2002
|
|
|
1875
2003
|
this._basicDot({
|
|
1876
2004
|
x: e,
|
|
1877
2005
|
y: r,
|
|
1878
2006
|
size: n,
|
|
1879
|
-
|
|
1880
|
-
rotation: i
|
|
2007
|
+
rotation: o
|
|
1881
2008
|
});
|
|
1882
2009
|
}, t.prototype._drawSquare = function (t) {
|
|
1883
2010
|
var e = t.x,
|
|
1884
2011
|
r = t.y,
|
|
1885
2012
|
n = t.size,
|
|
1886
|
-
o = t.
|
|
1887
|
-
i = t.rotation;
|
|
2013
|
+
o = t.rotation;
|
|
1888
2014
|
|
|
1889
2015
|
this._basicSquare({
|
|
1890
2016
|
x: e,
|
|
1891
2017
|
y: r,
|
|
1892
2018
|
size: n,
|
|
1893
|
-
|
|
1894
|
-
rotation: i
|
|
2019
|
+
rotation: o
|
|
1895
2020
|
});
|
|
1896
2021
|
}, t.prototype._drawExtraRounded = function (t) {
|
|
1897
2022
|
var e = t.x,
|
|
1898
2023
|
r = t.y,
|
|
1899
2024
|
n = t.size,
|
|
1900
|
-
o = t.
|
|
1901
|
-
i = t.rotation;
|
|
2025
|
+
o = t.rotation;
|
|
1902
2026
|
|
|
1903
2027
|
this._basicExtraRounded({
|
|
1904
2028
|
x: e,
|
|
1905
2029
|
y: r,
|
|
1906
2030
|
size: n,
|
|
1907
|
-
|
|
1908
|
-
rotation: i
|
|
2031
|
+
rotation: o
|
|
1909
2032
|
});
|
|
1910
2033
|
}, t;
|
|
1911
|
-
}()
|
|
1912
|
-
x = "square";
|
|
2034
|
+
}();
|
|
1913
2035
|
|
|
1914
|
-
var
|
|
1915
|
-
return (
|
|
2036
|
+
var _g = function g() {
|
|
2037
|
+
return (_g = Object.assign || function (t) {
|
|
1916
2038
|
for (var e, r = 1, n = arguments.length; r < n; r++) {
|
|
1917
2039
|
for (var o in e = arguments[r]) {
|
|
1918
2040
|
Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
|
|
@@ -1923,19 +2045,18 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1923
2045
|
}).apply(this, arguments);
|
|
1924
2046
|
};
|
|
1925
2047
|
|
|
1926
|
-
var
|
|
2048
|
+
var p = function () {
|
|
1927
2049
|
function t(t) {
|
|
1928
|
-
var e = t.
|
|
2050
|
+
var e = t.svg,
|
|
1929
2051
|
r = t.type;
|
|
1930
|
-
this.
|
|
2052
|
+
this._svg = e, this._type = r;
|
|
1931
2053
|
}
|
|
1932
2054
|
|
|
1933
2055
|
return t.prototype.draw = function (t, e, r, n) {
|
|
1934
|
-
var o
|
|
1935
|
-
i = this._context;
|
|
2056
|
+
var o;
|
|
1936
2057
|
|
|
1937
2058
|
switch (this._type) {
|
|
1938
|
-
case
|
|
2059
|
+
case "square":
|
|
1939
2060
|
o = this._drawSquare;
|
|
1940
2061
|
break;
|
|
1941
2062
|
|
|
@@ -1948,1041 +2069,193 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1948
2069
|
x: t,
|
|
1949
2070
|
y: e,
|
|
1950
2071
|
size: r,
|
|
1951
|
-
context: i,
|
|
1952
2072
|
rotation: n
|
|
1953
2073
|
});
|
|
1954
2074
|
}, t.prototype._rotateFigure = function (t) {
|
|
1955
|
-
var e
|
|
1956
|
-
r = t.
|
|
1957
|
-
n = t.
|
|
1958
|
-
o = t.
|
|
2075
|
+
var e,
|
|
2076
|
+
r = t.x,
|
|
2077
|
+
n = t.y,
|
|
2078
|
+
o = t.size,
|
|
1959
2079
|
i = t.rotation,
|
|
1960
2080
|
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);
|
|
2081
|
+
s = r + o / 2,
|
|
2082
|
+
u = n + o / 2;
|
|
2083
|
+
(0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
|
|
1965
2084
|
}, t.prototype._basicDot = function (t) {
|
|
1966
|
-
var e =
|
|
1967
|
-
r = t.
|
|
2085
|
+
var e = this,
|
|
2086
|
+
r = t.size,
|
|
2087
|
+
n = t.x,
|
|
2088
|
+
o = t.y;
|
|
1968
2089
|
|
|
1969
|
-
this._rotateFigure(
|
|
2090
|
+
this._rotateFigure(_g(_g({}, t), {
|
|
1970
2091
|
draw: function draw() {
|
|
1971
|
-
|
|
2092
|
+
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
2093
|
}
|
|
1973
2094
|
}));
|
|
1974
2095
|
}, t.prototype._basicSquare = function (t) {
|
|
1975
|
-
var e =
|
|
1976
|
-
r = t.
|
|
2096
|
+
var e = this,
|
|
2097
|
+
r = t.size,
|
|
2098
|
+
n = t.x,
|
|
2099
|
+
o = t.y;
|
|
1977
2100
|
|
|
1978
|
-
this._rotateFigure(
|
|
2101
|
+
this._rotateFigure(_g(_g({}, t), {
|
|
1979
2102
|
draw: function draw() {
|
|
1980
|
-
|
|
2103
|
+
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
2104
|
}
|
|
1982
2105
|
}));
|
|
1983
2106
|
}, t.prototype._drawDot = function (t) {
|
|
1984
2107
|
var e = t.x,
|
|
1985
2108
|
r = t.y,
|
|
1986
2109
|
n = t.size,
|
|
1987
|
-
o = t.
|
|
1988
|
-
i = t.rotation;
|
|
2110
|
+
o = t.rotation;
|
|
1989
2111
|
|
|
1990
2112
|
this._basicDot({
|
|
1991
2113
|
x: e,
|
|
1992
2114
|
y: r,
|
|
1993
2115
|
size: n,
|
|
1994
|
-
|
|
1995
|
-
rotation: i
|
|
2116
|
+
rotation: o
|
|
1996
2117
|
});
|
|
1997
2118
|
}, t.prototype._drawSquare = function (t) {
|
|
1998
2119
|
var e = t.x,
|
|
1999
2120
|
r = t.y,
|
|
2000
2121
|
n = t.size,
|
|
2001
|
-
o = t.
|
|
2002
|
-
i = t.rotation;
|
|
2122
|
+
o = t.rotation;
|
|
2003
2123
|
|
|
2004
2124
|
this._basicSquare({
|
|
2005
2125
|
x: e,
|
|
2006
2126
|
y: r,
|
|
2007
2127
|
size: n,
|
|
2008
|
-
|
|
2009
|
-
rotation: i
|
|
2128
|
+
rotation: o
|
|
2010
2129
|
});
|
|
2011
2130
|
}, t;
|
|
2012
2131
|
}(),
|
|
2013
|
-
|
|
2132
|
+
v = "circle";
|
|
2014
2133
|
|
|
2015
|
-
var
|
|
2016
|
-
|
|
2134
|
+
var w = function w(t, e, r, n) {
|
|
2135
|
+
return new (r || (r = Promise))(function (o, i) {
|
|
2136
|
+
function a(t) {
|
|
2137
|
+
try {
|
|
2138
|
+
u(n.next(t));
|
|
2139
|
+
} catch (t) {
|
|
2140
|
+
i(t);
|
|
2141
|
+
}
|
|
2142
|
+
}
|
|
2017
2143
|
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2144
|
+
function s(t) {
|
|
2145
|
+
try {
|
|
2146
|
+
u(n["throw"](t));
|
|
2147
|
+
} catch (t) {
|
|
2148
|
+
i(t);
|
|
2149
|
+
}
|
|
2150
|
+
}
|
|
2022
2151
|
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
configurable: !0
|
|
2029
|
-
}), Object.defineProperty(t.prototype, "width", {
|
|
2030
|
-
get: function get() {
|
|
2031
|
-
return this._canvas.width;
|
|
2032
|
-
},
|
|
2033
|
-
enumerable: !1,
|
|
2034
|
-
configurable: !0
|
|
2035
|
-
}), Object.defineProperty(t.prototype, "height", {
|
|
2036
|
-
get: function get() {
|
|
2037
|
-
return this._canvas.height;
|
|
2038
|
-
},
|
|
2039
|
-
enumerable: !1,
|
|
2040
|
-
configurable: !0
|
|
2041
|
-
}), t.prototype.getCanvas = function () {
|
|
2042
|
-
return this._canvas;
|
|
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;
|
|
2152
|
+
function u(t) {
|
|
2153
|
+
var e;
|
|
2154
|
+
t.done ? o(t.value) : (e = t.value, e instanceof r ? e : new r(function (t) {
|
|
2155
|
+
t(e);
|
|
2156
|
+
})).then(a, s);
|
|
2792
2157
|
}
|
|
2793
2158
|
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
}
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
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;
|
|
2159
|
+
u((n = n.apply(t, e || [])).next());
|
|
2160
|
+
});
|
|
2161
|
+
},
|
|
2162
|
+
y = function y(t, e) {
|
|
2163
|
+
var r,
|
|
2164
|
+
n,
|
|
2165
|
+
o,
|
|
2166
|
+
i,
|
|
2167
|
+
a = {
|
|
2168
|
+
label: 0,
|
|
2169
|
+
sent: function sent() {
|
|
2170
|
+
if (1 & o[0]) throw o[1];
|
|
2171
|
+
return o[1];
|
|
2172
|
+
},
|
|
2173
|
+
trys: [],
|
|
2174
|
+
ops: []
|
|
2175
|
+
};
|
|
2176
|
+
return i = {
|
|
2177
|
+
next: s(0),
|
|
2178
|
+
"throw": s(1),
|
|
2179
|
+
"return": s(2)
|
|
2180
|
+
}, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
|
|
2181
|
+
return this;
|
|
2182
|
+
}), i;
|
|
2875
2183
|
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
rotation: o
|
|
2881
|
-
});
|
|
2882
|
-
}, t;
|
|
2883
|
-
}();
|
|
2184
|
+
function s(i) {
|
|
2185
|
+
return function (s) {
|
|
2186
|
+
return function (i) {
|
|
2187
|
+
if (r) throw new TypeError("Generator is already executing.");
|
|
2884
2188
|
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
for (var o in e = arguments[r]) {
|
|
2889
|
-
Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
|
|
2890
|
-
}
|
|
2891
|
-
}
|
|
2189
|
+
for (; a;) {
|
|
2190
|
+
try {
|
|
2191
|
+
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
2192
|
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2193
|
+
switch (n = 0, o && (i = [2 & i[0], o.value]), i[0]) {
|
|
2194
|
+
case 0:
|
|
2195
|
+
case 1:
|
|
2196
|
+
o = i;
|
|
2197
|
+
break;
|
|
2896
2198
|
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
}
|
|
2199
|
+
case 4:
|
|
2200
|
+
return a.label++, {
|
|
2201
|
+
value: i[1],
|
|
2202
|
+
done: !1
|
|
2203
|
+
};
|
|
2903
2204
|
|
|
2904
|
-
|
|
2905
|
-
|
|
2205
|
+
case 5:
|
|
2206
|
+
a.label++, n = i[1], i = [0];
|
|
2207
|
+
continue;
|
|
2906
2208
|
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
break;
|
|
2209
|
+
case 7:
|
|
2210
|
+
i = a.ops.pop(), a.trys.pop();
|
|
2211
|
+
continue;
|
|
2911
2212
|
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2213
|
+
default:
|
|
2214
|
+
if (!((o = (o = a.trys).length > 0 && o[o.length - 1]) || 6 !== i[0] && 2 !== i[0])) {
|
|
2215
|
+
a = 0;
|
|
2216
|
+
continue;
|
|
2217
|
+
}
|
|
2916
2218
|
|
|
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;
|
|
2219
|
+
if (3 === i[0] && (!o || i[1] > o[0] && i[1] < o[3])) {
|
|
2220
|
+
a.label = i[1];
|
|
2221
|
+
break;
|
|
2222
|
+
}
|
|
2938
2223
|
|
|
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;
|
|
2224
|
+
if (6 === i[0] && a.label < o[1]) {
|
|
2225
|
+
a.label = o[1], o = i;
|
|
2226
|
+
break;
|
|
2227
|
+
}
|
|
2949
2228
|
|
|
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;
|
|
2229
|
+
if (o && a.label < o[2]) {
|
|
2230
|
+
a.label = o[2], a.ops.push(i);
|
|
2231
|
+
break;
|
|
2232
|
+
}
|
|
2960
2233
|
|
|
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;
|
|
2234
|
+
o[2] && a.ops.pop(), a.trys.pop();
|
|
2235
|
+
continue;
|
|
2236
|
+
}
|
|
2972
2237
|
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
}();
|
|
2238
|
+
i = e.call(t, a);
|
|
2239
|
+
} catch (t) {
|
|
2240
|
+
i = [6, t], n = 0;
|
|
2241
|
+
} finally {
|
|
2242
|
+
r = o = 0;
|
|
2243
|
+
}
|
|
2244
|
+
}
|
|
2981
2245
|
|
|
2982
|
-
|
|
2983
|
-
|
|
2246
|
+
if (5 & i[0]) throw i[1];
|
|
2247
|
+
return {
|
|
2248
|
+
value: i[0] ? i[1] : void 0,
|
|
2249
|
+
done: !0
|
|
2250
|
+
};
|
|
2251
|
+
}([i, s]);
|
|
2252
|
+
};
|
|
2253
|
+
}
|
|
2254
|
+
},
|
|
2255
|
+
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]],
|
|
2256
|
+
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
2257
|
|
|
2985
|
-
var
|
|
2258
|
+
var _ = function () {
|
|
2986
2259
|
function t(t) {
|
|
2987
2260
|
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
2261
|
}
|
|
@@ -3001,12 +2274,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3001
2274
|
configurable: !0
|
|
3002
2275
|
}), t.prototype.getElement = function () {
|
|
3003
2276
|
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
2277
|
}, t.prototype.drawQR = function (t) {
|
|
3009
|
-
return
|
|
2278
|
+
return w(this, void 0, void 0, function () {
|
|
3010
2279
|
var e,
|
|
3011
2280
|
r,
|
|
3012
2281
|
n,
|
|
@@ -3014,105 +2283,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3014
2283
|
i,
|
|
3015
2284
|
a,
|
|
3016
2285
|
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) {
|
|
2286
|
+
u,
|
|
2287
|
+
c,
|
|
2288
|
+
l,
|
|
2289
|
+
d = this;
|
|
2290
|
+
return y(this, function (f) {
|
|
3113
2291
|
switch (f.label) {
|
|
3114
2292
|
case 0:
|
|
3115
|
-
return e = t.getModuleCount(), r = Math.min(this._options.width, this._options.height) - 2 * this._options.margin, n = Math.
|
|
2293
|
+
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
2294
|
hideXDots: 0,
|
|
3117
2295
|
hideYDots: 0,
|
|
3118
2296
|
width: 0,
|
|
@@ -3121,72 +2299,85 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3121
2299
|
|
|
3122
2300
|
case 1:
|
|
3123
2301
|
if (f.sent(), !this._image) return [2];
|
|
3124
|
-
|
|
2302
|
+
a = this._options, s = a.imageOptions, u = a.qrOptions, c = s.imageSize * h[u.errorCorrectionLevel], l = Math.floor(c * e * e), i = function (t) {
|
|
2303
|
+
var e = t.originalHeight,
|
|
2304
|
+
r = t.originalWidth,
|
|
2305
|
+
n = t.maxHiddenDots,
|
|
2306
|
+
o = t.maxHiddenAxisDots,
|
|
2307
|
+
i = t.dotSize,
|
|
2308
|
+
a = {
|
|
2309
|
+
x: 0,
|
|
2310
|
+
y: 0
|
|
2311
|
+
},
|
|
2312
|
+
s = {
|
|
2313
|
+
x: 0,
|
|
2314
|
+
y: 0
|
|
2315
|
+
};
|
|
2316
|
+
if (e <= 0 || r <= 0 || n <= 0 || i <= 0) return {
|
|
2317
|
+
height: 0,
|
|
2318
|
+
width: 0,
|
|
2319
|
+
hideYDots: 0,
|
|
2320
|
+
hideXDots: 0
|
|
2321
|
+
};
|
|
2322
|
+
var u = e / r;
|
|
2323
|
+
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)), {
|
|
2324
|
+
height: s.y,
|
|
2325
|
+
width: s.x,
|
|
2326
|
+
hideYDots: a.y,
|
|
2327
|
+
hideXDots: a.x
|
|
2328
|
+
};
|
|
2329
|
+
}({
|
|
3125
2330
|
originalWidth: this._image.width,
|
|
3126
2331
|
originalHeight: this._image.height,
|
|
3127
|
-
maxHiddenDots:
|
|
2332
|
+
maxHiddenDots: l,
|
|
3128
2333
|
maxHiddenAxisDots: e - 14,
|
|
3129
|
-
dotSize:
|
|
2334
|
+
dotSize: o
|
|
3130
2335
|
}), f.label = 2;
|
|
3131
2336
|
|
|
3132
2337
|
case 2:
|
|
3133
|
-
return this.
|
|
3134
|
-
var n,
|
|
3135
|
-
return !(
|
|
3136
|
-
}), this.drawCorners(), this._options.image
|
|
3137
|
-
width:
|
|
3138
|
-
height:
|
|
2338
|
+
return this.drawBackground(), this.drawDots(function (t, r) {
|
|
2339
|
+
var n, o, a, s, u, h;
|
|
2340
|
+
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]));
|
|
2341
|
+
}), this.drawCorners(), this._options.image ? [4, this.drawImage({
|
|
2342
|
+
width: i.width,
|
|
2343
|
+
height: i.height,
|
|
3139
2344
|
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
|
-
}
|
|
2345
|
+
dotSize: o
|
|
2346
|
+
})] : [3, 4];
|
|
3160
2347
|
|
|
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
|
-
}
|
|
2348
|
+
case 3:
|
|
2349
|
+
f.sent(), f.label = 4;
|
|
3167
2350
|
|
|
3168
|
-
|
|
2351
|
+
case 4:
|
|
2352
|
+
return [2];
|
|
2353
|
+
}
|
|
2354
|
+
});
|
|
3169
2355
|
});
|
|
3170
|
-
var e, r, n, o;
|
|
3171
2356
|
}, t.prototype.drawBackground = function () {
|
|
3172
2357
|
var t,
|
|
3173
2358
|
e,
|
|
3174
|
-
r
|
|
3175
|
-
n = this.
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
2359
|
+
r,
|
|
2360
|
+
n = this._element,
|
|
2361
|
+
o = this._options;
|
|
2362
|
+
|
|
2363
|
+
if (n) {
|
|
2364
|
+
var i = null === (t = o.backgroundOptions) || void 0 === t ? void 0 : t.gradient,
|
|
2365
|
+
a = null === (e = o.backgroundOptions) || void 0 === e ? void 0 : e.color;
|
|
2366
|
+
|
|
2367
|
+
if ((i || a) && this._createColor({
|
|
2368
|
+
options: i,
|
|
2369
|
+
color: a,
|
|
3183
2370
|
additionalRotation: 0,
|
|
3184
2371
|
x: 0,
|
|
3185
2372
|
y: 0,
|
|
3186
|
-
height:
|
|
3187
|
-
width:
|
|
2373
|
+
height: o.height,
|
|
2374
|
+
width: o.width,
|
|
3188
2375
|
name: "background-color"
|
|
3189
|
-
})
|
|
2376
|
+
}), null === (r = o.backgroundOptions) || void 0 === r ? void 0 : r.round) {
|
|
2377
|
+
var s = Math.min(o.width, o.height),
|
|
2378
|
+
u = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
2379
|
+
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);
|
|
2380
|
+
}
|
|
3190
2381
|
}
|
|
3191
2382
|
}, t.prototype.drawDots = function (t) {
|
|
3192
2383
|
var e,
|
|
@@ -3199,10 +2390,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3199
2390
|
|
|
3200
2391
|
if (i > o.width || i > o.height) throw "The canvas is too small.";
|
|
3201
2392
|
var a = Math.min(o.width, o.height) - 2 * o.margin,
|
|
3202
|
-
s =
|
|
3203
|
-
u = Math.floor(
|
|
3204
|
-
|
|
3205
|
-
|
|
2393
|
+
s = o.shape === v ? a / Math.sqrt(2) : a,
|
|
2394
|
+
u = Math.floor(s / i),
|
|
2395
|
+
h = Math.floor((o.width - i * u) / 2),
|
|
2396
|
+
c = Math.floor((o.height - i * u) / 2),
|
|
2397
|
+
d = new l({
|
|
3206
2398
|
svg: this._element,
|
|
3207
2399
|
type: o.dotsOptions.type
|
|
3208
2400
|
});
|
|
@@ -3210,23 +2402,57 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3210
2402
|
options: null === (e = o.dotsOptions) || void 0 === e ? void 0 : e.gradient,
|
|
3211
2403
|
color: o.dotsOptions.color,
|
|
3212
2404
|
additionalRotation: 0,
|
|
3213
|
-
x:
|
|
3214
|
-
y:
|
|
3215
|
-
height:
|
|
3216
|
-
width:
|
|
2405
|
+
x: 0,
|
|
2406
|
+
y: 0,
|
|
2407
|
+
height: o.height,
|
|
2408
|
+
width: o.width,
|
|
3217
2409
|
name: "dot-color"
|
|
3218
2410
|
});
|
|
3219
2411
|
|
|
3220
|
-
for (var
|
|
2412
|
+
for (var f = function f(e) {
|
|
3221
2413
|
for (var o = function o(_o) {
|
|
3222
|
-
return t && !t(e, _o) ? "continue" : (null === (r =
|
|
2414
|
+
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
2415
|
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 (
|
|
2416
|
+
}), void (d._element && g._dotsClipPath && g._dotsClipPath.appendChild(d._element))) : "continue";
|
|
3225
2417
|
}, a = 0; a < i; a++) {
|
|
3226
2418
|
o(a);
|
|
3227
2419
|
}
|
|
3228
|
-
},
|
|
3229
|
-
|
|
2420
|
+
}, g = this, p = 0; p < i; p++) {
|
|
2421
|
+
f(p);
|
|
2422
|
+
}
|
|
2423
|
+
|
|
2424
|
+
if (o.shape === v) {
|
|
2425
|
+
var w = Math.floor((a / u - i) / 2),
|
|
2426
|
+
y = i + 2 * w,
|
|
2427
|
+
m = h - w * u,
|
|
2428
|
+
b = c - w * u,
|
|
2429
|
+
_ = [],
|
|
2430
|
+
x = Math.floor(y / 2);
|
|
2431
|
+
|
|
2432
|
+
for (p = 0; p < y; p++) {
|
|
2433
|
+
_[p] = [];
|
|
2434
|
+
|
|
2435
|
+
for (var S = 0; S < y; S++) {
|
|
2436
|
+
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;
|
|
2437
|
+
}
|
|
2438
|
+
}
|
|
2439
|
+
|
|
2440
|
+
var M = function M(t) {
|
|
2441
|
+
for (var e = function e(_e2) {
|
|
2442
|
+
if (!_[t][_e2]) return "continue";
|
|
2443
|
+
d.draw(m + t * u, b + _e2 * u, u, function (r, n) {
|
|
2444
|
+
var o;
|
|
2445
|
+
return !!(null === (o = _[t + r]) || void 0 === o ? void 0 : o[_e2 + n]);
|
|
2446
|
+
}), d._element && C._dotsClipPath && C._dotsClipPath.appendChild(d._element);
|
|
2447
|
+
}, r = 0; r < y; r++) {
|
|
2448
|
+
e(r);
|
|
2449
|
+
}
|
|
2450
|
+
},
|
|
2451
|
+
C = this;
|
|
2452
|
+
|
|
2453
|
+
for (p = 0; p < y; p++) {
|
|
2454
|
+
M(p);
|
|
2455
|
+
}
|
|
3230
2456
|
}
|
|
3231
2457
|
}, t.prototype.drawCorners = function () {
|
|
3232
2458
|
var t = this;
|
|
@@ -3237,100 +2463,101 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3237
2463
|
|
|
3238
2464
|
var n = this._qr.getModuleCount(),
|
|
3239
2465
|
o = Math.min(r.width, r.height) - 2 * r.margin,
|
|
3240
|
-
i =
|
|
3241
|
-
a =
|
|
3242
|
-
s =
|
|
3243
|
-
u =
|
|
3244
|
-
|
|
2466
|
+
i = r.shape === v ? o / Math.sqrt(2) : o,
|
|
2467
|
+
a = Math.floor(i / n),
|
|
2468
|
+
s = 7 * a,
|
|
2469
|
+
u = 3 * a,
|
|
2470
|
+
h = Math.floor((r.width - n * a) / 2),
|
|
2471
|
+
c = Math.floor((r.height - n * a) / 2);
|
|
3245
2472
|
|
|
3246
2473
|
[[0, 0, 0], [1, 0, Math.PI / 2], [0, 1, -Math.PI / 2]].forEach(function (e) {
|
|
3247
2474
|
var o,
|
|
3248
|
-
|
|
2475
|
+
i,
|
|
3249
2476
|
d,
|
|
3250
|
-
l,
|
|
3251
|
-
f,
|
|
3252
|
-
p,
|
|
3253
2477
|
g,
|
|
3254
2478
|
v,
|
|
3255
|
-
y,
|
|
3256
2479
|
w,
|
|
2480
|
+
y,
|
|
3257
2481
|
_,
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
2482
|
+
x,
|
|
2483
|
+
S,
|
|
2484
|
+
M,
|
|
2485
|
+
C,
|
|
2486
|
+
A = e[0],
|
|
2487
|
+
k = e[1],
|
|
2488
|
+
O = e[2],
|
|
2489
|
+
D = h + A * a * (n - 7),
|
|
2490
|
+
P = c + k * a * (n - 7),
|
|
2491
|
+
z = t._dotsClipPath,
|
|
2492
|
+
B = t._dotsClipPath;
|
|
2493
|
+
|
|
2494
|
+
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
2495
|
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
|
|
2496
|
+
color: null === (g = r.cornersSquareOptions) || void 0 === g ? void 0 : g.color,
|
|
2497
|
+
additionalRotation: O,
|
|
2498
|
+
x: D,
|
|
2499
|
+
y: P,
|
|
2500
|
+
height: s,
|
|
2501
|
+
width: s,
|
|
2502
|
+
name: "corners-square-color-" + A + "-" + k
|
|
2503
|
+
})), null === (v = r.cornersSquareOptions) || void 0 === v ? void 0 : v.type) {
|
|
2504
|
+
var q = new f({
|
|
3278
2505
|
svg: t._element,
|
|
3279
2506
|
type: r.cornersSquareOptions.type
|
|
3280
2507
|
});
|
|
3281
|
-
|
|
3282
|
-
} else for (var
|
|
2508
|
+
q.draw(D, P, s, O), q._element && z && z.appendChild(q._element);
|
|
2509
|
+
} else for (var I = new l({
|
|
3283
2510
|
svg: t._element,
|
|
3284
2511
|
type: r.dotsOptions.type
|
|
3285
|
-
}),
|
|
3286
|
-
for (var e = function e(
|
|
3287
|
-
if (!(null === (
|
|
3288
|
-
|
|
2512
|
+
}), E = function E(t) {
|
|
2513
|
+
for (var e = function e(_e3) {
|
|
2514
|
+
if (!(null === (w = m[t]) || void 0 === w ? void 0 : w[_e3])) return "continue";
|
|
2515
|
+
I.draw(D + t * a, P + _e3 * a, a, function (r, n) {
|
|
3289
2516
|
var o;
|
|
3290
|
-
return !!(null === (o =
|
|
3291
|
-
}),
|
|
3292
|
-
}, r = 0; r <
|
|
2517
|
+
return !!(null === (o = m[t + r]) || void 0 === o ? void 0 : o[_e3 + n]);
|
|
2518
|
+
}), I._element && z && z.appendChild(I._element);
|
|
2519
|
+
}, r = 0; r < m[t].length; r++) {
|
|
3293
2520
|
e(r);
|
|
3294
2521
|
}
|
|
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
|
|
2522
|
+
}, L = 0; L < m.length; L++) {
|
|
2523
|
+
E(L);
|
|
2524
|
+
}
|
|
2525
|
+
|
|
2526
|
+
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({
|
|
2527
|
+
options: null === (x = r.cornersDotOptions) || void 0 === x ? void 0 : x.gradient,
|
|
2528
|
+
color: null === (S = r.cornersDotOptions) || void 0 === S ? void 0 : S.color,
|
|
2529
|
+
additionalRotation: O,
|
|
2530
|
+
x: D + 2 * a,
|
|
2531
|
+
y: P + 2 * a,
|
|
2532
|
+
height: u,
|
|
2533
|
+
width: u,
|
|
2534
|
+
name: "corners-dot-color-" + A + "-" + k
|
|
2535
|
+
})), null === (M = r.cornersDotOptions) || void 0 === M ? void 0 : M.type) {
|
|
2536
|
+
var R = new p({
|
|
3310
2537
|
svg: t._element,
|
|
3311
2538
|
type: r.cornersDotOptions.type
|
|
3312
2539
|
});
|
|
3313
|
-
|
|
2540
|
+
R.draw(D + 2 * a, P + 2 * a, u, O), R._element && B && B.appendChild(R._element);
|
|
3314
2541
|
} else {
|
|
3315
|
-
|
|
2542
|
+
I = new l({
|
|
3316
2543
|
svg: t._element,
|
|
3317
2544
|
type: r.dotsOptions.type
|
|
3318
2545
|
});
|
|
3319
2546
|
|
|
3320
2547
|
var N = function N(t) {
|
|
3321
|
-
for (var e = function e(
|
|
3322
|
-
if (!(null === (
|
|
3323
|
-
|
|
2548
|
+
for (var e = function e(_e4) {
|
|
2549
|
+
if (!(null === (C = b[t]) || void 0 === C ? void 0 : C[_e4])) return "continue";
|
|
2550
|
+
I.draw(D + t * a, P + _e4 * a, a, function (r, n) {
|
|
3324
2551
|
var o;
|
|
3325
|
-
return !!(null === (o =
|
|
3326
|
-
}),
|
|
3327
|
-
}, r = 0; r <
|
|
2552
|
+
return !!(null === (o = b[t + r]) || void 0 === o ? void 0 : o[_e4 + n]);
|
|
2553
|
+
}), I._element && B && B.appendChild(I._element);
|
|
2554
|
+
}, r = 0; r < b[t].length; r++) {
|
|
3328
2555
|
e(r);
|
|
3329
2556
|
}
|
|
3330
2557
|
};
|
|
3331
2558
|
|
|
3332
|
-
for (
|
|
3333
|
-
N(
|
|
2559
|
+
for (L = 0; L < b.length; L++) {
|
|
2560
|
+
N(L);
|
|
3334
2561
|
}
|
|
3335
2562
|
}
|
|
3336
2563
|
});
|
|
@@ -3348,16 +2575,19 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3348
2575
|
var e = t.width,
|
|
3349
2576
|
r = t.height,
|
|
3350
2577
|
n = t.count,
|
|
3351
|
-
o = t.dotSize
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
2578
|
+
o = t.dotSize;
|
|
2579
|
+
return w(this, void 0, void 0, function () {
|
|
2580
|
+
var t, i, a, s, h, c, l, d, f;
|
|
2581
|
+
return y(this, function (g) {
|
|
2582
|
+
switch (g.label) {
|
|
2583
|
+
case 0:
|
|
2584
|
+
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 || "")];
|
|
2585
|
+
|
|
2586
|
+
case 1:
|
|
2587
|
+
return f = g.sent(), d.setAttribute("href", f || ""), this._element.appendChild(d), [2];
|
|
2588
|
+
}
|
|
2589
|
+
});
|
|
2590
|
+
});
|
|
3361
2591
|
}, t.prototype._createColor = function (t) {
|
|
3362
2592
|
var e = t.options,
|
|
3363
2593
|
r = t.color,
|
|
@@ -3367,45 +2597,46 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3367
2597
|
a = t.height,
|
|
3368
2598
|
s = t.width,
|
|
3369
2599
|
u = t.name,
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
if (
|
|
3374
|
-
var
|
|
3375
|
-
if (e.type
|
|
3376
|
-
var
|
|
3377
|
-
f = (
|
|
3378
|
-
|
|
3379
|
-
|
|
2600
|
+
h = s > a ? s : a,
|
|
2601
|
+
c = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
2602
|
+
|
|
2603
|
+
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) {
|
|
2604
|
+
var l;
|
|
2605
|
+
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 {
|
|
2606
|
+
var d = ((e.rotation || 0) + n) % (2 * Math.PI),
|
|
2607
|
+
f = (d + 2 * Math.PI) % (2 * Math.PI),
|
|
2608
|
+
g = o + s / 2,
|
|
2609
|
+
p = i + a / 2,
|
|
3380
2610
|
v = o + s / 2,
|
|
3381
|
-
|
|
3382
|
-
f >= 0 && f <= .25 * Math.PI || f > 1.75 * Math.PI && f <= 2 * Math.PI ? (
|
|
2611
|
+
w = i + a / 2;
|
|
2612
|
+
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
2613
|
}
|
|
3384
2614
|
e.colorStops.forEach(function (t) {
|
|
3385
2615
|
var e = t.offset,
|
|
3386
2616
|
r = t.color,
|
|
3387
2617
|
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 &&
|
|
2618
|
+
n.setAttribute("offset", 100 * e + "%"), n.setAttribute("stop-color", r), l.appendChild(n);
|
|
2619
|
+
}), c.setAttribute("fill", "url('#" + u + "')"), this._defs.appendChild(l);
|
|
2620
|
+
} else r && c.setAttribute("fill", r);
|
|
3391
2621
|
|
|
3392
|
-
this._element.appendChild(
|
|
2622
|
+
this._element.appendChild(c);
|
|
3393
2623
|
}, t;
|
|
3394
2624
|
}(),
|
|
3395
|
-
|
|
2625
|
+
x = "canvas";
|
|
3396
2626
|
|
|
3397
|
-
for (var
|
|
3398
|
-
|
|
2627
|
+
for (var S = {}, M = 0; M <= 40; M++) {
|
|
2628
|
+
S[M] = M;
|
|
3399
2629
|
}
|
|
3400
2630
|
|
|
3401
|
-
var
|
|
3402
|
-
type:
|
|
2631
|
+
var C = {
|
|
2632
|
+
type: x,
|
|
2633
|
+
shape: "square",
|
|
3403
2634
|
width: 300,
|
|
3404
2635
|
height: 300,
|
|
3405
2636
|
data: "",
|
|
3406
2637
|
margin: 0,
|
|
3407
2638
|
qrOptions: {
|
|
3408
|
-
typeNumber:
|
|
2639
|
+
typeNumber: S[0],
|
|
3409
2640
|
mode: void 0,
|
|
3410
2641
|
errorCorrectionLevel: "Q"
|
|
3411
2642
|
},
|
|
@@ -3420,12 +2651,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3420
2651
|
color: "#000"
|
|
3421
2652
|
},
|
|
3422
2653
|
backgroundOptions: {
|
|
2654
|
+
round: 0,
|
|
3423
2655
|
color: "#fff"
|
|
3424
2656
|
}
|
|
3425
2657
|
};
|
|
3426
2658
|
|
|
3427
|
-
var
|
|
3428
|
-
return (
|
|
2659
|
+
var _A = function A() {
|
|
2660
|
+
return (_A = Object.assign || function (t) {
|
|
3429
2661
|
for (var e, r = 1, n = arguments.length; r < n; r++) {
|
|
3430
2662
|
for (var o in e = arguments[r]) {
|
|
3431
2663
|
Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
|
|
@@ -3436,30 +2668,30 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3436
2668
|
}).apply(this, arguments);
|
|
3437
2669
|
};
|
|
3438
2670
|
|
|
3439
|
-
function
|
|
3440
|
-
var e =
|
|
2671
|
+
function k(t) {
|
|
2672
|
+
var e = _A({}, t);
|
|
3441
2673
|
|
|
3442
2674
|
if (!e.colorStops || !e.colorStops.length) throw "Field 'colorStops' is required in gradient";
|
|
3443
2675
|
return e.rotation ? e.rotation = Number(e.rotation) : e.rotation = 0, e.colorStops = e.colorStops.map(function (t) {
|
|
3444
|
-
return
|
|
2676
|
+
return _A(_A({}, t), {
|
|
3445
2677
|
offset: Number(t.offset)
|
|
3446
2678
|
});
|
|
3447
2679
|
}), e;
|
|
3448
2680
|
}
|
|
3449
2681
|
|
|
3450
|
-
function
|
|
3451
|
-
var e =
|
|
2682
|
+
function O(t) {
|
|
2683
|
+
var e = _A({}, t);
|
|
3452
2684
|
|
|
3453
|
-
return e.width = Number(e.width), e.height = Number(e.height), e.margin = Number(e.margin), e.imageOptions =
|
|
2685
|
+
return e.width = Number(e.width), e.height = Number(e.height), e.margin = Number(e.margin), e.imageOptions = _A(_A({}, e.imageOptions), {
|
|
3454
2686
|
hideBackgroundDots: Boolean(e.imageOptions.hideBackgroundDots),
|
|
3455
2687
|
imageSize: Number(e.imageOptions.imageSize),
|
|
3456
2688
|
margin: Number(e.imageOptions.margin)
|
|
3457
|
-
}), e.margin > Math.min(e.width, e.height) && (e.margin = Math.min(e.width, e.height)), e.dotsOptions =
|
|
2689
|
+
}), 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
2690
|
}
|
|
3459
2691
|
|
|
3460
|
-
var
|
|
3461
|
-
|
|
3462
|
-
|
|
2692
|
+
var D = r(192),
|
|
2693
|
+
P = r.n(D),
|
|
2694
|
+
z = function z(t, e, r, n) {
|
|
3463
2695
|
return new (r || (r = Promise))(function (o, i) {
|
|
3464
2696
|
function a(t) {
|
|
3465
2697
|
try {
|
|
@@ -3487,7 +2719,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3487
2719
|
u((n = n.apply(t, e || [])).next());
|
|
3488
2720
|
});
|
|
3489
2721
|
},
|
|
3490
|
-
|
|
2722
|
+
B = function B(t, e) {
|
|
3491
2723
|
var r,
|
|
3492
2724
|
n,
|
|
3493
2725
|
o,
|
|
@@ -3581,35 +2813,61 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3581
2813
|
}
|
|
3582
2814
|
};
|
|
3583
2815
|
|
|
3584
|
-
var
|
|
2816
|
+
var q = function () {
|
|
3585
2817
|
function t(t) {
|
|
3586
|
-
this._options = t ?
|
|
2818
|
+
this._options = t ? O(a(C, t)) : C, this.update();
|
|
3587
2819
|
}
|
|
3588
2820
|
|
|
3589
2821
|
return t._clearContainer = function (t) {
|
|
3590
2822
|
t && (t.innerHTML = "");
|
|
3591
|
-
}, t.prototype.
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
2823
|
+
}, t.prototype._setupSvg = function () {
|
|
2824
|
+
var t = this;
|
|
2825
|
+
|
|
2826
|
+
if (this._qr) {
|
|
2827
|
+
var e = new _(this._options);
|
|
2828
|
+
this._svg = e.getElement(), this._svgDrawingPromise = e.drawQR(this._qr).then(function () {
|
|
2829
|
+
var r;
|
|
2830
|
+
t._svg && (null === (r = t._extension) || void 0 === r || r.call(t, e.getElement(), t._options));
|
|
2831
|
+
});
|
|
2832
|
+
}
|
|
2833
|
+
}, t.prototype._setupCanvas = function () {
|
|
2834
|
+
var t,
|
|
2835
|
+
e = this;
|
|
2836
|
+
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 () {
|
|
2837
|
+
if (e._svg) {
|
|
2838
|
+
var t = e._svg,
|
|
2839
|
+
r = new XMLSerializer().serializeToString(t),
|
|
2840
|
+
n = "data:image/svg+xml;base64," + btoa(r),
|
|
2841
|
+
o = new Image();
|
|
2842
|
+
return new Promise(function (t) {
|
|
2843
|
+
o.onload = function () {
|
|
2844
|
+
var r, n;
|
|
2845
|
+
null === (n = null === (r = e._canvas) || void 0 === r ? void 0 : r.getContext("2d")) || void 0 === n || n.drawImage(o, 0, 0), t();
|
|
2846
|
+
}, o.src = n;
|
|
2847
|
+
});
|
|
2848
|
+
}
|
|
2849
|
+
}));
|
|
2850
|
+
}, t.prototype._getElement = function (t) {
|
|
2851
|
+
return void 0 === t && (t = "png"), z(this, void 0, void 0, function () {
|
|
2852
|
+
return B(this, function (e) {
|
|
2853
|
+
switch (e.label) {
|
|
3596
2854
|
case 0:
|
|
3597
2855
|
if (!this._qr) throw "QR code is empty";
|
|
3598
|
-
return "svg" !== t.toLowerCase() ? [3, 2] : (
|
|
2856
|
+
return "svg" !== t.toLowerCase() ? [3, 2] : (this._svg && this._svgDrawingPromise || this._setupSvg(), [4, this._svgDrawingPromise]);
|
|
3599
2857
|
|
|
3600
2858
|
case 1:
|
|
3601
|
-
return
|
|
2859
|
+
return e.sent(), [2, this._svg];
|
|
3602
2860
|
|
|
3603
2861
|
case 2:
|
|
3604
|
-
return
|
|
2862
|
+
return this._canvas && this._canvasDrawingPromise || this._setupCanvas(), [4, this._canvasDrawingPromise];
|
|
3605
2863
|
|
|
3606
2864
|
case 3:
|
|
3607
|
-
return
|
|
2865
|
+
return e.sent(), [2, this._canvas];
|
|
3608
2866
|
}
|
|
3609
2867
|
});
|
|
3610
2868
|
});
|
|
3611
2869
|
}, t.prototype.update = function (e) {
|
|
3612
|
-
t._clearContainer(this._container), this._options = e ?
|
|
2870
|
+
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
2871
|
switch (!0) {
|
|
3614
2872
|
case /^[0-9]*$/.test(t):
|
|
3615
2873
|
return "Numeric";
|
|
@@ -3620,41 +2878,46 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3620
2878
|
default:
|
|
3621
2879
|
return "Byte";
|
|
3622
2880
|
}
|
|
3623
|
-
}(this._options.data)), this._qr.make(), this._options.type ===
|
|
2881
|
+
}(this._options.data)), this._qr.make(), this._options.type === x ? this._setupCanvas() : this._setupSvg(), this.append(this._container));
|
|
3624
2882
|
}, t.prototype.append = function (t) {
|
|
3625
2883
|
if (t) {
|
|
3626
2884
|
if ("function" != typeof t.appendChild) throw "Container should be a single DOM node";
|
|
3627
|
-
this._options.type ===
|
|
2885
|
+
this._options.type === x ? this._canvas && t.appendChild(this._canvas) : this._svg && t.appendChild(this._svg), this._container = t;
|
|
3628
2886
|
}
|
|
2887
|
+
}, t.prototype.applyExtension = function (t) {
|
|
2888
|
+
if (!t) throw "Extension function should be defined.";
|
|
2889
|
+
this._extension = t, this.update();
|
|
2890
|
+
}, t.prototype.deleteExtension = function () {
|
|
2891
|
+
this._extension = void 0, this.update();
|
|
3629
2892
|
}, t.prototype.getRawData = function (t) {
|
|
3630
|
-
return void 0 === t && (t = "png"),
|
|
2893
|
+
return void 0 === t && (t = "png"), z(this, void 0, void 0, function () {
|
|
3631
2894
|
var e, r, n;
|
|
3632
|
-
return
|
|
2895
|
+
return B(this, function (o) {
|
|
3633
2896
|
switch (o.label) {
|
|
3634
2897
|
case 0:
|
|
3635
2898
|
if (!this._qr) throw "QR code is empty";
|
|
3636
|
-
return [4, this.
|
|
2899
|
+
return [4, this._getElement(t)];
|
|
3637
2900
|
|
|
3638
2901
|
case 1:
|
|
3639
|
-
return e = o.sent()
|
|
2902
|
+
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
2903
|
type: "image/svg+xml"
|
|
3641
2904
|
})]) : [2, new Promise(function (r) {
|
|
3642
|
-
return e.
|
|
3643
|
-
})];
|
|
2905
|
+
return e.toBlob(r, "image/" + t, 1);
|
|
2906
|
+
})] : [2, null];
|
|
3644
2907
|
}
|
|
3645
2908
|
});
|
|
3646
2909
|
});
|
|
3647
2910
|
}, t.prototype.download = function (t) {
|
|
3648
|
-
return
|
|
2911
|
+
return z(this, void 0, void 0, function () {
|
|
3649
2912
|
var e, r, n, o, i;
|
|
3650
|
-
return
|
|
2913
|
+
return B(this, function (a) {
|
|
3651
2914
|
switch (a.label) {
|
|
3652
2915
|
case 0:
|
|
3653
2916
|
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.
|
|
2917
|
+
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
2918
|
|
|
3656
2919
|
case 1:
|
|
3657
|
-
return n = a.sent()
|
|
2920
|
+
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
2921
|
}
|
|
3659
2922
|
});
|
|
3660
2923
|
});
|
|
@@ -3690,12 +2953,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3690
2953
|
}
|
|
3691
2954
|
}, r.o = function (t, e) {
|
|
3692
2955
|
return Object.prototype.hasOwnProperty.call(t, e);
|
|
3693
|
-
}, r(
|
|
2956
|
+
}, r(676);
|
|
3694
2957
|
}()["default"];
|
|
3695
2958
|
});
|
|
3696
2959
|
}, {}],
|
|
3697
2960
|
5: [function (require, module, exports) {
|
|
3698
|
-
module.exports = "1.
|
|
2961
|
+
module.exports = "1.120.1";
|
|
3699
2962
|
}, {}]
|
|
3700
2963
|
}, {}, [3])(3);
|
|
3701
2964
|
});
|