@onairos/react-native 3.1.18 → 3.2.1

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 (734) hide show
  1. package/README.md +374 -403
  2. package/lib/commonjs/api/index.js +1 -75
  3. package/lib/commonjs/api/index.js.map +1 -1
  4. package/lib/commonjs/assets/images/email.png +0 -0
  5. package/lib/commonjs/assets/images/linkedin.png +0 -0
  6. package/lib/commonjs/assets/images/reddit.png +0 -0
  7. package/lib/commonjs/assets/images/youtube.png +0 -0
  8. package/lib/commonjs/components/DataRequestModal.js.map +1 -1
  9. package/lib/commonjs/components/DataRequestScreen.js.map +1 -1
  10. package/lib/commonjs/components/EmailVerificationModal.js.map +1 -1
  11. package/lib/commonjs/components/Onairos.js +3 -1
  12. package/lib/commonjs/components/Onairos.js.map +1 -1
  13. package/lib/commonjs/components/OnairosButton.js +190 -171
  14. package/lib/commonjs/components/OnairosButton.js.map +1 -1
  15. package/lib/commonjs/components/Overlay.js +5 -5
  16. package/lib/commonjs/components/Overlay.js.map +1 -1
  17. package/lib/commonjs/components/PinInput.js +120 -282
  18. package/lib/commonjs/components/PinInput.js.map +1 -1
  19. package/lib/commonjs/components/PlatformList.js.map +1 -1
  20. package/lib/commonjs/components/TrainingModal.js +563 -808
  21. package/lib/commonjs/components/TrainingModal.js.map +1 -1
  22. package/lib/commonjs/components/UniversalOnboarding.js +1296 -2302
  23. package/lib/commonjs/components/UniversalOnboarding.js.map +1 -1
  24. package/lib/commonjs/components/UniversalOnboarding.tsx.new +455 -0
  25. package/lib/commonjs/components/onboarding/OAuthWebView.js +743 -134
  26. package/lib/commonjs/components/onboarding/OAuthWebView.js.map +1 -1
  27. package/lib/commonjs/components/onboarding/OnboardingHeader.js.map +1 -1
  28. package/lib/commonjs/components/onboarding/PinInput.js.map +1 -1
  29. package/lib/commonjs/components/onboarding/PlatformConnector.js.map +1 -1
  30. package/lib/commonjs/components/screens/ConnectorScreen.js.map +1 -1
  31. package/lib/commonjs/components/screens/LoadingScreen.js.map +1 -1
  32. package/lib/commonjs/components/screens/PinCreationScreen.js.map +1 -1
  33. package/lib/commonjs/constants/index.js.map +1 -1
  34. package/lib/commonjs/hooks/useConnections.js +125 -120
  35. package/lib/commonjs/hooks/useConnections.js.map +1 -1
  36. package/lib/commonjs/hooks/useCredentials.js.map +1 -1
  37. package/lib/commonjs/index.js +27 -157
  38. package/lib/commonjs/index.js.map +1 -1
  39. package/lib/commonjs/services/SDK_API_KEY_VALIDATION.md +428 -0
  40. package/lib/commonjs/services/apiKeyService.js +106 -105
  41. package/lib/commonjs/services/apiKeyService.js.map +1 -1
  42. package/lib/commonjs/services/oauthService.js.map +1 -1
  43. package/lib/commonjs/services/platformAuthService.js +722 -956
  44. package/lib/commonjs/services/platformAuthService.js.map +1 -1
  45. package/lib/commonjs/types/ambient.d.js.map +1 -1
  46. package/lib/commonjs/types/declarations.d.js.map +1 -1
  47. package/lib/commonjs/types/index.d.js.map +1 -1
  48. package/lib/commonjs/types/index.js.map +1 -1
  49. package/lib/commonjs/types/node-fix.d.js.map +1 -1
  50. package/lib/commonjs/types/node-override.d.js.map +1 -1
  51. package/lib/commonjs/types/opacity.d.js.map +1 -1
  52. package/lib/commonjs/types/types.d.js.map +1 -1
  53. package/lib/commonjs/types.js.map +1 -1
  54. package/lib/commonjs/utils/Portal.js +4 -4
  55. package/lib/commonjs/utils/Portal.js.map +1 -1
  56. package/lib/commonjs/utils/api.js +24 -24
  57. package/lib/commonjs/utils/api.js.map +1 -1
  58. package/lib/commonjs/utils/auth.js +18 -18
  59. package/lib/commonjs/utils/auth.js.map +1 -1
  60. package/lib/commonjs/utils/crypto.js +13 -13
  61. package/lib/commonjs/utils/crypto.js.map +1 -1
  62. package/lib/commonjs/utils/debugHelper.js.map +1 -1
  63. package/lib/commonjs/utils/encryption.js +12 -12
  64. package/lib/commonjs/utils/encryption.js.map +1 -1
  65. package/lib/commonjs/utils/onairosApi.js.map +1 -1
  66. package/lib/commonjs/utils/programmaticFlow.js +16 -16
  67. package/lib/commonjs/utils/programmaticFlow.js.map +1 -1
  68. package/lib/commonjs/utils/retryHelper.js +27 -27
  69. package/lib/commonjs/utils/retryHelper.js.map +1 -1
  70. package/lib/commonjs/utils/secureStorage.js.map +1 -1
  71. package/lib/module/api/index.js +0 -72
  72. package/lib/module/api/index.js.map +1 -1
  73. package/lib/module/assets/images/email.png +0 -0
  74. package/lib/module/assets/images/linkedin.png +0 -0
  75. package/lib/module/assets/images/reddit.png +0 -0
  76. package/lib/module/assets/images/youtube.png +0 -0
  77. package/lib/module/components/DataRequestModal.js.map +1 -1
  78. package/lib/module/components/DataRequestScreen.js.map +1 -1
  79. package/lib/module/components/EmailVerificationModal.js.map +1 -1
  80. package/lib/module/components/Onairos.js +3 -1
  81. package/lib/module/components/Onairos.js.map +1 -1
  82. package/lib/module/components/OnairosButton.js +192 -172
  83. package/lib/module/components/OnairosButton.js.map +1 -1
  84. package/lib/module/components/Overlay.js +5 -5
  85. package/lib/module/components/Overlay.js.map +1 -1
  86. package/lib/module/components/PinInput.js +120 -283
  87. package/lib/module/components/PinInput.js.map +1 -1
  88. package/lib/module/components/PlatformList.js.map +1 -1
  89. package/lib/module/components/TrainingModal.js +565 -809
  90. package/lib/module/components/TrainingModal.js.map +1 -1
  91. package/lib/module/components/UniversalOnboarding.js +1297 -2305
  92. package/lib/module/components/UniversalOnboarding.js.map +1 -1
  93. package/lib/module/components/UniversalOnboarding.tsx.new +455 -0
  94. package/lib/module/components/onboarding/OAuthWebView.js +744 -136
  95. package/lib/module/components/onboarding/OAuthWebView.js.map +1 -1
  96. package/lib/module/components/onboarding/OnboardingHeader.js.map +1 -1
  97. package/lib/module/components/onboarding/PinInput.js.map +1 -1
  98. package/lib/module/components/onboarding/PlatformConnector.js.map +1 -1
  99. package/lib/module/components/screens/ConnectorScreen.js.map +1 -1
  100. package/lib/module/components/screens/LoadingScreen.js.map +1 -1
  101. package/lib/module/components/screens/PinCreationScreen.js.map +1 -1
  102. package/lib/module/constants/index.js.map +1 -1
  103. package/lib/module/hooks/useConnections.js +125 -119
  104. package/lib/module/hooks/useConnections.js.map +1 -1
  105. package/lib/module/hooks/useCredentials.js.map +1 -1
  106. package/lib/module/index.js +17 -55
  107. package/lib/module/index.js.map +1 -1
  108. package/lib/module/services/SDK_API_KEY_VALIDATION.md +428 -0
  109. package/lib/module/services/apiKeyService.js +106 -105
  110. package/lib/module/services/apiKeyService.js.map +1 -1
  111. package/lib/module/services/oauthService.js.map +1 -1
  112. package/lib/module/services/platformAuthService.js +704 -943
  113. package/lib/module/services/platformAuthService.js.map +1 -1
  114. package/lib/module/types/ambient.d.js.map +1 -1
  115. package/lib/module/types/declarations.d.js.map +1 -1
  116. package/lib/module/types/index.d.js.map +1 -1
  117. package/lib/module/types/index.js.map +1 -1
  118. package/lib/module/types/node-fix.d.js.map +1 -1
  119. package/lib/module/types/node-override.d.js.map +1 -1
  120. package/lib/module/types/opacity.d.js.map +1 -1
  121. package/lib/module/types/types.d.js.map +1 -1
  122. package/lib/module/types.js.map +1 -1
  123. package/lib/module/utils/Portal.js +4 -4
  124. package/lib/module/utils/Portal.js.map +1 -1
  125. package/lib/module/utils/api.js +24 -24
  126. package/lib/module/utils/api.js.map +1 -1
  127. package/lib/module/utils/auth.js +18 -18
  128. package/lib/module/utils/auth.js.map +1 -1
  129. package/lib/module/utils/crypto.js +13 -13
  130. package/lib/module/utils/crypto.js.map +1 -1
  131. package/lib/module/utils/debugHelper.js.map +1 -1
  132. package/lib/module/utils/encryption.js +12 -12
  133. package/lib/module/utils/encryption.js.map +1 -1
  134. package/lib/module/utils/onairosApi.js.map +1 -1
  135. package/lib/module/utils/programmaticFlow.js +16 -16
  136. package/lib/module/utils/programmaticFlow.js.map +1 -1
  137. package/lib/module/utils/retryHelper.js +27 -27
  138. package/lib/module/utils/retryHelper.js.map +1 -1
  139. package/lib/module/utils/secureStorage.js.map +1 -1
  140. package/lib/typescript/api/index.d.ts +7 -15
  141. package/lib/typescript/api/index.d.ts.map +1 -1
  142. package/lib/typescript/components/DataRequestModal.d.ts +10 -10
  143. package/lib/typescript/components/DataRequestScreen.d.ts +10 -10
  144. package/lib/typescript/components/EmailVerificationModal.d.ts +10 -10
  145. package/lib/typescript/components/Onairos.d.ts +3 -3
  146. package/lib/typescript/components/Onairos.d.ts.map +1 -1
  147. package/lib/typescript/components/OnairosButton.d.ts +11 -36
  148. package/lib/typescript/components/OnairosButton.d.ts.map +1 -1
  149. package/lib/typescript/components/Overlay.d.ts +3 -3
  150. package/lib/typescript/components/PinInput.d.ts +3 -13
  151. package/lib/typescript/components/PinInput.d.ts.map +1 -1
  152. package/lib/typescript/components/PlatformList.d.ts +3 -3
  153. package/lib/typescript/components/TrainingModal.d.ts +3 -14
  154. package/lib/typescript/components/TrainingModal.d.ts.map +1 -1
  155. package/lib/typescript/components/UniversalOnboarding.d.ts +3 -16
  156. package/lib/typescript/components/UniversalOnboarding.d.ts.map +1 -1
  157. package/lib/typescript/components/onboarding/OAuthWebView.d.ts +9 -9
  158. package/lib/typescript/components/onboarding/OAuthWebView.d.ts.map +1 -1
  159. package/lib/typescript/components/onboarding/OnboardingHeader.d.ts +10 -10
  160. package/lib/typescript/components/onboarding/PinInput.d.ts +3 -3
  161. package/lib/typescript/components/onboarding/PlatformConnector.d.ts +12 -12
  162. package/lib/typescript/components/screens/ConnectorScreen.d.ts +8 -8
  163. package/lib/typescript/components/screens/LoadingScreen.d.ts +8 -8
  164. package/lib/typescript/components/screens/PinCreationScreen.d.ts +9 -9
  165. package/lib/typescript/constants/index.d.ts +52 -52
  166. package/lib/typescript/hooks/useConnections.d.ts +8 -13
  167. package/lib/typescript/hooks/useConnections.d.ts.map +1 -1
  168. package/lib/typescript/hooks/useCredentials.d.ts +8 -8
  169. package/lib/typescript/index.d.ts +17 -38
  170. package/lib/typescript/index.d.ts.map +1 -1
  171. package/lib/typescript/services/apiKeyService.d.ts +131 -131
  172. package/lib/typescript/services/apiKeyService.d.ts.map +1 -1
  173. package/lib/typescript/services/oauthService.d.ts +49 -49
  174. package/lib/typescript/services/platformAuthService.d.ts +143 -68
  175. package/lib/typescript/services/platformAuthService.d.ts.map +1 -1
  176. package/lib/typescript/types/index.d.ts +228 -264
  177. package/lib/typescript/types/index.d.ts.map +1 -1
  178. package/lib/typescript/types.d.ts +268 -266
  179. package/lib/typescript/types.d.ts.map +1 -1
  180. package/lib/typescript/utils/Portal.d.ts +13 -13
  181. package/lib/typescript/utils/api.d.ts +5 -5
  182. package/lib/typescript/utils/auth.d.ts +5 -5
  183. package/lib/typescript/utils/crypto.d.ts +3 -3
  184. package/lib/typescript/utils/debugHelper.d.ts +28 -28
  185. package/lib/typescript/utils/encryption.d.ts +18 -18
  186. package/lib/typescript/utils/onairosApi.d.ts +86 -86
  187. package/lib/typescript/utils/programmaticFlow.d.ts +22 -22
  188. package/lib/typescript/utils/retryHelper.d.ts +68 -68
  189. package/lib/typescript/utils/secureStorage.d.ts +93 -93
  190. package/package.json +149 -145
  191. package/src/api/index.ts +110 -151
  192. package/src/assets/images/email.png +0 -0
  193. package/src/assets/images/linkedin.png +0 -0
  194. package/src/assets/images/reddit.png +0 -0
  195. package/src/assets/images/youtube.png +0 -0
  196. package/src/components/DataRequestScreen.tsx +355 -355
  197. package/src/components/EmailVerificationModal.tsx +363 -363
  198. package/src/components/Onairos.tsx +424 -422
  199. package/src/components/OnairosButton.tsx +359 -339
  200. package/src/components/Overlay.tsx +506 -506
  201. package/src/components/PinInput.tsx +343 -555
  202. package/src/components/PlatformList.tsx +144 -144
  203. package/src/components/TrainingModal.tsx +737 -1047
  204. package/src/components/UniversalOnboarding.tsx +1839 -2888
  205. package/src/components/UniversalOnboarding.tsx.new +455 -0
  206. package/src/components/onboarding/OAuthWebView.tsx +838 -232
  207. package/src/hooks/useConnections.ts +163 -161
  208. package/src/hooks/useCredentials.ts +174 -174
  209. package/src/index.js +14 -14
  210. package/src/index.ts +49 -99
  211. package/src/services/SDK_API_KEY_VALIDATION.md +428 -0
  212. package/src/services/apiKeyService.ts +921 -919
  213. package/src/services/platformAuthService.ts +1113 -1346
  214. package/src/types/ambient.d.ts +28 -28
  215. package/src/types/index.ts +241 -265
  216. package/src/types/node-fix.d.ts +18 -18
  217. package/src/types/node-override.d.ts +23 -23
  218. package/src/types/opacity.d.ts +15 -15
  219. package/src/types/types.d.ts +17 -17
  220. package/src/types.ts +6 -4
  221. package/src/utils/Portal.tsx +82 -82
  222. package/src/utils/api.js +111 -111
  223. package/src/utils/auth.js +103 -103
  224. package/src/utils/crypto.js +59 -59
  225. package/src/utils/encryption.ts +68 -68
  226. package/src/utils/programmaticFlow.ts +112 -112
  227. package/src/utils/retryHelper.ts +274 -274
  228. package/types/index.d.ts +213 -213
  229. package/types/node-env.d.ts +14 -14
  230. package/lib/commonjs/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
  231. package/lib/commonjs/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
  232. package/lib/commonjs/assets/icons/Facebookicon.png +0 -0
  233. package/lib/commonjs/assets/icons/Gmail.png +0 -0
  234. package/lib/commonjs/assets/icons/Linkedinicon.png +0 -0
  235. package/lib/commonjs/assets/icons/Redditicon.png +0 -0
  236. package/lib/commonjs/assets/icons/YouTubeicon2.png +0 -0
  237. package/lib/commonjs/assets/icons/YouTubeicon3.png +0 -0
  238. package/lib/commonjs/assets/icons/farcaster.png +0 -0
  239. package/lib/commonjs/assets/icons/instagram.png +0 -0
  240. package/lib/commonjs/assets/icons/pinterest.png +0 -0
  241. package/lib/commonjs/assets/icons/swerv_logo.png +0 -0
  242. package/lib/commonjs/assets/icons/twitter.jpg +0 -0
  243. package/lib/commonjs/assets/images/Checkbox.svg +0 -3
  244. package/lib/commonjs/assets/images/EnochE.svg +0 -19
  245. package/lib/commonjs/assets/images/Enochicon1.png +0 -0
  246. package/lib/commonjs/assets/images/Face_ID_logo.png +0 -0
  247. package/lib/commonjs/assets/images/Facebookicon.png +0 -0
  248. package/lib/commonjs/assets/images/Gmail.png +0 -0
  249. package/lib/commonjs/assets/images/Googlelogo.png +0 -0
  250. package/lib/commonjs/assets/images/Linkedinicon.png +0 -0
  251. package/lib/commonjs/assets/images/Onairoslogo.png +0 -0
  252. package/lib/commonjs/assets/images/Personalityprofile.svg +0 -3
  253. package/lib/commonjs/assets/images/Personalitytraits.svg +0 -3
  254. package/lib/commonjs/assets/images/Redditicon.png +0 -0
  255. package/lib/commonjs/assets/images/Userpreferences.svg +0 -3
  256. package/lib/commonjs/assets/images/YouTubeicon3.png +0 -0
  257. package/lib/commonjs/assets/images/arrow.svg +0 -20
  258. package/lib/commonjs/assets/images/basicproficon.svg +0 -43
  259. package/lib/commonjs/assets/images/basicprofile.svg +0 -3
  260. package/lib/commonjs/assets/images/checkmark.svg +0 -4
  261. package/lib/commonjs/assets/images/contentanalysis.svg +0 -3
  262. package/lib/commonjs/assets/images/contenticon.svg +0 -23
  263. package/lib/commonjs/assets/images/persona1.png +0 -0
  264. package/lib/commonjs/assets/images/persona2.png +0 -0
  265. package/lib/commonjs/assets/images/persona3.png +0 -0
  266. package/lib/commonjs/assets/images/persona4.png +0 -0
  267. package/lib/commonjs/assets/images/persona5.png +0 -0
  268. package/lib/commonjs/assets/images/personalityicon.svg +0 -18
  269. package/lib/commonjs/assets/images/x-close.svg +0 -3
  270. package/lib/commonjs/components/BodyText.js +0 -27
  271. package/lib/commonjs/components/BodyText.js.map +0 -1
  272. package/lib/commonjs/components/BrandMark.js +0 -44
  273. package/lib/commonjs/components/BrandMark.js.map +0 -1
  274. package/lib/commonjs/components/CodeInput.js +0 -30
  275. package/lib/commonjs/components/CodeInput.js.map +0 -1
  276. package/lib/commonjs/components/EmailInput.js +0 -30
  277. package/lib/commonjs/components/EmailInput.js.map +0 -1
  278. package/lib/commonjs/components/ExistingUserDataConfirmation.js +0 -474
  279. package/lib/commonjs/components/ExistingUserDataConfirmation.js.map +0 -1
  280. package/lib/commonjs/components/GoogleButton.js +0 -55
  281. package/lib/commonjs/components/GoogleButton.js.map +0 -1
  282. package/lib/commonjs/components/HeadingGroup.js +0 -43
  283. package/lib/commonjs/components/HeadingGroup.js.map +0 -1
  284. package/lib/commonjs/components/ModalHeader.js +0 -99
  285. package/lib/commonjs/components/ModalHeader.js.map +0 -1
  286. package/lib/commonjs/components/ModalSheet.js +0 -47
  287. package/lib/commonjs/components/ModalSheet.js.map +0 -1
  288. package/lib/commonjs/components/OnairosSignInButton.js +0 -129
  289. package/lib/commonjs/components/OnairosSignInButton.js.map +0 -1
  290. package/lib/commonjs/components/PersonaImage.js +0 -60
  291. package/lib/commonjs/components/PersonaImage.js.map +0 -1
  292. package/lib/commonjs/components/PersonaLoadingScreen.js +0 -156
  293. package/lib/commonjs/components/PersonaLoadingScreen.js.map +0 -1
  294. package/lib/commonjs/components/PersonalizationConsentScreen.js +0 -316
  295. package/lib/commonjs/components/PersonalizationConsentScreen.js.map +0 -1
  296. package/lib/commonjs/components/PinCreationScreen.js +0 -393
  297. package/lib/commonjs/components/PinCreationScreen.js.map +0 -1
  298. package/lib/commonjs/components/PlatformConnectorsStep.js +0 -828
  299. package/lib/commonjs/components/PlatformConnectorsStep.js.map +0 -1
  300. package/lib/commonjs/components/PlatformToggle.js +0 -180
  301. package/lib/commonjs/components/PlatformToggle.js.map +0 -1
  302. package/lib/commonjs/components/PrimaryButton.js +0 -180
  303. package/lib/commonjs/components/PrimaryButton.js.map +0 -1
  304. package/lib/commonjs/components/SignInMatchAnimation.js +0 -197
  305. package/lib/commonjs/components/SignInMatchAnimation.js.map +0 -1
  306. package/lib/commonjs/components/SignInStep.js +0 -179
  307. package/lib/commonjs/components/SignInStep.js.map +0 -1
  308. package/lib/commonjs/components/VerificationStep.js +0 -154
  309. package/lib/commonjs/components/VerificationStep.js.map +0 -1
  310. package/lib/commonjs/components/WelcomeScreen.js +0 -401
  311. package/lib/commonjs/components/WelcomeScreen.js.map +0 -1
  312. package/lib/commonjs/components/icons/Basicproficon.js +0 -37
  313. package/lib/commonjs/components/icons/Basicproficon.js.map +0 -1
  314. package/lib/commonjs/components/icons/Basicprofile.js +0 -21
  315. package/lib/commonjs/components/icons/Basicprofile.js.map +0 -1
  316. package/lib/commonjs/components/icons/Checkbox.js +0 -21
  317. package/lib/commonjs/components/icons/Checkbox.js.map +0 -1
  318. package/lib/commonjs/components/icons/Checkmark.js +0 -27
  319. package/lib/commonjs/components/icons/Checkmark.js.map +0 -1
  320. package/lib/commonjs/components/icons/Contentanalysis.js +0 -21
  321. package/lib/commonjs/components/icons/Contentanalysis.js.map +0 -1
  322. package/lib/commonjs/components/icons/Contenticon.js +0 -39
  323. package/lib/commonjs/components/icons/Contenticon.js.map +0 -1
  324. package/lib/commonjs/components/icons/EnochE.js +0 -41
  325. package/lib/commonjs/components/icons/EnochE.js.map +0 -1
  326. package/lib/commonjs/components/icons/Personalityicon.js +0 -30
  327. package/lib/commonjs/components/icons/Personalityicon.js.map +0 -1
  328. package/lib/commonjs/components/icons/Personalityprofile.js +0 -21
  329. package/lib/commonjs/components/icons/Personalityprofile.js.map +0 -1
  330. package/lib/commonjs/components/icons/Personalitytraits.js +0 -21
  331. package/lib/commonjs/components/icons/Personalitytraits.js.map +0 -1
  332. package/lib/commonjs/components/icons/Userpreferences.js +0 -21
  333. package/lib/commonjs/components/icons/Userpreferences.js.map +0 -1
  334. package/lib/commonjs/components/icons/index.js +0 -84
  335. package/lib/commonjs/components/icons/index.js.map +0 -1
  336. package/lib/commonjs/config/api.js +0 -34
  337. package/lib/commonjs/config/api.js.map +0 -1
  338. package/lib/commonjs/context/AuthContext.js +0 -345
  339. package/lib/commonjs/context/AuthContext.js.map +0 -1
  340. package/lib/commonjs/hooks/useConnectedAccounts.js +0 -111
  341. package/lib/commonjs/hooks/useConnectedAccounts.js.map +0 -1
  342. package/lib/commonjs/hooks/useUserConnections.js +0 -148
  343. package/lib/commonjs/hooks/useUserConnections.js.map +0 -1
  344. package/lib/commonjs/services/apiClient.js +0 -302
  345. package/lib/commonjs/services/apiClient.js.map +0 -1
  346. package/lib/commonjs/services/authService.js +0 -935
  347. package/lib/commonjs/services/authService.js.map +0 -1
  348. package/lib/commonjs/services/biometricPinService.js +0 -184
  349. package/lib/commonjs/services/biometricPinService.js.map +0 -1
  350. package/lib/commonjs/services/connectedAccountsService.js +0 -268
  351. package/lib/commonjs/services/connectedAccountsService.js.map +0 -1
  352. package/lib/commonjs/services/googleAuthService.js +0 -268
  353. package/lib/commonjs/services/googleAuthService.js.map +0 -1
  354. package/lib/commonjs/services/imageCompressionService.js +0 -260
  355. package/lib/commonjs/services/imageCompressionService.js.map +0 -1
  356. package/lib/commonjs/services/jwtStorageService.js +0 -256
  357. package/lib/commonjs/services/jwtStorageService.js.map +0 -1
  358. package/lib/commonjs/services/mobileTrainingService.js +0 -185
  359. package/lib/commonjs/services/mobileTrainingService.js.map +0 -1
  360. package/lib/commonjs/services/pinEncryptionService.js +0 -84
  361. package/lib/commonjs/services/pinEncryptionService.js.map +0 -1
  362. package/lib/commonjs/services/pinStorageUtils.js +0 -105
  363. package/lib/commonjs/services/pinStorageUtils.js.map +0 -1
  364. package/lib/commonjs/services/storageService.js +0 -404
  365. package/lib/commonjs/services/storageService.js.map +0 -1
  366. package/lib/commonjs/services/trainingApiHelpers.js +0 -73
  367. package/lib/commonjs/services/trainingApiHelpers.js.map +0 -1
  368. package/lib/commonjs/services/userConnectionsService.js +0 -486
  369. package/lib/commonjs/services/userConnectionsService.js.map +0 -1
  370. package/lib/commonjs/services/youtubeMigrationService.js +0 -415
  371. package/lib/commonjs/services/youtubeMigrationService.js.map +0 -1
  372. package/lib/commonjs/theme/index.js +0 -249
  373. package/lib/commonjs/theme/index.js.map +0 -1
  374. package/lib/commonjs/utils/eventUtils.js +0 -288
  375. package/lib/commonjs/utils/eventUtils.js.map +0 -1
  376. package/lib/commonjs/utils/haptics.js +0 -66
  377. package/lib/commonjs/utils/haptics.js.map +0 -1
  378. package/lib/commonjs/utils/imagePreloader.js +0 -6
  379. package/lib/commonjs/utils/imagePreloader.js.map +0 -1
  380. package/lib/module/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
  381. package/lib/module/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
  382. package/lib/module/assets/icons/Facebookicon.png +0 -0
  383. package/lib/module/assets/icons/Gmail.png +0 -0
  384. package/lib/module/assets/icons/Linkedinicon.png +0 -0
  385. package/lib/module/assets/icons/Redditicon.png +0 -0
  386. package/lib/module/assets/icons/YouTubeicon2.png +0 -0
  387. package/lib/module/assets/icons/YouTubeicon3.png +0 -0
  388. package/lib/module/assets/icons/farcaster.png +0 -0
  389. package/lib/module/assets/icons/instagram.png +0 -0
  390. package/lib/module/assets/icons/pinterest.png +0 -0
  391. package/lib/module/assets/icons/swerv_logo.png +0 -0
  392. package/lib/module/assets/icons/twitter.jpg +0 -0
  393. package/lib/module/assets/images/Checkbox.svg +0 -3
  394. package/lib/module/assets/images/EnochE.svg +0 -19
  395. package/lib/module/assets/images/Enochicon1.png +0 -0
  396. package/lib/module/assets/images/Face_ID_logo.png +0 -0
  397. package/lib/module/assets/images/Facebookicon.png +0 -0
  398. package/lib/module/assets/images/Gmail.png +0 -0
  399. package/lib/module/assets/images/Googlelogo.png +0 -0
  400. package/lib/module/assets/images/Linkedinicon.png +0 -0
  401. package/lib/module/assets/images/Onairoslogo.png +0 -0
  402. package/lib/module/assets/images/Personalityprofile.svg +0 -3
  403. package/lib/module/assets/images/Personalitytraits.svg +0 -3
  404. package/lib/module/assets/images/Redditicon.png +0 -0
  405. package/lib/module/assets/images/Userpreferences.svg +0 -3
  406. package/lib/module/assets/images/YouTubeicon3.png +0 -0
  407. package/lib/module/assets/images/arrow.svg +0 -20
  408. package/lib/module/assets/images/basicproficon.svg +0 -43
  409. package/lib/module/assets/images/basicprofile.svg +0 -3
  410. package/lib/module/assets/images/checkmark.svg +0 -4
  411. package/lib/module/assets/images/contentanalysis.svg +0 -3
  412. package/lib/module/assets/images/contenticon.svg +0 -23
  413. package/lib/module/assets/images/persona1.png +0 -0
  414. package/lib/module/assets/images/persona2.png +0 -0
  415. package/lib/module/assets/images/persona3.png +0 -0
  416. package/lib/module/assets/images/persona4.png +0 -0
  417. package/lib/module/assets/images/persona5.png +0 -0
  418. package/lib/module/assets/images/personalityicon.svg +0 -18
  419. package/lib/module/assets/images/x-close.svg +0 -3
  420. package/lib/module/components/BodyText.js +0 -20
  421. package/lib/module/components/BodyText.js.map +0 -1
  422. package/lib/module/components/BrandMark.js +0 -37
  423. package/lib/module/components/BrandMark.js.map +0 -1
  424. package/lib/module/components/CodeInput.js +0 -23
  425. package/lib/module/components/CodeInput.js.map +0 -1
  426. package/lib/module/components/EmailInput.js +0 -23
  427. package/lib/module/components/EmailInput.js.map +0 -1
  428. package/lib/module/components/ExistingUserDataConfirmation.js +0 -465
  429. package/lib/module/components/ExistingUserDataConfirmation.js.map +0 -1
  430. package/lib/module/components/GoogleButton.js +0 -48
  431. package/lib/module/components/GoogleButton.js.map +0 -1
  432. package/lib/module/components/HeadingGroup.js +0 -36
  433. package/lib/module/components/HeadingGroup.js.map +0 -1
  434. package/lib/module/components/ModalHeader.js +0 -92
  435. package/lib/module/components/ModalHeader.js.map +0 -1
  436. package/lib/module/components/ModalSheet.js +0 -39
  437. package/lib/module/components/ModalSheet.js.map +0 -1
  438. package/lib/module/components/OnairosSignInButton.js +0 -120
  439. package/lib/module/components/OnairosSignInButton.js.map +0 -1
  440. package/lib/module/components/PersonaImage.js +0 -53
  441. package/lib/module/components/PersonaImage.js.map +0 -1
  442. package/lib/module/components/PersonaLoadingScreen.js +0 -148
  443. package/lib/module/components/PersonaLoadingScreen.js.map +0 -1
  444. package/lib/module/components/PersonalizationConsentScreen.js +0 -309
  445. package/lib/module/components/PersonalizationConsentScreen.js.map +0 -1
  446. package/lib/module/components/PinCreationScreen.js +0 -386
  447. package/lib/module/components/PinCreationScreen.js.map +0 -1
  448. package/lib/module/components/PlatformConnectorsStep.js +0 -820
  449. package/lib/module/components/PlatformConnectorsStep.js.map +0 -1
  450. package/lib/module/components/PlatformToggle.js +0 -173
  451. package/lib/module/components/PlatformToggle.js.map +0 -1
  452. package/lib/module/components/PrimaryButton.js +0 -172
  453. package/lib/module/components/PrimaryButton.js.map +0 -1
  454. package/lib/module/components/SignInMatchAnimation.js +0 -189
  455. package/lib/module/components/SignInMatchAnimation.js.map +0 -1
  456. package/lib/module/components/SignInStep.js +0 -171
  457. package/lib/module/components/SignInStep.js.map +0 -1
  458. package/lib/module/components/VerificationStep.js +0 -146
  459. package/lib/module/components/VerificationStep.js.map +0 -1
  460. package/lib/module/components/WelcomeScreen.js +0 -393
  461. package/lib/module/components/WelcomeScreen.js.map +0 -1
  462. package/lib/module/components/icons/Basicproficon.js +0 -30
  463. package/lib/module/components/icons/Basicproficon.js.map +0 -1
  464. package/lib/module/components/icons/Basicprofile.js +0 -14
  465. package/lib/module/components/icons/Basicprofile.js.map +0 -1
  466. package/lib/module/components/icons/Checkbox.js +0 -14
  467. package/lib/module/components/icons/Checkbox.js.map +0 -1
  468. package/lib/module/components/icons/Checkmark.js +0 -20
  469. package/lib/module/components/icons/Checkmark.js.map +0 -1
  470. package/lib/module/components/icons/Contentanalysis.js +0 -14
  471. package/lib/module/components/icons/Contentanalysis.js.map +0 -1
  472. package/lib/module/components/icons/Contenticon.js +0 -32
  473. package/lib/module/components/icons/Contenticon.js.map +0 -1
  474. package/lib/module/components/icons/EnochE.js +0 -34
  475. package/lib/module/components/icons/EnochE.js.map +0 -1
  476. package/lib/module/components/icons/Personalityicon.js +0 -23
  477. package/lib/module/components/icons/Personalityicon.js.map +0 -1
  478. package/lib/module/components/icons/Personalityprofile.js +0 -14
  479. package/lib/module/components/icons/Personalityprofile.js.map +0 -1
  480. package/lib/module/components/icons/Personalitytraits.js +0 -14
  481. package/lib/module/components/icons/Personalitytraits.js.map +0 -1
  482. package/lib/module/components/icons/Userpreferences.js +0 -14
  483. package/lib/module/components/icons/Userpreferences.js.map +0 -1
  484. package/lib/module/components/icons/index.js +0 -13
  485. package/lib/module/components/icons/index.js.map +0 -1
  486. package/lib/module/config/api.js +0 -26
  487. package/lib/module/config/api.js.map +0 -1
  488. package/lib/module/context/AuthContext.js +0 -335
  489. package/lib/module/context/AuthContext.js.map +0 -1
  490. package/lib/module/hooks/useConnectedAccounts.js +0 -106
  491. package/lib/module/hooks/useConnectedAccounts.js.map +0 -1
  492. package/lib/module/hooks/useUserConnections.js +0 -140
  493. package/lib/module/hooks/useUserConnections.js.map +0 -1
  494. package/lib/module/services/apiClient.js +0 -298
  495. package/lib/module/services/apiClient.js.map +0 -1
  496. package/lib/module/services/authService.js +0 -905
  497. package/lib/module/services/authService.js.map +0 -1
  498. package/lib/module/services/biometricPinService.js +0 -173
  499. package/lib/module/services/biometricPinService.js.map +0 -1
  500. package/lib/module/services/connectedAccountsService.js +0 -255
  501. package/lib/module/services/connectedAccountsService.js.map +0 -1
  502. package/lib/module/services/googleAuthService.js +0 -258
  503. package/lib/module/services/googleAuthService.js.map +0 -1
  504. package/lib/module/services/imageCompressionService.js +0 -250
  505. package/lib/module/services/imageCompressionService.js.map +0 -1
  506. package/lib/module/services/jwtStorageService.js +0 -239
  507. package/lib/module/services/jwtStorageService.js.map +0 -1
  508. package/lib/module/services/mobileTrainingService.js +0 -172
  509. package/lib/module/services/mobileTrainingService.js.map +0 -1
  510. package/lib/module/services/pinEncryptionService.js +0 -75
  511. package/lib/module/services/pinEncryptionService.js.map +0 -1
  512. package/lib/module/services/pinStorageUtils.js +0 -93
  513. package/lib/module/services/pinStorageUtils.js.map +0 -1
  514. package/lib/module/services/storageService.js +0 -383
  515. package/lib/module/services/storageService.js.map +0 -1
  516. package/lib/module/services/trainingApiHelpers.js +0 -67
  517. package/lib/module/services/trainingApiHelpers.js.map +0 -1
  518. package/lib/module/services/userConnectionsService.js +0 -476
  519. package/lib/module/services/userConnectionsService.js.map +0 -1
  520. package/lib/module/services/youtubeMigrationService.js +0 -404
  521. package/lib/module/services/youtubeMigrationService.js.map +0 -1
  522. package/lib/module/theme/index.js +0 -244
  523. package/lib/module/theme/index.js.map +0 -1
  524. package/lib/module/utils/eventUtils.js +0 -270
  525. package/lib/module/utils/eventUtils.js.map +0 -1
  526. package/lib/module/utils/haptics.js +0 -59
  527. package/lib/module/utils/haptics.js.map +0 -1
  528. package/lib/module/utils/imagePreloader.js +0 -3
  529. package/lib/module/utils/imagePreloader.js.map +0 -1
  530. package/lib/typescript/components/BodyText.d.ts +0 -10
  531. package/lib/typescript/components/BodyText.d.ts.map +0 -1
  532. package/lib/typescript/components/BrandMark.d.ts +0 -11
  533. package/lib/typescript/components/BrandMark.d.ts.map +0 -1
  534. package/lib/typescript/components/CodeInput.d.ts +0 -10
  535. package/lib/typescript/components/CodeInput.d.ts.map +0 -1
  536. package/lib/typescript/components/EmailInput.d.ts +0 -8
  537. package/lib/typescript/components/EmailInput.d.ts.map +0 -1
  538. package/lib/typescript/components/ExistingUserDataConfirmation.d.ts +0 -12
  539. package/lib/typescript/components/ExistingUserDataConfirmation.d.ts.map +0 -1
  540. package/lib/typescript/components/GoogleButton.d.ts +0 -11
  541. package/lib/typescript/components/GoogleButton.d.ts.map +0 -1
  542. package/lib/typescript/components/HeadingGroup.d.ts +0 -11
  543. package/lib/typescript/components/HeadingGroup.d.ts.map +0 -1
  544. package/lib/typescript/components/ModalHeader.d.ts +0 -11
  545. package/lib/typescript/components/ModalHeader.d.ts.map +0 -1
  546. package/lib/typescript/components/ModalSheet.d.ts +0 -13
  547. package/lib/typescript/components/ModalSheet.d.ts.map +0 -1
  548. package/lib/typescript/components/OnairosSignInButton.d.ts +0 -13
  549. package/lib/typescript/components/OnairosSignInButton.d.ts.map +0 -1
  550. package/lib/typescript/components/PersonaImage.d.ts +0 -8
  551. package/lib/typescript/components/PersonaImage.d.ts.map +0 -1
  552. package/lib/typescript/components/PersonaLoadingScreen.d.ts +0 -10
  553. package/lib/typescript/components/PersonaLoadingScreen.d.ts.map +0 -1
  554. package/lib/typescript/components/PersonalizationConsentScreen.d.ts +0 -10
  555. package/lib/typescript/components/PersonalizationConsentScreen.d.ts.map +0 -1
  556. package/lib/typescript/components/PinCreationScreen.d.ts +0 -10
  557. package/lib/typescript/components/PinCreationScreen.d.ts.map +0 -1
  558. package/lib/typescript/components/PlatformConnectorsStep.d.ts +0 -11
  559. package/lib/typescript/components/PlatformConnectorsStep.d.ts.map +0 -1
  560. package/lib/typescript/components/PlatformToggle.d.ts +0 -20
  561. package/lib/typescript/components/PlatformToggle.d.ts.map +0 -1
  562. package/lib/typescript/components/PrimaryButton.d.ts +0 -22
  563. package/lib/typescript/components/PrimaryButton.d.ts.map +0 -1
  564. package/lib/typescript/components/SignInMatchAnimation.d.ts +0 -9
  565. package/lib/typescript/components/SignInMatchAnimation.d.ts.map +0 -1
  566. package/lib/typescript/components/SignInStep.d.ts +0 -12
  567. package/lib/typescript/components/SignInStep.d.ts.map +0 -1
  568. package/lib/typescript/components/VerificationStep.d.ts +0 -13
  569. package/lib/typescript/components/VerificationStep.d.ts.map +0 -1
  570. package/lib/typescript/components/WelcomeScreen.d.ts +0 -9
  571. package/lib/typescript/components/WelcomeScreen.d.ts.map +0 -1
  572. package/lib/typescript/components/icons/Basicproficon.d.ts +0 -5
  573. package/lib/typescript/components/icons/Basicproficon.d.ts.map +0 -1
  574. package/lib/typescript/components/icons/Basicprofile.d.ts +0 -5
  575. package/lib/typescript/components/icons/Basicprofile.d.ts.map +0 -1
  576. package/lib/typescript/components/icons/Checkbox.d.ts +0 -5
  577. package/lib/typescript/components/icons/Checkbox.d.ts.map +0 -1
  578. package/lib/typescript/components/icons/Checkmark.d.ts +0 -5
  579. package/lib/typescript/components/icons/Checkmark.d.ts.map +0 -1
  580. package/lib/typescript/components/icons/Contentanalysis.d.ts +0 -5
  581. package/lib/typescript/components/icons/Contentanalysis.d.ts.map +0 -1
  582. package/lib/typescript/components/icons/Contenticon.d.ts +0 -5
  583. package/lib/typescript/components/icons/Contenticon.d.ts.map +0 -1
  584. package/lib/typescript/components/icons/EnochE.d.ts +0 -5
  585. package/lib/typescript/components/icons/EnochE.d.ts.map +0 -1
  586. package/lib/typescript/components/icons/Personalityicon.d.ts +0 -5
  587. package/lib/typescript/components/icons/Personalityicon.d.ts.map +0 -1
  588. package/lib/typescript/components/icons/Personalityprofile.d.ts +0 -5
  589. package/lib/typescript/components/icons/Personalityprofile.d.ts.map +0 -1
  590. package/lib/typescript/components/icons/Personalitytraits.d.ts +0 -5
  591. package/lib/typescript/components/icons/Personalitytraits.d.ts.map +0 -1
  592. package/lib/typescript/components/icons/Userpreferences.d.ts +0 -5
  593. package/lib/typescript/components/icons/Userpreferences.d.ts.map +0 -1
  594. package/lib/typescript/components/icons/index.d.ts +0 -12
  595. package/lib/typescript/components/icons/index.d.ts.map +0 -1
  596. package/lib/typescript/config/api.d.ts +0 -24
  597. package/lib/typescript/config/api.d.ts.map +0 -1
  598. package/lib/typescript/context/AuthContext.d.ts +0 -34
  599. package/lib/typescript/context/AuthContext.d.ts.map +0 -1
  600. package/lib/typescript/hooks/useConnectedAccounts.d.ts +0 -11
  601. package/lib/typescript/hooks/useConnectedAccounts.d.ts.map +0 -1
  602. package/lib/typescript/hooks/useUserConnections.d.ts +0 -12
  603. package/lib/typescript/hooks/useUserConnections.d.ts.map +0 -1
  604. package/lib/typescript/services/apiClient.d.ts +0 -91
  605. package/lib/typescript/services/apiClient.d.ts.map +0 -1
  606. package/lib/typescript/services/authService.d.ts +0 -216
  607. package/lib/typescript/services/authService.d.ts.map +0 -1
  608. package/lib/typescript/services/biometricPinService.d.ts +0 -29
  609. package/lib/typescript/services/biometricPinService.d.ts.map +0 -1
  610. package/lib/typescript/services/connectedAccountsService.d.ts +0 -56
  611. package/lib/typescript/services/connectedAccountsService.d.ts.map +0 -1
  612. package/lib/typescript/services/googleAuthService.d.ts +0 -63
  613. package/lib/typescript/services/googleAuthService.d.ts.map +0 -1
  614. package/lib/typescript/services/imageCompressionService.d.ts +0 -37
  615. package/lib/typescript/services/imageCompressionService.d.ts.map +0 -1
  616. package/lib/typescript/services/jwtStorageService.d.ts +0 -86
  617. package/lib/typescript/services/jwtStorageService.d.ts.map +0 -1
  618. package/lib/typescript/services/mobileTrainingService.d.ts +0 -45
  619. package/lib/typescript/services/mobileTrainingService.d.ts.map +0 -1
  620. package/lib/typescript/services/pinEncryptionService.d.ts +0 -17
  621. package/lib/typescript/services/pinEncryptionService.d.ts.map +0 -1
  622. package/lib/typescript/services/pinStorageUtils.d.ts +0 -25
  623. package/lib/typescript/services/pinStorageUtils.d.ts.map +0 -1
  624. package/lib/typescript/services/storageService.d.ts +0 -128
  625. package/lib/typescript/services/storageService.d.ts.map +0 -1
  626. package/lib/typescript/services/trainingApiHelpers.d.ts +0 -38
  627. package/lib/typescript/services/trainingApiHelpers.d.ts.map +0 -1
  628. package/lib/typescript/services/userConnectionsService.d.ts +0 -90
  629. package/lib/typescript/services/userConnectionsService.d.ts.map +0 -1
  630. package/lib/typescript/services/youtubeMigrationService.d.ts +0 -12
  631. package/lib/typescript/services/youtubeMigrationService.d.ts.map +0 -1
  632. package/lib/typescript/theme/index.d.ts +0 -416
  633. package/lib/typescript/theme/index.d.ts.map +0 -1
  634. package/lib/typescript/utils/eventUtils.d.ts +0 -108
  635. package/lib/typescript/utils/eventUtils.d.ts.map +0 -1
  636. package/lib/typescript/utils/haptics.d.ts +0 -11
  637. package/lib/typescript/utils/haptics.d.ts.map +0 -1
  638. package/lib/typescript/utils/imagePreloader.d.ts +0 -2
  639. package/lib/typescript/utils/imagePreloader.d.ts.map +0 -1
  640. package/src/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
  641. package/src/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
  642. package/src/assets/icons/Facebookicon.png +0 -0
  643. package/src/assets/icons/Gmail.png +0 -0
  644. package/src/assets/icons/Linkedinicon.png +0 -0
  645. package/src/assets/icons/Redditicon.png +0 -0
  646. package/src/assets/icons/YouTubeicon2.png +0 -0
  647. package/src/assets/icons/YouTubeicon3.png +0 -0
  648. package/src/assets/icons/farcaster.png +0 -0
  649. package/src/assets/icons/instagram.png +0 -0
  650. package/src/assets/icons/pinterest.png +0 -0
  651. package/src/assets/icons/swerv_logo.png +0 -0
  652. package/src/assets/icons/twitter.jpg +0 -0
  653. package/src/assets/images/Checkbox.svg +0 -3
  654. package/src/assets/images/EnochE.svg +0 -19
  655. package/src/assets/images/Enochicon1.png +0 -0
  656. package/src/assets/images/Face_ID_logo.png +0 -0
  657. package/src/assets/images/Facebookicon.png +0 -0
  658. package/src/assets/images/Gmail.png +0 -0
  659. package/src/assets/images/Googlelogo.png +0 -0
  660. package/src/assets/images/Linkedinicon.png +0 -0
  661. package/src/assets/images/Onairoslogo.png +0 -0
  662. package/src/assets/images/Personalityprofile.svg +0 -3
  663. package/src/assets/images/Personalitytraits.svg +0 -3
  664. package/src/assets/images/Redditicon.png +0 -0
  665. package/src/assets/images/Userpreferences.svg +0 -3
  666. package/src/assets/images/YouTubeicon3.png +0 -0
  667. package/src/assets/images/arrow.svg +0 -20
  668. package/src/assets/images/basicproficon.svg +0 -43
  669. package/src/assets/images/basicprofile.svg +0 -3
  670. package/src/assets/images/checkmark.svg +0 -4
  671. package/src/assets/images/contentanalysis.svg +0 -3
  672. package/src/assets/images/contenticon.svg +0 -23
  673. package/src/assets/images/persona1.png +0 -0
  674. package/src/assets/images/persona2.png +0 -0
  675. package/src/assets/images/persona3.png +0 -0
  676. package/src/assets/images/persona4.png +0 -0
  677. package/src/assets/images/persona5.png +0 -0
  678. package/src/assets/images/personalityicon.svg +0 -18
  679. package/src/assets/images/x-close.svg +0 -3
  680. package/src/components/BodyText.tsx +0 -33
  681. package/src/components/BrandMark.tsx +0 -62
  682. package/src/components/CodeInput.tsx +0 -32
  683. package/src/components/EmailInput.tsx +0 -31
  684. package/src/components/ExistingUserDataConfirmation.tsx +0 -507
  685. package/src/components/GoogleButton.tsx +0 -55
  686. package/src/components/HeadingGroup.tsx +0 -49
  687. package/src/components/ModalHeader.tsx +0 -125
  688. package/src/components/ModalSheet.tsx +0 -59
  689. package/src/components/OnairosSignInButton.tsx +0 -132
  690. package/src/components/PersonaImage.tsx +0 -79
  691. package/src/components/PersonaLoadingScreen.tsx +0 -201
  692. package/src/components/PersonalizationConsentScreen.tsx +0 -410
  693. package/src/components/PinCreationScreen.tsx +0 -492
  694. package/src/components/PlatformConnectorsStep.tsx +0 -892
  695. package/src/components/PlatformToggle.tsx +0 -226
  696. package/src/components/PrimaryButton.tsx +0 -214
  697. package/src/components/SignInMatchAnimation.tsx +0 -225
  698. package/src/components/SignInStep.tsx +0 -217
  699. package/src/components/VerificationStep.tsx +0 -198
  700. package/src/components/WelcomeScreen.tsx +0 -490
  701. package/src/components/icons/Basicproficon.tsx +0 -30
  702. package/src/components/icons/Basicprofile.tsx +0 -17
  703. package/src/components/icons/Checkbox.tsx +0 -17
  704. package/src/components/icons/Checkmark.tsx +0 -24
  705. package/src/components/icons/Contentanalysis.tsx +0 -17
  706. package/src/components/icons/Contenticon.tsx +0 -30
  707. package/src/components/icons/EnochE.tsx +0 -39
  708. package/src/components/icons/Personalityicon.tsx +0 -22
  709. package/src/components/icons/Personalityprofile.tsx +0 -17
  710. package/src/components/icons/Personalitytraits.tsx +0 -17
  711. package/src/components/icons/Userpreferences.tsx +0 -17
  712. package/src/components/icons/index.ts +0 -12
  713. package/src/config/api.ts +0 -25
  714. package/src/context/AuthContext.tsx +0 -393
  715. package/src/hooks/useConnectedAccounts.ts +0 -139
  716. package/src/hooks/useUserConnections.ts +0 -166
  717. package/src/services/apiClient.ts +0 -337
  718. package/src/services/authService.ts +0 -1008
  719. package/src/services/biometricPinService.ts +0 -193
  720. package/src/services/connectedAccountsService.ts +0 -290
  721. package/src/services/googleAuthService.ts +0 -279
  722. package/src/services/imageCompressionService.ts +0 -303
  723. package/src/services/jwtStorageService.ts +0 -257
  724. package/src/services/mobileTrainingService.ts +0 -204
  725. package/src/services/pinEncryptionService.ts +0 -76
  726. package/src/services/pinStorageUtils.ts +0 -97
  727. package/src/services/storageService.ts +0 -452
  728. package/src/services/trainingApiHelpers.ts +0 -67
  729. package/src/services/userConnectionsService.ts +0 -557
  730. package/src/services/youtubeMigrationService.ts +0 -454
  731. package/src/theme/index.ts +0 -239
  732. package/src/utils/eventUtils.ts +0 -303
  733. package/src/utils/haptics.ts +0 -59
  734. package/src/utils/imagePreloader.ts +0 -2
