icve-sso-vue3 0.0.12 → 0.0.14

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.
@@ -1941,68 +1941,6 @@ $({ target: 'Iterator', proto: true, real: true, forced: FORCED }, {
1941
1941
  });
1942
1942
 
1943
1943
 
1944
- /***/ },
1945
-
1946
- /***/ 1761
1947
- (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
1948
-
1949
- "use strict";
1950
-
1951
- var call = __webpack_require__(9565);
1952
- var uncurryThis = __webpack_require__(9504);
1953
- var fixRegExpWellKnownSymbolLogic = __webpack_require__(9228);
1954
- var anObject = __webpack_require__(8551);
1955
- var isObject = __webpack_require__(34);
1956
- var toLength = __webpack_require__(8014);
1957
- var toString = __webpack_require__(655);
1958
- var requireObjectCoercible = __webpack_require__(7750);
1959
- var getMethod = __webpack_require__(5966);
1960
- var advanceStringIndex = __webpack_require__(7829);
1961
- var getRegExpFlags = __webpack_require__(1034);
1962
- var regExpExec = __webpack_require__(6682);
1963
-
1964
- var stringIndexOf = uncurryThis(''.indexOf);
1965
-
1966
- // @@match logic
1967
- fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) {
1968
- return [
1969
- // `String.prototype.match` method
1970
- // https://tc39.es/ecma262/#sec-string.prototype.match
1971
- function match(regexp) {
1972
- var O = requireObjectCoercible(this);
1973
- var matcher = isObject(regexp) ? getMethod(regexp, MATCH) : undefined;
1974
- return matcher ? call(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString(O));
1975
- },
1976
- // `RegExp.prototype[@@match]` method
1977
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
1978
- function (string) {
1979
- var rx = anObject(this);
1980
- var S = toString(string);
1981
- var res = maybeCallNative(nativeMatch, rx, S);
1982
-
1983
- if (res.done) return res.value;
1984
-
1985
- var flags = toString(getRegExpFlags(rx));
1986
-
1987
- if (stringIndexOf(flags, 'g') === -1) return regExpExec(rx, S);
1988
-
1989
- var fullUnicode = stringIndexOf(flags, 'u') !== -1;
1990
- rx.lastIndex = 0;
1991
- var A = [];
1992
- var n = 0;
1993
- var result;
1994
- while ((result = regExpExec(rx, S)) !== null) {
1995
- var matchStr = toString(result[0]);
1996
- A[n] = matchStr;
1997
- if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
1998
- n++;
1999
- }
2000
- return n === 0 ? null : A;
2001
- }
2002
- ];
2003
- });
2004
-
2005
-
2006
1944
  /***/ },
2007
1945
 
2008
1946
  /***/ 1767
@@ -3275,1153 +3213,6 @@ module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
3275
3213
  }() : undefined);
3276
3214
 
3277
3215
 
