@onairos/react-native 3.1.11 → 3.1.13

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 (598) hide show
  1. package/lib/commonjs/api/index.js +75 -1
  2. package/lib/commonjs/api/index.js.map +1 -1
  3. package/lib/commonjs/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
  4. package/lib/commonjs/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
  5. package/lib/commonjs/assets/icons/Facebookicon.png +0 -0
  6. package/lib/commonjs/assets/icons/Gmail.png +0 -0
  7. package/lib/commonjs/assets/icons/Linkedinicon.png +0 -0
  8. package/lib/commonjs/assets/icons/Redditicon.png +0 -0
  9. package/lib/commonjs/assets/icons/YouTubeicon2.png +0 -0
  10. package/lib/commonjs/assets/icons/YouTubeicon3.png +0 -0
  11. package/lib/commonjs/assets/icons/farcaster.png +0 -0
  12. package/lib/commonjs/assets/icons/instagram.png +0 -0
  13. package/lib/commonjs/assets/icons/pinterest.png +0 -0
  14. package/lib/commonjs/assets/icons/swerv_logo.png +0 -0
  15. package/lib/commonjs/assets/icons/twitter.jpg +0 -0
  16. package/lib/commonjs/assets/images/Checkbox.svg +3 -0
  17. package/lib/commonjs/assets/images/EnochE.svg +19 -0
  18. package/lib/commonjs/assets/images/Enochicon1.png +0 -0
  19. package/lib/commonjs/assets/images/Face_ID_logo.png +0 -0
  20. package/lib/commonjs/assets/images/Facebookicon.png +0 -0
  21. package/lib/commonjs/assets/images/Gmail.png +0 -0
  22. package/lib/commonjs/assets/images/Googlelogo.png +0 -0
  23. package/lib/commonjs/assets/images/Linkedinicon.png +0 -0
  24. package/lib/commonjs/assets/images/Onairoslogo.png +0 -0
  25. package/lib/commonjs/assets/images/Personalityprofile.svg +3 -0
  26. package/lib/commonjs/assets/images/Personalitytraits.svg +3 -0
  27. package/lib/commonjs/assets/images/Redditicon.png +0 -0
  28. package/lib/commonjs/assets/images/Userpreferences.svg +3 -0
  29. package/lib/commonjs/assets/images/YouTubeicon3.png +0 -0
  30. package/lib/commonjs/assets/images/arrow.svg +20 -0
  31. package/lib/commonjs/assets/images/basicproficon.svg +43 -0
  32. package/lib/commonjs/assets/images/basicprofile.svg +3 -0
  33. package/lib/commonjs/assets/images/checkmark.svg +4 -0
  34. package/lib/commonjs/assets/images/contentanalysis.svg +3 -0
  35. package/lib/commonjs/assets/images/contenticon.svg +23 -0
  36. package/lib/commonjs/assets/images/persona1.png +0 -0
  37. package/lib/commonjs/assets/images/persona2.png +0 -0
  38. package/lib/commonjs/assets/images/persona3.png +0 -0
  39. package/lib/commonjs/assets/images/persona4.png +0 -0
  40. package/lib/commonjs/assets/images/persona5.png +0 -0
  41. package/lib/commonjs/assets/images/personalityicon.svg +18 -0
  42. package/lib/commonjs/assets/images/x-close.svg +3 -0
  43. package/lib/commonjs/components/BodyText.js +27 -0
  44. package/lib/commonjs/components/BodyText.js.map +1 -0
  45. package/lib/commonjs/components/BrandMark.js +44 -0
  46. package/lib/commonjs/components/BrandMark.js.map +1 -0
  47. package/lib/commonjs/components/CodeInput.js +30 -0
  48. package/lib/commonjs/components/CodeInput.js.map +1 -0
  49. package/lib/commonjs/components/EmailInput.js +30 -0
  50. package/lib/commonjs/components/EmailInput.js.map +1 -0
  51. package/lib/commonjs/components/ExistingUserDataConfirmation.js +474 -0
  52. package/lib/commonjs/components/ExistingUserDataConfirmation.js.map +1 -0
  53. package/lib/commonjs/components/GoogleButton.js +55 -0
  54. package/lib/commonjs/components/GoogleButton.js.map +1 -0
  55. package/lib/commonjs/components/HeadingGroup.js +43 -0
  56. package/lib/commonjs/components/HeadingGroup.js.map +1 -0
  57. package/lib/commonjs/components/ModalHeader.js +99 -0
  58. package/lib/commonjs/components/ModalHeader.js.map +1 -0
  59. package/lib/commonjs/components/ModalSheet.js +41 -0
  60. package/lib/commonjs/components/ModalSheet.js.map +1 -0
  61. package/lib/commonjs/components/Onairos.js +1 -3
  62. package/lib/commonjs/components/Onairos.js.map +1 -1
  63. package/lib/commonjs/components/OnairosButton.js +171 -190
  64. package/lib/commonjs/components/OnairosButton.js.map +1 -1
  65. package/lib/commonjs/components/OnairosSignInButton.js +169 -0
  66. package/lib/commonjs/components/OnairosSignInButton.js.map +1 -0
  67. package/lib/commonjs/components/Overlay.js +5 -5
  68. package/lib/commonjs/components/Overlay.js.map +1 -1
  69. package/lib/commonjs/components/PersonaImage.js +60 -0
  70. package/lib/commonjs/components/PersonaImage.js.map +1 -0
  71. package/lib/commonjs/components/PersonaLoadingScreen.js +156 -0
  72. package/lib/commonjs/components/PersonaLoadingScreen.js.map +1 -0
  73. package/lib/commonjs/components/PersonalizationConsentScreen.js +316 -0
  74. package/lib/commonjs/components/PersonalizationConsentScreen.js.map +1 -0
  75. package/lib/commonjs/components/PinCreationScreen.js +393 -0
  76. package/lib/commonjs/components/PinCreationScreen.js.map +1 -0
  77. package/lib/commonjs/components/PinInput.js +282 -120
  78. package/lib/commonjs/components/PinInput.js.map +1 -1
  79. package/lib/commonjs/components/PlatformConnectorsStep.js +828 -0
  80. package/lib/commonjs/components/PlatformConnectorsStep.js.map +1 -0
  81. package/lib/commonjs/components/PlatformToggle.js +180 -0
  82. package/lib/commonjs/components/PlatformToggle.js.map +1 -0
  83. package/lib/commonjs/components/PrimaryButton.js +180 -0
  84. package/lib/commonjs/components/PrimaryButton.js.map +1 -0
  85. package/lib/commonjs/components/SignInMatchAnimation.js +197 -0
  86. package/lib/commonjs/components/SignInMatchAnimation.js.map +1 -0
  87. package/lib/commonjs/components/SignInStep.js +179 -0
  88. package/lib/commonjs/components/SignInStep.js.map +1 -0
  89. package/lib/commonjs/components/TrainingModal.js +808 -563
  90. package/lib/commonjs/components/TrainingModal.js.map +1 -1
  91. package/lib/commonjs/components/UniversalOnboarding.js +2304 -1283
  92. package/lib/commonjs/components/UniversalOnboarding.js.map +1 -1
  93. package/lib/commonjs/components/VerificationStep.js +154 -0
  94. package/lib/commonjs/components/VerificationStep.js.map +1 -0
  95. package/lib/commonjs/components/WelcomeScreen.js +385 -0
  96. package/lib/commonjs/components/WelcomeScreen.js.map +1 -0
  97. package/lib/commonjs/components/icons/Basicproficon.js +37 -0
  98. package/lib/commonjs/components/icons/Basicproficon.js.map +1 -0
  99. package/lib/commonjs/components/icons/Basicprofile.js +21 -0
  100. package/lib/commonjs/components/icons/Basicprofile.js.map +1 -0
  101. package/lib/commonjs/components/icons/Checkbox.js +21 -0
  102. package/lib/commonjs/components/icons/Checkbox.js.map +1 -0
  103. package/lib/commonjs/components/icons/Checkmark.js +27 -0
  104. package/lib/commonjs/components/icons/Checkmark.js.map +1 -0
  105. package/lib/commonjs/components/icons/Contentanalysis.js +21 -0
  106. package/lib/commonjs/components/icons/Contentanalysis.js.map +1 -0
  107. package/lib/commonjs/components/icons/Contenticon.js +39 -0
  108. package/lib/commonjs/components/icons/Contenticon.js.map +1 -0
  109. package/lib/commonjs/components/icons/EnochE.js +41 -0
  110. package/lib/commonjs/components/icons/EnochE.js.map +1 -0
  111. package/lib/commonjs/components/icons/Personalityicon.js +30 -0
  112. package/lib/commonjs/components/icons/Personalityicon.js.map +1 -0
  113. package/lib/commonjs/components/icons/Personalityprofile.js +21 -0
  114. package/lib/commonjs/components/icons/Personalityprofile.js.map +1 -0
  115. package/lib/commonjs/components/icons/Personalitytraits.js +21 -0
  116. package/lib/commonjs/components/icons/Personalitytraits.js.map +1 -0
  117. package/lib/commonjs/components/icons/Userpreferences.js +21 -0
  118. package/lib/commonjs/components/icons/Userpreferences.js.map +1 -0
  119. package/lib/commonjs/components/icons/index.js +84 -0
  120. package/lib/commonjs/components/icons/index.js.map +1 -0
  121. package/lib/commonjs/components/onboarding/OAuthWebView.js +134 -743
  122. package/lib/commonjs/components/onboarding/OAuthWebView.js.map +1 -1
  123. package/lib/commonjs/config/api.js +34 -0
  124. package/lib/commonjs/config/api.js.map +1 -0
  125. package/lib/commonjs/context/AuthContext.js +345 -0
  126. package/lib/commonjs/context/AuthContext.js.map +1 -0
  127. package/lib/commonjs/hooks/useConnectedAccounts.js +111 -0
  128. package/lib/commonjs/hooks/useConnectedAccounts.js.map +1 -0
  129. package/lib/commonjs/hooks/useConnections.js +120 -125
  130. package/lib/commonjs/hooks/useConnections.js.map +1 -1
  131. package/lib/commonjs/hooks/useUserConnections.js +148 -0
  132. package/lib/commonjs/hooks/useUserConnections.js.map +1 -0
  133. package/lib/commonjs/index.js +149 -27
  134. package/lib/commonjs/index.js.map +1 -1
  135. package/lib/commonjs/services/apiClient.js +302 -0
  136. package/lib/commonjs/services/apiClient.js.map +1 -0
  137. package/lib/commonjs/services/authService.js +935 -0
  138. package/lib/commonjs/services/authService.js.map +1 -0
  139. package/lib/commonjs/services/biometricPinService.js +184 -0
  140. package/lib/commonjs/services/biometricPinService.js.map +1 -0
  141. package/lib/commonjs/services/connectedAccountsService.js +268 -0
  142. package/lib/commonjs/services/connectedAccountsService.js.map +1 -0
  143. package/lib/commonjs/services/googleAuthService.js +268 -0
  144. package/lib/commonjs/services/googleAuthService.js.map +1 -0
  145. package/lib/commonjs/services/imageCompressionService.js +260 -0
  146. package/lib/commonjs/services/imageCompressionService.js.map +1 -0
  147. package/lib/commonjs/services/jwtStorageService.js +256 -0
  148. package/lib/commonjs/services/jwtStorageService.js.map +1 -0
  149. package/lib/commonjs/services/mobileTrainingService.js +185 -0
  150. package/lib/commonjs/services/mobileTrainingService.js.map +1 -0
  151. package/lib/commonjs/services/pinEncryptionService.js +84 -0
  152. package/lib/commonjs/services/pinEncryptionService.js.map +1 -0
  153. package/lib/commonjs/services/pinStorageUtils.js +105 -0
  154. package/lib/commonjs/services/pinStorageUtils.js.map +1 -0
  155. package/lib/commonjs/services/platformAuthService.js +956 -722
  156. package/lib/commonjs/services/platformAuthService.js.map +1 -1
  157. package/lib/commonjs/services/storageService.js +404 -0
  158. package/lib/commonjs/services/storageService.js.map +1 -0
  159. package/lib/commonjs/services/trainingApiHelpers.js +73 -0
  160. package/lib/commonjs/services/trainingApiHelpers.js.map +1 -0
  161. package/lib/commonjs/services/userConnectionsService.js +486 -0
  162. package/lib/commonjs/services/userConnectionsService.js.map +1 -0
  163. package/lib/commonjs/services/youtubeMigrationService.js +415 -0
  164. package/lib/commonjs/services/youtubeMigrationService.js.map +1 -0
  165. package/lib/commonjs/theme/index.js +249 -0
  166. package/lib/commonjs/theme/index.js.map +1 -0
  167. package/lib/commonjs/utils/eventUtils.js +288 -0
  168. package/lib/commonjs/utils/eventUtils.js.map +1 -0
  169. package/lib/commonjs/utils/haptics.js +66 -0
  170. package/lib/commonjs/utils/haptics.js.map +1 -0
  171. package/lib/commonjs/utils/imagePreloader.js +6 -0
  172. package/lib/commonjs/utils/imagePreloader.js.map +1 -0
  173. package/lib/module/api/index.js +72 -0
  174. package/lib/module/api/index.js.map +1 -1
  175. package/lib/module/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
  176. package/lib/module/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
  177. package/lib/module/assets/icons/Facebookicon.png +0 -0
  178. package/lib/module/assets/icons/Gmail.png +0 -0
  179. package/lib/module/assets/icons/Linkedinicon.png +0 -0
  180. package/lib/module/assets/icons/Redditicon.png +0 -0
  181. package/lib/module/assets/icons/YouTubeicon2.png +0 -0
  182. package/lib/module/assets/icons/YouTubeicon3.png +0 -0
  183. package/lib/module/assets/icons/farcaster.png +0 -0
  184. package/lib/module/assets/icons/instagram.png +0 -0
  185. package/lib/module/assets/icons/pinterest.png +0 -0
  186. package/lib/module/assets/icons/swerv_logo.png +0 -0
  187. package/lib/module/assets/icons/twitter.jpg +0 -0
  188. package/lib/module/assets/images/Checkbox.svg +3 -0
  189. package/lib/module/assets/images/EnochE.svg +19 -0
  190. package/lib/module/assets/images/Enochicon1.png +0 -0
  191. package/lib/module/assets/images/Face_ID_logo.png +0 -0
  192. package/lib/module/assets/images/Facebookicon.png +0 -0
  193. package/lib/module/assets/images/Gmail.png +0 -0
  194. package/lib/module/assets/images/Googlelogo.png +0 -0
  195. package/lib/module/assets/images/Linkedinicon.png +0 -0
  196. package/lib/module/assets/images/Onairoslogo.png +0 -0
  197. package/lib/module/assets/images/Personalityprofile.svg +3 -0
  198. package/lib/module/assets/images/Personalitytraits.svg +3 -0
  199. package/lib/module/assets/images/Redditicon.png +0 -0
  200. package/lib/module/assets/images/Userpreferences.svg +3 -0
  201. package/lib/module/assets/images/YouTubeicon3.png +0 -0
  202. package/lib/module/assets/images/arrow.svg +20 -0
  203. package/lib/module/assets/images/basicproficon.svg +43 -0
  204. package/lib/module/assets/images/basicprofile.svg +3 -0
  205. package/lib/module/assets/images/checkmark.svg +4 -0
  206. package/lib/module/assets/images/contentanalysis.svg +3 -0
  207. package/lib/module/assets/images/contenticon.svg +23 -0
  208. package/lib/module/assets/images/persona1.png +0 -0
  209. package/lib/module/assets/images/persona2.png +0 -0
  210. package/lib/module/assets/images/persona3.png +0 -0
  211. package/lib/module/assets/images/persona4.png +0 -0
  212. package/lib/module/assets/images/persona5.png +0 -0
  213. package/lib/module/assets/images/personalityicon.svg +18 -0
  214. package/lib/module/assets/images/x-close.svg +3 -0
  215. package/lib/module/components/BodyText.js +20 -0
  216. package/lib/module/components/BodyText.js.map +1 -0
  217. package/lib/module/components/BrandMark.js +37 -0
  218. package/lib/module/components/BrandMark.js.map +1 -0
  219. package/lib/module/components/CodeInput.js +23 -0
  220. package/lib/module/components/CodeInput.js.map +1 -0
  221. package/lib/module/components/EmailInput.js +23 -0
  222. package/lib/module/components/EmailInput.js.map +1 -0
  223. package/lib/module/components/ExistingUserDataConfirmation.js +465 -0
  224. package/lib/module/components/ExistingUserDataConfirmation.js.map +1 -0
  225. package/lib/module/components/GoogleButton.js +48 -0
  226. package/lib/module/components/GoogleButton.js.map +1 -0
  227. package/lib/module/components/HeadingGroup.js +36 -0
  228. package/lib/module/components/HeadingGroup.js.map +1 -0
  229. package/lib/module/components/ModalHeader.js +92 -0
  230. package/lib/module/components/ModalHeader.js.map +1 -0
  231. package/lib/module/components/ModalSheet.js +34 -0
  232. package/lib/module/components/ModalSheet.js.map +1 -0
  233. package/lib/module/components/Onairos.js +1 -3
  234. package/lib/module/components/Onairos.js.map +1 -1
  235. package/lib/module/components/OnairosButton.js +172 -192
  236. package/lib/module/components/OnairosButton.js.map +1 -1
  237. package/lib/module/components/OnairosSignInButton.js +160 -0
  238. package/lib/module/components/OnairosSignInButton.js.map +1 -0
  239. package/lib/module/components/Overlay.js +5 -5
  240. package/lib/module/components/Overlay.js.map +1 -1
  241. package/lib/module/components/PersonaImage.js +53 -0
  242. package/lib/module/components/PersonaImage.js.map +1 -0
  243. package/lib/module/components/PersonaLoadingScreen.js +148 -0
  244. package/lib/module/components/PersonaLoadingScreen.js.map +1 -0
  245. package/lib/module/components/PersonalizationConsentScreen.js +309 -0
  246. package/lib/module/components/PersonalizationConsentScreen.js.map +1 -0
  247. package/lib/module/components/PinCreationScreen.js +386 -0
  248. package/lib/module/components/PinCreationScreen.js.map +1 -0
  249. package/lib/module/components/PinInput.js +283 -120
  250. package/lib/module/components/PinInput.js.map +1 -1
  251. package/lib/module/components/PlatformConnectorsStep.js +820 -0
  252. package/lib/module/components/PlatformConnectorsStep.js.map +1 -0
  253. package/lib/module/components/PlatformToggle.js +173 -0
  254. package/lib/module/components/PlatformToggle.js.map +1 -0
  255. package/lib/module/components/PrimaryButton.js +172 -0
  256. package/lib/module/components/PrimaryButton.js.map +1 -0
  257. package/lib/module/components/SignInMatchAnimation.js +189 -0
  258. package/lib/module/components/SignInMatchAnimation.js.map +1 -0
  259. package/lib/module/components/SignInStep.js +171 -0
  260. package/lib/module/components/SignInStep.js.map +1 -0
  261. package/lib/module/components/TrainingModal.js +809 -565
  262. package/lib/module/components/TrainingModal.js.map +1 -1
  263. package/lib/module/components/UniversalOnboarding.js +2307 -1284
  264. package/lib/module/components/UniversalOnboarding.js.map +1 -1
  265. package/lib/module/components/VerificationStep.js +146 -0
  266. package/lib/module/components/VerificationStep.js.map +1 -0
  267. package/lib/module/components/WelcomeScreen.js +378 -0
  268. package/lib/module/components/WelcomeScreen.js.map +1 -0
  269. package/lib/module/components/icons/Basicproficon.js +30 -0
  270. package/lib/module/components/icons/Basicproficon.js.map +1 -0
  271. package/lib/module/components/icons/Basicprofile.js +14 -0
  272. package/lib/module/components/icons/Basicprofile.js.map +1 -0
  273. package/lib/module/components/icons/Checkbox.js +14 -0
  274. package/lib/module/components/icons/Checkbox.js.map +1 -0
  275. package/lib/module/components/icons/Checkmark.js +20 -0
  276. package/lib/module/components/icons/Checkmark.js.map +1 -0
  277. package/lib/module/components/icons/Contentanalysis.js +14 -0
  278. package/lib/module/components/icons/Contentanalysis.js.map +1 -0
  279. package/lib/module/components/icons/Contenticon.js +32 -0
  280. package/lib/module/components/icons/Contenticon.js.map +1 -0
  281. package/lib/module/components/icons/EnochE.js +34 -0
  282. package/lib/module/components/icons/EnochE.js.map +1 -0
  283. package/lib/module/components/icons/Personalityicon.js +23 -0
  284. package/lib/module/components/icons/Personalityicon.js.map +1 -0
  285. package/lib/module/components/icons/Personalityprofile.js +14 -0
  286. package/lib/module/components/icons/Personalityprofile.js.map +1 -0
  287. package/lib/module/components/icons/Personalitytraits.js +14 -0
  288. package/lib/module/components/icons/Personalitytraits.js.map +1 -0
  289. package/lib/module/components/icons/Userpreferences.js +14 -0
  290. package/lib/module/components/icons/Userpreferences.js.map +1 -0
  291. package/lib/module/components/icons/index.js +13 -0
  292. package/lib/module/components/icons/index.js.map +1 -0
  293. package/lib/module/components/onboarding/OAuthWebView.js +136 -744
  294. package/lib/module/components/onboarding/OAuthWebView.js.map +1 -1
  295. package/lib/module/config/api.js +26 -0
  296. package/lib/module/config/api.js.map +1 -0
  297. package/lib/module/context/AuthContext.js +335 -0
  298. package/lib/module/context/AuthContext.js.map +1 -0
  299. package/lib/module/hooks/useConnectedAccounts.js +106 -0
  300. package/lib/module/hooks/useConnectedAccounts.js.map +1 -0
  301. package/lib/module/hooks/useConnections.js +119 -125
  302. package/lib/module/hooks/useConnections.js.map +1 -1
  303. package/lib/module/hooks/useUserConnections.js +140 -0
  304. package/lib/module/hooks/useUserConnections.js.map +1 -0
  305. package/lib/module/index.js +51 -15
  306. package/lib/module/index.js.map +1 -1
  307. package/lib/module/services/apiClient.js +298 -0
  308. package/lib/module/services/apiClient.js.map +1 -0
  309. package/lib/module/services/authService.js +905 -0
  310. package/lib/module/services/authService.js.map +1 -0
  311. package/lib/module/services/biometricPinService.js +173 -0
  312. package/lib/module/services/biometricPinService.js.map +1 -0
  313. package/lib/module/services/connectedAccountsService.js +255 -0
  314. package/lib/module/services/connectedAccountsService.js.map +1 -0
  315. package/lib/module/services/googleAuthService.js +258 -0
  316. package/lib/module/services/googleAuthService.js.map +1 -0
  317. package/lib/module/services/imageCompressionService.js +250 -0
  318. package/lib/module/services/imageCompressionService.js.map +1 -0
  319. package/lib/module/services/jwtStorageService.js +239 -0
  320. package/lib/module/services/jwtStorageService.js.map +1 -0
  321. package/lib/module/services/mobileTrainingService.js +172 -0
  322. package/lib/module/services/mobileTrainingService.js.map +1 -0
  323. package/lib/module/services/pinEncryptionService.js +75 -0
  324. package/lib/module/services/pinEncryptionService.js.map +1 -0
  325. package/lib/module/services/pinStorageUtils.js +93 -0
  326. package/lib/module/services/pinStorageUtils.js.map +1 -0
  327. package/lib/module/services/platformAuthService.js +943 -704
  328. package/lib/module/services/platformAuthService.js.map +1 -1
  329. package/lib/module/services/storageService.js +383 -0
  330. package/lib/module/services/storageService.js.map +1 -0
  331. package/lib/module/services/trainingApiHelpers.js +67 -0
  332. package/lib/module/services/trainingApiHelpers.js.map +1 -0
  333. package/lib/module/services/userConnectionsService.js +476 -0
  334. package/lib/module/services/userConnectionsService.js.map +1 -0
  335. package/lib/module/services/youtubeMigrationService.js +404 -0
  336. package/lib/module/services/youtubeMigrationService.js.map +1 -0
  337. package/lib/module/theme/index.js +244 -0
  338. package/lib/module/theme/index.js.map +1 -0
  339. package/lib/module/utils/eventUtils.js +270 -0
  340. package/lib/module/utils/eventUtils.js.map +1 -0
  341. package/lib/module/utils/haptics.js +59 -0
  342. package/lib/module/utils/haptics.js.map +1 -0
  343. package/lib/module/utils/imagePreloader.js +3 -0
  344. package/lib/module/utils/imagePreloader.js.map +1 -0
  345. package/lib/typescript/api/index.d.ts +8 -0
  346. package/lib/typescript/api/index.d.ts.map +1 -1
  347. package/lib/typescript/components/BodyText.d.ts +10 -0
  348. package/lib/typescript/components/BodyText.d.ts.map +1 -0
  349. package/lib/typescript/components/BrandMark.d.ts +11 -0
  350. package/lib/typescript/components/BrandMark.d.ts.map +1 -0
  351. package/lib/typescript/components/CodeInput.d.ts +10 -0
  352. package/lib/typescript/components/CodeInput.d.ts.map +1 -0
  353. package/lib/typescript/components/EmailInput.d.ts +8 -0
  354. package/lib/typescript/components/EmailInput.d.ts.map +1 -0
  355. package/lib/typescript/components/ExistingUserDataConfirmation.d.ts +12 -0
  356. package/lib/typescript/components/ExistingUserDataConfirmation.d.ts.map +1 -0
  357. package/lib/typescript/components/GoogleButton.d.ts +11 -0
  358. package/lib/typescript/components/GoogleButton.d.ts.map +1 -0
  359. package/lib/typescript/components/HeadingGroup.d.ts +11 -0
  360. package/lib/typescript/components/HeadingGroup.d.ts.map +1 -0
  361. package/lib/typescript/components/ModalHeader.d.ts +11 -0
  362. package/lib/typescript/components/ModalHeader.d.ts.map +1 -0
  363. package/lib/typescript/components/ModalSheet.d.ts +13 -0
  364. package/lib/typescript/components/ModalSheet.d.ts.map +1 -0
  365. package/lib/typescript/components/Onairos.d.ts.map +1 -1
  366. package/lib/typescript/components/OnairosButton.d.ts +29 -4
  367. package/lib/typescript/components/OnairosButton.d.ts.map +1 -1
  368. package/lib/typescript/components/OnairosSignInButton.d.ts +14 -0
  369. package/lib/typescript/components/OnairosSignInButton.d.ts.map +1 -0
  370. package/lib/typescript/components/PersonaImage.d.ts +8 -0
  371. package/lib/typescript/components/PersonaImage.d.ts.map +1 -0
  372. package/lib/typescript/components/PersonaLoadingScreen.d.ts +10 -0
  373. package/lib/typescript/components/PersonaLoadingScreen.d.ts.map +1 -0
  374. package/lib/typescript/components/PersonalizationConsentScreen.d.ts +10 -0
  375. package/lib/typescript/components/PersonalizationConsentScreen.d.ts.map +1 -0
  376. package/lib/typescript/components/PinCreationScreen.d.ts +10 -0
  377. package/lib/typescript/components/PinCreationScreen.d.ts.map +1 -0
  378. package/lib/typescript/components/PinInput.d.ts +11 -1
  379. package/lib/typescript/components/PinInput.d.ts.map +1 -1
  380. package/lib/typescript/components/PlatformConnectorsStep.d.ts +11 -0
  381. package/lib/typescript/components/PlatformConnectorsStep.d.ts.map +1 -0
  382. package/lib/typescript/components/PlatformToggle.d.ts +20 -0
  383. package/lib/typescript/components/PlatformToggle.d.ts.map +1 -0
  384. package/lib/typescript/components/PrimaryButton.d.ts +22 -0
  385. package/lib/typescript/components/PrimaryButton.d.ts.map +1 -0
  386. package/lib/typescript/components/SignInMatchAnimation.d.ts +9 -0
  387. package/lib/typescript/components/SignInMatchAnimation.d.ts.map +1 -0
  388. package/lib/typescript/components/SignInStep.d.ts +12 -0
  389. package/lib/typescript/components/SignInStep.d.ts.map +1 -0
  390. package/lib/typescript/components/TrainingModal.d.ts +12 -1
  391. package/lib/typescript/components/TrainingModal.d.ts.map +1 -1
  392. package/lib/typescript/components/UniversalOnboarding.d.ts +14 -1
  393. package/lib/typescript/components/UniversalOnboarding.d.ts.map +1 -1
  394. package/lib/typescript/components/VerificationStep.d.ts +13 -0
  395. package/lib/typescript/components/VerificationStep.d.ts.map +1 -0
  396. package/lib/typescript/components/WelcomeScreen.d.ts +9 -0
  397. package/lib/typescript/components/WelcomeScreen.d.ts.map +1 -0
  398. package/lib/typescript/components/icons/Basicproficon.d.ts +5 -0
  399. package/lib/typescript/components/icons/Basicproficon.d.ts.map +1 -0
  400. package/lib/typescript/components/icons/Basicprofile.d.ts +5 -0
  401. package/lib/typescript/components/icons/Basicprofile.d.ts.map +1 -0
  402. package/lib/typescript/components/icons/Checkbox.d.ts +5 -0
  403. package/lib/typescript/components/icons/Checkbox.d.ts.map +1 -0
  404. package/lib/typescript/components/icons/Checkmark.d.ts +5 -0
  405. package/lib/typescript/components/icons/Checkmark.d.ts.map +1 -0
  406. package/lib/typescript/components/icons/Contentanalysis.d.ts +5 -0
  407. package/lib/typescript/components/icons/Contentanalysis.d.ts.map +1 -0
  408. package/lib/typescript/components/icons/Contenticon.d.ts +5 -0
  409. package/lib/typescript/components/icons/Contenticon.d.ts.map +1 -0
  410. package/lib/typescript/components/icons/EnochE.d.ts +5 -0
  411. package/lib/typescript/components/icons/EnochE.d.ts.map +1 -0
  412. package/lib/typescript/components/icons/Personalityicon.d.ts +5 -0
  413. package/lib/typescript/components/icons/Personalityicon.d.ts.map +1 -0
  414. package/lib/typescript/components/icons/Personalityprofile.d.ts +5 -0
  415. package/lib/typescript/components/icons/Personalityprofile.d.ts.map +1 -0
  416. package/lib/typescript/components/icons/Personalitytraits.d.ts +5 -0
  417. package/lib/typescript/components/icons/Personalitytraits.d.ts.map +1 -0
  418. package/lib/typescript/components/icons/Userpreferences.d.ts +5 -0
  419. package/lib/typescript/components/icons/Userpreferences.d.ts.map +1 -0
  420. package/lib/typescript/components/icons/index.d.ts +12 -0
  421. package/lib/typescript/components/icons/index.d.ts.map +1 -0
  422. package/lib/typescript/components/onboarding/OAuthWebView.d.ts.map +1 -1
  423. package/lib/typescript/config/api.d.ts +24 -0
  424. package/lib/typescript/config/api.d.ts.map +1 -0
  425. package/lib/typescript/context/AuthContext.d.ts +34 -0
  426. package/lib/typescript/context/AuthContext.d.ts.map +1 -0
  427. package/lib/typescript/hooks/useConnectedAccounts.d.ts +11 -0
  428. package/lib/typescript/hooks/useConnectedAccounts.d.ts.map +1 -0
  429. package/lib/typescript/hooks/useConnections.d.ts +10 -5
  430. package/lib/typescript/hooks/useConnections.d.ts.map +1 -1
  431. package/lib/typescript/hooks/useUserConnections.d.ts +12 -0
  432. package/lib/typescript/hooks/useUserConnections.d.ts.map +1 -0
  433. package/lib/typescript/index.d.ts +24 -6
  434. package/lib/typescript/index.d.ts.map +1 -1
  435. package/lib/typescript/services/apiClient.d.ts +91 -0
  436. package/lib/typescript/services/apiClient.d.ts.map +1 -0
  437. package/lib/typescript/services/authService.d.ts +216 -0
  438. package/lib/typescript/services/authService.d.ts.map +1 -0
  439. package/lib/typescript/services/biometricPinService.d.ts +29 -0
  440. package/lib/typescript/services/biometricPinService.d.ts.map +1 -0
  441. package/lib/typescript/services/connectedAccountsService.d.ts +56 -0
  442. package/lib/typescript/services/connectedAccountsService.d.ts.map +1 -0
  443. package/lib/typescript/services/googleAuthService.d.ts +63 -0
  444. package/lib/typescript/services/googleAuthService.d.ts.map +1 -0
  445. package/lib/typescript/services/imageCompressionService.d.ts +37 -0
  446. package/lib/typescript/services/imageCompressionService.d.ts.map +1 -0
  447. package/lib/typescript/services/jwtStorageService.d.ts +86 -0
  448. package/lib/typescript/services/jwtStorageService.d.ts.map +1 -0
  449. package/lib/typescript/services/mobileTrainingService.d.ts +45 -0
  450. package/lib/typescript/services/mobileTrainingService.d.ts.map +1 -0
  451. package/lib/typescript/services/pinEncryptionService.d.ts +17 -0
  452. package/lib/typescript/services/pinEncryptionService.d.ts.map +1 -0
  453. package/lib/typescript/services/pinStorageUtils.d.ts +25 -0
  454. package/lib/typescript/services/pinStorageUtils.d.ts.map +1 -0
  455. package/lib/typescript/services/platformAuthService.d.ts +34 -109
  456. package/lib/typescript/services/platformAuthService.d.ts.map +1 -1
  457. package/lib/typescript/services/storageService.d.ts +128 -0
  458. package/lib/typescript/services/storageService.d.ts.map +1 -0
  459. package/lib/typescript/services/trainingApiHelpers.d.ts +38 -0
  460. package/lib/typescript/services/trainingApiHelpers.d.ts.map +1 -0
  461. package/lib/typescript/services/userConnectionsService.d.ts +90 -0
  462. package/lib/typescript/services/userConnectionsService.d.ts.map +1 -0
  463. package/lib/typescript/services/youtubeMigrationService.d.ts +12 -0
  464. package/lib/typescript/services/youtubeMigrationService.d.ts.map +1 -0
  465. package/lib/typescript/theme/index.d.ts +416 -0
  466. package/lib/typescript/theme/index.d.ts.map +1 -0
  467. package/lib/typescript/types/index.d.ts +39 -0
  468. package/lib/typescript/types/index.d.ts.map +1 -1
  469. package/lib/typescript/utils/eventUtils.d.ts +108 -0
  470. package/lib/typescript/utils/eventUtils.d.ts.map +1 -0
  471. package/lib/typescript/utils/haptics.d.ts +11 -0
  472. package/lib/typescript/utils/haptics.d.ts.map +1 -0
  473. package/lib/typescript/utils/imagePreloader.d.ts +2 -0
  474. package/lib/typescript/utils/imagePreloader.d.ts.map +1 -0
  475. package/package.json +158 -145
  476. package/src/api/index.ts +41 -0
  477. package/src/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
  478. package/src/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
  479. package/src/assets/icons/Facebookicon.png +0 -0
  480. package/src/assets/icons/Gmail.png +0 -0
  481. package/src/assets/icons/Linkedinicon.png +0 -0
  482. package/src/assets/icons/Redditicon.png +0 -0
  483. package/src/assets/icons/YouTubeicon2.png +0 -0
  484. package/src/assets/icons/YouTubeicon3.png +0 -0
  485. package/src/assets/icons/farcaster.png +0 -0
  486. package/src/assets/icons/instagram.png +0 -0
  487. package/src/assets/icons/pinterest.png +0 -0
  488. package/src/assets/icons/swerv_logo.png +0 -0
  489. package/src/assets/icons/twitter.jpg +0 -0
  490. package/src/assets/images/Checkbox.svg +3 -0
  491. package/src/assets/images/EnochE.svg +19 -0
  492. package/src/assets/images/Enochicon1.png +0 -0
  493. package/src/assets/images/Face_ID_logo.png +0 -0
  494. package/src/assets/images/Facebookicon.png +0 -0
  495. package/src/assets/images/Gmail.png +0 -0
  496. package/src/assets/images/Googlelogo.png +0 -0
  497. package/src/assets/images/Linkedinicon.png +0 -0
  498. package/src/assets/images/Onairoslogo.png +0 -0
  499. package/src/assets/images/Personalityprofile.svg +3 -0
  500. package/src/assets/images/Personalitytraits.svg +3 -0
  501. package/src/assets/images/Redditicon.png +0 -0
  502. package/src/assets/images/Userpreferences.svg +3 -0
  503. package/src/assets/images/YouTubeicon3.png +0 -0
  504. package/src/assets/images/arrow.svg +20 -0
  505. package/src/assets/images/basicproficon.svg +43 -0
  506. package/src/assets/images/basicprofile.svg +3 -0
  507. package/src/assets/images/checkmark.svg +4 -0
  508. package/src/assets/images/contentanalysis.svg +3 -0
  509. package/src/assets/images/contenticon.svg +23 -0
  510. package/src/assets/images/persona1.png +0 -0
  511. package/src/assets/images/persona2.png +0 -0
  512. package/src/assets/images/persona3.png +0 -0
  513. package/src/assets/images/persona4.png +0 -0
  514. package/src/assets/images/persona5.png +0 -0
  515. package/src/assets/images/personalityicon.svg +18 -0
  516. package/src/assets/images/x-close.svg +3 -0
  517. package/src/components/BodyText.tsx +33 -0
  518. package/src/components/BrandMark.tsx +62 -0
  519. package/src/components/CodeInput.tsx +32 -0
  520. package/src/components/EmailInput.tsx +31 -0
  521. package/src/components/ExistingUserDataConfirmation.tsx +507 -0
  522. package/src/components/GoogleButton.tsx +55 -0
  523. package/src/components/HeadingGroup.tsx +49 -0
  524. package/src/components/ModalHeader.tsx +125 -0
  525. package/src/components/ModalSheet.tsx +57 -0
  526. package/src/components/Onairos.tsx +422 -424
  527. package/src/components/OnairosButton.tsx +339 -359
  528. package/src/components/OnairosSignInButton.tsx +166 -0
  529. package/src/components/Overlay.tsx +506 -506
  530. package/src/components/PersonaImage.tsx +79 -0
  531. package/src/components/PersonaLoadingScreen.tsx +201 -0
  532. package/src/components/PersonalizationConsentScreen.tsx +410 -0
  533. package/src/components/PinCreationScreen.tsx +492 -0
  534. package/src/components/PinInput.tsx +555 -343
  535. package/src/components/PlatformConnectorsStep.tsx +892 -0
  536. package/src/components/PlatformToggle.tsx +226 -0
  537. package/src/components/PrimaryButton.tsx +214 -0
  538. package/src/components/SignInMatchAnimation.tsx +225 -0
  539. package/src/components/SignInStep.tsx +217 -0
  540. package/src/components/TrainingModal.tsx +1047 -737
  541. package/src/components/UniversalOnboarding.tsx +2888 -1820
  542. package/src/components/VerificationStep.tsx +198 -0
  543. package/src/components/WelcomeScreen.tsx +473 -0
  544. package/src/components/icons/Basicproficon.tsx +30 -0
  545. package/src/components/icons/Basicprofile.tsx +17 -0
  546. package/src/components/icons/Checkbox.tsx +17 -0
  547. package/src/components/icons/Checkmark.tsx +24 -0
  548. package/src/components/icons/Contentanalysis.tsx +17 -0
  549. package/src/components/icons/Contenticon.tsx +30 -0
  550. package/src/components/icons/EnochE.tsx +39 -0
  551. package/src/components/icons/Personalityicon.tsx +22 -0
  552. package/src/components/icons/Personalityprofile.tsx +17 -0
  553. package/src/components/icons/Personalitytraits.tsx +17 -0
  554. package/src/components/icons/Userpreferences.tsx +17 -0
  555. package/src/components/icons/index.ts +12 -0
  556. package/src/components/onboarding/OAuthWebView.tsx +232 -838
  557. package/src/config/api.ts +25 -0
  558. package/src/context/AuthContext.tsx +393 -0
  559. package/src/hooks/useConnectedAccounts.ts +139 -0
  560. package/src/hooks/useConnections.ts +129 -131
  561. package/src/hooks/useUserConnections.ts +166 -0
  562. package/src/index.ts +94 -49
  563. package/src/services/apiClient.ts +337 -0
  564. package/src/services/authService.ts +1008 -0
  565. package/src/services/biometricPinService.ts +193 -0
  566. package/src/services/connectedAccountsService.ts +290 -0
  567. package/src/services/googleAuthService.ts +279 -0
  568. package/src/services/imageCompressionService.ts +303 -0
  569. package/src/services/jwtStorageService.ts +257 -0
  570. package/src/services/mobileTrainingService.ts +204 -0
  571. package/src/services/pinEncryptionService.ts +76 -0
  572. package/src/services/pinStorageUtils.ts +97 -0
  573. package/src/services/platformAuthService.ts +1346 -1113
  574. package/src/services/storageService.ts +452 -0
  575. package/src/services/trainingApiHelpers.ts +67 -0
  576. package/src/services/userConnectionsService.ts +557 -0
  577. package/src/services/youtubeMigrationService.ts +454 -0
  578. package/src/theme/index.ts +239 -0
  579. package/src/types/index.ts +265 -238
  580. package/src/utils/eventUtils.ts +303 -0
  581. package/src/utils/haptics.ts +59 -0
  582. package/src/utils/imagePreloader.ts +2 -0
  583. package/README.md +0 -375
  584. package/lib/commonjs/assets/images/email.png +0 -0
  585. package/lib/commonjs/assets/images/linkedin.png +0 -0
  586. package/lib/commonjs/assets/images/reddit.png +0 -0
  587. package/lib/commonjs/assets/images/youtube.png +0 -0
  588. package/lib/commonjs/components/UniversalOnboarding.tsx.new +0 -455
  589. package/lib/module/assets/images/email.png +0 -0
  590. package/lib/module/assets/images/linkedin.png +0 -0
  591. package/lib/module/assets/images/reddit.png +0 -0
  592. package/lib/module/assets/images/youtube.png +0 -0
  593. package/lib/module/components/UniversalOnboarding.tsx.new +0 -455
  594. package/src/assets/images/email.png +0 -0
  595. package/src/assets/images/linkedin.png +0 -0
  596. package/src/assets/images/reddit.png +0 -0
  597. package/src/assets/images/youtube.png +0 -0
  598. package/src/components/UniversalOnboarding.tsx.new +0 -455
