@solar-taro/ui-sun 1.6.4 → 2.0.0

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.
Files changed (105) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/accordion/index.vue.d.ts +22 -16
  3. package/chip/index.vue.d.ts +15 -36
  4. package/circular-progress/index.vue.d.ts +4 -30
  5. package/fab/fab-group.vue.d.ts +9 -3
  6. package/fab/fab.vue.d.ts +9 -3
  7. package/fab/index.scss +11 -3
  8. package/icon/index.scss +4 -3
  9. package/icon/index.vue.d.ts +3 -22
  10. package/index.d.ts +3 -0
  11. package/index.js +28 -22
  12. package/index10.js +24 -33
  13. package/index11.js +34 -20
  14. package/index12.js +72 -46
  15. package/index13.js +19 -144
  16. package/index14.js +48 -28
  17. package/index15.js +144 -21
  18. package/index16.js +29 -24
  19. package/index17.js +19 -10
  20. package/index18.js +41 -27
  21. package/index19.js +23 -118
  22. package/index20.js +15 -9
  23. package/index21.js +33 -10
  24. package/index22.js +123 -10
  25. package/index23.js +14 -2
  26. package/index24.js +10 -2
  27. package/index25.js +10 -2
  28. package/index26.js +1 -1
  29. package/index27.js +2 -7
  30. package/index28.js +1 -1
  31. package/index29.js +7 -2
  32. package/index30.js +1 -1
  33. package/index31.js +1 -1
  34. package/index32.js +1 -1
  35. package/index33.js +1 -1
  36. package/index34.js +1 -1
  37. package/index35.js +1 -1
  38. package/index37.js +1 -1
  39. package/index38.js +1 -1
  40. package/index39.js +1 -1
  41. package/index40.js +1 -1
  42. package/index41.js +2 -66
  43. package/index42.js +2 -12
  44. package/index43.js +2 -25
  45. package/index44.js +2 -14
  46. package/index45.js +2 -5
  47. package/index46.js +2 -3
  48. package/index47.js +3 -26
  49. package/index48.js +66 -2
  50. package/index49.js +12 -506
  51. package/index50.js +24 -78
  52. package/index51.js +14 -70
  53. package/index52.js +4 -68
  54. package/index53.js +525 -542
  55. package/index54.js +26 -2
  56. package/index56.js +506 -2
  57. package/index57.js +78 -3
  58. package/index58.js +70 -2
  59. package/index59.js +69 -4
  60. package/index60.js +543 -2
  61. package/index63.js +2 -48
  62. package/index64.js +3 -81
  63. package/index66.js +4 -2
  64. package/index67.js +2 -2
  65. package/index68.js +2 -2
  66. package/index69.js +4 -0
  67. package/index7.js +7 -9
  68. package/index70.js +4 -0
  69. package/index71.js +50 -0
  70. package/index72.js +84 -0
  71. package/index73.js +4 -0
  72. package/index74.js +4 -0
  73. package/index75.js +4 -0
  74. package/index8.js +29 -17
  75. package/index9.js +19 -25
  76. package/item/index.d.ts +1 -0
  77. package/item/index.scss +40 -0
  78. package/item/index.vue.d.ts +26 -0
  79. package/lazy-render/index.vue.d.ts +13 -29
  80. package/list-header/index.scss +1 -1
  81. package/list-header/index.vue.d.ts +9 -3
  82. package/navbar/index.vue.d.ts +10 -4
  83. package/package.json +2 -2
  84. package/plugin.d.ts +0 -1
  85. package/popover/index.vue.d.ts +24 -41
  86. package/qrcode/index.d.ts +1 -0
  87. package/qrcode/index.scss +9 -0
  88. package/qrcode/index.vue.d.ts +22 -0
  89. package/qrcode/qrcodegen.d.ts +83 -0
  90. package/segment/injection.d.ts +0 -1
  91. package/segment/segment-btn.vue.d.ts +12 -16
  92. package/segment/segment.vue.d.ts +16 -20
  93. package/slider-captcha/index.vue.d.ts +7 -36
  94. package/spinner/index.scss +1 -0
  95. package/spinner/index.vue.d.ts +14 -33
  96. package/sudoku/sudoku-item.vue.d.ts +9 -3
  97. package/sudoku/sudoku.vue.d.ts +9 -3
  98. package/tabbar/index.d.ts +1 -0
  99. package/tabbar/index.scss +74 -0
  100. package/tabbar/index.vue.d.ts +38 -0
  101. package/table/_table.scss +1 -1
  102. package/table/table-cell.vue.d.ts +13 -24
  103. package/table/table-row.vue.d.ts +12 -17
  104. package/table/table.vue.d.ts +17 -43
  105. package/virtual-scroll/index.vue.d.ts +35 -74
