idmission-web-sdk 2.2.65 → 2.2.66

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.
Files changed (35) hide show
  1. package/dist/components/Example.d.ts +1 -1
  2. package/dist/components/Example.d.ts.map +1 -1
  3. package/dist/components/camera/CameraVideoTag.d.ts.map +1 -1
  4. package/dist/components/document_capture/DocumentCaptureStateProvider.d.ts.map +1 -1
  5. package/dist/components/id_capture/IdCaptureRequirementOption.d.ts.map +1 -1
  6. package/dist/components/id_capture/IdCaptureWizard.d.ts.map +1 -1
  7. package/dist/components/selfie_capture/SelfieCapture.d.ts.map +1 -1
  8. package/dist/components/signature_capture/SignatureCapture.d.ts.map +1 -1
  9. package/dist/components/submission/SubmissionProvider.d.ts.map +1 -1
  10. package/dist/index.d.ts +1 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/lib/camera/Camera.d.ts +0 -43
  13. package/dist/lib/camera/Camera.d.ts.map +1 -1
  14. package/dist/lib/camera/cameraStore.d.ts.map +1 -1
  15. package/dist/sdk2.cjs.development.js +182 -143
  16. package/dist/sdk2.cjs.development.js.map +1 -1
  17. package/dist/sdk2.cjs.production.js +1 -1
  18. package/dist/sdk2.cjs.production.js.map +1 -1
  19. package/dist/sdk2.esm.js +182 -143
  20. package/dist/sdk2.esm.js.map +1 -1
  21. package/dist/sdk2.umd.development.js +182 -143
  22. package/dist/sdk2.umd.development.js.map +1 -1
  23. package/dist/sdk2.umd.production.js +1 -1
  24. package/dist/sdk2.umd.production.js.map +1 -1
  25. package/dist/themes/index.d.ts.map +1 -1
  26. package/dist/version.d.ts +1 -1
  27. package/package.json +7 -12
  28. package/dist/lib/barcode/Native.d.ts +0 -2
  29. package/dist/lib/barcode/Native.d.ts.map +0 -1
  30. package/dist/lib/barcode/Scan.d.ts +0 -5
  31. package/dist/lib/barcode/Scan.d.ts.map +0 -1
  32. package/dist/lib/barcode/ZXing.d.ts +0 -2
  33. package/dist/lib/barcode/ZXing.d.ts.map +0 -1
  34. package/dist/lib/camera/videoRefStack.d.ts +0 -6
  35. package/dist/lib/camera/videoRefStack.d.ts.map +0 -1
@@ -211,7 +211,7 @@
211
211
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
212
212
  };
213
213
 
214
- var webSdkVersion = '2.2.65';
214
+ var webSdkVersion = '2.2.66';
215
215
 
216
216
  function getPlatform() {
217
217
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -1298,7 +1298,7 @@
1298
1298
  parts[_i] = arguments[_i];
1299
1299
  }
1300
1300
  if (logLevel < LogLevel.Debug) return;
1301
- console.debug.apply(console, parts); // eslint-disable-line
1301
+ console.debug.apply(console, parts); // eslint-disable-line no-console
1302
1302
  }
1303
1303
  function log() {
1304
1304
  var parts = [];
@@ -1306,7 +1306,7 @@
1306
1306
  parts[_i] = arguments[_i];
1307
1307
  }
1308
1308
  if (logLevel < LogLevel.Info) return;
1309
- console.log.apply(console, parts); // eslint-disable-line
1309
+ console.log.apply(console, parts); // eslint-disable-line no-console
1310
1310
  }
1311
1311
  function warn() {
1312
1312
  var parts = [];
@@ -1314,7 +1314,7 @@
1314
1314
  parts[_i] = arguments[_i];
1315
1315
  }
1316
1316
  if (logLevel < LogLevel.Warn) return;
1317
- console.warn.apply(console, parts); // eslint-disable-line
1317
+ console.warn.apply(console, parts); // eslint-disable-line no-console
1318
1318
  }
1319
1319
  function error() {
1320
1320
  var parts = [];
@@ -1322,7 +1322,7 @@
1322
1322
  parts[_i] = arguments[_i];
1323
1323
  }
1324
1324
  if (logLevel < LogLevel.Error) return;
1325
- console.error.apply(console, parts); // eslint-disable-line
1325
+ console.error.apply(console, parts); // eslint-disable-line no-console
1326
1326
  }
1327
1327
 
1328
1328
  var sparkMd5 = {exports: {}};
@@ -2275,82 +2275,33 @@
2275
2275
  onDocumentUploadFailed.current = userSuppliedOnDocumentUploadFailed;
