summaryrefslogtreecommitdiff
path: root/includes/external/matrix/node_modules/matrix-js-sdk/lib/crypto/crypto.js
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-04-24 14:03:36 +0200
committerRaindropsSys <contact@minteck.org>2023-04-24 14:03:36 +0200
commit633c92eae865e957121e08de634aeee11a8b3992 (patch)
tree09d881bee1dae0b6eee49db1dfaf0f500240606c /includes/external/matrix/node_modules/matrix-js-sdk/lib/crypto/crypto.js
parentc4657e4509733699c0f26a3c900bab47e915d5a0 (diff)
downloadpluralconnect-633c92eae865e957121e08de634aeee11a8b3992.tar.gz
pluralconnect-633c92eae865e957121e08de634aeee11a8b3992.tar.bz2
pluralconnect-633c92eae865e957121e08de634aeee11a8b3992.zip
Updated 18 files, added 1692 files and deleted includes/system/compare.inc (automated)
Diffstat (limited to 'includes/external/matrix/node_modules/matrix-js-sdk/lib/crypto/crypto.js')
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/crypto/crypto.js48
1 files changed, 48 insertions, 0 deletions
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/crypto/crypto.js b/includes/external/matrix/node_modules/matrix-js-sdk/lib/crypto/crypto.js
new file mode 100644
index 0000000..a622f2e
--- /dev/null
+++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/crypto/crypto.js
@@ -0,0 +1,48 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.crypto = exports.TextEncoder = void 0;
+exports.setCrypto = setCrypto;
+exports.setTextEncoder = setTextEncoder;
+exports.subtleCrypto = void 0;
+var _logger = require("../logger");
+var _global$window, _global$window$crypto, _global$window2, _global$window2$crypt, _global$window3, _global$window3$crypt, _global$window4;
+let crypto = (_global$window = global.window) === null || _global$window === void 0 ? void 0 : _global$window.crypto;
+exports.crypto = crypto;
+let subtleCrypto = (_global$window$crypto = (_global$window2 = global.window) === null || _global$window2 === void 0 ? void 0 : (_global$window2$crypt = _global$window2.crypto) === null || _global$window2$crypt === void 0 ? void 0 : _global$window2$crypt.subtle) !== null && _global$window$crypto !== void 0 ? _global$window$crypto : (_global$window3 = global.window) === null || _global$window3 === void 0 ? void 0 : (_global$window3$crypt = _global$window3.crypto) === null || _global$window3$crypt === void 0 ? void 0 : _global$window3$crypt.webkitSubtle;
+exports.subtleCrypto = subtleCrypto;
+let TextEncoder = (_global$window4 = global.window) === null || _global$window4 === void 0 ? void 0 : _global$window4.TextEncoder;
+
+/* eslint-disable @typescript-eslint/no-var-requires */
+exports.TextEncoder = TextEncoder;
+if (!crypto) {
+ try {
+ exports.crypto = crypto = require("crypto").webcrypto;
+ } catch (e) {
+ _logger.logger.error("Failed to load webcrypto", e);
+ }
+}
+if (!subtleCrypto) {
+ var _crypto2;
+ exports.subtleCrypto = subtleCrypto = (_crypto2 = crypto) === null || _crypto2 === void 0 ? void 0 : _crypto2.subtle;
+}
+if (!TextEncoder) {
+ try {
+ exports.TextEncoder = TextEncoder = require("util").TextEncoder;
+ } catch (e) {
+ _logger.logger.error("Failed to load TextEncoder util", e);
+ }
+}
+/* eslint-enable @typescript-eslint/no-var-requires */
+
+function setCrypto(_crypto) {
+ var _crypto$subtle;
+ exports.crypto = crypto = _crypto;
+ exports.subtleCrypto = subtleCrypto = (_crypto$subtle = _crypto.subtle) !== null && _crypto$subtle !== void 0 ? _crypto$subtle : _crypto.webkitSubtle;
+}
+function setTextEncoder(_TextEncoder) {
+ exports.TextEncoder = TextEncoder = _TextEncoder;
+}
+//# sourceMappingURL=crypto.js.map \ No newline at end of file