@velion-la/onboarding-sdk-react-native 1.0.0-beta.10

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 (614) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/LICENSE +12 -0
  3. package/README.md +888 -0
  4. package/app.plugin.js +101 -0
  5. package/lib/commonjs/camera/AddressSearchBar.js +304 -0
  6. package/lib/commonjs/camera/AddressSearchBar.js.map +1 -0
  7. package/lib/commonjs/camera/DocumentCapture.js +513 -0
  8. package/lib/commonjs/camera/DocumentCapture.js.map +1 -0
  9. package/lib/commonjs/camera/LivenessCamera.js +628 -0
  10. package/lib/commonjs/camera/LivenessCamera.js.map +1 -0
  11. package/lib/commonjs/camera/MapAddressPicker.js +331 -0
  12. package/lib/commonjs/camera/MapAddressPicker.js.map +1 -0
  13. package/lib/commonjs/core/VelionOnboarding.js +1113 -0
  14. package/lib/commonjs/core/VelionOnboarding.js.map +1 -0
  15. package/lib/commonjs/core/retryStepCopy.js +43 -0
  16. package/lib/commonjs/core/retryStepCopy.js.map +1 -0
  17. package/lib/commonjs/core/routingCommands.js +62 -0
  18. package/lib/commonjs/core/routingCommands.js.map +1 -0
  19. package/lib/commonjs/core/sessionDeclinedCopy.js +56 -0
  20. package/lib/commonjs/core/sessionDeclinedCopy.js.map +1 -0
  21. package/lib/commonjs/core/sessionStateMapper.js +200 -0
  22. package/lib/commonjs/core/sessionStateMapper.js.map +1 -0
  23. package/lib/commonjs/core/sseReasonMessages.js +450 -0
  24. package/lib/commonjs/core/sseReasonMessages.js.map +1 -0
  25. package/lib/commonjs/data/iso3166Alpha2Codes.json +1 -0
  26. package/lib/commonjs/data/iso3166CountryNames.json +251 -0
  27. package/lib/commonjs/i18n/index.js +30 -0
  28. package/lib/commonjs/i18n/index.js.map +1 -0
  29. package/lib/commonjs/i18n/strings/en.js +301 -0
  30. package/lib/commonjs/i18n/strings/en.js.map +1 -0
  31. package/lib/commonjs/i18n/strings/es.js +306 -0
  32. package/lib/commonjs/i18n/strings/es.js.map +1 -0
  33. package/lib/commonjs/index.js +225 -0
  34. package/lib/commonjs/index.js.map +1 -0
  35. package/lib/commonjs/package.json +1 -0
  36. package/lib/commonjs/steps/AddressInfoStep.js +662 -0
  37. package/lib/commonjs/steps/AddressInfoStep.js.map +1 -0
  38. package/lib/commonjs/steps/DocumentsOcrStep.js +405 -0
  39. package/lib/commonjs/steps/DocumentsOcrStep.js.map +1 -0
  40. package/lib/commonjs/steps/EconomicActivityStep.js +214 -0
  41. package/lib/commonjs/steps/EconomicActivityStep.js.map +1 -0
  42. package/lib/commonjs/steps/EmailContactStep.js +150 -0
  43. package/lib/commonjs/steps/EmailContactStep.js.map +1 -0
  44. package/lib/commonjs/steps/EmailOtpStep.js +225 -0
  45. package/lib/commonjs/steps/EmailOtpStep.js.map +1 -0
  46. package/lib/commonjs/steps/FaceMatchStep.js +169 -0
  47. package/lib/commonjs/steps/FaceMatchStep.js.map +1 -0
  48. package/lib/commonjs/steps/FingerprintStep.js +92 -0
  49. package/lib/commonjs/steps/FingerprintStep.js.map +1 -0
  50. package/lib/commonjs/steps/HumanBasicInfoStep.js +251 -0
  51. package/lib/commonjs/steps/HumanBasicInfoStep.js.map +1 -0
  52. package/lib/commonjs/steps/HumanExtendedInfoStep.js +275 -0
  53. package/lib/commonjs/steps/HumanExtendedInfoStep.js.map +1 -0
  54. package/lib/commonjs/steps/LegalBasicInfoStep.js +195 -0
  55. package/lib/commonjs/steps/LegalBasicInfoStep.js.map +1 -0
  56. package/lib/commonjs/steps/LegalExtendedInfoStep.js +173 -0
  57. package/lib/commonjs/steps/LegalExtendedInfoStep.js.map +1 -0
  58. package/lib/commonjs/steps/LivenessMatchStep.js +1184 -0
  59. package/lib/commonjs/steps/LivenessMatchStep.js.map +1 -0
  60. package/lib/commonjs/steps/PhoneContactStep.js +151 -0
  61. package/lib/commonjs/steps/PhoneContactStep.js.map +1 -0
  62. package/lib/commonjs/steps/PhoneOtpStep.js +224 -0
  63. package/lib/commonjs/steps/PhoneOtpStep.js.map +1 -0
  64. package/lib/commonjs/steps/SwornDeclarationStep.js +206 -0
  65. package/lib/commonjs/steps/SwornDeclarationStep.js.map +1 -0
  66. package/lib/commonjs/steps/TaxInfoStep.js +251 -0
  67. package/lib/commonjs/steps/TaxInfoStep.js.map +1 -0
  68. package/lib/commonjs/steps/TermsAndConditionsStep.js +245 -0
  69. package/lib/commonjs/steps/TermsAndConditionsStep.js.map +1 -0
  70. package/lib/commonjs/steps/_shared.js +61 -0
  71. package/lib/commonjs/steps/_shared.js.map +1 -0
  72. package/lib/commonjs/steps/types.js +6 -0
  73. package/lib/commonjs/steps/types.js.map +1 -0
  74. package/lib/commonjs/transport/api.js +176 -0
  75. package/lib/commonjs/transport/api.js.map +1 -0
  76. package/lib/commonjs/transport/irisWebSocket.js +121 -0
  77. package/lib/commonjs/transport/irisWebSocket.js.map +1 -0
  78. package/lib/commonjs/transport/secureUrl.js +50 -0
  79. package/lib/commonjs/transport/secureUrl.js.map +1 -0
  80. package/lib/commonjs/transport/sse.js +248 -0
  81. package/lib/commonjs/transport/sse.js.map +1 -0
  82. package/lib/commonjs/types/index.js +458 -0
  83. package/lib/commonjs/types/index.js.map +1 -0
  84. package/lib/commonjs/ui/MapFallbackBoundary.js +42 -0
  85. package/lib/commonjs/ui/MapFallbackBoundary.js.map +1 -0
  86. package/lib/commonjs/ui/StepShell.js +251 -0
  87. package/lib/commonjs/ui/StepShell.js.map +1 -0
  88. package/lib/commonjs/ui/VelionOnboardingScreen.js +276 -0
  89. package/lib/commonjs/ui/VelionOnboardingScreen.js.map +1 -0
  90. package/lib/commonjs/ui/forms/index.js +38 -0
  91. package/lib/commonjs/ui/forms/index.js.map +1 -0
  92. package/lib/commonjs/ui/forms/useInlineValidation.js +88 -0
  93. package/lib/commonjs/ui/forms/useInlineValidation.js.map +1 -0
  94. package/lib/commonjs/ui/forms/validators.js +34 -0
  95. package/lib/commonjs/ui/forms/validators.js.map +1 -0
  96. package/lib/commonjs/ui/icons/HomeHeartIcon.js +38 -0
  97. package/lib/commonjs/ui/icons/HomeHeartIcon.js.map +1 -0
  98. package/lib/commonjs/ui/icons/StepIcon.js +59 -0
  99. package/lib/commonjs/ui/icons/StepIcon.js.map +1 -0
  100. package/lib/commonjs/ui/overlays/AnalyzingOverlay.js +284 -0
  101. package/lib/commonjs/ui/overlays/AnalyzingOverlay.js.map +1 -0
  102. package/lib/commonjs/ui/overlays/LoadingOverlay.js +108 -0
  103. package/lib/commonjs/ui/overlays/LoadingOverlay.js.map +1 -0
  104. package/lib/commonjs/ui/overlays/ProgressBar.js +101 -0
  105. package/lib/commonjs/ui/overlays/ProgressBar.js.map +1 -0
  106. package/lib/commonjs/ui/overlays/RetryDialog.js +125 -0
  107. package/lib/commonjs/ui/overlays/RetryDialog.js.map +1 -0
  108. package/lib/commonjs/ui/overlays/index.js +33 -0
  109. package/lib/commonjs/ui/overlays/index.js.map +1 -0
  110. package/lib/commonjs/ui/primitives/BackButton.js +75 -0
  111. package/lib/commonjs/ui/primitives/BackButton.js.map +1 -0
  112. package/lib/commonjs/ui/primitives/Banner.js +81 -0
  113. package/lib/commonjs/ui/primitives/Banner.js.map +1 -0
  114. package/lib/commonjs/ui/primitives/Button.js +142 -0
  115. package/lib/commonjs/ui/primitives/Button.js.map +1 -0
  116. package/lib/commonjs/ui/primitives/Card.js +50 -0
  117. package/lib/commonjs/ui/primitives/Card.js.map +1 -0
  118. package/lib/commonjs/ui/primitives/Checkbox.js +139 -0
  119. package/lib/commonjs/ui/primitives/Checkbox.js.map +1 -0
  120. package/lib/commonjs/ui/primitives/CountrySelect.js +288 -0
  121. package/lib/commonjs/ui/primitives/CountrySelect.js.map +1 -0
  122. package/lib/commonjs/ui/primitives/DatePicker.js +245 -0
  123. package/lib/commonjs/ui/primitives/DatePicker.js.map +1 -0
  124. package/lib/commonjs/ui/primitives/Input.js +101 -0
  125. package/lib/commonjs/ui/primitives/Input.js.map +1 -0
  126. package/lib/commonjs/ui/primitives/SearchableSingleSelectList.js +162 -0
  127. package/lib/commonjs/ui/primitives/SearchableSingleSelectList.js.map +1 -0
  128. package/lib/commonjs/ui/primitives/Select.js +209 -0
  129. package/lib/commonjs/ui/primitives/Select.js.map +1 -0
  130. package/lib/commonjs/ui/primitives/Spinner.js +25 -0
  131. package/lib/commonjs/ui/primitives/Spinner.js.map +1 -0
  132. package/lib/commonjs/ui/primitives/index.js +89 -0
  133. package/lib/commonjs/ui/primitives/index.js.map +1 -0
  134. package/lib/commonjs/ui/primitives/searchableSingleSelectFilter.js +31 -0
  135. package/lib/commonjs/ui/primitives/searchableSingleSelectFilter.js.map +1 -0
  136. package/lib/commonjs/ui/theme/ThemeProvider.js +74 -0
  137. package/lib/commonjs/ui/theme/ThemeProvider.js.map +1 -0
  138. package/lib/commonjs/ui/theme/index.js +68 -0
  139. package/lib/commonjs/ui/theme/index.js.map +1 -0
  140. package/lib/commonjs/ui/theme/tokens.js +154 -0
  141. package/lib/commonjs/ui/theme/tokens.js.map +1 -0
  142. package/lib/commonjs/utils/EventEmitter.js +144 -0
  143. package/lib/commonjs/utils/EventEmitter.js.map +1 -0
  144. package/lib/commonjs/utils/base64.js +53 -0
  145. package/lib/commonjs/utils/base64.js.map +1 -0
  146. package/lib/commonjs/utils/deviceFingerprint.js +132 -0
  147. package/lib/commonjs/utils/deviceFingerprint.js.map +1 -0
  148. package/lib/commonjs/utils/documentTypeOptions.js +35 -0
  149. package/lib/commonjs/utils/documentTypeOptions.js.map +1 -0
  150. package/lib/commonjs/utils/googleMapsPreflight.js +88 -0
  151. package/lib/commonjs/utils/googleMapsPreflight.js.map +1 -0
  152. package/lib/commonjs/utils/hmac.js +58 -0
  153. package/lib/commonjs/utils/hmac.js.map +1 -0
  154. package/lib/commonjs/utils/iso3166Countries.js +98 -0
  155. package/lib/commonjs/utils/iso3166Countries.js.map +1 -0
  156. package/lib/commonjs/utils/jpegFromUri.js +44 -0
  157. package/lib/commonjs/utils/jpegFromUri.js.map +1 -0
  158. package/lib/commonjs/utils/keepAwake.js +58 -0
  159. package/lib/commonjs/utils/keepAwake.js.map +1 -0
  160. package/lib/commonjs/utils/log.js +42 -0
  161. package/lib/commonjs/utils/log.js.map +1 -0
  162. package/lib/commonjs/utils/osGeocoder.js +70 -0
  163. package/lib/commonjs/utils/osGeocoder.js.map +1 -0
  164. package/lib/commonjs/utils/parseGoogleAddressComponents.js +74 -0
  165. package/lib/commonjs/utils/parseGoogleAddressComponents.js.map +1 -0
  166. package/lib/commonjs/utils/personNameNormalize.js +24 -0
  167. package/lib/commonjs/utils/personNameNormalize.js.map +1 -0
  168. package/lib/commonjs/utils/sdkError.js +34 -0
  169. package/lib/commonjs/utils/sdkError.js.map +1 -0
  170. package/lib/commonjs/utils/sdkVersion.js +13 -0
  171. package/lib/commonjs/utils/sdkVersion.js.map +1 -0
  172. package/lib/commonjs/utils/stepConfig.js +65 -0
  173. package/lib/commonjs/utils/stepConfig.js.map +1 -0
  174. package/lib/commonjs/utils/taxInfoConfig.js +19 -0
  175. package/lib/commonjs/utils/taxInfoConfig.js.map +1 -0
  176. package/lib/commonjs/utils/useSafeAreaInsets.js +41 -0
  177. package/lib/commonjs/utils/useSafeAreaInsets.js.map +1 -0
  178. package/lib/commonjs/utils/velionExtra.js +48 -0
  179. package/lib/commonjs/utils/velionExtra.js.map +1 -0
  180. package/lib/module/camera/AddressSearchBar.js +299 -0
  181. package/lib/module/camera/AddressSearchBar.js.map +1 -0
  182. package/lib/module/camera/DocumentCapture.js +508 -0
  183. package/lib/module/camera/DocumentCapture.js.map +1 -0
  184. package/lib/module/camera/LivenessCamera.js +623 -0
  185. package/lib/module/camera/LivenessCamera.js.map +1 -0
  186. package/lib/module/camera/MapAddressPicker.js +326 -0
  187. package/lib/module/camera/MapAddressPicker.js.map +1 -0
  188. package/lib/module/core/VelionOnboarding.js +1109 -0
  189. package/lib/module/core/VelionOnboarding.js.map +1 -0
  190. package/lib/module/core/retryStepCopy.js +39 -0
  191. package/lib/module/core/retryStepCopy.js.map +1 -0
  192. package/lib/module/core/routingCommands.js +57 -0
  193. package/lib/module/core/routingCommands.js.map +1 -0
  194. package/lib/module/core/sessionDeclinedCopy.js +52 -0
  195. package/lib/module/core/sessionDeclinedCopy.js.map +1 -0
  196. package/lib/module/core/sessionStateMapper.js +189 -0
  197. package/lib/module/core/sessionStateMapper.js.map +1 -0
  198. package/lib/module/core/sseReasonMessages.js +446 -0
  199. package/lib/module/core/sseReasonMessages.js.map +1 -0
  200. package/lib/module/data/iso3166Alpha2Codes.json +1 -0
  201. package/lib/module/data/iso3166CountryNames.json +251 -0
  202. package/lib/module/i18n/index.js +25 -0
  203. package/lib/module/i18n/index.js.map +1 -0
  204. package/lib/module/i18n/strings/en.js +297 -0
  205. package/lib/module/i18n/strings/en.js.map +1 -0
  206. package/lib/module/i18n/strings/es.js +302 -0
  207. package/lib/module/i18n/strings/es.js.map +1 -0
  208. package/lib/module/index.js +36 -0
  209. package/lib/module/index.js.map +1 -0
  210. package/lib/module/steps/AddressInfoStep.js +658 -0
  211. package/lib/module/steps/AddressInfoStep.js.map +1 -0
  212. package/lib/module/steps/DocumentsOcrStep.js +399 -0
  213. package/lib/module/steps/DocumentsOcrStep.js.map +1 -0
  214. package/lib/module/steps/EconomicActivityStep.js +209 -0
  215. package/lib/module/steps/EconomicActivityStep.js.map +1 -0
  216. package/lib/module/steps/EmailContactStep.js +145 -0
  217. package/lib/module/steps/EmailContactStep.js.map +1 -0
  218. package/lib/module/steps/EmailOtpStep.js +220 -0
  219. package/lib/module/steps/EmailOtpStep.js.map +1 -0
  220. package/lib/module/steps/FaceMatchStep.js +164 -0
  221. package/lib/module/steps/FaceMatchStep.js.map +1 -0
  222. package/lib/module/steps/FingerprintStep.js +87 -0
  223. package/lib/module/steps/FingerprintStep.js.map +1 -0
  224. package/lib/module/steps/HumanBasicInfoStep.js +246 -0
  225. package/lib/module/steps/HumanBasicInfoStep.js.map +1 -0
  226. package/lib/module/steps/HumanExtendedInfoStep.js +270 -0
  227. package/lib/module/steps/HumanExtendedInfoStep.js.map +1 -0
  228. package/lib/module/steps/LegalBasicInfoStep.js +190 -0
  229. package/lib/module/steps/LegalBasicInfoStep.js.map +1 -0
  230. package/lib/module/steps/LegalExtendedInfoStep.js +168 -0
  231. package/lib/module/steps/LegalExtendedInfoStep.js.map +1 -0
  232. package/lib/module/steps/LivenessMatchStep.js +1177 -0
  233. package/lib/module/steps/LivenessMatchStep.js.map +1 -0
  234. package/lib/module/steps/PhoneContactStep.js +146 -0
  235. package/lib/module/steps/PhoneContactStep.js.map +1 -0
  236. package/lib/module/steps/PhoneOtpStep.js +219 -0
  237. package/lib/module/steps/PhoneOtpStep.js.map +1 -0
  238. package/lib/module/steps/SwornDeclarationStep.js +203 -0
  239. package/lib/module/steps/SwornDeclarationStep.js.map +1 -0
  240. package/lib/module/steps/TaxInfoStep.js +246 -0
  241. package/lib/module/steps/TaxInfoStep.js.map +1 -0
  242. package/lib/module/steps/TermsAndConditionsStep.js +240 -0
  243. package/lib/module/steps/TermsAndConditionsStep.js.map +1 -0
  244. package/lib/module/steps/_shared.js +52 -0
  245. package/lib/module/steps/_shared.js.map +1 -0
  246. package/lib/module/steps/types.js +4 -0
  247. package/lib/module/steps/types.js.map +1 -0
  248. package/lib/module/transport/api.js +173 -0
  249. package/lib/module/transport/api.js.map +1 -0
  250. package/lib/module/transport/irisWebSocket.js +115 -0
  251. package/lib/module/transport/irisWebSocket.js.map +1 -0
  252. package/lib/module/transport/secureUrl.js +45 -0
  253. package/lib/module/transport/secureUrl.js.map +1 -0
  254. package/lib/module/transport/sse.js +242 -0
  255. package/lib/module/transport/sse.js.map +1 -0
  256. package/lib/module/types/index.js +532 -0
  257. package/lib/module/types/index.js.map +1 -0
  258. package/lib/module/ui/MapFallbackBoundary.js +37 -0
  259. package/lib/module/ui/MapFallbackBoundary.js.map +1 -0
  260. package/lib/module/ui/StepShell.js +246 -0
  261. package/lib/module/ui/StepShell.js.map +1 -0
  262. package/lib/module/ui/VelionOnboardingScreen.js +273 -0
  263. package/lib/module/ui/VelionOnboardingScreen.js.map +1 -0
  264. package/lib/module/ui/forms/index.js +5 -0
  265. package/lib/module/ui/forms/index.js.map +1 -0
  266. package/lib/module/ui/forms/useInlineValidation.js +84 -0
  267. package/lib/module/ui/forms/useInlineValidation.js.map +1 -0
  268. package/lib/module/ui/forms/validators.js +27 -0
  269. package/lib/module/ui/forms/validators.js.map +1 -0
  270. package/lib/module/ui/icons/HomeHeartIcon.js +33 -0
  271. package/lib/module/ui/icons/HomeHeartIcon.js.map +1 -0
  272. package/lib/module/ui/icons/StepIcon.js +55 -0
  273. package/lib/module/ui/icons/StepIcon.js.map +1 -0
  274. package/lib/module/ui/overlays/AnalyzingOverlay.js +279 -0
  275. package/lib/module/ui/overlays/AnalyzingOverlay.js.map +1 -0
  276. package/lib/module/ui/overlays/LoadingOverlay.js +104 -0
  277. package/lib/module/ui/overlays/LoadingOverlay.js.map +1 -0
  278. package/lib/module/ui/overlays/ProgressBar.js +97 -0
  279. package/lib/module/ui/overlays/ProgressBar.js.map +1 -0
  280. package/lib/module/ui/overlays/RetryDialog.js +121 -0
  281. package/lib/module/ui/overlays/RetryDialog.js.map +1 -0
  282. package/lib/module/ui/overlays/index.js +6 -0
  283. package/lib/module/ui/overlays/index.js.map +1 -0
  284. package/lib/module/ui/primitives/BackButton.js +71 -0
  285. package/lib/module/ui/primitives/BackButton.js.map +1 -0
  286. package/lib/module/ui/primitives/Banner.js +77 -0
  287. package/lib/module/ui/primitives/Banner.js.map +1 -0
  288. package/lib/module/ui/primitives/Button.js +138 -0
  289. package/lib/module/ui/primitives/Button.js.map +1 -0
  290. package/lib/module/ui/primitives/Card.js +46 -0
  291. package/lib/module/ui/primitives/Card.js.map +1 -0
  292. package/lib/module/ui/primitives/Checkbox.js +136 -0
  293. package/lib/module/ui/primitives/Checkbox.js.map +1 -0
  294. package/lib/module/ui/primitives/CountrySelect.js +284 -0
  295. package/lib/module/ui/primitives/CountrySelect.js.map +1 -0
  296. package/lib/module/ui/primitives/DatePicker.js +241 -0
  297. package/lib/module/ui/primitives/DatePicker.js.map +1 -0
  298. package/lib/module/ui/primitives/Input.js +97 -0
  299. package/lib/module/ui/primitives/Input.js.map +1 -0
  300. package/lib/module/ui/primitives/SearchableSingleSelectList.js +153 -0
  301. package/lib/module/ui/primitives/SearchableSingleSelectList.js.map +1 -0
  302. package/lib/module/ui/primitives/Select.js +205 -0
  303. package/lib/module/ui/primitives/Select.js.map +1 -0
  304. package/lib/module/ui/primitives/Spinner.js +21 -0
  305. package/lib/module/ui/primitives/Spinner.js.map +1 -0
  306. package/lib/module/ui/primitives/index.js +14 -0
  307. package/lib/module/ui/primitives/index.js.map +1 -0
  308. package/lib/module/ui/primitives/searchableSingleSelectFilter.js +27 -0
  309. package/lib/module/ui/primitives/searchableSingleSelectFilter.js.map +1 -0
  310. package/lib/module/ui/theme/ThemeProvider.js +67 -0
  311. package/lib/module/ui/theme/ThemeProvider.js.map +1 -0
  312. package/lib/module/ui/theme/index.js +5 -0
  313. package/lib/module/ui/theme/index.js.map +1 -0
  314. package/lib/module/ui/theme/tokens.js +145 -0
  315. package/lib/module/ui/theme/tokens.js.map +1 -0
  316. package/lib/module/utils/EventEmitter.js +139 -0
  317. package/lib/module/utils/EventEmitter.js.map +1 -0
  318. package/lib/module/utils/base64.js +47 -0
  319. package/lib/module/utils/base64.js.map +1 -0
  320. package/lib/module/utils/deviceFingerprint.js +129 -0
  321. package/lib/module/utils/deviceFingerprint.js.map +1 -0
  322. package/lib/module/utils/documentTypeOptions.js +31 -0
  323. package/lib/module/utils/documentTypeOptions.js.map +1 -0
  324. package/lib/module/utils/googleMapsPreflight.js +84 -0
  325. package/lib/module/utils/googleMapsPreflight.js.map +1 -0
  326. package/lib/module/utils/hmac.js +53 -0
  327. package/lib/module/utils/hmac.js.map +1 -0
  328. package/lib/module/utils/iso3166Countries.js +92 -0
  329. package/lib/module/utils/iso3166Countries.js.map +1 -0
  330. package/lib/module/utils/jpegFromUri.js +40 -0
  331. package/lib/module/utils/jpegFromUri.js.map +1 -0
  332. package/lib/module/utils/keepAwake.js +53 -0
  333. package/lib/module/utils/keepAwake.js.map +1 -0
  334. package/lib/module/utils/log.js +37 -0
  335. package/lib/module/utils/log.js.map +1 -0
  336. package/lib/module/utils/osGeocoder.js +65 -0
  337. package/lib/module/utils/osGeocoder.js.map +1 -0
  338. package/lib/module/utils/parseGoogleAddressComponents.js +69 -0
  339. package/lib/module/utils/parseGoogleAddressComponents.js.map +1 -0
  340. package/lib/module/utils/personNameNormalize.js +20 -0
  341. package/lib/module/utils/personNameNormalize.js.map +1 -0
  342. package/lib/module/utils/sdkError.js +29 -0
  343. package/lib/module/utils/sdkError.js.map +1 -0
  344. package/lib/module/utils/sdkVersion.js +9 -0
  345. package/lib/module/utils/sdkVersion.js.map +1 -0
  346. package/lib/module/utils/stepConfig.js +59 -0
  347. package/lib/module/utils/stepConfig.js.map +1 -0
  348. package/lib/module/utils/taxInfoConfig.js +15 -0
  349. package/lib/module/utils/taxInfoConfig.js.map +1 -0
  350. package/lib/module/utils/useSafeAreaInsets.js +37 -0
  351. package/lib/module/utils/useSafeAreaInsets.js.map +1 -0
  352. package/lib/module/utils/velionExtra.js +44 -0
  353. package/lib/module/utils/velionExtra.js.map +1 -0
  354. package/lib/typescript/camera/AddressSearchBar.d.ts +37 -0
  355. package/lib/typescript/camera/AddressSearchBar.d.ts.map +1 -0
  356. package/lib/typescript/camera/DocumentCapture.d.ts +34 -0
  357. package/lib/typescript/camera/DocumentCapture.d.ts.map +1 -0
  358. package/lib/typescript/camera/LivenessCamera.d.ts +67 -0
  359. package/lib/typescript/camera/LivenessCamera.d.ts.map +1 -0
  360. package/lib/typescript/camera/MapAddressPicker.d.ts +57 -0
  361. package/lib/typescript/camera/MapAddressPicker.d.ts.map +1 -0
  362. package/lib/typescript/core/VelionOnboarding.d.ts +169 -0
  363. package/lib/typescript/core/VelionOnboarding.d.ts.map +1 -0
  364. package/lib/typescript/core/retryStepCopy.d.ts +27 -0
  365. package/lib/typescript/core/retryStepCopy.d.ts.map +1 -0
  366. package/lib/typescript/core/routingCommands.d.ts +39 -0
  367. package/lib/typescript/core/routingCommands.d.ts.map +1 -0
  368. package/lib/typescript/core/sessionDeclinedCopy.d.ts +16 -0
  369. package/lib/typescript/core/sessionDeclinedCopy.d.ts.map +1 -0
  370. package/lib/typescript/core/sessionStateMapper.d.ts +52 -0
  371. package/lib/typescript/core/sessionStateMapper.d.ts.map +1 -0
  372. package/lib/typescript/core/sseReasonMessages.d.ts +20 -0
  373. package/lib/typescript/core/sseReasonMessages.d.ts.map +1 -0
  374. package/lib/typescript/i18n/index.d.ts +13 -0
  375. package/lib/typescript/i18n/index.d.ts.map +1 -0
  376. package/lib/typescript/i18n/strings/en.d.ts +3 -0
  377. package/lib/typescript/i18n/strings/en.d.ts.map +1 -0
  378. package/lib/typescript/i18n/strings/es.d.ts +297 -0
  379. package/lib/typescript/i18n/strings/es.d.ts.map +1 -0
  380. package/lib/typescript/index.d.ts +26 -0
  381. package/lib/typescript/index.d.ts.map +1 -0
  382. package/lib/typescript/steps/AddressInfoStep.d.ts +26 -0
  383. package/lib/typescript/steps/AddressInfoStep.d.ts.map +1 -0
  384. package/lib/typescript/steps/DocumentsOcrStep.d.ts +26 -0
  385. package/lib/typescript/steps/DocumentsOcrStep.d.ts.map +1 -0
  386. package/lib/typescript/steps/EconomicActivityStep.d.ts +29 -0
  387. package/lib/typescript/steps/EconomicActivityStep.d.ts.map +1 -0
  388. package/lib/typescript/steps/EmailContactStep.d.ts +15 -0
  389. package/lib/typescript/steps/EmailContactStep.d.ts.map +1 -0
  390. package/lib/typescript/steps/EmailOtpStep.d.ts +21 -0
  391. package/lib/typescript/steps/EmailOtpStep.d.ts.map +1 -0
  392. package/lib/typescript/steps/FaceMatchStep.d.ts +27 -0
  393. package/lib/typescript/steps/FaceMatchStep.d.ts.map +1 -0
  394. package/lib/typescript/steps/FingerprintStep.d.ts +25 -0
  395. package/lib/typescript/steps/FingerprintStep.d.ts.map +1 -0
  396. package/lib/typescript/steps/HumanBasicInfoStep.d.ts +25 -0
  397. package/lib/typescript/steps/HumanBasicInfoStep.d.ts.map +1 -0
  398. package/lib/typescript/steps/HumanExtendedInfoStep.d.ts +23 -0
  399. package/lib/typescript/steps/HumanExtendedInfoStep.d.ts.map +1 -0
  400. package/lib/typescript/steps/LegalBasicInfoStep.d.ts +17 -0
  401. package/lib/typescript/steps/LegalBasicInfoStep.d.ts.map +1 -0
  402. package/lib/typescript/steps/LegalExtendedInfoStep.d.ts +17 -0
  403. package/lib/typescript/steps/LegalExtendedInfoStep.d.ts.map +1 -0
  404. package/lib/typescript/steps/LivenessMatchStep.d.ts +26 -0
  405. package/lib/typescript/steps/LivenessMatchStep.d.ts.map +1 -0
  406. package/lib/typescript/steps/PhoneContactStep.d.ts +15 -0
  407. package/lib/typescript/steps/PhoneContactStep.d.ts.map +1 -0
  408. package/lib/typescript/steps/PhoneOtpStep.d.ts +19 -0
  409. package/lib/typescript/steps/PhoneOtpStep.d.ts.map +1 -0
  410. package/lib/typescript/steps/SwornDeclarationStep.d.ts +20 -0
  411. package/lib/typescript/steps/SwornDeclarationStep.d.ts.map +1 -0
  412. package/lib/typescript/steps/TaxInfoStep.d.ts +19 -0
  413. package/lib/typescript/steps/TaxInfoStep.d.ts.map +1 -0
  414. package/lib/typescript/steps/TermsAndConditionsStep.d.ts +21 -0
  415. package/lib/typescript/steps/TermsAndConditionsStep.d.ts.map +1 -0
  416. package/lib/typescript/steps/_shared.d.ts +22 -0
  417. package/lib/typescript/steps/_shared.d.ts.map +1 -0
  418. package/lib/typescript/steps/types.d.ts +89 -0
  419. package/lib/typescript/steps/types.d.ts.map +1 -0
  420. package/lib/typescript/transport/api.d.ts +35 -0
  421. package/lib/typescript/transport/api.d.ts.map +1 -0
  422. package/lib/typescript/transport/irisWebSocket.d.ts +72 -0
  423. package/lib/typescript/transport/irisWebSocket.d.ts.map +1 -0
  424. package/lib/typescript/transport/secureUrl.d.ts +14 -0
  425. package/lib/typescript/transport/secureUrl.d.ts.map +1 -0
  426. package/lib/typescript/transport/sse.d.ts +54 -0
  427. package/lib/typescript/transport/sse.d.ts.map +1 -0
  428. package/lib/typescript/types/index.d.ts +1219 -0
  429. package/lib/typescript/types/index.d.ts.map +1 -0
  430. package/lib/typescript/ui/MapFallbackBoundary.d.ts +28 -0
  431. package/lib/typescript/ui/MapFallbackBoundary.d.ts.map +1 -0
  432. package/lib/typescript/ui/StepShell.d.ts +29 -0
  433. package/lib/typescript/ui/StepShell.d.ts.map +1 -0
  434. package/lib/typescript/ui/VelionOnboardingScreen.d.ts +26 -0
  435. package/lib/typescript/ui/VelionOnboardingScreen.d.ts.map +1 -0
  436. package/lib/typescript/ui/forms/index.d.ts +3 -0
  437. package/lib/typescript/ui/forms/index.d.ts.map +1 -0
  438. package/lib/typescript/ui/forms/useInlineValidation.d.ts +30 -0
  439. package/lib/typescript/ui/forms/useInlineValidation.d.ts.map +1 -0
  440. package/lib/typescript/ui/forms/validators.d.ts +11 -0
  441. package/lib/typescript/ui/forms/validators.d.ts.map +1 -0
  442. package/lib/typescript/ui/icons/HomeHeartIcon.d.ts +14 -0
  443. package/lib/typescript/ui/icons/HomeHeartIcon.d.ts.map +1 -0
  444. package/lib/typescript/ui/icons/StepIcon.d.ts +26 -0
  445. package/lib/typescript/ui/icons/StepIcon.d.ts.map +1 -0
  446. package/lib/typescript/ui/overlays/AnalyzingOverlay.d.ts +24 -0
  447. package/lib/typescript/ui/overlays/AnalyzingOverlay.d.ts.map +1 -0
  448. package/lib/typescript/ui/overlays/LoadingOverlay.d.ts +19 -0
  449. package/lib/typescript/ui/overlays/LoadingOverlay.d.ts.map +1 -0
  450. package/lib/typescript/ui/overlays/ProgressBar.d.ts +32 -0
  451. package/lib/typescript/ui/overlays/ProgressBar.d.ts.map +1 -0
  452. package/lib/typescript/ui/overlays/RetryDialog.d.ts +17 -0
  453. package/lib/typescript/ui/overlays/RetryDialog.d.ts.map +1 -0
  454. package/lib/typescript/ui/overlays/index.d.ts +4 -0
  455. package/lib/typescript/ui/overlays/index.d.ts.map +1 -0
  456. package/lib/typescript/ui/primitives/BackButton.d.ts +20 -0
  457. package/lib/typescript/ui/primitives/BackButton.d.ts.map +1 -0
  458. package/lib/typescript/ui/primitives/Banner.d.ts +11 -0
  459. package/lib/typescript/ui/primitives/Banner.d.ts.map +1 -0
  460. package/lib/typescript/ui/primitives/Button.d.ts +27 -0
  461. package/lib/typescript/ui/primitives/Button.d.ts.map +1 -0
  462. package/lib/typescript/ui/primitives/Card.d.ts +10 -0
  463. package/lib/typescript/ui/primitives/Card.d.ts.map +1 -0
  464. package/lib/typescript/ui/primitives/Checkbox.d.ts +25 -0
  465. package/lib/typescript/ui/primitives/Checkbox.d.ts.map +1 -0
  466. package/lib/typescript/ui/primitives/CountrySelect.d.ts +31 -0
  467. package/lib/typescript/ui/primitives/CountrySelect.d.ts.map +1 -0
  468. package/lib/typescript/ui/primitives/DatePicker.d.ts +42 -0
  469. package/lib/typescript/ui/primitives/DatePicker.d.ts.map +1 -0
  470. package/lib/typescript/ui/primitives/Input.d.ts +17 -0
  471. package/lib/typescript/ui/primitives/Input.d.ts.map +1 -0
  472. package/lib/typescript/ui/primitives/SearchableSingleSelectList.d.ts +33 -0
  473. package/lib/typescript/ui/primitives/SearchableSingleSelectList.d.ts.map +1 -0
  474. package/lib/typescript/ui/primitives/Select.d.ts +26 -0
  475. package/lib/typescript/ui/primitives/Select.d.ts.map +1 -0
  476. package/lib/typescript/ui/primitives/Spinner.d.ts +10 -0
  477. package/lib/typescript/ui/primitives/Spinner.d.ts.map +1 -0
  478. package/lib/typescript/ui/primitives/index.d.ts +12 -0
  479. package/lib/typescript/ui/primitives/index.d.ts.map +1 -0
  480. package/lib/typescript/ui/primitives/searchableSingleSelectFilter.d.ts +25 -0
  481. package/lib/typescript/ui/primitives/searchableSingleSelectFilter.d.ts.map +1 -0
  482. package/lib/typescript/ui/theme/ThemeProvider.d.ts +23 -0
  483. package/lib/typescript/ui/theme/ThemeProvider.d.ts.map +1 -0
  484. package/lib/typescript/ui/theme/index.d.ts +3 -0
  485. package/lib/typescript/ui/theme/index.d.ts.map +1 -0
  486. package/lib/typescript/ui/theme/tokens.d.ts +42 -0
  487. package/lib/typescript/ui/theme/tokens.d.ts.map +1 -0
  488. package/lib/typescript/utils/EventEmitter.d.ts +98 -0
  489. package/lib/typescript/utils/EventEmitter.d.ts.map +1 -0
  490. package/lib/typescript/utils/base64.d.ts +19 -0
  491. package/lib/typescript/utils/base64.d.ts.map +1 -0
  492. package/lib/typescript/utils/deviceFingerprint.d.ts +42 -0
  493. package/lib/typescript/utils/deviceFingerprint.d.ts.map +1 -0
  494. package/lib/typescript/utils/documentTypeOptions.d.ts +13 -0
  495. package/lib/typescript/utils/documentTypeOptions.d.ts.map +1 -0
  496. package/lib/typescript/utils/googleMapsPreflight.d.ts +52 -0
  497. package/lib/typescript/utils/googleMapsPreflight.d.ts.map +1 -0
  498. package/lib/typescript/utils/hmac.d.ts +39 -0
  499. package/lib/typescript/utils/hmac.d.ts.map +1 -0
  500. package/lib/typescript/utils/iso3166Countries.d.ts +27 -0
  501. package/lib/typescript/utils/iso3166Countries.d.ts.map +1 -0
  502. package/lib/typescript/utils/jpegFromUri.d.ts +29 -0
  503. package/lib/typescript/utils/jpegFromUri.d.ts.map +1 -0
  504. package/lib/typescript/utils/keepAwake.d.ts +16 -0
  505. package/lib/typescript/utils/keepAwake.d.ts.map +1 -0
  506. package/lib/typescript/utils/log.d.ts +18 -0
  507. package/lib/typescript/utils/log.d.ts.map +1 -0
  508. package/lib/typescript/utils/osGeocoder.d.ts +38 -0
  509. package/lib/typescript/utils/osGeocoder.d.ts.map +1 -0
  510. package/lib/typescript/utils/parseGoogleAddressComponents.d.ts +43 -0
  511. package/lib/typescript/utils/parseGoogleAddressComponents.d.ts.map +1 -0
  512. package/lib/typescript/utils/personNameNormalize.d.ts +10 -0
  513. package/lib/typescript/utils/personNameNormalize.d.ts.map +1 -0
  514. package/lib/typescript/utils/sdkError.d.ts +14 -0
  515. package/lib/typescript/utils/sdkError.d.ts.map +1 -0
  516. package/lib/typescript/utils/sdkVersion.d.ts +7 -0
  517. package/lib/typescript/utils/sdkVersion.d.ts.map +1 -0
  518. package/lib/typescript/utils/stepConfig.d.ts +8 -0
  519. package/lib/typescript/utils/stepConfig.d.ts.map +1 -0
  520. package/lib/typescript/utils/taxInfoConfig.d.ts +7 -0
  521. package/lib/typescript/utils/taxInfoConfig.d.ts.map +1 -0
  522. package/lib/typescript/utils/useSafeAreaInsets.d.ts +26 -0
  523. package/lib/typescript/utils/useSafeAreaInsets.d.ts.map +1 -0
  524. package/lib/typescript/utils/velionExtra.d.ts +24 -0
  525. package/lib/typescript/utils/velionExtra.d.ts.map +1 -0
  526. package/package.json +107 -0
  527. package/src/camera/AddressSearchBar.tsx +363 -0
  528. package/src/camera/DocumentCapture.tsx +514 -0
  529. package/src/camera/LivenessCamera.tsx +706 -0
  530. package/src/camera/MapAddressPicker.tsx +391 -0
  531. package/src/core/VelionOnboarding.ts +1291 -0
  532. package/src/core/retryStepCopy.ts +54 -0
  533. package/src/core/routingCommands.ts +63 -0
  534. package/src/core/sessionDeclinedCopy.ts +76 -0
  535. package/src/core/sessionStateMapper.ts +232 -0
  536. package/src/core/sseReasonMessages.ts +531 -0
  537. package/src/data/iso3166Alpha2Codes.json +1 -0
  538. package/src/data/iso3166CountryNames.json +251 -0
  539. package/src/i18n/index.ts +26 -0
  540. package/src/i18n/strings/en.ts +335 -0
  541. package/src/i18n/strings/es.ts +337 -0
  542. package/src/index.ts +146 -0
  543. package/src/steps/AddressInfoStep.tsx +744 -0
  544. package/src/steps/DocumentsOcrStep.tsx +481 -0
  545. package/src/steps/EconomicActivityStep.tsx +230 -0
  546. package/src/steps/EmailContactStep.tsx +165 -0
  547. package/src/steps/EmailOtpStep.tsx +256 -0
  548. package/src/steps/FaceMatchStep.tsx +176 -0
  549. package/src/steps/FingerprintStep.tsx +99 -0
  550. package/src/steps/HumanBasicInfoStep.tsx +286 -0
  551. package/src/steps/HumanExtendedInfoStep.tsx +362 -0
  552. package/src/steps/LegalBasicInfoStep.tsx +214 -0
  553. package/src/steps/LegalExtendedInfoStep.tsx +184 -0
  554. package/src/steps/LivenessMatchStep.tsx +1351 -0
  555. package/src/steps/PhoneContactStep.tsx +166 -0
  556. package/src/steps/PhoneOtpStep.tsx +255 -0
  557. package/src/steps/SwornDeclarationStep.tsx +237 -0
  558. package/src/steps/TaxInfoStep.tsx +288 -0
  559. package/src/steps/TermsAndConditionsStep.tsx +269 -0
  560. package/src/steps/_shared.ts +69 -0
  561. package/src/steps/types.ts +93 -0
  562. package/src/transport/api.ts +257 -0
  563. package/src/transport/irisWebSocket.ts +186 -0
  564. package/src/transport/secureUrl.ts +47 -0
  565. package/src/transport/sse.ts +310 -0
  566. package/src/types/index.ts +1421 -0
  567. package/src/ui/MapFallbackBoundary.tsx +46 -0
  568. package/src/ui/StepShell.tsx +273 -0
  569. package/src/ui/VelionOnboardingScreen.tsx +297 -0
  570. package/src/ui/forms/index.ts +12 -0
  571. package/src/ui/forms/useInlineValidation.ts +115 -0
  572. package/src/ui/forms/validators.ts +29 -0
  573. package/src/ui/icons/HomeHeartIcon.tsx +34 -0
  574. package/src/ui/icons/StepIcon.tsx +78 -0
  575. package/src/ui/overlays/AnalyzingOverlay.tsx +323 -0
  576. package/src/ui/overlays/LoadingOverlay.tsx +115 -0
  577. package/src/ui/overlays/ProgressBar.tsx +106 -0
  578. package/src/ui/overlays/RetryDialog.tsx +128 -0
  579. package/src/ui/overlays/index.ts +3 -0
  580. package/src/ui/primitives/BackButton.tsx +65 -0
  581. package/src/ui/primitives/Banner.tsx +81 -0
  582. package/src/ui/primitives/Button.tsx +164 -0
  583. package/src/ui/primitives/Card.tsx +55 -0
  584. package/src/ui/primitives/Checkbox.tsx +153 -0
  585. package/src/ui/primitives/CountrySelect.tsx +356 -0
  586. package/src/ui/primitives/DatePicker.tsx +266 -0
  587. package/src/ui/primitives/Input.tsx +110 -0
  588. package/src/ui/primitives/SearchableSingleSelectList.tsx +195 -0
  589. package/src/ui/primitives/Select.tsx +259 -0
  590. package/src/ui/primitives/Spinner.tsx +17 -0
  591. package/src/ui/primitives/index.ts +16 -0
  592. package/src/ui/primitives/searchableSingleSelectFilter.ts +38 -0
  593. package/src/ui/theme/ThemeProvider.tsx +102 -0
  594. package/src/ui/theme/index.ts +17 -0
  595. package/src/ui/theme/tokens.ts +159 -0
  596. package/src/utils/EventEmitter.ts +155 -0
  597. package/src/utils/base64.ts +44 -0
  598. package/src/utils/deviceFingerprint.ts +184 -0
  599. package/src/utils/documentTypeOptions.ts +31 -0
  600. package/src/utils/googleMapsPreflight.ts +89 -0
  601. package/src/utils/hmac.ts +61 -0
  602. package/src/utils/iso3166Countries.ts +111 -0
  603. package/src/utils/jpegFromUri.ts +42 -0
  604. package/src/utils/keepAwake.ts +62 -0
  605. package/src/utils/log.ts +37 -0
  606. package/src/utils/osGeocoder.ts +75 -0
  607. package/src/utils/parseGoogleAddressComponents.ts +123 -0
  608. package/src/utils/personNameNormalize.ts +17 -0
  609. package/src/utils/sdkError.ts +40 -0
  610. package/src/utils/sdkVersion.ts +6 -0
  611. package/src/utils/stepConfig.ts +75 -0
  612. package/src/utils/taxInfoConfig.ts +14 -0
  613. package/src/utils/useSafeAreaInsets.ts +37 -0
  614. package/src/utils/velionExtra.ts +46 -0
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.buildSignedFrameEnvelope = buildSignedFrameEnvelope;
7
+ exports.importHmacKey = importHmacKey;
8
+ var _hmac = require("@noble/hashes/hmac");
9
+ var _sha = require("@noble/hashes/sha256");
10
+ var _base = require("./base64");
11
+ /**
12
+ * @fileoverview HMAC-SHA256 over JPEG frames for the Iris liveness flow.
13
+ *
14
+ * React Native's WebCrypto support is incomplete in Hermes (no `subtle.sign`),
15
+ * so we lean on `@noble/hashes` — pure JavaScript, ~10 KB, no native code.
16
+ *
17
+ * Canonical message (must match the Iris orchestrator exactly):
18
+ * `${sessionId}\n${frameId}\n${ts}\n${sha256hex(jpeg)}`
19
+ *
20
+ * Output: lowercase hex MAC, sent in the JSON envelope's `mac` field.
21
+ */
22
+
23
+ /** Decode the base64 frame_integrity_key from `/liveness-init`. */
24
+ function importHmacKey(base64) {
25
+ return {
26
+ raw: (0, _base.base64ToBytes)(base64)
27
+ };
28
+ }
29
+
30
+ /**
31
+ * Build the signed envelope sent over the Iris WebSocket. Mirrors
32
+ * `LivenessModule.buildSignedEnvelope`:
33
+ * 1. Compute SHA-256 of the JPEG bytes (hex, lowercase).
34
+ * 2. Build the canonical message.
35
+ * 3. HMAC-SHA256 with the imported key.
36
+ * 4. Wrap into `{ type: 'FRAME', frameId, timestamp, image, mac }`.
37
+ *
38
+ * Returns the JSON string ready to `ws.send`.
39
+ */
40
+ function buildSignedFrameEnvelope(args) {
41
+ const ts = args.timestamp ?? Date.now();
42
+ const digest = (0, _sha.sha256)(args.jpegBytes);
43
+ const digestHex = (0, _base.bytesToHexLower)(digest);
44
+ const canonical = `${args.sessionId}\n${args.frameId}\n${ts}\n${digestHex}`;
45
+ const mac = (0, _hmac.hmac)(_sha.sha256, args.key.raw, new TextEncoder().encode(canonical));
46
+ const macHex = (0, _base.bytesToHexLower)(mac);
47
+ return {
48
+ json: JSON.stringify({
49
+ type: 'FRAME',
50
+ frameId: args.frameId,
51
+ timestamp: ts,
52
+ image: args.jpegBase64,
53
+ mac: macHex
54
+ }),
55
+ timestamp: ts
56
+ };
57
+ }
58
+ //# sourceMappingURL=hmac.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_hmac","require","_sha","_base","importHmacKey","base64","raw","base64ToBytes","buildSignedFrameEnvelope","args","ts","timestamp","Date","now","digest","sha256","jpegBytes","digestHex","bytesToHexLower","canonical","sessionId","frameId","mac","hmac","key","TextEncoder","encode","macHex","json","JSON","stringify","type","image","jpegBase64"],"sourceRoot":"../../../src","sources":["utils/hmac.ts"],"mappings":";;;;;;;AAYA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA;AACO,SAASG,aAAaA,CAACC,MAAc,EAAW;EACrD,OAAO;IAAEC,GAAG,EAAE,IAAAC,mBAAa,EAACF,MAAM;EAAE,CAAC;AACvC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,wBAAwBA,CAACC,IAQxC,EAAuC;EACtC,MAAMC,EAAE,GAAGD,IAAI,CAACE,SAAS,IAAIC,IAAI,CAACC,GAAG,CAAC,CAAC;EACvC,MAAMC,MAAM,GAAG,IAAAC,WAAM,EAACN,IAAI,CAACO,SAAS,CAAC;EACrC,MAAMC,SAAS,GAAG,IAAAC,qBAAe,EAACJ,MAAM,CAAC;EACzC,MAAMK,SAAS,GAAG,GAAGV,IAAI,CAACW,SAAS,KAAKX,IAAI,CAACY,OAAO,KAAKX,EAAE,KAAKO,SAAS,EAAE;EAC3E,MAAMK,GAAG,GAAG,IAAAC,UAAI,EAACR,WAAM,EAAEN,IAAI,CAACe,GAAG,CAAClB,GAAG,EAAE,IAAImB,WAAW,CAAC,CAAC,CAACC,MAAM,CAACP,SAAS,CAAC,CAAC;EAC3E,MAAMQ,MAAM,GAAG,IAAAT,qBAAe,EAACI,GAAG,CAAC;EACnC,OAAO;IACLM,IAAI,EAAEC,IAAI,CAACC,SAAS,CAAC;MACnBC,IAAI,EAAE,OAAO;MACbV,OAAO,EAAEZ,IAAI,CAACY,OAAO;MACrBV,SAAS,EAAED,EAAE;MACbsB,KAAK,EAAEvB,IAAI,CAACwB,UAAU;MACtBX,GAAG,EAAEK;IACP,CAAC,CAAC;IACFhB,SAAS,EAAED;EACb,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.filterIso3166Countries = filterIso3166Countries;
7
+ exports.listIso3166CountriesForUi = listIso3166CountriesForUi;
8
+ var _iso3166Alpha2Codes = _interopRequireDefault(require("../data/iso3166Alpha2Codes.json"));
9
+ var _iso3166CountryNames = _interopRequireDefault(require("../data/iso3166CountryNames.json"));
10
+ var _log = require("./log");
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+ /**
13
+ * ISO 3166-1 alpha-2 country list with localized display names.
14
+ *
15
+ * Strategy:
16
+ * 1. If `Intl.DisplayNames` is available (full ICU build, polyfilled
17
+ * Hermes, native iOS runtime, …), use it — it covers every BCP-47
18
+ * locale and stays current with ICU updates.
19
+ * 2. Otherwise fall back to a built-in map covering all 249 ISO 3166-1
20
+ * alpha-2 codes in `es` and `en`. The names match the official
21
+ * Spanish convention (es. wikipedia.org/wiki/ISO_3166-1) and the ISO
22
+ * English short name. Hermes default builds (which ship without
23
+ * `Intl.DisplayNames`) get full localized names without needing
24
+ * `@formatjs/intl-displaynames`.
25
+ */
26
+
27
+ function intlLocaleTag(locale) {
28
+ if (locale === 'en') return 'en';
29
+ /** Rioplatense UI uses Spanish country names with regional formatting. */
30
+ if (locale === 'ar') return 'es-AR';
31
+ return 'es';
32
+ }
33
+ let didWarnAboutFallback = false;
34
+ const NAMES_MAP = _iso3166CountryNames.default;
35
+ function fallbackName(code, lang) {
36
+ const entry = NAMES_MAP[code.toUpperCase()];
37
+ if (!entry || entry.length === 0) return code;
38
+ // [0] = es, [1] = en. Fall through to ES (or to the code itself) if the
39
+ // requested locale is missing.
40
+ return (lang === 'en' ? entry[1] : entry[0]) ?? entry[0] ?? code;
41
+ }
42
+ function buildResolver(localeTag) {
43
+ const lang = localeTag.toLowerCase().startsWith('en') ? 'en' : 'es';
44
+ const intl = globalThis.Intl;
45
+ if (intl && typeof intl.DisplayNames === 'function') {
46
+ try {
47
+ const dn = new intl.DisplayNames([localeTag], {
48
+ type: 'region'
49
+ });
50
+ // Wrap so unknown codes still fall back to the built-in map.
51
+ return {
52
+ of: code => dn.of(code) ?? fallbackName(code, lang)
53
+ };
54
+ } catch (err) {
55
+ // Some Hermes builds expose DisplayNames but throw on construction —
56
+ // fall through to the built-in map.
57
+ _log.log.warn('[iso3166] Intl.DisplayNames threw, falling back', err);
58
+ }
59
+ }
60
+ if (!didWarnAboutFallback) {
61
+ didWarnAboutFallback = true;
62
+ _log.log.info('[iso3166] Using built-in ISO 3166-1 country names (Intl.DisplayNames unavailable). ' + 'All 249 alpha-2 codes resolved via the bundled map.');
63
+ }
64
+ return {
65
+ of: code => fallbackName(code, lang)
66
+ };
67
+ }
68
+
69
+ /**
70
+ * Returns all ISO 3166-1 alpha-2 countries sorted by localized display name.
71
+ */
72
+ function listIso3166CountriesForUi(locale) {
73
+ const tag = intlLocaleTag(locale);
74
+ const codes = _iso3166Alpha2Codes.default;
75
+ const dn = buildResolver(tag);
76
+ const collator = globalThis.Intl?.Collator;
77
+ return codes.map(code => ({
78
+ code,
79
+ name: dn.of(code) ?? code
80
+ })).sort((a, b) => {
81
+ if (collator) {
82
+ return new collator(tag, {
83
+ sensitivity: 'base'
84
+ }).compare(a.name, b.name);
85
+ }
86
+ return a.name.localeCompare(b.name);
87
+ });
88
+ }
89
+
90
+ /**
91
+ * Filters by country name or code (case-insensitive).
92
+ */
93
+ function filterIso3166Countries(options, query) {
94
+ const q = query.trim().toLowerCase();
95
+ if (q.length === 0) return [...options];
96
+ return options.filter(o => o.code.toLowerCase().includes(q) || o.name.toLowerCase().includes(q));
97
+ }
98
+ //# sourceMappingURL=iso3166Countries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_iso3166Alpha2Codes","_interopRequireDefault","require","_iso3166CountryNames","_log","e","__esModule","default","intlLocaleTag","locale","didWarnAboutFallback","NAMES_MAP","COUNTRY_NAMES","fallbackName","code","lang","entry","toUpperCase","length","buildResolver","localeTag","toLowerCase","startsWith","intl","globalThis","Intl","DisplayNames","dn","type","of","err","log","warn","info","listIso3166CountriesForUi","tag","codes","ISO_CODES","collator","Collator","map","name","sort","a","b","sensitivity","compare","localeCompare","filterIso3166Countries","options","query","q","trim","filter","o","includes"],"sourceRoot":"../../../src","sources":["utils/iso3166Countries.ts"],"mappings":"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","ignoreList":[]}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.readJpegFromUri = readJpegFromUri;
7
+ var _expoFileSystem = require("expo-file-system");
8
+ var _base = require("./base64");
9
+ /**
10
+ * Helpers for reading a captured photo into JPEG bytes.
11
+ *
12
+ * Vision-Camera writes captures to a `file://` path; consumers convert that
13
+ * path into either base64 (for the Iris HMAC envelope) or raw bytes (for
14
+ * binary WebSocket frames + direct PUT to signed URLs).
15
+ *
16
+ * Why not `fetch(uri).then(r => r.blob()).then(b => b.arrayBuffer())`?
17
+ *
18
+ * React Native's Blob polyfill does NOT implement `Blob.arrayBuffer()`
19
+ * (it's web-only). Calling it crashes with
20
+ * `TypeError: blob.arrayBuffer is not a function`. The reliable path on
21
+ * iOS + Android is the native `File.arrayBuffer()` from
22
+ * `expo-file-system` v19+, which reads directly from disk into an
23
+ * ArrayBuffer without going through the JS Blob bridge.
24
+ */
25
+
26
+ /**
27
+ * Reads a `file://` URI into JPEG bytes + base64 representation.
28
+ *
29
+ * Accepts both forms vision-camera returns (`/var/mobile/...` without a
30
+ * scheme on iOS; `file:///data/...` on Android). Normalises to `file://`.
31
+ */
32
+ async function readJpegFromUri(uri) {
33
+ const normalised = uri.startsWith('file://') || uri.startsWith('http') ? uri : `file://${uri}`;
34
+ const file = new _expoFileSystem.File(normalised);
35
+ const buf = await file.arrayBuffer();
36
+ const bytes = new Uint8Array(buf);
37
+ const base64 = (0, _base.bytesToBase64)(bytes);
38
+ return {
39
+ bytes,
40
+ base64,
41
+ byteLength: bytes.byteLength
42
+ };
43
+ }
44
+ //# sourceMappingURL=jpegFromUri.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_expoFileSystem","require","_base","readJpegFromUri","uri","normalised","startsWith","file","File","buf","arrayBuffer","bytes","Uint8Array","base64","bytesToBase64","byteLength"],"sourceRoot":"../../../src","sources":["utils/jpegFromUri.ts"],"mappings":";;;;;;AAiBA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeE,eAAeA,CAACC,GAAW,EAAwB;EACvE,MAAMC,UAAU,GAAGD,GAAG,CAACE,UAAU,CAAC,SAAS,CAAC,IAAIF,GAAG,CAACE,UAAU,CAAC,MAAM,CAAC,GAClEF,GAAG,GACH,UAAUA,GAAG,EAAE;EACnB,MAAMG,IAAI,GAAG,IAAIC,oBAAI,CAACH,UAAU,CAAC;EACjC,MAAMI,GAAG,GAAG,MAAMF,IAAI,CAACG,WAAW,CAAC,CAAC;EACpC,MAAMC,KAAK,GAAG,IAAIC,UAAU,CAACH,GAAG,CAAC;EACjC,MAAMI,MAAM,GAAG,IAAAC,mBAAa,EAACH,KAAK,CAAC;EACnC,OAAO;IAAEA,KAAK;IAAEE,MAAM;IAAEE,UAAU,EAAEJ,KAAK,CAACI;EAAW,CAAC;AACxD","ignoreList":[]}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.activateScreenKeepAwake = activateScreenKeepAwake;
7
+ exports.deactivateScreenKeepAwake = deactivateScreenKeepAwake;
8
+ var _log = require("./log");
9
+ /**
10
+ * Thin wrapper around `expo-keep-awake` that prevents the device from
11
+ * locking the screen while the SDK is in the foreground. Without this,
12
+ * Android's screen-timeout policy kicks in during camera-heavy steps
13
+ * (LIVENESS_MATCH, DOCUMENTS_OCR) where the user is holding still and
14
+ * not interacting with the touchscreen — the screen dims, then locks,
15
+ * and the session is interrupted.
16
+ *
17
+ * Implementation is `require`-based so the SDK keeps working in bare
18
+ * React Native setups where `expo-keep-awake` may not be installed —
19
+ * in that case both calls degrade to no-ops and the host is expected to
20
+ * manage the wake lock itself.
21
+ */
22
+
23
+ const TAG = 'velion-onboarding-sdk';
24
+ let activated = false;
25
+ function loadModule() {
26
+ try {
27
+ // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
28
+ const mod = require('expo-keep-awake');
29
+ return mod?.default ?? mod;
30
+ } catch {
31
+ return null;
32
+ }
33
+ }
34
+ function activateScreenKeepAwake() {
35
+ if (activated) return;
36
+ const mod = loadModule();
37
+ if (!mod?.activateKeepAwakeAsync) {
38
+ _log.log.info('[keep-awake] expo-keep-awake unavailable; host should manage the wake lock if screen-lock is unwanted during the flow');
39
+ return;
40
+ }
41
+ activated = true;
42
+ void mod.activateKeepAwakeAsync(TAG).catch(err => {
43
+ activated = false;
44
+ _log.log.warn('[keep-awake] activate failed', err);
45
+ });
46
+ }
47
+ function deactivateScreenKeepAwake() {
48
+ if (!activated) return;
49
+ const mod = loadModule();
50
+ activated = false;
51
+ if (!mod?.deactivateKeepAwake) return;
52
+ try {
53
+ void mod.deactivateKeepAwake(TAG);
54
+ } catch (err) {
55
+ _log.log.warn('[keep-awake] deactivate failed', err);
56
+ }
57
+ }
58
+ //# sourceMappingURL=keepAwake.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_log","require","TAG","activated","loadModule","mod","default","activateScreenKeepAwake","activateKeepAwakeAsync","log","info","catch","err","warn","deactivateScreenKeepAwake","deactivateKeepAwake"],"sourceRoot":"../../../src","sources":["utils/keepAwake.ts"],"mappings":";;;;;;;AAcA,IAAAA,IAAA,GAAAC,OAAA;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,MAAMC,GAAG,GAAG,uBAAuB;AAEnC,IAAIC,SAAS,GAAG,KAAK;AAOrB,SAASC,UAAUA,CAAA,EAA+B;EAChD,IAAI;IACF;IACA,MAAMC,GAAG,GAAGJ,OAAO,CAAC,iBAAiB,CAAC;IACtC,OAAQI,GAAG,EAAEC,OAAO,IAAID,GAAG;EAC7B,CAAC,CAAC,MAAM;IACN,OAAO,IAAI;EACb;AACF;AAEO,SAASE,uBAAuBA,CAAA,EAAS;EAC9C,IAAIJ,SAAS,EAAE;EACf,MAAME,GAAG,GAAGD,UAAU,CAAC,CAAC;EACxB,IAAI,CAACC,GAAG,EAAEG,sBAAsB,EAAE;IAChCC,QAAG,CAACC,IAAI,CACN,uHACF,CAAC;IACD;EACF;EACAP,SAAS,GAAG,IAAI;EAChB,KAAKE,GAAG,CAACG,sBAAsB,CAACN,GAAG,CAAC,CAACS,KAAK,CAAEC,GAAY,IAAK;IAC3DT,SAAS,GAAG,KAAK;IACjBM,QAAG,CAACI,IAAI,CAAC,8BAA8B,EAAED,GAAG,CAAC;EAC/C,CAAC,CAAC;AACJ;AAEO,SAASE,yBAAyBA,CAAA,EAAS;EAChD,IAAI,CAACX,SAAS,EAAE;EAChB,MAAME,GAAG,GAAGD,UAAU,CAAC,CAAC;EACxBD,SAAS,GAAG,KAAK;EACjB,IAAI,CAACE,GAAG,EAAEU,mBAAmB,EAAE;EAC/B,IAAI;IACF,KAAKV,GAAG,CAACU,mBAAmB,CAACb,GAAG,CAAC;EACnC,CAAC,CAAC,OAAOU,GAAG,EAAE;IACZH,QAAG,CAACI,IAAI,CAAC,gCAAgC,EAAED,GAAG,CAAC;EACjD;AACF","ignoreList":[]}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.log = void 0;
7
+ exports.setDebugEnabled = setDebugEnabled;
8
+ /**
9
+ * @fileoverview Lightweight log gate.
10
+ *
11
+ * `log.info()` is silent unless either:
12
+ * - `__DEV__` is true (Metro bundler injects this in development), or
13
+ * - the host explicitly opted in via `VelionConfig.debug = true`.
14
+ *
15
+ * `log.warn()` / `log.error()` always go through. They sit on top of `console.*`
16
+ * so the host's logging pipeline (Sentry, Datadog, …) keeps capturing them.
17
+ */
18
+
19
+ let runtimeDebugEnabled = false;
20
+
21
+ /** Enables verbose logging at runtime. Called from VelionOnboarding when `config.debug === true`. */
22
+ function setDebugEnabled(enabled) {
23
+ runtimeDebugEnabled = enabled;
24
+ }
25
+
26
+ /** Internal — true when `log.info` should produce output. */
27
+ function infoEnabled() {
28
+ return typeof __DEV__ !== 'undefined' && __DEV__ === true || runtimeDebugEnabled;
29
+ }
30
+ const log = exports.log = {
31
+ info(...args) {
32
+ if (!infoEnabled()) return;
33
+ console.info('[VelionSDK]', ...args);
34
+ },
35
+ warn(...args) {
36
+ console.warn('[VelionSDK]', ...args);
37
+ },
38
+ error(...args) {
39
+ console.error('[VelionSDK]', ...args);
40
+ }
41
+ };
42
+ //# sourceMappingURL=log.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["runtimeDebugEnabled","setDebugEnabled","enabled","infoEnabled","__DEV__","log","exports","info","args","console","warn","error"],"sourceRoot":"../../../src","sources":["utils/log.ts"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,IAAIA,mBAAmB,GAAG,KAAK;;AAE/B;AACO,SAASC,eAAeA,CAACC,OAAgB,EAAQ;EACtDF,mBAAmB,GAAGE,OAAO;AAC/B;;AAEA;AACA,SAASC,WAAWA,CAAA,EAAY;EAC9B,OAAQ,OAAOC,OAAO,KAAK,WAAW,IAAIA,OAAO,KAAK,IAAI,IAAKJ,mBAAmB;AACpF;AAEO,MAAMK,GAAG,GAAAC,OAAA,CAAAD,GAAA,GAAG;EACjBE,IAAIA,CAAC,GAAGC,IAAe,EAAQ;IAC7B,IAAI,CAACL,WAAW,CAAC,CAAC,EAAE;IACpBM,OAAO,CAACF,IAAI,CAAC,aAAa,EAAE,GAAGC,IAAI,CAAC;EACtC,CAAC;EACDE,IAAIA,CAAC,GAAGF,IAAe,EAAQ;IAC7BC,OAAO,CAACC,IAAI,CAAC,aAAa,EAAE,GAAGF,IAAI,CAAC;EACtC,CAAC;EACDG,KAAKA,CAAC,GAAGH,IAAe,EAAQ;IAC9BC,OAAO,CAACE,KAAK,CAAC,aAAa,EAAE,GAAGH,IAAI,CAAC;EACvC;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.reverseGeocode = reverseGeocode;
7
+ var Location = _interopRequireWildcard(require("expo-location"));
8
+ var _log = require("./log");
9
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
10
+ /**
11
+ * Reverse geocoding via the OS-native geocoder, bypassing Google's REST API
12
+ * entirely.
13
+ *
14
+ * Why this exists:
15
+ * - The Google Geocoding Web Service is HTTP REST. It does not honour
16
+ * iOS/Android application restrictions on the API key, so a key tightly
17
+ * locked to a bundle ID still fails with REQUEST_DENIED when called from
18
+ * fetch().
19
+ * - The OS geocoder (CLGeocoder on iOS / android.location.Geocoder on
20
+ * Android) needs no Google key and respects the platform conventions
21
+ * users expect. Coverage in urban LATAM is excellent; rural coverage on
22
+ * iOS uses Apple Maps (lower than Google in remote zones) but the
23
+ * downstream OCR step normally recovers the printed address either way.
24
+ * - Keeps the SDK to one Google Maps key whose only purpose is rendering
25
+ * the map via the native Maps SDK — that one IS protected by the iOS /
26
+ * Android app restriction.
27
+ *
28
+ * Returns the same `ParsedAddressFields` shape that the previous Google
29
+ * Geocoding caller produced, so downstream code (`AddressDetailsForm`,
30
+ * payload assembly) doesn't change.
31
+ */
32
+
33
+ /**
34
+ * Returns parsed structured address fields, or `null` when the OS geocoder
35
+ * has no match.
36
+ */
37
+ async function reverseGeocode(args) {
38
+ let results;
39
+ try {
40
+ results = await Location.reverseGeocodeAsync({
41
+ latitude: args.latitude,
42
+ longitude: args.longitude
43
+ });
44
+ } catch (err) {
45
+ _log.log.warn('[os-geocoder] reverse failed', err);
46
+ return null;
47
+ }
48
+ if (!results || results.length === 0) {
49
+ _log.log.info('[os-geocoder] no results');
50
+ return null;
51
+ }
52
+ const top = results[0];
53
+ const isoCc = top.isoCountryCode ?? '';
54
+ return {
55
+ country: isoCc.toUpperCase(),
56
+ state: top.region ?? '',
57
+ city: top.city ?? '',
58
+ // OS reports neighborhoods inconsistently across platforms; map `district`
59
+ // (Apple) / `subregion` (Android fallback) to our `district` field and
60
+ // leave `neighborhood` empty so the user can fill it manually.
61
+ district: top.district ?? top.subregion ?? '',
62
+ neighborhood: '',
63
+ street: top.street ?? '',
64
+ number: top.streetNumber ?? '',
65
+ zip_code: top.postalCode ?? '',
66
+ latitude: args.latitude,
67
+ longitude: args.longitude
68
+ };
69
+ }
70
+ //# sourceMappingURL=osGeocoder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Location","_interopRequireWildcard","require","_log","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","reverseGeocode","args","results","reverseGeocodeAsync","latitude","longitude","err","log","warn","length","info","top","isoCc","isoCountryCode","country","toUpperCase","state","region","city","district","subregion","neighborhood","street","number","streetNumber","zip_code","postalCode"],"sourceRoot":"../../../src","sources":["utils/osGeocoder.ts"],"mappings":";;;;;;AAuBA,IAAAA,QAAA,GAAAC,uBAAA,CAAAC,OAAA;AAIA,IAAAC,IAAA,GAAAD,OAAA;AAA4B,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AA3B5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACO,eAAekB,cAAcA,CAClCC,IAAwB,EACyD;EACjF,IAAIC,OAA2C;EAC/C,IAAI;IACFA,OAAO,GAAG,MAAMzB,QAAQ,CAAC0B,mBAAmB,CAAC;MAC3CC,QAAQ,EAAEH,IAAI,CAACG,QAAQ;MACvBC,SAAS,EAAEJ,IAAI,CAACI;IAClB,CAAC,CAAC;EACJ,CAAC,CAAC,OAAOC,GAAG,EAAE;IACZC,QAAG,CAACC,IAAI,CAAC,8BAA8B,EAAEF,GAAG,CAAC;IAC7C,OAAO,IAAI;EACb;EACA,IAAI,CAACJ,OAAO,IAAIA,OAAO,CAACO,MAAM,KAAK,CAAC,EAAE;IACpCF,QAAG,CAACG,IAAI,CAAC,0BAA0B,CAAC;IACpC,OAAO,IAAI;EACb;EACA,MAAMC,GAAG,GAAGT,OAAO,CAAC,CAAC,CAAE;EACvB,MAAMU,KAAK,GAAGD,GAAG,CAACE,cAAc,IAAI,EAAE;EACtC,OAAO;IACLC,OAAO,EAAEF,KAAK,CAACG,WAAW,CAAC,CAAC;IAC5BC,KAAK,EAAEL,GAAG,CAACM,MAAM,IAAI,EAAE;IACvBC,IAAI,EAAEP,GAAG,CAACO,IAAI,IAAI,EAAE;IACpB;IACA;IACA;IACAC,QAAQ,EAAER,GAAG,CAACQ,QAAQ,IAAIR,GAAG,CAACS,SAAS,IAAI,EAAE;IAC7CC,YAAY,EAAE,EAAE;IAChBC,MAAM,EAAEX,GAAG,CAACW,MAAM,IAAI,EAAE;IACxBC,MAAM,EAAEZ,GAAG,CAACa,YAAY,IAAI,EAAE;IAC9BC,QAAQ,EAAEd,GAAG,CAACe,UAAU,IAAI,EAAE;IAC9BtB,QAAQ,EAAEH,IAAI,CAACG,QAAQ;IACvBC,SAAS,EAAEJ,IAAI,CAACI;EAClB,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isAddressSelectionComplete = isAddressSelectionComplete;
7
+ exports.parseGoogleAddressComponents = parseGoogleAddressComponents;
8
+ /**
9
+ * Maps Google Geocoder / Places `address_components` into
10
+ * `AddressInfoPayload` fields.
11
+ *
12
+ * The wire shape used here is whatever the Google Geocoding REST API
13
+ * returns: `{ long_name, short_name, types: string[] }`.
14
+ */
15
+
16
+ function pick(components, type, useShort) {
17
+ const c = components.find(x => x.types.includes(type));
18
+ if (!c) return '';
19
+ return useShort ? c.short_name : c.long_name;
20
+ }
21
+
22
+ /**
23
+ * Parses `address_components` from a Geocoder result or Place result.
24
+ * Applies fallbacks so required API fields are usually non-empty when Google
25
+ * returns a result.
26
+ */
27
+ function parseGoogleAddressComponents(components, formattedAddress, lat, lng) {
28
+ const list = components ?? [];
29
+ const firstLine = formattedAddress?.split(',')[0]?.trim() ?? '';
30
+ const country = pick(list, 'country', true).toUpperCase();
31
+ const state = pick(list, 'administrative_area_level_1', false) || pick(list, 'administrative_area_level_2', false);
32
+ const city = pick(list, 'locality', false) || pick(list, 'administrative_area_level_2', false) || pick(list, 'administrative_area_level_3', false) || pick(list, 'sublocality_level_1', false);
33
+ const district = pick(list, 'sublocality_level_1', false) || pick(list, 'sublocality', false) || pick(list, 'administrative_area_level_3', false) || undefined;
34
+ const neighborhood = pick(list, 'neighborhood', false) || undefined;
35
+ const route = pick(list, 'route', false);
36
+ const streetNumber = pick(list, 'street_number', false);
37
+ const postal = pick(list, 'postal_code', false);
38
+ let street = route;
39
+ if (!street && firstLine) street = firstLine;
40
+ if (!street) street = '—';
41
+ const number = streetNumber || 'S/N';
42
+ const zip_code = postal || '0000';
43
+ let cityOut = city;
44
+ if (!cityOut) cityOut = state || '—';
45
+ let stateOut = state;
46
+ if (!stateOut) stateOut = cityOut;
47
+ const out = {
48
+ country: country || 'XX',
49
+ state: stateOut,
50
+ city: cityOut,
51
+ street,
52
+ number,
53
+ zip_code,
54
+ latitude: lat,
55
+ longitude: lng
56
+ };
57
+ if (district) out.district = district;
58
+ if (neighborhood) out.neighborhood = neighborhood;
59
+ return out;
60
+ }
61
+
62
+ /**
63
+ * True when the parsed address has enough required fields to send to the
64
+ * backend.
65
+ */
66
+ function isAddressSelectionComplete(parsed, required = {}) {
67
+ const reqState = required.state !== false;
68
+ const reqCity = required.city !== false;
69
+ const reqStreet = required.street !== false;
70
+ const reqNumber = required.number !== false;
71
+ const reqPostal = required.postal !== false;
72
+ return parsed.country.length === 2 && (!reqState || parsed.state.length > 0) && (!reqCity || parsed.city.length > 0) && (!reqStreet || parsed.street.length > 0) && (!reqNumber || parsed.number.length > 0) && (!reqPostal || parsed.zip_code.length > 0);
73
+ }
74
+ //# sourceMappingURL=parseGoogleAddressComponents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["pick","components","type","useShort","c","find","x","types","includes","short_name","long_name","parseGoogleAddressComponents","formattedAddress","lat","lng","list","firstLine","split","trim","country","toUpperCase","state","city","district","undefined","neighborhood","route","streetNumber","postal","street","number","zip_code","cityOut","stateOut","out","latitude","longitude","isAddressSelectionComplete","parsed","required","reqState","reqCity","reqStreet","reqNumber","reqPostal","length"],"sourceRoot":"../../../src","sources":["utils/parseGoogleAddressComponents.ts"],"mappings":"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","ignoreList":[]}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.normalizePersonNameSegment = normalizePersonNameSegment;
7
+ /**
8
+ * Normalizes a single name field (given names or surnames) for API submission.
9
+ *
10
+ * - Trims leading/trailing whitespace
11
+ * - Applies Unicode NFC (composed form) for consistent encoding
12
+ * - Splits on any run of whitespace and rejoins with a single ASCII space,
13
+ * so multiple internal spaces or line breaks become one separator between words
14
+ */
15
+ function normalizePersonNameSegment(raw) {
16
+ const trimmed = raw.trim();
17
+ if (trimmed.length === 0) {
18
+ return '';
19
+ }
20
+ const nfc = trimmed.normalize('NFC');
21
+ const words = nfc.split(/\s+/).filter(w => w.length > 0);
22
+ return words.join(' ');
23
+ }
24
+ //# sourceMappingURL=personNameNormalize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["normalizePersonNameSegment","raw","trimmed","trim","length","nfc","normalize","words","split","filter","w","join"],"sourceRoot":"../../../src","sources":["utils/personNameNormalize.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,0BAA0BA,CAACC,GAAW,EAAU;EAC9D,MAAMC,OAAO,GAAGD,GAAG,CAACE,IAAI,CAAC,CAAC;EAC1B,IAAID,OAAO,CAACE,MAAM,KAAK,CAAC,EAAE;IACxB,OAAO,EAAE;EACX;EACA,MAAMC,GAAG,GAAGH,OAAO,CAACI,SAAS,CAAC,KAAK,CAAC;EACpC,MAAMC,KAAK,GAAGF,GAAG,CAACG,KAAK,CAAC,KAAK,CAAC,CAACC,MAAM,CAAEC,CAAC,IAAKA,CAAC,CAACN,MAAM,GAAG,CAAC,CAAC;EAC1D,OAAOG,KAAK,CAACI,IAAI,CAAC,GAAG,CAAC;AACxB","ignoreList":[]}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isSdkError = isSdkError;
7
+ exports.toSdkError = toSdkError;
8
+ /**
9
+ * @fileoverview Helpers to normalize thrown values into SdkError for consistent onError delivery.
10
+ */
11
+
12
+ /**
13
+ * Returns true if the value looks like an SdkError (has code and message).
14
+ */
15
+ function isSdkError(value) {
16
+ return value != null && typeof value === 'object' && 'code' in value && typeof value.code === 'string' && 'message' in value && typeof value.message === 'string';
17
+ }
18
+
19
+ /**
20
+ * Normalizes any thrown value to an SdkError so it can be passed to rejectStep/onError.
21
+ * Use when catching in a flow that must always end with an event to the implementer.
22
+ */
23
+ function toSdkError(err, defaultCode, defaultMessage) {
24
+ if (isSdkError(err)) {
25
+ return err;
26
+ }
27
+ const message = err instanceof Error ? err.message : typeof err === 'string' ? err : defaultMessage;
28
+ return {
29
+ code: defaultCode,
30
+ message: message || defaultMessage,
31
+ cause: err
32
+ };
33
+ }
34
+ //# sourceMappingURL=sdkError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["isSdkError","value","code","message","toSdkError","err","defaultCode","defaultMessage","Error","cause"],"sourceRoot":"../../../src","sources":["utils/sdkError.ts"],"mappings":";;;;;;;AAAA;AACA;AACA;;AAIA;AACA;AACA;AACO,SAASA,UAAUA,CAACC,KAAc,EAAqB;EAC5D,OACEA,KAAK,IAAI,IAAI,IACb,OAAOA,KAAK,KAAK,QAAQ,IACzB,MAAM,IAAIA,KAAK,IACf,OAAQA,KAAK,CAAcC,IAAI,KAAK,QAAQ,IAC5C,SAAS,IAAID,KAAK,IAClB,OAAQA,KAAK,CAAcE,OAAO,KAAK,QAAQ;AAEnD;;AAEA;AACA;AACA;AACA;AACO,SAASC,UAAUA,CACxBC,GAAY,EACZC,WAAyB,EACzBC,cAAsB,EACZ;EACV,IAAIP,UAAU,CAACK,GAAG,CAAC,EAAE;IACnB,OAAOA,GAAG;EACZ;EACA,MAAMF,OAAO,GACXE,GAAG,YAAYG,KAAK,GAAGH,GAAG,CAACF,OAAO,GAAG,OAAOE,GAAG,KAAK,QAAQ,GAAGA,GAAG,GAAGE,cAAc;EACrF,OAAO;IACLL,IAAI,EAAEI,WAAW;IACjBH,OAAO,EAAEA,OAAO,IAAII,cAAc;IAClCE,KAAK,EAAEJ;EACT,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SDK_VERSION = void 0;
7
+ /**
8
+ * Compile-time SDK version string sent on every authenticated request as
9
+ * `X-Velion-SDK-Version`. Bump it together with `sdk/package.json#version`
10
+ * on every release.
11
+ */
12
+ const SDK_VERSION = exports.SDK_VERSION = '0.1.0';
13
+ //# sourceMappingURL=sdkVersion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["SDK_VERSION","exports"],"sourceRoot":"../../../src","sources":["utils/sdkVersion.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACO,MAAMA,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG,OAAgB","ignoreList":[]}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.resolveCaptureModeFromStepConfig = resolveCaptureModeFromStepConfig;
7
+ exports.resolveDocumentOptionsFromStepConfig = resolveDocumentOptionsFromStepConfig;
8
+ exports.resolveTermsFromStepConfig = resolveTermsFromStepConfig;
9
+ function resolveDocumentOptionsFromStepConfig(cfg) {
10
+ const rows = cfg?.accepted_country_documents;
11
+ if (!Array.isArray(rows)) return undefined;
12
+ const out = [];
13
+ for (const country of rows) {
14
+ const docs = country?.document_types;
15
+ if (!Array.isArray(docs)) continue;
16
+ for (const d of docs) {
17
+ const id = d?.id;
18
+ if (!id || typeof id !== 'string') continue;
19
+ out.push({
20
+ value: id,
21
+ label: typeof d.display_value === 'string' && d.display_value.trim().length > 0 ? d.display_value : id
22
+ });
23
+ }
24
+ }
25
+ return out.length > 0 ? dedupeByValue(out) : undefined;
26
+ }
27
+ function resolveCaptureModeFromStepConfig(cfg) {
28
+ const methods = cfg?.capture_methods;
29
+ if (!methods) return undefined;
30
+ const camera = methods.camera_scan !== false;
31
+ const upload = methods.upload !== false;
32
+ if (camera && upload) return 'both';
33
+ if (camera) return 'camera';
34
+ if (upload) return 'file';
35
+ return 'both';
36
+ }
37
+ function resolveTermsFromStepConfig(cfg) {
38
+ const terms = cfg?.terms;
39
+ if (!Array.isArray(terms)) return undefined;
40
+ const parsed = [];
41
+ for (const [index, term] of terms.entries()) {
42
+ const title = typeof term?.title === 'string' ? term.title.trim() : '';
43
+ const url = typeof term?.url === 'string' ? term.url.trim() : '';
44
+ if (!title && !url) continue;
45
+ parsed.push({
46
+ id: `term-${index + 1}`,
47
+ description: title || url,
48
+ ...(url && {
49
+ link: url
50
+ })
51
+ });
52
+ }
53
+ return parsed.length > 0 ? parsed : undefined;
54
+ }
55
+ function dedupeByValue(options) {
56
+ const seen = new Set();
57
+ const out = [];
58
+ for (const opt of options) {
59
+ if (seen.has(opt.value)) continue;
60
+ seen.add(opt.value);
61
+ out.push(opt);
62
+ }
63
+ return out;
64
+ }
65
+ //# sourceMappingURL=stepConfig.js.map