idmission-web-sdk 2.2.65 → 2.2.67

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 (59) hide show
  1. package/dist/components/CompositeWizard.d.ts.map +1 -1
  2. package/dist/components/Example.d.ts +1 -1
  3. package/dist/components/Example.d.ts.map +1 -1
  4. package/dist/components/camera/CameraVideoTag.d.ts.map +1 -1
  5. package/dist/components/customer_flows/IdValidation.d.ts +1 -3
  6. package/dist/components/customer_flows/IdValidation.d.ts.map +1 -1
  7. package/dist/components/document_capture/DocumentCaptureStateProvider.d.ts.map +1 -1
  8. package/dist/components/fallback_flows/IdCapture.d.ts.map +1 -1
  9. package/dist/components/id_capture/CapturedDocuments.d.ts +1 -1
  10. package/dist/components/id_capture/CapturedDocuments.d.ts.map +1 -1
  11. package/dist/components/id_capture/IdCapture.d.ts +2 -2
  12. package/dist/components/id_capture/IdCapture.d.ts.map +1 -1
  13. package/dist/components/id_capture/IdCaptureModelsProvider.d.ts +1 -2
  14. package/dist/components/id_capture/IdCaptureModelsProvider.d.ts.map +1 -1
  15. package/dist/components/id_capture/IdCaptureRequirementOption.d.ts +5 -7
  16. package/dist/components/id_capture/IdCaptureRequirementOption.d.ts.map +1 -1
  17. package/dist/components/id_capture/IdCaptureStateProvider.d.ts +0 -4
  18. package/dist/components/id_capture/IdCaptureStateProvider.d.ts.map +1 -1
  19. package/dist/components/id_capture/IdCaptureSuccess.d.ts +4 -0
  20. package/dist/components/id_capture/IdCaptureSuccess.d.ts.map +1 -1
  21. package/dist/components/id_capture/IdCaptureWizard.d.ts +1 -2
  22. package/dist/components/id_capture/IdCaptureWizard.d.ts.map +1 -1
  23. package/dist/components/selfie_capture/SelfieCapture.d.ts.map +1 -1
  24. package/dist/components/signature_capture/SignatureCapture.d.ts.map +1 -1
  25. package/dist/components/submission/SubmissionProvider.d.ts.map +1 -1
  26. package/dist/components/video_id/IdVideoCapture.d.ts +0 -2
  27. package/dist/components/video_id/IdVideoCapture.d.ts.map +1 -1
  28. package/dist/components/video_id/IdVideoCaptureWizard.d.ts.map +1 -1
  29. package/dist/index.d.ts +1 -1
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/lib/camera/Camera.d.ts +0 -43
  32. package/dist/lib/camera/Camera.d.ts.map +1 -1
  33. package/dist/lib/camera/cameraStore.d.ts.map +1 -1
  34. package/dist/lib/models/DocumentDetection.d.ts +2 -6
  35. package/dist/lib/models/DocumentDetection.d.ts.map +1 -1
  36. package/dist/lib/models/Focus.d.ts +0 -4
  37. package/dist/lib/models/Focus.d.ts.map +1 -1
  38. package/dist/lib/models/defaults/DocumentDetector.d.ts +1 -1
  39. package/dist/sdk2.cjs.development.js +507 -494
  40. package/dist/sdk2.cjs.development.js.map +1 -1
  41. package/dist/sdk2.cjs.production.js +1 -1
  42. package/dist/sdk2.cjs.production.js.map +1 -1
  43. package/dist/sdk2.esm.js +507 -494
  44. package/dist/sdk2.esm.js.map +1 -1
  45. package/dist/sdk2.umd.development.js +507 -494
  46. package/dist/sdk2.umd.development.js.map +1 -1
  47. package/dist/sdk2.umd.production.js +1 -1
  48. package/dist/sdk2.umd.production.js.map +1 -1
  49. package/dist/themes/index.d.ts.map +1 -1
  50. package/dist/version.d.ts +1 -1
  51. package/package.json +7 -12
  52. package/dist/lib/barcode/Native.d.ts +0 -2
  53. package/dist/lib/barcode/Native.d.ts.map +0 -1
  54. package/dist/lib/barcode/Scan.d.ts +0 -5
  55. package/dist/lib/barcode/Scan.d.ts.map +0 -1
  56. package/dist/lib/barcode/ZXing.d.ts +0 -2
  57. package/dist/lib/barcode/ZXing.d.ts.map +0 -1
  58. package/dist/lib/camera/videoRefStack.d.ts +0 -6
  59. 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.67';
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.
@@ -8311,7 +8339,7 @@
8311
8339
 
8312
8340
  var DEFAULT_CDN_URL = 'https://websdk-cdn-dev.idmission.com/assets';
8313
8341
 
8314
- var defaultDocumentDetectorModelPath = "".concat(DEFAULT_CDN_URL, "/models/DocumentDetector/DocumentDetector-20241212_131026.tflite");
8342
+ var defaultDocumentDetectorModelPath = "".concat(DEFAULT_CDN_URL, "/models/DocumentDetector/DocumentDetector-20241018_093000.tflite");
8315
8343
 
8316
8344
  var defaultFocusModelPath = "".concat(DEFAULT_CDN_URL, "/models/Focus/Focus-20241008_102708.tflite");
8317
8345
 
@@ -8330,10 +8358,6 @@
8330
8358
  passport: {
8331
8359
  desktop: 0,
8332
8360
  mobile: 0.3
8333
- },
8334
- singlePage: {
8335
- desktop: 0,
8336
- mobile: 0.3
8337
8361
  }
8338
8362
  };
8339
8363
  var classifier = null;
@@ -8441,7 +8465,7 @@
8441
8465
  };
8442
8466
  }, [modelPath, modelLoadTimeoutMs, videoRef, shouldLoadModels]);
8443
8467
  React.useEffect(function handleModelError() {
8444
- modelError && (onModelError === null || onModelError === void 0 ? void 0 : onModelError(modelError));
8468
+ if (modelError) onModelError === null || onModelError === void 0 ? void 0 : onModelError(modelError);
8445
8469
  }, [modelError, onModelError]);
8446
8470
  return {
8447
8471
  ready: ready,
@@ -8587,7 +8611,7 @@
8587
8611
  };
8588
8612
  }, [modelLoadTimeoutMs, videoRef]);
8589
8613
  React.useEffect(function handleModelError() {
8590
- modelError && (onModelError === null || onModelError === void 0 ? void 0 : onModelError(modelError));
8614
+ if (modelError) onModelError === null || onModelError === void 0 ? void 0 : onModelError(modelError);
8591
8615
  }, [modelError, onModelError]);
8592
8616
  return {
8593
8617
  ready: ready,
@@ -8959,19 +8983,16 @@
8959
8983
  idCardFront: 0.6,
8960
8984
  idCardBack: 0.6,
8961
8985
  passport: 0.4,
8962
- singlePage: 0.4,
8963
8986
  stability: {
8964
8987
  idCardFront: 0.85,
8965
8988
  idCardBack: 0.85,
8966
- passport: 0.5,
8967
- singlePage: 0.5
8989
+ passport: 0.5
8968
8990
  }
8969
8991
  };
8970
8992
  var documentTypeDisplayNames = {
8971
8993
  idCardFront: 'ID card front',
8972
8994
  idCardBack: 'ID card back',
8973
8995
  passport: 'Passport',
8974
- singlePage: 'Single page',
8975
8996
  none: 'None'
8976
8997
  };
8977
8998
  var detector = null;
@@ -9086,7 +9107,7 @@
9086
9107
  };
9087
9108
  }, [shouldLoadModels, modelLoadTimeoutMs, modelPath, scoreThreshold, videoRef]);
9088
9109
  React.useEffect(function handleModelError() {
9089
- modelError && (onModelError === null || onModelError === void 0 ? void 0 : onModelError(modelError));
9110
+ if (modelError) onModelError === null || onModelError === void 0 ? void 0 : onModelError(modelError);
9090
9111
  }, [modelError, onModelError]);
9091
9112
  return {
9092
9113
  ready: ready,
@@ -9160,7 +9181,7 @@
9160
9181
  right: 20
9161
9182
  };
