@trustchex/react-native-sdk 1.355.1 → 1.357.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.
Files changed (254) hide show
  1. package/README.md +2 -9
  2. package/TrustchexSDK.podspec +5 -4
  3. package/android/build.gradle +6 -4
  4. package/android/src/main/AndroidManifest.xml +1 -1
  5. package/android/src/main/java/com/trustchex/reactnativesdk/TrustchexSDKPackage.kt +45 -25
  6. package/android/src/main/java/com/trustchex/reactnativesdk/camera/TrustchexCameraManager.kt +168 -0
  7. package/android/src/main/java/com/trustchex/reactnativesdk/camera/TrustchexCameraView.kt +871 -0
  8. package/android/src/main/java/com/trustchex/reactnativesdk/mlkit/MLKitModule.kt +245 -0
  9. package/android/src/main/java/com/trustchex/reactnativesdk/mrz/MRZValidationModule.kt +785 -0
  10. package/android/src/main/java/com/trustchex/reactnativesdk/mrz/MRZValidator.kt +419 -0
  11. package/android/src/main/java/com/trustchex/reactnativesdk/opencv/OpenCVModule.kt +818 -0
  12. package/ios/Camera/TrustchexCameraManager.m +37 -0
  13. package/ios/Camera/TrustchexCameraManager.swift +125 -0
  14. package/ios/Camera/TrustchexCameraView.swift +1176 -0
  15. package/ios/MLKit/MLKitModule.m +23 -0
  16. package/ios/MLKit/MLKitModule.swift +250 -0
  17. package/ios/MRZValidation.m +39 -0
  18. package/ios/MRZValidation.swift +802 -0
  19. package/ios/MRZValidator.swift +466 -0
  20. package/ios/OpenCV/OpenCVModule.h +4 -0
  21. package/ios/OpenCV/OpenCVModule.mm +810 -0
  22. package/lib/module/Screens/Dynamic/IdentityDocumentEIDScanningScreen.js +2 -3
  23. package/lib/module/Screens/Dynamic/IdentityDocumentScanningScreen.js +1 -2
  24. package/lib/module/Screens/Dynamic/LivenessDetectionScreen.js +418 -193
  25. package/lib/module/Screens/Static/OTPVerificationScreen.js +11 -11
  26. package/lib/module/Screens/Static/QrCodeScanningScreen.js +5 -1
  27. package/lib/module/Screens/Static/ResultScreen.js +25 -2
  28. package/lib/module/Screens/Static/VerificationSessionCheckScreen.js +25 -7
  29. package/lib/module/Shared/Components/DebugNavigationPanel.js +234 -24
  30. package/lib/module/Shared/Components/EIDScanner.js +99 -9
  31. package/lib/module/Shared/Components/FaceCamera.js +170 -179
  32. package/lib/module/Shared/Components/IdentityDocumentCamera.js +2151 -771
  33. package/lib/module/Shared/Components/QrCodeScannerCamera.js +109 -107
  34. package/lib/module/Shared/Components/TrustchexCamera.js +122 -0
  35. package/lib/module/Shared/EIDReader/tlv/tlv.helpers.js +91 -0
  36. package/lib/module/Shared/EIDReader/tlv/tlv.utils.js +2 -124
  37. package/lib/module/Shared/EIDReader/tlv/tlvInputStream.js +4 -4
  38. package/lib/module/Shared/EIDReader/tlv/tlvOutputState.js +4 -4
  39. package/lib/module/Shared/EIDReader/tlv/tlvOutputStream.js +4 -4
  40. package/lib/module/Shared/Libs/analytics.utils.js +2 -2
  41. package/lib/module/Shared/Libs/debug.utils.js +132 -0
  42. package/lib/module/Shared/Libs/deeplink.utils.js +6 -5
  43. package/lib/module/Shared/Libs/demo.utils.js +13 -3
  44. package/lib/module/Shared/Libs/mrz.utils.js +1 -175
  45. package/lib/module/Shared/Libs/native-device-info.utils.js +12 -6
  46. package/lib/module/Shared/Libs/tts.utils.js +40 -6
  47. package/lib/module/Shared/Services/AnalyticsService.js +9 -8
  48. package/lib/module/Shared/Types/mrzFields.js +1 -0
  49. package/lib/module/Translation/Resources/en.js +87 -88
  50. package/lib/module/Translation/Resources/tr.js +84 -85
  51. package/lib/module/Trustchex.js +9 -2
  52. package/lib/module/index.js +1 -0
  53. package/lib/module/version.js +1 -1
  54. package/lib/typescript/src/Screens/Dynamic/IdentityDocumentEIDScanningScreen.d.ts.map +1 -1
  55. package/lib/typescript/src/Screens/Dynamic/IdentityDocumentScanningScreen.d.ts.map +1 -1
  56. package/lib/typescript/src/Screens/Dynamic/LivenessDetectionScreen.d.ts.map +1 -1
  57. package/lib/typescript/src/Screens/Static/OTPVerificationScreen.d.ts.map +1 -1
  58. package/lib/typescript/src/Screens/Static/QrCodeScanningScreen.d.ts.map +1 -1
  59. package/lib/typescript/src/Screens/Static/ResultScreen.d.ts.map +1 -1
  60. package/lib/typescript/src/Screens/Static/VerificationSessionCheckScreen.d.ts.map +1 -1
  61. package/lib/typescript/src/Shared/Components/DebugNavigationPanel.d.ts.map +1 -1
  62. package/lib/typescript/src/Shared/Components/EIDScanner.d.ts +2 -2
  63. package/lib/typescript/src/Shared/Components/EIDScanner.d.ts.map +1 -1
  64. package/lib/typescript/src/Shared/Components/FaceCamera.d.ts +18 -4
  65. package/lib/typescript/src/Shared/Components/FaceCamera.d.ts.map +1 -1
  66. package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.d.ts +3 -4
  67. package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.d.ts.map +1 -1
  68. package/lib/typescript/src/Shared/Components/QrCodeScannerCamera.d.ts +2 -1
  69. package/lib/typescript/src/Shared/Components/QrCodeScannerCamera.d.ts.map +1 -1
  70. package/lib/typescript/src/Shared/Components/TrustchexCamera.d.ts +124 -0
  71. package/lib/typescript/src/Shared/Components/TrustchexCamera.d.ts.map +1 -0
  72. package/lib/typescript/src/Shared/EIDReader/tlv/tlv.helpers.d.ts +11 -0
  73. package/lib/typescript/src/Shared/EIDReader/tlv/tlv.helpers.d.ts.map +1 -0
  74. package/lib/typescript/src/Shared/EIDReader/tlv/tlv.utils.d.ts +2 -39
  75. package/lib/typescript/src/Shared/EIDReader/tlv/tlv.utils.d.ts.map +1 -1
  76. package/lib/typescript/src/Shared/Libs/analytics.utils.d.ts.map +1 -1
  77. package/lib/typescript/src/Shared/Libs/debug.utils.d.ts +42 -0
  78. package/lib/typescript/src/Shared/Libs/debug.utils.d.ts.map +1 -0
  79. package/lib/typescript/src/Shared/Libs/deeplink.utils.d.ts.map +1 -1
  80. package/lib/typescript/src/Shared/Libs/demo.utils.d.ts.map +1 -1
  81. package/lib/typescript/src/Shared/Libs/http-client.d.ts.map +1 -1
  82. package/lib/typescript/src/Shared/Libs/mrz.utils.d.ts +0 -4
  83. package/lib/typescript/src/Shared/Libs/mrz.utils.d.ts.map +1 -1
  84. package/lib/typescript/src/Shared/Libs/native-device-info.utils.d.ts.map +1 -1
  85. package/lib/typescript/src/Shared/Libs/tts.utils.d.ts +4 -3
  86. package/lib/typescript/src/Shared/Libs/tts.utils.d.ts.map +1 -1
  87. package/lib/typescript/src/Shared/Services/AnalyticsService.d.ts.map +1 -1
  88. package/lib/typescript/src/Shared/Types/identificationInfo.d.ts +2 -2
  89. package/lib/typescript/src/Shared/Types/identificationInfo.d.ts.map +1 -1
  90. package/lib/typescript/src/Shared/Types/mrzFields.d.ts +11 -0
  91. package/lib/typescript/src/Shared/Types/mrzFields.d.ts.map +1 -0
  92. package/lib/typescript/src/Translation/Resources/en.d.ts +4 -5
  93. package/lib/typescript/src/Translation/Resources/en.d.ts.map +1 -1
  94. package/lib/typescript/src/Translation/Resources/tr.d.ts +4 -5
  95. package/lib/typescript/src/Translation/Resources/tr.d.ts.map +1 -1
  96. package/lib/typescript/src/Trustchex.d.ts +2 -0
  97. package/lib/typescript/src/Trustchex.d.ts.map +1 -1
  98. package/lib/typescript/src/index.d.ts +1 -0
  99. package/lib/typescript/src/index.d.ts.map +1 -1
  100. package/lib/typescript/src/version.d.ts +1 -1
  101. package/package.json +4 -35
  102. package/src/Screens/Dynamic/ContractAcceptanceScreen.tsx +1 -1
  103. package/src/Screens/Dynamic/IdentityDocumentEIDScanningScreen.tsx +7 -5
  104. package/src/Screens/Dynamic/IdentityDocumentScanningScreen.tsx +2 -3
  105. package/src/Screens/Dynamic/LivenessDetectionScreen.tsx +498 -216
  106. package/src/Screens/Static/OTPVerificationScreen.tsx +37 -31
  107. package/src/Screens/Static/QrCodeScanningScreen.tsx +8 -1
  108. package/src/Screens/Static/ResultScreen.tsx +136 -88
  109. package/src/Screens/Static/VerificationSessionCheckScreen.tsx +46 -13
  110. package/src/Shared/Components/DebugNavigationPanel.tsx +290 -34
  111. package/src/Shared/Components/EIDScanner.tsx +94 -16
  112. package/src/Shared/Components/FaceCamera.tsx +236 -203
  113. package/src/Shared/Components/IdentityDocumentCamera.tsx +3073 -1030
  114. package/src/Shared/Components/QrCodeScannerCamera.tsx +133 -127
  115. package/src/Shared/Components/TrustchexCamera.tsx +289 -0
  116. package/src/Shared/Config/camera-enhancement.config.ts +2 -2
  117. package/src/Shared/EIDReader/tlv/tlv.helpers.ts +96 -0
  118. package/src/Shared/EIDReader/tlv/tlv.utils.ts +2 -125
  119. package/src/Shared/EIDReader/tlv/tlvInputStream.ts +4 -4
  120. package/src/Shared/EIDReader/tlv/tlvOutputState.ts +4 -4
  121. package/src/Shared/EIDReader/tlv/tlvOutputStream.ts +4 -4
  122. package/src/Shared/Libs/analytics.utils.ts +48 -20
  123. package/src/Shared/Libs/debug.utils.ts +149 -0
  124. package/src/Shared/Libs/deeplink.utils.ts +7 -5
  125. package/src/Shared/Libs/demo.utils.ts +4 -0
  126. package/src/Shared/Libs/http-client.ts +12 -8
  127. package/src/Shared/Libs/mrz.utils.ts +1 -163
  128. package/src/Shared/Libs/native-device-info.utils.ts +12 -6
  129. package/src/Shared/Libs/tts.utils.ts +48 -6
  130. package/src/Shared/Services/AnalyticsService.ts +69 -24
  131. package/src/Shared/Types/identificationInfo.ts +2 -2
  132. package/src/Shared/Types/mrzFields.ts +29 -0
  133. package/src/Translation/Resources/en.ts +90 -100
  134. package/src/Translation/Resources/tr.ts +89 -97
  135. package/src/Translation/index.ts +1 -1
  136. package/src/Trustchex.tsx +21 -4
  137. package/src/index.tsx +14 -0
  138. package/src/version.ts +1 -1
  139. package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/barcodescanner/BarcodeScannerFrameProcessorPlugin.kt +0 -301
  140. package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/cropper/BitmapUtils.kt +0 -205
  141. package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/cropper/CropperPlugin.kt +0 -72
  142. package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/cropper/FrameMetadata.kt +0 -4
  143. package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/facedetector/FaceDetectorFrameProcessorPlugin.kt +0 -303
  144. package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/textrecognition/TextRecognitionFrameProcessorPlugin.kt +0 -115
  145. package/ios/VisionCameraPlugins/BarcodeScanner/BarcodeScannerFrameProcessorPlugin-Bridging-Header.h +0 -9
  146. package/ios/VisionCameraPlugins/BarcodeScanner/BarcodeScannerFrameProcessorPlugin.mm +0 -22
  147. package/ios/VisionCameraPlugins/BarcodeScanner/BarcodeScannerFrameProcessorPlugin.swift +0 -188
  148. package/ios/VisionCameraPlugins/Cropper/Cropper-Bridging-Header.h +0 -13
  149. package/ios/VisionCameraPlugins/Cropper/Cropper.h +0 -20
  150. package/ios/VisionCameraPlugins/Cropper/Cropper.mm +0 -22
  151. package/ios/VisionCameraPlugins/Cropper/Cropper.swift +0 -145
  152. package/ios/VisionCameraPlugins/Cropper/CropperUtils.swift +0 -49
  153. package/ios/VisionCameraPlugins/FaceDetector/FaceDetectorFrameProcessorPlugin-Bridging-Header.h +0 -4
  154. package/ios/VisionCameraPlugins/FaceDetector/FaceDetectorFrameProcessorPlugin.mm +0 -22
  155. package/ios/VisionCameraPlugins/FaceDetector/FaceDetectorFrameProcessorPlugin.swift +0 -320
  156. package/ios/VisionCameraPlugins/TextRecognition/TextRecognitionFrameProcessorPlugin-Bridging-Header.h +0 -4
  157. package/ios/VisionCameraPlugins/TextRecognition/TextRecognitionFrameProcessorPlugin.mm +0 -27
  158. package/ios/VisionCameraPlugins/TextRecognition/TextRecognitionFrameProcessorPlugin.swift +0 -144
  159. package/lib/module/Shared/Libs/camera.utils.js +0 -308
  160. package/lib/module/Shared/Libs/frame-enhancement.utils.js +0 -133
  161. package/lib/module/Shared/Libs/opencv.utils.js +0 -21
  162. package/lib/module/Shared/Libs/worklet.utils.js +0 -68
  163. package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useBarcodeScanner.js +0 -46
  164. package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useCameraPermissions.js +0 -35
  165. package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/index.js +0 -19
  166. package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/scanCodes.js +0 -26
  167. package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/types.js +0 -3
  168. package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/utils/convert.js +0 -197
  169. package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/utils/geometry.js +0 -101
  170. package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/utils/highlights.js +0 -60
  171. package/lib/module/Shared/VisionCameraPlugins/Cropper/index.js +0 -47
  172. package/lib/module/Shared/VisionCameraPlugins/FaceDetector/Camera.js +0 -42
  173. package/lib/module/Shared/VisionCameraPlugins/FaceDetector/detectFaces.js +0 -35
  174. package/lib/module/Shared/VisionCameraPlugins/FaceDetector/index.js +0 -4
  175. package/lib/module/Shared/VisionCameraPlugins/FaceDetector/types.js +0 -3
  176. package/lib/module/Shared/VisionCameraPlugins/TextRecognition/Camera.js +0 -56
  177. package/lib/module/Shared/VisionCameraPlugins/TextRecognition/PhotoRecognizer.js +0 -20
  178. package/lib/module/Shared/VisionCameraPlugins/TextRecognition/RemoveLanguageModel.js +0 -9
  179. package/lib/module/Shared/VisionCameraPlugins/TextRecognition/index.js +0 -6
  180. package/lib/module/Shared/VisionCameraPlugins/TextRecognition/scanText.js +0 -20
  181. package/lib/module/Shared/VisionCameraPlugins/TextRecognition/translateText.js +0 -19
  182. package/lib/module/Shared/VisionCameraPlugins/TextRecognition/types.js +0 -3
  183. package/lib/typescript/src/Shared/Libs/camera.utils.d.ts +0 -87
  184. package/lib/typescript/src/Shared/Libs/camera.utils.d.ts.map +0 -1
  185. package/lib/typescript/src/Shared/Libs/frame-enhancement.utils.d.ts +0 -25
  186. package/lib/typescript/src/Shared/Libs/frame-enhancement.utils.d.ts.map +0 -1
  187. package/lib/typescript/src/Shared/Libs/opencv.utils.d.ts +0 -3
  188. package/lib/typescript/src/Shared/Libs/opencv.utils.d.ts.map +0 -1
  189. package/lib/typescript/src/Shared/Libs/worklet.utils.d.ts +0 -9
  190. package/lib/typescript/src/Shared/Libs/worklet.utils.d.ts.map +0 -1
  191. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useBarcodeScanner.d.ts +0 -13
  192. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useBarcodeScanner.d.ts.map +0 -1
  193. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useCameraPermissions.d.ts +0 -6
  194. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useCameraPermissions.d.ts.map +0 -1
  195. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/index.d.ts +0 -12
  196. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/index.d.ts.map +0 -1
  197. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/scanCodes.d.ts +0 -3
  198. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/scanCodes.d.ts.map +0 -1
  199. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/types.d.ts +0 -52
  200. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/types.d.ts.map +0 -1
  201. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/convert.d.ts +0 -62
  202. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/convert.d.ts.map +0 -1
  203. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/geometry.d.ts +0 -34
  204. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/geometry.d.ts.map +0 -1
  205. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/highlights.d.ts +0 -32
  206. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/highlights.d.ts.map +0 -1
  207. package/lib/typescript/src/Shared/VisionCameraPlugins/Cropper/index.d.ts +0 -23
  208. package/lib/typescript/src/Shared/VisionCameraPlugins/Cropper/index.d.ts.map +0 -1
  209. package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/Camera.d.ts +0 -9
  210. package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/Camera.d.ts.map +0 -1
  211. package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/detectFaces.d.ts +0 -3
  212. package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/detectFaces.d.ts.map +0 -1
  213. package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/index.d.ts +0 -3
  214. package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/index.d.ts.map +0 -1
  215. package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/types.d.ts +0 -79
  216. package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/types.d.ts.map +0 -1
  217. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/Camera.d.ts +0 -6
  218. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/Camera.d.ts.map +0 -1
  219. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/PhotoRecognizer.d.ts +0 -3
  220. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/PhotoRecognizer.d.ts.map +0 -1
  221. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/RemoveLanguageModel.d.ts +0 -3
  222. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/RemoveLanguageModel.d.ts.map +0 -1
  223. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/index.d.ts +0 -5
  224. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/index.d.ts.map +0 -1
  225. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/scanText.d.ts +0 -3
  226. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/scanText.d.ts.map +0 -1
  227. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/translateText.d.ts +0 -3
  228. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/translateText.d.ts.map +0 -1
  229. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/types.d.ts +0 -67
  230. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/types.d.ts.map +0 -1
  231. package/src/Shared/Libs/camera.utils.ts +0 -345
  232. package/src/Shared/Libs/frame-enhancement.utils.ts +0 -217
  233. package/src/Shared/Libs/opencv.utils.ts +0 -40
  234. package/src/Shared/Libs/worklet.utils.ts +0 -72
  235. package/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useBarcodeScanner.ts +0 -79
  236. package/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useCameraPermissions.ts +0 -46
  237. package/src/Shared/VisionCameraPlugins/BarcodeScanner/index.ts +0 -60
  238. package/src/Shared/VisionCameraPlugins/BarcodeScanner/scanCodes.ts +0 -32
  239. package/src/Shared/VisionCameraPlugins/BarcodeScanner/types.ts +0 -82
  240. package/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/convert.ts +0 -195
  241. package/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/geometry.ts +0 -135
  242. package/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/highlights.ts +0 -84
  243. package/src/Shared/VisionCameraPlugins/Cropper/index.ts +0 -78
  244. package/src/Shared/VisionCameraPlugins/FaceDetector/Camera.tsx +0 -63
  245. package/src/Shared/VisionCameraPlugins/FaceDetector/detectFaces.ts +0 -44
  246. package/src/Shared/VisionCameraPlugins/FaceDetector/index.ts +0 -3
  247. package/src/Shared/VisionCameraPlugins/FaceDetector/types.ts +0 -99
  248. package/src/Shared/VisionCameraPlugins/TextRecognition/Camera.tsx +0 -76
  249. package/src/Shared/VisionCameraPlugins/TextRecognition/PhotoRecognizer.ts +0 -18
  250. package/src/Shared/VisionCameraPlugins/TextRecognition/RemoveLanguageModel.ts +0 -7
  251. package/src/Shared/VisionCameraPlugins/TextRecognition/index.ts +0 -7
  252. package/src/Shared/VisionCameraPlugins/TextRecognition/scanText.ts +0 -27
  253. package/src/Shared/VisionCameraPlugins/TextRecognition/translateText.ts +0 -21
  254. package/src/Shared/VisionCameraPlugins/TextRecognition/types.ts +0 -141
