idmission-web-sdk 1.0.29 → 1.0.31

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.
@@ -17,6 +17,10 @@ export interface VideoIdValidationProps extends PropsWithChildren {
17
17
  onExitAfterFailure?: (submissionResponse: SubmissionResponse | null) => void;
18
18
  idCaptureProps?: IdCaptureWizardProps;
19
19
  faceLivenessProps?: FaceLivenessWizardProps;
20
+ idCardFrontDetectionThreshold?: number;
21
+ idCardFrontFocusThreshold?: number;
22
+ goodIdCardFrontFramesThreshold?: number;
23
+ showIdCardBackDurationMs?: number;
20
24
  readTextPrompt?: CustomerSuppliedVerbiage;
21
25
  readTextTimeoutDurationMs?: number;
22
26
  skipSuccessScreen?: boolean | (() => Promise<boolean>);
@@ -1,10 +1,10 @@
1
1
  import { ReactElement } from 'react';
2
+ import { IdVideoCaptureGuidesAssets, IdVideoCaptureGuidesVerbiage } from './IdVideoCaptureGuides';
2
3
  import { CustomerSuppliedVerbiage } from '../../lib/locales';
3
4
  import { LoaderButtonColors } from '../common/LoaderButton';
4
- export type Action = 'SHOW_ID_FRONT' | 'SHOW_ID_BACK' | 'READ_TEXT';
5
+ export type Action = 'SHOW_ID_FRONT' | 'FLIP_ID' | 'SHOW_ID_BACK' | 'READ_TEXT';
5
6
  export type IdVideoCaptureAssets = {
6
- idCardFrontGuidesImageUrl?: string;
7
- idCardBackGuidesImageUrl?: string;
7
+ guides?: IdVideoCaptureGuidesAssets;
8
8
  };
9
9
  export type IdVideoCaptureColors = {
10
10
  guidesSatisfiedColor?: string;
@@ -12,17 +12,17 @@ export type IdVideoCaptureColors = {
12
12
  readTextDoneBtn?: LoaderButtonColors;
13
13
  };
14
14
  export type IdVideoCaptureVerbiage = {
15
- idFrontInstructionText?: CustomerSuppliedVerbiage;
16
- idBackInstructionText?: CustomerSuppliedVerbiage;
15
+ guides?: IdVideoCaptureGuidesVerbiage;
17
16
  readTextHeading?: CustomerSuppliedVerbiage;
18
17
  readTextDoneBtnText?: CustomerSuppliedVerbiage;
19
18
  };
20
19
  export type IdVideoCaptureProps = {
21
20
  onComplete?: (videoUrl: string) => void;
22
21
  onFaceNotDetected?: () => void;
23
- idDetectionThreshold?: number;
24
- idFocusThreshold?: number;
25
- goodFramesThreshold?: number;
22
+ idCardFrontDetectionThreshold?: number;
23
+ idCardFrontFocusThreshold?: number;
24
+ goodIdCardFrontFramesThreshold?: number;
25
+ showIdCardBackDurationMs?: number;
26
26
  readTextPrompt?: CustomerSuppliedVerbiage;
27
27
  readTextTimeoutDurationMs?: number;
28
28
  assets?: IdVideoCaptureAssets;
@@ -30,4 +30,4 @@ export type IdVideoCaptureProps = {
30
30
  verbiage?: IdVideoCaptureVerbiage;
31
31
  debugMode?: boolean;
32
32
  };
33
- export declare const IdVideoCapture: ({ onComplete, onFaceNotDetected, idDetectionThreshold, idFocusThreshold, goodFramesThreshold, readTextPrompt, readTextTimeoutDurationMs, assets, colors, verbiage: rawVerbiage, debugMode, }: IdVideoCaptureProps) => ReactElement;
33
+ export declare const IdVideoCapture: ({ onComplete, onFaceNotDetected, idCardFrontDetectionThreshold, idCardFrontFocusThreshold, goodIdCardFrontFramesThreshold, showIdCardBackDurationMs, readTextPrompt, readTextTimeoutDurationMs, assets, colors, verbiage: rawVerbiage, debugMode, }: IdVideoCaptureProps) => ReactElement;
@@ -8,8 +8,10 @@ export type IdVideoCaptureFlipIdPromptVerbiage = {
8
8
  instructionText?: CustomerSuppliedVerbiage;
9
9
  };
10
10
  export type IdVideoCaptureFlipIdPromptProps = {
11
+ imageWidth?: number;
12
+ imageHeight?: number;
11
13
  style?: CSSProperties;
12
14
  assets?: IdVideoCaptureFlipIdPromptAssets;
13
15
  verbiage?: IdVideoCaptureFlipIdPromptVerbiage;
14
16
  };
15
- export declare const IdVideoCaptureFlipIdPrompt: ({ style, assets, verbiage, }: IdVideoCaptureFlipIdPromptProps) => ReactElement;
17
+ export declare const IdVideoCaptureFlipIdPrompt: ({ imageWidth, imageHeight, style, assets, verbiage, }: IdVideoCaptureFlipIdPromptProps) => ReactElement;
@@ -1,9 +1,20 @@
1
1
  import { ReactElement } from 'react';
2
+ import { CustomerSuppliedVerbiage } from '../../lib/locales';
3
+ export type Action = 'SHOW_ID_FRONT' | 'FLIP_ID' | 'SHOW_ID_BACK' | 'READ_TEXT';
4
+ export type IdVideoCaptureGuidesAssets = {
5
+ frontImageUrl?: string;
6
+ backImageUrl?: string;
7
+ };
8
+ export type IdVideoCaptureGuidesVerbiage = {
9
+ idFrontInstructionText?: CustomerSuppliedVerbiage;
10
+ idBackInstructionText?: CustomerSuppliedVerbiage;
11
+ flipIdInstructionText?: CustomerSuppliedVerbiage;
12
+ };
2
13
  export type IdVideoCaptureGuidesProps = {
3
- instructionText?: string;
4
14
  borderWidth?: number;
5
15
  borderColor?: string;
6
- guideImageUrl?: string;
7
- flipping?: boolean;
16
+ requestedAction?: Action;
17
+ assets?: IdVideoCaptureGuidesAssets;
18
+ verbiage?: IdVideoCaptureGuidesVerbiage;
8
19
  };
9
- export declare const IdVideoCaptureGuides: ({ instructionText, borderWidth, borderColor, guideImageUrl, flipping, }: IdVideoCaptureGuidesProps) => ReactElement;
20
+ export declare const IdVideoCaptureGuides: ({ requestedAction, borderWidth, borderColor, assets, verbiage: rawVerbiage, }: IdVideoCaptureGuidesProps) => ReactElement;
@@ -26,6 +26,10 @@ export type VideoIdWizardProps = {
26
26
  idCaptureProps?: IdCaptureWizardProps;
27
27
  faceLivenessProps?: FaceLivenessWizardProps;
28
28
  onExitAfterFailure?: (submissionResponse: SubmissionResponse | null) => void;
29
+ idCardFrontDetectionThreshold?: number;
30
+ idCardFrontFocusThreshold?: number;
31
+ goodIdCardFrontFramesThreshold?: number;
32
+ showIdCardBackDurationMs?: number;
29
33
  readTextPrompt?: CustomerSuppliedVerbiage;
30
34
  readTextTimeoutDurationMs?: number;
31
35
  skipSuccessScreen?: boolean | (() => Promise<boolean>);
@@ -34,4 +38,4 @@ export type VideoIdWizardProps = {
34
38
  verbiage?: VideoIdWizardVerbiage;
35
39
  debugMode?: boolean;
36
40
  };
37
- export declare const VideoIdWizard: ({ idCaptureProps, faceLivenessProps, onExitAfterFailure, readTextPrompt, readTextTimeoutDurationMs, assets, colors, verbiage, debugMode, }: VideoIdWizardProps) => ReactElement;
41
+ export declare const VideoIdWizard: ({ idCaptureProps, faceLivenessProps, onExitAfterFailure, idCardFrontDetectionThreshold, idCardFrontFocusThreshold, goodIdCardFrontFramesThreshold, showIdCardBackDurationMs, readTextPrompt, readTextTimeoutDurationMs, assets, colors, verbiage, debugMode, }: VideoIdWizardProps) => ReactElement;
@@ -50,7 +50,7 @@ var tf__namespace = /*#__PURE__*/_interopNamespace(tf);
50
50
  var useResizeObserver__default = /*#__PURE__*/_interopDefaultLegacy(useResizeObserver);
51
51
  var SignatureCanvas__default = /*#__PURE__*/_interopDefaultLegacy(SignatureCanvas);
52
52
 
53
- var webSdkVersion = '1.0.29';
53
+ var webSdkVersion = '1.0.31';
54
54
 
55
55
  function getPlatform() {
56
56
  return window.platform;
@@ -14140,7 +14140,9 @@ var SignatureKYC = function SignatureKYC(_a) {
14140
14140
 
14141
14141
  var IdVideoCaptureFlipIdPrompt = function IdVideoCaptureFlipIdPrompt(_a) {
14142
14142
  var _b;
14143
- var _c = _a.style,
14143
+ var imageWidth = _a.imageWidth,
14144
+ imageHeight = _a.imageHeight,
14145
+ _c = _a.style,
14144
14146
  style = _c === void 0 ? {} : _c,
14145
14147
  _d = _a.assets,
14146
14148
  assets = _d === void 0 ? {} : _d,
@@ -14250,6 +14252,8 @@ var IdVideoCaptureFlipIdPrompt = function IdVideoCaptureFlipIdPrompt(_a) {
14250
14252
  }, /*#__PURE__*/React__default['default'].createElement("img", {
14251
14253
  src: assets.frontImageUrl,
14252
14254
  alt: "",
14255
+ width: imageWidth,
14256
+ height: imageHeight,
14253
14257
  onLoad: onImageLoaded,
14254
14258
  style: tslib.__assign({
14255
14259
  backfaceVisibility: 'hidden',
@@ -14303,15 +14307,30 @@ var IdVideoCaptureFlipIdPrompt = function IdVideoCaptureFlipIdPrompt(_a) {
14303
14307
  };
14304
14308
 
14305
14309
  var IdVideoCaptureGuides = function IdVideoCaptureGuides(_a) {
14306
- var instructionText = _a.instructionText,
14307
- _b = _a.borderWidth,
14308
- borderWidth = _b === void 0 ? 3 : _b,
14309
- _c = _a.borderColor,
14310
- borderColor = _c === void 0 ? 'white' : _c,
14311
- _d = _a.guideImageUrl,
14312
- guideImageUrl = _d === void 0 ? "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Landscape-2.svg") : _d,
14313
- _e = _a.flipping,
14314
- flipping = _e === void 0 ? false : _e;
14310
+ var _b = _a.requestedAction,
14311
+ requestedAction = _b === void 0 ? 'SHOW_ID_FRONT' : _b,
14312
+ _c = _a.borderWidth,
14313
+ borderWidth = _c === void 0 ? 3 : _c,
14314
+ _d = _a.borderColor,
14315
+ borderColor = _d === void 0 ? 'white' : _d,
14316
+ _e = _a.assets,
14317
+ assets = _e === void 0 ? {} : _e,
14318
+ _f = _a.verbiage,
14319
+ rawVerbiage = _f === void 0 ? {} : _f;
14320
+ var imageRef = React.useRef(null);
14321
+ var _g = React.useState(0),
14322
+ imageWidth = _g[0],
14323
+ setImageWidth = _g[1];
14324
+ var _h = React.useState(0),
14325
+ imageHeight = _h[0],
14326
+ setImageHeight = _h[1];
14327
+ assets.frontImageUrl || (assets.frontImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Landscape-2.svg"));
14328
+ assets.backImageUrl || (assets.backImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Landscape-2.svg"));
14329
+ var verbiage = useTranslations(rawVerbiage, {
14330
+ idFrontInstructionText: 'Display the front of your ID card...',
14331
+ idBackInstructionText: 'Display the back of your ID card...'
14332
+ });
14333
+ var instructionText = requestedAction === 'SHOW_ID_FRONT' ? verbiage.idFrontInstructionText : verbiage.idBackInstructionText;
14315
14334
  var idGuideWidth = window.innerWidth > window.innerHeight ? '30%' : '75%';
14316
14335
  return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", {
14317
14336
  style: {
@@ -14332,7 +14351,13 @@ var IdVideoCaptureGuides = function IdVideoCaptureGuides(_a) {
14332
14351
  height: '100%',
14333
14352
  margin: '4% auto auto'
14334
14353
  }
14335
- }), flipping ? /*#__PURE__*/React__default['default'].createElement(IdVideoCaptureFlipIdPrompt, {
14354
+ }), requestedAction === 'FLIP_ID' ? /*#__PURE__*/React__default['default'].createElement(IdVideoCaptureFlipIdPrompt, {
14355
+ assets: assets,
14356
+ verbiage: {
14357
+ instructionText: verbiage.flipIdInstructionText
14358
+ },
14359
+ imageWidth: imageWidth,
14360
+ imageHeight: imageHeight,
14336
14361
  style: {
14337
14362
  width: idGuideWidth,
14338
14363
  margin: '2% auto 2%'
@@ -14366,10 +14391,16 @@ var IdVideoCaptureGuides = function IdVideoCaptureGuides(_a) {
14366
14391
  border: "4px solid ".concat(borderColor)
14367
14392
  }
14368
14393
  }, /*#__PURE__*/React__default['default'].createElement("img", {
14369
- src: guideImageUrl,
14394
+ ref: imageRef,
14395
+ src: requestedAction === 'SHOW_ID_BACK' ? assets.backImageUrl : assets.frontImageUrl,
14370
14396
  alt: "",
14371
14397
  style: {
14372
14398
  width: '100%'
14399
+ },
14400
+ onLoad: function onLoad() {
14401
+ var _a, _b, _c, _d;
14402
+ if (!imageWidth) setImageWidth((_b = (_a = imageRef.current) === null || _a === void 0 ? void 0 : _a.width) !== null && _b !== void 0 ? _b : 0);
14403
+ if (!imageHeight) setImageHeight((_d = (_c = imageRef.current) === null || _c === void 0 ? void 0 : _c.height) !== null && _d !== void 0 ? _d : 0);
14373
14404
  }
14374
14405
  })), /*#__PURE__*/React__default['default'].createElement("div", {
14375
14406
  style: {
@@ -14396,52 +14427,54 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14396
14427
  var _b, _c, _d, _e, _f, _g;
14397
14428
  var onComplete = _a.onComplete,
14398
14429
  onFaceNotDetected = _a.onFaceNotDetected,
14399
- _h = _a.idDetectionThreshold,
14400
- idDetectionThreshold = _h === void 0 ? 0.48 : _h,
14401
- _j = _a.idFocusThreshold,
14402
- idFocusThreshold = _j === void 0 ? 0.15 : _j,
14403
- _k = _a.goodFramesThreshold,
14404
- goodFramesThreshold = _k === void 0 ? 3 : _k,
14430
+ _h = _a.idCardFrontDetectionThreshold,
14431
+ idCardFrontDetectionThreshold = _h === void 0 ? 0.48 : _h,
14432
+ _j = _a.idCardFrontFocusThreshold,
14433
+ idCardFrontFocusThreshold = _j === void 0 ? 0.15 : _j,
14434
+ _k = _a.goodIdCardFrontFramesThreshold,
14435
+ goodIdCardFrontFramesThreshold = _k === void 0 ? 3 : _k,
14436
+ _l = _a.showIdCardBackDurationMs,
14437
+ showIdCardBackDurationMs = _l === void 0 ? 5000 : _l,
14405
14438
  readTextPrompt = _a.readTextPrompt,
14406
- _l = _a.readTextTimeoutDurationMs,
14407
- readTextTimeoutDurationMs = _l === void 0 ? 15000 : _l,
14408
- _m = _a.assets,
14409
- assets = _m === void 0 ? {} : _m,
14410
- _o = _a.colors,
14411
- colors = _o === void 0 ? {} : _o,
14412
- _p = _a.verbiage,
14413
- rawVerbiage = _p === void 0 ? {} : _p,
14414
- _q = _a.debugMode,
14415
- debugMode = _q === void 0 ? false : _q;
14416
- var _r = useResizeObserver__default['default'](),
14417
- ref = _r.ref,
14418
- _s = _r.width,
14419
- width = _s === void 0 ? 1 : _s,
14420
- _t = _r.height,
14421
- height = _t === void 0 ? 1 : _t;
14422
- var _u = React.useContext(CameraStateContext),
14423
- cameraRef = _u.cameraRef,
14424
- videoRef = _u.videoRef,
14425
- videoLoaded = _u.videoLoaded,
14426
- cameraReady = _u.cameraReady;
14427
- var _v = React.useState([]),
14428
- detectedObjects = _v[0],
14429
- setDetectedObjects = _v[1];
14439
+ _m = _a.readTextTimeoutDurationMs,
14440
+ readTextTimeoutDurationMs = _m === void 0 ? 15000 : _m,
14441
+ _o = _a.assets,
14442
+ assets = _o === void 0 ? {} : _o,
14443
+ _p = _a.colors,
14444
+ colors = _p === void 0 ? {} : _p,
14445
+ _q = _a.verbiage,
14446
+ rawVerbiage = _q === void 0 ? {} : _q,
14447
+ _r = _a.debugMode,
14448
+ debugMode = _r === void 0 ? false : _r;
14449
+ var _s = useResizeObserver__default['default'](),
14450
+ ref = _s.ref,
14451
+ _t = _s.width,
14452
+ width = _t === void 0 ? 1 : _t,
14453
+ _u = _s.height,
14454
+ height = _u === void 0 ? 1 : _u;
14455
+ var _v = React.useContext(CameraStateContext),
14456
+ cameraRef = _v.cameraRef,
14457
+ videoRef = _v.videoRef,
14458
+ videoLoaded = _v.videoLoaded,
14459
+ cameraReady = _v.cameraReady;
14430
14460
  var _w = React.useState([]),
14431
- faces = _w[0],
14432
- setFaces = _w[1];
14433
- var _x = React.useContext(IdCaptureModelsContext),
14434
- idModelsReady = _x.ready,
14435
- idModelsWorking = _x.working,
14436
- makeIdPrediction = _x.makePrediction,
14437
- onIdPredictionMade = _x.onPredictionMade,
14438
- setThresholds = _x.setThresholds;
14461
+ detectedObjects = _w[0],
14462
+ setDetectedObjects = _w[1];
14463
+ var _x = React.useState([]),
14464
+ faces = _x[0],
14465
+ setFaces = _x[1];
14466
+ var _y = React.useContext(IdCaptureModelsContext),
14467
+ idModelsReady = _y.ready,
14468
+ idModelsWorking = _y.working,
14469
+ makeIdPrediction = _y.makePrediction,
14470
+ onIdPredictionMade = _y.onPredictionMade,
14471
+ setThresholds = _y.setThresholds;
14439
14472
  var onSelfiePredictionMade = React.useContext(HighPerformanceSelfieGuidanceModelsContext).onPredictionMade;
14440
- var _y = useVideoRecorder(cameraRef.current),
14441
- isRecording = _y.isRecording,
14442
- startRecording = _y.startRecording,
14443
- stopRecording = _y.stopRecording,
14444
- videoUrl = _y.videoUrl;
14473
+ var _z = useVideoRecorder(cameraRef.current),
14474
+ isRecording = _z.isRecording,
14475
+ startRecording = _z.startRecording,
14476
+ stopRecording = _z.stopRecording,
14477
+ videoUrl = _z.videoUrl;
14445
14478
  React.useEffect(function () {
14446
14479
  if (!isRecording && !videoUrl) startRecording();
14447
14480
  if (videoUrl) onComplete === null || onComplete === void 0 ? void 0 : onComplete(videoUrl);
@@ -14451,11 +14484,11 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14451
14484
  React.useEffect(function () {
14452
14485
  shouldCaptureFrames.current = videoLoaded && cameraReady && idModelsReady;
14453
14486
  }, [cameraReady, idModelsReady, videoLoaded]);
14454
- var _z = React.useState('SHOW_ID_FRONT'),
14455
- requestedAction = _z[0],
14456
- setRequestedAction = _z[1];
14487
+ var _0 = React.useState('SHOW_ID_FRONT'),
14488
+ requestedAction = _0[0],
14489
+ setRequestedAction = _0[1];
14457
14490
  React.useEffect(function () {
14458
- if (requestedAction === 'READ_TEXT') return;
14491
+ if (requestedAction !== 'SHOW_ID_FRONT') return;
14459
14492
  if (!idModelsReady || !cameraReady || !videoLoaded) return;
14460
14493
  animationFrame.current = requestAnimationFrame(function runFrame() {
14461
14494
  return tslib.__awaiter(this, void 0, void 0, function () {
@@ -14474,18 +14507,15 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14474
14507
  }, [cameraReady, idModelsReady, idModelsWorking, makeIdPrediction, requestedAction, videoLoaded, videoRef]);
14475
14508
  React.useEffect(function () {
14476
14509
  setThresholds({
14477
- document: idDetectionThreshold,
14510
+ document: idCardFrontDetectionThreshold,
14478
14511
  passport: 1,
14479
- focus: idFocusThreshold
14512
+ focus: idCardFrontFocusThreshold
14480
14513
  });
14481
- }, [idDetectionThreshold, idFocusThreshold, setThresholds]);
14482
- var _0 = React.useState(false),
14483
- flippingIdCard = _0[0],
14484
- setFlippingIdCard = _0[1];
14514
+ }, [idCardFrontDetectionThreshold, idCardFrontFocusThreshold, setThresholds]);
14485
14515
  var _1 = React.useState(0),
14486
- goodFramesCount = _1[0],
14516
+ goodIdCardFrontFramesCount = _1[0],
14487
14517
  setGoodFramesCount = _1[1];
14488
- var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
14518
+ var goodFramesThresholdMet = goodIdCardFrontFramesCount >= goodIdCardFrontFramesThreshold;
14489
14519
  React.useEffect(function () {
14490
14520
  onIdPredictionMade(function (prediction) {
14491
14521
  setDetectedObjects(prediction.detectedObjects);
@@ -14497,24 +14527,25 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14497
14527
  setGoodFramesCount(0);
14498
14528
  }
14499
14529
  });
14500
- }, [idDetectionThreshold, onIdPredictionMade]);
14530
+ }, [idCardFrontDetectionThreshold, onIdPredictionMade]);
14501
14531
  React.useEffect(function () {
14502
14532
  if (goodFramesThresholdMet) {
14503
14533
  if (requestedAction == 'SHOW_ID_FRONT') {
14504
- setFlippingIdCard(true);
14534
+ setRequestedAction('FLIP_ID');
14505
14535
  setTimeout(function () {
14506
- setFlippingIdCard(false);
14507
14536
  setRequestedAction('SHOW_ID_BACK');
14508
14537
  }, 3500);
14509
- } else if (requestedAction === 'SHOW_ID_BACK') {
14510
- if (readTextPrompt) {
14511
- setRequestedAction('READ_TEXT');
14512
- } else {
14513
- stopRecording();
14514
- }
14515
14538
  }
14516
14539
  }
14517
- }, [goodFramesThresholdMet, onComplete, readTextPrompt, requestedAction, stopRecording]);
14540
+ }, [goodFramesThresholdMet, requestedAction]);
14541
+ var onIdBackCaptureComplete = React.useCallback(function () {
14542
+ if (readTextPrompt) {
14543
+ setRequestedAction('READ_TEXT');
14544
+ } else {
14545
+ stopRecording();
14546
+ }
14547
+ }, [readTextPrompt, stopRecording]);
14548
+ useTimeout(showIdCardBackDurationMs, onIdBackCaptureComplete, requestedAction !== 'SHOW_ID_BACK', false, requestedAction === 'SHOW_ID_BACK');
14518
14549
  var onReadTextTimeout = React.useCallback(function () {
14519
14550
  stopRecording();
14520
14551
  }, [stopRecording]);
@@ -14535,13 +14566,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14535
14566
  onFaceNotDetected === null || onFaceNotDetected === void 0 ? void 0 : onFaceNotDetected();
14536
14567
  }
14537
14568
  }, [numFramesWithoutFaces, onFaceNotDetected]);
14538
- assets.idCardFrontGuidesImageUrl || (assets.idCardFrontGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Landscape-2.svg"));
14539
- assets.idCardBackGuidesImageUrl || (assets.idCardBackGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Landscape-2.svg"));
14540
14569
  colors.guidesSatisfiedColor || (colors.guidesSatisfiedColor = 'green');
14541
14570
  colors.guidesUnsatisfiedColor || (colors.guidesUnsatisfiedColor = 'white');
14542
14571
  var verbiage = useTranslations(rawVerbiage, {
14543
- idFrontInstructionText: 'Display the front of your ID card...',
14544
- idBackInstructionText: 'Display the back of your ID card...',
14545
14572
  readTextHeading: 'Please read the following text aloud',
14546
14573
  readTextDoneBtnText: 'Done'
14547
14574
  });
@@ -14554,6 +14581,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14554
14581
  videoHeight: (_e = (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) !== null && _e !== void 0 ? _e : 0
14555
14582
  });
14556
14583
  var timeRemaining = msToTime(Math.max(0, readTextTimeoutDurationMs - (new Date().getTime() - (timeoutStartedAt !== null && timeoutStartedAt !== void 0 ? timeoutStartedAt : new Date()).getTime())));
14584
+ var satisfied = requestedAction === 'SHOW_ID_BACK' || goodIdCardFrontFramesCount > 0;
14557
14585
  return /*#__PURE__*/React__default['default'].createElement(PageContainer, {
14558
14586
  ref: ref,
14559
14587
  className: "flex"
@@ -14602,11 +14630,11 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14602
14630
  onClick: stopRecording,
14603
14631
  colors: colors.readTextDoneBtn
14604
14632
  }, verbiage.readTextDoneBtnText))) : /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(IdVideoCaptureGuides, {
14605
- instructionText: requestedAction === 'SHOW_ID_FRONT' ? verbiage.idFrontInstructionText : verbiage.idBackInstructionText,
14606
- guideImageUrl: requestedAction === 'SHOW_ID_FRONT' ? assets.idCardFrontGuidesImageUrl : assets.idCardBackGuidesImageUrl,
14607
- borderColor: goodFramesCount > 0 ? colors.guidesSatisfiedColor : colors.guidesUnsatisfiedColor,
14608
- flipping: flippingIdCard
14609
- }), debugMode && detectedObjects.length > 0 && /*#__PURE__*/React__default['default'].createElement(ObjectDetectionDebugOverlay, {
14633
+ assets: assets.guides,
14634
+ verbiage: rawVerbiage.guides,
14635
+ requestedAction: requestedAction,
14636
+ borderColor: satisfied ? colors.guidesSatisfiedColor : colors.guidesUnsatisfiedColor
14637
+ }), debugMode && requestedAction === 'SHOW_ID_FRONT' && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(ObjectDetectionDebugOverlay, {
14610
14638
  "$flipX": !((_f = cameraRef.current) === null || _f === void 0 ? void 0 : _f.isRearFacing)
14611
14639
  }, detectedObjects.map(function (obj, i) {
14612
14640
  var _a;
@@ -14617,7 +14645,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14617
14645
  color: "blue",
14618
14646
  flipX: !((_a = cameraRef.current) === null || _a === void 0 ? void 0 : _a.isRearFacing)
14619
14647
  });
14620
- })), debugMode && faces.length > 0 && /*#__PURE__*/React__default['default'].createElement(ObjectDetectionDebugOverlay, {
14648
+ })), /*#__PURE__*/React__default['default'].createElement(ObjectDetectionDebugOverlay, {
14621
14649
  "$flipX": !((_g = cameraRef.current) === null || _g === void 0 ? void 0 : _g.isRearFacing)
14622
14650
  }, faces.map(function (face, i) {
14623
14651
  var _a;
@@ -14627,7 +14655,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14627
14655
  scaling: debugScalingDetails,
14628
14656
  flipX: !((_a = cameraRef.current) === null || _a === void 0 ? void 0 : _a.isRearFacing)
14629
14657
  });
14630
- }))), debugMode && /*#__PURE__*/React__default['default'].createElement(DebugStatsPane, null, cameraRef.current ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")") : '❌ Camera not ready', /*#__PURE__*/React__default['default'].createElement("br", null), isRecording ? '✅ Recording' : '❌ Not recording', /*#__PURE__*/React__default['default'].createElement("br", null), goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', goodFramesCount, "/", goodFramesThreshold));
14658
+ })))), debugMode && /*#__PURE__*/React__default['default'].createElement(DebugStatsPane, null, cameraRef.current ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")") : '❌ Camera not ready', /*#__PURE__*/React__default['default'].createElement("br", null), isRecording ? '✅ Recording' : '❌ Not recording', /*#__PURE__*/React__default['default'].createElement("br", null), goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', goodIdCardFrontFramesCount, "/", goodIdCardFrontFramesThreshold));
14631
14659
  };
