@sanctum-key/react-native-sdk 1.0.19 → 1.0.20
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/build/package.json +1 -1
- package/build/src/components/KYCElements/CountrySelectionTemplate.d.ts.map +1 -1
- package/build/src/components/KYCElements/CountrySelectionTemplate.js +40 -128
- package/build/src/components/KYCElements/CountrySelectionTemplate.js.map +1 -1
- package/build/src/components/KYCElements/IDCardCapture.d.ts.map +1 -1
- package/build/src/components/KYCElements/IDCardCapture.js +166 -129
- package/build/src/components/KYCElements/IDCardCapture.js.map +1 -1
- package/build/src/components/KYCElements/VerificationProgressTemplate.d.ts.map +1 -1
- package/build/src/components/KYCElements/VerificationProgressTemplate.js +38 -33
- package/build/src/components/KYCElements/VerificationProgressTemplate.js.map +1 -1
- package/build/src/hooks/useTemplateKYCFlow.js +1 -1
- package/build/src/hooks/useTemplateKYCFlow.js.map +1 -1
- package/build/src/modules/api/CardAuthentification.d.ts +5 -0
- package/build/src/modules/api/CardAuthentification.d.ts.map +1 -1
- package/build/src/modules/api/CardAuthentification.js +67 -13
- package/build/src/modules/api/CardAuthentification.js.map +1 -1
- package/build/src/modules/api/KYCService.d.ts +10 -0
- package/build/src/modules/api/KYCService.d.ts.map +1 -1
- package/build/src/modules/api/KYCService.js +94 -25
- package/build/src/modules/api/KYCService.js.map +1 -1
- package/build/src/web/WebKYCEntry.d.ts.map +1 -1
- package/build/src/web/WebKYCEntry.js +34 -6
- package/build/src/web/WebKYCEntry.js.map +1 -1
- package/package.json +1 -1
- package/src/components/KYCElements/CountrySelectionTemplate.tsx +53 -133
- package/src/components/KYCElements/IDCardCapture.tsx +613 -556
- package/src/components/KYCElements/VerificationProgressTemplate.tsx +54 -66
- package/src/hooks/useTemplateKYCFlow.tsx +14 -14
- package/src/modules/api/CardAuthentification.ts +133 -66
- package/src/modules/api/KYCService.ts +142 -38
- package/src/web/WebKYCEntry.tsx +42 -7
|
@@ -1 +1 @@
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'react'; \nimport { View, Text, StyleSheet, Image, ScrollView, Platform, ActivityIndicator, TouchableOpacity, useWindowDimensions } from 'react-native';\nimport { showAlert } from '../../utils/platformAlert';\nimport { EnhancedCameraView } from '../EnhancedCameraView';\nimport { TemplateComponent, LocalizedText, GovernmentDocumentType, ISilentCaptureResult, IBbox, GovernmentDocumentTypeShorted, GovernmentDocumentTypeBackend } from '../../types/KYC.types';\nimport IdCardOverlay from '../OverLay/IdCard';\nimport { useTemplateKYCFlowContext } from '../../hooks/useTemplateKYCFlow';\nimport { useI18n } from '../../hooks/useI18n';\nimport { Button } from '../ui/Button';\nimport { removeDuplicates } from '../../utils/remove-duplicate';\nimport { backVerification, checkTemplateType, frontVerification } from '../../modules/api/CardAuthentification';\nimport { getDocumentTypeInfo } from '../../utils/get-document-type-info';\nimport pathToBase64 from '../../utils/pathToBase64';\nimport { cropByObb, cropImageWithBBoxWithTolerance, getObbConfidence, OBB_CONFIDENCE_THRESHOLD } from '../../utils/cropByObb';\nimport REGION_MAPPING from '../../config/region_mapping.json';\nimport QRCode from 'react-native-qrcode-svg'; \n\nconst ISO_TO_COUNTRY_NAME: Record<string, string> = { 'KE': 'Kenya', 'CM': 'Cameroon', 'NG': 'Nigeria', 'CA': 'Canada', 'FR': 'France', 'GH': 'Ghana', 'ZA': 'South Africa', 'GB': 'Britain', 'CI': 'Ivory Coast', 'SN': 'Senegal', 'TG': 'Togo', 'ML': 'Mali' }; \n\ninterface IIDCardPayload { dir: string; file: string; mrz: string; templatePath?: string; }\ninterface IDCardCaptureProps { component: TemplateComponent; value?: Record<string, IIDCardPayload>; onValueChange: (value: Record<string, IIDCardPayload | string>) => void; error?: string; language?: string; currentSide?: string; } \n\nexport const IDCardCapture: React.FC<IDCardCaptureProps> = ({ component, value = {}, onValueChange, error, language = 'en' }) => { \n const { t, locale } = useI18n(); \n const [showCamera, setShowCamera] = useState(false); \n const [capturedImages, setCapturedImages] = useState<Record<string, IIDCardPayload>>(value || {}); \n const [currentSide, setCurrentSide] = useState<'front' | 'back'>('front'); \n const [bboxBySide, setBboxBySide] = useState<Record<string, IBbox>>({}); \n const [silentCaptureResult, setSilentCaptureResult] = useState<ISilentCaptureResult>({ success: false, isAnalyzing: false }); \n const [isProcessingCapture, setIsProcessingCapture] = useState(false); \n const [processingImagePath, setProcessingImagePath] = useState<string | null>(null); \n const [cameraKey, setCameraKey] = useState(0); \n const [isRebootingCamera, setIsRebootingCamera] = useState(false); \n const [cameraType, setCameraType] = useState<'back' | 'front'>('back'); \n const [showQRModal, setShowQRModal] = useState(false); \n \n const [currentUrl, setCurrentUrl] = useState(''); \n useEffect(() => { \n if (typeof window !== 'undefined' && window.location) { \n setCurrentUrl(window.location.href); \n } \n }, []); \n\n const documentTypeMapping: Record<string, GovernmentDocumentType> = { 'nationalId': 'national_id', 'passport': 'passport', 'driversLicense': 'drivers_licence', 'residencePermit': 'permanent_residence', 'healthInsuranceCard': 'health_insurance_card', }; \n const { actions, state, env } = useTemplateKYCFlowContext(); \n const { width: screenWidth, height: screenHeight } = useWindowDimensions(); \n\n const getLocalizedText = (text: LocalizedText | Record<string, LocalizedText>): string => { \n if (text && typeof text[currentSide] === 'object' && text[currentSide][locale]) return text[currentSide][locale] || ''; \n return \"\"; \n }; \n\n const countrySelectionData = useMemo(() => { \n const countrySelectionComponent = state.template.components.find(c => c.type === 'country_selection'); \n return countrySelectionComponent ? state.componentData[countrySelectionComponent.id] : null; \n }, [state.template.components, state.componentData]); \n\n const selectedDocumentType = useMemo<{ type: GovernmentDocumentType; region: string } | null>(() => { \n if (!countrySelectionData?.documentType) return null; \n const backendDocType = countrySelectionData.documentType; \n const mappedType = documentTypeMapping[backendDocType] || backendDocType as GovernmentDocumentType; \n return { type: mappedType, region: countrySelectionData.region || 'root' }; \n }, [countrySelectionData, documentTypeMapping]); \n\n const countryData = useMemo(() => countrySelectionData, [countrySelectionData]); \n\n const refreshCamera = () => { \n setIsRebootingCamera(true); \n setTimeout(() => { \n setCameraKey(prev => prev + 1); \n setIsRebootingCamera(false); \n }, 500); \n }; \n\n const toggleCameraLens = () => { \n setCameraType(prev => prev === 'back' ? 'front' : 'back'); \n refreshCamera(); \n }; \n\n useEffect(() => { \n if (value && Object.keys(value).length > 0) { \n if (JSON.stringify(value) !== JSON.stringify(capturedImages)) { \n const updatedImages = value as Record<string, IIDCardPayload>; \n setCapturedImages(updatedImages); \n const currentImageData = updatedImages[currentSide]; \n if (currentImageData?.dir) { \n setSilentCaptureResult(prev => ({ \n ...prev, path: currentImageData.dir, success: true, isAnalyzing: false, mrz: currentImageData.mrz || '', templatePath: currentImageData.templatePath || '', \n })); \n } \n } \n } \n }, [value, currentSide]); \n\n const cameraConfig = useMemo(() => { \n const instructions = selectedDocumentType ? (locale === 'en' ? getDocumentTypeInfo(selectedDocumentType.type).instructions.en : getDocumentTypeInfo(selectedDocumentType.type).instructions.fr) : getLocalizedText(component.instructions as Record<string, LocalizedText>); \n \n const isLandscape = screenWidth > screenHeight; \n let xMin, xMax, yMin, yMax; \n\n if (Platform.OS === 'web') { \n // 🚨 UI FIX: Differentiate Desktop Web (Landscape) vs Mobile Web (Portrait)\n const boxWidthPercent = isLandscape ? 0.40 : 0.85; \n \n // On wide desktop, shift slightly right. On mobile portrait, center perfectly.\n xMin = isLandscape ? 30 : 7.5; \n xMax = xMin + (boxWidthPercent * 100); \n\n // Safely calculate height to guarantee a 1.59 aspect ratio\n const containerWidth = Math.min(screenWidth * 0.95, 1000); \n const containerHeight = isLandscape ? screenHeight * 0.80 : screenHeight * 0.90; \n \n const boxPixelWidth = containerWidth * boxWidthPercent; \n const boxPixelHeight = boxPixelWidth / 1.59; \n const heightPercent = (boxPixelHeight / containerHeight) * 100; \n\n // Center vertically\n yMin = (100 - heightPercent) / 2.5; \n yMax = yMin + heightPercent; \n } else { \n xMin = 5; xMax = 95; yMin = 34; yMax = 66; \n } \n\n const platformBbox = { xMin, yMin, xMax, yMax, borderColor: '#2DBD60', borderWidth: Platform.OS === 'web' ? 2 : 3, cornerRadius: 8 }; \n\n return { \n cameraType: Platform.OS === 'web' ? cameraType : 'back', \n flashMode: 'auto' as const, \n overlay: { guideText: instructions, bbox: platformBbox } \n }; \n }, [selectedDocumentType, locale, component.instructions, cameraType, screenWidth, screenHeight]); \n\n const retakePicture = (sideToRetake: 'front' | 'back') => { \n setIsProcessingCapture(false); \n setProcessingImagePath(null); \n setSilentCaptureResult({ path: '', success: false, isAnalyzing: false, error: '', templatePath: '', mrz: '', bbox: undefined }); \n setShowCamera(true); \n refreshCamera(); \n actions.showCustomStepper(false); \n setCapturedImages((prev) => { const newState = { ...prev }; delete newState[sideToRetake]; return newState; }); \n if (value) { const newValue = { ...value }; delete newValue[sideToRetake]; onValueChange(newValue); } \n }; \n\n const getCurrentSideVerification = (currentSide: string, countryKey: string) => { \n const rawDocType = countrySelectionData?.documentType; \n if (!rawDocType || !countryKey) { return { authMethod: [], mrzTypes: [], regionMapping: null, key: 'root' }; } \n const rawCountryName = ISO_TO_COUNTRY_NAME[countryData?.code || ''] || countryData?.code || countryKey; \n const baseMapping = (REGION_MAPPING as any).regionMapping || REGION_MAPPING; \n let countryMapping = baseMapping[rawCountryName]; \n if (!countryMapping) { \n const foundKey = Object.keys(baseMapping).find(k => k.toLowerCase() === rawCountryName.toLowerCase() || k.toLowerCase() === countryKey.toLowerCase()); \n if (foundKey) countryMapping = baseMapping[foundKey]; \n } \n if (!countryMapping) { return { authMethod: [], mrzTypes: [], regionMapping: null, key: 'root' }; } \n const regionMapping = countryMapping[rawDocType]; \n if (!regionMapping) { return { authMethod: [], mrzTypes: [], regionMapping: null, key: 'root' }; } \n const authMethod: string[] = []; \n const mrzTypes: string[] = []; \n const key = countrySelectionData.region?.trim()?.length > 0 ? countrySelectionData.region.trim() : 'root'; \n if (regionMapping?.[key] && Array.isArray(regionMapping[key])) { \n regionMapping[key].forEach((item: any) => { \n if (item[currentSide]) { \n authMethod.push(item[currentSide]); \n if (item?.mrz_type) mrzTypes.push(item?.mrz_type); \n } \n }); \n } \n return { authMethod: removeDuplicates(authMethod), mrzTypes: removeDuplicates(mrzTypes), regionMapping, key }; \n } \n\n const getCorrespondingMrzType = (templatePath: string, mapping: any, selectedDocumentType: string = \"root\") => { \n if (!mapping || !mapping[selectedDocumentType]) return null; \n const fileName = templatePath.split(\"/\").pop()?.replace(\".jpg\", \"\").replace(\".png\", \"\"); \n if (!fileName) return null; \n const pyName = `${fileName}.py`; \n const found = mapping[selectedDocumentType].find((item: any) => item.py_file === pyName); \n return found?.mrz_type || null; \n } \n\n const getCorrespondingAuthMethod = (templatePath: string, mapping: any, selectedDocumentType: string = \"root\", side: 'front' | 'back') => { \n if (!mapping || !mapping[selectedDocumentType]) return null; \n const fileName = templatePath.split(\"/\").pop()?.replace(\".jpg\", \"\").replace(\".png\", \"\"); \n if (!fileName) return null; \n const pyName = `${fileName}.py`; \n const found = mapping[selectedDocumentType].find((item: any) => item.py_file === pyName); \n return found?.[side] || null; \n } \n\n const autoCapture = async (capturePath: string, verified: ISilentCaptureResult) => { \n if (isProcessingCapture) return; \n setIsProcessingCapture(true); \n setProcessingImagePath(capturePath); \n try { \n let imagePathForUpload = capturePath; \n const overlayBbox = cameraConfig.overlay.bbox; \n const uiCropBbox = { \n minX: overlayBbox.xMin / 100, \n minY: overlayBbox.yMin / 100, \n width: (overlayBbox.xMax - overlayBbox.xMin) / 100, \n height: (overlayBbox.yMax - overlayBbox.yMin) / 100, \n }; \n try { \n imagePathForUpload = await cropImageWithBBoxWithTolerance(capturePath, uiCropBbox, 0.06); \n } catch (e) { \n console.warn(\"Crop failed, falling back to original image\", e); \n imagePathForUpload = capturePath; \n } \n const base64 = await pathToBase64(imagePathForUpload); \n const newImages = { \n ...capturedImages, \n [currentSide]: { dir: imagePathForUpload, file: base64, mrz: verified.mrz || \"\", templatePath: verified.templatePath }, \n }; \n setCapturedImages(newImages); \n if (verified.country && verified.documentType) { \n onValueChange({ \n ...newImages, \n country: verified.country, \n documentType: GovernmentDocumentTypeBackend[verified.documentType as keyof typeof GovernmentDocumentTypeBackend] || '', \n }); \n } \n setTimeout(() => { \n setShowCamera(false); \n actions.showCustomStepper(true); \n setSilentCaptureResult(prev => ({ ...prev, isAnalyzing: false })); \n setIsProcessingCapture(false); \n setProcessingImagePath(null); \n }, 600); \n } catch (e: any) { \n console.error(\"Backend Error:\", e); \n const friendlyError = state.currentLanguage === 'en' ? 'Unable to process document. Please try again.' : 'Impossible de traiter le document. Veuillez réessayer.'; \n showAlert('Error', friendlyError); \n setSilentCaptureResult(prev => ({ ...prev, isAnalyzing: false, success: false })); \n setIsProcessingCapture(false); \n setProcessingImagePath(null); \n } \n }; \n\n const handleSilentCapture = async (result: { success: boolean; path?: string; error?: string }) => { \n if (silentCaptureResult.isAnalyzing || isProcessingCapture) return; \n if (result.success && result.path) { \n setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: true, success: false, error: '' })); \n let templatePath = capturedImages[currentSide]?.templatePath || ''; \n let templateBbox: IBbox | undefined; \n let templateResponse: any; \n if (!selectedDocumentType) { \n setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, success: false, error: 'Document type not selected' })); \n return; \n } \n try { \n if (!templatePath) { \n const templateType = await checkTemplateType({ path: result.path || '', docType: selectedDocumentType?.type as GovernmentDocumentType, docRegion: countryData?.code || \"\", postfix: currentSide }, env); \n templateResponse = templateType; \n if (templateType.template_path) templatePath = templateType.template_path; \n if (templateType.card_obb) { \n const obbConfidence = getObbConfidence((templateType as any).card_obb); \n if (obbConfidence !== null && obbConfidence < OBB_CONFIDENCE_THRESHOLD) { \n setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, success: false, error: t('kyc.idCardCapture.cardNotFullyInFrame') })); \n return; \n } \n try { \n const crop = await cropByObb(result.path, (templateType as any).card_obb); \n templateBbox = crop.bbox; \n } catch { } \n } \n } \n const extractedCountryKey = templatePath ? templatePath.split('/')[0] : (ISO_TO_COUNTRY_NAME[countryData?.code || ''] || 'root'); \n const regionMappings = getCurrentSideVerification(currentSide, extractedCountryKey); \n let verificationRes: any; \n if (currentSide === 'front') { \n const matchedAuthMethod = getCorrespondingAuthMethod(templatePath, regionMappings.regionMapping, regionMappings.key || '', 'front'); \n const mrzType = getCorrespondingMrzType(templatePath, regionMappings.regionMapping, regionMappings.key || '') || 'TD1'; \n verificationRes = await frontVerification({ path: result.path, regionMapping: { authMethod: matchedAuthMethod ? [matchedAuthMethod] : regionMappings.authMethod, mrzTypes: regionMappings.mrzTypes }, selectedDocumentType: GovernmentDocumentTypeShorted[selectedDocumentType?.type as keyof typeof GovernmentDocumentTypeShorted] || '', code: countryData?.code || '', currentSide, templatePath, mrzType }, env); \n } else { \n let matchedBackAuthMethod = getCorrespondingAuthMethod(templatePath, regionMappings.regionMapping, regionMappings.key || '', 'back'); \n if (!matchedBackAuthMethod && currentSide === 'back') { matchedBackAuthMethod = 'MRZ'; } \n const backMrzType = getCorrespondingMrzType(templatePath, regionMappings.regionMapping, regionMappings.key || '') || ''; \n verificationRes = await backVerification({ path: result.path, regionMapping: { authMethod: matchedBackAuthMethod ? [matchedBackAuthMethod] : regionMappings.authMethod, mrzTypes: regionMappings.mrzTypes }, selectedDocumentType: GovernmentDocumentTypeShorted[selectedDocumentType.type as keyof typeof GovernmentDocumentTypeShorted] || '', code: countryData?.code || '', currentSide, templatePath, mrzType: backMrzType, templateResponse }, env); \n } \n const bbox = verificationRes?.bbox || templateBbox; \n const mrz = verificationRes?.mrz ? JSON.stringify(verificationRes.mrz) : \"\"; \n const verifiedResult: ISilentCaptureResult = { path: result.path, templatePath, bbox, success: true, mrz, isAnalyzing: false, country: countryData?.code, documentType: selectedDocumentType.type }; \n setSilentCaptureResult(verifiedResult); \n if (bbox) setBboxBySide(prev => ({ ...prev, [currentSide]: bbox })); \n await autoCapture(result.path, verifiedResult); \n } catch (error: any) { \n console.log(\"Backend Verification Error:\", error); \n const rawMessage = (error?.message || '').toLowerCase(); \n let userFriendlyMessage ='Verification failed. Please try again.'; \n if (rawMessage.includes('impossible') || rawMessage.includes('unreadable')) { \n userFriendlyMessage = 'Document unreadable. Please hold the camera steady in good light.'; \n } else if (rawMessage.includes('country mismatch') || rawMessage.includes('pays sélectionné')) { \n userFriendlyMessage = 'The document does not match your selected country.'; \n } else if (rawMessage.includes('card_not_fully_in_frame')) { \n userFriendlyMessage = 'Move closer to the document and ensure all corners are visible.'; \n } \n setSilentCaptureResult(prev => ({ ...prev, isAnalyzing: false, success: false, error: userFriendlyMessage })); \n } \n } \n }; \n\n const handleError = (event: { message: string }) => { \n showAlert('Erreur', event.message); \n setShowCamera(false); \n setIsProcessingCapture(false); \n }; \n\n useEffect(() => { \n actions.showCustomStepper(!showCamera); \n }, [showCamera]); \n\n if (!countrySelectionData || !selectedDocumentType) { \n return ( \n <View style={styles.root}> \n <View style={styles.previewContainer}> \n <Text style={styles.title}>{getLocalizedText(component.labels)}</Text> \n <Text style={styles.description}> \n {state.currentLanguage === \"en\" ? \"Please complete the country and document selection first.\" : \"Veuillez d'abord compléter la sélection du pays et du document.\"} \n </Text> \n </View> \n </View> \n ); \n } \n\n if (showCamera) { \n const isBusy = isProcessingCapture; \n if (isRebootingCamera) { \n return ( \n <View style={[styles.root, { justifyContent: 'center', alignItems: 'center', backgroundColor: '#000' }]}> \n <ActivityIndicator size=\"large\" color=\"#2DBD60\" /> \n <Text style={{ color: 'white', marginTop: 20, fontSize: 16 }}>Initializing Camera...</Text> \n </View> \n ); \n } \n return ( \n <View style={styles.root}> \n <View style={[styles.cameraWrapper, { flex: 1 }]}> \n <View style={styles.headerContainer}> \n <Text style={styles.headerTitle}> \n {selectedDocumentType ? (locale === 'en' ? getDocumentTypeInfo(selectedDocumentType.type).name.en : getDocumentTypeInfo(selectedDocumentType.type).name.fr) : ''} \n </Text> \n <View style={styles.stepBadge}> \n <Text style={styles.stepText}> \n {t('kyc.idCardCapture.captureTitle', { side: currentSide === 'front' ? locale === 'en' ? 'Front' : 'Recto' : locale === 'en' ? 'Back' : 'Verso' })} \n </Text> \n </View> \n </View> \n \n <View style={[styles.cameraFeedContainer, { flex: 1, backgroundColor: '#000' }]}> \n {Platform.OS === 'web' && ( \n <View style={styles.webTopControls}> \n <TouchableOpacity style={styles.webFlipButton} onPress={toggleCameraLens}> \n <Text style={styles.webFlipText}>🔄 Flip Lens</Text> \n </TouchableOpacity> \n </View> \n )} \n \n <EnhancedCameraView \n key={`${currentSide}-${cameraKey}`} \n showCamera={true} \n isProcessing={isBusy} \n cameraType={cameraConfig.cameraType} \n style={{ ...StyleSheet.absoluteFillObject, ...(Platform.OS === 'web' ? { width: '100%', height: '100%', left: 0, top: 0 } as any : {}) }} \n onError={handleError} \n onSilentCapture={handleSilentCapture} \n silentCaptureResult={silentCaptureResult} \n overlayComponent={ \n <> \n <IdCardOverlay \n xMin={cameraConfig.overlay.bbox.xMin} yMin={cameraConfig.overlay.bbox.yMin} xMax={cameraConfig.overlay.bbox.xMax} yMax={cameraConfig.overlay.bbox.yMax} \n instructions={cameraConfig.overlay.guideText} \n cornerOpacity={cameraConfig.overlay.bbox.cornerRadius || 0 as number} \n isSuccess={silentCaptureResult.success} \n language={state.currentLanguage} \n stepperProps={{ \n back: () => { \n if (currentSide === 'back') { \n setCurrentSide('front'); setShowCamera(false); setIsProcessingCapture(false); setProcessingImagePath(null); \n if (capturedImages['front']?.dir) { \n const frontImage = capturedImages['front']; \n setSilentCaptureResult((prev) => ({ ...prev, path: frontImage.dir, success: true, isAnalyzing: false, error: '', mrz: frontImage.mrz || '', templatePath: frontImage.templatePath || '', bbox: bboxBySide['front'] })); \n } else { setSilentCaptureResult((prev) => ({ ...prev, path: '', success: false, isAnalyzing: false, error: '', templatePath: '' })); } \n } else { actions.previousComponent(); } \n }, \n selectedDocumentType: selectedDocumentType ? (locale === 'en' ? getDocumentTypeInfo(selectedDocumentType.type).name.en : getDocumentTypeInfo(selectedDocumentType.type).name.fr) : '', \n step: state.currentComponentIndex + 1, totalSteps: state.template.components.length, side: currentSide, \n }} \n /> \n </> \n } \n /> \n \n {!isBusy && silentCaptureResult.isAnalyzing && ( \n <View style={styles.topAnalyzingPillContainer}> \n <View style={styles.topAnalyzingPill}> \n <ActivityIndicator size=\"small\" color=\"white\" /> \n <Text style={styles.analyzingPillText}> \n {state.currentLanguage === 'en' ? 'Scanning...' : 'Analyse...'} \n </Text> \n </View> \n </View> \n )} \n \n {isBusy && ( \n <View style={[StyleSheet.absoluteFillObject, { zIndex: 9999 }]}> \n {processingImagePath && ( \n <Image \n source={{ uri: processingImagePath.startsWith('file://') ? processingImagePath : `file://${processingImagePath}` }} \n style={StyleSheet.absoluteFillObject} \n resizeMode=\"cover\" \n /> \n )} \n <View style={styles.processingOverlay}> \n <ActivityIndicator size=\"large\" color=\"#2DBD60\" /> \n <Text style={styles.processingText}> \n {state.currentLanguage === 'en' ? 'Perfect!\\nProcessing Document...' : 'Parfait!\\nTraitement du document...'} \n </Text> \n </View> \n </View> \n )} \n \n {!isBusy && Platform.OS === 'web' ? ( \n <View style={styles.webBottomControlBar}> \n {silentCaptureResult.error && ( \n <View style={styles.floatingErrorBanner}> \n <Text style={styles.floatingErrorText}>⚠️ {silentCaptureResult.error}</Text> \n </View> \n )} \n <View style={styles.webActionButtonsRow}> \n <TouchableOpacity style={styles.webSecondaryButton} onPress={() => setShowCamera(false)}> \n <Text style={styles.webSecondaryButtonText}>Cancel</Text> \n </TouchableOpacity> \n <TouchableOpacity style={styles.webPrimaryButton} onPress={refreshCamera}> \n <Text style={styles.webPrimaryButtonText}>↻ Refresh Camera</Text> \n </TouchableOpacity> \n </View> \n </View> \n ) : !isBusy ? ( \n <View style={styles.escapeHatchContainer}> \n <TouchableOpacity style={styles.fallbackRefreshButton} onPress={refreshCamera}> \n <Text style={styles.fallbackRefreshText}>↻ Refresh Camera</Text> \n </TouchableOpacity> \n <TouchableOpacity \n style={[styles.fallbackRefreshButton, { marginTop: 15, backgroundColor: 'rgba(220, 38, 38, 0.8)', borderColor: '#DC2626' }]} \n onPress={() => setShowCamera(false)} \n > \n <Text style={styles.fallbackRefreshText}>Cancel / Go Back</Text> \n </TouchableOpacity> \n </View> \n ) : null} \n \n {silentCaptureResult.error && !isBusy && Platform.OS !== 'web' ? ( \n <View style={[styles.floatingErrorBanner, { zIndex: 10000 }]}> \n <Text style={styles.floatingErrorText}>⚠️ {silentCaptureResult.error}</Text> \n </View> \n ) : null} \n </View> \n </View> \n </View> \n ); \n } \n\n return ( \n <View style={styles.root}> \n <View style={styles.previewContainer}> \n <ScrollView style={styles.previewItemContainer} showsVerticalScrollIndicator={false}> \n <View key={currentSide} style={styles.sideContainer}> \n <Text style={styles.sideTitle}> \n {t('kyc.idCardCapture.captureTitle', { side: currentSide === 'front' ? locale === 'en' ? 'Front' : 'Recto' : locale === 'en' ? 'Back' : 'Verso' })} \n </Text> \n <Text style={{ fontSize: 14, color: '#666', textAlign: 'center', marginBottom: 16, lineHeight: 22 }}> \n {getLocalizedText(component.instructions)} \n </Text> \n <View style={{ alignItems: 'center', justifyContent: 'center', flexDirection: \"column\", gap: 16 }}> \n <View style={styles.imagePreviewWrapper}> \n {capturedImages[currentSide]?.dir ? ( \n <Image source={{ uri: capturedImages[currentSide].dir }} style={styles.previewImage} /> \n ) : silentCaptureResult.path ? ( \n <Image source={{ uri: silentCaptureResult.path }} style={styles.previewImage} /> \n ) : null} \n </View> \n {!capturedImages[currentSide]?.dir && ( \n <View style={{ width: '100%', gap: 12 }}> \n <Button \n title={state.currentLanguage === \"en\" ? \"Start Scanning\" : \"Commencer la numérisation\"} \n onPress={() => { setShowCamera(true); refreshCamera(); actions.showCustomStepper(false); }} \n variant=\"primary\" size=\"large\" fullWidth \n /> \n {Platform.OS === 'web' && ( \n <Button \n title={state.currentLanguage === \"en\" ? \"Continue on Phone\" : \"Continuer sur le téléphone\"} \n onPress={() => setShowQRModal(true)} \n variant=\"outline\" size=\"large\" fullWidth \n /> \n )} \n </View> \n )} \n {capturedImages[currentSide]?.dir && ( \n <> \n <Button title={t('kyc.idCardCapture.retakeButton')} onPress={() => retakePicture(currentSide)} variant=\"outline\" size=\"medium\" fullWidth /> \n <Button title={t('common.next')} onPress={() => { \n if (!selectedDocumentType) { showAlert('Error', 'Document type not selected'); return; } \n if (currentSide === 'back' || selectedDocumentType.type === 'passport') { \n actions.nextComponent(); \n } else { \n setShowCamera(true); refreshCamera(); setCurrentSide('back'); setSilentCaptureResult({ success: false, isAnalyzing: false, path: '', error: '', templatePath: undefined }); setIsProcessingCapture(false); setProcessingImagePath(null); \n } \n }} variant=\"primary\" size=\"large\" fullWidth /> \n </> \n )} \n </View> \n </View> \n </ScrollView> \n </View> \n {showQRModal && Platform.OS === 'web' && ( \n <View style={styles.qrModalOverlay}> \n <View style={styles.qrModalContainer}> \n <Text style={styles.qrModalTitle}> \n {state.currentLanguage === 'en' ? 'Scan to continue' : 'Scannez pour continuer'} \n </Text> \n <Text style={styles.qrModalText}> \n {state.currentLanguage === 'en' ? \"Point your phone's camera at this QR code to seamlessly continue the process on your mobile device.\" : \"Pointez l'appareil photo de votre téléphone vers ce code QR pour continuer le processus en toute fluidité sur votre appareil mobile.\"} \n </Text> \n <View style={styles.qrCodeWrapper}> \n <QRCode value={currentUrl} size={220} backgroundColor=\"transparent\" /> \n </View> \n <Button title={state.currentLanguage === 'en' ? \"Close\" : \"Fermer\"} onPress={() => setShowQRModal(false)} variant=\"outline\" fullWidth /> \n </View> \n </View> \n )} \n </View> \n ); \n}; \n\nconst styles = StyleSheet.create({ \n root: { flex: 1, width: '100%', backgroundColor: 'transparent', alignSelf: 'center', ...Platform.select({ web: { minHeight: '85vh', justifyContent: 'center', alignItems: 'center' } as any, }) }, \n cameraWrapper: { width: '100%', backgroundColor: '#000000', overflow: 'hidden', ...Platform.select({ web: { maxWidth: 1000, width: '95%', height: '80vh', minHeight: 600, borderRadius: 24, shadowColor: '#000', shadowOffset: { width: 0, height: 10 }, shadowOpacity: 0.15, shadowRadius: 30, elevation: 24 } as any, default: { flex: 1 } }) }, \n // 🚨 UI FIX: flexWrap handles overflowing text perfectly on narrow mobile screens\n headerContainer: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', flexWrap: 'wrap', gap: 10, paddingHorizontal: 20, paddingVertical: 18, backgroundColor: '#FFFFFF', borderBottomWidth: 1, borderBottomColor: '#F1F5F9', zIndex: 10, ...Platform.select({ web: { display: 'flex' }, default: { display: 'none' } }) }, \n headerTitle: { fontSize: 18, fontWeight: '700', color: '#0F172A', flexShrink: 1 }, \n stepBadge: { backgroundColor: '#F1F5F9', paddingHorizontal: 12, paddingVertical: 6, borderRadius: 20, }, \n stepText: { fontSize: 13, fontWeight: '600', color: '#64748B', }, \n cameraFeedContainer: { flex: 1, position: 'relative', backgroundColor: '#000', }, \n escapeHatchContainer: { position: 'absolute', bottom: 40, left: 0, right: 0, alignItems: 'center', justifyContent: 'center', zIndex: 99999 }, \n fallbackRefreshButton: { backgroundColor: 'rgba(0, 0, 0, 0.8)', borderWidth: 1, borderColor: 'rgba(255, 255, 255, 0.5)', paddingVertical: 12, paddingHorizontal: 24, borderRadius: 24, shadowColor: '#000', shadowOffset: { width: 0, height: 4 }, shadowOpacity: 0.3, shadowRadius: 5, elevation: 8 }, \n fallbackRefreshText: { color: '#FFFFFF', fontWeight: 'bold', fontSize: 16 }, \n webBottomControlBar: { position: 'absolute', bottom: 0, left: 0, right: 0, paddingHorizontal: 24, paddingBottom: 24, paddingTop: 30, backgroundColor: 'rgba(0,0,0,0.6)', zIndex: 99999 }, \n webActionButtonsRow: { flexDirection: 'row', justifyContent: 'center', gap: 16, marginTop: 12, maxWidth: 500, alignSelf: 'center', width: '100%' }, \n webPrimaryButton: { flex: 1, backgroundColor: '#2DBD60', paddingVertical: 14, borderRadius: 12, alignItems: 'center' }, \n webPrimaryButtonText: { color: 'white', fontWeight: 'bold', fontSize: 16 }, \n webSecondaryButton: { flex: 1, backgroundColor: 'rgba(255,255,255,0.15)', borderWidth: 1, borderColor: 'rgba(255,255,255,0.3)', paddingVertical: 14, borderRadius: 12, alignItems: 'center' }, \n webSecondaryButtonText: { color: 'white', fontWeight: 'bold', fontSize: 16 }, \n webTopControls: { position: 'absolute', top: Platform.OS === 'ios' ? 70 : 20, right: 20, zIndex: 9999 }, \n webFlipButton: { backgroundColor: 'rgba(0,0,0,0.6)', paddingHorizontal: 16, paddingVertical: 10, borderRadius: 20, borderWidth: 1, borderColor: 'rgba(255,255,255,0.4)', ...Platform.select({ web: { backdropFilter: 'blur(4px)' } as any }) }, \n webFlipText: { color: 'white', fontWeight: 'bold', fontSize: 14 }, \n previewContainer: { width: '100%', backgroundColor: 'white', borderRadius: 12, paddingVertical: 30, paddingHorizontal: 24, shadowColor: '#000', shadowOffset: { width: 0, height: 4 }, shadowOpacity: 0.08, shadowRadius: 16, elevation: 8, ...Platform.select({ web: { alignSelf: 'center', maxWidth: 650 }, default: { margin: 10, width: '95%' }}) }, \n previewItemContainer: { flexGrow: 1, }, \n title: { fontSize: 24, fontWeight: 'bold', color: '#333', marginBottom: 8, textAlign: 'center' }, \n description: { fontSize: 16, color: '#666', textAlign: 'center', marginBottom: 24, lineHeight: 22 }, \n sideContainer: { marginBottom: 24 }, \n sideTitle: { fontSize: 22, fontWeight: 'bold', color: '#000', marginBottom: 12, textAlign: 'center' }, \n imagePreviewWrapper: { width: '100%', borderRadius: 12, padding: 1, overflow: 'hidden', shadowColor: '#000', shadowOffset: { width: 0, height: 4 }, shadowOpacity: 0.12, shadowRadius: 8, elevation: 8, backgroundColor: '#f0f0f0', ...Platform.select({ web: { aspectRatio: 1.59, height: 'auto', maxWidth: 450, alignSelf: 'center' } as any, default: { height: 220 } }) }, \n previewImage: { width: '100%', height: '100%', borderRadius: 12, resizeMode: 'cover' }, \n floatingErrorBanner: { backgroundColor: '#FEF2F2', borderWidth: 1, borderColor: '#FCA5A5', paddingVertical: 12, paddingHorizontal: 16, borderRadius: 12, alignItems: 'center', justifyContent: 'center', width: '100%', ...Platform.select({ web: { position: 'absolute', bottom: '100%', marginBottom: 16, maxWidth: 500, alignSelf: 'center', zIndex: 100000, boxShadow: '0 4px 12px rgba(0,0,0,0.15)' } as any, default: { position: 'absolute', top: Platform.OS === 'ios' ? 90 : 70, left: 24, right: 24, zIndex: 10000 } }) }, \n floatingErrorText: { color: '#991B1B', fontSize: 14, fontWeight: '700', textAlign: 'center' }, \n processingOverlay: { flex: 1, backgroundColor: 'rgba(0, 0, 0, 0.7)', justifyContent: 'center', alignItems: 'center', zIndex: 9999, ...Platform.select({ web: { backdropFilter: 'blur(4px)' } as any }) }, \n processingText: { color: '#FFF', fontSize: 18, fontWeight: 'bold', marginTop: 16, textAlign: 'center' }, \n errorText: { color: '#dc2626', fontSize: 14, marginTop: 8, textAlign: 'center' }, \n // 🚨 UI FIX: Dropped the pill slightly lower so it never overlaps the flip lens button\n topAnalyzingPillContainer: { position: 'absolute', top: Platform.OS === 'android' ? 60 : 75, left: 0, right: 0, alignItems: 'center', zIndex: 100 }, \n topAnalyzingPill: { flexDirection: 'row', alignItems: 'center', backgroundColor: 'rgba(0,0,0,0.7)', paddingVertical: 10, paddingHorizontal: 20, borderRadius: 30, gap: 10, shadowColor: '#000', shadowOffset: {width: 0, height: 4}, shadowOpacity: 0.3, shadowRadius: 8 }, \n analyzingPillText: { color: 'white', fontSize: 14, fontWeight: 'bold' }, \n qrModalOverlay: { ...StyleSheet.absoluteFillObject, backgroundColor: 'rgba(0,0,0,0.6)', justifyContent: 'center', alignItems: 'center', zIndex: 999999, ...Platform.select({ web: { backdropFilter: 'blur(5px)' } as any }) }, \n qrModalContainer: { backgroundColor: '#FFFFFF', borderRadius: 24, padding: 32, width: '90%', maxWidth: 400, alignItems: 'center', shadowColor: '#000', shadowOffset: { width: 0, height: 10 }, shadowOpacity: 0.15, shadowRadius: 30, elevation: 24, }, \n qrModalTitle: { fontSize: 22, fontWeight: 'bold', color: '#0F172A', marginBottom: 12, textAlign: 'center' }, \n qrModalText: { fontSize: 15, color: '#64748B', textAlign: 'center', marginBottom: 24, lineHeight: 22, }, \n qrCodeWrapper: { padding: 16, backgroundColor: '#FFFFFF', borderRadius: 16, borderWidth: 1, borderColor: '#E2E8F0', marginBottom: 24, } \n});"]}
|
|
1
|
+
{"version":3,"file":"IDCardCapture.js","sourceRoot":"","sources":["../../../../src/components/KYCElements/IDCardCapture.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAC7I,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAyF,6BAA6B,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAC5L,OAAO,aAAa,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAChH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,8BAA8B,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAC9H,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAE7C,MAAM,mBAAmB,GAA2B,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,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EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,GAAG;IACtP,YAAY,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE;IAC3G,WAAW,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,GAAG;IACvG,aAAa,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,GAAG;CACxI,CAAC,CAAC","sourcesContent":["import React, { useEffect, useMemo, useState } from 'react';\nimport { View, Text, StyleSheet, Image, ScrollView, Platform, ActivityIndicator, TouchableOpacity, useWindowDimensions } from 'react-native';\nimport { showAlert } from '../../utils/platformAlert';\nimport { EnhancedCameraView } from '../EnhancedCameraView';\nimport { TemplateComponent, LocalizedText, GovernmentDocumentType, ISilentCaptureResult, IBbox, GovernmentDocumentTypeShorted, GovernmentDocumentTypeBackend } from '../../types/KYC.types';\nimport IdCardOverlay from '../OverLay/IdCard';\nimport { useTemplateKYCFlowContext } from '../../hooks/useTemplateKYCFlow';\nimport { useI18n } from '../../hooks/useI18n';\nimport { Button } from '../ui/Button';\nimport { removeDuplicates } from '../../utils/remove-duplicate';\nimport { backVerification, checkTemplateType, frontVerification } from '../../modules/api/CardAuthentification';\nimport { getDocumentTypeInfo } from '../../utils/get-document-type-info';\nimport pathToBase64 from '../../utils/pathToBase64';\nimport { cropByObb, cropImageWithBBoxWithTolerance, getObbConfidence, OBB_CONFIDENCE_THRESHOLD } from '../../utils/cropByObb';\nimport REGION_MAPPING from '../../config/region_mapping.json';\nimport QRCode from 'react-native-qrcode-svg';\n\nconst ISO_TO_COUNTRY_NAME: Record<string, string> = { 'KE': 'Kenya', 'CM': 'Cameroon', 'NG': 'Nigeria', 'CA': 'Canada', 'FR': 'France', 'GH': 'Ghana', 'ZA': 'South Africa', 'GB': 'Britain', 'CI': 'Ivory Coast', 'SN': 'Senegal', 'TG': 'Togo', 'ML': 'Mali' };\n\ninterface IIDCardPayload { dir: string; file: string; mrz: string; templatePath?: string; }\ninterface IDCardCaptureProps {\n component: TemplateComponent;\n value?: Record<string, IIDCardPayload>;\n onValueChange: (value: Record<string, IIDCardPayload | string>) => void;\n error?: string;\n language?: string;\n currentSide?: string;\n}\n\nexport const IDCardCapture: React.FC<IDCardCaptureProps> = ({ component, value = {}, onValueChange, error, language = 'en' }) => {\n const { t, locale } = useI18n();\n const [showCamera, setShowCamera] = useState(false);\n const [capturedImages, setCapturedImages] = useState<Record<string, IIDCardPayload>>(value || {});\n const [currentSide, setCurrentSide] = useState<'front' | 'back'>('front');\n const [bboxBySide, setBboxBySide] = useState<Record<string, IBbox>>({});\n const [silentCaptureResult, setSilentCaptureResult] = useState<ISilentCaptureResult>({ success: false, isAnalyzing: false });\n const [isProcessingCapture, setIsProcessingCapture] = useState(false);\n const [processingImagePath, setProcessingImagePath] = useState<string | null>(null);\n const [cameraKey, setCameraKey] = useState(0);\n const [isRebootingCamera, setIsRebootingCamera] = useState(false);\n const [cameraType, setCameraType] = useState<'back' | 'front'>('back');\n const [showQRModal, setShowQRModal] = useState(false);\n const [currentUrl, setCurrentUrl] = useState('');\n\n useEffect(() => {\n if (typeof window !== 'undefined' && window.location) {\n setCurrentUrl(window.location.href);\n }\n }, []);\n\n const documentTypeMapping: Record<string, GovernmentDocumentType> = { 'nationalId': 'national_id', 'passport': 'passport', 'driversLicense': 'drivers_licence', 'residencePermit': 'permanent_residence', 'healthInsuranceCard': 'health_insurance_card', };\n\n const { actions, state, env } = useTemplateKYCFlowContext();\n const { width: screenWidth, height: screenHeight } = useWindowDimensions();\n\n const getLocalizedText = (text: LocalizedText | Record<string, LocalizedText>): string => {\n if (text && typeof text[currentSide] === 'object' && text[currentSide][locale]) return text[currentSide][locale] || '';\n return \"\";\n };\n\n const countrySelectionData = useMemo(() => {\n const countrySelectionComponent = state.template.components.find(c => c.type === 'country_selection');\n return countrySelectionComponent ? state.componentData[countrySelectionComponent.id] : null;\n }, [state.template.components, state.componentData]);\n\n const selectedDocumentType = useMemo<{ type: GovernmentDocumentType; region: string } | null>(() => {\n if (!countrySelectionData?.documentType) return null;\n const backendDocType = countrySelectionData.documentType;\n const mappedType = documentTypeMapping[backendDocType] || backendDocType as GovernmentDocumentType;\n return { type: mappedType, region: countrySelectionData.region || 'root' };\n }, [countrySelectionData, documentTypeMapping]);\n\n const countryData = useMemo(() => countrySelectionData, [countrySelectionData]);\n\n const refreshCamera = () => {\n setIsRebootingCamera(true);\n setTimeout(() => {\n setCameraKey(prev => prev + 1);\n setIsRebootingCamera(false);\n }, 500);\n };\n\n const toggleCameraLens = () => {\n setCameraType(prev => prev === 'back' ? 'front' : 'back');\n refreshCamera();\n };\n\n useEffect(() => {\n if (value && Object.keys(value).length > 0) {\n if (JSON.stringify(value) !== JSON.stringify(capturedImages)) {\n const updatedImages = value as Record<string, IIDCardPayload>;\n setCapturedImages(updatedImages);\n const currentImageData = updatedImages[currentSide];\n if (currentImageData?.dir) {\n setSilentCaptureResult(prev => ({\n ...prev, path: currentImageData.dir, success: true, isAnalyzing: false, mrz: currentImageData.mrz || '', templatePath: currentImageData.templatePath || '',\n }));\n }\n }\n }\n }, [value, currentSide]);\n\n const cameraConfig = useMemo(() => {\n const instructions = selectedDocumentType ? (locale === 'en' ? getDocumentTypeInfo(selectedDocumentType.type).instructions.en : getDocumentTypeInfo(selectedDocumentType.type).instructions.fr) : getLocalizedText(component.instructions as Record<string, LocalizedText>);\n const isLandscape = screenWidth > screenHeight;\n let xMin, xMax, yMin, yMax;\n\n if (Platform.OS === 'web') {\n const boxWidthPercent = isLandscape ? 0.40 : 0.85;\n xMin = isLandscape ? 30 : 7.5;\n xMax = xMin + (boxWidthPercent * 100);\n const containerWidth = Math.min(screenWidth * 0.95, 1000);\n const containerHeight = isLandscape ? screenHeight * 0.80 : screenHeight * 0.90;\n const boxPixelWidth = containerWidth * boxWidthPercent;\n const boxPixelHeight = boxPixelWidth / 1.59;\n const heightPercent = (boxPixelHeight / containerHeight) * 100;\n yMin = (100 - heightPercent) / 2.5;\n yMax = yMin + heightPercent;\n } else {\n xMin = 5; xMax = 95; yMin = 34; yMax = 66;\n }\n const platformBbox = { xMin, yMin, xMax, yMax, borderColor: '#2DBD60', borderWidth: Platform.OS === 'web' ? 2 : 3, cornerRadius: 8 };\n return {\n cameraType: Platform.OS === 'web' ? cameraType : 'back',\n flashMode: 'auto' as const,\n overlay: { guideText: instructions, bbox: platformBbox }\n };\n }, [selectedDocumentType, locale, component.instructions, cameraType, screenWidth, screenHeight]);\n\n const retakePicture = (sideToRetake: 'front' | 'back') => {\n setIsProcessingCapture(false);\n setProcessingImagePath(null);\n setSilentCaptureResult({ path: '', success: false, isAnalyzing: false, error: '', templatePath: '', mrz: '', bbox: undefined });\n setShowCamera(true);\n refreshCamera();\n actions.showCustomStepper(false);\n setCapturedImages((prev) => { const newState = { ...prev }; delete newState[sideToRetake]; return newState; });\n if (value) { const newValue = { ...value }; delete newValue[sideToRetake]; onValueChange(newValue); }\n };\n\n const getCurrentSideVerification = (currentSide: string, countryKey: string) => {\n const rawDocType = countrySelectionData?.documentType;\n if (!rawDocType || !countryKey) { return { authMethod: [], mrzTypes: [], regionMapping: null, key: 'root' }; }\n const rawCountryName = ISO_TO_COUNTRY_NAME[countryData?.code || ''] || countryData?.code || countryKey;\n const baseMapping = (REGION_MAPPING as any).regionMapping || REGION_MAPPING;\n let countryMapping = baseMapping[rawCountryName];\n if (!countryMapping) {\n const foundKey = Object.keys(baseMapping).find(k => k.toLowerCase() === rawCountryName.toLowerCase() || k.toLowerCase() === countryKey.toLowerCase());\n if (foundKey) countryMapping = baseMapping[foundKey];\n }\n if (!countryMapping) { return { authMethod: [], mrzTypes: [], regionMapping: null, key: 'root' }; }\n const regionMapping = countryMapping[rawDocType];\n if (!regionMapping) { return { authMethod: [], mrzTypes: [], regionMapping: null, key: 'root' }; }\n const authMethod: string[] = [];\n const mrzTypes: string[] = [];\n const key = countrySelectionData.region?.trim()?.length > 0 ? countrySelectionData.region.trim() : 'root';\n if (regionMapping?.[key] && Array.isArray(regionMapping[key])) {\n regionMapping[key].forEach((item: any) => {\n if (item[currentSide]) {\n authMethod.push(item[currentSide]);\n if (item?.mrz_type) mrzTypes.push(item?.mrz_type);\n }\n });\n }\n return { authMethod: removeDuplicates(authMethod), mrzTypes: removeDuplicates(mrzTypes), regionMapping, key };\n }\n\n const getCorrespondingMrzType = (templatePath: string, mapping: any, selectedDocumentType: string = \"root\") => {\n if (!mapping || !mapping[selectedDocumentType]) return null;\n const fileName = templatePath.split(\"/\").pop()?.replace(\".jpg\", \"\").replace(\".png\", \"\");\n if (!fileName) return null;\n const pyName = `${fileName}.py`;\n const found = mapping[selectedDocumentType].find((item: any) => item.py_file === pyName);\n return found?.mrz_type || null;\n }\n\n const getCorrespondingAuthMethod = (templatePath: string, mapping: any, selectedDocumentType: string = \"root\", side: 'front' | 'back') => {\n if (!mapping || !mapping[selectedDocumentType]) return null;\n const fileName = templatePath.split(\"/\").pop()?.replace(\".jpg\", \"\").replace(\".png\", \"\");\n if (!fileName) return null;\n const pyName = `${fileName}.py`;\n const found = mapping[selectedDocumentType].find((item: any) => item.py_file === pyName);\n return found?.[side] || null;\n }\n\n const autoCapture = async (capturePath: string, verified: ISilentCaptureResult & { region?: string }) => {\n if (isProcessingCapture) return;\n setIsProcessingCapture(true);\n setProcessingImagePath(capturePath);\n try {\n let imagePathForUpload = capturePath;\n const overlayBbox = cameraConfig.overlay.bbox;\n const uiCropBbox = {\n minX: overlayBbox.xMin / 100,\n minY: overlayBbox.yMin / 100,\n width: (overlayBbox.xMax - overlayBbox.xMin) / 100,\n height: (overlayBbox.yMax - overlayBbox.yMin) / 100,\n };\n try {\n imagePathForUpload = await cropImageWithBBoxWithTolerance(capturePath, uiCropBbox, 0.06);\n } catch (e) {\n console.warn(\"Crop failed, falling back to original image\", e);\n imagePathForUpload = capturePath;\n }\n const base64 = await pathToBase64(imagePathForUpload);\n const newImages = {\n ...capturedImages,\n [currentSide]: { dir: imagePathForUpload, file: base64, mrz: verified.mrz || \"\", templatePath: verified.templatePath },\n };\n setCapturedImages(newImages);\n\n if (verified.country && verified.documentType) {\n onValueChange({\n ...newImages,\n country: verified.country,\n documentType: GovernmentDocumentTypeBackend[verified.documentType as keyof typeof GovernmentDocumentTypeBackend] || '',\n ...(verified.region ? { region: verified.region } : {}) \n });\n }\n\n setTimeout(() => {\n setShowCamera(false);\n actions.showCustomStepper(true);\n setSilentCaptureResult(prev => ({ ...prev, isAnalyzing: false }));\n setIsProcessingCapture(false);\n setProcessingImagePath(null);\n }, 600);\n } catch (e: any) {\n console.error(\"Backend Error:\", e);\n const friendlyError = state.currentLanguage === 'en' ? 'Unable to process document. Please try again.' : 'Impossible de traiter le document. Veuillez réessayer.';\n showAlert('Error', friendlyError);\n setSilentCaptureResult(prev => ({ ...prev, isAnalyzing: false, success: false }));\n setIsProcessingCapture(false);\n setProcessingImagePath(null);\n }\n };\n\n const handleSilentCapture = async (result: { success: boolean; path?: string; error?: string }) => {\n if (silentCaptureResult.isAnalyzing || isProcessingCapture) return;\n \n if (result.success && result.path) {\n setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: true, success: false, error: '' }));\n let templatePath = capturedImages[currentSide]?.templatePath || '';\n let templateBbox: IBbox | undefined;\n let templateResponse: any;\n \n if (!selectedDocumentType) {\n setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, success: false, error: 'Document type not selected' }));\n return;\n }\n\n const issuingSubdivision = selectedDocumentType.region !== 'root' ? selectedDocumentType.region : undefined;\n\n try {\n if (!templatePath) {\n const templateType = await checkTemplateType({ \n path: result.path || '', \n docType: selectedDocumentType?.type as GovernmentDocumentType, \n docRegion: countryData?.code || \"\", \n postfix: currentSide,\n issuingSubdivision: issuingSubdivision \n }, env);\n\n templateResponse = templateType;\n if (templateType.template_path) templatePath = templateType.template_path;\n \n if (templateType.card_obb) {\n const obbConfidence = getObbConfidence((templateType as any).card_obb);\n if (obbConfidence !== null && obbConfidence < OBB_CONFIDENCE_THRESHOLD) {\n setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, success: false, error: t('kyc.idCardCapture.cardNotFullyInFrame') }));\n return;\n }\n try {\n const crop = await cropByObb(result.path, (templateType as any).card_obb);\n templateBbox = crop.bbox;\n } catch { }\n }\n }\n\n const extractedCountryKey = templatePath ? templatePath.split('/')[0] : (ISO_TO_COUNTRY_NAME[countryData?.code || ''] || 'root');\n const regionMappings = getCurrentSideVerification(currentSide, extractedCountryKey);\n let verificationRes: any;\n\n if (currentSide === 'front') {\n const matchedAuthMethod = getCorrespondingAuthMethod(templatePath, regionMappings.regionMapping, regionMappings.key || '', 'front');\n const mrzType = getCorrespondingMrzType(templatePath, regionMappings.regionMapping, regionMappings.key || '') || 'TD1';\n \n verificationRes = await frontVerification({ \n path: result.path, \n regionMapping: { authMethod: matchedAuthMethod ? [matchedAuthMethod] : regionMappings.authMethod, mrzTypes: regionMappings.mrzTypes }, \n selectedDocumentType: GovernmentDocumentTypeShorted[selectedDocumentType?.type as keyof typeof GovernmentDocumentTypeShorted] || '', \n code: countryData?.code || '', \n currentSide, \n templatePath, \n mrzType,\n issuingSubdivision: issuingSubdivision \n }, env);\n } else {\n let matchedBackAuthMethod = getCorrespondingAuthMethod(templatePath, regionMappings.regionMapping, regionMappings.key || '', 'back');\n if (!matchedBackAuthMethod && currentSide === 'back') { matchedBackAuthMethod = 'MRZ'; }\n const backMrzType = getCorrespondingMrzType(templatePath, regionMappings.regionMapping, regionMappings.key || '') || '';\n \n // 🚨 EXTRACT FRONT TEMPLATE TO VALIDATE AGAINST BACK TEMPLATE\n const frontTemplatePath = capturedImages['front']?.templatePath || '';\n\n verificationRes = await backVerification({ \n path: result.path, \n regionMapping: { authMethod: matchedBackAuthMethod ? [matchedBackAuthMethod] : regionMappings.authMethod, mrzTypes: regionMappings.mrzTypes }, \n selectedDocumentType: GovernmentDocumentTypeShorted[selectedDocumentType.type as keyof typeof GovernmentDocumentTypeShorted] || '', \n code: countryData?.code || '', \n currentSide, \n templatePath, \n mrzType: backMrzType, \n templateResponse,\n issuingSubdivision: issuingSubdivision,\n frontTemplatePath: frontTemplatePath // 🚨 PASSED DOWN TO TRIGGER VALIDATION\n }, env);\n }\n\n const bbox = verificationRes?.bbox || templateBbox;\n const mrz = verificationRes?.mrz ? JSON.stringify(verificationRes.mrz) : \"\";\n \n const verifiedResult: ISilentCaptureResult & { region?: string } = { \n path: result.path, \n templatePath, \n bbox, \n success: true, \n mrz, \n isAnalyzing: false, \n country: countryData?.code, \n documentType: selectedDocumentType.type,\n region: issuingSubdivision \n };\n \n setSilentCaptureResult(verifiedResult);\n if (bbox) setBboxBySide(prev => ({ ...prev, [currentSide]: bbox }));\n \n await autoCapture(result.path, verifiedResult);\n\n } catch (error: any) {\n console.log(\"Backend Verification Error:\", error);\n const rawMessage = (error?.message || '').toLowerCase();\n let userFriendlyMessage ='Verification failed. Please try again.';\n \n if (rawMessage.includes('impossible') || rawMessage.includes('unreadable')) {\n userFriendlyMessage = 'Document unreadable. Please hold the camera steady in good light.';\n } else if (rawMessage.includes('country mismatch') || rawMessage.includes('pays sélectionné')) {\n userFriendlyMessage = 'The document does not match your selected country.';\n } else if (rawMessage.includes('card_not_fully_in_frame')) {\n userFriendlyMessage = 'Move closer to the document and ensure all corners are visible.';\n } else if (rawMessage.includes('ne correspond pas au recto')) { // 🚨 New Security Error Handler\n userFriendlyMessage = 'The back of the document does not match the front. You must scan the same ID.';\n }\n \n setSilentCaptureResult(prev => ({ ...prev, isAnalyzing: false, success: false, error: userFriendlyMessage }));\n }\n }\n };\n\n const handleError = (event: { message: string }) => {\n showAlert('Erreur', event.message);\n setShowCamera(false);\n setIsProcessingCapture(false);\n };\n\n useEffect(() => {\n actions.showCustomStepper(!showCamera);\n }, [showCamera]);\n\n if (!countrySelectionData || !selectedDocumentType) {\n return (\n <View style={styles.root}>\n <View style={styles.previewContainer}>\n <Text style={styles.title}>{getLocalizedText(component.labels)}</Text>\n <Text style={styles.description}>\n {state.currentLanguage === \"en\" ? \"Please complete the country and document selection first.\" : \"Veuillez d'abord compléter la sélection du pays et du document.\"}\n </Text>\n </View>\n </View>\n );\n }\n\n if (showCamera) {\n const isBusy = isProcessingCapture;\n if (isRebootingCamera) {\n return (\n <View style={[styles.root, { justifyContent: 'center', alignItems: 'center', backgroundColor: '#000' }]}>\n <ActivityIndicator size=\"large\" color=\"#2DBD60\" />\n <Text style={{ color: 'white', marginTop: 20, fontSize: 16 }}>Initializing Camera...</Text>\n </View>\n );\n }\n return (\n <View style={styles.root}>\n <View style={[styles.cameraWrapper, { flex: 1 }]}>\n <View style={styles.headerContainer}>\n <Text style={styles.headerTitle}>\n {selectedDocumentType ? (locale === 'en' ? getDocumentTypeInfo(selectedDocumentType.type).name.en : getDocumentTypeInfo(selectedDocumentType.type).name.fr) : ''}\n </Text>\n <View style={styles.stepBadge}>\n <Text style={styles.stepText}>\n {t('kyc.idCardCapture.captureTitle', { side: currentSide === 'front' ? locale === 'en' ? 'Front' : 'Recto' : locale === 'en' ? 'Back' : 'Verso' })}\n </Text>\n </View>\n </View>\n \n <View style={[styles.cameraFeedContainer, { flex: 1, backgroundColor: '#000' }]}>\n {Platform.OS === 'web' && (\n <View style={styles.webTopControls}>\n <TouchableOpacity style={styles.webFlipButton} onPress={toggleCameraLens}>\n <Text style={styles.webFlipText}>🔄 Flip Lens</Text>\n </TouchableOpacity>\n </View>\n )}\n \n <EnhancedCameraView\n key={`${currentSide}-${cameraKey}`}\n showCamera={true}\n isProcessing={isBusy}\n cameraType={cameraConfig.cameraType}\n style={{ ...StyleSheet.absoluteFillObject, ...(Platform.OS === 'web' ? { width: '100%', height: '100%', left: 0, top: 0 } as any : {}) }}\n onError={handleError}\n onSilentCapture={handleSilentCapture}\n silentCaptureResult={silentCaptureResult}\n overlayComponent={\n <>\n <IdCardOverlay\n xMin={cameraConfig.overlay.bbox.xMin} yMin={cameraConfig.overlay.bbox.yMin} xMax={cameraConfig.overlay.bbox.xMax} yMax={cameraConfig.overlay.bbox.yMax}\n instructions={cameraConfig.overlay.guideText}\n cornerOpacity={cameraConfig.overlay.bbox.cornerRadius || 0 as number}\n isSuccess={silentCaptureResult.success}\n language={state.currentLanguage}\n stepperProps={{\n back: () => {\n if (currentSide === 'back') {\n setCurrentSide('front'); setShowCamera(false); setIsProcessingCapture(false); setProcessingImagePath(null);\n if (capturedImages['front']?.dir) {\n const frontImage = capturedImages['front'];\n setSilentCaptureResult((prev) => ({ ...prev, path: frontImage.dir, success: true, isAnalyzing: false, error: '', mrz: frontImage.mrz || '', templatePath: frontImage.templatePath || '', bbox: bboxBySide['front'] }));\n } else { setSilentCaptureResult((prev) => ({ ...prev, path: '', success: false, isAnalyzing: false, error: '', templatePath: '' })); }\n } else { actions.previousComponent(); }\n },\n selectedDocumentType: selectedDocumentType ? (locale === 'en' ? getDocumentTypeInfo(selectedDocumentType.type).name.en : getDocumentTypeInfo(selectedDocumentType.type).name.fr) : '',\n step: state.currentComponentIndex + 1, totalSteps: state.template.components.length, side: currentSide,\n }}\n />\n </>\n }\n />\n \n {!isBusy && silentCaptureResult.isAnalyzing && (\n <View style={styles.topAnalyzingPillContainer}>\n <View style={styles.topAnalyzingPill}>\n <ActivityIndicator size=\"small\" color=\"white\" />\n <Text style={styles.analyzingPillText}>\n {state.currentLanguage === 'en' ? 'Scanning...' : 'Analyse...'}\n </Text>\n </View>\n </View>\n )}\n \n {isBusy && (\n <View style={[StyleSheet.absoluteFillObject, { zIndex: 9999 }]}>\n {processingImagePath && (\n <Image\n source={{ uri: processingImagePath.startsWith('file://') ? processingImagePath : `file://${processingImagePath}` }}\n style={StyleSheet.absoluteFillObject}\n resizeMode=\"cover\"\n />\n )}\n <View style={styles.processingOverlay}>\n <ActivityIndicator size=\"large\" color=\"#2DBD60\" />\n <Text style={styles.processingText}>\n {state.currentLanguage === 'en' ? 'Perfect!\\nProcessing Document...' : 'Parfait!\\nTraitement du document...'}\n </Text>\n </View>\n </View>\n )}\n \n {!isBusy && Platform.OS === 'web' ? (\n <View style={styles.webBottomControlBar}>\n {silentCaptureResult.error && (\n <View style={styles.floatingErrorBanner}>\n <Text style={styles.floatingErrorText}>⚠️ {silentCaptureResult.error}</Text>\n </View>\n )}\n <View style={styles.webActionButtonsRow}>\n <TouchableOpacity style={styles.webSecondaryButton} onPress={() => setShowCamera(false)}>\n <Text style={styles.webSecondaryButtonText}>Cancel</Text>\n </TouchableOpacity>\n <TouchableOpacity style={styles.webPrimaryButton} onPress={refreshCamera}>\n <Text style={styles.webPrimaryButtonText}>↻ Refresh Camera</Text>\n </TouchableOpacity>\n </View>\n </View>\n ) : !isBusy ? (\n <View style={styles.escapeHatchContainer}>\n <TouchableOpacity style={styles.fallbackRefreshButton} onPress={refreshCamera}>\n <Text style={styles.fallbackRefreshText}>↻ Refresh Camera</Text>\n </TouchableOpacity>\n <TouchableOpacity\n style={[styles.fallbackRefreshButton, { marginTop: 15, backgroundColor: 'rgba(220, 38, 38, 0.8)', borderColor: '#DC2626' }]}\n onPress={() => setShowCamera(false)}\n >\n <Text style={styles.fallbackRefreshText}>Cancel / Go Back</Text>\n </TouchableOpacity>\n </View>\n ) : null}\n \n {silentCaptureResult.error && !isBusy && Platform.OS !== 'web' ? (\n <View style={[styles.floatingErrorBanner, { zIndex: 10000 }]}>\n <Text style={styles.floatingErrorText}>⚠️ {silentCaptureResult.error}</Text>\n </View>\n ) : null}\n </View>\n </View>\n </View>\n );\n }\n\n return (\n <View style={styles.root}>\n <View style={styles.previewContainer}>\n <ScrollView style={styles.previewItemContainer} showsVerticalScrollIndicator={false}>\n <View key={currentSide} style={styles.sideContainer}>\n <Text style={styles.sideTitle}>\n {t('kyc.idCardCapture.captureTitle', { side: currentSide === 'front' ? locale === 'en' ? 'Front' : 'Recto' : locale === 'en' ? 'Back' : 'Verso' })}\n </Text>\n <Text style={{ fontSize: 14, color: '#666', textAlign: 'center', marginBottom: 16, lineHeight: 22 }}>\n {getLocalizedText(component.instructions)}\n </Text>\n <View style={{ alignItems: 'center', justifyContent: 'center', flexDirection: \"column\", gap: 16 }}>\n <View style={styles.imagePreviewWrapper}>\n {capturedImages[currentSide]?.dir ? (\n <Image source={{ uri: capturedImages[currentSide].dir }} style={styles.previewImage} />\n ) : silentCaptureResult.path ? (\n <Image source={{ uri: silentCaptureResult.path }} style={styles.previewImage} />\n ) : null}\n </View>\n {!capturedImages[currentSide]?.dir && (\n <View style={{ width: '100%', gap: 12 }}>\n <Button\n title={state.currentLanguage === \"en\" ? \"Start Scanning\" : \"Commencer la numérisation\"}\n onPress={() => { setShowCamera(true); refreshCamera(); actions.showCustomStepper(false); }}\n variant=\"primary\" size=\"large\" fullWidth\n />\n {Platform.OS === 'web' && (\n <Button\n title={state.currentLanguage === \"en\" ? \"Continue on Phone\" : \"Continuer sur le téléphone\"}\n onPress={() => setShowQRModal(true)}\n variant=\"outline\" size=\"large\" fullWidth\n />\n )}\n </View>\n )}\n {capturedImages[currentSide]?.dir && (\n <>\n <Button title={t('kyc.idCardCapture.retakeButton')} onPress={() => retakePicture(currentSide)} variant=\"outline\" size=\"medium\" fullWidth />\n <Button title={t('common.next')} onPress={() => {\n if (!selectedDocumentType) { showAlert('Error', 'Document type not selected'); return; }\n if (currentSide === 'back' || selectedDocumentType.type === 'passport') {\n actions.nextComponent();\n } else {\n setShowCamera(true); refreshCamera(); setCurrentSide('back'); setSilentCaptureResult({ success: false, isAnalyzing: false, path: '', error: '', templatePath: undefined }); setIsProcessingCapture(false); setProcessingImagePath(null);\n }\n }} variant=\"primary\" size=\"large\" fullWidth />\n </>\n )}\n </View>\n </View>\n </ScrollView>\n </View>\n {showQRModal && Platform.OS === 'web' && (\n <View style={styles.qrModalOverlay}>\n <View style={styles.qrModalContainer}>\n <Text style={styles.qrModalTitle}>\n {state.currentLanguage === 'en' ? 'Scan to continue' : 'Scannez pour continuer'}\n </Text>\n <Text style={styles.qrModalText}>\n {state.currentLanguage === 'en' ? \"Point your phone's camera at this QR code to seamlessly continue the process on your mobile device.\" : \"Pointez l'appareil photo de votre téléphone vers ce code QR pour continuer le processus en toute fluidité sur votre appareil mobile.\"}\n </Text>\n <View style={styles.qrCodeWrapper}>\n <QRCode value={currentUrl} size={220} backgroundColor=\"transparent\" />\n </View>\n <Button title={state.currentLanguage === 'en' ? \"Close\" : \"Fermer\"} onPress={() => setShowQRModal(false)} variant=\"outline\" fullWidth />\n </View>\n </View>\n )}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n root: { flex: 1, width: '100%', backgroundColor: 'transparent', alignSelf: 'center', ...Platform.select({ web: { minHeight: '85vh', justifyContent: 'center', alignItems: 'center' } as any, }) },\n cameraWrapper: { width: '100%', backgroundColor: '#000000', overflow: 'hidden', ...Platform.select({ web: { maxWidth: 1000, width: '95%', height: '80vh', minHeight: 600, borderRadius: 24, shadowColor: '#000', shadowOffset: { width: 0, height: 10 }, shadowOpacity: 0.15, shadowRadius: 30, elevation: 24 } as any, default: { flex: 1 } }) },\n headerContainer: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', flexWrap: 'wrap', gap: 10, paddingHorizontal: 20, paddingVertical: 18, backgroundColor: '#FFFFFF', borderBottomWidth: 1, borderBottomColor: '#F1F5F9', zIndex: 10, ...Platform.select({ web: { display: 'flex' }, default: { display: 'none' } }) },\n headerTitle: { fontSize: 18, fontWeight: '700', color: '#0F172A', flexShrink: 1 },\n stepBadge: { backgroundColor: '#F1F5F9', paddingHorizontal: 12, paddingVertical: 6, borderRadius: 20, },\n stepText: { fontSize: 13, fontWeight: '600', color: '#64748B', },\n cameraFeedContainer: { flex: 1, position: 'relative', backgroundColor: '#000', },\n escapeHatchContainer: { position: 'absolute', bottom: 40, left: 0, right: 0, alignItems: 'center', justifyContent: 'center', zIndex: 99999 },\n fallbackRefreshButton: { backgroundColor: 'rgba(0, 0, 0, 0.8)', borderWidth: 1, borderColor: 'rgba(255, 255, 255, 0.5)', paddingVertical: 12, paddingHorizontal: 24, borderRadius: 24, shadowColor: '#000', shadowOffset: { width: 0, height: 4 }, shadowOpacity: 0.3, shadowRadius: 5, elevation: 8 },\n fallbackRefreshText: { color: '#FFFFFF', fontWeight: 'bold', fontSize: 16 },\n webBottomControlBar: { position: 'absolute', bottom: 0, left: 0, right: 0, paddingHorizontal: 24, paddingBottom: 24, paddingTop: 30, backgroundColor: 'rgba(0,0,0,0.6)', zIndex: 99999 },\n webActionButtonsRow: { flexDirection: 'row', justifyContent: 'center', gap: 16, marginTop: 12, maxWidth: 500, alignSelf: 'center', width: '100%' },\n webPrimaryButton: { flex: 1, backgroundColor: '#2DBD60', paddingVertical: 14, borderRadius: 12, alignItems: 'center' },\n webPrimaryButtonText: { color: 'white', fontWeight: 'bold', fontSize: 16 },\n webSecondaryButton: { flex: 1, backgroundColor: 'rgba(255,255,255,0.15)', borderWidth: 1, borderColor: 'rgba(255,255,255,0.3)', paddingVertical: 14, borderRadius: 12, alignItems: 'center' },\n webSecondaryButtonText: { color: 'white', fontWeight: 'bold', fontSize: 16 },\n webTopControls: { position: 'absolute', top: Platform.OS === 'ios' ? 70 : 20, right: 20, zIndex: 9999 },\n webFlipButton: { backgroundColor: 'rgba(0,0,0,0.6)', paddingHorizontal: 16, paddingVertical: 10, borderRadius: 20, borderWidth: 1, borderColor: 'rgba(255,255,255,0.4)', ...Platform.select({ web: { backdropFilter: 'blur(4px)' } as any }) },\n webFlipText: { color: 'white', fontWeight: 'bold', fontSize: 14 },\n previewContainer: { width: '100%', backgroundColor: 'white', borderRadius: 12, paddingVertical: 30, paddingHorizontal: 24, shadowColor: '#000', shadowOffset: { width: 0, height: 4 }, shadowOpacity: 0.08, shadowRadius: 16, elevation: 8, ...Platform.select({ web: { alignSelf: 'center', maxWidth: 650 }, default: { margin: 10, width: '95%' }}) },\n previewItemContainer: { flexGrow: 1, },\n title: { fontSize: 24, fontWeight: 'bold', color: '#333', marginBottom: 8, textAlign: 'center' },\n description: { fontSize: 16, color: '#666', textAlign: 'center', marginBottom: 24, lineHeight: 22 },\n sideContainer: { marginBottom: 24 },\n sideTitle: { fontSize: 22, fontWeight: 'bold', color: '#000', marginBottom: 12, textAlign: 'center' },\n imagePreviewWrapper: { width: '100%', borderRadius: 12, padding: 1, overflow: 'hidden', shadowColor: '#000', shadowOffset: { width: 0, height: 4 }, shadowOpacity: 0.12, shadowRadius: 8, elevation: 8, backgroundColor: '#f0f0f0', ...Platform.select({ web: { aspectRatio: 1.59, height: 'auto', maxWidth: 450, alignSelf: 'center' } as any, default: { height: 220 } }) },\n previewImage: { width: '100%', height: '100%', borderRadius: 12, resizeMode: 'cover' },\n floatingErrorBanner: { backgroundColor: '#FEF2F2', borderWidth: 1, borderColor: '#FCA5A5', paddingVertical: 12, paddingHorizontal: 16, borderRadius: 12, alignItems: 'center', justifyContent: 'center', width: '100%', ...Platform.select({ web: { position: 'absolute', bottom: '100%', marginBottom: 16, maxWidth: 500, alignSelf: 'center', zIndex: 100000, boxShadow: '0 4px 12px rgba(0,0,0,0.15)' } as any, default: { position: 'absolute', top: Platform.OS === 'ios' ? 90 : 70, left: 24, right: 24, zIndex: 10000 } }) },\n floatingErrorText: { color: '#991B1B', fontSize: 14, fontWeight: '700', textAlign: 'center' },\n processingOverlay: { flex: 1, backgroundColor: 'rgba(0, 0, 0, 0.7)', justifyContent: 'center', alignItems: 'center', zIndex: 9999, ...Platform.select({ web: { backdropFilter: 'blur(4px)' } as any }) },\n processingText: { color: '#FFF', fontSize: 18, fontWeight: 'bold', marginTop: 16, textAlign: 'center' },\n errorText: { color: '#dc2626', fontSize: 14, marginTop: 8, textAlign: 'center' },\n topAnalyzingPillContainer: { position: 'absolute', top: Platform.OS === 'android' ? 60 : 75, left: 0, right: 0, alignItems: 'center', zIndex: 100 },\n topAnalyzingPill: { flexDirection: 'row', alignItems: 'center', backgroundColor: 'rgba(0,0,0,0.7)', paddingVertical: 10, paddingHorizontal: 20, borderRadius: 30, gap: 10, shadowColor: '#000', shadowOffset: {width: 0, height: 4}, shadowOpacity: 0.3, shadowRadius: 8 },\n analyzingPillText: { color: 'white', fontSize: 14, fontWeight: 'bold' },\n qrModalOverlay: { ...StyleSheet.absoluteFillObject, backgroundColor: 'rgba(0,0,0,0.6)', justifyContent: 'center', alignItems: 'center', zIndex: 999999, ...Platform.select({ web: { backdropFilter: 'blur(5px)' } as any }) },\n qrModalContainer: { backgroundColor: '#FFFFFF', borderRadius: 24, padding: 32, width: '90%', maxWidth: 400, alignItems: 'center', shadowColor: '#000', shadowOffset: { width: 0, height: 10 }, shadowOpacity: 0.15, shadowRadius: 30, elevation: 24, },\n qrModalTitle: { fontSize: 22, fontWeight: 'bold', color: '#0F172A', marginBottom: 12, textAlign: 'center' },\n qrModalText: { fontSize: 15, color: '#64748B', textAlign: 'center', marginBottom: 24, lineHeight: 22, },\n qrCodeWrapper: { padding: 16, backgroundColor: '#FFFFFF', borderRadius: 16, borderWidth: 1, borderColor: '#E2E8F0', marginBottom: 24, }\n});"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VerificationProgressTemplate.d.ts","sourceRoot":"","sources":["../../../../src/components/KYCElements/VerificationProgressTemplate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAM1D,UAAU,iCAAiC;IACzC,SAAS,EAAE,iBAAiB,CAAC;IAC7B,KAAK,EAAE,OAAO,CAAC;IACf,aAAa,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,4BAA4B,EAAE,KAAK,CAAC,EAAE,CAAC,iCAAiC,
|
|
1
|
+
{"version":3,"file":"VerificationProgressTemplate.d.ts","sourceRoot":"","sources":["../../../../src/components/KYCElements/VerificationProgressTemplate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAM1D,UAAU,iCAAiC;IACzC,SAAS,EAAE,iBAAiB,CAAC;IAC7B,KAAK,EAAE,OAAO,CAAC;IACf,aAAa,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,4BAA4B,EAAE,KAAK,CAAC,EAAE,CAAC,iCAAiC,CAuMpF,CAAC"}
|
|
@@ -18,12 +18,25 @@ export const VerificationProgressTemplate = () => {
|
|
|
18
18
|
try {
|
|
19
19
|
logger.log(`Starting verification check (attempt ${currentRetryCount + 1}/${maxRetries + 1})`);
|
|
20
20
|
const result = await kycService.getVerificationResult(state.session.session_id);
|
|
21
|
+
logger.log('getVerificationResult raw result:', JSON.stringify(result, null, 2));
|
|
22
|
+
if (result?.status === 'Failed.' || result?.status === 'failed' || result?.status === 'rejected') {
|
|
23
|
+
actions.setVerificationState({
|
|
24
|
+
status: 'failed',
|
|
25
|
+
result: {
|
|
26
|
+
referenceId: state.session.session_id,
|
|
27
|
+
issues: [result?.message || 'Verification failed. Sent for manual review.']
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
setIsRetrying(false);
|
|
31
|
+
return; // Break out of the function so it DOES NOT RETRY
|
|
32
|
+
}
|
|
33
|
+
// Check standard nested payload format
|
|
21
34
|
const responseData = result?.data;
|
|
22
35
|
const verificationResult = responseData?.[state.session.session_id]?.data;
|
|
23
36
|
if (!verificationResult) {
|
|
37
|
+
// If we still didn't get data and the status wasn't failed, throw to trigger a retry
|
|
24
38
|
throw new Error('Verification payload missing for current session');
|
|
25
39
|
}
|
|
26
|
-
logger.log('getVerificationResult result', JSON.stringify({ result, verificationResult }, null, 2));
|
|
27
40
|
// Vérifier le statut de vérification
|
|
28
41
|
if (verificationResult.verification_status === null || verificationResult.verification_status === "processing" || verificationResult.verification_status === "pending") {
|
|
29
42
|
if (currentRetryCount < maxRetries) {
|
|
@@ -31,16 +44,13 @@ export const VerificationProgressTemplate = () => {
|
|
|
31
44
|
setRetryCount(nextRetryCount);
|
|
32
45
|
setIsRetrying(true);
|
|
33
46
|
logger.log(`Verification still processing, retrying in 10s... (${nextRetryCount}/${maxRetries})`);
|
|
34
|
-
|
|
35
|
-
if (timeoutId) {
|
|
47
|
+
if (timeoutId)
|
|
36
48
|
clearTimeout(timeoutId);
|
|
37
|
-
}
|
|
38
|
-
// Attendre 10 secondes avant de relancer
|
|
39
49
|
const newTimeoutId = setTimeout(() => {
|
|
40
50
|
getVerificationResult(nextRetryCount, maxRetries);
|
|
41
51
|
}, 10000);
|
|
42
52
|
setTimeoutId(newTimeoutId);
|
|
43
|
-
return;
|
|
53
|
+
return;
|
|
44
54
|
}
|
|
45
55
|
else {
|
|
46
56
|
logger.error('Max retries reached, verification still processing');
|
|
@@ -49,22 +59,18 @@ export const VerificationProgressTemplate = () => {
|
|
|
49
59
|
}
|
|
50
60
|
}
|
|
51
61
|
// Traiter le résultat final (success, failed, etc.)
|
|
52
|
-
if (verificationResult.verification_status === "completed" ||
|
|
53
|
-
verificationResult.verification_status === "approved") {
|
|
54
|
-
// Mettre à jour l'état avec le succès
|
|
62
|
+
if (verificationResult.verification_status === "completed" || verificationResult.verification_status === "approved") {
|
|
55
63
|
actions.setVerificationState({
|
|
56
64
|
status: 'success',
|
|
57
65
|
result: result
|
|
58
66
|
});
|
|
59
67
|
}
|
|
60
|
-
else if (verificationResult.verification_status === "failed" ||
|
|
61
|
-
verificationResult.verification_status === "rejected") {
|
|
62
|
-
// Mettre à jour l'état avec l'échec
|
|
68
|
+
else if (verificationResult.verification_status === "failed" || verificationResult.verification_status === "rejected") {
|
|
63
69
|
actions.setVerificationState({
|
|
64
70
|
status: 'failed',
|
|
65
71
|
result: {
|
|
66
|
-
referenceId: verificationResult.verification_id,
|
|
67
|
-
issues: ['Verification failed']
|
|
72
|
+
referenceId: verificationResult.verification_id || state.session.session_id,
|
|
73
|
+
issues: ['Verification failed during processing.']
|
|
68
74
|
}
|
|
69
75
|
});
|
|
70
76
|
}
|
|
@@ -72,16 +78,13 @@ export const VerificationProgressTemplate = () => {
|
|
|
72
78
|
}
|
|
73
79
|
catch (error) {
|
|
74
80
|
logger.error('getVerificationResult error', JSON.stringify(errorMessage(error) || { message: error?.message || 'Unknown error' }, null, 2));
|
|
75
|
-
// En cas d'erreur, on peut aussi retry
|
|
76
81
|
if (currentRetryCount < maxRetries) {
|
|
77
82
|
const nextRetryCount = currentRetryCount + 1;
|
|
78
83
|
setRetryCount(nextRetryCount);
|
|
79
84
|
setIsRetrying(true);
|
|
80
85
|
logger.log(`getVerificationResult Error occurred, retrying in 10s... (${nextRetryCount}/${maxRetries})`);
|
|
81
|
-
|
|
82
|
-
if (timeoutId) {
|
|
86
|
+
if (timeoutId)
|
|
83
87
|
clearTimeout(timeoutId);
|
|
84
|
-
}
|
|
85
88
|
const newTimeoutId = setTimeout(() => {
|
|
86
89
|
getVerificationResult(nextRetryCount, maxRetries);
|
|
87
90
|
}, 10000);
|
|
@@ -98,12 +101,10 @@ export const VerificationProgressTemplate = () => {
|
|
|
98
101
|
getVerificationResult();
|
|
99
102
|
}
|
|
100
103
|
}, [state.session.session_id]);
|
|
101
|
-
// Nettoyage des timeouts lors du démontage du composant
|
|
102
104
|
useEffect(() => {
|
|
103
105
|
return () => {
|
|
104
|
-
if (timeoutId)
|
|
106
|
+
if (timeoutId)
|
|
105
107
|
clearTimeout(timeoutId);
|
|
106
|
-
}
|
|
107
108
|
};
|
|
108
109
|
}, [timeoutId]);
|
|
109
110
|
if (isSuccess) {
|
|
@@ -119,17 +120,25 @@ export const VerificationProgressTemplate = () => {
|
|
|
119
120
|
if (isFailed) {
|
|
120
121
|
return (<View style={styles.container}>
|
|
121
122
|
<Text style={styles.title}>{t('kyc.verificationProgress.status.failed')}</Text>
|
|
122
|
-
|
|
123
|
+
|
|
123
124
|
<View style={styles.issuesBox}>
|
|
124
125
|
<Text style={styles.issuesTitle}>{t('common.error')}</Text>
|
|
125
126
|
{Array.isArray(verification.result?.issues) && verification.result.issues.map((issue, idx) => (<Text key={idx} style={styles.issueItem}>• {issue}</Text>))}
|
|
126
127
|
</View>
|
|
127
|
-
|
|
128
|
-
|
|
128
|
+
|
|
129
|
+
{/* 🚨 FIX 2: Give the user actionable options to End or Restart */}
|
|
130
|
+
<TouchableOpacity style={[styles.button, styles.primary]} onPress={() => actions.submitVerification()}>
|
|
131
|
+
<Text style={styles.buttonText}>
|
|
132
|
+
{state.currentLanguage === 'en' ? 'OK / Finish' : 'Terminer'}
|
|
133
|
+
</Text>
|
|
129
134
|
</TouchableOpacity>
|
|
130
|
-
|
|
131
|
-
|
|
135
|
+
|
|
136
|
+
<TouchableOpacity style={[styles.button, styles.secondary]} onPress={() => actions.resetTemplate()}>
|
|
137
|
+
<Text style={styles.secondaryText}>
|
|
138
|
+
{state.currentLanguage === 'en' ? 'Start Over' : 'Recommencer'}
|
|
139
|
+
</Text>
|
|
132
140
|
</TouchableOpacity>
|
|
141
|
+
|
|
133
142
|
{verification.result?.referenceId ? (<Text style={styles.refText}>{`Reference ID: ${verification.result.referenceId}`}</Text>) : null}
|
|
134
143
|
</View>);
|
|
135
144
|
}
|
|
@@ -140,7 +149,6 @@ export const VerificationProgressTemplate = () => {
|
|
|
140
149
|
? `${t('kyc.verificationProgress.retrying', { current: retryCount, max: 40 })}`
|
|
141
150
|
: t('kyc.verificationProgress.estimatedTime')}
|
|
142
151
|
</Text>
|
|
143
|
-
|
|
144
152
|
<View style={styles.timeline}>
|
|
145
153
|
<View style={[styles.dot, styles.done]}><Text style={styles.stepCheckmark}>✓</Text></View>
|
|
146
154
|
<View style={styles.line}/>
|
|
@@ -148,13 +156,11 @@ export const VerificationProgressTemplate = () => {
|
|
|
148
156
|
<View style={styles.line}/>
|
|
149
157
|
<View style={[styles.dot, styles.pending]}><Text style={styles.stepCheckmark}>3</Text></View>
|
|
150
158
|
</View>
|
|
151
|
-
|
|
152
159
|
<View style={styles.row}>
|
|
153
160
|
<Text style={styles.stepLabel}>{t('kyc.verificationProgress.status.completed')}</Text>
|
|
154
161
|
<Text style={styles.stepLabel}>{t('kyc.verificationProgress.steps.analyzing')}</Text>
|
|
155
162
|
<Text style={styles.stepLabel}>{t('kyc.verificationProgress.steps.verifying')}</Text>
|
|
156
163
|
</View>
|
|
157
|
-
|
|
158
164
|
<View style={styles.card}>
|
|
159
165
|
<Text style={styles.cardTitle}>{t('kyc.idCardCapture.title')}</Text>
|
|
160
166
|
<Text style={styles.cardLine}>{t('kyc.verificationProgress.steps.extracting')}</Text>
|
|
@@ -185,15 +191,14 @@ const styles = StyleSheet.create({
|
|
|
185
191
|
card: { backgroundColor: 'white', padding: 16, borderRadius: 16, marginTop: 24 },
|
|
186
192
|
cardTitle: { fontSize: 16, color: '#6B7280', marginTop: 8 },
|
|
187
193
|
cardLine: { fontSize: 18, color: '#111827', fontWeight: '600', marginTop: 2 },
|
|
188
|
-
|
|
189
|
-
button: { paddingVertical: 14, borderRadius: 10, alignItems: 'center', marginTop: 20 },
|
|
194
|
+
button: { paddingVertical: 14, borderRadius: 10, alignItems: 'center', marginTop: 14 },
|
|
190
195
|
primary: { backgroundColor: '#2DBD60' },
|
|
191
196
|
buttonText: { color: 'white', fontSize: 16, fontWeight: '600' },
|
|
192
197
|
refText: { marginTop: 12, textAlign: 'center', color: '#6B7280' },
|
|
193
198
|
issuesBox: { backgroundColor: '#FEF2F2', borderRadius: 16, padding: 16, marginTop: 20 },
|
|
194
199
|
issuesTitle: { color: '#991B1B', fontWeight: '700', marginBottom: 8 },
|
|
195
200
|
issueItem: { color: '#991B1B', marginTop: 4 },
|
|
196
|
-
secondary: { backgroundColor: '#F3F4F6' },
|
|
197
|
-
secondaryText: { color: '#
|
|
201
|
+
secondary: { backgroundColor: '#F3F4F6', borderWidth: 1, borderColor: '#D1D5DB' },
|
|
202
|
+
secondaryText: { color: '#374151', fontSize: 16, fontWeight: '600' },
|
|
198
203
|
});
|
|
199
204
|
//# sourceMappingURL=VerificationProgressTemplate.js.map
|