package/index53.js CHANGED
@@ -1,545 +1,528 @@
1
- import { commonjsGlobal as X } from "./index47.js";
2
- import { __module as m } from "./index65.js";
3
- import { __require as A } from "./index49.js";
4
- import { __require as W } from "./index52.js";
5
- var B;
6
- function j() {
7
- return B ? m.exports : (B = 1, function(S, L) {
8
- (function(u, v, c) {
9
- S.exports = v(A(), W());
10
- })(X, function(u) {
11
- u.lib.Cipher || function(v) {
12
- var c = u, s = c.lib, p = s.Base, h = s.WordArray, y = s.BufferedBlockAlgorithm, x = c.enc;
13
- x.Utf8;
14
- var C = x.Base64, g = c.algo, k = g.EvpKDF, f = s.Cipher = y.extend({
15
- /**
16
- * Configuration options.
17
- *
18
- * @property {WordArray} iv The IV to use for this operation.
19
- */
20
- cfg: p.extend(),
21
- /**
22
- * Creates this cipher in encryption mode.
23
- *
24
- * @param {WordArray} key The key.
25
- * @param {Object} cfg (Optional) The configuration options to use for this operation.
26
- *
27
- * @return {Cipher} A cipher instance.
28
- *
29
- * @static
30
- *
31
- * @example
32
- *
33
- * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray });
34
- */
35
- createEncryptor: function(e, t) {
36
- return this.create(this._ENC_XFORM_MODE, e, t);
37
- },
38
- /**
39
- * Creates this cipher in decryption mode.
40
- *
41
- * @param {WordArray} key The key.
42
- * @param {Object} cfg (Optional) The configuration options to use for this operation.
43
- *
44
- * @return {Cipher} A cipher instance.
45
- *
46
- * @static
47
- *
48
- * @example
49
- *
50
- * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray });
51
- */
52
- createDecryptor: function(e, t) {
53
- return this.create(this._DEC_XFORM_MODE, e, t);
54
- },
55
- /**
56
- * Initializes a newly created cipher.
57
- *
58
- * @param {number} xformMode Either the encryption or decryption transormation mode constant.
59
- * @param {WordArray} key The key.
60
- * @param {Object} cfg (Optional) The configuration options to use for this operation.
61
- *
62
- * @example
63
- *
64
- * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray });
65
- */
66
- init: function(e, t, i) {
67
- this.cfg = this.cfg.extend(i), this._xformMode = e, this._key = t, this.reset();
68
- },
69
- /**
70
- * Resets this cipher to its initial state.
71
- *
72
- * @example
73
- *
74
- * cipher.reset();
75
- */
76
- reset: function() {
77
- y.reset.call(this), this._doReset();
78
- },
79
- /**
80
- * Adds data to be encrypted or decrypted.
81
- *
82
- * @param {WordArray|string} dataUpdate The data to encrypt or decrypt.
83
- *
84
- * @return {WordArray} The data after processing.
85
- *
86
- * @example
87
- *
88
- * var encrypted = cipher.process('data');
89
- * var encrypted = cipher.process(wordArray);
90
- */
91
- process: function(e) {
92
- return this._append(e), this._process();
93
- },
94
- /**
95
- * Finalizes the encryption or decryption process.
96
- * Note that the finalize operation is effectively a destructive, read-once operation.
97
- *
98
- * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt.
99
- *
100
- * @return {WordArray} The data after final processing.
101
- *
102
- * @example
103
- *
104
- * var encrypted = cipher.finalize();
105
- * var encrypted = cipher.finalize('data');
106
- * var encrypted = cipher.finalize(wordArray);
107
- */
108
- finalize: function(e) {
109
- e && this._append(e);
110
- var t = this._doFinalize();
111
- return t;
112
- },
113
- keySize: 128 / 32,
114
- ivSize: 128 / 32,
115
- _ENC_XFORM_MODE: 1,
116
- _DEC_XFORM_MODE: 2,
117
- /**
118
- * Creates shortcut functions to a cipher's object interface.
119
- *
120
- * @param {Cipher} cipher The cipher to create a helper for.
121
- *
122
- * @return {Object} An object with encrypt and decrypt shortcut functions.
123
- *
124
- * @static
125
- *
126
- * @example
127
- *
128
- * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES);
129
- */
130
- _createHelper: /* @__PURE__ */ function() {
131
- function e(t) {
132
- return typeof t == "string" ? q : l;
133
- }
134
- return function(t) {
135
- return {
136
- encrypt: function(i, r, n) {
137
- return e(r).encrypt(t, i, r, n);
138
- },
139
- decrypt: function(i, r, n) {
140
- return e(r).decrypt(t, i, r, n);
141
- }
142
- };
143
- };
144
- }()
145
- });
146
- s.StreamCipher = f.extend({
147
- _doFinalize: function() {
148
- var e = this._process(!0);
149
- return e;
150
- },
151
- blockSize: 1
152
- });
153
- var z = c.mode = {}, E = s.BlockCipherMode = p.extend({
154
- /**
155
- * Creates this mode for encryption.
156
- *
157
- * @param {Cipher} cipher A block cipher instance.
158
- * @param {Array} iv The IV words.
159
- *
160
- * @static
161
- *
162
- * @example
163
- *
164
- * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words);
165
- */
166
- createEncryptor: function(e, t) {
167
- return this.Encryptor.create(e, t);
168
- },
169
- /**
170
- * Creates this mode for decryption.
171
- *
172
- * @param {Cipher} cipher A block cipher instance.
173
- * @param {Array} iv The IV words.
174
- *
175
- * @static
176
- *
177
- * @example
178
- *
179
- * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words);
180
- */
181
- createDecryptor: function(e, t) {
182
- return this.Decryptor.create(e, t);
183
- },
184
- /**
185
- * Initializes a newly created mode.
186
- *
187
- * @param {Cipher} cipher A block cipher instance.
188
- * @param {Array} iv The IV words.
189
- *
190
- * @example
191
- *
192
- * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words);
193
- */
194
- init: function(e, t) {
195
- this._cipher = e, this._iv = t;
196
- }
197
- }), b = z.CBC = function() {
198
- var e = E.extend();
199
- e.Encryptor = e.extend({
200
- /**
201
- * Processes the data block at offset.
202
- *
203
- * @param {Array} words The data words to operate on.
204
- * @param {number} offset The offset where the block starts.
205
- *
206
- * @example
207
- *
208
- * mode.processBlock(data.words, offset);
209
- */
210
- processBlock: function(i, r) {
211
- var n = this._cipher, a = n.blockSize;
212
- t.call(this, i, r, a), n.encryptBlock(i, r), this._prevBlock = i.slice(r, r + a);
213
- }
214
- }), e.Decryptor = e.extend({
215
- /**
216
- * Processes the data block at offset.
217
- *
218
- * @param {Array} words The data words to operate on.
219
- * @param {number} offset The offset where the block starts.
220
- *
221
- * @example
222
- *
223
- * mode.processBlock(data.words, offset);
224
- */
225
- processBlock: function(i, r) {
226
- var n = this._cipher, a = n.blockSize, o = i.slice(r, r + a);
227
- n.decryptBlock(i, r), t.call(this, i, r, a), this._prevBlock = o;
228
- }
229
- });
230
- function t(i, r, n) {
231
- var a, o = this._iv;
232
- o ? (a = o, this._iv = v) : a = this._prevBlock;
233
- for (var d = 0; d < n; d++)
234
- i[r + d] ^= a[d];
235
- }
236
- return e;
237
- }(), D = c.pad = {}, M = D.Pkcs7 = {
238
- /**
239
- * Pads data using the algorithm defined in PKCS #5/7.
240
- *
241
- * @param {WordArray} data The data to pad.
242
- * @param {number} blockSize The multiple that the data should be padded to.
243
- *
244
- * @static
245
- *
246
- * @example
247
- *
248
- * CryptoJS.pad.Pkcs7.pad(wordArray, 4);
249
- */
250
- pad: function(e, t) {
251
- for (var i = t * 4, r = i - e.sigBytes % i, n = r << 24 | r << 16 | r << 8 | r, a = [], o = 0; o < r; o += 4)
252
- a.push(n);
253
- var d = h.create(a, r);
254
- e.concat(d);
255
- },
256
- /**
257
- * Unpads data that had been padded using the algorithm defined in PKCS #5/7.
258
- *
259
- * @param {WordArray} data The data to unpad.
260
- *
261
- * @static
262
- *
263
- * @example
264
- *
265
- * CryptoJS.pad.Pkcs7.unpad(wordArray);
266
- */
267
- unpad: function(e) {
268
- var t = e.words[e.sigBytes - 1 >>> 2] & 255;
269
- e.sigBytes -= t;
270
- }
271
- };
272
- s.BlockCipher = f.extend({
273
- /**
274
- * Configuration options.
275
- *
276
- * @property {Mode} mode The block mode to use. Default: CBC
277
- * @property {Padding} padding The padding strategy to use. Default: Pkcs7
278
- */
279
- cfg: f.cfg.extend({
280
- mode: b,
281
- padding: M
282
- }),
283
- reset: function() {
284
- var e;
285
- f.reset.call(this);
286
- var t = this.cfg, i = t.iv, r = t.mode;
287
- this._xformMode == this._ENC_XFORM_MODE ? e = r.createEncryptor : (e = r.createDecryptor, this._minBufferSize = 1), this._mode && this._mode.__creator == e ? this._mode.init(this, i && i.words) : (this._mode = e.call(r, this, i && i.words), this._mode.__creator = e);
288
- },
289
- _doProcessBlock: function(e, t) {
290
- this._mode.processBlock(e, t);
291
- },
292
- _doFinalize: function() {
293
- var e, t = this.cfg.padding;
294
- return this._xformMode == this._ENC_XFORM_MODE ? (t.pad(this._data, this.blockSize), e = this._process(!0)) : (e = this._process(!0), t.unpad(e)), e;
295
- },
296
- blockSize: 128 / 32
297
- });
298
- var _ = s.CipherParams = p.extend({
299
- /**
300
- * Initializes a newly created cipher params object.
301
- *
302
- * @param {Object} cipherParams An object with any of the possible cipher parameters.
303
- *
304
- * @example
305
- *
306
- * var cipherParams = CryptoJS.lib.CipherParams.create({
307
- * ciphertext: ciphertextWordArray,
308
- * key: keyWordArray,
309
- * iv: ivWordArray,
310
- * salt: saltWordArray,
311
- * algorithm: CryptoJS.algo.AES,
312
- * mode: CryptoJS.mode.CBC,
313
- * padding: CryptoJS.pad.PKCS7,
314
- * blockSize: 4,
315
- * formatter: CryptoJS.format.OpenSSL
316
- * });
317
- */
318
- init: function(e) {
319
- this.mixIn(e);
320
- },
321
- /**
322
- * Converts this cipher params object to a string.
323
- *
324
- * @param {Format} formatter (Optional) The formatting strategy to use.
325
- *
326
- * @return {string} The stringified cipher params.
327
- *
328
- * @throws Error If neither the formatter nor the default formatter is set.
329
- *
330
- * @example
331
- *
332
- * var string = cipherParams + '';
333
- * var string = cipherParams.toString();
334
- * var string = cipherParams.toString(CryptoJS.format.OpenSSL);
335
- */
336
- toString: function(e) {
337
- return (e || this.formatter).stringify(this);
338
- }
339
- }), O = c.format = {}, P = O.OpenSSL = {
340
- /**
341
- * Converts a cipher params object to an OpenSSL-compatible string.
342
- *
343
- * @param {CipherParams} cipherParams The cipher params object.
344
- *
345
- * @return {string} The OpenSSL-compatible string.
346
- *
347
- * @static
348
- *
349
- * @example
350
- *
351
- * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams);
352
- */
353
- stringify: function(e) {
354
- var t, i = e.ciphertext, r = e.salt;
355
- return r ? t = h.create([1398893684, 1701076831]).concat(r).concat(i) : t = i, t.toString(C);
356
- },
357
- /**
358
- * Converts an OpenSSL-compatible string to a cipher params object.
359
- *
360
- * @param {string} openSSLStr The OpenSSL-compatible string.
361
- *
362
- * @return {CipherParams} The cipher params object.
363
- *
364
- * @static
365
- *
366
- * @example
367
- *
368
- * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString);
369
- */
370
- parse: function(e) {
371
- var t, i = C.parse(e), r = i.words;
372
- return r[0] == 1398893684 && r[1] == 1701076831 && (t = h.create(r.slice(2, 4)), r.splice(0, 4), i.sigBytes -= 16), _.create({ ciphertext: i, salt: t });
373
- }
374
- }, l = s.SerializableCipher = p.extend({
375
- /**
376
- * Configuration options.
377
- *
378
- * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL
379
- */
380
- cfg: p.extend({
381
- format: P
382
- }),
383
- /**
384
- * Encrypts a message.
385
- *
386
- * @param {Cipher} cipher The cipher algorithm to use.
387
- * @param {WordArray|string} message The message to encrypt.
388
- * @param {WordArray} key The key.
389
- * @param {Object} cfg (Optional) The configuration options to use for this operation.
390
- *
391
- * @return {CipherParams} A cipher params object.
392
- *
393
- * @static
394
- *
395
- * @example
396
- *
397
- * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key);
398
- * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv });
399
- * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL });
400
- */
401
- encrypt: function(e, t, i, r) {
402
- r = this.cfg.extend(r);
403
- var n = e.createEncryptor(i, r), a = n.finalize(t), o = n.cfg;
404
- return _.create({
405
- ciphertext: a,
406
- key: i,
407
- iv: o.iv,
408
- algorithm: e,
409
- mode: o.mode,
410
- padding: o.padding,
411
- blockSize: e.blockSize,
412
- formatter: r.format
413
- });
414
- },
415
- /**
416
- * Decrypts serialized ciphertext.
417
- *
418
- * @param {Cipher} cipher The cipher algorithm to use.
419
- * @param {CipherParams|string} ciphertext The ciphertext to decrypt.
420
- * @param {WordArray} key The key.
421
- * @param {Object} cfg (Optional) The configuration options to use for this operation.
422
- *
423
- * @return {WordArray} The plaintext.
424
- *
425
- * @static
426
- *
427
- * @example
428
- *
429
- * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL });
430
- * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL });
431
- */
432
- decrypt: function(e, t, i, r) {
433
- r = this.cfg.extend(r), t = this._parse(t, r.format);
434
- var n = e.createDecryptor(i, r).finalize(t.ciphertext);
435
- return n;
436
- },
437
- /**
438
- * Converts serialized ciphertext to CipherParams,
439
- * else assumed CipherParams already and returns ciphertext unchanged.
440
- *
441
- * @param {CipherParams|string} ciphertext The ciphertext.
442
- * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext.
443
- *
444
- * @return {CipherParams} The unserialized ciphertext.
445
- *
446
- * @static
447
- *
448
- * @example
449
- *
450
- * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format);
451
- */
452
- _parse: function(e, t) {
453
- return typeof e == "string" ? t.parse(e, this) : e;
454
- }
455
- }), F = c.kdf = {}, R = F.OpenSSL = {
456
- /**
457
- * Derives a key and IV from a password.
458
- *
459
- * @param {string} password The password to derive from.
460
- * @param {number} keySize The size in words of the key to generate.
461
- * @param {number} ivSize The size in words of the IV to generate.
462
- * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly.
463
- *
464
- * @return {CipherParams} A cipher params object with the key, IV, and salt.
465
- *
466
- * @static
467
- *
468
- * @example
469
- *
470
- * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32);
471
- * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt');
472
- */
473
- execute: function(e, t, i, r, n) {
474
- if (r || (r = h.random(64 / 8)), n)
475
- var a = k.create({ keySize: t + i, hasher: n }).compute(e, r);
476
- else
477
- var a = k.create({ keySize: t + i }).compute(e, r);
478
- var o = h.create(a.words.slice(t), i * 4);
479
- return a.sigBytes = t * 4, _.create({ key: a, iv: o, salt: r });
480
- }
481
- }, q = s.PasswordBasedCipher = l.extend({
482
- /**
483
- * Configuration options.
484
- *
485
- * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL
486
- */
487
- cfg: l.cfg.extend({
488
- kdf: R
489
- }),
490
- /**
491
- * Encrypts a message using a password.
492
- *
493
- * @param {Cipher} cipher The cipher algorithm to use.
494
- * @param {WordArray|string} message The message to encrypt.
495
- * @param {string} password The password.
496
- * @param {Object} cfg (Optional) The configuration options to use for this operation.
497
- *
498
- * @return {CipherParams} A cipher params object.
499
- *
500
- * @static
501
- *
502
- * @example
503
- *
504
- * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password');
505
- * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL });
506
- */
507
- encrypt: function(e, t, i, r) {
508
- r = this.cfg.extend(r);
509
- var n = r.kdf.execute(i, e.keySize, e.ivSize, r.salt, r.hasher);
510
- r.iv = n.iv;
511
- var a = l.encrypt.call(this, e, t, n.key, r);
512
- return a.mixIn(n), a;
513
- },
514
- /**
515
- * Decrypts serialized ciphertext using a password.
516
- *
517
- * @param {Cipher} cipher The cipher algorithm to use.
518
- * @param {CipherParams|string} ciphertext The ciphertext to decrypt.
519
- * @param {string} password The password.
520
- * @param {Object} cfg (Optional) The configuration options to use for this operation.
521
- *
522
- * @return {WordArray} The plaintext.
523
- *
524
- * @static
525
- *
526
- * @example
527
- *
528
- * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL });
529
- * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL });
530
- */
531
- decrypt: function(e, t, i, r) {
532
- r = this.cfg.extend(r), t = this._parse(t, r.format);
533
- var n = r.kdf.execute(i, e.keySize, e.ivSize, t.salt, r.hasher);
534
- r.iv = n.iv;
535
- var a = l.decrypt.call(this, e, t, n.key, r);
536
- return a;
537
- }
538
- });
539
- }();
540
- });
541
- }(m), m.exports);
1
+ const r = class r {
2
+ /*-- Constructor (low level) and fields --*/
3
+ // Creates a new QR Code with the given version number,
4
+ // error correction level, data codeword bytes, and mask number.
5
+ // This is a low-level API that most users should not use directly.
6
+ // A mid-level API is the encodeSegments() function.
7
+ constructor(t, s, e, i) {
8
+ if (this.version = t, this.errorCorrectionLevel = s, this.modules = [], this.isFunction = [], t < r.MIN_VERSION || t > r.MAX_VERSION)
9
+ throw new RangeError("Version value out of range");
10
+ if (i < -1 || i > 7)
11
+ throw new RangeError("Mask value out of range");
12
+ this.size = t * 4 + 17;
13
+ const o = [];
14
+ for (let n = 0; n < this.size; n++)
15
+ o.push(!1);
16
+ for (let n = 0; n < this.size; n++)
17
+ this.modules.push(o.slice()), this.isFunction.push(o.slice());
18
+ this.drawFunctionPatterns();
19
+ const a = this.addEccAndInterleave(e);
20
+ if (this.drawCodewords(a), i == -1) {
21
+ let n = 1e9;
22
+ for (let h = 0; h < 8; h++) {
23
+ this.applyMask(h), this.drawFormatBits(h);
24
+ const l = this.getPenaltyScore();
25
+ l < n && (i = h, n = l), this.applyMask(h);
26
+ }
27
+ }
28
+ E(0 <= i && i <= 7), this.mask = i, this.applyMask(i), this.drawFormatBits(i), this.isFunction = [];
29
+ }
30
+ /*-- Static factory functions (high level) --*/
31
+ // Returns a QR Code representing the given Unicode text string at the given error correction level.
32
+ // As a conservative upper bound, this function is guaranteed to succeed for strings that have 738 or fewer
33
+ // Unicode code points (not UTF-16 code units) if the low error correction level is used. The smallest possible
34
+ // QR Code version is automatically chosen for the output. The ECC level of the result may be higher than the
35
+ // ecl argument if it can be done without increasing the version.
36
+ static encodeText(t, s) {
37
+ const e = P.makeSegments(t);
38
+ return r.encodeSegments(e, s);
39
+ }
40
+ // Returns a QR Code representing the given binary data at the given error correction level.
41
+ // This function always encodes using the binary segment mode, not any text mode. The maximum number of
42
+ // bytes allowed is 2953. The smallest possible QR Code version is automatically chosen for the output.
43
+ // The ECC level of the result may be higher than the ecl argument if it can be done without increasing the version.
44
+ static encodeBinary(t, s) {
45
+ const e = P.makeBytes(t);
46
+ return r.encodeSegments([e], s);
47
+ }
48
+ /*-- Static factory functions (mid level) --*/
49
+ // Returns a QR Code representing the given segments with the given encoding parameters.
50
+ // The smallest possible QR Code version within the given range is automatically
51
+ // chosen for the output. Iff boostEcl is true, then the ECC level of the result
52
+ // may be higher than the ecl argument if it can be done without increasing the
53
+ // version. The mask number is either between 0 to 7 (inclusive) to force that
54
+ // mask, or -1 to automatically choose an appropriate mask (which may be slow).
55
+ // This function allows the user to create a custom sequence of segments that switches
56
+ // between modes (such as alphanumeric and byte) to encode text in less space.
57
+ // This is a mid-level API; the high-level API is encodeText() and encodeBinary().
58
+ static encodeSegments(t, s, e = 1, i = 40, o = -1, a = !0) {
59
+ if (!(r.MIN_VERSION <= e && e <= i && i <= r.MAX_VERSION) || o < -1 || o > 7)
60
+ throw new RangeError("Invalid value");
61
+ let n, h;
62
+ for (n = e; ; n++) {
63
+ const c = r.getNumDataCodewords(n, s) * 8, d = P.getTotalBits(t, n);
64
+ if (d <= c) {
65
+ h = d;
66
+ break;
67
+ }
68
+ if (n >= i)
69
+ throw new RangeError("Data too long");
70
+ }
71
+ for (const c of [p.MEDIUM, p.QUARTILE, p.HIGH])
72
+ a && h <= r.getNumDataCodewords(n, c) * 8 && (s = c);
73
+ const l = [];
74
+ for (const c of t) {
75
+ f(c.mode.modeBits, 4, l), f(c.numChars, c.mode.numCharCountBits(n), l);
76
+ for (const d of c.getData())
77
+ l.push(d);
78
+ }
79
+ E(l.length == h);
80
+ const C = r.getNumDataCodewords(n, s) * 8;
81
+ E(l.length <= C), f(0, Math.min(4, C - l.length), l), f(0, (8 - l.length % 8) % 8, l), E(l.length % 8 == 0);
82
+ for (let c = 236; l.length < C; c ^= 253)
83
+ f(c, 8, l);
84
+ const M = [];
85
+ for (; M.length * 8 < l.length; )
86
+ M.push(0);
87
+ return l.forEach((c, d) => M[d >>> 3] |= c << 7 - (d & 7)), new r(n, s, M, o);
88
+ }
89
+ /*-- Accessor methods --*/
90
+ // Returns the color of the module (pixel) at the given coordinates, which is false
91
+ // for light or true for dark. The top left corner has the coordinates (x=0, y=0).
92
+ // If the given coordinates are out of bounds, then false (light) is returned.
93
+ getModule(t, s) {
94
+ return 0 <= t && t < this.size && 0 <= s && s < this.size && this.modules[s][t];
95
+ }
96
+ /*-- Private helper methods for constructor: Drawing function modules --*/
97
+ // Reads this object's version field, and draws and marks all function modules.
98
+ drawFunctionPatterns() {
99
+ for (let e = 0; e < this.size; e++)
100
+ this.setFunctionModule(6, e, e % 2 == 0), this.setFunctionModule(e, 6, e % 2 == 0);
101
+ this.drawFinderPattern(3, 3), this.drawFinderPattern(this.size - 4, 3), this.drawFinderPattern(3, this.size - 4);
102
+ const t = this.getAlignmentPatternPositions(), s = t.length;
103
+ for (let e = 0; e < s; e++)
104
+ for (let i = 0; i < s; i++)
105
+ e == 0 && i == 0 || e == 0 && i == s - 1 || e == s - 1 && i == 0 || this.drawAlignmentPattern(t[e], t[i]);
106
+ this.drawFormatBits(0), this.drawVersion();
107
+ }
108
+ // Draws two copies of the format bits (with its own error correction code)
109
+ // based on the given mask and this object's error correction level field.
110
+ drawFormatBits(t) {
111
+ const s = this.errorCorrectionLevel.formatBits << 3 | t;
112
+ let e = s;
113
+ for (let o = 0; o < 10; o++)
114
+ e = e << 1 ^ (e >>> 9) * 1335;
115
+ const i = (s << 10 | e) ^ 21522;
116
+ E(i >>> 15 == 0);
117
+ for (let o = 0; o <= 5; o++)
118
+ this.setFunctionModule(8, o, g(i, o));
119
+ this.setFunctionModule(8, 7, g(i, 6)), this.setFunctionModule(8, 8, g(i, 7)), this.setFunctionModule(7, 8, g(i, 8));
120
+ for (let o = 9; o < 15; o++)
121
+ this.setFunctionModule(14 - o, 8, g(i, o));
122
+ for (let o = 0; o < 8; o++)
123
+ this.setFunctionModule(this.size - 1 - o, 8, g(i, o));
124
+ for (let o = 8; o < 15; o++)
125
+ this.setFunctionModule(8, this.size - 15 + o, g(i, o));
126
+ this.setFunctionModule(8, this.size - 8, !0);
127
+ }
128
+ // Draws two copies of the version bits (with its own error correction code),
129
+ // based on this object's version field, iff 7 <= version <= 40.
130
+ drawVersion() {
131
+ if (this.version < 7)
132
+ return;
133
+ let t = this.version;
134
+ for (let e = 0; e < 12; e++)
135
+ t = t << 1 ^ (t >>> 11) * 7973;
136
+ const s = this.version << 12 | t;
137
+ E(s >>> 18 == 0);
138
+ for (let e = 0; e < 18; e++) {
139
+ const i = g(s, e), o = this.size - 11 + e % 3, a = Math.floor(e / 3);
140
+ this.setFunctionModule(o, a, i), this.setFunctionModule(a, o, i);
141
+ }
142
+ }
143
+ // Draws a 9*9 finder pattern including the border separator,
144
+ // with the center module at (x, y). Modules can be out of bounds.
145
+ drawFinderPattern(t, s) {
146
+ for (let e = -4; e <= 4; e++)
147
+ for (let i = -4; i <= 4; i++) {
148
+ const o = Math.max(Math.abs(i), Math.abs(e)), a = t + i, n = s + e;
149
+ 0 <= a && a < this.size && 0 <= n && n < this.size && this.setFunctionModule(a, n, o != 2 && o != 4);
150
+ }
151
+ }
152
+ // Draws a 5*5 alignment pattern, with the center module
153
+ // at (x, y). All modules must be in bounds.
154
+ drawAlignmentPattern(t, s) {
155
+ for (let e = -2; e <= 2; e++)
156
+ for (let i = -2; i <= 2; i++)
157
+ this.setFunctionModule(t + i, s + e, Math.max(Math.abs(i), Math.abs(e)) != 1);
158
+ }
159
+ // Sets the color of a module and marks it as a function module.
160
+ // Only used by the constructor. Coordinates must be in bounds.
161
+ setFunctionModule(t, s, e) {
162
+ this.modules[s][t] = e, this.isFunction[s][t] = !0;
163
+ }
164
+ /*-- Private helper methods for constructor: Codewords and masking --*/
165
+ // Returns a new byte string representing the given data with the appropriate error correction
166
+ // codewords appended to it, based on this object's version and error correction level.
167
+ addEccAndInterleave(t) {
168
+ const s = this.version, e = this.errorCorrectionLevel;
169
+ if (t.length != r.getNumDataCodewords(s, e))
170
+ throw new RangeError("Invalid argument");
171
+ const i = r.NUM_ERROR_CORRECTION_BLOCKS[e.ordinal][s], o = r.ECC_CODEWORDS_PER_BLOCK[e.ordinal][s], a = Math.floor(r.getNumRawDataModules(s) / 8), n = i - a % i, h = Math.floor(a / i), l = [], C = r.reedSolomonComputeDivisor(o);
172
+ for (let c = 0, d = 0; c < i; c++) {
173
+ const R = t.slice(d, d + h - o + (c < n ? 0 : 1));
174
+ d += R.length;
175
+ const b = r.reedSolomonComputeRemainder(R, C);
176
+ c < n && R.push(0), l.push(R.concat(b));
177
+ }
178
+ const M = [];
179
+ for (let c = 0; c < l[0].length; c++)
180
+ l.forEach((d, R) => {
181
+ (c != h - o || R >= n) && M.push(d[c]);
182
+ });
183
+ return E(M.length == a), M;
184
+ }
185
+ // Draws the given sequence of 8-bit codewords (data and error correction) onto the entire
186
+ // data area of this QR Code. Function modules need to be marked off before this is called.
187
+ drawCodewords(t) {
188
+ if (t.length != Math.floor(r.getNumRawDataModules(this.version) / 8))
189
+ throw new RangeError("Invalid argument");
190
+ let s = 0;
191
+ for (let e = this.size - 1; e >= 1; e -= 2) {
192
+ e == 6 && (e = 5);
193
+ for (let i = 0; i < this.size; i++)
194
+ for (let o = 0; o < 2; o++) {
195
+ const a = e - o, h = (e + 1 & 2) == 0 ? this.size - 1 - i : i;
196
+ !this.isFunction[h][a] && s < t.length * 8 && (this.modules[h][a] = g(t[s >>> 3], 7 - (s & 7)), s++);
197
+ }
198
+ }
199
+ E(s == t.length * 8);
200
+ }
201
+ // XORs the codeword modules in this QR Code with the given mask pattern.
202
+ // The function modules must be marked and the codeword bits must be drawn
203
+ // before masking. Due to the arithmetic of XOR, calling applyMask() with
204
+ // the same mask value a second time will undo the mask. A final well-formed
205
+ // QR Code needs exactly one (not zero, two, etc.) mask applied.
206
+ applyMask(t) {
207
+ if (t < 0 || t > 7)
208
+ throw new RangeError("Mask value out of range");
209
+ for (let s = 0; s < this.size; s++)
210
+ for (let e = 0; e < this.size; e++) {
211
+ let i;
212
+ switch (t) {
213
+ case 0:
214
+ i = (e + s) % 2 == 0;
215
+ break;
216
+ case 1:
217
+ i = s % 2 == 0;
218
+ break;
219
+ case 2:
220
+ i = e % 3 == 0;
221
+ break;
222
+ case 3:
223
+ i = (e + s) % 3 == 0;
224
+ break;
225
+ case 4:
226
+ i = (Math.floor(e / 3) + Math.floor(s / 2)) % 2 == 0;
227
+ break;
228
+ case 5:
229
+ i = e * s % 2 + e * s % 3 == 0;
230
+ break;
231
+ case 6:
232
+ i = (e * s % 2 + e * s % 3) % 2 == 0;
233
+ break;
234
+ case 7:
235
+ i = ((e + s) % 2 + e * s % 3) % 2 == 0;
236
+ break;
237
+ default:
238
+ throw new Error("Unreachable");
239
+ }
240
+ !this.isFunction[s][e] && i && (this.modules[s][e] = !this.modules[s][e]);
241
+ }
242
+ }
243
+ // Calculates and returns the penalty score based on state of this QR Code's current modules.
244
+ // This is used by the automatic mask choice algorithm to find the mask pattern that yields the lowest score.
245
+ getPenaltyScore() {
246
+ let t = 0;
247
+ for (let o = 0; o < this.size; o++) {
248
+ let a = !1, n = 0;
249
+ const h = [0, 0, 0, 0, 0, 0, 0];
250
+ for (let l = 0; l < this.size; l++)
251
+ this.modules[o][l] == a ? (n++, n == 5 ? t += r.PENALTY_N1 : n > 5 && t++) : (this.finderPenaltyAddHistory(n, h), a || (t += this.finderPenaltyCountPatterns(h) * r.PENALTY_N3), a = this.modules[o][l], n = 1);
252
+ t += this.finderPenaltyTerminateAndCount(a, n, h) * r.PENALTY_N3;
253
+ }
254
+ for (let o = 0; o < this.size; o++) {
255
+ let a = !1, n = 0;
256
+ const h = [0, 0, 0, 0, 0, 0, 0];
257
+ for (let l = 0; l < this.size; l++)
258
+ this.modules[l][o] == a ? (n++, n == 5 ? t += r.PENALTY_N1 : n > 5 && t++) : (this.finderPenaltyAddHistory(n, h), a || (t += this.finderPenaltyCountPatterns(h) * r.PENALTY_N3), a = this.modules[l][o], n = 1);
259
+ t += this.finderPenaltyTerminateAndCount(a, n, h) * r.PENALTY_N3;
260
+ }
261
+ for (let o = 0; o < this.size - 1; o++)
262
+ for (let a = 0; a < this.size - 1; a++) {
263
+ const n = this.modules[o][a];
264
+ n == this.modules[o][a + 1] && n == this.modules[o + 1][a] && n == this.modules[o + 1][a + 1] && (t += r.PENALTY_N2);
265
+ }
266
+ let s = 0;
267
+ for (const o of this.modules)
268
+ s = o.reduce((a, n) => a + (n ? 1 : 0), s);
269
+ const e = this.size * this.size, i = Math.ceil(Math.abs(s * 20 - e * 10) / e) - 1;
270
+ return E(0 <= i && i <= 9), t += i * r.PENALTY_N4, E(0 <= t && t <= 2568888), t;
271
+ }
272
+ /*-- Private helper functions --*/
273
+ // Returns an ascending list of positions of alignment patterns for this version number.
274
+ // Each position is in the range [0,177), and are used on both the x and y axes.
275
+ // This could be implemented as lookup table of 40 variable-length lists of integers.
276
+ getAlignmentPatternPositions() {
277
+ if (this.version == 1)
278
+ return [];
279
+ {
280
+ const t = Math.floor(this.version / 7) + 2, s = Math.floor((this.version * 8 + t * 3 + 5) / (t * 4 - 4)) * 2, e = [6];
281
+ for (let i = this.size - 7; e.length < t; i -= s)
282
+ e.splice(1, 0, i);
283
+ return e;
284
+ }
285
+ }
286
+ // Returns the number of data bits that can be stored in a QR Code of the given version number, after
287
+ // all function modules are excluded. This includes remainder bits, so it might not be a multiple of 8.
288
+ // The result is in the range [208, 29648]. This could be implemented as a 40-entry lookup table.
289
+ static getNumRawDataModules(t) {
290
+ if (t < r.MIN_VERSION || t > r.MAX_VERSION)
291
+ throw new RangeError("Version number out of range");
292
+ let s = (16 * t + 128) * t + 64;
293
+ if (t >= 2) {
294
+ const e = Math.floor(t / 7) + 2;
295
+ s -= (25 * e - 10) * e - 55, t >= 7 && (s -= 36);
296
+ }
297
+ return E(208 <= s && s <= 29648), s;
298
+ }
299
+ // Returns the number of 8-bit data (i.e. not error correction) codewords contained in any
300
+ // QR Code of the given version number and error correction level, with remainder bits discarded.
301
+ // This stateless pure function could be implemented as a (40*4)-cell lookup table.
302
+ static getNumDataCodewords(t, s) {
303
+ return Math.floor(r.getNumRawDataModules(t) / 8) - r.ECC_CODEWORDS_PER_BLOCK[s.ordinal][t] * r.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][t];
304
+ }
305
+ // Returns a Reed-Solomon ECC generator polynomial for the given degree. This could be
306
+ // implemented as a lookup table over all possible parameter values, instead of as an algorithm.
307
+ static reedSolomonComputeDivisor(t) {
308
+ if (t < 1 || t > 255)
309
+ throw new RangeError("Degree out of range");
310
+ const s = [];
311
+ for (let i = 0; i < t - 1; i++)
312
+ s.push(0);
313
+ s.push(1);
314
+ let e = 1;
315
+ for (let i = 0; i < t; i++) {
316
+ for (let o = 0; o < s.length; o++)
317
+ s[o] = r.reedSolomonMultiply(s[o], e), o + 1 < s.length && (s[o] ^= s[o + 1]);
318
+ e = r.reedSolomonMultiply(e, 2);
319
+ }
320
+ return s;
321
+ }
322
+ // Returns the Reed-Solomon error correction codeword for the given data and divisor polynomials.
323
+ static reedSolomonComputeRemainder(t, s) {
324
+ const e = s.map((i) => 0);
325
+ for (const i of t) {
326
+ const o = i ^ e.shift();
327
+ e.push(0), s.forEach((a, n) => e[n] ^= r.reedSolomonMultiply(a, o));
328
+ }
329
+ return e;
330
+ }
331
+ // Returns the product of the two given field elements modulo GF(2^8/0x11D). The arguments and result
332
+ // are unsigned 8-bit integers. This could be implemented as a lookup table of 256*256 entries of uint8.
333
+ static reedSolomonMultiply(t, s) {
334
+ if (t >>> 8 || s >>> 8)
335
+ throw new RangeError("Byte out of range");
336
+ let e = 0;
337
+ for (let i = 7; i >= 0; i--)
338
+ e = e << 1 ^ (e >>> 7) * 285, e ^= (s >>> i & 1) * t;
339
+ return E(e >>> 8 == 0), e;
340
+ }
341
+ // Can only be called immediately after a light run is added, and
342
+ // returns either 0, 1, or 2. A helper function for getPenaltyScore().
343
+ finderPenaltyCountPatterns(t) {
344
+ const s = t[1];
345
+ E(s <= this.size * 3);
346
+ const e = s > 0 && t[2] == s && t[3] == s * 3 && t[4] == s && t[5] == s;
347
+ return (e && t[0] >= s * 4 && t[6] >= s ? 1 : 0) + (e && t[6] >= s * 4 && t[0] >= s ? 1 : 0);
348
+ }
349
+ // Must be called at the end of a line (row or column) of modules. A helper function for getPenaltyScore().
350
+ finderPenaltyTerminateAndCount(t, s, e) {
351
+ return t && (this.finderPenaltyAddHistory(s, e), s = 0), s += this.size, this.finderPenaltyAddHistory(s, e), this.finderPenaltyCountPatterns(e);
352
+ }
353
+ // Pushes the given value to the front and drops the last value. A helper function for getPenaltyScore().
354
+ finderPenaltyAddHistory(t, s) {
355
+ s[0] == 0 && (t += this.size), s.pop(), s.unshift(t);
356
+ }
357
+ };
358
+ r.MIN_VERSION = 1, r.MAX_VERSION = 40, r.PENALTY_N1 = 3, r.PENALTY_N2 = 3, r.PENALTY_N3 = 40, r.PENALTY_N4 = 10, r.ECC_CODEWORDS_PER_BLOCK = [
359
+ // Version: (note that index 0 is for padding, and is set to an illegal value)
360
+ //0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level
361
+ [-1, 7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],
362
+ // Low
363
+ [-1, 10, 16, 26, 18, 24, 16, 18, 22, 22, 26, 30, 22, 22, 24, 24, 28, 28, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28],
364
+ // Medium
365
+ [-1, 13, 22, 18, 26, 18, 24, 18, 22, 20, 24, 28, 26, 24, 20, 30, 24, 28, 28, 26, 30, 28, 30, 30, 30, 30, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],
366
+ // Quartile
367
+ [-1, 17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30]
368
+ // High
369
+ ], r.NUM_ERROR_CORRECTION_BLOCKS = [
370
+ // Version: (note that index 0 is for padding, and is set to an illegal value)
371
+ //0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level
372
+ [-1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25],
373
+ // Low
374
+ [-1, 1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49],
375
+ // Medium
376
+ [-1, 1, 1, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 12, 16, 12, 17, 16, 18, 21, 20, 23, 23, 25, 27, 29, 34, 34, 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 62, 65, 68],
377
+ // Quartile
378
+ [-1, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81]
379
+ // High
380
+ ];
381
+ let I = r;
382
+ function f(A, t, s) {
383
+ if (t < 0 || t > 31 || A >>> t)
384
+ throw new RangeError("Value out of range");
385
+ for (let e = t - 1; e >= 0; e--)
386
+ s.push(A >>> e & 1);
387
+ }
388
+ function g(A, t) {
389
+ return (A >>> t & 1) != 0;
390
+ }
391
+ function E(A) {
392
+ if (!A)
393
+ throw new Error("Assertion error");
542
394
  }
