@leofcoin/peernet 1.1.101 → 1.1.103
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/exports/browser/{browser-nu3nKt2I.js → browser-CfYI-6aD.js} +1 -1
- package/exports/browser/{browser-Cjcx-T47.js → browser-Qcpp3EKK.js} +1 -1
- package/exports/browser/{client-C6OfbHKI.js → client-icdGX62_.js} +25 -37
- package/exports/browser/{identity-Cn0iQbY3.js → identity-nIyW_Xm8.js} +106 -106
- package/exports/browser/identity.js +1 -1
- package/exports/browser/{index-Biyfi3Iw.js → index-ChRjMyiM.js} +1 -1
- package/exports/browser/{index-CPXJrMI6.js → index-DTbjK0sK.js} +33 -33
- package/exports/browser/{messages-DYI_YkZS.js → messages-BzsDq0Y4.js} +2 -2
- package/exports/browser/{peernet-CnZz_eNn.js → peernet-BV-q4kmL.js} +3 -3
- package/exports/browser/peernet.js +2 -2
- package/package.json +9 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LittlePubSub } from './peernet-
|
|
2
|
-
import './identity-
|
|
1
|
+
import { L as LittlePubSub } from './peernet-BV-q4kmL.js';
|
|
2
|
+
import './identity-nIyW_Xm8.js';
|
|
3
3
|
import './value-C3vAp-wb.js';
|
|
4
4
|
|
|
5
5
|
class Api {
|
|
@@ -231,7 +231,7 @@ class SocketRequestClient {
|
|
|
231
231
|
const init = async () => {
|
|
232
232
|
// @ts-ignore
|
|
233
233
|
if (!globalThis.WebSocket && !this.#experimentalWebsocket)
|
|
234
|
-
globalThis.WebSocket = (await import('./browser-
|
|
234
|
+
globalThis.WebSocket = (await import('./browser-CfYI-6aD.js').then(function (n) { return n.b; })).default.w3cwebsocket;
|
|
235
235
|
const client = new WebSocket(this.#url, this.#protocol);
|
|
236
236
|
if (this.#experimentalWebsocket) {
|
|
237
237
|
client.addEventListener('error', this.onerror);
|
|
@@ -335,7 +335,7 @@ const iceServers = [
|
|
|
335
335
|
credential: 'openrelayproject'
|
|
336
336
|
}
|
|
337
337
|
];
|
|
338
|
-
const SimplePeer = (await import('./index-
|
|
338
|
+
const SimplePeer = (await import('./index-DTbjK0sK.js').then(function (n) { return n.i; })).default;
|
|
339
339
|
class Peer extends SimplePeer {
|
|
340
340
|
peerId;
|
|
341
341
|
channelName;
|
|
@@ -450,15 +450,6 @@ class Client {
|
|
|
450
450
|
getPeer(peerId) {
|
|
451
451
|
return this.#connections[peerId];
|
|
452
452
|
}
|
|
453
|
-
/**
|
|
454
|
-
*
|
|
455
|
-
* @param options {object}
|
|
456
|
-
* @param options.peerId {string}
|
|
457
|
-
* @param options.networkVersion {string}
|
|
458
|
-
* @param options.version {string}
|
|
459
|
-
* @param options.stars {string[]}
|
|
460
|
-
* @param options.connectEvent {string} defaults to peer:connected, can be renamed to handle different protocols, like peer:discovered (setup peer props before fireing the connect event)
|
|
461
|
-
*/
|
|
462
453
|
constructor(options) {
|
|
463
454
|
const { peerId, networkVersion, version, connectEvent, stars } = {
|
|
464
455
|
...defaultOptions,
|
|
@@ -485,7 +476,6 @@ class Client {
|
|
|
485
476
|
debug('reinit: start');
|
|
486
477
|
try {
|
|
487
478
|
await this.close();
|
|
488
|
-
// clear internal maps so setupStar starts fresh
|
|
489
479
|
this.#stars = {};
|
|
490
480
|
this.#connections = {};
|
|
491
481
|
for (const star of this.starsConfig) {
|
|
@@ -494,8 +484,7 @@ class Client {
|
|
|
494
484
|
}
|
|
495
485
|
catch (e) {
|
|
496
486
|
// If last star fails and none connected, surface error
|
|
497
|
-
if (
|
|
498
|
-
Object.keys(this.#stars).length === 0)
|
|
487
|
+
if (Object.keys(this.#stars).length === 0)
|
|
499
488
|
throw new Error(`No star available to connect`);
|
|
500
489
|
}
|
|
501
490
|
}
|
|
@@ -537,9 +526,8 @@ class Client {
|
|
|
537
526
|
throw lastErr;
|
|
538
527
|
}
|
|
539
528
|
async _init() {
|
|
540
|
-
// reconnectJob()
|
|
541
529
|
if (!globalThis.RTCPeerConnection)
|
|
542
|
-
globalThis.wrtc = (await import('./browser-
|
|
530
|
+
globalThis.wrtc = (await import('./browser-Qcpp3EKK.js').then(function (n) { return n.b; })).default;
|
|
543
531
|
for (const star of this.starsConfig) {
|
|
544
532
|
try {
|
|
545
533
|
await this.setupStar(star);
|
|
@@ -676,6 +664,7 @@ class Client {
|
|
|
676
664
|
debug(`peer ${from} already connected`);
|
|
677
665
|
return;
|
|
678
666
|
}
|
|
667
|
+
// peer.channels[channelName]
|
|
679
668
|
if (String(peer.channelName) !== String(channelName)) {
|
|
680
669
|
console.warn(`channelNames don't match: got ${peer.channelName}, expected: ${channelName}.`);
|
|
681
670
|
// Destroy the existing peer connection
|
|
@@ -757,30 +746,29 @@ class Client {
|
|
|
757
746
|
peer.destroy();
|
|
758
747
|
};
|
|
759
748
|
async close() {
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
this._resumeInterval = null;
|
|
749
|
+
for (const peerId in this.#connections) {
|
|
750
|
+
const peer = this.#connections[peerId];
|
|
751
|
+
if (peer) {
|
|
752
|
+
peer.destroy();
|
|
753
|
+
delete this.#connections[peerId];
|
|
754
|
+
}
|
|
767
755
|
}
|
|
768
756
|
for (const star in this.#stars) {
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
const listeners
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
catch (e) {
|
|
779
|
-
// ignore
|
|
780
|
-
}
|
|
757
|
+
// unsubscribe handlers we registered earlier
|
|
758
|
+
const listeners = this.#starListeners[star];
|
|
759
|
+
if (listeners && listeners.length) {
|
|
760
|
+
for (const { topic, handler } of listeners) {
|
|
761
|
+
try {
|
|
762
|
+
this.#stars[star].pubsub.unsubscribe(topic, handler);
|
|
763
|
+
}
|
|
764
|
+
catch (e) {
|
|
765
|
+
// ignore
|
|
781
766
|
}
|
|
782
767
|
}
|
|
783
768
|
}
|
|
769
|
+
if (this.#stars[star].connectionState() === 'open') {
|
|
770
|
+
await this.#stars[star].send({ url: 'leave', params: this.peerId });
|
|
771
|
+
}
|
|
784
772
|
}
|
|
785
773
|
const peerClosers = Object.values(this.#connections).map((connection) => {
|
|
786
774
|
try {
|
|
@@ -910,7 +910,7 @@ function requireBn () {
|
|
|
910
910
|
if (hasRequiredBn) return bn$1.exports;
|
|
911
911
|
hasRequiredBn = 1;
|
|
912
912
|
(function (module) {
|
|
913
|
-
(function (module, exports) {
|
|
913
|
+
(function (module, exports$1) {
|
|
914
914
|
|
|
915
915
|
// Utils
|
|
916
916
|
function assert (val, msg) {
|
|
@@ -953,7 +953,7 @@ function requireBn () {
|
|
|
953
953
|
if (typeof module === 'object') {
|
|
954
954
|
module.exports = BN;
|
|
955
955
|
} else {
|
|
956
|
-
exports.BN = BN;
|
|
956
|
+
exports$1.BN = BN;
|
|
957
957
|
}
|
|
958
958
|
|
|
959
959
|
BN.BN = BN;
|
|
@@ -4385,9 +4385,9 @@ var hasRequiredUtils$4;
|
|
|
4385
4385
|
function requireUtils$4 () {
|
|
4386
4386
|
if (hasRequiredUtils$4) return utils$3;
|
|
4387
4387
|
hasRequiredUtils$4 = 1;
|
|
4388
|
-
(function (exports) {
|
|
4388
|
+
(function (exports$1) {
|
|
4389
4389
|
|
|
4390
|
-
var utils = exports;
|
|
4390
|
+
var utils = exports$1;
|
|
4391
4391
|
|
|
4392
4392
|
function toArray(msg, enc) {
|
|
4393
4393
|
if (Array.isArray(msg))
|
|
@@ -4452,9 +4452,9 @@ var hasRequiredUtils$3;
|
|
|
4452
4452
|
function requireUtils$3 () {
|
|
4453
4453
|
if (hasRequiredUtils$3) return utils$4;
|
|
4454
4454
|
hasRequiredUtils$3 = 1;
|
|
4455
|
-
(function (exports) {
|
|
4455
|
+
(function (exports$1) {
|
|
4456
4456
|
|
|
4457
|
-
var utils = exports;
|
|
4457
|
+
var utils = exports$1;
|
|
4458
4458
|
var BN = requireBn();
|
|
4459
4459
|
var minAssert = requireMinimalisticAssert();
|
|
4460
4460
|
var minUtils = requireUtils$4();
|
|
@@ -6659,9 +6659,9 @@ var hasRequiredCurve;
|
|
|
6659
6659
|
function requireCurve () {
|
|
6660
6660
|
if (hasRequiredCurve) return curve;
|
|
6661
6661
|
hasRequiredCurve = 1;
|
|
6662
|
-
(function (exports) {
|
|
6662
|
+
(function (exports$1) {
|
|
6663
6663
|
|
|
6664
|
-
var curve = exports;
|
|
6664
|
+
var curve = exports$1;
|
|
6665
6665
|
|
|
6666
6666
|
curve.base = requireBase();
|
|
6667
6667
|
curve.short = requireShort();
|
|
@@ -7965,8 +7965,8 @@ var hasRequiredHash;
|
|
|
7965
7965
|
function requireHash () {
|
|
7966
7966
|
if (hasRequiredHash) return hash;
|
|
7967
7967
|
hasRequiredHash = 1;
|
|
7968
|
-
(function (exports) {
|
|
7969
|
-
var hash = exports;
|
|
7968
|
+
(function (exports$1) {
|
|
7969
|
+
var hash = exports$1;
|
|
7970
7970
|
|
|
7971
7971
|
hash.utils = requireUtils$2();
|
|
7972
7972
|
hash.common = requireCommon$1();
|
|
@@ -8779,9 +8779,9 @@ var hasRequiredCurves;
|
|
|
8779
8779
|
function requireCurves () {
|
|
8780
8780
|
if (hasRequiredCurves) return curves;
|
|
8781
8781
|
hasRequiredCurves = 1;
|
|
8782
|
-
(function (exports) {
|
|
8782
|
+
(function (exports$1) {
|
|
8783
8783
|
|
|
8784
|
-
var curves = exports;
|
|
8784
|
+
var curves = exports$1;
|
|
8785
8785
|
|
|
8786
8786
|
var hash = requireHash();
|
|
8787
8787
|
var curve = requireCurve();
|
|
@@ -10020,9 +10020,9 @@ var hasRequiredElliptic$2;
|
|
|
10020
10020
|
function requireElliptic$2 () {
|
|
10021
10021
|
if (hasRequiredElliptic$2) return elliptic$2;
|
|
10022
10022
|
hasRequiredElliptic$2 = 1;
|
|
10023
|
-
(function (exports) {
|
|
10023
|
+
(function (exports$1) {
|
|
10024
10024
|
|
|
10025
|
-
var elliptic = exports;
|
|
10025
|
+
var elliptic = exports$1;
|
|
10026
10026
|
|
|
10027
10027
|
elliptic.version = require$$0.version;
|
|
10028
10028
|
elliptic.utils = requireUtils$3();
|
|
@@ -14139,11 +14139,11 @@ var hasRequiredErrorCorrectionLevel;
|
|
|
14139
14139
|
function requireErrorCorrectionLevel () {
|
|
14140
14140
|
if (hasRequiredErrorCorrectionLevel) return errorCorrectionLevel;
|
|
14141
14141
|
hasRequiredErrorCorrectionLevel = 1;
|
|
14142
|
-
(function (exports) {
|
|
14143
|
-
exports.L = { bit: 1 };
|
|
14144
|
-
exports.M = { bit: 0 };
|
|
14145
|
-
exports.Q = { bit: 3 };
|
|
14146
|
-
exports.H = { bit: 2 };
|
|
14142
|
+
(function (exports$1) {
|
|
14143
|
+
exports$1.L = { bit: 1 };
|
|
14144
|
+
exports$1.M = { bit: 0 };
|
|
14145
|
+
exports$1.Q = { bit: 3 };
|
|
14146
|
+
exports$1.H = { bit: 2 };
|
|
14147
14147
|
|
|
14148
14148
|
function fromString (string) {
|
|
14149
14149
|
if (typeof string !== 'string') {
|
|
@@ -14155,32 +14155,32 @@ function requireErrorCorrectionLevel () {
|
|
|
14155
14155
|
switch (lcStr) {
|
|
14156
14156
|
case 'l':
|
|
14157
14157
|
case 'low':
|
|
14158
|
-
return exports.L
|
|
14158
|
+
return exports$1.L
|
|
14159
14159
|
|
|
14160
14160
|
case 'm':
|
|
14161
14161
|
case 'medium':
|
|
14162
|
-
return exports.M
|
|
14162
|
+
return exports$1.M
|
|
14163
14163
|
|
|
14164
14164
|
case 'q':
|
|
14165
14165
|
case 'quartile':
|
|
14166
|
-
return exports.Q
|
|
14166
|
+
return exports$1.Q
|
|
14167
14167
|
|
|
14168
14168
|
case 'h':
|
|
14169
14169
|
case 'high':
|
|
14170
|
-
return exports.H
|
|
14170
|
+
return exports$1.H
|
|
14171
14171
|
|
|
14172
14172
|
default:
|
|
14173
14173
|
throw new Error('Unknown EC Level: ' + string)
|
|
14174
14174
|
}
|
|
14175
14175
|
}
|
|
14176
14176
|
|
|
14177
|
-
exports.isValid = function isValid (level) {
|
|
14177
|
+
exports$1.isValid = function isValid (level) {
|
|
14178
14178
|
return level && typeof level.bit !== 'undefined' &&
|
|
14179
14179
|
level.bit >= 0 && level.bit < 4
|
|
14180
14180
|
};
|
|
14181
14181
|
|
|
14182
|
-
exports.from = function from (value, defaultValue) {
|
|
14183
|
-
if (exports.isValid(value)) {
|
|
14182
|
+
exports$1.from = function from (value, defaultValue) {
|
|
14183
|
+
if (exports$1.isValid(value)) {
|
|
14184
14184
|
return value
|
|
14185
14185
|
}
|
|
14186
14186
|
|
|
@@ -14332,7 +14332,7 @@ var hasRequiredAlignmentPattern;
|
|
|
14332
14332
|
function requireAlignmentPattern () {
|
|
14333
14333
|
if (hasRequiredAlignmentPattern) return alignmentPattern;
|
|
14334
14334
|
hasRequiredAlignmentPattern = 1;
|
|
14335
|
-
(function (exports) {
|
|
14335
|
+
(function (exports$1) {
|
|
14336
14336
|
const getSymbolSize = requireUtils$1().getSymbolSize;
|
|
14337
14337
|
|
|
14338
14338
|
/**
|
|
@@ -14349,7 +14349,7 @@ function requireAlignmentPattern () {
|
|
|
14349
14349
|
* @param {Number} version QR Code version
|
|
14350
14350
|
* @return {Array} Array of coordinate
|
|
14351
14351
|
*/
|
|
14352
|
-
exports.getRowColCoords = function getRowColCoords (version) {
|
|
14352
|
+
exports$1.getRowColCoords = function getRowColCoords (version) {
|
|
14353
14353
|
if (version === 1) return []
|
|
14354
14354
|
|
|
14355
14355
|
const posCount = Math.floor(version / 7) + 2;
|
|
@@ -14386,9 +14386,9 @@ function requireAlignmentPattern () {
|
|
|
14386
14386
|
* @param {Number} version QR Code version
|
|
14387
14387
|
* @return {Array} Array of coordinates
|
|
14388
14388
|
*/
|
|
14389
|
-
exports.getPositions = function getPositions (version) {
|
|
14389
|
+
exports$1.getPositions = function getPositions (version) {
|
|
14390
14390
|
const coords = [];
|
|
14391
|
-
const pos = exports.getRowColCoords(version);
|
|
14391
|
+
const pos = exports$1.getRowColCoords(version);
|
|
14392
14392
|
const posLength = pos.length;
|
|
14393
14393
|
|
|
14394
14394
|
for (let i = 0; i < posLength; i++) {
|
|
@@ -14454,8 +14454,8 @@ var hasRequiredMaskPattern;
|
|
|
14454
14454
|
function requireMaskPattern () {
|
|
14455
14455
|
if (hasRequiredMaskPattern) return maskPattern;
|
|
14456
14456
|
hasRequiredMaskPattern = 1;
|
|
14457
|
-
(function (exports) {
|
|
14458
|
-
exports.Patterns = {
|
|
14457
|
+
(function (exports$1) {
|
|
14458
|
+
exports$1.Patterns = {
|
|
14459
14459
|
PATTERN000: 0,
|
|
14460
14460
|
PATTERN001: 1,
|
|
14461
14461
|
PATTERN010: 2,
|
|
@@ -14483,7 +14483,7 @@ function requireMaskPattern () {
|
|
|
14483
14483
|
* @param {Number} mask Mask pattern
|
|
14484
14484
|
* @return {Boolean} true if valid, false otherwise
|
|
14485
14485
|
*/
|
|
14486
|
-
exports.isValid = function isValid (mask) {
|
|
14486
|
+
exports$1.isValid = function isValid (mask) {
|
|
14487
14487
|
return mask != null && mask !== '' && !isNaN(mask) && mask >= 0 && mask <= 7
|
|
14488
14488
|
};
|
|
14489
14489
|
|
|
@@ -14494,8 +14494,8 @@ function requireMaskPattern () {
|
|
|
14494
14494
|
* @param {Number|String} value Mask pattern value
|
|
14495
14495
|
* @return {Number} Valid mask pattern or undefined
|
|
14496
14496
|
*/
|
|
14497
|
-
exports.from = function from (value) {
|
|
14498
|
-
return exports.isValid(value) ? parseInt(value, 10) : undefined
|
|
14497
|
+
exports$1.from = function from (value) {
|
|
14498
|
+
return exports$1.isValid(value) ? parseInt(value, 10) : undefined
|
|
14499
14499
|
};
|
|
14500
14500
|
|
|
14501
14501
|
/**
|
|
@@ -14505,7 +14505,7 @@ function requireMaskPattern () {
|
|
|
14505
14505
|
* Points: N1 + i
|
|
14506
14506
|
* i is the amount by which the number of adjacent modules of the same color exceeds 5
|
|
14507
14507
|
*/
|
|
14508
|
-
exports.getPenaltyN1 = function getPenaltyN1 (data) {
|
|
14508
|
+
exports$1.getPenaltyN1 = function getPenaltyN1 (data) {
|
|
14509
14509
|
const size = data.size;
|
|
14510
14510
|
let points = 0;
|
|
14511
14511
|
let sameCountCol = 0;
|
|
@@ -14549,7 +14549,7 @@ function requireMaskPattern () {
|
|
|
14549
14549
|
*
|
|
14550
14550
|
* Points: N2 * (m - 1) * (n - 1)
|
|
14551
14551
|
*/
|
|
14552
|
-
exports.getPenaltyN2 = function getPenaltyN2 (data) {
|
|
14552
|
+
exports$1.getPenaltyN2 = function getPenaltyN2 (data) {
|
|
14553
14553
|
const size = data.size;
|
|
14554
14554
|
let points = 0;
|
|
14555
14555
|
|
|
@@ -14573,7 +14573,7 @@ function requireMaskPattern () {
|
|
|
14573
14573
|
*
|
|
14574
14574
|
* Points: N3 * number of pattern found
|
|
14575
14575
|
*/
|
|
14576
|
-
exports.getPenaltyN3 = function getPenaltyN3 (data) {
|
|
14576
|
+
exports$1.getPenaltyN3 = function getPenaltyN3 (data) {
|
|
14577
14577
|
const size = data.size;
|
|
14578
14578
|
let points = 0;
|
|
14579
14579
|
let bitsCol = 0;
|
|
@@ -14601,7 +14601,7 @@ function requireMaskPattern () {
|
|
|
14601
14601
|
* k is the rating of the deviation of the proportion of dark modules
|
|
14602
14602
|
* in the symbol from 50% in steps of 5%
|
|
14603
14603
|
*/
|
|
14604
|
-
exports.getPenaltyN4 = function getPenaltyN4 (data) {
|
|
14604
|
+
exports$1.getPenaltyN4 = function getPenaltyN4 (data) {
|
|
14605
14605
|
let darkCount = 0;
|
|
14606
14606
|
const modulesCount = data.data.length;
|
|
14607
14607
|
|
|
@@ -14622,14 +14622,14 @@ function requireMaskPattern () {
|
|
|
14622
14622
|
*/
|
|
14623
14623
|
function getMaskAt (maskPattern, i, j) {
|
|
14624
14624
|
switch (maskPattern) {
|
|
14625
|
-
case exports.Patterns.PATTERN000: return (i + j) % 2 === 0
|
|
14626
|
-
case exports.Patterns.PATTERN001: return i % 2 === 0
|
|
14627
|
-
case exports.Patterns.PATTERN010: return j % 3 === 0
|
|
14628
|
-
case exports.Patterns.PATTERN011: return (i + j) % 3 === 0
|
|
14629
|
-
case exports.Patterns.PATTERN100: return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 === 0
|
|
14630
|
-
case exports.Patterns.PATTERN101: return (i * j) % 2 + (i * j) % 3 === 0
|
|
14631
|
-
case exports.Patterns.PATTERN110: return ((i * j) % 2 + (i * j) % 3) % 2 === 0
|
|
14632
|
-
case exports.Patterns.PATTERN111: return ((i * j) % 3 + (i + j) % 2) % 2 === 0
|
|
14625
|
+
case exports$1.Patterns.PATTERN000: return (i + j) % 2 === 0
|
|
14626
|
+
case exports$1.Patterns.PATTERN001: return i % 2 === 0
|
|
14627
|
+
case exports$1.Patterns.PATTERN010: return j % 3 === 0
|
|
14628
|
+
case exports$1.Patterns.PATTERN011: return (i + j) % 3 === 0
|
|
14629
|
+
case exports$1.Patterns.PATTERN100: return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 === 0
|
|
14630
|
+
case exports$1.Patterns.PATTERN101: return (i * j) % 2 + (i * j) % 3 === 0
|
|
14631
|
+
case exports$1.Patterns.PATTERN110: return ((i * j) % 2 + (i * j) % 3) % 2 === 0
|
|
14632
|
+
case exports$1.Patterns.PATTERN111: return ((i * j) % 3 + (i + j) % 2) % 2 === 0
|
|
14633
14633
|
|
|
14634
14634
|
default: throw new Error('bad maskPattern:' + maskPattern)
|
|
14635
14635
|
}
|
|
@@ -14641,7 +14641,7 @@ function requireMaskPattern () {
|
|
|
14641
14641
|
* @param {Number} pattern Pattern reference number
|
|
14642
14642
|
* @param {BitMatrix} data BitMatrix data
|
|
14643
14643
|
*/
|
|
14644
|
-
exports.applyMask = function applyMask (pattern, data) {
|
|
14644
|
+
exports$1.applyMask = function applyMask (pattern, data) {
|
|
14645
14645
|
const size = data.size;
|
|
14646
14646
|
|
|
14647
14647
|
for (let col = 0; col < size; col++) {
|
|
@@ -14658,24 +14658,24 @@ function requireMaskPattern () {
|
|
|
14658
14658
|
* @param {BitMatrix} data
|
|
14659
14659
|
* @return {Number} Mask pattern reference number
|
|
14660
14660
|
*/
|
|
14661
|
-
exports.getBestMask = function getBestMask (data, setupFormatFunc) {
|
|
14662
|
-
const numPatterns = Object.keys(exports.Patterns).length;
|
|
14661
|
+
exports$1.getBestMask = function getBestMask (data, setupFormatFunc) {
|
|
14662
|
+
const numPatterns = Object.keys(exports$1.Patterns).length;
|
|
14663
14663
|
let bestPattern = 0;
|
|
14664
14664
|
let lowerPenalty = Infinity;
|
|
14665
14665
|
|
|
14666
14666
|
for (let p = 0; p < numPatterns; p++) {
|
|
14667
14667
|
setupFormatFunc(p);
|
|
14668
|
-
exports.applyMask(p, data);
|
|
14668
|
+
exports$1.applyMask(p, data);
|
|
14669
14669
|
|
|
14670
14670
|
// Calculate penalty
|
|
14671
14671
|
const penalty =
|
|
14672
|
-
exports.getPenaltyN1(data) +
|
|
14673
|
-
exports.getPenaltyN2(data) +
|
|
14674
|
-
exports.getPenaltyN3(data) +
|
|
14675
|
-
exports.getPenaltyN4(data);
|
|
14672
|
+
exports$1.getPenaltyN1(data) +
|
|
14673
|
+
exports$1.getPenaltyN2(data) +
|
|
14674
|
+
exports$1.getPenaltyN3(data) +
|
|
14675
|
+
exports$1.getPenaltyN4(data);
|
|
14676
14676
|
|
|
14677
14677
|
// Undo previously applied mask
|
|
14678
|
-
exports.applyMask(p, data);
|
|
14678
|
+
exports$1.applyMask(p, data);
|
|
14679
14679
|
|
|
14680
14680
|
if (penalty < lowerPenalty) {
|
|
14681
14681
|
lowerPenalty = penalty;
|
|
@@ -14920,7 +14920,7 @@ var hasRequiredPolynomial;
|
|
|
14920
14920
|
function requirePolynomial () {
|
|
14921
14921
|
if (hasRequiredPolynomial) return polynomial;
|
|
14922
14922
|
hasRequiredPolynomial = 1;
|
|
14923
|
-
(function (exports) {
|
|
14923
|
+
(function (exports$1) {
|
|
14924
14924
|
const GF = requireGaloisField();
|
|
14925
14925
|
|
|
14926
14926
|
/**
|
|
@@ -14930,7 +14930,7 @@ function requirePolynomial () {
|
|
|
14930
14930
|
* @param {Uint8Array} p2 Polynomial
|
|
14931
14931
|
* @return {Uint8Array} Product of p1 and p2
|
|
14932
14932
|
*/
|
|
14933
|
-
exports.mul = function mul (p1, p2) {
|
|
14933
|
+
exports$1.mul = function mul (p1, p2) {
|
|
14934
14934
|
const coeff = new Uint8Array(p1.length + p2.length - 1);
|
|
14935
14935
|
|
|
14936
14936
|
for (let i = 0; i < p1.length; i++) {
|
|
@@ -14949,7 +14949,7 @@ function requirePolynomial () {
|
|
|
14949
14949
|
* @param {Uint8Array} divisor Polynomial
|
|
14950
14950
|
* @return {Uint8Array} Remainder
|
|
14951
14951
|
*/
|
|
14952
|
-
exports.mod = function mod (divident, divisor) {
|
|
14952
|
+
exports$1.mod = function mod (divident, divisor) {
|
|
14953
14953
|
let result = new Uint8Array(divident);
|
|
14954
14954
|
|
|
14955
14955
|
while ((result.length - divisor.length) >= 0) {
|
|
@@ -14975,10 +14975,10 @@ function requirePolynomial () {
|
|
|
14975
14975
|
* @param {Number} degree Degree of the generator polynomial
|
|
14976
14976
|
* @return {Uint8Array} Buffer containing polynomial coefficients
|
|
14977
14977
|
*/
|
|
14978
|
-
exports.generateECPolynomial = function generateECPolynomial (degree) {
|
|
14978
|
+
exports$1.generateECPolynomial = function generateECPolynomial (degree) {
|
|
14979
14979
|
let poly = new Uint8Array([1]);
|
|
14980
14980
|
for (let i = 0; i < degree; i++) {
|
|
14981
|
-
poly = exports.mul(poly, new Uint8Array([1, GF.exp(i)]));
|
|
14981
|
+
poly = exports$1.mul(poly, new Uint8Array([1, GF.exp(i)]));
|
|
14982
14982
|
}
|
|
14983
14983
|
|
|
14984
14984
|
return poly
|
|
@@ -15122,7 +15122,7 @@ var hasRequiredMode;
|
|
|
15122
15122
|
function requireMode () {
|
|
15123
15123
|
if (hasRequiredMode) return mode;
|
|
15124
15124
|
hasRequiredMode = 1;
|
|
15125
|
-
(function (exports) {
|
|
15125
|
+
(function (exports$1) {
|
|
15126
15126
|
const VersionCheck = requireVersionCheck();
|
|
15127
15127
|
const Regex = requireRegex();
|
|
15128
15128
|
|
|
@@ -15133,7 +15133,7 @@ function requireMode () {
|
|
|
15133
15133
|
*
|
|
15134
15134
|
* @type {Object}
|
|
15135
15135
|
*/
|
|
15136
|
-
exports.NUMERIC = {
|
|
15136
|
+
exports$1.NUMERIC = {
|
|
15137
15137
|
id: 'Numeric',
|
|
15138
15138
|
bit: 1 << 0,
|
|
15139
15139
|
ccBits: [10, 12, 14]
|
|
@@ -15148,7 +15148,7 @@ function requireMode () {
|
|
|
15148
15148
|
*
|
|
15149
15149
|
* @type {Object}
|
|
15150
15150
|
*/
|
|
15151
|
-
exports.ALPHANUMERIC = {
|
|
15151
|
+
exports$1.ALPHANUMERIC = {
|
|
15152
15152
|
id: 'Alphanumeric',
|
|
15153
15153
|
bit: 1 << 1,
|
|
15154
15154
|
ccBits: [9, 11, 13]
|
|
@@ -15159,7 +15159,7 @@ function requireMode () {
|
|
|
15159
15159
|
*
|
|
15160
15160
|
* @type {Object}
|
|
15161
15161
|
*/
|
|
15162
|
-
exports.BYTE = {
|
|
15162
|
+
exports$1.BYTE = {
|
|
15163
15163
|
id: 'Byte',
|
|
15164
15164
|
bit: 1 << 2,
|
|
15165
15165
|
ccBits: [8, 16, 16]
|
|
@@ -15174,7 +15174,7 @@ function requireMode () {
|
|
|
15174
15174
|
*
|
|
15175
15175
|
* @type {Object}
|
|
15176
15176
|
*/
|
|
15177
|
-
exports.KANJI = {
|
|
15177
|
+
exports$1.KANJI = {
|
|
15178
15178
|
id: 'Kanji',
|
|
15179
15179
|
bit: 1 << 3,
|
|
15180
15180
|
ccBits: [8, 10, 12]
|
|
@@ -15186,7 +15186,7 @@ function requireMode () {
|
|
|
15186
15186
|
*
|
|
15187
15187
|
* @type {Object}
|
|
15188
15188
|
*/
|
|
15189
|
-
exports.MIXED = {
|
|
15189
|
+
exports$1.MIXED = {
|
|
15190
15190
|
bit: -1
|
|
15191
15191
|
};
|
|
15192
15192
|
|
|
@@ -15198,7 +15198,7 @@ function requireMode () {
|
|
|
15198
15198
|
* @param {Number} version QR Code version
|
|
15199
15199
|
* @return {Number} Number of bits
|
|
15200
15200
|
*/
|
|
15201
|
-
exports.getCharCountIndicator = function getCharCountIndicator (mode, version) {
|
|
15201
|
+
exports$1.getCharCountIndicator = function getCharCountIndicator (mode, version) {
|
|
15202
15202
|
if (!mode.ccBits) throw new Error('Invalid mode: ' + mode)
|
|
15203
15203
|
|
|
15204
15204
|
if (!VersionCheck.isValid(version)) {
|
|
@@ -15216,11 +15216,11 @@ function requireMode () {
|
|
|
15216
15216
|
* @param {String} dataStr Input data string
|
|
15217
15217
|
* @return {Mode} Best mode
|
|
15218
15218
|
*/
|
|
15219
|
-
exports.getBestModeForData = function getBestModeForData (dataStr) {
|
|
15220
|
-
if (Regex.testNumeric(dataStr)) return exports.NUMERIC
|
|
15221
|
-
else if (Regex.testAlphanumeric(dataStr)) return exports.ALPHANUMERIC
|
|
15222
|
-
else if (Regex.testKanji(dataStr)) return exports.KANJI
|
|
15223
|
-
else return exports.BYTE
|
|
15219
|
+
exports$1.getBestModeForData = function getBestModeForData (dataStr) {
|
|
15220
|
+
if (Regex.testNumeric(dataStr)) return exports$1.NUMERIC
|
|
15221
|
+
else if (Regex.testAlphanumeric(dataStr)) return exports$1.ALPHANUMERIC
|
|
15222
|
+
else if (Regex.testKanji(dataStr)) return exports$1.KANJI
|
|
15223
|
+
else return exports$1.BYTE
|
|
15224
15224
|
};
|
|
15225
15225
|
|
|
15226
15226
|
/**
|
|
@@ -15229,7 +15229,7 @@ function requireMode () {
|
|
|
15229
15229
|
* @param {Mode} mode Mode object
|
|
15230
15230
|
* @returns {String} Mode name
|
|
15231
15231
|
*/
|
|
15232
|
-
exports.toString = function toString (mode) {
|
|
15232
|
+
exports$1.toString = function toString (mode) {
|
|
15233
15233
|
if (mode && mode.id) return mode.id
|
|
15234
15234
|
throw new Error('Invalid mode')
|
|
15235
15235
|
};
|
|
@@ -15240,7 +15240,7 @@ function requireMode () {
|
|
|
15240
15240
|
* @param {Mode} mode Mode object
|
|
15241
15241
|
* @returns {Boolean} True if valid mode, false otherwise
|
|
15242
15242
|
*/
|
|
15243
|
-
exports.isValid = function isValid (mode) {
|
|
15243
|
+
exports$1.isValid = function isValid (mode) {
|
|
15244
15244
|
return mode && mode.bit && mode.ccBits
|
|
15245
15245
|
};
|
|
15246
15246
|
|
|
@@ -15259,13 +15259,13 @@ function requireMode () {
|
|
|
15259
15259
|
|
|
15260
15260
|
switch (lcStr) {
|
|
15261
15261
|
case 'numeric':
|
|
15262
|
-
return exports.NUMERIC
|
|
15262
|
+
return exports$1.NUMERIC
|
|
15263
15263
|
case 'alphanumeric':
|
|
15264
|
-
return exports.ALPHANUMERIC
|
|
15264
|
+
return exports$1.ALPHANUMERIC
|
|
15265
15265
|
case 'kanji':
|
|
15266
|
-
return exports.KANJI
|
|
15266
|
+
return exports$1.KANJI
|
|
15267
15267
|
case 'byte':
|
|
15268
|
-
return exports.BYTE
|
|
15268
|
+
return exports$1.BYTE
|
|
15269
15269
|
default:
|
|
15270
15270
|
throw new Error('Unknown mode: ' + string)
|
|
15271
15271
|
}
|
|
@@ -15279,8 +15279,8 @@ function requireMode () {
|
|
|
15279
15279
|
* @param {Mode} defaultValue Fallback value
|
|
15280
15280
|
* @return {Mode} Encoding mode
|
|
15281
15281
|
*/
|
|
15282
|
-
exports.from = function from (value, defaultValue) {
|
|
15283
|
-
if (exports.isValid(value)) {
|
|
15282
|
+
exports$1.from = function from (value, defaultValue) {
|
|
15283
|
+
if (exports$1.isValid(value)) {
|
|
15284
15284
|
return value
|
|
15285
15285
|
}
|
|
15286
15286
|
|
|
@@ -15299,7 +15299,7 @@ var hasRequiredVersion;
|
|
|
15299
15299
|
function requireVersion () {
|
|
15300
15300
|
if (hasRequiredVersion) return version;
|
|
15301
15301
|
hasRequiredVersion = 1;
|
|
15302
|
-
(function (exports) {
|
|
15302
|
+
(function (exports$1) {
|
|
15303
15303
|
const Utils = requireUtils$1();
|
|
15304
15304
|
const ECCode = requireErrorCorrectionCode();
|
|
15305
15305
|
const ECLevel = requireErrorCorrectionLevel();
|
|
@@ -15312,7 +15312,7 @@ function requireVersion () {
|
|
|
15312
15312
|
|
|
15313
15313
|
function getBestVersionForDataLength (mode, length, errorCorrectionLevel) {
|
|
15314
15314
|
for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {
|
|
15315
|
-
if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, mode)) {
|
|
15315
|
+
if (length <= exports$1.getCapacity(currentVersion, errorCorrectionLevel, mode)) {
|
|
15316
15316
|
return currentVersion
|
|
15317
15317
|
}
|
|
15318
15318
|
}
|
|
@@ -15339,7 +15339,7 @@ function requireVersion () {
|
|
|
15339
15339
|
function getBestVersionForMixedData (segments, errorCorrectionLevel) {
|
|
15340
15340
|
for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {
|
|
15341
15341
|
const length = getTotalBitsFromDataArray(segments, currentVersion);
|
|
15342
|
-
if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, Mode.MIXED)) {
|
|
15342
|
+
if (length <= exports$1.getCapacity(currentVersion, errorCorrectionLevel, Mode.MIXED)) {
|
|
15343
15343
|
return currentVersion
|
|
15344
15344
|
}
|
|
15345
15345
|
}
|
|
@@ -15355,7 +15355,7 @@ function requireVersion () {
|
|
|
15355
15355
|
* @param {Number} defaultValue Fallback value
|
|
15356
15356
|
* @return {Number} QR Code version number
|
|
15357
15357
|
*/
|
|
15358
|
-
exports.from = function from (value, defaultValue) {
|
|
15358
|
+
exports$1.from = function from (value, defaultValue) {
|
|
15359
15359
|
if (VersionCheck.isValid(value)) {
|
|
15360
15360
|
return parseInt(value, 10)
|
|
15361
15361
|
}
|
|
@@ -15372,7 +15372,7 @@ function requireVersion () {
|
|
|
15372
15372
|
* @param {Mode} mode Data mode
|
|
15373
15373
|
* @return {Number} Quantity of storable data
|
|
15374
15374
|
*/
|
|
15375
|
-
exports.getCapacity = function getCapacity (version, errorCorrectionLevel, mode) {
|
|
15375
|
+
exports$1.getCapacity = function getCapacity (version, errorCorrectionLevel, mode) {
|
|
15376
15376
|
if (!VersionCheck.isValid(version)) {
|
|
15377
15377
|
throw new Error('Invalid QR Code version')
|
|
15378
15378
|
}
|
|
@@ -15418,7 +15418,7 @@ function requireVersion () {
|
|
|
15418
15418
|
* @param {Mode} mode Data mode
|
|
15419
15419
|
* @return {Number} QR Code version
|
|
15420
15420
|
*/
|
|
15421
|
-
exports.getBestVersionForData = function getBestVersionForData (data, errorCorrectionLevel) {
|
|
15421
|
+
exports$1.getBestVersionForData = function getBestVersionForData (data, errorCorrectionLevel) {
|
|
15422
15422
|
let seg;
|
|
15423
15423
|
|
|
15424
15424
|
const ecl = ECLevel.from(errorCorrectionLevel, ECLevel.M);
|
|
@@ -15450,7 +15450,7 @@ function requireVersion () {
|
|
|
15450
15450
|
* @param {Number} version QR Code version
|
|
15451
15451
|
* @return {Number} Encoded version info bits
|
|
15452
15452
|
*/
|
|
15453
|
-
exports.getEncodedBits = function getEncodedBits (version) {
|
|
15453
|
+
exports$1.getEncodedBits = function getEncodedBits (version) {
|
|
15454
15454
|
if (!VersionCheck.isValid(version) || version < 7) {
|
|
15455
15455
|
throw new Error('Invalid QR Code version')
|
|
15456
15456
|
}
|
|
@@ -15910,7 +15910,7 @@ var hasRequiredSegments;
|
|
|
15910
15910
|
function requireSegments () {
|
|
15911
15911
|
if (hasRequiredSegments) return segments;
|
|
15912
15912
|
hasRequiredSegments = 1;
|
|
15913
|
-
(function (exports) {
|
|
15913
|
+
(function (exports$1) {
|
|
15914
15914
|
const Mode = requireMode();
|
|
15915
15915
|
const NumericData = requireNumericData();
|
|
15916
15916
|
const AlphanumericData = requireAlphanumericData();
|
|
@@ -16191,7 +16191,7 @@ function requireSegments () {
|
|
|
16191
16191
|
* @param {Array} array Array of objects with segments data
|
|
16192
16192
|
* @return {Array} Array of Segments
|
|
16193
16193
|
*/
|
|
16194
|
-
exports.fromArray = function fromArray (array) {
|
|
16194
|
+
exports$1.fromArray = function fromArray (array) {
|
|
16195
16195
|
return array.reduce(function (acc, seg) {
|
|
16196
16196
|
if (typeof seg === 'string') {
|
|
16197
16197
|
acc.push(buildSingleSegment(seg, null));
|
|
@@ -16211,7 +16211,7 @@ function requireSegments () {
|
|
|
16211
16211
|
* @param {Number} version QR Code version
|
|
16212
16212
|
* @return {Array} Array of segments
|
|
16213
16213
|
*/
|
|
16214
|
-
exports.fromString = function fromString (data, version) {
|
|
16214
|
+
exports$1.fromString = function fromString (data, version) {
|
|
16215
16215
|
const segs = getSegmentsFromString(data, Utils.isKanjiModeEnabled());
|
|
16216
16216
|
|
|
16217
16217
|
const nodes = buildNodes(segs);
|
|
@@ -16223,7 +16223,7 @@ function requireSegments () {
|
|
|
16223
16223
|
optimizedSegs.push(graph.table[path[i]].node);
|
|
16224
16224
|
}
|
|
16225
16225
|
|
|
16226
|
-
return exports.fromArray(mergeSegments(optimizedSegs))
|
|
16226
|
+
return exports$1.fromArray(mergeSegments(optimizedSegs))
|
|
16227
16227
|
};
|
|
16228
16228
|
|
|
16229
16229
|
/**
|
|
@@ -16236,8 +16236,8 @@ function requireSegments () {
|
|
|
16236
16236
|
* @param {string} data Input string
|
|
16237
16237
|
* @return {Array} Array of segments
|
|
16238
16238
|
*/
|
|
16239
|
-
exports.rawSplit = function rawSplit (data) {
|
|
16240
|
-
return exports.fromArray(
|
|
16239
|
+
exports$1.rawSplit = function rawSplit (data) {
|
|
16240
|
+
return exports$1.fromArray(
|
|
16241
16241
|
getSegmentsFromString(data, Utils.isKanjiModeEnabled())
|
|
16242
16242
|
)
|
|
16243
16243
|
};
|
|
@@ -16757,7 +16757,7 @@ var hasRequiredUtils;
|
|
|
16757
16757
|
function requireUtils () {
|
|
16758
16758
|
if (hasRequiredUtils) return utils;
|
|
16759
16759
|
hasRequiredUtils = 1;
|
|
16760
|
-
(function (exports) {
|
|
16760
|
+
(function (exports$1) {
|
|
16761
16761
|
function hex2rgba (hex) {
|
|
16762
16762
|
if (typeof hex === 'number') {
|
|
16763
16763
|
hex = hex.toString();
|
|
@@ -16793,7 +16793,7 @@ function requireUtils () {
|
|
|
16793
16793
|
}
|
|
16794
16794
|
}
|
|
16795
16795
|
|
|
16796
|
-
exports.getOptions = function getOptions (options) {
|
|
16796
|
+
exports$1.getOptions = function getOptions (options) {
|
|
16797
16797
|
if (!options) options = {};
|
|
16798
16798
|
if (!options.color) options.color = {};
|
|
16799
16799
|
|
|
@@ -16819,21 +16819,21 @@ function requireUtils () {
|
|
|
16819
16819
|
}
|
|
16820
16820
|
};
|
|
16821
16821
|
|
|
16822
|
-
exports.getScale = function getScale (qrSize, opts) {
|
|
16822
|
+
exports$1.getScale = function getScale (qrSize, opts) {
|
|
16823
16823
|
return opts.width && opts.width >= qrSize + opts.margin * 2
|
|
16824
16824
|
? opts.width / (qrSize + opts.margin * 2)
|
|
16825
16825
|
: opts.scale
|
|
16826
16826
|
};
|
|
16827
16827
|
|
|
16828
|
-
exports.getImageWidth = function getImageWidth (qrSize, opts) {
|
|
16829
|
-
const scale = exports.getScale(qrSize, opts);
|
|
16828
|
+
exports$1.getImageWidth = function getImageWidth (qrSize, opts) {
|
|
16829
|
+
const scale = exports$1.getScale(qrSize, opts);
|
|
16830
16830
|
return Math.floor((qrSize + opts.margin * 2) * scale)
|
|
16831
16831
|
};
|
|
16832
16832
|
|
|
16833
|
-
exports.qrToImageData = function qrToImageData (imgData, qr, opts) {
|
|
16833
|
+
exports$1.qrToImageData = function qrToImageData (imgData, qr, opts) {
|
|
16834
16834
|
const size = qr.modules.size;
|
|
16835
16835
|
const data = qr.modules.data;
|
|
16836
|
-
const scale = exports.getScale(size, opts);
|
|
16836
|
+
const scale = exports$1.getScale(size, opts);
|
|
16837
16837
|
const symbolSize = Math.floor((size + opts.margin * 2) * scale);
|
|
16838
16838
|
const scaledMargin = opts.margin * scale;
|
|
16839
16839
|
const palette = [opts.color.light, opts.color.dark];
|
|
@@ -16866,7 +16866,7 @@ var hasRequiredCanvas;
|
|
|
16866
16866
|
function requireCanvas () {
|
|
16867
16867
|
if (hasRequiredCanvas) return canvas;
|
|
16868
16868
|
hasRequiredCanvas = 1;
|
|
16869
|
-
(function (exports) {
|
|
16869
|
+
(function (exports$1) {
|
|
16870
16870
|
const Utils = requireUtils();
|
|
16871
16871
|
|
|
16872
16872
|
function clearCanvas (ctx, canvas, size) {
|
|
@@ -16887,7 +16887,7 @@ function requireCanvas () {
|
|
|
16887
16887
|
}
|
|
16888
16888
|
}
|
|
16889
16889
|
|
|
16890
|
-
exports.render = function render (qrData, canvas, options) {
|
|
16890
|
+
exports$1.render = function render (qrData, canvas, options) {
|
|
16891
16891
|
let opts = options;
|
|
16892
16892
|
let canvasEl = canvas;
|
|
16893
16893
|
|
|
@@ -16913,7 +16913,7 @@ function requireCanvas () {
|
|
|
16913
16913
|
return canvasEl
|
|
16914
16914
|
};
|
|
16915
16915
|
|
|
16916
|
-
exports.renderToDataURL = function renderToDataURL (qrData, canvas, options) {
|
|
16916
|
+
exports$1.renderToDataURL = function renderToDataURL (qrData, canvas, options) {
|
|
16917
16917
|
let opts = options;
|
|
16918
16918
|
|
|
16919
16919
|
if (typeof opts === 'undefined' && (!canvas || !canvas.getContext)) {
|
|
@@ -16923,7 +16923,7 @@ function requireCanvas () {
|
|
|
16923
16923
|
|
|
16924
16924
|
if (!opts) opts = {};
|
|
16925
16925
|
|
|
16926
|
-
const canvasEl = exports.render(qrData, canvas, opts);
|
|
16926
|
+
const canvasEl = exports$1.render(qrData, canvas, opts);
|
|
16927
16927
|
|
|
16928
16928
|
const type = opts.type || 'image/png';
|
|
16929
16929
|
const rendererOpts = opts.rendererOpts || {};
|
|
@@ -17150,7 +17150,7 @@ class Identity {
|
|
|
17150
17150
|
this.selectedAccount = new TextDecoder().decode(selected);
|
|
17151
17151
|
}
|
|
17152
17152
|
else {
|
|
17153
|
-
const importee = await import(/* webpackChunkName: "generate-account" */ './index-
|
|
17153
|
+
const importee = await import(/* webpackChunkName: "generate-account" */ './index-ChRjMyiM.js');
|
|
17154
17154
|
const { identity, accounts } = await importee.default(password, this.network);
|
|
17155
17155
|
await globalThis.accountStore.put('public', JSON.stringify({ walletId: identity.walletId }));
|
|
17156
17156
|
await globalThis.walletStore.put('version', String(1));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { I as default } from './identity-
|
|
1
|
+
export { I as default } from './identity-nIyW_Xm8.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as commonjsGlobal, r as require$$3, j as requireInherits_browser, g as getDefaultExportFromCjs } from './identity-
|
|
1
|
+
import { h as commonjsGlobal, r as require$$3, j as requireInherits_browser, g as getDefaultExportFromCjs } from './identity-nIyW_Xm8.js';
|
|
2
2
|
import require$$0 from 'events';
|
|
3
3
|
|
|
4
4
|
var browser$2 = {exports: {}};
|
|
@@ -481,17 +481,17 @@ var hasRequiredBrowser$2;
|
|
|
481
481
|
function requireBrowser$2 () {
|
|
482
482
|
if (hasRequiredBrowser$2) return browser$2.exports;
|
|
483
483
|
hasRequiredBrowser$2 = 1;
|
|
484
|
-
(function (module, exports) {
|
|
484
|
+
(function (module, exports$1) {
|
|
485
485
|
/**
|
|
486
486
|
* This is the web browser implementation of `debug()`.
|
|
487
487
|
*/
|
|
488
488
|
|
|
489
|
-
exports.formatArgs = formatArgs;
|
|
490
|
-
exports.save = save;
|
|
491
|
-
exports.load = load;
|
|
492
|
-
exports.useColors = useColors;
|
|
493
|
-
exports.storage = localstorage();
|
|
494
|
-
exports.destroy = (() => {
|
|
489
|
+
exports$1.formatArgs = formatArgs;
|
|
490
|
+
exports$1.save = save;
|
|
491
|
+
exports$1.load = load;
|
|
492
|
+
exports$1.useColors = useColors;
|
|
493
|
+
exports$1.storage = localstorage();
|
|
494
|
+
exports$1.destroy = (() => {
|
|
495
495
|
let warned = false;
|
|
496
496
|
|
|
497
497
|
return () => {
|
|
@@ -506,7 +506,7 @@ function requireBrowser$2 () {
|
|
|
506
506
|
* Colors.
|
|
507
507
|
*/
|
|
508
508
|
|
|
509
|
-
exports.colors = [
|
|
509
|
+
exports$1.colors = [
|
|
510
510
|
'#0000CC',
|
|
511
511
|
'#0000FF',
|
|
512
512
|
'#0033CC',
|
|
@@ -671,7 +671,7 @@ function requireBrowser$2 () {
|
|
|
671
671
|
*
|
|
672
672
|
* @api public
|
|
673
673
|
*/
|
|
674
|
-
exports.log = console.debug || console.log || (() => {});
|
|
674
|
+
exports$1.log = console.debug || console.log || (() => {});
|
|
675
675
|
|
|
676
676
|
/**
|
|
677
677
|
* Save `namespaces`.
|
|
@@ -682,9 +682,9 @@ function requireBrowser$2 () {
|
|
|
682
682
|
function save(namespaces) {
|
|
683
683
|
try {
|
|
684
684
|
if (namespaces) {
|
|
685
|
-
exports.storage.setItem('debug', namespaces);
|
|
685
|
+
exports$1.storage.setItem('debug', namespaces);
|
|
686
686
|
} else {
|
|
687
|
-
exports.storage.removeItem('debug');
|
|
687
|
+
exports$1.storage.removeItem('debug');
|
|
688
688
|
}
|
|
689
689
|
} catch (error) {
|
|
690
690
|
// Swallow
|
|
@@ -701,7 +701,7 @@ function requireBrowser$2 () {
|
|
|
701
701
|
function load() {
|
|
702
702
|
let r;
|
|
703
703
|
try {
|
|
704
|
-
r = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;
|
|
704
|
+
r = exports$1.storage.getItem('debug') || exports$1.storage.getItem('DEBUG') ;
|
|
705
705
|
} catch (error) {
|
|
706
706
|
// Swallow
|
|
707
707
|
// XXX (@Qix-) should we be logging these?
|
|
@@ -737,7 +737,7 @@ function requireBrowser$2 () {
|
|
|
737
737
|
}
|
|
738
738
|
}
|
|
739
739
|
|
|
740
|
-
module.exports = requireCommon()(exports);
|
|
740
|
+
module.exports = requireCommon()(exports$1);
|
|
741
741
|
|
|
742
742
|
const {formatters} = module.exports;
|
|
743
743
|
|
|
@@ -1053,7 +1053,7 @@ var hasRequiredBuffer;
|
|
|
1053
1053
|
function requireBuffer () {
|
|
1054
1054
|
if (hasRequiredBuffer) return buffer;
|
|
1055
1055
|
hasRequiredBuffer = 1;
|
|
1056
|
-
(function (exports) {
|
|
1056
|
+
(function (exports$1) {
|
|
1057
1057
|
|
|
1058
1058
|
const base64 = requireBase64Js();
|
|
1059
1059
|
const ieee754 = requireIeee754();
|
|
@@ -1062,12 +1062,12 @@ function requireBuffer () {
|
|
|
1062
1062
|
? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation
|
|
1063
1063
|
: null;
|
|
1064
1064
|
|
|
1065
|
-
exports.Buffer = Buffer;
|
|
1066
|
-
exports.SlowBuffer = SlowBuffer;
|
|
1067
|
-
exports.INSPECT_MAX_BYTES = 50;
|
|
1065
|
+
exports$1.Buffer = Buffer;
|
|
1066
|
+
exports$1.SlowBuffer = SlowBuffer;
|
|
1067
|
+
exports$1.INSPECT_MAX_BYTES = 50;
|
|
1068
1068
|
|
|
1069
1069
|
const K_MAX_LENGTH = 0x7fffffff;
|
|
1070
|
-
exports.kMaxLength = K_MAX_LENGTH;
|
|
1070
|
+
exports$1.kMaxLength = K_MAX_LENGTH;
|
|
1071
1071
|
|
|
1072
1072
|
/**
|
|
1073
1073
|
* If `Buffer.TYPED_ARRAY_SUPPORT`:
|
|
@@ -1663,7 +1663,7 @@ function requireBuffer () {
|
|
|
1663
1663
|
|
|
1664
1664
|
Buffer.prototype.inspect = function inspect () {
|
|
1665
1665
|
let str = '';
|
|
1666
|
-
const max = exports.INSPECT_MAX_BYTES;
|
|
1666
|
+
const max = exports$1.INSPECT_MAX_BYTES;
|
|
1667
1667
|
str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim();
|
|
1668
1668
|
if (this.length > max) str += ' ... ';
|
|
1669
1669
|
return '<Buffer ' + str + '>'
|
|
@@ -3160,7 +3160,7 @@ var hasRequiredSafeBuffer;
|
|
|
3160
3160
|
function requireSafeBuffer () {
|
|
3161
3161
|
if (hasRequiredSafeBuffer) return safeBuffer.exports;
|
|
3162
3162
|
hasRequiredSafeBuffer = 1;
|
|
3163
|
-
(function (module, exports) {
|
|
3163
|
+
(function (module, exports$1) {
|
|
3164
3164
|
/* eslint-disable node/no-deprecated-api */
|
|
3165
3165
|
var buffer = requireBuffer();
|
|
3166
3166
|
var Buffer = buffer.Buffer;
|
|
@@ -3175,8 +3175,8 @@ function requireSafeBuffer () {
|
|
|
3175
3175
|
module.exports = buffer;
|
|
3176
3176
|
} else {
|
|
3177
3177
|
// Copy properties from require('buffer')
|
|
3178
|
-
copyProps(buffer, exports);
|
|
3179
|
-
exports.Buffer = SafeBuffer;
|
|
3178
|
+
copyProps(buffer, exports$1);
|
|
3179
|
+
exports$1.Buffer = SafeBuffer;
|
|
3180
3180
|
}
|
|
3181
3181
|
|
|
3182
3182
|
function SafeBuffer (arg, encodingOrOffset, length) {
|
|
@@ -6397,16 +6397,16 @@ var hasRequiredReadableBrowser;
|
|
|
6397
6397
|
function requireReadableBrowser () {
|
|
6398
6398
|
if (hasRequiredReadableBrowser) return readableBrowser.exports;
|
|
6399
6399
|
hasRequiredReadableBrowser = 1;
|
|
6400
|
-
(function (module, exports) {
|
|
6401
|
-
exports = module.exports = require_stream_readable();
|
|
6402
|
-
exports.Stream = exports;
|
|
6403
|
-
exports.Readable = exports;
|
|
6404
|
-
exports.Writable = require_stream_writable();
|
|
6405
|
-
exports.Duplex = require_stream_duplex();
|
|
6406
|
-
exports.Transform = require_stream_transform();
|
|
6407
|
-
exports.PassThrough = require_stream_passthrough();
|
|
6408
|
-
exports.finished = requireEndOfStream();
|
|
6409
|
-
exports.pipeline = requirePipeline();
|
|
6400
|
+
(function (module, exports$1) {
|
|
6401
|
+
exports$1 = module.exports = require_stream_readable();
|
|
6402
|
+
exports$1.Stream = exports$1;
|
|
6403
|
+
exports$1.Readable = exports$1;
|
|
6404
|
+
exports$1.Writable = require_stream_writable();
|
|
6405
|
+
exports$1.Duplex = require_stream_duplex();
|
|
6406
|
+
exports$1.Transform = require_stream_transform();
|
|
6407
|
+
exports$1.PassThrough = require_stream_passthrough();
|
|
6408
|
+
exports$1.finished = requireEndOfStream();
|
|
6409
|
+
exports$1.pipeline = requirePipeline();
|
|
6410
6410
|
} (readableBrowser, readableBrowser.exports));
|
|
6411
6411
|
return readableBrowser.exports;
|
|
6412
6412
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as base, a as base58$1, i as index$2, c as index$3, d as index$4, e as index$5, I as Identity } from './identity-
|
|
1
|
+
import { b as base, a as base58$1, i as index$2, c as index$3, d as index$4, e as index$5, I as Identity } from './identity-nIyW_Xm8.js';
|
|
2
2
|
import { K as KeyPath, a as KeyValue } from './value-C3vAp-wb.js';
|
|
3
3
|
|
|
4
4
|
if (!globalThis.DEBUG) {
|
|
@@ -8366,7 +8366,7 @@ class Peernet {
|
|
|
8366
8366
|
this.root = options.root;
|
|
8367
8367
|
const { RequestMessage, ResponseMessage, PeerMessage, PeerMessageResponse, PeernetMessage, DHTMessage, DHTMessageResponse, DataMessage, DataMessageResponse, PsMessage, ChatMessage, PeernetFile
|
|
8368
8368
|
// FolderMessageResponse
|
|
8369
|
-
} = await import(/* webpackChunkName: "messages" */ './messages-
|
|
8369
|
+
} = await import(/* webpackChunkName: "messages" */ './messages-BzsDq0Y4.js');
|
|
8370
8370
|
/**
|
|
8371
8371
|
* proto Object containing protos
|
|
8372
8372
|
* @type {Object}
|
|
@@ -8460,7 +8460,7 @@ class Peernet {
|
|
|
8460
8460
|
if (this.#starting || this.#started)
|
|
8461
8461
|
return;
|
|
8462
8462
|
this.#starting = true;
|
|
8463
|
-
const importee = await import('./client-
|
|
8463
|
+
const importee = await import('./client-icdGX62_.js');
|
|
8464
8464
|
/**
|
|
8465
8465
|
* @access public
|
|
8466
8466
|
* @type {PeernetClient}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { P as default } from './peernet-
|
|
2
|
-
import './identity-
|
|
1
|
+
export { P as default } from './peernet-BV-q4kmL.js';
|
|
2
|
+
import './identity-nIyW_Xm8.js';
|
|
3
3
|
import './value-C3vAp-wb.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leofcoin/peernet",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.103",
|
|
4
4
|
"description": "",
|
|
5
5
|
"browser": "./exports/browser/peernet.js",
|
|
6
6
|
"exports": {
|
|
@@ -31,19 +31,19 @@
|
|
|
31
31
|
"author": "",
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@leofcoin/codec-format-interface": "^1.7.
|
|
34
|
+
"@leofcoin/codec-format-interface": "^1.7.14",
|
|
35
35
|
"@leofcoin/codecs": "^1.0.7",
|
|
36
36
|
"@leofcoin/generate-account": "^2.0.3",
|
|
37
37
|
"@leofcoin/identity-utils": "^1.0.2",
|
|
38
38
|
"@leofcoin/multi-wallet": "^3.1.8",
|
|
39
39
|
"@leofcoin/storage": "^3.5.38",
|
|
40
|
-
"@netpeer/swarm": "^0.8.
|
|
40
|
+
"@netpeer/swarm": "^0.8.32",
|
|
41
41
|
"@vandeurenglenn/base32": "^1.2.4",
|
|
42
42
|
"@vandeurenglenn/base58": "^1.1.9",
|
|
43
43
|
"@vandeurenglenn/debug": "^1.2.6",
|
|
44
44
|
"@vandeurenglenn/is-hex": "^1.1.1",
|
|
45
45
|
"@vandeurenglenn/little-pubsub": "^1.5.1",
|
|
46
|
-
"inquirer": "^
|
|
46
|
+
"inquirer": "^13.0.1",
|
|
47
47
|
"multi-signature": "^1.3.1",
|
|
48
48
|
"qr-scanner": "^1.4.2",
|
|
49
49
|
"qrcode": "^1.5.4",
|
|
@@ -52,19 +52,19 @@
|
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@jest/globals": "^30.2.0",
|
|
55
|
-
"@rollup/plugin-commonjs": "^
|
|
55
|
+
"@rollup/plugin-commonjs": "^29.0.0",
|
|
56
56
|
"@rollup/plugin-json": "^6.1.0",
|
|
57
57
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
58
58
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
59
59
|
"@rollup/plugin-wasm": "^6.2.2",
|
|
60
60
|
"@types/bs58check": "^3.0.1",
|
|
61
|
-
"@types/node": "^24.
|
|
62
|
-
"@types/qrcode": "^1.5.
|
|
61
|
+
"@types/node": "^24.10.1",
|
|
62
|
+
"@types/qrcode": "^1.5.6",
|
|
63
63
|
"@types/secp256k1": "^4.0.7",
|
|
64
64
|
"@types/varint": "^6.0.3",
|
|
65
|
-
"chai": "^6.2.
|
|
65
|
+
"chai": "^6.2.1",
|
|
66
66
|
"cross-env": "^10.1.0",
|
|
67
|
-
"rollup": "^4.
|
|
67
|
+
"rollup": "^4.53.3",
|
|
68
68
|
"sinon": "^21.0.0"
|
|
69
69
|
}
|
|
70
70
|
}
|