3278
- /***/ },
3279
-
3280
- /***/ 3060
3281
- (module, exports, __webpack_require__) {
3282
-
3283
- var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof = (__webpack_require__(8251)["default"]);
3284
- __webpack_require__(6280);
3285
- __webpack_require__(6918);
3286
- __webpack_require__(8706);
3287
- __webpack_require__(8598);
3288
- __webpack_require__(4114);
3289
- __webpack_require__(3609);
3290
- __webpack_require__(3288);
3291
- __webpack_require__(6099);
3292
- __webpack_require__(8459);
3293
- __webpack_require__(7495);
3294
- __webpack_require__(906);
3295
- __webpack_require__(8781);
3296
- __webpack_require__(1761);
3297
- __webpack_require__(5440);
3298
- /**
3299
- * @fileoverview
3300
- * - Using the 'QRCode for Javascript library'
3301
- * - Fixed dataset of 'QRCode for Javascript library' for support full-spec.
3302
- * - this library has no dependencies.
3303
- *
3304
- * @author davidshimjs
3305
- * @see <a href="http://www.d-project.com/" target="_blank">http://www.d-project.com/</a>
3306
- * @see <a href="http://jeromeetienne.github.com/jquery-qrcode/" target="_blank">http://jeromeetienne.github.com/jquery-qrcode/</a>
3307
- */
3308
- var QRCode;
3309
- (function (root, factory) {
3310
- /* CommonJS */
3311
- if (( false ? 0 : _typeof(exports)) == 'object') module.exports = factory();
3312
-
3313
- /* AMD module */else if (true) !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
3314
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
3315
- (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
3316
- __WEBPACK_AMD_DEFINE_FACTORY__),
3317
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
3318
-
3319
- /* Global */else // removed by dead control flow
3320
- {}
3321
- })(this, function () {
3322
- //---------------------------------------------------------------------
3323
- // QRCode for JavaScript
3324
- //
3325
- // Copyright (c) 2009 Kazuhiko Arase
3326
- //
3327
- // URL: http://www.d-project.com/
3328
- //
3329
- // Licensed under the MIT license:
3330
- // http://www.opensource.org/licenses/mit-license.php
3331
- //
3332
- // The word "QR Code" is registered trademark of
3333
- // DENSO WAVE INCORPORATED
3334
- // http://www.denso-wave.com/qrcode/faqpatent-e.html
3335
- //
3336
- //---------------------------------------------------------------------
3337
- function QR8bitByte(data) {
3338
- this.mode = QRMode.MODE_8BIT_BYTE;
3339
- this.data = data;
3340
- this.parsedData = [];
3341
-
3342
- // Added to support UTF-8 Characters
3343
- for (var i = 0, l = this.data.length; i < l; i++) {
3344
- var byteArray = [];
3345
- var code = this.data.charCodeAt(i);
3346
- if (code > 0x10000) {
3347
- byteArray[0] = 0xF0 | (code & 0x1C0000) >>> 18;
3348
- byteArray[1] = 0x80 | (code & 0x3F000) >>> 12;
3349
- byteArray[2] = 0x80 | (code & 0xFC0) >>> 6;
3350
- byteArray[3] = 0x80 | code & 0x3F;
3351
- } else if (code > 0x800) {
3352
- byteArray[0] = 0xE0 | (code & 0xF000) >>> 12;
3353
- byteArray[1] = 0x80 | (code & 0xFC0) >>> 6;
3354
- byteArray[2] = 0x80 | code & 0x3F;
3355
- } else if (code > 0x80) {
3356
- byteArray[0] = 0xC0 | (code & 0x7C0) >>> 6;
3357
- byteArray[1] = 0x80 | code & 0x3F;
3358
- } else {
3359
- byteArray[0] = code;
3360
- }
3361
- this.parsedData.push(byteArray);
3362
- }
3363
- this.parsedData = Array.prototype.concat.apply([], this.parsedData);
3364
- if (this.parsedData.length != this.data.length) {
3365
- this.parsedData.unshift(191);
3366
- this.parsedData.unshift(187);
3367
- this.parsedData.unshift(239);
3368
- }
3369
- }
3370
- QR8bitByte.prototype = {
3371
- getLength: function getLength(buffer) {
3372
- return this.parsedData.length;
3373
- },
3374
- write: function write(buffer) {
3375
- for (var i = 0, l = this.parsedData.length; i < l; i++) {
3376
- buffer.put(this.parsedData[i], 8);
3377
- }
3378
- }
3379
- };
3380
- function QRCodeModel(typeNumber, errorCorrectLevel) {
3381
- this.typeNumber = typeNumber;
3382
- this.errorCorrectLevel = errorCorrectLevel;
3383
- this.modules = null;
3384
- this.moduleCount = 0;
3385
- this.dataCache = null;
3386
- this.dataList = [];
3387
- }
3388
- QRCodeModel.prototype = {
3389
- addData: function addData(data) {
3390
- var newData = new QR8bitByte(data);
3391
- this.dataList.push(newData);
3392
- this.dataCache = null;
3393
- },
3394
- isDark: function isDark(row, col) {
3395
- if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) {
3396
- throw new Error(row + "," + col);
3397
- }
3398
- return this.modules[row][col];
3399
- },
3400
- getModuleCount: function getModuleCount() {
3401
- return this.moduleCount;
3402
- },
3403
- make: function make() {
3404
- this.makeImpl(false, this.getBestMaskPattern());
3405
- },
3406
- makeImpl: function makeImpl(test, maskPattern) {
3407
- this.moduleCount = this.typeNumber * 4 + 17;
3408
- this.modules = new Array(this.moduleCount);
3409
- for (var row = 0; row < this.moduleCount; row++) {
3410
- this.modules[row] = new Array(this.moduleCount);
3411
- for (var col = 0; col < this.moduleCount; col++) {
3412
- this.modules[row][col] = null;
3413
- }
3414
- }
3415
- this.setupPositionProbePattern(0, 0);
3416
- this.setupPositionProbePattern(this.moduleCount - 7, 0);
3417
- this.setupPositionProbePattern(0, this.moduleCount - 7);
3418
- this.setupPositionAdjustPattern();
3419
- this.setupTimingPattern();
3420
- this.setupTypeInfo(test, maskPattern);
3421
- if (this.typeNumber >= 7) {
3422
- this.setupTypeNumber(test);
3423
- }
3424
- if (this.dataCache == null) {
3425
- this.dataCache = QRCodeModel.createData(this.typeNumber, this.errorCorrectLevel, this.dataList);
3426
- }
3427
- this.mapData(this.dataCache, maskPattern);
3428
- },
3429
- setupPositionProbePattern: function setupPositionProbePattern(row, col) {
3430
- for (var r = -1; r <= 7; r++) {
3431
- if (row + r <= -1 || this.moduleCount <= row + r) continue;
3432
- for (var c = -1; c <= 7; c++) {
3433
- if (col + c <= -1 || this.moduleCount <= col + c) continue;
3434
- if (0 <= r && r <= 6 && (c == 0 || c == 6) || 0 <= c && c <= 6 && (r == 0 || r == 6) || 2 <= r && r <= 4 && 2 <= c && c <= 4) {
3435
- this.modules[row + r][col + c] = true;
3436
- } else {
3437
- this.modules[row + r][col + c] = false;
3438
- }
3439
- }
3440
- }
3441
- },
3442
- getBestMaskPattern: function getBestMaskPattern() {
3443
- var minLostPoint = 0;
3444
- var pattern = 0;
3445
- for (var i = 0; i < 8; i++) {
3446
- this.makeImpl(true, i);
3447
- var lostPoint = QRUtil.getLostPoint(this);
3448
- if (i == 0 || minLostPoint > lostPoint) {
3449
- minLostPoint = lostPoint;
3450
- pattern = i;
3451
- }
3452
- }
3453
- return pattern;
3454
- },
3455
- createMovieClip: function createMovieClip(target_mc, instance_name, depth) {
3456
- var qr_mc = target_mc.createEmptyMovieClip(instance_name, depth);
3457
- var cs = 1;
3458
- this.make();
3459
- for (var row = 0; row < this.modules.length; row++) {
3460
- var y = row * cs;
3461
- for (var col = 0; col < this.modules[row].length; col++) {
3462
- var x = col * cs;
3463
- var dark = this.modules[row][col];
3464
- if (dark) {
3465
- qr_mc.beginFill(0, 100);
3466
- qr_mc.moveTo(x, y);
3467
- qr_mc.lineTo(x + cs, y);
3468
- qr_mc.lineTo(x + cs, y + cs);
3469
- qr_mc.lineTo(x, y + cs);
3470
- qr_mc.endFill();
3471
- }
3472
- }
3473
- }
3474
- return qr_mc;
3475
- },
3476
- setupTimingPattern: function setupTimingPattern() {
3477
- for (var r = 8; r < this.moduleCount - 8; r++) {
3478
- if (this.modules[r][6] != null) {
3479
- continue;
3480
- }
3481
- this.modules[r][6] = r % 2 == 0;
3482
- }
3483
- for (var c = 8; c < this.moduleCount - 8; c++) {
3484
- if (this.modules[6][c] != null) {
3485
- continue;
3486
- }
3487
- this.modules[6][c] = c % 2 == 0;
3488
- }
3489
- },
3490
- setupPositionAdjustPattern: function setupPositionAdjustPattern() {
3491
- var pos = QRUtil.getPatternPosition(this.typeNumber);
3492
- for (var i = 0; i < pos.length; i++) {
3493
- for (var j = 0; j < pos.length; j++) {
3494
- var row = pos[i];
3495
- var col = pos[j];
3496
- if (this.modules[row][col] != null) {
3497
- continue;
3498
- }
3499
- for (var r = -2; r <= 2; r++) {
3500
- for (var c = -2; c <= 2; c++) {
3501
- if (r == -2 || r == 2 || c == -2 || c == 2 || r == 0 && c == 0) {
3502
- this.modules[row + r][col + c] = true;
3503
- } else {
3504
- this.modules[row + r][col + c] = false;
3505
- }
3506
- }
3507
- }
3508
- }
3509
- }
3510
- },
3511
- setupTypeNumber: function setupTypeNumber(test) {
3512
- var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
3513
- for (var i = 0; i < 18; i++) {
3514
- var mod = !test && (bits >> i & 1) == 1;
3515
- this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = mod;
3516
- }
3517
- for (var i = 0; i < 18; i++) {
3518
- var mod = !test && (bits >> i & 1) == 1;
3519
- this.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)] = mod;
3520
- }
3521
- },
3522
- setupTypeInfo: function setupTypeInfo(test, maskPattern) {
3523
- var data = this.errorCorrectLevel << 3 | maskPattern;
3524
- var bits = QRUtil.getBCHTypeInfo(data);
3525
- for (var i = 0; i < 15; i++) {
3526
- var mod = !test && (bits >> i & 1) == 1;
3527
- if (i < 6) {
3528
- this.modules[i][8] = mod;
3529
- } else if (i < 8) {
3530
- this.modules[i + 1][8] = mod;
3531
- } else {
3532
- this.modules[this.moduleCount - 15 + i][8] = mod;
3533
- }
3534
- }
3535
- for (var i = 0; i < 15; i++) {
3536
- var mod = !test && (bits >> i & 1) == 1;
3537
- if (i < 8) {
3538
- this.modules[8][this.moduleCount - i - 1] = mod;
3539
- } else if (i < 9) {
3540
- this.modules[8][15 - i - 1 + 1] = mod;
3541
- } else {
3542
- this.modules[8][15 - i - 1] = mod;
3543
- }
3544
- }
3545
- this.modules[this.moduleCount - 8][8] = !test;
3546
- },
3547
- mapData: function mapData(data, maskPattern) {
3548
- var inc = -1;
3549
- var row = this.moduleCount - 1;
3550
- var bitIndex = 7;
3551
- var byteIndex = 0;
3552
- for (var col = this.moduleCount - 1; col > 0; col -= 2) {
3553
- if (col == 6) col--;
3554
- while (true) {
3555
- for (var c = 0; c < 2; c++) {
3556
- if (this.modules[row][col - c] == null) {
3557
- var dark = false;
3558
- if (byteIndex < data.length) {
3559
- dark = (data[byteIndex] >>> bitIndex & 1) == 1;
3560
- }
3561
- var mask = QRUtil.getMask(maskPattern, row, col - c);
3562
- if (mask) {
3563
- dark = !dark;
3564
- }
3565
- this.modules[row][col - c] = dark;
3566
- bitIndex--;
3567
- if (bitIndex == -1) {
3568
- byteIndex++;
3569
- bitIndex = 7;
3570
- }
3571
- }
3572
- }
3573
- row += inc;
3574
- if (row < 0 || this.moduleCount <= row) {
3575
- row -= inc;
3576
- inc = -inc;
3577
- break;
3578
- }
3579
- }
3580
- }
3581
- }
3582
- };
3583
- QRCodeModel.PAD0 = 0xEC;
3584
- QRCodeModel.PAD1 = 0x11;
3585
- QRCodeModel.createData = function (typeNumber, errorCorrectLevel, dataList) {
3586
- var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel);
3587
- var buffer = new QRBitBuffer();
3588
- for (var i = 0; i < dataList.length; i++) {
3589
- var data = dataList[i];
3590
- buffer.put(data.mode, 4);
3591
- buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber));
3592
- data.write(buffer);
3593
- }
3594
- var totalDataCount = 0;
3595
- for (var i = 0; i < rsBlocks.length; i++) {
3596
- totalDataCount += rsBlocks[i].dataCount;
3597
- }
3598
- if (buffer.getLengthInBits() > totalDataCount * 8) {
3599
- throw new Error("code length overflow. (" + buffer.getLengthInBits() + ">" + totalDataCount * 8 + ")");
3600
- }
3601
- if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {
3602
- buffer.put(0, 4);
3603
- }
3604
- while (buffer.getLengthInBits() % 8 != 0) {
3605
- buffer.putBit(false);
3606
- }
3607
- while (true) {
3608
- if (buffer.getLengthInBits() >= totalDataCount * 8) {
3609
- break;
3610
- }
3611
- buffer.put(QRCodeModel.PAD0, 8);
3612
- if (buffer.getLengthInBits() >= totalDataCount * 8) {
3613
- break;
3614
- }
3615
- buffer.put(QRCodeModel.PAD1, 8);
3616
- }
3617
- return QRCodeModel.createBytes(buffer, rsBlocks);
3618
- };
3619
- QRCodeModel.createBytes = function (buffer, rsBlocks) {
3620
- var offset = 0;
3621
- var maxDcCount = 0;
3622
- var maxEcCount = 0;
3623
- var dcdata = new Array(rsBlocks.length);
3624
- var ecdata = new Array(rsBlocks.length);
3625
- for (var r = 0; r < rsBlocks.length; r++) {
3626
- var dcCount = rsBlocks[r].dataCount;
3627
- var ecCount = rsBlocks[r].totalCount - dcCount;
3628
- maxDcCount = Math.max(maxDcCount, dcCount);
3629
- maxEcCount = Math.max(maxEcCount, ecCount);
3630
- dcdata[r] = new Array(dcCount);
3631
- for (var i = 0; i < dcdata[r].length; i++) {
3632
- dcdata[r][i] = 0xff & buffer.buffer[i + offset];
3633
- }
3634
- offset += dcCount;
3635
- var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);
3636
- var rawPoly = new QRPolynomial(dcdata[r], rsPoly.getLength() - 1);
3637
- var modPoly = rawPoly.mod(rsPoly);
3638
- ecdata[r] = new Array(rsPoly.getLength() - 1);
3639
- for (var i = 0; i < ecdata[r].length; i++) {
3640
- var modIndex = i + modPoly.getLength() - ecdata[r].length;
3641
- ecdata[r][i] = modIndex >= 0 ? modPoly.get(modIndex) : 0;
3642
- }
3643
- }
3644
- var totalCodeCount = 0;
3645
- for (var i = 0; i < rsBlocks.length; i++) {
3646
- totalCodeCount += rsBlocks[i].totalCount;
3647
- }
3648
- var data = new Array(totalCodeCount);
3649
- var index = 0;
3650
- for (var i = 0; i < maxDcCount; i++) {
3651
- for (var r = 0; r < rsBlocks.length; r++) {
3652
- if (i < dcdata[r].length) {
3653
- data[index++] = dcdata[r][i];
3654
- }
3655
- }
3656
- }
3657
- for (var i = 0; i < maxEcCount; i++) {
3658
- for (var r = 0; r < rsBlocks.length; r++) {
3659
- if (i < ecdata[r].length) {
3660
- data[index++] = ecdata[r][i];
3661
- }
3662
- }
3663
- }
3664
- return data;
3665
- };
3666
- var QRMode = {
3667
- MODE_NUMBER: 1 << 0,
3668
- MODE_ALPHA_NUM: 1 << 1,
3669
- MODE_8BIT_BYTE: 1 << 2,
3670
- MODE_KANJI: 1 << 3
3671
- };
3672
- var QRErrorCorrectLevel = {
3673
- L: 1,
3674
- M: 0,
3675
- Q: 3,
3676
- H: 2
3677
- };
3678
- var QRMaskPattern = {
3679
- PATTERN000: 0,
3680
- PATTERN001: 1,
3681
- PATTERN010: 2,
3682
- PATTERN011: 3,
3683
- PATTERN100: 4,
3684
- PATTERN101: 5,
3685
- PATTERN110: 6,
3686
- PATTERN111: 7
3687
- };
3688
- var QRUtil = {
3689
- PATTERN_POSITION_TABLE: [[], [6, 18], [6, 22], [6, 26], [6, 30], [6, 34], [6, 22, 38], [6, 24, 42], [6, 26, 46], [6, 28, 50], [6, 30, 54], [6, 32, 58], [6, 34, 62], [6, 26, 46, 66], [6, 26, 48, 70], [6, 26, 50, 74], [6, 30, 54, 78], [6, 30, 56, 82], [6, 30, 58, 86], [6, 34, 62, 90], [6, 28, 50, 72, 94], [6, 26, 50, 74, 98], [6, 30, 54, 78, 102], [6, 28, 54, 80, 106], [6, 32, 58, 84, 110], [6, 30, 58, 86, 114], [6, 34, 62, 90, 118], [6, 26, 50, 74, 98, 122], [6, 30, 54, 78, 102, 126], [6, 26, 52, 78, 104, 130], [6, 30, 56, 82, 108, 134], [6, 34, 60, 86, 112, 138], [6, 30, 58, 86, 114, 142], [6, 34, 62, 90, 118, 146], [6, 30, 54, 78, 102, 126, 150], [6, 24, 50, 76, 102, 128, 154], [6, 28, 54, 80, 106, 132, 158], [6, 32, 58, 84, 110, 136, 162], [6, 26, 54, 82, 110, 138, 166], [6, 30, 58, 86, 114, 142, 170]],
3690
- G15: 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0,
3691
- G18: 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0,
3692
- G15_MASK: 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1,
3693
- getBCHTypeInfo: function getBCHTypeInfo(data) {
3694
- var d = data << 10;
3695
- while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
3696
- d ^= QRUtil.G15 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15);
3697
- }
3698
- return (data << 10 | d) ^ QRUtil.G15_MASK;
3699
- },
3700
- getBCHTypeNumber: function getBCHTypeNumber(data) {
3701
- var d = data << 12;
3702
- while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
3703
- d ^= QRUtil.G18 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18);
3704
- }
3705
- return data << 12 | d;
3706
- },
3707
- getBCHDigit: function getBCHDigit(data) {
3708
- var digit = 0;
3709
- while (data != 0) {
3710
- digit++;
3711
- data >>>= 1;
3712
- }
3713
- return digit;
3714
- },
3715
- getPatternPosition: function getPatternPosition(typeNumber) {
3716
- return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
3717
- },
3718
- getMask: function getMask(maskPattern, i, j) {
3719
- switch (maskPattern) {
3720
- case QRMaskPattern.PATTERN000:
3721
- return (i + j) % 2 == 0;
3722
- case QRMaskPattern.PATTERN001:
3723
- return i % 2 == 0;
3724
- case QRMaskPattern.PATTERN010:
3725
- return j % 3 == 0;
3726
- case QRMaskPattern.PATTERN011:
3727
- return (i + j) % 3 == 0;
3728
- case QRMaskPattern.PATTERN100:
3729
- return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;
3730
- case QRMaskPattern.PATTERN101:
3731
- return i * j % 2 + i * j % 3 == 0;
3732
- case QRMaskPattern.PATTERN110:
3733
- return (i * j % 2 + i * j % 3) % 2 == 0;
3734
- case QRMaskPattern.PATTERN111:
3735
- return (i * j % 3 + (i + j) % 2) % 2 == 0;
3736
- default:
3737
- throw new Error("bad maskPattern:" + maskPattern);
3738
- }
3739
- },
3740
- getErrorCorrectPolynomial: function getErrorCorrectPolynomial(errorCorrectLength) {
3741
- var a = new QRPolynomial([1], 0);
3742
- for (var i = 0; i < errorCorrectLength; i++) {
3743
- a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0));
3744
- }
3745
- return a;
3746
- },
3747
- getLengthInBits: function getLengthInBits(mode, type) {
3748
- if (1 <= type && type < 10) {
3749
- switch (mode) {
3750
- case QRMode.MODE_NUMBER:
3751
- return 10;
3752
- case QRMode.MODE_ALPHA_NUM:
3753
- return 9;
3754
- case QRMode.MODE_8BIT_BYTE:
3755
- return 8;
3756
- case QRMode.MODE_KANJI:
3757
- return 8;
3758
- default:
3759
- throw new Error("mode:" + mode);
3760
- }
3761
- } else if (type < 27) {
3762
- switch (mode) {
3763
- case QRMode.MODE_NUMBER:
3764
- return 12;
3765
- case QRMode.MODE_ALPHA_NUM:
3766
- return 11;
3767
- case QRMode.MODE_8BIT_BYTE:
3768
- return 16;
3769
- case QRMode.MODE_KANJI:
3770
- return 10;
3771
- default:
3772
- throw new Error("mode:" + mode);
3773
- }
3774
- } else if (type < 41) {
3775
- switch (mode) {
3776
- case QRMode.MODE_NUMBER:
3777
- return 14;
3778
- case QRMode.MODE_ALPHA_NUM:
3779
- return 13;
3780
- case QRMode.MODE_8BIT_BYTE:
3781
- return 16;
3782
- case QRMode.MODE_KANJI:
3783
- return 12;
3784
- default:
3785
- throw new Error("mode:" + mode);
3786
- }
3787
- } else {
3788
- throw new Error("type:" + type);
3789
- }
3790
- },
3791
- getLostPoint: function getLostPoint(qrCode) {
3792
- var moduleCount = qrCode.getModuleCount();
3793
- var lostPoint = 0;
3794
- for (var row = 0; row < moduleCount; row++) {
3795
- for (var col = 0; col < moduleCount; col++) {
3796
- var sameCount = 0;
3797
- var dark = qrCode.isDark(row, col);
3798
- for (var r = -1; r <= 1; r++) {
3799
- if (row + r < 0 || moduleCount <= row + r) {
3800
- continue;
3801
- }
3802
- for (var c = -1; c <= 1; c++) {
3803
- if (col + c < 0 || moduleCount <= col + c) {
3804
- continue;
3805
- }
3806
- if (r == 0 && c == 0) {
3807
- continue;
3808
- }
3809
- if (dark == qrCode.isDark(row + r, col + c)) {
3810
- sameCount++;
3811
- }
3812
- }
3813
- }
3814
- if (sameCount > 5) {
3815
- lostPoint += 3 + sameCount - 5;
3816
- }
3817
- }
3818
- }
3819
- for (var row = 0; row < moduleCount - 1; row++) {
3820
- for (var col = 0; col < moduleCount - 1; col++) {
3821
- var count = 0;
3822
- if (qrCode.isDark(row, col)) count++;
3823
- if (qrCode.isDark(row + 1, col)) count++;
3824
- if (qrCode.isDark(row, col + 1)) count++;
3825
- if (qrCode.isDark(row + 1, col + 1)) count++;
3826
- if (count == 0 || count == 4) {
3827
- lostPoint += 3;
3828
- }
3829
- }
3830
- }
3831
- for (var row = 0; row < moduleCount; row++) {
3832
- for (var col = 0; col < moduleCount - 6; col++) {
3833
- if (qrCode.isDark(row, col) && !qrCode.isDark(row, col + 1) && qrCode.isDark(row, col + 2) && qrCode.isDark(row, col + 3) && qrCode.isDark(row, col + 4) && !qrCode.isDark(row, col + 5) && qrCode.isDark(row, col + 6)) {
3834
- lostPoint += 40;
3835
- }
3836
- }
3837
- }
3838
- for (var col = 0; col < moduleCount; col++) {
3839
- for (var row = 0; row < moduleCount - 6; row++) {
3840
- if (qrCode.isDark(row, col) && !qrCode.isDark(row + 1, col) && qrCode.isDark(row + 2, col) && qrCode.isDark(row + 3, col) && qrCode.isDark(row + 4, col) && !qrCode.isDark(row + 5, col) && qrCode.isDark(row + 6, col)) {
3841
- lostPoint += 40;
3842
- }
3843
- }
3844
- }
3845
- var darkCount = 0;
3846
- for (var col = 0; col < moduleCount; col++) {
3847
- for (var row = 0; row < moduleCount; row++) {
3848
- if (qrCode.isDark(row, col)) {
3849
- darkCount++;
3850
- }
3851
- }
3852
- }
3853
- var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
3854
- lostPoint += ratio * 10;
3855
- return lostPoint;
3856
- }
3857
- };
3858
- var QRMath = {
3859
- glog: function glog(n) {
3860
- if (n < 1) {
3861
- throw new Error("glog(" + n + ")");
3862
- }
3863
- return QRMath.LOG_TABLE[n];
3864
- },
3865
- gexp: function gexp(n) {
3866
- while (n < 0) {
3867
- n += 255;
3868
- }
3869
- while (n >= 256) {
3870
- n -= 255;
3871
- }
3872
- return QRMath.EXP_TABLE[n];
3873
- },
3874
- EXP_TABLE: new Array(256),
3875
- LOG_TABLE: new Array(256)
3876
- };
3877
- for (var i = 0; i < 8; i++) {
3878
- QRMath.EXP_TABLE[i] = 1 << i;
3879
- }
3880
- for (var i = 8; i < 256; i++) {
3881
- QRMath.EXP_TABLE[i] = QRMath.EXP_TABLE[i - 4] ^ QRMath.EXP_TABLE[i - 5] ^ QRMath.EXP_TABLE[i - 6] ^ QRMath.EXP_TABLE[i - 8];
3882
- }
3883
- for (var i = 0; i < 255; i++) {
3884
- QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]] = i;
3885
- }
3886
- function QRPolynomial(num, shift) {
3887
- if (num.length == undefined) {
3888
- throw new Error(num.length + "/" + shift);
3889
- }
3890
- var offset = 0;
3891
- while (offset < num.length && num[offset] == 0) {
3892
- offset++;
3893
- }
3894
- this.num = new Array(num.length - offset + shift);
3895
- for (var i = 0; i < num.length - offset; i++) {
3896
- this.num[i] = num[i + offset];
3897
- }
3898
- }
3899
- QRPolynomial.prototype = {
3900
- get: function get(index) {
3901
- return this.num[index];
3902
- },
3903
- getLength: function getLength() {
3904
- return this.num.length;
3905
- },
3906
- multiply: function multiply(e) {
3907
- var num = new Array(this.getLength() + e.getLength() - 1);
3908
- for (var i = 0; i < this.getLength(); i++) {
3909
- for (var j = 0; j < e.getLength(); j++) {
3910
- num[i + j] ^= QRMath.gexp(QRMath.glog(this.get(i)) + QRMath.glog(e.get(j)));
3911
- }
3912
- }
3913
- return new QRPolynomial(num, 0);
3914
- },
3915
- mod: function mod(e) {
3916
- if (this.getLength() - e.getLength() < 0) {
3917
- return this;
3918
- }
3919
- var ratio = QRMath.glog(this.get(0)) - QRMath.glog(e.get(0));
3920
- var num = new Array(this.getLength());
3921
- for (var i = 0; i < this.getLength(); i++) {
3922
- num[i] = this.get(i);
3923
- }
3924
- for (var i = 0; i < e.getLength(); i++) {
3925
- num[i] ^= QRMath.gexp(QRMath.glog(e.get(i)) + ratio);
3926
- }
3927
- return new QRPolynomial(num, 0).mod(e);
3928
- }
3929
- };
3930
- function QRRSBlock(totalCount, dataCount) {
3931
- this.totalCount = totalCount;
3932
- this.dataCount = dataCount;
3933
- }
3934
- QRRSBlock.RS_BLOCK_TABLE = [[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], [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]];
3935
- QRRSBlock.getRSBlocks = function (typeNumber, errorCorrectLevel) {
3936
- var rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel);
3937
- if (rsBlock == undefined) {
3938
- throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel);
3939
- }
3940
- var length = rsBlock.length / 3;
3941
- var list = [];
3942
- for (var i = 0; i < length; i++) {
3943
- var count = rsBlock[i * 3 + 0];
3944
- var totalCount = rsBlock[i * 3 + 1];
3945
- var dataCount = rsBlock[i * 3 + 2];
3946
- for (var j = 0; j < count; j++) {
3947
- list.push(new QRRSBlock(totalCount, dataCount));
3948
- }
3949
- }
3950
- return list;
3951
- };
3952
- QRRSBlock.getRsBlockTable = function (typeNumber, errorCorrectLevel) {
3953
- switch (errorCorrectLevel) {
3954
- case QRErrorCorrectLevel.L:
3955
- return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0];
3956
- case QRErrorCorrectLevel.M:
3957
- return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];
3958
- case QRErrorCorrectLevel.Q:
3959
- return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];
3960
- case QRErrorCorrectLevel.H:
3961
- return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];
3962
- default:
3963
- return undefined;
3964
- }
3965
- };
3966
- function QRBitBuffer() {
3967
- this.buffer = [];
3968
- this.length = 0;
3969
- }
3970
- QRBitBuffer.prototype = {
3971
- get: function get(index) {
3972
- var bufIndex = Math.floor(index / 8);
3973
- return (this.buffer[bufIndex] >>> 7 - index % 8 & 1) == 1;
3974
- },
3975
- put: function put(num, length) {
3976
- for (var i = 0; i < length; i++) {
3977
- this.putBit((num >>> length - i - 1 & 1) == 1);
3978
- }
3979
- },
3980
- getLengthInBits: function getLengthInBits() {
3981
- return this.length;
3982
- },
3983
- putBit: function putBit(bit) {
3984
- var bufIndex = Math.floor(this.length / 8);
3985
- if (this.buffer.length <= bufIndex) {
3986
- this.buffer.push(0);
3987
- }
3988
- if (bit) {
3989
- this.buffer[bufIndex] |= 0x80 >>> this.length % 8;
3990
- }
3991
- this.length++;
3992
- }
3993
- };
3994
- var QRCodeLimitLength = [[17, 14, 11, 7], [32, 26, 20, 14], [53, 42, 32, 24], [78, 62, 46, 34], [106, 84, 60, 44], [134, 106, 74, 58], [154, 122, 86, 64], [192, 152, 108, 84], [230, 180, 130, 98], [271, 213, 151, 119], [321, 251, 177, 137], [367, 287, 203, 155], [425, 331, 241, 177], [458, 362, 258, 194], [520, 412, 292, 220], [586, 450, 322, 250], [644, 504, 364, 280], [718, 560, 394, 310], [792, 624, 442, 338], [858, 666, 482, 382], [929, 711, 509, 403], [1003, 779, 565, 439], [1091, 857, 611, 461], [1171, 911, 661, 511], [1273, 997, 715, 535], [1367, 1059, 751, 593], [1465, 1125, 805, 625], [1528, 1190, 868, 658], [1628, 1264, 908, 698], [1732, 1370, 982, 742], [1840, 1452, 1030, 790], [1952, 1538, 1112, 842], [2068, 1628, 1168, 898], [2188, 1722, 1228, 958], [2303, 1809, 1283, 983], [2431, 1911, 1351, 1051], [2563, 1989, 1423, 1093], [2699, 2099, 1499, 1139], [2809, 2213, 1579, 1219], [2953, 2331, 1663, 1273]];
3995
- function _isSupportCanvas() {
3996
- return typeof CanvasRenderingContext2D != "undefined";
3997
- }
3998
-
3999
- // android 2.x doesn't support Data-URI spec
4000
- function _getAndroid() {
4001
- var android = false;
4002
- var sAgent = navigator.userAgent;
4003
- if (/android/i.test(sAgent)) {
4004
- // android
4005
- android = true;
4006
- var aMat = sAgent.toString().match(/android ([0-9]\.[0-9])/i);
4007
- if (aMat && aMat[1]) {
4008
- android = parseFloat(aMat[1]);
4009
- }
4010
- }
4011
- return android;
4012
- }
4013
- var svgDrawer = function () {
4014
- var Drawing = function Drawing(el, htOption) {
4015
- this._el = el;
4016
- this._htOption = htOption;
4017
- };
4018
- Drawing.prototype.draw = function (oQRCode) {
4019
- var _htOption = this._htOption;
4020
- var _el = this._el;
4021
- var nCount = oQRCode.getModuleCount();
4022
- var nWidth = Math.floor(_htOption.width / nCount);
4023
- var nHeight = Math.floor(_htOption.height / nCount);
4024
- this.clear();
4025
- function makeSVG(tag, attrs) {
4026
- var el = document.createElementNS('http://www.w3.org/2000/svg', tag);
4027
- for (var k in attrs) if (attrs.hasOwnProperty(k)) el.setAttribute(k, attrs[k]);
4028
- return el;
4029
- }
4030
- var svg = makeSVG("svg", {
4031
- 'viewBox': '0 0 ' + String(nCount) + " " + String(nCount),
4032
- 'width': '100%',
4033
- 'height': '100%',
4034
- 'fill': _htOption.colorLight
4035
- });
4036
- svg.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xlink", "http://www.w3.org/1999/xlink");
4037
- _el.appendChild(svg);
4038
- svg.appendChild(makeSVG("rect", {
4039
- "fill": _htOption.colorLight,
4040
- "width": "100%",
4041
- "height": "100%"
4042
- }));
4043
- svg.appendChild(makeSVG("rect", {
4044
- "fill": _htOption.colorDark,
4045
- "width": "1",
4046
- "height": "1",
4047
- "id": "template"
4048
- }));
4049
- for (var row = 0; row < nCount; row++) {
4050
- for (var col = 0; col < nCount; col++) {
4051
- if (oQRCode.isDark(row, col)) {
4052
- var child = makeSVG("use", {
4053
- "x": String(col),
4054
- "y": String(row)
4055
- });
4056
- child.setAttributeNS("http://www.w3.org/1999/xlink", "href", "#template");
4057
- svg.appendChild(child);
4058
- }
4059
- }
4060
- }
4061
- };
4062
- Drawing.prototype.clear = function () {
4063
- while (this._el.hasChildNodes()) this._el.removeChild(this._el.lastChild);
4064
- };
4065
- return Drawing;
4066
- }();
4067
- var useSVG = document.documentElement.tagName.toLowerCase() === "svg";
4068
-
4069
- // Drawing in DOM by using Table tag
4070
- var Drawing = useSVG ? svgDrawer : !_isSupportCanvas() ? function () {
4071
- var Drawing = function Drawing(el, htOption) {
4072
- this._el = el;
4073
- this._htOption = htOption;
4074
- };
4075
-
4076
- /**
4077
- * Draw the QRCode
4078
- *
4079
- * @param {QRCode} oQRCode
4080
- */
4081
- Drawing.prototype.draw = function (oQRCode) {
4082
- var _htOption = this._htOption;
4083
- var _el = this._el;
4084
- var nCount = oQRCode.getModuleCount();
4085
- var nWidth = Math.floor(_htOption.width / nCount);
4086
- var nHeight = Math.floor(_htOption.height / nCount);
4087
- var aHTML = ['<table style="border:0;border-collapse:collapse;">'];
4088
- for (var row = 0; row < nCount; row++) {
4089
- aHTML.push('<tr>');
4090
- for (var col = 0; col < nCount; col++) {
4091
- aHTML.push('<td style="border:0;border-collapse:collapse;padding:0;margin:0;width:' + nWidth + 'px;height:' + nHeight + 'px;background-color:' + (oQRCode.isDark(row, col) ? _htOption.colorDark : _htOption.colorLight) + ';"></td>');
4092
- }
4093
- aHTML.push('</tr>');
4094
- }
4095
- aHTML.push('</table>');
4096
- _el.innerHTML = aHTML.join('');
4097
-
4098
- // Fix the margin values as real size.
4099
- var elTable = _el.childNodes[0];
4100
- var nLeftMarginTable = (_htOption.width - elTable.offsetWidth) / 2;
4101
- var nTopMarginTable = (_htOption.height - elTable.offsetHeight) / 2;
4102
- if (nLeftMarginTable > 0 && nTopMarginTable > 0) {
4103
- elTable.style.margin = nTopMarginTable + "px " + nLeftMarginTable + "px";
4104
- }
4105
- };
4106
-
4107
- /**
4108
- * Clear the QRCode
4109
- */
4110
- Drawing.prototype.clear = function () {
4111
- this._el.innerHTML = '';
4112
- };
4113
- return Drawing;
4114
- }() : function () {
4115
- // Drawing in Canvas
4116
- function _onMakeImage() {
4117
- this._elImage.src = this._elCanvas.toDataURL("image/png");
4118
- this._elImage.style.display = "block";
4119
- this._elCanvas.style.display = "none";
4120
- }
4121
-
4122
- // Android 2.1 bug workaround
4123
- // http://code.google.com/p/android/issues/detail?id=5141
4124
- if (this._android && this._android <= 2.1) {
4125
- var factor = 1 / window.devicePixelRatio;
4126
- var drawImage = CanvasRenderingContext2D.prototype.drawImage;
4127
- CanvasRenderingContext2D.prototype.drawImage = function (image, sx, sy, sw, sh, dx, dy, dw, dh) {
4128
- if ("nodeName" in image && /img/i.test(image.nodeName)) {
4129
- for (var i = arguments.length - 1; i >= 1; i--) {
4130
- arguments[i] = arguments[i] * factor;
4131
- }
4132
- } else if (typeof dw == "undefined") {
4133
- arguments[1] *= factor;
4134
- arguments[2] *= factor;
4135
- arguments[3] *= factor;
4136
- arguments[4] *= factor;
4137
- }
4138
- drawImage.apply(this, arguments);
4139
- };
4140
- }
4141
-
4142
- /**
4143
- * Check whether the user's browser supports Data URI or not
4144
- *
4145
- * @private
4146
- * @param {Function} fSuccess Occurs if it supports Data URI
4147
- * @param {Function} fFail Occurs if it doesn't support Data URI
4148
- */
4149
- function _safeSetDataURI(fSuccess, fFail) {
4150
- var self = this;
4151
- self._fFail = fFail;
4152
- self._fSuccess = fSuccess;
4153
-
4154
- // Check it just once
4155
- if (self._bSupportDataURI === null) {
4156
- var el = document.createElement("img");
4157
- var fOnError = function fOnError() {
4158
- self._bSupportDataURI = false;
4159
- if (self._fFail) {
4160
- self._fFail.call(self);
4161
- }
4162
- };
4163
- var fOnSuccess = function fOnSuccess() {
4164
- self._bSupportDataURI = true;
4165
- if (self._fSuccess) {
4166
- self._fSuccess.call(self);
4167
- }
4168
- };
4169
- el.onabort = fOnError;
4170
- el.onerror = fOnError;
4171
- el.onload = fOnSuccess;
4172
- el.src = "data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="; // the Image contains 1px data.
4173
- return;
4174
- } else if (self._bSupportDataURI === true && self._fSuccess) {
4175
- self._fSuccess.call(self);
4176
- } else if (self._bSupportDataURI === false && self._fFail) {
4177
- self._fFail.call(self);
4178
- }
4179
- }
4180
- ;
4181
-
4182
- /**
4183
- * Drawing QRCode by using canvas
4184
- *
4185
- * @constructor
4186
- * @param {HTMLElement} el
4187
- * @param {Object} htOption QRCode Options
4188
- */
4189
- var Drawing = function Drawing(el, htOption) {
4190
- this._bIsPainted = false;
4191
- this._android = _getAndroid();
4192
- this._htOption = htOption;
4193
- this._elCanvas = document.createElement("canvas");
4194
- this._elCanvas.width = htOption.width;
4195
- this._elCanvas.height = htOption.height;
4196
- el.appendChild(this._elCanvas);
4197
- this._el = el;
4198
- this._oContext = this._elCanvas.getContext("2d");
4199
- this._bIsPainted = false;
4200
- this._elImage = document.createElement("img");
4201
- this._elImage.alt = "Scan me!";
4202
- this._elImage.style.display = "none";
4203
- this._el.appendChild(this._elImage);
4204
- this._bSupportDataURI = null;
4205
- };
4206
-
4207
- /**
4208
- * Draw the QRCode
4209
- *
4210
- * @param {QRCode} oQRCode
4211
- */
4212
- Drawing.prototype.draw = function (oQRCode) {
4213
- var _elImage = this._elImage;
4214
- var _oContext = this._oContext;
4215
- var _htOption = this._htOption;
4216
- var nCount = oQRCode.getModuleCount();
4217
- var nWidth = _htOption.width / nCount;
4218
- var nHeight = _htOption.height / nCount;
4219
- var nRoundedWidth = Math.round(nWidth);
4220
- var nRoundedHeight = Math.round(nHeight);
4221
- _elImage.style.display = "none";
4222
- this.clear();
4223
- for (var row = 0; row < nCount; row++) {
4224
- for (var col = 0; col < nCount; col++) {
4225
- var bIsDark = oQRCode.isDark(row, col);
4226
- var nLeft = col * nWidth;
4227
- var nTop = row * nHeight;
4228
- _oContext.strokeStyle = bIsDark ? _htOption.colorDark : _htOption.colorLight;
4229
- _oContext.lineWidth = 1;
4230
- _oContext.fillStyle = bIsDark ? _htOption.colorDark : _htOption.colorLight;
4231
- _oContext.fillRect(nLeft, nTop, nWidth, nHeight);
4232
-
4233
- // 안티 앨리어싱 방지 처리
4234
- _oContext.strokeRect(Math.floor(nLeft) + 0.5, Math.floor(nTop) + 0.5, nRoundedWidth, nRoundedHeight);
4235
- _oContext.strokeRect(Math.ceil(nLeft) - 0.5, Math.ceil(nTop) - 0.5, nRoundedWidth, nRoundedHeight);
4236
- }
4237
- }
4238
- this._bIsPainted = true;
4239
- };
4240
-
4241
- /**
4242
- * Make the image from Canvas if the browser supports Data URI.
4243
- */
4244
- Drawing.prototype.makeImage = function () {
4245
- if (this._bIsPainted) {
4246
- _safeSetDataURI.call(this, _onMakeImage);
4247
- }
4248
- };
4249
-
4250
- /**
4251
- * Return whether the QRCode is painted or not
4252
- *
4253
- * @return {Boolean}
4254
- */
4255
- Drawing.prototype.isPainted = function () {
4256
- return this._bIsPainted;
4257
- };
4258
-
4259
- /**
4260
- * Clear the QRCode
4261
- */
4262
- Drawing.prototype.clear = function () {
4263
- this._oContext.clearRect(0, 0, this._elCanvas.width, this._elCanvas.height);
4264
- this._bIsPainted = false;
4265
- };
4266
-
4267
- /**
4268
- * @private
4269
- * @param {Number} nNumber
4270
- */
4271
- Drawing.prototype.round = function (nNumber) {
4272
- if (!nNumber) {
4273
- return nNumber;
4274
- }
4275
- return Math.floor(nNumber * 1000) / 1000;
4276
- };
4277
- return Drawing;
4278
- }();
4279
-
4280
- /**
4281
- * Get the type by string length
4282
- *
4283
- * @private
4284
- * @param {String} sText
4285
- * @param {Number} nCorrectLevel
4286
- * @return {Number} type
4287
- */
4288
- function _getTypeNumber(sText, nCorrectLevel) {
4289
- var nType = 1;
4290
- var length = _getUTF8Length(sText);
4291
- for (var i = 0, len = QRCodeLimitLength.length; i <= len; i++) {
4292
- var nLimit = 0;
4293
- switch (nCorrectLevel) {
4294
- case QRErrorCorrectLevel.L:
4295
- nLimit = QRCodeLimitLength[i][0];
4296
- break;
4297
- case QRErrorCorrectLevel.M:
4298
- nLimit = QRCodeLimitLength[i][1];
4299
- break;
4300
- case QRErrorCorrectLevel.Q:
4301
- nLimit = QRCodeLimitLength[i][2];
4302
- break;
4303
- case QRErrorCorrectLevel.H:
4304
- nLimit = QRCodeLimitLength[i][3];
4305
- break;
4306
- }
4307
- if (length <= nLimit) {
4308
- break;
4309
- } else {
4310
- nType++;
4311
- }
4312
- }
4313
- if (nType > QRCodeLimitLength.length) {
4314
- throw new Error("Too long data");
4315
- }
4316
- return nType;
4317
- }
4318
- function _getUTF8Length(sText) {
4319
- var replacedText = encodeURI(sText).toString().replace(/\%[0-9a-fA-F]{2}/g, 'a');
4320
- return replacedText.length + (replacedText.length != sText ? 3 : 0);
4321
- }
4322
-
4323
- /**
4324
- * @class QRCode
4325
- * @constructor
4326
- * @example
4327
- * new QRCode(document.getElementById("test"), "http://jindo.dev.naver.com/collie");
4328
- *
4329
- * @example
4330
- * var oQRCode = new QRCode("test", {
4331
- * text : "http://naver.com",
4332
- * width : 128,
4333
- * height : 128
4334
- * });
4335
- *
4336
- * oQRCode.clear(); // Clear the QRCode.
4337
- * oQRCode.makeCode("http://map.naver.com"); // Re-create the QRCode.
4338
- *
4339
- * @param {HTMLElement|String} el target element or 'id' attribute of element.
4340
- * @param {Object|String} vOption
4341
- * @param {String} vOption.text QRCode link data
4342
- * @param {Number} [vOption.width=256]
4343
- * @param {Number} [vOption.height=256]
4344
- * @param {String} [vOption.colorDark="#000000"]
4345
- * @param {String} [vOption.colorLight="#ffffff"]
4346
- * @param {QRCode.CorrectLevel} [vOption.correctLevel=QRCode.CorrectLevel.H] [L|M|Q|H]
4347
- */
4348
- QRCode = function QRCode(el, vOption) {
4349
- this._htOption = {
4350
- width: 256,
4351
- height: 256,
4352
- typeNumber: 4,
4353
- colorDark: "#000000",
4354
- colorLight: "#ffffff",
4355
- correctLevel: QRErrorCorrectLevel.H
4356
- };
4357
- if (typeof vOption === 'string') {
4358
- vOption = {
4359
- text: vOption
4360
- };
4361
- }
4362
-
4363
- // Overwrites options
4364
- if (vOption) {
4365
- for (var i in vOption) {
4366
- this._htOption[i] = vOption[i];
4367
- }
4368
- }
4369
- if (typeof el == "string") {
4370
- el = document.getElementById(el);
4371
- }
4372
- if (this._htOption.useSVG) {
4373
- Drawing = svgDrawer;
4374
- }
4375
- this._android = _getAndroid();
4376
- this._el = el;
4377
- this._oQRCode = null;
4378
- this._oDrawing = new Drawing(this._el, this._htOption);
4379
- if (this._htOption.text) {
4380
- this.makeCode(this._htOption.text);
4381
- }
4382
- };
4383
-
4384
- /**
4385
- * Make the QRCode
4386
- *
4387
- * @param {String} sText link data
4388
- */
4389
- QRCode.prototype.makeCode = function (sText) {
4390
- this._oQRCode = new QRCodeModel(_getTypeNumber(sText, this._htOption.correctLevel), this._htOption.correctLevel);
4391
- this._oQRCode.addData(sText);
4392
- this._oQRCode.make();
4393
- this._el.title = sText;
4394
- this._oDrawing.draw(this._oQRCode);
4395
- this.makeImage();
4396
- };
4397
-
4398
- /**
4399
- * Make the Image from Canvas element
4400
- * - It occurs automatically
4401
- * - Android below 3 doesn't support Data-URI spec.
4402
- *
4403
- * @private
4404
- */
4405
- QRCode.prototype.makeImage = function () {
4406
- if (typeof this._oDrawing.makeImage == "function" && (!this._android || this._android >= 3)) {
4407
- this._oDrawing.makeImage();
4408
- }
4409
- };
4410
-
4411
- /**
4412
- * Clear the QRCode
4413
- */
4414
- QRCode.prototype.clear = function () {
4415
- this._oDrawing.clear();
4416
- };
4417
-
4418
- /**
4419
- * @name QRCode.CorrectLevel
4420
- */
4421
- QRCode.CorrectLevel = QRErrorCorrectLevel;
4422
- return QRCode;
4423
- });
4424
-
4425
3216
  /***/ },
