idmission-web-sdk 2.0.4 → 2.1.1

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 (32) hide show
  1. package/README.md +36 -28
  2. package/dist/components/customer_flows/CustomerIdAndBiometricsEnrollment.d.ts +3 -12
  3. package/dist/components/customer_flows/IdAndFaceValidation.d.ts +3 -12
  4. package/dist/components/customer_flows/IdValidation.d.ts +3 -12
  5. package/dist/components/customer_flows/VideoIdValidation.d.ts +3 -12
  6. package/dist/components/id_capture/CapturedDocuments.d.ts +2 -0
  7. package/dist/components/id_capture/FocusModelProvider.d.ts +2 -1
  8. package/dist/components/id_capture/IdCapture.d.ts +5 -14
  9. package/dist/components/id_capture/IdCaptureModelsProvider.d.ts +7 -22
  10. package/dist/components/id_capture/IdCaptureStateProvider.d.ts +12 -38
  11. package/dist/components/id_capture/IdCaptureSuccess.d.ts +2 -3
  12. package/dist/components/id_capture/IdCaptureWizard.d.ts +3 -9
  13. package/dist/components/video_id/IdVideoCapture.d.ts +12 -7
  14. package/dist/components/video_id/IdVideoCaptureWizard.d.ts +3 -8
  15. package/dist/lib/models/DocumentDetection.d.ts +15 -12
  16. package/dist/lib/models/Focus.d.ts +6 -2
  17. package/dist/sdk2.cjs.development.js +774 -926
  18. package/dist/sdk2.cjs.development.js.map +1 -1
  19. package/dist/sdk2.cjs.production.js +1 -1
  20. package/dist/sdk2.cjs.production.js.map +1 -1
  21. package/dist/sdk2.esm.js +774 -926
  22. package/dist/sdk2.esm.js.map +1 -1
  23. package/dist/sdk2.umd.development.js +774 -926
  24. package/dist/sdk2.umd.development.js.map +1 -1
  25. package/dist/sdk2.umd.production.js +1 -1
  26. package/dist/sdk2.umd.production.js.map +1 -1
  27. package/dist/stories/Components/IdCapture/LicenseBackCapture.stories.d.ts +0 -48
  28. package/dist/stories/Components/IdCapture/LicenseFrontCapture.stories.d.ts +0 -45
  29. package/dist/stories/Components/IdCapture/PassportCapture.stories.d.ts +0 -47
  30. package/dist/stories/Components/IdCapture/Wizard.stories.d.ts +1 -77
  31. package/dist/version.d.ts +1 -1
  32. package/package.json +1 -1
package/dist/sdk2.esm.js CHANGED
@@ -14,7 +14,7 @@ import LanguageDetector from 'i18next-browser-languagedetector';
14
14
  import i18n from 'i18next';
15
15
  import SignatureCanvas from 'react-signature-canvas';
16
16
 
17
- var webSdkVersion = '2.0.4';
17
+ var webSdkVersion = '2.1.1';
18
18
 
19
19
  function getPlatform() {
20
20
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -1599,10 +1599,6 @@ function convertBase64ToBlob(base64Image) {
1599
1599
  });
1600
1600
  }
1601
1601
 
1602
- function supportsNativeBarcodeScanning() {
1603
- return 'BarcodeDetector' in window;
1604
- }
1605
-
1606
1602
  function getFrameDimensions(frame) {
1607
1603
  var frameWidth = frame.width,
1608
1604
  frameHeight = frame.height;
@@ -2474,10 +2470,14 @@ function waitForVideoReady(videoRef, checkEveryMs) {
2474
2470
  });
2475
2471
  }
2476
2472
 
2477
- var defaultFocusModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/focusmp20240523/model_float16.tflite";
2473
+ var defaultFocusModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/focusmp20240619/model_fp16.tflite";
2478
2474
  var defaultFocusModelLoadTimeoutMs = 45000;
2479
2475
  var defaultFocusThresholds = {
2480
- idCard: {
2476
+ idCardFront: {
2477
+ desktop: 0,
2478
+ mobile: 0.3
2479
+ },
2480
+ idCardBack: {
2481
2481
  desktop: 0,
2482
2482
  mobile: 0.3
2483
2483
  },
@@ -3100,14 +3100,19 @@ function sumUpProgressForDependencies(dependencies) {
3100
3100
  });
3101
3101
  }
3102
3102
 
3103
- var defaultDocumentDetectorModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/docdetectmp20240611/model_fp16.tflite";
3103
+ var defaultDocumentDetectorModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/docdetectmp20240614/model_fp16.tflite";
3104
3104
  var defaultDocumentDetectionScoreThreshold = 0.1;
3105
3105
  var defaultDocumentDetectionModelLoadTimeoutMs = 45000;
3106
3106
  var defaultDocumentDetectionThresholds = {
3107
- idCard: 0.8,
3108
- passport: 0.5,
3109
- mrz: 0.5,
3110
- pdf417: 0.15
3107
+ idCardFront: 0.8,
3108
+ idCardBack: 0.8,
3109
+ passport: 0.5
3110
+ };
3111
+ var documentTypeDisplayNames = {
3112
+ idCardFront: 'ID card front',
3113
+ idCardBack: 'ID card back',
3114
+ passport: 'Passport',
3115
+ none: 'None'
3111
3116
  };
3112
3117
  var detectors = {};
3113
3118
  function loadDocumentDetector(modelAssetPath, scoreThreshold) {
@@ -3262,34 +3267,33 @@ function processDocumentDetectorPrediction(prediction, thresholds) {
3262
3267
  return n > 0;
3263
3268
  });
3264
3269
  });
