@nibssplc/cams-sdk-react 1.0.0-rc.37 → 1.0.0-rc.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +39 -15
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +39 -15
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -131,22 +131,46 @@ var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(DialogPri
|
|
|
131
131
|
}); };
|
|
132
132
|
// Force override crypto.subtle
|
|
133
133
|
var originalSubtle = window.crypto.subtle;
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
134
|
+
try {
|
|
135
|
+
Object.defineProperty(window.crypto, 'subtle', {
|
|
136
|
+
configurable: true,
|
|
137
|
+
get: function () {
|
|
138
|
+
var _this = this;
|
|
139
|
+
return {
|
|
140
|
+
digest: function (algorithm, data) { return __awaiter(_this, void 0, void 0, function () {
|
|
141
|
+
var alg;
|
|
142
|
+
return __generator(this, function (_a) {
|
|
143
|
+
alg = typeof algorithm === 'string' ? algorithm : algorithm.name;
|
|
144
|
+
if (alg === 'SHA-256')
|
|
145
|
+
return [2 /*return*/, sha256(data)];
|
|
146
|
+
if (originalSubtle === null || originalSubtle === void 0 ? void 0 : originalSubtle.digest)
|
|
147
|
+
return [2 /*return*/, originalSubtle.digest(algorithm, data)];
|
|
148
|
+
throw new Error("Unsupported algorithm: ".concat(alg));
|
|
149
|
+
});
|
|
150
|
+
}); }
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
catch (_a) {
|
|
156
|
+
// Some environments prevent redefining built-ins; fallback to a typed assertion assignment
|
|
157
|
+
window.crypto.subtle = {
|
|
158
|
+
digest: function (algorithm, data) { return __awaiter(_this, void 0, void 0, function () {
|
|
159
|
+
var alg;
|
|
160
|
+
return __generator(this, function (_a) {
|
|
161
|
+
alg = typeof algorithm === 'string' ? algorithm : algorithm.name;
|
|
162
|
+
if (alg === 'SHA-256')
|
|
163
|
+
return [2 /*return*/, sha256(data)];
|
|
164
|
+
if (originalSubtle === null || originalSubtle === void 0 ? void 0 : originalSubtle.digest)
|
|
165
|
+
return [2 /*return*/, originalSubtle.digest(algorithm, data)];
|
|
166
|
+
throw new Error("Unsupported algorithm: ".concat(alg));
|
|
167
|
+
});
|
|
168
|
+
}); }
|
|
169
|
+
};
|
|
170
|
+
}
|
|
147
171
|
// Polyfill randomUUID
|
|
148
|
-
if (!
|
|
149
|
-
|
|
172
|
+
if (!globalThis.crypto.randomUUID) {
|
|
173
|
+
globalThis.crypto.randomUUID = function () {
|
|
150
174
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
151
175
|
var r = (Math.random() * 16) | 0;
|
|
152
176
|
var v = c === 'x' ? r : (r & 0x3) | 0x8;
|