4426
3217
 
4427
3218
  /***/ 3110
@@ -5258,59 +4049,6 @@ $({ target: 'Iterator', proto: true, real: true, forced: someWithoutClosingOnEar
5258
4049
  });
5259
4050
 
5260
4051
 
5261
- /***/ },
5262
-
5263
- /***/ 3609
5264
- (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
5265
-
5266
- "use strict";
5267
-
5268
- var $ = __webpack_require__(6518);
5269
- var toObject = __webpack_require__(8981);
5270
- var lengthOfArrayLike = __webpack_require__(6198);
5271
- var setArrayLength = __webpack_require__(4527);
5272
- var deletePropertyOrThrow = __webpack_require__(4606);
5273
- var doesNotExceedSafeInteger = __webpack_require__(6837);
5274
-
5275
- // IE8-
5276
- var INCORRECT_RESULT = [].unshift(0) !== 1;
5277
-
5278
- // V8 ~ Chrome < 71 and Safari <= 15.4, FF < 23 throws InternalError
5279
- var properErrorOnNonWritableLength = function () {
5280
- try {
5281
- // eslint-disable-next-line es/no-object-defineproperty -- safe
5282
- Object.defineProperty([], 'length', { writable: false }).unshift();
5283
- } catch (error) {
5284
- return error instanceof TypeError;
5285
- }
5286
- };
5287
-
5288
- var FORCED = INCORRECT_RESULT || !properErrorOnNonWritableLength();
5289
-
5290
- // `Array.prototype.unshift` method
5291
- // https://tc39.es/ecma262/#sec-array.prototype.unshift
5292
- $({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
5293
- // eslint-disable-next-line no-unused-vars -- required for `.length`
5294
- unshift: function unshift(item) {
5295
- var O = toObject(this);
5296
- var len = lengthOfArrayLike(O);
5297
- var argCount = arguments.length;
5298
- if (argCount) {
5299
- doesNotExceedSafeInteger(len + argCount);
5300
- var k = len;
5301
- while (k--) {
5302
- var to = k + argCount;
5303
- if (k in O) O[to] = O[k];
5304
- else deletePropertyOrThrow(O, to);
5305
- }
5306
- for (var j = 0; j < argCount; j++) {
5307
- O[j] = arguments[j];
5308
- }
5309
- } return setArrayLength(O, len + argCount);
5310
- }
5311
- });
5312
-
5313
-
5314
4052
  /***/ },