@@ -1,574 +1,403 @@
1
1
  import React, { useCallback, useEffect, useState, useRef } from 'react';
2
- import { View, Text, Image, StyleSheet, Dimensions, TouchableOpacity, ActivityIndicator, Platform, Modal, Animated, SafeAreaView, ScrollView, Linking, Vibration, Easing, Alert } from 'react-native';
3
- // Removed navigation dependencies for SDK compatibility
4
- import AsyncStorage from '@react-native-async-storage/async-storage';
5
- // Import components and hooks
2
+ import { View, Text, StyleSheet, TouchableOpacity, ActivityIndicator, Dimensions, Platform, Modal, Animated, SafeAreaView, TouchableWithoutFeedback, ScrollView, Image, Linking, Alert, TextInput } from 'react-native';
3
+ import Icon from 'react-native-vector-icons/MaterialIcons';
6
4
  import { PinInput } from './PinInput';
5
+ import { TrainingModal } from './TrainingModal';
6
+ import { DataRequestScreen } from './DataRequestScreen';
7
7
  import { OAuthWebView } from './onboarding/OAuthWebView';
8
- // import { useConnections } from '../../hooks/useConnections'; // Commented out - file path issue
9
- // import { useAuth } from '../../context/AuthContext'; // Commented out - file path issue
10
- import { initiateOAuth, initiateNativeAuth, hasNativeSDK, isOAuthCallback } from '../services/platformAuthService';
11
- import { triggerHaptic, HapticType } from '../utils/haptics';
12
- import { getOnairosUsername } from '../services/authService';
13
- import { io } from 'socket.io-client';
14
- import { setTemporaryPin, clearTemporaryPin } from '../services/pinStorageUtils';
15
- import { getEncryptedPinForAPI } from '../services/pinEncryptionService';
16
- import { startEnochTrainingWithYouTubeCheck } from '../services/mobileTrainingService';
17
-
18
- // Import types
19
- // import type { ConnectionStatus } from '../../hooks/useConnections'; // Commented out - file path issue
20
- // Removed App-specific navigation types
21
-
8
+ import { useConnections } from '../hooks/useConnections';
9
+ import { COLORS } from '../constants';
10
+ import { initiateOAuth, initiateNativeAuth, hasNativeSDK, isOAuthCallback, testApiConnectivity, handleOAuthCallbackUrl, requestEmailVerification, verifyEmailCode, checkEmailVerificationStatus } from '../services/platformAuthService';
11
+ // Optional Opacity SDK imports with error handling
12
+ let opacityInit = null;
13
+ let OpacityEnvironment = null;
14
+ let opacityGet = null;
15
+ try {
16
+ const opacitySDK = require('@opacity-labs/react-native-opacity');
17
+ opacityInit = opacitySDK.init;
18
+ OpacityEnvironment = opacitySDK.OpacityEnvironment;
19
+ opacityGet = opacitySDK.get;
20
+ } catch (error) {
21
+ console.warn('Opacity SDK not available:', error);
22
+ // Opacity SDK will be disabled if not available
23
+ }
22
24
  const {
23
25
  height,
24
26
  width
25
27
  } = Dimensions.get('window');
