idmission-web-sdk 2.0.0 → 2.0.2
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 +1 -0
- package/dist/components/customer_flows/VideoIdValidation.d.ts +2 -0
- package/dist/components/video_id/IdVideoCapture.d.ts +2 -1
- package/dist/components/video_id/IdVideoCaptureWizard.d.ts +2 -1
- package/dist/components/video_signature_capture/VideoSignatureWizard.d.ts +1 -1
- package/dist/lib/camera/useVideoRecorder.d.ts +1 -1
- package/dist/sdk2.cjs.development.js +278 -203
- 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 +278 -203
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +278 -203
- 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/stories/CustomerFlows/VideoIdValidation.stories.d.ts +8 -10
- package/dist/version.d.ts +1 -1
- package/package.json +9 -9
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.
|
|
17
|
+
var webSdkVersion = '2.0.2';
|
|
18
18
|
|
|
19
19
|
function getPlatform() {
|
|
20
20
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -2461,7 +2461,7 @@ var defaultFocusThresholds = {
|
|
|
2461
2461
|
var models = {};
|
|
2462
2462
|
function loadFocusModel(modelAssetPath) {
|
|
2463
2463
|
return __awaiter(this, void 0, void 0, function () {
|
|
2464
|
-
var id, _a, _b, _c, _d
|
|
2464
|
+
var id, _a, _b, _c, _d;
|
|
2465
2465
|
return __generator(this, function (_e) {
|
|
2466
2466
|
switch (_e.label) {
|
|
2467
2467
|
case 0:
|
|
@@ -2484,12 +2484,16 @@ function loadFocusModel(modelAssetPath) {
|
|
|
2484
2484
|
delegate: modelCapabilities.delegate
|
|
2485
2485
|
},
|
|
2486
2486
|
runningMode: 'VIDEO'
|
|
2487
|
-
}])
|
|
2487
|
+
}])
|
|
2488
|
+
// const emptyFrame = document.createElement('canvas')
|
|
2489
|
+
// models[id].classifyForVideo(emptyFrame, performance.now())
|
|
2490
|
+
// emptyFrame.remove()
|
|
2491
|
+
];
|
|
2488
2492
|
case 3:
|
|
2489
2493
|
_a[_b] = _e.sent();
|
|
2490
|
-
emptyFrame = document.createElement('canvas')
|
|
2491
|
-
models[id].classifyForVideo(emptyFrame, performance.now())
|
|
2492
|
-
emptyFrame.remove()
|
|
2494
|
+
// const emptyFrame = document.createElement('canvas')
|
|
2495
|
+
// models[id].classifyForVideo(emptyFrame, performance.now())
|
|
2496
|
+
// emptyFrame.remove()
|
|
2493
2497
|
return [2 /*return*/, models[id]];
|
|
2494
2498
|
}
|
|
2495
2499
|
});
|
|
@@ -2730,7 +2734,7 @@ var defaultSelfieCaptureModelLoadTimeoutMs = 45000;
|
|
|
2730
2734
|
var detector;
|
|
2731
2735
|
function loadFaceDetector() {
|
|
2732
2736
|
return __awaiter(this, void 0, void 0, function () {
|
|
2733
|
-
var _a, _b
|
|
2737
|
+
var _a, _b;
|
|
2734
2738
|
return __generator(this, function (_c) {
|
|
2735
2739
|
switch (_c.label) {
|
|
2736
2740
|
case 0:
|
|
@@ -2750,12 +2754,16 @@ function loadFaceDetector() {
|
|
|
2750
2754
|
delegate: modelCapabilities.delegate
|
|
2751
2755
|
},
|
|
2752
2756
|
runningMode: 'VIDEO'
|
|
2753
|
-
}])
|
|
2757
|
+
}])
|
|
2758
|
+
// const emptyFrame = document.createElement('canvas')
|
|
2759
|
+
// detector.detectForVideo(emptyFrame, performance.now())
|
|
2760
|
+
// emptyFrame.remove()
|
|
2761
|
+
];
|
|
2754
2762
|
case 3:
|
|
2755
2763
|
detector = _c.sent();
|
|
2756
|
-
emptyFrame = document.createElement('canvas')
|
|
2757
|
-
detector.detectForVideo(emptyFrame, performance.now())
|
|
2758
|
-
emptyFrame.remove()
|
|
2764
|
+
// const emptyFrame = document.createElement('canvas')
|
|
2765
|
+
// detector.detectForVideo(emptyFrame, performance.now())
|
|
2766
|
+
// emptyFrame.remove()
|
|
2759
2767
|
return [2 /*return*/, detector];
|
|
2760
2768
|
}
|
|
2761
2769
|
});
|
|
@@ -3078,7 +3086,7 @@ function loadDocumentDetector(modelAssetPath, scoreThreshold) {
|
|
|
3078
3086
|
scoreThreshold = defaultDocumentDetectionScoreThreshold;
|
|
3079
3087
|
}
|
|
3080
3088
|
return __awaiter(this, void 0, void 0, function () {
|
|
3081
|
-
var id, _a, _b, _c, _d
|
|
3089
|
+
var id, _a, _b, _c, _d;
|
|
3082
3090
|
return __generator(this, function (_e) {
|
|
3083
3091
|
switch (_e.label) {
|
|
3084
3092
|
case 0:
|
|
@@ -3102,12 +3110,16 @@ function loadDocumentDetector(modelAssetPath, scoreThreshold) {
|
|
|
3102
3110
|
},
|
|
3103
3111
|
scoreThreshold: scoreThreshold,
|
|
3104
3112
|
runningMode: 'VIDEO'
|
|
3105
|
-
}])
|
|
3113
|
+
}])
|
|
3114
|
+
// const emptyFrame = document.createElement('canvas')
|
|
3115
|
+
// detectors[id].detectForVideo(emptyFrame, performance.now())
|
|
3116
|
+
// emptyFrame.remove()
|
|
3117
|
+
];
|
|
3106
3118
|
case 3:
|
|
3107
3119
|
_a[_b] = _e.sent();
|
|
3108
|
-
emptyFrame = document.createElement('canvas')
|
|
3109
|
-
detectors[id].detectForVideo(emptyFrame, performance.now())
|
|
3110
|
-
emptyFrame.remove()
|
|
3120
|
+
// const emptyFrame = document.createElement('canvas')
|
|
3121
|
+
// detectors[id].detectForVideo(emptyFrame, performance.now())
|
|
3122
|
+
// emptyFrame.remove()
|
|
3111
3123
|
return [2 /*return*/, detectors[id]];
|
|
3112
3124
|
}
|
|
3113
3125
|
});
|
|
@@ -9152,14 +9164,20 @@ var FaceLivenessWizard = function FaceLivenessWizard(_a) {
|
|
|
9152
9164
|
var captureStartedAt = useRef();
|
|
9153
9165
|
var captureEndedAt = useRef();
|
|
9154
9166
|
var operationStartedAt = useRef();
|
|
9167
|
+
var _x = useContext(SelfieGuidanceModelsContext),
|
|
9168
|
+
start = _x.start,
|
|
9169
|
+
stop = _x.stop;
|
|
9155
9170
|
useEffect(function () {
|
|
9156
9171
|
operationStartedAt.current = new Date();
|
|
9157
9172
|
}, []);
|
|
9158
9173
|
useEffect(function () {
|
|
9159
|
-
if (captureState
|
|
9160
|
-
|
|
9161
|
-
|
|
9162
|
-
|
|
9174
|
+
if (captureState !== 'CAPTURING') return;
|
|
9175
|
+
captureStartedAt.current = new Date();
|
|
9176
|
+
start();
|
|
9177
|
+
return function () {
|
|
9178
|
+
stop();
|
|
9179
|
+
};
|
|
9180
|
+
}, [captureState, start, stop]);
|
|
9163
9181
|
var onCapture = useCallback(function () {
|
|
9164
9182
|
captureEndedAt.current = new Date();
|
|
9165
9183
|
}, []);
|
|
@@ -9196,9 +9214,9 @@ var FaceLivenessWizard = function FaceLivenessWizard(_a) {
|
|
|
9196
9214
|
setCaptureState('FAILED');
|
|
9197
9215
|
onTimeout === null || onTimeout === void 0 ? void 0 : onTimeout(submissionResponse, livenessCheckRequest);
|
|
9198
9216
|
}, [onTimeout, livenessCheckRequest, submissionResponse]);
|
|
9199
|
-
var
|
|
9200
|
-
attempt =
|
|
9201
|
-
setAttempt =
|
|
9217
|
+
var _y = useState(0),
|
|
9218
|
+
attempt = _y[0],
|
|
9219
|
+
setAttempt = _y[1];
|
|
9202
9220
|
var onExitCallback = useCallback(function () {
|
|
9203
9221
|
setAttempt(function (n) {
|
|
9204
9222
|
return n + 1;
|
|
@@ -9614,7 +9632,10 @@ var SignatureCapture = function SignatureCapture(_a) {
|
|
|
9614
9632
|
var AcceptBtn$1 = styled(LoaderButton)(templateObject_1$b || (templateObject_1$b = __makeTemplateObject(["\n margin-left: auto;\n"], ["\n margin-left: auto;\n"])));
|
|
9615
9633
|
var templateObject_1$b;
|
|
9616
9634
|
|
|
9617
|
-
var useVideoRecorder = function useVideoRecorder(camera, audioStream) {
|
|
9635
|
+
var useVideoRecorder = function useVideoRecorder(camera, audioStream, mergeAVStreams) {
|
|
9636
|
+
if (mergeAVStreams === void 0) {
|
|
9637
|
+
mergeAVStreams = false;
|
|
9638
|
+
}
|
|
9618
9639
|
var videoRecorder = useRef(null);
|
|
9619
9640
|
var audioRecorder = useRef(null);
|
|
9620
9641
|
var videoChunks = useRef([]);
|
|
@@ -9643,7 +9664,13 @@ var useVideoRecorder = function useVideoRecorder(camera, audioStream) {
|
|
|
9643
9664
|
var _h = useState(false),
|
|
9644
9665
|
audioRecordingIntentionallyStopped = _h[0],
|
|
9645
9666
|
setAudioRecordingIntentionallyStopped = _h[1];
|
|
9646
|
-
var
|
|
9667
|
+
var getVideoStream = useCallback(function () {
|
|
9668
|
+
var _a, _b, _c;
|
|
9669
|
+
if (!mergeAVStreams) return camera === null || camera === void 0 ? void 0 : camera.stream;
|
|
9670
|
+
var videoTracks = (_b = (_a = camera === null || camera === void 0 ? void 0 : camera.stream) === null || _a === void 0 ? void 0 : _a.getTracks()) !== null && _b !== void 0 ? _b : [];
|
|
9671
|
+
var audioTracks = (_c = audioStream === null || audioStream === void 0 ? void 0 : audioStream.getTracks()) !== null && _c !== void 0 ? _c : [];
|
|
9672
|
+
return new MediaStream(__spreadArray(__spreadArray([], videoTracks, true), audioTracks, true));
|
|
9673
|
+
}, [audioStream, camera === null || camera === void 0 ? void 0 : camera.stream, mergeAVStreams]);
|
|
9647
9674
|
var processVideo = useCallback(function () {
|
|
9648
9675
|
var videoBlob = new Blob(videoChunks.current, {
|
|
9649
9676
|
type: 'video/mp4'
|
|
@@ -9664,13 +9691,15 @@ var useVideoRecorder = function useVideoRecorder(camera, audioStream) {
|
|
|
9664
9691
|
(_a = audioStream === null || audioStream === void 0 ? void 0 : audioStream.stop) === null || _a === void 0 ? void 0 : _a.call(audioStream);
|
|
9665
9692
|
}, [audioStream]);
|
|
9666
9693
|
var startRecordingVideo = useCallback(function () {
|
|
9694
|
+
var videoStream = getVideoStream();
|
|
9667
9695
|
if (!videoStream) return;
|
|
9668
9696
|
videoChunks.current = [];
|
|
9669
9697
|
setIsRecordingVideo(true);
|
|
9670
9698
|
setVideoRecordingStopped(false);
|
|
9671
9699
|
setVideoRecordingIntentionallyStopped(false);
|
|
9672
9700
|
videoRecorder.current = new MediaRecorder(videoStream, {
|
|
9673
|
-
videoBitsPerSecond: 270000
|
|
9701
|
+
videoBitsPerSecond: 270000,
|
|
9702
|
+
audioBitsPerSecond: 32000
|
|
9674
9703
|
});
|
|
9675
9704
|
videoRecorder.current.ondataavailable = function (e) {
|
|
9676
9705
|
videoChunks.current.push(e.data);
|
|
@@ -9686,8 +9715,9 @@ var useVideoRecorder = function useVideoRecorder(camera, audioStream) {
|
|
|
9686
9715
|
// TODO: figure out what to do here
|
|
9687
9716
|
}
|
|
9688
9717
|
}, 100);
|
|
9689
|
-
}, [
|
|
9718
|
+
}, [getVideoStream]);
|
|
9690
9719
|
var startRecordingAudio = useCallback(function () {
|
|
9720
|
+
if (mergeAVStreams) return;
|
|
9691
9721
|
if (!audioStream) return;
|
|
9692
9722
|
audioChunks.current = [];
|
|
9693
9723
|
setIsRecordingAudio(true);
|
|
@@ -9703,7 +9733,7 @@ var useVideoRecorder = function useVideoRecorder(camera, audioStream) {
|
|
|
9703
9733
|
setAudioRecordingStopped(true);
|
|
9704
9734
|
};
|
|
9705
9735
|
audioRecorder.current.start(1000);
|
|
9706
|
-
}, [audioStream]);
|
|
9736
|
+
}, [audioStream, mergeAVStreams]);
|
|
9707
9737
|
var stopRecordingVideo = useCallback(function () {
|
|
9708
9738
|
var _a, _b;
|
|
9709
9739
|
setVideoRecordingIntentionallyStopped(true);
|
|
@@ -10005,45 +10035,52 @@ var VideoSignatureWizard = function VideoSignatureWizard(_a) {
|
|
|
10005
10035
|
onRetryClicked = _a.onRetryClicked,
|
|
10006
10036
|
onExitCapture = _a.onExitCapture,
|
|
10007
10037
|
onUserCancel = _a.onUserCancel,
|
|
10008
|
-
onModelError = _a.onModelError,
|
|
10009
10038
|
_c = _a.loadingOverlayMode,
|
|
10010
10039
|
loadingOverlayMode = _c === void 0 ? 'default' : _c,
|
|
10011
|
-
_d = _a.
|
|
10012
|
-
|
|
10013
|
-
_e = _a.
|
|
10014
|
-
|
|
10015
|
-
_f = _a.
|
|
10016
|
-
|
|
10017
|
-
_g = _a.
|
|
10018
|
-
|
|
10019
|
-
_h = _a.
|
|
10020
|
-
|
|
10021
|
-
_j = _a.
|
|
10022
|
-
|
|
10023
|
-
|
|
10024
|
-
|
|
10025
|
-
|
|
10026
|
-
|
|
10027
|
-
|
|
10028
|
-
|
|
10029
|
-
|
|
10030
|
-
setSignatureVideoUrl = _l.setSignatureVideoUrl,
|
|
10031
|
-
logSelfieCaptureAttempt = _l.logSelfieCaptureAttempt;
|
|
10040
|
+
_d = _a.skipSuccessScreen,
|
|
10041
|
+
skipSuccessScreen = _d === void 0 ? false : _d,
|
|
10042
|
+
_e = _a.assets,
|
|
10043
|
+
assets = _e === void 0 ? {} : _e,
|
|
10044
|
+
_f = _a.classNames,
|
|
10045
|
+
classNames = _f === void 0 ? {} : _f,
|
|
10046
|
+
_g = _a.colors,
|
|
10047
|
+
colors = _g === void 0 ? {} : _g,
|
|
10048
|
+
_h = _a.verbiage,
|
|
10049
|
+
verbiage = _h === void 0 ? {} : _h,
|
|
10050
|
+
_j = _a.debugMode,
|
|
10051
|
+
debugMode = _j === void 0 ? false : _j;
|
|
10052
|
+
var _k = useContext(SubmissionContext),
|
|
10053
|
+
selfieImage = _k.selfieImage,
|
|
10054
|
+
signatureVideoUrl = _k.signatureVideoUrl,
|
|
10055
|
+
setSelfieImage = _k.setSelfieImage,
|
|
10056
|
+
setSignatureData = _k.setSignatureData,
|
|
10057
|
+
setSignatureVideoUrl = _k.setSignatureVideoUrl,
|
|
10058
|
+
logSelfieCaptureAttempt = _k.logSelfieCaptureAttempt;
|
|
10032
10059
|
var cameraAccessDenied = useContext(CameraStateContext).cameraAccessDenied;
|
|
10033
|
-
var
|
|
10034
|
-
captureState =
|
|
10035
|
-
setCaptureState =
|
|
10060
|
+
var _l = useState('LOADING'),
|
|
10061
|
+
captureState = _l[0],
|
|
10062
|
+
setCaptureState = _l[1];
|
|
10036
10063
|
var operationStartedAt = useRef();
|
|
10037
10064
|
var captureStartedAt = useRef();
|
|
10038
10065
|
var captureEndedAt = useRef();
|
|
10066
|
+
var _m = useContext(SelfieGuidanceModelsContext),
|
|
10067
|
+
start = _m.start,
|
|
10068
|
+
stop = _m.stop;
|
|
10039
10069
|
useEffect(function () {
|
|
10040
10070
|
operationStartedAt.current = new Date();
|
|
10041
10071
|
}, []);
|
|
10042
10072
|
useEffect(function () {
|
|
10043
|
-
if (captureState
|
|
10044
|
-
|
|
10045
|
-
}
|
|
10073
|
+
if (captureState !== 'CHECKING_LIVENESS') return;
|
|
10074
|
+
captureStartedAt.current = new Date();
|
|
10046
10075
|
}, [captureState]);
|
|
10076
|
+
var shouldRun = ['CHECKING_LIVENESS', 'CAPTURING_SIGNATURE'].includes(captureState);
|
|
10077
|
+
useEffect(function () {
|
|
10078
|
+
if (!shouldRun) return;
|
|
10079
|
+
start();
|
|
10080
|
+
return function () {
|
|
10081
|
+
stop();
|
|
10082
|
+
};
|
|
10083
|
+
}, [shouldRun, start, stop]);
|
|
10047
10084
|
var logCaptureMetadata = useCallback(function () {
|
|
10048
10085
|
var _a, _b, _c;
|
|
10049
10086
|
logSelfieCaptureAttempt({
|
|
@@ -10108,11 +10145,7 @@ var VideoSignatureWizard = function VideoSignatureWizard(_a) {
|
|
|
10108
10145
|
setCaptureState('LOADING');
|
|
10109
10146
|
}
|
|
10110
10147
|
}, [cameraAccessDenied]);
|
|
10111
|
-
return /*#__PURE__*/React__default.createElement(
|
|
10112
|
-
throttleMs: captureState === 'CAPTURING_SIGNATURE' ? 250 : 0,
|
|
10113
|
-
onModelError: onModelError,
|
|
10114
|
-
modelLoadTimeoutMs: modelLoadTimeoutMs
|
|
10115
|
-
}, /*#__PURE__*/React__default.createElement(PageContainer, {
|
|
10148
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(PageContainer, {
|
|
10116
10149
|
className: "flex ".concat((_b = classNames === null || classNames === void 0 ? void 0 : classNames.container) !== null && _b !== void 0 ? _b : '')
|
|
10117
10150
|
}, /*#__PURE__*/React__default.createElement(CameraVideoTag, {
|
|
10118
10151
|
className: classNames.cameraFeed
|
|
@@ -10477,79 +10510,85 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10477
10510
|
disableFaceDetectionWhileAudioCapture = _8 === void 0 ? false : _8,
|
|
10478
10511
|
_9 = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
|
|
10479
10512
|
disableFaceDetectionWhileAudioCaptureMsDelay = _9 === void 0 ? 2000 : _9,
|
|
10480
|
-
_10 = _a.
|
|
10481
|
-
|
|
10482
|
-
_11 = _a.
|
|
10483
|
-
|
|
10484
|
-
_12 = _a.
|
|
10485
|
-
|
|
10486
|
-
_13 = _a.
|
|
10487
|
-
|
|
10488
|
-
_14 = _a.
|
|
10489
|
-
|
|
10490
|
-
|
|
10491
|
-
|
|
10492
|
-
|
|
10493
|
-
|
|
10494
|
-
_17 =
|
|
10495
|
-
|
|
10496
|
-
|
|
10497
|
-
|
|
10498
|
-
|
|
10499
|
-
|
|
10500
|
-
|
|
10501
|
-
|
|
10502
|
-
|
|
10503
|
-
|
|
10504
|
-
|
|
10505
|
-
|
|
10506
|
-
|
|
10507
|
-
setDetectedObjects = _19[1];
|
|
10513
|
+
_10 = _a.mergeAVStreams,
|
|
10514
|
+
mergeAVStreams = _10 === void 0 ? false : _10,
|
|
10515
|
+
_11 = _a.assets,
|
|
10516
|
+
assets = _11 === void 0 ? {} : _11,
|
|
10517
|
+
_12 = _a.classNames,
|
|
10518
|
+
classNames = _12 === void 0 ? {} : _12,
|
|
10519
|
+
_13 = _a.colors,
|
|
10520
|
+
colors = _13 === void 0 ? {} : _13,
|
|
10521
|
+
_14 = _a.verbiage,
|
|
10522
|
+
rawVerbiage = _14 === void 0 ? {} : _14,
|
|
10523
|
+
_15 = _a.debugMode,
|
|
10524
|
+
debugMode = _15 === void 0 ? false : _15;
|
|
10525
|
+
var _16 = useResizeObserver(),
|
|
10526
|
+
ref = _16.ref,
|
|
10527
|
+
_17 = _16.width,
|
|
10528
|
+
width = _17 === void 0 ? 1 : _17,
|
|
10529
|
+
_18 = _16.height,
|
|
10530
|
+
height = _18 === void 0 ? 1 : _18;
|
|
10531
|
+
var _19 = useContext(CameraStateContext),
|
|
10532
|
+
cameraRef = _19.cameraRef,
|
|
10533
|
+
videoRef = _19.videoRef,
|
|
10534
|
+
videoLoaded = _19.videoLoaded,
|
|
10535
|
+
cameraReady = _19.cameraReady,
|
|
10536
|
+
microphoneReady = _19.microphoneReady,
|
|
10537
|
+
audioStream = _19.audioStream,
|
|
10538
|
+
setVideoLoaded = _19.setVideoLoaded,
|
|
10539
|
+
takePhoto = _19.takePhoto;
|
|
10508
10540
|
var _20 = useState([]),
|
|
10509
|
-
|
|
10510
|
-
|
|
10511
|
-
var _21 =
|
|
10512
|
-
|
|
10513
|
-
|
|
10514
|
-
|
|
10515
|
-
|
|
10516
|
-
|
|
10517
|
-
|
|
10518
|
-
|
|
10519
|
-
|
|
10520
|
-
|
|
10521
|
-
|
|
10522
|
-
|
|
10523
|
-
var _23 =
|
|
10524
|
-
|
|
10525
|
-
|
|
10526
|
-
var _24 = useContext(
|
|
10527
|
-
|
|
10528
|
-
|
|
10529
|
-
var _25 =
|
|
10530
|
-
|
|
10531
|
-
|
|
10532
|
-
|
|
10533
|
-
|
|
10534
|
-
|
|
10535
|
-
|
|
10536
|
-
|
|
10537
|
-
|
|
10538
|
-
|
|
10541
|
+
detectedObjects = _20[0],
|
|
10542
|
+
setDetectedObjects = _20[1];
|
|
10543
|
+
var _21 = useState([]),
|
|
10544
|
+
faces = _21[0],
|
|
10545
|
+
setFaces = _21[1];
|
|
10546
|
+
var _22 = useContext(IdCaptureModelsContext),
|
|
10547
|
+
idModelsReady = _22.ready,
|
|
10548
|
+
startIdModels = _22.start,
|
|
10549
|
+
stopIdModels = _22.stop,
|
|
10550
|
+
onIdPredictionMade = _22.onPredictionMade,
|
|
10551
|
+
setThresholds = _22.setThresholds,
|
|
10552
|
+
bestFrameDetails = _22.bestFrameDetails,
|
|
10553
|
+
resetBestFrame = _22.resetBestFrame,
|
|
10554
|
+
idModelError = _22.modelError;
|
|
10555
|
+
var _23 = useState(null),
|
|
10556
|
+
videoStartsAt = _23[0],
|
|
10557
|
+
setVideoStartsAt = _23[1];
|
|
10558
|
+
var _24 = useContext(SubmissionContext),
|
|
10559
|
+
setIdCaptureVideoAudioStartsAt = _24.setIdCaptureVideoAudioStartsAt,
|
|
10560
|
+
setExpectedAudioText = _24.setExpectedAudioText;
|
|
10561
|
+
var _25 = useContext(SelfieGuidanceModelsContext),
|
|
10562
|
+
onSelfiePredictionMade = _25.onPredictionMade,
|
|
10563
|
+
selfieModelError = _25.error;
|
|
10564
|
+
var _26 = useVideoRecorder(cameraRef.current, audioStream, mergeAVStreams),
|
|
10565
|
+
isRecordingVideo = _26.isRecordingVideo,
|
|
10566
|
+
startRecordingVideo = _26.startRecordingVideo,
|
|
10567
|
+
startRecordingAudio = _26.startRecordingAudio,
|
|
10568
|
+
stopRecordingVideo = _26.stopRecordingVideo,
|
|
10569
|
+
stopRecordingAudio = _26.stopRecordingAudio,
|
|
10570
|
+
videoRecordingUnintentionallyStopped = _26.videoRecordingUnintentionallyStopped,
|
|
10571
|
+
audioRecordingUnintentionallyStopped = _26.audioRecordingUnintentionallyStopped,
|
|
10572
|
+
videoUrl = _26.videoUrl,
|
|
10573
|
+
audioUrl = _26.audioUrl;
|
|
10539
10574
|
var countdownTimeoutRef = useRef(undefined);
|
|
10540
|
-
var
|
|
10541
|
-
countdownRemaining =
|
|
10542
|
-
setCountdownRemaining =
|
|
10575
|
+
var _27 = useState(0),
|
|
10576
|
+
countdownRemaining = _27[0],
|
|
10577
|
+
setCountdownRemaining = _27[1];
|
|
10543
10578
|
useEffect(function () {
|
|
10544
10579
|
if (!isRecordingVideo && !videoUrl) {
|
|
10545
10580
|
startRecordingVideo();
|
|
10546
10581
|
setVideoStartsAt(new Date());
|
|
10547
10582
|
}
|
|
10548
|
-
if
|
|
10583
|
+
// if the mergeAVStreams flag is present, the audio stream is on the video
|
|
10584
|
+
// stream, so we won't wait for a separate data url containing audio only.
|
|
10585
|
+
var needsAudio = !!readTextPrompt && !mergeAVStreams;
|
|
10586
|
+
var audioReady = !needsAudio || audioUrl;
|
|
10587
|
+
if (videoUrl && audioReady) {
|
|
10549
10588
|
setVideoLoaded(false);
|
|
10550
10589
|
onComplete === null || onComplete === void 0 ? void 0 : onComplete(videoUrl, audioUrl);
|
|
10551
10590
|
}
|
|
10552
|
-
}, [audioUrl, isRecordingVideo, onComplete, readTextPrompt, setVideoLoaded, startRecordingVideo, videoUrl]);
|
|
10591
|
+
}, [audioUrl, isRecordingVideo, mergeAVStreams, onComplete, readTextPrompt, setVideoLoaded, startRecordingVideo, videoUrl]);
|
|
10553
10592
|
useEffect(function () {
|
|
10554
10593
|
if (videoRecordingUnintentionallyStopped || audioRecordingUnintentionallyStopped) {
|
|
10555
10594
|
onRecordingFailed === null || onRecordingFailed === void 0 ? void 0 : onRecordingFailed();
|
|
@@ -10559,9 +10598,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10559
10598
|
useEffect(function () {
|
|
10560
10599
|
shouldCaptureFrames.current = videoLoaded && cameraReady && idModelsReady && !idModelError && (!readTextPrompt || microphoneReady);
|
|
10561
10600
|
}, [cameraReady, idModelError, idModelsReady, microphoneReady, readTextPrompt, videoLoaded]);
|
|
10562
|
-
var
|
|
10563
|
-
requestedAction =
|
|
10564
|
-
setRequestedAction =
|
|
10601
|
+
var _28 = useState('SHOW_ID_FRONT'),
|
|
10602
|
+
requestedAction = _28[0],
|
|
10603
|
+
setRequestedAction = _28[1];
|
|
10565
10604
|
useEffect(function startModelsWhenCapturing() {
|
|
10566
10605
|
if (!shouldCaptureFrames.current && requestedAction !== 'SHOW_ID_FRONT' && requestedAction !== 'SHOW_ID_BACK') return;
|
|
10567
10606
|
startIdModels();
|
|
@@ -10580,15 +10619,15 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10580
10619
|
}
|
|
10581
10620
|
});
|
|
10582
10621
|
}, [idCardBackDetectionThreshold, idCardBackFocusThreshold, idCardFrontDetectionThreshold, idCardFrontFocusThreshold, requestedAction, setThresholds]);
|
|
10583
|
-
var _28 = useState(0),
|
|
10584
|
-
currentDetectionScore = _28[0],
|
|
10585
|
-
setCurrentDetectionScore = _28[1];
|
|
10586
10622
|
var _29 = useState(0),
|
|
10587
|
-
|
|
10588
|
-
|
|
10623
|
+
currentDetectionScore = _29[0],
|
|
10624
|
+
setCurrentDetectionScore = _29[1];
|
|
10589
10625
|
var _30 = useState(0),
|
|
10590
|
-
|
|
10591
|
-
|
|
10626
|
+
currentFocusScore = _30[0],
|
|
10627
|
+
setCurrentFocusScore = _30[1];
|
|
10628
|
+
var _31 = useState(0),
|
|
10629
|
+
goodFramesCount = _31[0],
|
|
10630
|
+
setGoodFramesCount = _31[1];
|
|
10592
10631
|
var goodFramesThreshold = requestedAction === 'SHOW_ID_FRONT' ? goodIdCardFrontFramesThreshold : goodIdCardBackFramesThreshold;
|
|
10593
10632
|
var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
|
|
10594
10633
|
useEffect(function () {
|
|
@@ -10606,9 +10645,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10606
10645
|
}
|
|
10607
10646
|
});
|
|
10608
10647
|
}, [idCaptureModelsEnabled, idCardFrontDetectionThreshold, onIdPredictionMade, idModelError]);
|
|
10609
|
-
var
|
|
10610
|
-
idFrontCaptureStartedAt =
|
|
10611
|
-
setFirstGoodFrameTime =
|
|
10648
|
+
var _32 = useState(null),
|
|
10649
|
+
idFrontCaptureStartedAt = _32[0],
|
|
10650
|
+
setFirstGoodFrameTime = _32[1];
|
|
10612
10651
|
useEffect(function () {
|
|
10613
10652
|
if (goodFramesCount === 1) setFirstGoodFrameTime(new Date().getTime());
|
|
10614
10653
|
}, [goodFramesCount]);
|
|
@@ -10629,9 +10668,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10629
10668
|
var frameHeight = (_e = (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) !== null && _e !== void 0 ? _e : 0;
|
|
10630
10669
|
var faceBox = (_f = faces === null || faces === void 0 ? void 0 : faces[0]) === null || _f === void 0 ? void 0 : _f.box;
|
|
10631
10670
|
var faceCentered = !faceBox || !frameWidth || faceBox.xMin > frameWidth * edgeBoundary && faceBox.yMin > frameHeight * edgeBoundary && faceBox.xMax < frameWidth * (1 - edgeBoundary) && faceBox.yMax < frameHeight * (1 - edgeBoundary);
|
|
10632
|
-
var
|
|
10633
|
-
countdownStartedAt =
|
|
10634
|
-
setCountdownStartedAt =
|
|
10671
|
+
var _33 = useState(),
|
|
10672
|
+
countdownStartedAt = _33[0],
|
|
10673
|
+
setCountdownStartedAt = _33[1];
|
|
10635
10674
|
var frameLock = useRef(false);
|
|
10636
10675
|
var captureFrame = useCallback(function () {
|
|
10637
10676
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -10752,9 +10791,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10752
10791
|
};
|
|
10753
10792
|
}, [captureCountdownSeconds, captureFrame, countdownStartedAt, manualCountdown]);
|
|
10754
10793
|
var timeoutStartedAt = useTimeout(readTextTimeoutDurationMs, stopRecording, requestedAction !== 'READ_TEXT', false, requestedAction === 'READ_TEXT').timeoutStartedAt;
|
|
10755
|
-
var
|
|
10756
|
-
numFramesWithoutFaces =
|
|
10757
|
-
setNumFramesWithoutFaces =
|
|
10794
|
+
var _34 = useState(0),
|
|
10795
|
+
numFramesWithoutFaces = _34[0],
|
|
10796
|
+
setNumFramesWithoutFaces = _34[1];
|
|
10758
10797
|
useEffect(function () {
|
|
10759
10798
|
if (!selfieModelError) {
|
|
10760
10799
|
onSelfiePredictionMade(function (faces) {
|
|
@@ -10772,14 +10811,14 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10772
10811
|
}
|
|
10773
10812
|
}, [disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, numFramesWithoutFaces, onFaceNotDetected, timeoutStartedAt]);
|
|
10774
10813
|
var theme = useTheme();
|
|
10775
|
-
var
|
|
10814
|
+
var _35 = useTranslations(rawVerbiage, {
|
|
10776
10815
|
faceNotCenteredText: 'Please move your face to the center...',
|
|
10777
10816
|
searchingForIdCardText: 'Searching for ID card...',
|
|
10778
10817
|
captureBtnText: 'Capture'
|
|
10779
10818
|
}),
|
|
10780
|
-
captureBtnText =
|
|
10781
|
-
faceNotCenteredText =
|
|
10782
|
-
searchingForIdCardText =
|
|
10819
|
+
captureBtnText = _35.captureBtnText,
|
|
10820
|
+
faceNotCenteredText = _35.faceNotCenteredText,
|
|
10821
|
+
searchingForIdCardText = _35.searchingForIdCardText;
|
|
10783
10822
|
var debugScalingDetails = useDebugScalingDetails({
|
|
10784
10823
|
enabled: debugMode,
|
|
10785
10824
|
pageWidth: width,
|
|
@@ -11020,29 +11059,31 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
11020
11059
|
disableFaceDetectionWhileAudioCaptureMsDelay = _v === void 0 ? 2000 : _v,
|
|
11021
11060
|
_w = _a.silentFallback,
|
|
11022
11061
|
silentFallback = _w === void 0 ? false : _w,
|
|
11023
|
-
_x = _a.
|
|
11024
|
-
|
|
11025
|
-
_y = _a.
|
|
11026
|
-
|
|
11027
|
-
_z = _a.
|
|
11028
|
-
|
|
11029
|
-
_0 = _a.
|
|
11030
|
-
|
|
11031
|
-
_1 = _a.
|
|
11032
|
-
|
|
11033
|
-
|
|
11034
|
-
|
|
11035
|
-
|
|
11036
|
-
|
|
11037
|
-
|
|
11038
|
-
|
|
11039
|
-
|
|
11040
|
-
|
|
11041
|
-
|
|
11042
|
-
|
|
11043
|
-
|
|
11044
|
-
|
|
11045
|
-
|
|
11062
|
+
_x = _a.mergeAVStreams,
|
|
11063
|
+
mergeAVStreams = _x === void 0 ? false : _x,
|
|
11064
|
+
_y = _a.assets,
|
|
11065
|
+
assets = _y === void 0 ? {} : _y,
|
|
11066
|
+
_z = _a.classNames,
|
|
11067
|
+
classNames = _z === void 0 ? {} : _z,
|
|
11068
|
+
_0 = _a.colors,
|
|
11069
|
+
colors = _0 === void 0 ? {} : _0,
|
|
11070
|
+
_1 = _a.verbiage,
|
|
11071
|
+
verbiage = _1 === void 0 ? {} : _1,
|
|
11072
|
+
_2 = _a.debugMode,
|
|
11073
|
+
debugMode = _2 === void 0 ? false : _2;
|
|
11074
|
+
var _3 = useContext(SubmissionContext),
|
|
11075
|
+
submissionStatus = _3.submissionStatus,
|
|
11076
|
+
idCaptureVideoUrl = _3.idCaptureVideoUrl,
|
|
11077
|
+
idCaptureVideoAudioUrl = _3.idCaptureVideoAudioUrl,
|
|
11078
|
+
idCaptureVideoIdFrontImage = _3.idCaptureVideoIdFrontImage,
|
|
11079
|
+
idCaptureVideoIdBackImage = _3.idCaptureVideoIdBackImage,
|
|
11080
|
+
setIdCaptureVideoUrl = _3.setIdCaptureVideoUrl,
|
|
11081
|
+
setIdCaptureVideoIdFrontImage = _3.setIdCaptureVideoIdFrontImage,
|
|
11082
|
+
setIdCaptureVideoIdBackImage = _3.setIdCaptureVideoIdBackImage,
|
|
11083
|
+
setIdCaptureVideoAudioUrl = _3.setIdCaptureVideoAudioUrl;
|
|
11084
|
+
var _4 = useState('CAPTURING_ID'),
|
|
11085
|
+
captureState = _4[0],
|
|
11086
|
+
setCaptureState = _4[1];
|
|
11046
11087
|
useEffect(function () {
|
|
11047
11088
|
if (skipIdCapture && captureState === 'CAPTURING_ID') setCaptureState('CHECKING_LIVENESS');
|
|
11048
11089
|
}, [captureState, skipIdCapture]);
|
|
@@ -11073,9 +11114,9 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
11073
11114
|
var onVideoCaptureFaceNotDetected = useCallback(function () {
|
|
11074
11115
|
setCaptureState('CHECKING_LIVENESS');
|
|
11075
11116
|
}, []);
|
|
11076
|
-
var
|
|
11077
|
-
attempt =
|
|
11078
|
-
setAttempt =
|
|
11117
|
+
var _5 = useState(0),
|
|
11118
|
+
attempt = _5[0],
|
|
11119
|
+
setAttempt = _5[1];
|
|
11079
11120
|
var userSuppliedExitAfterFailure = onExitAfterFailure !== null && onExitAfterFailure !== void 0 ? onExitAfterFailure : faceLivenessProps.onExitAfterFailure;
|
|
11080
11121
|
var onFaceCaptureExitAfterFailure = useCallback(function (resp, req) {
|
|
11081
11122
|
userSuppliedExitAfterFailure === null || userSuppliedExitAfterFailure === void 0 ? void 0 : userSuppliedExitAfterFailure(resp, req);
|
|
@@ -11116,11 +11157,13 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
11116
11157
|
onMicrophoneAccessDenied: onMicrophoneAccessDenied,
|
|
11117
11158
|
debugMode: debugMode
|
|
11118
11159
|
}, /*#__PURE__*/React__default.createElement(IdCaptureModelsProvider, {
|
|
11160
|
+
autoStart: false,
|
|
11119
11161
|
documentDetectionModelUrl: (_c = (_b = idCaptureProps.assets) === null || _b === void 0 ? void 0 : _b.documentDetectionModelUrl) !== null && _c !== void 0 ? _c : '',
|
|
11120
11162
|
focusModelUrl: (_e = (_d = idCaptureProps.assets) === null || _d === void 0 ? void 0 : _d.focusModelUrl) !== null && _e !== void 0 ? _e : '',
|
|
11121
11163
|
onModelError: onIdCaptureModelError,
|
|
11122
11164
|
modelLoadTimeoutMs: idCaptureModelLoadTimeoutMs
|
|
11123
11165
|
}, /*#__PURE__*/React__default.createElement(SelfieGuidanceModelsProvider, {
|
|
11166
|
+
autoStart: false,
|
|
11124
11167
|
onModelError: faceLivenessProps === null || faceLivenessProps === void 0 ? void 0 : faceLivenessProps.onModelError,
|
|
11125
11168
|
modelLoadTimeoutMs: faceLivenessProps === null || faceLivenessProps === void 0 ? void 0 : faceLivenessProps.modelLoadTimeoutMs
|
|
11126
11169
|
}, /*#__PURE__*/React__default.createElement(PageContainer, {
|
|
@@ -11189,6 +11232,7 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
11189
11232
|
readTextPrompt: readTextPrompt,
|
|
11190
11233
|
readTextTimeoutDurationMs: readTextTimeoutDurationMs,
|
|
11191
11234
|
readTextMinReadingMs: readTextMinReadingMs,
|
|
11235
|
+
mergeAVStreams: mergeAVStreams,
|
|
11192
11236
|
assets: assets.idVideoCapture,
|
|
11193
11237
|
classNames: classNames.idVideoCapture,
|
|
11194
11238
|
colors: colors.idVideoCapture,
|
|
@@ -11387,6 +11431,7 @@ var CompositeWizardComponent = function CompositeWizardComponent(_a) {
|
|
|
11387
11431
|
onMicrophoneAccessDenied: onMicrophoneAccessDenied,
|
|
11388
11432
|
debugMode: debugMode
|
|
11389
11433
|
}, /*#__PURE__*/React__default.createElement(SelfieGuidanceModelsProvider, {
|
|
11434
|
+
autoStart: false,
|
|
11390
11435
|
onModelError: faceLivenessProps.onModelError,
|
|
11391
11436
|
modelLoadTimeoutMs: faceLivenessProps.modelLoadTimeoutMs
|
|
11392
11437
|
}, /*#__PURE__*/React__default.createElement(FaceLivenessWizard, __assign({}, faceLivenessProps, {
|
|
@@ -11406,10 +11451,15 @@ var CompositeWizardComponent = function CompositeWizardComponent(_a) {
|
|
|
11406
11451
|
onCameraAccessDenied: onCameraAccessDenied,
|
|
11407
11452
|
onMicrophoneAccessDenied: onMicrophoneAccessDenied,
|
|
11408
11453
|
debugMode: debugMode
|
|
11454
|
+
}, /*#__PURE__*/React__default.createElement(SelfieGuidanceModelsProvider, {
|
|
11455
|
+
autoStart: false,
|
|
11456
|
+
throttleMs: 250,
|
|
11457
|
+
onModelError: videoSignatureCaptureProps.onModelError,
|
|
11458
|
+
modelLoadTimeoutMs: videoSignatureCaptureProps.modelLoadTimeoutMs
|
|
11409
11459
|
}, /*#__PURE__*/React__default.createElement(VideoSignatureWizard, __assign({}, videoSignatureCaptureProps, {
|
|
11410
11460
|
onComplete: onVideoSignatureComplete,
|
|
11411
11461
|
onRetryClicked: onVideoSignatureRetry
|
|
11412
|
-
})));
|
|
11462
|
+
}))));
|
|
11413
11463
|
case 'AdditionalDocumentCapture':
|
|
11414
11464
|
return /*#__PURE__*/React__default.createElement(AdditionalDocumentCaptureWizard, __assign({}, additionalDocumentCaptureProps, {
|
|
11415
11465
|
documents: documents,
|
|
@@ -12736,6 +12786,16 @@ var CustomerVerificationWizard = function CustomerVerificationWizard(_a) {
|
|
|
12736
12786
|
var _m = useContext(CameraStateContext),
|
|
12737
12787
|
cameraAccessDenied = _m.cameraAccessDenied,
|
|
12738
12788
|
releaseCameraAccess = _m.releaseCameraAccess;
|
|
12789
|
+
var _o = useContext(SelfieGuidanceModelsContext),
|
|
12790
|
+
start = _o.start,
|
|
12791
|
+
stop = _o.stop;
|
|
12792
|
+
useEffect(function () {
|
|
12793
|
+
if (captureState !== 'CAPTURING') return;
|
|
12794
|
+
start();
|
|
12795
|
+
return function () {
|
|
12796
|
+
stop();
|
|
12797
|
+
};
|
|
12798
|
+
}, [captureState, start, stop]);
|
|
12739
12799
|
var onCustomerMatchedCallback = useCallback(function (resp, req) {
|
|
12740
12800
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
12741
12801
|
return __generator(this, function (_a) {
|
|
@@ -12758,9 +12818,9 @@ var CustomerVerificationWizard = function CustomerVerificationWizard(_a) {
|
|
|
12758
12818
|
setCaptureState('FAILED');
|
|
12759
12819
|
onCaptureGuidanceTimeout === null || onCaptureGuidanceTimeout === void 0 ? void 0 : onCaptureGuidanceTimeout();
|
|
12760
12820
|
}, [onCaptureGuidanceTimeout]);
|
|
12761
|
-
var
|
|
12762
|
-
attempt =
|
|
12763
|
-
setAttempt =
|
|
12821
|
+
var _p = useState(0),
|
|
12822
|
+
attempt = _p[0],
|
|
12823
|
+
setAttempt = _p[1];
|
|
12764
12824
|
var onExitCallback = useCallback(function () {
|
|
12765
12825
|
setAttempt(function (n) {
|
|
12766
12826
|
return n + 1;
|
|
@@ -12934,6 +12994,7 @@ var CustomerVerification = function CustomerVerification(_a) {
|
|
|
12934
12994
|
onCameraAccessDenied: onCameraAccessDenied,
|
|
12935
12995
|
debugMode: debugMode
|
|
12936
12996
|
}, /*#__PURE__*/React__default.createElement(SelfieGuidanceModelsProvider, {
|
|
12997
|
+
autoStart: false,
|
|
12937
12998
|
onModelError: onModelError,
|
|
12938
12999
|
modelLoadTimeoutMs: modelLoadTimeoutMs
|
|
12939
13000
|
}, /*#__PURE__*/React__default.createElement(CustomerVerificationWizard, {
|
|
@@ -13280,6 +13341,16 @@ var CustomerIdentificationWizard = function CustomerIdentificationWizard(_a) {
|
|
|
13280
13341
|
var _m = useContext(CameraStateContext),
|
|
13281
13342
|
cameraAccessDenied = _m.cameraAccessDenied,
|
|
13282
13343
|
releaseCameraAccess = _m.releaseCameraAccess;
|
|
13344
|
+
var _o = useContext(SelfieGuidanceModelsContext),
|
|
13345
|
+
start = _o.start,
|
|
13346
|
+
stop = _o.stop;
|
|
13347
|
+
useEffect(function () {
|
|
13348
|
+
if (captureState !== 'CAPTURING') return;
|
|
13349
|
+
start();
|
|
13350
|
+
return function () {
|
|
13351
|
+
stop();
|
|
13352
|
+
};
|
|
13353
|
+
}, [captureState, start, stop]);
|
|
13283
13354
|
var onCustomerMatchedCallback = useCallback(function (resp, req) {
|
|
13284
13355
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
13285
13356
|
return __generator(this, function (_a) {
|
|
@@ -13302,9 +13373,9 @@ var CustomerIdentificationWizard = function CustomerIdentificationWizard(_a) {
|
|
|
13302
13373
|
setCaptureState('FAILED');
|
|
13303
13374
|
onCaptureGuidanceTimeout === null || onCaptureGuidanceTimeout === void 0 ? void 0 : onCaptureGuidanceTimeout();
|
|
13304
13375
|
}, [onCaptureGuidanceTimeout]);
|
|
13305
|
-
var
|
|
13306
|
-
attempt =
|
|
13307
|
-
setAttempt =
|
|
13376
|
+
var _p = useState(0),
|
|
13377
|
+
attempt = _p[0],
|
|
13378
|
+
setAttempt = _p[1];
|
|
13308
13379
|
var onExitCallback = useCallback(function () {
|
|
13309
13380
|
setAttempt(function (n) {
|
|
13310
13381
|
return n + 1;
|
|
@@ -13476,6 +13547,7 @@ var CustomerIdentification = function CustomerIdentification(_a) {
|
|
|
13476
13547
|
onCameraAccessDenied: onCameraAccessDenied,
|
|
13477
13548
|
debugMode: debugMode
|
|
13478
13549
|
}, /*#__PURE__*/React__default.createElement(SelfieGuidanceModelsProvider, {
|
|
13550
|
+
autoStart: false,
|
|
13479
13551
|
modelLoadTimeoutMs: modelLoadTimeoutMs,
|
|
13480
13552
|
onModelError: onModelError
|
|
13481
13553
|
}, /*#__PURE__*/React__default.createElement(CustomerIdentificationWizard, {
|
|
@@ -13660,28 +13732,30 @@ var VideoIdValidation = function VideoIdValidation(_a) {
|
|
|
13660
13732
|
disableFaceDetectionWhileAudioCaptureMsDelay = _w === void 0 ? 2000 : _w,
|
|
13661
13733
|
_x = _a.silentFallback,
|
|
13662
13734
|
silentFallback = _x === void 0 ? false : _x,
|
|
13663
|
-
_y = _a.
|
|
13664
|
-
|
|
13665
|
-
_z = _a.
|
|
13666
|
-
|
|
13667
|
-
_0 = _a.
|
|
13668
|
-
|
|
13669
|
-
_1 = _a.
|
|
13670
|
-
|
|
13671
|
-
_2 = _a.
|
|
13672
|
-
|
|
13673
|
-
_3 = _a.
|
|
13674
|
-
|
|
13675
|
-
_4 = _a.
|
|
13676
|
-
|
|
13677
|
-
_5 = _a.
|
|
13678
|
-
|
|
13679
|
-
_6 = _a.
|
|
13680
|
-
|
|
13681
|
-
_7 = _a.
|
|
13682
|
-
|
|
13683
|
-
_8 = _a.
|
|
13684
|
-
|
|
13735
|
+
_y = _a.mergeAVStreams,
|
|
13736
|
+
mergeAVStreams = _y === void 0 ? false : _y,
|
|
13737
|
+
_z = _a.theme,
|
|
13738
|
+
theme = _z === void 0 ? 'default' : _z,
|
|
13739
|
+
_0 = _a.assets,
|
|
13740
|
+
assets = _0 === void 0 ? {} : _0,
|
|
13741
|
+
_1 = _a.classNames,
|
|
13742
|
+
classNames = _1 === void 0 ? {} : _1,
|
|
13743
|
+
_2 = _a.colors,
|
|
13744
|
+
colors = _2 === void 0 ? {} : _2,
|
|
13745
|
+
_3 = _a.verbiage,
|
|
13746
|
+
verbiage = _3 === void 0 ? {} : _3,
|
|
13747
|
+
_4 = _a.captureSignature,
|
|
13748
|
+
captureSignature = _4 === void 0 ? false : _4,
|
|
13749
|
+
_5 = _a.captureSignatureVideo,
|
|
13750
|
+
captureSignatureVideo = _5 === void 0 ? false : _5,
|
|
13751
|
+
_6 = _a.captureAdditionalDocuments,
|
|
13752
|
+
captureAdditionalDocuments = _6 === void 0 ? [] : _6,
|
|
13753
|
+
_7 = _a.geolocationEnabled,
|
|
13754
|
+
geolocationEnabled = _7 === void 0 ? true : _7,
|
|
13755
|
+
_8 = _a.geolocationRequired,
|
|
13756
|
+
geolocationRequired = _8 === void 0 ? false : _8,
|
|
13757
|
+
_9 = _a.debugMode,
|
|
13758
|
+
debugMode = _9 === void 0 ? false : _9;
|
|
13685
13759
|
useLanguage(lang);
|
|
13686
13760
|
useDebugLogging(debugMode);
|
|
13687
13761
|
var videoIdCaptureProps = useMemo(function () {
|
|
@@ -13712,13 +13786,14 @@ var VideoIdValidation = function VideoIdValidation(_a) {
|
|
|
13712
13786
|
disableFaceDetectionWhileAudioCapture: disableFaceDetectionWhileAudioCapture,
|
|
13713
13787
|
disableFaceDetectionWhileAudioCaptureMsDelay: disableFaceDetectionWhileAudioCaptureMsDelay,
|
|
13714
13788
|
silentFallback: silentFallback,
|
|
13789
|
+
mergeAVStreams: mergeAVStreams,
|
|
13715
13790
|
assets: assets,
|
|
13716
13791
|
classNames: classNames,
|
|
13717
13792
|
colors: colors,
|
|
13718
13793
|
verbiage: verbiage,
|
|
13719
13794
|
debugMode: debugMode
|
|
13720
13795
|
};
|
|
13721
|
-
}, [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]);
|
|
13796
|
+
}, [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]);
|
|
13722
13797
|
var additionalDocumentCaptureProps = useMemo(function () {
|
|
13723
13798
|
return {
|
|
13724
13799
|
documents: captureAdditionalDocuments,
|