5315
4053
 
5316
4054
  /***/ 3635
@@ -5673,37 +4411,6 @@ module.exports = function isCancel(value) {
5673
4411
  };
5674
4412
 
5675
4413
 
5676
- /***/ },
5677
-
5678
- /***/ 3904
5679
- (module, __unused_webpack_exports, __webpack_require__) {
5680
-
5681
- "use strict";
5682
-
5683
- var globalThis = __webpack_require__(4576);
5684
- var fails = __webpack_require__(9039);
5685
- var uncurryThis = __webpack_require__(9504);
5686
- var toString = __webpack_require__(655);
5687
- var trim = (__webpack_require__(3802).trim);
5688
- var whitespaces = __webpack_require__(7452);
5689
-
5690
- var charAt = uncurryThis(''.charAt);
5691
- var $parseFloat = globalThis.parseFloat;
5692
- var Symbol = globalThis.Symbol;
5693
- var ITERATOR = Symbol && Symbol.iterator;
5694
- var FORCED = 1 / $parseFloat(whitespaces + '-0') !== -Infinity
5695
- // MS Edge 18- broken with boxed symbols
5696
- || (ITERATOR && !fails(function () { $parseFloat(Object(ITERATOR)); }));
5697
-
5698
- // `parseFloat` method
5699
- // https://tc39.es/ecma262/#sec-parsefloat-string
5700
- module.exports = FORCED ? function parseFloat(string) {
5701
- var trimmedString = trim(toString(string));
5702
- var result = $parseFloat(trimmedString);
5703
- return result === 0 && charAt(trimmedString, 0) === '-' ? -0 : result;
5704
- } : $parseFloat;
5705
-
5706
-
5707
4414
  /***/ },