@@ -1,106 +1,207 @@
1
- import React, { useEffect, useRef, useState } from 'react';
2
- import { View, Text, StyleSheet, TouchableOpacity, Dimensions, Modal, TouchableWithoutFeedback, SafeAreaView, Image, Alert } from 'react-native';
3
- import Icon from 'react-native-vector-icons/MaterialIcons';
1
+ import React, { useState, useEffect, useRef } from 'react';
2
+ import { View, Text, StyleSheet, TouchableOpacity, ActivityIndicator, Dimensions, TextInput, Keyboard, Animated, Platform, KeyboardAvoidingView, Modal, TouchableWithoutFeedback } from 'react-native';
4
3
  import { io } from 'socket.io-client';
5
- import { COLORS } from '../constants';
4
+ import { getAuthToken, getOnairosUsername } from '../services/authService';
5
+ import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
6
+ import AsyncStorage from '@react-native-async-storage/async-storage';
7
+ import { getEncryptedPinForAPI } from '../services/pinEncryptionService';
8
+ import { clearTemporaryPin } from '../services/pinStorageUtils';
9
+ // import EmailVerification from '../../../components/EmailVerification'; // Commented out - file doesn't exist
10
+ // import { sendEmailVerificationCode } from '../../../services/api'; // Commented out - use local API instead
11
+ import { startEnochTrainingWithYouTubeCheck } from '../services/mobileTrainingService';
12
+ import { ExistingUserDataConfirmation } from './ExistingUserDataConfirmation';
6
13
  const {
7
14
  width,
8
15
  height
9
16
  } = Dimensions.get('window');