395
+ const u = class u {
396
+ /*-- Constructor (low level) and fields --*/
397
+ // Creates a new QR Code segment with the given attributes and data.
398
+ // The character count (numChars) must agree with the mode and the bit buffer length,
399
+ // but the constraint isn't checked. The given bit buffer is cloned and stored.
400
+ constructor(t, s, e) {
401
+ if (this.mode = t, this.numChars = s, this.bitData = e, s < 0)
402
+ throw new RangeError("Invalid argument");
403
+ this.bitData = e.slice();
404
+ }
405
+ /*-- Static factory functions (mid level) --*/
406
+ // Returns a segment representing the given binary data encoded in
407
+ // byte mode. All input byte arrays are acceptable. Any text string
408
+ // can be converted to UTF-8 bytes and encoded as a byte mode segment.
409
+ static makeBytes(t) {
410
+ const s = [];
411
+ for (const e of t)
412
+ f(e, 8, s);
413
+ return new u(N.BYTE, t.length, s);
414
+ }
415
+ // Returns a segment representing the given string of decimal digits encoded in numeric mode.
416
+ static makeNumeric(t) {
417
+ if (!u.isNumeric(t))
418
+ throw new RangeError("String contains non-numeric characters");
419
+ const s = [];
420
+ for (let e = 0; e < t.length; ) {
421
+ const i = Math.min(t.length - e, 3);
422
+ f(parseInt(t.substring(e, e + i), 10), i * 3 + 1, s), e += i;
423
+ }
424
+ return new u(N.NUMERIC, t.length, s);
425
+ }
426
+ // Returns a segment representing the given text string encoded in alphanumeric mode.
427
+ // The characters allowed are: 0 to 9, A to Z (uppercase only), space,
428
+ // dollar, percent, asterisk, plus, hyphen, period, slash, colon.
429
+ static makeAlphanumeric(t) {
430
+ if (!u.isAlphanumeric(t))
431
+ throw new RangeError("String contains unencodable characters in alphanumeric mode");
432
+ const s = [];
433
+ let e;
434
+ for (e = 0; e + 2 <= t.length; e += 2) {
435
+ let i = u.ALPHANUMERIC_CHARSET.indexOf(t.charAt(e)) * 45;
436
+ i += u.ALPHANUMERIC_CHARSET.indexOf(t.charAt(e + 1)), f(i, 11, s);
437
+ }
438
+ return e < t.length && f(u.ALPHANUMERIC_CHARSET.indexOf(t.charAt(e)), 6, s), new u(N.ALPHANUMERIC, t.length, s);
439
+ }
440
+ // Returns a new mutable list of zero or more segments to represent the given Unicode text string.
441
+ // The result may use various segment modes and switch modes to optimize the length of the bit stream.
442
+ static makeSegments(t) {
443
+ return t == "" ? [] : u.isNumeric(t) ? [u.makeNumeric(t)] : u.isAlphanumeric(t) ? [u.makeAlphanumeric(t)] : [u.makeBytes(u.toUtf8ByteArray(t))];
444
+ }
445
+ // Returns a segment representing an Extended Channel Interpretation
446
+ // (ECI) designator with the given assignment value.
447
+ static makeEci(t) {
448
+ const s = [];
449
+ if (t < 0)
450
+ throw new RangeError("ECI assignment value out of range");
451
+ if (t < 128)
452
+ f(t, 8, s);
453
+ else if (t < 16384)
454
+ f(2, 2, s), f(t, 14, s);
455
+ else if (t < 1e6)
456
+ f(6, 3, s), f(t, 21, s);
457
+ else
458
+ throw new RangeError("ECI assignment value out of range");
459
+ return new u(N.ECI, 0, s);
460
+ }
461
+ // Tests whether the given string can be encoded as a segment in numeric mode.
462
+ // A string is encodable iff each character is in the range 0 to 9.
463
+ static isNumeric(t) {
464
+ return u.NUMERIC_REGEX.test(t);
465
+ }
466
+ // Tests whether the given string can be encoded as a segment in alphanumeric mode.
467
+ // A string is encodable iff each character is in the following set: 0 to 9, A to Z
468
+ // (uppercase only), space, dollar, percent, asterisk, plus, hyphen, period, slash, colon.
469
+ static isAlphanumeric(t) {
470
+ return u.ALPHANUMERIC_REGEX.test(t);
471
+ }
472
+ /*-- Methods --*/
473
+ // Returns a new copy of the data bits of this segment.
474
+ getData() {
475
+ return this.bitData.slice();
476
+ }
477
+ // (Package-private) Calculates and returns the number of bits needed to encode the given segments at
478
+ // the given version. The result is infinity if a segment has too many characters to fit its length field.
479
+ static getTotalBits(t, s) {
480
+ let e = 0;
481
+ for (const i of t) {
482
+ const o = i.mode.numCharCountBits(s);
483
+ if (i.numChars >= 1 << o)
484
+ return 1 / 0;
485
+ e += 4 + o + i.bitData.length;
486
+ }
487
+ return e;
488
+ }
489
+ // Returns a new array of bytes representing the given string encoded in UTF-8.
490
+ static toUtf8ByteArray(t) {
491
+ t = encodeURI(t);
492
+ const s = [];
493
+ for (let e = 0; e < t.length; e++)
494
+ t.charAt(e) != "%" ? s.push(t.charCodeAt(e)) : (s.push(parseInt(t.substring(e + 1, e + 3), 16)), e += 2);
495
+ return s;
496
+ }
497
+ };
498
+ u.NUMERIC_REGEX = /^[0-9]*$/, u.ALPHANUMERIC_REGEX = /^[A-Z0-9 $%*+./:-]*$/, u.ALPHANUMERIC_CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";
499
+ let P = u;
500
+ const w = class w {
501
+ // The QR Code can tolerate about 30% erroneous codewords
502
+ /*-- Constructor and fields --*/
503
+ constructor(t, s) {
504
+ this.ordinal = t, this.formatBits = s;
505
+ }
506
+ };
507
+ w.LOW = new w(0, 1), w.MEDIUM = new w(1, 0), w.QUARTILE = new w(2, 3), w.HIGH = new w(3, 2);
508
+ let p = w;
509
+ const m = class m {
510
+ /*-- Constructor and fields --*/
511
+ constructor(t, s) {
512
+ this.modeBits = t, this.numBitsCharCount = s;
513
+ }
514
+ /*-- Method --*/
515
+ // (Package-private) Returns the bit width of the character count field for a segment in
516
+ // this mode in a QR Code at the given version number. The result is in the range [0, 16].
517
+ numCharCountBits(t) {
518
+ return this.numBitsCharCount[Math.floor((t + 7) / 17)];
519
+ }
520
+ };
521
+ m.NUMERIC = new m(1, [10, 12, 14]), m.ALPHANUMERIC = new m(2, [9, 11, 13]), m.BYTE = new m(4, [8, 16, 16]), m.KANJI = new m(8, [8, 10, 12]), m.ECI = new m(7, [0, 0, 0]);
522
+ let N = m;
543
523
  export {
544
- j as __require
524
+ I as QrCode,
525
+ p as QrCodeEcc,
526
+ P as QrSegment,
527
+ N as QrSegmentMode
545
528
  };