package-installer-cli 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bundle-standalone/cli-with-packages.js +2991 -170
- data/bundle-standalone/template.json +18 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/README.md +7 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/components.json +21 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/index.html +14 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/jsconfig.json +10 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/package.json +23 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/public/tauri.svg +6 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/public/vite.svg +1 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src/App.css +116 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src/App.jsx +51 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src/assets/react.svg +1 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src/components/ui/button.jsx +55 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src/components/ui/card.jsx +101 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src/components/ui/input.jsx +24 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src/components/ui/textarea.jsx +20 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src/lib/utils.js +6 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src/main.jsx +9 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src-tauri/Cargo.toml +25 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src-tauri/build.rs +3 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src-tauri/capabilities/default.json +10 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src-tauri/icons/128x128.png +0 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src-tauri/icons/128x128@2x.png +0 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src-tauri/icons/32x32.png +0 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src-tauri/icons/Square107x107Logo.png +0 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src-tauri/icons/Square142x142Logo.png +0 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src-tauri/icons/Square150x150Logo.png +0 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src-tauri/icons/Square284x284Logo.png +0 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src-tauri/icons/Square30x30Logo.png +0 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src-tauri/icons/Square310x310Logo.png +0 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src-tauri/icons/Square44x44Logo.png +0 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src-tauri/icons/Square71x71Logo.png +0 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src-tauri/icons/Square89x89Logo.png +0 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src-tauri/icons/StoreLogo.png +0 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src-tauri/icons/icon.icns +0 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src-tauri/icons/icon.ico +0 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src-tauri/icons/icon.png +0 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src-tauri/src/lib.rs +14 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src-tauri/src/main.rs +6 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/src-tauri/tauri.conf.json +35 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/tailwind.config.js +12 -0
- data/bundle-standalone/templates/tauri/javascript/react-frontend/vite.config.js +31 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/README.md +7 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/angular.json +78 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/package.json +32 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src/app/app.component.css +112 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src/app/app.component.html +21 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src/app/app.component.ts +22 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src/app/app.config.ts +16 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src/app/app.routes.ts +3 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src/assets/angular.svg +16 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src/assets/tauri.svg +6 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src/index.html +12 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src/main.ts +7 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src/styles.css +1 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src-tauri/Cargo.toml +25 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src-tauri/build.rs +3 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src-tauri/capabilities/default.json +10 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src-tauri/icons/128x128.png +0 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src-tauri/icons/128x128@2x.png +0 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src-tauri/icons/32x32.png +0 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src-tauri/icons/Square107x107Logo.png +0 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src-tauri/icons/Square142x142Logo.png +0 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src-tauri/icons/Square150x150Logo.png +0 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src-tauri/icons/Square284x284Logo.png +0 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src-tauri/icons/Square30x30Logo.png +0 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src-tauri/icons/Square310x310Logo.png +0 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src-tauri/icons/Square44x44Logo.png +0 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src-tauri/icons/Square71x71Logo.png +0 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src-tauri/icons/Square89x89Logo.png +0 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src-tauri/icons/StoreLogo.png +0 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src-tauri/icons/icon.icns +0 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src-tauri/icons/icon.ico +0 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src-tauri/icons/icon.png +0 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src-tauri/src/lib.rs +14 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src-tauri/src/main.rs +6 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/src-tauri/tauri.conf.json +35 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/tsconfig.app.json +11 -0
- data/bundle-standalone/templates/tauri/javascript/tauri-app/tsconfig.json +26 -0
- data/bundle-standalone/templates/tauri/rust/tauri-rust-template/README.md +7 -0
- data/bundle-standalone/templates/tauri/rust/tauri-rust-template/src/assets/javascript.svg +1 -0
- data/bundle-standalone/templates/tauri/rust/tauri-rust-template/src/assets/tauri.svg +6 -0
- data/bundle-standalone/templates/tauri/rust/tauri-rust-template/src/index.html +39 -0
- data/bundle-standalone/templates/tauri/rust/tauri-rust-template/src/main.js +18 -0
- data/bundle-standalone/templates/tauri/rust/tauri-rust-template/src/styles.css +112 -0
- data/bundle-standalone/templates/tauri/rust/tauri-rust-template/src-tauri/Cargo.toml +25 -0
- data/bundle-standalone/templates/tauri/rust/tauri-rust-template/src-tauri/build.rs +3 -0
- data/bundle-standalone/templates/tauri/rust/tauri-rust-template/src-tauri/capabilities/default.json +10 -0
- data/bundle-standalone/templates/tauri/rust/tauri-rust-template/src-tauri/icons/128x128.png +0 -0
- data/bundle-standalone/templates/tauri/rust/tauri-rust-template/src-tauri/icons/128x128@2x.png +0 -0
- data/bundle-standalone/templates/tauri/rust/tauri-rust-template/src-tauri/icons/32x32.png +0 -0
- data/bundle-standalone/templates/tauri/rust/tauri-rust-template/src-tauri/icons/Square107x107Logo.png +0 -0
- data/bundle-standalone/templates/tauri/rust/tauri-rust-template/src-tauri/icons/Square142x142Logo.png +0 -0
- data/bundle-standalone/templates/tauri/rust/tauri-rust-template/src-tauri/icons/Square150x150Logo.png +0 -0
- data/bundle-standalone/templates/tauri/rust/tauri-rust-template/src-tauri/icons/Square284x284Logo.png +0 -0
- data/bundle-standalone/templates/tauri/rust/tauri-rust-template/src-tauri/icons/Square30x30Logo.png +0 -0
- data/bundle-standalone/templates/tauri/rust/tauri-rust-template/src-tauri/icons/Square310x310Logo.png +0 -0
- data/bundle-standalone/templates/tauri/rust/tauri-rust-template/src-tauri/icons/Square44x44Logo.png +0 -0
- data/bundle-standalone/templates/tauri/rust/tauri-rust-template/src-tauri/icons/Square71x71Logo.png +0 -0
- data/bundle-standalone/templates/tauri/rust/tauri-rust-template/src-tauri/icons/Square89x89Logo.png +0 -0
- data/bundle-standalone/templates/tauri/rust/tauri-rust-template/src-tauri/icons/StoreLogo.png +0 -0
- data/bundle-standalone/templates/tauri/rust/tauri-rust-template/src-tauri/icons/icon.icns +0 -0
- data/bundle-standalone/templates/tauri/rust/tauri-rust-template/src-tauri/icons/icon.ico +0 -0
- data/bundle-standalone/templates/tauri/rust/tauri-rust-template/src-tauri/icons/icon.png +0 -0
- data/bundle-standalone/templates/tauri/rust/tauri-rust-template/src-tauri/src/lib.rs +14 -0
- data/bundle-standalone/templates/tauri/rust/tauri-rust-template/src-tauri/src/main.rs +6 -0
- data/bundle-standalone/templates/tauri/rust/tauri-rust-template/src-tauri/tauri.conf.json +33 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/README.md +7 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/angular.json +78 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/jsconfig.app.json +11 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/jsconfig.json +26 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/package.json +32 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src/app/app.component.css +112 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src/app/app.component.html +21 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src/app/app.component.ts +22 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src/app/app.config.ts +16 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src/app/app.routes.ts +3 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src/assets/angular.svg +16 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src/assets/tauri.svg +6 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src/index.html +12 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src/main.ts +7 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src/styles.css +1 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src-tauri/Cargo.toml +25 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src-tauri/build.rs +3 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src-tauri/capabilities/default.json +10 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src-tauri/icons/128x128.png +0 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src-tauri/icons/128x128@2x.png +0 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src-tauri/icons/32x32.png +0 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src-tauri/icons/Square107x107Logo.png +0 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src-tauri/icons/Square142x142Logo.png +0 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src-tauri/icons/Square150x150Logo.png +0 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src-tauri/icons/Square284x284Logo.png +0 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src-tauri/icons/Square30x30Logo.png +0 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src-tauri/icons/Square310x310Logo.png +0 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src-tauri/icons/Square44x44Logo.png +0 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src-tauri/icons/Square71x71Logo.png +0 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src-tauri/icons/Square89x89Logo.png +0 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src-tauri/icons/StoreLogo.png +0 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src-tauri/icons/icon.icns +0 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src-tauri/icons/icon.ico +0 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src-tauri/icons/icon.png +0 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src-tauri/src/lib.rs +14 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src-tauri/src/main.rs +6 -0
- data/bundle-standalone/templates/tauri/typescript/angular-frontend/src-tauri/tauri.conf.json +35 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/README.md +7 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/components.json +21 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/index.html +14 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/package.json +26 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/public/tauri.svg +6 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/public/vite.svg +1 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src/App.css +116 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src/App.tsx +51 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src/assets/react.svg +1 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src/components/ui/button.tsx +59 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src/components/ui/card.tsx +92 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src/components/ui/input.tsx +21 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src/components/ui/textarea.tsx +18 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src/lib/utils.ts +6 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src/main.tsx +9 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src/vite-env.d.ts +1 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src-tauri/Cargo.toml +25 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src-tauri/build.rs +3 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src-tauri/capabilities/default.json +10 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src-tauri/icons/128x128.png +0 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src-tauri/icons/128x128@2x.png +0 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src-tauri/icons/32x32.png +0 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src-tauri/icons/Square107x107Logo.png +0 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src-tauri/icons/Square142x142Logo.png +0 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src-tauri/icons/Square150x150Logo.png +0 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src-tauri/icons/Square284x284Logo.png +0 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src-tauri/icons/Square30x30Logo.png +0 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src-tauri/icons/Square310x310Logo.png +0 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src-tauri/icons/Square44x44Logo.png +0 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src-tauri/icons/Square71x71Logo.png +0 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src-tauri/icons/Square89x89Logo.png +0 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src-tauri/icons/StoreLogo.png +0 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src-tauri/icons/icon.icns +0 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src-tauri/icons/icon.ico +0 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src-tauri/icons/icon.png +0 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src-tauri/src/lib.rs +14 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src-tauri/src/main.rs +6 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/src-tauri/tauri.conf.json +35 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/tailwind.config.js +11 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/tsconfig.json +25 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/tsconfig.node.json +10 -0
- data/bundle-standalone/templates/tauri/typescript/react-fronend/vite.config.ts +32 -0
- metadata +193 -8
- /data/bundle-standalone/templates/electron/{template/javascript → javascript/template}/index.html +0 -0
- /data/bundle-standalone/templates/electron/{template/javascript → javascript/template}/main.js +0 -0
- /data/bundle-standalone/templates/electron/{template/javascript → javascript/template}/package.json +0 -0
- /data/bundle-standalone/templates/electron/{template/typescript → typescript/template}/index.html +0 -0
- /data/bundle-standalone/templates/electron/{template/typescript → typescript/template}/main.ts +0 -0
- /data/bundle-standalone/templates/electron/{template/typescript → typescript/template}/package.json +0 -0
|
@@ -1235,6 +1235,39 @@ module.exports.makeDirSync = (dir, options) => {
|
|
|
1235
1235
|
}
|
|
1236
1236
|
|
|
1237
1237
|
|
|
1238
|
+
/***/ }),
|
|
1239
|
+
|
|
1240
|
+
/***/ 279:
|
|
1241
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1242
|
+
|
|
1243
|
+
/**
|
|
1244
|
+
* @otplib/plugin-crypto
|
|
1245
|
+
*
|
|
1246
|
+
* @author Gerald Yeo <contact@fusedthought.com>
|
|
1247
|
+
* @version: 12.0.1
|
|
1248
|
+
* @license: MIT
|
|
1249
|
+
**/
|
|
1250
|
+
|
|
1251
|
+
|
|
1252
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1253
|
+
|
|
1254
|
+
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
1255
|
+
|
|
1256
|
+
var crypto = _interopDefault(__webpack_require__(6982));
|
|
1257
|
+
|
|
1258
|
+
const createDigest = (algorithm, hmacKey, counter) => {
|
|
1259
|
+
const hmac = crypto.createHmac(algorithm, Buffer.from(hmacKey, 'hex'));
|
|
1260
|
+
const digest = hmac.update(Buffer.from(counter, 'hex')).digest();
|
|
1261
|
+
return digest.toString('hex');
|
|
1262
|
+
};
|
|
1263
|
+
const createRandomBytes = (size, encoding) => {
|
|
1264
|
+
return crypto.randomBytes(size).toString(encoding);
|
|
1265
|
+
};
|
|
1266
|
+
|
|
1267
|
+
exports.createDigest = createDigest;
|
|
1268
|
+
exports.createRandomBytes = createRandomBytes;
|
|
1269
|
+
|
|
1270
|
+
|
|
1238
1271
|
/***/ }),
|
|
1239
1272
|
|
|
1240
1273
|
/***/ 287:
|
|
@@ -2232,6 +2265,20 @@ function isSubscriber(value) {
|
|
|
2232
2265
|
}
|
|
2233
2266
|
//# sourceMappingURL=Observable.js.map
|
|
2234
2267
|
|
|
2268
|
+
/***/ }),
|
|
2269
|
+
|
|
2270
|
+
/***/ 543:
|
|
2271
|
+
/***/ ((module) => {
|
|
2272
|
+
|
|
2273
|
+
module.exports = {
|
|
2274
|
+
L : 1,
|
|
2275
|
+
M : 0,
|
|
2276
|
+
Q : 3,
|
|
2277
|
+
H : 2
|
|
2278
|
+
};
|
|
2279
|
+
|
|
2280
|
+
|
|
2281
|
+
|
|
2235
2282
|
/***/ }),
|
|
2236
2283
|
|
|
2237
2284
|
/***/ 553:
|
|
@@ -3643,6 +3690,39 @@ if (!processOk(process)) {
|
|
|
3643
3690
|
}
|
|
3644
3691
|
|
|
3645
3692
|
|
|
3693
|
+
/***/ }),
|
|
3694
|
+
|
|
3695
|
+
/***/ 942:
|
|
3696
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3697
|
+
|
|
3698
|
+
/*
|
|
3699
|
+
Copyright (c) 2011, Chris Umbel
|
|
3700
|
+
|
|
3701
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
3702
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
3703
|
+
in the Software without restriction, including without limitation the rights
|
|
3704
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
3705
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
3706
|
+
furnished to do so, subject to the following conditions:
|
|
3707
|
+
|
|
3708
|
+
The above copyright notice and this permission notice shall be included in
|
|
3709
|
+
all copies or substantial portions of the Software.
|
|
3710
|
+
|
|
3711
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
3712
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
3713
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
3714
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
3715
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
3716
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
3717
|
+
THE SOFTWARE.
|
|
3718
|
+
*/
|
|
3719
|
+
|
|
3720
|
+
var base32 = __webpack_require__(1103);
|
|
3721
|
+
|
|
3722
|
+
exports.encode = base32.encode;
|
|
3723
|
+
exports.decode = base32.decode;
|
|
3724
|
+
|
|
3725
|
+
|
|
3646
3726
|
/***/ }),
|
|
3647
3727
|
|
|
3648
3728
|
/***/ 963:
|
|
@@ -6696,6 +6776,141 @@ var AsapScheduler = (function (_super) {
|
|
|
6696
6776
|
exports.AsapScheduler = AsapScheduler;
|
|
6697
6777
|
//# sourceMappingURL=AsapScheduler.js.map
|
|
6698
6778
|
|
|
6779
|
+
/***/ }),
|
|
6780
|
+
|
|
6781
|
+
/***/ 1103:
|
|
6782
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
6783
|
+
|
|
6784
|
+
/*
|
|
6785
|
+
Copyright (c) 2011, Chris Umbel
|
|
6786
|
+
|
|
6787
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6788
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6789
|
+
in the Software without restriction, including without limitation the rights
|
|
6790
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
6791
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
6792
|
+
furnished to do so, subject to the following conditions:
|
|
6793
|
+
|
|
6794
|
+
The above copyright notice and this permission notice shall be included in
|
|
6795
|
+
all copies or substantial portions of the Software.
|
|
6796
|
+
|
|
6797
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
6798
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
6799
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
6800
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
6801
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
6802
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
6803
|
+
THE SOFTWARE.
|
|
6804
|
+
*/
|
|
6805
|
+
|
|
6806
|
+
|
|
6807
|
+
var charTable = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
|
|
6808
|
+
var byteTable = [
|
|
6809
|
+
0xff, 0xff, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
|
|
6810
|
+
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
|
6811
|
+
0xff, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
|
|
6812
|
+
0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
|
|
6813
|
+
0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
|
|
6814
|
+
0x17, 0x18, 0x19, 0xff, 0xff, 0xff, 0xff, 0xff,
|
|
6815
|
+
0xff, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
|
|
6816
|
+
0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
|
|
6817
|
+
0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
|
|
6818
|
+
0x17, 0x18, 0x19, 0xff, 0xff, 0xff, 0xff, 0xff
|
|
6819
|
+
];
|
|
6820
|
+
|
|
6821
|
+
function quintetCount(buff) {
|
|
6822
|
+
var quintets = Math.floor(buff.length / 5);
|
|
6823
|
+
return buff.length % 5 === 0 ? quintets: quintets + 1;
|
|
6824
|
+
}
|
|
6825
|
+
|
|
6826
|
+
exports.encode = function(plain) {
|
|
6827
|
+
if(!Buffer.isBuffer(plain)){
|
|
6828
|
+
plain = new Buffer(plain);
|
|
6829
|
+
}
|
|
6830
|
+
var i = 0;
|
|
6831
|
+
var j = 0;
|
|
6832
|
+
var shiftIndex = 0;
|
|
6833
|
+
var digit = 0;
|
|
6834
|
+
var encoded = new Buffer(quintetCount(plain) * 8);
|
|
6835
|
+
|
|
6836
|
+
/* byte by byte isn't as pretty as quintet by quintet but tests a bit
|
|
6837
|
+
faster. will have to revisit. */
|
|
6838
|
+
while(i < plain.length) {
|
|
6839
|
+
var current = plain[i];
|
|
6840
|
+
|
|
6841
|
+
if(shiftIndex > 3) {
|
|
6842
|
+
digit = current & (0xff >> shiftIndex);
|
|
6843
|
+
shiftIndex = (shiftIndex + 5) % 8;
|
|
6844
|
+
digit = (digit << shiftIndex) | ((i + 1 < plain.length) ?
|
|
6845
|
+
plain[i + 1] : 0) >> (8 - shiftIndex);
|
|
6846
|
+
i++;
|
|
6847
|
+
} else {
|
|
6848
|
+
digit = (current >> (8 - (shiftIndex + 5))) & 0x1f;
|
|
6849
|
+
shiftIndex = (shiftIndex + 5) % 8;
|
|
6850
|
+
if(shiftIndex === 0) i++;
|
|
6851
|
+
}
|
|
6852
|
+
|
|
6853
|
+
encoded[j] = charTable.charCodeAt(digit);
|
|
6854
|
+
j++;
|
|
6855
|
+
}
|
|
6856
|
+
|
|
6857
|
+
for(i = j; i < encoded.length; i++) {
|
|
6858
|
+
encoded[i] = 0x3d; //'='.charCodeAt(0)
|
|
6859
|
+
}
|
|
6860
|
+
|
|
6861
|
+
return encoded;
|
|
6862
|
+
};
|
|
6863
|
+
|
|
6864
|
+
exports.decode = function(encoded) {
|
|
6865
|
+
var shiftIndex = 0;
|
|
6866
|
+
var plainDigit = 0;
|
|
6867
|
+
var plainChar;
|
|
6868
|
+
var plainPos = 0;
|
|
6869
|
+
if(!Buffer.isBuffer(encoded)){
|
|
6870
|
+
encoded = new Buffer(encoded);
|
|
6871
|
+
}
|
|
6872
|
+
var decoded = new Buffer(Math.ceil(encoded.length * 5 / 8));
|
|
6873
|
+
|
|
6874
|
+
/* byte by byte isn't as pretty as octet by octet but tests a bit
|
|
6875
|
+
faster. will have to revisit. */
|
|
6876
|
+
for(var i = 0; i < encoded.length; i++) {
|
|
6877
|
+
if(encoded[i] === 0x3d){ //'='
|
|
6878
|
+
break;
|
|
6879
|
+
}
|
|
6880
|
+
|
|
6881
|
+
var encodedByte = encoded[i] - 0x30;
|
|
6882
|
+
|
|
6883
|
+
if(encodedByte < byteTable.length) {
|
|
6884
|
+
plainDigit = byteTable[encodedByte];
|
|
6885
|
+
|
|
6886
|
+
if(shiftIndex <= 3) {
|
|
6887
|
+
shiftIndex = (shiftIndex + 5) % 8;
|
|
6888
|
+
|
|
6889
|
+
if(shiftIndex === 0) {
|
|
6890
|
+
plainChar |= plainDigit;
|
|
6891
|
+
decoded[plainPos] = plainChar;
|
|
6892
|
+
plainPos++;
|
|
6893
|
+
plainChar = 0;
|
|
6894
|
+
} else {
|
|
6895
|
+
plainChar |= 0xff & (plainDigit << (8 - shiftIndex));
|
|
6896
|
+
}
|
|
6897
|
+
} else {
|
|
6898
|
+
shiftIndex = (shiftIndex + 5) % 8;
|
|
6899
|
+
plainChar |= 0xff & (plainDigit >>> shiftIndex);
|
|
6900
|
+
decoded[plainPos] = plainChar;
|
|
6901
|
+
plainPos++;
|
|
6902
|
+
|
|
6903
|
+
plainChar = 0xff & (plainDigit << (8 - shiftIndex));
|
|
6904
|
+
}
|
|
6905
|
+
} else {
|
|
6906
|
+
throw new Error('Invalid input - it is not base32 encoded string');
|
|
6907
|
+
}
|
|
6908
|
+
}
|
|
6909
|
+
|
|
6910
|
+
return decoded.slice(0, plainPos);
|
|
6911
|
+
};
|
|
6912
|
+
|
|
6913
|
+
|
|
6699
6914
|
/***/ }),
|
|
6700
6915
|
|
|
6701
6916
|
/***/ 1205:
|
|
@@ -9509,6 +9724,285 @@ function windowToggle(openings, closingSelector) {
|
|
|
9509
9724
|
exports.windowToggle = windowToggle;
|
|
9510
9725
|
//# sourceMappingURL=windowToggle.js.map
|
|
9511
9726
|
|
|
9727
|
+
/***/ }),
|
|
9728
|
+
|
|
9729
|
+
/***/ 1678:
|
|
9730
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
9731
|
+
|
|
9732
|
+
var QRMode = __webpack_require__(9802);
|
|
9733
|
+
var QRPolynomial = __webpack_require__(5739);
|
|
9734
|
+
var QRMath = __webpack_require__(6543);
|
|
9735
|
+
var QRMaskPattern = __webpack_require__(9207);
|
|
9736
|
+
|
|
9737
|
+
var QRUtil = {
|
|
9738
|
+
|
|
9739
|
+
PATTERN_POSITION_TABLE : [
|
|
9740
|
+
[],
|
|
9741
|
+
[6, 18],
|
|
9742
|
+
[6, 22],
|
|
9743
|
+
[6, 26],
|
|
9744
|
+
[6, 30],
|
|
9745
|
+
[6, 34],
|
|
9746
|
+
[6, 22, 38],
|
|
9747
|
+
[6, 24, 42],
|
|
9748
|
+
[6, 26, 46],
|
|
9749
|
+
[6, 28, 50],
|
|
9750
|
+
[6, 30, 54],
|
|
9751
|
+
[6, 32, 58],
|
|
9752
|
+
[6, 34, 62],
|
|
9753
|
+
[6, 26, 46, 66],
|
|
9754
|
+
[6, 26, 48, 70],
|
|
9755
|
+
[6, 26, 50, 74],
|
|
9756
|
+
[6, 30, 54, 78],
|
|
9757
|
+
[6, 30, 56, 82],
|
|
9758
|
+
[6, 30, 58, 86],
|
|
9759
|
+
[6, 34, 62, 90],
|
|
9760
|
+
[6, 28, 50, 72, 94],
|
|
9761
|
+
[6, 26, 50, 74, 98],
|
|
9762
|
+
[6, 30, 54, 78, 102],
|
|
9763
|
+
[6, 28, 54, 80, 106],
|
|
9764
|
+
[6, 32, 58, 84, 110],
|
|
9765
|
+
[6, 30, 58, 86, 114],
|
|
9766
|
+
[6, 34, 62, 90, 118],
|
|
9767
|
+
[6, 26, 50, 74, 98, 122],
|
|
9768
|
+
[6, 30, 54, 78, 102, 126],
|
|
9769
|
+
[6, 26, 52, 78, 104, 130],
|
|
9770
|
+
[6, 30, 56, 82, 108, 134],
|
|
9771
|
+
[6, 34, 60, 86, 112, 138],
|
|
9772
|
+
[6, 30, 58, 86, 114, 142],
|
|
9773
|
+
[6, 34, 62, 90, 118, 146],
|
|
9774
|
+
[6, 30, 54, 78, 102, 126, 150],
|
|
9775
|
+
[6, 24, 50, 76, 102, 128, 154],
|
|
9776
|
+
[6, 28, 54, 80, 106, 132, 158],
|
|
9777
|
+
[6, 32, 58, 84, 110, 136, 162],
|
|
9778
|
+
[6, 26, 54, 82, 110, 138, 166],
|
|
9779
|
+
[6, 30, 58, 86, 114, 142, 170]
|
|
9780
|
+
],
|
|
9781
|
+
|
|
9782
|
+
G15 : (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0),
|
|
9783
|
+
G18 : (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0),
|
|
9784
|
+
G15_MASK : (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1),
|
|
9785
|
+
|
|
9786
|
+
getBCHTypeInfo : function(data) {
|
|
9787
|
+
var d = data << 10;
|
|
9788
|
+
while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
|
|
9789
|
+
d ^= (QRUtil.G15 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) ) );
|
|
9790
|
+
}
|
|
9791
|
+
return ( (data << 10) | d) ^ QRUtil.G15_MASK;
|
|
9792
|
+
},
|
|
9793
|
+
|
|
9794
|
+
getBCHTypeNumber : function(data) {
|
|
9795
|
+
var d = data << 12;
|
|
9796
|
+
while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
|
|
9797
|
+
d ^= (QRUtil.G18 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) ) );
|
|
9798
|
+
}
|
|
9799
|
+
return (data << 12) | d;
|
|
9800
|
+
},
|
|
9801
|
+
|
|
9802
|
+
getBCHDigit : function(data) {
|
|
9803
|
+
|
|
9804
|
+
var digit = 0;
|
|
9805
|
+
|
|
9806
|
+
while (data !== 0) {
|
|
9807
|
+
digit++;
|
|
9808
|
+
data >>>= 1;
|
|
9809
|
+
}
|
|
9810
|
+
|
|
9811
|
+
return digit;
|
|
9812
|
+
},
|
|
9813
|
+
|
|
9814
|
+
getPatternPosition : function(typeNumber) {
|
|
9815
|
+
return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
|
|
9816
|
+
},
|
|
9817
|
+
|
|
9818
|
+
getMask : function(maskPattern, i, j) {
|
|
9819
|
+
|
|
9820
|
+
switch (maskPattern) {
|
|
9821
|
+
|
|
9822
|
+
case QRMaskPattern.PATTERN000 : return (i + j) % 2 === 0;
|
|
9823
|
+
case QRMaskPattern.PATTERN001 : return i % 2 === 0;
|
|
9824
|
+
case QRMaskPattern.PATTERN010 : return j % 3 === 0;
|
|
9825
|
+
case QRMaskPattern.PATTERN011 : return (i + j) % 3 === 0;
|
|
9826
|
+
case QRMaskPattern.PATTERN100 : return (Math.floor(i / 2) + Math.floor(j / 3) ) % 2 === 0;
|
|
9827
|
+
case QRMaskPattern.PATTERN101 : return (i * j) % 2 + (i * j) % 3 === 0;
|
|
9828
|
+
case QRMaskPattern.PATTERN110 : return ( (i * j) % 2 + (i * j) % 3) % 2 === 0;
|
|
9829
|
+
case QRMaskPattern.PATTERN111 : return ( (i * j) % 3 + (i + j) % 2) % 2 === 0;
|
|
9830
|
+
|
|
9831
|
+
default :
|
|
9832
|
+
throw new Error("bad maskPattern:" + maskPattern);
|
|
9833
|
+
}
|
|
9834
|
+
},
|
|
9835
|
+
|
|
9836
|
+
getErrorCorrectPolynomial : function(errorCorrectLength) {
|
|
9837
|
+
|
|
9838
|
+
var a = new QRPolynomial([1], 0);
|
|
9839
|
+
|
|
9840
|
+
for (var i = 0; i < errorCorrectLength; i++) {
|
|
9841
|
+
a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0) );
|
|
9842
|
+
}
|
|
9843
|
+
|
|
9844
|
+
return a;
|
|
9845
|
+
},
|
|
9846
|
+
|
|
9847
|
+
getLengthInBits : function(mode, type) {
|
|
9848
|
+
|
|
9849
|
+
if (1 <= type && type < 10) {
|
|
9850
|
+
|
|
9851
|
+
// 1 - 9
|
|
9852
|
+
|
|
9853
|
+
switch(mode) {
|
|
9854
|
+
case QRMode.MODE_NUMBER : return 10;
|
|
9855
|
+
case QRMode.MODE_ALPHA_NUM : return 9;
|
|
9856
|
+
case QRMode.MODE_8BIT_BYTE : return 8;
|
|
9857
|
+
case QRMode.MODE_KANJI : return 8;
|
|
9858
|
+
default :
|
|
9859
|
+
throw new Error("mode:" + mode);
|
|
9860
|
+
}
|
|
9861
|
+
|
|
9862
|
+
} else if (type < 27) {
|
|
9863
|
+
|
|
9864
|
+
// 10 - 26
|
|
9865
|
+
|
|
9866
|
+
switch(mode) {
|
|
9867
|
+
case QRMode.MODE_NUMBER : return 12;
|
|
9868
|
+
case QRMode.MODE_ALPHA_NUM : return 11;
|
|
9869
|
+
case QRMode.MODE_8BIT_BYTE : return 16;
|
|
9870
|
+
case QRMode.MODE_KANJI : return 10;
|
|
9871
|
+
default :
|
|
9872
|
+
throw new Error("mode:" + mode);
|
|
9873
|
+
}
|
|
9874
|
+
|
|
9875
|
+
} else if (type < 41) {
|
|
9876
|
+
|
|
9877
|
+
// 27 - 40
|
|
9878
|
+
|
|
9879
|
+
switch(mode) {
|
|
9880
|
+
case QRMode.MODE_NUMBER : return 14;
|
|
9881
|
+
case QRMode.MODE_ALPHA_NUM : return 13;
|
|
9882
|
+
case QRMode.MODE_8BIT_BYTE : return 16;
|
|
9883
|
+
case QRMode.MODE_KANJI : return 12;
|
|
9884
|
+
default :
|
|
9885
|
+
throw new Error("mode:" + mode);
|
|
9886
|
+
}
|
|
9887
|
+
|
|
9888
|
+
} else {
|
|
9889
|
+
throw new Error("type:" + type);
|
|
9890
|
+
}
|
|
9891
|
+
},
|
|
9892
|
+
|
|
9893
|
+
getLostPoint : function(qrCode) {
|
|
9894
|
+
|
|
9895
|
+
var moduleCount = qrCode.getModuleCount();
|
|
9896
|
+
var lostPoint = 0;
|
|
9897
|
+
var row = 0;
|
|
9898
|
+
var col = 0;
|
|
9899
|
+
|
|
9900
|
+
|
|
9901
|
+
// LEVEL1
|
|
9902
|
+
|
|
9903
|
+
for (row = 0; row < moduleCount; row++) {
|
|
9904
|
+
|
|
9905
|
+
for (col = 0; col < moduleCount; col++) {
|
|
9906
|
+
|
|
9907
|
+
var sameCount = 0;
|
|
9908
|
+
var dark = qrCode.isDark(row, col);
|
|
9909
|
+
|
|
9910
|
+
for (var r = -1; r <= 1; r++) {
|
|
9911
|
+
|
|
9912
|
+
if (row + r < 0 || moduleCount <= row + r) {
|
|
9913
|
+
continue;
|
|
9914
|
+
}
|
|
9915
|
+
|
|
9916
|
+
for (var c = -1; c <= 1; c++) {
|
|
9917
|
+
|
|
9918
|
+
if (col + c < 0 || moduleCount <= col + c) {
|
|
9919
|
+
continue;
|
|
9920
|
+
}
|
|
9921
|
+
|
|
9922
|
+
if (r === 0 && c === 0) {
|
|
9923
|
+
continue;
|
|
9924
|
+
}
|
|
9925
|
+
|
|
9926
|
+
if (dark === qrCode.isDark(row + r, col + c) ) {
|
|
9927
|
+
sameCount++;
|
|
9928
|
+
}
|
|
9929
|
+
}
|
|
9930
|
+
}
|
|
9931
|
+
|
|
9932
|
+
if (sameCount > 5) {
|
|
9933
|
+
lostPoint += (3 + sameCount - 5);
|
|
9934
|
+
}
|
|
9935
|
+
}
|
|
9936
|
+
}
|
|
9937
|
+
|
|
9938
|
+
// LEVEL2
|
|
9939
|
+
|
|
9940
|
+
for (row = 0; row < moduleCount - 1; row++) {
|
|
9941
|
+
for (col = 0; col < moduleCount - 1; col++) {
|
|
9942
|
+
var count = 0;
|
|
9943
|
+
if (qrCode.isDark(row, col ) ) count++;
|
|
9944
|
+
if (qrCode.isDark(row + 1, col ) ) count++;
|
|
9945
|
+
if (qrCode.isDark(row, col + 1) ) count++;
|
|
9946
|
+
if (qrCode.isDark(row + 1, col + 1) ) count++;
|
|
9947
|
+
if (count === 0 || count === 4) {
|
|
9948
|
+
lostPoint += 3;
|
|
9949
|
+
}
|
|
9950
|
+
}
|
|
9951
|
+
}
|
|
9952
|
+
|
|
9953
|
+
// LEVEL3
|
|
9954
|
+
|
|
9955
|
+
for (row = 0; row < moduleCount; row++) {
|
|
9956
|
+
for (col = 0; col < moduleCount - 6; col++) {
|
|
9957
|
+
if (qrCode.isDark(row, col) &&
|
|
9958
|
+
!qrCode.isDark(row, col + 1) &&
|
|
9959
|
+
qrCode.isDark(row, col + 2) &&
|
|
9960
|
+
qrCode.isDark(row, col + 3) &&
|
|
9961
|
+
qrCode.isDark(row, col + 4) &&
|
|
9962
|
+
!qrCode.isDark(row, col + 5) &&
|
|
9963
|
+
qrCode.isDark(row, col + 6) ) {
|
|
9964
|
+
lostPoint += 40;
|
|
9965
|
+
}
|
|
9966
|
+
}
|
|
9967
|
+
}
|
|
9968
|
+
|
|
9969
|
+
for (col = 0; col < moduleCount; col++) {
|
|
9970
|
+
for (row = 0; row < moduleCount - 6; row++) {
|
|
9971
|
+
if (qrCode.isDark(row, col) &&
|
|
9972
|
+
!qrCode.isDark(row + 1, col) &&
|
|
9973
|
+
qrCode.isDark(row + 2, col) &&
|
|
9974
|
+
qrCode.isDark(row + 3, col) &&
|
|
9975
|
+
qrCode.isDark(row + 4, col) &&
|
|
9976
|
+
!qrCode.isDark(row + 5, col) &&
|
|
9977
|
+
qrCode.isDark(row + 6, col) ) {
|
|
9978
|
+
lostPoint += 40;
|
|
9979
|
+
}
|
|
9980
|
+
}
|
|
9981
|
+
}
|
|
9982
|
+
|
|
9983
|
+
// LEVEL4
|
|
9984
|
+
|
|
9985
|
+
var darkCount = 0;
|
|
9986
|
+
|
|
9987
|
+
for (col = 0; col < moduleCount; col++) {
|
|
9988
|
+
for (row = 0; row < moduleCount; row++) {
|
|
9989
|
+
if (qrCode.isDark(row, col) ) {
|
|
9990
|
+
darkCount++;
|
|
9991
|
+
}
|
|
9992
|
+
}
|
|
9993
|
+
}
|
|
9994
|
+
|
|
9995
|
+
var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
|
|
9996
|
+
lostPoint += ratio * 10;
|
|
9997
|
+
|
|
9998
|
+
return lostPoint;
|
|
9999
|
+
}
|
|
10000
|
+
|
|
10001
|
+
};
|
|
10002
|
+
|
|
10003
|
+
module.exports = QRUtil;
|
|
10004
|
+
|
|
10005
|
+
|
|
9512
10006
|
/***/ }),
|
|
9513
10007
|
|
|
9514
10008
|
/***/ 1680:
|
|
@@ -14034,6 +14528,475 @@ if (process.platform === 'linux') {
|
|
|
14034
14528
|
}
|
|
14035
14529
|
|
|
14036
14530
|
|
|
14531
|
+
/***/ }),
|
|
14532
|
+
|
|
14533
|
+
/***/ 2304:
|
|
14534
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
14535
|
+
|
|
14536
|
+
//---------------------------------------------------------------------
|
|
14537
|
+
// QRCode for JavaScript
|
|
14538
|
+
//
|
|
14539
|
+
// Copyright (c) 2009 Kazuhiko Arase
|
|
14540
|
+
//
|
|
14541
|
+
// URL: http://www.d-project.com/
|
|
14542
|
+
//
|
|
14543
|
+
// Licensed under the MIT license:
|
|
14544
|
+
// http://www.opensource.org/licenses/mit-license.php
|
|
14545
|
+
//
|
|
14546
|
+
// The word "QR Code" is registered trademark of
|
|
14547
|
+
// DENSO WAVE INCORPORATED
|
|
14548
|
+
// http://www.denso-wave.com/qrcode/faqpatent-e.html
|
|
14549
|
+
//
|
|
14550
|
+
//---------------------------------------------------------------------
|
|
14551
|
+
// Modified to work in node for this project (and some refactoring)
|
|
14552
|
+
//---------------------------------------------------------------------
|
|
14553
|
+
|
|
14554
|
+
var QR8bitByte = __webpack_require__(2696);
|
|
14555
|
+
var QRUtil = __webpack_require__(1678);
|
|
14556
|
+
var QRPolynomial = __webpack_require__(5739);
|
|
14557
|
+
var QRRSBlock = __webpack_require__(7129);
|
|
14558
|
+
var QRBitBuffer = __webpack_require__(4880);
|
|
14559
|
+
|
|
14560
|
+
function QRCode(typeNumber, errorCorrectLevel) {
|
|
14561
|
+
this.typeNumber = typeNumber;
|
|
14562
|
+
this.errorCorrectLevel = errorCorrectLevel;
|
|
14563
|
+
this.modules = null;
|
|
14564
|
+
this.moduleCount = 0;
|
|
14565
|
+
this.dataCache = null;
|
|
14566
|
+
this.dataList = [];
|
|
14567
|
+
}
|
|
14568
|
+
|
|
14569
|
+
QRCode.prototype = {
|
|
14570
|
+
|
|
14571
|
+
addData : function(data) {
|
|
14572
|
+
var newData = new QR8bitByte(data);
|
|
14573
|
+
this.dataList.push(newData);
|
|
14574
|
+
this.dataCache = null;
|
|
14575
|
+
},
|
|
14576
|
+
|
|
14577
|
+
isDark : function(row, col) {
|
|
14578
|
+
if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) {
|
|
14579
|
+
throw new Error(row + "," + col);
|
|
14580
|
+
}
|
|
14581
|
+
return this.modules[row][col];
|
|
14582
|
+
},
|
|
14583
|
+
|
|
14584
|
+
getModuleCount : function() {
|
|
14585
|
+
return this.moduleCount;
|
|
14586
|
+
},
|
|
14587
|
+
|
|
14588
|
+
make : function() {
|
|
14589
|
+
// Calculate automatically typeNumber if provided is < 1
|
|
14590
|
+
if (this.typeNumber < 1 ){
|
|
14591
|
+
var typeNumber = 1;
|
|
14592
|
+
for (typeNumber = 1; typeNumber < 40; typeNumber++) {
|
|
14593
|
+
var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, this.errorCorrectLevel);
|
|
14594
|
+
|
|
14595
|
+
var buffer = new QRBitBuffer();
|
|
14596
|
+
var totalDataCount = 0;
|
|
14597
|
+
for (var i = 0; i < rsBlocks.length; i++) {
|
|
14598
|
+
totalDataCount += rsBlocks[i].dataCount;
|
|
14599
|
+
}
|
|
14600
|
+
|
|
14601
|
+
for (var x = 0; x < this.dataList.length; x++) {
|
|
14602
|
+
var data = this.dataList[x];
|
|
14603
|
+
buffer.put(data.mode, 4);
|
|
14604
|
+
buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber) );
|
|
14605
|
+
data.write(buffer);
|
|
14606
|
+
}
|
|
14607
|
+
if (buffer.getLengthInBits() <= totalDataCount * 8)
|
|
14608
|
+
break;
|
|
14609
|
+
}
|
|
14610
|
+
this.typeNumber = typeNumber;
|
|
14611
|
+
}
|
|
14612
|
+
this.makeImpl(false, this.getBestMaskPattern() );
|
|
14613
|
+
},
|
|
14614
|
+
|
|
14615
|
+
makeImpl : function(test, maskPattern) {
|
|
14616
|
+
|
|
14617
|
+
this.moduleCount = this.typeNumber * 4 + 17;
|
|
14618
|
+
this.modules = new Array(this.moduleCount);
|
|
14619
|
+
|
|
14620
|
+
for (var row = 0; row < this.moduleCount; row++) {
|
|
14621
|
+
|
|
14622
|
+
this.modules[row] = new Array(this.moduleCount);
|
|
14623
|
+
|
|
14624
|
+
for (var col = 0; col < this.moduleCount; col++) {
|
|
14625
|
+
this.modules[row][col] = null;//(col + row) % 3;
|
|
14626
|
+
}
|
|
14627
|
+
}
|
|
14628
|
+
|
|
14629
|
+
this.setupPositionProbePattern(0, 0);
|
|
14630
|
+
this.setupPositionProbePattern(this.moduleCount - 7, 0);
|
|
14631
|
+
this.setupPositionProbePattern(0, this.moduleCount - 7);
|
|
14632
|
+
this.setupPositionAdjustPattern();
|
|
14633
|
+
this.setupTimingPattern();
|
|
14634
|
+
this.setupTypeInfo(test, maskPattern);
|
|
14635
|
+
|
|
14636
|
+
if (this.typeNumber >= 7) {
|
|
14637
|
+
this.setupTypeNumber(test);
|
|
14638
|
+
}
|
|
14639
|
+
|
|
14640
|
+
if (this.dataCache === null) {
|
|
14641
|
+
this.dataCache = QRCode.createData(this.typeNumber, this.errorCorrectLevel, this.dataList);
|
|
14642
|
+
}
|
|
14643
|
+
|
|
14644
|
+
this.mapData(this.dataCache, maskPattern);
|
|
14645
|
+
},
|
|
14646
|
+
|
|
14647
|
+
setupPositionProbePattern : function(row, col) {
|
|
14648
|
+
|
|
14649
|
+
for (var r = -1; r <= 7; r++) {
|
|
14650
|
+
|
|
14651
|
+
if (row + r <= -1 || this.moduleCount <= row + r) continue;
|
|
14652
|
+
|
|
14653
|
+
for (var c = -1; c <= 7; c++) {
|
|
14654
|
+
|
|
14655
|
+
if (col + c <= -1 || this.moduleCount <= col + c) continue;
|
|
14656
|
+
|
|
14657
|
+
if ( (0 <= r && r <= 6 && (c === 0 || c === 6) ) ||
|
|
14658
|
+
(0 <= c && c <= 6 && (r === 0 || r === 6) ) ||
|
|
14659
|
+
(2 <= r && r <= 4 && 2 <= c && c <= 4) ) {
|
|
14660
|
+
this.modules[row + r][col + c] = true;
|
|
14661
|
+
} else {
|
|
14662
|
+
this.modules[row + r][col + c] = false;
|
|
14663
|
+
}
|
|
14664
|
+
}
|
|
14665
|
+
}
|
|
14666
|
+
},
|
|
14667
|
+
|
|
14668
|
+
getBestMaskPattern : function() {
|
|
14669
|
+
|
|
14670
|
+
var minLostPoint = 0;
|
|
14671
|
+
var pattern = 0;
|
|
14672
|
+
|
|
14673
|
+
for (var i = 0; i < 8; i++) {
|
|
14674
|
+
|
|
14675
|
+
this.makeImpl(true, i);
|
|
14676
|
+
|
|
14677
|
+
var lostPoint = QRUtil.getLostPoint(this);
|
|
14678
|
+
|
|
14679
|
+
if (i === 0 || minLostPoint > lostPoint) {
|
|
14680
|
+
minLostPoint = lostPoint;
|
|
14681
|
+
pattern = i;
|
|
14682
|
+
}
|
|
14683
|
+
}
|
|
14684
|
+
|
|
14685
|
+
return pattern;
|
|
14686
|
+
},
|
|
14687
|
+
|
|
14688
|
+
createMovieClip : function(target_mc, instance_name, depth) {
|
|
14689
|
+
|
|
14690
|
+
var qr_mc = target_mc.createEmptyMovieClip(instance_name, depth);
|
|
14691
|
+
var cs = 1;
|
|
14692
|
+
|
|
14693
|
+
this.make();
|
|
14694
|
+
|
|
14695
|
+
for (var row = 0; row < this.modules.length; row++) {
|
|
14696
|
+
|
|
14697
|
+
var y = row * cs;
|
|
14698
|
+
|
|
14699
|
+
for (var col = 0; col < this.modules[row].length; col++) {
|
|
14700
|
+
|
|
14701
|
+
var x = col * cs;
|
|
14702
|
+
var dark = this.modules[row][col];
|
|
14703
|
+
|
|
14704
|
+
if (dark) {
|
|
14705
|
+
qr_mc.beginFill(0, 100);
|
|
14706
|
+
qr_mc.moveTo(x, y);
|
|
14707
|
+
qr_mc.lineTo(x + cs, y);
|
|
14708
|
+
qr_mc.lineTo(x + cs, y + cs);
|
|
14709
|
+
qr_mc.lineTo(x, y + cs);
|
|
14710
|
+
qr_mc.endFill();
|
|
14711
|
+
}
|
|
14712
|
+
}
|
|
14713
|
+
}
|
|
14714
|
+
|
|
14715
|
+
return qr_mc;
|
|
14716
|
+
},
|
|
14717
|
+
|
|
14718
|
+
setupTimingPattern : function() {
|
|
14719
|
+
|
|
14720
|
+
for (var r = 8; r < this.moduleCount - 8; r++) {
|
|
14721
|
+
if (this.modules[r][6] !== null) {
|
|
14722
|
+
continue;
|
|
14723
|
+
}
|
|
14724
|
+
this.modules[r][6] = (r % 2 === 0);
|
|
14725
|
+
}
|
|
14726
|
+
|
|
14727
|
+
for (var c = 8; c < this.moduleCount - 8; c++) {
|
|
14728
|
+
if (this.modules[6][c] !== null) {
|
|
14729
|
+
continue;
|
|
14730
|
+
}
|
|
14731
|
+
this.modules[6][c] = (c % 2 === 0);
|
|
14732
|
+
}
|
|
14733
|
+
},
|
|
14734
|
+
|
|
14735
|
+
setupPositionAdjustPattern : function() {
|
|
14736
|
+
|
|
14737
|
+
var pos = QRUtil.getPatternPosition(this.typeNumber);
|
|
14738
|
+
|
|
14739
|
+
for (var i = 0; i < pos.length; i++) {
|
|
14740
|
+
|
|
14741
|
+
for (var j = 0; j < pos.length; j++) {
|
|
14742
|
+
|
|
14743
|
+
var row = pos[i];
|
|
14744
|
+
var col = pos[j];
|
|
14745
|
+
|
|
14746
|
+
if (this.modules[row][col] !== null) {
|
|
14747
|
+
continue;
|
|
14748
|
+
}
|
|
14749
|
+
|
|
14750
|
+
for (var r = -2; r <= 2; r++) {
|
|
14751
|
+
|
|
14752
|
+
for (var c = -2; c <= 2; c++) {
|
|
14753
|
+
|
|
14754
|
+
if (Math.abs(r) === 2 ||
|
|
14755
|
+
Math.abs(c) === 2 ||
|
|
14756
|
+
(r === 0 && c === 0) ) {
|
|
14757
|
+
this.modules[row + r][col + c] = true;
|
|
14758
|
+
} else {
|
|
14759
|
+
this.modules[row + r][col + c] = false;
|
|
14760
|
+
}
|
|
14761
|
+
}
|
|
14762
|
+
}
|
|
14763
|
+
}
|
|
14764
|
+
}
|
|
14765
|
+
},
|
|
14766
|
+
|
|
14767
|
+
setupTypeNumber : function(test) {
|
|
14768
|
+
|
|
14769
|
+
var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
|
|
14770
|
+
var mod;
|
|
14771
|
+
|
|
14772
|
+
for (var i = 0; i < 18; i++) {
|
|
14773
|
+
mod = (!test && ( (bits >> i) & 1) === 1);
|
|
14774
|
+
this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = mod;
|
|
14775
|
+
}
|
|
14776
|
+
|
|
14777
|
+
for (var x = 0; x < 18; x++) {
|
|
14778
|
+
mod = (!test && ( (bits >> x) & 1) === 1);
|
|
14779
|
+
this.modules[x % 3 + this.moduleCount - 8 - 3][Math.floor(x / 3)] = mod;
|
|
14780
|
+
}
|
|
14781
|
+
},
|
|
14782
|
+
|
|
14783
|
+
setupTypeInfo : function(test, maskPattern) {
|
|
14784
|
+
|
|
14785
|
+
var data = (this.errorCorrectLevel << 3) | maskPattern;
|
|
14786
|
+
var bits = QRUtil.getBCHTypeInfo(data);
|
|
14787
|
+
var mod;
|
|
14788
|
+
|
|
14789
|
+
// vertical
|
|
14790
|
+
for (var v = 0; v < 15; v++) {
|
|
14791
|
+
|
|
14792
|
+
mod = (!test && ( (bits >> v) & 1) === 1);
|
|
14793
|
+
|
|
14794
|
+
if (v < 6) {
|
|
14795
|
+
this.modules[v][8] = mod;
|
|
14796
|
+
} else if (v < 8) {
|
|
14797
|
+
this.modules[v + 1][8] = mod;
|
|
14798
|
+
} else {
|
|
14799
|
+
this.modules[this.moduleCount - 15 + v][8] = mod;
|
|
14800
|
+
}
|
|
14801
|
+
}
|
|
14802
|
+
|
|
14803
|
+
// horizontal
|
|
14804
|
+
for (var h = 0; h < 15; h++) {
|
|
14805
|
+
|
|
14806
|
+
mod = (!test && ( (bits >> h) & 1) === 1);
|
|
14807
|
+
|
|
14808
|
+
if (h < 8) {
|
|
14809
|
+
this.modules[8][this.moduleCount - h - 1] = mod;
|
|
14810
|
+
} else if (h < 9) {
|
|
14811
|
+
this.modules[8][15 - h - 1 + 1] = mod;
|
|
14812
|
+
} else {
|
|
14813
|
+
this.modules[8][15 - h - 1] = mod;
|
|
14814
|
+
}
|
|
14815
|
+
}
|
|
14816
|
+
|
|
14817
|
+
// fixed module
|
|
14818
|
+
this.modules[this.moduleCount - 8][8] = (!test);
|
|
14819
|
+
|
|
14820
|
+
},
|
|
14821
|
+
|
|
14822
|
+
mapData : function(data, maskPattern) {
|
|
14823
|
+
|
|
14824
|
+
var inc = -1;
|
|
14825
|
+
var row = this.moduleCount - 1;
|
|
14826
|
+
var bitIndex = 7;
|
|
14827
|
+
var byteIndex = 0;
|
|
14828
|
+
|
|
14829
|
+
for (var col = this.moduleCount - 1; col > 0; col -= 2) {
|
|
14830
|
+
|
|
14831
|
+
if (col === 6) col--;
|
|
14832
|
+
|
|
14833
|
+
while (true) {
|
|
14834
|
+
|
|
14835
|
+
for (var c = 0; c < 2; c++) {
|
|
14836
|
+
|
|
14837
|
+
if (this.modules[row][col - c] === null) {
|
|
14838
|
+
|
|
14839
|
+
var dark = false;
|
|
14840
|
+
|
|
14841
|
+
if (byteIndex < data.length) {
|
|
14842
|
+
dark = ( ( (data[byteIndex] >>> bitIndex) & 1) === 1);
|
|
14843
|
+
}
|
|
14844
|
+
|
|
14845
|
+
var mask = QRUtil.getMask(maskPattern, row, col - c);
|
|
14846
|
+
|
|
14847
|
+
if (mask) {
|
|
14848
|
+
dark = !dark;
|
|
14849
|
+
}
|
|
14850
|
+
|
|
14851
|
+
this.modules[row][col - c] = dark;
|
|
14852
|
+
bitIndex--;
|
|
14853
|
+
|
|
14854
|
+
if (bitIndex === -1) {
|
|
14855
|
+
byteIndex++;
|
|
14856
|
+
bitIndex = 7;
|
|
14857
|
+
}
|
|
14858
|
+
}
|
|
14859
|
+
}
|
|
14860
|
+
|
|
14861
|
+
row += inc;
|
|
14862
|
+
|
|
14863
|
+
if (row < 0 || this.moduleCount <= row) {
|
|
14864
|
+
row -= inc;
|
|
14865
|
+
inc = -inc;
|
|
14866
|
+
break;
|
|
14867
|
+
}
|
|
14868
|
+
}
|
|
14869
|
+
}
|
|
14870
|
+
|
|
14871
|
+
}
|
|
14872
|
+
|
|
14873
|
+
};
|
|
14874
|
+
|
|
14875
|
+
QRCode.PAD0 = 0xEC;
|
|
14876
|
+
QRCode.PAD1 = 0x11;
|
|
14877
|
+
|
|
14878
|
+
QRCode.createData = function(typeNumber, errorCorrectLevel, dataList) {
|
|
14879
|
+
|
|
14880
|
+
var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel);
|
|
14881
|
+
|
|
14882
|
+
var buffer = new QRBitBuffer();
|
|
14883
|
+
|
|
14884
|
+
for (var i = 0; i < dataList.length; i++) {
|
|
14885
|
+
var data = dataList[i];
|
|
14886
|
+
buffer.put(data.mode, 4);
|
|
14887
|
+
buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber) );
|
|
14888
|
+
data.write(buffer);
|
|
14889
|
+
}
|
|
14890
|
+
|
|
14891
|
+
// calc num max data.
|
|
14892
|
+
var totalDataCount = 0;
|
|
14893
|
+
for (var x = 0; x < rsBlocks.length; x++) {
|
|
14894
|
+
totalDataCount += rsBlocks[x].dataCount;
|
|
14895
|
+
}
|
|
14896
|
+
|
|
14897
|
+
if (buffer.getLengthInBits() > totalDataCount * 8) {
|
|
14898
|
+
throw new Error("code length overflow. (" +
|
|
14899
|
+
buffer.getLengthInBits() +
|
|
14900
|
+
">" +
|
|
14901
|
+
totalDataCount * 8 +
|
|
14902
|
+
")");
|
|
14903
|
+
}
|
|
14904
|
+
|
|
14905
|
+
// end code
|
|
14906
|
+
if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {
|
|
14907
|
+
buffer.put(0, 4);
|
|
14908
|
+
}
|
|
14909
|
+
|
|
14910
|
+
// padding
|
|
14911
|
+
while (buffer.getLengthInBits() % 8 !== 0) {
|
|
14912
|
+
buffer.putBit(false);
|
|
14913
|
+
}
|
|
14914
|
+
|
|
14915
|
+
// padding
|
|
14916
|
+
while (true) {
|
|
14917
|
+
|
|
14918
|
+
if (buffer.getLengthInBits() >= totalDataCount * 8) {
|
|
14919
|
+
break;
|
|
14920
|
+
}
|
|
14921
|
+
buffer.put(QRCode.PAD0, 8);
|
|
14922
|
+
|
|
14923
|
+
if (buffer.getLengthInBits() >= totalDataCount * 8) {
|
|
14924
|
+
break;
|
|
14925
|
+
}
|
|
14926
|
+
buffer.put(QRCode.PAD1, 8);
|
|
14927
|
+
}
|
|
14928
|
+
|
|
14929
|
+
return QRCode.createBytes(buffer, rsBlocks);
|
|
14930
|
+
};
|
|
14931
|
+
|
|
14932
|
+
QRCode.createBytes = function(buffer, rsBlocks) {
|
|
14933
|
+
|
|
14934
|
+
var offset = 0;
|
|
14935
|
+
|
|
14936
|
+
var maxDcCount = 0;
|
|
14937
|
+
var maxEcCount = 0;
|
|
14938
|
+
|
|
14939
|
+
var dcdata = new Array(rsBlocks.length);
|
|
14940
|
+
var ecdata = new Array(rsBlocks.length);
|
|
14941
|
+
|
|
14942
|
+
for (var r = 0; r < rsBlocks.length; r++) {
|
|
14943
|
+
|
|
14944
|
+
var dcCount = rsBlocks[r].dataCount;
|
|
14945
|
+
var ecCount = rsBlocks[r].totalCount - dcCount;
|
|
14946
|
+
|
|
14947
|
+
maxDcCount = Math.max(maxDcCount, dcCount);
|
|
14948
|
+
maxEcCount = Math.max(maxEcCount, ecCount);
|
|
14949
|
+
|
|
14950
|
+
dcdata[r] = new Array(dcCount);
|
|
14951
|
+
|
|
14952
|
+
for (var i = 0; i < dcdata[r].length; i++) {
|
|
14953
|
+
dcdata[r][i] = 0xff & buffer.buffer[i + offset];
|
|
14954
|
+
}
|
|
14955
|
+
offset += dcCount;
|
|
14956
|
+
|
|
14957
|
+
var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);
|
|
14958
|
+
var rawPoly = new QRPolynomial(dcdata[r], rsPoly.getLength() - 1);
|
|
14959
|
+
|
|
14960
|
+
var modPoly = rawPoly.mod(rsPoly);
|
|
14961
|
+
ecdata[r] = new Array(rsPoly.getLength() - 1);
|
|
14962
|
+
for (var x = 0; x < ecdata[r].length; x++) {
|
|
14963
|
+
var modIndex = x + modPoly.getLength() - ecdata[r].length;
|
|
14964
|
+
ecdata[r][x] = (modIndex >= 0)? modPoly.get(modIndex) : 0;
|
|
14965
|
+
}
|
|
14966
|
+
|
|
14967
|
+
}
|
|
14968
|
+
|
|
14969
|
+
var totalCodeCount = 0;
|
|
14970
|
+
for (var y = 0; y < rsBlocks.length; y++) {
|
|
14971
|
+
totalCodeCount += rsBlocks[y].totalCount;
|
|
14972
|
+
}
|
|
14973
|
+
|
|
14974
|
+
var data = new Array(totalCodeCount);
|
|
14975
|
+
var index = 0;
|
|
14976
|
+
|
|
14977
|
+
for (var z = 0; z < maxDcCount; z++) {
|
|
14978
|
+
for (var s = 0; s < rsBlocks.length; s++) {
|
|
14979
|
+
if (z < dcdata[s].length) {
|
|
14980
|
+
data[index++] = dcdata[s][z];
|
|
14981
|
+
}
|
|
14982
|
+
}
|
|
14983
|
+
}
|
|
14984
|
+
|
|
14985
|
+
for (var xx = 0; xx < maxEcCount; xx++) {
|
|
14986
|
+
for (var t = 0; t < rsBlocks.length; t++) {
|
|
14987
|
+
if (xx < ecdata[t].length) {
|
|
14988
|
+
data[index++] = ecdata[t][xx];
|
|
14989
|
+
}
|
|
14990
|
+
}
|
|
14991
|
+
}
|
|
14992
|
+
|
|
14993
|
+
return data;
|
|
14994
|
+
|
|
14995
|
+
};
|
|
14996
|
+
|
|
14997
|
+
module.exports = QRCode;
|
|
14998
|
+
|
|
14999
|
+
|
|
14037
15000
|
/***/ }),
|
|
14038
15001
|
|
|
14039
15002
|
/***/ 2309:
|
|
@@ -16257,6 +17220,35 @@ function raceInit(sources) {
|
|
|
16257
17220
|
exports.raceInit = raceInit;
|
|
16258
17221
|
//# sourceMappingURL=race.js.map
|
|
16259
17222
|
|
|
17223
|
+
/***/ }),
|
|
17224
|
+
|
|
17225
|
+
/***/ 2696:
|
|
17226
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
17227
|
+
|
|
17228
|
+
var QRMode = __webpack_require__(9802);
|
|
17229
|
+
|
|
17230
|
+
function QR8bitByte(data) {
|
|
17231
|
+
this.mode = QRMode.MODE_8BIT_BYTE;
|
|
17232
|
+
this.data = data;
|
|
17233
|
+
}
|
|
17234
|
+
|
|
17235
|
+
QR8bitByte.prototype = {
|
|
17236
|
+
|
|
17237
|
+
getLength : function() {
|
|
17238
|
+
return this.data.length;
|
|
17239
|
+
},
|
|
17240
|
+
|
|
17241
|
+
write : function(buffer) {
|
|
17242
|
+
for (var i = 0; i < this.data.length; i++) {
|
|
17243
|
+
// not JIS ...
|
|
17244
|
+
buffer.put(this.data.charCodeAt(i), 8);
|
|
17245
|
+
}
|
|
17246
|
+
}
|
|
17247
|
+
};
|
|
17248
|
+
|
|
17249
|
+
module.exports = QR8bitByte;
|
|
17250
|
+
|
|
17251
|
+
|
|
16260
17252
|
/***/ }),
|
|
16261
17253
|
|
|
16262
17254
|
/***/ 2752:
|
|
@@ -19114,6 +20106,37 @@ function popNumber(args, defaultValue) {
|
|
|
19114
20106
|
exports.popNumber = popNumber;
|
|
19115
20107
|
//# sourceMappingURL=args.js.map
|
|
19116
20108
|
|
|
20109
|
+
/***/ }),
|
|
20110
|
+
|
|
20111
|
+
/***/ 3523:
|
|
20112
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
20113
|
+
|
|
20114
|
+
/**
|
|
20115
|
+
* @otplib/plugin-thirty-two
|
|
20116
|
+
*
|
|
20117
|
+
* @author Gerald Yeo <contact@fusedthought.com>
|
|
20118
|
+
* @version: 12.0.1
|
|
20119
|
+
* @license: MIT
|
|
20120
|
+
**/
|
|
20121
|
+
|
|
20122
|
+
|
|
20123
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
20124
|
+
|
|
20125
|
+
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
20126
|
+
|
|
20127
|
+
var thirtyTwo = _interopDefault(__webpack_require__(942));
|
|
20128
|
+
|
|
20129
|
+
const keyDecoder = (encodedSecret, encoding) => {
|
|
20130
|
+
return thirtyTwo.decode(encodedSecret).toString(encoding);
|
|
20131
|
+
};
|
|
20132
|
+
const keyEncoder = (secret, encoding) => {
|
|
20133
|
+
return thirtyTwo.encode(Buffer.from(secret, encoding).toString('ascii')).toString().replace(/=/g, '');
|
|
20134
|
+
};
|
|
20135
|
+
|
|
20136
|
+
exports.keyDecoder = keyDecoder;
|
|
20137
|
+
exports.keyEncoder = keyEncoder;
|
|
20138
|
+
|
|
20139
|
+
|
|
19117
20140
|
/***/ }),
|
|
19118
20141
|
|
|
19119
20142
|
/***/ 3544:
|
|
@@ -23758,6 +24781,36 @@ function zipWith() {
|
|
|
23758
24781
|
exports.zipWith = zipWith;
|
|
23759
24782
|
//# sourceMappingURL=zipWith.js.map
|
|
23760
24783
|
|
|
24784
|
+
/***/ }),
|
|
24785
|
+
|
|
24786
|
+
/***/ 4283:
|
|
24787
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
24788
|
+
|
|
24789
|
+
/**
|
|
24790
|
+
* otplib
|
|
24791
|
+
*
|
|
24792
|
+
* @author Gerald Yeo <contact@fusedthought.com>
|
|
24793
|
+
* @version: 12.0.1
|
|
24794
|
+
* @license: MIT
|
|
24795
|
+
**/
|
|
24796
|
+
|
|
24797
|
+
|
|
24798
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
24799
|
+
|
|
24800
|
+
var presetDefault = __webpack_require__(8095);
|
|
24801
|
+
|
|
24802
|
+
|
|
24803
|
+
|
|
24804
|
+
Object.keys(presetDefault).forEach(function (k) {
|
|
24805
|
+
if (k !== 'default') Object.defineProperty(exports, k, {
|
|
24806
|
+
enumerable: true,
|
|
24807
|
+
get: function () {
|
|
24808
|
+
return presetDefault[k];
|
|
24809
|
+
}
|
|
24810
|
+
});
|
|
24811
|
+
});
|
|
24812
|
+
|
|
24813
|
+
|
|
23761
24814
|
/***/ }),
|
|
23762
24815
|
|
|
23763
24816
|
/***/ 4301:
|
|
@@ -27329,158 +28382,203 @@ module.exports = [
|
|
|
27329
28382
|
/***/ 4877:
|
|
27330
28383
|
/***/ ((module) => {
|
|
27331
28384
|
|
|
27332
|
-
|
|
27333
|
-
|
|
27334
|
-
module.exports = {
|
|
27335
|
-
"aliceblue": [240, 248, 255],
|
|
27336
|
-
"antiquewhite": [250, 235, 215],
|
|
27337
|
-
"aqua": [0, 255, 255],
|
|
27338
|
-
"aquamarine": [127, 255, 212],
|
|
27339
|
-
"azure": [240, 255, 255],
|
|
27340
|
-
"beige": [245, 245, 220],
|
|
27341
|
-
"bisque": [255, 228, 196],
|
|
27342
|
-
"black": [0, 0, 0],
|
|
27343
|
-
"blanchedalmond": [255, 235, 205],
|
|
27344
|
-
"blue": [0, 0, 255],
|
|
27345
|
-
"blueviolet": [138, 43, 226],
|
|
27346
|
-
"brown": [165, 42, 42],
|
|
27347
|
-
"burlywood": [222, 184, 135],
|
|
27348
|
-
"cadetblue": [95, 158, 160],
|
|
27349
|
-
"chartreuse": [127, 255, 0],
|
|
27350
|
-
"chocolate": [210, 105, 30],
|
|
27351
|
-
"coral": [255, 127, 80],
|
|
27352
|
-
"cornflowerblue": [100, 149, 237],
|
|
27353
|
-
"cornsilk": [255, 248, 220],
|
|
27354
|
-
"crimson": [220, 20, 60],
|
|
27355
|
-
"cyan": [0, 255, 255],
|
|
27356
|
-
"darkblue": [0, 0, 139],
|
|
27357
|
-
"darkcyan": [0, 139, 139],
|
|
27358
|
-
"darkgoldenrod": [184, 134, 11],
|
|
27359
|
-
"darkgray": [169, 169, 169],
|
|
27360
|
-
"darkgreen": [0, 100, 0],
|
|
27361
|
-
"darkgrey": [169, 169, 169],
|
|
27362
|
-
"darkkhaki": [189, 183, 107],
|
|
27363
|
-
"darkmagenta": [139, 0, 139],
|
|
27364
|
-
"darkolivegreen": [85, 107, 47],
|
|
27365
|
-
"darkorange": [255, 140, 0],
|
|
27366
|
-
"darkorchid": [153, 50, 204],
|
|
27367
|
-
"darkred": [139, 0, 0],
|
|
27368
|
-
"darksalmon": [233, 150, 122],
|
|
27369
|
-
"darkseagreen": [143, 188, 143],
|
|
27370
|
-
"darkslateblue": [72, 61, 139],
|
|
27371
|
-
"darkslategray": [47, 79, 79],
|
|
27372
|
-
"darkslategrey": [47, 79, 79],
|
|
27373
|
-
"darkturquoise": [0, 206, 209],
|
|
27374
|
-
"darkviolet": [148, 0, 211],
|
|
27375
|
-
"deeppink": [255, 20, 147],
|
|
27376
|
-
"deepskyblue": [0, 191, 255],
|
|
27377
|
-
"dimgray": [105, 105, 105],
|
|
27378
|
-
"dimgrey": [105, 105, 105],
|
|
27379
|
-
"dodgerblue": [30, 144, 255],
|
|
27380
|
-
"firebrick": [178, 34, 34],
|
|
27381
|
-
"floralwhite": [255, 250, 240],
|
|
27382
|
-
"forestgreen": [34, 139, 34],
|
|
27383
|
-
"fuchsia": [255, 0, 255],
|
|
27384
|
-
"gainsboro": [220, 220, 220],
|
|
27385
|
-
"ghostwhite": [248, 248, 255],
|
|
27386
|
-
"gold": [255, 215, 0],
|
|
27387
|
-
"goldenrod": [218, 165, 32],
|
|
27388
|
-
"gray": [128, 128, 128],
|
|
27389
|
-
"green": [0, 128, 0],
|
|
27390
|
-
"greenyellow": [173, 255, 47],
|
|
27391
|
-
"grey": [128, 128, 128],
|
|
27392
|
-
"honeydew": [240, 255, 240],
|
|
27393
|
-
"hotpink": [255, 105, 180],
|
|
27394
|
-
"indianred": [205, 92, 92],
|
|
27395
|
-
"indigo": [75, 0, 130],
|
|
27396
|
-
"ivory": [255, 255, 240],
|
|
27397
|
-
"khaki": [240, 230, 140],
|
|
27398
|
-
"lavender": [230, 230, 250],
|
|
27399
|
-
"lavenderblush": [255, 240, 245],
|
|
27400
|
-
"lawngreen": [124, 252, 0],
|
|
27401
|
-
"lemonchiffon": [255, 250, 205],
|
|
27402
|
-
"lightblue": [173, 216, 230],
|
|
27403
|
-
"lightcoral": [240, 128, 128],
|
|
27404
|
-
"lightcyan": [224, 255, 255],
|
|
27405
|
-
"lightgoldenrodyellow": [250, 250, 210],
|
|
27406
|
-
"lightgray": [211, 211, 211],
|
|
27407
|
-
"lightgreen": [144, 238, 144],
|
|
27408
|
-
"lightgrey": [211, 211, 211],
|
|
27409
|
-
"lightpink": [255, 182, 193],
|
|
27410
|
-
"lightsalmon": [255, 160, 122],
|
|
27411
|
-
"lightseagreen": [32, 178, 170],
|
|
27412
|
-
"lightskyblue": [135, 206, 250],
|
|
27413
|
-
"lightslategray": [119, 136, 153],
|
|
27414
|
-
"lightslategrey": [119, 136, 153],
|
|
27415
|
-
"lightsteelblue": [176, 196, 222],
|
|
27416
|
-
"lightyellow": [255, 255, 224],
|
|
27417
|
-
"lime": [0, 255, 0],
|
|
27418
|
-
"limegreen": [50, 205, 50],
|
|
27419
|
-
"linen": [250, 240, 230],
|
|
27420
|
-
"magenta": [255, 0, 255],
|
|
27421
|
-
"maroon": [128, 0, 0],
|
|
27422
|
-
"mediumaquamarine": [102, 205, 170],
|
|
27423
|
-
"mediumblue": [0, 0, 205],
|
|
27424
|
-
"mediumorchid": [186, 85, 211],
|
|
27425
|
-
"mediumpurple": [147, 112, 219],
|
|
27426
|
-
"mediumseagreen": [60, 179, 113],
|
|
27427
|
-
"mediumslateblue": [123, 104, 238],
|
|
27428
|
-
"mediumspringgreen": [0, 250, 154],
|
|
27429
|
-
"mediumturquoise": [72, 209, 204],
|
|
27430
|
-
"mediumvioletred": [199, 21, 133],
|
|
27431
|
-
"midnightblue": [25, 25, 112],
|
|
27432
|
-
"mintcream": [245, 255, 250],
|
|
27433
|
-
"mistyrose": [255, 228, 225],
|
|
27434
|
-
"moccasin": [255, 228, 181],
|
|
27435
|
-
"navajowhite": [255, 222, 173],
|
|
27436
|
-
"navy": [0, 0, 128],
|
|
27437
|
-
"oldlace": [253, 245, 230],
|
|
27438
|
-
"olive": [128, 128, 0],
|
|
27439
|
-
"olivedrab": [107, 142, 35],
|
|
27440
|
-
"orange": [255, 165, 0],
|
|
27441
|
-
"orangered": [255, 69, 0],
|
|
27442
|
-
"orchid": [218, 112, 214],
|
|
27443
|
-
"palegoldenrod": [238, 232, 170],
|
|
27444
|
-
"palegreen": [152, 251, 152],
|
|
27445
|
-
"paleturquoise": [175, 238, 238],
|
|
27446
|
-
"palevioletred": [219, 112, 147],
|
|
27447
|
-
"papayawhip": [255, 239, 213],
|
|
27448
|
-
"peachpuff": [255, 218, 185],
|
|
27449
|
-
"peru": [205, 133, 63],
|
|
27450
|
-
"pink": [255, 192, 203],
|
|
27451
|
-
"plum": [221, 160, 221],
|
|
27452
|
-
"powderblue": [176, 224, 230],
|
|
27453
|
-
"purple": [128, 0, 128],
|
|
27454
|
-
"rebeccapurple": [102, 51, 153],
|
|
27455
|
-
"red": [255, 0, 0],
|
|
27456
|
-
"rosybrown": [188, 143, 143],
|
|
27457
|
-
"royalblue": [65, 105, 225],
|
|
27458
|
-
"saddlebrown": [139, 69, 19],
|
|
27459
|
-
"salmon": [250, 128, 114],
|
|
27460
|
-
"sandybrown": [244, 164, 96],
|
|
27461
|
-
"seagreen": [46, 139, 87],
|
|
27462
|
-
"seashell": [255, 245, 238],
|
|
27463
|
-
"sienna": [160, 82, 45],
|
|
27464
|
-
"silver": [192, 192, 192],
|
|
27465
|
-
"skyblue": [135, 206, 235],
|
|
27466
|
-
"slateblue": [106, 90, 205],
|
|
27467
|
-
"slategray": [112, 128, 144],
|
|
27468
|
-
"slategrey": [112, 128, 144],
|
|
27469
|
-
"snow": [255, 250, 250],
|
|
27470
|
-
"springgreen": [0, 255, 127],
|
|
27471
|
-
"steelblue": [70, 130, 180],
|
|
27472
|
-
"tan": [210, 180, 140],
|
|
27473
|
-
"teal": [0, 128, 128],
|
|
27474
|
-
"thistle": [216, 191, 216],
|
|
27475
|
-
"tomato": [255, 99, 71],
|
|
27476
|
-
"turquoise": [64, 224, 208],
|
|
27477
|
-
"violet": [238, 130, 238],
|
|
27478
|
-
"wheat": [245, 222, 179],
|
|
27479
|
-
"white": [255, 255, 255],
|
|
27480
|
-
"whitesmoke": [245, 245, 245],
|
|
27481
|
-
"yellow": [255, 255, 0],
|
|
27482
|
-
"yellowgreen": [154, 205, 50]
|
|
27483
|
-
};
|
|
28385
|
+
|
|
28386
|
+
|
|
28387
|
+
module.exports = {
|
|
28388
|
+
"aliceblue": [240, 248, 255],
|
|
28389
|
+
"antiquewhite": [250, 235, 215],
|
|
28390
|
+
"aqua": [0, 255, 255],
|
|
28391
|
+
"aquamarine": [127, 255, 212],
|
|
28392
|
+
"azure": [240, 255, 255],
|
|
28393
|
+
"beige": [245, 245, 220],
|
|
28394
|
+
"bisque": [255, 228, 196],
|
|
28395
|
+
"black": [0, 0, 0],
|
|
28396
|
+
"blanchedalmond": [255, 235, 205],
|
|
28397
|
+
"blue": [0, 0, 255],
|
|
28398
|
+
"blueviolet": [138, 43, 226],
|
|
28399
|
+
"brown": [165, 42, 42],
|
|
28400
|
+
"burlywood": [222, 184, 135],
|
|
28401
|
+
"cadetblue": [95, 158, 160],
|
|
28402
|
+
"chartreuse": [127, 255, 0],
|
|
28403
|
+
"chocolate": [210, 105, 30],
|
|
28404
|
+
"coral": [255, 127, 80],
|
|
28405
|
+
"cornflowerblue": [100, 149, 237],
|
|
28406
|
+
"cornsilk": [255, 248, 220],
|
|
28407
|
+
"crimson": [220, 20, 60],
|
|
28408
|
+
"cyan": [0, 255, 255],
|
|
28409
|
+
"darkblue": [0, 0, 139],
|
|
28410
|
+
"darkcyan": [0, 139, 139],
|
|
28411
|
+
"darkgoldenrod": [184, 134, 11],
|
|
28412
|
+
"darkgray": [169, 169, 169],
|
|
28413
|
+
"darkgreen": [0, 100, 0],
|
|
28414
|
+
"darkgrey": [169, 169, 169],
|
|
28415
|
+
"darkkhaki": [189, 183, 107],
|
|
28416
|
+
"darkmagenta": [139, 0, 139],
|
|
28417
|
+
"darkolivegreen": [85, 107, 47],
|
|
28418
|
+
"darkorange": [255, 140, 0],
|
|
28419
|
+
"darkorchid": [153, 50, 204],
|
|
28420
|
+
"darkred": [139, 0, 0],
|
|
28421
|
+
"darksalmon": [233, 150, 122],
|
|
28422
|
+
"darkseagreen": [143, 188, 143],
|
|
28423
|
+
"darkslateblue": [72, 61, 139],
|
|
28424
|
+
"darkslategray": [47, 79, 79],
|
|
28425
|
+
"darkslategrey": [47, 79, 79],
|
|
28426
|
+
"darkturquoise": [0, 206, 209],
|
|
28427
|
+
"darkviolet": [148, 0, 211],
|
|
28428
|
+
"deeppink": [255, 20, 147],
|
|
28429
|
+
"deepskyblue": [0, 191, 255],
|
|
28430
|
+
"dimgray": [105, 105, 105],
|
|
28431
|
+
"dimgrey": [105, 105, 105],
|
|
28432
|
+
"dodgerblue": [30, 144, 255],
|
|
28433
|
+
"firebrick": [178, 34, 34],
|
|
28434
|
+
"floralwhite": [255, 250, 240],
|
|
28435
|
+
"forestgreen": [34, 139, 34],
|
|
28436
|
+
"fuchsia": [255, 0, 255],
|
|
28437
|
+
"gainsboro": [220, 220, 220],
|
|
28438
|
+
"ghostwhite": [248, 248, 255],
|
|
28439
|
+
"gold": [255, 215, 0],
|
|
28440
|
+
"goldenrod": [218, 165, 32],
|
|
28441
|
+
"gray": [128, 128, 128],
|
|
28442
|
+
"green": [0, 128, 0],
|
|
28443
|
+
"greenyellow": [173, 255, 47],
|
|
28444
|
+
"grey": [128, 128, 128],
|
|
28445
|
+
"honeydew": [240, 255, 240],
|
|
28446
|
+
"hotpink": [255, 105, 180],
|
|
28447
|
+
"indianred": [205, 92, 92],
|
|
28448
|
+
"indigo": [75, 0, 130],
|
|
28449
|
+
"ivory": [255, 255, 240],
|
|
28450
|
+
"khaki": [240, 230, 140],
|
|
28451
|
+
"lavender": [230, 230, 250],
|
|
28452
|
+
"lavenderblush": [255, 240, 245],
|
|
28453
|
+
"lawngreen": [124, 252, 0],
|
|
28454
|
+
"lemonchiffon": [255, 250, 205],
|
|
28455
|
+
"lightblue": [173, 216, 230],
|
|
28456
|
+
"lightcoral": [240, 128, 128],
|
|
28457
|
+
"lightcyan": [224, 255, 255],
|
|
28458
|
+
"lightgoldenrodyellow": [250, 250, 210],
|
|
28459
|
+
"lightgray": [211, 211, 211],
|
|
28460
|
+
"lightgreen": [144, 238, 144],
|
|
28461
|
+
"lightgrey": [211, 211, 211],
|
|
28462
|
+
"lightpink": [255, 182, 193],
|
|
28463
|
+
"lightsalmon": [255, 160, 122],
|
|
28464
|
+
"lightseagreen": [32, 178, 170],
|
|
28465
|
+
"lightskyblue": [135, 206, 250],
|
|
28466
|
+
"lightslategray": [119, 136, 153],
|
|
28467
|
+
"lightslategrey": [119, 136, 153],
|
|
28468
|
+
"lightsteelblue": [176, 196, 222],
|
|
28469
|
+
"lightyellow": [255, 255, 224],
|
|
28470
|
+
"lime": [0, 255, 0],
|
|
28471
|
+
"limegreen": [50, 205, 50],
|
|
28472
|
+
"linen": [250, 240, 230],
|
|
28473
|
+
"magenta": [255, 0, 255],
|
|
28474
|
+
"maroon": [128, 0, 0],
|
|
28475
|
+
"mediumaquamarine": [102, 205, 170],
|
|
28476
|
+
"mediumblue": [0, 0, 205],
|
|
28477
|
+
"mediumorchid": [186, 85, 211],
|
|
28478
|
+
"mediumpurple": [147, 112, 219],
|
|
28479
|
+
"mediumseagreen": [60, 179, 113],
|
|
28480
|
+
"mediumslateblue": [123, 104, 238],
|
|
28481
|
+
"mediumspringgreen": [0, 250, 154],
|
|
28482
|
+
"mediumturquoise": [72, 209, 204],
|
|
28483
|
+
"mediumvioletred": [199, 21, 133],
|
|
28484
|
+
"midnightblue": [25, 25, 112],
|
|
28485
|
+
"mintcream": [245, 255, 250],
|
|
28486
|
+
"mistyrose": [255, 228, 225],
|
|
28487
|
+
"moccasin": [255, 228, 181],
|
|
28488
|
+
"navajowhite": [255, 222, 173],
|
|
28489
|
+
"navy": [0, 0, 128],
|
|
28490
|
+
"oldlace": [253, 245, 230],
|
|
28491
|
+
"olive": [128, 128, 0],
|
|
28492
|
+
"olivedrab": [107, 142, 35],
|
|
28493
|
+
"orange": [255, 165, 0],
|
|
28494
|
+
"orangered": [255, 69, 0],
|
|
28495
|
+
"orchid": [218, 112, 214],
|
|
28496
|
+
"palegoldenrod": [238, 232, 170],
|
|
28497
|
+
"palegreen": [152, 251, 152],
|
|
28498
|
+
"paleturquoise": [175, 238, 238],
|
|
28499
|
+
"palevioletred": [219, 112, 147],
|
|
28500
|
+
"papayawhip": [255, 239, 213],
|
|
28501
|
+
"peachpuff": [255, 218, 185],
|
|
28502
|
+
"peru": [205, 133, 63],
|
|
28503
|
+
"pink": [255, 192, 203],
|
|
28504
|
+
"plum": [221, 160, 221],
|
|
28505
|
+
"powderblue": [176, 224, 230],
|
|
28506
|
+
"purple": [128, 0, 128],
|
|
28507
|
+
"rebeccapurple": [102, 51, 153],
|
|
28508
|
+
"red": [255, 0, 0],
|
|
28509
|
+
"rosybrown": [188, 143, 143],
|
|
28510
|
+
"royalblue": [65, 105, 225],
|
|
28511
|
+
"saddlebrown": [139, 69, 19],
|
|
28512
|
+
"salmon": [250, 128, 114],
|
|
28513
|
+
"sandybrown": [244, 164, 96],
|
|
28514
|
+
"seagreen": [46, 139, 87],
|
|
28515
|
+
"seashell": [255, 245, 238],
|
|
28516
|
+
"sienna": [160, 82, 45],
|
|
28517
|
+
"silver": [192, 192, 192],
|
|
28518
|
+
"skyblue": [135, 206, 235],
|
|
28519
|
+
"slateblue": [106, 90, 205],
|
|
28520
|
+
"slategray": [112, 128, 144],
|
|
28521
|
+
"slategrey": [112, 128, 144],
|
|
28522
|
+
"snow": [255, 250, 250],
|
|
28523
|
+
"springgreen": [0, 255, 127],
|
|
28524
|
+
"steelblue": [70, 130, 180],
|
|
28525
|
+
"tan": [210, 180, 140],
|
|
28526
|
+
"teal": [0, 128, 128],
|
|
28527
|
+
"thistle": [216, 191, 216],
|
|
28528
|
+
"tomato": [255, 99, 71],
|
|
28529
|
+
"turquoise": [64, 224, 208],
|
|
28530
|
+
"violet": [238, 130, 238],
|
|
28531
|
+
"wheat": [245, 222, 179],
|
|
28532
|
+
"white": [255, 255, 255],
|
|
28533
|
+
"whitesmoke": [245, 245, 245],
|
|
28534
|
+
"yellow": [255, 255, 0],
|
|
28535
|
+
"yellowgreen": [154, 205, 50]
|
|
28536
|
+
};
|
|
28537
|
+
|
|
28538
|
+
|
|
28539
|
+
/***/ }),
|
|
28540
|
+
|
|
28541
|
+
/***/ 4880:
|
|
28542
|
+
/***/ ((module) => {
|
|
28543
|
+
|
|
28544
|
+
function QRBitBuffer() {
|
|
28545
|
+
this.buffer = [];
|
|
28546
|
+
this.length = 0;
|
|
28547
|
+
}
|
|
28548
|
+
|
|
28549
|
+
QRBitBuffer.prototype = {
|
|
28550
|
+
|
|
28551
|
+
get : function(index) {
|
|
28552
|
+
var bufIndex = Math.floor(index / 8);
|
|
28553
|
+
return ( (this.buffer[bufIndex] >>> (7 - index % 8) ) & 1) == 1;
|
|
28554
|
+
},
|
|
28555
|
+
|
|
28556
|
+
put : function(num, length) {
|
|
28557
|
+
for (var i = 0; i < length; i++) {
|
|
28558
|
+
this.putBit( ( (num >>> (length - i - 1) ) & 1) == 1);
|
|
28559
|
+
}
|
|
28560
|
+
},
|
|
28561
|
+
|
|
28562
|
+
getLengthInBits : function() {
|
|
28563
|
+
return this.length;
|
|
28564
|
+
},
|
|
28565
|
+
|
|
28566
|
+
putBit : function(bit) {
|
|
28567
|
+
|
|
28568
|
+
var bufIndex = Math.floor(this.length / 8);
|
|
28569
|
+
if (this.buffer.length <= bufIndex) {
|
|
28570
|
+
this.buffer.push(0);
|
|
28571
|
+
}
|
|
28572
|
+
|
|
28573
|
+
if (bit) {
|
|
28574
|
+
this.buffer[bufIndex] |= (0x80 >>> (this.length % 8) );
|
|
28575
|
+
}
|
|
28576
|
+
|
|
28577
|
+
this.length++;
|
|
28578
|
+
}
|
|
28579
|
+
};
|
|
28580
|
+
|
|
28581
|
+
module.exports = QRBitBuffer;
|
|
27484
28582
|
|
|
27485
28583
|
|
|
27486
28584
|
/***/ }),
|
|
@@ -30477,6 +31575,79 @@ function mergeAll(concurrent) {
|
|
|
30477
31575
|
exports.mergeAll = mergeAll;
|
|
30478
31576
|
//# sourceMappingURL=mergeAll.js.map
|
|
30479
31577
|
|
|
31578
|
+
/***/ }),
|
|
31579
|
+
|
|
31580
|
+
/***/ 5739:
|
|
31581
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
31582
|
+
|
|
31583
|
+
var QRMath = __webpack_require__(6543);
|
|
31584
|
+
|
|
31585
|
+
function QRPolynomial(num, shift) {
|
|
31586
|
+
if (num.length === undefined) {
|
|
31587
|
+
throw new Error(num.length + "/" + shift);
|
|
31588
|
+
}
|
|
31589
|
+
|
|
31590
|
+
var offset = 0;
|
|
31591
|
+
|
|
31592
|
+
while (offset < num.length && num[offset] === 0) {
|
|
31593
|
+
offset++;
|
|
31594
|
+
}
|
|
31595
|
+
|
|
31596
|
+
this.num = new Array(num.length - offset + shift);
|
|
31597
|
+
for (var i = 0; i < num.length - offset; i++) {
|
|
31598
|
+
this.num[i] = num[i + offset];
|
|
31599
|
+
}
|
|
31600
|
+
}
|
|
31601
|
+
|
|
31602
|
+
QRPolynomial.prototype = {
|
|
31603
|
+
|
|
31604
|
+
get : function(index) {
|
|
31605
|
+
return this.num[index];
|
|
31606
|
+
},
|
|
31607
|
+
|
|
31608
|
+
getLength : function() {
|
|
31609
|
+
return this.num.length;
|
|
31610
|
+
},
|
|
31611
|
+
|
|
31612
|
+
multiply : function(e) {
|
|
31613
|
+
|
|
31614
|
+
var num = new Array(this.getLength() + e.getLength() - 1);
|
|
31615
|
+
|
|
31616
|
+
for (var i = 0; i < this.getLength(); i++) {
|
|
31617
|
+
for (var j = 0; j < e.getLength(); j++) {
|
|
31618
|
+
num[i + j] ^= QRMath.gexp(QRMath.glog(this.get(i) ) + QRMath.glog(e.get(j) ) );
|
|
31619
|
+
}
|
|
31620
|
+
}
|
|
31621
|
+
|
|
31622
|
+
return new QRPolynomial(num, 0);
|
|
31623
|
+
},
|
|
31624
|
+
|
|
31625
|
+
mod : function(e) {
|
|
31626
|
+
|
|
31627
|
+
if (this.getLength() - e.getLength() < 0) {
|
|
31628
|
+
return this;
|
|
31629
|
+
}
|
|
31630
|
+
|
|
31631
|
+
var ratio = QRMath.glog(this.get(0) ) - QRMath.glog(e.get(0) );
|
|
31632
|
+
|
|
31633
|
+
var num = new Array(this.getLength() );
|
|
31634
|
+
|
|
31635
|
+
for (var i = 0; i < this.getLength(); i++) {
|
|
31636
|
+
num[i] = this.get(i);
|
|
31637
|
+
}
|
|
31638
|
+
|
|
31639
|
+
for (var x = 0; x < e.getLength(); x++) {
|
|
31640
|
+
num[x] ^= QRMath.gexp(QRMath.glog(e.get(x) ) + ratio);
|
|
31641
|
+
}
|
|
31642
|
+
|
|
31643
|
+
// recursive call
|
|
31644
|
+
return new QRPolynomial(num, 0).mod(e);
|
|
31645
|
+
}
|
|
31646
|
+
};
|
|
31647
|
+
|
|
31648
|
+
module.exports = QRPolynomial;
|
|
31649
|
+
|
|
31650
|
+
|
|
30480
31651
|
/***/ }),
|
|
30481
31652
|
|
|
30482
31653
|
/***/ 5743:
|
|
@@ -32048,6 +33219,113 @@ function timestamp(timestampProvider) {
|
|
|
32048
33219
|
exports.timestamp = timestamp;
|
|
32049
33220
|
//# sourceMappingURL=timestamp.js.map
|
|
32050
33221
|
|
|
33222
|
+
/***/ }),
|
|
33223
|
+
|
|
33224
|
+
/***/ 6273:
|
|
33225
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
33226
|
+
|
|
33227
|
+
var QRCode = __webpack_require__(2304),
|
|
33228
|
+
QRErrorCorrectLevel = __webpack_require__(543),
|
|
33229
|
+
black = "\x1b[40m \x1b[0m",
|
|
33230
|
+
white = "\x1b[47m \x1b[0m",
|
|
33231
|
+
toCell = function (isBlack) {
|
|
33232
|
+
return isBlack ? black : white;
|
|
33233
|
+
},
|
|
33234
|
+
repeat = function (color) {
|
|
33235
|
+
return {
|
|
33236
|
+
times: function (count) {
|
|
33237
|
+
return new Array(count).join(color);
|
|
33238
|
+
}
|
|
33239
|
+
};
|
|
33240
|
+
},
|
|
33241
|
+
fill = function(length, value) {
|
|
33242
|
+
var arr = new Array(length);
|
|
33243
|
+
for (var i = 0; i < length; i++) {
|
|
33244
|
+
arr[i] = value;
|
|
33245
|
+
}
|
|
33246
|
+
return arr;
|
|
33247
|
+
};
|
|
33248
|
+
|
|
33249
|
+
module.exports = {
|
|
33250
|
+
|
|
33251
|
+
error: QRErrorCorrectLevel.L,
|
|
33252
|
+
|
|
33253
|
+
generate: function (input, opts, cb) {
|
|
33254
|
+
if (typeof opts === 'function') {
|
|
33255
|
+
cb = opts;
|
|
33256
|
+
opts = {};
|
|
33257
|
+
}
|
|
33258
|
+
|
|
33259
|
+
var qrcode = new QRCode(-1, this.error);
|
|
33260
|
+
qrcode.addData(input);
|
|
33261
|
+
qrcode.make();
|
|
33262
|
+
|
|
33263
|
+
var output = '';
|
|
33264
|
+
if (opts && opts.small) {
|
|
33265
|
+
var BLACK = true, WHITE = false;
|
|
33266
|
+
var moduleCount = qrcode.getModuleCount();
|
|
33267
|
+
var moduleData = qrcode.modules.slice();
|
|
33268
|
+
|
|
33269
|
+
var oddRow = moduleCount % 2 === 1;
|
|
33270
|
+
if (oddRow) {
|
|
33271
|
+
moduleData.push(fill(moduleCount, WHITE));
|
|
33272
|
+
}
|
|
33273
|
+
|
|
33274
|
+
var platte= {
|
|
33275
|
+
WHITE_ALL: '\u2588',
|
|
33276
|
+
WHITE_BLACK: '\u2580',
|
|
33277
|
+
BLACK_WHITE: '\u2584',
|
|
33278
|
+
BLACK_ALL: ' ',
|
|
33279
|
+
};
|
|
33280
|
+
|
|
33281
|
+
var borderTop = repeat(platte.BLACK_WHITE).times(moduleCount + 3);
|
|
33282
|
+
var borderBottom = repeat(platte.WHITE_BLACK).times(moduleCount + 3);
|
|
33283
|
+
output += borderTop + '\n';
|
|
33284
|
+
|
|
33285
|
+
for (var row = 0; row < moduleCount; row += 2) {
|
|
33286
|
+
output += platte.WHITE_ALL;
|
|
33287
|
+
|
|
33288
|
+
for (var col = 0; col < moduleCount; col++) {
|
|
33289
|
+
if (moduleData[row][col] === WHITE && moduleData[row + 1][col] === WHITE) {
|
|
33290
|
+
output += platte.WHITE_ALL;
|
|
33291
|
+
} else if (moduleData[row][col] === WHITE && moduleData[row + 1][col] === BLACK) {
|
|
33292
|
+
output += platte.WHITE_BLACK;
|
|
33293
|
+
} else if (moduleData[row][col] === BLACK && moduleData[row + 1][col] === WHITE) {
|
|
33294
|
+
output += platte.BLACK_WHITE;
|
|
33295
|
+
} else {
|
|
33296
|
+
output += platte.BLACK_ALL;
|
|
33297
|
+
}
|
|
33298
|
+
}
|
|
33299
|
+
|
|
33300
|
+
output += platte.WHITE_ALL + '\n';
|
|
33301
|
+
}
|
|
33302
|
+
|
|
33303
|
+
if (!oddRow) {
|
|
33304
|
+
output += borderBottom;
|
|
33305
|
+
}
|
|
33306
|
+
} else {
|
|
33307
|
+
var border = repeat(white).times(qrcode.getModuleCount() + 3);
|
|
33308
|
+
|
|
33309
|
+
output += border + '\n';
|
|
33310
|
+
qrcode.modules.forEach(function (row) {
|
|
33311
|
+
output += white;
|
|
33312
|
+
output += row.map(toCell).join('');
|
|
33313
|
+
output += white + '\n';
|
|
33314
|
+
});
|
|
33315
|
+
output += border;
|
|
33316
|
+
}
|
|
33317
|
+
|
|
33318
|
+
if (cb) cb(output);
|
|
33319
|
+
else console.log(output);
|
|
33320
|
+
},
|
|
33321
|
+
|
|
33322
|
+
setErrorLevel: function (error) {
|
|
33323
|
+
this.error = QRErrorCorrectLevel[error] || this.error;
|
|
33324
|
+
}
|
|
33325
|
+
|
|
33326
|
+
};
|
|
33327
|
+
|
|
33328
|
+
|
|
32051
33329
|
/***/ }),
|
|
32052
33330
|
|
|
32053
33331
|
/***/ 6311:
|
|
@@ -32680,6 +33958,57 @@ function debounceTime(dueTime, scheduler) {
|
|
|
32680
33958
|
exports.debounceTime = debounceTime;
|
|
32681
33959
|
//# sourceMappingURL=debounceTime.js.map
|
|
32682
33960
|
|
|
33961
|
+
/***/ }),
|
|
33962
|
+
|
|
33963
|
+
/***/ 6543:
|
|
33964
|
+
/***/ ((module) => {
|
|
33965
|
+
|
|
33966
|
+
var QRMath = {
|
|
33967
|
+
|
|
33968
|
+
glog : function(n) {
|
|
33969
|
+
|
|
33970
|
+
if (n < 1) {
|
|
33971
|
+
throw new Error("glog(" + n + ")");
|
|
33972
|
+
}
|
|
33973
|
+
|
|
33974
|
+
return QRMath.LOG_TABLE[n];
|
|
33975
|
+
},
|
|
33976
|
+
|
|
33977
|
+
gexp : function(n) {
|
|
33978
|
+
|
|
33979
|
+
while (n < 0) {
|
|
33980
|
+
n += 255;
|
|
33981
|
+
}
|
|
33982
|
+
|
|
33983
|
+
while (n >= 256) {
|
|
33984
|
+
n -= 255;
|
|
33985
|
+
}
|
|
33986
|
+
|
|
33987
|
+
return QRMath.EXP_TABLE[n];
|
|
33988
|
+
},
|
|
33989
|
+
|
|
33990
|
+
EXP_TABLE : new Array(256),
|
|
33991
|
+
|
|
33992
|
+
LOG_TABLE : new Array(256)
|
|
33993
|
+
|
|
33994
|
+
};
|
|
33995
|
+
|
|
33996
|
+
for (var i = 0; i < 8; i++) {
|
|
33997
|
+
QRMath.EXP_TABLE[i] = 1 << i;
|
|
33998
|
+
}
|
|
33999
|
+
for (var i = 8; i < 256; i++) {
|
|
34000
|
+
QRMath.EXP_TABLE[i] = QRMath.EXP_TABLE[i - 4]
|
|
34001
|
+
^ QRMath.EXP_TABLE[i - 5]
|
|
34002
|
+
^ QRMath.EXP_TABLE[i - 6]
|
|
34003
|
+
^ QRMath.EXP_TABLE[i - 8];
|
|
34004
|
+
}
|
|
34005
|
+
for (var i = 0; i < 255; i++) {
|
|
34006
|
+
QRMath.LOG_TABLE[QRMath.EXP_TABLE[i] ] = i;
|
|
34007
|
+
}
|
|
34008
|
+
|
|
34009
|
+
module.exports = QRMath;
|
|
34010
|
+
|
|
34011
|
+
|
|
32683
34012
|
/***/ }),
|
|
32684
34013
|
|
|
32685
34014
|
/***/ 6546:
|
|
@@ -37520,6 +38849,311 @@ if (process.env.READABLE_STREAM === 'disable' && Stream) {
|
|
|
37520
38849
|
}
|
|
37521
38850
|
|
|
37522
38851
|
|
|
38852
|
+
/***/ }),
|
|
38853
|
+
|
|
38854
|
+
/***/ 7129:
|
|
38855
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
38856
|
+
|
|
38857
|
+
var QRErrorCorrectLevel = __webpack_require__(543);
|
|
38858
|
+
|
|
38859
|
+
function QRRSBlock(totalCount, dataCount) {
|
|
38860
|
+
this.totalCount = totalCount;
|
|
38861
|
+
this.dataCount = dataCount;
|
|
38862
|
+
}
|
|
38863
|
+
|
|
38864
|
+
QRRSBlock.RS_BLOCK_TABLE = [
|
|
38865
|
+
|
|
38866
|
+
// L
|
|
38867
|
+
// M
|
|
38868
|
+
// Q
|
|
38869
|
+
// H
|
|
38870
|
+
|
|
38871
|
+
// 1
|
|
38872
|
+
[1, 26, 19],
|
|
38873
|
+
[1, 26, 16],
|
|
38874
|
+
[1, 26, 13],
|
|
38875
|
+
[1, 26, 9],
|
|
38876
|
+
|
|
38877
|
+
// 2
|
|
38878
|
+
[1, 44, 34],
|
|
38879
|
+
[1, 44, 28],
|
|
38880
|
+
[1, 44, 22],
|
|
38881
|
+
[1, 44, 16],
|
|
38882
|
+
|
|
38883
|
+
// 3
|
|
38884
|
+
[1, 70, 55],
|
|
38885
|
+
[1, 70, 44],
|
|
38886
|
+
[2, 35, 17],
|
|
38887
|
+
[2, 35, 13],
|
|
38888
|
+
|
|
38889
|
+
// 4
|
|
38890
|
+
[1, 100, 80],
|
|
38891
|
+
[2, 50, 32],
|
|
38892
|
+
[2, 50, 24],
|
|
38893
|
+
[4, 25, 9],
|
|
38894
|
+
|
|
38895
|
+
// 5
|
|
38896
|
+
[1, 134, 108],
|
|
38897
|
+
[2, 67, 43],
|
|
38898
|
+
[2, 33, 15, 2, 34, 16],
|
|
38899
|
+
[2, 33, 11, 2, 34, 12],
|
|
38900
|
+
|
|
38901
|
+
// 6
|
|
38902
|
+
[2, 86, 68],
|
|
38903
|
+
[4, 43, 27],
|
|
38904
|
+
[4, 43, 19],
|
|
38905
|
+
[4, 43, 15],
|
|
38906
|
+
|
|
38907
|
+
// 7
|
|
38908
|
+
[2, 98, 78],
|
|
38909
|
+
[4, 49, 31],
|
|
38910
|
+
[2, 32, 14, 4, 33, 15],
|
|
38911
|
+
[4, 39, 13, 1, 40, 14],
|
|
38912
|
+
|
|
38913
|
+
// 8
|
|
38914
|
+
[2, 121, 97],
|
|
38915
|
+
[2, 60, 38, 2, 61, 39],
|
|
38916
|
+
[4, 40, 18, 2, 41, 19],
|
|
38917
|
+
[4, 40, 14, 2, 41, 15],
|
|
38918
|
+
|
|
38919
|
+
// 9
|
|
38920
|
+
[2, 146, 116],
|
|
38921
|
+
[3, 58, 36, 2, 59, 37],
|
|
38922
|
+
[4, 36, 16, 4, 37, 17],
|
|
38923
|
+
[4, 36, 12, 4, 37, 13],
|
|
38924
|
+
|
|
38925
|
+
// 10
|
|
38926
|
+
[2, 86, 68, 2, 87, 69],
|
|
38927
|
+
[4, 69, 43, 1, 70, 44],
|
|
38928
|
+
[6, 43, 19, 2, 44, 20],
|
|
38929
|
+
[6, 43, 15, 2, 44, 16],
|
|
38930
|
+
|
|
38931
|
+
// 11
|
|
38932
|
+
[4, 101, 81],
|
|
38933
|
+
[1, 80, 50, 4, 81, 51],
|
|
38934
|
+
[4, 50, 22, 4, 51, 23],
|
|
38935
|
+
[3, 36, 12, 8, 37, 13],
|
|
38936
|
+
|
|
38937
|
+
// 12
|
|
38938
|
+
[2, 116, 92, 2, 117, 93],
|
|
38939
|
+
[6, 58, 36, 2, 59, 37],
|
|
38940
|
+
[4, 46, 20, 6, 47, 21],
|
|
38941
|
+
[7, 42, 14, 4, 43, 15],
|
|
38942
|
+
|
|
38943
|
+
// 13
|
|
38944
|
+
[4, 133, 107],
|
|
38945
|
+
[8, 59, 37, 1, 60, 38],
|
|
38946
|
+
[8, 44, 20, 4, 45, 21],
|
|
38947
|
+
[12, 33, 11, 4, 34, 12],
|
|
38948
|
+
|
|
38949
|
+
// 14
|
|
38950
|
+
[3, 145, 115, 1, 146, 116],
|
|
38951
|
+
[4, 64, 40, 5, 65, 41],
|
|
38952
|
+
[11, 36, 16, 5, 37, 17],
|
|
38953
|
+
[11, 36, 12, 5, 37, 13],
|
|
38954
|
+
|
|
38955
|
+
// 15
|
|
38956
|
+
[5, 109, 87, 1, 110, 88],
|
|
38957
|
+
[5, 65, 41, 5, 66, 42],
|
|
38958
|
+
[5, 54, 24, 7, 55, 25],
|
|
38959
|
+
[11, 36, 12],
|
|
38960
|
+
|
|
38961
|
+
// 16
|
|
38962
|
+
[5, 122, 98, 1, 123, 99],
|
|
38963
|
+
[7, 73, 45, 3, 74, 46],
|
|
38964
|
+
[15, 43, 19, 2, 44, 20],
|
|
38965
|
+
[3, 45, 15, 13, 46, 16],
|
|
38966
|
+
|
|
38967
|
+
// 17
|
|
38968
|
+
[1, 135, 107, 5, 136, 108],
|
|
38969
|
+
[10, 74, 46, 1, 75, 47],
|
|
38970
|
+
[1, 50, 22, 15, 51, 23],
|
|
38971
|
+
[2, 42, 14, 17, 43, 15],
|
|
38972
|
+
|
|
38973
|
+
// 18
|
|
38974
|
+
[5, 150, 120, 1, 151, 121],
|
|
38975
|
+
[9, 69, 43, 4, 70, 44],
|
|
38976
|
+
[17, 50, 22, 1, 51, 23],
|
|
38977
|
+
[2, 42, 14, 19, 43, 15],
|
|
38978
|
+
|
|
38979
|
+
// 19
|
|
38980
|
+
[3, 141, 113, 4, 142, 114],
|
|
38981
|
+
[3, 70, 44, 11, 71, 45],
|
|
38982
|
+
[17, 47, 21, 4, 48, 22],
|
|
38983
|
+
[9, 39, 13, 16, 40, 14],
|
|
38984
|
+
|
|
38985
|
+
// 20
|
|
38986
|
+
[3, 135, 107, 5, 136, 108],
|
|
38987
|
+
[3, 67, 41, 13, 68, 42],
|
|
38988
|
+
[15, 54, 24, 5, 55, 25],
|
|
38989
|
+
[15, 43, 15, 10, 44, 16],
|
|
38990
|
+
|
|
38991
|
+
// 21
|
|
38992
|
+
[4, 144, 116, 4, 145, 117],
|
|
38993
|
+
[17, 68, 42],
|
|
38994
|
+
[17, 50, 22, 6, 51, 23],
|
|
38995
|
+
[19, 46, 16, 6, 47, 17],
|
|
38996
|
+
|
|
38997
|
+
// 22
|
|
38998
|
+
[2, 139, 111, 7, 140, 112],
|
|
38999
|
+
[17, 74, 46],
|
|
39000
|
+
[7, 54, 24, 16, 55, 25],
|
|
39001
|
+
[34, 37, 13],
|
|
39002
|
+
|
|
39003
|
+
// 23
|
|
39004
|
+
[4, 151, 121, 5, 152, 122],
|
|
39005
|
+
[4, 75, 47, 14, 76, 48],
|
|
39006
|
+
[11, 54, 24, 14, 55, 25],
|
|
39007
|
+
[16, 45, 15, 14, 46, 16],
|
|
39008
|
+
|
|
39009
|
+
// 24
|
|
39010
|
+
[6, 147, 117, 4, 148, 118],
|
|
39011
|
+
[6, 73, 45, 14, 74, 46],
|
|
39012
|
+
[11, 54, 24, 16, 55, 25],
|
|
39013
|
+
[30, 46, 16, 2, 47, 17],
|
|
39014
|
+
|
|
39015
|
+
// 25
|
|
39016
|
+
[8, 132, 106, 4, 133, 107],
|
|
39017
|
+
[8, 75, 47, 13, 76, 48],
|
|
39018
|
+
[7, 54, 24, 22, 55, 25],
|
|
39019
|
+
[22, 45, 15, 13, 46, 16],
|
|
39020
|
+
|
|
39021
|
+
// 26
|
|
39022
|
+
[10, 142, 114, 2, 143, 115],
|
|
39023
|
+
[19, 74, 46, 4, 75, 47],
|
|
39024
|
+
[28, 50, 22, 6, 51, 23],
|
|
39025
|
+
[33, 46, 16, 4, 47, 17],
|
|
39026
|
+
|
|
39027
|
+
// 27
|
|
39028
|
+
[8, 152, 122, 4, 153, 123],
|
|
39029
|
+
[22, 73, 45, 3, 74, 46],
|
|
39030
|
+
[8, 53, 23, 26, 54, 24],
|
|
39031
|
+
[12, 45, 15, 28, 46, 16],
|
|
39032
|
+
|
|
39033
|
+
// 28
|
|
39034
|
+
[3, 147, 117, 10, 148, 118],
|
|
39035
|
+
[3, 73, 45, 23, 74, 46],
|
|
39036
|
+
[4, 54, 24, 31, 55, 25],
|
|
39037
|
+
[11, 45, 15, 31, 46, 16],
|
|
39038
|
+
|
|
39039
|
+
// 29
|
|
39040
|
+
[7, 146, 116, 7, 147, 117],
|
|
39041
|
+
[21, 73, 45, 7, 74, 46],
|
|
39042
|
+
[1, 53, 23, 37, 54, 24],
|
|
39043
|
+
[19, 45, 15, 26, 46, 16],
|
|
39044
|
+
|
|
39045
|
+
// 30
|
|
39046
|
+
[5, 145, 115, 10, 146, 116],
|
|
39047
|
+
[19, 75, 47, 10, 76, 48],
|
|
39048
|
+
[15, 54, 24, 25, 55, 25],
|
|
39049
|
+
[23, 45, 15, 25, 46, 16],
|
|
39050
|
+
|
|
39051
|
+
// 31
|
|
39052
|
+
[13, 145, 115, 3, 146, 116],
|
|
39053
|
+
[2, 74, 46, 29, 75, 47],
|
|
39054
|
+
[42, 54, 24, 1, 55, 25],
|
|
39055
|
+
[23, 45, 15, 28, 46, 16],
|
|
39056
|
+
|
|
39057
|
+
// 32
|
|
39058
|
+
[17, 145, 115],
|
|
39059
|
+
[10, 74, 46, 23, 75, 47],
|
|
39060
|
+
[10, 54, 24, 35, 55, 25],
|
|
39061
|
+
[19, 45, 15, 35, 46, 16],
|
|
39062
|
+
|
|
39063
|
+
// 33
|
|
39064
|
+
[17, 145, 115, 1, 146, 116],
|
|
39065
|
+
[14, 74, 46, 21, 75, 47],
|
|
39066
|
+
[29, 54, 24, 19, 55, 25],
|
|
39067
|
+
[11, 45, 15, 46, 46, 16],
|
|
39068
|
+
|
|
39069
|
+
// 34
|
|
39070
|
+
[13, 145, 115, 6, 146, 116],
|
|
39071
|
+
[14, 74, 46, 23, 75, 47],
|
|
39072
|
+
[44, 54, 24, 7, 55, 25],
|
|
39073
|
+
[59, 46, 16, 1, 47, 17],
|
|
39074
|
+
|
|
39075
|
+
// 35
|
|
39076
|
+
[12, 151, 121, 7, 152, 122],
|
|
39077
|
+
[12, 75, 47, 26, 76, 48],
|
|
39078
|
+
[39, 54, 24, 14, 55, 25],
|
|
39079
|
+
[22, 45, 15, 41, 46, 16],
|
|
39080
|
+
|
|
39081
|
+
// 36
|
|
39082
|
+
[6, 151, 121, 14, 152, 122],
|
|
39083
|
+
[6, 75, 47, 34, 76, 48],
|
|
39084
|
+
[46, 54, 24, 10, 55, 25],
|
|
39085
|
+
[2, 45, 15, 64, 46, 16],
|
|
39086
|
+
|
|
39087
|
+
// 37
|
|
39088
|
+
[17, 152, 122, 4, 153, 123],
|
|
39089
|
+
[29, 74, 46, 14, 75, 47],
|
|
39090
|
+
[49, 54, 24, 10, 55, 25],
|
|
39091
|
+
[24, 45, 15, 46, 46, 16],
|
|
39092
|
+
|
|
39093
|
+
// 38
|
|
39094
|
+
[4, 152, 122, 18, 153, 123],
|
|
39095
|
+
[13, 74, 46, 32, 75, 47],
|
|
39096
|
+
[48, 54, 24, 14, 55, 25],
|
|
39097
|
+
[42, 45, 15, 32, 46, 16],
|
|
39098
|
+
|
|
39099
|
+
// 39
|
|
39100
|
+
[20, 147, 117, 4, 148, 118],
|
|
39101
|
+
[40, 75, 47, 7, 76, 48],
|
|
39102
|
+
[43, 54, 24, 22, 55, 25],
|
|
39103
|
+
[10, 45, 15, 67, 46, 16],
|
|
39104
|
+
|
|
39105
|
+
// 40
|
|
39106
|
+
[19, 148, 118, 6, 149, 119],
|
|
39107
|
+
[18, 75, 47, 31, 76, 48],
|
|
39108
|
+
[34, 54, 24, 34, 55, 25],
|
|
39109
|
+
[20, 45, 15, 61, 46, 16]
|
|
39110
|
+
];
|
|
39111
|
+
|
|
39112
|
+
QRRSBlock.getRSBlocks = function(typeNumber, errorCorrectLevel) {
|
|
39113
|
+
|
|
39114
|
+
var rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel);
|
|
39115
|
+
|
|
39116
|
+
if (rsBlock === undefined) {
|
|
39117
|
+
throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel);
|
|
39118
|
+
}
|
|
39119
|
+
|
|
39120
|
+
var length = rsBlock.length / 3;
|
|
39121
|
+
|
|
39122
|
+
var list = [];
|
|
39123
|
+
|
|
39124
|
+
for (var i = 0; i < length; i++) {
|
|
39125
|
+
|
|
39126
|
+
var count = rsBlock[i * 3 + 0];
|
|
39127
|
+
var totalCount = rsBlock[i * 3 + 1];
|
|
39128
|
+
var dataCount = rsBlock[i * 3 + 2];
|
|
39129
|
+
|
|
39130
|
+
for (var j = 0; j < count; j++) {
|
|
39131
|
+
list.push(new QRRSBlock(totalCount, dataCount) );
|
|
39132
|
+
}
|
|
39133
|
+
}
|
|
39134
|
+
|
|
39135
|
+
return list;
|
|
39136
|
+
};
|
|
39137
|
+
|
|
39138
|
+
QRRSBlock.getRsBlockTable = function(typeNumber, errorCorrectLevel) {
|
|
39139
|
+
|
|
39140
|
+
switch(errorCorrectLevel) {
|
|
39141
|
+
case QRErrorCorrectLevel.L :
|
|
39142
|
+
return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0];
|
|
39143
|
+
case QRErrorCorrectLevel.M :
|
|
39144
|
+
return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];
|
|
39145
|
+
case QRErrorCorrectLevel.Q :
|
|
39146
|
+
return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];
|
|
39147
|
+
case QRErrorCorrectLevel.H :
|
|
39148
|
+
return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];
|
|
39149
|
+
default :
|
|
39150
|
+
return undefined;
|
|
39151
|
+
}
|
|
39152
|
+
};
|
|
39153
|
+
|
|
39154
|
+
module.exports = QRRSBlock;
|
|
39155
|
+
|
|
39156
|
+
|
|
37523
39157
|
/***/ }),
|
|
37524
39158
|
|
|
37525
39159
|
/***/ 7145:
|
|
@@ -41463,6 +43097,504 @@ function executeSchedule(parentSubscription, scheduler, work, delay, repeat) {
|
|
|
41463
43097
|
exports.executeSchedule = executeSchedule;
|
|
41464
43098
|
//# sourceMappingURL=executeSchedule.js.map
|
|
41465
43099
|
|
|
43100
|
+
/***/ }),
|
|
43101
|
+
|
|
43102
|
+
/***/ 7735:
|
|
43103
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
43104
|
+
|
|
43105
|
+
/**
|
|
43106
|
+
* @otplib/core
|
|
43107
|
+
*
|
|
43108
|
+
* @author Gerald Yeo <contact@fusedthought.com>
|
|
43109
|
+
* @version: 12.0.1
|
|
43110
|
+
* @license: MIT
|
|
43111
|
+
**/
|
|
43112
|
+
|
|
43113
|
+
|
|
43114
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
43115
|
+
|
|
43116
|
+
function objectValues(value) {
|
|
43117
|
+
return Object.keys(value).map(key => value[key]);
|
|
43118
|
+
}
|
|
43119
|
+
(function (HashAlgorithms) {
|
|
43120
|
+
HashAlgorithms["SHA1"] = "sha1";
|
|
43121
|
+
HashAlgorithms["SHA256"] = "sha256";
|
|
43122
|
+
HashAlgorithms["SHA512"] = "sha512";
|
|
43123
|
+
})(exports.HashAlgorithms || (exports.HashAlgorithms = {}));
|
|
43124
|
+
const HASH_ALGORITHMS = objectValues(exports.HashAlgorithms);
|
|
43125
|
+
(function (KeyEncodings) {
|
|
43126
|
+
KeyEncodings["ASCII"] = "ascii";
|
|
43127
|
+
KeyEncodings["BASE64"] = "base64";
|
|
43128
|
+
KeyEncodings["HEX"] = "hex";
|
|
43129
|
+
KeyEncodings["LATIN1"] = "latin1";
|
|
43130
|
+
KeyEncodings["UTF8"] = "utf8";
|
|
43131
|
+
})(exports.KeyEncodings || (exports.KeyEncodings = {}));
|
|
43132
|
+
const KEY_ENCODINGS = objectValues(exports.KeyEncodings);
|
|
43133
|
+
(function (Strategy) {
|
|
43134
|
+
Strategy["HOTP"] = "hotp";
|
|
43135
|
+
Strategy["TOTP"] = "totp";
|
|
43136
|
+
})(exports.Strategy || (exports.Strategy = {}));
|
|
43137
|
+
const STRATEGY = objectValues(exports.Strategy);
|
|
43138
|
+
const createDigestPlaceholder = () => {
|
|
43139
|
+
throw new Error('Please provide an options.createDigest implementation.');
|
|
43140
|
+
};
|
|
43141
|
+
function isTokenValid(value) {
|
|
43142
|
+
return /^(\d+)$/.test(value);
|
|
43143
|
+
}
|
|
43144
|
+
function padStart(value, maxLength, fillString) {
|
|
43145
|
+
if (value.length >= maxLength) {
|
|
43146
|
+
return value;
|
|
43147
|
+
}
|
|
43148
|
+
const padding = Array(maxLength + 1).join(fillString);
|
|
43149
|
+
return `${padding}${value}`.slice(-1 * maxLength);
|
|
43150
|
+
}
|
|
43151
|
+
function keyuri(options) {
|
|
43152
|
+
const tmpl = `otpauth://${options.type}/{labelPrefix}:{accountName}?secret={secret}{query}`;
|
|
43153
|
+
const params = [];
|
|
43154
|
+
if (STRATEGY.indexOf(options.type) < 0) {
|
|
43155
|
+
throw new Error(`Expecting options.type to be one of ${STRATEGY.join(', ')}. Received ${options.type}.`);
|
|
43156
|
+
}
|
|
43157
|
+
if (options.type === 'hotp') {
|
|
43158
|
+
if (options.counter == null || typeof options.counter !== 'number') {
|
|
43159
|
+
throw new Error('Expecting options.counter to be a number when options.type is "hotp".');
|
|
43160
|
+
}
|
|
43161
|
+
params.push(`&counter=${options.counter}`);
|
|
43162
|
+
}
|
|
43163
|
+
if (options.type === 'totp' && options.step) {
|
|
43164
|
+
params.push(`&period=${options.step}`);
|
|
43165
|
+
}
|
|
43166
|
+
if (options.digits) {
|
|
43167
|
+
params.push(`&digits=${options.digits}`);
|
|
43168
|
+
}
|
|
43169
|
+
if (options.algorithm) {
|
|
43170
|
+
params.push(`&algorithm=${options.algorithm.toUpperCase()}`);
|
|
43171
|
+
}
|
|
43172
|
+
if (options.issuer) {
|
|
43173
|
+
params.push(`&issuer=${encodeURIComponent(options.issuer)}`);
|
|
43174
|
+
}
|
|
43175
|
+
return tmpl.replace('{labelPrefix}', encodeURIComponent(options.issuer || options.accountName)).replace('{accountName}', encodeURIComponent(options.accountName)).replace('{secret}', options.secret).replace('{query}', params.join(''));
|
|
43176
|
+
}
|
|
43177
|
+
class OTP {
|
|
43178
|
+
constructor(defaultOptions = {}) {
|
|
43179
|
+
this._defaultOptions = Object.freeze({ ...defaultOptions
|
|
43180
|
+
});
|
|
43181
|
+
this._options = Object.freeze({});
|
|
43182
|
+
}
|
|
43183
|
+
create(defaultOptions = {}) {
|
|
43184
|
+
return new OTP(defaultOptions);
|
|
43185
|
+
}
|
|
43186
|
+
clone(defaultOptions = {}) {
|
|
43187
|
+
const instance = this.create({ ...this._defaultOptions,
|
|
43188
|
+
...defaultOptions
|
|
43189
|
+
});
|
|
43190
|
+
instance.options = this._options;
|
|
43191
|
+
return instance;
|
|
43192
|
+
}
|
|
43193
|
+
get options() {
|
|
43194
|
+
return Object.freeze({ ...this._defaultOptions,
|
|
43195
|
+
...this._options
|
|
43196
|
+
});
|
|
43197
|
+
}
|
|
43198
|
+
set options(options) {
|
|
43199
|
+
this._options = Object.freeze({ ...this._options,
|
|
43200
|
+
...options
|
|
43201
|
+
});
|
|
43202
|
+
}
|
|
43203
|
+
allOptions() {
|
|
43204
|
+
return this.options;
|
|
43205
|
+
}
|
|
43206
|
+
resetOptions() {
|
|
43207
|
+
this._options = Object.freeze({});
|
|
43208
|
+
}
|
|
43209
|
+
}
|
|
43210
|
+
|
|
43211
|
+
function hotpOptionsValidator(options) {
|
|
43212
|
+
if (typeof options.createDigest !== 'function') {
|
|
43213
|
+
throw new Error('Expecting options.createDigest to be a function.');
|
|
43214
|
+
}
|
|
43215
|
+
if (typeof options.createHmacKey !== 'function') {
|
|
43216
|
+
throw new Error('Expecting options.createHmacKey to be a function.');
|
|
43217
|
+
}
|
|
43218
|
+
if (typeof options.digits !== 'number') {
|
|
43219
|
+
throw new Error('Expecting options.digits to be a number.');
|
|
43220
|
+
}
|
|
43221
|
+
if (!options.algorithm || HASH_ALGORITHMS.indexOf(options.algorithm) < 0) {
|
|
43222
|
+
throw new Error(`Expecting options.algorithm to be one of ${HASH_ALGORITHMS.join(', ')}. Received ${options.algorithm}.`);
|
|
43223
|
+
}
|
|
43224
|
+
if (!options.encoding || KEY_ENCODINGS.indexOf(options.encoding) < 0) {
|
|
43225
|
+
throw new Error(`Expecting options.encoding to be one of ${KEY_ENCODINGS.join(', ')}. Received ${options.encoding}.`);
|
|
43226
|
+
}
|
|
43227
|
+
}
|
|
43228
|
+
const hotpCreateHmacKey = (algorithm, secret, encoding) => {
|
|
43229
|
+
return Buffer.from(secret, encoding).toString('hex');
|
|
43230
|
+
};
|
|
43231
|
+
function hotpDefaultOptions() {
|
|
43232
|
+
const options = {
|
|
43233
|
+
algorithm: exports.HashAlgorithms.SHA1,
|
|
43234
|
+
createHmacKey: hotpCreateHmacKey,
|
|
43235
|
+
createDigest: createDigestPlaceholder,
|
|
43236
|
+
digits: 6,
|
|
43237
|
+
encoding: exports.KeyEncodings.ASCII
|
|
43238
|
+
};
|
|
43239
|
+
return options;
|
|
43240
|
+
}
|
|
43241
|
+
function hotpOptions(opt) {
|
|
43242
|
+
const options = { ...hotpDefaultOptions(),
|
|
43243
|
+
...opt
|
|
43244
|
+
};
|
|
43245
|
+
hotpOptionsValidator(options);
|
|
43246
|
+
return Object.freeze(options);
|
|
43247
|
+
}
|
|
43248
|
+
function hotpCounter(counter) {
|
|
43249
|
+
const hexCounter = counter.toString(16);
|
|
43250
|
+
return padStart(hexCounter, 16, '0');
|
|
43251
|
+
}
|
|
43252
|
+
function hotpDigestToToken(hexDigest, digits) {
|
|
43253
|
+
const digest = Buffer.from(hexDigest, 'hex');
|
|
43254
|
+
const offset = digest[digest.length - 1] & 0xf;
|
|
43255
|
+
const binary = (digest[offset] & 0x7f) << 24 | (digest[offset + 1] & 0xff) << 16 | (digest[offset + 2] & 0xff) << 8 | digest[offset + 3] & 0xff;
|
|
43256
|
+
const token = binary % Math.pow(10, digits);
|
|
43257
|
+
return padStart(String(token), digits, '0');
|
|
43258
|
+
}
|
|
43259
|
+
function hotpDigest(secret, counter, options) {
|
|
43260
|
+
const hexCounter = hotpCounter(counter);
|
|
43261
|
+
const hmacKey = options.createHmacKey(options.algorithm, secret, options.encoding);
|
|
43262
|
+
return options.createDigest(options.algorithm, hmacKey, hexCounter);
|
|
43263
|
+
}
|
|
43264
|
+
function hotpToken(secret, counter, options) {
|
|
43265
|
+
const hexDigest = options.digest || hotpDigest(secret, counter, options);
|
|
43266
|
+
return hotpDigestToToken(hexDigest, options.digits);
|
|
43267
|
+
}
|
|
43268
|
+
function hotpCheck(token, secret, counter, options) {
|
|
43269
|
+
if (!isTokenValid(token)) {
|
|
43270
|
+
return false;
|
|
43271
|
+
}
|
|
43272
|
+
const systemToken = hotpToken(secret, counter, options);
|
|
43273
|
+
return token === systemToken;
|
|
43274
|
+
}
|
|
43275
|
+
function hotpKeyuri(accountName, issuer, secret, counter, options) {
|
|
43276
|
+
return keyuri({
|
|
43277
|
+
algorithm: options.algorithm,
|
|
43278
|
+
digits: options.digits,
|
|
43279
|
+
type: exports.Strategy.HOTP,
|
|
43280
|
+
accountName,
|
|
43281
|
+
counter,
|
|
43282
|
+
issuer,
|
|
43283
|
+
secret
|
|
43284
|
+
});
|
|
43285
|
+
}
|
|
43286
|
+
class HOTP extends OTP {
|
|
43287
|
+
create(defaultOptions = {}) {
|
|
43288
|
+
return new HOTP(defaultOptions);
|
|
43289
|
+
}
|
|
43290
|
+
allOptions() {
|
|
43291
|
+
return hotpOptions(this.options);
|
|
43292
|
+
}
|
|
43293
|
+
generate(secret, counter) {
|
|
43294
|
+
return hotpToken(secret, counter, this.allOptions());
|
|
43295
|
+
}
|
|
43296
|
+
check(token, secret, counter) {
|
|
43297
|
+
return hotpCheck(token, secret, counter, this.allOptions());
|
|
43298
|
+
}
|
|
43299
|
+
verify(opts) {
|
|
43300
|
+
if (typeof opts !== 'object') {
|
|
43301
|
+
throw new Error('Expecting argument 0 of verify to be an object');
|
|
43302
|
+
}
|
|
43303
|
+
return this.check(opts.token, opts.secret, opts.counter);
|
|
43304
|
+
}
|
|
43305
|
+
keyuri(accountName, issuer, secret, counter) {
|
|
43306
|
+
return hotpKeyuri(accountName, issuer, secret, counter, this.allOptions());
|
|
43307
|
+
}
|
|
43308
|
+
}
|
|
43309
|
+
|
|
43310
|
+
function parseWindowBounds(win) {
|
|
43311
|
+
if (typeof win === 'number') {
|
|
43312
|
+
return [Math.abs(win), Math.abs(win)];
|
|
43313
|
+
}
|
|
43314
|
+
if (Array.isArray(win)) {
|
|
43315
|
+
const [past, future] = win;
|
|
43316
|
+
if (typeof past === 'number' && typeof future === 'number') {
|
|
43317
|
+
return [Math.abs(past), Math.abs(future)];
|
|
43318
|
+
}
|
|
43319
|
+
}
|
|
43320
|
+
throw new Error('Expecting options.window to be an number or [number, number].');
|
|
43321
|
+
}
|
|
43322
|
+
function totpOptionsValidator(options) {
|
|
43323
|
+
hotpOptionsValidator(options);
|
|
43324
|
+
parseWindowBounds(options.window);
|
|
43325
|
+
if (typeof options.epoch !== 'number') {
|
|
43326
|
+
throw new Error('Expecting options.epoch to be a number.');
|
|
43327
|
+
}
|
|
43328
|
+
if (typeof options.step !== 'number') {
|
|
43329
|
+
throw new Error('Expecting options.step to be a number.');
|
|
43330
|
+
}
|
|
43331
|
+
}
|
|
43332
|
+
const totpPadSecret = (secret, encoding, minLength) => {
|
|
43333
|
+
const currentLength = secret.length;
|
|
43334
|
+
const hexSecret = Buffer.from(secret, encoding).toString('hex');
|
|
43335
|
+
if (currentLength < minLength) {
|
|
43336
|
+
const newSecret = new Array(minLength - currentLength + 1).join(hexSecret);
|
|
43337
|
+
return Buffer.from(newSecret, 'hex').slice(0, minLength).toString('hex');
|
|
43338
|
+
}
|
|
43339
|
+
return hexSecret;
|
|
43340
|
+
};
|
|
43341
|
+
const totpCreateHmacKey = (algorithm, secret, encoding) => {
|
|
43342
|
+
switch (algorithm) {
|
|
43343
|
+
case exports.HashAlgorithms.SHA1:
|
|
43344
|
+
return totpPadSecret(secret, encoding, 20);
|
|
43345
|
+
case exports.HashAlgorithms.SHA256:
|
|
43346
|
+
return totpPadSecret(secret, encoding, 32);
|
|
43347
|
+
case exports.HashAlgorithms.SHA512:
|
|
43348
|
+
return totpPadSecret(secret, encoding, 64);
|
|
43349
|
+
default:
|
|
43350
|
+
throw new Error(`Expecting algorithm to be one of ${HASH_ALGORITHMS.join(', ')}. Received ${algorithm}.`);
|
|
43351
|
+
}
|
|
43352
|
+
};
|
|
43353
|
+
function totpDefaultOptions() {
|
|
43354
|
+
const options = {
|
|
43355
|
+
algorithm: exports.HashAlgorithms.SHA1,
|
|
43356
|
+
createDigest: createDigestPlaceholder,
|
|
43357
|
+
createHmacKey: totpCreateHmacKey,
|
|
43358
|
+
digits: 6,
|
|
43359
|
+
encoding: exports.KeyEncodings.ASCII,
|
|
43360
|
+
epoch: Date.now(),
|
|
43361
|
+
step: 30,
|
|
43362
|
+
window: 0
|
|
43363
|
+
};
|
|
43364
|
+
return options;
|
|
43365
|
+
}
|
|
43366
|
+
function totpOptions(opt) {
|
|
43367
|
+
const options = { ...totpDefaultOptions(),
|
|
43368
|
+
...opt
|
|
43369
|
+
};
|
|
43370
|
+
totpOptionsValidator(options);
|
|
43371
|
+
return Object.freeze(options);
|
|
43372
|
+
}
|
|
43373
|
+
function totpCounter(epoch, step) {
|
|
43374
|
+
return Math.floor(epoch / step / 1000);
|
|
43375
|
+
}
|
|
43376
|
+
function totpToken(secret, options) {
|
|
43377
|
+
const counter = totpCounter(options.epoch, options.step);
|
|
43378
|
+
return hotpToken(secret, counter, options);
|
|
43379
|
+
}
|
|
43380
|
+
function totpEpochsInWindow(epoch, direction, deltaPerEpoch, numOfEpoches) {
|
|
43381
|
+
const result = [];
|
|
43382
|
+
if (numOfEpoches === 0) {
|
|
43383
|
+
return result;
|
|
43384
|
+
}
|
|
43385
|
+
for (let i = 1; i <= numOfEpoches; i++) {
|
|
43386
|
+
const delta = direction * i * deltaPerEpoch;
|
|
43387
|
+
result.push(epoch + delta);
|
|
43388
|
+
}
|
|
43389
|
+
return result;
|
|
43390
|
+
}
|
|
43391
|
+
function totpEpochAvailable(epoch, step, win) {
|
|
43392
|
+
const bounds = parseWindowBounds(win);
|
|
43393
|
+
const delta = step * 1000;
|
|
43394
|
+
return {
|
|
43395
|
+
current: epoch,
|
|
43396
|
+
past: totpEpochsInWindow(epoch, -1, delta, bounds[0]),
|
|
43397
|
+
future: totpEpochsInWindow(epoch, 1, delta, bounds[1])
|
|
43398
|
+
};
|
|
43399
|
+
}
|
|
43400
|
+
function totpCheck(token, secret, options) {
|
|
43401
|
+
if (!isTokenValid(token)) {
|
|
43402
|
+
return false;
|
|
43403
|
+
}
|
|
43404
|
+
const systemToken = totpToken(secret, options);
|
|
43405
|
+
return token === systemToken;
|
|
43406
|
+
}
|
|
43407
|
+
function totpCheckByEpoch(epochs, token, secret, options) {
|
|
43408
|
+
let position = null;
|
|
43409
|
+
epochs.some((epoch, idx) => {
|
|
43410
|
+
if (totpCheck(token, secret, { ...options,
|
|
43411
|
+
epoch
|
|
43412
|
+
})) {
|
|
43413
|
+
position = idx + 1;
|
|
43414
|
+
return true;
|
|
43415
|
+
}
|
|
43416
|
+
return false;
|
|
43417
|
+
});
|
|
43418
|
+
return position;
|
|
43419
|
+
}
|
|
43420
|
+
function totpCheckWithWindow(token, secret, options) {
|
|
43421
|
+
if (totpCheck(token, secret, options)) {
|
|
43422
|
+
return 0;
|
|
43423
|
+
}
|
|
43424
|
+
const epochs = totpEpochAvailable(options.epoch, options.step, options.window);
|
|
43425
|
+
const backward = totpCheckByEpoch(epochs.past, token, secret, options);
|
|
43426
|
+
if (backward !== null) {
|
|
43427
|
+
return backward * -1;
|
|
43428
|
+
}
|
|
43429
|
+
return totpCheckByEpoch(epochs.future, token, secret, options);
|
|
43430
|
+
}
|
|
43431
|
+
function totpTimeUsed(epoch, step) {
|
|
43432
|
+
return Math.floor(epoch / 1000) % step;
|
|
43433
|
+
}
|
|
43434
|
+
function totpTimeRemaining(epoch, step) {
|
|
43435
|
+
return step - totpTimeUsed(epoch, step);
|
|
43436
|
+
}
|
|
43437
|
+
function totpKeyuri(accountName, issuer, secret, options) {
|
|
43438
|
+
return keyuri({
|
|
43439
|
+
algorithm: options.algorithm,
|
|
43440
|
+
digits: options.digits,
|
|
43441
|
+
step: options.step,
|
|
43442
|
+
type: exports.Strategy.TOTP,
|
|
43443
|
+
accountName,
|
|
43444
|
+
issuer,
|
|
43445
|
+
secret
|
|
43446
|
+
});
|
|
43447
|
+
}
|
|
43448
|
+
class TOTP extends HOTP {
|
|
43449
|
+
create(defaultOptions = {}) {
|
|
43450
|
+
return new TOTP(defaultOptions);
|
|
43451
|
+
}
|
|
43452
|
+
allOptions() {
|
|
43453
|
+
return totpOptions(this.options);
|
|
43454
|
+
}
|
|
43455
|
+
generate(secret) {
|
|
43456
|
+
return totpToken(secret, this.allOptions());
|
|
43457
|
+
}
|
|
43458
|
+
checkDelta(token, secret) {
|
|
43459
|
+
return totpCheckWithWindow(token, secret, this.allOptions());
|
|
43460
|
+
}
|
|
43461
|
+
check(token, secret) {
|
|
43462
|
+
const delta = this.checkDelta(token, secret);
|
|
43463
|
+
return typeof delta === 'number';
|
|
43464
|
+
}
|
|
43465
|
+
verify(opts) {
|
|
43466
|
+
if (typeof opts !== 'object') {
|
|
43467
|
+
throw new Error('Expecting argument 0 of verify to be an object');
|
|
43468
|
+
}
|
|
43469
|
+
return this.check(opts.token, opts.secret);
|
|
43470
|
+
}
|
|
43471
|
+
timeRemaining() {
|
|
43472
|
+
const options = this.allOptions();
|
|
43473
|
+
return totpTimeRemaining(options.epoch, options.step);
|
|
43474
|
+
}
|
|
43475
|
+
timeUsed() {
|
|
43476
|
+
const options = this.allOptions();
|
|
43477
|
+
return totpTimeUsed(options.epoch, options.step);
|
|
43478
|
+
}
|
|
43479
|
+
keyuri(accountName, issuer, secret) {
|
|
43480
|
+
return totpKeyuri(accountName, issuer, secret, this.allOptions());
|
|
43481
|
+
}
|
|
43482
|
+
}
|
|
43483
|
+
|
|
43484
|
+
function authenticatorOptionValidator(options) {
|
|
43485
|
+
totpOptionsValidator(options);
|
|
43486
|
+
if (typeof options.keyDecoder !== 'function') {
|
|
43487
|
+
throw new Error('Expecting options.keyDecoder to be a function.');
|
|
43488
|
+
}
|
|
43489
|
+
if (options.keyEncoder && typeof options.keyEncoder !== 'function') {
|
|
43490
|
+
throw new Error('Expecting options.keyEncoder to be a function.');
|
|
43491
|
+
}
|
|
43492
|
+
}
|
|
43493
|
+
function authenticatorDefaultOptions() {
|
|
43494
|
+
const options = {
|
|
43495
|
+
algorithm: exports.HashAlgorithms.SHA1,
|
|
43496
|
+
createDigest: createDigestPlaceholder,
|
|
43497
|
+
createHmacKey: totpCreateHmacKey,
|
|
43498
|
+
digits: 6,
|
|
43499
|
+
encoding: exports.KeyEncodings.HEX,
|
|
43500
|
+
epoch: Date.now(),
|
|
43501
|
+
step: 30,
|
|
43502
|
+
window: 0
|
|
43503
|
+
};
|
|
43504
|
+
return options;
|
|
43505
|
+
}
|
|
43506
|
+
function authenticatorOptions(opt) {
|
|
43507
|
+
const options = { ...authenticatorDefaultOptions(),
|
|
43508
|
+
...opt
|
|
43509
|
+
};
|
|
43510
|
+
authenticatorOptionValidator(options);
|
|
43511
|
+
return Object.freeze(options);
|
|
43512
|
+
}
|
|
43513
|
+
function authenticatorEncoder(secret, options) {
|
|
43514
|
+
return options.keyEncoder(secret, options.encoding);
|
|
43515
|
+
}
|
|
43516
|
+
function authenticatorDecoder(secret, options) {
|
|
43517
|
+
return options.keyDecoder(secret, options.encoding);
|
|
43518
|
+
}
|
|
43519
|
+
function authenticatorGenerateSecret(numberOfBytes, options) {
|
|
43520
|
+
const key = options.createRandomBytes(numberOfBytes, options.encoding);
|
|
43521
|
+
return authenticatorEncoder(key, options);
|
|
43522
|
+
}
|
|
43523
|
+
function authenticatorToken(secret, options) {
|
|
43524
|
+
return totpToken(authenticatorDecoder(secret, options), options);
|
|
43525
|
+
}
|
|
43526
|
+
function authenticatorCheckWithWindow(token, secret, options) {
|
|
43527
|
+
return totpCheckWithWindow(token, authenticatorDecoder(secret, options), options);
|
|
43528
|
+
}
|
|
43529
|
+
class Authenticator extends TOTP {
|
|
43530
|
+
create(defaultOptions = {}) {
|
|
43531
|
+
return new Authenticator(defaultOptions);
|
|
43532
|
+
}
|
|
43533
|
+
allOptions() {
|
|
43534
|
+
return authenticatorOptions(this.options);
|
|
43535
|
+
}
|
|
43536
|
+
generate(secret) {
|
|
43537
|
+
return authenticatorToken(secret, this.allOptions());
|
|
43538
|
+
}
|
|
43539
|
+
checkDelta(token, secret) {
|
|
43540
|
+
return authenticatorCheckWithWindow(token, secret, this.allOptions());
|
|
43541
|
+
}
|
|
43542
|
+
encode(secret) {
|
|
43543
|
+
return authenticatorEncoder(secret, this.allOptions());
|
|
43544
|
+
}
|
|
43545
|
+
decode(secret) {
|
|
43546
|
+
return authenticatorDecoder(secret, this.allOptions());
|
|
43547
|
+
}
|
|
43548
|
+
generateSecret(numberOfBytes = 10) {
|
|
43549
|
+
return authenticatorGenerateSecret(numberOfBytes, this.allOptions());
|
|
43550
|
+
}
|
|
43551
|
+
}
|
|
43552
|
+
|
|
43553
|
+
exports.Authenticator = Authenticator;
|
|
43554
|
+
exports.HASH_ALGORITHMS = HASH_ALGORITHMS;
|
|
43555
|
+
exports.HOTP = HOTP;
|
|
43556
|
+
exports.KEY_ENCODINGS = KEY_ENCODINGS;
|
|
43557
|
+
exports.OTP = OTP;
|
|
43558
|
+
exports.STRATEGY = STRATEGY;
|
|
43559
|
+
exports.TOTP = TOTP;
|
|
43560
|
+
exports.authenticatorCheckWithWindow = authenticatorCheckWithWindow;
|
|
43561
|
+
exports.authenticatorDecoder = authenticatorDecoder;
|
|
43562
|
+
exports.authenticatorDefaultOptions = authenticatorDefaultOptions;
|
|
43563
|
+
exports.authenticatorEncoder = authenticatorEncoder;
|
|
43564
|
+
exports.authenticatorGenerateSecret = authenticatorGenerateSecret;
|
|
43565
|
+
exports.authenticatorOptionValidator = authenticatorOptionValidator;
|
|
43566
|
+
exports.authenticatorOptions = authenticatorOptions;
|
|
43567
|
+
exports.authenticatorToken = authenticatorToken;
|
|
43568
|
+
exports.createDigestPlaceholder = createDigestPlaceholder;
|
|
43569
|
+
exports.hotpCheck = hotpCheck;
|
|
43570
|
+
exports.hotpCounter = hotpCounter;
|
|
43571
|
+
exports.hotpCreateHmacKey = hotpCreateHmacKey;
|
|
43572
|
+
exports.hotpDefaultOptions = hotpDefaultOptions;
|
|
43573
|
+
exports.hotpDigestToToken = hotpDigestToToken;
|
|
43574
|
+
exports.hotpKeyuri = hotpKeyuri;
|
|
43575
|
+
exports.hotpOptions = hotpOptions;
|
|
43576
|
+
exports.hotpOptionsValidator = hotpOptionsValidator;
|
|
43577
|
+
exports.hotpToken = hotpToken;
|
|
43578
|
+
exports.isTokenValid = isTokenValid;
|
|
43579
|
+
exports.keyuri = keyuri;
|
|
43580
|
+
exports.objectValues = objectValues;
|
|
43581
|
+
exports.padStart = padStart;
|
|
43582
|
+
exports.totpCheck = totpCheck;
|
|
43583
|
+
exports.totpCheckByEpoch = totpCheckByEpoch;
|
|
43584
|
+
exports.totpCheckWithWindow = totpCheckWithWindow;
|
|
43585
|
+
exports.totpCounter = totpCounter;
|
|
43586
|
+
exports.totpCreateHmacKey = totpCreateHmacKey;
|
|
43587
|
+
exports.totpDefaultOptions = totpDefaultOptions;
|
|
43588
|
+
exports.totpEpochAvailable = totpEpochAvailable;
|
|
43589
|
+
exports.totpKeyuri = totpKeyuri;
|
|
43590
|
+
exports.totpOptions = totpOptions;
|
|
43591
|
+
exports.totpOptionsValidator = totpOptionsValidator;
|
|
43592
|
+
exports.totpPadSecret = totpPadSecret;
|
|
43593
|
+
exports.totpTimeRemaining = totpTimeRemaining;
|
|
43594
|
+
exports.totpTimeUsed = totpTimeUsed;
|
|
43595
|
+
exports.totpToken = totpToken;
|
|
43596
|
+
|
|
43597
|
+
|
|
41466
43598
|
/***/ }),
|
|
41467
43599
|
|
|
41468
43600
|
/***/ 7739:
|
|
@@ -42063,6 +44195,44 @@ function exhaustAll() {
|
|
|
42063
44195
|
exports.exhaustAll = exhaustAll;
|
|
42064
44196
|
//# sourceMappingURL=exhaustAll.js.map
|
|
42065
44197
|
|
|
44198
|
+
/***/ }),
|
|
44199
|
+
|
|
44200
|
+
/***/ 8095:
|
|
44201
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
44202
|
+
|
|
44203
|
+
/**
|
|
44204
|
+
* @otplib/preset-default
|
|
44205
|
+
*
|
|
44206
|
+
* @author Gerald Yeo <contact@fusedthought.com>
|
|
44207
|
+
* @version: 12.0.1
|
|
44208
|
+
* @license: MIT
|
|
44209
|
+
**/
|
|
44210
|
+
|
|
44211
|
+
|
|
44212
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
44213
|
+
|
|
44214
|
+
var pluginCrypto = __webpack_require__(279);
|
|
44215
|
+
var pluginThirtyTwo = __webpack_require__(3523);
|
|
44216
|
+
var core = __webpack_require__(7735);
|
|
44217
|
+
|
|
44218
|
+
const hotp = new core.HOTP({
|
|
44219
|
+
createDigest: pluginCrypto.createDigest
|
|
44220
|
+
});
|
|
44221
|
+
const totp = new core.TOTP({
|
|
44222
|
+
createDigest: pluginCrypto.createDigest
|
|
44223
|
+
});
|
|
44224
|
+
const authenticator = new core.Authenticator({
|
|
44225
|
+
createDigest: pluginCrypto.createDigest,
|
|
44226
|
+
createRandomBytes: pluginCrypto.createRandomBytes,
|
|
44227
|
+
keyDecoder: pluginThirtyTwo.keyDecoder,
|
|
44228
|
+
keyEncoder: pluginThirtyTwo.keyEncoder
|
|
44229
|
+
});
|
|
44230
|
+
|
|
44231
|
+
exports.authenticator = authenticator;
|
|
44232
|
+
exports.hotp = hotp;
|
|
44233
|
+
exports.totp = totp;
|
|
44234
|
+
|
|
44235
|
+
|
|
42066
44236
|
/***/ }),
|
|
42067
44237
|
|
|
42068
44238
|
/***/ 8109:
|
|
@@ -44557,6 +46727,23 @@ function isPOJO(obj) {
|
|
|
44557
46727
|
}
|
|
44558
46728
|
//# sourceMappingURL=argsArgArrayOrObject.js.map
|
|
44559
46729
|
|
|
46730
|
+
/***/ }),
|
|
46731
|
+
|
|
46732
|
+
/***/ 9207:
|
|
46733
|
+
/***/ ((module) => {
|
|
46734
|
+
|
|
46735
|
+
module.exports = {
|
|
46736
|
+
PATTERN000 : 0,
|
|
46737
|
+
PATTERN001 : 1,
|
|
46738
|
+
PATTERN010 : 2,
|
|
46739
|
+
PATTERN011 : 3,
|
|
46740
|
+
PATTERN100 : 4,
|
|
46741
|
+
PATTERN101 : 5,
|
|
46742
|
+
PATTERN110 : 6,
|
|
46743
|
+
PATTERN111 : 7
|
|
46744
|
+
};
|
|
46745
|
+
|
|
46746
|
+
|
|
44560
46747
|
/***/ }),
|
|
44561
46748
|
|
|
44562
46749
|
/***/ 9232:
|
|
@@ -47934,6 +50121,19 @@ function bufferTime(bufferTimeSpan) {
|
|
|
47934
50121
|
exports.bufferTime = bufferTime;
|
|
47935
50122
|
//# sourceMappingURL=bufferTime.js.map
|
|
47936
50123
|
|
|
50124
|
+
/***/ }),
|
|
50125
|
+
|
|
50126
|
+
/***/ 9802:
|
|
50127
|
+
/***/ ((module) => {
|
|
50128
|
+
|
|
50129
|
+
module.exports = {
|
|
50130
|
+
MODE_NUMBER : 1 << 0,
|
|
50131
|
+
MODE_ALPHA_NUM : 1 << 1,
|
|
50132
|
+
MODE_8BIT_BYTE : 1 << 2,
|
|
50133
|
+
MODE_KANJI : 1 << 3
|
|
50134
|
+
};
|
|
50135
|
+
|
|
50136
|
+
|
|
47937
50137
|
/***/ }),
|
|
47938
50138
|
|
|
47939
50139
|
/***/ 9815:
|
|
@@ -62172,6 +64372,7 @@ function showCacheHelp() {
|
|
|
62172
64372
|
};
|
|
62173
64373
|
(0,helpFormatter/* createStandardHelp */.ht)(helpConfig);
|
|
62174
64374
|
}
|
|
64375
|
+
const CLI_CACHE_DIR = '.package-installer-cli';
|
|
62175
64376
|
/**
|
|
62176
64377
|
* Main cache command function
|
|
62177
64378
|
*/
|
|
@@ -62236,7 +64437,7 @@ async function cacheCommand(subcommand, type, options = {}) {
|
|
|
62236
64437
|
console.log(source/* default */.Ay.gray(` Cached Projects: ${stats.projects?.length || 0}`));
|
|
62237
64438
|
console.log(source/* default */.Ay.gray(` Template Files: ${stats.templateFiles?.size || Object.keys(stats.templateFiles || {}).length || 0}`));
|
|
62238
64439
|
// Show cache size
|
|
62239
|
-
const cacheDir = external_path_.join(external_os_.homedir(),
|
|
64440
|
+
const cacheDir = external_path_.join(external_os_.homedir(), CLI_CACHE_DIR);
|
|
62240
64441
|
if (await fs_extra_lib.pathExists(cacheDir)) {
|
|
62241
64442
|
const size = await (0,utils_cacheManager/* getDirectorySize */.fC)(cacheDir);
|
|
62242
64443
|
console.log(source/* default */.Ay.gray(` Cache Size: ${(size / 1024 / 1024).toFixed(2)} MB`));
|
|
@@ -62271,7 +64472,7 @@ async function cacheStatsCommand() {
|
|
|
62271
64472
|
const hitRatio = totalRequests > 0 ? ((stats.hits || 0) / totalRequests * 100).toFixed(1) : '0';
|
|
62272
64473
|
console.log(source/* default */.Ay.gray(` Hit Ratio: ${hitRatio}%`));
|
|
62273
64474
|
// Storage information
|
|
62274
|
-
const cacheDir = external_path_.join(external_os_.homedir(),
|
|
64475
|
+
const cacheDir = external_path_.join(external_os_.homedir(), CLI_CACHE_DIR);
|
|
62275
64476
|
if (await fs_extra_lib.pathExists(cacheDir)) {
|
|
62276
64477
|
const size = await (0,utils_cacheManager/* getDirectorySize */.fC)(cacheDir);
|
|
62277
64478
|
console.log(source/* default */.Ay.gray(` Cache Size: ${(size / 1024 / 1024).toFixed(2)} MB`));
|
|
@@ -62290,7 +64491,7 @@ async function cacheClearCommand(type) {
|
|
|
62290
64491
|
console.log((0,dist/* default */.Ay)(['#00d2d3', '#0084ff'])('\n🗑️ Cache Cleaner\n'));
|
|
62291
64492
|
const spinner = (0,node_modules_ora/* default */.Ay)('Clearing cache...').start();
|
|
62292
64493
|
try {
|
|
62293
|
-
const cacheDir = external_path_.join(external_os_.homedir(),
|
|
64494
|
+
const cacheDir = external_path_.join(external_os_.homedir(), CLI_CACHE_DIR);
|
|
62294
64495
|
if (type) {
|
|
62295
64496
|
// Clear specific cache type
|
|
62296
64497
|
const cacheFile = external_path_.join(cacheDir, 'cache.json');
|
|
@@ -62342,21 +64543,17 @@ async function cacheClearCommand(type) {
|
|
|
62342
64543
|
*/
|
|
62343
64544
|
async function cacheInfoCommand() {
|
|
62344
64545
|
console.log((0,dist/* default */.Ay)(['#00d2d3', '#0084ff'])('\n🔧 Cache Configuration\n'));
|
|
62345
|
-
const
|
|
62346
|
-
const
|
|
62347
|
-
const cacheDir = path.join(os.homedir(), '.pi-cache');
|
|
62348
|
-
const cacheFile = path.join(cacheDir, 'cache.json');
|
|
64546
|
+
const cacheDir = external_path_.join(external_os_.homedir(), CLI_CACHE_DIR);
|
|
64547
|
+
const cacheFile = external_path_.join(cacheDir, 'cache.json');
|
|
62349
64548
|
console.log(source/* default */.Ay.cyan('Cache Configuration:'));
|
|
62350
64549
|
console.log(source/* default */.Ay.gray(` Cache Directory: ${cacheDir}`));
|
|
62351
64550
|
console.log(source/* default */.Ay.gray(` Cache File: ${cacheFile}`));
|
|
62352
|
-
console.log(source/* default */.Ay.gray(` Cache Version:
|
|
62353
|
-
|
|
62354
|
-
const fs = require('fs-extra');
|
|
62355
|
-
const exists = await fs.pathExists(cacheFile);
|
|
64551
|
+
console.log(source/* default */.Ay.gray(` Cache Version: 3.11.2`));
|
|
64552
|
+
const exists = await fs_extra_lib.pathExists(cacheFile);
|
|
62356
64553
|
console.log(source/* default */.Ay.gray(` Cache File Exists: ${exists ? 'Yes' : 'No'}`));
|
|
62357
64554
|
if (exists) {
|
|
62358
64555
|
try {
|
|
62359
|
-
const stats = await
|
|
64556
|
+
const stats = await fs_extra_lib.stat(cacheFile);
|
|
62360
64557
|
const size = (stats.size / 1024).toFixed(2);
|
|
62361
64558
|
const modified = stats.mtime.toLocaleString();
|
|
62362
64559
|
console.log(source/* default */.Ay.gray(` File Size: ${size} KB`));
|
|
@@ -62381,7 +64578,7 @@ async function cacheSizeCommand() {
|
|
|
62381
64578
|
console.log((0,dist/* default */.Ay)(['#00d2d3', '#0084ff'])('\n📊 Cache Size Information\n'));
|
|
62382
64579
|
const spinner = (0,node_modules_ora/* default */.Ay)('Calculating cache size...').start();
|
|
62383
64580
|
try {
|
|
62384
|
-
const cacheDir = external_path_.join(external_os_.homedir(),
|
|
64581
|
+
const cacheDir = external_path_.join(external_os_.homedir(), CLI_CACHE_DIR);
|
|
62385
64582
|
if (!await fs_extra_lib.pathExists(cacheDir)) {
|
|
62386
64583
|
spinner.warn('Cache directory not found');
|
|
62387
64584
|
console.log(source/* default */.Ay.yellow('⚠️ Cache has not been initialized yet'));
|
|
@@ -62421,7 +64618,7 @@ async function cacheOptimizeCommand() {
|
|
|
62421
64618
|
console.log((0,dist/* default */.Ay)(['#00d2d3', '#0084ff'])('\n⚡ Cache Optimizer\n'));
|
|
62422
64619
|
const spinner = (0,node_modules_ora/* default */.Ay)('Optimizing cache...').start();
|
|
62423
64620
|
try {
|
|
62424
|
-
const cacheDir = external_path_.join(external_os_.homedir(),
|
|
64621
|
+
const cacheDir = external_path_.join(external_os_.homedir(), CLI_CACHE_DIR);
|
|
62425
64622
|
const cacheFile = external_path_.join(cacheDir, 'cache.json');
|
|
62426
64623
|
if (!await fs_extra_lib.pathExists(cacheFile)) {
|
|
62427
64624
|
spinner.warn('Cache file not found');
|
|
@@ -62538,16 +64735,13 @@ function checkDevelopmentTools() {
|
|
|
62538
64735
|
const tools = [
|
|
62539
64736
|
{ name: 'Node.js', command: 'node', flag: '--version' },
|
|
62540
64737
|
{ name: 'npm', command: 'npm', flag: '--version' },
|
|
62541
|
-
{ name: 'yarn', command: 'yarn', flag: '--version' },
|
|
62542
64738
|
{ name: 'pnpm', command: 'pnpm', flag: '--version' },
|
|
62543
64739
|
{ name: 'Git', command: 'git', flag: '--version' },
|
|
62544
64740
|
{ name: 'Docker', command: 'docker', flag: '--version' },
|
|
62545
64741
|
{ name: 'Python', command: 'python3', flag: '--version' },
|
|
62546
64742
|
{ name: 'Rust', command: 'rustc', flag: '--version' },
|
|
62547
64743
|
{ name: 'Go', command: 'go', flag: 'version' },
|
|
62548
|
-
{ name: 'PHP', command: 'php', flag: '--version' },
|
|
62549
64744
|
{ name: 'Ruby', command: 'ruby', flag: '--version' },
|
|
62550
|
-
{ name: 'Java', command: 'java', flag: '--version' },
|
|
62551
64745
|
{ name: 'VS Code', command: 'code', flag: '--version' }
|
|
62552
64746
|
];
|
|
62553
64747
|
return tools.map(tool => ({
|
|
@@ -62632,7 +64826,7 @@ STRIPE_SECRET_KEY=sk_test_...
|
|
|
62632
64826
|
STRIPE_PUBLISHABLE_KEY=pk_test_...
|
|
62633
64827
|
`;
|
|
62634
64828
|
await fs_extra_lib.writeFile(envPath, envContent);
|
|
62635
|
-
console.log(source/* default */.Ay.green(`✅ Generated .env
|
|
64829
|
+
console.log(source/* default */.Ay.green(`✅ Generated .env template at ${envPath}`));
|
|
62636
64830
|
}
|
|
62637
64831
|
catch (error) {
|
|
62638
64832
|
console.error(source/* default */.Ay.red('❌ Failed to generate .env template:'), error);
|
|
@@ -66758,6 +68952,551 @@ async function emailCommand(category, options = {}) {
|
|
|
66758
68952
|
}
|
|
66759
68953
|
}
|
|
66760
68954
|
|
|
68955
|
+
// EXTERNAL MODULE: external "crypto"
|
|
68956
|
+
var external_crypto_ = __webpack_require__(6982);
|
|
68957
|
+
;// ./dist/utils/authStore.js
|
|
68958
|
+
|
|
68959
|
+
|
|
68960
|
+
|
|
68961
|
+
|
|
68962
|
+
class AuthStore {
|
|
68963
|
+
constructor() {
|
|
68964
|
+
this.records = [];
|
|
68965
|
+
this.failedAttempts = {};
|
|
68966
|
+
this.dir = external_path_.join(external_os_.homedir(), '.package-installer-cli');
|
|
68967
|
+
this.file = external_path_.join(this.dir, 'auth.json');
|
|
68968
|
+
this.sessionFile = external_path_.join(this.dir, 'session.json');
|
|
68969
|
+
}
|
|
68970
|
+
async init() {
|
|
68971
|
+
await fs_extra_lib.ensureDir(this.dir);
|
|
68972
|
+
// Restrict directory permissions to user only
|
|
68973
|
+
try {
|
|
68974
|
+
await fs_extra_lib.chmod(this.dir, 0o700);
|
|
68975
|
+
}
|
|
68976
|
+
catch { }
|
|
68977
|
+
if (await fs_extra_lib.pathExists(this.file)) {
|
|
68978
|
+
try {
|
|
68979
|
+
const data = await fs_extra_lib.readJson(this.file);
|
|
68980
|
+
this.records = Array.isArray(data) ? data : [];
|
|
68981
|
+
}
|
|
68982
|
+
catch {
|
|
68983
|
+
this.records = [];
|
|
68984
|
+
}
|
|
68985
|
+
}
|
|
68986
|
+
}
|
|
68987
|
+
async save() {
|
|
68988
|
+
await fs_extra_lib.writeJson(this.file, this.records, { spaces: 2 });
|
|
68989
|
+
// Restrict file permissions to user only
|
|
68990
|
+
try {
|
|
68991
|
+
await fs_extra_lib.chmod(this.file, 0o600);
|
|
68992
|
+
}
|
|
68993
|
+
catch { }
|
|
68994
|
+
}
|
|
68995
|
+
hashPassword(password, salt) {
|
|
68996
|
+
// Use scrypt for password hashing (built-in, fast and secure)
|
|
68997
|
+
return external_crypto_.scryptSync(password, salt, 64);
|
|
68998
|
+
}
|
|
68999
|
+
async createUser(email, password) {
|
|
69000
|
+
const existing = this.records.find(r => r.email === email.toLowerCase());
|
|
69001
|
+
if (existing)
|
|
69002
|
+
throw new Error('User already exists');
|
|
69003
|
+
// Basic validation
|
|
69004
|
+
const normalizedEmail = email.trim().toLowerCase();
|
|
69005
|
+
if (!/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(normalizedEmail)) {
|
|
69006
|
+
throw new Error('Invalid email address');
|
|
69007
|
+
}
|
|
69008
|
+
if (password.length < 8) {
|
|
69009
|
+
throw new Error('Password must be at least 8 characters long');
|
|
69010
|
+
}
|
|
69011
|
+
const salt = external_crypto_.randomBytes(16);
|
|
69012
|
+
const hash = this.hashPassword(password, salt);
|
|
69013
|
+
const record = {
|
|
69014
|
+
email: email.toLowerCase(),
|
|
69015
|
+
salt: salt.toString('hex'),
|
|
69016
|
+
hash: hash.toString('hex'),
|
|
69017
|
+
createdAt: new Date().toISOString(),
|
|
69018
|
+
usageCount: 0,
|
|
69019
|
+
usageLimit: 3,
|
|
69020
|
+
};
|
|
69021
|
+
this.records.push(record);
|
|
69022
|
+
await this.save();
|
|
69023
|
+
return record;
|
|
69024
|
+
}
|
|
69025
|
+
// Increment usage for unverified user, return true if allowed, false if over limit
|
|
69026
|
+
async incrementUsage(email) {
|
|
69027
|
+
const rec = this.records.find(r => r.email === email.toLowerCase());
|
|
69028
|
+
if (!rec)
|
|
69029
|
+
throw new Error('User not found');
|
|
69030
|
+
if (rec.verified)
|
|
69031
|
+
return true; // No limit for verified
|
|
69032
|
+
if (typeof rec.usageCount !== 'number')
|
|
69033
|
+
rec.usageCount = 0;
|
|
69034
|
+
if (typeof rec.usageLimit !== 'number')
|
|
69035
|
+
rec.usageLimit = 3;
|
|
69036
|
+
if (rec.usageCount >= rec.usageLimit)
|
|
69037
|
+
return false;
|
|
69038
|
+
rec.usageCount += 1;
|
|
69039
|
+
await this.save();
|
|
69040
|
+
return true;
|
|
69041
|
+
}
|
|
69042
|
+
// Reset usage when user is verified
|
|
69043
|
+
async verifyUser(email, password) {
|
|
69044
|
+
const record = this.records.find(r => r.email === email.toLowerCase());
|
|
69045
|
+
if (!record)
|
|
69046
|
+
return false;
|
|
69047
|
+
// Simple rate limiting/backoff
|
|
69048
|
+
const key = email.toLowerCase();
|
|
69049
|
+
const now = Date.now();
|
|
69050
|
+
const entry = this.failedAttempts[key];
|
|
69051
|
+
if (entry && entry.count >= 5 && now - entry.lastAttempt < 60_000) {
|
|
69052
|
+
// Lockout for 60s after 5 failed attempts
|
|
69053
|
+
throw new Error('Too many failed attempts. Try again later.');
|
|
69054
|
+
}
|
|
69055
|
+
const salt = Buffer.from(record.salt, 'hex');
|
|
69056
|
+
const hash = this.hashPassword(password, salt);
|
|
69057
|
+
const stored = Buffer.from(record.hash, 'hex');
|
|
69058
|
+
// Use timingSafeEqual to avoid timing attacks
|
|
69059
|
+
if (stored.length !== hash.length)
|
|
69060
|
+
return false;
|
|
69061
|
+
const ok = external_crypto_.timingSafeEqual(stored, hash);
|
|
69062
|
+
if (!ok) {
|
|
69063
|
+
// record failed attempt
|
|
69064
|
+
if (!this.failedAttempts[key])
|
|
69065
|
+
this.failedAttempts[key] = { count: 0, lastAttempt: now };
|
|
69066
|
+
this.failedAttempts[key].count += 1;
|
|
69067
|
+
this.failedAttempts[key].lastAttempt = now;
|
|
69068
|
+
}
|
|
69069
|
+
else {
|
|
69070
|
+
// reset on success
|
|
69071
|
+
delete this.failedAttempts[key];
|
|
69072
|
+
}
|
|
69073
|
+
return ok;
|
|
69074
|
+
}
|
|
69075
|
+
async login(email, password) {
|
|
69076
|
+
const ok = await this.verifyUser(email, password);
|
|
69077
|
+
if (!ok)
|
|
69078
|
+
return false;
|
|
69079
|
+
await fs_extra_lib.writeJson(this.sessionFile, { email: email.toLowerCase(), loggedAt: new Date().toISOString() }, { spaces: 2 });
|
|
69080
|
+
return true;
|
|
69081
|
+
}
|
|
69082
|
+
async logout() {
|
|
69083
|
+
if (await fs_extra_lib.pathExists(this.sessionFile)) {
|
|
69084
|
+
await fs_extra_lib.remove(this.sessionFile);
|
|
69085
|
+
}
|
|
69086
|
+
}
|
|
69087
|
+
async getSession() {
|
|
69088
|
+
if (!(await fs_extra_lib.pathExists(this.sessionFile)))
|
|
69089
|
+
return null;
|
|
69090
|
+
try {
|
|
69091
|
+
const data = await fs_extra_lib.readJson(this.sessionFile);
|
|
69092
|
+
return { email: (data.email || '').toLowerCase() };
|
|
69093
|
+
}
|
|
69094
|
+
catch {
|
|
69095
|
+
return null;
|
|
69096
|
+
}
|
|
69097
|
+
}
|
|
69098
|
+
async isLoggedIn() {
|
|
69099
|
+
const s = await this.getSession();
|
|
69100
|
+
return !!s?.email;
|
|
69101
|
+
}
|
|
69102
|
+
async getUsers() {
|
|
69103
|
+
return this.records.slice();
|
|
69104
|
+
}
|
|
69105
|
+
async setTotpSecret(email, secret) {
|
|
69106
|
+
const rec = this.records.find(r => r.email === email.toLowerCase());
|
|
69107
|
+
if (!rec)
|
|
69108
|
+
throw new Error('User not found');
|
|
69109
|
+
rec.totpSecret = secret;
|
|
69110
|
+
await this.save();
|
|
69111
|
+
}
|
|
69112
|
+
async setVerified(email, verified) {
|
|
69113
|
+
const rec = this.records.find(r => r.email === email.toLowerCase());
|
|
69114
|
+
if (!rec)
|
|
69115
|
+
throw new Error('User not found');
|
|
69116
|
+
rec.verified = verified;
|
|
69117
|
+
if (verified) {
|
|
69118
|
+
rec.usageCount = undefined;
|
|
69119
|
+
rec.usageLimit = undefined;
|
|
69120
|
+
}
|
|
69121
|
+
await this.save();
|
|
69122
|
+
}
|
|
69123
|
+
async getTotpSecret(email) {
|
|
69124
|
+
const rec = this.records.find(r => r.email === email.toLowerCase());
|
|
69125
|
+
return rec?.totpSecret;
|
|
69126
|
+
}
|
|
69127
|
+
async isVerified(email) {
|
|
69128
|
+
const rec = this.records.find(r => r.email === email.toLowerCase());
|
|
69129
|
+
return !!rec?.verified;
|
|
69130
|
+
}
|
|
69131
|
+
}
|
|
69132
|
+
const authStore_authStore = new AuthStore();
|
|
69133
|
+
async function initAuthStore() {
|
|
69134
|
+
await authStore_authStore.init();
|
|
69135
|
+
}
|
|
69136
|
+
|
|
69137
|
+
// EXTERNAL MODULE: ./node_modules/.pnpm/otplib@12.0.1/node_modules/otplib/index.js
|
|
69138
|
+
var otplib = __webpack_require__(4283);
|
|
69139
|
+
// EXTERNAL MODULE: ./node_modules/.pnpm/qrcode-terminal@0.12.0/node_modules/qrcode-terminal/lib/main.js
|
|
69140
|
+
var main = __webpack_require__(6273);
|
|
69141
|
+
;// ./dist/commands/auth.js
|
|
69142
|
+
|
|
69143
|
+
|
|
69144
|
+
|
|
69145
|
+
|
|
69146
|
+
|
|
69147
|
+
|
|
69148
|
+
async function setupTotp(email) {
|
|
69149
|
+
// Generate TOTP secret
|
|
69150
|
+
const secret = otplib.authenticator.generateSecret();
|
|
69151
|
+
const otpauth = otplib.authenticator.keyuri(email, 'PackageInstallerCLI', secret);
|
|
69152
|
+
// Show QR code in terminal
|
|
69153
|
+
console.log(source/* default */.Ay.cyan('\nScan this QR code with Google Authenticator or a compatible app:'));
|
|
69154
|
+
main.generate(otpauth, { small: true });
|
|
69155
|
+
console.log(source/* default */.Ay.gray(`If you can't scan, use this secret: ${source/* default */.Ay.yellow(secret)}`));
|
|
69156
|
+
return secret;
|
|
69157
|
+
}
|
|
69158
|
+
async function verifyTotpPrompt(secret) {
|
|
69159
|
+
for (let i = 0; i < 3; ++i) {
|
|
69160
|
+
const { code } = await lib["default"].prompt([
|
|
69161
|
+
{ name: 'code', message: 'Enter 6-digit code from your Authenticator app:', type: 'input', validate: (v) => /^\d{6}$/.test(v) || 'Enter a 6-digit code' }
|
|
69162
|
+
]);
|
|
69163
|
+
if (otplib.authenticator.check(code, secret))
|
|
69164
|
+
return true;
|
|
69165
|
+
console.log(source/* default */.Ay.red('❌ Invalid code. Try again.'));
|
|
69166
|
+
}
|
|
69167
|
+
return false;
|
|
69168
|
+
}
|
|
69169
|
+
// Add a function for 2FA setup and verification (used in both register and verify)
|
|
69170
|
+
async function setupAndVerifyTotp(email) {
|
|
69171
|
+
const secret = await setupTotp(email);
|
|
69172
|
+
await authStore_authStore.setTotpSecret(email, secret);
|
|
69173
|
+
const verified = await verifyTotpPrompt(secret);
|
|
69174
|
+
if (!verified) {
|
|
69175
|
+
console.log(source/* default */.Ay.red('❌ Verification failed. 2FA not enabled.'));
|
|
69176
|
+
return false;
|
|
69177
|
+
}
|
|
69178
|
+
await authStore_authStore.setVerified(email, true);
|
|
69179
|
+
console.log(source/* default */.Ay.green('✅ 2FA enabled and verified!'));
|
|
69180
|
+
return true;
|
|
69181
|
+
}
|
|
69182
|
+
// Patch interactiveRegister to make 2FA optional
|
|
69183
|
+
async function interactiveRegister() {
|
|
69184
|
+
const { email, password, confirm } = await lib["default"].prompt([
|
|
69185
|
+
{ name: 'email', message: 'Email:', type: 'input', validate: (v) => /^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(v) || 'Enter a valid email' },
|
|
69186
|
+
{ name: 'password', message: 'Password (min 8 chars):', type: 'password', mask: '*', validate: (v) => v.length >= 8 || 'Password must be at least 8 characters' },
|
|
69187
|
+
{ name: 'confirm', message: 'Confirm Password:', type: 'password', mask: '*' },
|
|
69188
|
+
]);
|
|
69189
|
+
if (password !== confirm) {
|
|
69190
|
+
console.log(source/* default */.Ay.red('Passwords do not match'));
|
|
69191
|
+
return;
|
|
69192
|
+
}
|
|
69193
|
+
let created = false;
|
|
69194
|
+
try {
|
|
69195
|
+
await authStore_authStore.createUser(email, password);
|
|
69196
|
+
created = true;
|
|
69197
|
+
}
|
|
69198
|
+
catch (err) {
|
|
69199
|
+
if (err.message && err.message.includes('already exists')) {
|
|
69200
|
+
console.log(source/* default */.Ay.red('❌ User already exists. Please login or use a different email.'));
|
|
69201
|
+
return;
|
|
69202
|
+
}
|
|
69203
|
+
console.log(source/* default */.Ay.red('❌'), err.message || String(err));
|
|
69204
|
+
return;
|
|
69205
|
+
}
|
|
69206
|
+
// Suggest 2FA setup
|
|
69207
|
+
const { enable2fa } = await lib["default"].prompt([
|
|
69208
|
+
{ name: 'enable2fa', type: 'confirm', message: 'Would you like to enable 2FA (recommended)?', default: true }
|
|
69209
|
+
]);
|
|
69210
|
+
if (enable2fa) {
|
|
69211
|
+
await setupAndVerifyTotp(email);
|
|
69212
|
+
}
|
|
69213
|
+
else {
|
|
69214
|
+
console.log(source/* default */.Ay.yellow('⚠️ 2FA is not enabled. You can enable it anytime with: pi auth verify'));
|
|
69215
|
+
}
|
|
69216
|
+
// Always auto-login after registration if user was created
|
|
69217
|
+
if (created) {
|
|
69218
|
+
const ok = await authStore_authStore.login(email, password);
|
|
69219
|
+
if (ok) {
|
|
69220
|
+
console.log(source/* default */.Ay.green('✅ User registered and logged in.'));
|
|
69221
|
+
}
|
|
69222
|
+
else {
|
|
69223
|
+
console.log(source/* default */.Ay.yellow('User registered, but auto-login failed. Please login manually.'));
|
|
69224
|
+
}
|
|
69225
|
+
}
|
|
69226
|
+
}
|
|
69227
|
+
async function interactiveLogin() {
|
|
69228
|
+
const responses = await inquirer.prompt([
|
|
69229
|
+
{ name: 'email', message: 'Email:', type: 'input', validate: (v) => /^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(v) || 'Enter a valid email' },
|
|
69230
|
+
{ name: 'password', message: 'Password:', type: 'password', mask: '*', validate: (v) => v.length >= 8 || 'Password must be at least 8 characters' },
|
|
69231
|
+
]);
|
|
69232
|
+
const { email, password } = responses;
|
|
69233
|
+
try {
|
|
69234
|
+
const ok = await authStore.login(email, password);
|
|
69235
|
+
if (!ok) {
|
|
69236
|
+
console.log(chalk.red('❌ Invalid email or password'));
|
|
69237
|
+
return;
|
|
69238
|
+
}
|
|
69239
|
+
// Check verification
|
|
69240
|
+
const secret = await authStore.getTotpSecret(email);
|
|
69241
|
+
const isVerified = await authStore.isVerified(email);
|
|
69242
|
+
if (!secret) {
|
|
69243
|
+
console.log(chalk.red('❌ This account does not have 2FA set up. Please register again.'));
|
|
69244
|
+
await authStore.logout();
|
|
69245
|
+
return;
|
|
69246
|
+
}
|
|
69247
|
+
if (!isVerified) {
|
|
69248
|
+
console.log(chalk.red('❌ This account is not verified. Please complete TOTP verification during registration.'));
|
|
69249
|
+
await authStore.logout();
|
|
69250
|
+
return;
|
|
69251
|
+
}
|
|
69252
|
+
// Prompt for TOTP code
|
|
69253
|
+
const { code } = await inquirer.prompt([
|
|
69254
|
+
{ name: 'code', message: 'Enter 6-digit code from your Authenticator app:', type: 'input', validate: (v) => /^\d{6}$/.test(v) || 'Enter a 6-digit code' }
|
|
69255
|
+
]);
|
|
69256
|
+
if (!authenticator.check(code, secret)) {
|
|
69257
|
+
console.log(chalk.red('❌ Invalid code. Login aborted.'));
|
|
69258
|
+
await authStore.logout();
|
|
69259
|
+
return;
|
|
69260
|
+
}
|
|
69261
|
+
console.log(chalk.green('✅ Logged in successfully'));
|
|
69262
|
+
}
|
|
69263
|
+
catch (err) {
|
|
69264
|
+
if (err.message && err.message.includes('already exists')) {
|
|
69265
|
+
console.log(chalk.red('❌ User already exists. Please login or use a different email.'));
|
|
69266
|
+
return;
|
|
69267
|
+
}
|
|
69268
|
+
console.log(chalk.red('❌'), err.message || String(err));
|
|
69269
|
+
}
|
|
69270
|
+
}
|
|
69271
|
+
async function handleAuthOptions(subcommand, value, opts = {}) {
|
|
69272
|
+
await initAuthStore();
|
|
69273
|
+
// Help flag or no subcommand: show help
|
|
69274
|
+
if (opts.help || opts['--help'] || opts['-h'] || subcommand === '--help' || subcommand === '-h' || !subcommand) {
|
|
69275
|
+
showAuthHelp();
|
|
69276
|
+
return;
|
|
69277
|
+
}
|
|
69278
|
+
try {
|
|
69279
|
+
// Normalize subcommand for robust matching
|
|
69280
|
+
const cmd = (subcommand || '').toLowerCase();
|
|
69281
|
+
switch (cmd) {
|
|
69282
|
+
case 'login': {
|
|
69283
|
+
if (opts.email && opts.password) {
|
|
69284
|
+
try {
|
|
69285
|
+
const ok = await authStore_authStore.login(opts.email, opts.password);
|
|
69286
|
+
if (!ok) {
|
|
69287
|
+
console.log(source/* default */.Ay.red('❌ Invalid email or password'));
|
|
69288
|
+
return;
|
|
69289
|
+
}
|
|
69290
|
+
// Check verification
|
|
69291
|
+
const secret = await authStore_authStore.getTotpSecret(opts.email);
|
|
69292
|
+
const isVerified = await authStore_authStore.isVerified(opts.email);
|
|
69293
|
+
if (!secret) {
|
|
69294
|
+
console.log(source/* default */.Ay.red('❌ This account does not have 2FA set up. Please register again.'));
|
|
69295
|
+
await authStore_authStore.logout();
|
|
69296
|
+
return;
|
|
69297
|
+
}
|
|
69298
|
+
if (!isVerified) {
|
|
69299
|
+
console.log(source/* default */.Ay.red('❌ This account is not verified. Please complete TOTP verification during registration.'));
|
|
69300
|
+
await authStore_authStore.logout();
|
|
69301
|
+
return;
|
|
69302
|
+
}
|
|
69303
|
+
// Prompt for TOTP code
|
|
69304
|
+
const { code } = await lib["default"].prompt([
|
|
69305
|
+
{ name: 'code', message: 'Enter 6-digit code from your Authenticator app:', type: 'input', validate: (v) => /^\d{6}$/.test(v) || 'Enter a 6-digit code' }
|
|
69306
|
+
]);
|
|
69307
|
+
if (!otplib.authenticator.check(code, secret)) {
|
|
69308
|
+
console.log(source/* default */.Ay.red('❌ Invalid code. Login aborted.'));
|
|
69309
|
+
await authStore_authStore.logout();
|
|
69310
|
+
return;
|
|
69311
|
+
}
|
|
69312
|
+
console.log(source/* default */.Ay.green('✅ Logged in successfully'));
|
|
69313
|
+
}
|
|
69314
|
+
catch (err) {
|
|
69315
|
+
if (err.message && err.message.includes('already exists')) {
|
|
69316
|
+
console.log(source/* default */.Ay.red('❌ User already exists. Please login or use a different email.'));
|
|
69317
|
+
return;
|
|
69318
|
+
}
|
|
69319
|
+
console.log(source/* default */.Ay.red('❌'), err.message || String(err));
|
|
69320
|
+
}
|
|
69321
|
+
}
|
|
69322
|
+
else {
|
|
69323
|
+
// Interactive login
|
|
69324
|
+
const responses = await lib["default"].prompt([
|
|
69325
|
+
{ name: 'email', message: 'Email:', type: 'input', validate: (v) => /^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(v) || 'Enter a valid email' },
|
|
69326
|
+
{ name: 'password', message: 'Password:', type: 'password', mask: '*', validate: (v) => v.length >= 8 || 'Password must be at least 8 characters' },
|
|
69327
|
+
]);
|
|
69328
|
+
const { email, password } = responses;
|
|
69329
|
+
const ok = await authStore_authStore.login(email, password);
|
|
69330
|
+
if (!ok) {
|
|
69331
|
+
console.log(source/* default */.Ay.red('❌ Invalid email or password'));
|
|
69332
|
+
return;
|
|
69333
|
+
}
|
|
69334
|
+
const secret = await authStore_authStore.getTotpSecret(email);
|
|
69335
|
+
const isVerified = await authStore_authStore.isVerified(email);
|
|
69336
|
+
if (!secret) {
|
|
69337
|
+
console.log(source/* default */.Ay.red('❌ This account does not have 2FA set up. Please register again.'));
|
|
69338
|
+
await authStore_authStore.logout();
|
|
69339
|
+
return;
|
|
69340
|
+
}
|
|
69341
|
+
if (!isVerified) {
|
|
69342
|
+
console.log(source/* default */.Ay.red('❌ This account is not verified. Please complete TOTP verification during registration.'));
|
|
69343
|
+
await authStore_authStore.logout();
|
|
69344
|
+
return;
|
|
69345
|
+
}
|
|
69346
|
+
const { code } = await lib["default"].prompt([
|
|
69347
|
+
{ name: 'code', message: 'Enter 6-digit code from your Authenticator app:', type: 'input', validate: (v) => /^\d{6}$/.test(v) || 'Enter a 6-digit code' }
|
|
69348
|
+
]);
|
|
69349
|
+
if (!otplib.authenticator.check(code, secret)) {
|
|
69350
|
+
console.log(source/* default */.Ay.red('❌ Invalid code. Login aborted.'));
|
|
69351
|
+
await authStore_authStore.logout();
|
|
69352
|
+
return;
|
|
69353
|
+
}
|
|
69354
|
+
console.log(source/* default */.Ay.green('✅ Logged in successfully'));
|
|
69355
|
+
}
|
|
69356
|
+
return;
|
|
69357
|
+
}
|
|
69358
|
+
case 'register': {
|
|
69359
|
+
if (opts.email && opts.password) {
|
|
69360
|
+
try {
|
|
69361
|
+
await authStore_authStore.createUser(opts.email, opts.password);
|
|
69362
|
+
// TOTP setup
|
|
69363
|
+
const secret = await setupTotp(opts.email);
|
|
69364
|
+
await authStore_authStore.setTotpSecret(opts.email, secret);
|
|
69365
|
+
const verified = await verifyTotpPrompt(secret);
|
|
69366
|
+
if (!verified) {
|
|
69367
|
+
console.log(source/* default */.Ay.red('❌ Verification failed. Registration incomplete.'));
|
|
69368
|
+
return;
|
|
69369
|
+
}
|
|
69370
|
+
await authStore_authStore.setVerified(opts.email, true);
|
|
69371
|
+
// Auto-login after registration
|
|
69372
|
+
const ok = await authStore_authStore.login(opts.email, opts.password);
|
|
69373
|
+
if (ok) {
|
|
69374
|
+
console.log(source/* default */.Ay.green('✅ User registered, verified, and logged in.'));
|
|
69375
|
+
}
|
|
69376
|
+
else {
|
|
69377
|
+
console.log(source/* default */.Ay.yellow('User registered and verified, but auto-login failed. Please login manually.'));
|
|
69378
|
+
}
|
|
69379
|
+
}
|
|
69380
|
+
catch (err) {
|
|
69381
|
+
console.log(source/* default */.Ay.red('❌'), err.message || String(err));
|
|
69382
|
+
}
|
|
69383
|
+
}
|
|
69384
|
+
else {
|
|
69385
|
+
await interactiveRegister();
|
|
69386
|
+
}
|
|
69387
|
+
return;
|
|
69388
|
+
}
|
|
69389
|
+
case 'verify': {
|
|
69390
|
+
// Get current session or prompt for email
|
|
69391
|
+
let email = opts.email;
|
|
69392
|
+
if (!email) {
|
|
69393
|
+
const session = await authStore_authStore.getSession();
|
|
69394
|
+
if (session && session.email) {
|
|
69395
|
+
email = session.email;
|
|
69396
|
+
}
|
|
69397
|
+
else {
|
|
69398
|
+
const resp = await lib["default"].prompt([
|
|
69399
|
+
{ name: 'email', message: 'Email to verify:', type: 'input', validate: (v) => /^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(v) || 'Enter a valid email' }
|
|
69400
|
+
]);
|
|
69401
|
+
email = resp.email;
|
|
69402
|
+
}
|
|
69403
|
+
}
|
|
69404
|
+
// Check if user exists
|
|
69405
|
+
const users = await authStore_authStore.getUsers();
|
|
69406
|
+
const user = users.find(u => u.email === email.toLowerCase());
|
|
69407
|
+
if (!user) {
|
|
69408
|
+
console.log(source/* default */.Ay.red('❌ User not found. Please register first.'));
|
|
69409
|
+
return;
|
|
69410
|
+
}
|
|
69411
|
+
// If already verified, skip
|
|
69412
|
+
if (user.verified) {
|
|
69413
|
+
console.log(source/* default */.Ay.green('✅ 2FA is already enabled for this user.'));
|
|
69414
|
+
return;
|
|
69415
|
+
}
|
|
69416
|
+
await setupAndVerifyTotp(email);
|
|
69417
|
+
return;
|
|
69418
|
+
}
|
|
69419
|
+
case 'logout': {
|
|
69420
|
+
await authStore_authStore.logout();
|
|
69421
|
+
console.log(source/* default */.Ay.green('✅ Logged out'));
|
|
69422
|
+
return;
|
|
69423
|
+
}
|
|
69424
|
+
case 'status': {
|
|
69425
|
+
const s = await authStore_authStore.getSession();
|
|
69426
|
+
if (s)
|
|
69427
|
+
console.log(source/* default */.Ay.green(`Logged in as ${s.email}`));
|
|
69428
|
+
else
|
|
69429
|
+
console.log(source/* default */.Ay.yellow('Not logged in'));
|
|
69430
|
+
return;
|
|
69431
|
+
}
|
|
69432
|
+
case 'whoami': {
|
|
69433
|
+
const s = await authStore_authStore.getSession();
|
|
69434
|
+
if (s)
|
|
69435
|
+
console.log(source/* default */.Ay.green(`${s.email}`));
|
|
69436
|
+
else
|
|
69437
|
+
console.log(source/* default */.Ay.yellow('Not logged in'));
|
|
69438
|
+
return;
|
|
69439
|
+
}
|
|
69440
|
+
case 'list-users': {
|
|
69441
|
+
const users = await authStore_authStore.getUsers();
|
|
69442
|
+
if (!users || users.length === 0) {
|
|
69443
|
+
console.log(source/* default */.Ay.yellow('No users registered'));
|
|
69444
|
+
return;
|
|
69445
|
+
}
|
|
69446
|
+
console.log(source/* default */.Ay.green('Registered users:'));
|
|
69447
|
+
users.forEach(u => console.log(' - ' + u.email));
|
|
69448
|
+
return;
|
|
69449
|
+
}
|
|
69450
|
+
default: {
|
|
69451
|
+
showAuthHelp();
|
|
69452
|
+
return;
|
|
69453
|
+
}
|
|
69454
|
+
}
|
|
69455
|
+
}
|
|
69456
|
+
catch (err) {
|
|
69457
|
+
console.log(source/* default */.Ay.red('❌'), err.message || String(err));
|
|
69458
|
+
}
|
|
69459
|
+
}
|
|
69460
|
+
function showAuthHelp() {
|
|
69461
|
+
const cfg = {
|
|
69462
|
+
commandName: 'auth',
|
|
69463
|
+
emoji: '🔐',
|
|
69464
|
+
description: 'Manage authentication for the CLI (register, login, logout, status, 2FA verification).',
|
|
69465
|
+
usage: [
|
|
69466
|
+
'auth register',
|
|
69467
|
+
'auth login',
|
|
69468
|
+
'auth login --email <email> --password <password>',
|
|
69469
|
+
'auth logout',
|
|
69470
|
+
'auth status',
|
|
69471
|
+
'auth verify',
|
|
69472
|
+
'auth whoami',
|
|
69473
|
+
'auth list-users',
|
|
69474
|
+
],
|
|
69475
|
+
options: [
|
|
69476
|
+
{ flag: '--email <email>', description: 'Email for non-interactive actions' },
|
|
69477
|
+
{ flag: '--password <password>', description: 'Password for non-interactive actions' },
|
|
69478
|
+
{ flag: '-h, --help', description: 'Show help for the auth command' },
|
|
69479
|
+
],
|
|
69480
|
+
examples: [
|
|
69481
|
+
{ command: 'auth register', description: 'Interactive registration' },
|
|
69482
|
+
{ command: 'auth login', description: 'Interactive login' },
|
|
69483
|
+
{ command: 'auth login --email me@you.com --password hunter2', description: 'Non-interactive login (use with care)' },
|
|
69484
|
+
{ command: 'auth verify', description: 'Enable and verify 2FA for your account' },
|
|
69485
|
+
{ command: 'auth logout', description: 'Logout from the CLI' },
|
|
69486
|
+
{ command: 'auth status', description: 'Show current login status' },
|
|
69487
|
+
{ command: 'auth whoami', description: 'Show current user email' },
|
|
69488
|
+
{ command: 'auth list-users', description: 'List all registered users' },
|
|
69489
|
+
],
|
|
69490
|
+
tips: [
|
|
69491
|
+
'🔒 2FA (Google Authenticator) is required for unlimited CLI access.',
|
|
69492
|
+
'Unverified users can only use 3 commands before verification is required.',
|
|
69493
|
+
'Passwords are stored as scrypt hashes with per-user salt. Keep your machine secure.',
|
|
69494
|
+
'Use "pi auth verify" to enable 2FA and unlock all features.',
|
|
69495
|
+
],
|
|
69496
|
+
};
|
|
69497
|
+
(0,helpFormatter/* createStandardHelp */.ht)(cfg);
|
|
69498
|
+
}
|
|
69499
|
+
|
|
66761
69500
|
;// ./dist/index.js
|
|
66762
69501
|
//#!/usr/bin/env node
|
|
66763
69502
|
|
|
@@ -66785,10 +69524,12 @@ globalThis.path = external_path_;
|
|
|
66785
69524
|
|
|
66786
69525
|
|
|
66787
69526
|
|
|
69527
|
+
|
|
66788
69528
|
// Import utilities
|
|
66789
69529
|
|
|
66790
69530
|
|
|
66791
69531
|
|
|
69532
|
+
|
|
66792
69533
|
// Get current file directory for ESM
|
|
66793
69534
|
const dist_filename = (0,external_url_.fileURLToPath)("file:///home/sharique/desktop/shariq-projects/package-installer-cli/dist/index.js");
|
|
66794
69535
|
const dist_dirname = (0,external_path_.dirname)(dist_filename);
|
|
@@ -66809,6 +69550,15 @@ const packageJson = JSON.parse((0,external_fs_.readFileSync)(packageJsonPath, 'u
|
|
|
66809
69550
|
const VERSION = packageJson.version;
|
|
66810
69551
|
// Initialize CLI program
|
|
66811
69552
|
const dist_program = new Command();
|
|
69553
|
+
// Initialize auth store early
|
|
69554
|
+
(async () => {
|
|
69555
|
+
try {
|
|
69556
|
+
await initAuthStore();
|
|
69557
|
+
}
|
|
69558
|
+
catch (err) {
|
|
69559
|
+
// non-fatal
|
|
69560
|
+
}
|
|
69561
|
+
})();
|
|
66812
69562
|
// Create beautiful blue gradient for CLI name
|
|
66813
69563
|
const gradientTitle = (0,dist/* default */.Ay)(['#0072ff', '#00c6ff', '#0072ff']);
|
|
66814
69564
|
const piGradient = (0,dist/* default */.Ay)(['#00c6ff', '#0072ff']);
|
|
@@ -66821,6 +69571,46 @@ dist_program
|
|
|
66821
69571
|
sortSubcommands: true,
|
|
66822
69572
|
subcommandTerm: (cmd) => cmd.name(),
|
|
66823
69573
|
});
|
|
69574
|
+
// Global preAction: enforce login for most commands, whitelist a few
|
|
69575
|
+
dist_program.hook('preAction', async (thisCommand, actionCommand) => {
|
|
69576
|
+
const name = actionCommand.name();
|
|
69577
|
+
// Commands allowed without login (help, version, auth, cache --help etc.)
|
|
69578
|
+
const allowed = ['auth', 'help', 'version', 'cache'];
|
|
69579
|
+
if (allowed.includes(name))
|
|
69580
|
+
return;
|
|
69581
|
+
// Also allow if user requested help/version via flags anywhere on the command line
|
|
69582
|
+
const argv = process.argv.slice(2).map(a => a.toLowerCase());
|
|
69583
|
+
const helpFlags = ['-h', '--help'];
|
|
69584
|
+
const versionFlags = ['-v', '-V', '--version'];
|
|
69585
|
+
if (argv.some(a => helpFlags.includes(a) || versionFlags.includes(a)))
|
|
69586
|
+
return;
|
|
69587
|
+
const logged = await authStore_authStore.isLoggedIn();
|
|
69588
|
+
if (!logged) {
|
|
69589
|
+
console.log('\n' + source/* default */.Ay.red('❌ You must be logged in to use this command.'));
|
|
69590
|
+
console.log(source/* default */.Ay.gray(`Run: pi auth --help to see authentication options`));
|
|
69591
|
+
process.exit(1);
|
|
69592
|
+
}
|
|
69593
|
+
// 2FA enforcement and usage limit for unverified users
|
|
69594
|
+
const session = await authStore_authStore.getSession();
|
|
69595
|
+
if (session && session.email) {
|
|
69596
|
+
const isVerified = await authStore_authStore.isVerified(session.email);
|
|
69597
|
+
// Allow verify, logout, help for unverified users
|
|
69598
|
+
const authSub = argv[1] || '';
|
|
69599
|
+
if (!isVerified) {
|
|
69600
|
+
if (name === 'auth' && ['verify', 'logout', '', undefined].includes(authSub))
|
|
69601
|
+
return;
|
|
69602
|
+
// Usage limit enforcement for unverified users
|
|
69603
|
+
const allowed = await authStore_authStore.incrementUsage(session.email).catch(() => false);
|
|
69604
|
+
if (!allowed) {
|
|
69605
|
+
console.log('\n' + source/* default */.Ay.red('❌ You have reached the maximum number of allowed commands as an unverified user.'));
|
|
69606
|
+
console.log(source/* default */.Ay.yellow('Please verify your account with: pi auth verify'));
|
|
69607
|
+
process.exit(1);
|
|
69608
|
+
}
|
|
69609
|
+
// Show warning for unverified users
|
|
69610
|
+
console.log(source/* default */.Ay.yellow('⚠️ Your account is not verified. You have limited access until you complete 2FA.'));
|
|
69611
|
+
}
|
|
69612
|
+
}
|
|
69613
|
+
});
|
|
66824
69614
|
/**
|
|
66825
69615
|
* Enhanced error handler with better formatting
|
|
66826
69616
|
*/
|
|
@@ -66939,6 +69729,25 @@ dist_program
|
|
|
66939
69729
|
handleCommandError('add feature', error);
|
|
66940
69730
|
}
|
|
66941
69731
|
});
|
|
69732
|
+
// AUTH COMMAND - authentication and user management (subcommand pattern like cache)
|
|
69733
|
+
dist_program
|
|
69734
|
+
.command('auth')
|
|
69735
|
+
.description(source/* default */.Ay.hex('#00d2d3')('🔐 ') + source/* default */.Ay.hex('#95afc0')('Authentication and user management'))
|
|
69736
|
+
.argument('[subcommand]', 'Auth subcommand (login, register, logout, status, whoami, list-users)')
|
|
69737
|
+
.argument('[value]', 'Optional value for subcommand (not used)')
|
|
69738
|
+
.option('--email <email>', 'Email for login/register')
|
|
69739
|
+
.option('--password <password>', 'Password for login/register')
|
|
69740
|
+
.option('-h, --help', 'Show help for auth command')
|
|
69741
|
+
.allowUnknownOption(true)
|
|
69742
|
+
.on('--help', () => { showAuthHelp(); })
|
|
69743
|
+
.action(async (subcommand, value, options) => {
|
|
69744
|
+
try {
|
|
69745
|
+
await handleAuthOptions(subcommand, value, options);
|
|
69746
|
+
}
|
|
69747
|
+
catch (error) {
|
|
69748
|
+
handleCommandError('auth', error);
|
|
69749
|
+
}
|
|
69750
|
+
});
|
|
66942
69751
|
// UPGRADE-CLI COMMAND - Update CLI to latest version
|
|
66943
69752
|
dist_program
|
|
66944
69753
|
.command('upgrade-cli')
|
|
@@ -67165,6 +69974,7 @@ dist_program.on('--help', () => {
|
|
|
67165
69974
|
source/* default */.Ay.hex('#95afc0')(' ') + piGradient('pi') + ' ' + commandGradient('check') + source/* default */.Ay.hex('#95afc0')(' # Check package versions') + '\n' +
|
|
67166
69975
|
source/* default */.Ay.hex('#95afc0')(' ') + piGradient('pi') + ' ' + commandGradient('check') + source/* default */.Ay.hex('#95afc0')(' react # Check specific package') + '\n' +
|
|
67167
69976
|
source/* default */.Ay.hex('#95afc0')(' ') + piGradient('pi') + ' ' + commandGradient('email') + source/* default */.Ay.hex('#95afc0')(' # Contact developer with feedback') + '\n' +
|
|
69977
|
+
source/* default */.Ay.hex('#95afc0')(' ') + piGradient('pi') + ' ' + commandGradient('auth') + source/* default */.Ay.hex('#95afc0')(' # Manage CLI authentication (login/register/status)') + '\n' +
|
|
67168
69978
|
source/* default */.Ay.hex('#ff6b6b')('🌍 REPOSITORY & DEPLOYMENT') + '\n' +
|
|
67169
69979
|
source/* default */.Ay.hex('#95afc0')(' ') + piGradient('pi') + ' ' + commandGradient('clone') + source/* default */.Ay.hex('#95afc0')(' # Clone repositories interactively') + '\n' +
|
|
67170
69980
|
source/* default */.Ay.hex('#95afc0')(' ') + piGradient('pi') + ' ' + commandGradient('clone') + source/* default */.Ay.hex('#95afc0')(' facebook/react # Clone popular repositories') + '\n' +
|
|
@@ -67205,6 +70015,7 @@ if (process.argv.length === 2) {
|
|
|
67205
70015
|
source/* default */.Ay.hex('#ffa502')('Need help? Try these:') + '\n\n' +
|
|
67206
70016
|
source/* default */.Ay.hex('#ff6b6b')(' ') + piGradient('pi') + ' ' + source/* default */.Ay.hex('#ff6b6b')('--help') + source/* default */.Ay.hex('#95afc0')(' # See all available commands') + '\n' +
|
|
67207
70017
|
source/* default */.Ay.hex('#95afc0')(' ') + piGradient('pi') + ' ' + source/* default */.Ay.hex('#95afc0')('command --help') + source/* default */.Ay.hex('#95afc0')(' # Get detailed help for any command') + '\n\n' +
|
|
70018
|
+
source/* default */.Ay.hex('#95afc0')(' ') + piGradient('pi') + ' ' + source/* default */.Ay.hex('#95afc0')('auth --help') + source/* default */.Ay.hex('#95afc0')(' # Detailed help for authentication commands') + '\n\n' +
|
|
67208
70019
|
source/* default */.Ay.hex('#00d2d3')('💡 Pro tip: All commands are interactive - just run them and follow prompts!'), {
|
|
67209
70020
|
padding: 1,
|
|
67210
70021
|
borderStyle: 'round',
|
|
@@ -67222,5 +70033,15 @@ if (process.argv.length === 2) {
|
|
|
67222
70033
|
}
|
|
67223
70034
|
})();
|
|
67224
70035
|
// Parse command line arguments
|
|
70036
|
+
// If user asked for auth help explicitly (pi auth --help), show our formatted auth help and exit
|
|
70037
|
+
const preArgs = process.argv.slice(2).map(a => String(a).toLowerCase());
|
|
70038
|
+
if (preArgs[0] === 'auth' && (preArgs.includes('--help') || preArgs.includes('-h'))) {
|
|
70039
|
+
try {
|
|
70040
|
+
showAuthHelp();
|
|
70041
|
+
}
|
|
70042
|
+
catch { }
|
|
70043
|
+
;
|
|
70044
|
+
process.exit(0);
|
|
70045
|
+
}
|
|
67225
70046
|
dist_program.parse();
|
|
67226
70047
|
|