10
17
  export const TrainingModal = ({
11
18
  visible,
12
- progress,
13
- eta,
14
19
  onCancel,
15
20
  onComplete,
16
21
  modelKey,
17
22
  username,
18
- test = false
23
+ isPrimaryAuth = false,
24
+ autoFocusEmailInput = false,
25
+ // Add default value
26
+ navigation
19
27
  }) => {
20
- // Socket and training state
21
- const socketRef = useRef(null);
28
+ const [progress, setProgress] = useState(0);
29
+ const [email, setEmail] = useState('');
30
+ const [emailError, setEmailError] = useState('');
31
+ const [isTrainingComplete, setIsTrainingComplete] = useState(false);
32
+ const [isSubmittingEmail, setIsSubmittingEmail] = useState(false);
22
33
  const [socketConnected, setSocketConnected] = useState(false);
23
34
  const [trainingStatus, setTrainingStatus] = useState('Initializing...');
24
35
  const [hasError, setHasError] = useState(false);
25
- const [errorCode, setErrorCode] = useState(null);
26
- const [isTrainingComplete, setIsTrainingComplete] = useState(false);
27
36
  const [userTraits, setUserTraits] = useState(null);
28
37
  const [inferenceResults, setInferenceResults] = useState(null);
29
- const [internalProgress, setInternalProgress] = useState(0);
30
- const [isEnochSDK, setIsEnochSDK] = useState(false); // Determine if using Enoch SDK
31
- const [trainingResults, setTrainingResults] = useState(null);
32
-
33
- // Use internal progress if available, otherwise fall back to prop progress
34
- const currentProgress = internalProgress > 0 ? internalProgress / 100 : progress;
35
- const progressPercentage = Math.round(currentProgress * 100);
36
-
37
- // Mock user data for now - in real implementation this would come from props
38
- const userToken = 'mock-token'; // TODO: Get from actual auth
39
- const userInfo = {
40
- username: username || 'mobile_user',
41
- email: null,
42
- id: null,
43
- name: username || 'mobile_user'
38
+ const socketRef = useRef(null);
39
+ const emailInputRef = useRef(null); // Add email input ref
40
+ const [userToken, setUserToken] = useState(null);
41
+ const [userInfo, setUserInfo] = useState(null);
42
+ const [matchStep, setMatchStep] = useState('email');
43
+ const [matchCount, setMatchCount] = useState(0);
44
+ const [isContinueLoading, setIsContinueLoading] = useState(false);
45
+ const [existingUserAccountInfo, setExistingUserAccountInfo] = useState(null);
46
+
47
+ // --- Modal slide animation ---
48
+ const modalTranslateY = useRef(new Animated.Value(height)).current;
49
+ const animationDuration = 300; // Increased duration for smoother animation
50
+
51
+ // Reset state when modal becomes invisible
52
+ useEffect(() => {
53
+ if (!visible) {
54
+ // Reset all state
55
+ setEmail('');
56
+ setEmailError('');
57
+ setIsSubmittingEmail(false);
58
+ setMatchStep('email');
59
+ setMatchCount(0);
60
+ setIsContinueLoading(false);
61
+ setProgress(0);
62
+ setIsTrainingComplete(false);
63
+ setHasError(false);
64
+ setTrainingStatus('Initializing...');
65
+ setUserTraits(null);
66
+ setInferenceResults(null);
67
+ setUserToken(null);
68
+ setUserInfo(null);
69
+
70
+ // Reset animation value
71
+ modalTranslateY.setValue(height);
72
+ }
73
+ }, [visible]);
74
+
75
+ // Handle animation
76
+ useEffect(() => {
77
+ if (visible) {
78
+ // Ensure we start from the bottom
79
+ modalTranslateY.setValue(height);
80
+ // Animate up
81
+ Animated.spring(modalTranslateY, {
82
+ toValue: 0,
83
+ useNativeDriver: true,
84
+ damping: 20,
85
+ mass: 1,
86
+ stiffness: 200
87
+ }).start();
88
+ }
89
+ }, [visible]);
90
+
91
+ // Handle modal close
92
+ const handleModalClose = () => {
93
+ Animated.spring(modalTranslateY, {
94
+ toValue: height,
95
+ useNativeDriver: true,
96
+ damping: 20,
97
+ mass: 1,
98
+ stiffness: 200
99
+ }).start(() => {
100
+ onCancel();
101
+ });
44
102
  };
45
103
 
46
- // Check if we should use Enoch SDK (based on modelKey or other criteria)
104
+ // Get auth token and user info on mount
47
105
  useEffect(() => {
48
- // For now, default to clean training unless specified
49
- // In real implementation, this would be determined by SDK type
50
- setIsEnochSDK((modelKey === null || modelKey === void 0 ? void 0 : modelKey.includes('enoch')) || false);
51
- }, [modelKey]);
106
+ const loadUserData = async () => {
107
+ try {
108
+ const token = await getAuthToken();
109
+ setUserToken(token);
110
+ if (token) {
111
+ // Use provided username instead of making API call to avoid 404 error
112
+ // The backend JWT contains username but /api/user/profile endpoint doesn't exist
113
+ const fallbackUsername = username || 'mobile_user';
114
+ console.log('🔍 Using provided username for training:', fallbackUsername);
115
+ setUserInfo({
116
+ username: fallbackUsername,
117
+ email: null,
118
+ id: null // Will be filled by backend during training
119
+ });
120
+ }
121
+ } catch (error) {
122
+ console.error('Error loading user data:', error);
123
+ // Fallback user info
124
+ setUserInfo({
125
+ username: username || 'mobile_user',
126
+ email: null,
127
+ id: null
128
+ });
129
+ }
130
+ };
131
+ if (visible) {
132
+ loadUserData();
133
+ }
134
+ }, [visible, username]);
52
135
 
