idmission-web-sdk 1.0.358 → 1.0.360
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.
- package/README.md +2 -1
- package/dist/components/customer_flows/VideoIdValidation.d.ts +3 -1
- package/dist/components/read_text_prompt/ReadTextPrompt.d.ts +2 -1
- package/dist/components/video_id/IdVideoCapture.d.ts +2 -1
- package/dist/components/video_id/IdVideoCaptureWizard.d.ts +2 -1
- package/dist/sdk2.cjs.development.js +166 -144
- package/dist/sdk2.cjs.development.js.map +1 -1
- package/dist/sdk2.cjs.production.js +1 -1
- package/dist/sdk2.cjs.production.js.map +1 -1
- package/dist/sdk2.esm.js +166 -144
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +166 -144
- package/dist/sdk2.umd.development.js.map +1 -1
- package/dist/sdk2.umd.production.js +1 -1
- package/dist/sdk2.umd.production.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -702,7 +702,8 @@ Render a fullscreen capture component that performs IDValidation and FaceValidat
|
|
|
702
702
|
<tr><td><code>goodIdCardFrontFramesThreshold</code> (optional)</td><td>number of good frames of the ID card front that must be captured before moving on during video capture. Defaults to 3.</td></tr>
|
|
703
703
|
<tr><td><code>showIdCardBackDurationMs</code> (optional)</td><td>the duration of time in milliseconds that the user is instructed to show the back of their ID card during video capture. Defaults to 5000ms.</td></tr>
|
|
704
704
|
<tr><td><code>readTextPrompt</code> (optional)</td><td>an optional text prompt to display on screen for the user to read during video capture after the ID card has been shown. Leave blank to skip the read text screen.</td></tr>
|
|
705
|
-
<tr><td><code>readTextTimeoutDurationMs</code> (optional)</td><td>the duration of time in milliseconds that the user is allowed to spend reading the <code>readTextPrompt</code>. Defaults to
|
|
705
|
+
<tr><td><code>readTextTimeoutDurationMs</code> (optional)</td><td>the duration of time in milliseconds that the user is allowed to spend reading the <code>readTextPrompt</code>. Defaults to 15000 (15 seconds).</td></tr>
|
|
706
|
+
<tr><td><code>readTextMinReadingMs</code> (optional)</td><td>the duration of time in milliseconds that the user is forced to spend reading the `readTextPrompt` before they can click the Done button. Defaults to 10000 (10 seconds).</td></tr>
|
|
706
707
|
<tr><td><code>skipSuccessScreen</code> (optional)</td><td>boolean or async function to indicate whether to proceed automatically after capture guidance is satisfied. If an async function is supplied returning a boolean, it will be evaluated at the time of capture guidance satisfaction. Defaults to false.</td></tr>
|
|
707
708
|
<tr><td><code>skipIdCapture</code> (optional)</td><td>boolean to indicate whether to skip the initial ID capture flow. Note that when this flag is set, submission to IDmission's servers will not be attempted; it should be used in tandem with onSubmit. Defaults to false.</td></tr>
|
|
708
709
|
<tr><td><code>skipShowIdCardBack</code> (optional)</td><td>boolean or async function to indicate whether to instruct the user to show the back of their ID card during video capture. If an async function is supplied returning a boolean, it will be evaluated at the time of ID front video capture completion. Defaults to false.</td></tr>
|
|
@@ -101,8 +101,10 @@ export interface VideoIdValidationProps extends PropsWithChildren {
|
|
|
101
101
|
goodIdCardBackFramesThreshold?: number;
|
|
102
102
|
/** An optional text prompt to display on screen for the user to read during video capture after the ID card has been shown. */
|
|
103
103
|
readTextPrompt?: CustomerSuppliedVerbiage;
|
|
104
|
-
/** The duration of time in milliseconds that the user is allowed to spend reading the `readTextPrompt`. */
|
|
104
|
+
/** The duration of time in milliseconds that the user is allowed to spend reading the `readTextPrompt`. Defaults to 15000 (15 seconds). */
|
|
105
105
|
readTextTimeoutDurationMs?: number;
|
|
106
|
+
/** The duration of time in milliseconds that the user is forced to spend reading the `readTextPrompt` before they can click the Done button. Defaults to 3000 (3 seconds). */
|
|
107
|
+
readTextMinReadingMs?: number;
|
|
106
108
|
/** Boolean or async function to indicate whether to proceed automatically after capture guidance is satisfied. If an async function is supplied returning a boolean, it will be evaluated at the time of capture guidance satisfaction. Defaults to `false`. */
|
|
107
109
|
skipSuccessScreen?: boolean | (() => Promise<boolean>);
|
|
108
110
|
/** Boolean to indicate whether to skip the initial ID capture flow. Note that when this flag is set, submission to IDmission's servers will not be attempted; it should be used in tandem with `onSubmit`. Defaults to `false`. */
|
|
@@ -17,7 +17,8 @@ export type ReadTextPromptProps = {
|
|
|
17
17
|
onComplete?: () => void;
|
|
18
18
|
startedAt?: Date;
|
|
19
19
|
durationMs?: number;
|
|
20
|
+
minReadingMs?: number;
|
|
20
21
|
classNames?: ReadTextPromptClassNames;
|
|
21
22
|
verbiage?: ReadTextPromptVerbiage;
|
|
22
23
|
};
|
|
23
|
-
export declare const ReadTextPrompt: ({ text, onComplete, durationMs, classNames, verbiage: rawVerbiage, }: ReadTextPromptProps) => React.JSX.Element;
|
|
24
|
+
export declare const ReadTextPrompt: ({ text, onComplete, durationMs, minReadingMs, classNames, verbiage: rawVerbiage, }: ReadTextPromptProps) => React.JSX.Element;
|
|
@@ -48,6 +48,7 @@ export type IdVideoCaptureProps = {
|
|
|
48
48
|
captureCountdownSeconds?: number;
|
|
49
49
|
readTextPrompt?: CustomerSuppliedVerbiage;
|
|
50
50
|
readTextTimeoutDurationMs?: number;
|
|
51
|
+
readTextMinReadingMs?: number;
|
|
51
52
|
disableFaceDetectionWhileAudioCapture: boolean;
|
|
52
53
|
disableFaceDetectionWhileAudioCaptureMsDelay: number;
|
|
53
54
|
assets?: IdVideoCaptureAssets;
|
|
@@ -56,4 +57,4 @@ export type IdVideoCaptureProps = {
|
|
|
56
57
|
verbiage?: IdVideoCaptureVerbiage;
|
|
57
58
|
debugMode?: boolean;
|
|
58
59
|
};
|
|
59
|
-
export declare const IdVideoCapture: ({ onComplete, onIdFrontImageCaptured, onIdBackImageCaptured, onFaceNotDetected, idCaptureModelsEnabled, idCardFrontDelay, idCardFrontDetectionThreshold, idCardFrontFocusThreshold, goodIdCardFrontFramesThreshold, idCardBackDetectionThreshold, idCardBackFocusThreshold, goodIdCardBackFramesThreshold, skipShowIdCardBack, captureCountdownSeconds, readTextPrompt, readTextTimeoutDurationMs, disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, assets, classNames, colors, verbiage: rawVerbiage, debugMode, }: IdVideoCaptureProps) => ReactElement;
|
|
60
|
+
export declare const IdVideoCapture: ({ onComplete, onIdFrontImageCaptured, onIdBackImageCaptured, onFaceNotDetected, idCaptureModelsEnabled, idCardFrontDelay, idCardFrontDetectionThreshold, idCardFrontFocusThreshold, goodIdCardFrontFramesThreshold, idCardBackDetectionThreshold, idCardBackFocusThreshold, goodIdCardBackFramesThreshold, skipShowIdCardBack, captureCountdownSeconds, readTextPrompt, readTextTimeoutDurationMs, readTextMinReadingMs, disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, assets, classNames, colors, verbiage: rawVerbiage, debugMode, }: IdVideoCaptureProps) => ReactElement;
|
|
@@ -50,6 +50,7 @@ export type VideoIdWizardProps = {
|
|
|
50
50
|
goodIdCardBackFramesThreshold?: number;
|
|
51
51
|
readTextPrompt?: CustomerSuppliedVerbiage;
|
|
52
52
|
readTextTimeoutDurationMs?: number;
|
|
53
|
+
readTextMinReadingMs?: number;
|
|
53
54
|
skipSuccessScreen?: boolean | (() => Promise<boolean>);
|
|
54
55
|
skipIdCapture?: boolean;
|
|
55
56
|
skipShowIdCardBack?: boolean | (() => Promise<boolean>);
|
|
@@ -68,4 +69,4 @@ export type VideoIdWizardProps = {
|
|
|
68
69
|
verbiage?: VideoIdWizardVerbiage;
|
|
69
70
|
debugMode?: boolean;
|
|
70
71
|
};
|
|
71
|
-
export declare const VideoIdWizard: ({ onComplete, onExitCapture, onExitAfterFailure, onUserCancel, onIdCaptureModelError, idCaptureProps, faceLivenessProps, idCaptureModelsEnabled, idCardFrontDetectionThreshold, idCardBackDetectionThreshold, idCardFrontFocusThreshold, idCardBackFocusThreshold, goodIdCardFrontFramesThreshold, goodIdCardBackFramesThreshold, readTextPrompt, readTextTimeoutDurationMs, skipIdCapture, skipShowIdCardBack, skipSuccessScreen, idCaptureLoadingOverlayMode, idCaptureGuideType, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, idCaptureModelLoadTimeoutMs, faceLivenessLoadingOverlayMode, disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, silentFallback, assets, classNames, colors, verbiage, debugMode, }: VideoIdWizardProps) => ReactElement;
|
|
72
|
+
export declare const VideoIdWizard: ({ onComplete, onExitCapture, onExitAfterFailure, onUserCancel, onIdCaptureModelError, idCaptureProps, faceLivenessProps, idCaptureModelsEnabled, idCardFrontDetectionThreshold, idCardBackDetectionThreshold, idCardFrontFocusThreshold, idCardBackFocusThreshold, goodIdCardFrontFramesThreshold, goodIdCardBackFramesThreshold, readTextPrompt, readTextTimeoutDurationMs, readTextMinReadingMs, skipIdCapture, skipShowIdCardBack, skipSuccessScreen, idCaptureLoadingOverlayMode, idCaptureGuideType, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, idCaptureModelLoadTimeoutMs, faceLivenessLoadingOverlayMode, disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, silentFallback, assets, classNames, colors, verbiage, debugMode, }: VideoIdWizardProps) => ReactElement;
|
|
@@ -50,7 +50,7 @@ var LanguageDetector__default = /*#__PURE__*/_interopDefaultLegacy(LanguageDetec
|
|
|
50
50
|
var i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
|
|
51
51
|
var SignatureCanvas__default = /*#__PURE__*/_interopDefaultLegacy(SignatureCanvas);
|
|
52
52
|
|
|
53
|
-
var webSdkVersion = '1.0.
|
|
53
|
+
var webSdkVersion = '1.0.360';
|
|
54
54
|
|
|
55
55
|
function getPlatform() {
|
|
56
56
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -16401,20 +16401,22 @@ var ReadTextPrompt = function ReadTextPrompt(_a) {
|
|
|
16401
16401
|
onComplete = _a.onComplete,
|
|
16402
16402
|
_b = _a.durationMs,
|
|
16403
16403
|
durationMs = _b === void 0 ? 15000 : _b,
|
|
16404
|
-
_c = _a.
|
|
16405
|
-
|
|
16406
|
-
_d = _a.
|
|
16407
|
-
|
|
16404
|
+
_c = _a.minReadingMs,
|
|
16405
|
+
minReadingMs = _c === void 0 ? 10000 : _c,
|
|
16406
|
+
_d = _a.classNames,
|
|
16407
|
+
classNames = _d === void 0 ? {} : _d,
|
|
16408
|
+
_e = _a.verbiage,
|
|
16409
|
+
rawVerbiage = _e === void 0 ? {} : _e;
|
|
16408
16410
|
text = useVerbiage(text, '');
|
|
16409
16411
|
var countdownTimeoutRef = React.useRef(undefined);
|
|
16410
|
-
var
|
|
16411
|
-
countdownRemaining =
|
|
16412
|
-
setCountdownRemaining =
|
|
16412
|
+
var _f = React.useState(durationMs / 1000),
|
|
16413
|
+
countdownRemaining = _f[0],
|
|
16414
|
+
setCountdownRemaining = _f[1];
|
|
16413
16415
|
var verbiage = useTranslations(rawVerbiage, {
|
|
16414
16416
|
headingText: 'Please read the following text aloud',
|
|
16415
16417
|
doneBtnText: 'Done'
|
|
16416
16418
|
});
|
|
16417
|
-
var manualCountdown = function
|
|
16419
|
+
var manualCountdown = React.useCallback(function (remainingTime) {
|
|
16418
16420
|
if (remainingTime > 0) {
|
|
16419
16421
|
var nextCycle_1 = remainingTime - 1;
|
|
16420
16422
|
setCountdownRemaining(nextCycle_1);
|
|
@@ -16422,7 +16424,7 @@ var ReadTextPrompt = function ReadTextPrompt(_a) {
|
|
|
16422
16424
|
return manualCountdown(nextCycle_1);
|
|
16423
16425
|
}, 1000);
|
|
16424
16426
|
}
|
|
16425
|
-
};
|
|
16427
|
+
}, []);
|
|
16426
16428
|
React.useEffect(function () {
|
|
16427
16429
|
setCountdownRemaining(countdownRemaining);
|
|
16428
16430
|
countdownTimeoutRef.current = setTimeout(function () {
|
|
@@ -16431,7 +16433,18 @@ var ReadTextPrompt = function ReadTextPrompt(_a) {
|
|
|
16431
16433
|
return function () {
|
|
16432
16434
|
clearTimeout(countdownTimeoutRef.current);
|
|
16433
16435
|
};
|
|
16434
|
-
}, []);
|
|
16436
|
+
}, [countdownRemaining, manualCountdown]);
|
|
16437
|
+
var _g = React.useState(false),
|
|
16438
|
+
minReadingTimeElapsed = _g[0],
|
|
16439
|
+
setMinReadingTimeElapsed = _g[1];
|
|
16440
|
+
React.useEffect(function trackReadingTime() {
|
|
16441
|
+
var timeout = setTimeout(function () {
|
|
16442
|
+
setMinReadingTimeElapsed(true);
|
|
16443
|
+
}, minReadingMs);
|
|
16444
|
+
return function () {
|
|
16445
|
+
clearTimeout(timeout);
|
|
16446
|
+
};
|
|
16447
|
+
}, [minReadingMs]);
|
|
16435
16448
|
return /*#__PURE__*/React__default['default'].createElement(ReadTextPromptContainer, {
|
|
16436
16449
|
className: classNames.container
|
|
16437
16450
|
}, /*#__PURE__*/React__default['default'].createElement(ReadTextPromptHeading, {
|
|
@@ -16446,7 +16459,8 @@ var ReadTextPrompt = function ReadTextPrompt(_a) {
|
|
|
16446
16459
|
variant: "positive",
|
|
16447
16460
|
className: classNames.doneBtn,
|
|
16448
16461
|
onClick: onComplete,
|
|
16449
|
-
|
|
16462
|
+
disabled: !minReadingTimeElapsed,
|
|
16463
|
+
finished: minReadingTimeElapsed
|
|
16450
16464
|
}, verbiage.doneBtnText)));
|
|
16451
16465
|
};
|
|
16452
16466
|
var ReadTextPromptContainer = styled__default['default'].div(templateObject_1$6 || (templateObject_1$6 = tslib.__makeTemplateObject(["\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n display: flex;\n flex-direction: column;\n"], ["\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n display: flex;\n flex-direction: column;\n"])));
|
|
@@ -16514,72 +16528,74 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
16514
16528
|
readTextPrompt = _a.readTextPrompt,
|
|
16515
16529
|
_4 = _a.readTextTimeoutDurationMs,
|
|
16516
16530
|
readTextTimeoutDurationMs = _4 === void 0 ? 15000 : _4,
|
|
16517
|
-
_5 = _a.
|
|
16518
|
-
|
|
16519
|
-
_6 = _a.
|
|
16520
|
-
|
|
16521
|
-
_7 = _a.
|
|
16522
|
-
|
|
16523
|
-
_8 = _a.
|
|
16524
|
-
|
|
16525
|
-
_9 = _a.
|
|
16526
|
-
|
|
16527
|
-
_10 = _a.
|
|
16528
|
-
|
|
16529
|
-
_11 = _a.
|
|
16530
|
-
|
|
16531
|
-
|
|
16532
|
-
|
|
16533
|
-
|
|
16534
|
-
|
|
16535
|
-
_14 =
|
|
16536
|
-
|
|
16537
|
-
|
|
16538
|
-
|
|
16539
|
-
|
|
16540
|
-
|
|
16541
|
-
|
|
16542
|
-
|
|
16543
|
-
|
|
16544
|
-
|
|
16545
|
-
|
|
16546
|
-
|
|
16547
|
-
|
|
16548
|
-
setDetectedObjects = _16[1];
|
|
16531
|
+
_5 = _a.readTextMinReadingMs,
|
|
16532
|
+
readTextMinReadingMs = _5 === void 0 ? 10000 : _5,
|
|
16533
|
+
_6 = _a.disableFaceDetectionWhileAudioCapture,
|
|
16534
|
+
disableFaceDetectionWhileAudioCapture = _6 === void 0 ? false : _6,
|
|
16535
|
+
_7 = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
|
|
16536
|
+
disableFaceDetectionWhileAudioCaptureMsDelay = _7 === void 0 ? 2000 : _7,
|
|
16537
|
+
_8 = _a.assets,
|
|
16538
|
+
assets = _8 === void 0 ? {} : _8,
|
|
16539
|
+
_9 = _a.classNames,
|
|
16540
|
+
classNames = _9 === void 0 ? {} : _9,
|
|
16541
|
+
_10 = _a.colors,
|
|
16542
|
+
colors = _10 === void 0 ? {} : _10,
|
|
16543
|
+
_11 = _a.verbiage,
|
|
16544
|
+
rawVerbiage = _11 === void 0 ? {} : _11,
|
|
16545
|
+
_12 = _a.debugMode,
|
|
16546
|
+
debugMode = _12 === void 0 ? false : _12;
|
|
16547
|
+
var _13 = useResizeObserver__default['default'](),
|
|
16548
|
+
ref = _13.ref,
|
|
16549
|
+
_14 = _13.width,
|
|
16550
|
+
width = _14 === void 0 ? 1 : _14,
|
|
16551
|
+
_15 = _13.height,
|
|
16552
|
+
height = _15 === void 0 ? 1 : _15;
|
|
16553
|
+
var _16 = React.useContext(CameraStateContext),
|
|
16554
|
+
cameraRef = _16.cameraRef,
|
|
16555
|
+
videoRef = _16.videoRef,
|
|
16556
|
+
videoLoaded = _16.videoLoaded,
|
|
16557
|
+
cameraReady = _16.cameraReady,
|
|
16558
|
+
microphoneReady = _16.microphoneReady,
|
|
16559
|
+
audioStream = _16.audioStream,
|
|
16560
|
+
setVideoLoaded = _16.setVideoLoaded,
|
|
16561
|
+
takePhoto = _16.takePhoto;
|
|
16549
16562
|
var _17 = React.useState([]),
|
|
16550
|
-
|
|
16551
|
-
|
|
16552
|
-
var _18 = React.
|
|
16553
|
-
|
|
16554
|
-
|
|
16555
|
-
|
|
16556
|
-
|
|
16557
|
-
|
|
16558
|
-
|
|
16559
|
-
|
|
16560
|
-
|
|
16561
|
-
|
|
16562
|
-
|
|
16563
|
-
|
|
16564
|
-
|
|
16565
|
-
var _20 = React.
|
|
16566
|
-
|
|
16567
|
-
|
|
16568
|
-
var _21 = React.useContext(
|
|
16569
|
-
|
|
16570
|
-
|
|
16571
|
-
var _22 =
|
|
16572
|
-
|
|
16573
|
-
|
|
16574
|
-
|
|
16575
|
-
|
|
16576
|
-
|
|
16577
|
-
|
|
16578
|
-
|
|
16563
|
+
detectedObjects = _17[0],
|
|
16564
|
+
setDetectedObjects = _17[1];
|
|
16565
|
+
var _18 = React.useState([]),
|
|
16566
|
+
faces = _18[0],
|
|
16567
|
+
setFaces = _18[1];
|
|
16568
|
+
var _19 = React.useContext(IdCaptureModelsContext),
|
|
16569
|
+
idModelsReady = _19.ready,
|
|
16570
|
+
idModelsWorking = _19.working,
|
|
16571
|
+
makeIdPrediction = _19.makePrediction,
|
|
16572
|
+
onIdPredictionMade = _19.onPredictionMade,
|
|
16573
|
+
setThresholds = _19.setThresholds,
|
|
16574
|
+
bestFrameDetectionScore = _19.bestFrameDetectionScore,
|
|
16575
|
+
bestFrameFocusScore = _19.bestFrameFocusScore,
|
|
16576
|
+
resetBestFrame = _19.resetBestFrame,
|
|
16577
|
+
idModelError = _19.idModelError;
|
|
16578
|
+
var _20 = React.useState(null),
|
|
16579
|
+
videoStartsAt = _20[0],
|
|
16580
|
+
setVideoStartsAt = _20[1];
|
|
16581
|
+
var _21 = React.useContext(SubmissionContext),
|
|
16582
|
+
setIdCaptureVideoAudioStartsAt = _21.setIdCaptureVideoAudioStartsAt,
|
|
16583
|
+
setExpectedAudioText = _21.setExpectedAudioText;
|
|
16584
|
+
var _22 = React.useContext(HighPerformanceSelfieGuidanceModelsContext),
|
|
16585
|
+
onSelfiePredictionMade = _22.onPredictionMade,
|
|
16586
|
+
selfieModelError = _22.error;
|
|
16587
|
+
var _23 = useVideoRecorder(cameraRef.current, audioStream),
|
|
16588
|
+
isRecordingVideo = _23.isRecordingVideo,
|
|
16589
|
+
startRecordingVideo = _23.startRecordingVideo,
|
|
16590
|
+
startRecordingAudio = _23.startRecordingAudio,
|
|
16591
|
+
stopRecordingVideo = _23.stopRecordingVideo,
|
|
16592
|
+
stopRecordingAudio = _23.stopRecordingAudio,
|
|
16593
|
+
videoUrl = _23.videoUrl,
|
|
16594
|
+
audioUrl = _23.audioUrl;
|
|
16579
16595
|
var countdownTimeoutRef = React.useRef(undefined);
|
|
16580
|
-
var
|
|
16581
|
-
countdownRemaining =
|
|
16582
|
-
setCountdownRemaining =
|
|
16596
|
+
var _24 = React.useState(0),
|
|
16597
|
+
countdownRemaining = _24[0],
|
|
16598
|
+
setCountdownRemaining = _24[1];
|
|
16583
16599
|
React.useEffect(function () {
|
|
16584
16600
|
if (!isRecordingVideo && !videoUrl) {
|
|
16585
16601
|
startRecordingVideo();
|
|
@@ -16595,9 +16611,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
16595
16611
|
React.useEffect(function () {
|
|
16596
16612
|
shouldCaptureFrames.current = videoLoaded && cameraReady && idModelsReady && !idModelError && (!readTextPrompt || microphoneReady);
|
|
16597
16613
|
}, [cameraReady, idModelError, idModelsReady, microphoneReady, readTextPrompt, videoLoaded]);
|
|
16598
|
-
var
|
|
16599
|
-
requestedAction =
|
|
16600
|
-
setRequestedAction =
|
|
16614
|
+
var _25 = React.useState('SHOW_ID_FRONT'),
|
|
16615
|
+
requestedAction = _25[0],
|
|
16616
|
+
setRequestedAction = _25[1];
|
|
16601
16617
|
React.useEffect(function () {
|
|
16602
16618
|
if (requestedAction !== 'SHOW_ID_FRONT' && requestedAction !== 'SHOW_ID_BACK') return;
|
|
16603
16619
|
if (!idCaptureModelsEnabled || !idModelsReady || !cameraReady || !videoLoaded || idModelError) return;
|
|
@@ -16625,15 +16641,15 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
16625
16641
|
}
|
|
16626
16642
|
});
|
|
16627
16643
|
}, [idCardBackDetectionThreshold, idCardBackFocusThreshold, idCardFrontDetectionThreshold, idCardFrontFocusThreshold, requestedAction, setThresholds]);
|
|
16628
|
-
var _25 = React.useState(0),
|
|
16629
|
-
currentDetectionScore = _25[0],
|
|
16630
|
-
setCurrentDetectionScore = _25[1];
|
|
16631
16644
|
var _26 = React.useState(0),
|
|
16632
|
-
|
|
16633
|
-
|
|
16645
|
+
currentDetectionScore = _26[0],
|
|
16646
|
+
setCurrentDetectionScore = _26[1];
|
|
16634
16647
|
var _27 = React.useState(0),
|
|
16635
|
-
|
|
16636
|
-
|
|
16648
|
+
currentFocusScore = _27[0],
|
|
16649
|
+
setCurrentFocusScore = _27[1];
|
|
16650
|
+
var _28 = React.useState(0),
|
|
16651
|
+
goodFramesCount = _28[0],
|
|
16652
|
+
setGoodFramesCount = _28[1];
|
|
16637
16653
|
var goodFramesThreshold = requestedAction === 'SHOW_ID_FRONT' ? goodIdCardFrontFramesThreshold : goodIdCardBackFramesThreshold;
|
|
16638
16654
|
var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
|
|
16639
16655
|
React.useEffect(function () {
|
|
@@ -16651,9 +16667,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
16651
16667
|
}
|
|
16652
16668
|
});
|
|
16653
16669
|
}, [idCaptureModelsEnabled, idCardFrontDetectionThreshold, onIdPredictionMade, idModelError]);
|
|
16654
|
-
var
|
|
16655
|
-
idFrontCaptureStartedAt =
|
|
16656
|
-
setFirstGoodFrameTime =
|
|
16670
|
+
var _29 = React.useState(null),
|
|
16671
|
+
idFrontCaptureStartedAt = _29[0],
|
|
16672
|
+
setFirstGoodFrameTime = _29[1];
|
|
16657
16673
|
React.useEffect(function () {
|
|
16658
16674
|
if (goodFramesCount === 1) setFirstGoodFrameTime(new Date().getTime());
|
|
16659
16675
|
}, [goodFramesCount]);
|
|
@@ -16674,9 +16690,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
16674
16690
|
var frameHeight = (_e = (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) !== null && _e !== void 0 ? _e : 0;
|
|
16675
16691
|
var faceBox = (_f = faces === null || faces === void 0 ? void 0 : faces[0]) === null || _f === void 0 ? void 0 : _f.box;
|
|
16676
16692
|
var faceCentered = !faceBox || !frameWidth || faceBox.xMin > frameWidth * edgeBoundary && faceBox.yMin > frameHeight * edgeBoundary && faceBox.xMax < frameWidth * (1 - edgeBoundary) && faceBox.yMax < frameHeight * (1 - edgeBoundary);
|
|
16677
|
-
var
|
|
16678
|
-
countdownStartedAt =
|
|
16679
|
-
setCountdownStartedAt =
|
|
16693
|
+
var _30 = React.useState(),
|
|
16694
|
+
countdownStartedAt = _30[0],
|
|
16695
|
+
setCountdownStartedAt = _30[1];
|
|
16680
16696
|
var frameLock = React.useRef(false);
|
|
16681
16697
|
var captureFrame = React.useCallback(function () {
|
|
16682
16698
|
return tslib.__awaiter(void 0, void 0, void 0, function () {
|
|
@@ -16797,9 +16813,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
16797
16813
|
};
|
|
16798
16814
|
}, [captureCountdownSeconds, captureFrame, countdownStartedAt, manualCountdown]);
|
|
16799
16815
|
var timeoutStartedAt = useTimeout(readTextTimeoutDurationMs, stopRecording, requestedAction !== 'READ_TEXT', false, requestedAction === 'READ_TEXT').timeoutStartedAt;
|
|
16800
|
-
var
|
|
16801
|
-
numFramesWithoutFaces =
|
|
16802
|
-
setNumFramesWithoutFaces =
|
|
16816
|
+
var _31 = React.useState(0),
|
|
16817
|
+
numFramesWithoutFaces = _31[0],
|
|
16818
|
+
setNumFramesWithoutFaces = _31[1];
|
|
16803
16819
|
React.useEffect(function () {
|
|
16804
16820
|
if (!selfieModelError) {
|
|
16805
16821
|
onSelfiePredictionMade(function (faces) {
|
|
@@ -16817,14 +16833,14 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
16817
16833
|
}
|
|
16818
16834
|
}, [disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, numFramesWithoutFaces, onFaceNotDetected, timeoutStartedAt]);
|
|
16819
16835
|
var theme = styled.useTheme();
|
|
16820
|
-
var
|
|
16836
|
+
var _32 = useTranslations(rawVerbiage, {
|
|
16821
16837
|
faceNotCenteredText: 'Please move your face to the center...',
|
|
16822
16838
|
searchingForIdCardText: 'Searching for ID card...',
|
|
16823
16839
|
captureBtnText: 'Capture'
|
|
16824
16840
|
}),
|
|
16825
|
-
captureBtnText =
|
|
16826
|
-
faceNotCenteredText =
|
|
16827
|
-
searchingForIdCardText =
|
|
16841
|
+
captureBtnText = _32.captureBtnText,
|
|
16842
|
+
faceNotCenteredText = _32.faceNotCenteredText,
|
|
16843
|
+
searchingForIdCardText = _32.searchingForIdCardText;
|
|
16828
16844
|
var debugScalingDetails = useDebugScalingDetails({
|
|
16829
16845
|
enabled: debugMode,
|
|
16830
16846
|
pageWidth: width,
|
|
@@ -16842,6 +16858,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
16842
16858
|
text: readTextPrompt,
|
|
16843
16859
|
startedAt: timeoutStartedAt || undefined,
|
|
16844
16860
|
durationMs: readTextTimeoutDurationMs,
|
|
16861
|
+
minReadingMs: readTextMinReadingMs,
|
|
16845
16862
|
classNames: classNames.readTextPrompt,
|
|
16846
16863
|
verbiage: rawVerbiage.readTextPrompt,
|
|
16847
16864
|
onComplete: stopRecording
|
|
@@ -17037,6 +17054,7 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
17037
17054
|
goodIdCardBackFramesThreshold = _a.goodIdCardBackFramesThreshold,
|
|
17038
17055
|
readTextPrompt = _a.readTextPrompt,
|
|
17039
17056
|
readTextTimeoutDurationMs = _a.readTextTimeoutDurationMs,
|
|
17057
|
+
readTextMinReadingMs = _a.readTextMinReadingMs,
|
|
17040
17058
|
_k = _a.skipIdCapture,
|
|
17041
17059
|
skipIdCapture = _k === void 0 ? false : _k,
|
|
17042
17060
|
_l = _a.skipShowIdCardBack,
|
|
@@ -17221,6 +17239,7 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
17221
17239
|
disableFaceDetectionWhileAudioCaptureMsDelay: disableFaceDetectionWhileAudioCaptureMsDelay,
|
|
17222
17240
|
readTextPrompt: readTextPrompt,
|
|
17223
17241
|
readTextTimeoutDurationMs: readTextTimeoutDurationMs,
|
|
17242
|
+
readTextMinReadingMs: readTextMinReadingMs,
|
|
17224
17243
|
assets: assets.idVideoCapture,
|
|
17225
17244
|
classNames: classNames.idVideoCapture,
|
|
17226
17245
|
colors: colors.idVideoCapture,
|
|
@@ -19492,50 +19511,52 @@ var VideoIdValidation = function VideoIdValidation(_a) {
|
|
|
19492
19511
|
readTextPrompt = _a.readTextPrompt,
|
|
19493
19512
|
_k = _a.readTextTimeoutDurationMs,
|
|
19494
19513
|
readTextTimeoutDurationMs = _k === void 0 ? 15000 : _k,
|
|
19495
|
-
_l = _a.
|
|
19496
|
-
|
|
19497
|
-
_m = _a.
|
|
19498
|
-
|
|
19499
|
-
_o = _a.
|
|
19500
|
-
|
|
19501
|
-
_p = _a.
|
|
19502
|
-
|
|
19503
|
-
_q = _a.
|
|
19504
|
-
|
|
19505
|
-
_r = _a.
|
|
19506
|
-
|
|
19507
|
-
_s = _a.
|
|
19508
|
-
|
|
19509
|
-
_t = _a.
|
|
19510
|
-
|
|
19511
|
-
_u = _a.
|
|
19512
|
-
|
|
19513
|
-
_v = _a.
|
|
19514
|
-
|
|
19515
|
-
_w = _a.
|
|
19516
|
-
|
|
19517
|
-
_x = _a.
|
|
19518
|
-
|
|
19519
|
-
_y = _a.
|
|
19520
|
-
|
|
19521
|
-
_z = _a.
|
|
19522
|
-
|
|
19523
|
-
_0 = _a.
|
|
19524
|
-
|
|
19525
|
-
_1 = _a.
|
|
19526
|
-
|
|
19527
|
-
_2 = _a.
|
|
19528
|
-
|
|
19529
|
-
_3 = _a.
|
|
19530
|
-
|
|
19531
|
-
_4 = _a.
|
|
19532
|
-
|
|
19533
|
-
_5 = _a.
|
|
19534
|
-
|
|
19535
|
-
_6 = _a.
|
|
19536
|
-
|
|
19537
|
-
_7 = _a.
|
|
19538
|
-
|
|
19514
|
+
_l = _a.readTextMinReadingMs,
|
|
19515
|
+
readTextMinReadingMs = _l === void 0 ? 10000 : _l,
|
|
19516
|
+
_m = _a.skipSuccessScreen,
|
|
19517
|
+
skipSuccessScreen = _m === void 0 ? false : _m,
|
|
19518
|
+
_o = _a.skipIdCapture,
|
|
19519
|
+
skipIdCapture = _o === void 0 ? false : _o,
|
|
19520
|
+
_p = _a.skipShowIdCardBack,
|
|
19521
|
+
skipShowIdCardBack = _p === void 0 ? false : _p,
|
|
19522
|
+
_q = _a.idCaptureLoadingOverlayMode,
|
|
19523
|
+
idCaptureLoadingOverlayMode = _q === void 0 ? 'default' : _q,
|
|
19524
|
+
_r = _a.idCaptureGuideType,
|
|
19525
|
+
idCaptureGuideType = _r === void 0 ? 'fit' : _r,
|
|
19526
|
+
_s = _a.idCapturePortraitGuidesOnMobile,
|
|
19527
|
+
idCapturePortraitGuidesOnMobile = _s === void 0 ? false : _s,
|
|
19528
|
+
_t = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
|
|
19529
|
+
idCaptureRotateLoadingOverlayImageWhenPortrait = _t === void 0 ? true : _t,
|
|
19530
|
+
_u = _a.faceLivenessLoadingOverlayMode,
|
|
19531
|
+
faceLivenessLoadingOverlayMode = _u === void 0 ? 'default' : _u,
|
|
19532
|
+
_v = _a.disableFaceDetectionWhileAudioCapture,
|
|
19533
|
+
disableFaceDetectionWhileAudioCapture = _v === void 0 ? false : _v,
|
|
19534
|
+
_w = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
|
|
19535
|
+
disableFaceDetectionWhileAudioCaptureMsDelay = _w === void 0 ? 2000 : _w,
|
|
19536
|
+
_x = _a.silentFallback,
|
|
19537
|
+
silentFallback = _x === void 0 ? false : _x,
|
|
19538
|
+
_y = _a.theme,
|
|
19539
|
+
theme = _y === void 0 ? 'default' : _y,
|
|
19540
|
+
_z = _a.assets,
|
|
19541
|
+
assets = _z === void 0 ? {} : _z,
|
|
19542
|
+
_0 = _a.classNames,
|
|
19543
|
+
classNames = _0 === void 0 ? {} : _0,
|
|
19544
|
+
_1 = _a.colors,
|
|
19545
|
+
colors = _1 === void 0 ? {} : _1,
|
|
19546
|
+
_2 = _a.verbiage,
|
|
19547
|
+
verbiage = _2 === void 0 ? {} : _2,
|
|
19548
|
+
_3 = _a.captureSignature,
|
|
19549
|
+
captureSignature = _3 === void 0 ? false : _3,
|
|
19550
|
+
_4 = _a.captureSignatureVideo,
|
|
19551
|
+
captureSignatureVideo = _4 === void 0 ? false : _4,
|
|
19552
|
+
_5 = _a.captureAdditionalDocuments,
|
|
19553
|
+
captureAdditionalDocuments = _5 === void 0 ? [] : _5,
|
|
19554
|
+
_6 = _a.geolocationEnabled,
|
|
19555
|
+
geolocationEnabled = _6 === void 0 ? true : _6,
|
|
19556
|
+
_7 = _a.geolocationRequired,
|
|
19557
|
+
geolocationRequired = _7 === void 0 ? false : _7,
|
|
19558
|
+
_8 = _a.debugMode,
|
|
19559
|
+
debugMode = _8 === void 0 ? false : _8;
|
|
19539
19560
|
useLanguage(lang);
|
|
19540
19561
|
useDebugLogging(debugMode);
|
|
19541
19562
|
var videoIdCaptureProps = React.useMemo(function () {
|
|
@@ -19551,6 +19572,7 @@ var VideoIdValidation = function VideoIdValidation(_a) {
|
|
|
19551
19572
|
goodIdCardBackFramesThreshold: goodIdCardBackFramesThreshold,
|
|
19552
19573
|
readTextPrompt: readTextPrompt,
|
|
19553
19574
|
readTextTimeoutDurationMs: readTextTimeoutDurationMs,
|
|
19575
|
+
readTextMinReadingMs: readTextMinReadingMs,
|
|
19554
19576
|
onExitCapture: onExitCapture,
|
|
19555
19577
|
onExitAfterFailure: onExitAfterFailure,
|
|
19556
19578
|
onUserCancel: onUserCancel,
|
|
@@ -19571,7 +19593,7 @@ var VideoIdValidation = function VideoIdValidation(_a) {
|
|
|
19571
19593
|
verbiage: verbiage,
|
|
19572
19594
|
debugMode: debugMode
|
|
19573
19595
|
};
|
|
19574
|
-
}, [
|
|
19596
|
+
}, [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, assets, classNames, colors, verbiage, debugMode]);
|
|
19575
19597
|
var additionalDocumentCaptureProps = React.useMemo(function () {
|
|
19576
19598
|
return {
|
|
19577
19599
|
documents: captureAdditionalDocuments,
|