26
- // ConnectionStatus interface is now imported from hooks/useConnections
27
-
28
28
  export const UniversalOnboarding = ({
29
29
  visible,
30
30
  onClose,
31
31
  AppName,
32
+ appIcon,
32
33
  requestData,
33
34
  returnLink,
34
35
  onComplete,
35
36
  embedd = false,
36
37
  debug = false,
37
- test = false,
38
+ testMode = false,
38
39
  preferredPlatform,
39
- primaryAuthOnly = false
40
+ inferenceData,
41
+ auto = false,
42
+ partner
40
43
  }) => {
41
- var _existingUserInfo$exi;
42
- const [step, setStep] = useState(primaryAuthOnly ? 'persona' : 'connect');
44
+ const [step, setStep] = useState('email');
43
45
  const [connections, setConnections] = useState({});
44
46
  const [pin, setPin] = useState('');
45
47
  const [selectedTier, setSelectedTier] = useState('Medium');
46
- // Training state is now handled by TrainingModal
47
- const [slideAnim] = useState(new Animated.Value(height * 0.5));
48
+ const [training, setTraining] = useState({
49
+ progress: 0,
50
+ eta: ''
51
+ });
52
+ const [slideAnim] = useState(new Animated.Value(height));
48
53
  const [platformToggles, setPlatformToggles] = useState({});
49
54
  const [oauthUrl, setOauthUrl] = useState('');
50
55
  const [currentPlatform, setCurrentPlatform] = useState('');
56
+ const [username, setUsername] = useState('Avatar');
57
+ const [isConnectingPlatform, setIsConnectingPlatform] = useState(false);
58
+ const [showLoginWebView, setShowLoginWebView] = useState(false);
51
59
  const [email, setEmail] = useState('');
52
- const [longPressTimer, setLongPressTimer] = useState(null);
53
- const [modalVisible, setModalVisible] = useState(visible);
54
-
55
- // Debug logging for modal visibility
56
- useEffect(() => {
57
- console.log('🔍 UniversalOnboarding: visible prop changed to:', visible);
58
- console.log('🔍 UniversalOnboarding: modalVisible state is:', modalVisible);
59
- console.log('🔍 UniversalOnboarding: current step is:', step);
60
- console.log('🔍 UniversalOnboarding: primaryAuthOnly is:', primaryAuthOnly);
61
- }, [visible, modalVisible, step, primaryAuthOnly]);
62
- const isCompletingRef = useRef(false);
63
- const [connectionsCount, setConnectionsCount] = useState(5); // Simulated connections count
64
-
65
- // Add state for showing additional platforms
66
- const [showAdditionalPlatforms, setShowAdditionalPlatforms] = useState(false);
67
- const [additionalPlatformsOpacity] = useState(new Animated.Value(0));
68
-
69
- // Add ref for ScrollView to control scroll position
70
- const scrollViewRef = useRef(null);
71
- // Get the authenticated user from auth context
72
- // const { user } = useAuth(); // Hook not available
73
- const user = null;
74
-
75
- // State for storing the correct username
76
- const [username, setUsername] = useState('');
77
-
78
- // Real training state variables (replacing fake persona state)
79
- const [personaProgress, setPersonaProgress] = useState(0);
80
- const [personaStatus, setPersonaStatus] = useState('Initializing...');
81
- const [isPersonaComplete, setIsPersonaComplete] = useState(false);
82
- const [socketConnected, setSocketConnected] = useState(false);
83
- const [hasError, setHasError] = useState(false);
84
- const [userTraits, setUserTraits] = useState(null);
85
- const [inferenceResults, setInferenceResults] = useState(null);
86
- const [userToken, setUserToken] = useState(null);
87
- const [userInfo, setUserInfo] = useState(null);
88
- const [animatedDots, setAnimatedDots] = useState('');
89
- const socketRef = useRef(null);
90
- const dotsAnimationRef = useRef(null);
91
-
92
- // Existing user state
60
+ const [verificationCode, setVerificationCode] = useState('');
61
+ const [isVerifyingCode, setIsVerifyingCode] = useState(false);
93
62
  const [isExistingUser, setIsExistingUser] = useState(false);
94
- const [existingUserToken, setExistingUserToken] = useState(null);
95
- const [existingUserInfo, setExistingUserInfo] = useState(null);
96
-
97
- // Data scenario states
98
- const [dataScenario, setDataScenario] = useState(null);
99
- const [dataDetails, setDataDetails] = useState(null);
100
- const [showDataWarning, setShowDataWarning] = useState(false);
101
-
102
- // ✅ NEW: Background training state
103
- const [isBackgroundTrainingStarted, setIsBackgroundTrainingStarted] = useState(false);
104
- const [backgroundTrainingProgress, setBackgroundTrainingProgress] = useState('');
105
- const [backgroundSocketId, setBackgroundSocketId] = useState(null);
106
-
107
- // Function to store connected platforms
108
- const storeConnectedPlatform = async platformId => {
109
- try {
110
- const storedPlatforms = await AsyncStorage.getItem('connectedPlatforms');
111
- let platforms = storedPlatforms ? JSON.parse(storedPlatforms) : [];
112
-
113
- // Add platform if not already in the list
114
- if (!platforms.includes(platformId)) {
115
- platforms.push(platformId);
116
- await AsyncStorage.setItem('connectedPlatforms', JSON.stringify(platforms));
117
- console.log('📱 Stored connected platform:', platformId, 'Total platforms:', platforms);
118
- }
119
- } catch (error) {
120
- console.error('Error storing connected platform:', error);
121
- }
122
- };
123
-
124
- // Function to remove connected platform from storage
125
- const removeConnectedPlatform = async platformId => {
126
- try {
127
- const storedPlatforms = await AsyncStorage.getItem('connectedPlatforms');
128
- let platforms = storedPlatforms ? JSON.parse(storedPlatforms) : [];
129
63
 
130
- // Remove platform from the list
131
- platforms = platforms.filter(platform => platform !== platformId);
132
- await AsyncStorage.setItem('connectedPlatforms', JSON.stringify(platforms));
133
- console.log('📱 Removed connected platform:', platformId, 'Remaining platforms:', platforms);
134
- } catch (error) {
135
- console.error('Error removing connected platform:', error);
136
- }
137
- };
138
-
139
- // Function to handle disconnect confirmation
140
- const handleDisconnectPlatform = (platformId, platformName) => {
141
- Alert.alert('Disconnect Platform', `Are you sure you want to disconnect ${platformName}?`, [{
142
- text: 'No',
143
- style: 'cancel'
144
- }, {
145
- text: 'Yes',
146
- style: 'destructive',
147
- onPress: async () => {
148
- try {
149
- // Update local state to show disconnected
150
- setConnectionStatuses(prev => ({
151
- ...prev,
152
- [platformId]: 'disconnected'
153
- }));
154
- setConnections(prev => {
155
- const newConnections = {
156
- ...prev
157
- };
158
- delete newConnections[platformId];
159
- return newConnections;
160
- });
161
- setPlatformToggles(prev => ({
162
- ...prev,
163
- [platformId]: false
164
- }));
165
-
166
- // Remove from storage
167
- await removeConnectedPlatform(platformId);
168
-
169
- // Call the disconnect function from the hook
170
- await disconnectPlatform();
171
- console.log('🔌 Disconnected platform:', platformId);
172
- } catch (error) {
173
- console.error('Error disconnecting platform:', error);
174
- }
175
- }
176
- }]);
177
- };
178
-
179
- // Function to start animated dots
180
- const startDotsAnimation = () => {
181
- if (dotsAnimationRef.current) {
182
- clearInterval(dotsAnimationRef.current);
183
- }
184
- let dotCount = 0;
185
- dotsAnimationRef.current = setInterval(() => {
186
- dotCount = (dotCount + 1) % 4; // 0, 1, 2, 3, then back to 0
187
- if (dotCount === 0) {
188
- setAnimatedDots('');
189
- } else {
190
- setAnimatedDots('.'.repeat(dotCount));
191
- }
192
- }, 500); // Change every 500ms
193
- };
194
-
195
- // Function to stop animated dots
196
- const stopDotsAnimation = () => {
197
- if (dotsAnimationRef.current) {
198
- clearInterval(dotsAnimationRef.current);
199
- dotsAnimationRef.current = null;
200
- }
201
- setAnimatedDots('');
202
- };
64
+ // Add refs for cleanup and code inputs
65
+ const successTimeoutRef = useRef(null);
66
+ const isMountedRef = useRef(true);
67
+ const codeInputRefs = useRef([]);
203
68
 
204
- // Split platforms into main and additional
205
- const mainPlatforms = [{
206
- id: 'pinterest',
207
- name: 'Pinterest',
208
- color: '#E60023'
69
+ // Add state for showing additional platforms
70
+ const [showAllPlatforms, setShowAllPlatforms] = useState(false);
71
+
72
+ // Parse test mode options
73
+ const testModeOptions = typeof testMode === 'object' ? testMode : {};
74
+ const isTestMode = testMode === true || typeof testMode === 'object' && testMode !== null;
75
+ const showTestControls = (debug || isTestMode) && requestData;
76
+
77
+ // Simple 2-flow system
78
+ const isExistingUserFlow = testModeOptions.existingUser || false;
79
+ const isNewUserFlow = testModeOptions.newUser || false;
80
+ const platforms = [{
81
+ id: 'instagram',
82
+ name: 'Instagram',
83
+ icon: require('../assets/images/instagram.png')
209
84
  }, {
210
85
  id: 'youtube',
211
86
  name: 'YouTube',
212
- color: '#FFFFFF'
87
+ icon: require('../assets/images/youtube.png')
88
+ }, {
89
+ id: 'email',
90
+ name: 'Gmail',
91
+ icon: require('../assets/images/email.png')
213
92
  }, {
214
- id: 'linkedin',
215
- name: 'LinkedIn',
216
- color: '#0077B5'
217
- }];
218
- const additionalPlatforms = [{
219
93
  id: 'reddit',
220
94
  name: 'Reddit',
221
- color: '#FFFFFF'
95
+ icon: require('../assets/images/reddit.png')
222
96
  }, {
223
- id: 'gmail',
224
- name: 'Gmail',
225
- color: '#EA4335'
97
+ id: 'pinterest',
98
+ name: 'Pinterest',
99
+ icon: require('../assets/images/pinterest.png')
226
100
  }];
227
101
 
228
- // Keep the original platforms array for compatibility
229
- const platforms = [...mainPlatforms, ...additionalPlatforms];
230
-
231
- // const {
232
- // connectPlatform,
233
- // disconnectPlatform,
234
- // getConnectionStatus,
235
- // isConnecting,
236
- // } = useConnections(); // Hook not available
237
- const connectPlatform = async () => {};
238
- const disconnectPlatform = async () => {};
239
- const getConnectionStatus = () => 'disconnected';
240
- const isConnecting = false;
241
- const isConnected = () => false;
242
-
243
- // Track connection statuses and currently connecting platform
244
- const [connectionStatuses, setConnectionStatuses] = useState({});
245
- const [connectingPlatform, setConnectingPlatform] = useState(null);
246
-
247
- // Function to get the platform icon based on platform ID
248
- const getPlatformIcon = platformId => {
249
- switch (platformId) {
250
- case 'instagram':
251
- return require('../assets/icons/instagram.png');
252
- case 'youtube':
253
- return require('../assets/icons/YouTubeicon2.png');
254
- case 'reddit':
255
- return require('../assets/icons/Redditicon.png');
256
- case 'pinterest':
257
- return require('../assets/icons/pinterest.png');
258
- case 'facebook':
259
- return require('../assets/icons/Facebookicon.png');
260
- case 'linkedin':
261
- return require('../assets/icons/Linkedinicon.png');
262
- case 'gmail':
263
- return require('../assets/icons/Gmail.png');
102
+ // Handle preferredPlatform to show ONLY preferred platforms (up to 2)
103
+ const getDisplayPlatforms = () => {
104
+ if (!preferredPlatform) {
105
+ // Default behavior: show first 3 platforms initially
106
+ return showAllPlatforms ? platforms : platforms.slice(0, 3);
264
107
  }
265
- };
108
+ const preferredArray = Array.isArray(preferredPlatform) ? preferredPlatform : [preferredPlatform];
109
+ const maxPreferred = Math.min(preferredArray.length, 2); // Limit to 2 preferred platforms max
266
110
 
267
- // Track if the modal has ever been visible to prevent initial onClose call
268
- const hasBeenVisibleRef = useRef(false);
111
+ // Show ONLY the preferred platforms (in specified order)
112
+ return preferredArray.slice(0, maxPreferred).map(id => platforms.find(p => p.id === id)).filter(Boolean);
113
+ };
114
+ const platformsToDisplay = getDisplayPlatforms();
115
+
116
+ // Calculate additional platforms for "Show More" button
117
+ const additionalPlatforms = preferredPlatform ? [] : platforms.slice(3);
118
+ const {
119
+ connectPlatform,
120
+ disconnectPlatform,
121
+ getConnectionStatus,
122
+ isConnecting
123
+ } = useConnections();
269
124
  useEffect(() => {
125
+ // Set mounted flag
126
+ isMountedRef.current = true;
270
127
  if (visible) {
271
- hasBeenVisibleRef.current = true; // Mark that modal has been visible
272
- isCompletingRef.current = false; // Reset flag when becoming visible
273
- setModalVisible(true);
274
128
  loadInitialStatus();
275
129
  // Animate in
276
130
  Animated.spring(slideAnim, {
277
131
  toValue: 0,
278
- friction: 8,
279
- tension: 40,
280
- useNativeDriver: true
132
+ useNativeDriver: true,
133
+ bounciness: 0
281
134
  }).start();
282
- const subscription = Linking.addEventListener('url', handleUrl);
135
+
136
+ // Set up deep link listener for OAuth callbacks
137
+ // Using the subscription pattern for React Native's Linking API
138
+ const subscription = Linking.addListener('url', ({
139
+ url
140
+ }) => {
141
+ if (isOAuthCallback(url)) {
142
+ handleOAuthCallback(url);
143
+ }
144
+ });
145
+
146
+ // Check for initial URL (app was opened via deep link)
147
+ Linking.getInitialURL().then(initialUrl => {
148
+ if (initialUrl && isOAuthCallback(initialUrl)) {
149
+ handleOAuthCallback(initialUrl);
150
+ }
151
+ });
152
+
153
+ // Initialize platform toggles
154
+ const initialToggles = {};
155
+ platforms.forEach(platform => {
156
+ initialToggles[platform.id] = false;
157
+ });
158
+ setPlatformToggles(initialToggles);
159
+
160
+ // Debug mode for Expo Go
161
+ if (debug || Platform.OS === 'web') {
162
+ console.log('Debug mode enabled - Using mock data for onboarding');
163
+ console.log('Configuration:', {
164
+ auto,
165
+ partner,
166
+ hasInferenceData: !!inferenceData,
167
+ inferenceDataType: typeof inferenceData
168
+ });
169
+
170
+ // Pre-populate with mock connections in debug mode
171
+ if (testMode || Platform.OS === 'web') {
172
+ setConnections({
173
+ instagram: {
174
+ userName: 'instagram_user',
175
+ connected: true
176
+ },
177
+ youtube: {
178
+ userName: 'youtube_user',
179
+ connected: true
180
+ }
181
+ });
182
+ }
183
+ }
184
+
185
+ // If there's a preferred platform, pre-connect
186
+ if (preferredPlatform && debug) {
187
+ const preferredArray = Array.isArray(preferredPlatform) ? preferredPlatform : [preferredPlatform];
188
+ const newConnections = {};
189
+ preferredArray.slice(0, 2).forEach(platform => {
190
+ newConnections[platform] = {
191
+ userName: `${platform}_user`,
192
+ connected: true
193
+ };
194
+ });
195
+ setConnections(prev => ({
196
+ ...prev,
197
+ ...newConnections
198
+ }));
199
+ }
200
+
201
+ // Return cleanup function
283
202
  return () => {
203
+ // Remove event listener using the subscription
284
204
  subscription.remove();
285
205
  };
286
- } else if (hasBeenVisibleRef.current && !isCompletingRef.current) {
287
- // Only animate out if NOT completing - prevents flicker during successful completion
206
+ } else {
207
+ // Animate out
288
208
  Animated.timing(slideAnim, {
289
209
  toValue: height,
290
- useNativeDriver: true,
291
- duration: 500,
292
- // Longer duration for a more elegant exit
293
- easing: Easing.bezier(0.16, 1, 0.3, 1) // Custom bezier curve for a luxurious, smooth exit
210
+ duration: 250,
211
+ useNativeDriver: true
294
212
  }).start(() => {
295
- // Use a timeout to prevent animation state updates during unmount
296
- setTimeout(() => {
297
- setModalVisible(false);
298
- onClose(); // Call onClose from props
299
- }, 16);
213
+ // Reset state if needed
300
214
  });
301
- } else if (hasBeenVisibleRef.current && isCompletingRef.current) {
302
- // If completing, hide modal immediately without any animation or delay
303
- setModalVisible(false);
304
- // Don't call onClose() when completing - let parent handle the navigation
305
- isCompletingRef.current = false; // Reset for next time
306
215
  }
307
- }, [visible, onClose]); // Removed isCompleting from dependency array
216
+ }, [visible, preferredPlatform]);
308
217
 
309
- // Cleanup socket connection and dots animation when component unmounts or becomes invisible
218
+ // Cleanup effect for unmounting
310
219
  useEffect(() => {
311
220
  return () => {
312
- if (socketRef.current) {
313
- console.log('🔌 Cleaning up socket connection...');
314
- socketRef.current.disconnect();
315
- socketRef.current = null;
316
- }
317
- stopDotsAnimation();
318
- };
319
- }, [visible]);
320
-
321
- // Set up deep link listener for OAuth callbacks
322
- const handleUrl = useCallback(({
323
- url
324
- }) => {
325
- if (isOAuthCallback(url)) {
326
- handleOAuthCallback(url);
327
- }
328
- }, []);
329
-
330
- // Load user data and authentication token when modal becomes visible
331
- useEffect(() => {
332
- const loadUserData = async () => {
333
- try {
334
- // Check for existing user info first
335
- const existingToken = await AsyncStorage.getItem('existing_user_token');
336
- const existingInfo = await AsyncStorage.getItem('existing_user_info');
337
- if (existingToken && existingInfo) {
338
- console.log('🔍 Found existing user info - user wants to add more data');
339
- setIsExistingUser(true);
340
- setExistingUserToken(existingToken);
341
- setExistingUserInfo(JSON.parse(existingInfo));
221
+ // Set mounted flag to false
222
+ isMountedRef.current = false;
342
223
 
343
- // Clear the temporary storage
344
- await AsyncStorage.removeItem('existing_user_token');
345
- await AsyncStorage.removeItem('existing_user_info');
346
- }
347
- const token = (await AsyncStorage.getItem('onairos_jwt_token')) || (await AsyncStorage.getItem('auth_token'));
348
- setUserToken(token);
349
- if (token) {
350
- var _user$email;
351
- // Use provided username or get stored username
352
- const storedUsername = await getOnairosUsername();
353
- const fallbackUsername = storedUsername || (user === null || user === void 0 || (_user$email = user.email) === null || _user$email === void 0 ? void 0 : _user$email.split('@')[0]) || (user === null || user === void 0 ? void 0 : user.name) || 'mobile_user';
354
- console.log('🔍 Using username for training:', fallbackUsername);
355
- setUserInfo({
356
- username: fallbackUsername,
357
- email: (user === null || user === void 0 ? void 0 : user.email) || null,
358
- id: null // Will be filled by backend during training
359
- });
360
- setUsername(fallbackUsername);
361
- }
362
- } catch (error) {
363
- var _user$email2;
364
- console.error('Error loading user data:', error);
365
- // Fallback user info
366
- const fallbackUsername = (user === null || user === void 0 || (_user$email2 = user.email) === null || _user$email2 === void 0 ? void 0 : _user$email2.split('@')[0]) || (user === null || user === void 0 ? void 0 : user.name) || 'mobile_user';
367
- setUserInfo({
368
- username: fallbackUsername,
369
- email: (user === null || user === void 0 ? void 0 : user.email) || null,
370
- id: null
371
- });
372
- setUsername(fallbackUsername);
224
+ // Clear any pending timeouts
225
+ if (successTimeoutRef.current) {
226
+ clearTimeout(successTimeoutRef.current);
227
+ successTimeoutRef.current = null;
373
228
  }
374
229
  };
375
- if (visible) {
376
- loadUserData();
230
+ }, []);
231
+ const handleClose = () => {
232
+ // Clear any pending timeouts before closing
233
+ if (successTimeoutRef.current) {
234
+ clearTimeout(successTimeoutRef.current);
235
+ successTimeoutRef.current = null;
377
236
  }
378
- }, [visible, user]);
379
- const loadInitialStatus = async () => {
380
- try {
381
- // Get the stored Onairos username first
382
- const storedUsername = await getOnairosUsername();
383
- const fallbackUsername = (user === null || user === void 0 ? void 0 : user.email) || (user === null || user === void 0 ? void 0 : user.name) || `user_${Math.floor(Math.random() * 10000)}`;
384
- const finalUsername = storedUsername || fallbackUsername;
385
- console.log('🔍 Loading username for data connections:', {
386
- storedUsername,
387
- fallbackUsername,
388
- finalUsername
389
- });
390
- setUsername(finalUsername);
391
-
392
- // Initialize connection statuses
393
- const connectionStatus = await getConnectionStatus();
394
- console.log('Initial connection status:', connectionStatus);
395
-
396
- // Update the main connections state
397
- setConnections(connectionStatus);
398
-
399
- // Convert connections object to status strings
400
- const statuses = {};
401
- Object.keys(connectionStatus).forEach(platform => {
402
- var _connectionStatus$pla;
403
- statuses[platform] = (_connectionStatus$pla = connectionStatus[platform]) !== null && _connectionStatus$pla !== void 0 && _connectionStatus$pla.connected ? 'connected' : 'disconnected';
404
- });
405
- setConnectionStatuses(statuses);
406
-
407
- // Initialize platform toggles based on connection statuses
408
- const toggles = {};
409
- Object.keys(connectionStatus).forEach(platform => {
410
- var _connectionStatus$pla2;
411
- toggles[platform] = ((_connectionStatus$pla2 = connectionStatus[platform]) === null || _connectionStatus$pla2 === void 0 ? void 0 : _connectionStatus$pla2.connected) || false;
412
- });
413
- setPlatformToggles(toggles);
414
- console.log('Connection statuses set:', statuses);
415
- console.log('Platform toggles set:', toggles);
416
- } catch (error) {
417
- console.error('Error loading initial connection status:', error);
418
- // Set empty objects as fallback
419
- setConnections({});
420
- setConnectionStatuses({});
421
- setPlatformToggles({});
422
237
 
423
- // Still set a fallback username even if other loading fails
424
- const fallbackUsername = (user === null || user === void 0 ? void 0 : user.email) || (user === null || user === void 0 ? void 0 : user.name) || `user_${Math.floor(Math.random() * 10000)}`;
425
- setUsername(fallbackUsername);
426
- }
427
- };
428
- const handleClose = () => {
429
- const currentlyCompleting = isCompletingRef.current; // Capture ref's current value
238
+ // Set mounted flag to false
239
+ isMountedRef.current = false;
430
240
 
431
- // Animate out with a luxurious, smooth motion
241
+ // Animate out and then call onClose
432
242
  Animated.timing(slideAnim, {
433
243
  toValue: height,
434
- // Full slide down
435
- useNativeDriver: true,
436
- duration: 500,
437
- // Longer duration for a more elegant exit
438
- easing: Easing.bezier(0.16, 1, 0.3, 1) // Custom bezier curve for a luxurious, smooth exit
244
+ duration: 250,
245
+ useNativeDriver: true
439
246
  }).start(() => {
440
- // Small delay before closing modal to ensure animation completes fully
441
- setTimeout(() => {
442
- setModalVisible(false);
443
- if (!currentlyCompleting) {
444
- // Use the captured value
445
- onClose();
446
- }
447
- // Do NOT reset isCompletingRef.current here. The useEffect watching props.visible is responsible for that.
448
- }, 100);
247
+ // Only call onClose if component is still meant to be mounted
248
+ // This prevents the "User closed onboarding" error
249
+ onClose();
449
250
  });
450
251
  };
451
- const handleConnectPlatform = async platformId => {
452
- // Trigger haptic feedback when connect button is pressed
453
- triggerHaptic(HapticType.BUTTON_PRESS);
454
- setConnectingPlatform(platformId);
252
+ const loadInitialStatus = useCallback(async () => {
455
253
  try {
456
- // Check if the platform has a native SDK
457
- if (hasNativeSDK(platformId)) {
458
- // Use native SDK authentication
459
- setCurrentPlatform(platformId);
460
- const success = await initiateNativeAuth(platformId, username);
461
- if (success) {
462
- // Update connections state
463
- setConnections(prev => ({
464
- ...prev,
465
- [platformId]: {
466
- userName: username,
467
- connected: true
468
- }
469
- }));
470
-
471
- // Update platform toggles
472
- setPlatformToggles(prev => ({
473
- ...prev,
474
- [platformId]: true
475
- }));
476
-
477
- // Update connection statuses
478
- setConnectionStatuses(prev => ({
479
- ...prev,
480
- [platformId]: 'connected'
481
- }));
482
-
483
- // Store the connected platform
484
- await storeConnectedPlatform(platformId);
485
- }
486
- } else {
487
- // For other platforms, use the web OAuth flow
488
- setCurrentPlatform(platformId);
489
- const oauthUrl = await initiateOAuth(platformId, username);
490
- if (oauthUrl) {
491
- setOauthUrl(oauthUrl);
492
- setStep('oauth');
493
- }
494
- }
254
+ console.log('🔄 Loading initial connection status...');
255
+ const status = await getConnectionStatus();
256
+ console.log('✅ Connection status loaded:', status);
257
+ setConnections(status || {});
495
258
  } catch (error) {
496
- console.error(`Error connecting to ${platformId}:`, error);
497
- } finally {
498
- setConnectingPlatform(null);
259
+ console.error('❌ Failed to load connection status:', error);
260
+ // Set empty connections to prevent crashes
261
+ setConnections({});
499
262
  }
500
- };
263
+ }, [getConnectionStatus]);
501
264
  const togglePlatform = useCallback(async platformId => {
502
- // If toggling on, initiate the OAuth flow for the platform
503
265
  if (!platformToggles[platformId]) {
266
+ // Attempt to connect platform
504
267
  try {
505
- // Special case for Instagram which uses the existing flow
506
- if (platformId === 'instagram') {
507
- setPlatformToggles(prev => ({
508
- ...prev,
509
- [platformId]: !prev[platformId]
510
- }));
511
- setConnections(prev => ({
512
- ...prev,
513
- [platformId]: {
514
- userName: `${platformId}_user`,
515
- connected: true
516
- }
517
- }));
518
- // Store the connected platform
519
- await storeConnectedPlatform(platformId);
268
+ setIsConnectingPlatform(true);
269
+ console.log(`🔌 Initiating connection for ${platformId}`);
270
+
271
+ // Test API connectivity first
272
+ console.log('🔍 Testing API connectivity...');
273
+ const connectivityTest = await testApiConnectivity();
274
+ if (!connectivityTest.success) {
275
+ console.error('❌ API connectivity test failed:', connectivityTest.error);
276
+ Alert.alert('Network Error', `${connectivityTest.error}\n\nPlease check your internet connection and try again.`);
520
277
  return;
521
278
  }
279
+ console.log('✅ API connectivity confirmed');
522
280
 
523
- // Check if the platform has a native SDK
524
- if (hasNativeSDK(platformId)) {
525
- // Use native SDK authentication
526
- setCurrentPlatform(platformId);
527
- const success = await initiateNativeAuth(platformId, username);
528
- if (success) {
529
- // Update connections state
530
- setConnections(prev => ({
531
- ...prev,
532
- [platformId]: {
533
- userName: username,
534
- connected: true
535
- }
536
- }));
281
+ // Instagram: Use Opacity SDK exclusively
282
+ if (platformId === 'instagram') {
283
+ // Check if Opacity SDK is available
284
+ if (!opacityInit || !OpacityEnvironment || !opacityGet) {
285
+ console.error('❌ Opacity SDK not available for Instagram');
286
+ throw new Error('Instagram connection requires the Opacity SDK. Please ensure @opacity-labs/react-native-opacity is properly installed and configured.');
287
+ }
288
+ console.log('🔌 Initializing Opacity SDK for Instagram...');
289
+
290
+ // Initialize Opacity SDK with your API key
291
+ const apiKey = 'OsamaTest-7bde2407-7360-462a-86b4-b26d7f890cbb';
292
+ await opacityInit({
293
+ apiKey,
294
+ environment: OpacityEnvironment.Production,
295
+ shouldShowErrorsInWebView: true
296
+ });
297
+ console.log('✅ Opacity SDK initialized successfully');
298
+ console.log('📱 Fetching Instagram profile...');
299
+
300
+ // Fetch Instagram profile using Opacity SDK
301
+ const profile = await opacityGet('flow:instagram:profile');
302
+ if (profile && typeof profile === 'object') {
303
+ console.log('✅ Instagram profile retrieved:', profile);
537
304
 
538
- // Update platform toggles
305
+ // Extract username from profile or use fallback
306
+ const instagramUsername = profile.username || profile.name || username;
307
+
308
+ // Update platform toggle state
539
309
  setPlatformToggles(prev => ({
540
310
  ...prev,
541
311
  [platformId]: true
542
312
  }));
543
313
 
544
- // Store the connected platform
545
- await storeConnectedPlatform(platformId);
314
+ // Update connections state with Instagram data
315
+ setConnections(prev => ({
316
+ ...prev,
317
+ [platformId]: {
318
+ userName: instagramUsername,
319
+ connected: true,
320
+ profileData: profile // Store additional profile data
321
+ }
322
+ }));
323
+ console.log(`✅ Instagram successfully connected for user: ${instagramUsername}`);
324
+ } else {
325
+ throw new Error('Invalid or empty Instagram profile data returned from Opacity SDK');
326
+ }
327
+ } else {
328
+ // For all other platforms (non-Instagram), check if they have native SDK
329
+ if (hasNativeSDK(platformId)) {
330
+ console.log(`📱 Using native SDK for ${platformId}`);
331
+ // Use native SDK for authentication
332
+ const success = await initiateNativeAuth(platformId, username);
333
+ if (success) {
334
+ console.log(`✅ Native authentication successful for ${platformId}`);
335
+ // Update platform toggle state
336
+ setPlatformToggles(prev => ({
337
+ ...prev,
338
+ [platformId]: true
339
+ }));
340
+
341
+ // Update connections state
342
+ setConnections(prev => ({
343
+ ...prev,
344
+ [platformId]: {
345
+ userName: username,
346
+ connected: true
347
+ }
348
+ }));
349
+ } else {
350
+ throw new Error(`Native authentication failed for ${platformId}`);
351
+ }
352
+ } else {
353
+ // Use OAuth WebView flow
354
+ console.log(`🌐 Initiating OAuth flow for ${platformId}`);
355
+ const oauthUrl = await initiateOAuth(platformId, username, AppName);
356
+ if (oauthUrl) {
357
+ console.log(`✅ Received OAuth URL for ${platformId}:`, oauthUrl);
358
+ setCurrentPlatform(platformId);
359
+ setOauthUrl(oauthUrl);
360
+ setStep('oauth');
361
+ } else {
362
+ console.error(`❌ No OAuth URL returned for ${platformId}`);
363
+ throw new Error(`Failed to get authorization URL for ${platformId}. Please try again.`);
364
+ }
546
365
  }
547
- return;
548
- }
549
-
550
- // For other platforms, use the web OAuth flow
551
- setCurrentPlatform(platformId);
552
- const oauthUrl = await initiateOAuth(platformId, username);
553
-
554
- // If oauthUrl is null, it means we should use native SDK (which should have been caught above)
555
- if (oauthUrl) {
556
- setOauthUrl(oauthUrl);
557
- setStep('oauth');
558
366
  }
559
367
  } catch (error) {
560
- console.error(`Error initiating OAuth for ${platformId}:`, error);
561
- // If there's an error, don't toggle the platform
562
- return;
368
+ console.error(`❌ Error connecting ${platformId}:`, error);
369
+
370
+ // Provide user-friendly error messages based on platform
371
+ let errorMessage = 'Unknown error occurred';
372
+ if (error instanceof Error) {
373
+ if (platformId === 'instagram') {
374
+ if (error.message.includes('Initialize')) {
375
+ errorMessage = 'Failed to initialize Instagram connection. Please check your internet connection.';
376
+ } else if (error.message.includes('profile')) {
377
+ errorMessage = 'Unable to retrieve Instagram profile. Please try again or check your Instagram account permissions.';
378
+ } else {
379
+ errorMessage = error.message;
380
+ }
381
+ } else {
382
+ errorMessage = error.message;
383
+ }
384
+ }
385
+ Alert.alert(`${platformId.charAt(0).toUpperCase() + platformId.slice(1)} Connection Failed`, errorMessage, [{
386
+ text: 'OK',
387
+ style: 'default'
388
+ }]);
389
+ } finally {
390
+ setIsConnectingPlatform(false);
563
391
  }
564
392
  } else {
565
- // If toggling off, just update the state
393
+ // Disconnect platform
394
+ console.log(`🔌 Disconnecting ${platformId}`);
566
395
  setPlatformToggles(prev => ({
567
396
  ...prev,
568
- [platformId]: !prev[platformId]
397
+ [platformId]: false
569
398
  }));
570
399
 
571
- // Remove connection
400
+ // Update connections state
572
401
  setConnections(prev => {
573
402
  const newConnections = {
574
403
  ...prev
@@ -577,50 +406,50 @@ export const UniversalOnboarding = ({
577
406
  return newConnections;
578
407
  });
579
408
  }
580
- }, [platformToggles, username]);
409
+ }, [platformToggles, username, AppName]);
581
410
 
582
- /**
583
- * Handles OAuth callback URLs
411
+ /**
412
+ * Handles OAuth callback URLs
584
413
  */
585
414
  const handleOAuthCallback = useCallback(url => {
586
- try {
587
- // Extract the authorization code from the URL
588
- const parsedUrl = new URL(url);
589
- const code = parsedUrl.searchParams.get('code');
590
- const platform = parsedUrl.searchParams.get('platform') || currentPlatform;
591
- if (code && platform) {
592
- // Update connections state
593
- setConnections(prev => ({
594
- ...prev,
595
- [platform]: {
596
- userName: username,
597
- connected: true
598
- }
599
- }));
415
+ console.log('🔗 OAuth callback received:', url);
416
+ const result = handleOAuthCallbackUrl(url);
417
+ if (result.success && result.platform && result.code) {
418
+ console.log(`✅ OAuth successful for ${result.platform}`);
600
419
 
601
- // Update platform toggles
602
- setPlatformToggles(prev => ({
603
- ...prev,
604
- [platform]: true
605
- }));
420
+ // Update connections state
421
+ setConnections(prev => ({
422
+ ...prev,
423
+ [result.platform]: {
424
+ userName: username,
425
+ connected: true
426
+ }
427
+ }));
606
428
 
607
- // Return to the connect step
608
- setStep('connect');
609
- }
610
- } catch (error) {
611
- console.error('Error handling OAuth callback:', error);
429
+ // Update platform toggles
430
+ setPlatformToggles(prev => ({
431
+ ...prev,
432
+ [result.platform]: true
433
+ }));
434
+
435
+ // Close OAuth window and return to connect step
436
+ setOauthUrl('');
437
+ setCurrentPlatform('');
438
+ setStep('connect');
439
+ console.log(`🎉 ${result.platform} successfully connected via OAuth`);
440
+ } else {
441
+ console.error('❌ OAuth callback failed or incomplete');
612
442
  }
613
- }, [currentPlatform, username]);
443
+ }, [username]);
614
444
 
615
- /**
616
- * Handles successful OAuth authentication from the OAuthWebView
445
+ /**
446
+ * Handles completion of the OAuth flow
617
447
  */
618
- const handleOAuthSuccess = useCallback(async code => {
619
- console.log(`🎉 OAuth success for ${currentPlatform} - backend callback completed`);
620
- console.log(`📝 Received result:`, code);
621
- if (currentPlatform) {
622
- console.log(`✅ Updating connection state for ${currentPlatform}`);
448
+ const handleOAuthSuccess = useCallback(code => {
449
+ console.log(`OAuth success for ${currentPlatform} with code: ${code}`);
623
450
 
451
+ // Update connections for the current platform
452
+ if (currentPlatform) {
624
453
  // Update connections state
625
454
  setConnections(prev => ({
626
455
  ...prev,
@@ -635,893 +464,513 @@ export const UniversalOnboarding = ({
635
464
  ...prev,
636
465
  [currentPlatform]: true
637
466
  }));
638
-
639
- // Update connection statuses
640
- setConnectionStatuses(prev => ({
641
- ...prev,
642
- [currentPlatform]: 'connected'
643
- }));
644
-
645
- // Store the connected platform
646
- await storeConnectedPlatform(currentPlatform);
647
- console.log(`💾 ${currentPlatform} connection stored successfully`);
467
+ console.log(`Successfully connected ${currentPlatform} for user ${username}`);
648
468
  }
649
469
 
650
- // Close the OAuth window by returning to the connect step
651
- console.log('🔄 Returning to connect step');
470
+ // Close OAuth window and return to connect step
652
471
  setOauthUrl('');
472
+ setCurrentPlatform('');
653
473
  setStep('connect');
654
- }, [currentPlatform, username, storeConnectedPlatform]);
655
- const handlePinSubmit = useCallback(async userPin => {
656
- setPin(userPin);
474
+ }, [currentPlatform, username]);
475
+
476
+ // Function to check for existing account (spoofed for now)
477
+ const checkExistingAccount = useCallback(async () => {
478
+ console.log('Checking for existing account...');
479
+ // TODO: Implement actual logic to check cookies/storage for existing account
480
+ // For now, this is spoofed and doesn't do anything
481
+ return false;
482
+ }, []);
483
+
484
+ // Function to handle email submission
485
+ const handleEmailSubmit = useCallback(async () => {
486
+ console.log('🚀 handleEmailSubmit called with email:', email);
487
+ console.log('🧪 testMode value:', testMode);
488
+ console.log('🧪 isTestMode computed:', isTestMode);
489
+ try {
490
+ if (!email || !email.trim()) {
491
+ console.log('❌ No email provided');
492
+ Alert.alert('Error', 'Please enter your email address');
493
+ return;
494
+ }
495
+
496
+ // Basic email validation
497
+ const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
498
+ if (!emailRegex.test(email.trim())) {
499
+ console.log('❌ Invalid email format');
500
+ Alert.alert('Error', 'Please enter a valid email address');
501
+ return;
502
+ }
503
+ console.log('📧 Email validation passed, proceeding...');
504
+
505
+ // Check if we should skip API calls entirely (only for specific test scenarios)
506
+ const shouldSkipApiCalls = typeof testMode === 'object' && testMode !== null && testMode.skipApiCalls === true;
507
+ if (shouldSkipApiCalls) {
508
+ console.log('🧪 Test mode with skipApiCalls: true - Skipping API call, proceeding to verification');
509
+ setStep('verify');
510
+ return;
511
+ }
657
512
 
658
- // Store PIN temporarily for training component access
659
- setTemporaryPin(userPin);
660
- console.log('🔐 [PIN SUBMIT] PIN submitted, checking for background training...');
513
+ // Add loading state to prevent multiple submissions
514
+ if (isVerifyingCode) {
515
+ console.log('⚠️ Email verification already in progress');
516
+ return;
517
+ }
518
+ setIsVerifyingCode(true);
519
+ console.log('🔄 Starting email verification process...');
520
+ console.log('📡 Will make API call with testMode flag:', isTestMode);
661
521
 
662
- // NEW: Check if background training is already running
663
- if (isBackgroundTrainingStarted && backgroundSocketId) {
664
- console.log('✅ [PIN SUBMIT] Background training detected, continuing with PIN validation...');
522
+ // Wrap the entire API call in a timeout to prevent hanging
523
+ const timeoutPromise = new Promise((_, reject) => {
524
+ setTimeout(() => reject(new Error('Request timeout')), 10000); // 10 second timeout
525
+ });
526
+ try {
527
+ // Safety check for function availability with detailed debugging
528
+ console.log('🔍 Checking requestEmailVerification function availability...');
529
+ console.log('🔍 Type of requestEmailVerification:', typeof requestEmailVerification);
530
+ console.log('🔍 requestEmailVerification function:', requestEmailVerification);
531
+ if (typeof requestEmailVerification !== 'function') {
532
+ console.error('❌ requestEmailVerification function not available');
533
+ console.error('❌ Available functions from platformAuthService:', {
534
+ requestEmailVerification: typeof requestEmailVerification,
535
+ verifyEmailCode: typeof verifyEmailCode,
536
+ checkEmailVerificationStatus: typeof checkEmailVerificationStatus
537
+ });
538
+ // In development, just proceed anyway
539
+ console.log('🧪 Proceeding without API call in development mode');
540
+ setStep('verify');
541
+ return;
542
+ }
543
+ console.log('✅ requestEmailVerification function is available');
544
+ console.log('🔄 Making API call to requestEmailVerification...');
545
+
546
+ // Race between API call and timeout
547
+ const result = await Promise.race([requestEmailVerification(email.trim(), isTestMode), timeoutPromise]);
548
+ console.log('📡 Email verification API result:', result);
549
+ if (result && result.success) {
550
+ console.log('✅ Verification code requested successfully');
551
+ setStep('verify');
552
+ } else {
553
+ console.warn('⚠️ Email verification request failed, but proceeding anyway:', result);
554
+ // In development mode, proceed even if API fails
555
+ setStep('verify');
556
+ }
557
+ } catch (verificationError) {
558
+ console.error('❌ Error in email verification API call:', verificationError);
559
+ // In development mode, proceed even if API fails
560
+ console.log('🧪 API failed but proceeding to verification step in development mode');
561
+ setStep('verify');
562
+ } finally {
563
+ setIsVerifyingCode(false);
564
+ }
565
+ } catch (error) {
566
+ console.error('❌ Unexpected error in email submission:', error);
567
+ setIsVerifyingCode(false);
665
568
 
666
- // Continue with existing training by sending PIN validation
569
+ // In development mode, still try to proceed
570
+ console.log('🧪 Error occurred but attempting to proceed to verification step');
667
571
  try {
668
- await continueBackgroundTrainingWithPin(userPin);
669
- setStep('persona'); // Move to persona step to show training progress
670
- } catch (error) {
671
- console.error(' [PIN SUBMIT] Failed to continue background training:', error);
672
- // ❌ DISABLED: Don't start new training when PIN is submitted
673
- // Just show persona step with error state
674
- setStep('persona');
675
- setPersonaStatus('Error: Failed to continue training');
676
- setHasError(true);
572
+ setStep('verify');
573
+ } catch (stepError) {
574
+ console.error('❌ Failed to set step to verify:', stepError);
575
+ Alert.alert('Error', 'An unexpected error occurred. Please try again.');
677
576
  }
678
- } else {
679
- console.log('ℹ️ [PIN SUBMIT] No background training detected');
680
- // ❌ DISABLED: Don't start training when PIN is submitted
681
- // Training should only start during connector→PIN transition
682
- setStep('persona');
683
- setPersonaStatus('No training in progress. Please restart the flow.');
684
- setHasError(true);
685
577
  }
686
- console.log('🔐 [PIN SUBMIT] PIN stored securely, moved to persona step');
687
- }, [isBackgroundTrainingStarted, backgroundSocketId]);
578
+ }, [email, isVerifyingCode, debug, testMode, isTestMode]);
688
579
 
689
- // Start real Enoch training via API (restored for backwards compatibility)
690
- const startEnochTraining = async (socketId, authToken) => {
580
+ // Function to handle verification code submission
581
+ const handleVerificationSubmit = useCallback(async () => {
582
+ if (!verificationCode.trim() || verificationCode.trim().length !== 6) {
583
+ Alert.alert('Error', 'Please enter a 6-digit verification code');
584
+ return;
585
+ }
586
+ setIsVerifyingCode(true);
691
587
  try {
692
- setPersonaStatus('Starting training...');
693
- setPersonaProgress(15);
694
-
695
- // Use provided token or get from AsyncStorage to avoid state timing issues
696
- const token = authToken || (await AsyncStorage.getItem('onairos_jwt_token')) || (await AsyncStorage.getItem('auth_token'));
697
- if (!token) {
698
- console.error('❌ No authentication token available');
699
- throw new Error('No authentication token available');
588
+ // Safety check for function availability
589
+ if (typeof verifyEmailCode !== 'function') {
590
+ throw new Error('Email verification service not available');
700
591
  }
701
- console.log('🚀 Starting Enoch training with socketId:', socketId);
702
- console.log('🔑 Using auth token:', token ? `${token.substring(0, 20)}...` : 'None');
703
-
704
- // Get stored Onairos username for API calls
705
- const storedUsername = await getOnairosUsername();
706
- const finalUsername = storedUsername || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.username) || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.name) || username || 'mobile_user';
707
-
708
- // Get connected platforms information
709
- const connectedPlatforms = await AsyncStorage.getItem('connectedPlatforms');
710
- const platformsList = connectedPlatforms ? JSON.parse(connectedPlatforms) : [];
711
- console.log('📱 Connected platforms for training:', platformsList);
712
-
713
- // Get encrypted PIN for training (if available)
714
- const encryptedPin = await getEncryptedPinForAPI().catch(error => {
715
- console.warn('⚠️ Could not get encrypted PIN for training:', error);
716
- return null;
717
- });
718
592
 
719
- // Prepare user data for training - match backend expected format
720
- const trainingData = {
721
- socketId,
722
- username: finalUsername,
723
- email: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.email) || null,
724
- modelKey: null,
725
- connectedPlatforms: platformsList,
726
- platformConnections: connections,
727
- ...(encryptedPin && {
728
- encryptedPin: encryptedPin,
729
- hasPinData: true
730
- })
731
- };
732
- console.log('📤 Sending training data to /mobile-training/enoch:', trainingData);
733
-
734
- // Use the new training function that includes YouTube migration check
735
- const result = await startEnochTrainingWithYouTubeCheck(trainingData);
736
- console.log('📡 Training API response:', result);
737
-
738
- // Handle CONNECTIONS_REQUIRED scenario (pre-training validation)
739
- if (result.requiresConnections || result.code === 'CONNECTIONS_REQUIRED') {
740
- console.log('🔗 Connections required detected from HTTP response');
741
- setDataScenario('CONNECTIONS_REQUIRED');
742
- setDataDetails(result);
743
- setShowDataWarning(true);
744
- setPersonaStatus('Connections required');
745
- setHasError(true);
746
- stopDotsAnimation();
747
- return;
593
+ // Test Mode: Use specific flows
594
+ if (isTestMode) {
595
+ console.log('🧪 Test mode verification - simulating success');
596
+ if (isExistingUserFlow) {
597
+ // Flow 1: Existing User Data Request Close (return API URL)
598
+ console.log('🧪 Test Flow 1: Existing User → Show Data Request');
599
+ setIsExistingUser(true);
600
+ setStep('dataRequest');
601
+ return;
602
+ } else if (isNewUserFlow) {
603
+ // Flow 2: New User → Platform Connect → PIN → Training
604
+ console.log('🧪 Test Flow 2: New User → Platform Connect');
605
+ const emailPrefix = email.trim().split('@')[0] || 'TestUser';
606
+ setUsername(emailPrefix);
607
+ setStep('connect');
608
+ return;
609
+ }
748
610
  }
611
+
612
+ // Real API call (production) or test mode
613
+ const result = await verifyEmailCode(email.trim(), verificationCode.trim(), isTestMode);
749
614
  if (result.success) {
750
- console.log('🚀 Training Started:', result.message);
751
- console.log('🎯 Training Features:', result.features);
752
-
753
- // Log the new features from the spec
754
- if (result.features) {
755
- console.log('✅ Inference enabled:', result.features.inference);
756
- console.log('💾 Storage method:', result.features.storage);
757
- console.log('🔒 Compression enabled:', result.features.compression);
758
- console.log('🔐 Encryption enabled:', result.features.encryption);
759
- console.log('📊 Training type:', result.features.type);
760
- console.log('🗄️ Databases:', result.features.databases);
761
- console.log('📈 Query scores enabled:', result.features.queryScores);
615
+ console.log(' Email verification successful');
616
+
617
+ // Check if user exists in backend (properly typed now)
618
+ const existingUser = result.existingUser || false;
619
+ setIsExistingUser(existingUser);
620
+ if (existingUser) {
621
+ console.log('👤 Existing user detected, showing data request screen');
622
+ setStep('dataRequest');
623
+ } else {
624
+ console.log('🆕 New user, proceeding to platform connection');
625
+ // Safely set username from email prefix
626
+ try {
627
+ const emailPrefix = email.trim().split('@')[0];
628
+ if (emailPrefix && emailPrefix.length > 0) {
629
+ setUsername(emailPrefix);
630
+ } else {
631
+ setUsername('User'); // Fallback username
632
+ }
633
+ } catch (usernameError) {
634
+ console.warn('Failed to extract username from email, using fallback:', usernameError);
635
+ setUsername('User');
636
+ }
637
+ setStep('connect');
762
638
  }
763
- setPersonaStatus('Training model...');
764
- setPersonaProgress(25);
765
639
  } else {
766
- console.error(' Training start failed:', result.error);
767
- setPersonaStatus(`Error: ${result.error || 'Training failed to start'}`);
768
- setHasError(true);
769
- stopDotsAnimation();
640
+ Alert.alert('Verification Failed', result.error || 'Invalid verification code');
770
641
  }
771
642
  } catch (error) {
772
- console.error('❌ Training start error:', error);
773
- setPersonaStatus(`Error: ${error instanceof Error ? error.message : 'Unknown error'}`);
774
- setHasError(true);
775
- stopDotsAnimation();
643
+ console.error('❌ Error verifying code:', error);
644
+ Alert.alert('Error', 'Failed to verify code');
645
+ } finally {
646
+ setIsVerifyingCode(false);
776
647
  }
777
- };
648
+ }, [email, verificationCode]);
649
+ const handlePinSubmit = useCallback(async userPin => {
650
+ setPin(userPin);
651
+ setStep('training');
778
652
 
779
- // NEW: Continue background training with PIN validation
780
- const continueBackgroundTrainingWithPin = async userPin => {
653
+ // Save session data for "Never Connect Again" functionality
781
654
  try {
782
- console.log('🔐 [BACKGROUND] Continuing existing background training with PIN validation');
783
- console.log('🔑 Using auth token:', `${userToken === null || userToken === void 0 ? void 0 : userToken.substring(0, 20)}...`);
784
-
785
- // Check if we have a valid socket ID
786
- if (!backgroundSocketId) {
787
- throw new Error('No background socket ID available');
788
- }
655
+ const sessionData = {
656
+ pin: userPin,
657
+ connections,
658
+ platformToggles,
659
+ selectedTier,
660
+ username,
661
+ timestamp: Date.now(),
662
+ appName: AppName,
663
+ inferenceData: auto ? inferenceData : undefined,
664
+ partner
665
+ };
789
666
 
790
- // REMOVED: Don't send new training signal - training already started!
791
- // We should just validate the PIN with the existing training, not start new training
667
+ // Store session data in secure storage for future use
668
+ console.log('Saving session data for future "Never Connect Again" functionality:', sessionData);
792
669
 
793
- console.log('🔐 [BACKGROUND] PIN validation - continuing with existing training session');
794
- console.log('🔌 [BACKGROUND] Using existing socket ID:', backgroundSocketId);
670
+ // TODO: Implement actual secure storage of session data
671
+ // This would typically involve:
672
+ // 1. Storing encrypted session data locally
673
+ // 2. Setting cookies in WebView for onairos.uk domain
674
+ // 3. Storing authentication tokens securely
795
675
 
796
- // Just log that we're continuing - the existing training should handle PIN internally
797
- console.log(' [BACKGROUND] PIN submitted for existing training session');
676
+ // For now, we'll simulate this with console logging
677
+ console.log('Session data saved - future apps will detect existing account');
798
678
  } catch (error) {
799
- console.error('❌ [BACKGROUND] Failed to continue background training:', error);
800
- throw error;
679
+ console.error('Failed to save session data:', error);
801
680
  }
802
- };
681
+ }, [connections, selectedTier, platformToggles, username, AppName, auto, inferenceData, partner]);
682
+ const handleTrainingComplete = useCallback(async () => {
683
+ console.log('🎉 Training completed successfully');
684
+ console.log('🔍 Auto mode enabled:', auto);
685
+ console.log('🔍 Inference data available:', !!inferenceData);
686
+ try {
687
+ if (auto && inferenceData) {
688
+ console.log('🤖 Auto mode: Making API request to get URL and perform inference');
803
689
 
804
- // Replace fake persona creation with real training setup
805
- const startPersonaCreation = async () => {
806
- setPersonaProgress(0);
807
- setPersonaStatus('Initializing');
808
- setIsPersonaComplete(false);
809
- setHasError(false);
690
+ // First, get the API URL from backend
691
+ const apiUrlResponse = await fetch('https://api2.onairos.uk/', {
692
+ method: 'POST',
693
+ headers: {
694
+ 'Content-Type': 'application/json'
695
+ },
696
+ body: JSON.stringify({
697
+ Info: {
698
+ storage: 'secure',
699
+ appId: AppName,
700
+ confirmations: Object.keys(requestData || {}),
701
+ EncryptedUserPin: pin,
702
+ // Use the actual PIN from user
703
+ account: email.trim(),
704
+ proofMode: false
705
+ }
706
+ })
707
+ });
708
+ if (!apiUrlResponse.ok) {
709
+ throw new Error(`Failed to get API URL: ${apiUrlResponse.status}`);
710
+ }
711
+ const {
712
+ apiUrl,
713
+ token
714
+ } = await apiUrlResponse.json();
715
+ console.log('✅ Received API URL:', apiUrl);
716
+ console.log('✅ Received token:', (token === null || token === void 0 ? void 0 : token.substring(0, 20)) + '...');
717
+
718
+ // Now make the inference call with the provided data
719
+ const inferenceResponse = await fetch(apiUrl, {
720
+ method: 'POST',
721
+ headers: {
722
+ 'Content-Type': 'application/json',
723
+ 'Authorization': `Bearer ${token}`
724
+ },
725
+ body: JSON.stringify({
726
+ ...inferenceData,
727
+ userEmail: email.trim(),
728
+ appName: AppName,
729
+ timestamp: new Date().toISOString()
730
+ })
731
+ });
732
+ if (!inferenceResponse.ok) {
733
+ throw new Error(`Inference API failed: ${inferenceResponse.status}`);
734
+ }
735
+ const inferenceResults = await inferenceResponse.json();
736
+ console.log('✅ Auto mode inference results:', inferenceResults);
810
737
 
811
- // Start the dots animation
812
- startDotsAnimation();
813
- try {
814
- var _user$email4;
815
- console.log('🚀 Starting persona creation...');
816
-
817
- // Ensure we have a valid authentication token before starting
818
- console.log('🔐 Step 1: Ensuring authentication token...');
819
- const authToken = await ensureAuthToken();
820
- if (!authToken) {
821
- throw new Error('Failed to create or retrieve authentication token');
822
- }
738
+ // Close the modal first
739
+ handleClose();
823
740
 
824
- // Set the token in state
825
- setUserToken(authToken);
826
- console.log('✅ Authentication token set in state:', `${authToken.substring(0, 20)}...`);
827
- console.log('🔍 Token length:', authToken.length);
828
-
829
- // Also verify it was stored properly
830
- const storedToken = await AsyncStorage.getItem('onairos_jwt_token');
831
- console.log('🔑 Token stored verification:', storedToken ? `${storedToken.substring(0, 20)}...` : 'Not stored');
832
-
833
- // If userInfo is not set, try to reload it
834
- if (!userInfo) {
835
- var _user$email3;
836
- console.log('🔄 UserInfo not available, attempting to reload...');
837
- const storedUsername = await getOnairosUsername();
838
- const fallbackUsername = storedUsername || (user === null || user === void 0 || (_user$email3 = user.email) === null || _user$email3 === void 0 ? void 0 : _user$email3.split('@')[0]) || (user === null || user === void 0 ? void 0 : user.name) || 'mobile_user';
839
- const newUserInfo = {
840
- username: fallbackUsername,
841
- email: (user === null || user === void 0 ? void 0 : user.email) || null,
842
- id: null
741
+ // Complete onboarding with inference results
742
+ setTimeout(() => {
743
+ onComplete(apiUrl, token, {
744
+ pin,
745
+ connections,
746
+ platformToggles,
747
+ selectedTier,
748
+ tierData: requestData === null || requestData === void 0 ? void 0 : requestData[selectedTier],
749
+ sessionSaved: true,
750
+ // Add inference data if auto mode is enabled
751
+ ...(auto && inferenceData && {
752
+ inferenceData
753
+ }),
754
+ // Add partner info for special partners
755
+ ...(partner && {
756
+ partner: partner === 'couplebible' ? 'CoupleBible' : partner
757
+ }),
758
+ autoMode: true,
759
+ inferenceResults,
760
+ apiUrl,
761
+ token
762
+ });
763
+ }, 100);
764
+ } else {
765
+ console.log('📋 Standard mode: Returning API URL for manual use');
766
+
767
+ // Prepare completion data
768
+ const completionData = {
769
+ pin,
770
+ connections,
771
+ platformToggles,
772
+ selectedTier,
773
+ tierData: requestData === null || requestData === void 0 ? void 0 : requestData[selectedTier],
774
+ sessionSaved: true,
775
+ // Add inference data if auto mode is enabled
776
+ ...(auto && inferenceData && {
777
+ inferenceData
778
+ }),
779
+ // Add partner info for special partners
780
+ ...(partner && {
781
+ partner: partner === 'couplebible' ? 'CoupleBible' : partner
782
+ }),
783
+ autoMode: false
843
784
  };
844
- setUserInfo(newUserInfo);
845
- setUsername(fallbackUsername);
846
- console.log('🧑‍💻 Set user info:', newUserInfo);
785
+ console.log('Completion data prepared:', completionData);
847
786
 
848
- // Give a moment for state to update
849
- await new Promise(resolve => setTimeout(() => resolve(), 200));
850
- }
787
+ // Close the modal first
788
+ handleClose();
851
789
 
852
- // Check again after potential reload
853
- const currentUserInfo = userInfo || {
854
- username: username || (user === null || user === void 0 || (_user$email4 = user.email) === null || _user$email4 === void 0 ? void 0 : _user$email4.split('@')[0]) || (user === null || user === void 0 ? void 0 : user.name) || 'mobile_user',
855
- email: (user === null || user === void 0 ? void 0 : user.email) || null,
856
- id: null
857
- };
858
- if (!authToken) {
859
- console.error('❌ No authentication token available after ensureAuthToken');
860
- throw new Error('No authentication token available');
790
+ // Then call the completion callback
791
+ setTimeout(() => {
792
+ onComplete('https://api2.onairos.uk', 'dummy-token', completionData);
793
+ }, 100);
861
794
  }
862
- console.log('🔧 Setting up socket connection for real training...');
863
- console.log('🧑‍💻 User info available:', currentUserInfo);
864
- console.log('🔑 Token available:', !!authToken);
865
- console.log('🌐 Attempting to connect to: https://api2.onairos.uk');
866
- console.log('📱 Device platform:', Platform.OS);
867
- console.log('🔗 Network connectivity check starting...');
868
- setPersonaStatus('Connecting');
869
- setPersonaProgress(5);
870
-
871
- // Initialize socket connection with enhanced configuration
872
- socketRef.current = io('https://api2.onairos.uk', {
873
- transports: ['websocket', 'polling'],
874
- // Add polling as fallback
875
- autoConnect: false,
876
- timeout: 15000,
877
- // Increase timeout to 15 seconds
878
- reconnection: true,
879
- // Enable reconnection with limits
880
- reconnectionAttempts: 3,
881
- reconnectionDelay: 1000,
882
- forceNew: true // Force a new connection
883
- });
884
- console.log('🔌 Socket instance created:', {
885
- connected: socketRef.current.connected,
886
- id: socketRef.current.id,
887
- disconnected: socketRef.current.disconnected
888
- });
889
-
890
- // Socket event listeners with enhanced error handling
891
- socketRef.current.on('connect', () => {
892
- var _socketRef$current, _socketRef$current2, _socketRef$current3, _socketRef$current4;
893
- console.log('✅ Socket connected for training');
894
- console.log('🔌 Socket connection details:', {
895
- id: (_socketRef$current = socketRef.current) === null || _socketRef$current === void 0 ? void 0 : _socketRef$current.id,
896
- connected: (_socketRef$current2 = socketRef.current) === null || _socketRef$current2 === void 0 ? void 0 : _socketRef$current2.connected,
897
- transport: (_socketRef$current3 = socketRef.current) === null || _socketRef$current3 === void 0 || (_socketRef$current3 = _socketRef$current3.io) === null || _socketRef$current3 === void 0 || (_socketRef$current3 = _socketRef$current3.engine) === null || _socketRef$current3 === void 0 || (_socketRef$current3 = _socketRef$current3.transport) === null || _socketRef$current3 === void 0 ? void 0 : _socketRef$current3.name
898
- });
899
- setSocketConnected(true);
900
- setPersonaStatus('Starting training');
901
- setPersonaProgress(10);
902
- const socketId = (_socketRef$current4 = socketRef.current) === null || _socketRef$current4 === void 0 ? void 0 : _socketRef$current4.id;
903
- console.log('🔌 Socket ID for training:', socketId);
904
- if (socketId) {
905
- // Add a small delay to ensure socket is fully ready and registered on backend
906
- console.log('🔄 Socket ready for persona display with token:', authToken ? `${authToken.substring(0, 20)}...` : 'None');
907
- console.log('⏰ Socket registered but training will not start from persona screen...');
908
- // ❌ DISABLED: Don't start training from persona screen
909
- // Training should only start during connector→PIN transition
910
- // setTimeout(() => {
911
- // console.log('🚀 Now starting training with socket ID:', socketId);
912
- // startEnochTraining(socketId, authToken);
913
- // }, 2000);
914
-
915
- // Just show the persona screen without starting training
916
- setPersonaStatus('Waiting for training to start from connector→PIN transition');
917
- } else {
918
- console.error('❌ No socket ID available after connection');
919
- setPersonaStatus('Connection error. Please try again.');
920
- setHasError(true);
921
- stopDotsAnimation();
922
- }
923
- });
924
- socketRef.current.on('disconnect', reason => {
925
- var _socketRef$current5;
926
- console.log('❌ Socket disconnected, reason:', reason);
927
- console.log('🔍 Disconnect details:', {
928
- reason: reason,
929
- wasConnected: socketConnected,
930
- socketId: (_socketRef$current5 = socketRef.current) === null || _socketRef$current5 === void 0 ? void 0 : _socketRef$current5.id
931
- });
932
- setSocketConnected(false);
933
- });
934
- socketRef.current.on('reconnect', attemptNumber => {
935
- console.log('🔄 Socket reconnected after', attemptNumber, 'attempts');
936
- setSocketConnected(true);
937
- });
938
- socketRef.current.on('reconnect_attempt', attemptNumber => {
939
- console.log('🔄 Socket reconnection attempt:', attemptNumber);
940
- setPersonaStatus(`Reconnecting... (${attemptNumber}/3)`);
941
- });
942
- socketRef.current.on('reconnect_error', error => {
943
- console.error('❌ Socket reconnection error:', error);
944
- });
945
- socketRef.current.on('reconnect_failed', () => {
946
- console.error('❌ Socket reconnection failed after all attempts');
947
- setPersonaStatus('Connection failed. Please try again.');
948
- setHasError(true);
949
- stopDotsAnimation();
950
- });
951
- socketRef.current.on('connect_error', error => {
952
- console.error('❌ Socket connection error:', error);
953
- console.error('❌ Socket error details:', {
954
- message: error.message,
955
- name: error.name,
956
- stack: error.stack,
957
- errorObject: error
958
- });
959
- setPersonaStatus('Connection error. Please try again.');
960
- setHasError(true);
961
- stopDotsAnimation();
962
- });
963
- socketRef.current.on('trainingCompleted', data => {
964
- console.log('✅ Training Complete:', data);
965
- setPersonaStatus('Running test inference');
966
- setPersonaProgress(60);
967
- });
968
- socketRef.current.on('inferenceCompleted', data => {
969
- console.log('🧠 Inference Complete:', data);
970
- setPersonaStatus('Uploading to S3');
971
- setPersonaProgress(80);
972
- setUserTraits(data.traits);
973
- setInferenceResults(data.inferenceResults);
974
- });
975
- socketRef.current.on('modelStandby', data => {
976
- console.log('🎉 All Complete:', data);
977
-
978
- // Log completion details based on new spec
979
- if (data.completed) {
980
- console.log('✅ Training completed:', data.message);
981
- console.log('💾 Storage method:', data.storage);
982
- console.log('🔐 Encryption enabled:', data.encryption);
983
- console.log('🧠 Inference enabled:', data.inference);
984
-
985
- // Log database info for Enoch mode
986
- if (data.databases && Array.isArray(data.databases)) {
987
- console.log('🗄️ Databases used:', data.databases.join(', '));
988
- }
989
-
990
- // Log testing mode
991
- if (data.testing) {
992
- console.log('🧪 Testing mode enabled');
993
- }
994
- }
995
- setIsPersonaComplete(true);
996
- setPersonaStatus('Complete!');
997
- setPersonaProgress(100);
998
- stopDotsAnimation();
999
- });
1000
- socketRef.current.on('trainingUpdate', data => {
1001
- console.log('📊 Training update:', data);
1002
-
1003
- // Handle YouTube token expiry
1004
- if (data.error && data.error.includes('YouTube access token has expired')) {
1005
- console.log('🔄 YouTube token expired, triggering reconnection...');
1006
- setDataScenario(null);
1007
- setShowDataWarning(false);
1008
- setPersonaStatus('YouTube token expired - reconnecting...');
1009
-
1010
- // Try to refresh tokens first before full reconnection
1011
- setTimeout(async () => {
1012
- try {
1013
- // Import the refresh function
1014
- const {
1015
- refreshYouTubeTokens
1016
- } = await import('../services/platformAuthService');
1017
- console.log('🔄 Attempting to refresh YouTube tokens...');
1018
- const refreshSuccess = await refreshYouTubeTokens();
1019
- if (refreshSuccess) {
1020
- console.log('✅ YouTube tokens refreshed, but training restart disabled');
1021
- setPersonaStatus('YouTube tokens refreshed - but training only starts from connector→PIN');
1022
-
1023
- // ❌ DISABLED: Don't restart training from persona screen
1024
- // Training should only start during connector→PIN transition
1025
- // if (socketRef.current?.id) {
1026
- // startEnochTraining(socketRef.current.id, userToken ?? undefined);
1027
- // }
1028
-
1029
- setHasError(true); // Show error so user can restart flow properly
1030
- } else {
1031
- console.log('❌ Token refresh failed, attempting full reconnection...');
1032
- setPersonaStatus('Token refresh failed - please restart from connector screen');
1033
-
1034
- // ❌ DISABLED: Don't restart training from persona screen
1035
- // Fall back to full reconnection
1036
- try {
1037
- await handleConnectPlatform('youtube');
1038
- console.log('✅ YouTube reconnected, but training restart disabled');
1039
- setPersonaStatus('YouTube reconnected - please restart from connector screen');
1040
-
1041
- // ❌ DISABLED: Don't restart training from persona screen
1042
- // Training should only start during connector→PIN transition
1043
- // if (socketRef.current?.id) {
1044
- // startEnochTraining(socketRef.current.id, userToken ?? undefined);
1045
- // }
1046
-
1047
- setHasError(true); // Show error so user can restart flow properly
1048
- } catch (reconnectError) {
1049
- console.error('❌ YouTube reconnection failed:', reconnectError);
1050
- setPersonaStatus('YouTube reconnection failed. Please restart from connector screen.');
1051
- setHasError(true);
1052
- stopDotsAnimation();
1053
- }
1054
- }
1055
- } catch (error) {
1056
- console.error('❌ YouTube token refresh/reconnection error:', error);
1057
- setPersonaStatus('YouTube connection failed. Please try again.');
1058
- setHasError(true);
1059
- stopDotsAnimation();
1060
- }
1061
- }, 1000);
1062
- return;
1063
- }
1064
-
1065
- // Handle connections required scenario (pre-training validation)
1066
- if (data.requiresConnections || data.code === 'CONNECTIONS_REQUIRED') {
1067
- console.log('🔗 Connections required detected from socket');
1068
- setDataScenario('CONNECTIONS_REQUIRED');
1069
- setDataDetails(data);
1070
- setShowDataWarning(true);
1071
- setPersonaStatus('Connections required');
1072
- setHasError(true);
1073
- stopDotsAnimation();
1074
- return;
1075
- }
1076
-
1077
- // Handle data scenario responses
1078
- if (data.code === 'NO_DATA') {
1079
- console.log('🚫 No data scenario detected');
1080
- setDataScenario('NO_DATA');
1081
- setDataDetails(data.details);
1082
- setShowDataWarning(true);
1083
- setPersonaStatus('No interaction data found');
1084
- setHasError(true);
1085
- stopDotsAnimation();
1086
- return;
1087
- }
1088
- if (data.code === 'LIMITED_DATA') {
1089
- console.log('ℹ️ Limited data scenario detected');
1090
- setDataScenario('LIMITED_DATA');
1091
- setDataDetails(data.details);
1092
- setShowDataWarning(true);
1093
- setPersonaStatus('Creating your persona with available data');
1094
- // Don't set hasError - training continues
1095
- return;
1096
- }
1097
-
1098
- // Handle regular training updates
1099
- if (data.error) {
1100
- console.error('❌ Training update error:', data.error);
1101
- setPersonaStatus(`Error: ${data.error}`);
1102
- setHasError(true);
1103
- stopDotsAnimation();
1104
- } else if (data.progress) {
1105
- setPersonaProgress(data.progress);
1106
- setPersonaStatus(data.status || 'Training in progress');
1107
- // Clear data warning if training progresses normally
1108
- if (showDataWarning && data.progress > 30) {
1109
- setShowDataWarning(false);
1110
- }
1111
- }
1112
- });
1113
-
1114
- // Connect to socket with timeout
1115
- console.log('🔌 Attempting to connect to socket...');
1116
- console.log('🔌 Socket config:', {
1117
- url: 'https://api2.onairos.uk',
1118
- transports: ['websocket'],
1119
- autoConnect: false,
1120
- timeout: 10000,
1121
- reconnection: false
1122
- });
1123
- socketRef.current.connect();
1124
- console.log('🔌 Socket connect() called - waiting for connection...');
1125
-
1126
- // Add immediate state check
1127
- setTimeout(() => {
1128
- var _socketRef$current6, _socketRef$current7, _socketRef$current8, _socketRef$current9;
1129
- console.log('🔍 Socket state after 1 second:', {
1130
- connected: (_socketRef$current6 = socketRef.current) === null || _socketRef$current6 === void 0 ? void 0 : _socketRef$current6.connected,
1131
- disconnected: (_socketRef$current7 = socketRef.current) === null || _socketRef$current7 === void 0 ? void 0 : _socketRef$current7.disconnected,
1132
- id: (_socketRef$current8 = socketRef.current) === null || _socketRef$current8 === void 0 ? void 0 : _socketRef$current8.id,
1133
- engineConnected: (_socketRef$current9 = socketRef.current) === null || _socketRef$current9 === void 0 || (_socketRef$current9 = _socketRef$current9.io) === null || _socketRef$current9 === void 0 || (_socketRef$current9 = _socketRef$current9.engine) === null || _socketRef$current9 === void 0 ? void 0 : _socketRef$current9.readyState
1134
- });
1135
- }, 1000);
1136
- setTimeout(() => {
1137
- var _socketRef$current0, _socketRef$current1, _socketRef$current10, _socketRef$current11;
1138
- console.log('🔍 Socket state after 5 seconds:', {
1139
- connected: (_socketRef$current0 = socketRef.current) === null || _socketRef$current0 === void 0 ? void 0 : _socketRef$current0.connected,
1140
- disconnected: (_socketRef$current1 = socketRef.current) === null || _socketRef$current1 === void 0 ? void 0 : _socketRef$current1.disconnected,
1141
- id: (_socketRef$current10 = socketRef.current) === null || _socketRef$current10 === void 0 ? void 0 : _socketRef$current10.id,
1142
- engineConnected: (_socketRef$current11 = socketRef.current) === null || _socketRef$current11 === void 0 || (_socketRef$current11 = _socketRef$current11.io) === null || _socketRef$current11 === void 0 || (_socketRef$current11 = _socketRef$current11.engine) === null || _socketRef$current11 === void 0 ? void 0 : _socketRef$current11.readyState
1143
- });
1144
- }, 5000);
1145
-
1146
- // Set a timeout for socket connection with enhanced fallback
1147
- setTimeout(() => {
1148
- if (!socketConnected && socketRef.current && !socketRef.current.connected) {
1149
- console.error('❌ Socket connection timeout after 20 seconds');
1150
- console.error('🔍 Socket state:', {
1151
- connected: socketRef.current.connected,
1152
- disconnected: socketRef.current.disconnected,
1153
- id: socketRef.current.id
1154
- });
1155
- setPersonaStatus('Connection timeout. Please check your internet and try again.');
1156
- setHasError(true);
1157
- stopDotsAnimation();
1158
-
1159
- // Cleanup socket
1160
- if (socketRef.current) {
1161
- socketRef.current.disconnect();
1162
- socketRef.current = null;
1163
- }
1164
- }
1165
- }, 20000); // Increased timeout to 20 seconds
1166
795
  } catch (error) {
1167
- console.error('❌ Error in startPersonaCreation:', error);
1168
- setPersonaStatus('Failed to initialize training. Please try again.');
1169
- setHasError(true);
1170
- stopDotsAnimation();
1171
- }
1172
- };
1173
-
1174
- // Get user-friendly status message based on progress (updated for real training)
1175
- const getPersonaStatusMessage = progress => {
1176
- if (hasError) return 'Something went wrong. Please try again.';
1177
- if (isPersonaComplete) return 'Your persona is ready! 🎉';
1178
- let baseMessage = '';
1179
- if (progress < 20) {
1180
- baseMessage = 'Keeping your data private';
1181
- } else if (progress < 40) {
1182
- baseMessage = 'Trying to understand your mind';
1183
- } else if (progress < 60) {
1184
- baseMessage = 'You\'re more interesting than I expected';
1185
- } else if (progress < 80) {
1186
- baseMessage = 'Finalizing your unique persona';
1187
- } else if (progress < 95) {
1188
- baseMessage = 'Almost done';
1189
- } else {
1190
- baseMessage = 'Just a few more seconds';
1191
- }
1192
- return baseMessage + animatedDots;
1193
- };
796
+ console.error('❌ Error in training complete:', error);
797
+
798
+ // Fallback to standard mode
799
+ const completionData = {
800
+ pin,
801
+ connections,
802
+ platformToggles,
803
+ selectedTier,
804
+ tierData: requestData === null || requestData === void 0 ? void 0 : requestData[selectedTier],
805
+ sessionSaved: true,
806
+ // Add inference data if auto mode is enabled
807
+ ...(auto && inferenceData && {
808
+ inferenceData
809
+ }),
810
+ // Add partner info for special partners
811
+ ...(partner && {
812
+ partner: partner === 'couplebible' ? 'CoupleBible' : partner
813
+ }),
814
+ autoMode: false,
815
+ error: error instanceof Error ? error.message : 'Unknown error'
816
+ };
817
+ console.log('Fallback completion data:', completionData);
1194
818
 
1195
- // Handle persona completion - now continues the onboarding flow instead of going to separate training
1196
- const handlePersonaComplete = async () => {
1197
- console.log('🎉 Real persona creation completed successfully');
1198
- // Cleanup socket connection
1199
- if (socketRef.current) {
1200
- console.log('🔌 Disconnecting training socket...');
1201
- socketRef.current.disconnect();
1202
- socketRef.current = null;
1203
- }
1204
- // Clear temporary PIN since training is complete
1205
- clearTemporaryPin();
1206
- // Set the completion flag BEFORE calling onComplete
1207
- isCompletingRef.current = true;
819
+ // Close the modal first
820
+ handleClose();
1208
821
 
1209
- // Get the real authentication token instead of using placeholder
1210
- try {
1211
- const realToken = (await AsyncStorage.getItem('onairos_jwt_token')) || (await AsyncStorage.getItem('enoch_token')) || (await AsyncStorage.getItem('auth_token'));
1212
- if (realToken) {
1213
- console.log('✅ Using real authentication token for onComplete:', `${realToken.substring(0, 30)}...`);
1214
- // Call onComplete with the REAL token that was created during ensureAuthToken
1215
- onComplete === null || onComplete === void 0 || onComplete('https://api2.onairos.uk', realToken, {
1216
- email: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.email) || '',
1217
- ...userInfo
1218
- });
1219
- } else {
1220
- console.error('❌ No real authentication token found after training completion');
1221
- // Fallback to placeholder token if no real token exists
1222
- onComplete === null || onComplete === void 0 || onComplete('https://api2.onairos.uk', 'training-complete-token', {
1223
- email: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.email) || '',
1224
- ...userInfo
1225
- });
1226
- }
1227
- } catch (error) {
1228
- console.error('❌ Error retrieving real token for onComplete:', error);
1229
- // Fallback to placeholder token on error
1230
- onComplete === null || onComplete === void 0 || onComplete('https://api2.onairos.uk', 'training-complete-token', {
1231
- email: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.email) || '',
1232
- ...userInfo
1233
- });
822
+ // Then call the completion callback
823
+ setTimeout(() => {
824
+ onComplete('https://api2.onairos.uk', 'dummy-token', completionData);
825
+ }, 100);
1234
826
  }
1235
- };
1236
-
1237
- // Ensure authentication token exists before training
1238
- const ensureAuthToken = async () => {
827
+ }, [pin, connections, platformToggles, selectedTier, requestData, auto, inferenceData, partner, handleClose, onComplete, AppName, email]);
828
+ const handleDataRequestAccept = useCallback(async () => {
829
+ console.log('Data request accepted for existing user');
830
+ console.log('🔍 Auto mode enabled:', auto);
831
+ console.log('🔍 Inference data available:', !!inferenceData);
1239
832
  try {
1240
- var _user$name, _onairosResponseData$;
1241
- // Check if we already have an authentication token (prioritize Enoch-specific tokens)
1242
- let existingToken = (await AsyncStorage.getItem('onairos_jwt_token')) || (await AsyncStorage.getItem('enoch_token')) || (await AsyncStorage.getItem('auth_token'));
1243
- if (existingToken && existingToken.trim().length > 20) {
1244
- console.log('✅ Authentication token already exists:', `${existingToken.substring(0, 20)}...`);
1245
- console.log('🔍 Token length:', existingToken.length);
1246
- console.log('🔍 Token format check:', existingToken.includes('.') ? 'Looks like JWT' : 'Not JWT format');
1247
- return existingToken;
1248
- }
1249
- console.log('🔐 Creating Enoch authentication token for universal onboarding...');
1250
-
1251
- // Create user accounts and get proper Enoch token
1252
- const fallbackEmail = (user === null || user === void 0 ? void 0 : user.email) || `${username || 'user'}@onairos.temp`;
1253
- const fallbackUsername = username || (user === null || user === void 0 || (_user$name = user.name) === null || _user$name === void 0 ? void 0 : _user$name.split('@')[0]) || 'mobile_user';
1254
- console.log('🔐 Using credentials:', {
1255
- email: fallbackEmail,
1256
- username: fallbackUsername
1257
- });
833
+ if (auto && inferenceData) {
834
+ console.log('🤖 Auto mode: Making API request to get URL and perform inference');
1258
835
 
1259
- // Step 1: Create Enoch user first
1260
- console.log('🔐 Step 1: Creating Enoch user...');
1261
- try {
1262
- const enochRegisterResponse = await fetch('https://api2.onairos.uk/enoch/users/register', {
836
+ // First, get the API URL from backend
837
+ const apiUrlResponse = await fetch('https://api2.onairos.uk/', {
1263
838
  method: 'POST',
1264
839
  headers: {
1265
840
  'Content-Type': 'application/json'
1266
841
  },
1267
842
  body: JSON.stringify({
1268
- email: fallbackEmail,
1269
- name: fallbackUsername,
1270
- photoUrl: ''
843
+ Info: {
844
+ storage: 'secure',
845
+ // or whatever storage type
846
+ appId: AppName,
847
+ confirmations: Object.keys(requestData || {}),
848
+ EncryptedUserPin: 'temp-pin',
849
+ // This would come from user PIN in real flow
850
+ account: email.trim(),
851
+ proofMode: false
852
+ }
1271
853
  })
1272
854
  });
1273
- console.log('📡 Enoch register response status:', enochRegisterResponse.status);
1274
- const enochResponseData = await enochRegisterResponse.json();
1275
- console.log('🔗 Enoch user creation response:', enochResponseData);
1276
- } catch (enochError) {
1277
- console.warn('⚠️ Enoch user creation failed (continuing):', enochError);
1278
- }
1279
-
1280
- // Step 2: Create Onairos account to get JWT token (this is the critical step)
1281
- console.log('🔐 Step 2: Creating Onairos account...');
1282
- const onairosSignupResponse = await fetch('https://api2.onairos.uk/register/enoch', {
1283
- method: 'POST',
1284
- headers: {
1285
- 'Content-Type': 'application/json'
1286
- },
1287
- body: JSON.stringify({
1288
- email: fallbackEmail,
1289
- username: fallbackUsername,
1290
- name: fallbackUsername
1291
- })
1292
- });
1293
- console.log('📡 Onairos register response status:', onairosSignupResponse.status);
1294
- if (!onairosSignupResponse.ok) {
1295
- const errorText = await onairosSignupResponse.text();
1296
- console.error('❌ Onairos signup failed:', errorText);
1297
- throw new Error(`Onairos signup failed: ${onairosSignupResponse.status} ${errorText}`);
1298
- }
1299
- const onairosResponseData = await onairosSignupResponse.json();
1300
- console.log('🔗 Onairos account creation response:', onairosResponseData);
1301
-
1302
- // Extract the token from the response
1303
- let authToken = null;
1304
- if (onairosResponseData.token) {
1305
- authToken = onairosResponseData.token;
1306
- } else if ((_onairosResponseData$ = onairosResponseData.data) !== null && _onairosResponseData$ !== void 0 && _onairosResponseData$.token) {
1307
- authToken = onairosResponseData.data.token;
1308
- } else if (onairosResponseData.jwt) {
1309
- authToken = onairosResponseData.jwt;
1310
- }
1311
- if (!authToken) {
1312
- console.error('❌ No token found in response:', onairosResponseData);
1313
- throw new Error('No authentication token returned from server');
1314
- }
1315
-
1316
- // Validate the token format
1317
- if (typeof authToken !== 'string' || authToken.length < 20) {
1318
- console.error('❌ Invalid token format:', authToken);
1319
- throw new Error('Invalid token format received');
1320
- }
1321
-
1322
- // Check if it looks like a JWT
1323
- const jwtParts = authToken.split('.');
1324
- if (jwtParts.length !== 3) {
1325
- console.warn('⚠️ Token does not appear to be a valid JWT:', `${authToken.substring(0, 20)}...`);
855
+ if (!apiUrlResponse.ok) {
856
+ throw new Error(`Failed to get API URL: ${apiUrlResponse.status}`);
857
+ }
858
+ const {
859
+ apiUrl,
860
+ token
861
+ } = await apiUrlResponse.json();
862
+ console.log('✅ Received API URL:', apiUrl);
863
+ console.log(' Received token:', (token === null || token === void 0 ? void 0 : token.substring(0, 20)) + '...');
864
+
865
+ // Now make the inference call with the provided data
866
+ const inferenceResponse = await fetch(apiUrl, {
867
+ method: 'POST',
868
+ headers: {
869
+ 'Content-Type': 'application/json',
870
+ 'Authorization': `Bearer ${token}`
871
+ },
872
+ body: JSON.stringify({
873
+ ...inferenceData,
874
+ userEmail: email.trim(),
875
+ appName: AppName,
876
+ timestamp: new Date().toISOString()
877
+ })
878
+ });
879
+ if (!inferenceResponse.ok) {
880
+ throw new Error(`Inference API failed: ${inferenceResponse.status}`);
881
+ }
882
+ const inferenceResults = await inferenceResponse.json();
883
+ console.log('✅ Auto mode inference results:', inferenceResults);
884
+
885
+ // Complete onboarding with inference results
886
+ onComplete(apiUrl, token, {
887
+ existingAccount: true,
888
+ email: email.trim(),
889
+ dataRequestAccepted: true,
890
+ requestData,
891
+ autoMode: true,
892
+ inferenceResults,
893
+ apiUrl,
894
+ token
895
+ });
1326
896
  } else {
1327
- console.log(' Token appears to be a valid JWT format');
897
+ console.log('📋 Standard mode: Returning API URL for manual use');
898
+
899
+ // Standard mode: just return the API URL
900
+ onComplete('https://api2.onairos.uk', 'existing-session-token', {
901
+ existingAccount: true,
902
+ email: email.trim(),
903
+ dataRequestAccepted: true,
904
+ requestData,
905
+ autoMode: false
906
+ });
1328
907
  }
1329
-
1330
- // Store the token in multiple locations for maximum compatibility
1331
- await AsyncStorage.setItem('onairos_jwt_token', authToken);
1332
- await AsyncStorage.setItem('auth_token', authToken);
1333
- await AsyncStorage.setItem('enoch_token', authToken);
1334
- await AsyncStorage.setItem('onairos_username', onairosResponseData.username || fallbackUsername);
1335
- console.log('✅ Successfully stored authentication tokens');
1336
- console.log('🔑 Token preview:', `${authToken.substring(0, 20)}...`);
1337
- console.log('🔑 Token length:', authToken.length);
1338
- console.log('👤 Username stored:', onairosResponseData.username || fallbackUsername);
1339
- return authToken;
1340
908
  } catch (error) {
1341
- console.error('❌ Error ensuring authentication token:', error);
1342
- throw error;
1343
- }
1344
- };
1345
- const canProceed = Object.values(platformToggles).some(value => value);
1346
- const handleProceed = () => {
1347
- if (canProceed) {
1348
- // Trigger haptic feedback when continue button is pressed
1349
- triggerHaptic(HapticType.BUTTON_PRESS);
1350
-
1351
- // ✅ NEW: Start background training when transitioning from connectors to PIN screen
1352
- console.log('🚀 [TRANSITION] Starting background training during connect → pin transition');
1353
- startBackgroundTraining().catch(error => {
1354
- console.error('❌ [TRANSITION] Background training failed during transition:', error);
1355
- // Continue to PIN screen even if training fails
909
+ console.error('❌ Error in data request accept:', error);
910
+
911
+ // Fallback to standard mode
912
+ onComplete('https://api2.onairos.uk', 'existing-session-token', {
913
+ existingAccount: true,
914
+ email: email.trim(),
915
+ dataRequestAccepted: true,
916
+ requestData,
917
+ autoMode: false,
918
+ error: error instanceof Error ? error.message : 'Unknown error'
1356
919
  });
1357
- setStep('pin');
1358
920
  }
1359
- };
1360
- const handleReviewerBypass = () => {
1361
- console.log('Reviewer bypass activated');
1362
-
1363
- // Set the completion flag BEFORE calling onComplete
1364
- isCompletingRef.current = true;
1365
-
1366
- // Call onComplete with a special reviewer token that the parent can recognize
1367
- onComplete === null || onComplete === void 0 || onComplete('https://api2.onairos.uk', 'reviewer-bypass-token', {
1368
- email: 'reviewer@apple.com'
1369
- });
1370
- };
1371
-
1372
- // Removed navigation dependency for SDK compatibility
1373
-
1374
- // Training is now handled by the TrainingModal component
1375
-
1376
- // ✅ NEW: Background training function - starts when PIN screen appears
1377
- const startBackgroundTraining = useCallback(async () => {
1378
- try {
1379
- console.log('🚀 [BACKGROUND] Starting background training optimization...');
1380
- setBackgroundTrainingProgress('Connecting...');
1381
-
1382
- // Step 1: Ensure authentication token exists
1383
- const authToken = await ensureAuthToken();
1384
- if (!authToken) {
1385
- throw new Error('Failed to create authentication token for background training');
1386
- }
1387
- console.log('✅ [BACKGROUND] Auth token ready:', `${authToken.substring(0, 20)}...`);
1388
- setUserToken(authToken);
1389
-
1390
- // Step 2: Set up user info if not available
1391
- if (!userInfo) {
1392
- var _user$email5;
1393
- const storedUsername = await getOnairosUsername();
1394
- const fallbackUsername = storedUsername || (user === null || user === void 0 || (_user$email5 = user.email) === null || _user$email5 === void 0 ? void 0 : _user$email5.split('@')[0]) || (user === null || user === void 0 ? void 0 : user.name) || 'mobile_user';
1395
- const newUserInfo = {
1396
- username: fallbackUsername,
1397
- email: (user === null || user === void 0 ? void 0 : user.email) || null,
1398
- id: null
1399
- };
1400
- setUserInfo(newUserInfo);
1401
- setUsername(fallbackUsername);
1402
- console.log('🧑‍💻 [BACKGROUND] User info set:', newUserInfo);
1403
- }
1404
-
1405
- // Step 3: Initialize socket connection for background training
1406
- console.log('🔌 [BACKGROUND] Setting up socket for background training...');
1407
- setBackgroundTrainingProgress('Initializing data collection...');
1408
- const backgroundSocket = io('https://api2.onairos.uk', {
1409
- transports: ['websocket', 'polling'],
1410
- autoConnect: false,
1411
- timeout: 15000,
1412
- reconnection: true,
1413
- reconnectionAttempts: 3,
1414
- reconnectionDelay: 1000,
1415
- forceNew: true
1416
- });
921
+ }, [email, onComplete, requestData, auto, inferenceData, AppName]);
922
+ const handleDataRequestDecline = useCallback(() => {
923
+ console.log('Data request declined');
924
+ handleClose();
925
+ }, [handleClose]);
926
+ const canProceedToPin = useCallback(() => {
927
+ // Test mode: Always allow proceeding (simulates platform connections)
928
+ if (isTestMode || testModeOptions.skipRealConnections) {
929
+ console.log('🧪 Test mode: Allowing proceed without real platform connections');
930
+ return true;
931
+ }
1417
932
 
1418
- // Set up socket event listeners for background training
1419
- backgroundSocket.on('connect', async () => {
1420
- console.log('✅ [BACKGROUND] Socket connected, starting background data collection...');
1421
- const socketId = backgroundSocket.id;
1422
- setBackgroundSocketId(socketId || null);
1423
- setBackgroundTrainingProgress('Collecting your data...');
1424
- if (socketId) {
1425
- // Step 4: Start background training WITHOUT PIN (per backend instructions)
1426
- await startBackgroundEnochTraining(socketId, authToken);
1427
- }
1428
- });
1429
- backgroundSocket.on('trainingUpdate', data => {
1430
- if (data.progress) {
1431
- setBackgroundTrainingProgress(data.status || 'Processing...');
1432
- console.log('📊 [BACKGROUND] Training progress:', data.progress, '%');
1433
- }
1434
- });
1435
- backgroundSocket.on('disconnect', () => {
1436
- console.log('❌ [BACKGROUND] Socket disconnected');
1437
- });
933
+ // Production: Check if at least one platform is connected
934
+ const hasPlatformConnected = Object.values(platformToggles).some(value => value === true);
1438
935
 
1439
- // Store socket reference for later use
1440
- socketRef.current = backgroundSocket;
936
+ // Auto mode validation
937
+ if (auto && partner !== 'couplebible' && !inferenceData) {
938
+ console.warn('Auto mode enabled but no inference data provided (and partner is not couplebible)');
939
+ return false;
940
+ }
941
+ return hasPlatformConnected;
942
+ }, [platformToggles, auto, partner, inferenceData, isTestMode, testModeOptions]);
943
+ const handleProceed = () => {
944
+ console.log('Proceeding to next step');
945
+ // Show success screen first
946
+ setStep('success');
1441
947
 
1442
- // Connect the socket to start background training
1443
- backgroundSocket.connect();
1444
- console.log('✅ [BACKGROUND] Background training initiated successfully');
1445
- } catch (error) {
1446
- console.error('❌ [BACKGROUND] Background training failed:', error);
1447
- setBackgroundTrainingProgress('');
1448
- throw error;
948
+ // Clear any existing timeout
949
+ if (successTimeoutRef.current) {
950
+ clearTimeout(successTimeoutRef.current);
1449
951
  }
1450
- }, [userInfo, username, user]);
1451
952
 
1452
- // NEW: Background training API call - starts data collection without PIN
1453
- const startBackgroundEnochTraining = async (socketId, authToken) => {
1454
- try {
1455
- console.log('🚀 [BACKGROUND] Starting background training with socketId:', socketId);
1456
- console.log('🔑 Using auth token:', `${authToken.substring(0, 20)}...`);
1457
-
1458
- // Prepare background training data
1459
- const backgroundData = {
1460
- socketId,
1461
- username: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.username) || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.name) || username || 'mobile_user',
1462
- email: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.email) || null,
1463
- modelKey: null,
1464
- connectedPlatforms: [],
1465
- // No connected platforms for background training
1466
- platformConnections: {} // No platform connections for background training
1467
- // No encrypted PIN for background training
1468
- };
1469
- console.log('📤 Sending background training data to /mobile-training/enoch:', backgroundData);
1470
-
1471
- // Use the new training function that includes YouTube migration check
1472
- const backgroundResult = await startEnochTrainingWithYouTubeCheck(backgroundData);
1473
- console.log('📡 Background training API response:', backgroundResult);
1474
-
1475
- // Handle CONNECTIONS_REQUIRED scenario (pre-training validation)
1476
- if (backgroundResult.requiresConnections || backgroundResult.code === 'CONNECTIONS_REQUIRED') {
1477
- console.log('🔗 Connections required detected from background training');
1478
- setDataScenario('CONNECTIONS_REQUIRED');
1479
- setDataDetails(backgroundResult);
1480
- setShowDataWarning(true);
1481
- setPersonaStatus('Connections required');
1482
- setHasError(true);
1483
- stopDotsAnimation();
1484
- return;
1485
- }
1486
- if (backgroundResult.success) {
1487
- console.log('🚀 Background training started:', backgroundResult.message);
1488
- console.log('🎯 Background training Features:', backgroundResult.features);
1489
-
1490
- // ✅ CRITICAL: Set background training started flag
1491
- setIsBackgroundTrainingStarted(true);
1492
-
1493
- // Log the new features from the spec
1494
- if (backgroundResult.features) {
1495
- console.log('✅ Inference enabled:', backgroundResult.features.inference);
1496
- console.log('💾 Storage method:', backgroundResult.features.storage);
1497
- console.log('🔒 Compression enabled:', backgroundResult.features.compression);
1498
- console.log('🔐 Encryption enabled:', backgroundResult.features.encryption);
1499
- console.log('📊 Training type:', backgroundResult.features.type);
1500
- console.log('🗄️ Databases:', backgroundResult.features.databases);
1501
- console.log('📈 Query scores enabled:', backgroundResult.features.queryScores);
1502
- }
1503
- setPersonaStatus('Background training model...');
1504
- setPersonaProgress(25);
1505
- } else {
1506
- console.error('❌ Background training start failed:', backgroundResult.error);
1507
- setPersonaStatus(`Error: ${backgroundResult.error || 'Background training failed to start'}`);
1508
- setHasError(true);
1509
- stopDotsAnimation();
953
+ // After a delay, proceed to PIN
954
+ successTimeoutRef.current = setTimeout(() => {
955
+ // Only proceed if component is still mounted and visible
956
+ if (isMountedRef.current && visible) {
957
+ setStep('pin');
1510
958
  }
1511
- } catch (error) {
1512
- console.error('❌ Background training start error:', error);
1513
- setPersonaStatus(`Error: ${error instanceof Error ? error.message : 'Unknown error'}`);
1514
- setHasError(true);
1515
- stopDotsAnimation();
1516
- }
959
+ successTimeoutRef.current = null;
960
+ }, 3000);
1517
961
  };
1518
962
  return /*#__PURE__*/React.createElement(Modal, {
963
+ visible: visible,
1519
964
  transparent: true,
1520
- visible: modalVisible,
1521
965
  animationType: "none",
966
+ statusBarTranslucent: true,
1522
967
  onRequestClose: handleClose
968
+ }, /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
969
+ onPress: handleClose
1523
970
  }, /*#__PURE__*/React.createElement(View, {
1524
971
  style: styles.modalOverlay
972
+ }, /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
973
+ onPress: e => e.stopPropagation()
1525
974
  }, /*#__PURE__*/React.createElement(Animated.View, {
1526
975
  style: [styles.bottomSheet, {
1527
976
  transform: [{
@@ -1532,313 +981,214 @@ export const UniversalOnboarding = ({
1532
981
  style: styles.container
1533
982
  }, /*#__PURE__*/React.createElement(View, {
1534
983
  style: styles.handleContainer
1535
- }, /*#__PURE__*/React.createElement(TouchableOpacity, {
1536
- onPress: handleClose,
1537
- style: styles.handleButton
1538
984
  }, /*#__PURE__*/React.createElement(View, {
1539
985
  style: styles.handle
1540
- }))), step === 'connect' && /*#__PURE__*/React.createElement(View, {
1541
- style: styles.connectContainer
986
+ })), step === 'email' && /*#__PURE__*/React.createElement(View, {
987
+ style: styles.emailInputContainer
988
+ }, /*#__PURE__*/React.createElement(View, {
989
+ style: styles.emailHeader
990
+ }, /*#__PURE__*/React.createElement(View, {
991
+ style: styles.onairosIcon
992
+ }, /*#__PURE__*/React.createElement(Image, {
993
+ source: require('../assets/images/onairos_logo.png'),
994
+ style: styles.onairosLogo,
995
+ resizeMode: "contain"
996
+ })), /*#__PURE__*/React.createElement(Text, {
997
+ style: styles.emailTitle
998
+ }, "Welcome to Onairos"), /*#__PURE__*/React.createElement(Text, {
999
+ style: styles.emailSubtitle
1000
+ }, "Enter your email to get started")), /*#__PURE__*/React.createElement(View, {
1001
+ style: styles.emailInputSection
1002
+ }, /*#__PURE__*/React.createElement(TextInput, {
1003
+ style: styles.emailInput,
1004
+ value: email,
1005
+ onChangeText: setEmail,
1006
+ placeholder: "Enter your email address",
1007
+ keyboardType: "email-address",
1008
+ autoCapitalize: "none",
1009
+ autoCorrect: false,
1010
+ autoFocus: true
1011
+ }), /*#__PURE__*/React.createElement(TouchableOpacity, {
1012
+ style: [styles.emailSubmitButton, !email.trim() && styles.emailSubmitButtonDisabled],
1013
+ onPress: handleEmailSubmit,
1014
+ disabled: !email.trim()
1015
+ }, /*#__PURE__*/React.createElement(Text, {
1016
+ style: styles.emailSubmitButtonText
1017
+ }, "Continue")))), step === 'verify' && /*#__PURE__*/React.createElement(View, {
1018
+ style: styles.emailInputContainer
1542
1019
  }, /*#__PURE__*/React.createElement(View, {
1020
+ style: styles.emailHeader
1021
+ }, /*#__PURE__*/React.createElement(View, {
1022
+ style: styles.onairosIcon
1023
+ }, /*#__PURE__*/React.createElement(Image, {
1024
+ source: require('../assets/images/onairos_logo.png'),
1025
+ style: styles.onairosLogo,
1026
+ resizeMode: "contain"
1027
+ })), /*#__PURE__*/React.createElement(Text, {
1028
+ style: styles.emailTitle
1029
+ }, "Enter Verification Code"), /*#__PURE__*/React.createElement(Text, {
1030
+ style: styles.emailSubtitle
1031
+ }, "We've sent a 6-digit code to ", email), isTestMode && /*#__PURE__*/React.createElement(Text, {
1032
+ style: styles.developmentNote
1033
+ }, "\uD83D\uDD0D Test Mode: Any 6-digit code will work")), /*#__PURE__*/React.createElement(View, {
1034
+ style: styles.emailInputSection
1035
+ }, /*#__PURE__*/React.createElement(View, {
1036
+ style: styles.codeInputContainer
1037
+ }, [0, 1, 2, 3, 4, 5].map(index => /*#__PURE__*/React.createElement(TextInput, {
1038
+ key: index,
1039
+ ref: ref => codeInputRefs.current[index] = ref,
1040
+ style: [styles.codeDigit, verificationCode.length === index && styles.codeDigitActive],
1041
+ value: verificationCode[index] || '',
1042
+ onChangeText: text => {
1043
+ if (text.length <= 1 && /^\d*$/.test(text)) {
1044
+ const newCode = verificationCode.split('');
1045
+ newCode[index] = text;
1046
+ const updatedCode = newCode.join('').slice(0, 6);
1047
+ setVerificationCode(updatedCode);
1048
+
1049
+ // Auto-focus next input
1050
+ if (text && index < 5) {
1051
+ var _codeInputRefs$curren;
1052
+ (_codeInputRefs$curren = codeInputRefs.current[index + 1]) === null || _codeInputRefs$curren === void 0 || _codeInputRefs$curren.focus();
1053
+ }
1054
+ }
1055
+ },
1056
+ onKeyPress: ({
1057
+ nativeEvent
1058
+ }) => {
1059
+ // Handle backspace to move to previous input
1060
+ if (nativeEvent.key === 'Backspace' && !verificationCode[index] && index > 0) {
1061
+ var _codeInputRefs$curren2;
1062
+ (_codeInputRefs$curren2 = codeInputRefs.current[index - 1]) === null || _codeInputRefs$curren2 === void 0 || _codeInputRefs$curren2.focus();
1063
+ }
1064
+ },
1065
+ keyboardType: "number-pad",
1066
+ maxLength: 1,
1067
+ textAlign: "center",
1068
+ autoFocus: index === 0
1069
+ }))), /*#__PURE__*/React.createElement(TouchableOpacity, {
1070
+ style: [styles.emailSubmitButton, (verificationCode.length !== 6 || isVerifyingCode) && styles.emailSubmitButtonDisabled],
1071
+ onPress: handleVerificationSubmit,
1072
+ disabled: verificationCode.length !== 6 || isVerifyingCode
1073
+ }, isVerifyingCode ? /*#__PURE__*/React.createElement(ActivityIndicator, {
1074
+ size: "small",
1075
+ color: "#fff"
1076
+ }) : /*#__PURE__*/React.createElement(Text, {
1077
+ style: styles.emailSubmitButtonText
1078
+ }, "Verify")), /*#__PURE__*/React.createElement(TouchableOpacity, {
1079
+ style: styles.backButton,
1080
+ onPress: () => setStep('email')
1081
+ }, /*#__PURE__*/React.createElement(Text, {
1082
+ style: styles.backButtonText
1083
+ }, "\u2190 Back to email")))), step === 'connect' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
1543
1084
  style: styles.header
1544
1085
  }, /*#__PURE__*/React.createElement(View, {
1545
1086
  style: styles.headerContent
1546
1087
  }, /*#__PURE__*/React.createElement(View, {
1547
- style: styles.appIcon
1548
- }, /*#__PURE__*/React.createElement(Text, {
1549
- style: styles.appIconText
1550
- }, "O")), /*#__PURE__*/React.createElement(Text, {
1551
- style: styles.arrow
1552
- }, "\u2192"), /*#__PURE__*/React.createElement(View, {
1553
1088
  style: styles.onairosIcon
1554
1089
  }, /*#__PURE__*/React.createElement(Image, {
1555
- source: require('../assets/images/Enochicon1.png'),
1556
- style: styles.onairosIconImage,
1090
+ source: require('../assets/images/onairos_logo.png'),
1091
+ style: styles.onairosLogo,
1092
+ resizeMode: "contain"
1093
+ })), /*#__PURE__*/React.createElement(Icon, {
1094
+ name: "arrow-forward",
1095
+ size: 24,
1096
+ color: "#666",
1097
+ style: styles.arrow
1098
+ }), /*#__PURE__*/React.createElement(View, {
1099
+ style: styles.appIcon
1100
+ }, appIcon ? /*#__PURE__*/React.createElement(Image, {
1101
+ source: appIcon,
1102
+ style: styles.appIconImage,
1557
1103
  resizeMode: "contain"
1558
- }))), /*#__PURE__*/React.createElement(View, {
1104
+ }) : /*#__PURE__*/React.createElement(Text, {
1105
+ style: styles.appIconText
1106
+ }, AppName.charAt(0))))), /*#__PURE__*/React.createElement(ScrollView, {
1107
+ style: styles.content,
1108
+ contentContainerStyle: styles.scrollContent,
1109
+ showsVerticalScrollIndicator: true,
1110
+ bounces: true,
1111
+ scrollEnabled: true,
1112
+ nestedScrollEnabled: true,
1113
+ keyboardShouldPersistTaps: "handled"
1114
+ }, /*#__PURE__*/React.createElement(View, {
1559
1115
  style: styles.titleContainer
1560
1116
  }, /*#__PURE__*/React.createElement(Text, {
1561
1117
  style: styles.mainTitle
1562
- }, isExistingUser ? 'Add More Data to Enoch' : 'Connect your platforms to Enoch via Onairos'), /*#__PURE__*/React.createElement(Text, {
1118
+ }, "Let ", AppName, " learn about you from your data and apps"), /*#__PURE__*/React.createElement(Text, {
1563
1119
  style: styles.privacyMessage
1564
- }, isExistingUser ? 'Connect additional accounts to enhance your digital personality. Your privacy is ensured.' : 'Connect one account to get started. Each additional connection improves your match quality. Your privacy is ensured.', ' ', /*#__PURE__*/React.createElement(Text, {
1565
- style: styles.privacyLink,
1566
- onPress: () => setStep('privacy')
1567
- }, "How it's used \u2192")), isExistingUser && existingUserInfo && /*#__PURE__*/React.createElement(View, {
1568
- style: styles.existingUserBanner
1569
- }, /*#__PURE__*/React.createElement(Text, {
1570
- style: styles.existingUserText
1571
- }, "\u2705 You already have ", ((_existingUserInfo$exi = existingUserInfo.existingUserData) === null || _existingUserInfo$exi === void 0 || (_existingUserInfo$exi = _existingUserInfo$exi.summary) === null || _existingUserInfo$exi === void 0 ? void 0 : _existingUserInfo$exi.connectionsCount) || 0, " connections"), /*#__PURE__*/React.createElement(Text, {
1572
- style: styles.existingUserSubtext
1573
- }, "Add more platforms to get even better insights")), connectionStatuses['linkedin'] === 'connected' && Object.values(connectionStatuses).filter(status => status === 'connected').length === 1 && /*#__PURE__*/React.createElement(View, {
1574
- style: styles.linkedinRequirementContainer
1575
- }, /*#__PURE__*/React.createElement(Text, {
1576
- style: styles.linkedinRequirementText
1577
- }, /*#__PURE__*/React.createElement(Text, {
1578
- style: styles.linkedinRequirementAsterisk
1579
- }, "*"), /*#__PURE__*/React.createElement(Text, {
1580
- style: styles.linkedinRequirementMessage
1581
- }, " LinkedIn requires pairing with an additional platform for optimal results"))))), /*#__PURE__*/React.createElement(View, {
1582
- style: {
1583
- height: 1,
1584
- backgroundColor: '#CCCCCC',
1585
- width: '100%',
1586
- marginVertical: 0
1587
- }
1588
- }), /*#__PURE__*/React.createElement(ScrollView, {
1589
- ref: scrollViewRef,
1590
- style: styles.platformsScrollView,
1591
- contentContainerStyle: styles.platformsScrollContent,
1592
- showsVerticalScrollIndicator: true,
1593
- bounces: true,
1594
- alwaysBounceVertical: true,
1595
- indicatorStyle: "black",
1596
- scrollEventThrottle: 16,
1597
- directionalLockEnabled: true,
1598
- keyboardShouldPersistTaps: "handled",
1599
- decelerationRate: "normal",
1600
- contentOffset: {
1601
- x: 0,
1602
- y: 60
1603
- }
1604
- }, /*#__PURE__*/React.createElement(View, {
1120
+ }, "None of your app data is shared with ANYONE"), (debug || testMode) && /*#__PURE__*/React.createElement(Text, {
1121
+ style: styles.developmentNote
1122
+ }, "\uD83E\uDDEA Test Mode: You can proceed without connecting any platforms")), /*#__PURE__*/React.createElement(View, {
1605
1123
  style: styles.platformsContainer
1606
- }, primaryAuthOnly ?
1607
- /*#__PURE__*/
1608
- // Only show email option when primaryAuthOnly is true
1609
- React.createElement(View, {
1610
- style: styles.platformItem
1124
+ }, platformsToDisplay.map(platform => /*#__PURE__*/React.createElement(TouchableOpacity, {
1125
+ key: platform.id,
1126
+ style: styles.platformItem,
1127
+ onPress: () => togglePlatform(platform.id),
1128
+ disabled: isConnectingPlatform
1611
1129
  }, /*#__PURE__*/React.createElement(View, {
1612
1130
  style: styles.platformInfo
1613
- }, /*#__PURE__*/React.createElement(View, {
1614
- style: [styles.platformIcon, {
1615
- backgroundColor: '#4285F4'
1616
- }]
1617
- }, /*#__PURE__*/React.createElement(Text, {
1618
- style: styles.platformIconText
1619
- }, "@")), /*#__PURE__*/React.createElement(Text, {
1131
+ }, /*#__PURE__*/React.createElement(Image, {
1132
+ source: platform.icon,
1133
+ style: styles.platformIcon,
1134
+ resizeMode: "contain"
1135
+ }), /*#__PURE__*/React.createElement(Text, {
1620
1136
  style: styles.platformName
1621
- }, "Email")), /*#__PURE__*/React.createElement(TouchableOpacity, {
1622
- onPress: async () => {
1623
- // Trigger haptic feedback when sign in button is pressed
1624
- triggerHaptic(HapticType.BUTTON_PRESS);
1625
-
1626
- // Mark email as connected for primaryAuth flow
1627
- setConnections(prev => ({
1628
- ...prev,
1629
- email: {
1630
- userName: email || 'user@example.com',
1631
- connected: true
1632
- }
1633
- }));
1634
- setConnectionStatuses(prev => ({
1635
- ...prev,
1636
- email: 'connected'
1637
- }));
1638
- setPlatformToggles(prev => ({
1639
- ...prev,
1640
- email: true
1641
- }));
1642
-
1643
- // Store the connected platform
1644
- await storeConnectedPlatform('email');
1645
- setStep('connections');
1646
- },
1647
- style: [styles.footerButtonConfirm, {
1648
- paddingVertical: 8,
1649
- paddingHorizontal: 16
1650
- }]
1137
+ }, platform.name)), isConnectingPlatform && currentPlatform === platform.id ? /*#__PURE__*/React.createElement(ActivityIndicator, {
1138
+ size: "small",
1139
+ color: COLORS.primary
1140
+ }) : /*#__PURE__*/React.createElement(View, {
1141
+ style: [styles.platformToggle, platformToggles[platform.id] && styles.platformToggleActive]
1142
+ }, /*#__PURE__*/React.createElement(View, {
1143
+ style: [styles.platformToggleThumb, platformToggles[platform.id] && styles.platformToggleThumbActive]
1144
+ })))), additionalPlatforms.length > 0 && /*#__PURE__*/React.createElement(TouchableOpacity, {
1145
+ style: styles.expandButton,
1146
+ onPress: () => setShowAllPlatforms(!showAllPlatforms)
1147
+ }, /*#__PURE__*/React.createElement(Icon, {
1148
+ name: showAllPlatforms ? "expand_less" : "add",
1149
+ size: 24,
1150
+ color: COLORS.primary
1151
+ }), /*#__PURE__*/React.createElement(Text, {
1152
+ style: styles.expandButtonText
1153
+ }, showAllPlatforms ? "Show Less" : `${additionalPlatforms.length} More Connectors`))), showTestControls && /*#__PURE__*/React.createElement(View, {
1154
+ style: styles.testModeContainer
1651
1155
  }, /*#__PURE__*/React.createElement(Text, {
1652
- style: styles.footerButtonTextConfirm
1653
- }, "Sign in"))) :
1654
- /*#__PURE__*/
1655
- // Show main platforms first
1656
- React.createElement(React.Fragment, null, mainPlatforms.map(platform => {
1657
- const isConnected = connectionStatuses[platform.id] === 'connected';
1658
- const isPlatformConnecting = connectingPlatform === platform.id;
1659
- return /*#__PURE__*/React.createElement(View, {
1660
- key: platform.id,
1661
- style: styles.platformItem
1662
- }, /*#__PURE__*/React.createElement(View, {
1663
- style: styles.platformInfo
1664
- }, platform.id === 'linkedin' ?
1665
- /*#__PURE__*/
1666
- // Use square container for LinkedIn
1667
- React.createElement(View, {
1668
- style: [styles.linkedinPlatformIcon, {
1669
- backgroundColor: platform.color
1670
- }]
1671
- }, /*#__PURE__*/React.createElement(Image, {
1672
- source: getPlatformIcon(platform.id),
1673
- style: styles.platformIconImage,
1674
- resizeMode: "contain"
1675
- })) : platform.id === 'pinterest' ?
1676
- /*#__PURE__*/
1677
- // Use smaller circular container for Pinterest
1678
- React.createElement(View, {
1679
- style: [styles.pinterestPlatformIcon, {
1680
- backgroundColor: platform.color
1681
- }]
1682
- }, /*#__PURE__*/React.createElement(Image, {
1683
- source: getPlatformIcon(platform.id),
1684
- style: styles.pinterestIconImage,
1685
- resizeMode: "contain"
1686
- })) : /*#__PURE__*/React.createElement(View, {
1687
- style: [styles.platformIcon, {
1688
- backgroundColor: platform.color
1689
- }]
1690
- }, /*#__PURE__*/React.createElement(Image, {
1691
- source: getPlatformIcon(platform.id),
1692
- style: platform.id === 'youtube' ? styles.youtubeIconImage : styles.platformIconImage,
1693
- resizeMode: "contain"
1694
- })), /*#__PURE__*/React.createElement(Text, {
1695
- style: styles.platformName
1696
- }, platform.name, platform.id === 'linkedin' && connectionStatuses['linkedin'] === 'connected' && Object.values(connectionStatuses).filter(status => status === 'connected').length === 1 && /*#__PURE__*/React.createElement(Text, {
1697
- style: styles.asterisk
1698
- }, "*"))), /*#__PURE__*/React.createElement(TouchableOpacity, {
1699
- onPress: () => {
1700
- if (isConnected) {
1701
- // Handle disconnect
1702
- handleDisconnectPlatform(platform.id, platform.name);
1703
- } else {
1704
- // Handle connect
1705
- handleConnectPlatform(platform.id);
1706
- }
1707
- },
1708
- onLongPress: platform.id === 'youtube' ? () => {
1709
- // Start a timer for haptic feedback at 2 seconds
1710
- const hapticTimer = setTimeout(() => {
1711
- // Provide haptic feedback
1712
- Vibration.vibrate(100);
1713
- }, 2000);
1714
-
1715
- // Start a timer for 4 seconds for the bypass
1716
- const bypassTimer = setTimeout(() => {
1717
- handleReviewerBypass();
1718
- }, 4000);
1719
-
1720
- // Store the timer
1721
- setLongPressTimer(bypassTimer);
1722
- } : undefined,
1723
- onPressOut: platform.id === 'youtube' ? () => {
1724
- // Clear the timer if the press is released before 4 seconds
1725
- if (longPressTimer) {
1726
- clearTimeout(longPressTimer);
1727
- setLongPressTimer(null);
1728
- }
1729
- } : undefined,
1730
- style: [isConnected ? styles.footerButtonConnected : styles.footerButtonConfirm, {
1731
- paddingVertical: 8,
1732
- paddingHorizontal: 16
1733
- }],
1734
- disabled: isPlatformConnecting
1735
- }, isPlatformConnecting ? /*#__PURE__*/React.createElement(ActivityIndicator, {
1736
- size: "small",
1737
- color: "#fff"
1738
- }) : /*#__PURE__*/React.createElement(Text, {
1739
- style: isConnected ? styles.footerButtonTextConnected : styles.footerButtonTextConfirm
1740
- }, isConnected ? 'Connected' : 'Connect')));
1741
- }), /*#__PURE__*/React.createElement(TouchableOpacity, {
1742
- style: styles.additionalPlatformsToggle,
1156
+ style: styles.testModeTitle
1157
+ }, "\uD83E\uDDEA Test Mode - 2 Main Flows"), /*#__PURE__*/React.createElement(TouchableOpacity, {
1158
+ style: styles.testExistingUserButton,
1743
1159
  onPress: () => {
1744
- triggerHaptic(HapticType.BUTTON_PRESS);
1745
- const newShowState = !showAdditionalPlatforms;
1746
- if (newShowState) {
1747
- // Expanding - show platforms first, then animate in and scroll
1748
- setShowAdditionalPlatforms(true);
1749
- Animated.timing(additionalPlatformsOpacity, {
1750
- toValue: 1,
1751
- duration: 300,
1752
- useNativeDriver: true
1753
- }).start();
1754
-
1755
- // Auto-scroll to reveal additional platforms when expanding
1756
- setTimeout(() => {
1757
- var _scrollViewRef$curren;
1758
- (_scrollViewRef$curren = scrollViewRef.current) === null || _scrollViewRef$curren === void 0 || _scrollViewRef$curren.scrollTo({
1759
- y: 220,
1760
- // Scroll down to reveal additional platforms and hint at Gmail
1761
- animated: true
1762
- });
1763
- }, 100);
1764
- } else {
1765
- // Collapsing - animate out first, then hide platforms and scroll back up
1766
- Animated.timing(additionalPlatformsOpacity, {
1767
- toValue: 0,
1768
- duration: 300,
1769
- useNativeDriver: true
1770
- }).start(() => {
1771
- setShowAdditionalPlatforms(false);
1772
- });
1773
-
1774
- // Scroll back up smoothly when collapsing
1775
- setTimeout(() => {
1776
- var _scrollViewRef$curren2;
1777
- (_scrollViewRef$curren2 = scrollViewRef.current) === null || _scrollViewRef$curren2 === void 0 || _scrollViewRef$curren2.scrollTo({
1778
- y: 0,
1779
- // Scroll back to top
1780
- animated: true
1781
- });
1782
- }, 100);
1783
- }
1160
+ // Flow 1: Existing User
1161
+ setIsExistingUser(true);
1162
+ setStep('dataRequest');
1784
1163
  }
1785
- }, /*#__PURE__*/React.createElement(Text, {
1786
- style: styles.additionalPlatformsText
1787
- }, showAdditionalPlatforms ? '− Hide additional platforms' : '+ Add additional platforms')), showAdditionalPlatforms && /*#__PURE__*/React.createElement(Animated.View, {
1788
- style: {
1789
- opacity: additionalPlatformsOpacity
1164
+ }, /*#__PURE__*/React.createElement(Icon, {
1165
+ name: "person",
1166
+ size: 20,
1167
+ color: "#28a745"
1168
+ }), /*#__PURE__*/React.createElement(Text, {
1169
+ style: styles.testExistingUserButtonText
1170
+ }, "Flow 1: Existing User (Email \u2192 Code \u2192 Data Request \u2192 Close)")), /*#__PURE__*/React.createElement(TouchableOpacity, {
1171
+ style: styles.testSkipToTrainingButton,
1172
+ onPress: () => {
1173
+ // Flow 2: New User - Skip to connect step
1174
+ setStep('connect');
1790
1175
  }
1791
- }, additionalPlatforms.map(platform => {
1792
- const isConnected = connectionStatuses[platform.id] === 'connected';
1793
- const isPlatformConnecting = connectingPlatform === platform.id;
1794
- return /*#__PURE__*/React.createElement(View, {
1795
- key: platform.id,
1796
- style: styles.platformItem
1797
- }, /*#__PURE__*/React.createElement(View, {
1798
- style: styles.platformInfo
1799
- }, platform.id === 'gmail' ?
1800
- /*#__PURE__*/
1801
- // Use the same wrapper for size/centering, but transparent background
1802
- React.createElement(View, {
1803
- style: [styles.platformIcon, {
1804
- backgroundColor: 'transparent'
1805
- }]
1806
- }, /*#__PURE__*/React.createElement(Image, {
1807
- source: getPlatformIcon(platform.id),
1808
- style: styles.gmailIconImage,
1809
- resizeMode: "contain"
1810
- })) : /*#__PURE__*/React.createElement(View, {
1811
- style: [styles.platformIcon, {
1812
- backgroundColor: platform.color
1813
- }]
1814
- }, /*#__PURE__*/React.createElement(Image, {
1815
- source: getPlatformIcon(platform.id),
1816
- style: platform.id === 'reddit' ? styles.redditIconImage : styles.platformIconImage,
1817
- resizeMode: "contain"
1818
- })), /*#__PURE__*/React.createElement(Text, {
1819
- style: styles.platformName
1820
- }, platform.name)), /*#__PURE__*/React.createElement(TouchableOpacity, {
1821
- onPress: () => {
1822
- if (isConnected) {
1823
- // Handle disconnect
1824
- handleDisconnectPlatform(platform.id, platform.name);
1825
- } else {
1826
- // Handle connect
1827
- handleConnectPlatform(platform.id);
1828
- }
1829
- },
1830
- style: [isConnected ? styles.footerButtonConnected : styles.footerButtonConfirm, {
1831
- paddingVertical: 8,
1832
- paddingHorizontal: 16
1833
- }],
1834
- disabled: isPlatformConnecting
1835
- }, isPlatformConnecting ? /*#__PURE__*/React.createElement(ActivityIndicator, {
1836
- size: "small",
1837
- color: "#fff"
1838
- }) : /*#__PURE__*/React.createElement(Text, {
1839
- style: isConnected ? styles.footerButtonTextConnected : styles.footerButtonTextConfirm
1840
- }, isConnected ? 'Connected' : 'Connect')));
1841
- }))))), /*#__PURE__*/React.createElement(View, {
1176
+ }, /*#__PURE__*/React.createElement(Icon, {
1177
+ name: "person-add",
1178
+ size: 20,
1179
+ color: "#17a2b8"
1180
+ }), /*#__PURE__*/React.createElement(Text, {
1181
+ style: styles.testSkipToTrainingButtonText
1182
+ }, "Flow 2: New User (Connect \u2192 PIN \u2192 Training)")), /*#__PURE__*/React.createElement(TouchableOpacity, {
1183
+ style: styles.testDataRequestButton,
1184
+ onPress: () => setStep('dataRequest')
1185
+ }, /*#__PURE__*/React.createElement(Icon, {
1186
+ name: "preview",
1187
+ size: 20,
1188
+ color: COLORS.primary
1189
+ }), /*#__PURE__*/React.createElement(Text, {
1190
+ style: styles.testDataRequestButtonText
1191
+ }, "Preview Data Request Screen")))), /*#__PURE__*/React.createElement(View, {
1842
1192
  style: styles.footer
1843
1193
  }, /*#__PURE__*/React.createElement(TouchableOpacity, {
1844
1194
  style: styles.footerButtonCancel,
@@ -1846,155 +1196,58 @@ export const UniversalOnboarding = ({
1846
1196
  }, /*#__PURE__*/React.createElement(Text, {
1847
1197
  style: styles.footerButtonText
1848
1198
  }, "Cancel")), /*#__PURE__*/React.createElement(TouchableOpacity, {
1849
- style: [styles.footerButtonConfirm, !canProceed && styles.footerButtonDisabled],
1199
+ style: [styles.footerButtonConfirm, !canProceedToPin() && styles.footerButtonDisabled],
1850
1200
  onPress: handleProceed,
1851
- disabled: !canProceed
1201
+ disabled: !canProceedToPin()
1852
1202
  }, /*#__PURE__*/React.createElement(Text, {
1853
1203
  style: styles.footerButtonTextConfirm
1854
- }, "Continue")))), step === 'pin' && /*#__PURE__*/React.createElement(PinInput, {
1855
- onSubmit: handlePinSubmit,
1856
- minLength: 8,
1857
- requireSpecialChar: true,
1858
- requireNumber: true,
1859
- onBack: () => setStep('connect'),
1860
- enableBiometricStorage: true
1861
- // ✅ REMOVED: Background training now starts during transition, not on component mount
1862
- // onBackgroundTrainingStart={startBackgroundTraining}
1863
- ,
1864
- showBackgroundProgress: true,
1865
- backgroundProgressText: backgroundTrainingProgress || "Training is starting in the background..."
1866
- }), step === 'persona' && /*#__PURE__*/React.createElement(View, {
1867
- style: styles.personaContainer
1868
- }, /*#__PURE__*/React.createElement(View, {
1869
- style: styles.personaHeaderWithBack
1870
- }, /*#__PURE__*/React.createElement(TouchableOpacity, {
1871
- style: [styles.personaBackButton,
1872
- // Highlight the back button when there's insufficient data
1873
- (dataScenario === 'NO_DATA' || dataScenario === 'CONNECTIONS_REQUIRED') && styles.highlightedBackButton],
1874
- onPress: () => setStep('connect') // Changed from 'pin' to 'connect' to go back to platform connections
1875
- }, /*#__PURE__*/React.createElement(Text, {
1876
- style: [{
1877
- fontSize: 24
1878
- },
1879
- // Make the arrow more prominent when insufficient data
1880
- (dataScenario === 'NO_DATA' || dataScenario === 'CONNECTIONS_REQUIRED') && styles.highlightedBackArrow]
1881
- }, "\u2190")), /*#__PURE__*/React.createElement(Text, {
1882
- style: styles.personaTitle
1883
- }, isPersonaComplete ? 'Your persona is ready! 🎉' : 'Creating your persona')), /*#__PURE__*/React.createElement(Text, {
1884
- style: styles.personaSubtitle
1885
- }, isPersonaComplete ? 'We\'ve created a personalized experience just for you.' : 'This will only take a moment. We\'re personalizing your experience.'), /*#__PURE__*/React.createElement(View, {
1886
- style: styles.personaProgressContainer
1204
+ }, "Connect")))), step === 'success' && /*#__PURE__*/React.createElement(View, {
1205
+ style: styles.successContainer
1887
1206
  }, /*#__PURE__*/React.createElement(View, {
1888
- style: styles.personaProgressBar
1207
+ style: styles.successContent
1889
1208
  }, /*#__PURE__*/React.createElement(View, {
1890
- style: [styles.personaProgressFill, {
1891
- width: `${personaProgress}%`
1892
- }, hasError && styles.progressError]
1209
+ style: styles.successIcon
1210
+ }, /*#__PURE__*/React.createElement(Icon, {
1211
+ name: "check",
1212
+ size: 48,
1213
+ color: "#fff"
1893
1214
  })), /*#__PURE__*/React.createElement(Text, {
1894
- style: styles.personaProgressText
1895
- }, Math.round(personaProgress), "%"), !isPersonaComplete && /*#__PURE__*/React.createElement(Text, {
1896
- style: styles.personaStatusText
1897
- }, getPersonaStatusMessage(personaProgress))), showDataWarning && dataScenario && /*#__PURE__*/React.createElement(View, {
1898
- style: [styles.dataWarningContainer, dataScenario === 'NO_DATA' || dataScenario === 'CONNECTIONS_REQUIRED' ? styles.dataConnectionsRequired : styles.dataInfoContainer]
1899
- }, /*#__PURE__*/React.createElement(View, {
1900
- style: styles.dataWarningHeader
1901
- }, /*#__PURE__*/React.createElement(Text, {
1902
- style: styles.dataWarningIcon
1903
- }, dataScenario === 'NO_DATA' || dataScenario === 'CONNECTIONS_REQUIRED' ? '‼️' : 'ℹ️'), /*#__PURE__*/React.createElement(Text, {
1904
- style: [styles.dataWarningTitle, {
1905
- color: dataScenario === 'NO_DATA' || dataScenario === 'CONNECTIONS_REQUIRED' ? '#000000' : '#0369A1'
1906
- }]
1907
- }, dataScenario === 'CONNECTIONS_REQUIRED' ? 'Not enough data to personalize your experience' : dataScenario === 'NO_DATA' ? 'Not enough data to personalize your experience' : 'Working with your available data')), /*#__PURE__*/React.createElement(Text, {
1908
- style: [styles.dataWarningMessage, {
1909
- color: dataScenario === 'NO_DATA' || dataScenario === 'CONNECTIONS_REQUIRED' ? '#374151' : '#0C4A6E'
1910
- }]
1911
- }, dataScenario === 'CONNECTIONS_REQUIRED' ? 'To provide the best experience possible, please go back and add an additional platform.' : dataScenario === 'NO_DATA' ? 'To provide the best experience possible, please go back and add an additional platform.' : 'We\'re building your persona with the information currently available.'), (dataScenario === 'NO_DATA' || dataScenario === 'CONNECTIONS_REQUIRED') && /*#__PURE__*/React.createElement(TouchableOpacity, {
1912
- style: styles.goBackButton,
1913
- onPress: () => setStep('connect'),
1914
- activeOpacity: 0.8
1915
- }, /*#__PURE__*/React.createElement(Text, {
1916
- style: styles.goBackButtonText
1917
- }, "\u2190 Add another platform")), (dataDetails === null || dataDetails === void 0 ? void 0 : dataDetails.suggestions) && dataScenario !== 'NO_DATA' && /*#__PURE__*/React.createElement(View, {
1918
- style: [styles.dataWarningSuggestions, {
1919
- borderTopColor: 'rgba(3, 105, 161, 0.2)'
1920
- }]
1921
- }, /*#__PURE__*/React.createElement(Text, {
1922
- style: [styles.dataWarningSuggestionsTitle, {
1923
- color: '#0369A1'
1924
- }]
1925
- }, "For higher model quality:"), dataDetails.suggestions.slice(0, 2).map((suggestion, index) => {
1926
- // Override specific suggestions with new text
1927
- let displayText = suggestion;
1928
- if (suggestion.toLowerCase().includes('better model quality') || suggestion.toLowerCase().includes('interact with more content')) {
1929
- displayText = 'Connect additional platforms';
1930
- } else if (suggestion.toLowerCase().includes('like/dislike more videos') || suggestion.toLowerCase().includes('posts, or content')) {
1931
- displayText = 'Interact and generate more content (like/dislike more videos, etc.)';
1932
- }
1933
- return /*#__PURE__*/React.createElement(Text, {
1934
- key: index,
1935
- style: [styles.dataWarningSuggestionItem, {
1936
- color: '#0C4A6E'
1937
- }]
1938
- }, "\u2022 ", displayText);
1939
- })), dataScenario === 'LIMITED_DATA' && /*#__PURE__*/React.createElement(Text, {
1940
- style: [styles.dataWarningContinueNote, {
1941
- color: '#0369A1'
1942
- }]
1943
- })), personaStatus.includes('YouTube token expired') && /*#__PURE__*/React.createElement(View, {
1944
- style: [styles.dataWarningContainer, styles.dataInfoContainer]
1945
- }, /*#__PURE__*/React.createElement(View, {
1946
- style: styles.dataWarningHeader
1947
- }, /*#__PURE__*/React.createElement(Text, {
1948
- style: styles.dataWarningIcon
1949
- }, "\uD83D\uDD04"), /*#__PURE__*/React.createElement(Text, {
1950
- style: [styles.dataWarningTitle, {
1951
- color: '#0369A1'
1952
- }]
1953
- }, "Refreshing YouTube connection")), /*#__PURE__*/React.createElement(Text, {
1954
- style: [styles.dataWarningMessage, {
1955
- color: '#0C4A6E'
1956
- }]
1957
- }, "Your YouTube access expired. We're automatically reconnecting...")), isPersonaComplete && /*#__PURE__*/React.createElement(View, {
1958
- style: styles.personaCompleteContainer
1959
- }, /*#__PURE__*/React.createElement(TouchableOpacity, {
1960
- style: styles.personaContinueButton,
1961
- onPress: () => {
1962
- console.log('🎯 Continue button pressed - completing onboarding');
1963
- handlePersonaComplete();
1964
- },
1965
- activeOpacity: 0.8
1966
- }, /*#__PURE__*/React.createElement(Text, {
1967
- style: styles.personaContinueButtonText
1968
- }, "Continue"))), hasError && !isPersonaComplete && !showDataWarning && /*#__PURE__*/React.createElement(View, {
1969
- style: styles.personaCompleteContainer
1970
- }, /*#__PURE__*/React.createElement(Text, {
1971
- style: styles.personaCompleteTitle
1972
- }, "Something went wrong"), /*#__PURE__*/React.createElement(Text, {
1973
- style: styles.personaCompleteSubtitle
1974
- }, "Please try again or contact support if the issue persists."), /*#__PURE__*/React.createElement(TouchableOpacity, {
1975
- style: [styles.personaContinueButton, {
1976
- backgroundColor: '#FF3B30'
1977
- }],
1978
- onPress: () => {
1979
- console.log('🔄 Retry button pressed - redirecting to connector screen');
1980
- setHasError(false);
1981
- // ❌ DISABLED: Don't start new training on retry
1982
- // Training should only start during connector→PIN transition
1983
- // startPersonaCreation();
1984
-
1985
- // Instead, go back to connector screen so user can restart proper flow
1986
- setStep('connect');
1987
- setPersonaStatus('Initializing');
1988
- setPersonaProgress(0);
1989
- },
1990
- activeOpacity: 0.8
1215
+ style: styles.successTitle
1216
+ }, "Never Connect Again!"), /*#__PURE__*/React.createElement(Text, {
1217
+ style: styles.successSubtitle
1218
+ }, "Your login session has been saved"), /*#__PURE__*/React.createElement(View, {
1219
+ style: styles.successMessage
1991
1220
  }, /*#__PURE__*/React.createElement(Text, {
1992
- style: styles.personaContinueButtonText
1993
- }, "Restart")))), step === 'oauth' && oauthUrl && /*#__PURE__*/React.createElement(View, {
1994
- style: {
1995
- marginTop: -17
1996
- }
1997
- }, /*#__PURE__*/React.createElement(OAuthWebView, {
1221
+ style: styles.successMessageText
1222
+ }, "Your Onairos account and platform connections are now saved in your browser cookies. Next time you use any app with Onairos, you'll be automatically signed in without needing to reconnect your accounts.")), /*#__PURE__*/React.createElement(View, {
1223
+ style: styles.progressIndicator
1224
+ }, /*#__PURE__*/React.createElement(ActivityIndicator, {
1225
+ size: "small",
1226
+ color: "#4CAF50"
1227
+ }), /*#__PURE__*/React.createElement(Text, {
1228
+ style: styles.progressText
1229
+ }, "Continuing...")))), step === 'pin' && /*#__PURE__*/React.createElement(PinInput, {
1230
+ onSubmit: handlePinSubmit,
1231
+ minLength: 8,
1232
+ requireSpecialChar: true,
1233
+ requireNumber: true,
1234
+ onBack: () => setStep('connect')
1235
+ }), step === 'training' && /*#__PURE__*/React.createElement(TrainingModal, {
1236
+ visible: step === 'training',
1237
+ progress: training.progress,
1238
+ eta: training.eta,
1239
+ onCancel: handleClose,
1240
+ onComplete: handleTrainingComplete,
1241
+ modelKey: "onairosTrainingModel",
1242
+ username: username,
1243
+ test: isTestMode
1244
+ }), step === 'dataRequest' && /*#__PURE__*/React.createElement(DataRequestScreen, {
1245
+ onAccept: handleDataRequestAccept,
1246
+ onDecline: handleDataRequestDecline,
1247
+ requestData: requestData || {},
1248
+ AppName: AppName,
1249
+ appIcon: appIcon
1250
+ }), step === 'oauth' && oauthUrl && /*#__PURE__*/React.createElement(OAuthWebView, {
1998
1251
  url: oauthUrl,
1999
1252
  platform: currentPlatform,
2000
1253
  onClose: () => {
@@ -2003,146 +1256,32 @@ export const UniversalOnboarding = ({
2003
1256
  },
2004
1257
  onSuccess: handleOAuthSuccess,
2005
1258
  onComplete: () => setStep('connect')
2006
- })), step === 'privacy' && /*#__PURE__*/React.createElement(View, {
2007
- style: styles.modalContent
2008
- }, /*#__PURE__*/React.createElement(View, {
2009
- style: styles.privacyHeader
2010
- }, /*#__PURE__*/React.createElement(TouchableOpacity, {
2011
- style: styles.backButton,
2012
- onPress: () => setStep('connect')
2013
- }, /*#__PURE__*/React.createElement(Text, {
2014
- style: styles.backButtonText
2015
- }, "\u2190")), /*#__PURE__*/React.createElement(Text, {
2016
- style: styles.headerTitle
2017
- }, "How Enoch uses personal data"), /*#__PURE__*/React.createElement(View, {
2018
- style: styles.backButtonSpacer
2019
- })), /*#__PURE__*/React.createElement(View, {
2020
- style: styles.privacyDetailsContainer
2021
- }, /*#__PURE__*/React.createElement(Text, {
2022
- style: styles.privacyDetailsTitle
2023
- }), /*#__PURE__*/React.createElement(View, {
2024
- style: styles.privacyBulletPoint
2025
- }, /*#__PURE__*/React.createElement(Text, {
2026
- style: styles.bulletPoint
2027
- }, "\u2022"), /*#__PURE__*/React.createElement(Text, {
2028
- style: styles.privacyBulletText
2029
- }, "Enoch legally accesses your platform data with explicit permission for this event only - never stored post-session and auto-deleted.")), /*#__PURE__*/React.createElement(View, {
2030
- style: styles.privacyBulletPoint
2031
- }, /*#__PURE__*/React.createElement(Text, {
2032
- style: styles.bulletPoint
2033
- }, "\u2022"), /*#__PURE__*/React.createElement(Text, {
2034
- style: styles.privacyBulletText
2035
- }, "Enoch NEVER sells your data. You are a user, not a commodity.")), /*#__PURE__*/React.createElement(View, {
2036
- style: styles.privacyBulletPoint
2037
- }, /*#__PURE__*/React.createElement(Text, {
2038
- style: styles.bulletPoint
2039
- }, "\u2022"), /*#__PURE__*/React.createElement(Text, {
2040
- style: styles.privacyBulletText
2041
- }, "Data collected builds your Onairos persona, enabling personalized experiences across future products while prioritizing your data sovereignty."))), /*#__PURE__*/React.createElement(TouchableOpacity, {
2042
- style: styles.footerButtonConfirm,
2043
- onPress: () => {
2044
- triggerHaptic(HapticType.BUTTON_PRESS);
2045
- setStep('connect');
2046
- }
2047
- }, /*#__PURE__*/React.createElement(Text, {
2048
- style: styles.footerButtonTextConfirm
2049
- }, "Got it"))), step === 'connections' && /*#__PURE__*/React.createElement(View, {
2050
- style: styles.modalContent
2051
- }, /*#__PURE__*/React.createElement(View, {
2052
- style: styles.privacyHeader
2053
- }, /*#__PURE__*/React.createElement(TouchableOpacity, {
2054
- style: styles.backButton,
2055
- onPress: () => setStep(primaryAuthOnly ? 'connections' : 'connect')
2056
- }, /*#__PURE__*/React.createElement(Text, {
2057
- style: styles.backButtonText
2058
- }, "\u2190")), /*#__PURE__*/React.createElement(Text, {
2059
- style: styles.headerTitle
2060
- }, "Connections Found"), /*#__PURE__*/React.createElement(View, {
2061
- style: styles.backButtonSpacer
2062
- })), /*#__PURE__*/React.createElement(View, {
2063
- style: styles.privacyDetailsContainer
2064
- }, /*#__PURE__*/React.createElement(Text, {
2065
- style: styles.connectionsCountText
2066
- }, "We found ", connectionsCount, " potential connections for you!"), /*#__PURE__*/React.createElement(View, {
2067
- style: styles.privacyBulletPoint
2068
- }, /*#__PURE__*/React.createElement(Text, {
2069
- style: styles.bulletPoint
2070
- }, "\u2022"), /*#__PURE__*/React.createElement(Text, {
2071
- style: styles.privacyBulletText
2072
- }, "Continue to see your personalized matches")), /*#__PURE__*/React.createElement(View, {
2073
- style: styles.privacyBulletPoint
2074
- }, /*#__PURE__*/React.createElement(Text, {
2075
- style: styles.bulletPoint
2076
- }, "\u2022"), /*#__PURE__*/React.createElement(Text, {
2077
- style: styles.privacyBulletText
2078
- }, "Your privacy is protected - we only show compatible profiles")), /*#__PURE__*/React.createElement(View, {
2079
- style: styles.privacyBulletPoint
2080
- }, /*#__PURE__*/React.createElement(Text, {
2081
- style: styles.bulletPoint
2082
- }, "\u2022"), /*#__PURE__*/React.createElement(Text, {
2083
- style: styles.privacyBulletText
2084
- }, "Ready to start building meaningful connections?"))), /*#__PURE__*/React.createElement(TouchableOpacity, {
2085
- style: styles.footerButtonConfirm,
2086
- onPress: async () => {
2087
- triggerHaptic(HapticType.BUTTON_PRESS);
2088
- // Complete the onboarding flow
2089
- isCompletingRef.current = true;
2090
-
2091
- // Check if this is an existing user adding more data
2092
- if (isExistingUser && existingUserToken) {
2093
- console.log('🔑 EXISTING USER: UniversalOnboarding complete, returning existing user token:', `${existingUserToken.substring(0, 20)}...`);
2094
- onComplete === null || onComplete === void 0 || onComplete('https://api2.onairos.uk', existingUserToken, {
2095
- email: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.email) || '',
2096
- ...userInfo
2097
- });
2098
- } else {
2099
- // For new users, retrieve the stored JWT token from TrainingModal
2100
- const storedToken = (await AsyncStorage.getItem('onairos_jwt_token')) || (await AsyncStorage.getItem('auth_token')) || (await AsyncStorage.getItem('enoch_token'));
2101
- const storedEmail = await AsyncStorage.getItem('user_email');
2102
- if (storedToken) {
2103
- console.log('🔑 NEW USER: UniversalOnboarding complete, returning stored JWT token:', `${storedToken.substring(0, 20)}...`);
2104
- onComplete === null || onComplete === void 0 || onComplete('https://api2.onairos.uk', storedToken, {
2105
- email: storedEmail || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.email) || '',
2106
- ...userInfo
2107
- });
2108
- } else {
2109
- console.warn('⚠️ NEW USER: No stored JWT token found, using fallback');
2110
- onComplete === null || onComplete === void 0 || onComplete('https://api2.onairos.uk', 'connections-complete-token', {
2111
- email: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.email) || '',
2112
- ...userInfo
2113
- });
2114
- }
2115
- }
2116
- }
2117
- }, /*#__PURE__*/React.createElement(Text, {
2118
- style: styles.footerButtonTextConfirm
2119
- }, "Continue to Setup")))))));
1259
+ })))))));
2120
1260
  };