53
- // Start training with new API schema
54
- const startTraining = async socketId => {
136
+ // Start Enoch training via API
137
+ const startEnochTraining = async socketId => {
55
138
  try {
56
139
  setTrainingStatus('Starting training...');
57
- setInternalProgress(10);
58
- setHasError(false);
59
- setErrorCode(null);
140
+ setProgress(10);
60
141
  if (!userToken) {
61
142
  throw new Error('No authentication token available');
62
143
  }
144
+ console.log('🚀 Starting Enoch training with socketId:', socketId);
63
145
 
64
- // Determine endpoint based on SDK type
65
- const endpoint = isEnochSDK ? '/mobile-training/enoch' : '/mobile-training/clean';
66
- console.log(`🚀 Starting training with endpoint: ${endpoint}`);
67
- console.log('🔍 Production mode: Using new training API schema');
146
+ // Get stored Onairos username for API calls
147
+ const storedUsername = await getOnairosUsername();
148
+ const finalUsername = storedUsername || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.username) || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.name) || username || 'mobile_user';
68
149
 
69
- // Prepare training data in new format
150
+ // Get connected platforms information
151
+ const connectedPlatforms = await AsyncStorage.getItem('connectedPlatforms');
152
+ const platformsList = connectedPlatforms ? JSON.parse(connectedPlatforms) : [];
153
+ console.log('📱 Connected platforms for training:', platformsList);
154
+
155
+ // Get encrypted PIN for training (if available)
156
+ const encryptedPin = await getEncryptedPinForAPI().catch(error => {
157
+ console.warn('⚠️ Could not get encrypted PIN for training:', error);
158
+ return null;
159
+ });
160
+
161
+ // Prepare user data for training - match backend expected format
70
162
  const trainingData = {
71
- Info: {
72
- username: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.username) || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.name) || username || 'mobile_user',
73
- // Mock connected platforms - in real implementation this would come from props
74
- connectedPlatforms: ['youtube', 'instagram', 'reddit'] // TODO: Get from actual connections
75
- }
163
+ socketId,
164
+ username: finalUsername,
165
+ // This will be used as fallback in backend
166
+ email: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.email) || null,
167
+ // Backend will use this if available
168
+ modelKey: modelKey || null,
169
+ connectedPlatforms: platformsList,
170
+ // Include connected platforms
171
+ // Include encrypted PIN if available
172
+ ...(encryptedPin && {
173
+ encryptedPin: encryptedPin,
174
+ hasPinData: true
175
+ })
76
176
  };