3265
- var bestIdCard = detectedObjects.find(function (obj) {
3270
+ var bestIdCardFront = detectedObjects.find(function (obj) {
3266
3271
  return obj.label === 'Document';
3267
3272
  });
3273
+ var bestIdCardBack = detectedObjects.find(function (obj) {
3274
+ return obj.label === 'Document back';
3275
+ });
3268
3276
  var bestPassportPage = detectedObjects.find(function (obj) {
3269
3277
  return obj.label === 'Passport page';
3270
3278
  });
3271
- var passportDetectionScore = (_a = bestPassportPage === null || bestPassportPage === void 0 ? void 0 : bestPassportPage.score) !== null && _a !== void 0 ? _a : 0;
3272
- var passportDetectionThresholdMet = passportDetectionScore >= ((_b = thresholds.passport) !== null && _b !== void 0 ? _b : 0);
3273
- var bestDocument = passportDetectionThresholdMet ? bestPassportPage : bestIdCard;
3274
- var detectionScore = (_c = bestDocument === null || bestDocument === void 0 ? void 0 : bestDocument.score) !== null && _c !== void 0 ? _c : 0;
3275
- var detectionThreshold = passportDetectionThresholdMet ? thresholds.passport : thresholds.idCard;
3279
+ var idCardFrontDetectionScore = (_a = bestIdCardFront === null || bestIdCardFront === void 0 ? void 0 : bestIdCardFront.score) !== null && _a !== void 0 ? _a : 0;
3280
+ var idCardBackDetectionScore = (_b = bestIdCardBack === null || bestIdCardBack === void 0 ? void 0 : bestIdCardBack.score) !== null && _b !== void 0 ? _b : 0;
3281
+ var passportDetectionScore = (_c = bestPassportPage === null || bestPassportPage === void 0 ? void 0 : bestPassportPage.score) !== null && _c !== void 0 ? _c : 0;
3282
+ var idCardFrontDetectionThresholdMet = idCardFrontDetectionScore >= ((_d = thresholds.idCardFront) !== null && _d !== void 0 ? _d : 0);
3283
+ var idCardBackDetectionThresholdMet = idCardBackDetectionScore >= ((_e = thresholds.idCardBack) !== null && _e !== void 0 ? _e : 0);
3284
+ var passportDetectionThresholdMet = passportDetectionScore >= ((_f = thresholds.passport) !== null && _f !== void 0 ? _f : 0);
3285
+ var bestDocument = passportDetectionThresholdMet ? bestPassportPage : idCardBackDetectionThresholdMet ? bestIdCardBack : bestIdCardFront;
3286
+ var detectionThreshold = passportDetectionThresholdMet ? thresholds.passport : idCardBackDetectionThresholdMet ? thresholds.idCardBack : thresholds.idCardFront;
3287
+ var detectionScore = (_g = bestDocument === null || bestDocument === void 0 ? void 0 : bestDocument.score) !== null && _g !== void 0 ? _g : 0;
3276
3288
  var detectionThresholdMet = detectionScore >= (detectionThreshold !== null && detectionThreshold !== void 0 ? detectionThreshold : 0);
3277
3289
  var detectedDocumentType = 'none';
3278
3290
  if (passportDetectionThresholdMet) {
3279
3291
  detectedDocumentType = 'passport';
3292
+ } else if (idCardBackDetectionThresholdMet) {
3293
+ detectedDocumentType = 'idCardBack';
3280
3294
  } else if (detectionThresholdMet) {
3281
- detectedDocumentType = 'idCard';
3295
+ detectedDocumentType = 'idCardFront';
3282
3296
  }
3283
- var bestMrz = detectedObjects.find(function (obj) {
3284
- return obj.label === 'MRZ';
3285
- });
3286
- var mrzDetectionScore = (_d = bestMrz === null || bestMrz === void 0 ? void 0 : bestMrz.score) !== null && _d !== void 0 ? _d : 0;
3287
- var mrzDetectionThresholdMet = mrzDetectionScore >= ((_e = thresholds.mrz) !== null && _e !== void 0 ? _e : 0);
3288
- var bestPdf417 = detectedObjects.find(function (obj) {
3289
- return obj.label === 'PDF417';
3290
- });
3291
- var pdf417DetectionScore = (_f = bestPdf417 === null || bestPdf417 === void 0 ? void 0 : bestPdf417.score) !== null && _f !== void 0 ? _f : 0;
3292
- var pdf417DetectionThresholdMet = pdf417DetectionScore >= ((_g = thresholds.pdf417) !== null && _g !== void 0 ? _g : 0);
3293
3297
  var documentInBounds = false;
3294
3298
  if (bestDocument) {
3295
3299
  var boundaryPx = 20;
@@ -3319,15 +3323,13 @@ function processDocumentDetectorPrediction(prediction, thresholds) {
3319
3323
  detectionTime: time,
3320
3324
  detectionThresholdMet: detectionThresholdMet,
3321
3325
  detectedDocumentType: detectedDocumentType,
3326
+ idCardFrontDetectionScore: idCardFrontDetectionScore,
3327
+ idCardFrontDetectionThresholdMet: idCardFrontDetectionThresholdMet,
3328
+ idCardBackDetectionScore: idCardBackDetectionScore,
3329
+ idCardBackDetectionThresholdMet: idCardBackDetectionThresholdMet,
3322
3330
  passportDetectionScore: passportDetectionScore,
3323
3331
  passportDetectionThresholdMet: passportDetectionThresholdMet,
3324
- mrzDetectionScore: mrzDetectionScore,
3325
- mrzDetectionThresholdMet: mrzDetectionThresholdMet,
3326
- pdf417DetectionScore: pdf417DetectionScore,
3327
- pdf417DetectionThresholdMet: pdf417DetectionThresholdMet,
3328
3332
  bestDocument: bestDocument,
3329
- bestMrz: bestMrz,
3330
- bestPdf417: bestPdf417,
3331
3333
  documentInBounds: documentInBounds,
3332
3334
  documentTooClose: documentTooClose,
3333
3335
  frameWidth: frameWidth,
@@ -3575,24 +3577,26 @@ function FocusModelProvider(_a) {
3575
3577
  focusModelPath = _b === void 0 ? defaultFocusModelPath : _b,
3576
3578
  _c = _a.focusModelLoadTimeoutMs,
3577
3579
  focusModelLoadTimeoutMs = _c === void 0 ? defaultFocusModelLoadTimeoutMs : _c,
3578
- onFocusModelError = _a.onFocusModelError;
3580
+ onFocusModelError = _a.onFocusModelError,
3581
+ _d = _a.showCanvases,
3582
+ showCanvases = _d === void 0 ? false : _d;
3579
3583
  var cropCanvas = useRef(null);
3580
3584
  var rotateCanvas = useRef(null);
3581
- var _d = useState({}),
3582
- focusThresholds = _d[0],
3583
- setFocusThresholds = _d[1];
3584
- var _e = useState(0),
3585
- focusPredictionTime = _e[0],
3586
- setFocusPredictionTime = _e[1];
3587
- var _f = useLoadFocusModel({
3585
+ var _e = useState({}),
3586
+ focusThresholds = _e[0],
3587
+ setFocusThresholds = _e[1];
3588
+ var _f = useState(0),
3589
+ focusPredictionTime = _f[0],
3590
+ setFocusPredictionTime = _f[1];
3591
+ var _g = useLoadFocusModel({
3588
3592
  modelPath: focusModelPath,
3589
3593
  modelLoadTimeoutMs: focusModelLoadTimeoutMs,
3590
3594
  onModelError: onFocusModelError
3591
3595
  }),
3592
- model = _f.model,
3593
- ready = _f.ready,
3594
- modelDownloadProgress = _f.modelDownloadProgress,
3595
- modelError = _f.modelError;
3596
+ model = _g.model,
3597
+ ready = _g.ready,
3598
+ modelDownloadProgress = _g.modelDownloadProgress,
3599
+ modelError = _g.modelError;
3596
3600
  var makeFocusPrediction = useCallback(function (imageData, box) {
3597
3601
  if (!model.current) return null;
3598
3602
  var prediction = makeFocusModelPrediction(model.current, imageData, cropCanvas.current, rotateCanvas.current, box);
@@ -3613,13 +3617,23 @@ function FocusModelProvider(_a) {
3613
3617
  return /*#__PURE__*/React__default.createElement(FocusModelContext.Provider, {
3614
3618
  value: value
3615
3619
  }, /*#__PURE__*/React__default.createElement(InvisibleCanvas, {
3616
- ref: rotateCanvas
3620
+ ref: rotateCanvas,
3621
+ style: showCanvases ? {
3622
+ display: 'block'
3623
+ } : undefined
3617
3624
  }), /*#__PURE__*/React__default.createElement(InvisibleCanvas, {
3618
- ref: cropCanvas
3625
+ ref: cropCanvas,
3626
+ style: showCanvases ? {
3627
+ display: 'block'
3628
+ } : undefined
3619
3629
  }), children);
3620
3630
  }
3621
3631
 
3622
3632
  var onMobile = isMobile();
3633
+ var defaultIdCaptureThresholds = {
3634
+ detection: defaultDocumentDetectionThresholds,
3635
+ focus: defaultFocusThresholds
3636
+ };
3623
3637
  var IdCaptureModelsContext = /*#__PURE__*/createContext({
3624
3638
  ready: false,
3625
3639
  start: function start() {
@@ -3630,7 +3644,7 @@ var IdCaptureModelsContext = /*#__PURE__*/createContext({
3630
3644
  },
3631
3645
  modelDownloadProgress: 0,
3632
3646
  modelError: null,
3633
- thresholds: {},
3647
+ thresholds: defaultIdCaptureThresholds,
3634
3648
  setThresholds: function setThresholds() {
3635
3649
  return null;
3636
3650
  },
@@ -3645,6 +3659,10 @@ var IdCaptureModelsContext = /*#__PURE__*/createContext({
3645
3659
  },
3646
3660
  resetBestFrame: function resetBestFrame() {
3647
3661
  return null;
3662
+ },
3663
+ requiredDocumentType: 'none',
3664
+ setRequiredDocumentType: function setRequiredDocumentType() {
3665
+ return null;
3648
3666
  }
3649
3667
  });
3650
3668
  function IdCaptureModelsProviderInner(_a) {
@@ -3677,46 +3695,54 @@ function IdCaptureModelsProviderInner(_a) {
3677
3695
  var bestPredictionCanvas = useRef(null);
3678
3696
  var bestFocusScore = useRef(0);
3679
3697
  var stopDetection = useRef(0);
3698
+ var _e = useState('none'),
3699
+ requiredDocumentType = _e[0],
3700
+ setRequiredDocumentType = _e[1];
3680
3701
  var thresholds = useMemo(function () {
3681
3702
  return __assign(__assign({}, documentDetectionThresholds), {
3682
3703
  focus: focusThresholds
3683
3704
  });
3684
3705
  }, [documentDetectionThresholds, focusThresholds]);
3685
3706
  var setThresholds = useCallback(function (thresholds) {
3686
- setDocumentDetectionThresholds(thresholds);
3687
- if (thresholds.focus) setFocusThresholds(thresholds.focus);
3707
+ if (thresholds.detection) {
3708
+ setDocumentDetectionThresholds(thresholds.detection);
3709
+ }
3710
+ if (thresholds.focus) {
3711
+ setFocusThresholds(thresholds.focus);
3712
+ }
3688
3713
  }, [setDocumentDetectionThresholds, setFocusThresholds]);
3689
3714
  useEffect(function handleDetections() {
3690
3715
  var _this = this;
3691
3716
  onDocumentDetected(function (prediction) {
3692
3717
  return __awaiter(_this, void 0, void 0, function () {
3693
- var stopDetectionAtStart, focusPredictionTime, focusScore, focusThresholdMet, focusPrediction, focusThresholdSet, focusThreshold;
3694
- var _a, _b, _c, _d, _e;
3695
- return __generator(this, function (_f) {
3718
+ var stopDetectionAtStart, focusPredictionTime, focusScore, focusThresholdMet, isRequiredDocumentType, focusPrediction, focusThresholdSet, focusThreshold;
3719
+ var _a, _b, _c, _d, _e, _f;
3720
+ return __generator(this, function (_g) {
3696
3721
  if (!lastPredictionCanvas.current) return [2 /*return*/];
3697
3722
  stopDetectionAtStart = stopDetection.current;
3698
3723
  focusPredictionTime = 0, focusScore = 0, focusThresholdMet = false;
3699
- if (prediction.detectedDocumentType !== 'none' && prediction.detectionThresholdMet && prediction.documentInBounds && !prediction.documentTooClose) {
3700
- focusPrediction = makeFocusPrediction(lastPredictionCanvas.current, (_a = prediction.bestDocument) === null || _a === void 0 ? void 0 : _a.box);
3724
+ isRequiredDocumentType = requiredDocumentType === 'none' || prediction.detectedDocumentType === requiredDocumentType || ((_a = requiredDocumentType.includes) === null || _a === void 0 ? void 0 : _a.call(requiredDocumentType, prediction.detectedDocumentType));
3725
+ if (isRequiredDocumentType && prediction.detectedDocumentType !== 'none' && prediction.detectionThresholdMet && prediction.documentInBounds && !prediction.documentTooClose) {
3726
+ focusPrediction = makeFocusPrediction(lastPredictionCanvas.current, (_b = prediction.bestDocument) === null || _b === void 0 ? void 0 : _b.box);
3701
3727
  if (focusPrediction) {
3702
3728
  focusScore = focusPrediction.score;
3703
3729
  focusPredictionTime = focusPrediction.predictionTime;
3704
3730
  }
3705
- focusThresholdSet = (_b = thresholds.focus) === null || _b === void 0 ? void 0 : _b[prediction.detectedDocumentType];
3706
- focusThreshold = (_c = onMobile ? focusThresholdSet === null || focusThresholdSet === void 0 ? void 0 : focusThresholdSet.mobile : focusThresholdSet === null || focusThresholdSet === void 0 ? void 0 : focusThresholdSet.desktop) !== null && _c !== void 0 ? _c : 0;
3731
+ focusThresholdSet = (_c = thresholds.focus) === null || _c === void 0 ? void 0 : _c[prediction.detectedDocumentType];
3732
+ 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;
3707
3733
  focusThresholdMet = focusScore >= focusThreshold;
3708
3734
  if (bestFocusScore.current <= focusScore && stopDetectionAtStart === stopDetection.current) {
3709
3735
  bestFocusScore.current = focusScore;
3710
3736
  drawToCanvas(bestPredictionCanvas.current, lastPredictionCanvas.current);
3711
3737
  setBestFrameDetails({
3712
- boundingBox: (_d = prediction.bestDocument) === null || _d === void 0 ? void 0 : _d.box,
3738
+ boundingBox: (_e = prediction.bestDocument) === null || _e === void 0 ? void 0 : _e.box,
3713
3739
  documentType: prediction.detectedDocumentType,
3714
3740
  detectionScore: prediction.detectionScore,
3715
3741
  focusScore: focusScore
3716
3742
  });
3717
3743
  }
3718
3744
  }
3719
- (_e = onPredictionHandler.current) === null || _e === void 0 ? void 0 : _e.call(onPredictionHandler, __assign(__assign({}, prediction), {
3745
+ (_f = onPredictionHandler.current) === null || _f === void 0 ? void 0 : _f.call(onPredictionHandler, __assign(__assign({}, prediction), {
3720
3746
  focusScore: focusScore,
3721
3747
  focusPredictionTime: focusPredictionTime,
3722
3748
  focusThresholdMet: focusThresholdMet
@@ -3725,7 +3751,7 @@ function IdCaptureModelsProviderInner(_a) {
3725
3751
  });
3726
3752
  });
3727
3753
  });
3728
- }, [lastPredictionCanvas, makeFocusPrediction, onDocumentDetected, thresholds.focus]);
3754
+ }, [lastPredictionCanvas, makeFocusPrediction, onDocumentDetected, requiredDocumentType, thresholds.focus]);
3729
3755
  var modelError = documentDetectionModelError !== null && documentDetectionModelError !== void 0 ? documentDetectionModelError : focusModelError;
3730
3756
  useEffect(function handleModelErrors() {
3731
3757
  modelError && (onModelError === null || onModelError === void 0 ? void 0 : onModelError(modelError));
@@ -3739,9 +3765,9 @@ function IdCaptureModelsProviderInner(_a) {
3739
3765
  canvas: bestPredictionCanvas.current
3740
3766
  });
3741
3767
  }, [bestFrameDetails]);
3742
- var _e = useState(0),
3743
- canvasKey = _e[0],
3744
- setCanvasKey = _e[1];
3768
+ var _f = useState(0),
3769
+ canvasKey = _f[0],
3770
+ setCanvasKey = _f[1];
3745
3771
  var resetBestFrame = useCallback(function () {
3746
3772
  stopDetection.current += 1;
3747
3773
  setCanvasKey(function (n) {
@@ -3751,6 +3777,9 @@ function IdCaptureModelsProviderInner(_a) {
3751
3777
  setBestFrameDetails(null);
3752
3778
  bestFocusScore.current = 0;
3753
3779
  }, [clearDocumentDetectionLastPredictionCanvas]);
3780
+ useEffect(function () {
3781
+ requiredDocumentType && resetBestFrame();
3782
+ }, [requiredDocumentType, resetBestFrame]);
3754
3783
  var value = useMemo(function () {
3755
3784
  return {
3756
3785
  ready: documentDetectionModelReady && focusModelReady,
@@ -3765,9 +3794,11 @@ function IdCaptureModelsProviderInner(_a) {
3765
3794
  focusPredictionTime: focusPredictionTime,
3766
3795
  getBestFrame: getBestFrame,
3767
3796
  resetBestFrame: resetBestFrame,
3768
- bestFrameDetails: bestFrameDetails
3797
+ bestFrameDetails: bestFrameDetails,
3798
+ requiredDocumentType: requiredDocumentType,
3799
+ setRequiredDocumentType: setRequiredDocumentType
3769
3800
  };
3770
- }, [bestFrameDetails, detectionTime, documentDetectionModelDownloadProgress, documentDetectionModelReady, focusModelDownloadProgress, focusModelReady, focusPredictionTime, getBestFrame, modelError, onPredictionMade, resetBestFrame, setThresholds, startDocumentDetection, stopDocumentDetection, thresholds]);
3801
+ }, [bestFrameDetails, detectionTime, documentDetectionModelDownloadProgress, documentDetectionModelReady, focusModelDownloadProgress, focusModelReady, focusPredictionTime, getBestFrame, modelError, onPredictionMade, requiredDocumentType, resetBestFrame, setThresholds, startDocumentDetection, stopDocumentDetection, thresholds]);
3771
3802
  return /*#__PURE__*/React__default.createElement(IdCaptureModelsContext.Provider, {
3772
3803
  value: value
3773
3804
  }, /*#__PURE__*/React__default.createElement(InvisibleCanvas, {
@@ -3816,28 +3847,20 @@ var initialState$4 = {
3816
3847
  videoHeight: 0,
3817
3848
  detectedObjects: [],
3818
3849
  bestDocument: undefined,
3819
- bestMrz: undefined,
3820
- bestPdf417: undefined,
3821
- documentType: 'none',
3850
+ detectedDocumentType: 'none',
3851
+ detectionThresholdMet: false,
3822
3852
  documentInBounds: false,
3823
3853
  documentTooClose: false,
3824
- documentDetectionScore: 0,
3825
- documentDetectionThresholdMet: false,
3826
- passportPageDetectionScore: 0,
3827
- passportPageDetectionThresholdMet: false,
3828
- mrzDetectionScore: 0,
3829
- mrzDetectionThresholdMet: false,
3830
- pdf417DetectionScore: 0,
3831
- pdf417DetectionThresholdMet: false,
3854
+ flipRequired: false,
3855
+ backDetectedFirst: false,
3856
+ idCardFrontDetectionScore: 0,
3857
+ idCardFrontDetectionThresholdMet: false,
3858
+ idCardBackDetectionScore: 0,
3859
+ idCardBackDetectionThresholdMet: false,
3860
+ passportDetectionScore: 0,
3861
+ passportDetectionThresholdMet: false,
3832
3862
  focusScore: 0,
3833
3863
  focusThresholdMet: false,
3834
- barcodeScanningEnabled: false,
3835
- barcodeResult: null,
3836
- waitingForBarcodeScan: false,
3837
- shouldScanBarcode: false,
3838
- autoCaptureBarcodeRequired: 'mobile',
3839
- barcodeScanFailedAttempts: 0,
3840
- maxBarcodeScanAttempts: 10,
3841
3864
  isGoodFrame: false,
3842
3865
  goodFramesCount: 0,
3843
3866
  goodFramesThreshold: 3,
@@ -3851,8 +3874,6 @@ var initialState$4 = {
3851
3874
  capturedDocuments: {},
3852
3875
  captureRequirement: 'idCardOrPassport',
3853
3876
  requestedDocumentType: 'idCardFront',
3854
- detectedDocumentType: 'none',
3855
- differentDocumentTypeDetections: 0,
3856
3877
  operationStartedAt: null,
3857
3878
  captureStartedAt: null
3858
3879
  };
@@ -3887,11 +3908,6 @@ var reducer$4 = function reducer(state, action) {
3887
3908
  newState.operationStartedAt = new Date();
3888
3909
  return newState;
3889
3910
  }
3890
- case 'configureCapture':
3891
- return __assign(__assign(__assign({}, state), action.payload), {
3892
- capturing: false,
3893
- captureFailed: false
3894
- });
3895
3911
  case 'setRequiredDocumentType':
3896
3912
  return __assign(__assign({}, state), {
3897
3913
  requiredDocumentType: action.payload
@@ -3928,18 +3944,15 @@ var reducer$4 = function reducer(state, action) {
3928
3944
  case 'objectsDetected':
3929
3945
  var _d = action.payload.prediction,
3930
3946
  detectedObjects = _d.detectedObjects,
3931
- detectionScore = _d.detectionScore,
3932
3947
  detectionThresholdMet = _d.detectionThresholdMet,
3933
3948
  detectedDocumentType = _d.detectedDocumentType,
3949
+ idCardFrontDetectionScore = _d.idCardFrontDetectionScore,
3950
+ idCardFrontDetectionThresholdMet = _d.idCardFrontDetectionThresholdMet,
3951
+ idCardBackDetectionScore = _d.idCardBackDetectionScore,
3952
+ idCardBackDetectionThresholdMet = _d.idCardBackDetectionThresholdMet,
3934
3953
  passportDetectionScore = _d.passportDetectionScore,
3935
3954
  passportDetectionThresholdMet = _d.passportDetectionThresholdMet,
3936
- mrzDetectionScore = _d.mrzDetectionScore,
3937
- mrzDetectionThresholdMet = _d.mrzDetectionThresholdMet,
3938
- pdf417DetectionScore = _d.pdf417DetectionScore,
3939
- pdf417DetectionThresholdMet = _d.pdf417DetectionThresholdMet,
3940
3955
  bestDocument = _d.bestDocument,
3941
- bestMrz = _d.bestMrz,
3942
- bestPdf417 = _d.bestPdf417,
3943
3956
  documentInBounds = _d.documentInBounds,
3944
3957
  documentTooClose = _d.documentTooClose,
3945
3958
  focusScore = _d.focusScore,
@@ -3955,84 +3968,50 @@ var reducer$4 = function reducer(state, action) {
3955
3968
  goodFramesThreshold = Math.ceil(3 * frameCaptureRate);
3956
3969
  }
3957
3970
  }
3958
- var barcodeScanRequired = state.autoCaptureBarcodeRequired === true || state.autoCaptureBarcodeRequired === 'mobile' && isMobile();
3959
- var shouldScanBarcode = state.barcodeScanningEnabled && pdf417DetectionThresholdMet && barcodeScanRequired;
3960
- var waitingForBarcodeScan = shouldScanBarcode && !state.barcodeResult;
3961
- var isGoodFrame = detectionThresholdMet && documentInBounds && !documentTooClose && focusThresholdMet;
3971
+ var flipRequired = state.requestedDocumentType === 'idCardBack' && detectedDocumentType === 'idCardFront';
3972
+ var backDetectedFirst = state.requestedDocumentType.includes('idCardFront') && detectedDocumentType === 'idCardBack';
3973
+ var isGoodFrame = detectionThresholdMet && documentInBounds && !documentTooClose && !flipRequired && !backDetectedFirst && focusThresholdMet;
3962
3974
  var goodFramesCount = state.goodFramesCount;
3963
3975
  if (isGoodFrame) {
3964
3976
  goodFramesCount += 1;
3965
3977
  }
3978
+ var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
3979
+ var requestedDocumentType = state.requestedDocumentType;
3980
+ if (state.captureRequirement === 'idCardOrPassport') {
3981
+ if (detectedDocumentType === 'passport' && state.requestedDocumentType !== 'passport') {
3982
+ requestedDocumentType = 'passport';
3983
+ }
3984
+ if (requestedDocumentType === 'passport' && passportDetectionScore < 0.3) {
3985
+ requestedDocumentType = 'idCardFront' in state.capturedDocuments ? 'idCardBack' : 'idCardFront';
3986
+ }
3987
+ }
3966
3988
  return __assign(__assign({}, state), {
3967
3989
  videoWidth: frameWidth,
3968
3990
  videoHeight: frameHeight,
3969
3991
  detectedObjects: detectedObjects,
3970
3992
  bestDocument: bestDocument,
3971
- bestMrz: bestMrz,
3972
- bestPdf417: bestPdf417,
3973
- documentType: detectedDocumentType,
3993
+ requestedDocumentType: requestedDocumentType,
3994
+ detectedDocumentType: detectedDocumentType,
3995
+ detectionThresholdMet: detectionThresholdMet,
3974
3996
  documentInBounds: documentInBounds,
3975
3997
  documentTooClose: documentTooClose,
3976
- documentDetectionScore: detectionScore,
3977
- documentDetectionThresholdMet: detectionThresholdMet,
3978
- mrzDetectionScore: mrzDetectionScore,
3979
- mrzDetectionThresholdMet: mrzDetectionThresholdMet,
3980
- pdf417DetectionScore: pdf417DetectionScore,
3981
- pdf417DetectionThresholdMet: pdf417DetectionThresholdMet,
3982
- passportPageDetectionScore: passportDetectionScore,
3983
- passportPageDetectionThresholdMet: passportDetectionThresholdMet,
3998
+ flipRequired: flipRequired,
3999
+ backDetectedFirst: backDetectedFirst,
4000
+ idCardFrontDetectionScore: idCardFrontDetectionScore,
4001
+ idCardFrontDetectionThresholdMet: idCardFrontDetectionThresholdMet,
4002
+ idCardBackDetectionScore: idCardBackDetectionScore,
4003
+ idCardBackDetectionThresholdMet: idCardBackDetectionThresholdMet,
4004
+ passportDetectionScore: passportDetectionScore,
4005
+ passportDetectionThresholdMet: passportDetectionThresholdMet,
3984
4006
  focusScore: focusScore,
3985
4007
  focusThresholdMet: focusThresholdMet,
3986
- shouldScanBarcode: shouldScanBarcode,
3987
- waitingForBarcodeScan: waitingForBarcodeScan,
3988
4008
  isGoodFrame: isGoodFrame,
3989
4009
  goodFramesCount: goodFramesCount,
3990
4010
  goodFramesThreshold: goodFramesThreshold,
3991
- goodFramesThresholdMet: goodFramesCount >= goodFramesThreshold,
4011
+ goodFramesThresholdMet: goodFramesThresholdMet,
3992
4012
  lastFrameCapturedAt: frameCapturedAt,
3993
4013
  frameCaptureRate: frameCaptureRate
3994
4014
  });
3995
- case 'predictionMade':
3996
- {
3997
- var _e = action.payload,
3998
- detectedDocumentType_1 = _e.detectedDocumentType,
3999
- passportDetectionScore_1 = _e.passportDetectionScore;
4000
- var requestedDocumentType = state.requestedDocumentType;
4001
- var newState = __assign(__assign({}, state), {
4002
- detectedDocumentType: detectedDocumentType_1
4003
- });
4004
- if (state.captureRequirement === 'idCardOrPassport') {
4005
- var predictionIsRequestedType = requestedDocumentType.startsWith(detectedDocumentType_1);
4006
- if (predictionIsRequestedType) {
4007
- newState.differentDocumentTypeDetections = 0;
4008
- }
4009
- if (detectedDocumentType_1 === 'passport' && requestedDocumentType !== 'passport') {
4010
- newState.requestedDocumentType = 'passport';
4011
- }
4012
- if (requestedDocumentType === 'passport' && passportDetectionScore_1 < 0.3) {
4013
- newState.requestedDocumentType = 'idCardFront' in state.capturedDocuments ? 'idCardBack' : 'idCardFront';
4014
- }
4015
- }
4016
- return newState;
4017
- }
4018
- case 'barcodeScanned':
4019
- return __assign(__assign({}, state), {
4020
- barcodeResult: action.payload.result,
4021
- waitingForBarcodeScan: false,
4022
- autoCaptureBarcodeRequired: false
4023
- });
4024
- case 'barcodeScanFailed':
4025
- {
4026
- var newState = __assign(__assign({}, state), {
4027
- barcodeScanFailedAttempts: state.barcodeScanFailedAttempts + 1
4028
- });
4029
- if (newState.barcodeScanFailedAttempts >= newState.maxBarcodeScanAttempts) {
4030
- newState.autoCaptureBarcodeRequired = false;
4031
- newState.shouldScanBarcode = false;
4032
- newState.waitingForBarcodeScan = false;
4033
- }
4034
- return newState;
4035
- }
4036
4015
  case 'captureStarted':
4037
4016
  return __assign(__assign({}, state), {
4038
4017
  captureStartedAt: new Date(),
@@ -4084,8 +4063,9 @@ var reducer$4 = function reducer(state, action) {
4084
4063
  newState_1.requestedDocumentType = remainingRequirements[0];
4085
4064
  if (state.requestedDocumentType === 'idCardFront' && newState_1.requestedDocumentType === 'idCardBack') {
4086
4065
  newState_1.captureState = 'requestingFlip';
4087
- newState_1.documentDetectionThresholdMet = false;
4088
- newState_1.passportPageDetectionThresholdMet = false;
4066
+ newState_1.idCardFrontDetectionThresholdMet = false;
4067
+ newState_1.idCardBackDetectionThresholdMet = false;
4068
+ newState_1.passportDetectionThresholdMet = false;
4089
4069
  }
4090
4070
  }
4091
4071
  return newState_1;
@@ -4116,8 +4096,9 @@ var reducer$4 = function reducer(state, action) {
4116
4096
  newState_2.requestedDocumentType = remainingRequirements[0];
4117
4097
  if (state.requestedDocumentType === 'idCardFront' && newState_2.requestedDocumentType === 'idCardBack') {
4118
4098
  newState_2.captureState = 'requestingFlip';
4119
- newState_2.documentDetectionThresholdMet = false;
4120
- newState_2.passportPageDetectionThresholdMet = false;
4099
+ newState_2.idCardFrontDetectionThresholdMet = false;
4100
+ newState_2.idCardBackDetectionThresholdMet = false;
4101
+ newState_2.passportDetectionThresholdMet = false;
4121
4102
  }
4122
4103
  }
4123
4104
  return newState_2;
@@ -4562,85 +4543,42 @@ var templateObject_1$A, templateObject_2$p;
4562
4543
  var DEFAULT_CDN_URL = 'https://websdk-cdn-dev.idmission.com/assets';
4563
4544
 
4564
4545
  var IdCapture = function IdCapture(_a) {
4565
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
4546
+ var _b, _c, _d, _e, _f, _g, _h, _j;
4566
4547
  var requiredDocumentType = _a.requiredDocumentType,
4567
- _m = _a.autoCaptureEnabled,
4568
- autoCaptureEnabled = _m === void 0 ? true : _m,
4569
- _o = _a.autoCaptureBarcodeRequired,
4570
- autoCaptureBarcodeRequired = _o === void 0 ? 'mobile' : _o,
4571
- _p = _a.idCardDetectionThreshold,
4572
- idCardDetectionThreshold = _p === void 0 ? defaultDocumentDetectionThresholds.idCard : _p,
4573
- _q = _a.passportDetectionThreshold,
4574
- passportDetectionThreshold = _q === void 0 ? defaultDocumentDetectionThresholds.passport : _q,
4575
- _r = _a.mrzDetectionScoreThreshold,
4576
- mrzDetectionScoreThreshold = _r === void 0 ? defaultDocumentDetectionThresholds.mrz : _r,
4577
- _s = _a.pdf417DetectionThreshold,
4578
- pdf417DetectionThreshold = _s === void 0 ? defaultDocumentDetectionThresholds.pdf417 : _s,
4579
- _t = _a.idCardFocusScoreThreshold,
4580
- idCardFocusScoreThreshold = _t === void 0 ? (_b = defaultFocusThresholds.idCard) === null || _b === void 0 ? void 0 : _b.mobile : _t,
4581
- _u = _a.passportFocusScoreThreshold,
4582
- passportFocusScoreThreshold = _u === void 0 ? (_c = defaultFocusThresholds.passport) === null || _c === void 0 ? void 0 : _c.mobile : _u,
4583
- _v = _a.barcodeScanningEnabled,
4584
- barcodeScanningEnabled = _v === void 0 ? true : _v,
4585
- _w = _a.maxBarcodeScanAttempts,
4586
- maxBarcodeScanAttempts = _w === void 0 ? 10 : _w,
4548
+ _k = _a.thresholds,
4549
+ thresholds = _k === void 0 ? defaultIdCaptureThresholds : _k,
4587
4550
  guidanceMessage = _a.guidanceMessage,
4588
4551
  guidanceSatisfied = _a.guidanceSatisfied,
4589
- onPrediction = _a.onPrediction,
4590
4552
  onCapture = _a.onCapture,
4591
- _x = _a.assets,
4592
- assets = _x === void 0 ? {} : _x,
4593
- _y = _a.classNames,
4594
- classNames = _y === void 0 ? {} : _y,
4595
- _z = _a.colors,
4596
- colors = _z === void 0 ? {} : _z,
4597
- _0 = _a.verbiage,
4598
- rawVerbiage = _0 === void 0 ? {} : _0,
4599
- _1 = _a.debugMode,
4600
- debugMode = _1 === void 0 ? false : _1;
4601
- var _2 = useResizeObserver(),
4602
- ref = _2.ref,
4603
- _3 = _2.width,
4604
- width = _3 === void 0 ? 1 : _3,
4605
- _4 = _2.height,
4606
- height = _4 === void 0 ? 1 : _4;
4607
- var _5 = useIdCaptureState(),
4608
- state = _5[0],
4609
- dispatch = _5[1];
4553
+ _l = _a.assets,
4554
+ assets = _l === void 0 ? {} : _l,
4555
+ _m = _a.classNames,
4556
+ classNames = _m === void 0 ? {} : _m,
4557
+ _o = _a.colors,
4558
+ colors = _o === void 0 ? {} : _o,
4559
+ _p = _a.verbiage,
4560
+ rawVerbiage = _p === void 0 ? {} : _p,
4561
+ _q = _a.debugMode,
4562
+ debugMode = _q === void 0 ? false : _q;
4563
+ var _r = useResizeObserver(),
4564
+ ref = _r.ref,
4565
+ _s = _r.width,
4566
+ width = _s === void 0 ? 1 : _s,
4567
+ _t = _r.height,
4568
+ height = _t === void 0 ? 1 : _t;
4569
+ var _u = useIdCaptureState(),
4570
+ state = _u[0],
4571
+ dispatch = _u[1];
4610
4572
  var cameraRef = useContext(CameraStateContext).cameraRef;
4611
- var _6 = useContext(IdCaptureModelsContext),
4612
- modelsReady = _6.ready,
4613
- setThresholds = _6.setThresholds,
4614
- onPredictionMade = _6.onPredictionMade,
4615
- detectionTime = _6.detectionTime,
4616
- focusPredictionTime = _6.focusPredictionTime,
4617
- getBestFrame = _6.getBestFrame;
4573
+ var _v = useContext(IdCaptureModelsContext),
4574
+ modelsReady = _v.ready,
4575
+ setThresholds = _v.setThresholds,
4576
+ detectionTime = _v.detectionTime,
4577
+ focusPredictionTime = _v.focusPredictionTime,
4578
+ getBestFrame = _v.getBestFrame;
4618
4579
  useEffect(function () {
4619
- dispatch({
4620
- type: 'configureCapture',
4621
- payload: {
4622
- autoCaptureBarcodeRequired: autoCaptureBarcodeRequired,
4623
- barcodeScanningEnabled: barcodeScanningEnabled,
4624
- maxBarcodeScanAttempts: maxBarcodeScanAttempts
4625
- }
4626
- });
4627
- }, [autoCaptureBarcodeRequired, barcodeScanningEnabled, dispatch, maxBarcodeScanAttempts]);
4628
- useEffect(function () {
4629
- setThresholds({
4630
- idCard: idCardDetectionThreshold,
4631
- passport: passportDetectionThreshold,
4632
- mrz: mrzDetectionScoreThreshold,
4633
- pdf417: pdf417DetectionThreshold,
4634
- focus: {
4635
- idCard: {
4636
- mobile: idCardFocusScoreThreshold
4637
- },
4638
- passport: {
4639
- mobile: passportFocusScoreThreshold
4640
- }
4641
- }
4642
- });
4643
- }, [idCardDetectionThreshold, idCardFocusScoreThreshold, mrzDetectionScoreThreshold, passportDetectionThreshold, passportFocusScoreThreshold, pdf417DetectionThreshold, setThresholds]);
4580
+ setThresholds(thresholds);
4581
+ }, [thresholds, setThresholds]);
4644
4582
  useEffect(function () {
4645
4583
  if (!requiredDocumentType) return;
4646
4584
  dispatch({
@@ -4657,18 +4595,7 @@ var IdCapture = function IdCapture(_a) {
4657
4595
  }
4658
4596
  });
4659
4597
  }, [dispatch, height, width]);
4660
- useEffect(function () {
4661
- onPredictionMade(function (prediction) {
4662
- dispatch({
4663
- type: 'objectsDetected',
4664
- payload: {
4665
- prediction: prediction
4666
- }
4667
- });
4668
- onPrediction === null || onPrediction === void 0 ? void 0 : onPrediction(prediction);
4669
- });
4670
- }, [dispatch, onPrediction, onPredictionMade]);
4671
- var shouldCapture = autoCaptureEnabled && state.goodFramesThresholdMet && !state.capturing && !state.waitingForBarcodeScan && timeSince(state.captureStartedAt) >= 3000;
4598
+ var shouldCapture = state.goodFramesThresholdMet && !state.capturing && timeSince(state.captureStartedAt) >= 3000;
4672
4599
  useEffect(function () {
4673
4600
  if (!shouldCapture) return;
4674
4601
  dispatch({
@@ -4682,29 +4609,13 @@ var IdCapture = function IdCapture(_a) {
4682
4609
  });
4683
4610
  return;
4684
4611
  }
4685
- var originalCanvas = bestFrame.canvas,
4612
+ var canvas = bestFrame.canvas,
4686
4613
  documentType = bestFrame.documentType,
4687
4614
  boundingBox = bestFrame.boundingBox,
4688
4615
  detectionScore = bestFrame.detectionScore,
4689
4616
  focusScore = bestFrame.focusScore;
4690
- var width = originalCanvas.width,
4691
- height = originalCanvas.height;
4692
- var canvas = originalCanvas;
4693
- // resize image to 2k max if barcode is read
4694
- var isGreaterThan2k = width > 1920 && height > 1080 || width > 1080 && height > 1920;
4695
- if (isGreaterThan2k && !!state.barcodeResult) {
4696
- canvas = document.createElement('canvas');
4697
- if (width > height) {
4698
- canvas.width = 1920;
4699
- canvas.height = height * (1920 / width);
4700
- } else {
4701
- canvas.height = 1920;
4702
- canvas.width = width * (1920 / height);
4703
- }
4704
- var ctx2d = canvas.getContext('2d');
4705
- if (!ctx2d) return;
4706
- ctx2d.drawImage(originalCanvas, 0, 0, canvas.width, canvas.height);
4707
- }
4617
+ var width = canvas.width,
4618
+ height = canvas.height;
4708
4619
  var imageUrl = canvas.toDataURL('image/jpeg', 0.95);
4709
4620
  dispatch({
4710
4621
  type: 'frameCaptured',
@@ -4728,18 +4639,18 @@ var IdCapture = function IdCapture(_a) {
4728
4639
  type: 'captured'
4729
4640
  });
4730
4641
  }, 0);
4731
- }, [dispatch, getBestFrame, onCapture, shouldCapture, state.barcodeResult, state.captureStartedAt, state.requestedDocumentType]);
4642
+ }, [dispatch, getBestFrame, onCapture, shouldCapture, state.captureStartedAt, state.requestedDocumentType]);
4732
4643
  assets.portraitGuidesImageUrl || (assets.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Portrait-2.svg"));
4733
4644
  assets.landscapeGuidesImageUrl || (assets.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Landscape-2.svg"));
4734
4645
  var theme = useTheme();
4735
- colors.guideBoxUnsatisfiedColor || (colors.guideBoxUnsatisfiedColor = (_f = (_e = (_d = theme.idCapture) === null || _d === void 0 ? void 0 : _d.guideBox) === null || _e === void 0 ? void 0 : _e.unsatisfiedColor) !== null && _f !== void 0 ? _f : 'white');
4736
- colors.guideBoxSatisfiedColor || (colors.guideBoxSatisfiedColor = (_j = (_h = (_g = theme.idCapture) === null || _g === void 0 ? void 0 : _g.guideBox) === null || _h === void 0 ? void 0 : _h.satisfiedColor) !== null && _j !== void 0 ? _j : 'green');
4646
+ colors.guideBoxUnsatisfiedColor || (colors.guideBoxUnsatisfiedColor = (_d = (_c = (_b = theme.idCapture) === null || _b === void 0 ? void 0 : _b.guideBox) === null || _c === void 0 ? void 0 : _c.unsatisfiedColor) !== null && _d !== void 0 ? _d : 'white');
4647
+ colors.guideBoxSatisfiedColor || (colors.guideBoxSatisfiedColor = (_g = (_f = (_e = theme.idCapture) === null || _e === void 0 ? void 0 : _e.guideBox) === null || _f === void 0 ? void 0 : _f.satisfiedColor) !== null && _g !== void 0 ? _g : 'green');
4737
4648
  var verbiage = useTranslations(rawVerbiage, {
4738
4649
  instructionText: 'Scan the front of ID',
4739
4650
  processingIdCardText: 'ID card front captured.',
4740
- capturingText: 'Capturing...',
4741
- captureFailedText: 'Capture failed!',
4742
- guidanceSatisfiedText: 'Document detected, hold still...',
4651
+ guidanceSatisfiedText: "".concat(documentTypeDisplayNames[state.detectedDocumentType], " detected, hold still..."),
4652
+ guidancePleaseFlipText: 'ID card front detected - please flip your ID card',
4653
+ guidanceBackDetectedFirstText: 'ID card back detected - please flip your ID card',
4743
4654
  guidanceTooBlurryText: 'Document out of focus – try improving the lighting',
4744
4655
  guidanceNotCenteredText: 'Document is not centered',
4745
4656
  guidanceTooCloseText: 'Document too close, please back up',
@@ -4754,10 +4665,10 @@ var IdCapture = function IdCapture(_a) {
4754
4665
  });
4755
4666
  var satisfied = state.isGoodFrame;
4756
4667
  if (typeof guidanceSatisfied === 'boolean') satisfied = guidanceSatisfied;
4757
- guidanceMessage || (guidanceMessage = satisfied ? verbiage.guidanceSatisfiedText : !state.documentDetectionThresholdMet ? verbiage.guidanceNotDetectedText : !state.documentInBounds ? verbiage.guidanceNotCenteredText : state.documentTooClose ? verbiage.guidanceTooCloseText : !state.focusThresholdMet ? verbiage.guidanceTooBlurryText : '');
4668
+ guidanceMessage || (guidanceMessage = satisfied ? verbiage.guidanceSatisfiedText : !state.detectionThresholdMet ? verbiage.guidanceNotDetectedText : state.backDetectedFirst ? verbiage.guidanceBackDetectedFirstText : state.flipRequired ? verbiage.guidancePleaseFlipText : !state.documentInBounds ? verbiage.guidanceNotCenteredText : state.documentTooClose ? verbiage.guidanceTooCloseText : !state.focusThresholdMet ? verbiage.guidanceTooBlurryText : '');
4758
4669
  return /*#__PURE__*/React__default.createElement(PageContainer, {
4759
4670
  ref: ref,
4760
- className: "flex ".concat((_k = classNames.container) !== null && _k !== void 0 ? _k : '')
4671
+ className: "flex ".concat((_h = classNames.container) !== null && _h !== void 0 ? _h : '')
4761
4672
  }, guidanceMessage !== '' && ( /*#__PURE__*/React__default.createElement(GuidanceMessageContainer, {
4762
4673
  "$top": "",
4763
4674
  "$bottom": "12.5dvh",
@@ -4766,7 +4677,7 @@ var IdCapture = function IdCapture(_a) {
4766
4677
  "$variant": satisfied ? 'positive' : 'default',
4767
4678
  className: classNames.guidanceMessage
4768
4679
  }, guidanceMessage))), debugMode && ( /*#__PURE__*/React__default.createElement(DebugBoundingBoxOverlay, {
4769
- "$flipX": !((_l = cameraRef.current) === null || _l === void 0 ? void 0 : _l.isRearFacing),
4680
+ "$flipX": !((_j = cameraRef.current) === null || _j === void 0 ? void 0 : _j.isRearFacing),
4770
4681
  scaling: debugScalingDetails
4771
4682
  }, state.detectedObjects.map(function (obj, i) {
4772
4683
  var _a;
@@ -4776,7 +4687,7 @@ var IdCapture = function IdCapture(_a) {
4776
4687
  scaling: debugScalingDetails,
4777
4688
  flipX: !((_a = cameraRef.current) === null || _a === void 0 ? void 0 : _a.isRearFacing)
4778
4689
  });
4779
- }))), debugMode && ( /*#__PURE__*/React__default.createElement(DebugStatsPane, null, cameraRef.current ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__default.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__default.createElement("br", null), modelsReady ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, state.documentDetectionThresholdMet ? '✅' : '❌', " Document Score: ", state.documentDetectionScore.toFixed(3), " (", state.documentType, ")", /*#__PURE__*/React__default.createElement("br", null), state.passportPageDetectionThresholdMet ? '✅' : '❌', " Passport Score: ", state.passportPageDetectionScore.toFixed(3), /*#__PURE__*/React__default.createElement("br", null), state.focusThresholdMet ? '✅' : '❌', " Focus Score:", ' ', state.focusScore.toFixed(3), /*#__PURE__*/React__default.createElement("br", null), state.documentInBounds ? '✅' : '❌', " Document In Bounds", /*#__PURE__*/React__default.createElement("br", null), state.goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', state.goodFramesCount, "/", state.goodFramesThreshold, barcodeScanningEnabled && state.autoCaptureBarcodeRequired ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("br", null), state.barcodeResult ? '✅' : '❌', " Barcode Scanned (", supportsNativeBarcodeScanning() ? 'Native' : 'ZXing', ",", ' ', state.barcodeScanFailedAttempts, "/", state.maxBarcodeScanAttempts, " failed attempts)")) : null)) : ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "\u274C Models not ready")))));
4690
+ }))), debugMode && ( /*#__PURE__*/React__default.createElement(DebugStatsPane, null, cameraRef.current ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__default.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__default.createElement("br", null), modelsReady ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, state.detectionThresholdMet ? '✅' : '❌', " Detected Document Type: ", state.detectedDocumentType, /*#__PURE__*/React__default.createElement("br", null), state.idCardFrontDetectionThresholdMet ? '✅' : '❌', " ID Card Front Score: ", state.idCardFrontDetectionScore.toFixed(3), /*#__PURE__*/React__default.createElement("br", null), state.idCardBackDetectionThresholdMet ? '✅' : '❌', " ID Card Back Score: ", state.idCardBackDetectionScore.toFixed(3), /*#__PURE__*/React__default.createElement("br", null), state.passportDetectionThresholdMet ? '✅' : '❌', " Passport Score: ", state.passportDetectionScore.toFixed(3), /*#__PURE__*/React__default.createElement("br", null), state.focusThresholdMet ? '✅' : '❌', " Focus Score:", ' ', state.focusScore.toFixed(3), /*#__PURE__*/React__default.createElement("br", null), state.documentInBounds ? '✅' : '❌', " Document In Bounds", /*#__PURE__*/React__default.createElement("br", null), state.goodFramesThresholdMet ? '' : '', " Good Frame Count:", ' ', state.goodFramesCount, "/", state.goodFramesThreshold)) : ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "\u274C Models not ready")))));
4780
4691
  };
4781
4692
  var timeSince = function timeSince(t) {
4782
4693
  if (!t) return 0;
@@ -5710,11 +5621,7 @@ var CapturedDocumentImg = function CapturedDocumentImg(_a) {
5710
5621
  setUrl(cropToDetectedObjectBox(imgRef.current, bbox).toDataURL('image/jpeg', 0.95));
5711
5622
  }, 100);
5712
5623
  }
5713
- return /*#__PURE__*/React__default.createElement("div", {
5714
- style: {
5715
- position: 'relative'
5716
- }
5717
- }, /*#__PURE__*/React__default.createElement("img", {
5624
+ return /*#__PURE__*/React__default.createElement("img", {
5718
5625
  ref: imgRef,
5719
5626
  alt: alt,
5720
5627
  className: className,
@@ -5734,13 +5641,12 @@ var CapturedDocumentImg = function CapturedDocumentImg(_a) {
5734
5641
  (_a = link.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(link);
5735
5642
  });
5736
5643
  }
5737
- }));
5644
+ });
5738
5645
  };
5739
5646
 
5740
5647
  var OverlayInstruction = styled.p(templateObject_1$u || (templateObject_1$u = __makeTemplateObject(["\n font-size: 18px;\n margin: 30px 0;\n"], ["\n font-size: 18px;\n margin: 30px 0;\n"])));
5741
5648
  var IdCaptureSuccess = function IdCaptureSuccess(_a) {
5742
5649
  var capturedDocuments = _a.capturedDocuments,
5743
- // barcodeResult,
5744
5650
  onSubmitClick = _a.onSubmitClick,
5745
5651
  onRetryClick = _a.onRetryClick,
5746
5652
  _b = _a.classNames,
@@ -5748,7 +5654,9 @@ var IdCaptureSuccess = function IdCaptureSuccess(_a) {
5748
5654
  _c = _a.colors,
5749
5655
  colors = _c === void 0 ? {} : _c,
5750
5656
  _d = _a.verbiage,
5751
- rawVerbiage = _d === void 0 ? {} : _d;
5657
+ rawVerbiage = _d === void 0 ? {} : _d,
5658
+ _e = _a.debugMode,
5659
+ debugMode = _e === void 0 ? false : _e;
5752
5660
  var submissionStatus = useContext(SubmissionContext).submissionStatus;
5753
5661
  var idCardFront = capturedDocuments.idCardFront,
5754
5662
  idCardBack = capturedDocuments.idCardBack,
@@ -5783,7 +5691,7 @@ var IdCaptureSuccess = function IdCaptureSuccess(_a) {
5783
5691
  image: idCardFront,
5784
5692
  className: classNames.image,
5785
5693
  alt: verbiage.idCardFrontText
5786
- })))), idCardBack && ( /*#__PURE__*/React__default.createElement(ImageCol$1, {
5694
+ })), debugMode && ( /*#__PURE__*/React__default.createElement("pre", null, "Detection Score: ".concat(idCardFront.detectionScore, "\nFocus Score: ").concat(idCardFront.focusScore, "\nBounding Box: ").concat(JSON.stringify(idCardFront.boundingBox)))))), idCardBack && ( /*#__PURE__*/React__default.createElement(ImageCol$1, {
5787
5695
  className: classNames.imageCol
5788
5696
  }, /*#__PURE__*/React__default.createElement(ImageHeading, {
5789
5697
  className: classNames.imageHeading
@@ -5793,7 +5701,7 @@ var IdCaptureSuccess = function IdCaptureSuccess(_a) {
5793
5701
  image: idCardBack,
5794
5702
  className: classNames.image,
5795
5703
  alt: verbiage.idCardBackText
5796
- })))), passport && ( /*#__PURE__*/React__default.createElement(ImageCol$1, {
5704
+ })), debugMode && ( /*#__PURE__*/React__default.createElement("pre", null, "Detection Score: ".concat(idCardBack.detectionScore, "\nFocus Score: ").concat(idCardBack.focusScore, "\nBounding Box: ").concat(JSON.stringify(idCardBack.boundingBox)))))), passport && ( /*#__PURE__*/React__default.createElement(ImageCol$1, {
5797
5705
  className: classNames.imageCol
5798
5706
  }, /*#__PURE__*/React__default.createElement(ImageHeading, {
5799
5707
  className: classNames.imageHeading
@@ -5803,7 +5711,7 @@ var IdCaptureSuccess = function IdCaptureSuccess(_a) {
5803
5711
  image: passport,
5804
5712
  className: classNames.image,
5805
5713
  alt: verbiage.passportText
5806
- })))))), /*#__PURE__*/React__default.createElement(OverlayInstruction, {
5714
+ })), debugMode && ( /*#__PURE__*/React__default.createElement("pre", null, "Detection Score: ".concat(passport.detectionScore, "\nFocus Score: ").concat(passport.focusScore, "\nBounding Box: ").concat(JSON.stringify(passport.boundingBox)))))))), /*#__PURE__*/React__default.createElement(OverlayInstruction, {
5807
5715
  className: classNames.instruction
5808
5716
  }, verbiage.instructionText), /*#__PURE__*/React__default.createElement(ButtonsRow, {
5809
5717
  className: classNames.buttonsRow
@@ -6405,13 +6313,8 @@ function IdCaptureGuides(_a) {
6405
6313
  var cameraRef = useContext(CameraStateContext).cameraRef;
6406
6314
  var verbiage = useTranslations(rawVerbiage, {
6407
6315
  instructionText: 'Scan the front of ID',
6408
- processingIdCardText: 'ID card front captured.',
6409
6316
  capturingText: 'Capturing...',
6410
- captureFailedText: 'Capture failed!',
6411
- guidanceSatisfiedText: 'Document detected, hold still...',
6412
- guidanceTooBlurryText: 'Document out of focus – try improving the lighting',
6413
- guidanceNotCenteredText: 'Document is not centered',
6414
- guidanceNotDetectedText: 'Document not detected'
6317
+ captureFailedText: 'Capture failed!'
6415
6318
  });
6416
6319
  var isMobile = window.innerWidth < window.innerHeight;
6417
6320
  var frontImageUrl = portraitGuidesOnMobile && isMobile ? flipIdPromptAssets === null || flipIdPromptAssets === void 0 ? void 0 : flipIdPromptAssets.frontPortraitGuidesImageUrl : flipIdPromptAssets === null || flipIdPromptAssets === void 0 ? void 0 : flipIdPromptAssets.frontLandscapeGuidesImageUrl;
@@ -6425,7 +6328,7 @@ function IdCaptureGuides(_a) {
6425
6328
  landscapeGuidesImageUrl: assets.landscapeGuidesImageUrl,
6426
6329
  isMirrored: !((_b = cameraRef.current) === null || _b === void 0 ? void 0 : _b.isRearFacing),
6427
6330
  borderColor: state.isGoodFrame ? colors.guideBoxSatisfiedColor : colors.guideBoxUnsatisfiedColor,
6428
- imageVisible: requestingFlip || !state.documentDetectionThresholdMet || !state.documentInBounds || state.documentTooClose
6331
+ imageVisible: requestingFlip || !state.idCardFrontDetectionThresholdMet || !state.documentInBounds || state.documentTooClose
6429
6332
  })), guideType === 'fit' && ( /*#__PURE__*/React__default.createElement(IdCaptureFitGuide, {
6430
6333
  classNames: classNames,
6431
6334
  requestingFlip: requestingFlip,
@@ -6435,7 +6338,7 @@ function IdCaptureGuides(_a) {
6435
6338
  backImageUrl: backImageUrl,
6436
6339
  isMirrored: !((_c = cameraRef.current) === null || _c === void 0 ? void 0 : _c.isRearFacing),
6437
6340
  borderColor: state.isGoodFrame ? colors.guideBoxSatisfiedColor : colors.guideBoxUnsatisfiedColor,
6438
- imageVisible: requestingFlip || !state.documentDetectionThresholdMet || !state.documentInBounds || state.documentTooClose
6341
+ imageVisible: requestingFlip || !state.detectionThresholdMet || !state.documentInBounds || state.documentTooClose || state.flipRequired
6439
6342
  })));
6440
6343
  }
6441
6344
 
@@ -7330,78 +7233,66 @@ var StyledButtonsRow$8 = styled(ButtonsRow)(templateObject_6$3 || (templateObjec
7330
7233
  var templateObject_1$l, templateObject_2$f, templateObject_3$d, templateObject_4$8, templateObject_5$4, templateObject_6$3;
7331
7234
 
7332
7235
  var IdCaptureWizard = function IdCaptureWizard(_a) {
7333
- var _b, _c, _d, _e, _f, _g, _h, _j;
7334
- var _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
7236
+ var _b, _c, _d, _e, _f, _g;
7237
+ var _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
7335
7238
  var onSuccess = _a.onSuccess,
7336
7239
  onExitCapture = _a.onExitCapture,
7337
7240
  onUserCancel = _a.onUserCancel,
7338
- _v = _a.loadingOverlayMode,
7339
- loadingOverlayMode = _v === void 0 ? 'default' : _v,
7241
+ _t = _a.loadingOverlayMode,
7242
+ loadingOverlayMode = _t === void 0 ? 'default' : _t,
7340
7243
  precapturedDocuments = _a.precapturedDocuments,
7341
- _w = _a.captureRequirement,
7342
- captureRequirement = _w === void 0 ? 'idCardOrPassport' : _w,
7343
- _x = _a.separateIdCardCaptureSequence,
7344
- separateIdCardCaptureSequence = _x === void 0 ? false : _x,
7345
- _y = _a.autoCaptureEnabled,
7346
- autoCaptureEnabled = _y === void 0 ? true : _y,
7347
- _z = _a.autoCaptureBarcodeRequired,
7348
- autoCaptureBarcodeRequired = _z === void 0 ? 'mobile' : _z,
7349
- _0 = _a.barcodeScanningEnabled,
7350
- barcodeScanningEnabled = _0 === void 0 ? false : _0,
7351
- _1 = _a.idCardAutoCaptureScoreThreshold,
7352
- idCardAutoCaptureScoreThreshold = _1 === void 0 ? defaultDocumentDetectionThresholds.idCard : _1,
7353
- _2 = _a.passportAutoCaptureScoreThreshold,
7354
- passportAutoCaptureScoreThreshold = _2 === void 0 ? defaultDocumentDetectionThresholds.passport : _2,
7355
- _3 = _a.mrzDetectionScoreThreshold,
7356
- mrzDetectionScoreThreshold = _3 === void 0 ? defaultDocumentDetectionThresholds.mrz : _3,
7357
- _4 = _a.idCardFocusScoreThreshold,
7358
- idCardFocusScoreThreshold = _4 === void 0 ? (_b = defaultFocusThresholds.idCard) === null || _b === void 0 ? void 0 : _b.mobile : _4,
7359
- _5 = _a.passportFocusScoreThreshold,
7360
- passportFocusScoreThreshold = _5 === void 0 ? (_c = defaultFocusThresholds.passport) === null || _c === void 0 ? void 0 : _c.mobile : _5,
7361
- _6 = _a.skipSuccessScreen,
7362
- skipSuccessScreen = _6 === void 0 ? false : _6,
7244
+ _u = _a.captureRequirement,
7245
+ captureRequirement = _u === void 0 ? 'idCardOrPassport' : _u,
7246
+ _v = _a.separateIdCardCaptureSequence,
7247
+ separateIdCardCaptureSequence = _v === void 0 ? false : _v,
7248
+ _w = _a.thresholds,
7249
+ thresholds = _w === void 0 ? defaultIdCaptureThresholds : _w,
7250
+ _x = _a.skipSuccessScreen,
7251
+ skipSuccessScreen = _x === void 0 ? false : _x,
7363
7252
  instructions = _a.instructions,
7364
- _7 = _a.releaseCameraAccessOnExit,
7365
- releaseCameraAccessOnExit = _7 === void 0 ? true : _7,
7366
- _8 = _a.guideType,
7367
- guideType = _8 === void 0 ? 'fit' : _8,
7368
- _9 = _a.portraitGuidesOnMobile,
7369
- portraitGuidesOnMobile = _9 === void 0 ? false : _9,
7370
- _10 = _a.rotateLoadingOverlayImageWhenPortrait,
7371
- rotateLoadingOverlayImageWhenPortrait = _10 === void 0 ? true : _10,
7372
- _11 = _a.silentFallback,
7373
- silentFallback = _11 === void 0 ? false : _11,
7374
- _12 = _a.assets,
7375
- assets = _12 === void 0 ? {} : _12,
7376
- _13 = _a.classNames,
7377
- classNames = _13 === void 0 ? {} : _13,
7378
- _14 = _a.colors,
7379
- colors = _14 === void 0 ? {} : _14,
7380
- _15 = _a.verbiage,
7381
- verbiage = _15 === void 0 ? {} : _15,
7382
- _16 = _a.debugMode,
7383
- debugMode = _16 === void 0 ? false : _16;
7384
- var _17 = useIdCaptureState(),
7385
- state = _17[0],
7386
- dispatch = _17[1];
7387
- var _18 = useContext(CameraStateContext),
7388
- cameraAccessDenied = _18.cameraAccessDenied,
7389
- releaseCameraAccess = _18.releaseCameraAccess;
7390
- var _19 = useState(false),
7391
- overlayDismissed = _19[0],
7392
- setOverlayDismissed = _19[1];
7393
- var _20 = useContext(SubmissionContext),
7394
- submissionStatus = _20.submissionStatus,
7395
- setIdFrontImage = _20.setIdFrontImage,
7396
- setIdBackImage = _20.setIdBackImage,
7397
- setPassportImage = _20.setPassportImage,
7398
- logIdFrontCaptureAttempt = _20.logIdFrontCaptureAttempt,
7399
- logIdBackCaptureAttempt = _20.logIdBackCaptureAttempt;
7400
- var _21 = useContext(IdCaptureModelsContext),
7401
- start = _21.start,
7402
- stop = _21.stop,
7403
- modelError = _21.modelError,
7404
- resetBestFrame = _21.resetBestFrame;
7253
+ _y = _a.releaseCameraAccessOnExit,
7254
+ releaseCameraAccessOnExit = _y === void 0 ? true : _y,
7255
+ _z = _a.guideType,
7256
+ guideType = _z === void 0 ? 'fit' : _z,
7257
+ _0 = _a.portraitGuidesOnMobile,
7258
+ portraitGuidesOnMobile = _0 === void 0 ? false : _0,
7259
+ _1 = _a.rotateLoadingOverlayImageWhenPortrait,
7260
+ rotateLoadingOverlayImageWhenPortrait = _1 === void 0 ? true : _1,
7261
+ _2 = _a.silentFallback,
7262
+ silentFallback = _2 === void 0 ? false : _2,
7263
+ _3 = _a.assets,
7264
+ assets = _3 === void 0 ? {} : _3,
7265
+ _4 = _a.classNames,
7266
+ classNames = _4 === void 0 ? {} : _4,
7267
+ _5 = _a.colors,
7268
+ colors = _5 === void 0 ? {} : _5,
7269
+ _6 = _a.verbiage,
7270
+ verbiage = _6 === void 0 ? {} : _6,
7271
+ _7 = _a.debugMode,
7272
+ debugMode = _7 === void 0 ? false : _7;
7273
+ var _8 = useIdCaptureState(),
7274
+ state = _8[0],
7275
+ dispatch = _8[1];
7276
+ var _9 = useContext(CameraStateContext),
7277
+ cameraAccessDenied = _9.cameraAccessDenied,
7278
+ releaseCameraAccess = _9.releaseCameraAccess;
7279
+ var _10 = useState(false),
7280
+ overlayDismissed = _10[0],
7281
+ setOverlayDismissed = _10[1];
7282
+ var _11 = useContext(SubmissionContext),
7283
+ submissionStatus = _11.submissionStatus,
7284
+ setIdFrontImage = _11.setIdFrontImage,
7285
+ setIdBackImage = _11.setIdBackImage,
7286
+ setPassportImage = _11.setPassportImage,
7287
+ logIdFrontCaptureAttempt = _11.logIdFrontCaptureAttempt,
7288
+ logIdBackCaptureAttempt = _11.logIdBackCaptureAttempt;
7289
+ var _12 = useContext(IdCaptureModelsContext),
7290
+ start = _12.start,
7291
+ stop = _12.stop,
7292
+ onPredictionMade = _12.onPredictionMade,
7293
+ setRequiredDocumentType = _12.setRequiredDocumentType,
7294
+ modelError = _12.modelError,
7295
+ resetBestFrame = _12.resetBestFrame;
7405
7296
  useEffect(function () {
7406
7297
  dispatch({
7407
7298
  type: 'configureWizard',
@@ -7426,16 +7317,29 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
7426
7317
  type: 'captureStarted'
7427
7318
  });
7428
7319
  start();
7429
- return function () {
7430
- stop();
7431
- };
7432
- }, [dispatch, overlayDismissed, start, state.captureState, stop]);
7433
- var onPrediction = useCallback(function (prediction) {
7434
- dispatch({
7435
- type: 'predictionMade',
7436
- payload: prediction
7320
+ }, [dispatch, overlayDismissed, start, state.captureState]);
7321
+ useEffect(function () {
7322
+ onPredictionMade(function (prediction) {
7323
+ if (state.captureState === 'capturing') {
7324
+ dispatch({
7325
+ type: 'objectsDetected',
7326
+ payload: {
7327
+ prediction: prediction
7328
+ }
7329
+ });
7330
+ } else if (state.captureState === 'requestingFlip') {
7331
+ if (prediction.idCardBackDetectionThresholdMet) {
7332
+ resetBestFrame();
7333
+ dispatch({
7334
+ type: 'flipRequestCompleted'
7335
+ });
7336
+ }
7337
+ }
7437
7338
  });
7438
- }, [dispatch]);
7339
+ }, [dispatch, onPredictionMade, resetBestFrame, state.captureState]);
7340
+ useEffect(function () {
7341
+ if (state.captureState === 'complete') stop();
7342
+ }, [state.captureState, stop]);
7439
7343
  var onCapture = useCallback(function (imageData, width, height, documentType, metadata) {
7440
7344
  logCaptureMetadata(metadata);
7441
7345
  dispatch({
@@ -7445,7 +7349,9 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
7445
7349
  width: width,
7446
7350
  height: height,
7447
7351
  documentType: documentType,
7448
- boundingBox: metadata.boundingBox
7352
+ boundingBox: metadata.boundingBox,
7353
+ detectionScore: metadata.bestDetectionScore,
7354
+ focusScore: metadata.bestFocusScore
7449
7355
  }
7450
7356
  });
7451
7357
  }, [dispatch, logCaptureMetadata]);
@@ -7475,9 +7381,9 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
7475
7381
  type: 'resetWizard'
7476
7382
  });
7477
7383
  }, [dispatch]);
7478
- var _22 = useState(0),
7479
- attempt = _22[0],
7480
- setAttempt = _22[1];
7384
+ var _13 = useState(0),
7385
+ attempt = _13[0],
7386
+ setAttempt = _13[1];
7481
7387
  var onExit = useCallback(function () {
7482
7388
  setOverlayDismissed(false);
7483
7389
  setAttempt(function (n) {
@@ -7502,19 +7408,19 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
7502
7408
  }
7503
7409
  }, [cameraAccessDenied]);
7504
7410
  assets.idCardFront || (assets.idCardFront = {});
7505
- (_k = assets.idCardFront).portraitGuidesImageUrl || (_k.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Portrait-2.svg"));
7506
- (_l = assets.idCardFront).landscapeGuidesImageUrl || (_l.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Landscape-2.svg"));
7411
+ (_h = assets.idCardFront).portraitGuidesImageUrl || (_h.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Portrait-2.svg"));
7412
+ (_j = assets.idCardFront).landscapeGuidesImageUrl || (_j.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Landscape-2.svg"));
7507
7413
  assets.idCardBack || (assets.idCardBack = {});
7508
- (_m = assets.idCardBack).portraitGuidesImageUrl || (_m.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Portrait-2.svg"));
7509
- (_o = assets.idCardBack).landscapeGuidesImageUrl || (_o.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Landscape-2.svg"));
7414
+ (_k = assets.idCardBack).portraitGuidesImageUrl || (_k.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Portrait-2.svg"));
7415
+ (_l = assets.idCardBack).landscapeGuidesImageUrl || (_l.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Landscape-2.svg"));
7510
7416
  assets.passport || (assets.passport = {});
7511
- (_p = assets.passport).portraitGuidesImageUrl || (_p.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-Passport-Front-SVG-Portrait-2.svg"));
7512
- (_q = assets.passport).landscapeGuidesImageUrl || (_q.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-Passport-Front-SVG-Landscape-2.svg"));
7417
+ (_m = assets.passport).portraitGuidesImageUrl || (_m.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-Passport-Front-SVG-Portrait-2.svg"));
7418
+ (_o = assets.passport).landscapeGuidesImageUrl || (_o.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-Passport-Front-SVG-Landscape-2.svg"));
7513
7419
  assets.flipIdPrompt || (assets.flipIdPrompt = {});
7514
- (_r = assets.flipIdPrompt).frontPortraitGuidesImageUrl || (_r.frontPortraitGuidesImageUrl = assets.idCardFront.portraitGuidesImageUrl);
7515
- (_s = assets.flipIdPrompt).frontLandscapeGuidesImageUrl || (_s.frontLandscapeGuidesImageUrl = assets.idCardFront.landscapeGuidesImageUrl);
7516
- (_t = assets.flipIdPrompt).backPortraitGuidesImageUrl || (_t.backPortraitGuidesImageUrl = assets.idCardBack.portraitGuidesImageUrl);
7517
- (_u = assets.flipIdPrompt).backLandscapeGuidesImageUrl || (_u.backLandscapeGuidesImageUrl = assets.idCardBack.landscapeGuidesImageUrl);
7420
+ (_p = assets.flipIdPrompt).frontPortraitGuidesImageUrl || (_p.frontPortraitGuidesImageUrl = assets.idCardFront.portraitGuidesImageUrl);
7421
+ (_q = assets.flipIdPrompt).frontLandscapeGuidesImageUrl || (_q.frontLandscapeGuidesImageUrl = assets.idCardFront.landscapeGuidesImageUrl);
7422
+ (_r = assets.flipIdPrompt).backPortraitGuidesImageUrl || (_r.backPortraitGuidesImageUrl = assets.idCardBack.portraitGuidesImageUrl);
7423
+ (_s = assets.flipIdPrompt).backLandscapeGuidesImageUrl || (_s.backLandscapeGuidesImageUrl = assets.idCardBack.landscapeGuidesImageUrl);
7518
7424
  var idCaptureVerbiages = {
7519
7425
  idCardFront: useTranslations(verbiage.idCardFront, {
7520
7426
  instructionText: 'Scan the front of ID',
@@ -7528,24 +7434,45 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
7528
7434
  })
7529
7435
  };
7530
7436
  var theme = useTheme();
7531
- var _23 = useIdCaptureState()[0],
7532
- guideRectX = _23.guideRectX,
7533
- guideRectY = _23.guideRectY,
7534
- guideRectWidth = _23.guideRectWidth,
7535
- guideRectHeight = _23.guideRectHeight,
7536
- imageUrl = _23.imageUrl;
7437
+ var _14 = useIdCaptureState()[0],
7438
+ guideRectX = _14.guideRectX,
7439
+ guideRectY = _14.guideRectY,
7440
+ guideRectWidth = _14.guideRectWidth,
7441
+ guideRectHeight = _14.guideRectHeight,
7442
+ imageUrl = _14.imageUrl;
7537
7443
  var idCaptureAssets = assets[state.requestedDocumentType];
7538
7444
  var idCaptureVerbiage = idCaptureVerbiages[state.requestedDocumentType];
7539
7445
  useEffect(function () {
7540
7446
  if (separateIdCardCaptureSequence) return;
7541
- if (state.captureState === 'requestingFlip') {
7542
- setTimeout(function () {
7543
- dispatch({
7544
- type: 'flipRequestCompleted'
7545
- });
7546
- }, 6000);
7447
+ if (state.captureState !== 'requestingFlip') return;
7448
+ var t = setTimeout(function () {
7449
+ resetBestFrame();
7450
+ dispatch({
7451
+ type: 'flipRequestCompleted'
7452
+ });
7453
+ }, 6000);
7454
+ return function () {
7455
+ clearTimeout(t);
7456
+ };
7457
+ }, [dispatch, resetBestFrame, separateIdCardCaptureSequence, state.captureState]);
7458
+ useEffect(function () {
7459
+ if (state.requestedDocumentType === 'idCardFront') {
7460
+ if (captureRequirement === 'idCardOrPassport') {
7461
+ setRequiredDocumentType(['idCardFront', 'passport']);
7462
+ } else {
7463
+ setRequiredDocumentType('idCardFront');
7464
+ }
7547
7465
  }
7548
- }, [dispatch, separateIdCardCaptureSequence, state.captureState]);
7466
+ if (state.requestedDocumentType === 'idCardBack') {
7467
+ setRequiredDocumentType('idCardBack');
7468
+ }
7469
+ if (state.requestedDocumentType === 'passport') {
7470
+ setRequiredDocumentType('passport');
7471
+ }
7472
+ return function () {
7473
+ setRequiredDocumentType('none');
7474
+ };
7475
+ }, [captureRequirement, setRequiredDocumentType, state.requestedDocumentType]);
7549
7476
  var handleCapture = useCallback(function (imageData) {
7550
7477
  return __awaiter(void 0, void 0, void 0, function () {
7551
7478
  var base64ImageData;
@@ -7579,7 +7506,7 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
7579
7506
  });
7580
7507
  }
7581
7508
  return /*#__PURE__*/React__default.createElement(PageContainer, {
7582
- className: "flex ".concat((_d = classNames === null || classNames === void 0 ? void 0 : classNames.container) !== null && _d !== void 0 ? _d : '')
7509
+ className: "flex ".concat((_b = classNames === null || classNames === void 0 ? void 0 : classNames.container) !== null && _b !== void 0 ? _b : '')
7583
7510
  }, state.captureState !== 'complete' && ( /*#__PURE__*/React__default.createElement(CameraFeedWrapper, {
7584
7511
  "$x": guideRectX,
7585
7512
  "$y": guideRectY,
@@ -7590,15 +7517,7 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
7590
7517
  className: classNames === null || classNames === void 0 ? void 0 : classNames.cameraFeed
7591
7518
  }))), overlayDismissed && state.captureState === 'capturing' && ( /*#__PURE__*/React__default.createElement(IdCapture, {
7592
7519
  requiredDocumentType: state.requestedDocumentType,
7593
- autoCaptureEnabled: autoCaptureEnabled,
7594
- idCardDetectionThreshold: idCardAutoCaptureScoreThreshold,
7595
- passportDetectionThreshold: passportAutoCaptureScoreThreshold,
7596
- idCardFocusScoreThreshold: idCardFocusScoreThreshold,
7597
- passportFocusScoreThreshold: passportFocusScoreThreshold,
7598
- mrzDetectionScoreThreshold: mrzDetectionScoreThreshold,
7599
- autoCaptureBarcodeRequired: autoCaptureBarcodeRequired,
7600
- barcodeScanningEnabled: barcodeScanningEnabled && state.requestedDocumentType === 'idCardBack',
7601
- onPrediction: onPrediction,
7520
+ thresholds: thresholds,
7602
7521
  onCapture: onCapture,
7603
7522
  assets: idCaptureAssets,
7604
7523
  classNames: classNames === null || classNames === void 0 ? void 0 : classNames.capture,
@@ -7614,15 +7533,15 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
7614
7533
  assets: idCaptureAssets,
7615
7534
  colors: colors,
7616
7535
  verbiage: idCaptureVerbiage
7617
- }), !((_f = (_e = theme.idCapture) === null || _e === void 0 ? void 0 : _e.capturePreview) === null || _f === void 0 ? void 0 : _f.disabled) && state.captureState === 'requestingFlip' && !separateIdCardCaptureSequence && imageUrl && ( /*#__PURE__*/React__default.createElement(IdCaptureImagePreview, {
7618
- classNames: (_g = classNames.capture) === null || _g === void 0 ? void 0 : _g.imagePreview,
7619
- text: (_h = idCaptureVerbiages === null || idCaptureVerbiages === void 0 ? void 0 : idCaptureVerbiages.idCardFront) === null || _h === void 0 ? void 0 : _h.processingIdCardText,
7536
+ }), !((_d = (_c = theme.idCapture) === null || _c === void 0 ? void 0 : _c.capturePreview) === null || _d === void 0 ? void 0 : _d.disabled) && state.captureState === 'requestingFlip' && !separateIdCardCaptureSequence && imageUrl && ( /*#__PURE__*/React__default.createElement(IdCaptureImagePreview, {
7537
+ classNames: (_e = classNames.capture) === null || _e === void 0 ? void 0 : _e.imagePreview,
7538
+ text: (_f = idCaptureVerbiages === null || idCaptureVerbiages === void 0 ? void 0 : idCaptureVerbiages.idCardFront) === null || _f === void 0 ? void 0 : _f.processingIdCardText,
7620
7539
  imageUrl: imageUrl
7621
7540
  })), state.captureState !== 'complete' && ( /*#__PURE__*/React__default.createElement("div", {
7622
7541
  id: "idmission-above-guides-content"
7623
7542
  })), /*#__PURE__*/React__default.createElement(ExitCaptureButton, {
7624
7543
  onClick: onExit,
7625
- className: (_j = classNames.capture) === null || _j === void 0 ? void 0 : _j.exitCaptureBtn
7544
+ className: (_g = classNames.capture) === null || _g === void 0 ? void 0 : _g.exitCaptureBtn
7626
7545
  }), !overlayDismissed && ( /*#__PURE__*/React__default.createElement(IdCaptureLoadingOverlay, {
7627
7546
  key: attempt,
7628
7547
  mode: loadingOverlayMode,
@@ -7649,12 +7568,12 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
7649
7568
  verbiage: verbiage.success
7650
7569
  })), state.captureState === 'complete' && showSuccessScreen && ( /*#__PURE__*/React__default.createElement(IdCaptureSuccess, {
7651
7570
  capturedDocuments: state.capturedDocuments,
7652
- barcodeResult: state.barcodeResult,
7653
7571
  classNames: classNames.success,
7654
7572
  onSubmitClick: onSubmitClick,
7655
7573
  onRetryClick: onRetryClick,
7656
7574
  colors: colors.success,
7657
- verbiage: verbiage.success
7575
+ verbiage: verbiage.success,
7576
+ debugMode: debugMode
7658
7577
  })));
7659
7578
  };
7660
7579
 
@@ -10515,6 +10434,31 @@ var DoneButton = styled(LoaderButton)(templateObject_6 || (templateObject_6 = __
10515
10434
  var templateObject_1$6, templateObject_2$6, templateObject_3$6, templateObject_4$1, templateObject_5, templateObject_6;
10516
10435
 
10517
10436
  var edgeBoundary = 0.05;
10437
+ var defaultVideoIdCaptureThresholds = {
10438
+ detection: {
10439
+ idCardFront: 0.6,
10440
+ idCardBack: 0.6,
10441
+ passport: 1
10442
+ },
10443
+ focus: {
10444
+ idCardFront: {
10445
+ desktop: 0,
10446
+ mobile: 0
10447
+ },
10448
+ idCardBack: {
10449
+ desktop: 0,
10450
+ mobile: 0
10451
+ },
10452
+ passport: {
10453
+ desktop: 0,
10454
+ mobile: 0
10455
+ }
10456
+ },
10457
+ goodFrames: {
10458
+ idCardFront: 1,
10459
+ idCardBack: 1
10460
+ }
10461
+ };
10518
10462
  var IdVideoCapture = function IdVideoCapture(_a) {
10519
10463
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
10520
10464
  var onComplete = _a.onComplete,
@@ -10526,96 +10470,85 @@ var IdVideoCapture = function IdVideoCapture(_a) {
10526
10470
  idCaptureModelsEnabled = _w === void 0 ? true : _w,
10527
10471
  _x = _a.idCardFrontDelay,
10528
10472
  idCardFrontDelay = _x === void 0 ? 1000 : _x,
10529
- _y = _a.idCardFrontDetectionThreshold,
10530
- idCardFrontDetectionThreshold = _y === void 0 ? 0.6 : _y,
10531
- _z = _a.idCardFrontFocusThreshold,
10532
- idCardFrontFocusThreshold = _z === void 0 ? 0 : _z,
10533
- _0 = _a.goodIdCardFrontFramesThreshold,
10534
- goodIdCardFrontFramesThreshold = _0 === void 0 ? 1 : _0,
10535
- _1 = _a.idCardBackDetectionThreshold,
10536
- idCardBackDetectionThreshold = _1 === void 0 ? 0.6 : _1,
10537
- _2 = _a.idCardBackFocusThreshold,
10538
- idCardBackFocusThreshold = _2 === void 0 ? 0 : _2,
10539
- _3 = _a.goodIdCardBackFramesThreshold,
10540
- goodIdCardBackFramesThreshold = _3 === void 0 ? 1 : _3,
10541
- _4 = _a.skipShowIdCardBack,
10542
- skipShowIdCardBack = _4 === void 0 ? false : _4,
10543
- _5 = _a.captureCountdownSeconds,
10544
- captureCountdownSeconds = _5 === void 0 ? 3 : _5,
10473
+ _y = _a.videoIdCaptureThresholds,
10474
+ videoIdCaptureThresholds = _y === void 0 ? defaultVideoIdCaptureThresholds : _y,
10475
+ _z = _a.skipShowIdCardBack,
10476
+ skipShowIdCardBack = _z === void 0 ? false : _z,
10477
+ _0 = _a.captureCountdownSeconds,
10478
+ captureCountdownSeconds = _0 === void 0 ? 3 : _0,
10545
10479
  readTextPrompt = _a.readTextPrompt,
10546
- _6 = _a.readTextTimeoutDurationMs,
10547
- readTextTimeoutDurationMs = _6 === void 0 ? 15000 : _6,
10548
- _7 = _a.readTextMinReadingMs,
10549
- readTextMinReadingMs = _7 === void 0 ? 10000 : _7,
10550
- _8 = _a.disableFaceDetectionWhileAudioCapture,
10551
- disableFaceDetectionWhileAudioCapture = _8 === void 0 ? false : _8,
10552
- _9 = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
10553
- disableFaceDetectionWhileAudioCaptureMsDelay = _9 === void 0 ? 2000 : _9,
10554
- _10 = _a.mergeAVStreams,
10555
- mergeAVStreams = _10 === void 0 ? false : _10,
10556
- _11 = _a.assets,
10557
- assets = _11 === void 0 ? {} : _11,
10558
- _12 = _a.classNames,
10559
- classNames = _12 === void 0 ? {} : _12,
10560
- _13 = _a.colors,
10561
- colors = _13 === void 0 ? {} : _13,
10562
- _14 = _a.verbiage,
10563
- rawVerbiage = _14 === void 0 ? {} : _14,
10564
- _15 = _a.debugMode,
10565
- debugMode = _15 === void 0 ? false : _15;
10566
- var _16 = useResizeObserver(),
10567
- ref = _16.ref,
10568
- _17 = _16.width,
10569
- width = _17 === void 0 ? 1 : _17,
10570
- _18 = _16.height,
10571
- height = _18 === void 0 ? 1 : _18;
10572
- var _19 = useContext(CameraStateContext),
10573
- cameraRef = _19.cameraRef,
10574
- videoRef = _19.videoRef,
10575
- videoLoaded = _19.videoLoaded,
10576
- cameraReady = _19.cameraReady,
10577
- microphoneReady = _19.microphoneReady,
10578
- audioStream = _19.audioStream,
10579
- setVideoLoaded = _19.setVideoLoaded,
10580
- takePhoto = _19.takePhoto;
10581
- var _20 = useState([]),
10582
- detectedObjects = _20[0],
10583
- setDetectedObjects = _20[1];
10584
- var _21 = useState([]),
10585
- faces = _21[0],
10586
- setFaces = _21[1];
10587
- var _22 = useContext(IdCaptureModelsContext),
10588
- idModelsReady = _22.ready,
10589
- startIdModels = _22.start,
10590
- stopIdModels = _22.stop,
10591
- onIdPredictionMade = _22.onPredictionMade,
10592
- setThresholds = _22.setThresholds,
10593
- bestFrameDetails = _22.bestFrameDetails,
10594
- resetBestFrame = _22.resetBestFrame,
10595
- idModelError = _22.modelError;
10596
- var _23 = useState(null),
10597
- videoStartsAt = _23[0],
10598
- setVideoStartsAt = _23[1];
10599
- var _24 = useContext(SubmissionContext),
10600
- setIdCaptureVideoAudioStartsAt = _24.setIdCaptureVideoAudioStartsAt,
10601
- setExpectedAudioText = _24.setExpectedAudioText;
10602
- var _25 = useContext(SelfieGuidanceModelsContext),
10603
- onSelfiePredictionMade = _25.onPredictionMade,
10604
- selfieModelError = _25.error;
10605
- var _26 = useVideoRecorder(cameraRef.current, audioStream, mergeAVStreams),
10606
- isRecordingVideo = _26.isRecordingVideo,
10607
- startRecordingVideo = _26.startRecordingVideo,
10608
- startRecordingAudio = _26.startRecordingAudio,
10609
- stopRecordingVideo = _26.stopRecordingVideo,
10610
- stopRecordingAudio = _26.stopRecordingAudio,
10611
- videoRecordingUnintentionallyStopped = _26.videoRecordingUnintentionallyStopped,
10612
- audioRecordingUnintentionallyStopped = _26.audioRecordingUnintentionallyStopped,
10613
- videoUrl = _26.videoUrl,
10614
- audioUrl = _26.audioUrl;
10480
+ _1 = _a.readTextTimeoutDurationMs,
10481
+ readTextTimeoutDurationMs = _1 === void 0 ? 15000 : _1,
10482
+ _2 = _a.readTextMinReadingMs,
10483
+ readTextMinReadingMs = _2 === void 0 ? 10000 : _2,
10484
+ _3 = _a.disableFaceDetectionWhileAudioCapture,
10485
+ disableFaceDetectionWhileAudioCapture = _3 === void 0 ? false : _3,
10486
+ _4 = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
10487
+ disableFaceDetectionWhileAudioCaptureMsDelay = _4 === void 0 ? 2000 : _4,
10488
+ _5 = _a.mergeAVStreams,
10489
+ mergeAVStreams = _5 === void 0 ? false : _5,
10490
+ _6 = _a.assets,
10491
+ assets = _6 === void 0 ? {} : _6,
10492
+ _7 = _a.classNames,
10493
+ classNames = _7 === void 0 ? {} : _7,
10494
+ _8 = _a.colors,
10495
+ colors = _8 === void 0 ? {} : _8,
10496
+ _9 = _a.verbiage,
10497
+ rawVerbiage = _9 === void 0 ? {} : _9,
10498
+ _10 = _a.debugMode,
10499
+ debugMode = _10 === void 0 ? false : _10;
10500
+ var _11 = useResizeObserver(),
10501
+ ref = _11.ref,
10502
+ _12 = _11.width,
10503
+ width = _12 === void 0 ? 1 : _12,
10504
+ _13 = _11.height,
10505
+ height = _13 === void 0 ? 1 : _13;
10506
+ var _14 = useContext(CameraStateContext),
10507
+ cameraRef = _14.cameraRef,
10508
+ videoRef = _14.videoRef,
10509
+ videoLoaded = _14.videoLoaded,
10510
+ cameraReady = _14.cameraReady,
10511
+ microphoneReady = _14.microphoneReady,
10512
+ audioStream = _14.audioStream,
10513
+ setVideoLoaded = _14.setVideoLoaded;
10514
+ var _15 = useState([]),
10515
+ detectedObjects = _15[0],
10516
+ setDetectedObjects = _15[1];
10517
+ var _16 = useState([]),
10518
+ faces = _16[0],
10519
+ setFaces = _16[1];
10520
+ var _17 = useContext(IdCaptureModelsContext),
10521
+ idModelsReady = _17.ready,
10522
+ startIdModels = _17.start,
10523
+ stopIdModels = _17.stop,
10524
+ onIdPredictionMade = _17.onPredictionMade,
10525
+ setThresholds = _17.setThresholds,
10526
+ bestFrameDetails = _17.bestFrameDetails,
10527
+ resetBestFrame = _17.resetBestFrame,
10528
+ idModelError = _17.modelError;
10529
+ var _18 = useState(null),
10530
+ videoStartsAt = _18[0],
10531
+ setVideoStartsAt = _18[1];
10532
+ var _19 = useContext(SubmissionContext),
10533
+ setIdCaptureVideoAudioStartsAt = _19.setIdCaptureVideoAudioStartsAt,
10534
+ setExpectedAudioText = _19.setExpectedAudioText;
10535
+ var _20 = useContext(SelfieGuidanceModelsContext),
10536
+ onSelfiePredictionMade = _20.onPredictionMade,
10537
+ selfieModelError = _20.error;
10538
+ var _21 = useVideoRecorder(cameraRef.current, audioStream, mergeAVStreams),
10539
+ isRecordingVideo = _21.isRecordingVideo,
10540
+ startRecordingVideo = _21.startRecordingVideo,
10541
+ startRecordingAudio = _21.startRecordingAudio,
10542
+ stopRecordingVideo = _21.stopRecordingVideo,
10543
+ stopRecordingAudio = _21.stopRecordingAudio,
10544
+ videoRecordingUnintentionallyStopped = _21.videoRecordingUnintentionallyStopped,
10545
+ audioRecordingUnintentionallyStopped = _21.audioRecordingUnintentionallyStopped,
10546
+ videoUrl = _21.videoUrl,
10547
+ audioUrl = _21.audioUrl;
10615
10548
  var countdownTimeoutRef = useRef(undefined);
10616
- var _27 = useState(0),
10617
- countdownRemaining = _27[0],
10618
- setCountdownRemaining = _27[1];
10549
+ var _22 = useState(-1),
10550
+ countdownRemaining = _22[0],
10551
+ setCountdownRemaining = _22[1];
10619
10552
  useEffect(function () {
10620
10553
  if (!isRecordingVideo && !videoUrl) {
10621
10554
  startRecordingVideo();
@@ -10635,41 +10568,30 @@ var IdVideoCapture = function IdVideoCapture(_a) {
10635
10568
  onRecordingFailed === null || onRecordingFailed === void 0 ? void 0 : onRecordingFailed();
10636
10569
  }
10637
10570
  }, [audioRecordingUnintentionallyStopped, onRecordingFailed, videoRecordingUnintentionallyStopped]);
10638
- var shouldCaptureFrames = useRef(false);
10639
- useEffect(function () {
10640
- shouldCaptureFrames.current = videoLoaded && cameraReady && idModelsReady && !idModelError && (!readTextPrompt || microphoneReady);
10641
- }, [cameraReady, idModelError, idModelsReady, microphoneReady, readTextPrompt, videoLoaded]);
10642
- var _28 = useState('SHOW_ID_FRONT'),
10643
- requestedAction = _28[0],
10644
- setRequestedAction = _28[1];
10571
+ var _23 = useState('SHOW_ID_FRONT'),
10572
+ requestedAction = _23[0],
10573
+ setRequestedAction = _23[1];
10574
+ var shouldRunIdModels = idCaptureModelsEnabled && videoLoaded && cameraReady && idModelsReady && !idModelError && requestedAction !== 'READ_TEXT' && (!readTextPrompt || microphoneReady);
10645
10575
  useEffect(function startModelsWhenCapturing() {
10646
- if (!shouldCaptureFrames.current && requestedAction !== 'SHOW_ID_FRONT' && requestedAction !== 'SHOW_ID_BACK') return;
10576
+ if (!shouldRunIdModels) return;
10647
10577
  startIdModels();
10648
10578
  return function () {
10649
10579
  stopIdModels();
10650
10580
  };
10651
- }, [requestedAction, startIdModels, stopIdModels]);
10581
+ }, [shouldRunIdModels, startIdModels, stopIdModels]);
10652
10582
  useEffect(function () {
10653
- setThresholds({
10654
- idCard: requestedAction === 'SHOW_ID_FRONT' ? idCardFrontDetectionThreshold : requestedAction === 'SHOW_ID_BACK' ? idCardBackDetectionThreshold : 1,
10655
- passport: 1,
10656
- focus: {
10657
- idCard: {
10658
- mobile: requestedAction === 'SHOW_ID_FRONT' ? idCardFrontFocusThreshold : requestedAction === 'SHOW_ID_BACK' ? idCardBackFocusThreshold : 0
10659
- }
10660
- }
10661
- });
10662
- }, [idCardBackDetectionThreshold, idCardBackFocusThreshold, idCardFrontDetectionThreshold, idCardFrontFocusThreshold, requestedAction, setThresholds]);
10663
- var _29 = useState(0),
10664
- currentDetectionScore = _29[0],
10665
- setCurrentDetectionScore = _29[1];
10666
- var _30 = useState(0),
10667
- currentFocusScore = _30[0],
10668
- setCurrentFocusScore = _30[1];
10669
- var _31 = useState(0),
10670
- goodFramesCount = _31[0],
10671
- setGoodFramesCount = _31[1];
10672
- var goodFramesThreshold = requestedAction === 'SHOW_ID_FRONT' ? goodIdCardFrontFramesThreshold : goodIdCardBackFramesThreshold;
10583
+ setThresholds(videoIdCaptureThresholds);
10584
+ }, [requestedAction, setThresholds, videoIdCaptureThresholds]);
10585
+ var _24 = useState(0),
10586
+ currentDetectionScore = _24[0],
10587
+ setCurrentDetectionScore = _24[1];
10588
+ var _25 = useState(0),
10589
+ currentFocusScore = _25[0],
10590
+ setCurrentFocusScore = _25[1];
10591
+ var _26 = useState(0),
10592
+ goodFramesCount = _26[0],
10593
+ setGoodFramesCount = _26[1];
10594
+ var goodFramesThreshold = requestedAction === 'SHOW_ID_FRONT' ? videoIdCaptureThresholds.goodFrames.idCardFront : videoIdCaptureThresholds.goodFrames.idCardBack;
10673
10595
  var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
10674
10596
  useEffect(function () {
10675
10597
  if (!idCaptureModelsEnabled || idModelError) return;
@@ -10677,18 +10599,19 @@ var IdVideoCapture = function IdVideoCapture(_a) {
10677
10599
  setDetectedObjects(prediction.detectedObjects);
10678
10600
  setCurrentDetectionScore(prediction.detectionScore);
10679
10601
  setCurrentFocusScore(prediction.focusScore);
10680
- if (prediction.detectionThresholdMet && prediction.focusThresholdMet) {
10681
- setGoodFramesCount(function (n) {
10682
- return n + 1;
10683
- });
10684
- } else {
10685
- setGoodFramesCount(0);
10602
+ var detectionThresholdMet = requestedAction === 'SHOW_ID_FRONT' ? prediction.idCardFrontDetectionThresholdMet : prediction.idCardBackDetectionThresholdMet;
10603
+ var isGoodFrame = detectionThresholdMet && prediction.focusThresholdMet;
10604
+ if (requestedAction === 'FLIP_ID' && isGoodFrame) {
10605
+ return setRequestedAction('SHOW_ID_BACK');
10686
10606
  }
10607
+ setGoodFramesCount(isGoodFrame ? function (n) {
10608
+ return n + 1;
10609
+ } : 0);
10687
10610
  });
10688
- }, [idCaptureModelsEnabled, idCardFrontDetectionThreshold, onIdPredictionMade, idModelError]);
10689
- var _32 = useState(null),
10690
- idFrontCaptureStartedAt = _32[0],
10691
- setFirstGoodFrameTime = _32[1];
10611
+ }, [idCaptureModelsEnabled, onIdPredictionMade, idModelError, requestedAction]);
10612
+ var _27 = useState(null),
10613
+ idFrontCaptureStartedAt = _27[0],
10614
+ setFirstGoodFrameTime = _27[1];
10692
10615
  useEffect(function () {
10693
10616
  if (goodFramesCount === 1) setFirstGoodFrameTime(new Date().getTime());
10694
10617
  }, [goodFramesCount]);
@@ -10709,73 +10632,56 @@ var IdVideoCapture = function IdVideoCapture(_a) {
10709
10632
  var frameHeight = (_e = (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) !== null && _e !== void 0 ? _e : 0;
10710
10633
  var faceBox = (_f = faces === null || faces === void 0 ? void 0 : faces[0]) === null || _f === void 0 ? void 0 : _f.box;
10711
10634
  var faceCentered = !faceBox || !frameWidth || faceBox.xMin > frameWidth * edgeBoundary && faceBox.yMin > frameHeight * edgeBoundary && faceBox.xMax < frameWidth * (1 - edgeBoundary) && faceBox.yMax < frameHeight * (1 - edgeBoundary);
10712
- var _33 = useState(),
10713
- countdownStartedAt = _33[0],
10714
- setCountdownStartedAt = _33[1];
10635
+ var _28 = useState(),
10636
+ countdownStartedAt = _28[0],
10637
+ setCountdownStartedAt = _28[1];
10638
+ var photoCanvas = useRef(null);
10715
10639
  var frameLock = useRef(false);
10716
10640
  var captureFrame = useCallback(function () {
10717
10641
  return __awaiter(void 0, void 0, void 0, function () {
10718
- var frame, frameBase64, _a;
10719
- return __generator(this, function (_b) {
10720
- switch (_b.label) {
10642
+ var frameBase64;
10643
+ return __generator(this, function (_a) {
10644
+ switch (_a.label) {
10721
10645
  case 0:
10722
10646
  if (frameLock.current) return [2 /*return*/];
10723
10647
  frameLock.current = true;
10724
- return [4 /*yield*/, takePhoto()];
10725
- case 1:
10726
- frame = _b.sent();
10727
- if (!frame) {
10648
+ drawToCanvas(photoCanvas.current, videoRef.current);
10649
+ frameBase64 = photoCanvas.current.toDataURL('image/jpeg');
10650
+ if (!frameBase64) {
10728
10651
  frameLock.current = false;
10729
10652
  return [2 /*return*/];
10730
10653
  }
10731
- _b.label = 2;
10732
- case 2:
10733
- _b.trys.push([2,, 10, 11]);
10734
- _a = frame;
10735
- if (!_a) return [3 /*break*/, 4];
10736
- return [4 /*yield*/, new Promise(function (resolve) {
10737
- var reader = new FileReader();
10738
- reader.onloadend = function () {
10739
- return resolve(reader.result);
10740
- };
10741
- reader.readAsDataURL(frame);
10742
- })];
10743
- case 3:
10744
- _a = _b.sent();
10745
- _b.label = 4;
10746
- case 4:
10747
- frameBase64 = _a;
10748
- if (!(requestedAction == 'SHOW_ID_FRONT')) return [3 /*break*/, 8];
10654
+ _a.label = 1;
10655
+ case 1:
10656
+ _a.trys.push([1,, 7, 8]);
10657
+ if (!(requestedAction == 'SHOW_ID_FRONT')) return [3 /*break*/, 5];
10749
10658
  if (onIdFrontImageCaptured) {
10750
- frameBase64 && onIdFrontImageCaptured(frameBase64);
10659
+ onIdFrontImageCaptured(frameBase64);
10751
10660
  }
10752
- if (!skipShowIdCardBack) return [3 /*break*/, 7];
10753
- if (!(skipShowIdCardBack === true)) return [3 /*break*/, 5];
10661
+ if (!skipShowIdCardBack) return [3 /*break*/, 4];
10662
+ if (!(skipShowIdCardBack === true)) return [3 /*break*/, 2];
10754
10663
  return [2 /*return*/, onIdBackCaptureComplete()];
10755
- case 5:
10664
+ case 2:
10756
10665
  return [4 /*yield*/, skipShowIdCardBack()];
10757
- case 6:
10758
- if (_b.sent()) {
10666
+ case 3:
10667
+ if (_a.sent()) {
10759
10668
  return [2 /*return*/, onIdBackCaptureComplete()];
10760
10669
  }
10761
- _b.label = 7;
10762
- case 7:
10670
+ _a.label = 4;
10671
+ case 4:
10763
10672
  setRequestedAction('FLIP_ID');
10764
- setTimeout(function () {
10765
- setRequestedAction('SHOW_ID_BACK');
10766
- }, 6000);
10767
- return [3 /*break*/, 9];
10768
- case 8:
10673
+ return [3 /*break*/, 6];
10674
+ case 5:
10769
10675
  if (requestedAction == 'SHOW_ID_BACK') {
10770
10676
  if (onIdBackImageCaptured) {
10771
- frameBase64 && onIdBackImageCaptured(frameBase64);
10677
+ onIdBackImageCaptured(frameBase64);
10772
10678
  }
10773
10679
  onIdBackCaptureComplete();
10774
10680
  }
10775
- _b.label = 9;
10776
- case 9:
10777
- return [3 /*break*/, 11];
10778
- case 10:
10681
+ _a.label = 6;
10682
+ case 6:
10683
+ return [3 /*break*/, 8];
10684
+ case 7:
10779
10685
  setDetectedObjects([]);
10780
10686
  setCurrentDetectionScore(0);
10781
10687
  setCurrentFocusScore(0);
@@ -10787,17 +10693,27 @@ var IdVideoCapture = function IdVideoCapture(_a) {
10787
10693
  clearTimeout(countdownTimeoutRef.current);
10788
10694
  }
10789
10695
  return [7 /*endfinally*/];
10790
- case 11:
10696
+ case 8:
10791
10697
  return [2 /*return*/];
10792
10698
  }
10793
10699
  });
10794
10700
  });
10795
- }, [onIdBackCaptureComplete, onIdBackImageCaptured, onIdFrontImageCaptured, requestedAction, resetBestFrame, skipShowIdCardBack, takePhoto]);
10701
+ }, [onIdBackCaptureComplete, onIdBackImageCaptured, onIdFrontImageCaptured, requestedAction, resetBestFrame, skipShowIdCardBack, videoRef]);
10702
+ var isFlipping = requestedAction === 'FLIP_ID';
10703
+ useEffect(function () {
10704
+ if (!isFlipping) return;
10705
+ var t = setTimeout(function () {
10706
+ setRequestedAction('SHOW_ID_BACK');
10707
+ }, 6000);
10708
+ return function () {
10709
+ clearTimeout(t);
10710
+ };
10711
+ }, [isFlipping]);
10796
10712
  var stopRecording = useCallback(function () {
10797
10713
  stopRecordingVideo();
10798
10714
  stopRecordingAudio();
10799
10715
  }, [stopRecordingAudio, stopRecordingVideo]);
10800
- var satisfied = goodFramesThresholdMet && faceCentered && delaySatisfied;
10716
+ var satisfied = !isFlipping && goodFramesThresholdMet && faceCentered && delaySatisfied;
10801
10717
  useEffect(function () {
10802
10718
  if (satisfied && !countdownStartedAt) {
10803
10719
  setCountdownStartedAt(new Date());
@@ -10817,10 +10733,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
10817
10733
  }, 1000);
10818
10734
  return;
10819
10735
  }
10820
- if (countdownStartedAt) {
10821
- captureFrame();
10822
- }
10823
- }, [captureFrame, countdownStartedAt, countdownTimeoutRef]);
10736
+ }, [countdownTimeoutRef]);
10824
10737
  useEffect(function () {
10825
10738
  if (!countdownStartedAt) return;
10826
10739
  setCountdownRemaining(captureCountdownSeconds);
@@ -10830,11 +10743,17 @@ var IdVideoCapture = function IdVideoCapture(_a) {
10830
10743
  return function () {
10831
10744
  clearTimeout(countdownTimeoutRef.current);
10832
10745
  };
10833
- }, [captureCountdownSeconds, captureFrame, countdownStartedAt, manualCountdown]);
10746
+ }, [captureCountdownSeconds, countdownStartedAt, manualCountdown]);
10747
+ useEffect(function () {
10748
+ if (countdownRemaining === 0) {
10749
+ setCountdownRemaining(-1);
10750
+ captureFrame().then();
10751
+ }
10752
+ }, [captureFrame, countdownRemaining]);
10834
10753
  var timeoutStartedAt = useTimeout(readTextTimeoutDurationMs, stopRecording, requestedAction !== 'READ_TEXT', false, requestedAction === 'READ_TEXT').timeoutStartedAt;
10835
- var _34 = useState(0),
10836
- numFramesWithoutFaces = _34[0],
10837
- setNumFramesWithoutFaces = _34[1];
10754
+ var _29 = useState(0),
10755
+ numFramesWithoutFaces = _29[0],
10756
+ setNumFramesWithoutFaces = _29[1];
10838
10757
  useEffect(function () {
10839
10758
  if (!selfieModelError) {
10840
10759
  onSelfiePredictionMade(function (faces) {
@@ -10852,14 +10771,14 @@ var IdVideoCapture = function IdVideoCapture(_a) {
10852
10771
  }
10853
10772
  }, [disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, numFramesWithoutFaces, onFaceNotDetected, timeoutStartedAt]);
10854
10773
  var theme = useTheme();
10855
- var _35 = useTranslations(rawVerbiage, {
10774
+ var _30 = useTranslations(rawVerbiage, {
10856
10775
  faceNotCenteredText: 'Please move your face to the center...',
10857
10776
  searchingForIdCardText: 'Searching for ID card...',
10858
10777
  captureBtnText: 'Capture'
10859
10778
  }),
10860
- captureBtnText = _35.captureBtnText,
10861
- faceNotCenteredText = _35.faceNotCenteredText,
10862
- searchingForIdCardText = _35.searchingForIdCardText;
10779
+ captureBtnText = _30.captureBtnText,
10780
+ faceNotCenteredText = _30.faceNotCenteredText,
10781
+ searchingForIdCardText = _30.searchingForIdCardText;
10863
10782
  var debugScalingDetails = useDebugScalingDetails({
10864
10783
  enabled: debugMode,
10865
10784
  pageWidth: width,
@@ -10873,7 +10792,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
10873
10792
  return /*#__PURE__*/React__default.createElement(PageContainer, {
10874
10793
  ref: ref,
10875
10794
  className: "flex ".concat((_l = classNames.container) !== null && _l !== void 0 ? _l : '')
10876
- }, requestedAction === 'READ_TEXT' ? ( /*#__PURE__*/React__default.createElement(ReadTextPrompt, {
10795
+ }, /*#__PURE__*/React__default.createElement(InvisibleCanvas, {
10796
+ ref: photoCanvas
10797
+ }), requestedAction === 'READ_TEXT' ? ( /*#__PURE__*/React__default.createElement(ReadTextPrompt, {
10877
10798
  text: readTextPrompt,
10878
10799
  startedAt: timeoutStartedAt || undefined,
10879
10800
  durationMs: readTextTimeoutDurationMs,
@@ -10912,7 +10833,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
10912
10833
  className: classNames.guidanceMessage,
10913
10834
  "$background": (_q = (_p = (_o = theme.guidanceMessages) === null || _o === void 0 ? void 0 : _o.negative) === null || _p === void 0 ? void 0 : _p.backgroundColor) !== null && _q !== void 0 ? _q : 'red',
10914
10835
  "$textColor": (_t = (_s = (_r = theme.guidanceMessages) === null || _r === void 0 ? void 0 : _r.negative) === null || _s === void 0 ? void 0 : _s.textColor) !== null && _t !== void 0 ? _t : 'white'
10915
- }, guidanceText))), debugMode && ( /*#__PURE__*/React__default.createElement(DebugStatsPane, null, cameraRef.current ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__default.createElement("br", null), isRecordingVideo ? '✅ Recording' : '❌ Not recording', /*#__PURE__*/React__default.createElement("br", null), goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', goodFramesCount, "/", goodFramesThreshold, /*#__PURE__*/React__default.createElement("br", null), "Detection Score: ", currentDetectionScore, /*#__PURE__*/React__default.createElement("br", null), "Focus Score: ", currentFocusScore, /*#__PURE__*/React__default.createElement("br", null), "Best Frame Detection Score: ", (_u = bestFrameDetails === null || bestFrameDetails === void 0 ? void 0 : bestFrameDetails.detectionScore) !== null && _u !== void 0 ? _u : 0, /*#__PURE__*/React__default.createElement("br", null), "Best Frame Focus Score: ", (_v = bestFrameDetails === null || bestFrameDetails === void 0 ? void 0 : bestFrameDetails.focusScore) !== null && _v !== void 0 ? _v : 0)), !!countdownRemaining && capturingId && ( /*#__PURE__*/React__default.createElement(CountdownContainer, {
10836
+ }, guidanceText))), debugMode && ( /*#__PURE__*/React__default.createElement(DebugStatsPane, null, cameraRef.current ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__default.createElement("br", null), isRecordingVideo ? '✅ Recording' : '❌ Not recording', /*#__PURE__*/React__default.createElement("br", null), goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', goodFramesCount, "/", goodFramesThreshold, /*#__PURE__*/React__default.createElement("br", null), "Detection Score: ", currentDetectionScore, /*#__PURE__*/React__default.createElement("br", null), "Focus Score: ", currentFocusScore, /*#__PURE__*/React__default.createElement("br", null), "Best Frame Detection Score: ", (_u = bestFrameDetails === null || bestFrameDetails === void 0 ? void 0 : bestFrameDetails.detectionScore) !== null && _u !== void 0 ? _u : 0, /*#__PURE__*/React__default.createElement("br", null), "Best Frame Focus Score: ", (_v = bestFrameDetails === null || bestFrameDetails === void 0 ? void 0 : bestFrameDetails.focusScore) !== null && _v !== void 0 ? _v : 0)), countdownRemaining > 0 && capturingId && ( /*#__PURE__*/React__default.createElement(CountdownContainer, {
10916
10837
  className: classNames.countdownContainer
10917
10838
  }, /*#__PURE__*/React__default.createElement(Countdown, {
10918
10839
  className: classNames.countdown
@@ -11067,64 +10988,60 @@ var VideoIdWizard = function VideoIdWizard(_a) {
11067
10988
  faceLivenessProps = _h === void 0 ? {} : _h,
11068
10989
  _j = _a.idCaptureModelsEnabled,
11069
10990
  idCaptureModelsEnabled = _j === void 0 ? true : _j,
11070
- idCardFrontDetectionThreshold = _a.idCardFrontDetectionThreshold,
11071
- idCardBackDetectionThreshold = _a.idCardBackDetectionThreshold,
11072
- idCardFrontFocusThreshold = _a.idCardFrontFocusThreshold,
11073
- idCardBackFocusThreshold = _a.idCardBackFocusThreshold,
11074
- goodIdCardFrontFramesThreshold = _a.goodIdCardFrontFramesThreshold,
11075
- goodIdCardBackFramesThreshold = _a.goodIdCardBackFramesThreshold,
10991
+ _k = _a.videoIdCaptureThresholds,
10992
+ videoIdCaptureThresholds = _k === void 0 ? defaultVideoIdCaptureThresholds : _k,
11076
10993
  readTextPrompt = _a.readTextPrompt,
11077
10994
  readTextTimeoutDurationMs = _a.readTextTimeoutDurationMs,
11078
10995
  readTextMinReadingMs = _a.readTextMinReadingMs,
11079
- _k = _a.skipIdCapture,
11080
- skipIdCapture = _k === void 0 ? false : _k,
11081
- _l = _a.skipShowIdCardBack,
11082
- skipShowIdCardBack = _l === void 0 ? false : _l,
11083
- _m = _a.skipSuccessScreen,
11084
- skipSuccessScreen = _m === void 0 ? false : _m,
11085
- _o = _a.idCaptureLoadingOverlayMode,
11086
- idCaptureLoadingOverlayMode = _o === void 0 ? 'default' : _o,
11087
- _p = _a.idCaptureGuideType,
11088
- idCaptureGuideType = _p === void 0 ? 'fit' : _p,
11089
- _q = _a.idCapturePortraitGuidesOnMobile,
11090
- idCapturePortraitGuidesOnMobile = _q === void 0 ? false : _q,
11091
- _r = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
11092
- idCaptureRotateLoadingOverlayImageWhenPortrait = _r === void 0 ? true : _r,
11093
- _s = _a.idCaptureModelLoadTimeoutMs,
11094
- idCaptureModelLoadTimeoutMs = _s === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _s,
11095
- _t = _a.faceLivenessLoadingOverlayMode,
11096
- faceLivenessLoadingOverlayMode = _t === void 0 ? 'default' : _t,
11097
- _u = _a.disableFaceDetectionWhileAudioCapture,
11098
- disableFaceDetectionWhileAudioCapture = _u === void 0 ? true : _u,
11099
- _v = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
11100
- disableFaceDetectionWhileAudioCaptureMsDelay = _v === void 0 ? 2000 : _v,
11101
- _w = _a.silentFallback,
11102
- silentFallback = _w === void 0 ? false : _w,
11103
- _x = _a.mergeAVStreams,
11104
- mergeAVStreams = _x === void 0 ? false : _x,
11105
- _y = _a.assets,
11106
- assets = _y === void 0 ? {} : _y,
11107
- _z = _a.classNames,
11108
- classNames = _z === void 0 ? {} : _z,
11109
- _0 = _a.colors,
11110
- colors = _0 === void 0 ? {} : _0,
11111
- _1 = _a.verbiage,
11112
- verbiage = _1 === void 0 ? {} : _1,
11113
- _2 = _a.debugMode,
11114
- debugMode = _2 === void 0 ? false : _2;
11115
- var _3 = useContext(SubmissionContext),
11116
- submissionStatus = _3.submissionStatus,
11117
- idCaptureVideoUrl = _3.idCaptureVideoUrl,
11118
- idCaptureVideoAudioUrl = _3.idCaptureVideoAudioUrl,
11119
- idCaptureVideoIdFrontImage = _3.idCaptureVideoIdFrontImage,
11120
- idCaptureVideoIdBackImage = _3.idCaptureVideoIdBackImage,
11121
- setIdCaptureVideoUrl = _3.setIdCaptureVideoUrl,
11122
- setIdCaptureVideoIdFrontImage = _3.setIdCaptureVideoIdFrontImage,
11123
- setIdCaptureVideoIdBackImage = _3.setIdCaptureVideoIdBackImage,
11124
- setIdCaptureVideoAudioUrl = _3.setIdCaptureVideoAudioUrl;
11125
- var _4 = useState('CAPTURING_ID'),
11126
- captureState = _4[0],
11127
- setCaptureState = _4[1];
10996
+ _l = _a.skipIdCapture,
10997
+ skipIdCapture = _l === void 0 ? false : _l,
10998
+ _m = _a.skipShowIdCardBack,
10999
+ skipShowIdCardBack = _m === void 0 ? false : _m,
11000
+ _o = _a.skipSuccessScreen,
11001
+ skipSuccessScreen = _o === void 0 ? false : _o,
11002
+ _p = _a.idCaptureLoadingOverlayMode,
11003
+ idCaptureLoadingOverlayMode = _p === void 0 ? 'default' : _p,
11004
+ _q = _a.idCaptureGuideType,
11005
+ idCaptureGuideType = _q === void 0 ? 'fit' : _q,
11006
+ _r = _a.idCapturePortraitGuidesOnMobile,
11007
+ idCapturePortraitGuidesOnMobile = _r === void 0 ? false : _r,
11008
+ _s = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
11009
+ idCaptureRotateLoadingOverlayImageWhenPortrait = _s === void 0 ? true : _s,
11010
+ _t = _a.idCaptureModelLoadTimeoutMs,
11011
+ idCaptureModelLoadTimeoutMs = _t === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _t,
11012
+ _u = _a.faceLivenessLoadingOverlayMode,
11013
+ faceLivenessLoadingOverlayMode = _u === void 0 ? 'default' : _u,
11014
+ _v = _a.disableFaceDetectionWhileAudioCapture,
11015
+ disableFaceDetectionWhileAudioCapture = _v === void 0 ? true : _v,
11016
+ _w = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
11017
+ disableFaceDetectionWhileAudioCaptureMsDelay = _w === void 0 ? 2000 : _w,
11018
+ _x = _a.silentFallback,
11019
+ silentFallback = _x === void 0 ? false : _x,
11020
+ _y = _a.mergeAVStreams,
11021
+ mergeAVStreams = _y === void 0 ? false : _y,
11022
+ _z = _a.assets,
11023
+ assets = _z === void 0 ? {} : _z,
11024
+ _0 = _a.classNames,
11025
+ classNames = _0 === void 0 ? {} : _0,
11026
+ _1 = _a.colors,
11027
+ colors = _1 === void 0 ? {} : _1,
11028
+ _2 = _a.verbiage,
11029
+ verbiage = _2 === void 0 ? {} : _2,
11030
+ _3 = _a.debugMode,
11031
+ debugMode = _3 === void 0 ? false : _3;
11032
+ var _4 = useContext(SubmissionContext),
11033
+ submissionStatus = _4.submissionStatus,
11034
+ idCaptureVideoUrl = _4.idCaptureVideoUrl,
11035
+ idCaptureVideoAudioUrl = _4.idCaptureVideoAudioUrl,
11036
+ idCaptureVideoIdFrontImage = _4.idCaptureVideoIdFrontImage,
11037
+ idCaptureVideoIdBackImage = _4.idCaptureVideoIdBackImage,
11038
+ setIdCaptureVideoUrl = _4.setIdCaptureVideoUrl,
11039
+ setIdCaptureVideoIdFrontImage = _4.setIdCaptureVideoIdFrontImage,
11040
+ setIdCaptureVideoIdBackImage = _4.setIdCaptureVideoIdBackImage,
11041
+ setIdCaptureVideoAudioUrl = _4.setIdCaptureVideoAudioUrl;
11042
+ var _5 = useState('CAPTURING_ID'),
11043
+ captureState = _5[0],
11044
+ setCaptureState = _5[1];
11128
11045
  useEffect(function () {
11129
11046
  if (skipIdCapture && captureState === 'CAPTURING_ID') setCaptureState('CHECKING_LIVENESS');
11130
11047
  }, [captureState, skipIdCapture]);
@@ -11155,9 +11072,9 @@ var VideoIdWizard = function VideoIdWizard(_a) {
11155
11072
  var onVideoCaptureFaceNotDetected = useCallback(function () {
11156
11073
  setCaptureState('CHECKING_LIVENESS');
11157
11074
  }, []);
11158
- var _5 = useState(0),
11159
- attempt = _5[0],
11160
- setAttempt = _5[1];
11075
+ var _6 = useState(0),
11076
+ attempt = _6[0],
11077
+ setAttempt = _6[1];
11161
11078
  var userSuppliedExitAfterFailure = onExitAfterFailure !== null && onExitAfterFailure !== void 0 ? onExitAfterFailure : faceLivenessProps.onExitAfterFailure;
11162
11079
  var onFaceCaptureExitAfterFailure = useCallback(function (resp, req) {
11163
11080
  userSuppliedExitAfterFailure === null || userSuppliedExitAfterFailure === void 0 ? void 0 : userSuppliedExitAfterFailure(resp, req);
@@ -11261,12 +11178,7 @@ var VideoIdWizard = function VideoIdWizard(_a) {
11261
11178
  onFaceNotDetected: onVideoCaptureFaceNotDetected,
11262
11179
  onRecordingFailed: onRecordingFailed,
11263
11180
  idCaptureModelsEnabled: idCaptureModelsEnabled,
11264
- idCardFrontDetectionThreshold: idCardFrontDetectionThreshold,
11265
- idCardBackDetectionThreshold: idCardBackDetectionThreshold,
11266
- idCardFrontFocusThreshold: idCardFrontFocusThreshold,
11267
- idCardBackFocusThreshold: idCardBackFocusThreshold,
11268
- goodIdCardFrontFramesThreshold: goodIdCardFrontFramesThreshold,
11269
- goodIdCardBackFramesThreshold: goodIdCardBackFramesThreshold,
11181
+ videoIdCaptureThresholds: videoIdCaptureThresholds,
11270
11182
  skipShowIdCardBack: skipShowIdCardBack,
11271
11183
  disableFaceDetectionWhileAudioCapture: disableFaceDetectionWhileAudioCapture,
11272
11184
  disableFaceDetectionWhileAudioCaptureMsDelay: disableFaceDetectionWhileAudioCaptureMsDelay,
@@ -11727,9 +11639,8 @@ var ThemeProvider = function ThemeProvider(_a) {
11727
11639
  * Render a fullscreen ID capture component that instructs the user to photograph both sides of their ID card, or full page of their passport.
11728
11640
  */
11729
11641
  var IdValidation = function IdValidation(_a) {
11730
- var _b, _c;
11731
- var _d = _a.lang,
11732
- lang = _d === void 0 ? 'auto' : _d,
11642
+ var _b = _a.lang,
11643
+ lang = _b === void 0 ? 'auto' : _b,
11733
11644
  sessionId = _a.sessionId,
11734
11645
  clientRequestID = _a.clientRequestID,
11735
11646
  submissionUrl = _a.submissionUrl,
@@ -11752,35 +11663,25 @@ var IdValidation = function IdValidation(_a) {
11752
11663
  webhooksFireOnReview = _a.webhooksFireOnReview,
11753
11664
  sendBase64DocumentsInSwaggerProxy = _a.sendBase64DocumentsInSwaggerProxy,
11754
11665
  precapturedDocuments = _a.precapturedDocuments,
11755
- _e = _a.loadingOverlayMode,
11756
- loadingOverlayMode = _e === void 0 ? 'default' : _e,
11757
- _f = _a.idCaptureRequirement,
11758
- idCaptureRequirement = _f === void 0 ? 'idCardOrPassport' : _f,
11759
- _g = _a.separateIdCardCaptureSequence,
11760
- separateIdCardCaptureSequence = _g === void 0 ? false : _g,
11761
- _h = _a.idAutoCaptureEnabled,
11762
- idAutoCaptureEnabled = _h === void 0 ? true : _h,
11763
- _j = _a.idCardAutoCaptureScoreThreshold,
11764
- idCardAutoCaptureScoreThreshold = _j === void 0 ? defaultDocumentDetectionThresholds.idCard : _j,
11765
- _k = _a.passportAutoCaptureScoreThreshold,
11766
- passportAutoCaptureScoreThreshold = _k === void 0 ? defaultDocumentDetectionThresholds.passport : _k,
11767
- _l = _a.mrzDetectionScoreThreshold,
11768
- mrzDetectionScoreThreshold = _l === void 0 ? defaultDocumentDetectionThresholds.mrz : _l,
11769
- _m = _a.idCardFocusScoreThreshold,
11770
- idCardFocusScoreThreshold = _m === void 0 ? (_b = defaultFocusThresholds.idCard) === null || _b === void 0 ? void 0 : _b.mobile : _m,
11771
- _o = _a.passportFocusScoreThreshold,
11772
- passportFocusScoreThreshold = _o === void 0 ? (_c = defaultFocusThresholds.passport) === null || _c === void 0 ? void 0 : _c.mobile : _o,
11773
- _p = _a.skipSuccessScreen,
11774
- skipSuccessScreen = _p === void 0 ? false : _p,
11666
+ _c = _a.loadingOverlayMode,
11667
+ loadingOverlayMode = _c === void 0 ? 'default' : _c,
11668
+ _d = _a.idCaptureRequirement,
11669
+ idCaptureRequirement = _d === void 0 ? 'idCardOrPassport' : _d,
11670
+ _e = _a.separateIdCardCaptureSequence,
11671
+ separateIdCardCaptureSequence = _e === void 0 ? false : _e,
11672
+ _f = _a.idCaptureThresholds,
11673
+ idCaptureThresholds = _f === void 0 ? defaultIdCaptureThresholds : _f,
11674
+ _g = _a.skipSuccessScreen,
11675
+ skipSuccessScreen = _g === void 0 ? false : _g,
11775
11676
  instructions = _a.instructions,
11776
- _q = _a.guideType,
11777
- guideType = _q === void 0 ? 'fit' : _q,
11778
- _r = _a.portraitGuidesOnMobile,
11779
- portraitGuidesOnMobile = _r === void 0 ? false : _r,
11780
- _s = _a.rotateLoadingOverlayImageWhenPortrait,
11781
- rotateLoadingOverlayImageWhenPortrait = _s === void 0 ? true : _s,
11782
- _t = _a.modelLoadTimeoutMs,
11783
- modelLoadTimeoutMs = _t === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _t,
11677
+ _h = _a.guideType,
11678
+ guideType = _h === void 0 ? 'fit' : _h,
11679
+ _j = _a.portraitGuidesOnMobile,
11680
+ portraitGuidesOnMobile = _j === void 0 ? false : _j,
11681
+ _k = _a.rotateLoadingOverlayImageWhenPortrait,
11682
+ rotateLoadingOverlayImageWhenPortrait = _k === void 0 ? true : _k,
11683
+ _l = _a.modelLoadTimeoutMs,
11684
+ modelLoadTimeoutMs = _l === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _l,
11784
11685
  onBeforeSubmit = _a.onBeforeSubmit,
11785
11686
  onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
11786
11687
  onDocumentUploadProgress = _a.onDocumentUploadProgress,
@@ -11794,28 +11695,28 @@ var IdValidation = function IdValidation(_a) {
11794
11695
  onUserCancel = _a.onUserCancel,
11795
11696
  onModelError = _a.onModelError,
11796
11697
  onCameraAccessDenied = _a.onCameraAccessDenied,
11797
- _u = _a.theme,
11798
- theme = _u === void 0 ? 'default' : _u,
11799
- _v = _a.assets,
11800
- assets = _v === void 0 ? {} : _v,
11801
- _w = _a.classNames,
11802
- classNames = _w === void 0 ? {} : _w,
11803
- _x = _a.colors,
11804
- colors = _x === void 0 ? {} : _x,
11805
- _y = _a.verbiage,
11806
- verbiage = _y === void 0 ? {} : _y,
11807
- _z = _a.captureSignature,
11808
- captureSignature = _z === void 0 ? false : _z,
11809
- _0 = _a.captureSignatureVideo,
11810
- captureSignatureVideo = _0 === void 0 ? false : _0,
11811
- _1 = _a.captureAdditionalDocuments,
11812
- captureAdditionalDocuments = _1 === void 0 ? [] : _1,
11813
- _2 = _a.geolocationEnabled,
11814
- geolocationEnabled = _2 === void 0 ? true : _2,
11815
- _3 = _a.geolocationRequired,
11816
- geolocationRequired = _3 === void 0 ? false : _3,
11817
- _4 = _a.debugMode,
11818
- debugMode = _4 === void 0 ? false : _4;
11698
+ _m = _a.theme,
11699
+ theme = _m === void 0 ? 'default' : _m,
11700
+ _o = _a.assets,
11701
+ assets = _o === void 0 ? {} : _o,
11702
+ _p = _a.classNames,
11703
+ classNames = _p === void 0 ? {} : _p,
11704
+ _q = _a.colors,
11705
+ colors = _q === void 0 ? {} : _q,
11706
+ _r = _a.verbiage,
11707
+ verbiage = _r === void 0 ? {} : _r,
11708
+ _s = _a.captureSignature,
11709
+ captureSignature = _s === void 0 ? false : _s,
11710
+ _t = _a.captureSignatureVideo,
11711
+ captureSignatureVideo = _t === void 0 ? false : _t,
11712
+ _u = _a.captureAdditionalDocuments,
11713
+ captureAdditionalDocuments = _u === void 0 ? [] : _u,
11714
+ _v = _a.geolocationEnabled,
11715
+ geolocationEnabled = _v === void 0 ? true : _v,
11716
+ _w = _a.geolocationRequired,
11717
+ geolocationRequired = _w === void 0 ? false : _w,
11718
+ _x = _a.debugMode,
11719
+ debugMode = _x === void 0 ? false : _x;
11819
11720
  useLanguage(lang);
11820
11721
  useDebugLogging(debugMode);
11821
11722
  var idCaptureProps = useMemo(function () {
@@ -11826,13 +11727,7 @@ var IdValidation = function IdValidation(_a) {
11826
11727
  precapturedDocuments: precapturedDocuments,
11827
11728
  captureRequirement: idCaptureRequirement,
11828
11729
  separateIdCardCaptureSequence: separateIdCardCaptureSequence,
11829
- autoCaptureEnabled: idAutoCaptureEnabled,
11830
- idCardAutoCaptureScoreThreshold: idCardAutoCaptureScoreThreshold,
11831
- passportAutoCaptureScoreThreshold: passportAutoCaptureScoreThreshold,
11832
- mrzDetectionScoreThreshold: mrzDetectionScoreThreshold,
11833
- idCardFocusScoreThreshold: idCardFocusScoreThreshold,
11834
- passportFocusScoreThreshold: passportFocusScoreThreshold,
11835
- barcodeScanningEnabled: false,
11730
+ thresholds: idCaptureThresholds,
11836
11731
  skipSuccessScreen: skipSuccessScreen,
11837
11732
  loadingOverlayMode: loadingOverlayMode,
11838
11733
  instructions: instructions,
@@ -11846,7 +11741,7 @@ var IdValidation = function IdValidation(_a) {
11846
11741
  verbiage: verbiage,
11847
11742
  debugMode: debugMode
11848
11743
  };
11849
- }, [onExitCapture, onUserCancel, onModelError, precapturedDocuments, idCaptureRequirement, separateIdCardCaptureSequence, idAutoCaptureEnabled, idCardAutoCaptureScoreThreshold, passportAutoCaptureScoreThreshold, mrzDetectionScoreThreshold, idCardFocusScoreThreshold, passportFocusScoreThreshold, skipSuccessScreen, loadingOverlayMode, instructions, guideType, portraitGuidesOnMobile, rotateLoadingOverlayImageWhenPortrait, modelLoadTimeoutMs, assets, classNames, colors, verbiage, debugMode]);
11744
+ }, [onExitCapture, onUserCancel, onModelError, precapturedDocuments, idCaptureRequirement, separateIdCardCaptureSequence, idCaptureThresholds, skipSuccessScreen, loadingOverlayMode, instructions, guideType, portraitGuidesOnMobile, rotateLoadingOverlayImageWhenPortrait, modelLoadTimeoutMs, assets, classNames, colors, verbiage, debugMode]);
11850
11745
  var additionalDocumentCaptureProps = useMemo(function () {
11851
11746
  return {
11852
11747
  documents: captureAdditionalDocuments,
@@ -12040,9 +11935,8 @@ var FaceValidation = function FaceValidation(_a) {
12040
11935
  * Render a fullscreen capture component that performs `IDValidation` and `FaceValidation` sequentially.
12041
11936
  * */
12042
11937
  var IdAndFaceValidation = function IdAndFaceValidation(_a) {
12043
- var _b, _c;
12044
- var _d = _a.lang,
12045
- lang = _d === void 0 ? 'auto' : _d,
11938
+ var _b = _a.lang,
11939
+ lang = _b === void 0 ? 'auto' : _b,
12046
11940
  sessionId = _a.sessionId,
12047
11941
  authUrl = _a.authUrl,
12048
11942
  submissionUrl = _a.submissionUrl,
@@ -12064,39 +11958,29 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
12064
11958
  webhooksFireOnReview = _a.webhooksFireOnReview,
12065
11959
  sendBase64DocumentsInSwaggerProxy = _a.sendBase64DocumentsInSwaggerProxy,
12066
11960
  precapturedDocuments = _a.precapturedDocuments,
12067
- _e = _a.idCaptureLoadingOverlayMode,
12068
- idCaptureLoadingOverlayMode = _e === void 0 ? 'default' : _e,
12069
- _f = _a.idCaptureRequirement,
12070
- idCaptureRequirement = _f === void 0 ? 'idCardOrPassport' : _f,
12071
- _g = _a.idAutoCaptureEnabled,
12072
- idAutoCaptureEnabled = _g === void 0 ? true : _g,
12073
- _h = _a.idCardAutoCaptureScoreThreshold,
12074
- idCardAutoCaptureScoreThreshold = _h === void 0 ? defaultDocumentDetectionThresholds.idCard : _h,
12075
- _j = _a.passportAutoCaptureScoreThreshold,
12076
- passportAutoCaptureScoreThreshold = _j === void 0 ? defaultDocumentDetectionThresholds.passport : _j,
12077
- _k = _a.mrzDetectionScoreThreshold,
12078
- mrzDetectionScoreThreshold = _k === void 0 ? defaultDocumentDetectionThresholds.mrz : _k,
12079
- _l = _a.idCardFocusScoreThreshold,
12080
- idCardFocusScoreThreshold = _l === void 0 ? (_b = defaultFocusThresholds.idCard) === null || _b === void 0 ? void 0 : _b.mobile : _l,
12081
- _m = _a.passportFocusScoreThreshold,
12082
- passportFocusScoreThreshold = _m === void 0 ? (_c = defaultFocusThresholds.passport) === null || _c === void 0 ? void 0 : _c.mobile : _m,
12083
- _o = _a.faceLivenessLoadingOverlayMode,
12084
- faceLivenessLoadingOverlayMode = _o === void 0 ? 'default' : _o,
12085
- _p = _a.faceLivenessTimeoutDurationMs,
12086
- faceLivenessTimeoutDurationMs = _p === void 0 ? 15000 : _p,
12087
- _q = _a.skipSuccessScreen,
12088
- skipSuccessScreen = _q === void 0 ? false : _q,
11961
+ _c = _a.idCaptureLoadingOverlayMode,
11962
+ idCaptureLoadingOverlayMode = _c === void 0 ? 'default' : _c,
11963
+ _d = _a.idCaptureRequirement,
11964
+ idCaptureRequirement = _d === void 0 ? 'idCardOrPassport' : _d,
11965
+ _e = _a.idCaptureThresholds,
11966
+ idCaptureThresholds = _e === void 0 ? defaultIdCaptureThresholds : _e,
11967
+ _f = _a.faceLivenessLoadingOverlayMode,
11968
+ faceLivenessLoadingOverlayMode = _f === void 0 ? 'default' : _f,
11969
+ _g = _a.faceLivenessTimeoutDurationMs,
11970
+ faceLivenessTimeoutDurationMs = _g === void 0 ? 15000 : _g,
11971
+ _h = _a.skipSuccessScreen,
11972
+ skipSuccessScreen = _h === void 0 ? false : _h,
12089
11973
  idCaptureInstructions = _a.idCaptureInstructions,
12090
- _r = _a.idCaptureGuideType,
12091
- idCaptureGuideType = _r === void 0 ? 'fit' : _r,
12092
- _s = _a.idCapturePortraitGuidesOnMobile,
12093
- idCapturePortraitGuidesOnMobile = _s === void 0 ? false : _s,
12094
- _t = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
12095
- idCaptureRotateLoadingOverlayImageWhenPortrait = _t === void 0 ? true : _t,
12096
- _u = _a.idCaptureModelLoadTimeoutMs,
12097
- idCaptureModelLoadTimeoutMs = _u === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _u,
12098
- _v = _a.selfieCaptureModelLoadTimeoutMs,
12099
- selfieCaptureModelLoadTimeoutMs = _v === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _v,
11974
+ _j = _a.idCaptureGuideType,
11975
+ idCaptureGuideType = _j === void 0 ? 'fit' : _j,
11976
+ _k = _a.idCapturePortraitGuidesOnMobile,
11977
+ idCapturePortraitGuidesOnMobile = _k === void 0 ? false : _k,
11978
+ _l = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
11979
+ idCaptureRotateLoadingOverlayImageWhenPortrait = _l === void 0 ? true : _l,
11980
+ _m = _a.idCaptureModelLoadTimeoutMs,
11981
+ idCaptureModelLoadTimeoutMs = _m === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _m,
11982
+ _o = _a.selfieCaptureModelLoadTimeoutMs,
11983
+ selfieCaptureModelLoadTimeoutMs = _o === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _o,
12100
11984
  onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
12101
11985
  onDocumentUploaded = _a.onDocumentUploaded,
12102
11986
  onDocumentUploadProgress = _a.onDocumentUploadProgress,
@@ -12113,28 +11997,28 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
12113
11997
  onIdCaptureModelError = _a.onIdCaptureModelError,
12114
11998
  onSelfieCaptureModelError = _a.onSelfieCaptureModelError,
12115
11999
  onCameraAccessDenied = _a.onCameraAccessDenied,
12116
- _w = _a.captureSignature,
12117
- captureSignature = _w === void 0 ? false : _w,
12118
- _x = _a.captureSignatureVideo,
12119
- captureSignatureVideo = _x === void 0 ? false : _x,
12120
- _y = _a.captureAdditionalDocuments,
12121
- captureAdditionalDocuments = _y === void 0 ? [] : _y,
12122
- _z = _a.theme,
12123
- theme = _z === void 0 ? 'default' : _z,
12124
- _0 = _a.assets,
12125
- assets = _0 === void 0 ? {} : _0,
12126
- _1 = _a.classNames,
12127
- classNames = _1 === void 0 ? {} : _1,
12128
- _2 = _a.colors,
12129
- colors = _2 === void 0 ? {} : _2,
12130
- _3 = _a.verbiage,
12131
- verbiage = _3 === void 0 ? {} : _3,
12132
- _4 = _a.geolocationEnabled,
12133
- geolocationEnabled = _4 === void 0 ? true : _4,
12134
- _5 = _a.geolocationRequired,
12135
- geolocationRequired = _5 === void 0 ? false : _5,
12136
- _6 = _a.debugMode,
12137
- debugMode = _6 === void 0 ? false : _6;
12000
+ _p = _a.captureSignature,
12001
+ captureSignature = _p === void 0 ? false : _p,
12002
+ _q = _a.captureSignatureVideo,
12003
+ captureSignatureVideo = _q === void 0 ? false : _q,
12004
+ _r = _a.captureAdditionalDocuments,
12005
+ captureAdditionalDocuments = _r === void 0 ? [] : _r,
12006
+ _s = _a.theme,
12007
+ theme = _s === void 0 ? 'default' : _s,
12008
+ _t = _a.assets,
12009
+ assets = _t === void 0 ? {} : _t,
12010
+ _u = _a.classNames,
12011
+ classNames = _u === void 0 ? {} : _u,
12012
+ _v = _a.colors,
12013
+ colors = _v === void 0 ? {} : _v,
12014
+ _w = _a.verbiage,
12015
+ verbiage = _w === void 0 ? {} : _w,
12016
+ _x = _a.geolocationEnabled,
12017
+ geolocationEnabled = _x === void 0 ? true : _x,
12018
+ _y = _a.geolocationRequired,
12019
+ geolocationRequired = _y === void 0 ? false : _y,
12020
+ _z = _a.debugMode,
12021
+ debugMode = _z === void 0 ? false : _z;
12138
12022
  useLanguage(lang);
12139
12023
  useDebugLogging(debugMode);
12140
12024
  var idCaptureProps = useMemo(function () {
@@ -12148,12 +12032,7 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
12148
12032
  verbiage: verbiage.idCapture,
12149
12033
  precapturedDocuments: precapturedDocuments,
12150
12034
  captureRequirement: idCaptureRequirement,
12151
- autoCaptureEnabled: idAutoCaptureEnabled,
12152
- idCardAutoCaptureScoreThreshold: idCardAutoCaptureScoreThreshold,
12153
- passportAutoCaptureScoreThreshold: passportAutoCaptureScoreThreshold,
12154
- mrzDetectionScoreThreshold: mrzDetectionScoreThreshold,
12155
- idCardFocusScoreThreshold: idCardFocusScoreThreshold,
12156
- passportFocusScoreThreshold: passportFocusScoreThreshold,
12035
+ thresholds: idCaptureThresholds,
12157
12036
  loadingOverlayMode: idCaptureLoadingOverlayMode,
12158
12037
  instructions: idCaptureInstructions,
12159
12038
  guideType: idCaptureGuideType,
@@ -12163,7 +12042,7 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
12163
12042
  skipSuccessScreen: skipSuccessScreen,
12164
12043
  debugMode: debugMode
12165
12044
  };
12166
- }, [assets.idCapture, classNames.idCapture, colors.idCapture, debugMode, idAutoCaptureEnabled, idCaptureGuideType, idCaptureInstructions, idCaptureLoadingOverlayMode, idCaptureModelLoadTimeoutMs, idCapturePortraitGuidesOnMobile, idCaptureRequirement, idCaptureRotateLoadingOverlayImageWhenPortrait, idCardAutoCaptureScoreThreshold, idCardFocusScoreThreshold, mrzDetectionScoreThreshold, onExitCapture, onIdCaptureModelError, onUserCancel, passportAutoCaptureScoreThreshold, passportFocusScoreThreshold, precapturedDocuments, skipSuccessScreen, verbiage.idCapture]);
12045
+ }, [onExitCapture, onUserCancel, onIdCaptureModelError, assets.idCapture, classNames.idCapture, colors.idCapture, verbiage.idCapture, precapturedDocuments, idCaptureRequirement, idCaptureThresholds, idCaptureLoadingOverlayMode, idCaptureInstructions, idCaptureGuideType, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, idCaptureModelLoadTimeoutMs, skipSuccessScreen, debugMode]);
12167
12046
  var faceLivenessProps = useMemo(function () {
12168
12047
  return {
12169
12048
  loadingOverlayMode: faceLivenessLoadingOverlayMode,
@@ -12271,10 +12150,9 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
12271
12150
  * Render a fullscreen capture component that performs IDValidation and FaceValidation sequentially, and then stores the results in IDmission's customer database using the supplied `enrollmentId` for later verification or 1:N matching.
12272
12151
  */
12273
12152
  var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollment(_a) {
12274
- var _b, _c;
12275
12153
  var enrollmentId = _a.enrollmentId,
12276
- _d = _a.lang,
12277
- lang = _d === void 0 ? 'auto' : _d,
12154
+ _b = _a.lang,
12155
+ lang = _b === void 0 ? 'auto' : _b,
12278
12156
  sessionId = _a.sessionId,
12279
12157
  authUrl = _a.authUrl,
12280
12158
  submissionUrl = _a.submissionUrl,
@@ -12298,39 +12176,29 @@ var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollme
12298
12176
  webhooksSendProcessedImages = _a.webhooksSendProcessedImages,
12299
12177
  webhooksFireOnReview = _a.webhooksFireOnReview,
12300
12178
  sendBase64DocumentsInSwaggerProxy = _a.sendBase64DocumentsInSwaggerProxy,
12301
- _e = _a.idCaptureLoadingOverlayMode,
12302
- idCaptureLoadingOverlayMode = _e === void 0 ? 'default' : _e,
12303
- _f = _a.idCaptureRequirement,
12304
- idCaptureRequirement = _f === void 0 ? 'idCardOrPassport' : _f,
12305
- _g = _a.idAutoCaptureEnabled,
12306
- idAutoCaptureEnabled = _g === void 0 ? true : _g,
12307
- _h = _a.idCardAutoCaptureScoreThreshold,
12308
- idCardAutoCaptureScoreThreshold = _h === void 0 ? defaultDocumentDetectionThresholds.idCard : _h,
12309
- _j = _a.passportAutoCaptureScoreThreshold,
12310
- passportAutoCaptureScoreThreshold = _j === void 0 ? defaultDocumentDetectionThresholds.passport : _j,
12311
- _k = _a.mrzDetectionScoreThreshold,
12312
- mrzDetectionScoreThreshold = _k === void 0 ? defaultDocumentDetectionThresholds.mrz : _k,
12313
- _l = _a.idCardFocusScoreThreshold,
12314
- idCardFocusScoreThreshold = _l === void 0 ? (_b = defaultFocusThresholds.idCard) === null || _b === void 0 ? void 0 : _b.mobile : _l,
12315
- _m = _a.passportFocusScoreThreshold,
12316
- passportFocusScoreThreshold = _m === void 0 ? (_c = defaultFocusThresholds.passport) === null || _c === void 0 ? void 0 : _c.mobile : _m,
12317
- _o = _a.faceLivenessTimeoutDurationMs,
12318
- faceLivenessTimeoutDurationMs = _o === void 0 ? 15000 : _o,
12319
- _p = _a.faceLivenessLoadingOverlayMode,
12320
- faceLivenessLoadingOverlayMode = _p === void 0 ? 'default' : _p,
12321
- _q = _a.skipSuccessScreen,
12322
- skipSuccessScreen = _q === void 0 ? false : _q,
12179
+ _c = _a.idCaptureLoadingOverlayMode,
12180
+ idCaptureLoadingOverlayMode = _c === void 0 ? 'default' : _c,
12181
+ _d = _a.idCaptureRequirement,
12182
+ idCaptureRequirement = _d === void 0 ? 'idCardOrPassport' : _d,
12183
+ _e = _a.idCaptureThresholds,
12184
+ idCaptureThresholds = _e === void 0 ? defaultIdCaptureThresholds : _e,
12185
+ _f = _a.faceLivenessTimeoutDurationMs,
12186
+ faceLivenessTimeoutDurationMs = _f === void 0 ? 15000 : _f,
12187
+ _g = _a.faceLivenessLoadingOverlayMode,
12188
+ faceLivenessLoadingOverlayMode = _g === void 0 ? 'default' : _g,
12189
+ _h = _a.skipSuccessScreen,
12190
+ skipSuccessScreen = _h === void 0 ? false : _h,
12323
12191
  idCaptureInstructions = _a.idCaptureInstructions,
12324
- _r = _a.idCaptureGuideType,
12325
- idCaptureGuideType = _r === void 0 ? 'fit' : _r,
12326
- _s = _a.idCapturePortraitGuidesOnMobile,
12327
- idCapturePortraitGuidesOnMobile = _s === void 0 ? false : _s,
12328
- _t = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
12329
- idCaptureRotateLoadingOverlayImageWhenPortrait = _t === void 0 ? true : _t,
12330
- _u = _a.idCaptureModelLoadTimeoutMs,
12331
- idCaptureModelLoadTimeoutMs = _u === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _u,
12332
- _v = _a.selfieCaptureModelLoadTimeoutMs,
12333
- selfieCaptureModelLoadTimeoutMs = _v === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _v,
12192
+ _j = _a.idCaptureGuideType,
12193
+ idCaptureGuideType = _j === void 0 ? 'fit' : _j,
12194
+ _k = _a.idCapturePortraitGuidesOnMobile,
12195
+ idCapturePortraitGuidesOnMobile = _k === void 0 ? false : _k,
12196
+ _l = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
12197
+ idCaptureRotateLoadingOverlayImageWhenPortrait = _l === void 0 ? true : _l,
12198
+ _m = _a.idCaptureModelLoadTimeoutMs,
12199
+ idCaptureModelLoadTimeoutMs = _m === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _m,
12200
+ _o = _a.selfieCaptureModelLoadTimeoutMs,
12201
+ selfieCaptureModelLoadTimeoutMs = _o === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _o,
12334
12202
  onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
12335
12203
  onDocumentUploadProgress = _a.onDocumentUploadProgress,
12336
12204
  onDocumentUploaded = _a.onDocumentUploaded,
@@ -12346,28 +12214,28 @@ var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollme
12346
12214
  onIdCaptureModelError = _a.onIdCaptureModelError,
12347
12215
  onSelfieCaptureModelError = _a.onSelfieCaptureModelError,
12348
12216
  onCameraAccessDenied = _a.onCameraAccessDenied,
12349
- _w = _a.captureSignature,
12350
- captureSignature = _w === void 0 ? false : _w,
12351
- _x = _a.captureSignatureVideo,
12352
- captureSignatureVideo = _x === void 0 ? false : _x,
12353
- _y = _a.captureAdditionalDocuments,
12354
- captureAdditionalDocuments = _y === void 0 ? [] : _y,
12355
- _z = _a.theme,
12356
- theme = _z === void 0 ? 'default' : _z,
12357
- _0 = _a.assets,
12358
- assets = _0 === void 0 ? {} : _0,
12359
- _1 = _a.classNames,
12360
- classNames = _1 === void 0 ? {} : _1,
12361
- _2 = _a.colors,
12362
- colors = _2 === void 0 ? {} : _2,
12363
- _3 = _a.verbiage,
12364
- verbiage = _3 === void 0 ? {} : _3,
12365
- _4 = _a.geolocationEnabled,
12366
- geolocationEnabled = _4 === void 0 ? true : _4,
12367
- _5 = _a.geolocationRequired,
12368
- geolocationRequired = _5 === void 0 ? false : _5,
12369
- _6 = _a.debugMode,
12370
- debugMode = _6 === void 0 ? false : _6;
12217
+ _p = _a.captureSignature,
12218
+ captureSignature = _p === void 0 ? false : _p,
12219
+ _q = _a.captureSignatureVideo,
12220
+ captureSignatureVideo = _q === void 0 ? false : _q,
12221
+ _r = _a.captureAdditionalDocuments,
12222
+ captureAdditionalDocuments = _r === void 0 ? [] : _r,
12223
+ _s = _a.theme,
12224
+ theme = _s === void 0 ? 'default' : _s,
12225
+ _t = _a.assets,
12226
+ assets = _t === void 0 ? {} : _t,
12227
+ _u = _a.classNames,
12228
+ classNames = _u === void 0 ? {} : _u,
12229
+ _v = _a.colors,
12230
+ colors = _v === void 0 ? {} : _v,
12231
+ _w = _a.verbiage,
12232
+ verbiage = _w === void 0 ? {} : _w,
12233
+ _x = _a.geolocationEnabled,
12234
+ geolocationEnabled = _x === void 0 ? true : _x,
12235
+ _y = _a.geolocationRequired,
12236
+ geolocationRequired = _y === void 0 ? false : _y,
12237
+ _z = _a.debugMode,
12238
+ debugMode = _z === void 0 ? false : _z;
12371
12239
  useLanguage(lang);
12372
12240
  useDebugLogging(debugMode);
12373
12241
  var idCaptureProps = useMemo(function () {
@@ -12377,12 +12245,7 @@ var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollme
12377
12245
  colors: colors.idCapture,
12378
12246
  verbiage: verbiage.idCapture,
12379
12247
  captureRequirement: idCaptureRequirement,
12380
- autoCaptureEnabled: idAutoCaptureEnabled,
12381
- idCardAutoCaptureScoreThreshold: idCardAutoCaptureScoreThreshold,
12382
- passportAutoCaptureScoreThreshold: passportAutoCaptureScoreThreshold,
12383
- mrzDetectionScoreThreshold: mrzDetectionScoreThreshold,
12384
- idCardFocusScoreThreshold: idCardFocusScoreThreshold,
12385
- passportFocusScoreThreshold: passportFocusScoreThreshold,
12248
+ thresholds: idCaptureThresholds,
12386
12249
  loadingOverlayMode: idCaptureLoadingOverlayMode,
12387
12250
  instructions: idCaptureInstructions,
12388
12251
  guideType: idCaptureGuideType,
@@ -12395,7 +12258,7 @@ var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollme
12395
12258
  skipSuccessScreen: skipSuccessScreen,
12396
12259
  debugMode: debugMode
12397
12260
  };
12398
- }, [assets.idCapture, classNames.idCapture, colors.idCapture, debugMode, idAutoCaptureEnabled, idCaptureGuideType, idCaptureInstructions, idCaptureLoadingOverlayMode, idCaptureModelLoadTimeoutMs, idCapturePortraitGuidesOnMobile, idCaptureRequirement, idCaptureRotateLoadingOverlayImageWhenPortrait, idCardAutoCaptureScoreThreshold, idCardFocusScoreThreshold, mrzDetectionScoreThreshold, onExitCapture, onIdCaptureModelError, onUserCancel, passportAutoCaptureScoreThreshold, passportFocusScoreThreshold, skipSuccessScreen, verbiage.idCapture]);
12261
+ }, [assets.idCapture, classNames.idCapture, colors.idCapture, verbiage.idCapture, idCaptureRequirement, idCaptureThresholds, idCaptureLoadingOverlayMode, idCaptureInstructions, idCaptureGuideType, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, idCaptureModelLoadTimeoutMs, onExitCapture, onUserCancel, onIdCaptureModelError, skipSuccessScreen, debugMode]);
12399
12262
  var faceLivenessProps = useMemo(function () {
12400
12263
  return {
12401
12264
  onExitCapture: onExitCapture,
@@ -13733,70 +13596,60 @@ var VideoIdValidation = function VideoIdValidation(_a) {
13733
13596
  faceLivenessProps = _a.faceLivenessProps,
13734
13597
  _c = _a.idCaptureModelsEnabled,
13735
13598
  idCaptureModelsEnabled = _c === void 0 ? true : _c,
13736
- _d = _a.idCardFrontDetectionThreshold,
13737
- idCardFrontDetectionThreshold = _d === void 0 ? 0.6 : _d,
13738
- _e = _a.idCardFrontFocusThreshold,
13739
- idCardFrontFocusThreshold = _e === void 0 ? 0 : _e,
13740
- _f = _a.goodIdCardFrontFramesThreshold,
13741
- goodIdCardFrontFramesThreshold = _f === void 0 ? 1 : _f,
13742
- _g = _a.idCardBackDetectionThreshold,
13743
- idCardBackDetectionThreshold = _g === void 0 ? 0.6 : _g,
13744
- _h = _a.idCardBackFocusThreshold,
13745
- idCardBackFocusThreshold = _h === void 0 ? 0 : _h,
13746
- _j = _a.goodIdCardBackFramesThreshold,
13747
- goodIdCardBackFramesThreshold = _j === void 0 ? 1 : _j,
13599
+ _d = _a.videoIdCaptureThresholds,
13600
+ videoIdCaptureThresholds = _d === void 0 ? defaultVideoIdCaptureThresholds : _d,
13748
13601
  readTextPrompt = _a.readTextPrompt,
13749
- _k = _a.readTextTimeoutDurationMs,
13750
- readTextTimeoutDurationMs = _k === void 0 ? 15000 : _k,
13751
- _l = _a.readTextMinReadingMs,
13752
- readTextMinReadingMs = _l === void 0 ? 10000 : _l,
13753
- _m = _a.skipSuccessScreen,
13754
- skipSuccessScreen = _m === void 0 ? false : _m,
13755
- _o = _a.skipIdCapture,
13756
- skipIdCapture = _o === void 0 ? false : _o,
13757
- _p = _a.skipShowIdCardBack,
13758
- skipShowIdCardBack = _p === void 0 ? false : _p,
13759
- _q = _a.idCaptureLoadingOverlayMode,
13760
- idCaptureLoadingOverlayMode = _q === void 0 ? 'default' : _q,
13761
- _r = _a.idCaptureGuideType,
13762
- idCaptureGuideType = _r === void 0 ? 'fit' : _r,
13763
- _s = _a.idCapturePortraitGuidesOnMobile,
13764
- idCapturePortraitGuidesOnMobile = _s === void 0 ? false : _s,
13765
- _t = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
13766
- idCaptureRotateLoadingOverlayImageWhenPortrait = _t === void 0 ? true : _t,
13602
+ _e = _a.readTextTimeoutDurationMs,
13603
+ readTextTimeoutDurationMs = _e === void 0 ? 15000 : _e,
13604
+ _f = _a.readTextMinReadingMs,
13605
+ readTextMinReadingMs = _f === void 0 ? 10000 : _f,
13606
+ _g = _a.skipSuccessScreen,
13607
+ skipSuccessScreen = _g === void 0 ? false : _g,
13608
+ _h = _a.skipIdCapture,
13609
+ skipIdCapture = _h === void 0 ? false : _h,
13610
+ _j = _a.skipShowIdCardBack,
13611
+ skipShowIdCardBack = _j === void 0 ? false : _j,
13612
+ _k = _a.idCaptureLoadingOverlayMode,
13613
+ idCaptureLoadingOverlayMode = _k === void 0 ? 'default' : _k,
13614
+ _l = _a.idCaptureGuideType,
13615
+ idCaptureGuideType = _l === void 0 ? 'fit' : _l,
13616
+ _m = _a.idCapturePortraitGuidesOnMobile,
13617
+ idCapturePortraitGuidesOnMobile = _m === void 0 ? false : _m,
13618
+ _o = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
13619
+ idCaptureRotateLoadingOverlayImageWhenPortrait = _o === void 0 ? true : _o,
13767
13620
  idCardForFaceMatch = _a.idCardForFaceMatch,
13768
- _u = _a.faceLivenessLoadingOverlayMode,
13769
- faceLivenessLoadingOverlayMode = _u === void 0 ? 'default' : _u,
13770
- _v = _a.disableFaceDetectionWhileAudioCapture,
13771
- disableFaceDetectionWhileAudioCapture = _v === void 0 ? false : _v,
13772
- _w = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
13773
- disableFaceDetectionWhileAudioCaptureMsDelay = _w === void 0 ? 2000 : _w,
13774
- _x = _a.silentFallback,
13775
- silentFallback = _x === void 0 ? false : _x,
13776
- _y = _a.mergeAVStreams,
13777
- mergeAVStreams = _y === void 0 ? false : _y,
13778
- _z = _a.theme,
13779
- theme = _z === void 0 ? 'default' : _z,
13780
- _0 = _a.assets,
13781
- assets = _0 === void 0 ? {} : _0,
13782
- _1 = _a.classNames,
13783
- classNames = _1 === void 0 ? {} : _1,
13784
- _2 = _a.colors,
13785
- colors = _2 === void 0 ? {} : _2,
13786
- _3 = _a.verbiage,
13787
- verbiage = _3 === void 0 ? {} : _3,
13788
- _4 = _a.captureSignature,
13789
- captureSignature = _4 === void 0 ? false : _4,
13790
- _5 = _a.captureSignatureVideo,
13791
- captureSignatureVideo = _5 === void 0 ? false : _5,
13792
- _6 = _a.captureAdditionalDocuments,
13793
- captureAdditionalDocuments = _6 === void 0 ? [] : _6,
13794
- _7 = _a.geolocationEnabled,
13795
- geolocationEnabled = _7 === void 0 ? true : _7,
13796
- _8 = _a.geolocationRequired,
13797
- geolocationRequired = _8 === void 0 ? false : _8,
13798
- _9 = _a.debugMode,
13799
- debugMode = _9 === void 0 ? false : _9;
13621
+ _p = _a.faceLivenessLoadingOverlayMode,
13622
+ faceLivenessLoadingOverlayMode = _p === void 0 ? 'default' : _p,
13623
+ _q = _a.disableFaceDetectionWhileAudioCapture,
13624
+ disableFaceDetectionWhileAudioCapture = _q === void 0 ? false : _q,
13625
+ _r = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
13626
+ disableFaceDetectionWhileAudioCaptureMsDelay = _r === void 0 ? 2000 : _r,
13627
+ _s = _a.silentFallback,
13628
+ silentFallback = _s === void 0 ? false : _s,
13629
+ _t = _a.mergeAVStreams,
13630
+ mergeAVStreams = _t === void 0 ? false : _t,
13631
+ _u = _a.theme,
13632
+ theme = _u === void 0 ? 'default' : _u,
13633
+ _v = _a.assets,
13634
+ assets = _v === void 0 ? {} : _v,
13635
+ _w = _a.classNames,
13636
+ classNames = _w === void 0 ? {} : _w,
13637
+ _x = _a.colors,
13638
+ colors = _x === void 0 ? {} : _x,
13639
+ _y = _a.verbiage,
13640
+ verbiage = _y === void 0 ? {} : _y,
13641
+ _z = _a.captureSignature,
13642
+ captureSignature = _z === void 0 ? false : _z,
13643
+ _0 = _a.captureSignatureVideo,
13644
+ captureSignatureVideo = _0 === void 0 ? false : _0,
13645
+ _1 = _a.captureAdditionalDocuments,
13646
+ captureAdditionalDocuments = _1 === void 0 ? [] : _1,
13647
+ _2 = _a.geolocationEnabled,
13648
+ geolocationEnabled = _2 === void 0 ? true : _2,
13649
+ _3 = _a.geolocationRequired,
13650
+ geolocationRequired = _3 === void 0 ? false : _3,
13651
+ _4 = _a.debugMode,
13652
+ debugMode = _4 === void 0 ? false : _4;
13800
13653
  useLanguage(lang);
13801
13654
  useDebugLogging(debugMode);
13802
13655
  var videoIdCaptureProps = useMemo(function () {
@@ -13804,12 +13657,7 @@ var VideoIdValidation = function VideoIdValidation(_a) {
13804
13657
  idCaptureProps: idCaptureProps,
13805
13658
  faceLivenessProps: faceLivenessProps,
13806
13659
  idCaptureModelsEnabled: idCaptureModelsEnabled,
13807
- idCardFrontDetectionThreshold: idCardFrontDetectionThreshold,
13808
- idCardFrontFocusThreshold: idCardFrontFocusThreshold,
13809
- goodIdCardFrontFramesThreshold: goodIdCardFrontFramesThreshold,
13810
- idCardBackDetectionThreshold: idCardBackDetectionThreshold,
13811
- idCardBackFocusThreshold: idCardBackFocusThreshold,
13812
- goodIdCardBackFramesThreshold: goodIdCardBackFramesThreshold,
13660
+ videoIdCaptureThresholds: videoIdCaptureThresholds,
13813
13661
  readTextPrompt: readTextPrompt,
13814
13662
  readTextTimeoutDurationMs: readTextTimeoutDurationMs,
13815
13663
  readTextMinReadingMs: readTextMinReadingMs,
@@ -13834,7 +13682,7 @@ var VideoIdValidation = function VideoIdValidation(_a) {
13834
13682
  verbiage: verbiage,
13835
13683
  debugMode: debugMode
13836
13684
  };
13837
- }, [idCaptureProps, faceLivenessProps, idCaptureModelsEnabled, idCardFrontDetectionThreshold, idCardFrontFocusThreshold, goodIdCardFrontFramesThreshold, idCardBackDetectionThreshold, idCardBackFocusThreshold, goodIdCardBackFramesThreshold, readTextPrompt, readTextTimeoutDurationMs, readTextMinReadingMs, onExitCapture, onExitAfterFailure, onUserCancel, skipSuccessScreen, skipIdCapture, skipShowIdCardBack, idCaptureLoadingOverlayMode, idCaptureGuideType, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, faceLivenessLoadingOverlayMode, disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, silentFallback, mergeAVStreams, assets, classNames, colors, verbiage, debugMode]);
13685
+ }, [idCaptureProps, faceLivenessProps, idCaptureModelsEnabled, videoIdCaptureThresholds, readTextPrompt, readTextTimeoutDurationMs, readTextMinReadingMs, onExitCapture, onExitAfterFailure, onUserCancel, skipSuccessScreen, skipIdCapture, skipShowIdCardBack, idCaptureLoadingOverlayMode, idCaptureGuideType, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, faceLivenessLoadingOverlayMode, disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, silentFallback, mergeAVStreams, assets, classNames, colors, verbiage, debugMode]);
13838
13686
  var additionalDocumentCaptureProps = useMemo(function () {
13839
13687
  return {
13840
13688
  documents: captureAdditionalDocuments,