2121
1261
  const styles = StyleSheet.create({
2122
1262
  modalOverlay: {
2123
1263
  flex: 1,
1264
+ backgroundColor: 'rgba(0, 0, 0, 0.5)',
2124
1265
  justifyContent: 'flex-end',
2125
- backgroundColor: 'rgba(0, 0, 0, 0.5)'
1266
+ alignItems: 'center'
2126
1267
  },
2127
1268
  bottomSheet: {
2128
- backgroundColor: '#FFFFFF',
2129
- borderTopLeftRadius: 20,
2130
- borderTopRightRadius: 20,
2131
- paddingTop: 8,
2132
- paddingBottom: Platform.OS === 'ios' ? 20 : 0,
2133
- minHeight: height * .86,
2134
- width: '100%'
1269
+ backgroundColor: '#fff',
1270
+ width: width,
1271
+ height: height * 0.8,
1272
+ borderTopLeftRadius: 24,
1273
+ borderTopRightRadius: 24,
1274
+ overflow: 'hidden'
2135
1275
  },
2136
1276
  container: {
2137
- flex: 1
1277
+ flex: 1,
1278
+ backgroundColor: '#fff'
2138
1279
  },
2139
1280
  handleContainer: {
1281
+ width: '100%',
2140
1282
  alignItems: 'center',
2141
- paddingVertical: 8
2142
- },
2143
- handleButton: {
2144
- padding: 10,
2145
- width: 60
1283
+ paddingTop: 12,
1284
+ paddingBottom: 8
2146
1285
  },
2147
1286
  handle: {
2148
1287
  width: 40,
@@ -2151,58 +1290,57 @@ const styles = StyleSheet.create({
2151
1290
  backgroundColor: '#E0E0E0'
2152
1291
  },
2153
1292
  header: {
2154
- alignItems: 'center',
2155
- marginBottom: 20,
2156
- paddingHorizontal: 24
1293
+ padding: 24,
1294
+ alignItems: 'center'
2157
1295
  },
2158
1296
  headerContent: {
2159
1297
  flexDirection: 'row',
2160
1298
  alignItems: 'center',
2161
1299
  justifyContent: 'center',
2162
- marginBottom: 24
1300
+ marginBottom: 16
2163
1301
  },
2164
1302
  appIcon: {
2165
1303
  width: 48,
2166
1304
  height: 48,
2167
- borderRadius: 24,
1305
+ borderRadius: 16,
2168
1306
  backgroundColor: '#F5F5F5',
2169
1307
  alignItems: 'center',
2170
1308
  justifyContent: 'center'
2171
1309
  },
2172
1310
  appIconText: {
2173
1311
  fontSize: 24,
2174
- fontWeight: 'bold',
2175
- color: '#333'
1312
+ color: '#000'
1313
+ },
1314
+ appIconImage: {
1315
+ width: 32,
1316
+ height: 32
2176
1317
  },
2177
1318
  arrow: {
2178
- marginHorizontal: 16,
2179
- fontSize: 24,
2180
- color: '#666'
1319
+ marginHorizontal: 16
2181
1320
  },
2182
1321
  onairosIcon: {
2183
- width: 54,
2184
- height: 54,
2185
- borderRadius: 32,
2186
- backgroundColor: 'transparent',
1322
+ width: 48,
1323
+ height: 48,
1324
+ borderRadius: 16,
1325
+ backgroundColor: '#F5F5F5',
2187
1326
  alignItems: 'center',
2188
1327
  justifyContent: 'center'
2189
1328
  },
2190
1329
  onairosIconText: {
2191
1330
  fontSize: 24,
2192
- fontWeight: 'bold',
2193
- color: '#fff'
1331
+ color: '#000'
2194
1332
  },
2195
- onairosIconImage: {
2196
- width: 54,
2197
- height: 54
1333
+ onairosLogo: {
1334
+ width: 32,
1335
+ height: 32
2198
1336
  },
2199
1337
  titleContainer: {
2200
- alignItems: 'center'
1338
+ marginBottom: 20
2201
1339
  },
2202
1340
  mainTitle: {
2203
- fontSize: 24,
1341
+ fontSize: 20,
2204
1342
  fontWeight: '600',
2205
- color: '#333',
1343
+ color: '#000',
2206
1344
  textAlign: 'center',
2207
1345
  marginBottom: 12
2208
1346
  },
@@ -2210,102 +1348,44 @@ const styles = StyleSheet.create({
2210
1348
  fontSize: 14,
2211
1349
  color: '#666',
2212
1350
  textAlign: 'center',
2213
- marginBottom: 20
2214
- },
2215
- privacyLink: {
2216
- color: '#000000',
2217
- fontWeight: '600',
2218
- textDecorationLine: 'underline'
2219
- },
2220
- boldText: {
2221
- fontWeight: 'bold'
1351
+ marginBottom: 12
2222
1352
  },
2223
1353
  content: {
2224
1354
  flex: 1,
2225
1355
  paddingHorizontal: 24
2226
1356
  },
2227
- platformsScrollView: {
2228
- flex: 1,
2229
- width: '100%'
2230
- },
2231
- platformsScrollContent: {
2232
- paddingBottom: 0,
2233
- paddingHorizontal: 24
2234
- },
2235
- platformsContainer: {
2236
- marginTop: 16
2237
- },
2238
- platformItem: {
2239
- flexDirection: 'row',
2240
- alignItems: 'center',
2241
- justifyContent: 'space-between',
2242
- paddingVertical: 16,
2243
- paddingHorizontal: 8,
2244
- borderBottomWidth: 1,
2245
- borderBottomColor: '#E5E5E5'
2246
- },
2247
- platformInfo: {
2248
- flexDirection: 'row',
2249
- alignItems: 'center'
2250
- },
2251
- platformIcon: {
2252
- width: 40,
2253
- height: 40,
2254
- borderRadius: 20,
2255
- backgroundColor: '#F5F5F5',
2256
- alignItems: 'center',
2257
- justifyContent: 'center',
2258
- marginRight: 16
2259
- },
2260
- platformIconText: {
2261
- fontSize: 18,
2262
- fontWeight: 'bold',
2263
- color: '#333',
2264
- textAlign: 'center',
2265
- textAlignVertical: 'center'
2266
- },
2267
- platformIconImage: {
2268
- width: 24,
2269
- height: 24
2270
- },
2271
- youtubeIconImage: {
2272
- width: 58,
2273
- height: 58
1357
+ scrollContent: {
1358
+ flexGrow: 1,
1359
+ paddingBottom: 20
2274
1360
  },
2275
- redditIconImage: {
2276
- width: 34,
2277
- height: 34
2278
- },
2279
- pinterestIconImage: {
2280
- width: 48,
2281
- height: 48
2282
- },
2283
- gmailIconImage: {
2284
- width: 32,
2285
- height: 32
1361
+ platformsContainer: {
1362
+ marginTop: 16
2286
1363
  },
2287
- linkedinPlatformIcon: {
2288
- width: 40,
2289
- height: 40,
2290
- borderRadius: 8,
2291
- backgroundColor: '#F5F5F5',
1364
+ platformItem: {
1365
+ flexDirection: 'row',
1366
+ justifyContent: 'space-between',
2292
1367
  alignItems: 'center',
2293
- justifyContent: 'center',
2294
- marginRight: 16
1368
+ padding: 12,
1369
+ backgroundColor: '#fff',
1370
+ borderRadius: 12,
1371
+ marginBottom: 8,
1372
+ borderWidth: 1,
1373
+ borderColor: '#eee'
2295
1374
  },
2296
- pinterestPlatformIcon: {
2297
- width: 34,
2298
- height: 34,
2299
- borderRadius: 17,
2300
- backgroundColor: '#F5F5F5',
1375
+ platformInfo: {
1376
+ flexDirection: 'row',
2301
1377
  alignItems: 'center',
2302
- justifyContent: 'center',
2303
- marginRight: 16
1378
+ flex: 1
1379
+ },
1380
+ platformIcon: {
1381
+ width: 24,
1382
+ height: 24,
1383
+ marginRight: 12
2304
1384
  },
2305
1385
  platformName: {
2306
1386
  fontSize: 16,
2307
- color: '#333',
2308
- textAlignVertical: 'center'
1387
+ fontWeight: '500',
1388
+ color: '#000'
2309
1389
  },
2310
1390
  footer: {
2311
1391
  flexDirection: 'row',
@@ -2313,389 +1393,301 @@ const styles = StyleSheet.create({
2313
1393
  justifyContent: 'space-between',
2314
1394
  padding: 24,
2315
1395
  borderTopWidth: 1,
2316
- borderTopColor: '#E5E5E5'
1396
+ borderTopColor: '#eee',
1397
+ backgroundColor: '#fff'
2317
1398
  },
2318
1399
  footerButtonCancel: {
2319
- paddingVertical: 12,
1400
+ paddingVertical: 8,
2320
1401
  paddingHorizontal: 16
2321
1402
  },
2322
- footerButtonText: {
2323
- color: '#666',
2324
- fontSize: 16
2325
- },
2326
1403
  footerButtonConfirm: {
2327
- paddingVertical: 12,
2328
- paddingHorizontal: 24,
2329
- backgroundColor: '#000000',
2330
- borderRadius: 8,
2331
- marginTop: 20
2332
- },
2333
- footerButtonConnected: {
2334
- paddingVertical: 12,
2335
- paddingHorizontal: 24,
2336
- backgroundColor: '#E9C46A',
2337
- borderRadius: 8
1404
+ paddingVertical: 16,
1405
+ paddingHorizontal: 32,
1406
+ borderRadius: 16,
1407
+ backgroundColor: '#fff',
1408
+ borderWidth: 1,
1409
+ borderColor: '#000'
2338
1410
  },
2339
1411
  footerButtonDisabled: {
2340
- backgroundColor: '#E5E5E5'
1412
+ opacity: 0.5
2341
1413
  },
2342
- footerButtonTextConfirm: {
2343
- color: '#fff',
2344
- fontSize: 16,
2345
- fontWeight: '600'
1414
+ footerButtonText: {
1415
+ color: '#666',
1416
+ fontSize: 16
2346
1417
  },
2347
- footerButtonTextConnected: {
1418
+ footerButtonTextConfirm: {
2348
1419
  color: '#000',
2349
1420
  fontSize: 16,
2350
1421
  fontWeight: '600'
2351
1422
  },
2352
- connectContainer: {
2353
- flex: 1
2354
- },
2355
- modalContent: {
1423
+ successContainer: {
2356
1424
  flex: 1,
2357
- backgroundColor: '#FFFFFF',
2358
- borderTopLeftRadius: 20,
2359
- borderTopRightRadius: 20,
2360
- padding: 24
2361
- },
2362
- backButton: {
2363
- padding: 8,
2364
- width: 40
1425
+ justifyContent: 'center',
1426
+ alignItems: 'center'
2365
1427
  },
2366
- backButtonText: {
2367
- fontSize: 24,
2368
- color: '#000000'
1428
+ successContent: {
1429
+ backgroundColor: '#fff',
1430
+ padding: 24,
1431
+ borderRadius: 16,
1432
+ alignItems: 'center'
2369
1433
  },
2370
- backButtonSpacer: {
2371
- width: 40
1434
+ successIcon: {
1435
+ backgroundColor: '#4CAF50',
1436
+ borderRadius: 24,
1437
+ padding: 12,
1438
+ marginBottom: 16
2372
1439
  },
2373
- headerTitle: {
2374
- fontSize: 18,
1440
+ successTitle: {
1441
+ fontSize: 22,
2375
1442
  fontWeight: '600',
2376
- color: '#333',
2377
- textAlign: 'center'
2378
- },
2379
- privacyHeader: {
2380
- flexDirection: 'row',
2381
- alignItems: 'center',
2382
- justifyContent: 'space-between',
2383
- paddingHorizontal: 16,
2384
- paddingVertical: 20,
2385
- backgroundColor: '#FFFFFF',
2386
- borderBottomWidth: 1,
2387
- borderBottomColor: '#F0F0F0'
2388
- },
2389
- privacyDetailsContainer: {
2390
- paddingHorizontal: 24,
2391
- paddingVertical: 8,
2392
- flex: 1,
2393
- marginTop: 20
1443
+ color: '#000',
1444
+ textAlign: 'center',
1445
+ marginBottom: 16
2394
1446
  },
2395
- privacyDetailsTitle: {
2396
- fontSize: 20,
2397
- fontWeight: '600',
2398
- color: '#333',
2399
- marginBottom: 0
1447
+ successSubtitle: {
1448
+ fontSize: 14,
1449
+ color: '#666',
1450
+ textAlign: 'center',
1451
+ marginBottom: 16
2400
1452
  },
2401
- privacyBulletPoint: {
2402
- flexDirection: 'row',
2403
- marginBottom: 16,
2404
- alignItems: 'flex-start'
1453
+ successMessage: {
1454
+ backgroundColor: '#f0f0f0',
1455
+ padding: 16,
1456
+ borderRadius: 8,
1457
+ marginBottom: 16
2405
1458
  },
2406
- bulletPoint: {
2407
- fontSize: 18,
2408
- marginRight: 8,
2409
- color: '#333'
1459
+ successMessageText: {
1460
+ fontSize: 14,
1461
+ color: '#666'
2410
1462
  },
2411
- privacyBulletText: {
2412
- fontSize: 16,
2413
- color: '#333',
2414
- flex: 1,
2415
- lineHeight: 24
1463
+ platformToggle: {
1464
+ width: 50,
1465
+ height: 28,
1466
+ borderRadius: 14,
1467
+ borderWidth: 1,
1468
+ borderColor: '#ddd',
1469
+ backgroundColor: '#f0f0f0',
1470
+ justifyContent: 'center',
1471
+ paddingHorizontal: 2
2416
1472
  },
2417
- connectionsCountText: {
2418
- fontSize: 18,
2419
- fontWeight: '600',
2420
- color: '#333',
2421
- marginBottom: 24
1473
+ platformToggleActive: {
1474
+ borderColor: '#4CAF50',
1475
+ backgroundColor: '#4CAF50'
2422
1476
  },
2423
- personaContainer: {
2424
- flex: 1,
2425
- padding: 16,
1477
+ platformToggleThumb: {
1478
+ width: 22,
1479
+ height: 22,
1480
+ borderRadius: 11,
2426
1481
  backgroundColor: '#fff',
2427
- justifyContent: 'flex-start'
1482
+ shadowColor: '#000',
1483
+ shadowOffset: {
1484
+ width: 0,
1485
+ height: 1
1486
+ },
1487
+ shadowOpacity: 0.2,
1488
+ shadowRadius: 2,
1489
+ elevation: 2
2428
1490
  },
2429
- personaHeaderWithBack: {
2430
- flexDirection: 'row',
2431
- alignItems: 'center',
2432
- justifyContent: 'space-between',
2433
- marginBottom: 16,
2434
- paddingVertical: 8
1491
+ platformToggleThumbActive: {
1492
+ alignSelf: 'flex-end'
2435
1493
  },
2436
- personaBackButton: {
2437
- padding: 8
1494
+ // Dark mode styles
1495
+ darkPlatformItem: {
1496
+ backgroundColor: '#333',
1497
+ borderColor: '#555'
2438
1498
  },
2439
- personaHeader: {
2440
- alignItems: 'center',
2441
- marginBottom: 32,
2442
- paddingHorizontal: 24
1499
+ darkText: {
1500
+ color: '#fff'
2443
1501
  },
2444
- personaTitle: {
2445
- fontSize: 20,
2446
- fontWeight: '600',
2447
- color: '#333',
2448
- textAlign: 'center',
2449
- flex: 1,
2450
- marginBottom: 8
1502
+ darkSubText: {
1503
+ color: '#ccc'
2451
1504
  },
2452
- personaSubtitle: {
2453
- fontSize: 14,
2454
- color: '#666',
2455
- marginBottom: 24,
2456
- textAlign: 'center'
1505
+ progressIndicator: {
1506
+ flexDirection: 'row',
1507
+ alignItems: 'center',
1508
+ marginTop: 16
2457
1509
  },
2458
- personaProgressContainer: {
2459
- marginBottom: 24,
2460
- paddingHorizontal: 0
1510
+ progressText: {
1511
+ fontSize: 16,
1512
+ fontWeight: '500',
1513
+ color: '#000',
1514
+ marginLeft: 8
2461
1515
  },
2462
- personaProgressBar: {
2463
- height: 8,
2464
- backgroundColor: '#F5F5F5',
2465
- borderRadius: 4,
2466
- overflow: 'hidden',
2467
- marginBottom: 12
1516
+ // Email input styles
1517
+ emailInputContainer: {
1518
+ flex: 1,
1519
+ justifyContent: 'flex-start',
1520
+ alignItems: 'center',
1521
+ padding: 24,
1522
+ paddingTop: 60
2468
1523
  },
2469
- personaProgressFill: {
2470
- height: '100%',
2471
- backgroundColor: '#1BA9D4',
2472
- borderRadius: 4
1524
+ emailHeader: {
1525
+ alignItems: 'center',
1526
+ marginBottom: 32
2473
1527
  },
2474
- personaProgressText: {
2475
- fontSize: 16,
1528
+ emailTitle: {
1529
+ fontSize: 24,
2476
1530
  fontWeight: '600',
2477
- color: '#333',
1531
+ color: '#000',
2478
1532
  textAlign: 'center',
1533
+ marginTop: 16,
2479
1534
  marginBottom: 8
2480
1535
  },
2481
- personaStatusText: {
2482
- fontSize: 14,
1536
+ emailSubtitle: {
1537
+ fontSize: 16,
2483
1538
  color: '#666',
2484
1539
  textAlign: 'center'
2485
1540
  },
2486
- personaCompleteContainer: {
2487
- alignItems: 'center',
2488
- paddingHorizontal: 0
2489
- },
2490
- personaCompleteTitle: {
2491
- fontSize: 20,
2492
- fontWeight: '600',
2493
- color: '#333',
2494
- marginBottom: 8,
2495
- textAlign: 'center'
2496
- },
2497
- personaCompleteSubtitle: {
2498
- fontSize: 14,
2499
- color: '#666',
2500
- textAlign: 'center',
2501
- marginBottom: 40
2502
- },
2503
- personaContinueButton: {
2504
- backgroundColor: '#000000',
2505
- paddingVertical: 16,
2506
- paddingHorizontal: 48,
2507
- borderRadius: 16,
2508
- alignItems: 'center',
1541
+ emailInputSection: {
2509
1542
  width: '100%',
2510
- marginTop: 32,
2511
- shadowColor: '#000',
2512
- shadowOffset: {
2513
- width: 0,
2514
- height: 2
2515
- },
2516
- shadowOpacity: 0.1,
2517
- shadowRadius: 4,
2518
- elevation: 3
1543
+ maxWidth: 320
2519
1544
  },
2520
- personaContinueButtonText: {
2521
- color: '#fff',
1545
+ emailInput: {
1546
+ borderWidth: 1,
1547
+ borderColor: '#ddd',
1548
+ borderRadius: 12,
1549
+ padding: 16,
2522
1550
  fontSize: 16,
2523
- fontWeight: '600'
2524
- },
2525
- progressError: {
2526
- backgroundColor: '#FF3B30'
1551
+ marginBottom: 16,
1552
+ backgroundColor: '#fff'
2527
1553
  },
2528
- dataWarningContainer: {
2529
- padding: 16,
1554
+ emailSubmitButton: {
1555
+ backgroundColor: '#4CAF50',
1556
+ paddingVertical: 16,
1557
+ paddingHorizontal: 32,
2530
1558
  borderRadius: 12,
2531
- marginTop: 16,
2532
- borderWidth: 1,
2533
- shadowColor: '#000',
2534
- shadowOffset: {
2535
- width: 0,
2536
- height: 2
2537
- },
2538
- shadowOpacity: 0.1,
2539
- shadowRadius: 4,
2540
- elevation: 3
2541
- },
2542
- dataWarningHeader: {
2543
- flexDirection: 'row',
2544
- alignItems: 'center',
2545
- marginBottom: 8
1559
+ alignItems: 'center'
2546
1560
  },
2547
- dataWarningIcon: {
2548
- fontSize: 20,
2549
- marginRight: 8
1561
+ emailSubmitButtonDisabled: {
1562
+ opacity: 0.5
2550
1563
  },
2551
- dataWarningTitle: {
1564
+ emailSubmitButtonText: {
1565
+ color: '#fff',
2552
1566
  fontSize: 16,
2553
- fontWeight: '600',
2554
- flex: 1
2555
- },
2556
- dataWarningMessage: {
2557
- fontSize: 14,
2558
- marginBottom: 0,
2559
- lineHeight: 20
2560
- },
2561
- dataWarningSuggestions: {
2562
- marginTop: 12,
2563
- paddingTop: 12,
2564
- borderTopWidth: 1
1567
+ fontWeight: '600'
2565
1568
  },
2566
- dataWarningSuggestionsTitle: {
1569
+ // Verification code styles
1570
+ developmentNote: {
2567
1571
  fontSize: 14,
2568
- fontWeight: '600',
2569
- marginBottom: 6
2570
- },
2571
- dataWarningSuggestionItem: {
2572
- fontSize: 13,
2573
- marginBottom: 4,
2574
- lineHeight: 18
2575
- },
2576
- dataWarningContinueNote: {
2577
- fontSize: 13,
2578
- fontWeight: '500',
2579
- marginTop: 12,
2580
- fontStyle: 'italic'
2581
- },
2582
- dataWarningError: {
2583
- backgroundColor: '#FFF5F5',
2584
- borderColor: '#FEB2B2'
2585
- },
2586
- dataInfoContainer: {
2587
- backgroundColor: '#F0F9FF',
2588
- borderColor: '#BAE6FD'
1572
+ color: '#FF9800',
1573
+ textAlign: 'center',
1574
+ marginTop: 8,
1575
+ backgroundColor: '#FFF3E0',
1576
+ padding: 8,
1577
+ borderRadius: 4
2589
1578
  },
2590
- dataConnectionsRequired: {
2591
- backgroundColor: '#F5F5F5',
2592
- borderColor: '#D1D5DB',
2593
- shadowColor: '#6B7280',
2594
- shadowOffset: {
2595
- width: 0,
2596
- height: 0
2597
- },
2598
- shadowOpacity: 0.15,
2599
- shadowRadius: 8
1579
+ codeInputContainer: {
1580
+ flexDirection: 'row',
1581
+ justifyContent: 'space-between',
1582
+ marginBottom: 24,
1583
+ paddingHorizontal: 20
2600
1584
  },
2601
- highlightedBackButton: {
2602
- backgroundColor: '#F5F5F5',
2603
- borderRadius: 20,
1585
+ codeDigit: {
1586
+ width: 45,
1587
+ height: 55,
2604
1588
  borderWidth: 2,
2605
- borderColor: '#000000',
2606
- shadowColor: '#000000',
2607
- shadowOffset: {
2608
- width: 0,
2609
- height: 0
2610
- },
2611
- shadowOpacity: 0.3,
2612
- shadowRadius: 8,
2613
- elevation: 5
1589
+ borderColor: '#ddd',
1590
+ borderRadius: 8,
1591
+ fontSize: 24,
1592
+ fontWeight: '600',
1593
+ color: '#000',
1594
+ backgroundColor: '#fff'
2614
1595
  },
2615
- highlightedBackArrow: {
2616
- color: '#000000',
2617
- fontWeight: 'bold'
1596
+ codeDigitActive: {
1597
+ borderColor: '#4CAF50'
2618
1598
  },
2619
- goBackButton: {
2620
- backgroundColor: '#000000',
1599
+ backButton: {
2621
1600
  paddingVertical: 12,
2622
- paddingHorizontal: 16,
2623
- borderRadius: 8,
2624
- marginTop: 12,
2625
- alignItems: 'center',
2626
- shadowColor: '#000000',
2627
- shadowOffset: {
2628
- width: 0,
2629
- height: 0
2630
- },
2631
- shadowOpacity: 0.3,
2632
- shadowRadius: 6,
2633
- elevation: 3
1601
+ alignItems: 'center'
2634
1602
  },
2635
- goBackButtonText: {
2636
- color: '#FFFFFF',
2637
- fontSize: 14,
2638
- fontWeight: '600'
1603
+ backButtonText: {
1604
+ color: '#666',
1605
+ fontSize: 16
2639
1606
  },
2640
- additionalPlatformsToggle: {
2641
- paddingVertical: 16,
2642
- paddingHorizontal: 8,
1607
+ // Expand button styles
1608
+ expandButton: {
1609
+ flexDirection: 'row',
2643
1610
  alignItems: 'center',
2644
- borderBottomWidth: 1,
2645
- borderBottomColor: '#E5E5E5'
1611
+ justifyContent: 'center',
1612
+ padding: 12,
1613
+ backgroundColor: '#f8f9fa',
1614
+ borderRadius: 12,
1615
+ borderWidth: 1,
1616
+ borderColor: '#e9ecef',
1617
+ marginTop: 8
2646
1618
  },
2647
- additionalPlatformsText: {
1619
+ expandButtonText: {
2648
1620
  fontSize: 14,
2649
- color: '#666',
2650
- fontWeight: '500'
2651
- },
2652
- asterisk: {
2653
- color: '#FF6B6B',
2654
- fontSize: 16,
2655
- fontWeight: 'bold',
2656
- marginLeft: 2
1621
+ fontWeight: '500',
1622
+ color: COLORS.primary,
1623
+ marginLeft: 8
2657
1624
  },
2658
- linkedinRequirementContainer: {
2659
- backgroundColor: '#F8F9FA',
1625
+ // Test mode styles
1626
+ testModeContainer: {
1627
+ marginTop: 16,
1628
+ paddingHorizontal: 16,
1629
+ backgroundColor: '#f8f9fa',
1630
+ borderRadius: 12,
1631
+ padding: 16,
2660
1632
  borderWidth: 1,
2661
- borderColor: '#E5E7EB',
2662
- borderRadius: 8,
2663
- paddingHorizontal: 12,
2664
- paddingVertical: 8,
2665
- marginTop: 8,
2666
- marginHorizontal: 4
1633
+ borderColor: '#e9ecef'
2667
1634
  },
2668
- linkedinRequirementText: {
2669
- fontSize: 12,
2670
- fontStyle: 'italic',
1635
+ testModeTitle: {
1636
+ fontSize: 16,
1637
+ fontWeight: '600',
1638
+ color: '#495057',
1639
+ marginBottom: 12,
2671
1640
  textAlign: 'center'
2672
1641
  },
2673
- linkedinRequirementAsterisk: {
2674
- color: '#FF6B6B',
2675
- fontWeight: 'bold'
1642
+ testDataRequestButton: {
1643
+ flexDirection: 'row',
1644
+ alignItems: 'center',
1645
+ justifyContent: 'center',
1646
+ padding: 12,
1647
+ backgroundColor: '#fff3cd',
1648
+ borderRadius: 12,
1649
+ borderWidth: 1,
1650
+ borderColor: '#ffeaa7',
1651
+ marginBottom: 8
2676
1652
  },
2677
- linkedinRequirementMessage: {
2678
- color: '#6B7280'
1653
+ testDataRequestButtonText: {
1654
+ fontSize: 14,
1655
+ fontWeight: '500',
1656
+ color: '#856404',
1657
+ marginLeft: 8
2679
1658
  },
2680
- existingUserBanner: {
2681
- backgroundColor: '#F0F9FF',
2682
- borderWidth: 1,
2683
- borderColor: '#0EA5E9',
1659
+ testExistingUserButton: {
1660
+ flexDirection: 'row',
1661
+ alignItems: 'center',
1662
+ justifyContent: 'center',
1663
+ padding: 12,
1664
+ backgroundColor: '#d4edda',
2684
1665
  borderRadius: 12,
2685
- paddingHorizontal: 16,
2686
- paddingVertical: 12,
2687
- marginTop: 12
1666
+ borderWidth: 1,
1667
+ borderColor: '#c3e6cb',
1668
+ marginBottom: 8
2688
1669
  },
2689
- existingUserText: {
1670
+ testExistingUserButtonText: {
2690
1671
  fontSize: 14,
2691
- fontWeight: '600',
2692
- color: '#0369A1',
2693
- marginBottom: 4
1672
+ fontWeight: '500',
1673
+ color: '#155724',
1674
+ marginLeft: 8
2694
1675
  },
2695
- existingUserSubtext: {
2696
- fontSize: 12,
2697
- color: '#0C4A6E',
2698
- lineHeight: 16
1676
+ testSkipToTrainingButton: {
1677
+ flexDirection: 'row',
1678
+ alignItems: 'center',
1679
+ justifyContent: 'center',
1680
+ padding: 12,
1681
+ backgroundColor: '#d1ecf1',
1682
+ borderRadius: 12,
1683
+ borderWidth: 1,
1684
+ borderColor: '#bee5eb'
1685
+ },
1686
+ testSkipToTrainingButtonText: {
1687
+ fontSize: 14,
1688
+ fontWeight: '500',
1689
+ color: '#0c5460',
1690
+ marginLeft: 8
2699
1691
  }
2700
1692
  });
2701
1693
  //# sourceMappingURL=UniversalOnboarding.js.map