@@ -12,7 +12,8 @@ import AppContext from "../Contexts/AppContext.js";
12
12
  import StyledButton from "./StyledButton.js";
13
13
  import LottieView from 'lottie-react-native';
14
14
  import { useKeepAwake } from "../Libs/native-keep-awake.utils.js";
15
- import { speakWithDebounce } from "../Libs/tts.utils.js";
15
+ import { speak, resetLastMessage } from "../Libs/tts.utils.js";
16
+ import { isDebugEnabled } from "../Libs/debug.utils.js";
16
17
  import { trackEIDScanStart, trackEIDScanComplete, trackEIDScanFailed } from "../Libs/analytics.utils.js";
17
18
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
18
19
  const EIDScanner = ({
@@ -48,7 +49,7 @@ const EIDScanner = ({
48
49
  const dd = dateStr.substring(4, 6);
49
50
 
50
51
  // Assume 19xx if YY >= 50, else 20xx
51
- const year = parseInt(yy) >= 50 ? `19${yy}` : `20${yy}`;
52
+ const year = parseInt(yy, 10) >= 50 ? `19${yy}` : `20${yy}`;
52
53
  return `${dd}/${mm}/${year}`;
53
54
  }
54
55
 
@@ -73,6 +74,7 @@ const EIDScanner = ({
73
74
  const appContext = React.useContext(AppContext);
74
75
  const [voiceGuidanceMessage, setVoiceGuidanceMessage] = useState();
75
76
  const [attemptNumber, setAttemptNumber] = useState(0);
77
+ const lastVoiceGuidanceMessage = useRef('');
76
78
  const readNFC = useCallback(async () => {
77
79
  const startTime = Date.now();
78
80
  const currentAttempt = attemptNumber + 1;
@@ -81,6 +83,8 @@ const EIDScanner = ({
81
83
  setIsScanned(false);
82
84
  setProgress(0);
83
85
  setProgressStage('');
86
+ lastVoiceGuidanceMessage.current = '';
87
+ resetLastMessage();
84
88
 
85
89
  // Track EID scan start using analytics helper
86
90
  const docType = documentType || 'UNKNOWN';
@@ -124,8 +128,6 @@ const EIDScanner = ({
124
128
  setDocumentMRZInfo(passportData.mrz);
125
129
  setDocumentFaceImageMimeType(passportData.mimeType);
126
130
  setIsScanned(true);
127
-
128
- // Track successful EID scan
129
131
  await trackEIDScanComplete(docType, scanDuration, currentAttempt).catch(() => {});
130
132
  }
131
133
  } else {
@@ -240,8 +242,9 @@ const EIDScanner = ({
240
242
  }
241
243
  }, [isScanning, progress, pulseAnim]);
242
244
  useEffect(() => {
243
- if (voiceGuidanceMessage && appContext.currentWorkflowStep?.data?.voiceGuidanceActive) {
244
- speakWithDebounce(voiceGuidanceMessage);
245
+ if (voiceGuidanceMessage && appContext.currentWorkflowStep?.data?.voiceGuidanceActive && voiceGuidanceMessage !== lastVoiceGuidanceMessage.current) {
246
+ lastVoiceGuidanceMessage.current = voiceGuidanceMessage;
247
+ speak(voiceGuidanceMessage, true);
245
248
  }
246
249
  }, [voiceGuidanceMessage, appContext.currentWorkflowStep?.data?.voiceGuidanceActive]);
247
250
  return /*#__PURE__*/_jsxs(View, {
@@ -250,11 +253,14 @@ const EIDScanner = ({
250
253
  style: [styles.topProgressContainer, {
251
254
  paddingTop: insets.top + 16
252
255
  }],
253
- children: [/*#__PURE__*/_jsxs(View, {
256
+ children: [/*#__PURE__*/_jsx(Text, {
257
+ style: styles.holdSteadyText,
258
+ children: t('eidScannerScreen.readingDocument')
259
+ }), /*#__PURE__*/_jsxs(View, {
254
260
  style: styles.progressTextContainer,
255
261
  children: [/*#__PURE__*/_jsx(Text, {
256
262
  style: styles.topScanningText,
257
- children: progressStage || t('eidScannerScreen.readingDocument')
263
+ children: progressStage || t('eidScannerScreen.connecting')
258
264
  }), /*#__PURE__*/_jsxs(Text, {
259
265
  style: [styles.progressPercentage, {
260
266
  color: appContext.branding.primaryColor
@@ -433,6 +439,83 @@ const EIDScanner = ({
433
439
  },
434
440
  children: t('eidScannerScreen.approveAndContinue')
435
441
  })
442
+ }), isDebugEnabled() && /*#__PURE__*/_jsxs(View, {
443
+ style: {
444
+ position: 'absolute',
445
+ top: insets.top + 10,
446
+ right: 10,
447
+ backgroundColor: 'rgba(0, 0, 0, 0.85)',
448
+ padding: 10,
449
+ borderRadius: 8,
450
+ borderWidth: 1,
451
+ borderColor: '#FF6B6B',
452
+ maxWidth: 200,
453
+ zIndex: 1001
454
+ },
455
+ children: [/*#__PURE__*/_jsx(Text, {
456
+ style: {
457
+ color: '#FF6B6B',
458
+ fontSize: 11,
459
+ fontWeight: 'bold',
460
+ marginBottom: 6
461
+ },
462
+ children: "\uD83D\uDC1B DEBUG MODE"
463
+ }), /*#__PURE__*/_jsx(Text, {
464
+ style: {
465
+ color: '#88D8B0',
466
+ fontSize: 9,
467
+ marginBottom: 2
468
+ },
469
+ children: `NFC: ${hasNfc ? '✓' : '✗'}`
470
+ }), /*#__PURE__*/_jsx(Text, {
471
+ style: {
472
+ color: '#88D8B0',
473
+ fontSize: 9,
474
+ marginBottom: 2
475
+ },
476
+ children: `Enabled: ${isEnabled ? '✓' : '✗'}`
477
+ }), /*#__PURE__*/_jsx(Text, {
478
+ style: {
479
+ color: '#88D8B0',
480
+ fontSize: 9,
481
+ marginBottom: 2
482
+ },
483
+ children: `Scanning: ${isScanning ? '✓' : '○'}`
484
+ }), /*#__PURE__*/_jsx(Text, {
485
+ style: {
486
+ color: '#88D8B0',
487
+ fontSize: 9,
488
+ marginBottom: 2
489
+ },
490
+ children: `Scanned: ${isScanned ? '✓' : '○'}`
491
+ }), /*#__PURE__*/_jsx(Text, {
492
+ style: {
493
+ color: '#88D8B0',
494
+ fontSize: 9,
495
+ marginBottom: 2
496
+ },
497
+ children: `Progress: ${Math.round(progress)}%`
498
+ }), /*#__PURE__*/_jsx(Text, {
499
+ style: {
500
+ color: '#88D8B0',
501
+ fontSize: 9,
502
+ marginBottom: 2
503
+ },
504
+ children: `Face Image: ${documentFaceImage ? '✓' : '✗'}`
505
+ }), /*#__PURE__*/_jsx(Text, {
506
+ style: {
507
+ color: '#88D8B0',
508
+ fontSize: 9,
509
+ marginBottom: 2
510
+ },
511
+ children: `MRZ Info: ${documentMRZInfo ? '✓' : '✗'}`
512
+ }), /*#__PURE__*/_jsx(Text, {
513
+ style: {
514
+ color: '#88D8B0',
515
+ fontSize: 9
516
+ },
517
+ children: `Doc Type: ${documentType}`
518
+ })]
436
519
  })]
437
520
  })]
438
521
  });
@@ -455,6 +538,13 @@ const styles = StyleSheet.create({
455
538
  backgroundColor: 'rgba(255, 255, 255, 0.95)',
456
539
  gap: 8
457
540
  },
541
+ holdSteadyText: {
542
+ fontSize: 20,
543
+ fontWeight: '700',
544
+ color: '#000',
545
+ textAlign: 'center',
546
+ marginBottom: 8
547
+ },
458
548
  progressTextContainer: {
459
549
  flexDirection: 'row',
460
550
  justifyContent: 'space-between',
@@ -462,7 +552,7 @@ const styles = StyleSheet.create({
462
552
  width: '100%'
463
553
  },
464
554
  topScanningText: {
465
- fontSize: 18,
555
+ fontSize: 14,
466
556
  fontWeight: 'bold',
467
557
  color: '#000',
468
558
  flex: 1
@@ -2,23 +2,26 @@
2
2
 
3
3
  import { useIsFocused } from '@react-navigation/native';
4
4
  import { useKeepAwake } from "../Libs/native-keep-awake.utils.js";
5
- import React, { useEffect, useState, useMemo } from 'react';
6
- import { StyleSheet, Text, View, Platform, Linking, Dimensions, ActivityIndicator, NativeModules } from 'react-native';
7
- import { useCameraDevice, useCameraPermission, Camera, useFrameProcessor, useCameraFormat, runAtTargetFps, useMicrophonePermission } from 'react-native-vision-camera';
8
- import { runAsync } from "../Libs/worklet.utils.js";
9
- import { useFaceDetector } from "../VisionCameraPlugins/FaceDetector/index.js";
10
- import { Worklets, useSharedValue } from 'react-native-worklets-core';
11
- import { crop } from "../VisionCameraPlugins/Cropper/index.js";
12
- import { isCircularRegionBright, isBlurry } from "../Libs/camera.utils.js";
5
+ import { debugLog, debugWarn, debugError, logError } from "../Libs/debug.utils.js";
6
+ import React, { useEffect, useState, useRef, useCallback } from 'react';
7
+ import { StyleSheet, Text, View, Platform, Linking, ActivityIndicator, NativeModules, PermissionsAndroid } from 'react-native';
8
+ import { TrustchexCamera } from "./TrustchexCamera.js";
13
9
  import { useTranslation } from 'react-i18next';
14
10
  import StyledButton from "./StyledButton.js";
15
11
  import { useTheme } from "../Contexts/ThemeContext.js";
16
12
  import { SafeAreaView } from 'react-native-safe-area-context';
13
+ import { Dimensions } from 'react-native';
17
14
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
18
- const VIDEO_WIDTH = 1280;
19
- const VIDEO_HEIGHT = 720;
20
- const windowWidth = Dimensions.get('window').width;
21
- const windowHeight = Dimensions.get('window').height;
15
+ const {
16
+ width: windowWidth,
17
+ height: windowHeight
18
+ } = Dimensions.get('window');
19
+ const {
20
+ OpenCVModule
21
+ } = NativeModules;
22
+ const MIN_BRIGHTNESS_THRESHOLD = 80;
23
+ const BLUR_VARIANCE_THRESHOLD = 60;
24
+ const REGION_BRIGHTNESS_THRESHOLD = 70;
22
25
  const FaceCamera = ({
23
26
  onFacesDetected,
24
27
  onCameraInitialized,
@@ -26,60 +29,36 @@ const FaceCamera = ({
26
29
  }) => {
27
30
  useKeepAwake();
28
31
  const theme = useTheme();
29
- const cameraPermission = useCameraPermission();
30
- const microphonePermission = useMicrophonePermission();
32
+ const [hasPermission, setHasPermission] = useState(false);
31
33
  const [permissionsRequested, setPermissionsRequested] = useState(false);
32
- const cameraRef = React.useRef(null);
34
+ const cameraRef = useRef(null);
33
35
  const isFocused = useIsFocused();
34
36
  const [isActive, setIsActive] = useState(false);
35
- const device = useCameraDevice('front');
36
- const format = useCameraFormat(device, [{
37
- videoResolution: {
38
- width: VIDEO_WIDTH,
39
- height: VIDEO_HEIGHT
40
- },
41
- iso: 'max',
42
- photoHdr: false,
43
- videoHdr: false,
44
- fps: 30
45
- }]);
46
- const isCameraInitialized = useSharedValue(false);
47
- const faceDetectorOptions = useMemo(() => ({
48
- contourMode: 'none',
49
- landmarkMode: 'none',
50
- classificationMode: 'all',
51
- performanceMode: 'accurate',
52
- trackingEnabled: false,
53
- autoScale: true,
54
- windowWidth: windowWidth,
55
- windowHeight: windowHeight
56
- }), [windowWidth, windowHeight]);
57
- const {
58
- detectFaces
59
- } = useFaceDetector(faceDetectorOptions);
37
+ const isCameraInitializedRef = useRef(false);
38
+ const lastFrameTimeRef = useRef(0);
60
39
  const {
61
40
  t
62
41
  } = useTranslation();
63
42
  useEffect(() => {
64
43
  const requestPermissions = async () => {
65
- if (!cameraPermission.hasPermission) {
66
- await cameraPermission.requestPermission();
67
- }
68
- if (!microphonePermission.hasPermission) {
69
- await microphonePermission.requestPermission();
44
+ if (Platform.OS === 'android') {
45
+ const granted = await PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.CAMERA);
46
+ setHasPermission(granted === PermissionsAndroid.RESULTS.GRANTED);
47
+ } else {
48
+ // iOS permissions handled by native camera
49
+ setHasPermission(true);
70
50
  }
71
51
  setPermissionsRequested(true);
72
52
  };
73
53
  requestPermissions();
74
- }, [cameraPermission, microphonePermission]);
75
- const handleFaces = Worklets.createRunOnJS((faces, image, isBright) => {
76
- if (faces.length > 0) {
77
- console.log('[FaceCamera] handleFaces called - faces:', faces.length, 'bright:', isBright);
78
- onFacesDetected(faces, image, isBright);
79
- }
80
- });
54
+ }, []);
81
55
  useEffect(() => {
82
- if (!!device && !!format && isFocused) {
56
+ debugLog('FaceCamera', 'isActive state changed:', {
57
+ isFocused,
58
+ hasPermission,
59
+ isActive: isFocused && hasPermission
60
+ });
61
+ if (isFocused && hasPermission) {
83
62
  setIsActive(true);
84
63
  } else {
85
64
  setIsActive(false);
@@ -87,7 +66,7 @@ const FaceCamera = ({
87
66
  return () => {
88
67
  setIsActive(false);
89
68
  };
90
- }, [device, format, isFocused]);
69
+ }, [isFocused, hasPermission]);
91
70
 
92
71
  // Set screen brightness to maximum when camera is active
93
72
  useEffect(() => {
@@ -100,9 +79,9 @@ const FaceCamera = ({
100
79
  if (isActive) {
101
80
  try {
102
81
  originalBrightness = await DeviceBrightness.getBrightness();
103
- await DeviceBrightness.setBrightness(1.0);
82
+ await DeviceBrightness.setBrightness(1);
104
83
  } catch (error) {
105
- console.log('Failed to set brightness:', error);
84
+ debugLog('FaceCamera', '[FaceCamera] Failed to set brightness:', error);
106
85
  }
107
86
  }
108
87
  };
@@ -113,96 +92,131 @@ const FaceCamera = ({
113
92
  }
114
93
  };
115
94
  }, [isActive]);
116
- const handleWorklet = frame => {
117
- 'worklet';
118
-
95
+ const isProcessingFrame = useRef(false);
96
+ const handleFrame = useCallback(async event => {
97
+ debugLog('FaceCamera', '*** FRAME CALLBACK INVOKED ***', {
98
+ isProcessing: isProcessingFrame.current,
99
+ timestamp: Date.now()
100
+ });
101
+ if (isProcessingFrame.current) {
102
+ debugLog('FaceCamera', 'Frame dropped - already processing');
103
+ return;
104
+ }
105
+ const now = Date.now();
106
+ const timeSinceLastFrame = now - lastFrameTimeRef.current;
107
+ // Throttle to ~6.7 FPS for face scanning (150ms interval matches Flutter SDK for responsive detection)
108
+ if (timeSinceLastFrame < 150) {
109
+ debugLog('FaceCamera', `Frame dropped - throttling (${timeSinceLastFrame}ms < 150ms)`);
110
+ return;
111
+ }
112
+ lastFrameTimeRef.current = now;
113
+ if (!isCameraInitializedRef.current) {
114
+ debugLog('FaceCamera', 'Camera not initialized yet');
115
+ return;
116
+ }
117
+ if (!isActive) {
118
+ debugLog('FaceCamera', 'Camera not active');
119
+ return;
120
+ }
121
+ isProcessingFrame.current = true;
122
+ const {
123
+ frame
124
+ } = event.nativeEvent;
119
125
  try {
120
- // Calculate brightness based on the circular preview area if provided
121
- // Otherwise fall back to entire frame brightness
122
- let isBright = false;
123
- if (previewRect) {
124
- // Convert preview rect from screen coordinates to frame coordinates
125
- const scaleX = frame.width / windowWidth;
126
- const scaleY = frame.height / windowHeight;
127
- const frameCircleRect = {
128
- minX: Math.floor(previewRect.minX * scaleX),
129
- minY: Math.floor(previewRect.minY * scaleY),
130
- width: Math.floor(previewRect.width * scaleX),
131
- height: Math.floor(previewRect.height * scaleY)
132
- };
133
- isBright = isCircularRegionBright(frame, frameCircleRect, 60);
134
- } else {
135
- // Fallback: check entire frame brightness (use legacy method)
136
- const buffer = frame.toArrayBuffer();
137
- const data = new Uint8Array(buffer);
138
- const width = frame.width;
139
- const height = frame.height;
140
- let luminanceSum = 0;
141
- let pixelCount = 0;
142
- const centerX = Math.floor(width / 2);
143
- const centerY = Math.floor(height / 2);
144
- const halfSizeX = Math.floor(width / 2);
145
- const halfSizeY = Math.floor(height / 2);
146
- for (let y = centerY - halfSizeY; y < centerY + halfSizeY; y++) {
147
- for (let x = centerX - halfSizeX; x < centerX + halfSizeX; x++) {
148
- const index = y * width + x;
149
- if (data[index] !== undefined) {
150
- luminanceSum += data[index];
151
- pixelCount++;
152
- }
153
- }
154
- }
155
- isBright = luminanceSum / pixelCount > 60;
156
- }
157
-
158
- // Skip blurry frames to ensure sharp face captures
159
- // Lower threshold (10) for better frame acceptance
160
- if (isBlurry(frame, 10)) {
126
+ if (!frame.width || !frame.height || frame.width <= 0 || frame.height <= 0) {
127
+ debugLog('FaceCamera', 'Invalid frame dimensions');
161
128
  return;
162
129
  }
163
- const image = crop(frame, {
164
- cropRegion: {
165
- top: 0,
166
- left: 0,
167
- width: 100,
168
- height: 100
130
+ const base64Image = frame.base64Image ?? '';
131
+
132
+ // Read faces directly from native ML Kit results
133
+ const nativeFaces = frame.faces ?? [];
134
+ debugLog('FaceCamera', 'Native faces:', nativeFaces.length);
135
+
136
+ // Map NativeFace to FaceCamera's Face type first
137
+ // ML Kit classification probabilities may be undefined if detection fails
138
+ // Default to 0 so comparisons don't fail with undefined
139
+ const faces = nativeFaces.map(f => ({
140
+ bounds: {
141
+ x: f.bounds.x,
142
+ y: f.bounds.y,
143
+ width: f.bounds.width,
144
+ height: f.bounds.height
169
145
  },
170
- includeImageBase64: true,
171
- saveAsFile: false
172
- });
173
- if (image && image.base64) {
174
- const faces = detectFaces(frame);
175
- if (faces.length > 0) {
176
- console.log('[FaceCamera] Faces detected:', faces.length);
146
+ yawAngle: f.yawAngle ?? 0,
147
+ pitchAngle: f.pitchAngle ?? 0,
148
+ rollAngle: f.rollAngle ?? 0,
149
+ smilingProbability: f.smilingProbability ?? 0,
150
+ leftEyeOpenProbability: f.leftEyeOpenProbability ?? 0,
151
+ rightEyeOpenProbability: f.rightEyeOpenProbability ?? 0
152
+ }));
153
+
154
+ // Check overall brightness - computed natively on the Y plane
155
+ const avgBrightness = frame.brightness ?? 128;
156
+ const isBright = avgBrightness >= MIN_BRIGHTNESS_THRESHOLD;
157
+
158
+ // Check brightness in the region of interest (circular preview area)
159
+ let isRegionBright = isBright; // Default to overall brightness
160
+ if (previewRect && base64Image && OpenCVModule) {
161
+ try {
162
+ // Scale preview rect from screen coordinates to frame coordinates
163
+ const scaleX = frame.width / windowWidth;
164
+ const scaleY = frame.height / windowHeight;
165
+ const regionMinX = Math.round(previewRect.minX * scaleX);
166
+ const regionMinY = Math.round(previewRect.minY * scaleY);
167
+ const regionWidth = Math.round(previewRect.width * scaleX);
168
+ const regionHeight = Math.round(previewRect.height * scaleY);
169
+ isRegionBright = await OpenCVModule.isCircularRegionBright(base64Image, regionMinX, regionMinY, regionWidth, regionHeight, REGION_BRIGHTNESS_THRESHOLD);
170
+ } catch (error) {
171
+ debugWarn('FaceCamera', 'Region brightness check failed:', error);
177
172
  }
178
- handleFaces(faces, image.base64, isBright);
179
173
  }
180
- } catch (error) {
181
- console.error('[FaceCamera] Face detection error:', error);
182
- }
183
- };
184
- const frameProcessor = useFrameProcessor(frame => {
185
- 'worklet';
186
174
 
187
- if (!isCameraInitialized.value) {
188
- return;
189
- }
190
- // iOS: Run at target 6 FPS using runAtTargetFps
191
- if (Platform.OS === 'ios') {
192
- runAtTargetFps(6, () => {
193
- 'worklet';
194
-
195
- handleWorklet(frame);
196
- });
197
- } else {
198
- // Android: Run async without throttling
199
- runAsync(frame, () => {
200
- 'worklet';
175
+ // Check for blur using OpenCV Laplacian variance
176
+ let isNotBlurry = true;
177
+ try {
178
+ if (base64Image && OpenCVModule) {
179
+ const isBlurryResult = await OpenCVModule.checkBlurry(base64Image, BLUR_VARIANCE_THRESHOLD);
180
+ isNotBlurry = !isBlurryResult;
181
+ }
182
+ } catch (error) {
183
+ debugWarn('FaceCamera', 'Blur check failed:', error);
184
+ // If check fails, assume not blurry to continue
185
+ }
201
186
 
202
- handleWorklet(frame);
203
- });
187
+ // Check quality but still pass detected faces
188
+ // Let liveness detection logic decide whether to accept poor quality frames
189
+ const hasGoodQuality = isRegionBright && isNotBlurry;
190
+ if (!hasGoodQuality) {
191
+ debugLog('FaceCamera', 'Frame quality insufficient:', {
192
+ avgBrightness,
193
+ isBright,
194
+ isRegionBright,
195
+ isNotBlurry,
196
+ faceCount: faces.length
197
+ });
198
+ }
199
+ debugLog('FaceCamera', `Calling onFacesDetected with ${faces.length} faces`);
200
+ // Always call onFacesDetected with detected faces
201
+ // isRegionBright indicates whether the region of interest has acceptable brightness
202
+ // This allows the UI to show warnings while still detecting faces
203
+ onFacesDetected(faces, base64Image, isRegionBright, frame.width, frame.height);
204
+ } catch (error) {
205
+ debugError('FaceCamera', 'Face detection error:', error);
206
+ } finally {
207
+ isProcessingFrame.current = false;
208
+ }
209
+ }, [isActive, previewRect, onFacesDetected]);
210
+ const handleCameraReady = useCallback(() => {
211
+ debugLog('FaceCamera', 'Camera ready, initializing...');
212
+ isCameraInitializedRef.current = true;
213
+ if (cameraRef.current) {
214
+ onCameraInitialized(cameraRef.current);
204
215
  }
205
- }, [handleFaces, isCameraInitialized]);
216
+ }, [onCameraInitialized]);
217
+ const handleCameraError = useCallback(event => {
218
+ logError('[FaceCamera] Camera error:', event.nativeEvent.error);
219
+ }, []);
206
220
  if (!permissionsRequested) {
207
221
  return /*#__PURE__*/_jsx(SafeAreaView, {
208
222
  style: styles.permissionContainer,
@@ -212,8 +226,7 @@ const FaceCamera = ({
212
226
  })
213
227
  });
214
228
  }
215
- if (!cameraPermission.hasPermission) {
216
- // Camera permission denied by user - their choice, not actionable
229
+ if (!hasPermission) {
217
230
  return /*#__PURE__*/_jsxs(SafeAreaView, {
218
231
  style: styles.permissionContainer,
219
232
  children: [/*#__PURE__*/_jsx(Text, {
@@ -228,50 +241,28 @@ const FaceCamera = ({
228
241
  })]
229
242
  });
230
243
  }
231
- if (!microphonePermission.hasPermission) {
232
- // Microphone permission denied by user - their choice, not actionable
233
- return /*#__PURE__*/_jsxs(SafeAreaView, {
234
- style: styles.permissionContainer,
235
- children: [/*#__PURE__*/_jsx(Text, {
236
- style: styles.permissionText,
237
- children: t('general.noMicrophonePermissionGiven')
238
- }), /*#__PURE__*/_jsx(StyledButton, {
239
- mode: "contained",
240
- onPress: () => {
241
- Linking.openSettings();
242
- },
243
- children: t('general.openSettings')
244
- })]
245
- });
246
- }
247
- if (device == null) {
248
- // No camera device - device limitation, not actionable
249
- return /*#__PURE__*/_jsx(SafeAreaView, {
250
- style: styles.permissionContainer,
251
- children: /*#__PURE__*/_jsx(Text, {
252
- style: styles.permissionText,
253
- children: t('general.noCameraDetected')
254
- })
255
- });
256
- }
244
+ debugLog('FaceCamera', 'Rendering TrustchexCamera with props:', {
245
+ isActive,
246
+ enableFrameProcessing: isActive,
247
+ enableFaceDetection: isActive,
248
+ includeBase64: true,
249
+ targetFps: 10
250
+ });
257
251
  return /*#__PURE__*/_jsx(View, {
258
252
  style: StyleSheet.absoluteFill,
259
- children: /*#__PURE__*/_jsx(Camera, {
253
+ children: /*#__PURE__*/_jsx(TrustchexCamera, {
260
254
  ref: cameraRef,
261
- frameProcessor: frameProcessor,
262
255
  style: StyleSheet.absoluteFill,
263
- device: device,
264
- format: format,
265
- isActive: isActive,
266
- video: true,
267
- photo: false,
268
- audio: true,
269
- videoBitRate: 'extra-low',
270
- fps: Math.max(format?.minFps ?? 0, 30),
271
- onInitialized: () => {
272
- isCameraInitialized.value = true;
273
- onCameraInitialized(cameraRef.current);
274
- }
256
+ cameraType: "front",
257
+ torchEnabled: false,
258
+ enableFrameProcessing: isActive,
259
+ enableFaceDetection: isActive,
260
+ includeBase64: true // Enabled to capture photos for liveness steps
261
+ ,
262
+ targetFps: 5,
263
+ onFrameAvailable: handleFrame,
264
+ onCameraReady: handleCameraReady,
265
+ onCameraError: handleCameraError
275
266
  })
276
267
  });
277
268
  };