@trustchex/react-native-sdk 1.362.4 → 1.374.0
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/TrustchexSDK.podspec +3 -3
- package/android/build.gradle +3 -3
- package/android/src/main/java/com/trustchex/reactnativesdk/camera/TrustchexCameraView.kt +71 -17
- package/ios/Camera/TrustchexCameraView.swift +166 -119
- package/lib/module/Shared/Components/FaceCamera.js +1 -0
- package/lib/module/Shared/Components/IdentityDocumentCamera.js +344 -207
- package/lib/module/Shared/Components/QrCodeScannerCamera.js +1 -8
- package/lib/module/Shared/Libs/mrz.utils.js +202 -9
- package/lib/module/Translation/Resources/en.js +0 -4
- package/lib/module/Translation/Resources/tr.js +0 -4
- package/lib/module/version.js +1 -1
- package/lib/typescript/src/Shared/Components/FaceCamera.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/QrCodeScannerCamera.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/TrustchexCamera.d.ts +1 -0
- package/lib/typescript/src/Shared/Components/TrustchexCamera.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Libs/mrz.utils.d.ts +8 -0
- package/lib/typescript/src/Shared/Libs/mrz.utils.d.ts.map +1 -1
- package/lib/typescript/src/Translation/Resources/en.d.ts +0 -4
- package/lib/typescript/src/Translation/Resources/en.d.ts.map +1 -1
- package/lib/typescript/src/Translation/Resources/tr.d.ts +0 -4
- package/lib/typescript/src/Translation/Resources/tr.d.ts.map +1 -1
- package/lib/typescript/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/Shared/Components/FaceCamera.tsx +1 -0
- package/src/Shared/Components/IdentityDocumentCamera.tsx +443 -265
- package/src/Shared/Components/QrCodeScannerCamera.tsx +1 -9
- package/src/Shared/Components/TrustchexCamera.tsx +1 -0
- package/src/Shared/Libs/mrz.utils.ts +238 -26
- package/src/Translation/Resources/en.ts +0 -4
- package/src/Translation/Resources/tr.ts +0 -4
- package/src/version.ts +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
/* eslint-disable react-native/no-inline-styles */
|
|
4
4
|
import React, { useEffect, useState, useRef, useCallback } from 'react';
|
|
5
|
-
import { View, StyleSheet, Text as TextView, Platform, StatusBar, Vibration, Linking, Image, ActivityIndicator, PermissionsAndroid, Dimensions, ScrollView } from 'react-native';
|
|
5
|
+
import { View, StyleSheet, Text as TextView, Platform, StatusBar, Vibration, Linking, Image, ActivityIndicator, PermissionsAndroid, Dimensions, ScrollView, Animated } from 'react-native';
|
|
6
6
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
7
7
|
import { TrustchexCamera } from "./TrustchexCamera.js";
|
|
8
8
|
import { NativeModules } from 'react-native';
|
|
@@ -21,10 +21,10 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
21
21
|
const {
|
|
22
22
|
OpenCVModule
|
|
23
23
|
} = NativeModules;
|
|
24
|
+
const AnimatedText = Animated.createAnimatedComponent(TextView);
|
|
24
25
|
const HOLOGRAM_IMAGE_COUNT = 12;
|
|
25
26
|
const HOLOGRAM_DETECTION_THRESHOLD = 1000; // Lowered for better sensitivity while still filtering noise
|
|
26
27
|
const HOLOGRAM_DETECTION_RETRY_COUNT = 3; // More attempts but faster each (~1s per attempt)
|
|
27
|
-
const SECOND_FACE_DETECTION_RETRY_COUNT = 10;
|
|
28
28
|
const MIN_BRIGHTNESS_THRESHOLD = 45;
|
|
29
29
|
const MAX_CONSECUTIVE_QUALITY_FAILURES = 30;
|
|
30
30
|
const IdentityDocumentCamera = ({
|
|
@@ -86,6 +86,9 @@ const IdentityDocumentCamera = ({
|
|
|
86
86
|
// Barcode caching - persist detected barcode across frames for reliability
|
|
87
87
|
const cachedBarcode = useRef(null);
|
|
88
88
|
|
|
89
|
+
// Error message flash animation
|
|
90
|
+
const errorFlashAnim = useRef(new Animated.Value(1)).current;
|
|
91
|
+
|
|
89
92
|
// Test mode tracking
|
|
90
93
|
const [testModeData, setTestModeData] = useState(null);
|
|
91
94
|
|
|
@@ -222,10 +225,10 @@ const IdentityDocumentCamera = ({
|
|
|
222
225
|
if (hasGuideShown) {
|
|
223
226
|
// Generate message - match UI display logic exactly for consistency
|
|
224
227
|
let message = '';
|
|
225
|
-
if (
|
|
226
|
-
message =
|
|
228
|
+
if (nextStep === 'COMPLETED') {
|
|
229
|
+
message = t('identityDocumentCamera.scanCompleted');
|
|
227
230
|
} else if (status === 'INCORRECT') {
|
|
228
|
-
message = nextStep === 'SCAN_ID_FRONT_OR_PASSPORT' ? t('identityDocumentCamera.
|
|
231
|
+
message = nextStep === 'SCAN_ID_FRONT_OR_PASSPORT' ? t('identityDocumentCamera.alignIDFront') : nextStep === 'SCAN_ID_BACK' ? t('identityDocumentCamera.alignIDBack') : nextStep === 'SCAN_HOLOGRAM' ? t('identityDocumentCamera.alignIDFront') : t('identityDocumentCamera.alignPhotoSide');
|
|
229
232
|
} else if (isBrightnessLow) {
|
|
230
233
|
message = t('identityDocumentCamera.lowBrightness');
|
|
231
234
|
} else if (isFrameBlurry) {
|
|
@@ -263,6 +266,22 @@ const IdentityDocumentCamera = ({
|
|
|
263
266
|
}
|
|
264
267
|
}, [nextStep]);
|
|
265
268
|
|
|
269
|
+
// Error flash animation - flash red text when wrong side detected
|
|
270
|
+
useEffect(() => {
|
|
271
|
+
if (status === 'INCORRECT') {
|
|
272
|
+
errorFlashAnim.setValue(1);
|
|
273
|
+
Animated.loop(Animated.sequence([Animated.timing(errorFlashAnim, {
|
|
274
|
+
toValue: 0.3,
|
|
275
|
+
duration: 300,
|
|
276
|
+
useNativeDriver: false
|
|
277
|
+
}), Animated.timing(errorFlashAnim, {
|
|
278
|
+
toValue: 1,
|
|
279
|
+
duration: 300,
|
|
280
|
+
useNativeDriver: false
|
|
281
|
+
})])).start();
|
|
282
|
+
}
|
|
283
|
+
}, [status, errorFlashAnim]);
|
|
284
|
+
|
|
266
285
|
// Native OpenCV: detect hologram from sequence of face images
|
|
267
286
|
const detectHologramNative = useCallback(async images => {
|
|
268
287
|
try {
|
|
@@ -1201,7 +1220,7 @@ const IdentityDocumentCamera = ({
|
|
|
1201
1220
|
}
|
|
1202
1221
|
setStatus('SCANNING');
|
|
1203
1222
|
}
|
|
1204
|
-
}, [nextStep, frameDimensions, currentHologramImage, currentFaceImage, hasRequiredMRZFields, areMRZFieldsEqual,
|
|
1223
|
+
}, [nextStep, frameDimensions, currentHologramImage, detectedDocumentType, currentFaceImage, testMode, hasRequiredMRZFields, areMRZFieldsEqual, onlyMRZScan, isTorchOn, setIsTorchOn, setNextStepAndVibrate, onIdentityDocumentScanned, logMRZDetails, logMRZValidationFailure, currentSecondaryFaceImage, detectHologramNative]);
|
|
1205
1224
|
const handleFrame = useCallback(async event => {
|
|
1206
1225
|
if (!isCameraInitialized.current) {
|
|
1207
1226
|
return;
|
|
@@ -2158,174 +2177,35 @@ const IdentityDocumentCamera = ({
|
|
|
2158
2177
|
current: 3,
|
|
2159
2178
|
total: 3
|
|
2160
2179
|
})}` : ''
|
|
2161
|
-
}), /*#__PURE__*/_jsx(
|
|
2180
|
+
}), /*#__PURE__*/_jsx(AnimatedText, {
|
|
2162
2181
|
style: [styles.topZoneText,
|
|
2163
2182
|
// Priority order for coloring (later styles override earlier ones)
|
|
2164
2183
|
// 1. Success (green) - scan completed
|
|
2165
|
-
|
|
2166
|
-
// 2. Error (red) - wrong side
|
|
2167
|
-
status === 'INCORRECT' && styles.topZoneTextError,
|
|
2184
|
+
nextStep === 'COMPLETED' && styles.topZoneTextSuccess,
|
|
2185
|
+
// 2. Error (red) - wrong side - with flash opacity
|
|
2186
|
+
status === 'INCORRECT' && styles.topZoneTextError, status === 'INCORRECT' && {
|
|
2187
|
+
opacity: errorFlashAnim
|
|
2188
|
+
},
|
|
2168
2189
|
// 3. Warning (yellow) - quality issues
|
|
2169
2190
|
(isBrightnessLow || isFrameBlurry) && styles.topZoneTextWarning,
|
|
2170
2191
|
// 4. Scanning (green) - all elements detected AND inside scan area
|
|
2171
2192
|
status === 'SCANNING' && allElementsDetected && elementsOutsideScanArea.length === 0 && !isBrightnessLow && !isFrameBlurry && styles.topZoneTextScanning
|
|
2172
2193
|
// 5. Default (white) - aligning (not all detected OR elements outside scan area)
|
|
2173
2194
|
],
|
|
2174
|
-
children: status === '
|
|
2175
|
-
: t('identityDocumentCamera.alignPhotoSide') : isBrightnessLow ? t('identityDocumentCamera.lowBrightness') : isFrameBlurry ? t('identityDocumentCamera.avoidBlur') : status === 'SCANNING' && allElementsDetected && elementsOutsideScanArea.length === 0 ? nextStep === 'SCAN_ID_BACK' ? t('identityDocumentCamera.idCardBackDetected') : detectedDocumentType === 'PASSPORT' ? t('identityDocumentCamera.passportDetected') : detectedDocumentType === 'ID_FRONT' ? t('identityDocumentCamera.idCardFrontDetected') : nextStep === 'SCAN_HOLOGRAM' ? t('identityDocumentCamera.alignHologram') : t('identityDocumentCamera.readingDocument') : elementsOutsideScanArea.length > 0 ? t('identityDocumentCamera.centerDocument') : (status === 'SCANNING' || status === 'SEARCHING') && !allElementsDetected ? nextStep === 'SCAN_ID_BACK' ? t('identityDocumentCamera.alignIDBack') : nextStep === 'SCAN_ID_FRONT_OR_PASSPORT' ? detectedDocumentType === 'PASSPORT' ? t('identityDocumentCamera.alignPassport') : detectedDocumentType === 'ID_FRONT' ? t('identityDocumentCamera.alignIDFront') : t('identityDocumentCamera.alignPhotoSide') : nextStep === 'SCAN_HOLOGRAM' ? t('identityDocumentCamera.alignHologram') : t('identityDocumentCamera.readingDocument') : nextStep === 'SCAN_ID_FRONT_OR_PASSPORT' ? status === 'SCANNING' ? t('identityDocumentCamera.readingDocument') : t('identityDocumentCamera.alignPhotoSide') : nextStep === 'SCAN_HOLOGRAM' ? t('identityDocumentCamera.alignHologram') : nextStep === 'SCAN_ID_BACK' ? status === 'SCANNING' ? t('identityDocumentCamera.readingDocument') : t('identityDocumentCamera.alignIDBackSide') : nextStep === 'COMPLETED' ? t('identityDocumentCamera.scanCompleted') : ''
|
|
2195
|
+
children: nextStep === 'COMPLETED' ? t('identityDocumentCamera.scanCompleted') : status === 'INCORRECT' ? nextStep === 'SCAN_ID_FRONT_OR_PASSPORT' ? t('identityDocumentCamera.alignIDFront') : nextStep === 'SCAN_ID_BACK' ? t('identityDocumentCamera.alignIDBack') : nextStep === 'SCAN_HOLOGRAM' ? t('identityDocumentCamera.alignIDFront') : t('identityDocumentCamera.alignPhotoSide') : isBrightnessLow ? t('identityDocumentCamera.lowBrightness') : isFrameBlurry ? t('identityDocumentCamera.avoidBlur') : status === 'SCANNING' && allElementsDetected && elementsOutsideScanArea.length === 0 ? nextStep === 'SCAN_ID_BACK' ? t('identityDocumentCamera.idCardBackDetected') : detectedDocumentType === 'PASSPORT' ? t('identityDocumentCamera.passportDetected') : detectedDocumentType === 'ID_FRONT' ? t('identityDocumentCamera.idCardFrontDetected') : nextStep === 'SCAN_HOLOGRAM' ? t('identityDocumentCamera.alignHologram') : t('identityDocumentCamera.readingDocument') : elementsOutsideScanArea.length > 0 ? t('identityDocumentCamera.centerDocument') : (status === 'SCANNING' || status === 'SEARCHING') && !allElementsDetected ? nextStep === 'SCAN_ID_BACK' ? t('identityDocumentCamera.alignIDBack') : nextStep === 'SCAN_ID_FRONT_OR_PASSPORT' ? detectedDocumentType === 'PASSPORT' ? t('identityDocumentCamera.alignPassport') : detectedDocumentType === 'ID_FRONT' ? t('identityDocumentCamera.alignIDFront') : t('identityDocumentCamera.alignPhotoSide') : nextStep === 'SCAN_HOLOGRAM' ? t('identityDocumentCamera.alignHologram') : t('identityDocumentCamera.readingDocument') : nextStep === 'SCAN_ID_FRONT_OR_PASSPORT' ? status === 'SCANNING' ? t('identityDocumentCamera.readingDocument') : t('identityDocumentCamera.alignPhotoSide') : nextStep === 'SCAN_HOLOGRAM' ? t('identityDocumentCamera.alignHologram') : nextStep === 'SCAN_ID_BACK' ? status === 'SCANNING' ? t('identityDocumentCamera.readingDocument') : t('identityDocumentCamera.alignIDBackSide') : nextStep === 'COMPLETED' ? t('identityDocumentCamera.scanCompleted') : ''
|
|
2176
2196
|
})]
|
|
2177
2197
|
}), /*#__PURE__*/_jsx(View, {
|
|
2178
2198
|
style: styles.leftZone
|
|
2179
2199
|
}), /*#__PURE__*/_jsx(View, {
|
|
2180
2200
|
style: styles.rightZone
|
|
2181
2201
|
}), /*#__PURE__*/_jsx(View, {
|
|
2182
|
-
style: styles.bottomZone
|
|
2183
|
-
children: /*#__PURE__*/_jsxs(View, {
|
|
2184
|
-
style: styles.debugImagesRow,
|
|
2185
|
-
children: [isDebugEnabled() && /*#__PURE__*/_jsxs(View, {
|
|
2186
|
-
style: styles.imageContainer,
|
|
2187
|
-
children: [currentFaceImage ? /*#__PURE__*/_jsx(Image, {
|
|
2188
|
-
source: {
|
|
2189
|
-
uri: `data:image/jpeg;base64,${currentFaceImage}`
|
|
2190
|
-
},
|
|
2191
|
-
style: styles.faceImage
|
|
2192
|
-
}) : /*#__PURE__*/_jsx(View, {
|
|
2193
|
-
style: [styles.faceImage, {
|
|
2194
|
-
backgroundColor: '#333',
|
|
2195
|
-
justifyContent: 'center'
|
|
2196
|
-
}],
|
|
2197
|
-
children: /*#__PURE__*/_jsx(TextView, {
|
|
2198
|
-
style: {
|
|
2199
|
-
color: '#666',
|
|
2200
|
-
fontSize: 10,
|
|
2201
|
-
textAlign: 'center'
|
|
2202
|
-
},
|
|
2203
|
-
children: "Waiting..."
|
|
2204
|
-
})
|
|
2205
|
-
}), /*#__PURE__*/_jsx(TextView, {
|
|
2206
|
-
style: [styles.imageContainerText, currentFaceImage && {
|
|
2207
|
-
color: '#4CAF50'
|
|
2208
|
-
}],
|
|
2209
|
-
children: `${currentFaceImage ? '✓ ' : ''}Face`
|
|
2210
|
-
})]
|
|
2211
|
-
}), isDebugEnabled() && /*#__PURE__*/_jsxs(View, {
|
|
2212
|
-
style: styles.imageContainer,
|
|
2213
|
-
children: [currentSecondaryFaceImage ? /*#__PURE__*/_jsx(Image, {
|
|
2214
|
-
source: {
|
|
2215
|
-
uri: `data:image/jpeg;base64,${currentSecondaryFaceImage}`
|
|
2216
|
-
},
|
|
2217
|
-
style: styles.faceImage
|
|
2218
|
-
}) : /*#__PURE__*/_jsx(View, {
|
|
2219
|
-
style: [styles.faceImage, {
|
|
2220
|
-
backgroundColor: '#333',
|
|
2221
|
-
justifyContent: 'center'
|
|
2222
|
-
}],
|
|
2223
|
-
children: /*#__PURE__*/_jsx(TextView, {
|
|
2224
|
-
style: {
|
|
2225
|
-
color: '#666',
|
|
2226
|
-
fontSize: 10,
|
|
2227
|
-
textAlign: 'center'
|
|
2228
|
-
},
|
|
2229
|
-
children: "Waiting..."
|
|
2230
|
-
})
|
|
2231
|
-
}), /*#__PURE__*/_jsx(TextView, {
|
|
2232
|
-
style: [styles.imageContainerText, currentSecondaryFaceImage && {
|
|
2233
|
-
color: '#4CAF50'
|
|
2234
|
-
}],
|
|
2235
|
-
children: `${currentSecondaryFaceImage ? '✓ ' : ''}2nd Face`
|
|
2236
|
-
})]
|
|
2237
|
-
}), isDebugEnabled() && /*#__PURE__*/_jsxs(View, {
|
|
2238
|
-
style: styles.imageContainer,
|
|
2239
|
-
children: [currentHologramImage ? /*#__PURE__*/_jsx(Image, {
|
|
2240
|
-
source: {
|
|
2241
|
-
uri: `data:image/jpeg;base64,${currentHologramImage}`
|
|
2242
|
-
},
|
|
2243
|
-
style: styles.faceImage
|
|
2244
|
-
}) : latestHologramFaceImage && hologramImageCount > 0 ? /*#__PURE__*/_jsxs(View, {
|
|
2245
|
-
style: {
|
|
2246
|
-
position: 'relative'
|
|
2247
|
-
},
|
|
2248
|
-
children: [/*#__PURE__*/_jsx(Image, {
|
|
2249
|
-
source: {
|
|
2250
|
-
uri: `data:image/jpeg;base64,${latestHologramFaceImage}`
|
|
2251
|
-
},
|
|
2252
|
-
style: [styles.faceImage, {
|
|
2253
|
-
opacity: 0.7
|
|
2254
|
-
}]
|
|
2255
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
2256
|
-
style: {
|
|
2257
|
-
position: 'absolute',
|
|
2258
|
-
bottom: 0,
|
|
2259
|
-
left: 0,
|
|
2260
|
-
right: 0,
|
|
2261
|
-
backgroundColor: 'rgba(0,0,0,0.7)',
|
|
2262
|
-
padding: 2
|
|
2263
|
-
},
|
|
2264
|
-
children: /*#__PURE__*/_jsxs(TextView, {
|
|
2265
|
-
style: {
|
|
2266
|
-
color: '#FFA500',
|
|
2267
|
-
fontSize: 8,
|
|
2268
|
-
textAlign: 'center',
|
|
2269
|
-
fontWeight: 'bold'
|
|
2270
|
-
},
|
|
2271
|
-
children: [hologramImageCount, "/", HOLOGRAM_IMAGE_COUNT]
|
|
2272
|
-
})
|
|
2273
|
-
})]
|
|
2274
|
-
}) : /*#__PURE__*/_jsx(View, {
|
|
2275
|
-
style: [styles.faceImage, {
|
|
2276
|
-
backgroundColor: '#333',
|
|
2277
|
-
justifyContent: 'center'
|
|
2278
|
-
}],
|
|
2279
|
-
children: /*#__PURE__*/_jsx(TextView, {
|
|
2280
|
-
style: {
|
|
2281
|
-
color: '#666',
|
|
2282
|
-
fontSize: 10,
|
|
2283
|
-
textAlign: 'center'
|
|
2284
|
-
},
|
|
2285
|
-
children: "Waiting..."
|
|
2286
|
-
})
|
|
2287
|
-
}), /*#__PURE__*/_jsx(TextView, {
|
|
2288
|
-
style: [styles.imageContainerText, currentHologramImage && {
|
|
2289
|
-
color: '#4CAF50'
|
|
2290
|
-
}, latestHologramFaceImage && !currentHologramImage && {
|
|
2291
|
-
color: '#FFA500'
|
|
2292
|
-
}],
|
|
2293
|
-
children: `${currentHologramImage ? '✓ ' : latestHologramFaceImage ? '⏳ ' : ''}Hologram`
|
|
2294
|
-
})]
|
|
2295
|
-
}), isDebugEnabled() && /*#__PURE__*/_jsxs(View, {
|
|
2296
|
-
style: styles.imageContainer,
|
|
2297
|
-
children: [_currentHologramMaskImage ? /*#__PURE__*/_jsx(Image, {
|
|
2298
|
-
source: {
|
|
2299
|
-
uri: `data:image/jpeg;base64,${_currentHologramMaskImage}`
|
|
2300
|
-
},
|
|
2301
|
-
style: styles.faceImage
|
|
2302
|
-
}) : /*#__PURE__*/_jsx(View, {
|
|
2303
|
-
style: [styles.faceImage, {
|
|
2304
|
-
backgroundColor: '#333',
|
|
2305
|
-
justifyContent: 'center'
|
|
2306
|
-
}],
|
|
2307
|
-
children: /*#__PURE__*/_jsx(TextView, {
|
|
2308
|
-
style: {
|
|
2309
|
-
color: '#666',
|
|
2310
|
-
fontSize: 10,
|
|
2311
|
-
textAlign: 'center'
|
|
2312
|
-
},
|
|
2313
|
-
children: "Waiting..."
|
|
2314
|
-
})
|
|
2315
|
-
}), /*#__PURE__*/_jsx(TextView, {
|
|
2316
|
-
style: [styles.imageContainerText, _currentHologramMaskImage && {
|
|
2317
|
-
color: '#4CAF50'
|
|
2318
|
-
}],
|
|
2319
|
-
children: `${_currentHologramMaskImage ? '✓ ' : ''}Mask`
|
|
2320
|
-
})]
|
|
2321
|
-
})]
|
|
2322
|
-
})
|
|
2202
|
+
style: styles.bottomZone
|
|
2323
2203
|
}), /*#__PURE__*/_jsx(View, {
|
|
2324
2204
|
style: [styles.scanArea, {
|
|
2325
|
-
borderColor:
|
|
2205
|
+
borderColor: nextStep === 'COMPLETED' ? '#4CAF50' : status === 'INCORRECT' ? '#f44336' : status === 'SCANNING' ? '#2196F3' : isBrightnessLow || isFrameBlurry ? '#FFC107' : 'white',
|
|
2326
2206
|
borderWidth: status === 'SCANNING' ? 3 : 2
|
|
2327
2207
|
}],
|
|
2328
|
-
children: nextStep === 'COMPLETED'
|
|
2208
|
+
children: nextStep === 'COMPLETED' ? /*#__PURE__*/_jsx(LottieView, {
|
|
2329
2209
|
source: require('../../Shared/Animations/success.json'),
|
|
2330
2210
|
style: styles.animation,
|
|
2331
2211
|
loop: false,
|
|
@@ -2340,11 +2220,6 @@ const IdentityDocumentCamera = ({
|
|
|
2340
2220
|
style: styles.animation,
|
|
2341
2221
|
loop: true,
|
|
2342
2222
|
autoPlay: true
|
|
2343
|
-
}) : status === 'SCANNING' ? /*#__PURE__*/_jsx(LottieView, {
|
|
2344
|
-
source: require('../../Shared/Animations/scanning.json'),
|
|
2345
|
-
style: styles.animation,
|
|
2346
|
-
loop: true,
|
|
2347
|
-
autoPlay: true
|
|
2348
2223
|
}) : null
|
|
2349
2224
|
}), isDebugEnabled() && /*#__PURE__*/_jsx(SafeAreaView, {
|
|
2350
2225
|
style: {
|
|
@@ -2357,71 +2232,333 @@ const IdentityDocumentCamera = ({
|
|
|
2357
2232
|
},
|
|
2358
2233
|
children: /*#__PURE__*/_jsxs(View, {
|
|
2359
2234
|
style: {
|
|
2360
|
-
marginTop:
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2235
|
+
marginTop: 8,
|
|
2236
|
+
marginHorizontal: 8,
|
|
2237
|
+
backgroundColor: 'rgba(0, 0, 0, 0.9)',
|
|
2238
|
+
padding: 8,
|
|
2239
|
+
borderRadius: 6,
|
|
2364
2240
|
borderWidth: 1,
|
|
2365
|
-
borderColor: '
|
|
2366
|
-
minWidth:
|
|
2241
|
+
borderColor: 'rgba(255, 82, 82, 0.5)',
|
|
2242
|
+
minWidth: 220,
|
|
2243
|
+
maxWidth: '92%'
|
|
2367
2244
|
},
|
|
2368
|
-
children: [/*#__PURE__*/
|
|
2245
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
2369
2246
|
style: {
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
marginBottom: 6,
|
|
2374
|
-
textAlign: 'center'
|
|
2247
|
+
flexDirection: 'row',
|
|
2248
|
+
justifyContent: 'space-between',
|
|
2249
|
+
marginBottom: 4
|
|
2375
2250
|
},
|
|
2376
|
-
children:
|
|
2377
|
-
|
|
2251
|
+
children: [/*#__PURE__*/_jsx(TextView, {
|
|
2252
|
+
style: {
|
|
2253
|
+
color: '#88D8B0',
|
|
2254
|
+
fontSize: 10,
|
|
2255
|
+
fontWeight: 'bold'
|
|
2256
|
+
},
|
|
2257
|
+
children: `Status: ${status}`
|
|
2258
|
+
}), /*#__PURE__*/_jsx(TextView, {
|
|
2259
|
+
style: {
|
|
2260
|
+
color: '#FFEB3B',
|
|
2261
|
+
fontSize: 10,
|
|
2262
|
+
fontWeight: 'bold'
|
|
2263
|
+
},
|
|
2264
|
+
children: `Step: ${nextStep}`
|
|
2265
|
+
})]
|
|
2266
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
2378
2267
|
style: {
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
marginBottom:
|
|
2268
|
+
flexDirection: 'row',
|
|
2269
|
+
justifyContent: 'space-between',
|
|
2270
|
+
marginBottom: 4,
|
|
2271
|
+
gap: 3
|
|
2382
2272
|
},
|
|
2383
|
-
children:
|
|
2273
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
2274
|
+
style: {
|
|
2275
|
+
backgroundColor: isBrightnessLow ? '#f44336' : '#4CAF50',
|
|
2276
|
+
paddingHorizontal: 6,
|
|
2277
|
+
paddingVertical: 1,
|
|
2278
|
+
borderRadius: 3
|
|
2279
|
+
},
|
|
2280
|
+
children: /*#__PURE__*/_jsx(TextView, {
|
|
2281
|
+
style: {
|
|
2282
|
+
color: '#FFFFFF',
|
|
2283
|
+
fontSize: 8,
|
|
2284
|
+
fontWeight: 'bold'
|
|
2285
|
+
},
|
|
2286
|
+
children: isBrightnessLow ? 'Low Light' : 'Good Light'
|
|
2287
|
+
})
|
|
2288
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
2289
|
+
style: {
|
|
2290
|
+
backgroundColor: isFrameBlurry ? '#f44336' : '#4CAF50',
|
|
2291
|
+
paddingHorizontal: 6,
|
|
2292
|
+
paddingVertical: 1,
|
|
2293
|
+
borderRadius: 3
|
|
2294
|
+
},
|
|
2295
|
+
children: /*#__PURE__*/_jsx(TextView, {
|
|
2296
|
+
style: {
|
|
2297
|
+
color: '#FFFFFF',
|
|
2298
|
+
fontSize: 8,
|
|
2299
|
+
fontWeight: 'bold'
|
|
2300
|
+
},
|
|
2301
|
+
children: isFrameBlurry ? 'Blurry' : 'Sharp'
|
|
2302
|
+
})
|
|
2303
|
+
})]
|
|
2384
2304
|
}), /*#__PURE__*/_jsx(TextView, {
|
|
2385
2305
|
style: {
|
|
2386
|
-
color: '#
|
|
2387
|
-
fontSize:
|
|
2388
|
-
marginBottom:
|
|
2306
|
+
color: elementsOutsideScanArea.length === 0 ? '#4CAF50' : '#FFA500',
|
|
2307
|
+
fontSize: 8,
|
|
2308
|
+
marginBottom: 3
|
|
2389
2309
|
},
|
|
2390
|
-
children: `
|
|
2310
|
+
children: elementsOutsideScanArea.length === 0 ? 'All elements in frame' : `Outside: ${elementsOutsideScanArea.join(', ')}`
|
|
2391
2311
|
}), /*#__PURE__*/_jsx(TextView, {
|
|
2392
2312
|
style: {
|
|
2393
|
-
color: '
|
|
2394
|
-
fontSize:
|
|
2395
|
-
marginBottom:
|
|
2313
|
+
color: 'rgba(255, 255, 255, 0.7)',
|
|
2314
|
+
fontSize: 8,
|
|
2315
|
+
marginBottom: 3
|
|
2396
2316
|
},
|
|
2397
|
-
children: `
|
|
2398
|
-
}), /*#__PURE__*/_jsx(TextView, {
|
|
2317
|
+
children: `Face: ${documentPlaneBounds ? '✓' : '✗'}, MRZ: ${mrzBounds ? '✓' : '✗'}, Sig: ${signatureBounds ? '✓' : '✗'}`
|
|
2318
|
+
}), nextStep === 'SCAN_HOLOGRAM' && hologramImageCount > 0 && /*#__PURE__*/_jsx(TextView, {
|
|
2399
2319
|
style: {
|
|
2400
|
-
color: '#
|
|
2401
|
-
fontSize:
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
children: `Brightness: ${isBrightnessLow ? '⚠️ LOW' : '✓'}`
|
|
2405
|
-
}), /*#__PURE__*/_jsx(TextView, {
|
|
2406
|
-
style: {
|
|
2407
|
-
color: '#88D8B0',
|
|
2408
|
-
fontSize: 9,
|
|
2409
|
-
marginBottom: 2
|
|
2320
|
+
color: '#9C27B0',
|
|
2321
|
+
fontSize: 8,
|
|
2322
|
+
fontWeight: 'bold',
|
|
2323
|
+
marginBottom: 3
|
|
2410
2324
|
},
|
|
2411
|
-
children: `
|
|
2412
|
-
}), /*#__PURE__*/
|
|
2325
|
+
children: `Hologram: ${hologramImageCount}/${HOLOGRAM_IMAGE_COUNT}`
|
|
2326
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
2413
2327
|
style: {
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2328
|
+
flexDirection: 'row',
|
|
2329
|
+
gap: 8,
|
|
2330
|
+
paddingTop: 3,
|
|
2331
|
+
borderTopWidth: 1,
|
|
2332
|
+
borderTopColor: 'rgba(255, 255, 255, 0.2)',
|
|
2333
|
+
marginBottom: 4
|
|
2417
2334
|
},
|
|
2418
|
-
children:
|
|
2419
|
-
|
|
2335
|
+
children: [/*#__PURE__*/_jsx(TextView, {
|
|
2336
|
+
style: {
|
|
2337
|
+
color: 'rgba(255, 255, 255, 0.7)',
|
|
2338
|
+
fontSize: 8,
|
|
2339
|
+
marginTop: 3
|
|
2340
|
+
},
|
|
2341
|
+
children: `Doc: ${detectedDocumentType}`
|
|
2342
|
+
}), /*#__PURE__*/_jsx(TextView, {
|
|
2343
|
+
style: {
|
|
2344
|
+
color: 'rgba(255, 255, 255, 0.7)',
|
|
2345
|
+
fontSize: 8,
|
|
2346
|
+
marginTop: 3
|
|
2347
|
+
},
|
|
2348
|
+
children: `Flash: ${isTorchOn ? '🔦' : '○'}`
|
|
2349
|
+
})]
|
|
2350
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
2420
2351
|
style: {
|
|
2421
|
-
|
|
2422
|
-
|
|
2352
|
+
flexDirection: 'row',
|
|
2353
|
+
flexWrap: 'wrap',
|
|
2354
|
+
gap: 4,
|
|
2355
|
+
justifyContent: 'center'
|
|
2423
2356
|
},
|
|
2424
|
-
children:
|
|
2357
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
2358
|
+
style: {
|
|
2359
|
+
alignItems: 'center'
|
|
2360
|
+
},
|
|
2361
|
+
children: [currentFaceImage ? /*#__PURE__*/_jsx(Image, {
|
|
2362
|
+
source: {
|
|
2363
|
+
uri: `data:image/jpeg;base64,${currentFaceImage}`
|
|
2364
|
+
},
|
|
2365
|
+
style: {
|
|
2366
|
+
width: 40,
|
|
2367
|
+
height: 48,
|
|
2368
|
+
borderRadius: 2,
|
|
2369
|
+
borderWidth: 1,
|
|
2370
|
+
borderColor: '#4CAF50'
|
|
2371
|
+
}
|
|
2372
|
+
}) : /*#__PURE__*/_jsx(View, {
|
|
2373
|
+
style: {
|
|
2374
|
+
width: 40,
|
|
2375
|
+
height: 48,
|
|
2376
|
+
borderRadius: 2,
|
|
2377
|
+
borderWidth: 1,
|
|
2378
|
+
borderColor: '#666',
|
|
2379
|
+
backgroundColor: '#222',
|
|
2380
|
+
justifyContent: 'center',
|
|
2381
|
+
alignItems: 'center'
|
|
2382
|
+
},
|
|
2383
|
+
children: /*#__PURE__*/_jsx(TextView, {
|
|
2384
|
+
style: {
|
|
2385
|
+
color: '#666',
|
|
2386
|
+
fontSize: 7
|
|
2387
|
+
},
|
|
2388
|
+
children: "\u2014"
|
|
2389
|
+
})
|
|
2390
|
+
}), /*#__PURE__*/_jsx(TextView, {
|
|
2391
|
+
style: {
|
|
2392
|
+
color: currentFaceImage ? '#4CAF50' : '#999',
|
|
2393
|
+
fontSize: 7,
|
|
2394
|
+
marginTop: 1,
|
|
2395
|
+
fontWeight: 'bold'
|
|
2396
|
+
},
|
|
2397
|
+
children: `${currentFaceImage ? '✓' : '○'} Face`
|
|
2398
|
+
})]
|
|
2399
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
2400
|
+
style: {
|
|
2401
|
+
alignItems: 'center'
|
|
2402
|
+
},
|
|
2403
|
+
children: [currentSecondaryFaceImage ? /*#__PURE__*/_jsx(Image, {
|
|
2404
|
+
source: {
|
|
2405
|
+
uri: `data:image/jpeg;base64,${currentSecondaryFaceImage}`
|
|
2406
|
+
},
|
|
2407
|
+
style: {
|
|
2408
|
+
width: 40,
|
|
2409
|
+
height: 48,
|
|
2410
|
+
borderRadius: 2,
|
|
2411
|
+
borderWidth: 1,
|
|
2412
|
+
borderColor: '#2196F3'
|
|
2413
|
+
}
|
|
2414
|
+
}) : /*#__PURE__*/_jsx(View, {
|
|
2415
|
+
style: {
|
|
2416
|
+
width: 40,
|
|
2417
|
+
height: 48,
|
|
2418
|
+
borderRadius: 2,
|
|
2419
|
+
borderWidth: 1,
|
|
2420
|
+
borderColor: '#666',
|
|
2421
|
+
backgroundColor: '#222',
|
|
2422
|
+
justifyContent: 'center',
|
|
2423
|
+
alignItems: 'center'
|
|
2424
|
+
},
|
|
2425
|
+
children: /*#__PURE__*/_jsx(TextView, {
|
|
2426
|
+
style: {
|
|
2427
|
+
color: '#666',
|
|
2428
|
+
fontSize: 7
|
|
2429
|
+
},
|
|
2430
|
+
children: "\u2014"
|
|
2431
|
+
})
|
|
2432
|
+
}), /*#__PURE__*/_jsx(TextView, {
|
|
2433
|
+
style: {
|
|
2434
|
+
color: currentSecondaryFaceImage ? '#2196F3' : '#999',
|
|
2435
|
+
fontSize: 7,
|
|
2436
|
+
marginTop: 1,
|
|
2437
|
+
fontWeight: 'bold'
|
|
2438
|
+
},
|
|
2439
|
+
children: `${currentSecondaryFaceImage ? '✓' : '○'} 2nd`
|
|
2440
|
+
})]
|
|
2441
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
2442
|
+
style: {
|
|
2443
|
+
alignItems: 'center'
|
|
2444
|
+
},
|
|
2445
|
+
children: [currentHologramImage ? /*#__PURE__*/_jsx(Image, {
|
|
2446
|
+
source: {
|
|
2447
|
+
uri: `data:image/jpeg;base64,${currentHologramImage}`
|
|
2448
|
+
},
|
|
2449
|
+
style: {
|
|
2450
|
+
width: 40,
|
|
2451
|
+
height: 48,
|
|
2452
|
+
borderRadius: 2,
|
|
2453
|
+
borderWidth: 1,
|
|
2454
|
+
borderColor: '#9C27B0'
|
|
2455
|
+
}
|
|
2456
|
+
}) : latestHologramFaceImage && hologramImageCount > 0 ? /*#__PURE__*/_jsxs(View, {
|
|
2457
|
+
style: {
|
|
2458
|
+
position: 'relative'
|
|
2459
|
+
},
|
|
2460
|
+
children: [/*#__PURE__*/_jsx(Image, {
|
|
2461
|
+
source: {
|
|
2462
|
+
uri: `data:image/jpeg;base64,${latestHologramFaceImage}`
|
|
2463
|
+
},
|
|
2464
|
+
style: {
|
|
2465
|
+
width: 40,
|
|
2466
|
+
height: 48,
|
|
2467
|
+
borderRadius: 2,
|
|
2468
|
+
borderWidth: 1,
|
|
2469
|
+
borderColor: '#FFA500',
|
|
2470
|
+
opacity: 0.7
|
|
2471
|
+
}
|
|
2472
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
2473
|
+
style: {
|
|
2474
|
+
position: 'absolute',
|
|
2475
|
+
bottom: 1,
|
|
2476
|
+
left: 1,
|
|
2477
|
+
right: 1,
|
|
2478
|
+
backgroundColor: 'rgba(0,0,0,0.8)',
|
|
2479
|
+
paddingVertical: 0,
|
|
2480
|
+
borderRadius: 1
|
|
2481
|
+
},
|
|
2482
|
+
children: /*#__PURE__*/_jsxs(TextView, {
|
|
2483
|
+
style: {
|
|
2484
|
+
color: '#FFA500',
|
|
2485
|
+
fontSize: 6,
|
|
2486
|
+
textAlign: 'center',
|
|
2487
|
+
fontWeight: 'bold'
|
|
2488
|
+
},
|
|
2489
|
+
children: [hologramImageCount, "/", HOLOGRAM_IMAGE_COUNT]
|
|
2490
|
+
})
|
|
2491
|
+
})]
|
|
2492
|
+
}) : /*#__PURE__*/_jsx(View, {
|
|
2493
|
+
style: {
|
|
2494
|
+
width: 40,
|
|
2495
|
+
height: 48,
|
|
2496
|
+
borderRadius: 2,
|
|
2497
|
+
borderWidth: 1,
|
|
2498
|
+
borderColor: '#666',
|
|
2499
|
+
backgroundColor: '#222',
|
|
2500
|
+
justifyContent: 'center',
|
|
2501
|
+
alignItems: 'center'
|
|
2502
|
+
},
|
|
2503
|
+
children: /*#__PURE__*/_jsx(TextView, {
|
|
2504
|
+
style: {
|
|
2505
|
+
color: '#666',
|
|
2506
|
+
fontSize: 7
|
|
2507
|
+
},
|
|
2508
|
+
children: "\u2014"
|
|
2509
|
+
})
|
|
2510
|
+
}), /*#__PURE__*/_jsx(TextView, {
|
|
2511
|
+
style: {
|
|
2512
|
+
color: currentHologramImage ? '#9C27B0' : latestHologramFaceImage ? '#FFA500' : '#999',
|
|
2513
|
+
fontSize: 7,
|
|
2514
|
+
marginTop: 1,
|
|
2515
|
+
fontWeight: 'bold'
|
|
2516
|
+
},
|
|
2517
|
+
children: `${currentHologramImage ? '✓' : latestHologramFaceImage ? '⏳' : '○'} Holo`
|
|
2518
|
+
})]
|
|
2519
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
2520
|
+
style: {
|
|
2521
|
+
alignItems: 'center'
|
|
2522
|
+
},
|
|
2523
|
+
children: [_currentHologramMaskImage ? /*#__PURE__*/_jsx(Image, {
|
|
2524
|
+
source: {
|
|
2525
|
+
uri: `data:image/jpeg;base64,${_currentHologramMaskImage}`
|
|
2526
|
+
},
|
|
2527
|
+
style: {
|
|
2528
|
+
width: 40,
|
|
2529
|
+
height: 48,
|
|
2530
|
+
borderRadius: 2,
|
|
2531
|
+
borderWidth: 1,
|
|
2532
|
+
borderColor: '#FF6B6B'
|
|
2533
|
+
}
|
|
2534
|
+
}) : /*#__PURE__*/_jsx(View, {
|
|
2535
|
+
style: {
|
|
2536
|
+
width: 40,
|
|
2537
|
+
height: 48,
|
|
2538
|
+
borderRadius: 2,
|
|
2539
|
+
borderWidth: 1,
|
|
2540
|
+
borderColor: '#666',
|
|
2541
|
+
backgroundColor: '#222',
|
|
2542
|
+
justifyContent: 'center',
|
|
2543
|
+
alignItems: 'center'
|
|
2544
|
+
},
|
|
2545
|
+
children: /*#__PURE__*/_jsx(TextView, {
|
|
2546
|
+
style: {
|
|
2547
|
+
color: '#666',
|
|
2548
|
+
fontSize: 7
|
|
2549
|
+
},
|
|
2550
|
+
children: "\u2014"
|
|
2551
|
+
})
|
|
2552
|
+
}), /*#__PURE__*/_jsx(TextView, {
|
|
2553
|
+
style: {
|
|
2554
|
+
color: _currentHologramMaskImage ? '#FF6B6B' : '#999',
|
|
2555
|
+
fontSize: 7,
|
|
2556
|
+
marginTop: 1,
|
|
2557
|
+
fontWeight: 'bold'
|
|
2558
|
+
},
|
|
2559
|
+
children: `${_currentHologramMaskImage ? '✓' : '○'} Mask`
|
|
2560
|
+
})]
|
|
2561
|
+
})]
|
|
2425
2562
|
})]
|
|
2426
2563
|
})
|
|
2427
2564
|
}), testMode && testModeData && /*#__PURE__*/_jsx(SafeAreaView, {
|