5708
4415
 
5709
4416
  /***/ 3925
@@ -11482,29 +10189,6 @@ module.exports = function () {
11482
10189
  };
11483
10190
 
11484
10191
 
11485
- /***/ },
11486
-
11487
- /***/ 8251
11488
- (module, __unused_webpack_exports, __webpack_require__) {
11489
-
11490
- __webpack_require__(2675);
11491
- __webpack_require__(9463);
11492
- __webpack_require__(2259);
11493
- __webpack_require__(3792);
11494
- __webpack_require__(6099);
11495
- __webpack_require__(7764);
11496
- __webpack_require__(2953);
11497
- function _typeof(o) {
11498
- "@babel/helpers - typeof";
11499
-
11500
- return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
11501
- return typeof o;
11502
- } : function (o) {
11503
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
11504
- }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o);
11505
- }
11506
- module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
11507
-
11508
10192
  /***/ },
11509
10193
 
11510
10194
  /***/ 8265
@@ -11610,23 +10294,6 @@ $({ target: 'Array', proto: true, forced: !STRICT_METHOD }, {
11610
10294
  });
11611
10295
 
11612
10296
 
11613
- /***/ },
11614
-
11615
- /***/ 8459
11616
- (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
11617
-
11618
- "use strict";
11619
-
11620
- var $ = __webpack_require__(6518);
11621
- var $parseFloat = __webpack_require__(3904);
11622
-
11623
- // `parseFloat` method
11624
- // https://tc39.es/ecma262/#sec-parsefloat-string
11625
- $({ global: true, forced: parseFloat !== $parseFloat }, {
11626
- parseFloat: $parseFloat
11627
- });
11628
-
11629
-
11630
10297
  /***/ },
11631
10298
 
11632
10299
  /***/ 8469
@@ -12477,6 +11144,638 @@ $({ target: 'JSON', stat: true, forced: NO_SOURCE_SUPPORT }, {
12477
11144
  });
12478
11145
 
12479
11146
 
