idmission-web-sdk 2.3.100 → 2.3.101

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.
@@ -212,7 +212,7 @@
212
212
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
213
213
  };
214
214
 
215
- var webSdkVersion = '2.3.100';
215
+ var webSdkVersion = '2.3.101';
216
216
 
217
217
  function getPlatform() {
218
218
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -24201,23 +24201,10 @@
24201
24201
  return t.length > 0 ? t : undefined;
24202
24202
  }
24203
24203
 
24204
- function makeReadChunk(file) {
24205
- var _this = this;
24206
- return function (chunkSize, offset) {
24207
- return __awaiter(_this, void 0, void 0, function () {
24208
- var _a;
24209
- return __generator(this, function (_b) {
24210
- switch (_b.label) {
24211
- case 0:
24212
- _a = Uint8Array.bind;
24213
- return [4 /*yield*/, file.slice(offset, offset + chunkSize).arrayBuffer()];
24214
- case 1:
24215
- return [2 /*return*/, new (_a.apply(Uint8Array, [void 0, _b.sent()]))()];
24216
- }
24217
- });
24218
- });
24219
- };
24220
- }
24204
+ // function makeReadChunk(file: File | Blob): ReadChunkFunc {
24205
+ // return async (chunkSize: number, offset: number) =>
24206
+ // new Uint8Array(await file.slice(offset, offset + chunkSize).arrayBuffer())
24207
+ // }
24221
24208
  var signatureRecorder = null;
24222
24209
  var signatureChunks = [];