9162
9183
  function processDocumentDetectorPrediction(prediction, thresholds, boundaries) {
9163
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
9184
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
9164
9185
  if (boundaries === void 0) {
9165
9186
  boundaries = defaultDocumentDetectionBoundaries;
9166
9187
  }
@@ -9211,25 +9232,18 @@
9211
9232
  var bestPassportPage = detectedObjects.find(function (obj) {
9212
9233
  return obj.label === 'Passport page';
9213
9234
  });
9214
- var bestSinglePage = detectedObjects.find(function (obj) {
9215
- return obj.label === 'Single page';
9216
- });
9217
9235
  var idCardFrontDetectionScore = (_e = bestIdCardFront === null || bestIdCardFront === void 0 ? void 0 : bestIdCardFront.score) !== null && _e !== void 0 ? _e : 0;
9218
9236
  var idCardBackDetectionScore = (_f = bestIdCardBack === null || bestIdCardBack === void 0 ? void 0 : bestIdCardBack.score) !== null && _f !== void 0 ? _f : 0;
9219
9237
  var passportDetectionScore = (_g = bestPassportPage === null || bestPassportPage === void 0 ? void 0 : bestPassportPage.score) !== null && _g !== void 0 ? _g : 0;
9220
- var singlePageDetectionScore = (_h = bestSinglePage === null || bestSinglePage === void 0 ? void 0 : bestSinglePage.score) !== null && _h !== void 0 ? _h : 0;
9221
- var idCardFrontDetectionThresholdMet = idCardFrontDetectionScore >= ((_j = thresholds.idCardFront) !== null && _j !== void 0 ? _j : 0);
9222
- var idCardBackDetectionThresholdMet = idCardBackDetectionScore >= ((_k = thresholds.idCardBack) !== null && _k !== void 0 ? _k : 0);
9223
- var passportDetectionThresholdMet = passportDetectionScore >= ((_l = thresholds.passport) !== null && _l !== void 0 ? _l : 0);
9224
- var singlePageDetectionThresholdMet = singlePageDetectionScore >= ((_m = thresholds.singlePage) !== null && _m !== void 0 ? _m : 0);
9225
- var bestDocument = singlePageDetectionThresholdMet ? bestSinglePage : passportDetectionThresholdMet ? bestPassportPage : idCardBackDetectionThresholdMet ? bestIdCardBack : bestIdCardFront;
9226
- var detectionThreshold = singlePageDetectionThresholdMet ? thresholds.singlePage : passportDetectionThresholdMet ? thresholds.passport : idCardBackDetectionThresholdMet ? thresholds.idCardBack : thresholds.idCardFront;
9227
- var detectionScore = (_o = bestDocument === null || bestDocument === void 0 ? void 0 : bestDocument.score) !== null && _o !== void 0 ? _o : 0;
9238
+ var idCardFrontDetectionThresholdMet = idCardFrontDetectionScore >= ((_h = thresholds.idCardFront) !== null && _h !== void 0 ? _h : 0);
9239
+ var idCardBackDetectionThresholdMet = idCardBackDetectionScore >= ((_j = thresholds.idCardBack) !== null && _j !== void 0 ? _j : 0);
9240
+ var passportDetectionThresholdMet = passportDetectionScore >= ((_k = thresholds.passport) !== null && _k !== void 0 ? _k : 0);
9241
+ var bestDocument = passportDetectionThresholdMet ? bestPassportPage : idCardBackDetectionThresholdMet ? bestIdCardBack : bestIdCardFront;
9242
+ var detectionThreshold = passportDetectionThresholdMet ? thresholds.passport : idCardBackDetectionThresholdMet ? thresholds.idCardBack : thresholds.idCardFront;
9243
+ var detectionScore = (_l = bestDocument === null || bestDocument === void 0 ? void 0 : bestDocument.score) !== null && _l !== void 0 ? _l : 0;
9228
9244
  var detectionThresholdMet = detectionScore >= (detectionThreshold !== null && detectionThreshold !== void 0 ? detectionThreshold : 0);
9229
9245
  var detectedDocumentType = 'none';
9230
- if (singlePageDetectionThresholdMet) {
9231
- detectedDocumentType = 'singlePage';
9232
- } else if (passportDetectionThresholdMet) {
9246
+ if (passportDetectionThresholdMet) {
9233
9247
  detectedDocumentType = 'passport';
9234
9248
  } else if (idCardBackDetectionThresholdMet) {
9235
9249
  detectedDocumentType = 'idCardBack';
@@ -9243,12 +9257,12 @@
9243
9257
  var documentIsStable = false;
9244
9258
  var documentTooClose = false;
9245
9259
  if (bestDocument) {
9246
- var _q = [bestDocument.box.width / frameWidth, bestDocument.box.height / frameHeight],
9247
- docWidth = _q[0],
9248
- docHeight = _q[1];
9260
+ var _o = [bestDocument.box.width / frameWidth, bestDocument.box.height / frameHeight],
9261
+ docWidth = _o[0],
9262
+ docHeight = _o[1];
9249
9263
  documentTooClose = docWidth > 0.85 || docHeight > 0.85;
9250
9264
  if (detectionThresholdMet && documentInBounds && !documentTooClose) {
9251
- var thresholdSet = (_p = thresholds.stability) !== null && _p !== void 0 ? _p : defaultDocumentDetectionThresholds.stability;
9265
+ var thresholdSet = (_m = thresholds.stability) !== null && _m !== void 0 ? _m : defaultDocumentDetectionThresholds.stability;
9252
9266
  var threshold_1 = thresholdSet[detectedDocumentType];
9253
9267
  var framesNeeded = Math.ceil(average(framesNeededSamples));
9254
9268
  trackBox(bestDocument.box, framesNeeded);
@@ -9270,8 +9284,6 @@
9270
9284
  idCardBackDetectionThresholdMet: idCardBackDetectionThresholdMet,
9271
9285
  passportDetectionScore: passportDetectionScore,
9272
9286
  passportDetectionThresholdMet: passportDetectionThresholdMet,
9273
- singlePageDetectionScore: singlePageDetectionScore,
9274
- singlePageDetectionThresholdMet: singlePageDetectionThresholdMet,
9275
9287
  bestDocument: bestDocument,
9276
9288
  documentInBounds: documentInBounds,
9277
9289
  documentTooClose: documentTooClose,
@@ -9337,8 +9349,8 @@
9337
9349
  renderPrediction().then();
9338
9350
  return function () {
9339
9351
  loopId.current += 1;
9340
- frameId.current && cancelAnimationFrame(frameId.current);
9341
- timer && clearTimeout(timer);
9352
+ if (frameId.current) cancelAnimationFrame(frameId.current);
9353
+ if (timer) clearTimeout(timer);
9342
9354
  };
9343
9355
  }, [fn, running, throttleMs]);
9344
9356
  var start = React.useCallback(function () {
@@ -9557,7 +9569,7 @@
9557
9569
  },
9558
9570
  requestCameraAccess: function requestCameraAccess() {
9559
9571
  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;
9572
+ 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
9573
  var _b, _c, _d;
9562
9574
  return __generator(this, function (_e) {
9563
9575
  switch (_e.label) {
@@ -9677,13 +9689,13 @@
9677
9689
  debug('opened stream with no width and height constraints');
9678
9690
  return [3 /*break*/, 10];
9679
9691
  case 9:
9680
- _e.sent();
9681
- debug('cannot open stream at all');
9692
+ e_2 = _e.sent();
9693
+ debug('cannot open stream at all', e_2);
9682
9694
  return [3 /*break*/, 10];
9683
9695
  case 10:
9684
9696
  if (!stream_1) {
9685
9697
  error('failed to open camera');
9686
- throw new Error('failed to open camera');
9698
+ throw new Error('failed to open camera: ');
9687
9699
  }
9688
9700
  debug('camera access granted with constraints', constraints);
9689
9701
  handleStreamEnded_1 = function handleStreamEnded_1() {
@@ -9764,7 +9776,7 @@
9764
9776
  },
9765
9777
  requestMicrophoneAccess: function requestMicrophoneAccess() {
9766
9778
  return __awaiter(this, void 0, void 0, function () {
9767
- var stream_2;
9779
+ var stream_2, e_4;
9768
9780
  return __generator(this, function (_a) {
9769
9781
  switch (_a.label) {
9770
9782
  case 0:
@@ -9803,7 +9815,8 @@
9803
9815
  }, 500);
9804
9816
  return [3 /*break*/, 4];
9805
9817
  case 3:
9806
- _a.sent();
9818
+ e_4 = _a.sent();
9819
+ debug('failed to open microphone', e_4);
9807
9820
  set({
9808
9821
  microphoneAccessDenied: true
9809
9822
  });
@@ -10168,9 +10181,7 @@
10168
10181
  // @ts-ignore
10169
10182
  return navAny.userAgentData && navAny.userAgentData.mobile;
10170
10183
  }
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));
10184
+ 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
10185
  }
10175
10186
  return false;
10176
10187
  }
@@ -10219,39 +10230,37 @@
10219
10230
  });
10220
10231
  function IdCaptureModelsProviderInner(_a) {
10221
10232
  var children = _a.children,
10222
- onModelError = _a.onModelError,
10223
- _b = _a.allowSinglePageIdCapture,
10224
- allowSinglePageIdCapture = _b === void 0 ? false : _b;
10225
- var _c = React.useContext(DocumentDetectionModelContext),
10226
- documentDetectionModelReady = _c.documentDetectionModelReady,
10227
- documentDetectionModelDownloadProgress = _c.documentDetectionModelDownloadProgress,
10228
- startDocumentDetection = _c.startDocumentDetection,
10229
- stopDocumentDetection = _c.stopDocumentDetection,
10230
- lastPredictionCanvas = _c.documentDetectionLastPredictionCanvas,
10231
- clearDocumentDetectionLastPredictionCanvas = _c.clearDocumentDetectionLastPredictionCanvas,
10232
- onDocumentDetected = _c.onDocumentDetected,
10233
- detectionTime = _c.detectionTime,
10234
- documentDetectionThresholds = _c.documentDetectionThresholds,
10235
- setDocumentDetectionThresholds = _c.setDocumentDetectionThresholds,
10236
- documentDetectionBoundaries = _c.documentDetectionBoundaries,
10237
- setDocumentDetectionBoundaries = _c.setDocumentDetectionBoundaries,
10238
- documentDetectionModelError = _c.documentDetectionModelError;
10239
- var _d = React.useContext(FocusModelContext),
10240
- focusModelReady = _d.focusModelReady,
10241
- focusModelDownloadProgress = _d.focusModelDownloadProgress,
10242
- makeFocusPrediction = _d.makeFocusPrediction,
10243
- focusThresholds = _d.focusThresholds,
10244
- setFocusThresholds = _d.setFocusThresholds,
10245
- focusPredictionTime = _d.focusPredictionTime,
10246
- focusModelError = _d.focusModelError;
10233
+ onModelError = _a.onModelError;
10234
+ var _b = React.useContext(DocumentDetectionModelContext),
10235
+ documentDetectionModelReady = _b.documentDetectionModelReady,
10236
+ documentDetectionModelDownloadProgress = _b.documentDetectionModelDownloadProgress,
10237
+ startDocumentDetection = _b.startDocumentDetection,
10238
+ stopDocumentDetection = _b.stopDocumentDetection,
10239
+ lastPredictionCanvas = _b.documentDetectionLastPredictionCanvas,
10240
+ clearDocumentDetectionLastPredictionCanvas = _b.clearDocumentDetectionLastPredictionCanvas,
10241
+ onDocumentDetected = _b.onDocumentDetected,
10242
+ detectionTime = _b.detectionTime,
10243
+ documentDetectionThresholds = _b.documentDetectionThresholds,
10244
+ setDocumentDetectionThresholds = _b.setDocumentDetectionThresholds,
10245
+ documentDetectionBoundaries = _b.documentDetectionBoundaries,
10246
+ setDocumentDetectionBoundaries = _b.setDocumentDetectionBoundaries,
10247
+ documentDetectionModelError = _b.documentDetectionModelError;
10248
+ var _c = React.useContext(FocusModelContext),
10249
+ focusModelReady = _c.focusModelReady,
10250
+ focusModelDownloadProgress = _c.focusModelDownloadProgress,
10251
+ makeFocusPrediction = _c.makeFocusPrediction,
10252
+ focusThresholds = _c.focusThresholds,
10253
+ setFocusThresholds = _c.setFocusThresholds,
10254
+ focusPredictionTime = _c.focusPredictionTime,
10255
+ focusModelError = _c.focusModelError;
10247
10256
  var onPredictionHandler = React.useRef();
10248
10257
  var bestFrameDetails = React.useRef(null);
10249
10258
  var bestPredictionCanvas = React.useRef(null);
10250
10259
  var bestFocusScore = React.useRef(0);
10251
10260
  var stopDetection = React.useRef(0);
10252
- var _e = React.useState('none'),
10253
- requiredDocumentType = _e[0],
10254
- setRequiredDocumentType = _e[1];
10261
+ var _d = React.useState('none'),
10262
+ requiredDocumentType = _d[0],
10263
+ setRequiredDocumentType = _d[1];
10255
10264
  var thresholds = React.useMemo(function () {
10256
10265
  return _assign(_assign({}, documentDetectionThresholds), {
10257
10266
  focus: focusThresholds
@@ -10269,42 +10278,34 @@
10269
10278
  var _this = this;
10270
10279
  onDocumentDetected(function (prediction) {
10271
10280
  return __awaiter(_this, void 0, void 0, function () {
10272
- var stopDetectionAtStart, focusPredictionTime, focusScore, focusThresholdMet, isSinglePage, isRequiredDocumentType, focusPrediction, focusThresholdSet, focusThreshold;
10273
- var _a, _b, _c, _d, _e, _f, _g;
10274
- return __generator(this, function (_h) {
10281
+ var stopDetectionAtStart, focusPredictionTime, focusScore, focusThresholdMet, isRequiredDocumentType, focusPrediction, focusThresholdSet, focusThreshold;
10282
+ var _a, _b, _c, _d, _e, _f;
10283
+ return __generator(this, function (_g) {
10275
10284
  if (!lastPredictionCanvas.current) return [2 /*return*/];
10276
10285
  stopDetectionAtStart = stopDetection.current;
10277
10286
  focusPredictionTime = 0, focusScore = 0, focusThresholdMet = false;
10278
- isSinglePage = prediction.detectedDocumentType === 'singlePage';
10279
- if (!allowSinglePageIdCapture && isSinglePage) {
10280
- prediction.detectedDocumentType = 'passport';
10281
- prediction.passportDetectionScore = prediction.singlePageDetectionScore;
10282
- prediction.passportDetectionThresholdMet = prediction.singlePageDetectionThresholdMet;
10283
- prediction.singlePageDetectionScore = 0;
10284
- prediction.singlePageDetectionThresholdMet = false;
10285
- }
10286
- isRequiredDocumentType = requiredDocumentType === 'none' || prediction.detectedDocumentType === requiredDocumentType || ((_a = requiredDocumentType.includes) === null || _a === void 0 ? void 0 : _a.call(requiredDocumentType, prediction.detectedDocumentType)) || allowSinglePageIdCapture && isSinglePage && ((_b = requiredDocumentType.includes) === null || _b === void 0 ? void 0 : _b.call(requiredDocumentType, 'idCardFront'));
10287
+ isRequiredDocumentType = requiredDocumentType === 'none' || prediction.detectedDocumentType === requiredDocumentType || ((_a = requiredDocumentType.includes) === null || _a === void 0 ? void 0 : _a.call(requiredDocumentType, prediction.detectedDocumentType));
10287
10288
  if (isRequiredDocumentType && prediction.detectedDocumentType !== 'none' && prediction.detectionThresholdMet && prediction.documentInBounds && !prediction.documentTooClose && prediction.documentIsStable) {
10288
- focusPrediction = makeFocusPrediction(lastPredictionCanvas.current, (_c = prediction.bestDocument) === null || _c === void 0 ? void 0 : _c.box);
10289
+ focusPrediction = makeFocusPrediction(lastPredictionCanvas.current, (_b = prediction.bestDocument) === null || _b === void 0 ? void 0 : _b.box);
10289
10290
  if (focusPrediction) {
10290
10291
  focusScore = focusPrediction.score;
10291
10292
  focusPredictionTime = focusPrediction.predictionTime;
10292
10293
  }
10293
- focusThresholdSet = (_d = thresholds.focus) === null || _d === void 0 ? void 0 : _d[prediction.detectedDocumentType];
10294
- focusThreshold = (_e = onMobile ? focusThresholdSet === null || focusThresholdSet === void 0 ? void 0 : focusThresholdSet.mobile : focusThresholdSet === null || focusThresholdSet === void 0 ? void 0 : focusThresholdSet.desktop) !== null && _e !== void 0 ? _e : 0;
10294
+ focusThresholdSet = (_c = thresholds.focus) === null || _c === void 0 ? void 0 : _c[prediction.detectedDocumentType];
10295
+ focusThreshold = (_d = onMobile ? focusThresholdSet === null || focusThresholdSet === void 0 ? void 0 : focusThresholdSet.mobile : focusThresholdSet === null || focusThresholdSet === void 0 ? void 0 : focusThresholdSet.desktop) !== null && _d !== void 0 ? _d : 0;
10295
10296
  focusThresholdMet = focusScore >= focusThreshold;
10296
10297
  if (bestFocusScore.current <= focusScore && stopDetectionAtStart === stopDetection.current) {
10297
10298
  bestFocusScore.current = focusScore;
10298
10299
  drawToCanvas(bestPredictionCanvas.current, lastPredictionCanvas.current);
10299
10300
  bestFrameDetails.current = {
10300
- boundingBox: (_f = prediction.bestDocument) === null || _f === void 0 ? void 0 : _f.box,
10301
+ boundingBox: (_e = prediction.bestDocument) === null || _e === void 0 ? void 0 : _e.box,
10301
10302
  documentType: prediction.detectedDocumentType,
10302
10303
  detectionScore: prediction.detectionScore,
10303
10304
  focusScore: focusScore
10304
10305
  };
10305
10306
  }
10306
10307
  }
10307
- (_g = onPredictionHandler.current) === null || _g === void 0 ? void 0 : _g.call(onPredictionHandler, _assign(_assign({}, prediction), {
10308
+ (_f = onPredictionHandler.current) === null || _f === void 0 ? void 0 : _f.call(onPredictionHandler, _assign(_assign({}, prediction), {
10308
10309
  focusScore: focusScore,
10309
10310
  focusPredictionTime: focusPredictionTime,
10310
10311
  focusThresholdMet: focusThresholdMet
@@ -10313,10 +10314,10 @@
10313
10314
  });
10314
10315
  });
10315
10316
  });
10316
- }, [allowSinglePageIdCapture, lastPredictionCanvas, makeFocusPrediction, onDocumentDetected, requiredDocumentType, thresholds.focus]);
10317
+ }, [lastPredictionCanvas, makeFocusPrediction, onDocumentDetected, requiredDocumentType, thresholds.focus]);
10317
10318
  var modelError = documentDetectionModelError !== null && documentDetectionModelError !== void 0 ? documentDetectionModelError : focusModelError;
10318
10319
  React.useEffect(function handleModelErrors() {
10319
- modelError && (onModelError === null || onModelError === void 0 ? void 0 : onModelError(modelError));
10320
+ if (modelError) onModelError === null || onModelError === void 0 ? void 0 : onModelError(modelError);
10320
10321
  }, [modelError, onModelError]);
10321
10322
  var onPredictionMade = React.useCallback(function (handler) {
10322
10323
  onPredictionHandler.current = handler;
@@ -10327,9 +10328,9 @@
10327
10328
  canvas: bestPredictionCanvas.current
10328
10329
  });
10329
10330
  }, []);
10330
- var _f = React.useState(0),
10331
- canvasKey = _f[0],
10332
- setCanvasKey = _f[1];
10331
+ var _e = React.useState(0),
10332
+ canvasKey = _e[0],
10333
+ setCanvasKey = _e[1];
10333
10334
  var resetBestFrame = React.useCallback(function () {
10334
10335
  stopDetection.current += 1;
10335
10336
  setCanvasKey(function (n) {
@@ -10340,7 +10341,7 @@
10340
10341
  bestFocusScore.current = 0;
10341
10342
  }, [clearDocumentDetectionLastPredictionCanvas]);
10342
10343
  React.useEffect(function () {
10343
- requiredDocumentType && resetBestFrame();
10344
+ if (requiredDocumentType) resetBestFrame();
10344
10345
  }, [requiredDocumentType, resetBestFrame]);
10345
10346
  var value = React.useMemo(function () {
10346
10347
  return {
@@ -10459,9 +10460,9 @@
10459
10460
  });
10460
10461
  }
10461
10462
 
10462
- var CapturedDocumentTypeValues = ['idCardFront', 'idCardBack', 'passport', 'singlePage', 'selfie'];
10463
+ var CapturedDocumentTypeValues = ['idCardFront', 'idCardBack', 'passport', 'selfie'];
10463
10464
 
10464
- var acceptedDocumentTypesForIdCaptureRequirementOption = {
10465
+ var requiredDocumentsForOption = {
10465
10466
  idCardFront: ['idCardFront'],
10466
10467
  idCardBack: ['idCardBack'],
10467
10468
  passport: ['passport'],
@@ -10469,35 +10470,13 @@
10469
10470
  idCardAndPassport: ['idCardFront', 'idCardBack', 'passport'],
10470
10471
  idCardOrPassport: ['idCardFront', 'idCardBack', 'passport'] // this one is so weird
10471
10472
  };
10472
- function minImageCountForIdCaptureRequirementOption(idCaptureRequirement) {
10473
+ function requiredImageCountForOption(idCaptureRequirement) {
10473
10474
  if (idCaptureRequirement === 'idCardOrPassport') return 1;
10474
- return acceptedDocumentTypesForIdCaptureRequirementOption[idCaptureRequirement].length;
10475
+ return requiredDocumentsForOption[idCaptureRequirement].length;
10475
10476
  }
10476
- function maxImageCountForIdCaptureRequirementOption(idCaptureRequirement) {
10477
+ function allowedImageCountForOption(idCaptureRequirement) {
10477
10478
  if (idCaptureRequirement === 'idCardOrPassport') return 2;
10478
- return minImageCountForIdCaptureRequirementOption(idCaptureRequirement);
10479
- }
10480
- function remainingIdCaptureRequirements(captureRequirement, capturedDocuments, requestedDocumentType) {
10481
- var isIdCardOrPassport = captureRequirement === 'idCardOrPassport';
10482
- if (isIdCardOrPassport && requestedDocumentType === 'passport') return [];
10483
- var acceptedTypes = acceptedDocumentTypesForIdCaptureRequirementOption[captureRequirement];
10484
- console.log({
10485
- capturedDocuments: capturedDocuments,
10486
- captureRequirement: captureRequirement
10487
- });
10488
- if (captureRequirement.includes('idCard') && 'singlePage' in capturedDocuments) {
10489
- acceptedTypes = acceptedTypes.filter(function (v) {
10490
- return !v.includes('idCard');
10491
- });
10492
- }
10493
- if (isIdCardOrPassport) {
10494
- acceptedTypes = acceptedTypes.filter(function (v) {
10495
- return v !== 'passport';
10496
- });
10497
- }
10498
- return acceptedTypes.filter(function (v) {
10499
- return !(v in capturedDocuments);
10500
- });
10479
+ return requiredImageCountForOption(idCaptureRequirement);
10501
10480
  }
10502
10481
 
10503
10482
  var initialState$4 = {
@@ -10536,8 +10515,6 @@
10536
10515
  idCardBackDetectionThresholdMet: false,
10537
10516
  passportDetectionScore: 0,
10538
10517
  passportDetectionThresholdMet: false,
10539
- singlePageDetectionScore: 0,
10540
- singlePageDetectionThresholdMet: false,
10541
10518
  focusScore: 0,
10542
10519
  focusThresholdMet: false,
10543
10520
  isGoodFrame: false,
@@ -10553,7 +10530,6 @@
10553
10530
  capturedDocuments: {},
10554
10531
  captureRequirement: 'idCardOrPassport',
10555
10532
  requestedDocumentType: 'idCardFront',
10556
- allowSinglePageIdCapture: false,
10557
10533
  allowIdCardBackToFrontCapture: false,
10558
10534
  operationStartedAt: null,
10559
10535
  captureStartedAt: null
@@ -10568,13 +10544,11 @@
10568
10544
  var _c = action.payload,
10569
10545
  captureRequirement = _c.captureRequirement,
10570
10546
  precapturedDocuments = _c.precapturedDocuments,
10571
- allowSinglePageIdCapture = _c.allowSinglePageIdCapture,
10572
10547
  allowIdCardBackToFrontCapture = _c.allowIdCardBackToFrontCapture,
10573
10548
  enableOverrideWrongDocumentTypeDialog = _c.enableOverrideWrongDocumentTypeDialog,
10574
10549
  allowOverrideWrongDocumentTypeAfterMs = _c.allowOverrideWrongDocumentTypeAfterMs;
10575
10550
  var newState = _assign(_assign({}, state), {
10576
10551
  captureRequirement: captureRequirement,
10577
- allowSinglePageIdCapture: allowSinglePageIdCapture !== null && allowSinglePageIdCapture !== void 0 ? allowSinglePageIdCapture : false,
10578
10552
  allowIdCardBackToFrontCapture: allowIdCardBackToFrontCapture !== null && allowIdCardBackToFrontCapture !== void 0 ? allowIdCardBackToFrontCapture : false,
10579
10553
  enableOverrideWrongDocumentTypeDialog: enableOverrideWrongDocumentTypeDialog,
10580
10554
  allowOverrideWrongDocumentTypeAfterMs: allowOverrideWrongDocumentTypeAfterMs
@@ -10642,8 +10616,6 @@
10642
10616
  idCardBackDetectionThresholdMet = _d.idCardBackDetectionThresholdMet,
10643
10617
  passportDetectionScore = _d.passportDetectionScore,
10644
10618
  passportDetectionThresholdMet = _d.passportDetectionThresholdMet,
10645
- singlePageDetectionScore = _d.singlePageDetectionScore,
10646
- singlePageDetectionThresholdMet = _d.singlePageDetectionThresholdMet,
10647
10619
  bestDocument = _d.bestDocument,
10648
10620
  documentInBounds = _d.documentInBounds,
10649
10621
  documentTooClose = _d.documentTooClose,
@@ -10664,8 +10636,7 @@
10664
10636
  }
10665
10637
  }
10666
10638
  }
10667
- var idCardDetected = detectedDocumentType.includes('idCard') || detectedDocumentType === 'singlePage';
10668
- var idCardDetectedButNotAllowed = idCardDetected && !state.captureRequirement.includes('idCard');
10639
+ var idCardDetectedButNotAllowed = detectedDocumentType.includes('idCard') && !state.captureRequirement.includes('idCard');
10669
10640
  var passportNotAllowed = !state.captureRequirement.toLowerCase().includes('passport');
10670
10641
  var idCardFrontWasCaptured = 'idCardFront' in state.capturedDocuments;
10671
10642
  var idCardBackWasCaptured = 'idCardBack' in state.capturedDocuments;
@@ -10725,8 +10696,6 @@
10725
10696
  idCardBackDetectionThresholdMet: idCardBackDetectionThresholdMet,
10726
10697
  passportDetectionScore: passportDetectionScore,
10727
10698
  passportDetectionThresholdMet: passportDetectionThresholdMet,
10728
- singlePageDetectionScore: singlePageDetectionScore,
10729
- singlePageDetectionThresholdMet: singlePageDetectionThresholdMet,
10730
10699
  focusScore: focusScore,
10731
10700
  focusThresholdMet: focusThresholdMet,
10732
10701
  isGoodFrame: isGoodFrame,
@@ -10764,7 +10733,7 @@
10764
10733
  });
10765
10734
  case 'documentCaptured':
10766
10735
  {
10767
- var newState = _assign(_assign({}, state), {
10736
+ var newState_1 = _assign(_assign({}, state), {
10768
10737
  capturing: false,
10769
10738
  captureFailed: false,
10770
10739
  allowOverrideFlipRequirement: false,
@@ -10773,42 +10742,64 @@
10773
10742
  wrongDocumentTypePredictions: 0,
10774
10743
  capturedDocuments: _assign(_assign({}, state.capturedDocuments), (_a = {}, _a[action.payload.documentType] = action.payload, _a))
10775
10744
  });
10776
- var remainingRequirements = remainingIdCaptureRequirements(state.captureRequirement, newState.capturedDocuments, state.requestedDocumentType);
10745
+ var remainingRequirements = requiredDocumentsForOption[state.captureRequirement].filter(function (v) {
10746
+ return !(v in newState_1.capturedDocuments);
10747
+ });
10748
+ if (state.captureRequirement === 'idCardOrPassport') {
10749
+ if (state.requestedDocumentType === 'passport') {
10750
+ remainingRequirements = [];
10751
+ } else {
10752
+ remainingRequirements = remainingRequirements.filter(function (v) {
10753
+ return v !== 'passport';
10754
+ });
10755
+ }
10756
+ }
10777
10757
  if (remainingRequirements.length === 0) {
10778
- newState.captureState = 'complete';
10758
+ newState_1.captureState = 'complete';
10779
10759
  } else {
10780
- newState.requestedDocumentType = remainingRequirements[0];
10781
- if (state.requestedDocumentType === 'idCardFront' && newState.requestedDocumentType === 'idCardBack' || state.requestedDocumentType === 'idCardBack' && newState.requestedDocumentType === 'idCardFront') {
10782
- newState.captureState = 'requestingFlip';
10783
- newState.idCardFrontDetectionThresholdMet = false;
10784
- newState.idCardBackDetectionThresholdMet = false;
10785
- newState.passportDetectionThresholdMet = false;
10786
- newState.wrongDocumentTypePredictions = 0;
10760
+ newState_1.requestedDocumentType = remainingRequirements[0];
10761
+ if (state.requestedDocumentType === 'idCardFront' && newState_1.requestedDocumentType === 'idCardBack' || state.requestedDocumentType === 'idCardBack' && newState_1.requestedDocumentType === 'idCardFront') {
10762
+ newState_1.captureState = 'requestingFlip';
10763
+ newState_1.idCardFrontDetectionThresholdMet = false;
10764
+ newState_1.idCardBackDetectionThresholdMet = false;
10765
+ newState_1.passportDetectionThresholdMet = false;
10766
+ newState_1.wrongDocumentTypePredictions = 0;
10787
10767
  }
10788
10768
  }
10789
- return newState;
10769
+ return newState_1;
10790
10770
  }
10791
10771
  case 'documentCapturedManually':
10792
10772
  {
10793
- var newState = _assign(_assign({}, state), {
10773
+ var newState_2 = _assign(_assign({}, state), {
10794
10774
  capturedDocuments: _assign(_assign({}, state.capturedDocuments), (_b = {}, _b[state.requestedDocumentType] = _assign(_assign({}, action.payload), {
10795
10775
  width: 0,
10796
10776
  height: 0
10797
10777
  }), _b))
10798
10778
  });
10799
- var remainingRequirements = remainingIdCaptureRequirements(state.captureRequirement, newState.capturedDocuments, state.requestedDocumentType);
10779
+ var remainingRequirements = requiredDocumentsForOption[state.captureRequirement].filter(function (v) {
10780
+ return !(v in newState_2.capturedDocuments);
10781
+ });
10782
+ if (state.captureRequirement === 'idCardOrPassport') {
10783
+ if (state.requestedDocumentType === 'passport') {
10784
+ remainingRequirements = [];
10785
+ } else {
10786
+ remainingRequirements = remainingRequirements.filter(function (v) {
10787
+ return v !== 'passport';
10788
+ });
10789
+ }
10790
+ }
10800
10791
  if (remainingRequirements.length === 0) {
10801
- newState.captureState = 'complete';
10792
+ newState_2.captureState = 'complete';
10802
10793
  } else {
10803
- newState.requestedDocumentType = remainingRequirements[0];
10804
- if (state.requestedDocumentType === 'idCardFront' && newState.requestedDocumentType === 'idCardBack' || state.requestedDocumentType === 'idCardBack' && newState.requestedDocumentType === 'idCardFront') {
10805
- newState.captureState = 'requestingFlip';
10806
- newState.idCardFrontDetectionThresholdMet = false;
10807
- newState.idCardBackDetectionThresholdMet = false;
10808
- newState.passportDetectionThresholdMet = false;
10794
+ newState_2.requestedDocumentType = remainingRequirements[0];
10795
+ if (state.requestedDocumentType === 'idCardFront' && newState_2.requestedDocumentType === 'idCardBack' || state.requestedDocumentType === 'idCardBack' && newState_2.requestedDocumentType === 'idCardFront') {
10796
+ newState_2.captureState = 'requestingFlip';
10797
+ newState_2.idCardFrontDetectionThresholdMet = false;
10798
+ newState_2.idCardBackDetectionThresholdMet = false;
10799
+ newState_2.passportDetectionThresholdMet = false;
10809
10800
  }
10810
10801
  }
10811
- return newState;
10802
+ return newState_2;
10812
10803
  }
10813
10804
  case 'flipRequestCompleted':
10814
10805
  return _assign(_assign({}, state), {
@@ -14199,7 +14190,7 @@
14199
14190
  imageUrl: imageUrl
14200
14191
  }
14201
14192
  });
14202
- var capturedDocumentType = documentType;
14193
+ var capturedDocumentType = documentType === 'passport' ? 'passport' : state.requestedDocumentType;
14203
14194
  setTimeout(function () {
14204
14195
  var _a;
14205
14196
  var captureTime = new Date().getTime() - ((_a = state.captureStartedAt) !== null && _a !== void 0 ? _a : new Date()).getTime();
@@ -14266,7 +14257,7 @@
14266
14257
  scaling: debugScalingDetails,
14267
14258
  flipX: !isRearFacing
14268
14259
  });
14269
- }))), debugMode && ( /*#__PURE__*/React.createElement(DebugStatsPane, null, camera ? ( /*#__PURE__*/React.createElement(React.Fragment, null, "\u2705 Camera: ", camera.label, " (", camera.width, "x", camera.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React.createElement("br", null), state.frameCaptureRate > 0.75 ? '✅' : '👎', " Frame Rate:", ' ', Math.round((state.frameCaptureRate + Number.EPSILON) * 1000) / 1000, ' ', "fps (", detectionTime, "ms doc detect, ", focusPredictionTime, "ms focus)", /*#__PURE__*/React.createElement("br", null), modelsReady ? ( /*#__PURE__*/React.createElement(React.Fragment, null, state.detectionThresholdMet ? '✅' : '❌', " Detected Document Type: ", state.detectedDocumentType, /*#__PURE__*/React.createElement("br", null), state.idCardFrontDetectionThresholdMet ? '✅' : '❌', " ID Card Front Score: ", state.idCardFrontDetectionScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.idCardBackDetectionThresholdMet ? '✅' : '❌', " ID Card Back Score: ", state.idCardBackDetectionScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.passportDetectionThresholdMet ? '✅' : '❌', " Passport Score: ", state.passportDetectionScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.singlePageDetectionThresholdMet ? '✅' : '❌', " Single Page Score: ", state.singlePageDetectionScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.focusThresholdMet ? '✅' : '❌', " Focus Score:", ' ', state.focusScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.documentInBounds ? '✅' : '❌', " Document In Bounds", /*#__PURE__*/React.createElement("br", null), state.documentIsStable ? '✅' : '❌', " Document Is Stable", /*#__PURE__*/React.createElement("br", null), state.goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', state.goodFramesCount, "/", state.goodFramesThreshold)) : ( /*#__PURE__*/React.createElement(React.Fragment, null, "\u274C Models not ready")))));
14260
+ }))), debugMode && ( /*#__PURE__*/React.createElement(DebugStatsPane, null, camera ? ( /*#__PURE__*/React.createElement(React.Fragment, null, "\u2705 Camera: ", camera.label, " (", camera.width, "x", camera.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React.createElement("br", null), state.frameCaptureRate > 0.75 ? '✅' : '👎', " Frame Rate:", ' ', Math.round((state.frameCaptureRate + Number.EPSILON) * 1000) / 1000, ' ', "fps (", detectionTime, "ms doc detect, ", focusPredictionTime, "ms focus)", /*#__PURE__*/React.createElement("br", null), modelsReady ? ( /*#__PURE__*/React.createElement(React.Fragment, null, state.detectionThresholdMet ? '✅' : '❌', " Detected Document Type: ", state.detectedDocumentType, /*#__PURE__*/React.createElement("br", null), state.idCardFrontDetectionThresholdMet ? '✅' : '❌', " ID Card Front Score: ", state.idCardFrontDetectionScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.idCardBackDetectionThresholdMet ? '✅' : '❌', " ID Card Back Score: ", state.idCardBackDetectionScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.passportDetectionThresholdMet ? '✅' : '❌', " Passport Score: ", state.passportDetectionScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.focusThresholdMet ? '✅' : '❌', " Focus Score:", ' ', state.focusScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.documentInBounds ? '✅' : '❌', " Document In Bounds", /*#__PURE__*/React.createElement("br", null), state.documentIsStable ? '✅' : '❌', " Document Is Stable", /*#__PURE__*/React.createElement("br", null), state.goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', state.goodFramesCount, "/", state.goodFramesThreshold)) : ( /*#__PURE__*/React.createElement(React.Fragment, null, "\u274C Models not ready")))));
14270
14261
  };
14271
14262
  var timeSince = function timeSince(t) {
14272
14263
  if (!t) return 0;
@@ -15379,8 +15370,15 @@
15379
15370
  _e = _a.debugMode,
15380
15371
  debugMode = _e === void 0 ? false : _e;
15381
15372
  var submissionStatus = React.useContext(SubmissionContext).submissionStatus;
15373
+ var idCardFront = capturedDocuments.idCardFront,
15374
+ idCardBack = capturedDocuments.idCardBack,
15375
+ passport = capturedDocuments.passport;
15382
15376
  var verbiage = useTranslations(rawVerbiage, {
15383
15377
  headingText: 'ID Capture Successful',
15378
+ idCardFrontText: 'ID Card Front',
15379
+ idCardBackText: 'ID Card Back',
15380
+ passportText: 'Passport',
15381
+ instructionText: 'Verify the entire ID was captured clearly with no glare.',
15384
15382
  retryText: 'Retry',
15385
15383
  submittingText: 'Submitting...',
15386
15384
  submitText: 'Done'
@@ -15397,16 +15395,25 @@
15397
15395
  className: classNames.imageContainer
15398
15396
  }, /*#__PURE__*/React.createElement(ImageRow, {
15399
15397
  className: classNames.imageRow
15400
- }, Object.values(capturedDocuments).map(function (doc) {
15401
- return /*#__PURE__*/React.createElement(ImageCol$1, {
15402
- className: classNames.imageCol,
15403
- key: doc.imageData
15404
- }, /*#__PURE__*/React.createElement(StyledImage, {
15405
- image: doc,
15406
- className: classNames.image,
15407
- alt: doc.documentType
15408
- }), debugMode && ( /*#__PURE__*/React.createElement(DebugPre, null, "Document Type: ".concat(doc.documentType, "\nDetection Score: ").concat(doc.detectionScore, "\nFocus Score: ").concat(doc.focusScore, "\nBounding Box: ").concat(JSON.stringify(doc.boundingBox)))));
15409
- }))), /*#__PURE__*/React.createElement(ButtonsColumn, {
15398
+ }, idCardFront && ( /*#__PURE__*/React.createElement(ImageCol$1, {
15399
+ className: classNames.imageCol
15400
+ }, /*#__PURE__*/React.createElement(StyledImage, {
15401
+ image: idCardFront,
15402
+ className: classNames.image,
15403
+ alt: verbiage.idCardFrontText
15404
+ }), debugMode && ( /*#__PURE__*/React.createElement(DebugPre, null, "Detection Score: ".concat(idCardFront.detectionScore, "\nFocus Score: ").concat(idCardFront.focusScore, "\nBounding Box: ").concat(JSON.stringify(idCardFront.boundingBox)))))), idCardBack && ( /*#__PURE__*/React.createElement(ImageCol$1, {
15405
+ className: classNames.imageCol
15406
+ }, /*#__PURE__*/React.createElement(StyledImage, {
15407
+ image: idCardBack,
15408
+ className: classNames.image,
15409
+ alt: verbiage.idCardBackText
15410
+ }), debugMode && ( /*#__PURE__*/React.createElement(DebugPre, null, "Detection Score: ".concat(idCardBack.detectionScore, "\nFocus Score: ").concat(idCardBack.focusScore, "\nBounding Box: ").concat(JSON.stringify(idCardBack.boundingBox)))))), passport && ( /*#__PURE__*/React.createElement(ImageCol$1, {
15411
+ className: classNames.imageCol
15412
+ }, /*#__PURE__*/React.createElement(StyledImage, {
15413
+ image: passport,
15414
+ className: classNames.image,
15415
+ alt: verbiage.passportText
15416
+ }), debugMode && ( /*#__PURE__*/React.createElement(DebugPre, null, "Detection Score: ".concat(passport.detectionScore, "\nFocus Score: ").concat(passport.focusScore, "\nBounding Box: ").concat(JSON.stringify(passport.boundingBox)))))))), /*#__PURE__*/React.createElement(ButtonsColumn, {
15410
15417
  className: classNames.buttonsRow
15411
15418
  }, /*#__PURE__*/React.createElement(WideButton, {
15412
15419
  className: classNames.submitBtn,
@@ -15425,7 +15432,7 @@
15425
15432
  };
15426
15433
  var Heading$a = styled.h1(templateObject_1$v || (templateObject_1$v = __makeTemplateObject(["\n font-size: 1.5rem;\n margin-top: 0;\n margin-bottom: 1.5rem;\n"], ["\n font-size: 1.5rem;\n margin-top: 0;\n margin-bottom: 1.5rem;\n"])));
15427
15434
  var ImagesContainer = styled(OverlayImageContainer)(templateObject_2$q || (templateObject_2$q = __makeTemplateObject(["\n flex-grow: 1;\n overflow-y: auto;\n padding-bottom: 0;\n max-width: 100%;\n"], ["\n flex-grow: 1;\n overflow-y: auto;\n padding-bottom: 0;\n max-width: 100%;\n"])));
15428
- var ImageRow = styled(OverlayImageRow)(templateObject_3$k || (templateObject_3$k = __makeTemplateObject(["\n max-width: 100%;\n flex-direction: column;\n display: grid;\n grid-gap: 12px;\n"], ["\n max-width: 100%;\n flex-direction: column;\n display: grid;\n grid-gap: 12px;\n"])));
15435
+ var ImageRow = styled(OverlayImageRow)(templateObject_3$k || (templateObject_3$k = __makeTemplateObject(["\n max-width: 100%;\n flex-direction: column;\n display: grid;\n grid-gap: 12px;\n //grid-template-columns: 1fr 1fr;\n"], ["\n max-width: 100%;\n flex-direction: column;\n display: grid;\n grid-gap: 12px;\n //grid-template-columns: 1fr 1fr;\n"])));
15429
15436
  var ImageCol$1 = styled.div(templateObject_4$e || (templateObject_4$e = __makeTemplateObject(["\n width: 100%;\n max-height: none !important;\n"], ["\n width: 100%;\n max-height: none !important;\n"])));
15430
15437
  var StyledImage = styled(CapturedDocumentImg)(templateObject_5$9 || (templateObject_5$9 = __makeTemplateObject(["\n width: 100%;\n border-radius: 12px;\n"], ["\n width: 100%;\n border-radius: 12px;\n"])));
15431
15438
  var DebugPre = styled.pre(templateObject_6$7 || (templateObject_6$7 = __makeTemplateObject(["\n text-align: left;\n max-width: min(450px, 100dvw - 100px);\n overflow-x: auto;\n"], ["\n text-align: left;\n max-width: min(450px, 100dvw - 100px);\n overflow-x: auto;\n"])));
@@ -16009,7 +16016,7 @@
16009
16016
  });
16010
16017
  }, [setDimensions, wrapperHeight, wrapperWidth]);
16011
16018
  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;
16019
+ var paddingAndBorderPx = padding * 2 + (borderWidth !== null && borderWidth !== void 0 ? borderWidth : 0) * 2;
16013
16020
  var images = useImagesWithBackToFront(userSuppliedImages, isBackToFront);
16014
16021
  var imagesByUrl = useGuideImagesByUrl(images);
16015
16022
  var orientation = getOrientation(portraitGuidesOnMobile);
@@ -16056,7 +16063,7 @@
16056
16063
  "$isMirrored": isMirrored,
16057
16064
  className: classNames.centerRegion
16058
16065
  }, /*#__PURE__*/React.createElement(GuideCenterBorder, {
16059
- "$borderWidth": borderWidth,
16066
+ "$borderWidth": borderWidth !== null && borderWidth !== void 0 ? borderWidth : 0,
16060
16067
  "$borderColor": borderColor,
16061
16068
  "$padding": imagePadding,
16062
16069
  className: classNames.centerRegionBorder
@@ -16256,7 +16263,7 @@
16256
16263
  }, [aspectRatio, borderColor, borderRadius, borderWidth, dispatch, maskColor, padding, redrawing, wrapperHeight, wrapperWidth]);
16257
16264
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CanvasWrapper$1, {
16258
16265
  ref: wrapperRef,
16259
- "$maskColor": maskColor,
16266
+ "$maskColor": maskColor !== null && maskColor !== void 0 ? maskColor : '',
16260
16267
  className: classNames.canvasWrapper
16261
16268
  }, /*#__PURE__*/React.createElement(Canvas$1, {
16262
16269
  ref: canvasRef,
@@ -16551,7 +16558,7 @@
16551
16558
  var uploadDocument = React.useContext(SubmissionContext).uploadDocument;
16552
16559
  var uploadCapturedDocument = React.useCallback(function (content, filetype) {
16553
16560
  return __awaiter(void 0, void 0, void 0, function () {
16554
- var documentId_1;
16561
+ var documentId_1, e_1;
16555
16562
  return __generator(this, function (_a) {
16556
16563
  switch (_a.label) {
16557
16564
  case 0:
@@ -16574,7 +16581,8 @@
16574
16581
  }, 0);
16575
16582
  return [3 /*break*/, 3];
16576
16583
  case 2:
16577
- _a.sent();
16584
+ e_1 = _a.sent();
16585
+ debug('upload failed', e_1);
16578
16586
  dispatch({
16579
16587
  type: 'uploadFailed'
16580
16588
  });
@@ -16609,7 +16617,7 @@
16609
16617
  resolvedDocuments.forEach(function (d) {
16610
16618
  if (d.content) {
16611
16619
  d.contentUrl || (d.contentUrl = URL.createObjectURL(d.content));
16612
- uploadCapturedDocument(d.content, d.content.type);
16620
+ void uploadCapturedDocument(d.content, d.content.type);
16613
16621
  }
16614
16622
  });
16615
16623
  }, [aspectRatio, cameraFeedMode, documents, instructions, uploadCapturedDocument]);
@@ -16807,6 +16815,7 @@
16807
16815
  React.useEffect(function attachCameraStreamToVideoTagWhenReady() {
16808
16816
  if (videoRef.current && videoStream) {
16809
16817
  debug('attaching camera stream to video tag');
16818
+ // eslint-disable-next-line react-compiler/react-compiler
16810
16819
  videoRef.current.srcObject = videoStream;
16811
16820
  }
16812
16821
  }, [videoStream, videoRef]);
@@ -17133,8 +17142,8 @@
17133
17142
  var _j = React.useState(silentFallback),
17134
17143
  useFallback = _j[0],
17135
17144
  setUseFallback = _j[1];
17136
- var minImageCount = minImageCountForIdCaptureRequirementOption(idCaptureRequirement);
17137
- var maxImageCount = maxImageCountForIdCaptureRequirementOption(idCaptureRequirement);
17145
+ var allowedImageCount = allowedImageCountForOption(idCaptureRequirement);
17146
+ var requiredImageCount = requiredImageCountForOption(idCaptureRequirement);
17138
17147
  var _k = useFileState(),
17139
17148
  rawFile = _k.rawFile,
17140
17149
  fileInputOnChange = _k.fileInputOnChange;
@@ -17147,7 +17156,7 @@
17147
17156
  var whatToCapture = idCaptureRequirement === 'idCard' ? 'ID card' : idCaptureRequirement === 'passport' ? 'passport' : idCaptureRequirement === 'idCardOrPassport' ? 'ID card or passport' : 'ID card and passport';
17148
17157
  var firstInstructionText = idCaptureRequirement === 'idCard' || idCaptureRequirement === 'idCardAndPassport' ? 'Please capture the front of your ID card.' : idCaptureRequirement === 'passport' ? 'Please capture the ID page of your passport.' : 'Please capture the front of your ID card, or the ID page of your passport.';
17149
17158
  var secondInstructionText = idCaptureRequirement === 'idCardOrPassport' ? 'Please capture the back of your ID card, or click Done if submitting a passport.' : 'Please capture the back of your ID card.';
17150
- var descriptionText = "On-device capture guidance failed, please capture ".concat(minImageCount > 1 ? 'photos' : ' a photo', " of your ").concat(whatToCapture, " manually.");
17159
+ var descriptionText = "On-device capture guidance failed, please capture ".concat(requiredImageCount > 1 ? 'photos' : ' a photo', " of your ").concat(whatToCapture, " manually.");
17151
17160
  var verbiage = useTranslations(rawVerbiage, {
17152
17161
  headingText: "We're having some trouble.",
17153
17162
  descriptionText: descriptionText,
@@ -17221,7 +17230,7 @@
17221
17230
  alt: "",
17222
17231
  className: classNames.image
17223
17232
  }));
17224
- }))), images.length < minImageCount && ( /*#__PURE__*/React.createElement(Instruction, {
17233
+ }))), images.length < requiredImageCount && ( /*#__PURE__*/React.createElement(Instruction, {
17225
17234
  className: classNames.instruction
17226
17235
  }, instructionText)), /*#__PURE__*/React.createElement("input", {
17227
17236
  ref: fileInput,
@@ -17232,7 +17241,7 @@
17232
17241
  hidden: true
17233
17242
  }), /*#__PURE__*/React.createElement(StyledButtonsRow$8, {
17234
17243
  className: classNames.buttonsRow
17235
- }, images.length < maxImageCount && ( /*#__PURE__*/React.createElement(LoaderButton, {
17244
+ }, images.length < allowedImageCount && ( /*#__PURE__*/React.createElement(LoaderButton, {
17236
17245
  variant: images.length > 0 ? 'secondary' : 'positive',
17237
17246
  className: images.length > 0 ? classNames.captureMoreBtn : classNames.captureBtn,
17238
17247
  colors: images.length > 0 ? colors.captureMoreBtn : colors.captureBtn,
@@ -17245,7 +17254,7 @@
17245
17254
  setDocumentToCapture(instructionText);
17246
17255
  }
17247
17256
  }
17248
- }, images.length > 0 ? verbiage.captureMoreBtnText : verbiage.captureBtnText)), images.length >= minImageCount && ( /*#__PURE__*/React.createElement(LoaderButton, {
17257
+ }, images.length > 0 ? verbiage.captureMoreBtnText : verbiage.captureBtnText)), images.length >= requiredImageCount && ( /*#__PURE__*/React.createElement(LoaderButton, {
17249
17258
  variant: "positive",
17250
17259
  className: classNames.doneBtn,
17251
17260
  colors: colors.doneBtn,
@@ -17292,90 +17301,91 @@
17292
17301
  precapturedDocuments = _a.precapturedDocuments,
17293
17302
  _j = _a.captureRequirement,
17294
17303
  captureRequirement = _j === void 0 ? 'idCardOrPassport' : _j,
17295
- _k = _a.allowSinglePageIdCapture,
17296
- allowSinglePageIdCapture = _k === void 0 ? false : _k,
17297
- _l = _a.separateIdCardCaptureSequence,
17298
- separateIdCardCaptureSequence = _l === void 0 ? false : _l,
17299
- _m = _a.thresholds,
17300
- thresholds = _m === void 0 ? defaultIdCaptureThresholds : _m,
17301
- _o = _a.skipSuccessScreen,
17302
- skipSuccessScreen = _o === void 0 ? false : _o,
17304
+ _k = _a.separateIdCardCaptureSequence,
17305
+ separateIdCardCaptureSequence = _k === void 0 ? false : _k,
17306
+ _l = _a.thresholds,
17307
+ thresholds = _l === void 0 ? defaultIdCaptureThresholds : _l,
17308
+ _m = _a.skipSuccessScreen,
17309
+ skipSuccessScreen = _m === void 0 ? false : _m,
17303
17310
  instructions = _a.instructions,
17304
- _p = _a.releaseCameraAccessOnExit,
17305
- releaseCameraAccessOnExit = _p === void 0 ? true : _p,
17306
- _q = _a.guideType,
17307
- guideType = _q === void 0 ? 'fit' : _q,
17308
- _r = _a.portraitGuidesOnMobile,
17309
- portraitGuidesOnMobile = _r === void 0 ? true : _r,
17310
- _s = _a.rotateLoadingOverlayImageWhenPortrait,
17311
- rotateLoadingOverlayImageWhenPortrait = _s === void 0 ? true : _s,
17312
- _t = _a.silentFallback,
17313
- silentFallback = _t === void 0 ? false : _t,
17314
- _u = _a.forceFallbackMode,
17315
- forceFallbackMode = _u === void 0 ? false : _u,
17316
- _v = _a.allowIdCardBackToFrontCapture,
17317
- allowIdCardBackToFrontCapture = _v === void 0 ? false : _v,
17318
- _w = _a.enableOverrideWrongDocumentTypeDialog,
17319
- enableOverrideWrongDocumentTypeDialog = _w === void 0 ? false : _w,
17320
- _x = _a.allowOverrideWrongDocumentTypeAfterMs,
17321
- allowOverrideWrongDocumentTypeAfterMs = _x === void 0 ? 8000 : _x,
17322
- _y = _a.guideImages,
17323
- guideImages = _y === void 0 ? defaultIdCaptureGuideImages : _y,
17324
- _z = _a.assets,
17325
- assets = _z === void 0 ? {} : _z,
17326
- _0 = _a.classNames,
17327
- classNames = _0 === void 0 ? {} : _0,
17328
- _1 = _a.colors,
17329
- colors = _1 === void 0 ? {} : _1,
17330
- _2 = _a.verbiage,
17331
- verbiage = _2 === void 0 ? {} : _2,
17332
- _3 = _a.debugMode,
17333
- debugMode = _3 === void 0 ? false : _3;
17334
- var _4 = useIdCaptureState(),
17335
- state = _4[0],
17336
- dispatch = _4[1];
17337
- var _5 = useCameraStore(),
17338
- cameraAccessDenied = _5.cameraAccessDenied,
17339
- requestCameraAccess = _5.requestCameraAccess,
17340
- releaseCameraAccess = _5.releaseCameraAccess;
17341
- var _6 = React.useState(false),
17342
- overlayDismissed = _6[0],
17343
- setOverlayDismissed = _6[1];
17344
- var _7 = React.useContext(SubmissionContext),
17345
- submissionStatus = _7.submissionStatus,
17346
- setIdFrontImage = _7.setIdFrontImage,
17347
- setIdBackImage = _7.setIdBackImage,
17348
- setPassportImage = _7.setPassportImage,
17349
- logIdFrontCaptureAttempt = _7.logIdFrontCaptureAttempt,
17350
- logIdBackCaptureAttempt = _7.logIdBackCaptureAttempt;
17351
- var _8 = React.useContext(IdCaptureModelsContext),
17352
- start = _8.start,
17353
- stop = _8.stop,
17354
- onPredictionMade = _8.onPredictionMade,
17355
- setRequiredDocumentType = _8.setRequiredDocumentType,
17356
- modelError = _8.modelError,
17357
- resetBestFrame = _8.resetBestFrame;
17311
+ _o = _a.releaseCameraAccessOnExit,
17312
+ releaseCameraAccessOnExit = _o === void 0 ? true : _o,
17313
+ _p = _a.guideType,
17314
+ guideType = _p === void 0 ? 'fit' : _p,
17315
+ _q = _a.portraitGuidesOnMobile,
17316
+ portraitGuidesOnMobile = _q === void 0 ? true : _q,
17317
+ _r = _a.rotateLoadingOverlayImageWhenPortrait,
17318
+ rotateLoadingOverlayImageWhenPortrait = _r === void 0 ? true : _r,
17319
+ _s = _a.silentFallback,
17320
+ silentFallback = _s === void 0 ? false : _s,
17321
+ _t = _a.forceFallbackMode,
17322
+ forceFallbackMode = _t === void 0 ? false : _t,
17323
+ _u = _a.allowIdCardBackToFrontCapture,
17324
+ allowIdCardBackToFrontCapture = _u === void 0 ? false : _u,
17325
+ _v = _a.enableOverrideWrongDocumentTypeDialog,
17326
+ enableOverrideWrongDocumentTypeDialog = _v === void 0 ? false : _v,
17327
+ _w = _a.allowOverrideWrongDocumentTypeAfterMs,
17328
+ allowOverrideWrongDocumentTypeAfterMs = _w === void 0 ? 8000 : _w,
17329
+ _x = _a.guideImages,
17330
+ guideImages = _x === void 0 ? defaultIdCaptureGuideImages : _x,
17331
+ _y = _a.assets,
17332
+ assets = _y === void 0 ? {} : _y,
17333
+ _z = _a.classNames,
17334
+ classNames = _z === void 0 ? {} : _z,
17335
+ _0 = _a.colors,
17336
+ colors = _0 === void 0 ? {} : _0,
17337
+ _1 = _a.verbiage,
17338
+ verbiage = _1 === void 0 ? {} : _1,
17339
+ _2 = _a.debugMode,
17340
+ debugMode = _2 === void 0 ? false : _2;
17341
+ var _3 = useIdCaptureState(),
17342
+ state = _3[0],
17343
+ dispatch = _3[1];
17344
+ var _4 = useCameraStore(),
17345
+ cameraAccessDenied = _4.cameraAccessDenied,
17346
+ requestCameraAccess = _4.requestCameraAccess,
17347
+ releaseCameraAccess = _4.releaseCameraAccess;
17348
+ var _5 = React.useState(false),
17349
+ overlayDismissed = _5[0],
17350
+ setOverlayDismissed = _5[1];
17351
+ var _6 = React.useContext(SubmissionContext),
17352
+ submissionStatus = _6.submissionStatus,
17353
+ setIdFrontImage = _6.setIdFrontImage,
17354
+ setIdBackImage = _6.setIdBackImage,
17355
+ setPassportImage = _6.setPassportImage,
17356
+ logIdFrontCaptureAttempt = _6.logIdFrontCaptureAttempt,
17357
+ logIdBackCaptureAttempt = _6.logIdBackCaptureAttempt;
17358
+ var _7 = React.useContext(IdCaptureModelsContext),
17359
+ start = _7.start,
17360
+ stop = _7.stop,
17361
+ onPredictionMade = _7.onPredictionMade,
17362
+ setRequiredDocumentType = _7.setRequiredDocumentType,
17363
+ modelError = _7.modelError,
17364
+ resetBestFrame = _7.resetBestFrame;
17358
17365
  React.useEffect(function () {
17359
17366
  dispatch({
17360
17367
  type: 'configureWizard',
17361
17368
  payload: {
17362
17369
  captureRequirement: captureRequirement,
17363
17370
  precapturedDocuments: precapturedDocuments,
17364
- allowSinglePageIdCapture: allowSinglePageIdCapture,
17365
17371
  allowIdCardBackToFrontCapture: allowIdCardBackToFrontCapture,
17366
17372
  enableOverrideWrongDocumentTypeDialog: enableOverrideWrongDocumentTypeDialog,
17367
17373
  allowOverrideWrongDocumentTypeAfterMs: allowOverrideWrongDocumentTypeAfterMs
17368
17374
  }
17369
17375
  });
17370
- }, [allowIdCardBackToFrontCapture, allowOverrideWrongDocumentTypeAfterMs, allowSinglePageIdCapture, captureRequirement, dispatch, enableOverrideWrongDocumentTypeDialog, precapturedDocuments]);
17376
+ }, [allowIdCardBackToFrontCapture, allowOverrideWrongDocumentTypeAfterMs, captureRequirement, dispatch, enableOverrideWrongDocumentTypeDialog, precapturedDocuments]);
17371
17377
  var documentCount = Object.keys(state.capturedDocuments).length;
17372
17378
  React.useEffect(function () {
17373
- documentCount && resetBestFrame();
17379
+ if (documentCount) resetBestFrame();
17374
17380
  }, [documentCount, resetBestFrame]);
17375
17381
  var logCaptureMetadata = React.useCallback(function (metadata) {
17376
17382
  var _a;
17377
17383
  metadata.operationTime = new Date().getTime() - ((_a = state.operationStartedAt) !== null && _a !== void 0 ? _a : new Date()).getTime();
17378
- state.requestedDocumentType === 'idCardBack' ? logIdBackCaptureAttempt(metadata) : logIdFrontCaptureAttempt(metadata);
17384
+ if (state.requestedDocumentType === 'idCardBack') {
17385
+ logIdBackCaptureAttempt(metadata);
17386
+ } else {
17387
+ logIdFrontCaptureAttempt(metadata);
17388
+ }
17379
17389
  }, [logIdBackCaptureAttempt, logIdFrontCaptureAttempt, state.operationStartedAt, state.requestedDocumentType]);
17380
17390
  React.useEffect(function startModelsWhenCapturing() {
17381
17391
  if (!overlayDismissed || state.captureState !== 'capturing') return;
@@ -17425,17 +17435,14 @@
17425
17435
  var _a = state.capturedDocuments,
17426
17436
  idCardFront = _a.idCardFront,
17427
17437
  idCardBack = _a.idCardBack,
17428
- passport = _a.passport,
17429
- singlePage = _a.singlePage;
17438
+ passport = _a.passport;
17430
17439
  var idFrontImage = idCardFront && dataUrlToBase64Sync(idCardFront.imageData);
17431
17440
  var idBackImage = idCardBack && dataUrlToBase64Sync(idCardBack.imageData);
17432
17441
  var passportImage = passport && dataUrlToBase64Sync(passport.imageData);
17433
- 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();
17442
+ if (idFrontImage) setIdFrontImage(idFrontImage);
17443
+ if (idBackImage) setIdBackImage(idBackImage);
17444
+ if (passportImage) setPassportImage(passportImage);
17445
+ if (releaseCameraAccessOnExit) releaseCameraAccess();
17439
17446
  setTimeout(function () {
17440
17447
  onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess({
17441
17448
  idFrontImage: idFrontImage,
@@ -17450,9 +17457,9 @@
17450
17457
  type: 'resetWizard'
17451
17458
  });
17452
17459
  }, [dispatch]);
17453
- var _9 = React.useState(0),
17454
- attempt = _9[0],
17455
- setAttempt = _9[1];
17460
+ var _8 = React.useState(0),
17461
+ attempt = _8[0],
17462
+ setAttempt = _8[1];
17456
17463
  var onExit = React.useCallback(function () {
17457
17464
  releaseCameraAccess();
17458
17465
  setOverlayDismissed(false);
@@ -17467,7 +17474,7 @@
17467
17474
  }, [dispatch, onExitCapture, releaseCameraAccess, requestCameraAccess]);
17468
17475
  React.useEffect(function () {
17469
17476
  if (submissionStatus !== SubmissionStatus.READY) {
17470
- releaseCameraAccessOnExit && releaseCameraAccess();
17477
+ if (releaseCameraAccessOnExit) releaseCameraAccess();
17471
17478
  }
17472
17479
  }, [releaseCameraAccess, releaseCameraAccessOnExit, submissionStatus]);
17473
17480
  React.useEffect(function () {
@@ -17543,9 +17550,9 @@
17543
17550
  });
17544
17551
  });
17545
17552
  }, [dispatch]);
17546
- var _10 = React.useState(false),
17547
- progressStarted = _10[0],
17548
- setProgressStarted = _10[1];
17553
+ var _9 = React.useState(false),
17554
+ progressStarted = _9[0],
17555
+ setProgressStarted = _9[1];
17549
17556
  React.useEffect(function () {
17550
17557
  if (state.captureState === 'capturing') {
17551
17558
  setProgressStarted(false);
@@ -18648,19 +18655,25 @@
18648
18655
  canvasRef = _v.canvasRef,
18649
18656
  guidanceError = _v.error;
18650
18657
  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();
18658
+ return __awaiter(void 0, void 0, void 0, function () {
18659
+ return __generator(this, function (_a) {
18660
+ if (shouldCapture && !busy) {
18661
+ drawToCanvas(lastPredictionCanvas.current, canvasRef.current);
18662
+ dispatch({
18663
+ type: 'facesDetected',
18664
+ payload: prediction
18665
+ });
18666
+ }
18667
+ return [2 /*return*/];
18668
+ });
18660
18669
  });
18661
18670
  }, [canvasRef, shouldCapture, busy]), 16));
18662
18671
  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();
18672
+ if (prediction === null || prediction === void 0 ? void 0 : prediction.faceReady) {
18673
+ onGuidanceSatisfied === null || onGuidanceSatisfied === void 0 ? void 0 : onGuidanceSatisfied();
18674
+ } else {
18675
+ onGuidanceNotSatisfied === null || onGuidanceNotSatisfied === void 0 ? void 0 : onGuidanceNotSatisfied();
18676
+ }
18664
18677
  }, [onGuidanceNotSatisfied, onGuidanceSatisfied, prediction === null || prediction === void 0 ? void 0 : prediction.faceReady]);
18665
18678
  React.useEffect(function () {
18666
18679
  if (!(prediction === null || prediction === void 0 ? void 0 : prediction.faceReady)) return;
@@ -19658,7 +19671,7 @@
19658
19671
  }, [logCaptureMetadata, releaseCameraAccess, requestCameraAccess]);
19659
19672
  var onDoneCallback = React.useCallback(function () {
19660
19673
  logCaptureMetadata();
19661
- releaseCameraAccessOnExit && releaseCameraAccess();
19674
+ if (releaseCameraAccessOnExit) releaseCameraAccess();
19662
19675
  setTimeout(function () {
19663
19676
  onComplete === null || onComplete === void 0 ? void 0 : onComplete(submissionResponse, livenessCheckRequest);
19664
19677
  }, 0);
@@ -19677,7 +19690,7 @@
19677
19690
  onLoadingOverlayDismissed === null || onLoadingOverlayDismissed === void 0 ? void 0 : onLoadingOverlayDismissed();
19678
19691
  }, [onLoadingOverlayDismissed]);
19679
19692
  var onFailureExitClick = React.useCallback(function () {
19680
- releaseCameraAccessOnExit && releaseCameraAccess();
19693
+ if (releaseCameraAccessOnExit) releaseCameraAccess();
19681
19694
  setTimeout(function () {
19682
19695
  onExitAfterFailure === null || onExitAfterFailure === void 0 ? void 0 : onExitAfterFailure(submissionResponse, livenessCheckRequest);
19683
19696
  }, 0);
@@ -20799,16 +20812,15 @@
20799
20812
  var templateObject_1$b, templateObject_2$9, templateObject_3$9, templateObject_4$4;
20800
20813
 
20801
20814
  var SignatureCapture = function SignatureCapture(_a) {
20802
- var _b;
20803
20815
  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;
20816
+ _b = _a.classNames,
20817
+ classNames = _b === void 0 ? {} : _b,
20818
+ _c = _a.verbiage,
20819
+ rawVerbiage = _c === void 0 ? {} : _c;
20820
+ var _d = useResizeObserver(),
20821
+ ref = _d.ref,
20822
+ width = _d.width,
20823
+ height = _d.height;
20812
20824
  var signaturePad = React.useRef(null);
20813
20825
  var verbiage = useTranslations(rawVerbiage, {
20814
20826
  headingText: 'Please sign the box below',
@@ -20858,8 +20870,11 @@
20858
20870
  }, /*#__PURE__*/React.createElement(LoaderButton, {
20859
20871
  variant: "secondary",
20860
20872
  className: classNames.clearBtn,
20861
- onClick: (_b = signaturePad.current) === null || _b === void 0 ? void 0 : _b.clear,
20862
- finished: true
20873
+ finished: true,
20874
+ onClick: function onClick() {
20875
+ var _a;
20876
+ (_a = signaturePad.current) === null || _a === void 0 ? void 0 : _a.clear();
20877
+ }
20863
20878
  }, verbiage.clearBtnText), /*#__PURE__*/React.createElement(AcceptBtn$1, {
20864
20879
  variant: "positive",
20865
20880
  className: classNames.acceptBtn,
@@ -21837,8 +21852,7 @@
21837
21852
  detection: {
21838
21853
  idCardFront: 0.4,
21839
21854
  idCardBack: 0.5,
21840
- passport: 0.3,
21841
- singlePage: 0.3
21855
+ passport: 0.3
21842
21856
  },
21843
21857
  focus: {
21844
21858
  idCardFront: {
@@ -21852,17 +21866,12 @@
21852
21866
  passport: {
21853
21867
  desktop: 0,
21854
21868
  mobile: 0
21855
- },
21856
- singlePage: {
21857
- desktop: 0,
21858
- mobile: 0
21859
21869
  }
21860
21870
  },
21861
21871
  goodFrames: {
21862
21872
  idCardFront: 1,
21863
21873
  idCardBack: 1,
21864
- passport: 1,
21865
- singlePage: 1
21874
+ passport: 1
21866
21875
  },
21867
21876
  flipShortcutThreshold: 0.7
21868
21877
  };
@@ -21934,7 +21943,6 @@
21934
21943
  stopIdModels = _18.stop,
21935
21944
  onIdPredictionMade = _18.onPredictionMade,
21936
21945
  setThresholds = _18.setThresholds,
21937
- setRequiredDocumentType = _18.setRequiredDocumentType,
21938
21946
  setDocumentDetectionBoundaries = _18.setDocumentDetectionBoundaries,
21939
21947
  bestFrameDetails = _18.bestFrameDetails,
21940
21948
  resetBestFrame = _18.resetBestFrame,
@@ -22013,9 +22021,6 @@
22013
22021
  React.useEffect(function () {
22014
22022
  setThresholds(adjustedThresholds);
22015
22023
  }, [requestedAction, setThresholds, adjustedThresholds]);
22016
- React.useEffect(function () {
22017
- setRequiredDocumentType(requestedAction === 'SHOW_PASSPORT' ? 'passport' : requestedAction === 'SHOW_ID_BACK' ? 'idCardBack' : 'idCardFront');
22018
- }, [requestedAction, setRequiredDocumentType]);
22019
22024
  React.useEffect(function () {
22020
22025
  setDocumentDetectionBoundaries({
22021
22026
  top: 20,
@@ -22038,9 +22043,6 @@
22038
22043
  setGoodFramesCount = _28[1];
22039
22044
  var goodFramesThreshold = requestedAction === 'SHOW_PASSPORT' ? adjustedThresholds.goodFrames.passport : requestedAction === 'SHOW_ID_FRONT' ? adjustedThresholds.goodFrames.idCardFront : adjustedThresholds.goodFrames.idCardBack;
22040
22045
  var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
22041
- var _29 = React.useState(false),
22042
- isSinglePage = _29[0],
22043
- setIsSinglePage = _29[1];
22044
22046
  React.useEffect(function () {
22045
22047
  if (!idCaptureModelsEnabled || idModelError) return;
22046
22048
  onIdPredictionMade(function (prediction) {
@@ -22048,8 +22050,7 @@
22048
22050
  setCurrentDetectionScore(prediction.detectionScore);
22049
22051
  setCurrentDetectedDocumentType(prediction.detectedDocumentType);
22050
22052
  setCurrentFocusScore(prediction.focusScore);
22051
- setIsSinglePage(prediction.singlePageDetectionThresholdMet);
22052
- var detectionThresholdMet = requestedAction === 'SHOW_PASSPORT' ? prediction.passportDetectionThresholdMet : requestedAction === 'SHOW_ID_BACK' ? prediction.idCardBackDetectionThresholdMet : prediction.idCardFrontDetectionThresholdMet || prediction.singlePageDetectionThresholdMet;
22053
+ var detectionThresholdMet = requestedAction === 'SHOW_PASSPORT' ? prediction.passportDetectionThresholdMet : requestedAction === 'SHOW_ID_FRONT' ? prediction.idCardFrontDetectionThresholdMet : prediction.idCardBackDetectionThresholdMet;
22053
22054
  var isGoodFrame = detectionThresholdMet && prediction.focusThresholdMet;
22054
22055
  var shouldShortcutFlipAnimation = requestedAction === 'FLIP_ID' && isGoodFrame && prediction.idCardBackDetectionScore >= adjustedThresholds.flipShortcutThreshold;
22055
22056
  if (shouldShortcutFlipAnimation) {
@@ -22060,9 +22061,9 @@
22060
22061
  } : 0);
22061
22062
  });
22062
22063
  }, [idCaptureModelsEnabled, onIdPredictionMade, idModelError, requestedAction, adjustedThresholds.flipShortcutThreshold]);
22063
- var _30 = React.useState(null),
22064
- idFrontCaptureStartedAt = _30[0],
22065
- setFirstGoodFrameTime = _30[1];
22064
+ var _29 = React.useState(null),
22065
+ idFrontCaptureStartedAt = _29[0],
22066
+ setFirstGoodFrameTime = _29[1];
22066
22067
  React.useEffect(function () {
22067
22068
  if (goodFramesCount === 1) setFirstGoodFrameTime(new Date().getTime());
22068
22069
  }, [goodFramesCount]);
@@ -22083,60 +22084,80 @@
22083
22084
  var frameHeight = (_e = (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) !== null && _e !== void 0 ? _e : 0;
22084
22085
  var faceBox = face === null || face === void 0 ? void 0 : face.box;
22085
22086
  var faceCentered = !faceBox || !frameWidth || faceBox.xMin > frameWidth * edgeBoundary && faceBox.yMin > frameHeight * edgeBoundary && faceBox.xMax < frameWidth * (1 - edgeBoundary) && faceBox.yMax < frameHeight * (1 - edgeBoundary);
22086
- var _31 = React.useState(),
22087
- countdownStartedAt = _31[0],
22088
- setCountdownStartedAt = _31[1];
22087
+ var _30 = React.useState(),
22088
+ countdownStartedAt = _30[0],
22089
+ setCountdownStartedAt = _30[1];
22089
22090
  var photoCanvas = React.useRef(null);
22090
22091
  var frameLock = React.useRef(false);
22091
22092
  var captureFrame = React.useCallback(function () {
22092
22093
  return __awaiter(void 0, void 0, void 0, function () {
22093
- var frameBase64;
22094
- return __generator(this, function (_a) {
22095
- if (frameLock.current) return [2 /*return*/];
22096
- frameLock.current = true;
22097
- drawToCanvas(photoCanvas.current, videoRef.current);
22098
- frameBase64 = photoCanvas.current.toDataURL('image/jpeg');
22099
- if (!frameBase64) {
22100
- frameLock.current = false;
22101
- return [2 /*return*/];
22102
- }
22103
- try {
22104
- if (requestedAction == 'SHOW_ID_FRONT') {
22094
+ var frameBase64, _a;
22095
+ return __generator(this, function (_b) {
22096
+ switch (_b.label) {
22097
+ case 0:
22098
+ if (frameLock.current) return [2 /*return*/];
22099
+ frameLock.current = true;
22100
+ drawToCanvas(photoCanvas.current, videoRef.current);
22101
+ frameBase64 = photoCanvas.current.toDataURL('image/jpeg');
22102
+ if (!frameBase64) {
22103
+ frameLock.current = false;
22104
+ return [2 /*return*/];
22105
+ }
22106
+ _b.label = 1;
22107
+ case 1:
22108
+ _b.trys.push([1,, 7, 8]);
22109
+ if (!(requestedAction == 'SHOW_ID_FRONT')) return [3 /*break*/, 5];
22105
22110
  if (onIdFrontImageCaptured) {
22106
22111
  onIdFrontImageCaptured(frameBase64);
22107
22112
  }
22108
- if (isSinglePage || evaluateShouldSkip(skipShowIdCardBack)) {
22113
+ if (!skipShowIdCardBack) return [3 /*break*/, 4];
22114
+ _a = skipShowIdCardBack === true;
22115
+ if (_a) return [3 /*break*/, 3];
22116
+ return [4 /*yield*/, skipShowIdCardBack()];
22117
+ case 2:
22118
+ _a = _b.sent();
22119
+ _b.label = 3;
22120
+ case 3:
22121
+ if (_a) {
22109
22122
  return [2 /*return*/, onIdCaptureComplete()];
22110
22123
  }
22124
+ _b.label = 4;
22125
+ case 4:
22111
22126
  setRequestedAction('FLIP_ID');
22112
- } else if (requestedAction == 'SHOW_ID_BACK') {
22113
- if (onIdBackImageCaptured) {
22114
- onIdBackImageCaptured(frameBase64);
22127
+ return [3 /*break*/, 6];
22128
+ case 5:
22129
+ if (requestedAction == 'SHOW_ID_BACK') {
22130
+ if (onIdBackImageCaptured) {
22131
+ onIdBackImageCaptured(frameBase64);
22132
+ }
22133
+ onIdCaptureComplete();
22134
+ } else if (requestedAction == 'SHOW_PASSPORT') {
22135
+ if (onIdFrontImageCaptured) {
22136
+ onIdFrontImageCaptured(frameBase64);
22137
+ }
22138
+ onIdCaptureComplete();
22115
22139
  }
22116
- onIdCaptureComplete();
22117
- } else if (requestedAction == 'SHOW_PASSPORT') {
22118
- if (onIdFrontImageCaptured) {
22119
- onIdFrontImageCaptured(frameBase64);
22140
+ _b.label = 6;
22141
+ case 6:
22142
+ return [3 /*break*/, 8];
22143
+ case 7:
22144
+ setDetectedObjects([]);
22145
+ setCurrentDetectionScore(0);
22146
+ setCurrentFocusScore(0);
22147
+ setGoodFramesCount(0);
22148
+ setCountdownStartedAt(undefined);
22149
+ resetBestFrame();
22150
+ frameLock.current = false;
22151
+ if (countdownTimeoutRef.current) {
22152
+ clearTimeout(countdownTimeoutRef.current);
22120
22153
  }
22121
- onIdCaptureComplete();
22122
- }
22123
- } finally {
22124
- setDetectedObjects([]);
22125
- setCurrentDetectionScore(0);
22126
- setCurrentFocusScore(0);
22127
- setGoodFramesCount(0);
22128
- setCountdownStartedAt(undefined);
22129
- setIsSinglePage(false);
22130
- resetBestFrame();
22131
- frameLock.current = false;
22132
- if (countdownTimeoutRef.current) {
22133
- clearTimeout(countdownTimeoutRef.current);
22134
- }
22154
+ return [7 /*endfinally*/];
22155
+ case 8:
22156
+ return [2 /*return*/];
22135
22157
  }
22136
- return [2 /*return*/];
22137
22158
  });
22138
22159
  });
22139
- }, [videoRef, requestedAction, onIdFrontImageCaptured, isSinglePage, skipShowIdCardBack, onIdCaptureComplete, onIdBackImageCaptured, resetBestFrame]);
22160
+ }, [onIdCaptureComplete, onIdBackImageCaptured, onIdFrontImageCaptured, requestedAction, resetBestFrame, skipShowIdCardBack, videoRef]);
22140
22161
  var isFlipping = requestedAction === 'FLIP_ID';
22141
22162
  React.useEffect(function () {
22142
22163
  if (!isFlipping) return;
@@ -22195,9 +22216,9 @@
22195
22216
  stopSelfieGuidance();
22196
22217
  };
22197
22218
  }, [startSelfieGuidance, stopSelfieGuidance]);
22198
- var _32 = React.useState(0),
22199
- numFramesWithoutFaces = _32[0],
22200
- setNumFramesWithoutFaces = _32[1];
22219
+ var _31 = React.useState(0),
22220
+ numFramesWithoutFaces = _31[0],
22221
+ setNumFramesWithoutFaces = _31[1];
22201
22222
  onSelfiePredictionMade(f(React.useCallback(function (_a) {
22202
22223
  var face = _a.face;
22203
22224
  if (selfieModelError) return;
@@ -22213,12 +22234,12 @@
22213
22234
  }
22214
22235
  }, [disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, numFramesWithoutFaces, onFaceNotDetected, timeoutStartedAt]);
22215
22236
  var theme = styled.useTheme();
22216
- var _33 = useTranslations(rawVerbiage, {
22237
+ var _32 = useTranslations(rawVerbiage, {
22217
22238
  faceNotCenteredText: 'Please move your face to the center...',
22218
22239
  captureBtnText: 'Capture'
22219
22240
  }),
22220
- captureBtnText = _33.captureBtnText,
22221
- faceNotCenteredText = _33.faceNotCenteredText;
22241
+ captureBtnText = _32.captureBtnText,
22242
+ faceNotCenteredText = _32.faceNotCenteredText;
22222
22243
  var debugScalingDetails = useDebugScalingDetails({
22223
22244
  enabled: debugMode,
22224
22245
  pageWidth: width,
@@ -22293,11 +22314,6 @@
22293
22314
  var Countdown = styled.div(templateObject_2$5 || (templateObject_2$5 = __makeTemplateObject(["\n color: white;\n font-size: 64px;\n font-weight: bold;\n margin: auto;\n"], ["\n color: white;\n font-size: 64px;\n font-weight: bold;\n margin: auto;\n"])));
22294
22315
  var CaptureButtonContainer = styled.div(templateObject_3$5 || (templateObject_3$5 = __makeTemplateObject(["\n position: fixed;\n bottom: 0;\n width: 100dvw;\n display: flex;\n z-index: 100000;\n"], ["\n position: fixed;\n bottom: 0;\n width: 100dvw;\n display: flex;\n z-index: 100000;\n"])));
22295
22316
  var CaptureButton = styled(LoaderButton)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin: 0 auto 25px;\n"], ["\n margin: 0 auto 25px;\n"])));
22296
- function evaluateShouldSkip(value) {
22297
- if (value === true) return true;
22298
- if (typeof value === 'function') return value();
22299
- return false;
22300
- }
22301
22317
  var templateObject_1$5, templateObject_2$5, templateObject_3$5, templateObject_4;
22302
22318
 
22303
22319
  var IdVideoCaptureSuccess = function IdVideoCaptureSuccess(_a) {
@@ -22515,7 +22531,7 @@
22515
22531
  return __awaiter(void 0, void 0, void 0, function () {
22516
22532
  return __generator(this, function (_a) {
22517
22533
  setIdCaptureVideoUrl(videoUrl);
22518
- audioUrl && setIdCaptureVideoAudioUrl(audioUrl);
22534
+ if (audioUrl) setIdCaptureVideoAudioUrl(audioUrl);
22519
22535
  setCaptureState('SUCCESS');
22520
22536
  if (skipSuccessScreen) onComplete === null || onComplete === void 0 ? void 0 : onComplete();
22521
22537
  return [2 /*return*/];
@@ -22591,8 +22607,7 @@
22591
22607
  documentDetectionModelUrl: (_g = (_f = idCaptureProps.assets) === null || _f === void 0 ? void 0 : _f.documentDetectionModelUrl) !== null && _g !== void 0 ? _g : '',
22592
22608
  focusModelUrl: (_j = (_h = idCaptureProps.assets) === null || _h === void 0 ? void 0 : _h.focusModelUrl) !== null && _j !== void 0 ? _j : '',
22593
22609
  onModelError: onIdCaptureModelError,
22594
- modelLoadTimeoutMs: idCaptureModelLoadTimeoutMs,
22595
- allowSinglePageIdCapture: idCaptureProps.allowSinglePageIdCapture
22610
+ modelLoadTimeoutMs: idCaptureModelLoadTimeoutMs
22596
22611
  }, /*#__PURE__*/React.createElement(SelfieGuidanceModelsProvider, {
22597
22612
  autoStart: false,
22598
22613
  onModelError: faceLivenessProps === null || faceLivenessProps === void 0 ? void 0 : faceLivenessProps.onModelError,
@@ -22842,8 +22857,7 @@
22842
22857
  documentDetectionModelUrl: (_d = (_c = idCaptureProps.assets) === null || _c === void 0 ? void 0 : _c.documentDetectionModelUrl) !== null && _d !== void 0 ? _d : '',
22843
22858
  focusModelUrl: (_f = (_e = idCaptureProps.assets) === null || _e === void 0 ? void 0 : _e.focusModelUrl) !== null && _f !== void 0 ? _f : '',
22844
22859
  onModelError: idCaptureProps.onModelError,
22845
- modelLoadTimeoutMs: idCaptureProps.modelLoadTimeoutMs,
22846
- allowSinglePageIdCapture: idCaptureProps.allowSinglePageIdCapture
22860
+ modelLoadTimeoutMs: idCaptureProps.modelLoadTimeoutMs
22847
22861
  }, /*#__PURE__*/React.createElement(IdCaptureStateProvider, null, /*#__PURE__*/React.createElement(GuideOrientationContextProvider, null, /*#__PURE__*/React.createElement(IdCaptureWizard, _assign({}, idCaptureProps, {
22848
22862
  onSuccess: onIdCaptureSuccess
22849
22863
  }))))));
@@ -23110,10 +23124,10 @@
23110
23124
  var ThemeProvider = function ThemeProvider(_a) {
23111
23125
  var children = _a.children,
23112
23126
  themeInput = _a.theme;
23113
- var themeRef = React.useRef(themeInput);
23127
+ var themeRef = React.useState(themeInput)[0];
23114
23128
  var theme = React.useMemo(function () {
23115
- return resolveTheme(themeRef.current);
23116
- }, []);
23129
+ return resolveTheme(themeRef);
23130
+ }, [themeRef]);
23117
23131
  var colors = theme.colors;
23118
23132
  React.useEffect(function () {
23119
23133
  for (var name_1 in colors) {
@@ -23165,33 +23179,31 @@
23165
23179
  onLoadingOverlayDismissed = _a.onLoadingOverlayDismissed,
23166
23180
  _d = _a.idCaptureRequirement,
23167
23181
  idCaptureRequirement = _d === void 0 ? 'idCardOrPassport' : _d,
23168
- _e = _a.allowSinglePageIdCapture,
23169
- allowSinglePageIdCapture = _e === void 0 ? false : _e,
23170
- _f = _a.separateIdCardCaptureSequence,
23171
- separateIdCardCaptureSequence = _f === void 0 ? false : _f,
23172
- _g = _a.idCaptureThresholds,
23173
- idCaptureThresholds = _g === void 0 ? defaultIdCaptureThresholds : _g,
23174
- _h = _a.skipSuccessScreen,
23175
- skipSuccessScreen = _h === void 0 ? false : _h,
23182
+ _e = _a.separateIdCardCaptureSequence,
23183
+ separateIdCardCaptureSequence = _e === void 0 ? false : _e,
23184
+ _f = _a.idCaptureThresholds,
23185
+ idCaptureThresholds = _f === void 0 ? defaultIdCaptureThresholds : _f,
23186
+ _g = _a.skipSuccessScreen,
23187
+ skipSuccessScreen = _g === void 0 ? false : _g,
23176
23188
  instructions = _a.instructions,
23177
- _j = _a.guideType,
23178
- guideType = _j === void 0 ? 'fit' : _j,
23179
- _k = _a.guideImages,
23180
- guideImages = _k === void 0 ? defaultIdCaptureGuideImages : _k,
23181
- _l = _a.portraitGuidesOnMobile,
23182
- portraitGuidesOnMobile = _l === void 0 ? true : _l,
23183
- _m = _a.rotateLoadingOverlayImageWhenPortrait,
23184
- rotateLoadingOverlayImageWhenPortrait = _m === void 0 ? true : _m,
23185
- _o = _a.modelLoadTimeoutMs,
23186
- modelLoadTimeoutMs = _o === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _o,
23187
- _p = _a.forceFallbackMode,
23188
- forceFallbackMode = _p === void 0 ? false : _p,
23189
- _q = _a.allowIdCardBackToFrontCapture,
23190
- allowIdCardBackToFrontCapture = _q === void 0 ? false : _q,
23191
- _r = _a.enableOverrideWrongDocumentTypeDialog,
23192
- enableOverrideWrongDocumentTypeDialog = _r === void 0 ? false : _r,
23193
- _s = _a.allowOverrideWrongDocumentTypeAfterMs,
23194
- allowOverrideWrongDocumentTypeAfterMs = _s === void 0 ? 8000 : _s,
23189
+ _h = _a.guideType,
23190
+ guideType = _h === void 0 ? 'fit' : _h,
23191
+ _j = _a.guideImages,
23192
+ guideImages = _j === void 0 ? defaultIdCaptureGuideImages : _j,
23193
+ _k = _a.portraitGuidesOnMobile,
23194
+ portraitGuidesOnMobile = _k === void 0 ? true : _k,
23195
+ _l = _a.rotateLoadingOverlayImageWhenPortrait,
23196
+ rotateLoadingOverlayImageWhenPortrait = _l === void 0 ? true : _l,
23197
+ _m = _a.modelLoadTimeoutMs,
23198
+ modelLoadTimeoutMs = _m === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _m,
23199
+ _o = _a.forceFallbackMode,
23200
+ forceFallbackMode = _o === void 0 ? false : _o,
23201
+ _p = _a.allowIdCardBackToFrontCapture,
23202
+ allowIdCardBackToFrontCapture = _p === void 0 ? false : _p,
23203
+ _q = _a.enableOverrideWrongDocumentTypeDialog,
23204
+ enableOverrideWrongDocumentTypeDialog = _q === void 0 ? false : _q,
23205
+ _r = _a.allowOverrideWrongDocumentTypeAfterMs,
23206
+ allowOverrideWrongDocumentTypeAfterMs = _r === void 0 ? 8000 : _r,
23195
23207
  onBeforeSubmit = _a.onBeforeSubmit,
23196
23208
  onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
23197
23209
  onDocumentUploadProgress = _a.onDocumentUploadProgress,
@@ -23205,28 +23217,28 @@
23205
23217
  onUserCancel = _a.onUserCancel,
23206
23218
  onModelError = _a.onModelError,
23207
23219
  onCameraAccessDenied = _a.onCameraAccessDenied,
23208
- _t = _a.theme,
23209
- theme = _t === void 0 ? 'default' : _t,
23210
- _u = _a.assets,
23211
- assets = _u === void 0 ? {} : _u,
23212
- _v = _a.classNames,
23213
- classNames = _v === void 0 ? {} : _v,
23214
- _w = _a.colors,
23215
- colors = _w === void 0 ? {} : _w,
23216
- _x = _a.verbiage,
23217
- verbiage = _x === void 0 ? {} : _x,
23218
- _y = _a.captureSignature,
23219
- captureSignature = _y === void 0 ? false : _y,
23220
- _z = _a.captureSignatureVideo,
23221
- captureSignatureVideo = _z === void 0 ? false : _z,
23222
- _0 = _a.captureAdditionalDocuments,
23223
- captureAdditionalDocuments = _0 === void 0 ? [] : _0,
23224
- _1 = _a.geolocationEnabled,
23225
- geolocationEnabled = _1 === void 0 ? true : _1,
23226
- _2 = _a.geolocationRequired,
23227
- geolocationRequired = _2 === void 0 ? false : _2,
23228
- _3 = _a.debugMode,
23229
- debugMode = _3 === void 0 ? false : _3;
23220
+ _s = _a.theme,
23221
+ theme = _s === void 0 ? 'default' : _s,
23222
+ _t = _a.assets,
23223
+ assets = _t === void 0 ? {} : _t,
23224
+ _u = _a.classNames,
23225
+ classNames = _u === void 0 ? {} : _u,
23226
+ _v = _a.colors,
23227
+ colors = _v === void 0 ? {} : _v,
23228
+ _w = _a.verbiage,
23229
+ verbiage = _w === void 0 ? {} : _w,
23230
+ _x = _a.captureSignature,
23231
+ captureSignature = _x === void 0 ? false : _x,
23232
+ _y = _a.captureSignatureVideo,
23233
+ captureSignatureVideo = _y === void 0 ? false : _y,
23234
+ _z = _a.captureAdditionalDocuments,
23235
+ captureAdditionalDocuments = _z === void 0 ? [] : _z,
23236
+ _0 = _a.geolocationEnabled,
23237
+ geolocationEnabled = _0 === void 0 ? true : _0,
23238
+ _1 = _a.geolocationRequired,
23239
+ geolocationRequired = _1 === void 0 ? false : _1,
23240
+ _2 = _a.debugMode,
23241
+ debugMode = _2 === void 0 ? false : _2;
23230
23242
  useLanguage(lang);
23231
23243
  useDebugLogging(debugMode);
23232
23244
  var idCaptureProps = React.useMemo(function () {
@@ -23236,7 +23248,6 @@
23236
23248
  onModelError: onModelError,
23237
23249
  precapturedDocuments: precapturedDocuments,
23238
23250
  captureRequirement: idCaptureRequirement,
23239
- allowSinglePageIdCapture: allowSinglePageIdCapture,
23240
23251
  separateIdCardCaptureSequence: separateIdCardCaptureSequence,
23241
23252
  thresholds: idCaptureThresholds,
23242
23253
  skipSuccessScreen: skipSuccessScreen,
@@ -23259,7 +23270,7 @@
23259
23270
  verbiage: verbiage,
23260
23271
  debugMode: debugMode
23261
23272
  };
23262
- }, [onExitCapture, onUserCancel, onModelError, precapturedDocuments, idCaptureRequirement, allowSinglePageIdCapture, separateIdCardCaptureSequence, idCaptureThresholds, skipSuccessScreen, loadingOverlayMode, customOverlayContent, onLoadingOverlayDismissed, forceFallbackMode, allowIdCardBackToFrontCapture, instructions, guideType, guideImages, portraitGuidesOnMobile, rotateLoadingOverlayImageWhenPortrait, modelLoadTimeoutMs, enableOverrideWrongDocumentTypeDialog, allowOverrideWrongDocumentTypeAfterMs, assets, classNames, colors, verbiage, debugMode]);
23273
+ }, [onExitCapture, onUserCancel, onModelError, precapturedDocuments, idCaptureRequirement, separateIdCardCaptureSequence, idCaptureThresholds, skipSuccessScreen, loadingOverlayMode, customOverlayContent, onLoadingOverlayDismissed, forceFallbackMode, allowIdCardBackToFrontCapture, instructions, guideType, guideImages, portraitGuidesOnMobile, rotateLoadingOverlayImageWhenPortrait, modelLoadTimeoutMs, enableOverrideWrongDocumentTypeDialog, allowOverrideWrongDocumentTypeAfterMs, assets, classNames, colors, verbiage, debugMode]);
23263
23274
  var additionalDocumentCaptureProps = React.useMemo(function () {
23264
23275
  return {
23265
23276
  documents: captureAdditionalDocuments,
@@ -25615,7 +25626,9 @@
25615
25626
  try {
25616
25627
  root.unmount();
25617
25628
  originalRemove_1();
25618
- } catch (e) {}
25629
+ } catch (e) {
25630
+ debug('failed to unmount', e);
25631
+ }
25619
25632
  };
25620
25633
  }
25621
25634
  return targetElement;