11147
+ /***/ },
11148
+
11149
+ /***/ 9118
11150
+ (module) {
11151
+
11152
+ /**
11153
+ * @fileoverview
11154
+ * - Using the 'QRCode for Javascript library'
11155
+ * - Fixed dataset of 'QRCode for Javascript library' for support full-spec.
11156
+ * - this library has no dependencies.
11157
+ *
11158
+ * @author davidshimjs
11159
+ * @see <a href="http://www.d-project.com/" target="_blank">http://www.d-project.com/</a>
11160
+ * @see <a href="http://jeromeetienne.github.com/jquery-qrcode/" target="_blank">http://jeromeetienne.github.com/jquery-qrcode/</a>
11161
+ */
11162
+ var QRCode;
11163
+
11164
+ (function (root, factory) {
11165
+
11166
+ /* CommonJS */
11167
+ if (true) module.exports = factory()
11168
+
11169
+ /* AMD module */
11170
+ else // removed by dead control flow
11171
+ {}
11172
+
11173
+ }(this, function () { //---------------------------------------------------------------------
11174
+ // QRCode for JavaScript
11175
+ //
11176
+ // Copyright (c) 2009 Kazuhiko Arase
11177
+ //
11178
+ // URL: http://www.d-project.com/
11179
+ //
11180
+ // Licensed under the MIT license:
11181
+ // http://www.opensource.org/licenses/mit-license.php
11182
+ //
11183
+ // The word "QR Code" is registered trademark of
11184
+ // DENSO WAVE INCORPORATED
11185
+ // http://www.denso-wave.com/qrcode/faqpatent-e.html
11186
+ //
11187
+ //---------------------------------------------------------------------
11188
+ function QR8bitByte(data) {
11189
+ this.mode = QRMode.MODE_8BIT_BYTE;
11190
+ this.data = data;
11191
+ this.parsedData = [];
11192
+
11193
+ // Added to support UTF-8 Characters
11194
+ for (var i = 0, l = this.data.length; i < l; i++) {
11195
+ var byteArray = [];
11196
+ var code = this.data.charCodeAt(i);
11197
+
11198
+ if (code > 0x10000) {
11199
+ byteArray[0] = 0xF0 | ((code & 0x1C0000) >>> 18);
11200
+ byteArray[1] = 0x80 | ((code & 0x3F000) >>> 12);
11201
+ byteArray[2] = 0x80 | ((code & 0xFC0) >>> 6);
11202
+ byteArray[3] = 0x80 | (code & 0x3F);
11203
+ } else if (code > 0x800) {
11204
+ byteArray[0] = 0xE0 | ((code & 0xF000) >>> 12);
11205
+ byteArray[1] = 0x80 | ((code & 0xFC0) >>> 6);
11206
+ byteArray[2] = 0x80 | (code & 0x3F);
11207
+ } else if (code > 0x80) {
11208
+ byteArray[0] = 0xC0 | ((code & 0x7C0) >>> 6);
11209
+ byteArray[1] = 0x80 | (code & 0x3F);
11210
+ } else {
11211
+ byteArray[0] = code;
11212
+ }
11213
+
11214
+ this.parsedData.push(byteArray);
11215
+ }
11216
+
11217
+ this.parsedData = Array.prototype.concat.apply([], this.parsedData);
11218
+
11219
+ if (this.parsedData.length != this.data.length) {
11220
+ this.parsedData.unshift(191);
11221
+ this.parsedData.unshift(187);
11222
+ this.parsedData.unshift(239);
11223
+ }
11224
+ }
11225
+
11226
+ QR8bitByte.prototype = {
11227
+ getLength: function (buffer) {
11228
+ return this.parsedData.length;
11229
+ },
11230
+ write: function (buffer) {
11231
+ for (var i = 0, l = this.parsedData.length; i < l; i++) {
11232
+ buffer.put(this.parsedData[i], 8);
11233
+ }
11234
+ }
11235
+ };
11236
+
11237
+ function QRCodeModel(typeNumber, errorCorrectLevel) {
11238
+ this.typeNumber = typeNumber;
11239
+ this.errorCorrectLevel = errorCorrectLevel;
11240
+ this.modules = null;
11241
+ this.moduleCount = 0;
11242
+ this.dataCache = null;
11243
+ this.dataList = [];
11244
+ }
11245
+
11246
+ QRCodeModel.prototype={addData:function(data){var newData=new QR8bitByte(data);this.dataList.push(newData);this.dataCache=null;},isDark:function(row,col){if(row<0||this.moduleCount<=row||col<0||this.moduleCount<=col){throw new Error(row+","+col);}
11247
+ return this.modules[row][col];},getModuleCount:function(){return this.moduleCount;},make:function(){this.makeImpl(false,this.getBestMaskPattern());},makeImpl:function(test,maskPattern){this.moduleCount=this.typeNumber*4+17;this.modules=new Array(this.moduleCount);for(var row=0;row<this.moduleCount;row++){this.modules[row]=new Array(this.moduleCount);for(var col=0;col<this.moduleCount;col++){this.modules[row][col]=null;}}
11248
+ this.setupPositionProbePattern(0,0);this.setupPositionProbePattern(this.moduleCount-7,0);this.setupPositionProbePattern(0,this.moduleCount-7);this.setupPositionAdjustPattern();this.setupTimingPattern();this.setupTypeInfo(test,maskPattern);if(this.typeNumber>=7){this.setupTypeNumber(test);}
11249
+ if(this.dataCache==null){this.dataCache=QRCodeModel.createData(this.typeNumber,this.errorCorrectLevel,this.dataList);}
11250
+ this.mapData(this.dataCache,maskPattern);},setupPositionProbePattern:function(row,col){for(var r=-1;r<=7;r++){if(row+r<=-1||this.moduleCount<=row+r)continue;for(var c=-1;c<=7;c++){if(col+c<=-1||this.moduleCount<=col+c)continue;if((0<=r&&r<=6&&(c==0||c==6))||(0<=c&&c<=6&&(r==0||r==6))||(2<=r&&r<=4&&2<=c&&c<=4)){this.modules[row+r][col+c]=true;}else{this.modules[row+r][col+c]=false;}}}},getBestMaskPattern:function(){var minLostPoint=0;var pattern=0;for(var i=0;i<8;i++){this.makeImpl(true,i);var lostPoint=QRUtil.getLostPoint(this);if(i==0||minLostPoint>lostPoint){minLostPoint=lostPoint;pattern=i;}}
11251
+ return pattern;},createMovieClip:function(target_mc,instance_name,depth){var qr_mc=target_mc.createEmptyMovieClip(instance_name,depth);var cs=1;this.make();for(var row=0;row<this.modules.length;row++){var y=row*cs;for(var col=0;col<this.modules[row].length;col++){var x=col*cs;var dark=this.modules[row][col];if(dark){qr_mc.beginFill(0,100);qr_mc.moveTo(x,y);qr_mc.lineTo(x+cs,y);qr_mc.lineTo(x+cs,y+cs);qr_mc.lineTo(x,y+cs);qr_mc.endFill();}}}
11252
+ return qr_mc;},setupTimingPattern:function(){for(var r=8;r<this.moduleCount-8;r++){if(this.modules[r][6]!=null){continue;}
11253
+ this.modules[r][6]=(r%2==0);}
11254
+ for(var c=8;c<this.moduleCount-8;c++){if(this.modules[6][c]!=null){continue;}
11255
+ this.modules[6][c]=(c%2==0);}},setupPositionAdjustPattern:function(){var pos=QRUtil.getPatternPosition(this.typeNumber);for(var i=0;i<pos.length;i++){for(var j=0;j<pos.length;j++){var row=pos[i];var col=pos[j];if(this.modules[row][col]!=null){continue;}
11256
+ for(var r=-2;r<=2;r++){for(var c=-2;c<=2;c++){if(r==-2||r==2||c==-2||c==2||(r==0&&c==0)){this.modules[row+r][col+c]=true;}else{this.modules[row+r][col+c]=false;}}}}}},setupTypeNumber:function(test){var bits=QRUtil.getBCHTypeNumber(this.typeNumber);for(var i=0;i<18;i++){var mod=(!test&&((bits>>i)&1)==1);this.modules[Math.floor(i/3)][i%3+this.moduleCount-8-3]=mod;}
11257
+ for(var i=0;i<18;i++){var mod=(!test&&((bits>>i)&1)==1);this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=mod;}},setupTypeInfo:function(test,maskPattern){var data=(this.errorCorrectLevel<<3)|maskPattern;var bits=QRUtil.getBCHTypeInfo(data);for(var i=0;i<15;i++){var mod=(!test&&((bits>>i)&1)==1);if(i<6){this.modules[i][8]=mod;}else if(i<8){this.modules[i+1][8]=mod;}else{this.modules[this.moduleCount-15+i][8]=mod;}}
11258
+ for(var i=0;i<15;i++){var mod=(!test&&((bits>>i)&1)==1);if(i<8){this.modules[8][this.moduleCount-i-1]=mod;}else if(i<9){this.modules[8][15-i-1+1]=mod;}else{this.modules[8][15-i-1]=mod;}}
11259
+ this.modules[this.moduleCount-8][8]=(!test);},mapData:function(data,maskPattern){var inc=-1;var row=this.moduleCount-1;var bitIndex=7;var byteIndex=0;for(var col=this.moduleCount-1;col>0;col-=2){if(col==6)col--;while(true){for(var c=0;c<2;c++){if(this.modules[row][col-c]==null){var dark=false;if(byteIndex<data.length){dark=(((data[byteIndex]>>>bitIndex)&1)==1);}
11260
+ var mask=QRUtil.getMask(maskPattern,row,col-c);if(mask){dark=!dark;}
11261
+ this.modules[row][col-c]=dark;bitIndex--;if(bitIndex==-1){byteIndex++;bitIndex=7;}}}
11262
+ row+=inc;if(row<0||this.moduleCount<=row){row-=inc;inc=-inc;break;}}}}};QRCodeModel.PAD0=0xEC;QRCodeModel.PAD1=0x11;QRCodeModel.createData=function(typeNumber,errorCorrectLevel,dataList){var rsBlocks=QRRSBlock.getRSBlocks(typeNumber,errorCorrectLevel);var buffer=new QRBitBuffer();for(var i=0;i<dataList.length;i++){var data=dataList[i];buffer.put(data.mode,4);buffer.put(data.getLength(),QRUtil.getLengthInBits(data.mode,typeNumber));data.write(buffer);}
11263
+ var totalDataCount=0;for(var i=0;i<rsBlocks.length;i++){totalDataCount+=rsBlocks[i].dataCount;}
11264
+ if(buffer.getLengthInBits()>totalDataCount*8){throw new Error("code length overflow. ("
11265
+ +buffer.getLengthInBits()
11266
+ +">"
11267
+ +totalDataCount*8
11268
+ +")");}
11269
+ if(buffer.getLengthInBits()+4<=totalDataCount*8){buffer.put(0,4);}
11270
+ while(buffer.getLengthInBits()%8!=0){buffer.putBit(false);}
11271
+ while(true){if(buffer.getLengthInBits()>=totalDataCount*8){break;}
11272
+ buffer.put(QRCodeModel.PAD0,8);if(buffer.getLengthInBits()>=totalDataCount*8){break;}
11273
+ buffer.put(QRCodeModel.PAD1,8);}
11274
+ return QRCodeModel.createBytes(buffer,rsBlocks);};QRCodeModel.createBytes=function(buffer,rsBlocks){var offset=0;var maxDcCount=0;var maxEcCount=0;var dcdata=new Array(rsBlocks.length);var ecdata=new Array(rsBlocks.length);for(var r=0;r<rsBlocks.length;r++){var dcCount=rsBlocks[r].dataCount;var ecCount=rsBlocks[r].totalCount-dcCount;maxDcCount=Math.max(maxDcCount,dcCount);maxEcCount=Math.max(maxEcCount,ecCount);dcdata[r]=new Array(dcCount);for(var i=0;i<dcdata[r].length;i++){dcdata[r][i]=0xff&buffer.buffer[i+offset];}
11275
+ offset+=dcCount;var rsPoly=QRUtil.getErrorCorrectPolynomial(ecCount);var rawPoly=new QRPolynomial(dcdata[r],rsPoly.getLength()-1);var modPoly=rawPoly.mod(rsPoly);ecdata[r]=new Array(rsPoly.getLength()-1);for(var i=0;i<ecdata[r].length;i++){var modIndex=i+modPoly.getLength()-ecdata[r].length;ecdata[r][i]=(modIndex>=0)?modPoly.get(modIndex):0;}}
11276
+ var totalCodeCount=0;for(var i=0;i<rsBlocks.length;i++){totalCodeCount+=rsBlocks[i].totalCount;}
11277
+ var data=new Array(totalCodeCount);var index=0;for(var i=0;i<maxDcCount;i++){for(var r=0;r<rsBlocks.length;r++){if(i<dcdata[r].length){data[index++]=dcdata[r][i];}}}
11278
+ for(var i=0;i<maxEcCount;i++){for(var r=0;r<rsBlocks.length;r++){if(i<ecdata[r].length){data[index++]=ecdata[r][i];}}}
11279
+ return data;};var QRMode={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3};var QRErrorCorrectLevel={L:1,M:0,Q:3,H:2};var QRMaskPattern={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var QRUtil={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:(1<<10)|(1<<8)|(1<<5)|(1<<4)|(1<<2)|(1<<1)|(1<<0),G18:(1<<12)|(1<<11)|(1<<10)|(1<<9)|(1<<8)|(1<<5)|(1<<2)|(1<<0),G15_MASK:(1<<14)|(1<<12)|(1<<10)|(1<<4)|(1<<1),getBCHTypeInfo:function(data){var d=data<<10;while(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G15)>=0){d^=(QRUtil.G15<<(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G15)));}
11280
+ return((data<<10)|d)^QRUtil.G15_MASK;},getBCHTypeNumber:function(data){var d=data<<12;while(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G18)>=0){d^=(QRUtil.G18<<(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G18)));}
11281
+ return(data<<12)|d;},getBCHDigit:function(data){var digit=0;while(data!=0){digit++;data>>>=1;}
11282
+ return digit;},getPatternPosition:function(typeNumber){return QRUtil.PATTERN_POSITION_TABLE[typeNumber-1];},getMask:function(maskPattern,i,j){switch(maskPattern){case QRMaskPattern.PATTERN000:return(i+j)%2==0;case QRMaskPattern.PATTERN001:return i%2==0;case QRMaskPattern.PATTERN010:return j%3==0;case QRMaskPattern.PATTERN011:return(i+j)%3==0;case QRMaskPattern.PATTERN100:return(Math.floor(i/2)+Math.floor(j/3))%2==0;case QRMaskPattern.PATTERN101:return(i*j)%2+(i*j)%3==0;case QRMaskPattern.PATTERN110:return((i*j)%2+(i*j)%3)%2==0;case QRMaskPattern.PATTERN111:return((i*j)%3+(i+j)%2)%2==0;default:throw new Error("bad maskPattern:"+maskPattern);}},getErrorCorrectPolynomial:function(errorCorrectLength){var a=new QRPolynomial([1],0);for(var i=0;i<errorCorrectLength;i++){a=a.multiply(new QRPolynomial([1,QRMath.gexp(i)],0));}
11283
+ return a;},getLengthInBits:function(mode,type){if(1<=type&&type<10){switch(mode){case QRMode.MODE_NUMBER:return 10;case QRMode.MODE_ALPHA_NUM:return 9;case QRMode.MODE_8BIT_BYTE:return 8;case QRMode.MODE_KANJI:return 8;default:throw new Error("mode:"+mode);}}else if(type<27){switch(mode){case QRMode.MODE_NUMBER:return 12;case QRMode.MODE_ALPHA_NUM:return 11;case QRMode.MODE_8BIT_BYTE:return 16;case QRMode.MODE_KANJI:return 10;default:throw new Error("mode:"+mode);}}else if(type<41){switch(mode){case QRMode.MODE_NUMBER:return 14;case QRMode.MODE_ALPHA_NUM:return 13;case QRMode.MODE_8BIT_BYTE:return 16;case QRMode.MODE_KANJI:return 12;default:throw new Error("mode:"+mode);}}else{throw new Error("type:"+type);}},getLostPoint:function(qrCode){var moduleCount=qrCode.getModuleCount();var lostPoint=0;for(var row=0;row<moduleCount;row++){for(var col=0;col<moduleCount;col++){var sameCount=0;var dark=qrCode.isDark(row,col);for(var r=-1;r<=1;r++){if(row+r<0||moduleCount<=row+r){continue;}
11284
+ for(var c=-1;c<=1;c++){if(col+c<0||moduleCount<=col+c){continue;}
11285
+ if(r==0&&c==0){continue;}
11286
+ if(dark==qrCode.isDark(row+r,col+c)){sameCount++;}}}
11287
+ if(sameCount>5){lostPoint+=(3+sameCount-5);}}}
11288
+ for(var row=0;row<moduleCount-1;row++){for(var col=0;col<moduleCount-1;col++){var count=0;if(qrCode.isDark(row,col))count++;if(qrCode.isDark(row+1,col))count++;if(qrCode.isDark(row,col+1))count++;if(qrCode.isDark(row+1,col+1))count++;if(count==0||count==4){lostPoint+=3;}}}
11289
+ for(var row=0;row<moduleCount;row++){for(var col=0;col<moduleCount-6;col++){if(qrCode.isDark(row,col)&&!qrCode.isDark(row,col+1)&&qrCode.isDark(row,col+2)&&qrCode.isDark(row,col+3)&&qrCode.isDark(row,col+4)&&!qrCode.isDark(row,col+5)&&qrCode.isDark(row,col+6)){lostPoint+=40;}}}
11290
+ for(var col=0;col<moduleCount;col++){for(var row=0;row<moduleCount-6;row++){if(qrCode.isDark(row,col)&&!qrCode.isDark(row+1,col)&&qrCode.isDark(row+2,col)&&qrCode.isDark(row+3,col)&&qrCode.isDark(row+4,col)&&!qrCode.isDark(row+5,col)&&qrCode.isDark(row+6,col)){lostPoint+=40;}}}
11291
+ var darkCount=0;for(var col=0;col<moduleCount;col++){for(var row=0;row<moduleCount;row++){if(qrCode.isDark(row,col)){darkCount++;}}}
11292
+ var ratio=Math.abs(100*darkCount/moduleCount/moduleCount-50)/5;lostPoint+=ratio*10;return lostPoint;}};var QRMath={glog:function(n){if(n<1){throw new Error("glog("+n+")");}
11293
+ return QRMath.LOG_TABLE[n];},gexp:function(n){while(n<0){n+=255;}
11294
+ while(n>=256){n-=255;}
11295
+ return QRMath.EXP_TABLE[n];},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var i=0;i<8;i++){QRMath.EXP_TABLE[i]=1<<i;}
11296
+ for(var i=8;i<256;i++){QRMath.EXP_TABLE[i]=QRMath.EXP_TABLE[i-4]^QRMath.EXP_TABLE[i-5]^QRMath.EXP_TABLE[i-6]^QRMath.EXP_TABLE[i-8];}
11297
+ for(var i=0;i<255;i++){QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]]=i;}
11298
+ function QRPolynomial(num,shift){if(num.length==undefined){throw new Error(num.length+"/"+shift);}
11299
+ var offset=0;while(offset<num.length&&num[offset]==0){offset++;}
11300
+ this.num=new Array(num.length-offset+shift);for(var i=0;i<num.length-offset;i++){this.num[i]=num[i+offset];}}
11301
+ QRPolynomial.prototype={get:function(index){return this.num[index];},getLength:function(){return this.num.length;},multiply:function(e){var num=new Array(this.getLength()+e.getLength()-1);for(var i=0;i<this.getLength();i++){for(var j=0;j<e.getLength();j++){num[i+j]^=QRMath.gexp(QRMath.glog(this.get(i))+QRMath.glog(e.get(j)));}}
11302
+ return new QRPolynomial(num,0);},mod:function(e){if(this.getLength()-e.getLength()<0){return this;}
11303
+ var ratio=QRMath.glog(this.get(0))-QRMath.glog(e.get(0));var num=new Array(this.getLength());for(var i=0;i<this.getLength();i++){num[i]=this.get(i);}
11304
+ for(var i=0;i<e.getLength();i++){num[i]^=QRMath.gexp(QRMath.glog(e.get(i))+ratio);}
11305
+ return new QRPolynomial(num,0).mod(e);}};function QRRSBlock(totalCount,dataCount){this.totalCount=totalCount;this.dataCount=dataCount;}
11306
+ QRRSBlock.RS_BLOCK_TABLE=[[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],[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]];QRRSBlock.getRSBlocks=function(typeNumber,errorCorrectLevel){var rsBlock=QRRSBlock.getRsBlockTable(typeNumber,errorCorrectLevel);if(rsBlock==undefined){throw new Error("bad rs block @ typeNumber:"+typeNumber+"/errorCorrectLevel:"+errorCorrectLevel);}
11307
+ var length=rsBlock.length/3;var list=[];for(var i=0;i<length;i++){var count=rsBlock[i*3+0];var totalCount=rsBlock[i*3+1];var dataCount=rsBlock[i*3+2];for(var j=0;j<count;j++){list.push(new QRRSBlock(totalCount,dataCount));}}
11308
+ return list;};QRRSBlock.getRsBlockTable=function(typeNumber,errorCorrectLevel){switch(errorCorrectLevel){case QRErrorCorrectLevel.L:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+0];case QRErrorCorrectLevel.M:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+1];case QRErrorCorrectLevel.Q:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+2];case QRErrorCorrectLevel.H:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+3];default:return undefined;}};function QRBitBuffer(){this.buffer=[];this.length=0;}
11309
+ QRBitBuffer.prototype={get:function(index){var bufIndex=Math.floor(index/8);return((this.buffer[bufIndex]>>>(7-index%8))&1)==1;},put:function(num,length){for(var i=0;i<length;i++){this.putBit(((num>>>(length-i-1))&1)==1);}},getLengthInBits:function(){return this.length;},putBit:function(bit){var bufIndex=Math.floor(this.length/8);if(this.buffer.length<=bufIndex){this.buffer.push(0);}
11310
+ if(bit){this.buffer[bufIndex]|=(0x80>>>(this.length%8));}
11311
+ this.length++;}};var QRCodeLimitLength=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];
11312
+
11313
+ function _isSupportCanvas() {
11314
+ return typeof CanvasRenderingContext2D != "undefined";
11315
+ }
11316
+
11317
+ // android 2.x doesn't support Data-URI spec
11318
+ function _getAndroid() {
11319
+ var android = false;
11320
+ var sAgent = navigator.userAgent;
11321
+
11322
+ if (/android/i.test(sAgent)) { // android
11323
+ android = true;
11324
+ var aMat = sAgent.toString().match(/android ([0-9]\.[0-9])/i);
11325
+
11326
+ if (aMat && aMat[1]) {
11327
+ android = parseFloat(aMat[1]);
11328
+ }
11329
+ }
11330
+
11331
+ return android;
11332
+ }
11333
+
11334
+ var svgDrawer = (function() {
11335
+
11336
+ var Drawing = function (el, htOption) {
11337
+ this._el = el;
11338
+ this._htOption = htOption;
11339
+ };
11340
+
11341
+ Drawing.prototype.draw = function (oQRCode) {
11342
+ var _htOption = this._htOption;
11343
+ var _el = this._el;
11344
+ var nCount = oQRCode.getModuleCount();
11345
+ var nWidth = Math.floor(_htOption.width / nCount);
11346
+ var nHeight = Math.floor(_htOption.height / nCount);
11347
+
11348
+ this.clear();
11349
+
11350
+ function makeSVG(tag, attrs) {
11351
+ var el = document.createElementNS('http://www.w3.org/2000/svg', tag);
11352
+ for (var k in attrs)
11353
+ if (attrs.hasOwnProperty(k)) el.setAttribute(k, attrs[k]);
11354
+ return el;
11355
+ }
11356
+
11357
+ var svg = makeSVG("svg" , {'viewBox': '0 0 ' + String(nCount) + " " + String(nCount), 'width': '100%', 'height': '100%', 'fill': _htOption.colorLight});
11358
+ svg.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xlink", "http://www.w3.org/1999/xlink");
11359
+ _el.appendChild(svg);
11360
+
11361
+ svg.appendChild(makeSVG("rect", {"fill": _htOption.colorLight, "width": "100%", "height": "100%"}));
11362
+ svg.appendChild(makeSVG("rect", {"fill": _htOption.colorDark, "width": "1", "height": "1", "id": "template"}));
11363
+
11364
+ for (var row = 0; row < nCount; row++) {
11365
+ for (var col = 0; col < nCount; col++) {
11366
+ if (oQRCode.isDark(row, col)) {
11367
+ var child = makeSVG("use", {"x": String(col), "y": String(row)});
11368
+ child.setAttributeNS("http://www.w3.org/1999/xlink", "href", "#template")
11369
+ svg.appendChild(child);
11370
+ }
11371
+ }
11372
+ }
11373
+ };
11374
+ Drawing.prototype.clear = function () {
11375
+ while (this._el.hasChildNodes())
11376
+ this._el.removeChild(this._el.lastChild);
11377
+ };
11378
+ return Drawing;
11379
+ })();
11380
+
11381
+ var useSVG = document.documentElement.tagName.toLowerCase() === "svg";
11382
+
11383
+ // Drawing in DOM by using Table tag
11384
+ var Drawing = useSVG ? svgDrawer : !_isSupportCanvas() ? (function () {
11385
+ var Drawing = function (el, htOption) {
11386
+ this._el = el;
11387
+ this._htOption = htOption;
11388
+ };
11389
+
11390
+ /**
11391
+ * Draw the QRCode
11392
+ *
11393
+ * @param {QRCode} oQRCode
11394
+ */
11395
+ Drawing.prototype.draw = function (oQRCode) {
11396
+ var _htOption = this._htOption;
11397
+ var _el = this._el;
11398
+ var nCount = oQRCode.getModuleCount();
11399
+ var nWidth = Math.floor(_htOption.width / nCount);
11400
+ var nHeight = Math.floor(_htOption.height / nCount);
11401
+ var aHTML = ['<table style="border:0;border-collapse:collapse;">'];
11402
+
11403
+ for (var row = 0; row < nCount; row++) {
11404
+ aHTML.push('<tr>');
11405
+
11406
+ for (var col = 0; col < nCount; col++) {
11407
+ aHTML.push('<td style="border:0;border-collapse:collapse;padding:0;margin:0;width:' + nWidth + 'px;height:' + nHeight + 'px;background-color:' + (oQRCode.isDark(row, col) ? _htOption.colorDark : _htOption.colorLight) + ';"></td>');
11408
+ }
11409
+
11410
+ aHTML.push('</tr>');
11411
+ }
11412
+
11413
+ aHTML.push('</table>');
11414
+ _el.innerHTML = aHTML.join('');
11415
+
11416
+ // Fix the margin values as real size.
11417
+ var elTable = _el.childNodes[0];
11418
+ var nLeftMarginTable = (_htOption.width - elTable.offsetWidth) / 2;
11419
+ var nTopMarginTable = (_htOption.height - elTable.offsetHeight) / 2;
11420
+
11421
+ if (nLeftMarginTable > 0 && nTopMarginTable > 0) {
11422
+ elTable.style.margin = nTopMarginTable + "px " + nLeftMarginTable + "px";
11423
+ }
11424
+ };
11425
+
11426
+ /**
11427
+ * Clear the QRCode
11428
+ */
11429
+ Drawing.prototype.clear = function () {
11430
+ this._el.innerHTML = '';
11431
+ };
11432
+
11433
+ return Drawing;
11434
+ })() : (function () { // Drawing in Canvas
11435
+ function _onMakeImage() {
11436
+ this._elImage.src = this._elCanvas.toDataURL("image/png");
11437
+ this._elImage.style.display = "block";
11438
+ this._elCanvas.style.display = "none";
11439
+ }
11440
+
11441
+ // Android 2.1 bug workaround
11442
+ // http://code.google.com/p/android/issues/detail?id=5141
11443
+ if (this._android && this._android <= 2.1) {
11444
+ var factor = 1 / window.devicePixelRatio;
11445
+ var drawImage = CanvasRenderingContext2D.prototype.drawImage;
11446
+ CanvasRenderingContext2D.prototype.drawImage = function (image, sx, sy, sw, sh, dx, dy, dw, dh) {
11447
+ if (("nodeName" in image) && /img/i.test(image.nodeName)) {
11448
+ for (var i = arguments.length - 1; i >= 1; i--) {
11449
+ arguments[i] = arguments[i] * factor;
11450
+ }
11451
+ } else if (typeof dw == "undefined") {
11452
+ arguments[1] *= factor;
11453
+ arguments[2] *= factor;
11454
+ arguments[3] *= factor;
11455
+ arguments[4] *= factor;
11456
+ }
11457
+
11458
+ drawImage.apply(this, arguments);
11459
+ };
11460
+ }
11461
+
11462
+ /**
11463
+ * Check whether the user's browser supports Data URI or not
11464
+ *
11465
+ * @private
11466
+ * @param {Function} fSuccess Occurs if it supports Data URI
11467
+ * @param {Function} fFail Occurs if it doesn't support Data URI
11468
+ */
11469
+ function _safeSetDataURI(fSuccess, fFail) {
11470
+ var self = this;
11471
+ self._fFail = fFail;
11472
+ self._fSuccess = fSuccess;
11473
+
11474
+ // Check it just once
11475
+ if (self._bSupportDataURI === null) {
11476
+ var el = document.createElement("img");
11477
+ var fOnError = function() {
11478
+ self._bSupportDataURI = false;
11479
+
11480
+ if (self._fFail) {
11481
+ self._fFail.call(self);
11482
+ }
11483
+ };
11484
+ var fOnSuccess = function() {
11485
+ self._bSupportDataURI = true;
11486
+
11487
+ if (self._fSuccess) {
11488
+ self._fSuccess.call(self);
11489
+ }
11490
+ };
11491
+
11492
+ el.onabort = fOnError;
11493
+ el.onerror = fOnError;
11494
+ el.onload = fOnSuccess;
11495
+ el.src = "data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="; // the Image contains 1px data.
11496
+ return;
11497
+ } else if (self._bSupportDataURI === true && self._fSuccess) {
11498
+ self._fSuccess.call(self);
11499
+ } else if (self._bSupportDataURI === false && self._fFail) {
11500
+ self._fFail.call(self);
11501
+ }
11502
+ };
11503
+
11504
+ /**
11505
+ * Drawing QRCode by using canvas
11506
+ *
11507
+ * @constructor
11508
+ * @param {HTMLElement} el
11509
+ * @param {Object} htOption QRCode Options
11510
+ */
11511
+ var Drawing = function (el, htOption) {
11512
+ this._bIsPainted = false;
11513
+ this._android = _getAndroid();
11514
+
11515
+ this._htOption = htOption;
11516
+ this._elCanvas = document.createElement("canvas");
11517
+ this._elCanvas.width = htOption.width;
11518
+ this._elCanvas.height = htOption.height;
11519
+ el.appendChild(this._elCanvas);
11520
+ this._el = el;
11521
+ this._oContext = this._elCanvas.getContext("2d");
11522
+ this._bIsPainted = false;
11523
+ this._elImage = document.createElement("img");
11524
+ this._elImage.alt = "Scan me!";
11525
+ this._elImage.style.display = "none";
11526
+ this._el.appendChild(this._elImage);
11527
+ this._bSupportDataURI = null;
11528
+ };
11529
+
11530
+ /**
11531
+ * Draw the QRCode
11532
+ *
11533
+ * @param {QRCode} oQRCode
11534
+ */
11535
+ Drawing.prototype.draw = function (oQRCode) {
11536
+ var _elImage = this._elImage;
11537
+ var _oContext = this._oContext;
11538
+ var _htOption = this._htOption;
11539
+
11540
+ var nCount = oQRCode.getModuleCount();
11541
+ var nWidth = _htOption.width / nCount;
11542
+ var nHeight = _htOption.height / nCount;
11543
+ var nRoundedWidth = Math.round(nWidth);
11544
+ var nRoundedHeight = Math.round(nHeight);
11545
+
11546
+ _elImage.style.display = "none";
11547
+ this.clear();
11548
+
11549
+ for (var row = 0; row < nCount; row++) {
11550
+ for (var col = 0; col < nCount; col++) {
11551
+ var bIsDark = oQRCode.isDark(row, col);
11552
+ var nLeft = col * nWidth;
11553
+ var nTop = row * nHeight;
11554
+ _oContext.strokeStyle = bIsDark ? _htOption.colorDark : _htOption.colorLight;
11555
+ _oContext.lineWidth = 1;
11556
+ _oContext.fillStyle = bIsDark ? _htOption.colorDark : _htOption.colorLight;
11557
+ _oContext.fillRect(nLeft, nTop, nWidth, nHeight);
11558
+
11559
+ // 안티 앨리어싱 방지 처리
11560
+ _oContext.strokeRect(
11561
+ Math.floor(nLeft) + 0.5,
11562
+ Math.floor(nTop) + 0.5,
11563
+ nRoundedWidth,
11564
+ nRoundedHeight
11565
+ );
11566
+
11567
+ _oContext.strokeRect(
11568
+ Math.ceil(nLeft) - 0.5,
11569
+ Math.ceil(nTop) - 0.5,
11570
+ nRoundedWidth,
11571
+ nRoundedHeight
11572
+ );
11573
+ }
11574
+ }
11575
+
11576
+ this._bIsPainted = true;
11577
+ };
11578
+
11579
+ /**
11580
+ * Make the image from Canvas if the browser supports Data URI.
11581
+ */
11582
+ Drawing.prototype.makeImage = function () {
11583
+ if (this._bIsPainted) {
11584
+ _safeSetDataURI.call(this, _onMakeImage);
11585
+ }
11586
+ };
11587
+
11588
+ /**
11589
+ * Return whether the QRCode is painted or not
11590
+ *
11591
+ * @return {Boolean}
11592
+ */
11593
+ Drawing.prototype.isPainted = function () {
11594
+ return this._bIsPainted;
11595
+ };
11596
+
11597
+ /**
11598
+ * Clear the QRCode
11599
+ */
11600
+ Drawing.prototype.clear = function () {
11601
+ this._oContext.clearRect(0, 0, this._elCanvas.width, this._elCanvas.height);
11602
+ this._bIsPainted = false;
11603
+ };
11604
+
11605
+ /**
11606
+ * @private
11607
+ * @param {Number} nNumber
11608
+ */
11609
+ Drawing.prototype.round = function (nNumber) {
11610
+ if (!nNumber) {
11611
+ return nNumber;
11612
+ }
11613
+
11614
+ return Math.floor(nNumber * 1000) / 1000;
11615
+ };
11616
+
11617
+ return Drawing;
11618
+ })();
11619
+
11620
+ /**
11621
+ * Get the type by string length
11622
+ *
11623
+ * @private
11624
+ * @param {String} sText
11625
+ * @param {Number} nCorrectLevel
11626
+ * @return {Number} type
11627
+ */
11628
+ function _getTypeNumber(sText, nCorrectLevel) {
11629
+ var nType = 1;
11630
+ var length = _getUTF8Length(sText);
11631
+
11632
+ for (var i = 0, len = QRCodeLimitLength.length; i <= len; i++) {
11633
+ var nLimit = 0;
11634
+
11635
+ switch (nCorrectLevel) {
11636
+ case QRErrorCorrectLevel.L :
11637
+ nLimit = QRCodeLimitLength[i][0];
11638
+ break;
11639
+ case QRErrorCorrectLevel.M :
11640
+ nLimit = QRCodeLimitLength[i][1];
11641
+ break;
11642
+ case QRErrorCorrectLevel.Q :
11643
+ nLimit = QRCodeLimitLength[i][2];
11644
+ break;
11645
+ case QRErrorCorrectLevel.H :
11646
+ nLimit = QRCodeLimitLength[i][3];
11647
+ break;
11648
+ }
11649
+
11650
+ if (length <= nLimit) {
11651
+ break;
11652
+ } else {
11653
+ nType++;
11654
+ }
11655
+ }
11656
+
11657
+ if (nType > QRCodeLimitLength.length) {
11658
+ throw new Error("Too long data");
11659
+ }
11660
+
11661
+ return nType;
11662
+ }
11663
+
11664
+ function _getUTF8Length(sText) {
11665
+ var replacedText = encodeURI(sText).toString().replace(/\%[0-9a-fA-F]{2}/g, 'a');
11666
+ return replacedText.length + (replacedText.length != sText ? 3 : 0);
11667
+ }
11668
+
11669
+ /**
11670
+ * @class QRCode
11671
+ * @constructor
11672
+ * @example
11673
+ * new QRCode(document.getElementById("test"), "http://jindo.dev.naver.com/collie");
11674
+ *
11675
+ * @example
11676
+ * var oQRCode = new QRCode("test", {
11677
+ * text : "http://naver.com",
11678
+ * width : 128,
11679
+ * height : 128
11680
+ * });
11681
+ *
11682
+ * oQRCode.clear(); // Clear the QRCode.
11683
+ * oQRCode.makeCode("http://map.naver.com"); // Re-create the QRCode.
11684
+ *
11685
+ * @param {HTMLElement|String} el target element or 'id' attribute of element.
11686
+ * @param {Object|String} vOption
11687
+ * @param {String} vOption.text QRCode link data
11688
+ * @param {Number} [vOption.width=256]
11689
+ * @param {Number} [vOption.height=256]
11690
+ * @param {String} [vOption.colorDark="#000000"]
11691
+ * @param {String} [vOption.colorLight="#ffffff"]
11692
+ * @param {QRCode.CorrectLevel} [vOption.correctLevel=QRCode.CorrectLevel.H] [L|M|Q|H]
11693
+ */
11694
+ QRCode = function (el, vOption) {
11695
+ this._htOption = {
11696
+ width : 256,
11697
+ height : 256,
11698
+ typeNumber : 4,
11699
+ colorDark : "#000000",
11700
+ colorLight : "#ffffff",
11701
+ correctLevel : QRErrorCorrectLevel.H
11702
+ };
11703
+
11704
+ if (typeof vOption === 'string') {
11705
+ vOption = {
11706
+ text : vOption
11707
+ };
11708
+ }
11709
+
11710
+ // Overwrites options
11711
+ if (vOption) {
11712
+ for (var i in vOption) {
11713
+ this._htOption[i] = vOption[i];
11714
+ }
11715
+ }
11716
+
11717
+ if (typeof el == "string") {
11718
+ el = document.getElementById(el);
11719
+ }
11720
+
11721
+ if (this._htOption.useSVG) {
11722
+ Drawing = svgDrawer;
11723
+ }
11724
+
11725
+ this._android = _getAndroid();
11726
+ this._el = el;
11727
+ this._oQRCode = null;
11728
+ this._oDrawing = new Drawing(this._el, this._htOption);
11729
+
11730
+ if (this._htOption.text) {
11731
+ this.makeCode(this._htOption.text);
11732
+ }
11733
+ };
11734
+
11735
+ /**
11736
+ * Make the QRCode
11737
+ *
11738
+ * @param {String} sText link data
11739
+ */
11740
+ QRCode.prototype.makeCode = function (sText) {
11741
+ this._oQRCode = new QRCodeModel(_getTypeNumber(sText, this._htOption.correctLevel), this._htOption.correctLevel);
11742
+ this._oQRCode.addData(sText);
11743
+ this._oQRCode.make();
11744
+ this._el.title = sText;
11745
+ this._oDrawing.draw(this._oQRCode);
11746
+ this.makeImage();
11747
+ };
11748
+
11749
+ /**
11750
+ * Make the Image from Canvas element
11751
+ * - It occurs automatically
11752
+ * - Android below 3 doesn't support Data-URI spec.
11753
+ *
11754
+ * @private
11755
+ */
11756
+ QRCode.prototype.makeImage = function () {
11757
+ if (typeof this._oDrawing.makeImage == "function" && (!this._android || this._android >= 3)) {
11758
+ this._oDrawing.makeImage();
11759
+ }
11760
+ };
11761
+
11762
+ /**
11763
+ * Clear the QRCode
11764
+ */
11765
+ QRCode.prototype.clear = function () {
11766
+ this._oDrawing.clear();
11767
+ };
11768
+
11769
+ /**
11770
+ * @name QRCode.CorrectLevel
11771
+ */
11772
+ QRCode.CorrectLevel = QRErrorCorrectLevel;
11773
+
11774
+ return QRCode;
11775
+
11776
+ }));
11777
+
11778
+
12480
11779
  /***/ },
12481
11780
 
12482
11781
  /***/ 9137
@@ -36265,7 +35564,7 @@ function QRCodeLoginvue_type_template_id_6badd114_scoped_true_render(_ctx, _cach
36265
35564
  ;// ./src/components/QRCodeLogin.vue?vue&type=template&id=6badd114&scoped=true
36266
35565
 
36267
35566
  // EXTERNAL MODULE: ./node_modules/qrcodejs2/qrcode.js
36268
- var qrcode = __webpack_require__(3060);
35567
+ var qrcode = __webpack_require__(9118);
36269
35568
  var qrcode_default = /*#__PURE__*/__webpack_require__.n(qrcode);
36270
35569
  ;// ./src/utils/auth.js
36271
35570