2276
2276
  }, [userSuppliedOnDocumentUploadFailed]);
2277
2277
  var uploadDocument = React.useCallback(function (src, metadata) {
2278
- return new Promise(function (resolve, reject) {
2279
- return __awaiter(void 0, void 0, void 0, function () {
2280
- var blob, _a, documentId, upload, _b, _c;
2281
- var _d, _e;
2282
- var _f;
2283
- return __generator(this, function (_g) {
2284
- switch (_g.label) {
2285
- case 0:
2286
- blob = typeof src === 'string' ? convertBase64ToBlob(src) : src;
2287
- _a = onBeforeDocumentUpload.current;
2288
- if (!_a) return [3 /*break*/, 2];
2289
- return [4 /*yield*/, (_f = onBeforeDocumentUpload.current) === null || _f === void 0 ? void 0 : _f.call(onBeforeDocumentUpload, blob, metadata)];
2290
- case 1:
2291
- _a = _g.sent() === false;
2292
- _g.label = 2;
2293
- case 2:
2294
- if (_a) return [2 /*return*/, resolve(blobToB64(blob))];
2295
- _b = createUpload;
2296
- _c = [blob];
2297
- _d = {
2298
- endpoint: documentServiceUrl,
2299
- retryDelays: [0, 1000, 1000, 1000, 3000, 5000, 10000, 20000],
2300
- headers: {
2301
- 'X-Session-Id': sessionId
2302
- }
2303
- };
2304
- _e = {
2305
- filetype: blob.type,
2306
- contentType: blob.type
2307
- };
2308
- return [4 /*yield*/, calculateMd5(blob)];
2309
- case 3:
2310
- upload = _b.apply(void 0, _c.concat([(_d.metadata = _assign.apply(void 0, [(_e.fingerprint = _g.sent(), _e), metadata || {}]), _d.onProgress = function (bytesUploaded, bytesTotal) {
2311
- var _a;
2312
- (_a = onDocumentUploadProgress.current) === null || _a === void 0 ? void 0 : _a.call(onDocumentUploadProgress, {
2313
- bytesUploaded: bytesUploaded,
2314
- bytesTotal: bytesTotal,
2315
- percentage: (bytesUploaded / bytesTotal * 100).toFixed(2) + '%',
2316
- metadata: metadata
2317
- });
2318
- }, _d.onAfterResponse = function (_req, res) {
2319
- var contentType = res.getHeader('Content-Type');
2320
- if (!(contentType === null || contentType === void 0 ? void 0 : contentType.startsWith('application/json'))) return;
2321
- var body = res.getBody();
2322
- if (!body) return;
2323
- try {
2324
- var parsedId = JSON.parse(body).id;
2325
- if (parsedId.startsWith('urn:documentsv1:')) {
2326
- documentId = parsedId;
2327
- }
2328
- } catch (e) {
2329
- warn('Failed to parse documents service response body', e);
2330
- }
2331
- }, _d.onSuccess = function () {
2332
- var _a, _b;
2333
- documentId || (documentId = "urn:documentsv1:".concat(getEnvFromUrl(upload.url), ":").concat((_a = upload.url.split('/files/').pop()) === null || _a === void 0 ? void 0 : _a.split('+').shift()));
2334
- (_b = onDocumentUploaded.current) === null || _b === void 0 ? void 0 : _b.call(onDocumentUploaded, documentId, metadata);
2335
- resolve(documentId);
2336
- }, _d.onError = function (error) {
2337
- var _a;
2338
- log('Failed because: ' + error);
2339
- (_a = onDocumentUploadFailed.current) === null || _a === void 0 ? void 0 : _a.call(onDocumentUploadFailed, error, metadata);
2340
- reject(error);
2341
- }, _d)]));
2342
- // Check if there are any previous uploads to continue.
2343
- upload.findPreviousUploads().then(function (previousUploads) {
2344
- // Found previous uploads so we select the first one.
2345
- if (previousUploads.length) {
2346
- upload.resumeFromPreviousUpload(previousUploads[0]);
2347
- }
2348
- // Start the upload
2349
- upload.start();
2350
- });
2351
- return [2 /*return*/];
2352
- }
2353
- });
2278
+ return __awaiter(void 0, void 0, void 0, function () {
2279
+ var blob, _a;
2280
+ var _b;
2281
+ return __generator(this, function (_c) {
2282
+ switch (_c.label) {
2283
+ case 0:
2284
+ blob = typeof src === 'string' ? convertBase64ToBlob(src) : src;
2285
+ _a = onBeforeDocumentUpload.current;
2286
+ if (!_a) return [3 /*break*/, 2];
2287
+ return [4 /*yield*/, (_b = onBeforeDocumentUpload.current) === null || _b === void 0 ? void 0 : _b.call(onBeforeDocumentUpload, blob, metadata)];
2288
+ case 1:
2289
+ _a = _c.sent() === false;
2290
+ _c.label = 2;
2291
+ case 2:
2292
+ if (_a) {
2293
+ return [2 /*return*/, blobToB64(blob)];
2294
+ }
2295
+ return [2 /*return*/, performUpload({
2296
+ blob: blob,
2297
+ endpoint: documentServiceUrl,
2298
+ sessionId: sessionId,
2299
+ metadata: metadata,
2300
+ onDocumentUploadProgress: onDocumentUploadProgress.current,
2301
+ onDocumentUploaded: onDocumentUploaded.current,
2302
+ onDocumentUploadFailed: onDocumentUploadFailed.current
2303
+ })];
2304
+ }
2354
2305
  });
2355
2306
  });
2356
2307
  }, [documentServiceUrl, sessionId]);
@@ -2899,6 +2850,83 @@
2899
2850
  }
2900
2851
  return 'unknown';
2901
2852
  }
2853
+ function performUpload(_a) {
2854
+ return __awaiter(this, arguments, void 0, function (_b) {
2855
+ var fingerprint;
2856
+ var blob = _b.blob,
2857
+ endpoint = _b.endpoint,
2858
+ sessionId = _b.sessionId,
2859
+ metadata = _b.metadata,
2860
+ onDocumentUploadProgress = _b.onDocumentUploadProgress,
2861
+ onDocumentUploaded = _b.onDocumentUploaded,
2862
+ onDocumentUploadFailed = _b.onDocumentUploadFailed;
2863
+ return __generator(this, function (_c) {
2864
+ switch (_c.label) {
2865
+ case 0:
2866
+ return [4 /*yield*/, calculateMd5(blob)];
2867
+ case 1:
2868
+ fingerprint = _c.sent();
2869
+ return [2 /*return*/, new Promise(function (resolve, reject) {
2870
+ var documentId;
2871
+ var upload = createUpload(blob, {
2872
+ endpoint: endpoint,
2873
+ retryDelays: [0, 1000, 1000, 1000, 3000, 5000, 10000, 20000],
2874
+ headers: {
2875
+ 'X-Session-Id': sessionId
2876
+ },
2877
+ metadata: _assign({
2878
+ filetype: blob.type,
2879
+ contentType: blob.type,
2880
+ fingerprint: fingerprint
2881
+ }, metadata || {}),
2882
+ onProgress: function onProgress(bytesUploaded, bytesTotal) {
2883
+ onDocumentUploadProgress === null || onDocumentUploadProgress === void 0 ? void 0 : onDocumentUploadProgress({
2884
+ bytesUploaded: bytesUploaded,
2885
+ bytesTotal: bytesTotal,
2886
+ percentage: (bytesUploaded / bytesTotal * 100).toFixed(2) + '%',
2887
+ metadata: metadata
2888
+ });
2889
+ },
2890
+ onAfterResponse: function onAfterResponse(_req, res) {
2891
+ var contentType = res.getHeader('Content-Type');
2892
+ if (!(contentType === null || contentType === void 0 ? void 0 : contentType.startsWith('application/json'))) return;
2893
+ var body = res.getBody();
2894
+ if (!body) return;
2895
+ try {
2896
+ var parsedId = JSON.parse(body).id;
2897
+ if (parsedId.startsWith('urn:documentsv1:')) {
2898
+ documentId = parsedId;
2899
+ }
2900
+ } catch (e) {
2901
+ warn('Failed to parse documents service response body', e);
2902
+ }
2903
+ },
2904
+ onSuccess: function onSuccess() {
2905
+ var _a;
2906
+ documentId || (documentId = "urn:documentsv1:".concat(getEnvFromUrl(upload.url), ":").concat((_a = upload.url.split('/files/').pop()) === null || _a === void 0 ? void 0 : _a.split('+').shift()));
2907
+ onDocumentUploaded === null || onDocumentUploaded === void 0 ? void 0 : onDocumentUploaded(documentId, metadata);
2908
+ resolve(documentId);
2909
+ },
2910
+ onError: function onError(error) {
2911
+ log('Failed because: ' + error);
2912
+ onDocumentUploadFailed === null || onDocumentUploadFailed === void 0 ? void 0 : onDocumentUploadFailed(error, metadata);
2913
+ reject(error);
2914
+ }
2915
+ });
2916
+ // Check if there are any previous uploads to continue.
2917
+ upload.findPreviousUploads().then(function (previousUploads) {
2918
+ // Found previous uploads so we select the first one.
2919
+ if (previousUploads.length) {
2920
+ upload.resumeFromPreviousUpload(previousUploads[0]);
2921
+ }
2922
+ // Start the upload
2923
+ upload.start();
2924
+ });
2925
+ })];
2926
+ }
2927
+ });
2928
+ });
2929
+ }
2902
2930
 
2903
2931
  // This could've been more streamlined with internal state instead of abusing
2904
2932
  // refs to such extent, but then composing hooks and components could not opt out of unnecessary renders.
@@ -8441,7 +8469,7 @@
8441
8469
  };
8442
8470
  }, [modelPath, modelLoadTimeoutMs, videoRef, shouldLoadModels]);