24223
24210
  var videoSignatureInitialState = {
@@ -24298,42 +24285,39 @@
24298
24285
  signatureRecorder.stop();
24299
24286
  signatureRecorder.onstop = function () {
24300
24287
  return __awaiter(void 0, void 0, void 0, function () {
24301
- var recordingStoppedAt, inferredType, blob, _a, onSignatureVideoCaptured, recordingStartRequestedAt, recordingStartedAt, firstChunkReceivedAt, signatureStartedAt, signatureEndedAt, recordingStopRequestedAt, lastChunkReceivedAt, mediaInfo;
24302
- var _b;
24303
- return __generator(this, function (_c) {
24304
- switch (_c.label) {
24305
- case 0:
24306
- recordingStoppedAt = performance.now();
24307
- set({
24308
- recordingStoppedAt: recordingStoppedAt
24309
- });
24310
- inferredType = inferBlobType(signatureChunks[0]) || (signatureRecorder === null || signatureRecorder === void 0 ? void 0 : signatureRecorder.mimeType) || 'video/mp4';
24311
- blob = new Blob(signatureChunks, {
24312
- type: inferredType
24313
- });
24314
- signatureChunks = [];
24315
- signatureRecorder = null;
24316
- if (!signatureData) return [2 /*return*/];
24317
- _a = get(), onSignatureVideoCaptured = _a.onSignatureVideoCaptured, recordingStartRequestedAt = _a.recordingStartRequestedAt, recordingStartedAt = _a.recordingStartedAt, firstChunkReceivedAt = _a.firstChunkReceivedAt, signatureStartedAt = _a.signatureStartedAt, signatureEndedAt = _a.signatureEndedAt, recordingStopRequestedAt = _a.recordingStopRequestedAt, lastChunkReceivedAt = _a.lastChunkReceivedAt;
24318
- return [4 /*yield*/, (_b = get().mediaInfo) === null || _b === void 0 ? void 0 : _b.analyzeData(blob.size, makeReadChunk(blob))];
24319
- case 1:
24320
- mediaInfo = _c.sent();
24321
- onSignatureVideoCaptured(blob, signatureData, imageUrl !== null && imageUrl !== void 0 ? imageUrl : null, {
24322
- mediaInfo: mediaInfo,
24323
- mimeType: inferredType,
24324
- timingData: {
24325
- recordingStartRequestedAt: recordingStartRequestedAt,
24326
- recordingStartedAt: recordingStartedAt,
24327
- firstChunkReceivedAt: firstChunkReceivedAt,
24328
- signatureStartedAt: signatureStartedAt,
24329
- signatureEndedAt: signatureEndedAt,
24330
- recordingStopRequestedAt: recordingStopRequestedAt,
24331
- recordingStoppedAt: recordingStoppedAt,
24332
- lastChunkReceivedAt: lastChunkReceivedAt
24333
- }
24334
- });
24335
- return [2 /*return*/];
24336
- }
24288
+ var recordingStoppedAt, inferredType, blob, _a, onSignatureVideoCaptured, recordingStartRequestedAt, recordingStartedAt, firstChunkReceivedAt, signatureStartedAt, signatureEndedAt, recordingStopRequestedAt, lastChunkReceivedAt;
24289
+ return __generator(this, function (_b) {
24290
+ recordingStoppedAt = performance.now();
24291
+ set({
24292
+ recordingStoppedAt: recordingStoppedAt
24293
+ });
24294
+ inferredType = inferBlobType(signatureChunks[0]) || (signatureRecorder === null || signatureRecorder === void 0 ? void 0 : signatureRecorder.mimeType) || 'video/mp4';
24295
+ blob = new Blob(signatureChunks, {
24296
+ type: inferredType
24297
+ });
24298
+ signatureChunks = [];
24299
+ signatureRecorder = null;
24300
+ if (!signatureData) return [2 /*return*/];
24301
+ _a = get(), onSignatureVideoCaptured = _a.onSignatureVideoCaptured, recordingStartRequestedAt = _a.recordingStartRequestedAt, recordingStartedAt = _a.recordingStartedAt, firstChunkReceivedAt = _a.firstChunkReceivedAt, signatureStartedAt = _a.signatureStartedAt, signatureEndedAt = _a.signatureEndedAt, recordingStopRequestedAt = _a.recordingStopRequestedAt, lastChunkReceivedAt = _a.lastChunkReceivedAt;
24302
+ // const mediaInfo = await get().mediaInfo?.analyzeData(
24303
+ // blob.size,
24304
+ // makeReadChunk(blob),
24305
+ // )
24306
+ onSignatureVideoCaptured(blob, signatureData, imageUrl !== null && imageUrl !== void 0 ? imageUrl : null, {
24307
+ // mediaInfo,
24308
+ mimeType: inferredType,
24309
+ timingData: {
24310
+ recordingStartRequestedAt: recordingStartRequestedAt,
24311
+ recordingStartedAt: recordingStartedAt,
24312
+ firstChunkReceivedAt: firstChunkReceivedAt,
24313
+ signatureStartedAt: signatureStartedAt,
24314
+ signatureEndedAt: signatureEndedAt,
24315
+ recordingStopRequestedAt: recordingStopRequestedAt,
24316
+ recordingStoppedAt: recordingStoppedAt,
24317
+ lastChunkReceivedAt: lastChunkReceivedAt
24318
+ }
24319
+ });
24320
+ return [2 /*return*/];
24337
24321
  });
24338
24322
  });
24339
24323
  };
@@ -24400,53 +24384,35 @@
24400
24384
  // Use dynamic import to avoid build-time WASM loading issues
24401
24385
  var loadMediaInfo = function loadMediaInfo() {
24402
24386
  return __awaiter(_this, void 0, void 0, function () {
24403
- var mediaInfoFactory, mediaInfo, e_1, mediaInfoFactory, mediaInfo, fallbackError_1;
24387
+ var mediaInfoFactory, e_1;
24404
24388
  return __generator(this, function (_a) {
24405
24389
  switch (_a.label) {
24406
24390
  case 0:
24407
- _a.trys.push([0, 3,, 9]);
24408
- return [4 /*yield*/, Promise.resolve().then(function () { return index; })];
24391
+ _a.trys.push([0, 3,, 4]);
24392
+ return [4 /*yield*/, Promise.resolve().then(function () { return index; })
24393
+ // const mediaInfo =
24394
+ ];
24409
24395
  case 1:
24410
24396
  mediaInfoFactory = _a.sent().mediaInfoFactory;
24397
+ // const mediaInfo =
24411
24398
  return [4 /*yield*/, mediaInfoFactory({
24412
24399
  format: 'object',
24413
24400
  full: true,
24414
24401
  locateFile: function locateFile(filename) {
24415
24402
  return "".concat(DEFAULT_CDN_URL, "/").concat(filename);
24416
24403
  }
24417
- })];
24404
+ })
24405
+ // useVideoSignatureStore.setState({ mediaInfo })
24406
+ ];
24418
24407
  case 2:
24419
- mediaInfo = _a.sent();
24420
- useVideoSignatureStore.setState({
24421
- mediaInfo: mediaInfo
24422
- });
24423
- return [3 /*break*/, 9];
24408
+ // const mediaInfo =
24409
+ _a.sent();
24410
+ return [3 /*break*/, 4];
24424
24411
  case 3:
24425
24412
  e_1 = _a.sent();
24426
24413
  warn('error loading mediaInfo', e_1);
24427
- _a.label = 4;
24414
+ return [3 /*break*/, 4];
24428
24415
  case 4:
24429
- _a.trys.push([4, 7,, 8]);
24430
- return [4 /*yield*/, Promise.resolve().then(function () { return index; })];
24431
- case 5:
24432
- mediaInfoFactory = _a.sent().mediaInfoFactory;
24433
- return [4 /*yield*/, mediaInfoFactory({
24434
- format: 'object',
24435
- full: true
24436
- })];
24437
- case 6:
24438
- mediaInfo = _a.sent();
24439
- useVideoSignatureStore.setState({
24440
- mediaInfo: mediaInfo
24441
- });
24442
- return [3 /*break*/, 8];
24443
- case 7:
24444
- fallbackError_1 = _a.sent();
24445
- warn('fallback mediaInfo loading also failed', fallbackError_1);
24446
- return [3 /*break*/, 8];
24447
- case 8:
24448
- return [3 /*break*/, 9];
24449
- case 9:
24450
24416
  return [2 /*return*/];
24451
24417
  }
24452
24418
  });
@@ -24454,13 +24420,11 @@
24454
24420
  };
24455
24421
  loadMediaInfo();
24456
24422
  return function () {
24457
- var mediaInfo = useVideoSignatureStore.getState().mediaInfo;
24458
- if (mediaInfo) {
24459
- mediaInfo.close();
24460
- useVideoSignatureStore.setState({
24461
- mediaInfo: undefined
24462
- });
24463
- }
24423
+ // const mediaInfo = useVideoSignatureStore.getState().mediaInfo
24424
+ // if (mediaInfo) {
24425
+ // mediaInfo.close()
24426
+ // useVideoSignatureStore.setState({ mediaInfo: undefined })
24427
+ // }
24464
24428
  };
24465
24429
  }, [captureMediaInfo]);
24466
24430
  var signaturePadEmpty = useVideoSignatureStore().signaturePadEmpty;