@monerium/sdk 2.2.1 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,38 +1,21 @@
1
1
  var ne = Object.defineProperty;
2
- var oe = (e, t, o) =>
3
- t in e
4
- ? ne(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o })
5
- : (e[t] = o);
6
- var E = (e, t, o) => (oe(e, typeof t != 'symbol' ? t + '' : t, o), o),
7
- I = (e, t, o) => {
8
- if (!t.has(e)) throw TypeError('Cannot ' + o);
9
- };
10
- var U = (e, t, o) => (
11
- I(e, t, 'read from private field'), o ? o.call(e) : t.get(e)
12
- ),
13
- H = (e, t, o) => {
14
- if (t.has(e))
15
- throw TypeError('Cannot add the same private member more than once');
16
- t instanceof WeakSet ? t.add(e) : t.set(e, o);
17
- },
18
- M = (e, t, o, a) => (
19
- I(e, t, 'write to private field'), a ? a.call(e, o) : t.set(e, o), o
20
- );
21
- var B = (e, t, o) => (I(e, t, 'access private method'), o);
22
- var O =
23
- typeof globalThis < 'u'
24
- ? globalThis
25
- : typeof window < 'u'
26
- ? window
27
- : typeof global < 'u'
28
- ? global
29
- : typeof self < 'u'
30
- ? self
31
- : {};
2
+ var oe = (e, t, o) => t in e ? ne(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
3
+ var E = (e, t, o) => (oe(e, typeof t != "symbol" ? t + "" : t, o), o), I = (e, t, o) => {
4
+ if (!t.has(e))
5
+ throw TypeError("Cannot " + o);
6
+ };
7
+ var U = (e, t, o) => (I(e, t, "read from private field"), o ? o.call(e) : t.get(e)), H = (e, t, o) => {
8
+ if (t.has(e))
9
+ throw TypeError("Cannot add the same private member more than once");
10
+ t instanceof WeakSet ? t.add(e) : t.set(e, o);
11
+ }, M = (e, t, o, a) => (I(e, t, "write to private field"), a ? a.call(e, o) : t.set(e, o), o);
12
+ var B = (e, t, o) => (I(e, t, "access private method"), o);
13
+ var O = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
32
14
  function ie(e) {
33
- if (e.__esModule) return e;
15
+ if (e.__esModule)
16
+ return e;
34
17
  var t = e.default;
35
- if (typeof t == 'function') {
18
+ if (typeof t == "function") {
36
19
  var o = function a() {
37
20
  if (this instanceof a) {
38
21
  var w = [null];
@@ -43,685 +26,282 @@ function ie(e) {
43
26
  return t.apply(this, arguments);
44
27
  };
45
28
  o.prototype = t.prototype;
46
- } else o = {};
47
- return (
48
- Object.defineProperty(o, '__esModule', { value: !0 }),
49
- Object.keys(e).forEach(function (a) {
50
- var w = Object.getOwnPropertyDescriptor(e, a);
51
- Object.defineProperty(
52
- o,
53
- a,
54
- w.get
55
- ? w
56
- : {
57
- enumerable: !0,
58
- get: function () {
59
- return e[a];
60
- },
61
- },
62
- );
63
- }),
64
- o
65
- );
29
+ } else
30
+ o = {};
31
+ return Object.defineProperty(o, "__esModule", { value: !0 }), Object.keys(e).forEach(function(a) {
32
+ var w = Object.getOwnPropertyDescriptor(e, a);
33
+ Object.defineProperty(o, a, w.get ? w : {
34
+ enumerable: !0,
35
+ get: function() {
36
+ return e[a];
37
+ }
38
+ });
39
+ }), o;
66
40
  }
67
- var D = {},
68
- se = {
69
- get exports() {
70
- return D;
71
- },
72
- set exports(e) {
73
- D = e;
74
- },
75
- };
41
+ var D = {}, se = {
42
+ get exports() {
43
+ return D;
44
+ },
45
+ set exports(e) {
46
+ D = e;
47
+ }
48
+ };
76
49
  function ae(e) {
77
- throw new Error(
78
- 'Could not dynamically require "' +
79
- e +
80
- '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.',
81
- );
50
+ throw new Error('Could not dynamically require "' + e + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
82
51
  }
83
- var q = {},
84
- ce = {
85
- get exports() {
86
- return q;
87
- },
88
- set exports(e) {
89
- q = e;
90
- },
91
- };
92
- const ue = {},
93
- fe = /* @__PURE__ */ Object.freeze(
94
- /* @__PURE__ */ Object.defineProperty(
95
- {
96
- __proto__: null,
97
- default: ue,
98
- },
99
- Symbol.toStringTag,
100
- { value: 'Module' },
101
- ),
102
- ),
103
- he = /* @__PURE__ */ ie(fe);
52
+ var q = {}, ce = {
53
+ get exports() {
54
+ return q;
55
+ },
56
+ set exports(e) {
57
+ q = e;
58
+ }
59
+ };
60
+ const ue = {}, fe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
61
+ __proto__: null,
62
+ default: ue
63
+ }, Symbol.toStringTag, { value: "Module" })), he = /* @__PURE__ */ ie(fe);
104
64
  var G;
105
65
  function J() {
106
- return (
107
- G ||
108
- ((G = 1),
109
- (function (e, t) {
110
- (function (o, a) {
111
- e.exports = a();
112
- })(O, function () {
113
- var o =
114
- o ||
115
- (function (a, w) {
116
- var l;
117
- if (
118
- (typeof window < 'u' && window.crypto && (l = window.crypto),
119
- typeof self < 'u' && self.crypto && (l = self.crypto),
120
- typeof globalThis < 'u' &&
121
- globalThis.crypto &&
122
- (l = globalThis.crypto),
123
- !l &&
124
- typeof window < 'u' &&
125
- window.msCrypto &&
126
- (l = window.msCrypto),
127
- !l && typeof O < 'u' && O.crypto && (l = O.crypto),
128
- !l && typeof ae == 'function')
129
- )
130
- try {
131
- l = he;
132
- } catch {}
133
- var S = function () {
134
- if (l) {
135
- if (typeof l.getRandomValues == 'function')
136
- try {
137
- return l.getRandomValues(new Uint32Array(1))[0];
138
- } catch {}
139
- if (typeof l.randomBytes == 'function')
140
- try {
141
- return l.randomBytes(4).readInt32LE();
142
- } catch {}
143
- }
144
- throw new Error(
145
- 'Native crypto module could not be used to get secure random number.',
146
- );
147
- },
148
- P =
149
- Object.create ||
150
- (function () {
151
- function r() {}
152
- return function (n) {
153
- var s;
154
- return (
155
- (r.prototype = n),
156
- (s = new r()),
157
- (r.prototype = null),
158
- s
159
- );
160
- };
161
- })(),
162
- _ = {},
163
- C = (_.lib = {}),
164
- y = (C.Base = (function () {
165
- return {
166
- /**
167
- * Creates a new object that inherits from this object.
168
- *
169
- * @param {Object} overrides Properties to copy into the new object.
170
- *
171
- * @return {Object} The new object.
172
- *
173
- * @static
174
- *
175
- * @example
176
- *
177
- * var MyType = CryptoJS.lib.Base.extend({
178
- * field: 'value',
179
- *
180
- * method: function () {
181
- * }
182
- * });
183
- */
184
- extend: function (r) {
185
- var n = P(this);
186
- return (
187
- r && n.mixIn(r),
188
- (!n.hasOwnProperty('init') || this.init === n.init) &&
189
- (n.init = function () {
190
- n.$super.init.apply(this, arguments);
191
- }),
192
- (n.init.prototype = n),
193
- (n.$super = this),
194
- n
195
- );
196
- },
197
- /**
198
- * Extends this object and runs the init method.
199
- * Arguments to create() will be passed to init().
200
- *
201
- * @return {Object} The new object.
202
- *
203
- * @static
204
- *
205
- * @example
206
- *
207
- * var instance = MyType.create();
208
- */
209
- create: function () {
210
- var r = this.extend();
211
- return r.init.apply(r, arguments), r;
212
- },
213
- /**
214
- * Initializes a newly created object.
215
- * Override this method to add some logic when your objects are created.
216
- *
217
- * @example
218
- *
219
- * var MyType = CryptoJS.lib.Base.extend({
220
- * init: function () {
221
- * // ...
222
- * }
223
- * });
224
- */
225
- init: function () {},
226
- /**
227
- * Copies properties into this object.
228
- *
229
- * @param {Object} properties The properties to mix in.
230
- *
231
- * @example
232
- *
233
- * MyType.mixIn({
234
- * field: 'value'
235
- * });
236
- */
237
- mixIn: function (r) {
238
- for (var n in r) r.hasOwnProperty(n) && (this[n] = r[n]);
239
- r.hasOwnProperty('toString') &&
240
- (this.toString = r.toString);
241
- },
242
- /**
243
- * Creates a copy of this object.
244
- *
245
- * @return {Object} The clone.
246
- *
247
- * @example
248
- *
249
- * var clone = instance.clone();
250
- */
251
- clone: function () {
252
- return this.init.prototype.extend(this);
253
- },
254
- };
255
- })()),
256
- d = (C.WordArray = y.extend({
257
- /**
258
- * Initializes a newly created word array.
259
- *
260
- * @param {Array} words (Optional) An array of 32-bit words.
261
- * @param {number} sigBytes (Optional) The number of significant bytes in the words.
262
- *
263
- * @example
264
- *
265
- * var wordArray = CryptoJS.lib.WordArray.create();
266
- * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
267
- * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
268
- */
269
- init: function (r, n) {
270
- (r = this.words = r || []),
271
- n != w
272
- ? (this.sigBytes = n)
273
- : (this.sigBytes = r.length * 4);
274
- },
275
- /**
276
- * Converts this word array to a string.
277
- *
278
- * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
279
- *
280
- * @return {string} The stringified word array.
281
- *
282
- * @example
283
- *
284
- * var string = wordArray + '';
285
- * var string = wordArray.toString();
286
- * var string = wordArray.toString(CryptoJS.enc.Utf8);
287
- */
288
- toString: function (r) {
289
- return (r || u).stringify(this);
290
- },
291
- /**
292
- * Concatenates a word array to this word array.
293
- *
294
- * @param {WordArray} wordArray The word array to append.
295
- *
296
- * @return {WordArray} This word array.
297
- *
298
- * @example
299
- *
300
- * wordArray1.concat(wordArray2);
301
- */
302
- concat: function (r) {
303
- var n = this.words,
304
- s = r.words,
305
- c = this.sigBytes,
306
- p = r.sigBytes;
307
- if ((this.clamp(), c % 4))
308
- for (var g = 0; g < p; g++) {
309
- var m = (s[g >>> 2] >>> (24 - (g % 4) * 8)) & 255;
310
- n[(c + g) >>> 2] |= m << (24 - ((c + g) % 4) * 8);
311
- }
312
- else
313
- for (var b = 0; b < p; b += 4)
314
- n[(c + b) >>> 2] = s[b >>> 2];
315
- return (this.sigBytes += p), this;
316
- },
317
- /**
318
- * Removes insignificant bits.
319
- *
320
- * @example
321
- *
322
- * wordArray.clamp();
323
- */
324
- clamp: function () {
325
- var r = this.words,
326
- n = this.sigBytes;
327
- (r[n >>> 2] &= 4294967295 << (32 - (n % 4) * 8)),
328
- (r.length = a.ceil(n / 4));
329
- },
330
- /**
331
- * Creates a copy of this word array.
332
- *
333
- * @return {WordArray} The clone.
334
- *
335
- * @example
336
- *
337
- * var clone = wordArray.clone();
338
- */
339
- clone: function () {
340
- var r = y.clone.call(this);
341
- return (r.words = this.words.slice(0)), r;
342
- },
343
- /**
344
- * Creates a word array filled with random bytes.
345
- *
346
- * @param {number} nBytes The number of random bytes to generate.
347
- *
348
- * @return {WordArray} The random word array.
349
- *
350
- * @static
351
- *
352
- * @example
353
- *
354
- * var wordArray = CryptoJS.lib.WordArray.random(16);
355
- */
356
- random: function (r) {
357
- for (var n = [], s = 0; s < r; s += 4) n.push(S());
358
- return new d.init(n, r);
359
- },
360
- })),
361
- v = (_.enc = {}),
362
- u = (v.Hex = {
363
- /**
364
- * Converts a word array to a hex string.
365
- *
366
- * @param {WordArray} wordArray The word array.
367
- *
368
- * @return {string} The hex string.
369
- *
370
- * @static
371
- *
372
- * @example
373
- *
374
- * var hexString = CryptoJS.enc.Hex.stringify(wordArray);
375
- */
376
- stringify: function (r) {
377
- for (
378
- var n = r.words, s = r.sigBytes, c = [], p = 0;
379
- p < s;
380
- p++
381
- ) {
382
- var g = (n[p >>> 2] >>> (24 - (p % 4) * 8)) & 255;
383
- c.push((g >>> 4).toString(16)),
384
- c.push((g & 15).toString(16));
385
- }
386
- return c.join('');
387
- },
388
- /**
389
- * Converts a hex string to a word array.
390
- *
391
- * @param {string} hexStr The hex string.
392
- *
393
- * @return {WordArray} The word array.
394
- *
395
- * @static
396
- *
397
- * @example
398
- *
399
- * var wordArray = CryptoJS.enc.Hex.parse(hexString);
400
- */
401
- parse: function (r) {
402
- for (var n = r.length, s = [], c = 0; c < n; c += 2)
403
- s[c >>> 3] |=
404
- parseInt(r.substr(c, 2), 16) << (24 - (c % 8) * 4);
405
- return new d.init(s, n / 2);
406
- },
407
- }),
408
- h = (v.Latin1 = {
409
- /**
410
- * Converts a word array to a Latin1 string.
411
- *
412
- * @param {WordArray} wordArray The word array.
413
- *
414
- * @return {string} The Latin1 string.
415
- *
416
- * @static
417
- *
418
- * @example
419
- *
420
- * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
421
- */
422
- stringify: function (r) {
423
- for (
424
- var n = r.words, s = r.sigBytes, c = [], p = 0;
425
- p < s;
426
- p++
427
- ) {
428
- var g = (n[p >>> 2] >>> (24 - (p % 4) * 8)) & 255;
429
- c.push(String.fromCharCode(g));
430
- }
431
- return c.join('');
432
- },
433
- /**
434
- * Converts a Latin1 string to a word array.
435
- *
436
- * @param {string} latin1Str The Latin1 string.
437
- *
438
- * @return {WordArray} The word array.
439
- *
440
- * @static
441
- *
442
- * @example
443
- *
444
- * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
445
- */
446
- parse: function (r) {
447
- for (var n = r.length, s = [], c = 0; c < n; c++)
448
- s[c >>> 2] |=
449
- (r.charCodeAt(c) & 255) << (24 - (c % 4) * 8);
450
- return new d.init(s, n);
451
- },
452
- }),
453
- i = (v.Utf8 = {
454
- /**
455
- * Converts a word array to a UTF-8 string.
456
- *
457
- * @param {WordArray} wordArray The word array.
458
- *
459
- * @return {string} The UTF-8 string.
460
- *
461
- * @static
462
- *
463
- * @example
464
- *
465
- * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
466
- */
467
- stringify: function (r) {
468
- try {
469
- return decodeURIComponent(escape(h.stringify(r)));
470
- } catch {
471
- throw new Error('Malformed UTF-8 data');
472
- }
473
- },
474
- /**
475
- * Converts a UTF-8 string to a word array.
476
- *
477
- * @param {string} utf8Str The UTF-8 string.
478
- *
479
- * @return {WordArray} The word array.
480
- *
481
- * @static
482
- *
483
- * @example
484
- *
485
- * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
486
- */
487
- parse: function (r) {
488
- return h.parse(unescape(encodeURIComponent(r)));
489
- },
490
- }),
491
- f = (C.BufferedBlockAlgorithm = y.extend({
492
- /**
493
- * Resets this block algorithm's data buffer to its initial state.
494
- *
495
- * @example
496
- *
497
- * bufferedBlockAlgorithm.reset();
498
- */
499
- reset: function () {
500
- (this._data = new d.init()), (this._nDataBytes = 0);
501
- },
502
- /**
503
- * Adds new data to this block algorithm's buffer.
504
- *
505
- * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
506
- *
507
- * @example
508
- *
509
- * bufferedBlockAlgorithm._append('data');
510
- * bufferedBlockAlgorithm._append(wordArray);
511
- */
512
- _append: function (r) {
513
- typeof r == 'string' && (r = i.parse(r)),
514
- this._data.concat(r),
515
- (this._nDataBytes += r.sigBytes);
516
- },
517
- /**
518
- * Processes available data blocks.
519
- *
520
- * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
521
- *
522
- * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
523
- *
524
- * @return {WordArray} The processed data.
525
- *
526
- * @example
527
- *
528
- * var processedData = bufferedBlockAlgorithm._process();
529
- * var processedData = bufferedBlockAlgorithm._process(!!'flush');
530
- */
531
- _process: function (r) {
532
- var n,
533
- s = this._data,
534
- c = s.words,
535
- p = s.sigBytes,
536
- g = this.blockSize,
537
- m = g * 4,
538
- b = p / m;
539
- r
540
- ? (b = a.ceil(b))
541
- : (b = a.max((b | 0) - this._minBufferSize, 0));
542
- var z = b * g,
543
- k = a.min(z * 4, p);
544
- if (z) {
545
- for (var L = 0; L < z; L += g) this._doProcessBlock(c, L);
546
- (n = c.splice(0, z)), (s.sigBytes -= k);
547
- }
548
- return new d.init(n, k);
549
- },
550
- /**
551
- * Creates a copy of this object.
552
- *
553
- * @return {Object} The clone.
554
- *
555
- * @example
556
- *
557
- * var clone = bufferedBlockAlgorithm.clone();
558
- */
559
- clone: function () {
560
- var r = y.clone.call(this);
561
- return (r._data = this._data.clone()), r;
562
- },
563
- _minBufferSize: 0,
564
- }));
565
- C.Hasher = f.extend({
566
- /**
567
- * Configuration options.
568
- */
569
- cfg: y.extend(),
570
- /**
571
- * Initializes a newly created hasher.
572
- *
573
- * @param {Object} cfg (Optional) The configuration options to use for this hash computation.
574
- *
575
- * @example
576
- *
577
- * var hasher = CryptoJS.algo.SHA256.create();
578
- */
579
- init: function (r) {
580
- (this.cfg = this.cfg.extend(r)), this.reset();
581
- },
582
- /**
583
- * Resets this hasher to its initial state.
584
- *
585
- * @example
586
- *
587
- * hasher.reset();
588
- */
589
- reset: function () {
590
- f.reset.call(this), this._doReset();
591
- },
592
- /**
593
- * Updates this hasher with a message.
594
- *
595
- * @param {WordArray|string} messageUpdate The message to append.
596
- *
597
- * @return {Hasher} This hasher.
598
- *
599
- * @example
600
- *
601
- * hasher.update('message');
602
- * hasher.update(wordArray);
603
- */
604
- update: function (r) {
605
- return this._append(r), this._process(), this;
606
- },
607
- /**
608
- * Finalizes the hash computation.
609
- * Note that the finalize operation is effectively a destructive, read-once operation.
610
- *
611
- * @param {WordArray|string} messageUpdate (Optional) A final message update.
612
- *
613
- * @return {WordArray} The hash.
614
- *
615
- * @example
616
- *
617
- * var hash = hasher.finalize();
618
- * var hash = hasher.finalize('message');
619
- * var hash = hasher.finalize(wordArray);
620
- */
621
- finalize: function (r) {
622
- r && this._append(r);
623
- var n = this._doFinalize();
624
- return n;
625
- },
626
- blockSize: 16,
627
- /**
628
- * Creates a shortcut function to a hasher's object interface.
629
- *
630
- * @param {Hasher} hasher The hasher to create a helper for.
631
- *
632
- * @return {Function} The shortcut function.
633
- *
634
- * @static
635
- *
636
- * @example
637
- *
638
- * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
639
- */
640
- _createHelper: function (r) {
641
- return function (n, s) {
642
- return new r.init(s).finalize(n);
643
- };
644
- },
645
- /**
646
- * Creates a shortcut function to the HMAC's object interface.
647
- *
648
- * @param {Hasher} hasher The hasher to use in this HMAC helper.
649
- *
650
- * @return {Function} The shortcut function.
651
- *
652
- * @static
653
- *
654
- * @example
655
- *
656
- * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
657
- */
658
- _createHmacHelper: function (r) {
659
- return function (n, s) {
660
- return new x.HMAC.init(r, s).finalize(n);
661
- };
662
- },
663
- });
664
- var x = (_.algo = {});
665
- return _;
666
- })(Math);
667
- return o;
668
- });
669
- })(ce)),
670
- q
671
- );
672
- }
673
- (function (e, t) {
674
- (function (o, a) {
675
- e.exports = a(J());
676
- })(O, function (o) {
677
- return (
678
- (function () {
679
- var a = o,
680
- w = a.lib,
681
- l = w.WordArray,
682
- S = a.enc;
683
- S.Base64url = {
66
+ return G || (G = 1, function(e, t) {
67
+ (function(o, a) {
68
+ e.exports = a();
69
+ })(O, function() {
70
+ var o = o || function(a, w) {
71
+ var l;
72
+ if (typeof window < "u" && window.crypto && (l = window.crypto), typeof self < "u" && self.crypto && (l = self.crypto), typeof globalThis < "u" && globalThis.crypto && (l = globalThis.crypto), !l && typeof window < "u" && window.msCrypto && (l = window.msCrypto), !l && typeof O < "u" && O.crypto && (l = O.crypto), !l && typeof ae == "function")
73
+ try {
74
+ l = he;
75
+ } catch {
76
+ }
77
+ var S = function() {
78
+ if (l) {
79
+ if (typeof l.getRandomValues == "function")
80
+ try {
81
+ return l.getRandomValues(new Uint32Array(1))[0];
82
+ } catch {
83
+ }
84
+ if (typeof l.randomBytes == "function")
85
+ try {
86
+ return l.randomBytes(4).readInt32LE();
87
+ } catch {
88
+ }
89
+ }
90
+ throw new Error("Native crypto module could not be used to get secure random number.");
91
+ }, P = Object.create || function() {
92
+ function r() {
93
+ }
94
+ return function(n) {
95
+ var s;
96
+ return r.prototype = n, s = new r(), r.prototype = null, s;
97
+ };
98
+ }(), _ = {}, C = _.lib = {}, y = C.Base = function() {
99
+ return {
100
+ /**
101
+ * Creates a new object that inherits from this object.
102
+ *
103
+ * @param {Object} overrides Properties to copy into the new object.
104
+ *
105
+ * @return {Object} The new object.
106
+ *
107
+ * @static
108
+ *
109
+ * @example
110
+ *
111
+ * var MyType = CryptoJS.lib.Base.extend({
112
+ * field: 'value',
113
+ *
114
+ * method: function () {
115
+ * }
116
+ * });
117
+ */
118
+ extend: function(r) {
119
+ var n = P(this);
120
+ return r && n.mixIn(r), (!n.hasOwnProperty("init") || this.init === n.init) && (n.init = function() {
121
+ n.$super.init.apply(this, arguments);
122
+ }), n.init.prototype = n, n.$super = this, n;
123
+ },
124
+ /**
125
+ * Extends this object and runs the init method.
126
+ * Arguments to create() will be passed to init().
127
+ *
128
+ * @return {Object} The new object.
129
+ *
130
+ * @static
131
+ *
132
+ * @example
133
+ *
134
+ * var instance = MyType.create();
135
+ */
136
+ create: function() {
137
+ var r = this.extend();
138
+ return r.init.apply(r, arguments), r;
139
+ },
140
+ /**
141
+ * Initializes a newly created object.
142
+ * Override this method to add some logic when your objects are created.
143
+ *
144
+ * @example
145
+ *
146
+ * var MyType = CryptoJS.lib.Base.extend({
147
+ * init: function () {
148
+ * // ...
149
+ * }
150
+ * });
151
+ */
152
+ init: function() {
153
+ },
154
+ /**
155
+ * Copies properties into this object.
156
+ *
157
+ * @param {Object} properties The properties to mix in.
158
+ *
159
+ * @example
160
+ *
161
+ * MyType.mixIn({
162
+ * field: 'value'
163
+ * });
164
+ */
165
+ mixIn: function(r) {
166
+ for (var n in r)
167
+ r.hasOwnProperty(n) && (this[n] = r[n]);
168
+ r.hasOwnProperty("toString") && (this.toString = r.toString);
169
+ },
170
+ /**
171
+ * Creates a copy of this object.
172
+ *
173
+ * @return {Object} The clone.
174
+ *
175
+ * @example
176
+ *
177
+ * var clone = instance.clone();
178
+ */
179
+ clone: function() {
180
+ return this.init.prototype.extend(this);
181
+ }
182
+ };
183
+ }(), d = C.WordArray = y.extend({
684
184
  /**
685
- * Converts a word array to a Base64url string.
185
+ * Initializes a newly created word array.
686
186
  *
687
- * @param {WordArray} wordArray The word array.
187
+ * @param {Array} words (Optional) An array of 32-bit words.
188
+ * @param {number} sigBytes (Optional) The number of significant bytes in the words.
189
+ *
190
+ * @example
191
+ *
192
+ * var wordArray = CryptoJS.lib.WordArray.create();
193
+ * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
194
+ * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
195
+ */
196
+ init: function(r, n) {
197
+ r = this.words = r || [], n != w ? this.sigBytes = n : this.sigBytes = r.length * 4;
198
+ },
199
+ /**
200
+ * Converts this word array to a string.
688
201
  *
689
- * @param {boolean} urlSafe Whether to use url safe
202
+ * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
690
203
  *
691
- * @return {string} The Base64url string.
204
+ * @return {string} The stringified word array.
692
205
  *
693
- * @static
206
+ * @example
207
+ *
208
+ * var string = wordArray + '';
209
+ * var string = wordArray.toString();
210
+ * var string = wordArray.toString(CryptoJS.enc.Utf8);
211
+ */
212
+ toString: function(r) {
213
+ return (r || u).stringify(this);
214
+ },
215
+ /**
216
+ * Concatenates a word array to this word array.
217
+ *
218
+ * @param {WordArray} wordArray The word array to append.
219
+ *
220
+ * @return {WordArray} This word array.
694
221
  *
695
222
  * @example
696
223
  *
697
- * var base64String = CryptoJS.enc.Base64url.stringify(wordArray);
224
+ * wordArray1.concat(wordArray2);
698
225
  */
699
- stringify: function (_, C = !0) {
700
- var y = _.words,
701
- d = _.sigBytes,
702
- v = C ? this._safe_map : this._map;
703
- _.clamp();
704
- for (var u = [], h = 0; h < d; h += 3)
705
- for (
706
- var i = (y[h >>> 2] >>> (24 - (h % 4) * 8)) & 255,
707
- f = (y[(h + 1) >>> 2] >>> (24 - ((h + 1) % 4) * 8)) & 255,
708
- x = (y[(h + 2) >>> 2] >>> (24 - ((h + 2) % 4) * 8)) & 255,
709
- r = (i << 16) | (f << 8) | x,
710
- n = 0;
711
- n < 4 && h + n * 0.75 < d;
712
- n++
713
- )
714
- u.push(v.charAt((r >>> (6 * (3 - n))) & 63));
715
- var s = v.charAt(64);
716
- if (s) for (; u.length % 4; ) u.push(s);
717
- return u.join('');
226
+ concat: function(r) {
227
+ var n = this.words, s = r.words, c = this.sigBytes, p = r.sigBytes;
228
+ if (this.clamp(), c % 4)
229
+ for (var g = 0; g < p; g++) {
230
+ var m = s[g >>> 2] >>> 24 - g % 4 * 8 & 255;
231
+ n[c + g >>> 2] |= m << 24 - (c + g) % 4 * 8;
232
+ }
233
+ else
234
+ for (var b = 0; b < p; b += 4)
235
+ n[c + b >>> 2] = s[b >>> 2];
236
+ return this.sigBytes += p, this;
718
237
  },
719
238
  /**
720
- * Converts a Base64url string to a word array.
239
+ * Removes insignificant bits.
240
+ *
241
+ * @example
242
+ *
243
+ * wordArray.clamp();
244
+ */
245
+ clamp: function() {
246
+ var r = this.words, n = this.sigBytes;
247
+ r[n >>> 2] &= 4294967295 << 32 - n % 4 * 8, r.length = a.ceil(n / 4);
248
+ },
249
+ /**
250
+ * Creates a copy of this word array.
251
+ *
252
+ * @return {WordArray} The clone.
253
+ *
254
+ * @example
255
+ *
256
+ * var clone = wordArray.clone();
257
+ */
258
+ clone: function() {
259
+ var r = y.clone.call(this);
260
+ return r.words = this.words.slice(0), r;
261
+ },
262
+ /**
263
+ * Creates a word array filled with random bytes.
264
+ *
265
+ * @param {number} nBytes The number of random bytes to generate.
266
+ *
267
+ * @return {WordArray} The random word array.
268
+ *
269
+ * @static
270
+ *
271
+ * @example
272
+ *
273
+ * var wordArray = CryptoJS.lib.WordArray.random(16);
274
+ */
275
+ random: function(r) {
276
+ for (var n = [], s = 0; s < r; s += 4)
277
+ n.push(S());
278
+ return new d.init(n, r);
279
+ }
280
+ }), v = _.enc = {}, u = v.Hex = {
281
+ /**
282
+ * Converts a word array to a hex string.
283
+ *
284
+ * @param {WordArray} wordArray The word array.
721
285
  *
722
- * @param {string} base64Str The Base64url string.
286
+ * @return {string} The hex string.
723
287
  *
724
- * @param {boolean} urlSafe Whether to use url safe
288
+ * @static
289
+ *
290
+ * @example
291
+ *
292
+ * var hexString = CryptoJS.enc.Hex.stringify(wordArray);
293
+ */
294
+ stringify: function(r) {
295
+ for (var n = r.words, s = r.sigBytes, c = [], p = 0; p < s; p++) {
296
+ var g = n[p >>> 2] >>> 24 - p % 4 * 8 & 255;
297
+ c.push((g >>> 4).toString(16)), c.push((g & 15).toString(16));
298
+ }
299
+ return c.join("");
300
+ },
301
+ /**
302
+ * Converts a hex string to a word array.
303
+ *
304
+ * @param {string} hexStr The hex string.
725
305
  *
726
306
  * @return {WordArray} The word array.
727
307
  *
@@ -729,192 +309,415 @@ function J() {
729
309
  *
730
310
  * @example
731
311
  *
732
- * var wordArray = CryptoJS.enc.Base64url.parse(base64String);
312
+ * var wordArray = CryptoJS.enc.Hex.parse(hexString);
733
313
  */
734
- parse: function (_, C = !0) {
735
- var y = _.length,
736
- d = C ? this._safe_map : this._map,
737
- v = this._reverseMap;
738
- if (!v) {
739
- v = this._reverseMap = [];
740
- for (var u = 0; u < d.length; u++) v[d.charCodeAt(u)] = u;
314
+ parse: function(r) {
315
+ for (var n = r.length, s = [], c = 0; c < n; c += 2)
316
+ s[c >>> 3] |= parseInt(r.substr(c, 2), 16) << 24 - c % 8 * 4;
317
+ return new d.init(s, n / 2);
318
+ }
319
+ }, h = v.Latin1 = {
320
+ /**
321
+ * Converts a word array to a Latin1 string.
322
+ *
323
+ * @param {WordArray} wordArray The word array.
324
+ *
325
+ * @return {string} The Latin1 string.
326
+ *
327
+ * @static
328
+ *
329
+ * @example
330
+ *
331
+ * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
332
+ */
333
+ stringify: function(r) {
334
+ for (var n = r.words, s = r.sigBytes, c = [], p = 0; p < s; p++) {
335
+ var g = n[p >>> 2] >>> 24 - p % 4 * 8 & 255;
336
+ c.push(String.fromCharCode(g));
741
337
  }
742
- var h = d.charAt(64);
743
- if (h) {
744
- var i = _.indexOf(h);
745
- i !== -1 && (y = i);
338
+ return c.join("");
339
+ },
340
+ /**
341
+ * Converts a Latin1 string to a word array.
342
+ *
343
+ * @param {string} latin1Str The Latin1 string.
344
+ *
345
+ * @return {WordArray} The word array.
346
+ *
347
+ * @static
348
+ *
349
+ * @example
350
+ *
351
+ * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
352
+ */
353
+ parse: function(r) {
354
+ for (var n = r.length, s = [], c = 0; c < n; c++)
355
+ s[c >>> 2] |= (r.charCodeAt(c) & 255) << 24 - c % 4 * 8;
356
+ return new d.init(s, n);
357
+ }
358
+ }, i = v.Utf8 = {
359
+ /**
360
+ * Converts a word array to a UTF-8 string.
361
+ *
362
+ * @param {WordArray} wordArray The word array.
363
+ *
364
+ * @return {string} The UTF-8 string.
365
+ *
366
+ * @static
367
+ *
368
+ * @example
369
+ *
370
+ * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
371
+ */
372
+ stringify: function(r) {
373
+ try {
374
+ return decodeURIComponent(escape(h.stringify(r)));
375
+ } catch {
376
+ throw new Error("Malformed UTF-8 data");
746
377
  }
747
- return P(_, y, v);
748
378
  },
749
- _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
750
- _safe_map:
751
- 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_',
752
- };
753
- function P(_, C, y) {
754
- for (var d = [], v = 0, u = 0; u < C; u++)
755
- if (u % 4) {
756
- var h = y[_.charCodeAt(u - 1)] << ((u % 4) * 2),
757
- i = y[_.charCodeAt(u)] >>> (6 - (u % 4) * 2),
758
- f = h | i;
759
- (d[v >>> 2] |= f << (24 - (v % 4) * 8)), v++;
379
+ /**
380
+ * Converts a UTF-8 string to a word array.
381
+ *
382
+ * @param {string} utf8Str The UTF-8 string.
383
+ *
384
+ * @return {WordArray} The word array.
385
+ *
386
+ * @static
387
+ *
388
+ * @example
389
+ *
390
+ * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
391
+ */
392
+ parse: function(r) {
393
+ return h.parse(unescape(encodeURIComponent(r)));
394
+ }
395
+ }, f = C.BufferedBlockAlgorithm = y.extend({
396
+ /**
397
+ * Resets this block algorithm's data buffer to its initial state.
398
+ *
399
+ * @example
400
+ *
401
+ * bufferedBlockAlgorithm.reset();
402
+ */
403
+ reset: function() {
404
+ this._data = new d.init(), this._nDataBytes = 0;
405
+ },
406
+ /**
407
+ * Adds new data to this block algorithm's buffer.
408
+ *
409
+ * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
410
+ *
411
+ * @example
412
+ *
413
+ * bufferedBlockAlgorithm._append('data');
414
+ * bufferedBlockAlgorithm._append(wordArray);
415
+ */
416
+ _append: function(r) {
417
+ typeof r == "string" && (r = i.parse(r)), this._data.concat(r), this._nDataBytes += r.sigBytes;
418
+ },
419
+ /**
420
+ * Processes available data blocks.
421
+ *
422
+ * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
423
+ *
424
+ * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
425
+ *
426
+ * @return {WordArray} The processed data.
427
+ *
428
+ * @example
429
+ *
430
+ * var processedData = bufferedBlockAlgorithm._process();
431
+ * var processedData = bufferedBlockAlgorithm._process(!!'flush');
432
+ */
433
+ _process: function(r) {
434
+ var n, s = this._data, c = s.words, p = s.sigBytes, g = this.blockSize, m = g * 4, b = p / m;
435
+ r ? b = a.ceil(b) : b = a.max((b | 0) - this._minBufferSize, 0);
436
+ var z = b * g, k = a.min(z * 4, p);
437
+ if (z) {
438
+ for (var L = 0; L < z; L += g)
439
+ this._doProcessBlock(c, L);
440
+ n = c.splice(0, z), s.sigBytes -= k;
760
441
  }
761
- return l.create(d, v);
762
- }
763
- })(),
764
- o.enc.Base64url
765
- );
442
+ return new d.init(n, k);
443
+ },
444
+ /**
445
+ * Creates a copy of this object.
446
+ *
447
+ * @return {Object} The clone.
448
+ *
449
+ * @example
450
+ *
451
+ * var clone = bufferedBlockAlgorithm.clone();
452
+ */
453
+ clone: function() {
454
+ var r = y.clone.call(this);
455
+ return r._data = this._data.clone(), r;
456
+ },
457
+ _minBufferSize: 0
458
+ });
459
+ C.Hasher = f.extend({
460
+ /**
461
+ * Configuration options.
462
+ */
463
+ cfg: y.extend(),
464
+ /**
465
+ * Initializes a newly created hasher.
466
+ *
467
+ * @param {Object} cfg (Optional) The configuration options to use for this hash computation.
468
+ *
469
+ * @example
470
+ *
471
+ * var hasher = CryptoJS.algo.SHA256.create();
472
+ */
473
+ init: function(r) {
474
+ this.cfg = this.cfg.extend(r), this.reset();
475
+ },
476
+ /**
477
+ * Resets this hasher to its initial state.
478
+ *
479
+ * @example
480
+ *
481
+ * hasher.reset();
482
+ */
483
+ reset: function() {
484
+ f.reset.call(this), this._doReset();
485
+ },
486
+ /**
487
+ * Updates this hasher with a message.
488
+ *
489
+ * @param {WordArray|string} messageUpdate The message to append.
490
+ *
491
+ * @return {Hasher} This hasher.
492
+ *
493
+ * @example
494
+ *
495
+ * hasher.update('message');
496
+ * hasher.update(wordArray);
497
+ */
498
+ update: function(r) {
499
+ return this._append(r), this._process(), this;
500
+ },
501
+ /**
502
+ * Finalizes the hash computation.
503
+ * Note that the finalize operation is effectively a destructive, read-once operation.
504
+ *
505
+ * @param {WordArray|string} messageUpdate (Optional) A final message update.
506
+ *
507
+ * @return {WordArray} The hash.
508
+ *
509
+ * @example
510
+ *
511
+ * var hash = hasher.finalize();
512
+ * var hash = hasher.finalize('message');
513
+ * var hash = hasher.finalize(wordArray);
514
+ */
515
+ finalize: function(r) {
516
+ r && this._append(r);
517
+ var n = this._doFinalize();
518
+ return n;
519
+ },
520
+ blockSize: 16,
521
+ /**
522
+ * Creates a shortcut function to a hasher's object interface.
523
+ *
524
+ * @param {Hasher} hasher The hasher to create a helper for.
525
+ *
526
+ * @return {Function} The shortcut function.
527
+ *
528
+ * @static
529
+ *
530
+ * @example
531
+ *
532
+ * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
533
+ */
534
+ _createHelper: function(r) {
535
+ return function(n, s) {
536
+ return new r.init(s).finalize(n);
537
+ };
538
+ },
539
+ /**
540
+ * Creates a shortcut function to the HMAC's object interface.
541
+ *
542
+ * @param {Hasher} hasher The hasher to use in this HMAC helper.
543
+ *
544
+ * @return {Function} The shortcut function.
545
+ *
546
+ * @static
547
+ *
548
+ * @example
549
+ *
550
+ * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
551
+ */
552
+ _createHmacHelper: function(r) {
553
+ return function(n, s) {
554
+ return new x.HMAC.init(r, s).finalize(n);
555
+ };
556
+ }
557
+ });
558
+ var x = _.algo = {};
559
+ return _;
560
+ }(Math);
561
+ return o;
562
+ });
563
+ }(ce)), q;
564
+ }
565
+ (function(e, t) {
566
+ (function(o, a) {
567
+ e.exports = a(J());
568
+ })(O, function(o) {
569
+ return function() {
570
+ var a = o, w = a.lib, l = w.WordArray, S = a.enc;
571
+ S.Base64url = {
572
+ /**
573
+ * Converts a word array to a Base64url string.
574
+ *
575
+ * @param {WordArray} wordArray The word array.
576
+ *
577
+ * @param {boolean} urlSafe Whether to use url safe
578
+ *
579
+ * @return {string} The Base64url string.
580
+ *
581
+ * @static
582
+ *
583
+ * @example
584
+ *
585
+ * var base64String = CryptoJS.enc.Base64url.stringify(wordArray);
586
+ */
587
+ stringify: function(_, C = !0) {
588
+ var y = _.words, d = _.sigBytes, v = C ? this._safe_map : this._map;
589
+ _.clamp();
590
+ for (var u = [], h = 0; h < d; h += 3)
591
+ for (var i = y[h >>> 2] >>> 24 - h % 4 * 8 & 255, f = y[h + 1 >>> 2] >>> 24 - (h + 1) % 4 * 8 & 255, x = y[h + 2 >>> 2] >>> 24 - (h + 2) % 4 * 8 & 255, r = i << 16 | f << 8 | x, n = 0; n < 4 && h + n * 0.75 < d; n++)
592
+ u.push(v.charAt(r >>> 6 * (3 - n) & 63));
593
+ var s = v.charAt(64);
594
+ if (s)
595
+ for (; u.length % 4; )
596
+ u.push(s);
597
+ return u.join("");
598
+ },
599
+ /**
600
+ * Converts a Base64url string to a word array.
601
+ *
602
+ * @param {string} base64Str The Base64url string.
603
+ *
604
+ * @param {boolean} urlSafe Whether to use url safe
605
+ *
606
+ * @return {WordArray} The word array.
607
+ *
608
+ * @static
609
+ *
610
+ * @example
611
+ *
612
+ * var wordArray = CryptoJS.enc.Base64url.parse(base64String);
613
+ */
614
+ parse: function(_, C = !0) {
615
+ var y = _.length, d = C ? this._safe_map : this._map, v = this._reverseMap;
616
+ if (!v) {
617
+ v = this._reverseMap = [];
618
+ for (var u = 0; u < d.length; u++)
619
+ v[d.charCodeAt(u)] = u;
620
+ }
621
+ var h = d.charAt(64);
622
+ if (h) {
623
+ var i = _.indexOf(h);
624
+ i !== -1 && (y = i);
625
+ }
626
+ return P(_, y, v);
627
+ },
628
+ _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
629
+ _safe_map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
630
+ };
631
+ function P(_, C, y) {
632
+ for (var d = [], v = 0, u = 0; u < C; u++)
633
+ if (u % 4) {
634
+ var h = y[_.charCodeAt(u - 1)] << u % 4 * 2, i = y[_.charCodeAt(u)] >>> 6 - u % 4 * 2, f = h | i;
635
+ d[v >>> 2] |= f << 24 - v % 4 * 8, v++;
636
+ }
637
+ return l.create(d, v);
638
+ }
639
+ }(), o.enc.Base64url;
766
640
  });
767
641
  })(se);
768
- var V = {},
769
- le = {
770
- get exports() {
771
- return V;
772
- },
773
- set exports(e) {
774
- V = e;
775
- },
776
- };
777
- (function (e, t) {
778
- (function (o, a) {
642
+ var V = {}, le = {
643
+ get exports() {
644
+ return V;
645
+ },
646
+ set exports(e) {
647
+ V = e;
648
+ }
649
+ };
650
+ (function(e, t) {
651
+ (function(o, a) {
779
652
  e.exports = a(J());
780
- })(O, function (o) {
781
- return (
782
- (function (a) {
783
- var w = o,
784
- l = w.lib,
785
- S = l.WordArray,
786
- P = l.Hasher,
787
- _ = w.algo,
788
- C = [],
789
- y = [];
790
- (function () {
791
- function u(x) {
792
- for (var r = a.sqrt(x), n = 2; n <= r; n++) if (!(x % n)) return !1;
793
- return !0;
794
- }
795
- function h(x) {
796
- return ((x - (x | 0)) * 4294967296) | 0;
653
+ })(O, function(o) {
654
+ return function(a) {
655
+ var w = o, l = w.lib, S = l.WordArray, P = l.Hasher, _ = w.algo, C = [], y = [];
656
+ (function() {
657
+ function u(x) {
658
+ for (var r = a.sqrt(x), n = 2; n <= r; n++)
659
+ if (!(x % n))
660
+ return !1;
661
+ return !0;
662
+ }
663
+ function h(x) {
664
+ return (x - (x | 0)) * 4294967296 | 0;
665
+ }
666
+ for (var i = 2, f = 0; f < 64; )
667
+ u(i) && (f < 8 && (C[f] = h(a.pow(i, 1 / 2))), y[f] = h(a.pow(i, 1 / 3)), f++), i++;
668
+ })();
669
+ var d = [], v = _.SHA256 = P.extend({
670
+ _doReset: function() {
671
+ this._hash = new S.init(C.slice(0));
672
+ },
673
+ _doProcessBlock: function(u, h) {
674
+ for (var i = this._hash.words, f = i[0], x = i[1], r = i[2], n = i[3], s = i[4], c = i[5], p = i[6], g = i[7], m = 0; m < 64; m++) {
675
+ if (m < 16)
676
+ d[m] = u[h + m] | 0;
677
+ else {
678
+ var b = d[m - 15], z = (b << 25 | b >>> 7) ^ (b << 14 | b >>> 18) ^ b >>> 3, k = d[m - 2], L = (k << 15 | k >>> 17) ^ (k << 13 | k >>> 19) ^ k >>> 10;
679
+ d[m] = z + d[m - 7] + L + d[m - 16];
680
+ }
681
+ var K = s & c ^ ~s & p, Y = f & x ^ f & r ^ x & r, ee = (f << 30 | f >>> 2) ^ (f << 19 | f >>> 13) ^ (f << 10 | f >>> 22), re = (s << 26 | s >>> 6) ^ (s << 21 | s >>> 11) ^ (s << 7 | s >>> 25), N = g + re + K + y[m] + d[m], te = ee + Y;
682
+ g = p, p = c, c = s, s = n + N | 0, n = r, r = x, x = f, f = N + te | 0;
797
683
  }
798
- for (var i = 2, f = 0; f < 64; )
799
- u(i) &&
800
- (f < 8 && (C[f] = h(a.pow(i, 1 / 2))),
801
- (y[f] = h(a.pow(i, 1 / 3))),
802
- f++),
803
- i++;
804
- })();
805
- var d = [],
806
- v = (_.SHA256 = P.extend({
807
- _doReset: function () {
808
- this._hash = new S.init(C.slice(0));
809
- },
810
- _doProcessBlock: function (u, h) {
811
- for (
812
- var i = this._hash.words,
813
- f = i[0],
814
- x = i[1],
815
- r = i[2],
816
- n = i[3],
817
- s = i[4],
818
- c = i[5],
819
- p = i[6],
820
- g = i[7],
821
- m = 0;
822
- m < 64;
823
- m++
824
- ) {
825
- if (m < 16) d[m] = u[h + m] | 0;
826
- else {
827
- var b = d[m - 15],
828
- z =
829
- ((b << 25) | (b >>> 7)) ^
830
- ((b << 14) | (b >>> 18)) ^
831
- (b >>> 3),
832
- k = d[m - 2],
833
- L =
834
- ((k << 15) | (k >>> 17)) ^
835
- ((k << 13) | (k >>> 19)) ^
836
- (k >>> 10);
837
- d[m] = z + d[m - 7] + L + d[m - 16];
838
- }
839
- var K = (s & c) ^ (~s & p),
840
- Y = (f & x) ^ (f & r) ^ (x & r),
841
- ee =
842
- ((f << 30) | (f >>> 2)) ^
843
- ((f << 19) | (f >>> 13)) ^
844
- ((f << 10) | (f >>> 22)),
845
- re =
846
- ((s << 26) | (s >>> 6)) ^
847
- ((s << 21) | (s >>> 11)) ^
848
- ((s << 7) | (s >>> 25)),
849
- N = g + re + K + y[m] + d[m],
850
- te = ee + Y;
851
- (g = p),
852
- (p = c),
853
- (c = s),
854
- (s = (n + N) | 0),
855
- (n = r),
856
- (r = x),
857
- (x = f),
858
- (f = (N + te) | 0);
859
- }
860
- (i[0] = (i[0] + f) | 0),
861
- (i[1] = (i[1] + x) | 0),
862
- (i[2] = (i[2] + r) | 0),
863
- (i[3] = (i[3] + n) | 0),
864
- (i[4] = (i[4] + s) | 0),
865
- (i[5] = (i[5] + c) | 0),
866
- (i[6] = (i[6] + p) | 0),
867
- (i[7] = (i[7] + g) | 0);
868
- },
869
- _doFinalize: function () {
870
- var u = this._data,
871
- h = u.words,
872
- i = this._nDataBytes * 8,
873
- f = u.sigBytes * 8;
874
- return (
875
- (h[f >>> 5] |= 128 << (24 - (f % 32))),
876
- (h[(((f + 64) >>> 9) << 4) + 14] = a.floor(i / 4294967296)),
877
- (h[(((f + 64) >>> 9) << 4) + 15] = i),
878
- (u.sigBytes = h.length * 4),
879
- this._process(),
880
- this._hash
881
- );
882
- },
883
- clone: function () {
884
- var u = P.clone.call(this);
885
- return (u._hash = this._hash.clone()), u;
886
- },
887
- }));
888
- (w.SHA256 = P._createHelper(v)),
889
- (w.HmacSHA256 = P._createHmacHelper(v));
890
- })(Math),
891
- o.SHA256
892
- );
684
+ i[0] = i[0] + f | 0, i[1] = i[1] + x | 0, i[2] = i[2] + r | 0, i[3] = i[3] + n | 0, i[4] = i[4] + s | 0, i[5] = i[5] + c | 0, i[6] = i[6] + p | 0, i[7] = i[7] + g | 0;
685
+ },
686
+ _doFinalize: function() {
687
+ var u = this._data, h = u.words, i = this._nDataBytes * 8, f = u.sigBytes * 8;
688
+ return h[f >>> 5] |= 128 << 24 - f % 32, h[(f + 64 >>> 9 << 4) + 14] = a.floor(i / 4294967296), h[(f + 64 >>> 9 << 4) + 15] = i, u.sigBytes = h.length * 4, this._process(), this._hash;
689
+ },
690
+ clone: function() {
691
+ var u = P.clone.call(this);
692
+ return u._hash = this._hash.clone(), u;
693
+ }
694
+ });
695
+ w.SHA256 = P._createHelper(v), w.HmacSHA256 = P._createHmacHelper(v);
696
+ }(Math), o.SHA256;
893
697
  });
894
698
  })(le);
895
699
  const de = () => {
896
- let e = '';
897
- const t = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',
898
- o = t.length;
899
- let a = 0;
900
- for (; a < 128; ) (e += t.charAt(Math.floor(Math.random() * o))), (a += 1);
901
- return e;
902
- },
903
- pe = {
904
- environments: {
905
- production: {
906
- api: 'https://api.monerium.app',
907
- web: 'https://monerium.app',
908
- },
909
- sandbox: {
910
- api: 'https://api.monerium.dev',
911
- web: 'https://sandbox.monerium.dev',
912
- },
700
+ let e = "";
701
+ const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", o = t.length;
702
+ let a = 0;
703
+ for (; a < 128; )
704
+ e += t.charAt(Math.floor(Math.random() * o)), a += 1;
705
+ return e;
706
+ }, pe = {
707
+ environments: {
708
+ production: {
709
+ api: "https://api.monerium.app",
710
+ web: "https://monerium.app"
913
711
  },
914
- };
712
+ sandbox: {
713
+ api: "https://api.monerium.dev",
714
+ web: "https://sandbox.monerium.dev"
715
+ }
716
+ }
717
+ };
915
718
  var $, W, A, R, T, Q, j, X, F, Z;
916
719
  class Re {
917
- constructor(t = 'sandbox') {
720
+ constructor(t = "sandbox") {
918
721
  // -- Helper Methods
919
722
  H(this, A);
920
723
  H(this, T);
@@ -923,35 +726,26 @@ class Re {
923
726
  H(this, $, void 0);
924
727
  H(this, W, void 0);
925
728
  /** The PKCE code verifier */
926
- E(this, 'codeVerifier');
927
- E(this, 'bearerProfile');
729
+ E(this, "codeVerifier");
730
+ E(this, "bearerProfile");
928
731
  /**
929
732
  * @deprecated since v2.0.7, use {@link getAuthFlowURI} instead.
930
733
  */
931
- E(this, 'pkceRequest', (t) => this.getAuthFlowURI(t));
734
+ E(this, "pkceRequest", (t) => this.getAuthFlowURI(t));
932
735
  M(this, $, pe.environments[t]);
933
736
  }
934
737
  // -- Authentication
935
738
  async auth(t) {
936
739
  let o;
937
740
  if (B(this, T, Q).call(this, t))
938
- o = { ...t, grant_type: 'authorization_code' };
741
+ o = { ...t, grant_type: "authorization_code" };
939
742
  else if (B(this, j, X).call(this, t))
940
- o = { ...t, grant_type: 'refresh_token' };
743
+ o = { ...t, grant_type: "refresh_token" };
941
744
  else if (B(this, F, Z).call(this, t))
942
- o = { ...t, grant_type: 'client_credentials' };
943
- else throw new Error('Authentication method could not be detected.');
944
- return (
945
- (this.bearerProfile = await B(this, A, R).call(
946
- this,
947
- 'post',
948
- 'auth/token',
949
- new URLSearchParams(o),
950
- !0,
951
- )),
952
- M(this, W, `Bearer ${this.bearerProfile.access_token}`),
953
- this.bearerProfile
954
- );
745
+ o = { ...t, grant_type: "client_credentials" };
746
+ else
747
+ throw new Error("Authentication method could not be detected.");
748
+ return this.bearerProfile = await B(this, A, R).call(this, "post", "auth/token", new URLSearchParams(o), !0), M(this, W, `Bearer ${this.bearerProfile.access_token}`), this.bearerProfile;
955
749
  }
956
750
  /**
957
751
  * Construct the url to the authorization code flow,
@@ -961,147 +755,86 @@ class Re {
961
755
  */
962
756
  getAuthFlowURI(t) {
963
757
  this.codeVerifier = de();
964
- const o = D.stringify(V(this.codeVerifier)),
965
- a = {
966
- ...t,
967
- client_id: t == null ? void 0 : t.client_id,
968
- code_challenge: o,
969
- code_challenge_method: 'S256',
970
- response_type: 'code',
971
- };
758
+ const o = D.stringify(
759
+ V(this.codeVerifier)
760
+ ), a = {
761
+ ...t,
762
+ client_id: t == null ? void 0 : t.client_id,
763
+ code_challenge: o,
764
+ code_challenge_method: "S256",
765
+ response_type: "code"
766
+ };
972
767
  return `${U(this, $).api}/auth?${new URLSearchParams(a)}`;
973
768
  }
974
769
  // -- Read Methods
975
770
  getAuthContext() {
976
- return B(this, A, R).call(this, 'get', 'auth/context');
771
+ return B(this, A, R).call(this, "get", "auth/context");
977
772
  }
978
773
  /**
979
774
  * @param {string} profileId - the id of the profile to fetch.
980
775
  */
981
776
  getProfile(t) {
982
- return B(this, A, R).call(this, 'get', `profiles/${t}`);
777
+ return B(this, A, R).call(this, "get", `profiles/${t}`);
983
778
  }
984
779
  /**
985
780
  * @param {string=} profileId - the id of the profile to fetch balances.
986
781
  */
987
782
  getBalances(t) {
988
- return t
989
- ? B(this, A, R).call(this, 'get', `profiles/${t}/balances`)
990
- : B(this, A, R).call(this, 'get', 'balances');
783
+ return t ? B(this, A, R).call(this, "get", `profiles/${t}/balances`) : B(this, A, R).call(this, "get", "balances");
991
784
  }
992
785
  getOrders(t) {
993
- const o = new URLSearchParams(t);
994
- return B(this, A, R).call(this, 'get', `orders?${o}`);
786
+ const o = new URLSearchParams(
787
+ t
788
+ );
789
+ return B(this, A, R).call(this, "get", `orders?${o}`);
995
790
  }
996
791
  getOrder(t) {
997
- return B(this, A, R).call(this, 'get', `orders/${t}`);
792
+ return B(this, A, R).call(this, "get", `orders/${t}`);
998
793
  }
999
794
  getTokens() {
1000
- return B(this, A, R).call(this, 'get', 'tokens');
795
+ return B(this, A, R).call(this, "get", "tokens");
1001
796
  }
1002
797
  // -- Write Methods
1003
798
  linkAddress(t, o) {
1004
- return B(this, A, R).call(
1005
- this,
1006
- 'post',
1007
- `profiles/${t}/addresses`,
1008
- JSON.stringify(o),
1009
- );
799
+ return B(this, A, R).call(this, "post", `profiles/${t}/addresses`, JSON.stringify(o));
1010
800
  }
1011
801
  placeOrder(t, o) {
1012
- return o
1013
- ? B(this, A, R).call(
1014
- this,
1015
- 'post',
1016
- `profiles/${o}/orders`,
1017
- JSON.stringify(t),
1018
- )
1019
- : B(this, A, R).call(this, 'post', 'orders', JSON.stringify(t));
802
+ return o ? B(this, A, R).call(this, "post", `profiles/${o}/orders`, JSON.stringify(t)) : B(this, A, R).call(this, "post", "orders", JSON.stringify(t));
1020
803
  }
1021
804
  uploadSupportingDocument(t) {
1022
- const o = new URLSearchParams(t);
1023
- return B(this, A, R).call(this, 'post', 'files/supporting-document', o, !0);
805
+ const o = new URLSearchParams(
806
+ t
807
+ );
808
+ return B(this, A, R).call(this, "post", "files/supporting-document", o, !0);
1024
809
  }
1025
810
  }
1026
- ($ = new WeakMap()),
1027
- (W = new WeakMap()),
1028
- (A = new WeakSet()),
1029
- (R = async function (t, o, a, w) {
1030
- const l = await fetch(`${U(this, $).api}/${o}`, {
1031
- method: t,
1032
- headers: {
1033
- 'Content-Type': `application/${w ? 'x-www-form-urlencoded' : 'json'}`,
1034
- Authorization: U(this, W) || '',
1035
- // "User-Agent": "sdk/" + pjson.version,
1036
- },
1037
- body: a,
1038
- });
1039
- let S;
1040
- try {
1041
- S = await l.json();
1042
- } catch {
1043
- throw await l.text();
1044
- }
1045
- if (l.ok) return S;
1046
- throw S;
1047
- }),
1048
- (T = new WeakSet()),
1049
- (Q = function (t) {
1050
- return t.code != null;
1051
- }),
1052
- (j = new WeakSet()),
1053
- (X = function (t) {
1054
- return t.refresh_token != null;
1055
- }),
1056
- (F = new WeakSet()),
1057
- (Z = function (t) {
1058
- return t.client_secret != null;
811
+ $ = new WeakMap(), W = new WeakMap(), A = new WeakSet(), R = async function(t, o, a, w) {
812
+ const l = await fetch(`${U(this, $).api}/${o}`, {
813
+ method: t,
814
+ headers: {
815
+ "Content-Type": `application/${w ? "x-www-form-urlencoded" : "json"}`,
816
+ Authorization: U(this, W) || ""
817
+ // "User-Agent": "sdk/" + pjson.version,
818
+ },
819
+ body: a
1059
820
  });
1060
- var ve = /* @__PURE__ */ ((e) => (
1061
- (e.eur = 'eur'), (e.usd = 'usd'), (e.gbp = 'gbp'), (e.isk = 'isk'), e
1062
- ))(ve || {}),
1063
- ge = /* @__PURE__ */ ((e) => (
1064
- (e.corporate = 'corporate'), (e.personal = 'personal'), e
1065
- ))(ge || {}),
1066
- ye = /* @__PURE__ */ ((e) => ((e.read = 'read'), (e.write = 'write'), e))(
1067
- ye || {},
1068
- ),
1069
- we = /* @__PURE__ */ ((e) => (
1070
- (e.absent = 'absent'),
1071
- (e.submitted = 'submitted'),
1072
- (e.pending = 'pending'),
1073
- (e.confirmed = 'confirmed'),
1074
- e
1075
- ))(we || {}),
1076
- _e = /* @__PURE__ */ ((e) => (
1077
- (e.approved = 'approved'),
1078
- (e.rejected = 'rejected'),
1079
- (e.unknown = 'unknown'),
1080
- e
1081
- ))(_e || {}),
1082
- me = /* @__PURE__ */ ((e) => ((e.iban = 'iban'), (e.scan = 'scan'), e))(
1083
- me || {},
1084
- ),
1085
- be = /* @__PURE__ */ ((e) => (
1086
- (e.polygon = 'polygon'), (e.ethereum = 'ethereum'), (e.gnosis = 'gnosis'), e
1087
- ))(be || {}),
1088
- Be = /* @__PURE__ */ ((e) => (
1089
- (e.mainnet = 'mainnet'),
1090
- (e.chiado = 'chiado'),
1091
- (e.goerli = 'goerli'),
1092
- (e.mumbai = 'mumbai'),
1093
- e
1094
- ))(Be || {}),
1095
- xe = /* @__PURE__ */ ((e) => ((e.redeem = 'redeem'), (e.issue = 'issue'), e))(
1096
- xe || {},
1097
- ),
1098
- Ae = /* @__PURE__ */ ((e) => (
1099
- (e.placed = 'placed'),
1100
- (e.pending = 'pending'),
1101
- (e.processed = 'processed'),
1102
- (e.rejected = 'rejected'),
1103
- e
1104
- ))(Ae || {});
821
+ let S;
822
+ try {
823
+ S = await l.json();
824
+ } catch {
825
+ throw await l.text();
826
+ }
827
+ if (l.ok)
828
+ return S;
829
+ throw S;
830
+ }, T = new WeakSet(), Q = function(t) {
831
+ return t.code != null;
832
+ }, j = new WeakSet(), X = function(t) {
833
+ return t.refresh_token != null;
834
+ }, F = new WeakSet(), Z = function(t) {
835
+ return t.client_secret != null;
836
+ };
837
+ var ve = /* @__PURE__ */ ((e) => (e.eur = "eur", e.usd = "usd", e.gbp = "gbp", e.isk = "isk", e))(ve || {}), ge = /* @__PURE__ */ ((e) => (e.corporate = "corporate", e.personal = "personal", e))(ge || {}), ye = /* @__PURE__ */ ((e) => (e.read = "read", e.write = "write", e))(ye || {}), we = /* @__PURE__ */ ((e) => (e.absent = "absent", e.submitted = "submitted", e.pending = "pending", e.confirmed = "confirmed", e))(we || {}), _e = /* @__PURE__ */ ((e) => (e.approved = "approved", e.rejected = "rejected", e.unknown = "unknown", e))(_e || {}), me = /* @__PURE__ */ ((e) => (e.iban = "iban", e.scan = "scan", e))(me || {}), be = /* @__PURE__ */ ((e) => (e.polygon = "polygon", e.ethereum = "ethereum", e.gnosis = "gnosis", e))(be || {}), Be = /* @__PURE__ */ ((e) => (e.mainnet = "mainnet", e.chiado = "chiado", e.goerli = "goerli", e.mumbai = "mumbai", e))(Be || {}), xe = /* @__PURE__ */ ((e) => (e.redeem = "redeem", e.issue = "issue", e))(xe || {}), Ae = /* @__PURE__ */ ((e) => (e.placed = "placed", e.pending = "pending", e.processed = "processed", e.rejected = "rejected", e))(Ae || {});
1105
838
  export {
1106
839
  be as Chain,
1107
840
  ve as Currency,
@@ -1113,6 +846,6 @@ export {
1113
846
  Ae as OrderState,
1114
847
  me as PaymentStandard,
1115
848
  ye as Permission,
1116
- ge as ProfileType,
849
+ ge as ProfileType
1117
850
  };
1118
851
  //# sourceMappingURL=index.mjs.map