8443
8471
  React.useEffect(function handleModelError() {
8444
- modelError && (onModelError === null || onModelError === void 0 ? void 0 : onModelError(modelError));
8472
+ if (modelError) onModelError === null || onModelError === void 0 ? void 0 : onModelError(modelError);
8445
8473
  }, [modelError, onModelError]);
8446
8474
  return {
8447
8475
  ready: ready,
@@ -8587,7 +8615,7 @@
8587
8615
  };
8588
8616
  }, [modelLoadTimeoutMs, videoRef]);
8589
8617
  React.useEffect(function handleModelError() {
8590
- modelError && (onModelError === null || onModelError === void 0 ? void 0 : onModelError(modelError));
8618
+ if (modelError) onModelError === null || onModelError === void 0 ? void 0 : onModelError(modelError);
8591
8619
  }, [modelError, onModelError]);
8592
8620
  return {
8593
8621
  ready: ready,
@@ -9086,7 +9114,7 @@
9086
9114
  };
9087
9115
  }, [shouldLoadModels, modelLoadTimeoutMs, modelPath, scoreThreshold, videoRef]);
9088
9116
  React.useEffect(function handleModelError() {
9089
- modelError && (onModelError === null || onModelError === void 0 ? void 0 : onModelError(modelError));
9117
+ if (modelError) onModelError === null || onModelError === void 0 ? void 0 : onModelError(modelError);
9090
9118
  }, [modelError, onModelError]);