14632
14660
  function msToTime(s) {
14633
14661
  var ms = s % 1000;
@@ -14685,6 +14713,10 @@ var VideoIdWizard = function VideoIdWizard(_a) {
14685
14713
  _g = _a.faceLivenessProps,
14686
14714
  faceLivenessProps = _g === void 0 ? {} : _g,
14687
14715
  onExitAfterFailure = _a.onExitAfterFailure,
14716
+ idCardFrontDetectionThreshold = _a.idCardFrontDetectionThreshold,
14717
+ idCardFrontFocusThreshold = _a.idCardFrontFocusThreshold,
14718
+ goodIdCardFrontFramesThreshold = _a.goodIdCardFrontFramesThreshold,
14719
+ showIdCardBackDurationMs = _a.showIdCardBackDurationMs,
14688
14720
  readTextPrompt = _a.readTextPrompt,
14689
14721
  readTextTimeoutDurationMs = _a.readTextTimeoutDurationMs,
14690
14722
  _h = _a.assets,
@@ -14795,6 +14827,10 @@ var VideoIdWizard = function VideoIdWizard(_a) {
14795
14827
  key: "id-video-capture-".concat(attempt),
14796
14828
  onComplete: onVideoCaptureComplete,
14797
14829
  onFaceNotDetected: onVideoCaptureFaceNotDetected,
14830
+ idCardFrontDetectionThreshold: idCardFrontDetectionThreshold,
14831
+ idCardFrontFocusThreshold: idCardFrontFocusThreshold,
14832
+ goodIdCardFrontFramesThreshold: goodIdCardFrontFramesThreshold,
14833
+ showIdCardBackDurationMs: showIdCardBackDurationMs,
14798
14834
  readTextPrompt: readTextPrompt,
14799
14835
  readTextTimeoutDurationMs: readTextTimeoutDurationMs,
14800
14836
  assets: assets.idVideoCapture,
@@ -14827,6 +14863,10 @@ var VideoIdValidation = function VideoIdValidation(_a) {
14827
14863
  onExitAfterFailure = _a.onExitAfterFailure,
14828
14864
  idCaptureProps = _a.idCaptureProps,
14829
14865
  faceLivenessProps = _a.faceLivenessProps,
14866
+ idCardFrontDetectionThreshold = _a.idCardFrontDetectionThreshold,
14867
+ idCardFrontFocusThreshold = _a.idCardFrontFocusThreshold,
14868
+ goodIdCardFrontFramesThreshold = _a.goodIdCardFrontFramesThreshold,
14869
+ showIdCardBackDurationMs = _a.showIdCardBackDurationMs,
14830
14870
  readTextPrompt = _a.readTextPrompt,
14831
14871
  readTextTimeoutDurationMs = _a.readTextTimeoutDurationMs,
14832
14872
  _c = _a.skipSuccessScreen,
@@ -14848,6 +14888,10 @@ var VideoIdValidation = function VideoIdValidation(_a) {
14848
14888
  }, /*#__PURE__*/React__default['default'].createElement(VideoIdWizard, {
14849
14889
  idCaptureProps: idCaptureProps,
14850
14890
  faceLivenessProps: faceLivenessProps,
14891
+ idCardFrontDetectionThreshold: idCardFrontDetectionThreshold,
14892
+ idCardFrontFocusThreshold: idCardFrontFocusThreshold,
14893
+ goodIdCardFrontFramesThreshold: goodIdCardFrontFramesThreshold,
14894
+ showIdCardBackDurationMs: showIdCardBackDurationMs,
14851
14895
  readTextPrompt: readTextPrompt,
14852
14896
  readTextTimeoutDurationMs: readTextTimeoutDurationMs,
14853
14897
  onExitAfterFailure: onExitAfterFailure,