77
- console.log('📤 Sending training data:', trainingData);
78
-
79
- // Call the new training API
80
- const response = await fetch(`https://api2.onairos.uk${endpoint}`, {
81
- method: 'POST',
82
- headers: {
83
- 'Content-Type': 'application/json',
84
- 'Authorization': `Bearer ${userToken}` // JWT token authentication
85
- },
86
- body: JSON.stringify(trainingData)
87
- });
88
- const result = await response.json();
177
+ console.log('📤 Starting training with YouTube migration check:', trainingData);
178
+ console.log('🔑 Using stored username:', storedUsername);
179
+ console.log('🔑 Final username for training:', finalUsername);
180
+ console.log('🔗 Connected platforms:', platformsList);
181
+ console.log('🔐 PIN included in training:', !!encryptedPin);
182
+
183
+ // Use the new training function that includes YouTube migration check
184
+ const result = await startEnochTrainingWithYouTubeCheck(trainingData);
89
185
  if (result.success) {
90
186
  console.log('🚀 Training Started:', result.message);
91
- setTrainingStatus('Training initiated...');
92
- setInternalProgress(20);
93
- } else {
94
- console.error('Training start failed:', result.error);
187
+ console.log('🎯 Training Features:', result.features);
95
188
 
96
- // Handle specific error codes from new schema
97
- if (result.code) {
98
- setErrorCode(result.code);
99
- handleTrainingError(result.code, result.error);
100
- } else {
101
- setTrainingStatus(`Error: ${result.error}`);
102
- setHasError(true);
189
+ // Log the new features from the spec
190
+ if (result.features) {
191
+ console.log('✅ Inference enabled:', result.features.inference);
192
+ console.log('💾 Storage method:', result.features.storage);
193
+ console.log('🔒 Compression enabled:', result.features.compression);
194
+ console.log('🔐 Encryption enabled:', result.features.encryption);
195
+ console.log('📊 Training type:', result.features.type);
196
+ console.log('🗄️ Databases:', result.features.databases);
197
+ console.log('📈 Query scores enabled:', result.features.queryScores);
103
198
  }
199
+ setTrainingStatus('Training model...');
200
+ setProgress(20);
201
+ } else {
202
+ console.error('Training start failed:', result.error);
203
+ setTrainingStatus(`Error: ${result.error}`);
204
+ setHasError(true);
104
205
  }
105
206
  } catch (error) {
106
207
  console.error('Training start error:', error);
@@ -109,268 +210,93 @@ export const TrainingModal = ({
109
210
  }
110
211
  };
111
212
 
112
- // Handle training errors with specific error codes
113
- const handleTrainingError = (code, message) => {
114
- console.error(`Training Error [${code}]:`, message);
115
- setHasError(true);
116
- switch (code) {
117
- case 'PIN_REQUIRED':
118
- setTrainingStatus('PIN setup required');
119
- Alert.alert('PIN Required', 'Please set up your PIN first before training.', [{
120
- text: 'Cancel',
121
- style: 'cancel'
122
- }, {
123
- text: 'Set PIN',
124
- onPress: () => {
125
- // TODO: Navigate to PIN setup
126
- console.log('Navigate to PIN setup');
127
- }
128
- }]);
129
- break;
130
- case 'CONNECTIONS_REQUIRED':
131
- setTrainingStatus('No connected accounts');
132
- Alert.alert('Connections Required', 'Please connect at least one social media account before training.', [{
133
- text: 'Cancel',
134
- style: 'cancel'
135
- }, {
136
- text: 'Connect',
137
- onPress: () => {
138
- // TODO: Navigate to connections
139
- console.log('Navigate to connections');
140
- }
141
- }]);
142
- break;
143
- case 'INSUFFICIENT_DATA':
144
- setTrainingStatus('Insufficient data for training');
145
- Alert.alert('Insufficient Data', 'We need more interaction data to train your model effectively. Please use your connected platforms more and try again.', [{
146
- text: 'OK',
147
- style: 'default'
148
- }]);
149
- break;
150
- case 'ENCRYPTION_REQUIRED':
151
- setTrainingStatus('Model encryption failed');
152
- Alert.alert('Encryption Error', 'Failed to encrypt your model. Please try again.', [{
153
- text: 'OK',
154
- style: 'default'
155
- }]);
156
- break;
157
- default:
158
- setTrainingStatus(`Error: ${message}`);
159
- Alert.alert('Training Error', message || 'An unexpected error occurred during training.', [{
160
- text: 'OK',
161
- style: 'default'
162
- }]);
163
- }
164
- };
165
-
166
- // Simulate training progress for test mode
167
- const simulateTraining = () => {
168
- var _phases$currentPhase;
169
- console.log('🧪 Starting simulated training with new schema phases...');
170
- setTrainingStatus('Validating Requirements');
171
- setInternalProgress(5);
172
-
173
- // Simulate all phases from the new schema
174
- const phases = [{
175
- progress: 10,
176
- status: 'Validating Requirements',
177
- delay: 1000
178
- }, {
179
- progress: 25,
180
- status: 'Training Model',
181
- delay: 2000
182
- }, {
183
- progress: 50,
184
- status: 'Training Model',
185
- delay: 2000
186
- }, {
187
- progress: 65,
188
- status: 'Model Trained - Running Test Inference',
189
- delay: 1500
190
- }, {
191
- progress: 80,
192
- status: 'Encrypting and Compressing Model',
193
- delay: 1000
194
- }, {
195
- progress: 95,
196
- status: 'Uploading Encrypted Model to ARDrive',
197
- delay: 1500
198
- }, {
199
- progress: 100,
200
- status: 'Complete!',
201
- delay: 500
202
- }];
203
- let currentPhase = 0;
204
- const progressInterval = setInterval(() => {
205
- if (currentPhase < phases.length) {
206
- const phase = phases[currentPhase];
207
- setInternalProgress(phase.progress);
208
- setTrainingStatus(phase.status);
209
- if (phase.progress === 100) {
210
- setIsTrainingComplete(true);
211
- clearInterval(progressInterval);
212
-
213
- // Mock completion results
214
- const mockResults = {
215
- completed: true,
216
- message: "Model trained, encrypted, and stored successfully",
217
- storage: "ARDrive",
218
- encryption: true,
219
- inference: isEnochSDK,
220
- // Only Enoch SDK runs inference
221
- modelUrl: `https://arweave.net/mock_tx_${Date.now()}`
222
- };
223
- setTrainingResults(mockResults);
224
-
225
- // Auto-complete after a short delay
226
- setTimeout(() => {
227
- onComplete && onComplete();
228
- }, 1000);
229
- }
230
- currentPhase++;
231
- }
232
- }, ((_phases$currentPhase = phases[currentPhase]) === null || _phases$currentPhase === void 0 ? void 0 : _phases$currentPhase.delay) || 1000);
233
-
234
- // Cleanup interval on unmount
235
- return () => clearInterval(progressInterval);
236
- };
237
-
238
213
  // Setup socket connection and training
239
214
  useEffect(() => {
240
- if (!visible || !userInfo) return;
215
+ if (!visible || !userToken || !userInfo) return;
241
216
  console.log('Setting up socket connection for training...');
242
217
  console.log('🧑‍💻 User info available:', userInfo);
243
- console.log('🧪 Test mode:', test);
244
- console.log('🔧 Using Enoch SDK:', isEnochSDK);
245
218
 
246
- // If test mode is enabled, use simulation instead of real API
247
- if (test) {
248
- console.log('🧪 Test mode enabled - Using simulated training with new schema');
249
- setSocketConnected(true);
250
- simulateTraining();
251
- return;
252
- }
219
+ // Initialize socket connection
220
+ socketRef.current = io('https://api2.onairos.uk', {
221
+ transports: ['websocket'],
222
+ autoConnect: false
223
+ });
253
224
 
254
- // Initialize real socket connection
255
- try {
256
- console.log('🔌 Production mode: Initializing real socket connection');
225
+ // Socket event listeners
226
+ socketRef.current.on('connect', () => {
227
+ var _socketRef$current;
228
+ console.log('✅ Socket connected for training');
229
+ setSocketConnected(true);
230
+ const socketId = (_socketRef$current = socketRef.current) === null || _socketRef$current === void 0 ? void 0 : _socketRef$current.id;
231
+ if (socketId) {
232
+ // ❌ DISABLED: This was causing training to start too early (when modal opens)
233
+ // Training should only start when transitioning from connectors to PIN screen
234
+ // startEnochTraining(socketId);
235
+ console.log('🔌 Socket ready, but training will start only when user transitions to PIN screen');
236
+ }
237
+ });
238
+ socketRef.current.on('disconnect', () => {
239
+ console.log('❌ Socket disconnected');
240
+ setSocketConnected(false);
241
+ });
242
+ socketRef.current.on('trainingCompleted', data => {
243
+ console.log('✅ Training Complete:', data);
244
+ setTrainingStatus('Running test inference...');
245
+ setProgress(60);
246
+ });
247
+ socketRef.current.on('inferenceCompleted', data => {
248
+ console.log('🧠 Inference Complete:', data);
249
+ setTrainingStatus('Uploading to S3...');
250
+ setProgress(80);
251
+ setUserTraits(data.traits);
252
+ setInferenceResults(data.inferenceResults);
253
+ });
254
+ socketRef.current.on('modelStandby', data => {
255
+ console.log('🎉 All Complete:', data);
257
256
 
258
- // Initialize socket connection
259
- socketRef.current = io('https://api2.onairos.uk', {
260
- transports: ['websocket'],
261
- autoConnect: false
262
- });
257
+ // Log completion details based on new spec
258
+ if (data.completed) {
259
+ console.log('✅ Training completed:', data.message);
260
+ console.log('💾 Storage method:', data.storage);
261
+ console.log('🔐 Encryption enabled:', data.encryption);
262
+ console.log('🧠 Inference enabled:', data.inference);
263
263
 
264
- // Socket event listeners for new schema
265
- socketRef.current.on('connect', () => {
266
- var _socketRef$current;
267
- console.log('✅ Socket connected for training');
268
- setSocketConnected(true);
269
- const socketId = (_socketRef$current = socketRef.current) === null || _socketRef$current === void 0 ? void 0 : _socketRef$current.id;
270
- if (socketId) {
271
- startTraining(socketId);
264
+ // Log database info for Enoch mode
265
+ if (data.databases && Array.isArray(data.databases)) {
266
+ console.log('🗄️ Databases used:', data.databases.join(', '));
272
267
  }
273
- });
274
- socketRef.current.on('disconnect', () => {
275
- console.log('❌ Socket disconnected');
276
- setSocketConnected(false);
277
- });
278
- socketRef.current.on('connect_error', error => {
279
- console.error('❌ Socket connection error:', error);
280
- setTrainingStatus('Connection failed');
281
- setHasError(true);
282
- });
283
268
 
284
- // Handle training updates with new schema phases
285
- socketRef.current.on('trainingUpdate', data => {
286
- console.log('📡 Training update received:', data);
287
- if (data.error) {
288
- if (data.code) {
289
- setErrorCode(data.code);
290
- handleTrainingError(data.code, data.error);
291
- } else {
292
- console.error('Training update error:', data.error);
293
- setTrainingStatus(`Error: ${data.error}`);
294
- setHasError(true);
295
- }
296
- } else {
297
- // Handle different status phases
298
- if (data.status) {
299
- setTrainingStatus(data.status);
300
-
301
- // Update progress based on phase
302
- switch (data.status) {
303
- case 'Validating Requirements':
304
- setInternalProgress(10);
305
- break;
306
- case 'Training Model':
307
- setInternalProgress(data.percent || 40);
308
- break;
309
- case 'Model Trained - Running Test Inference':
310
- setInternalProgress(65);
311
- break;
312
- case 'Encrypting and Compressing Model':
313
- setInternalProgress(80);
314
- break;
315
- case 'Uploading Encrypted Model to ARDrive':
316
- setInternalProgress(90);
317
- break;
318
- default:
319
- if (data.percent) {
320
- setInternalProgress(data.percent);
321
- }
322
- }
323
- }
324
- if (data.progress) {
325
- setInternalProgress(data.progress);
326
- }
269
+ // Log testing mode
270
+ if (data.testing) {
271
+ console.log('🧪 Testing mode enabled');
327
272
  }
328
- });
273
+ }
274
+ setIsTrainingComplete(true);
275
+ setTrainingStatus('Complete!');
276
+ setProgress(100);
329
277
 
330
- // Handle training completion with new schema
331
- socketRef.current.on('trainingCompleted', data => {
332
- console.log('✅ Training Complete:', data);
333
- if (data.completed && data.storage === 'ARDrive' && data.encryption === true) {
334
- setTrainingStatus('Training completed successfully!');
335
- setIsTrainingComplete(true);
336
- setInternalProgress(100);
337
- setTrainingResults(data);
338
-
339
- // Display results
340
- console.log('✅ Model URL:', data.modelUrl);
341
- console.log('✅ Storage:', data.storage);
342
- console.log('✅ Encrypted:', data.encryption);
343
- console.log('✅ Inference:', data.inference);
344
-
345
- // Auto-complete after a short delay
346
- setTimeout(() => {
347
- onComplete && onComplete();
348
- }, 1500);
349
- } else {
350
- console.error('Training completion missing required fields:', data);
351
- setTrainingStatus('Training completed with warnings');
352
- setHasError(true);
353
- }
354
- });
278
+ // Clear temporary PIN after training is complete
279
+ clearTemporaryPin();
355
280
 
356
- // Legacy handlers for backward compatibility
357
- socketRef.current.on('inferenceCompleted', data => {
358
- console.log('🧠 Inference Complete:', data);
359
- setUserTraits(data.traits);
360
- setInferenceResults(data.inferenceResults);
361
- });
362
- socketRef.current.on('modelStandby', data => {
363
- console.log('🎉 Model Ready:', data);
364
- // This is handled by trainingCompleted now
365
- });
281
+ // Show continue button for primary auth when training is complete
282
+ if (isPrimaryAuth) {
283
+ setMatchStep('found');
284
+ setMatchCount(Math.floor(Math.random() * 10) + 5);
285
+ }
286
+ });
287
+ socketRef.current.on('trainingUpdate', data => {
288
+ if (data.error) {
289
+ console.error('Training update error:', data.error);
290
+ setTrainingStatus(`Error: ${data.error}`);
291
+ setHasError(true);
292
+ } else if (data.progress) {
293
+ setProgress(data.progress);
294
+ setTrainingStatus(data.status || 'Training in progress...');
295
+ }
296
+ });
366
297
 
367
- // Connect to socket
368
- socketRef.current.connect();
369
- } catch (socketError) {
370
- console.error('🚨 Production mode: Socket connection failed:', socketError);
371
- setTrainingStatus('Failed to connect to training service');
372
- setHasError(true);
373
- }
298
+ // Connect to socket
299
+ socketRef.current.connect();
374
300
 
375
301
  // Cleanup function
376
302
  return () => {
@@ -380,329 +306,647 @@ export const TrainingModal = ({
380
306
  socketRef.current = null;
381
307
  }
382
308
  };
383
- }, [visible, userInfo, test, isEnochSDK]);
384
-
385
- // Render error details for specific error codes
386
- const renderErrorDetails = () => {
387
- if (!hasError || !errorCode) return null;
388
- const errorDetails = {
389
- 'PIN_REQUIRED': {
390
- icon: 'lock',
391
- title: 'PIN Setup Required',
392
- description: 'Set up your PIN to secure your AI model'
393
- },
394
- 'CONNECTIONS_REQUIRED': {
395
- icon: 'link',
396
- title: 'Connect Accounts',
397
- description: 'Connect at least one social media account'
398
- },
399
- 'INSUFFICIENT_DATA': {
400
- icon: 'data-usage',
401
- title: 'More Data Needed',
402
- description: 'We need more interaction data to train effectively'
403
- },
404
- 'ENCRYPTION_REQUIRED': {
405
- icon: 'security',
406
- title: 'Encryption Failed',
407
- description: 'Failed to encrypt your model securely'
309
+ }, [visible, userToken, userInfo]);
310
+
311
+ // When modal becomes visible and autoFocus is requested, focus the email input
312
+ useEffect(() => {
313
+ if (visible && autoFocusEmailInput && matchStep === 'email' && emailInputRef.current) {
314
+ const timer = setTimeout(() => {
315
+ var _emailInputRef$curren;
316
+ (_emailInputRef$curren = emailInputRef.current) === null || _emailInputRef$curren === void 0 || _emailInputRef$curren.focus();
317
+ }, 150); // Small delay to sync with modal animation
318
+ return () => clearTimeout(timer);
319
+ } else if (!visible && emailInputRef.current) {
320
+ // Optional: Blur input when modal is not visible
321
+ // emailInputRef.current?.blur();
322
+ }
323
+ }, [visible, autoFocusEmailInput, matchStep]);
324
+
325
+ // Validate email format
326
+ const validateEmail = email => {
327
+ // Check for reviewer bypass first
328
+ if (email.toLowerCase().trim() === 'reviewer') {
329
+ return true; // Valid for reviewer bypass
330
+ }
331
+ const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
332
+ return emailRegex.test(email);
333
+ };
334
+ const handleEmailSubmit = async () => {
335
+ // Check for reviewer bypass
336
+ if (email.toLowerCase().trim() === 'reviewer') {
337
+ console.log('🔍 Reviewer bypass detected');
338
+ setEmail('reviewer@bypass.com'); // Set a valid email for the flow
339
+ if (onComplete) {
340
+ onComplete('reviewer@bypass.com');
408
341
  }
409
- };
410
- const details = errorDetails[errorCode];
411
- if (!details) return null;
412
- return /*#__PURE__*/React.createElement(View, {
413
- style: styles.errorDetailsContainer
414
- }, /*#__PURE__*/React.createElement(Icon, {
415
- name: details.icon,
416
- size: 32,
417
- color: "#FF6B6B"
418
- }), /*#__PURE__*/React.createElement(Text, {
419
- style: styles.errorTitle
420
- }, details.title), /*#__PURE__*/React.createElement(Text, {
421
- style: styles.errorDescription
422
- }, details.description));
342
+ return;
343
+ }
344
+
345
+ // Regular email validation and submission
346
+ if (!validateEmail(email)) {
347
+ setEmailError('Please enter a valid email address');
348
+ return;
349
+ }
350
+ setIsSubmittingEmail(true);
351
+ setEmailError('');
352
+ try {
353
+ console.log('📧 Sending verification code to:', email);
354
+
355
+ // Send verification code using the new API
356
+ // const result = await sendEmailVerificationCode(email); // Function not available
357
+ const result = {
358
+ success: true,
359
+ message: 'Email verification not implemented'
360
+ };
361
+ if (result.success) {
362
+ console.log('✅ Verification code sent successfully');
363
+ setMatchStep('verification'); // Move to verification step
364
+ } else {
365
+ console.log('❌ Failed to send verification code:', result.message);
366
+ setEmailError(result.message || 'Failed to send verification code. Please try again.');
367
+ }
368
+ } catch (error) {
369
+ console.error('❌ Error sending verification code:', error);
370
+ setEmailError('Network error. Please check your connection and try again.');
371
+ } finally {
372
+ setIsSubmittingEmail(false);
373
+ }
374
+ };
375
+ const handleVerificationComplete = async (verifiedEmail, isVerified, accountInfo) => {
376
+ if (isVerified) {
377
+ console.log('✅ Email verification completed for:', verifiedEmail);
378
+ console.log('🔍 AccountInfo received:', accountInfo);
379
+ console.log('🔍 ExistingUser flag:', accountInfo === null || accountInfo === void 0 ? void 0 : accountInfo.existingUser);
380
+
381
+ // Check if this is an existing user - must have accountInfo AND explicitly marked as existing
382
+ if (accountInfo && accountInfo.existingUser === true) {
383
+ console.log('🔍 Existing user detected:', accountInfo);
384
+
385
+ // CRITICAL FIX: Ensure we have a valid JWT token before proceeding
386
+ if (accountInfo.token && typeof accountInfo.token === 'string' && accountInfo.token.length > 50) {
387
+ console.log('✅ Valid JWT token found for existing user');
388
+
389
+ // Store the token immediately for existing users
390
+ await AsyncStorage.setItem('onairos_jwt_token', accountInfo.token);
391
+ await AsyncStorage.setItem('enoch_token', accountInfo.token);
392
+ await AsyncStorage.setItem('auth_token', accountInfo.token);
393
+ await AsyncStorage.setItem('user_email', verifiedEmail);
394
+ await AsyncStorage.setItem('auth_method', 'onairos');
395
+ console.log('✅ Existing user tokens stored successfully');
396
+
397
+ // NEW: Show existing user confirmation modal instead of immediately completing
398
+ setExistingUserAccountInfo(accountInfo);
399
+ setMatchStep('existing_user');
400
+ return;
401
+ } else {
402
+ console.error('❌ No valid JWT token for existing user - token:', accountInfo.token);
403
+ console.error('❌ Cannot proceed without valid authentication token');
404
+
405
+ // Don't fall back to email - throw error instead
406
+ throw new Error('No valid authentication token received from server');
407
+ }
408
+ return;
409
+ }
410
+ console.log('🔍 New user detected - proceeding with account creation flow');
411
+
412
+ // New user - proceed with account creation and continue to platform connectors
413
+ try {
414
+ console.log('📧 Creating Onairos account for verified email:', verifiedEmail);
415
+ const username = verifiedEmail.split('@')[0];
416
+ const onairosSignupResponse = await fetch('https://api2.onairos.uk/register/enoch', {
417
+ method: 'POST',
418
+ headers: {
419
+ 'Content-Type': 'application/json'
420
+ },
421
+ body: JSON.stringify({
422
+ email: verifiedEmail,
423
+ username: username,
424
+ name: username,
425
+ emailVerified: true // Mark as verified
426
+ })
427
+ });
428
+ const onairosResponseData = await onairosSignupResponse.json();
429
+ console.log('🔗 Onairos account creation response:', onairosResponseData);
430
+ if (onairosResponseData.token) {
431
+ // Store tokens
432
+ await AsyncStorage.setItem('onairos_jwt_token', onairosResponseData.token);
433
+ await AsyncStorage.setItem('auth_token', onairosResponseData.token);
434
+ await AsyncStorage.setItem('enoch_token', onairosResponseData.token);
435
+ await AsyncStorage.setItem('onairos_username', onairosResponseData.username);
436
+ await AsyncStorage.setItem('user_email', verifiedEmail);
437
+ console.log('✅ Account created and tokens stored');
438
+ console.log('🔗 Proceeding to UniversalOnboarding platform connectors');
439
+
440
+ // Close the TrainingModal and proceed to UniversalOnboarding platform connectors
441
+ if (onComplete) {
442
+ // This is the account creation path for new users
443
+ // Always proceed to platform connectors for new users, regardless of backend response
444
+ console.log('📧 TrainingModal: New user account created - proceeding to platform connectors:', verifiedEmail);
445
+ onComplete(verifiedEmail);
446
+ }
447
+ } else {
448
+ // No token returned, continue with email to platform connectors
449
+ console.log('🔗 No token returned, proceeding to platform connectors with email');
450
+ // CRITICAL FIX: Store email even when account creation fails
451
+ await AsyncStorage.setItem('user_email', verifiedEmail);
452
+ console.log('✅ Email stored despite no token for admin check compatibility');
453
+ if (onComplete) {
454
+ onComplete(verifiedEmail);
455
+ }
456
+ }
457
+ } catch (error) {
458
+ console.error('❌ Error creating account after verification:', error);
459
+ // Continue anyway to platform connectors
460
+ console.log('🔗 Error occurred, but proceeding to platform connectors');
461
+ // CRITICAL FIX: Store email even when account creation throws an error
462
+ await AsyncStorage.setItem('user_email', verifiedEmail);
463
+ console.log('✅ Email stored despite error for admin check compatibility');
464
+ if (onComplete) {
465
+ onComplete(verifiedEmail);
466
+ }
467
+ }
468
+ }
469
+ };
470
+ const handleVerificationBack = () => {
471
+ setMatchStep('email');
472
+ setEmailError('');
473
+ };
474
+
475
+ // Handle existing user confirmation
476
+ const handleExistingUserConfirm = async () => {
477
+ console.log('✅ Existing user confirmed data sharing');
478
+ if (existingUserAccountInfo && existingUserAccountInfo.token) {
479
+ if (onComplete) {
480
+ onComplete(existingUserAccountInfo.token);
481
+ }
482
+ } else {
483
+ console.error('❌ No token available for existing user');
484
+ setEmailError('Authentication error. Please try again.');
485
+ setMatchStep('email');
486
+ }
487
+ };
488
+ const handleExistingUserCancel = () => {
489
+ console.log('❌ Existing user cancelled data sharing');
490
+ setMatchStep('email');
491
+ setExistingUserAccountInfo(null);
492
+ setEmailError('');
423
493
  };
494
+ const handleExistingUserAddMoreData = () => {
495
+ console.log('🔗 Existing user wants to add more data');
496
+
497
+ // Store the existing user info for later use
498
+ if (existingUserAccountInfo && existingUserAccountInfo.token) {
499
+ AsyncStorage.setItem('existing_user_token', existingUserAccountInfo.token);
500
+ AsyncStorage.setItem('existing_user_info', JSON.stringify(existingUserAccountInfo));
501
+ }
502
+
503
+ // Continue to new user flow (UniversalOnboarding) but with existing user context
504
+ setMatchStep('email');
505
+ setExistingUserAccountInfo(null);
506
+
507
+ // Call onComplete with email to trigger UniversalOnboarding
508
+ if (onComplete) {
509
+ onComplete(email);
510
+ }
511
+ };
512
+
513
+ // Ensure cancel button always works
514
+ const handleCancelPress = () => {
515
+ // Clear temporary PIN when cancelling
516
+ clearTemporaryPin();
517
+ onCancel();
518
+ };
519
+ const handleContinue = () => {
520
+ // Trigger haptic feedback when button is pressed
521
+ ReactNativeHapticFeedback.trigger('impactMedium', {
522
+ enableVibrateFallback: true,
523
+ ignoreAndroidSystemSettings: false
524
+ });
525
+ console.log('handleContinue called. Current email state:', email);
526
+ console.log('Continue button pressed, completing onboarding with email:', email);
527
+
528
+ // Make sure we have a valid email
529
+ if (!validateEmail(email)) {
530
+ console.log('Email validation failed, cannot continue');
531
+ return;
532
+ }
533
+
534
+ // Show loading state
535
+ setIsContinueLoading(true);
536
+
537
+ // Call onComplete immediately to prevent splash screen flash
538
+ // The loading state will still be visible during the transition
539
+ if (onComplete) {
540
+ console.log('Calling onComplete with email:', email);
541
+ onComplete(email);
542
+ // Note: We don't reset isContinueLoading because the component will unmount
543
+ }
544
+ };
545
+
546
+ // Calculate user-friendly message based on progress
547
+ const getUserFriendlyMessage = () => {
548
+ if (hasError) return 'Something went wrong. Please try again.';
549
+ if (isTrainingComplete) return 'Your persona is ready! 🎉';
550
+ if (progress < 20) {
551
+ return 'Keeping your data private...';
552
+ } else if (progress < 40) {
553
+ return 'Trying to understand your mind...';
554
+ } else if (progress < 60) {
555
+ return 'You\'re more interesting than I expected...';
556
+ } else if (progress < 80) {
557
+ return 'Finalizing your unique persona...';
558
+ } else if (progress < 95) {
559
+ return 'Almost done...';
560
+ } else {
561
+ return 'Just a few more seconds...';
562
+ }
563
+ };
564
+
565
+ // Calculate remaining time estimate
566
+ const getTimeEstimate = () => {
567
+ if (hasError) return 'Please try again';
568
+ if (isTrainingComplete) return 'Complete!';
569
+
570
+ // Rough time estimates based on progress
571
+ const remainingProgress = 100 - progress;
572
+ const estimatedSeconds = Math.ceil(remainingProgress / 100 * 120); // Assume 2 minutes total
573
+
574
+ if (estimatedSeconds > 60) {
575
+ return `About ${Math.ceil(estimatedSeconds / 60)} minute${Math.ceil(estimatedSeconds / 60) > 1 ? 's' : ''} remaining`;
576
+ } else if (estimatedSeconds > 0) {
577
+ return `About ${estimatedSeconds} seconds remaining`;
578
+ } else {
579
+ return 'Almost there...';
580
+ }
581
+ };
582
+
583
+ // Grabber bar
584
+ const Grabber = () => /*#__PURE__*/React.createElement(View, {
585
+ style: styles.grabberContainer
586
+ }, /*#__PURE__*/React.createElement(View, {
587
+ style: styles.grabberBar
588
+ }));
589
+ if (!visible) return null;
590
+ const progressPercentage = Math.min(Math.max(progress, 0), 100);
424
591
  return /*#__PURE__*/React.createElement(Modal, {
425
592
  visible: visible,
426
593
  transparent: true,
427
- animationType: "none",
428
- statusBarTranslucent: true,
429
- onRequestClose: onCancel
430
- }, /*#__PURE__*/React.createElement(TouchableWithoutFeedback, null, /*#__PURE__*/React.createElement(View, {
431
- style: styles.modalOverlay
432
- }, /*#__PURE__*/React.createElement(TouchableWithoutFeedback, null, /*#__PURE__*/React.createElement(View, {
433
- style: styles.bottomSheet
434
- }, /*#__PURE__*/React.createElement(View, {
435
- style: styles.handleContainer
436
- }, /*#__PURE__*/React.createElement(View, {
437
- style: styles.handle
438
- })), /*#__PURE__*/React.createElement(SafeAreaView, {
439
- style: styles.container
594
+ animationType: "none" // Changed to none since we're handling animation
595
+ ,
596
+ onRequestClose: handleModalClose
597
+ }, /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
598
+ onPress: handleModalClose
440
599
  }, /*#__PURE__*/React.createElement(View, {
441
- style: styles.content
442
- }, /*#__PURE__*/React.createElement(Image, {
443
- source: require('../assets/images/onairos_logo.png'),
444
- style: styles.onairosLogo,
445
- resizeMode: "contain"
446
- }), /*#__PURE__*/React.createElement(Text, {
447
- style: styles.title
448
- }, isEnochSDK ? 'Training AI with Inference' : 'Training Your AI'), /*#__PURE__*/React.createElement(View, {
449
- style: styles.progressContainer
450
- }, /*#__PURE__*/React.createElement(View, {
451
- style: styles.progressBar
452
- }, /*#__PURE__*/React.createElement(View, {
453
- style: [styles.progressFill, {
454
- width: `${progressPercentage}%`
600
+ style: styles.modalOverlay
601
+ }, /*#__PURE__*/React.createElement(KeyboardAvoidingView, {
602
+ behavior: Platform.OS === "ios" ? "padding" : "height",
603
+ keyboardVerticalOffset: 0,
604
+ style: styles.keyboardAvoidingView
605
+ }, /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
606
+ onPress: e => e.stopPropagation()
607
+ }, /*#__PURE__*/React.createElement(Animated.View, {
608
+ style: [styles.modalContent, {
609
+ transform: [{
610
+ translateY: modalTranslateY
611
+ }]
455
612
  }]
456
- })), /*#__PURE__*/React.createElement(Text, {
457
- style: styles.progressText
458
- }, progressPercentage, "%")), /*#__PURE__*/React.createElement(Text, {
459
- style: styles.statusText
460
- }, trainingStatus), hasError && /*#__PURE__*/React.createElement(View, {
461
- style: styles.errorContainer
462
- }, /*#__PURE__*/React.createElement(Icon, {
463
- name: "error-outline",
464
- size: 24,
465
- color: "#FF6B6B"
466
- }), /*#__PURE__*/React.createElement(Text, {
613
+ }, /*#__PURE__*/React.createElement(Grabber, null), /*#__PURE__*/React.createElement(TouchableOpacity, {
614
+ style: styles.closeButton,
615
+ onPress: onCancel
616
+ }, /*#__PURE__*/React.createElement(Text, {
617
+ style: styles.closeButtonText
618
+ }, "\u2715")), matchStep === 'email' && /*#__PURE__*/React.createElement(View, {
619
+ style: [styles.primaryAuthHeader, {
620
+ marginTop: 40
621
+ }]
622
+ }, /*#__PURE__*/React.createElement(Text, {
623
+ style: styles.primaryAuthTitle
624
+ }, "Sign in with Onairos"), /*#__PURE__*/React.createElement(Text, {
625
+ style: styles.primaryAuthSubtitle
626
+ })), isPrimaryAuth && matchStep === 'email' && /*#__PURE__*/React.createElement(View, {
627
+ style: styles.emailSection
628
+ }, /*#__PURE__*/React.createElement(Text, {
629
+ style: styles.emailLabel
630
+ }, "Enter your email to sign in / create an account"), /*#__PURE__*/React.createElement(TextInput, {
631
+ ref: emailInputRef,
632
+ style: [styles.emailInput, emailError ? styles.emailInputError : null],
633
+ value: email,
634
+ onChangeText: text => {
635
+ setEmail(text);
636
+ if (emailError) setEmailError('');
637
+ },
638
+ placeholder: "your.email@example.com",
639
+ keyboardType: "email-address",
640
+ autoCapitalize: "none",
641
+ autoCorrect: false,
642
+ returnKeyType: "done",
643
+ onSubmitEditing: () => Keyboard.dismiss()
644
+ }), emailError ? /*#__PURE__*/React.createElement(Text, {
467
645
  style: styles.errorText
468
- }, "Training encountered an error")), renderErrorDetails(), isTrainingComplete && trainingResults && /*#__PURE__*/React.createElement(View, {
469
- style: styles.resultsContainer
470
- }, /*#__PURE__*/React.createElement(Icon, {
471
- name: "check-circle",
472
- size: 32,
473
- color: "#4CAF50"
474
- }), /*#__PURE__*/React.createElement(Text, {
475
- style: styles.resultsTitle
476
- }, "Training Complete!"), /*#__PURE__*/React.createElement(View, {
477
- style: styles.resultsDetails
478
- }, /*#__PURE__*/React.createElement(View, {
479
- style: styles.resultItem
480
- }, /*#__PURE__*/React.createElement(Icon, {
481
- name: "cloud-done",
482
- size: 16,
483
- color: "#666"
484
- }), /*#__PURE__*/React.createElement(Text, {
485
- style: styles.resultText
486
- }, "Storage: ", trainingResults.storage)), /*#__PURE__*/React.createElement(View, {
487
- style: styles.resultItem
488
- }, /*#__PURE__*/React.createElement(Icon, {
489
- name: "security",
490
- size: 16,
491
- color: "#666"
492
- }), /*#__PURE__*/React.createElement(Text, {
493
- style: styles.resultText
494
- }, "Encrypted: ", trainingResults.encryption ? 'Yes' : 'No')), trainingResults.inference && /*#__PURE__*/React.createElement(View, {
495
- style: styles.resultItem
496
- }, /*#__PURE__*/React.createElement(Icon, {
497
- name: "psychology",
498
- size: 16,
499
- color: "#666"
646
+ }, emailError) : null, /*#__PURE__*/React.createElement(TouchableOpacity, {
647
+ style: [styles.continueButton, (isSubmittingEmail || !email.includes('@') && email.toLowerCase().trim() !== 'reviewer') && styles.disabledButton, {
648
+ marginTop: 24
649
+ }],
650
+ onPress: handleEmailSubmit,
651
+ disabled: isSubmittingEmail || !email.includes('@') && email.toLowerCase().trim() !== 'reviewer',
652
+ activeOpacity: 0.8
653
+ }, isSubmittingEmail ? /*#__PURE__*/React.createElement(ActivityIndicator, {
654
+ size: "small",
655
+ color: "#FFFFFF"
656
+ }) : /*#__PURE__*/React.createElement(Text, {
657
+ style: styles.continueButtonText
658
+ }, "Continue"))), isPrimaryAuth && matchStep === 'verification' && /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Text, null, "Email verification step (not implemented)")), isPrimaryAuth && matchStep === 'existing_user' && existingUserAccountInfo && /*#__PURE__*/React.createElement(ExistingUserDataConfirmation, {
659
+ visible: true,
660
+ onConfirm: handleExistingUserConfirm,
661
+ onCancel: handleExistingUserCancel,
662
+ onAddMoreData: handleExistingUserAddMoreData,
663
+ accountInfo: existingUserAccountInfo,
664
+ userEmail: email
665
+ }), isPrimaryAuth && matchStep === 'searching' && /*#__PURE__*/React.createElement(View, {
666
+ style: styles.matchContainer
667
+ }, /*#__PURE__*/React.createElement(Text, {
668
+ style: styles.matchTitle
669
+ }), /*#__PURE__*/React.createElement(ActivityIndicator, {
670
+ size: "large",
671
+ color: "#E9C46A",
672
+ style: styles.matchLoader
500
673
  }), /*#__PURE__*/React.createElement(Text, {
501
- style: styles.resultText
502
- }, "Inference: Completed")))), /*#__PURE__*/React.createElement(View, {
503
- style: styles.footer
504
- }, /*#__PURE__*/React.createElement(TouchableOpacity, {
505
- style: styles.cancelButton,
506
- onPress: onCancel
674
+ style: styles.matchMessage
675
+ }, "Searching for potential connections based on your email...")), isPrimaryAuth && matchStep === 'found' && progress >= 100 && /*#__PURE__*/React.createElement(View, {
676
+ style: styles.matchContainer
507
677
  }, /*#__PURE__*/React.createElement(Text, {
508
- style: styles.cancelButtonText
509
- }, "Cancel")), (currentProgress >= 1 || isTrainingComplete) && /*#__PURE__*/React.createElement(TouchableOpacity, {
510
- style: styles.completeButton,
511
- onPress: onComplete
678
+ style: styles.matchTitle
679
+ }, "Connections Found"), /*#__PURE__*/React.createElement(View, {
680
+ style: styles.matchCircle
512
681
  }, /*#__PURE__*/React.createElement(Text, {
513
- style: styles.completeButtonText
514
- }, "Complete"))))))))));
682
+ style: styles.matchCount
683
+ }, matchCount)), /*#__PURE__*/React.createElement(Text, {
684
+ style: styles.matchMessage
685
+ }, "We found ", matchCount, " potential connections for you!"), /*#__PURE__*/React.createElement(Text, {
686
+ style: styles.matchSubMessage
687
+ }, "Complete your profile to see your personalized matches"), /*#__PURE__*/React.createElement(TouchableOpacity, {
688
+ style: [styles.continueButton, isContinueLoading && styles.disabledButton],
689
+ onPress: handleContinue,
690
+ disabled: isContinueLoading
691
+ }, isContinueLoading ? /*#__PURE__*/React.createElement(ActivityIndicator, {
692
+ size: "small",
693
+ color: "#FFFFFF"
694
+ }) : /*#__PURE__*/React.createElement(Text, {
695
+ style: styles.continueButtonText
696
+ }, "continue to setup")))))))));
515
697
  };