9091
9119
  return {
9092
9120
  ready: ready,
@@ -9337,8 +9365,8 @@
9337
9365
  renderPrediction().then();
9338
9366
  return function () {
9339
9367
  loopId.current += 1;
9340
- frameId.current && cancelAnimationFrame(frameId.current);
9341
- timer && clearTimeout(timer);
9368
+ if (frameId.current) cancelAnimationFrame(frameId.current);
9369
+ if (timer) clearTimeout(timer);
9342
9370
  };
9343
9371
  }, [fn, running, throttleMs]);
9344
9372
  var start = React.useCallback(function () {
@@ -9557,7 +9585,7 @@
9557
9585
  },
9558
9586
  requestCameraAccess: function requestCameraAccess() {
9559
9587
  return __awaiter(this, void 0, void 0, function () {
9560
- var _a, videoRef, releaseCameraAccess, preferFrontFacingCamera, preferIphoneContinuityCamera, iphoneContinuityCameraDenied, availableCameras, selectedCamera, platform_1, iphoneContinuityCamera, constraints, stream_1, e_1, handleStreamEnded_1, videoTrack_1, camera_1, e_3;
9588
+ var _a, videoRef, releaseCameraAccess, preferFrontFacingCamera, preferIphoneContinuityCamera, iphoneContinuityCameraDenied, availableCameras, selectedCamera, platform_1, iphoneContinuityCamera, constraints, stream_1, e_1, e_2, handleStreamEnded_1, videoTrack_1, camera_1, e_3;
9561
9589
  var _b, _c, _d;
9562
9590
  return __generator(this, function (_e) {
9563
9591
  switch (_e.label) {
@@ -9677,13 +9705,13 @@
9677
9705
  debug('opened stream with no width and height constraints');
9678
9706
  return [3 /*break*/, 10];
9679
9707
  case 9:
9680
- _e.sent();
9681
- debug('cannot open stream at all');
9708
+ e_2 = _e.sent();
9709
+ debug('cannot open stream at all', e_2);
9682
9710
  return [3 /*break*/, 10];
9683
9711
  case 10:
9684
9712
  if (!stream_1) {
9685
9713
  error('failed to open camera');
9686
- throw new Error('failed to open camera');
9714
+ throw new Error('failed to open camera: ');
9687
9715
  }
9688
9716
  debug('camera access granted with constraints', constraints);
9689
9717
  handleStreamEnded_1 = function handleStreamEnded_1() {
@@ -9764,7 +9792,7 @@
9764
9792
  },
9765
9793
  requestMicrophoneAccess: function requestMicrophoneAccess() {
9766
9794
  return __awaiter(this, void 0, void 0, function () {
9767
- var stream_2;
9795
+ var stream_2, e_4;
9768
9796
  return __generator(this, function (_a) {
9769
9797
  switch (_a.label) {
9770
9798
  case 0:
@@ -9803,7 +9831,8 @@
9803
9831
  }, 500);
9804
9832
  return [3 /*break*/, 4];
9805
9833
  case 3:
9806
- _a.sent();
9834
+ e_4 = _a.sent();
9835
+ debug('failed to open microphone', e_4);
9807
9836
  set({
9808
9837
  microphoneAccessDenied: true
9809
9838
  });
@@ -10168,9 +10197,7 @@
10168
10197
  // @ts-ignore
10169
10198
  return navAny.userAgentData && navAny.userAgentData.mobile;
10170
10199
  }
10171
- return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) ||
10172
- // tslint:disable-next-line:max-line-length
10173
- /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4));
10200
+ return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4));
10174
10201
  }
10175
10202
  return false;
10176
10203
  }
@@ -10316,7 +10343,7 @@
10316
10343
  }, [allowSinglePageIdCapture, lastPredictionCanvas, makeFocusPrediction, onDocumentDetected, requiredDocumentType, thresholds.focus]);
10317
10344
  var modelError = documentDetectionModelError !== null && documentDetectionModelError !== void 0 ? documentDetectionModelError : focusModelError;
10318
10345
  React.useEffect(function handleModelErrors() {
10319
- modelError && (onModelError === null || onModelError === void 0 ? void 0 : onModelError(modelError));
10346
+ if (modelError) onModelError === null || onModelError === void 0 ? void 0 : onModelError(modelError);
10320
10347
  }, [modelError, onModelError]);
10321
10348
  var onPredictionMade = React.useCallback(function (handler) {
10322
10349
  onPredictionHandler.current = handler;
@@ -10340,7 +10367,7 @@
10340
10367
  bestFocusScore.current = 0;
10341
10368
  }, [clearDocumentDetectionLastPredictionCanvas]);
10342
10369
  React.useEffect(function () {
10343
- requiredDocumentType && resetBestFrame();
10370
+ if (requiredDocumentType) resetBestFrame();
10344
10371
  }, [requiredDocumentType, resetBestFrame]);
10345
10372
  var value = React.useMemo(function () {
10346
10373
  return {
@@ -10481,10 +10508,6 @@
10481
10508
  var isIdCardOrPassport = captureRequirement === 'idCardOrPassport';
10482
10509
  if (isIdCardOrPassport && requestedDocumentType === 'passport') return [];
10483
10510
  var acceptedTypes = acceptedDocumentTypesForIdCaptureRequirementOption[captureRequirement];
10484
- console.log({
10485
- capturedDocuments: capturedDocuments,
10486
- captureRequirement: captureRequirement
10487
- });
10488
10511
  if (captureRequirement.includes('idCard') && 'singlePage' in capturedDocuments) {
10489
10512
  acceptedTypes = acceptedTypes.filter(function (v) {
10490
10513
  return !v.includes('idCard');
@@ -16009,7 +16032,7 @@
16009
16032
  });
16010
16033
  }, [setDimensions, wrapperHeight, wrapperWidth]);
16011
16034
  var padding = userSuppliedPadding !== null && userSuppliedPadding !== void 0 ? userSuppliedPadding : isMobile() ? (_g = (_f = (_e = theme.idCapture) === null || _e === void 0 ? void 0 : _e.guideBox) === null || _f === void 0 ? void 0 : _f.mobilePadding) !== null && _g !== void 0 ? _g : 0 : (_k = (_j = (_h = theme.idCapture) === null || _h === void 0 ? void 0 : _h.guideBox) === null || _j === void 0 ? void 0 : _j.desktopPadding) !== null && _k !== void 0 ? _k : 50;
16012
- var paddingAndBorderPx = padding * 2 + borderWidth * 2;
16035
+ var paddingAndBorderPx = padding * 2 + (borderWidth !== null && borderWidth !== void 0 ? borderWidth : 0) * 2;
16013
16036
  var images = useImagesWithBackToFront(userSuppliedImages, isBackToFront);
16014
16037
  var imagesByUrl = useGuideImagesByUrl(images);
16015
16038
  var orientation = getOrientation(portraitGuidesOnMobile);
@@ -16056,7 +16079,7 @@
16056
16079
  "$isMirrored": isMirrored,
16057
16080
  className: classNames.centerRegion
16058
16081
  }, /*#__PURE__*/React.createElement(GuideCenterBorder, {
16059
- "$borderWidth": borderWidth,
16082
+ "$borderWidth": borderWidth !== null && borderWidth !== void 0 ? borderWidth : 0,
16060
16083
  "$borderColor": borderColor,
16061
16084
  "$padding": imagePadding,
16062
16085
  className: classNames.centerRegionBorder
@@ -16256,7 +16279,7 @@
16256
16279
  }, [aspectRatio, borderColor, borderRadius, borderWidth, dispatch, maskColor, padding, redrawing, wrapperHeight, wrapperWidth]);
16257
16280
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CanvasWrapper$1, {
16258
16281
  ref: wrapperRef,
16259
- "$maskColor": maskColor,
16282
+ "$maskColor": maskColor !== null && maskColor !== void 0 ? maskColor : '',
16260
16283
  className: classNames.canvasWrapper
16261
16284
  }, /*#__PURE__*/React.createElement(Canvas$1, {
16262
16285
  ref: canvasRef,
@@ -16551,7 +16574,7 @@
16551
16574
  var uploadDocument = React.useContext(SubmissionContext).uploadDocument;
16552
16575
  var uploadCapturedDocument = React.useCallback(function (content, filetype) {
16553
16576
  return __awaiter(void 0, void 0, void 0, function () {
16554
- var documentId_1;
16577
+ var documentId_1, e_1;
16555
16578
  return __generator(this, function (_a) {
16556
16579
  switch (_a.label) {
16557
16580
  case 0:
@@ -16574,7 +16597,8 @@
16574
16597
  }, 0);
16575
16598
  return [3 /*break*/, 3];
16576
16599
  case 2:
16577
- _a.sent();
16600
+ e_1 = _a.sent();
16601
+ debug('upload failed', e_1);
16578
16602
  dispatch({
16579
16603
  type: 'uploadFailed'
16580
16604
  });
@@ -16609,7 +16633,7 @@
16609
16633
  resolvedDocuments.forEach(function (d) {
16610
16634
  if (d.content) {
16611
16635
  d.contentUrl || (d.contentUrl = URL.createObjectURL(d.content));
16612
- uploadCapturedDocument(d.content, d.content.type);
16636
+ void uploadCapturedDocument(d.content, d.content.type);
16613
16637
  }
16614
16638
  });
16615
16639
  }, [aspectRatio, cameraFeedMode, documents, instructions, uploadCapturedDocument]);
@@ -16807,6 +16831,7 @@
16807
16831
  React.useEffect(function attachCameraStreamToVideoTagWhenReady() {
16808
16832
  if (videoRef.current && videoStream) {
16809
16833
  debug('attaching camera stream to video tag');
16834
+ // eslint-disable-next-line react-compiler/react-compiler
16810
16835
  videoRef.current.srcObject = videoStream;
16811
16836
  }
16812
16837
  }, [videoStream, videoRef]);
@@ -17370,12 +17395,16 @@
17370
17395
  }, [allowIdCardBackToFrontCapture, allowOverrideWrongDocumentTypeAfterMs, allowSinglePageIdCapture, captureRequirement, dispatch, enableOverrideWrongDocumentTypeDialog, precapturedDocuments]);
17371
17396
  var documentCount = Object.keys(state.capturedDocuments).length;
17372
17397
  React.useEffect(function () {
17373
- documentCount && resetBestFrame();
17398
+ if (documentCount) resetBestFrame();
17374
17399
  }, [documentCount, resetBestFrame]);
17375
17400
  var logCaptureMetadata = React.useCallback(function (metadata) {
17376
17401
  var _a;
17377
17402
  metadata.operationTime = new Date().getTime() - ((_a = state.operationStartedAt) !== null && _a !== void 0 ? _a : new Date()).getTime();
17378
- state.requestedDocumentType === 'idCardBack' ? logIdBackCaptureAttempt(metadata) : logIdFrontCaptureAttempt(metadata);
17403
+ if (state.requestedDocumentType === 'idCardBack') {
17404
+ logIdBackCaptureAttempt(metadata);
17405
+ } else {
17406
+ logIdFrontCaptureAttempt(metadata);
17407
+ }
17379
17408
  }, [logIdBackCaptureAttempt, logIdFrontCaptureAttempt, state.operationStartedAt, state.requestedDocumentType]);
17380
17409
  React.useEffect(function startModelsWhenCapturing() {
17381
17410
  if (!overlayDismissed || state.captureState !== 'capturing') return;
@@ -17431,11 +17460,11 @@
17431
17460
  var idBackImage = idCardBack && dataUrlToBase64Sync(idCardBack.imageData);
17432
17461
  var passportImage = passport && dataUrlToBase64Sync(passport.imageData);
17433
17462
  var singlePageImage = singlePage && dataUrlToBase64Sync(singlePage.imageData);
17434
- idFrontImage && setIdFrontImage(idFrontImage);
17435
- idBackImage && setIdBackImage(idBackImage);
17436
- passportImage && setPassportImage(passportImage);
17437
- singlePageImage && setIdFrontImage(singlePageImage);
17438
- releaseCameraAccessOnExit && releaseCameraAccess();
17463
+ if (idFrontImage) setIdFrontImage(idFrontImage);
17464
+ if (idBackImage) setIdBackImage(idBackImage);
17465
+ if (passportImage) setPassportImage(passportImage);
17466
+ if (singlePageImage) setIdFrontImage(singlePageImage);
17467
+ if (releaseCameraAccessOnExit) releaseCameraAccess();
17439
17468
  setTimeout(function () {
17440
17469
  onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess({
17441
17470
  idFrontImage: idFrontImage,
@@ -17467,7 +17496,7 @@
17467
17496
  }, [dispatch, onExitCapture, releaseCameraAccess, requestCameraAccess]);
17468
17497
  React.useEffect(function () {
17469
17498
  if (submissionStatus !== SubmissionStatus.READY) {
17470
- releaseCameraAccessOnExit && releaseCameraAccess();
17499
+ if (releaseCameraAccessOnExit) releaseCameraAccess();
17471
17500
  }
17472
17501
  }, [releaseCameraAccess, releaseCameraAccessOnExit, submissionStatus]);
17473
17502
  React.useEffect(function () {
@@ -18648,19 +18677,25 @@
18648
18677
  canvasRef = _v.canvasRef,
18649
18678
  guidanceError = _v.error;
18650
18679
  onPredictionMade(f(React.useCallback(function (prediction) {
18651
- return new Promise(function (resolve) {
18652
- if (shouldCapture && !busy) {
18653
- drawToCanvas(lastPredictionCanvas.current, canvasRef.current);
18654
- dispatch({
18655
- type: 'facesDetected',
18656
- payload: prediction
18657
- });
18658
- }
18659
- resolve();
18680
+ return __awaiter(void 0, void 0, void 0, function () {
18681
+ return __generator(this, function (_a) {
18682
+ if (shouldCapture && !busy) {
18683
+ drawToCanvas(lastPredictionCanvas.current, canvasRef.current);
18684
+ dispatch({
18685
+ type: 'facesDetected',
18686
+ payload: prediction
18687
+ });
18688
+ }
18689
+ return [2 /*return*/];
18690
+ });
18660
18691
  });
18661
18692
  }, [canvasRef, shouldCapture, busy]), 16));
18662
18693
  React.useEffect(function () {
18663
- (prediction === null || prediction === void 0 ? void 0 : prediction.faceReady) ? onGuidanceSatisfied === null || onGuidanceSatisfied === void 0 ? void 0 : onGuidanceSatisfied() : onGuidanceNotSatisfied === null || onGuidanceNotSatisfied === void 0 ? void 0 : onGuidanceNotSatisfied();
18694
+ if (prediction === null || prediction === void 0 ? void 0 : prediction.faceReady) {
18695
+ onGuidanceSatisfied === null || onGuidanceSatisfied === void 0 ? void 0 : onGuidanceSatisfied();
18696
+ } else {
18697
+ onGuidanceNotSatisfied === null || onGuidanceNotSatisfied === void 0 ? void 0 : onGuidanceNotSatisfied();
18698
+ }
18664
18699
  }, [onGuidanceNotSatisfied, onGuidanceSatisfied, prediction === null || prediction === void 0 ? void 0 : prediction.faceReady]);
18665
18700
  React.useEffect(function () {
18666
18701
  if (!(prediction === null || prediction === void 0 ? void 0 : prediction.faceReady)) return;
@@ -19658,7 +19693,7 @@
19658
19693
  }, [logCaptureMetadata, releaseCameraAccess, requestCameraAccess]);
19659
19694
  var onDoneCallback = React.useCallback(function () {
19660
19695
  logCaptureMetadata();
19661
- releaseCameraAccessOnExit && releaseCameraAccess();
19696
+ if (releaseCameraAccessOnExit) releaseCameraAccess();
19662
19697
  setTimeout(function () {
19663
19698
  onComplete === null || onComplete === void 0 ? void 0 : onComplete(submissionResponse, livenessCheckRequest);
19664
19699
  }, 0);
@@ -19677,7 +19712,7 @@
19677
19712
  onLoadingOverlayDismissed === null || onLoadingOverlayDismissed === void 0 ? void 0 : onLoadingOverlayDismissed();
19678
19713
  }, [onLoadingOverlayDismissed]);
19679
19714
  var onFailureExitClick = React.useCallback(function () {
19680
- releaseCameraAccessOnExit && releaseCameraAccess();
19715
+ if (releaseCameraAccessOnExit) releaseCameraAccess();
19681
19716
  setTimeout(function () {
19682
19717
  onExitAfterFailure === null || onExitAfterFailure === void 0 ? void 0 : onExitAfterFailure(submissionResponse, livenessCheckRequest);
19683
19718
  }, 0);
@@ -20799,16 +20834,15 @@
20799
20834
  var templateObject_1$b, templateObject_2$9, templateObject_3$9, templateObject_4$4;
20800
20835
 
20801
20836
  var SignatureCapture = function SignatureCapture(_a) {
20802
- var _b;
20803
20837
  var onAccept = _a.onAccept,
20804
- _c = _a.classNames,
20805
- classNames = _c === void 0 ? {} : _c,
20806
- _d = _a.verbiage,
20807
- rawVerbiage = _d === void 0 ? {} : _d;
20808
- var _e = useResizeObserver(),
20809
- ref = _e.ref,
20810
- width = _e.width,
20811
- height = _e.height;
20838
+ _b = _a.classNames,
20839
+ classNames = _b === void 0 ? {} : _b,
20840
+ _c = _a.verbiage,
20841
+ rawVerbiage = _c === void 0 ? {} : _c;
20842
+ var _d = useResizeObserver(),
20843
+ ref = _d.ref,
20844
+ width = _d.width,
20845
+ height = _d.height;
20812
20846
  var signaturePad = React.useRef(null);
20813
20847
  var verbiage = useTranslations(rawVerbiage, {
20814
20848
  headingText: 'Please sign the box below',
@@ -20858,8 +20892,11 @@
20858
20892
  }, /*#__PURE__*/React.createElement(LoaderButton, {
20859
20893
  variant: "secondary",
20860
20894
  className: classNames.clearBtn,
20861
- onClick: (_b = signaturePad.current) === null || _b === void 0 ? void 0 : _b.clear,
20862
- finished: true
20895
+ finished: true,
20896
+ onClick: function onClick() {
20897
+ var _a;
20898
+ (_a = signaturePad.current) === null || _a === void 0 ? void 0 : _a.clear();
20899
+ }
20863
20900
  }, verbiage.clearBtnText), /*#__PURE__*/React.createElement(AcceptBtn$1, {
20864
20901
  variant: "positive",
20865
20902
  className: classNames.acceptBtn,
@@ -22515,7 +22552,7 @@
22515
22552
  return __awaiter(void 0, void 0, void 0, function () {
22516
22553
  return __generator(this, function (_a) {
22517
22554
  setIdCaptureVideoUrl(videoUrl);
22518
- audioUrl && setIdCaptureVideoAudioUrl(audioUrl);
22555
+ if (audioUrl) setIdCaptureVideoAudioUrl(audioUrl);
22519
22556
  setCaptureState('SUCCESS');
22520
22557
  if (skipSuccessScreen) onComplete === null || onComplete === void 0 ? void 0 : onComplete();
22521
22558
  return [2 /*return*/];
@@ -23110,10 +23147,10 @@
23110
23147
  var ThemeProvider = function ThemeProvider(_a) {
23111
23148
  var children = _a.children,
23112
23149
  themeInput = _a.theme;
23113
- var themeRef = React.useRef(themeInput);
23150
+ var themeRef = React.useState(themeInput)[0];
23114
23151
  var theme = React.useMemo(function () {
23115
- return resolveTheme(themeRef.current);
23116
- }, []);
23152
+ return resolveTheme(themeRef);
23153
+ }, [themeRef]);
23117
23154
  var colors = theme.colors;
23118
23155
  React.useEffect(function () {
23119
23156
  for (var name_1 in colors) {
@@ -25615,7 +25652,9 @@
25615
25652
  try {
25616
25653
  root.unmount();
25617
25654
  originalRemove_1();
25618
- } catch (e) {}
25655
+ } catch (e) {
25656
+ debug('failed to unmount', e);
25657
+ }
25619
25658
  };
25620
25659
  }
25621
25660
  return targetElement;