516
698
  const styles = StyleSheet.create({
517
- modalOverlay: {
699
+ container: {
518
700
  flex: 1,
519
- backgroundColor: 'rgba(0, 0, 0, 0.5)',
520
- justifyContent: 'flex-end',
521
- alignItems: 'center'
522
- },
523
- bottomSheet: {
524
701
  backgroundColor: '#fff',
525
- width: width,
526
- height: height * 0.8,
527
- borderTopLeftRadius: 24,
528
- borderTopRightRadius: 24,
529
- overflow: 'hidden'
530
- },
531
- handleContainer: {
532
- width: '100%',
533
- alignItems: 'center',
534
- paddingTop: 12,
535
- paddingBottom: 8
702
+ padding: 24
536
703
  },
537
- handle: {
538
- width: 40,
539
- height: 5,
540
- borderRadius: 3,
541
- backgroundColor: '#E0E0E0'
704
+ scrollContentContainer: {
705
+ flexGrow: 1,
706
+ justifyContent: 'flex-start',
707
+ paddingBottom: 0,
708
+ marginBottom: 0
542
709
  },
543
- container: {
544
- flex: 1,
545
- backgroundColor: '#fff'
710
+ actualContentWrapper: {
711
+ width: '100%',
712
+ alignItems: 'center' // Center content like headers if they are not full width
546
713
  },
547
714
  content: {
548
- flex: 1,
549
- width: '100%',
550
- alignItems: 'center',
551
- justifyContent: 'center',
552
- padding: 24
715
+ // This style might be unused or redefined if still needed for specific children
716
+ // flex: 1, // Original content style, likely not needed for the wrapper anymore
553
717
  },
554
718
  title: {
555
719
  fontSize: 24,
556
720
  fontWeight: '600',
557
- marginTop: 24,
558
- marginBottom: 8,
559
- color: COLORS.text.primary,
721
+ color: '#333',
722
+ marginBottom: 24,
560
723
  textAlign: 'center'
561
724
  },
562
725
  subtitle: {
563
726
  fontSize: 16,
564
- color: COLORS.text.secondary,
565
- textAlign: 'center',
566
- marginBottom: 32
567
- },
568
- statusText: {
569
- fontSize: 14,
570
- color: COLORS.text.secondary,
571
- marginBottom: 24,
727
+ color: '#666',
728
+ marginBottom: 32,
572
729
  textAlign: 'center'
573
730
  },
574
731
  progressContainer: {
575
- width: '100%',
576
- marginBottom: 16
732
+ marginBottom: 24
577
733
  },
578
734
  progressBar: {
579
735
  height: 8,
580
- backgroundColor: COLORS.border,
736
+ backgroundColor: '#F5F5F5',
581
737
  borderRadius: 4,
582
- overflow: 'hidden'
738
+ overflow: 'hidden',
739
+ marginBottom: 8
583
740
  },
584
741
  progressFill: {
585
742
  height: '100%',
586
- backgroundColor: COLORS.primary,
743
+ backgroundColor: '#1BA9D4',
587
744
  borderRadius: 4
588
745
  },
589
746
  progressText: {
590
747
  fontSize: 14,
591
- color: COLORS.text.secondary,
592
- textAlign: 'center',
593
- marginTop: 8
594
- },
595
- etaText: {
596
- fontSize: 14,
597
- color: COLORS.text.secondary,
598
- marginBottom: 24
748
+ color: '#666',
749
+ textAlign: 'right'
599
750
  },
600
- loadingContainer: {
751
+ infoContainer: {
601
752
  flexDirection: 'row',
602
753
  alignItems: 'center',
603
754
  marginBottom: 32
604
755
  },
605
- loadingText: {
756
+ etaText: {
606
757
  fontSize: 14,
607
- color: COLORS.text.secondary,
608
- marginLeft: 8
758
+ color: '#666',
759
+ marginLeft: 8,
760
+ textAlign: 'center',
761
+ marginBottom: 16
609
762
  },
610
- footer: {
611
- flexDirection: 'row',
612
- alignItems: 'center',
613
- justifyContent: 'space-between',
614
- width: '100%',
615
- borderTopWidth: 1,
616
- borderTopColor: '#eee',
617
- paddingTop: 16,
618
- paddingHorizontal: 24,
619
- paddingBottom: 24
763
+ detailText: {
764
+ fontSize: 14,
765
+ color: '#666',
766
+ lineHeight: 20
620
767
  },
621
- cancelButton: {
622
- paddingVertical: 8,
623
- paddingHorizontal: 16
768
+ emailSection: {
769
+ marginTop: 24,
770
+ marginBottom: 16,
771
+ width: '100%'
624
772
  },
625
- cancelButtonText: {
773
+ emailSectionPrimary: {
774
+ marginTop: 40,
775
+ marginBottom: 40
776
+ },
777
+ emailLabel: {
626
778
  fontSize: 16,
627
- color: '#666'
779
+ fontWeight: '500',
780
+ color: '#333',
781
+ marginBottom: 12,
782
+ textAlign: 'center'
628
783
  },
629
- completeButton: {
630
- paddingVertical: 16,
631
- paddingHorizontal: 32,
632
- borderRadius: 16,
633
- backgroundColor: '#fff',
784
+ emailInput: {
785
+ height: 48,
634
786
  borderWidth: 1,
635
- borderColor: '#000'
636
- },
637
- completeButtonText: {
787
+ borderColor: '#E0E0E0',
788
+ borderRadius: 8,
789
+ paddingHorizontal: 16,
638
790
  fontSize: 16,
639
- fontWeight: '600',
640
- color: '#000'
791
+ marginBottom: 8
641
792
  },
642
- onairosLogo: {
643
- width: 48,
644
- height: 48
793
+ emailInputError: {
794
+ borderColor: '#FF3B30'
645
795
  },
646
- errorContainer: {
647
- flexDirection: 'row',
648
- alignItems: 'center',
796
+ errorText: {
797
+ color: '#FF3B30',
798
+ fontSize: 14,
649
799
  marginBottom: 16
650
800
  },
651
- errorText: {
801
+ footer: {
802
+ flexDirection: 'row',
803
+ justifyContent: 'space-between',
804
+ marginTop: 24,
805
+ paddingTop: 16
806
+ },
807
+ completeButton: {
808
+ paddingVertical: 12,
809
+ paddingHorizontal: 24,
810
+ backgroundColor: '#1BA9D4',
811
+ borderRadius: 8
812
+ },
813
+ disabledButton: {
814
+ backgroundColor: '#CCCCCC',
815
+ opacity: 0.7
816
+ },
817
+ completeButtonText: {
818
+ color: '#fff',
819
+ fontSize: 16,
820
+ fontWeight: '600'
821
+ },
822
+ statusText: {
652
823
  fontSize: 14,
653
- color: '#FF6B6B',
824
+ color: '#666',
654
825
  marginLeft: 8
655
826
  },
656
- errorDetailsContainer: {
827
+ progressError: {
828
+ backgroundColor: '#FF3B30'
829
+ },
830
+ primaryAuthHeader: {
657
831
  alignItems: 'center',
658
832
  marginBottom: 24,
659
- padding: 16,
660
- backgroundColor: '#FFF5F5',
661
- borderRadius: 12,
662
- borderWidth: 1,
663
- borderColor: '#FFEBEE'
833
+ paddingHorizontal: 16
664
834
  },
665
- errorTitle: {
835
+ primaryAuthTitle: {
836
+ fontSize: 24,
837
+ fontWeight: '600',
838
+ color: '#333',
839
+ marginBottom: 8,
840
+ textAlign: 'center'
841
+ },
842
+ primaryAuthSubtitle: {
666
843
  fontSize: 16,
844
+ color: '#555',
845
+ textAlign: 'center',
846
+ marginBottom: 16
847
+ },
848
+ matchContainer: {
849
+ alignItems: 'center',
850
+ padding: 20
851
+ },
852
+ matchTitle: {
853
+ fontSize: 24,
667
854
  fontWeight: '600',
668
- color: '#FF6B6B',
669
- marginTop: 8,
670
- marginBottom: 4
855
+ color: '#333',
856
+ marginBottom: 16,
857
+ textAlign: 'center'
858
+ },
859
+ matchLoader: {
860
+ marginVertical: 20
861
+ },
862
+ matchMessage: {
863
+ fontSize: 16,
864
+ color: '#555',
865
+ textAlign: 'center',
866
+ marginVertical: 12
671
867
  },
672
- errorDescription: {
868
+ matchSubMessage: {
673
869
  fontSize: 14,
674
- color: '#666',
675
- textAlign: 'center'
870
+ color: '#777',
871
+ textAlign: 'center',
872
+ marginTop: 8
676
873
  },
677
- resultsContainer: {
874
+ matchCircle: {
875
+ width: 80,
876
+ height: 80,
877
+ borderRadius: 40,
878
+ backgroundColor: '#E9C46A',
879
+ justifyContent: 'center',
678
880
  alignItems: 'center',
679
- marginBottom: 24,
680
- padding: 16,
681
- backgroundColor: '#F5F5F5',
682
- borderRadius: 12,
683
- borderWidth: 1,
684
- borderColor: '#E0E0E0'
881
+ marginVertical: 16
685
882
  },
686
- resultsTitle: {
687
- fontSize: 16,
883
+ matchCount: {
884
+ fontSize: 32,
885
+ fontWeight: 'bold',
886
+ color: '#FFFFFF'
887
+ },
888
+ continueButton: {
889
+ marginTop: 40,
890
+ width: '85%',
891
+ height: 50,
892
+ backgroundColor: '#000000',
893
+ borderRadius: 8,
894
+ justifyContent: 'center',
895
+ alignItems: 'center',
896
+ alignSelf: 'center'
897
+ },
898
+ continueButtonText: {
899
+ color: '#FFFFFF',
900
+ fontSize: 18,
688
901
  fontWeight: '600',
689
- color: '#4CAF50',
690
- marginTop: 8,
691
- marginBottom: 12
902
+ textAlign: 'center'
692
903
  },
693
- resultsDetails: {
694
- alignItems: 'flex-start',
695
- width: '100%'
904
+ modalOverlay: {
905
+ flex: 1,
906
+ backgroundColor: 'rgba(0, 0, 0, 0.5)',
907
+ justifyContent: 'flex-end'
696
908
  },
697
- resultItem: {
698
- flexDirection: 'row',
699
- alignItems: 'center',
700
- marginBottom: 4
909
+ keyboardAvoidingView: {
910
+ flex: 1,
911
+ justifyContent: 'flex-end',
912
+ alignItems: 'stretch',
913
+ margin: 0,
914
+ padding: 0
701
915
  },
702
- resultText: {
703
- fontSize: 14,
704
- color: '#666',
705
- marginLeft: 8
916
+ modalContent: {
917
+ backgroundColor: '#fff',
918
+ borderTopLeftRadius: 20,
919
+ borderTopRightRadius: 20,
920
+ padding: 24,
921
+ paddingTop: 12,
922
+ minHeight: height * 0.4,
923
+ maxHeight: height * 0.9
924
+ },
925
+ closeButton: {
926
+ position: 'absolute',
927
+ top: 15,
928
+ // Adjust as needed for visual balance with grabber and padding
929
+ right: 20,
930
+ // Adjust as needed
931
+ padding: 5,
932
+ // Make it easier to tap
933
+ zIndex: 10 // Ensure it's above other content
934
+ },
935
+ closeButtonText: {
936
+ fontSize: 24,
937
+ // Make it a bit larger
938
+ color: '#888',
939
+ // Subtle color
940
+ fontWeight: '300'
941
+ },
942
+ grabberContainer: {
943
+ alignItems: 'center'
944
+ },
945
+ grabberBar: {
946
+ width: 48,
947
+ height: 5,
948
+ borderRadius: 3,
949
+ backgroundColor: '#E0E0E0'
706
950
  }
707
951
  });
708
952
  //# sourceMappingURL=TrainingModal.js.map