@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.
- package/README.md +374 -403
- package/lib/commonjs/api/index.js +1 -75
- package/lib/commonjs/api/index.js.map +1 -1
- package/lib/commonjs/assets/images/email.png +0 -0
- package/lib/commonjs/assets/images/linkedin.png +0 -0
- package/lib/commonjs/assets/images/reddit.png +0 -0
- package/lib/commonjs/assets/images/youtube.png +0 -0
- package/lib/commonjs/components/DataRequestModal.js.map +1 -1
- package/lib/commonjs/components/DataRequestScreen.js.map +1 -1
- package/lib/commonjs/components/EmailVerificationModal.js.map +1 -1
- package/lib/commonjs/components/Onairos.js +3 -1
- package/lib/commonjs/components/Onairos.js.map +1 -1
- package/lib/commonjs/components/OnairosButton.js +190 -171
- package/lib/commonjs/components/OnairosButton.js.map +1 -1
- package/lib/commonjs/components/Overlay.js +5 -5
- package/lib/commonjs/components/Overlay.js.map +1 -1
- package/lib/commonjs/components/PinInput.js +120 -282
- package/lib/commonjs/components/PinInput.js.map +1 -1
- package/lib/commonjs/components/PlatformList.js.map +1 -1
- package/lib/commonjs/components/TrainingModal.js +563 -808
- package/lib/commonjs/components/TrainingModal.js.map +1 -1
- package/lib/commonjs/components/UniversalOnboarding.js +1296 -2302
- package/lib/commonjs/components/UniversalOnboarding.js.map +1 -1
- package/lib/commonjs/components/UniversalOnboarding.tsx.new +455 -0
- package/lib/commonjs/components/onboarding/OAuthWebView.js +743 -134
- package/lib/commonjs/components/onboarding/OAuthWebView.js.map +1 -1
- package/lib/commonjs/components/onboarding/OnboardingHeader.js.map +1 -1
- package/lib/commonjs/components/onboarding/PinInput.js.map +1 -1
- package/lib/commonjs/components/onboarding/PlatformConnector.js.map +1 -1
- package/lib/commonjs/components/screens/ConnectorScreen.js.map +1 -1
- package/lib/commonjs/components/screens/LoadingScreen.js.map +1 -1
- package/lib/commonjs/components/screens/PinCreationScreen.js.map +1 -1
- package/lib/commonjs/constants/index.js.map +1 -1
- package/lib/commonjs/hooks/useConnections.js +125 -120
- package/lib/commonjs/hooks/useConnections.js.map +1 -1
- package/lib/commonjs/hooks/useCredentials.js.map +1 -1
- package/lib/commonjs/index.js +27 -157
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/services/SDK_API_KEY_VALIDATION.md +428 -0
- package/lib/commonjs/services/apiKeyService.js +106 -105
- package/lib/commonjs/services/apiKeyService.js.map +1 -1
- package/lib/commonjs/services/oauthService.js.map +1 -1
- package/lib/commonjs/services/platformAuthService.js +722 -956
- package/lib/commonjs/services/platformAuthService.js.map +1 -1
- package/lib/commonjs/types/ambient.d.js.map +1 -1
- package/lib/commonjs/types/declarations.d.js.map +1 -1
- package/lib/commonjs/types/index.d.js.map +1 -1
- package/lib/commonjs/types/index.js.map +1 -1
- package/lib/commonjs/types/node-fix.d.js.map +1 -1
- package/lib/commonjs/types/node-override.d.js.map +1 -1
- package/lib/commonjs/types/opacity.d.js.map +1 -1
- package/lib/commonjs/types/types.d.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/Portal.js +4 -4
- package/lib/commonjs/utils/Portal.js.map +1 -1
- package/lib/commonjs/utils/api.js +24 -24
- package/lib/commonjs/utils/api.js.map +1 -1
- package/lib/commonjs/utils/auth.js +18 -18
- package/lib/commonjs/utils/auth.js.map +1 -1
- package/lib/commonjs/utils/crypto.js +13 -13
- package/lib/commonjs/utils/crypto.js.map +1 -1
- package/lib/commonjs/utils/debugHelper.js.map +1 -1
- package/lib/commonjs/utils/encryption.js +12 -12
- package/lib/commonjs/utils/encryption.js.map +1 -1
- package/lib/commonjs/utils/onairosApi.js.map +1 -1
- package/lib/commonjs/utils/programmaticFlow.js +16 -16
- package/lib/commonjs/utils/programmaticFlow.js.map +1 -1
- package/lib/commonjs/utils/retryHelper.js +27 -27
- package/lib/commonjs/utils/retryHelper.js.map +1 -1
- package/lib/commonjs/utils/secureStorage.js.map +1 -1
- package/lib/module/api/index.js +0 -72
- package/lib/module/api/index.js.map +1 -1
- package/lib/module/assets/images/email.png +0 -0
- package/lib/module/assets/images/linkedin.png +0 -0
- package/lib/module/assets/images/reddit.png +0 -0
- package/lib/module/assets/images/youtube.png +0 -0
- package/lib/module/components/DataRequestModal.js.map +1 -1
- package/lib/module/components/DataRequestScreen.js.map +1 -1
- package/lib/module/components/EmailVerificationModal.js.map +1 -1
- package/lib/module/components/Onairos.js +3 -1
- package/lib/module/components/Onairos.js.map +1 -1
- package/lib/module/components/OnairosButton.js +192 -172
- package/lib/module/components/OnairosButton.js.map +1 -1
- package/lib/module/components/Overlay.js +5 -5
- package/lib/module/components/Overlay.js.map +1 -1
- package/lib/module/components/PinInput.js +120 -283
- package/lib/module/components/PinInput.js.map +1 -1
- package/lib/module/components/PlatformList.js.map +1 -1
- package/lib/module/components/TrainingModal.js +565 -809
- package/lib/module/components/TrainingModal.js.map +1 -1
- package/lib/module/components/UniversalOnboarding.js +1297 -2305
- package/lib/module/components/UniversalOnboarding.js.map +1 -1
- package/lib/module/components/UniversalOnboarding.tsx.new +455 -0
- package/lib/module/components/onboarding/OAuthWebView.js +744 -136
- package/lib/module/components/onboarding/OAuthWebView.js.map +1 -1
- package/lib/module/components/onboarding/OnboardingHeader.js.map +1 -1
- package/lib/module/components/onboarding/PinInput.js.map +1 -1
- package/lib/module/components/onboarding/PlatformConnector.js.map +1 -1
- package/lib/module/components/screens/ConnectorScreen.js.map +1 -1
- package/lib/module/components/screens/LoadingScreen.js.map +1 -1
- package/lib/module/components/screens/PinCreationScreen.js.map +1 -1
- package/lib/module/constants/index.js.map +1 -1
- package/lib/module/hooks/useConnections.js +125 -119
- package/lib/module/hooks/useConnections.js.map +1 -1
- package/lib/module/hooks/useCredentials.js.map +1 -1
- package/lib/module/index.js +17 -55
- package/lib/module/index.js.map +1 -1
- package/lib/module/services/SDK_API_KEY_VALIDATION.md +428 -0
- package/lib/module/services/apiKeyService.js +106 -105
- package/lib/module/services/apiKeyService.js.map +1 -1
- package/lib/module/services/oauthService.js.map +1 -1
- package/lib/module/services/platformAuthService.js +704 -943
- package/lib/module/services/platformAuthService.js.map +1 -1
- package/lib/module/types/ambient.d.js.map +1 -1
- package/lib/module/types/declarations.d.js.map +1 -1
- package/lib/module/types/index.d.js.map +1 -1
- package/lib/module/types/index.js.map +1 -1
- package/lib/module/types/node-fix.d.js.map +1 -1
- package/lib/module/types/node-override.d.js.map +1 -1
- package/lib/module/types/opacity.d.js.map +1 -1
- package/lib/module/types/types.d.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/Portal.js +4 -4
- package/lib/module/utils/Portal.js.map +1 -1
- package/lib/module/utils/api.js +24 -24
- package/lib/module/utils/api.js.map +1 -1
- package/lib/module/utils/auth.js +18 -18
- package/lib/module/utils/auth.js.map +1 -1
- package/lib/module/utils/crypto.js +13 -13
- package/lib/module/utils/crypto.js.map +1 -1
- package/lib/module/utils/debugHelper.js.map +1 -1
- package/lib/module/utils/encryption.js +12 -12
- package/lib/module/utils/encryption.js.map +1 -1
- package/lib/module/utils/onairosApi.js.map +1 -1
- package/lib/module/utils/programmaticFlow.js +16 -16
- package/lib/module/utils/programmaticFlow.js.map +1 -1
- package/lib/module/utils/retryHelper.js +27 -27
- package/lib/module/utils/retryHelper.js.map +1 -1
- package/lib/module/utils/secureStorage.js.map +1 -1
- package/lib/typescript/api/index.d.ts +7 -15
- package/lib/typescript/api/index.d.ts.map +1 -1
- package/lib/typescript/components/DataRequestModal.d.ts +10 -10
- package/lib/typescript/components/DataRequestScreen.d.ts +10 -10
- package/lib/typescript/components/EmailVerificationModal.d.ts +10 -10
- package/lib/typescript/components/Onairos.d.ts +3 -3
- package/lib/typescript/components/Onairos.d.ts.map +1 -1
- package/lib/typescript/components/OnairosButton.d.ts +11 -36
- package/lib/typescript/components/OnairosButton.d.ts.map +1 -1
- package/lib/typescript/components/Overlay.d.ts +3 -3
- package/lib/typescript/components/PinInput.d.ts +3 -13
- package/lib/typescript/components/PinInput.d.ts.map +1 -1
- package/lib/typescript/components/PlatformList.d.ts +3 -3
- package/lib/typescript/components/TrainingModal.d.ts +3 -14
- package/lib/typescript/components/TrainingModal.d.ts.map +1 -1
- package/lib/typescript/components/UniversalOnboarding.d.ts +3 -16
- package/lib/typescript/components/UniversalOnboarding.d.ts.map +1 -1
- package/lib/typescript/components/onboarding/OAuthWebView.d.ts +9 -9
- package/lib/typescript/components/onboarding/OAuthWebView.d.ts.map +1 -1
- package/lib/typescript/components/onboarding/OnboardingHeader.d.ts +10 -10
- package/lib/typescript/components/onboarding/PinInput.d.ts +3 -3
- package/lib/typescript/components/onboarding/PlatformConnector.d.ts +12 -12
- package/lib/typescript/components/screens/ConnectorScreen.d.ts +8 -8
- package/lib/typescript/components/screens/LoadingScreen.d.ts +8 -8
- package/lib/typescript/components/screens/PinCreationScreen.d.ts +9 -9
- package/lib/typescript/constants/index.d.ts +52 -52
- package/lib/typescript/hooks/useConnections.d.ts +8 -13
- package/lib/typescript/hooks/useConnections.d.ts.map +1 -1
- package/lib/typescript/hooks/useCredentials.d.ts +8 -8
- package/lib/typescript/index.d.ts +17 -38
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/services/apiKeyService.d.ts +131 -131
- package/lib/typescript/services/apiKeyService.d.ts.map +1 -1
- package/lib/typescript/services/oauthService.d.ts +49 -49
- package/lib/typescript/services/platformAuthService.d.ts +143 -68
- package/lib/typescript/services/platformAuthService.d.ts.map +1 -1
- package/lib/typescript/types/index.d.ts +228 -264
- package/lib/typescript/types/index.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +268 -266
- package/lib/typescript/types.d.ts.map +1 -1
- package/lib/typescript/utils/Portal.d.ts +13 -13
- package/lib/typescript/utils/api.d.ts +5 -5
- package/lib/typescript/utils/auth.d.ts +5 -5
- package/lib/typescript/utils/crypto.d.ts +3 -3
- package/lib/typescript/utils/debugHelper.d.ts +28 -28
- package/lib/typescript/utils/encryption.d.ts +18 -18
- package/lib/typescript/utils/onairosApi.d.ts +86 -86
- package/lib/typescript/utils/programmaticFlow.d.ts +22 -22
- package/lib/typescript/utils/retryHelper.d.ts +68 -68
- package/lib/typescript/utils/secureStorage.d.ts +93 -93
- package/package.json +149 -145
- package/src/api/index.ts +110 -151
- package/src/assets/images/email.png +0 -0
- package/src/assets/images/linkedin.png +0 -0
- package/src/assets/images/reddit.png +0 -0
- package/src/assets/images/youtube.png +0 -0
- package/src/components/DataRequestScreen.tsx +355 -355
- package/src/components/EmailVerificationModal.tsx +363 -363
- package/src/components/Onairos.tsx +424 -422
- package/src/components/OnairosButton.tsx +359 -339
- package/src/components/Overlay.tsx +506 -506
- package/src/components/PinInput.tsx +343 -555
- package/src/components/PlatformList.tsx +144 -144
- package/src/components/TrainingModal.tsx +737 -1047
- package/src/components/UniversalOnboarding.tsx +1839 -2888
- package/src/components/UniversalOnboarding.tsx.new +455 -0
- package/src/components/onboarding/OAuthWebView.tsx +838 -232
- package/src/hooks/useConnections.ts +163 -161
- package/src/hooks/useCredentials.ts +174 -174
- package/src/index.js +14 -14
- package/src/index.ts +49 -99
- package/src/services/SDK_API_KEY_VALIDATION.md +428 -0
- package/src/services/apiKeyService.ts +921 -919
- package/src/services/platformAuthService.ts +1113 -1346
- package/src/types/ambient.d.ts +28 -28
- package/src/types/index.ts +241 -265
- package/src/types/node-fix.d.ts +18 -18
- package/src/types/node-override.d.ts +23 -23
- package/src/types/opacity.d.ts +15 -15
- package/src/types/types.d.ts +17 -17
- package/src/types.ts +6 -4
- package/src/utils/Portal.tsx +82 -82
- package/src/utils/api.js +111 -111
- package/src/utils/auth.js +103 -103
- package/src/utils/crypto.js +59 -59
- package/src/utils/encryption.ts +68 -68
- package/src/utils/programmaticFlow.ts +112 -112
- package/src/utils/retryHelper.ts +274 -274
- package/types/index.d.ts +213 -213
- package/types/node-env.d.ts +14 -14
- package/lib/commonjs/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
- package/lib/commonjs/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
- package/lib/commonjs/assets/icons/Facebookicon.png +0 -0
- package/lib/commonjs/assets/icons/Gmail.png +0 -0
- package/lib/commonjs/assets/icons/Linkedinicon.png +0 -0
- package/lib/commonjs/assets/icons/Redditicon.png +0 -0
- package/lib/commonjs/assets/icons/YouTubeicon2.png +0 -0
- package/lib/commonjs/assets/icons/YouTubeicon3.png +0 -0
- package/lib/commonjs/assets/icons/farcaster.png +0 -0
- package/lib/commonjs/assets/icons/instagram.png +0 -0
- package/lib/commonjs/assets/icons/pinterest.png +0 -0
- package/lib/commonjs/assets/icons/swerv_logo.png +0 -0
- package/lib/commonjs/assets/icons/twitter.jpg +0 -0
- package/lib/commonjs/assets/images/Checkbox.svg +0 -3
- package/lib/commonjs/assets/images/EnochE.svg +0 -19
- package/lib/commonjs/assets/images/Enochicon1.png +0 -0
- package/lib/commonjs/assets/images/Face_ID_logo.png +0 -0
- package/lib/commonjs/assets/images/Facebookicon.png +0 -0
- package/lib/commonjs/assets/images/Gmail.png +0 -0
- package/lib/commonjs/assets/images/Googlelogo.png +0 -0
- package/lib/commonjs/assets/images/Linkedinicon.png +0 -0
- package/lib/commonjs/assets/images/Onairoslogo.png +0 -0
- package/lib/commonjs/assets/images/Personalityprofile.svg +0 -3
- package/lib/commonjs/assets/images/Personalitytraits.svg +0 -3
- package/lib/commonjs/assets/images/Redditicon.png +0 -0
- package/lib/commonjs/assets/images/Userpreferences.svg +0 -3
- package/lib/commonjs/assets/images/YouTubeicon3.png +0 -0
- package/lib/commonjs/assets/images/arrow.svg +0 -20
- package/lib/commonjs/assets/images/basicproficon.svg +0 -43
- package/lib/commonjs/assets/images/basicprofile.svg +0 -3
- package/lib/commonjs/assets/images/checkmark.svg +0 -4
- package/lib/commonjs/assets/images/contentanalysis.svg +0 -3
- package/lib/commonjs/assets/images/contenticon.svg +0 -23
- package/lib/commonjs/assets/images/persona1.png +0 -0
- package/lib/commonjs/assets/images/persona2.png +0 -0
- package/lib/commonjs/assets/images/persona3.png +0 -0
- package/lib/commonjs/assets/images/persona4.png +0 -0
- package/lib/commonjs/assets/images/persona5.png +0 -0
- package/lib/commonjs/assets/images/personalityicon.svg +0 -18
- package/lib/commonjs/assets/images/x-close.svg +0 -3
- package/lib/commonjs/components/BodyText.js +0 -27
- package/lib/commonjs/components/BodyText.js.map +0 -1
- package/lib/commonjs/components/BrandMark.js +0 -44
- package/lib/commonjs/components/BrandMark.js.map +0 -1
- package/lib/commonjs/components/CodeInput.js +0 -30
- package/lib/commonjs/components/CodeInput.js.map +0 -1
- package/lib/commonjs/components/EmailInput.js +0 -30
- package/lib/commonjs/components/EmailInput.js.map +0 -1
- package/lib/commonjs/components/ExistingUserDataConfirmation.js +0 -474
- package/lib/commonjs/components/ExistingUserDataConfirmation.js.map +0 -1
- package/lib/commonjs/components/GoogleButton.js +0 -55
- package/lib/commonjs/components/GoogleButton.js.map +0 -1
- package/lib/commonjs/components/HeadingGroup.js +0 -43
- package/lib/commonjs/components/HeadingGroup.js.map +0 -1
- package/lib/commonjs/components/ModalHeader.js +0 -99
- package/lib/commonjs/components/ModalHeader.js.map +0 -1
- package/lib/commonjs/components/ModalSheet.js +0 -47
- package/lib/commonjs/components/ModalSheet.js.map +0 -1
- package/lib/commonjs/components/OnairosSignInButton.js +0 -129
- package/lib/commonjs/components/OnairosSignInButton.js.map +0 -1
- package/lib/commonjs/components/PersonaImage.js +0 -60
- package/lib/commonjs/components/PersonaImage.js.map +0 -1
- package/lib/commonjs/components/PersonaLoadingScreen.js +0 -156
- package/lib/commonjs/components/PersonaLoadingScreen.js.map +0 -1
- package/lib/commonjs/components/PersonalizationConsentScreen.js +0 -316
- package/lib/commonjs/components/PersonalizationConsentScreen.js.map +0 -1
- package/lib/commonjs/components/PinCreationScreen.js +0 -393
- package/lib/commonjs/components/PinCreationScreen.js.map +0 -1
- package/lib/commonjs/components/PlatformConnectorsStep.js +0 -828
- package/lib/commonjs/components/PlatformConnectorsStep.js.map +0 -1
- package/lib/commonjs/components/PlatformToggle.js +0 -180
- package/lib/commonjs/components/PlatformToggle.js.map +0 -1
- package/lib/commonjs/components/PrimaryButton.js +0 -180
- package/lib/commonjs/components/PrimaryButton.js.map +0 -1
- package/lib/commonjs/components/SignInMatchAnimation.js +0 -197
- package/lib/commonjs/components/SignInMatchAnimation.js.map +0 -1
- package/lib/commonjs/components/SignInStep.js +0 -179
- package/lib/commonjs/components/SignInStep.js.map +0 -1
- package/lib/commonjs/components/VerificationStep.js +0 -154
- package/lib/commonjs/components/VerificationStep.js.map +0 -1
- package/lib/commonjs/components/WelcomeScreen.js +0 -401
- package/lib/commonjs/components/WelcomeScreen.js.map +0 -1
- package/lib/commonjs/components/icons/Basicproficon.js +0 -37
- package/lib/commonjs/components/icons/Basicproficon.js.map +0 -1
- package/lib/commonjs/components/icons/Basicprofile.js +0 -21
- package/lib/commonjs/components/icons/Basicprofile.js.map +0 -1
- package/lib/commonjs/components/icons/Checkbox.js +0 -21
- package/lib/commonjs/components/icons/Checkbox.js.map +0 -1
- package/lib/commonjs/components/icons/Checkmark.js +0 -27
- package/lib/commonjs/components/icons/Checkmark.js.map +0 -1
- package/lib/commonjs/components/icons/Contentanalysis.js +0 -21
- package/lib/commonjs/components/icons/Contentanalysis.js.map +0 -1
- package/lib/commonjs/components/icons/Contenticon.js +0 -39
- package/lib/commonjs/components/icons/Contenticon.js.map +0 -1
- package/lib/commonjs/components/icons/EnochE.js +0 -41
- package/lib/commonjs/components/icons/EnochE.js.map +0 -1
- package/lib/commonjs/components/icons/Personalityicon.js +0 -30
- package/lib/commonjs/components/icons/Personalityicon.js.map +0 -1
- package/lib/commonjs/components/icons/Personalityprofile.js +0 -21
- package/lib/commonjs/components/icons/Personalityprofile.js.map +0 -1
- package/lib/commonjs/components/icons/Personalitytraits.js +0 -21
- package/lib/commonjs/components/icons/Personalitytraits.js.map +0 -1
- package/lib/commonjs/components/icons/Userpreferences.js +0 -21
- package/lib/commonjs/components/icons/Userpreferences.js.map +0 -1
- package/lib/commonjs/components/icons/index.js +0 -84
- package/lib/commonjs/components/icons/index.js.map +0 -1
- package/lib/commonjs/config/api.js +0 -34
- package/lib/commonjs/config/api.js.map +0 -1
- package/lib/commonjs/context/AuthContext.js +0 -345
- package/lib/commonjs/context/AuthContext.js.map +0 -1
- package/lib/commonjs/hooks/useConnectedAccounts.js +0 -111
- package/lib/commonjs/hooks/useConnectedAccounts.js.map +0 -1
- package/lib/commonjs/hooks/useUserConnections.js +0 -148
- package/lib/commonjs/hooks/useUserConnections.js.map +0 -1
- package/lib/commonjs/services/apiClient.js +0 -302
- package/lib/commonjs/services/apiClient.js.map +0 -1
- package/lib/commonjs/services/authService.js +0 -935
- package/lib/commonjs/services/authService.js.map +0 -1
- package/lib/commonjs/services/biometricPinService.js +0 -184
- package/lib/commonjs/services/biometricPinService.js.map +0 -1
- package/lib/commonjs/services/connectedAccountsService.js +0 -268
- package/lib/commonjs/services/connectedAccountsService.js.map +0 -1
- package/lib/commonjs/services/googleAuthService.js +0 -268
- package/lib/commonjs/services/googleAuthService.js.map +0 -1
- package/lib/commonjs/services/imageCompressionService.js +0 -260
- package/lib/commonjs/services/imageCompressionService.js.map +0 -1
- package/lib/commonjs/services/jwtStorageService.js +0 -256
- package/lib/commonjs/services/jwtStorageService.js.map +0 -1
- package/lib/commonjs/services/mobileTrainingService.js +0 -185
- package/lib/commonjs/services/mobileTrainingService.js.map +0 -1
- package/lib/commonjs/services/pinEncryptionService.js +0 -84
- package/lib/commonjs/services/pinEncryptionService.js.map +0 -1
- package/lib/commonjs/services/pinStorageUtils.js +0 -105
- package/lib/commonjs/services/pinStorageUtils.js.map +0 -1
- package/lib/commonjs/services/storageService.js +0 -404
- package/lib/commonjs/services/storageService.js.map +0 -1
- package/lib/commonjs/services/trainingApiHelpers.js +0 -73
- package/lib/commonjs/services/trainingApiHelpers.js.map +0 -1
- package/lib/commonjs/services/userConnectionsService.js +0 -486
- package/lib/commonjs/services/userConnectionsService.js.map +0 -1
- package/lib/commonjs/services/youtubeMigrationService.js +0 -415
- package/lib/commonjs/services/youtubeMigrationService.js.map +0 -1
- package/lib/commonjs/theme/index.js +0 -249
- package/lib/commonjs/theme/index.js.map +0 -1
- package/lib/commonjs/utils/eventUtils.js +0 -288
- package/lib/commonjs/utils/eventUtils.js.map +0 -1
- package/lib/commonjs/utils/haptics.js +0 -66
- package/lib/commonjs/utils/haptics.js.map +0 -1
- package/lib/commonjs/utils/imagePreloader.js +0 -6
- package/lib/commonjs/utils/imagePreloader.js.map +0 -1
- package/lib/module/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
- package/lib/module/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
- package/lib/module/assets/icons/Facebookicon.png +0 -0
- package/lib/module/assets/icons/Gmail.png +0 -0
- package/lib/module/assets/icons/Linkedinicon.png +0 -0
- package/lib/module/assets/icons/Redditicon.png +0 -0
- package/lib/module/assets/icons/YouTubeicon2.png +0 -0
- package/lib/module/assets/icons/YouTubeicon3.png +0 -0
- package/lib/module/assets/icons/farcaster.png +0 -0
- package/lib/module/assets/icons/instagram.png +0 -0
- package/lib/module/assets/icons/pinterest.png +0 -0
- package/lib/module/assets/icons/swerv_logo.png +0 -0
- package/lib/module/assets/icons/twitter.jpg +0 -0
- package/lib/module/assets/images/Checkbox.svg +0 -3
- package/lib/module/assets/images/EnochE.svg +0 -19
- package/lib/module/assets/images/Enochicon1.png +0 -0
- package/lib/module/assets/images/Face_ID_logo.png +0 -0
- package/lib/module/assets/images/Facebookicon.png +0 -0
- package/lib/module/assets/images/Gmail.png +0 -0
- package/lib/module/assets/images/Googlelogo.png +0 -0
- package/lib/module/assets/images/Linkedinicon.png +0 -0
- package/lib/module/assets/images/Onairoslogo.png +0 -0
- package/lib/module/assets/images/Personalityprofile.svg +0 -3
- package/lib/module/assets/images/Personalitytraits.svg +0 -3
- package/lib/module/assets/images/Redditicon.png +0 -0
- package/lib/module/assets/images/Userpreferences.svg +0 -3
- package/lib/module/assets/images/YouTubeicon3.png +0 -0
- package/lib/module/assets/images/arrow.svg +0 -20
- package/lib/module/assets/images/basicproficon.svg +0 -43
- package/lib/module/assets/images/basicprofile.svg +0 -3
- package/lib/module/assets/images/checkmark.svg +0 -4
- package/lib/module/assets/images/contentanalysis.svg +0 -3
- package/lib/module/assets/images/contenticon.svg +0 -23
- package/lib/module/assets/images/persona1.png +0 -0
- package/lib/module/assets/images/persona2.png +0 -0
- package/lib/module/assets/images/persona3.png +0 -0
- package/lib/module/assets/images/persona4.png +0 -0
- package/lib/module/assets/images/persona5.png +0 -0
- package/lib/module/assets/images/personalityicon.svg +0 -18
- package/lib/module/assets/images/x-close.svg +0 -3
- package/lib/module/components/BodyText.js +0 -20
- package/lib/module/components/BodyText.js.map +0 -1
- package/lib/module/components/BrandMark.js +0 -37
- package/lib/module/components/BrandMark.js.map +0 -1
- package/lib/module/components/CodeInput.js +0 -23
- package/lib/module/components/CodeInput.js.map +0 -1
- package/lib/module/components/EmailInput.js +0 -23
- package/lib/module/components/EmailInput.js.map +0 -1
- package/lib/module/components/ExistingUserDataConfirmation.js +0 -465
- package/lib/module/components/ExistingUserDataConfirmation.js.map +0 -1
- package/lib/module/components/GoogleButton.js +0 -48
- package/lib/module/components/GoogleButton.js.map +0 -1
- package/lib/module/components/HeadingGroup.js +0 -36
- package/lib/module/components/HeadingGroup.js.map +0 -1
- package/lib/module/components/ModalHeader.js +0 -92
- package/lib/module/components/ModalHeader.js.map +0 -1
- package/lib/module/components/ModalSheet.js +0 -39
- package/lib/module/components/ModalSheet.js.map +0 -1
- package/lib/module/components/OnairosSignInButton.js +0 -120
- package/lib/module/components/OnairosSignInButton.js.map +0 -1
- package/lib/module/components/PersonaImage.js +0 -53
- package/lib/module/components/PersonaImage.js.map +0 -1
- package/lib/module/components/PersonaLoadingScreen.js +0 -148
- package/lib/module/components/PersonaLoadingScreen.js.map +0 -1
- package/lib/module/components/PersonalizationConsentScreen.js +0 -309
- package/lib/module/components/PersonalizationConsentScreen.js.map +0 -1
- package/lib/module/components/PinCreationScreen.js +0 -386
- package/lib/module/components/PinCreationScreen.js.map +0 -1
- package/lib/module/components/PlatformConnectorsStep.js +0 -820
- package/lib/module/components/PlatformConnectorsStep.js.map +0 -1
- package/lib/module/components/PlatformToggle.js +0 -173
- package/lib/module/components/PlatformToggle.js.map +0 -1
- package/lib/module/components/PrimaryButton.js +0 -172
- package/lib/module/components/PrimaryButton.js.map +0 -1
- package/lib/module/components/SignInMatchAnimation.js +0 -189
- package/lib/module/components/SignInMatchAnimation.js.map +0 -1
- package/lib/module/components/SignInStep.js +0 -171
- package/lib/module/components/SignInStep.js.map +0 -1
- package/lib/module/components/VerificationStep.js +0 -146
- package/lib/module/components/VerificationStep.js.map +0 -1
- package/lib/module/components/WelcomeScreen.js +0 -393
- package/lib/module/components/WelcomeScreen.js.map +0 -1
- package/lib/module/components/icons/Basicproficon.js +0 -30
- package/lib/module/components/icons/Basicproficon.js.map +0 -1
- package/lib/module/components/icons/Basicprofile.js +0 -14
- package/lib/module/components/icons/Basicprofile.js.map +0 -1
- package/lib/module/components/icons/Checkbox.js +0 -14
- package/lib/module/components/icons/Checkbox.js.map +0 -1
- package/lib/module/components/icons/Checkmark.js +0 -20
- package/lib/module/components/icons/Checkmark.js.map +0 -1
- package/lib/module/components/icons/Contentanalysis.js +0 -14
- package/lib/module/components/icons/Contentanalysis.js.map +0 -1
- package/lib/module/components/icons/Contenticon.js +0 -32
- package/lib/module/components/icons/Contenticon.js.map +0 -1
- package/lib/module/components/icons/EnochE.js +0 -34
- package/lib/module/components/icons/EnochE.js.map +0 -1
- package/lib/module/components/icons/Personalityicon.js +0 -23
- package/lib/module/components/icons/Personalityicon.js.map +0 -1
- package/lib/module/components/icons/Personalityprofile.js +0 -14
- package/lib/module/components/icons/Personalityprofile.js.map +0 -1
- package/lib/module/components/icons/Personalitytraits.js +0 -14
- package/lib/module/components/icons/Personalitytraits.js.map +0 -1
- package/lib/module/components/icons/Userpreferences.js +0 -14
- package/lib/module/components/icons/Userpreferences.js.map +0 -1
- package/lib/module/components/icons/index.js +0 -13
- package/lib/module/components/icons/index.js.map +0 -1
- package/lib/module/config/api.js +0 -26
- package/lib/module/config/api.js.map +0 -1
- package/lib/module/context/AuthContext.js +0 -335
- package/lib/module/context/AuthContext.js.map +0 -1
- package/lib/module/hooks/useConnectedAccounts.js +0 -106
- package/lib/module/hooks/useConnectedAccounts.js.map +0 -1
- package/lib/module/hooks/useUserConnections.js +0 -140
- package/lib/module/hooks/useUserConnections.js.map +0 -1
- package/lib/module/services/apiClient.js +0 -298
- package/lib/module/services/apiClient.js.map +0 -1
- package/lib/module/services/authService.js +0 -905
- package/lib/module/services/authService.js.map +0 -1
- package/lib/module/services/biometricPinService.js +0 -173
- package/lib/module/services/biometricPinService.js.map +0 -1
- package/lib/module/services/connectedAccountsService.js +0 -255
- package/lib/module/services/connectedAccountsService.js.map +0 -1
- package/lib/module/services/googleAuthService.js +0 -258
- package/lib/module/services/googleAuthService.js.map +0 -1
- package/lib/module/services/imageCompressionService.js +0 -250
- package/lib/module/services/imageCompressionService.js.map +0 -1
- package/lib/module/services/jwtStorageService.js +0 -239
- package/lib/module/services/jwtStorageService.js.map +0 -1
- package/lib/module/services/mobileTrainingService.js +0 -172
- package/lib/module/services/mobileTrainingService.js.map +0 -1
- package/lib/module/services/pinEncryptionService.js +0 -75
- package/lib/module/services/pinEncryptionService.js.map +0 -1
- package/lib/module/services/pinStorageUtils.js +0 -93
- package/lib/module/services/pinStorageUtils.js.map +0 -1
- package/lib/module/services/storageService.js +0 -383
- package/lib/module/services/storageService.js.map +0 -1
- package/lib/module/services/trainingApiHelpers.js +0 -67
- package/lib/module/services/trainingApiHelpers.js.map +0 -1
- package/lib/module/services/userConnectionsService.js +0 -476
- package/lib/module/services/userConnectionsService.js.map +0 -1
- package/lib/module/services/youtubeMigrationService.js +0 -404
- package/lib/module/services/youtubeMigrationService.js.map +0 -1
- package/lib/module/theme/index.js +0 -244
- package/lib/module/theme/index.js.map +0 -1
- package/lib/module/utils/eventUtils.js +0 -270
- package/lib/module/utils/eventUtils.js.map +0 -1
- package/lib/module/utils/haptics.js +0 -59
- package/lib/module/utils/haptics.js.map +0 -1
- package/lib/module/utils/imagePreloader.js +0 -3
- package/lib/module/utils/imagePreloader.js.map +0 -1
- package/lib/typescript/components/BodyText.d.ts +0 -10
- package/lib/typescript/components/BodyText.d.ts.map +0 -1
- package/lib/typescript/components/BrandMark.d.ts +0 -11
- package/lib/typescript/components/BrandMark.d.ts.map +0 -1
- package/lib/typescript/components/CodeInput.d.ts +0 -10
- package/lib/typescript/components/CodeInput.d.ts.map +0 -1
- package/lib/typescript/components/EmailInput.d.ts +0 -8
- package/lib/typescript/components/EmailInput.d.ts.map +0 -1
- package/lib/typescript/components/ExistingUserDataConfirmation.d.ts +0 -12
- package/lib/typescript/components/ExistingUserDataConfirmation.d.ts.map +0 -1
- package/lib/typescript/components/GoogleButton.d.ts +0 -11
- package/lib/typescript/components/GoogleButton.d.ts.map +0 -1
- package/lib/typescript/components/HeadingGroup.d.ts +0 -11
- package/lib/typescript/components/HeadingGroup.d.ts.map +0 -1
- package/lib/typescript/components/ModalHeader.d.ts +0 -11
- package/lib/typescript/components/ModalHeader.d.ts.map +0 -1
- package/lib/typescript/components/ModalSheet.d.ts +0 -13
- package/lib/typescript/components/ModalSheet.d.ts.map +0 -1
- package/lib/typescript/components/OnairosSignInButton.d.ts +0 -13
- package/lib/typescript/components/OnairosSignInButton.d.ts.map +0 -1
- package/lib/typescript/components/PersonaImage.d.ts +0 -8
- package/lib/typescript/components/PersonaImage.d.ts.map +0 -1
- package/lib/typescript/components/PersonaLoadingScreen.d.ts +0 -10
- package/lib/typescript/components/PersonaLoadingScreen.d.ts.map +0 -1
- package/lib/typescript/components/PersonalizationConsentScreen.d.ts +0 -10
- package/lib/typescript/components/PersonalizationConsentScreen.d.ts.map +0 -1
- package/lib/typescript/components/PinCreationScreen.d.ts +0 -10
- package/lib/typescript/components/PinCreationScreen.d.ts.map +0 -1
- package/lib/typescript/components/PlatformConnectorsStep.d.ts +0 -11
- package/lib/typescript/components/PlatformConnectorsStep.d.ts.map +0 -1
- package/lib/typescript/components/PlatformToggle.d.ts +0 -20
- package/lib/typescript/components/PlatformToggle.d.ts.map +0 -1
- package/lib/typescript/components/PrimaryButton.d.ts +0 -22
- package/lib/typescript/components/PrimaryButton.d.ts.map +0 -1
- package/lib/typescript/components/SignInMatchAnimation.d.ts +0 -9
- package/lib/typescript/components/SignInMatchAnimation.d.ts.map +0 -1
- package/lib/typescript/components/SignInStep.d.ts +0 -12
- package/lib/typescript/components/SignInStep.d.ts.map +0 -1
- package/lib/typescript/components/VerificationStep.d.ts +0 -13
- package/lib/typescript/components/VerificationStep.d.ts.map +0 -1
- package/lib/typescript/components/WelcomeScreen.d.ts +0 -9
- package/lib/typescript/components/WelcomeScreen.d.ts.map +0 -1
- package/lib/typescript/components/icons/Basicproficon.d.ts +0 -5
- package/lib/typescript/components/icons/Basicproficon.d.ts.map +0 -1
- package/lib/typescript/components/icons/Basicprofile.d.ts +0 -5
- package/lib/typescript/components/icons/Basicprofile.d.ts.map +0 -1
- package/lib/typescript/components/icons/Checkbox.d.ts +0 -5
- package/lib/typescript/components/icons/Checkbox.d.ts.map +0 -1
- package/lib/typescript/components/icons/Checkmark.d.ts +0 -5
- package/lib/typescript/components/icons/Checkmark.d.ts.map +0 -1
- package/lib/typescript/components/icons/Contentanalysis.d.ts +0 -5
- package/lib/typescript/components/icons/Contentanalysis.d.ts.map +0 -1
- package/lib/typescript/components/icons/Contenticon.d.ts +0 -5
- package/lib/typescript/components/icons/Contenticon.d.ts.map +0 -1
- package/lib/typescript/components/icons/EnochE.d.ts +0 -5
- package/lib/typescript/components/icons/EnochE.d.ts.map +0 -1
- package/lib/typescript/components/icons/Personalityicon.d.ts +0 -5
- package/lib/typescript/components/icons/Personalityicon.d.ts.map +0 -1
- package/lib/typescript/components/icons/Personalityprofile.d.ts +0 -5
- package/lib/typescript/components/icons/Personalityprofile.d.ts.map +0 -1
- package/lib/typescript/components/icons/Personalitytraits.d.ts +0 -5
- package/lib/typescript/components/icons/Personalitytraits.d.ts.map +0 -1
- package/lib/typescript/components/icons/Userpreferences.d.ts +0 -5
- package/lib/typescript/components/icons/Userpreferences.d.ts.map +0 -1
- package/lib/typescript/components/icons/index.d.ts +0 -12
- package/lib/typescript/components/icons/index.d.ts.map +0 -1
- package/lib/typescript/config/api.d.ts +0 -24
- package/lib/typescript/config/api.d.ts.map +0 -1
- package/lib/typescript/context/AuthContext.d.ts +0 -34
- package/lib/typescript/context/AuthContext.d.ts.map +0 -1
- package/lib/typescript/hooks/useConnectedAccounts.d.ts +0 -11
- package/lib/typescript/hooks/useConnectedAccounts.d.ts.map +0 -1
- package/lib/typescript/hooks/useUserConnections.d.ts +0 -12
- package/lib/typescript/hooks/useUserConnections.d.ts.map +0 -1
- package/lib/typescript/services/apiClient.d.ts +0 -91
- package/lib/typescript/services/apiClient.d.ts.map +0 -1
- package/lib/typescript/services/authService.d.ts +0 -216
- package/lib/typescript/services/authService.d.ts.map +0 -1
- package/lib/typescript/services/biometricPinService.d.ts +0 -29
- package/lib/typescript/services/biometricPinService.d.ts.map +0 -1
- package/lib/typescript/services/connectedAccountsService.d.ts +0 -56
- package/lib/typescript/services/connectedAccountsService.d.ts.map +0 -1
- package/lib/typescript/services/googleAuthService.d.ts +0 -63
- package/lib/typescript/services/googleAuthService.d.ts.map +0 -1
- package/lib/typescript/services/imageCompressionService.d.ts +0 -37
- package/lib/typescript/services/imageCompressionService.d.ts.map +0 -1
- package/lib/typescript/services/jwtStorageService.d.ts +0 -86
- package/lib/typescript/services/jwtStorageService.d.ts.map +0 -1
- package/lib/typescript/services/mobileTrainingService.d.ts +0 -45
- package/lib/typescript/services/mobileTrainingService.d.ts.map +0 -1
- package/lib/typescript/services/pinEncryptionService.d.ts +0 -17
- package/lib/typescript/services/pinEncryptionService.d.ts.map +0 -1
- package/lib/typescript/services/pinStorageUtils.d.ts +0 -25
- package/lib/typescript/services/pinStorageUtils.d.ts.map +0 -1
- package/lib/typescript/services/storageService.d.ts +0 -128
- package/lib/typescript/services/storageService.d.ts.map +0 -1
- package/lib/typescript/services/trainingApiHelpers.d.ts +0 -38
- package/lib/typescript/services/trainingApiHelpers.d.ts.map +0 -1
- package/lib/typescript/services/userConnectionsService.d.ts +0 -90
- package/lib/typescript/services/userConnectionsService.d.ts.map +0 -1
- package/lib/typescript/services/youtubeMigrationService.d.ts +0 -12
- package/lib/typescript/services/youtubeMigrationService.d.ts.map +0 -1
- package/lib/typescript/theme/index.d.ts +0 -416
- package/lib/typescript/theme/index.d.ts.map +0 -1
- package/lib/typescript/utils/eventUtils.d.ts +0 -108
- package/lib/typescript/utils/eventUtils.d.ts.map +0 -1
- package/lib/typescript/utils/haptics.d.ts +0 -11
- package/lib/typescript/utils/haptics.d.ts.map +0 -1
- package/lib/typescript/utils/imagePreloader.d.ts +0 -2
- package/lib/typescript/utils/imagePreloader.d.ts.map +0 -1
- package/src/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
- package/src/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
- package/src/assets/icons/Facebookicon.png +0 -0
- package/src/assets/icons/Gmail.png +0 -0
- package/src/assets/icons/Linkedinicon.png +0 -0
- package/src/assets/icons/Redditicon.png +0 -0
- package/src/assets/icons/YouTubeicon2.png +0 -0
- package/src/assets/icons/YouTubeicon3.png +0 -0
- package/src/assets/icons/farcaster.png +0 -0
- package/src/assets/icons/instagram.png +0 -0
- package/src/assets/icons/pinterest.png +0 -0
- package/src/assets/icons/swerv_logo.png +0 -0
- package/src/assets/icons/twitter.jpg +0 -0
- package/src/assets/images/Checkbox.svg +0 -3
- package/src/assets/images/EnochE.svg +0 -19
- package/src/assets/images/Enochicon1.png +0 -0
- package/src/assets/images/Face_ID_logo.png +0 -0
- package/src/assets/images/Facebookicon.png +0 -0
- package/src/assets/images/Gmail.png +0 -0
- package/src/assets/images/Googlelogo.png +0 -0
- package/src/assets/images/Linkedinicon.png +0 -0
- package/src/assets/images/Onairoslogo.png +0 -0
- package/src/assets/images/Personalityprofile.svg +0 -3
- package/src/assets/images/Personalitytraits.svg +0 -3
- package/src/assets/images/Redditicon.png +0 -0
- package/src/assets/images/Userpreferences.svg +0 -3
- package/src/assets/images/YouTubeicon3.png +0 -0
- package/src/assets/images/arrow.svg +0 -20
- package/src/assets/images/basicproficon.svg +0 -43
- package/src/assets/images/basicprofile.svg +0 -3
- package/src/assets/images/checkmark.svg +0 -4
- package/src/assets/images/contentanalysis.svg +0 -3
- package/src/assets/images/contenticon.svg +0 -23
- package/src/assets/images/persona1.png +0 -0
- package/src/assets/images/persona2.png +0 -0
- package/src/assets/images/persona3.png +0 -0
- package/src/assets/images/persona4.png +0 -0
- package/src/assets/images/persona5.png +0 -0
- package/src/assets/images/personalityicon.svg +0 -18
- package/src/assets/images/x-close.svg +0 -3
- package/src/components/BodyText.tsx +0 -33
- package/src/components/BrandMark.tsx +0 -62
- package/src/components/CodeInput.tsx +0 -32
- package/src/components/EmailInput.tsx +0 -31
- package/src/components/ExistingUserDataConfirmation.tsx +0 -507
- package/src/components/GoogleButton.tsx +0 -55
- package/src/components/HeadingGroup.tsx +0 -49
- package/src/components/ModalHeader.tsx +0 -125
- package/src/components/ModalSheet.tsx +0 -59
- package/src/components/OnairosSignInButton.tsx +0 -132
- package/src/components/PersonaImage.tsx +0 -79
- package/src/components/PersonaLoadingScreen.tsx +0 -201
- package/src/components/PersonalizationConsentScreen.tsx +0 -410
- package/src/components/PinCreationScreen.tsx +0 -492
- package/src/components/PlatformConnectorsStep.tsx +0 -892
- package/src/components/PlatformToggle.tsx +0 -226
- package/src/components/PrimaryButton.tsx +0 -214
- package/src/components/SignInMatchAnimation.tsx +0 -225
- package/src/components/SignInStep.tsx +0 -217
- package/src/components/VerificationStep.tsx +0 -198
- package/src/components/WelcomeScreen.tsx +0 -490
- package/src/components/icons/Basicproficon.tsx +0 -30
- package/src/components/icons/Basicprofile.tsx +0 -17
- package/src/components/icons/Checkbox.tsx +0 -17
- package/src/components/icons/Checkmark.tsx +0 -24
- package/src/components/icons/Contentanalysis.tsx +0 -17
- package/src/components/icons/Contenticon.tsx +0 -30
- package/src/components/icons/EnochE.tsx +0 -39
- package/src/components/icons/Personalityicon.tsx +0 -22
- package/src/components/icons/Personalityprofile.tsx +0 -17
- package/src/components/icons/Personalitytraits.tsx +0 -17
- package/src/components/icons/Userpreferences.tsx +0 -17
- package/src/components/icons/index.ts +0 -12
- package/src/config/api.ts +0 -25
- package/src/context/AuthContext.tsx +0 -393
- package/src/hooks/useConnectedAccounts.ts +0 -139
- package/src/hooks/useUserConnections.ts +0 -166
- package/src/services/apiClient.ts +0 -337
- package/src/services/authService.ts +0 -1008
- package/src/services/biometricPinService.ts +0 -193
- package/src/services/connectedAccountsService.ts +0 -290
- package/src/services/googleAuthService.ts +0 -279
- package/src/services/imageCompressionService.ts +0 -303
- package/src/services/jwtStorageService.ts +0 -257
- package/src/services/mobileTrainingService.ts +0 -204
- package/src/services/pinEncryptionService.ts +0 -76
- package/src/services/pinStorageUtils.ts +0 -97
- package/src/services/storageService.ts +0 -452
- package/src/services/trainingApiHelpers.ts +0 -67
- package/src/services/userConnectionsService.ts +0 -557
- package/src/services/youtubeMigrationService.ts +0 -454
- package/src/theme/index.ts +0 -239
- package/src/utils/eventUtils.ts +0 -303
- package/src/utils/haptics.ts +0 -59
- 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,
|
|
3
|
-
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
import { initiateOAuth, initiateNativeAuth, hasNativeSDK, isOAuthCallback } from '../services/platformAuthService';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
38
|
+
testMode = false,
|
|
38
39
|
preferredPlatform,
|
|
39
|
-
|
|
40
|
+
inferenceData,
|
|
41
|
+
auto = false,
|
|
42
|
+
partner
|
|
40
43
|
}) => {
|
|
41
|
-
|
|
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
|
-
|
|
47
|
-
|
|
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 [
|
|
53
|
-
const [
|
|
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
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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
|
-
//
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
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
|
-
|
|
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
|
-
|
|
95
|
+
icon: require('../assets/images/reddit.png')
|
|
222
96
|
}, {
|
|
223
|
-
id: '
|
|
224
|
-
name: '
|
|
225
|
-
|
|
97
|
+
id: 'pinterest',
|
|
98
|
+
name: 'Pinterest',
|
|
99
|
+
icon: require('../assets/images/pinterest.png')
|
|
226
100
|
}];
|
|
227
101
|
|
|
228
|
-
//
|
|
229
|
-
const
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
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
|
-
|
|
268
|
-
|
|
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
|
-
|
|
279
|
-
|
|
280
|
-
useNativeDriver: true
|
|
132
|
+
useNativeDriver: true,
|
|
133
|
+
bounciness: 0
|
|
281
134
|
}).start();
|
|
282
|
-
|
|
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
|
|
287
|
-
//
|
|
206
|
+
} else {
|
|
207
|
+
// Animate out
|
|
288
208
|
Animated.timing(slideAnim, {
|
|
289
209
|
toValue: height,
|
|
290
|
-
|
|
291
|
-
|
|
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
|
-
//
|
|
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,
|
|
216
|
+
}, [visible, preferredPlatform]);
|
|
308
217
|
|
|
309
|
-
// Cleanup
|
|
218
|
+
// Cleanup effect for unmounting
|
|
310
219
|
useEffect(() => {
|
|
311
220
|
return () => {
|
|
312
|
-
|
|
313
|
-
|
|
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
|
-
|
|
344
|
-
|
|
345
|
-
|
|
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
|
-
|
|
376
|
-
|
|
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
|
-
|
|
424
|
-
|
|
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
|
|
241
|
+
// Animate out and then call onClose
|
|
432
242
|
Animated.timing(slideAnim, {
|
|
433
243
|
toValue: height,
|
|
434
|
-
|
|
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
|
-
//
|
|
441
|
-
|
|
442
|
-
|
|
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
|
|
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
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
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(
|
|
497
|
-
|
|
498
|
-
|
|
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
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
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
|
-
//
|
|
524
|
-
if (
|
|
525
|
-
//
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
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
|
-
//
|
|
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
|
-
//
|
|
545
|
-
|
|
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(
|
|
561
|
-
|
|
562
|
-
|
|
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
|
-
//
|
|
393
|
+
// Disconnect platform
|
|
394
|
+
console.log(`🔌 Disconnecting ${platformId}`);
|
|
566
395
|
setPlatformToggles(prev => ({
|
|
567
396
|
...prev,
|
|
568
|
-
[platformId]:
|
|
397
|
+
[platformId]: false
|
|
569
398
|
}));
|
|
570
399
|
|
|
571
|
-
//
|
|
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
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
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
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
420
|
+
// Update connections state
|
|
421
|
+
setConnections(prev => ({
|
|
422
|
+
...prev,
|
|
423
|
+
[result.platform]: {
|
|
424
|
+
userName: username,
|
|
425
|
+
connected: true
|
|
426
|
+
}
|
|
427
|
+
}));
|
|
606
428
|
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
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
|
-
}, [
|
|
443
|
+
}, [username]);
|
|
614
444
|
|
|
615
|
-
/**
|
|
616
|
-
* Handles
|
|
445
|
+
/**
|
|
446
|
+
* Handles completion of the OAuth flow
|
|
617
447
|
*/
|
|
618
|
-
const handleOAuthSuccess = useCallback(
|
|
619
|
-
console.log(
|
|
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
|
|
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
|
|
655
|
-
|
|
656
|
-
|
|
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
|
-
|
|
659
|
-
|
|
660
|
-
|
|
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
|
-
|
|
663
|
-
|
|
664
|
-
|
|
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
|
-
//
|
|
569
|
+
// In development mode, still try to proceed
|
|
570
|
+
console.log('🧪 Error occurred but attempting to proceed to verification step');
|
|
667
571
|
try {
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
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
|
-
|
|
687
|
-
}, [isBackgroundTrainingStarted, backgroundSocketId]);
|
|
578
|
+
}, [email, isVerifyingCode, debug, testMode, isTestMode]);
|
|
688
579
|
|
|
689
|
-
//
|
|
690
|
-
const
|
|
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
|
-
|
|
693
|
-
|
|
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
|
-
//
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
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('
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
console.log('
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
console.log('
|
|
760
|
-
|
|
761
|
-
|
|
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
|
-
|
|
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('❌
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
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
|
-
|
|
780
|
-
const continueBackgroundTrainingWithPin = async userPin => {
|
|
653
|
+
// Save session data for "Never Connect Again" functionality
|
|
781
654
|
try {
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
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
|
-
//
|
|
791
|
-
|
|
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
|
-
|
|
794
|
-
|
|
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
|
-
//
|
|
797
|
-
console.log('
|
|
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('
|
|
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
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
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
|
-
|
|
812
|
-
|
|
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
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
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
|
-
|
|
845
|
-
setUsername(fallbackUsername);
|
|
846
|
-
console.log('🧑💻 Set user info:', newUserInfo);
|
|
785
|
+
console.log('Completion data prepared:', completionData);
|
|
847
786
|
|
|
848
|
-
//
|
|
849
|
-
|
|
850
|
-
}
|
|
787
|
+
// Close the modal first
|
|
788
|
+
handleClose();
|
|
851
789
|
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
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
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
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
|
-
|
|
1196
|
-
|
|
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
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
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
|
-
|
|
1238
|
-
|
|
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
|
-
|
|
1241
|
-
|
|
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
|
-
|
|
1260
|
-
|
|
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
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
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
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
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('
|
|
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
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
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
|
|
1361
|
-
console.log('
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
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
|
-
|
|
1419
|
-
|
|
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
|
-
|
|
1440
|
-
|
|
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
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
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
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
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
|
-
|
|
1512
|
-
|
|
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
|
-
}))
|
|
1541
|
-
style: styles.
|
|
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/
|
|
1556
|
-
style: styles.
|
|
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
|
-
})
|
|
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
|
-
},
|
|
1118
|
+
}, "Let ", AppName, " learn about you from your data and apps"), /*#__PURE__*/React.createElement(Text, {
|
|
1563
1119
|
style: styles.privacyMessage
|
|
1564
|
-
},
|
|
1565
|
-
style: styles.
|
|
1566
|
-
|
|
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
|
-
},
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
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(
|
|
1614
|
-
|
|
1615
|
-
|
|
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
|
-
},
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
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.
|
|
1653
|
-
}, "
|
|
1654
|
-
|
|
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
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
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(
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
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
|
-
},
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
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, !
|
|
1199
|
+
style: [styles.footerButtonConfirm, !canProceedToPin() && styles.footerButtonDisabled],
|
|
1850
1200
|
onPress: handleProceed,
|
|
1851
|
-
disabled: !
|
|
1201
|
+
disabled: !canProceedToPin()
|
|
1852
1202
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
1853
1203
|
style: styles.footerButtonTextConfirm
|
|
1854
|
-
}, "
|
|
1855
|
-
|
|
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.
|
|
1207
|
+
style: styles.successContent
|
|
1889
1208
|
}, /*#__PURE__*/React.createElement(View, {
|
|
1890
|
-
style:
|
|
1891
|
-
|
|
1892
|
-
|
|
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.
|
|
1895
|
-
},
|
|
1896
|
-
style: styles.
|
|
1897
|
-
},
|
|
1898
|
-
style:
|
|
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.
|
|
1993
|
-
}, "
|
|
1994
|
-
style:
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
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
|
-
}))
|
|
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
|
-
|
|
1266
|
+
alignItems: 'center'
|
|
2126
1267
|
},
|
|
2127
1268
|
bottomSheet: {
|
|
2128
|
-
backgroundColor: '#
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2155
|
-
|
|
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:
|
|
1300
|
+
marginBottom: 16
|
|
2163
1301
|
},
|
|
2164
1302
|
appIcon: {
|
|
2165
1303
|
width: 48,
|
|
2166
1304
|
height: 48,
|
|
2167
|
-
borderRadius:
|
|
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
|
-
|
|
2175
|
-
|
|
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:
|
|
2184
|
-
height:
|
|
2185
|
-
borderRadius:
|
|
2186
|
-
backgroundColor: '
|
|
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
|
-
|
|
2193
|
-
color: '#fff'
|
|
1331
|
+
color: '#000'
|
|
2194
1332
|
},
|
|
2195
|
-
|
|
2196
|
-
width:
|
|
2197
|
-
height:
|
|
1333
|
+
onairosLogo: {
|
|
1334
|
+
width: 32,
|
|
1335
|
+
height: 32
|
|
2198
1336
|
},
|
|
2199
1337
|
titleContainer: {
|
|
2200
|
-
|
|
1338
|
+
marginBottom: 20
|
|
2201
1339
|
},
|
|
2202
1340
|
mainTitle: {
|
|
2203
|
-
fontSize:
|
|
1341
|
+
fontSize: 20,
|
|
2204
1342
|
fontWeight: '600',
|
|
2205
|
-
color: '#
|
|
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:
|
|
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
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
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
|
-
|
|
2276
|
-
|
|
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
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
borderRadius: 8,
|
|
2291
|
-
backgroundColor: '#F5F5F5',
|
|
1364
|
+
platformItem: {
|
|
1365
|
+
flexDirection: 'row',
|
|
1366
|
+
justifyContent: 'space-between',
|
|
2292
1367
|
alignItems: 'center',
|
|
2293
|
-
|
|
2294
|
-
|
|
1368
|
+
padding: 12,
|
|
1369
|
+
backgroundColor: '#fff',
|
|
1370
|
+
borderRadius: 12,
|
|
1371
|
+
marginBottom: 8,
|
|
1372
|
+
borderWidth: 1,
|
|
1373
|
+
borderColor: '#eee'
|
|
2295
1374
|
},
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
height: 34,
|
|
2299
|
-
borderRadius: 17,
|
|
2300
|
-
backgroundColor: '#F5F5F5',
|
|
1375
|
+
platformInfo: {
|
|
1376
|
+
flexDirection: 'row',
|
|
2301
1377
|
alignItems: 'center',
|
|
2302
|
-
|
|
2303
|
-
|
|
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
|
-
|
|
2308
|
-
|
|
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: '#
|
|
1396
|
+
borderTopColor: '#eee',
|
|
1397
|
+
backgroundColor: '#fff'
|
|
2317
1398
|
},
|
|
2318
1399
|
footerButtonCancel: {
|
|
2319
|
-
paddingVertical:
|
|
1400
|
+
paddingVertical: 8,
|
|
2320
1401
|
paddingHorizontal: 16
|
|
2321
1402
|
},
|
|
2322
|
-
footerButtonText: {
|
|
2323
|
-
color: '#666',
|
|
2324
|
-
fontSize: 16
|
|
2325
|
-
},
|
|
2326
1403
|
footerButtonConfirm: {
|
|
2327
|
-
paddingVertical:
|
|
2328
|
-
paddingHorizontal:
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
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
|
-
|
|
1412
|
+
opacity: 0.5
|
|
2341
1413
|
},
|
|
2342
|
-
|
|
2343
|
-
color: '#
|
|
2344
|
-
fontSize: 16
|
|
2345
|
-
fontWeight: '600'
|
|
1414
|
+
footerButtonText: {
|
|
1415
|
+
color: '#666',
|
|
1416
|
+
fontSize: 16
|
|
2346
1417
|
},
|
|
2347
|
-
|
|
1418
|
+
footerButtonTextConfirm: {
|
|
2348
1419
|
color: '#000',
|
|
2349
1420
|
fontSize: 16,
|
|
2350
1421
|
fontWeight: '600'
|
|
2351
1422
|
},
|
|
2352
|
-
|
|
2353
|
-
flex: 1
|
|
2354
|
-
},
|
|
2355
|
-
modalContent: {
|
|
1423
|
+
successContainer: {
|
|
2356
1424
|
flex: 1,
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
borderTopRightRadius: 20,
|
|
2360
|
-
padding: 24
|
|
2361
|
-
},
|
|
2362
|
-
backButton: {
|
|
2363
|
-
padding: 8,
|
|
2364
|
-
width: 40
|
|
1425
|
+
justifyContent: 'center',
|
|
1426
|
+
alignItems: 'center'
|
|
2365
1427
|
},
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
1428
|
+
successContent: {
|
|
1429
|
+
backgroundColor: '#fff',
|
|
1430
|
+
padding: 24,
|
|
1431
|
+
borderRadius: 16,
|
|
1432
|
+
alignItems: 'center'
|
|
2369
1433
|
},
|
|
2370
|
-
|
|
2371
|
-
|
|
1434
|
+
successIcon: {
|
|
1435
|
+
backgroundColor: '#4CAF50',
|
|
1436
|
+
borderRadius: 24,
|
|
1437
|
+
padding: 12,
|
|
1438
|
+
marginBottom: 16
|
|
2372
1439
|
},
|
|
2373
|
-
|
|
2374
|
-
fontSize:
|
|
1440
|
+
successTitle: {
|
|
1441
|
+
fontSize: 22,
|
|
2375
1442
|
fontWeight: '600',
|
|
2376
|
-
color: '#
|
|
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
|
-
|
|
2396
|
-
fontSize:
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
marginBottom:
|
|
1447
|
+
successSubtitle: {
|
|
1448
|
+
fontSize: 14,
|
|
1449
|
+
color: '#666',
|
|
1450
|
+
textAlign: 'center',
|
|
1451
|
+
marginBottom: 16
|
|
2400
1452
|
},
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
1453
|
+
successMessage: {
|
|
1454
|
+
backgroundColor: '#f0f0f0',
|
|
1455
|
+
padding: 16,
|
|
1456
|
+
borderRadius: 8,
|
|
1457
|
+
marginBottom: 16
|
|
2405
1458
|
},
|
|
2406
|
-
|
|
2407
|
-
fontSize:
|
|
2408
|
-
|
|
2409
|
-
color: '#333'
|
|
1459
|
+
successMessageText: {
|
|
1460
|
+
fontSize: 14,
|
|
1461
|
+
color: '#666'
|
|
2410
1462
|
},
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
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
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
color: '#333',
|
|
2421
|
-
marginBottom: 24
|
|
1473
|
+
platformToggleActive: {
|
|
1474
|
+
borderColor: '#4CAF50',
|
|
1475
|
+
backgroundColor: '#4CAF50'
|
|
2422
1476
|
},
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
1477
|
+
platformToggleThumb: {
|
|
1478
|
+
width: 22,
|
|
1479
|
+
height: 22,
|
|
1480
|
+
borderRadius: 11,
|
|
2426
1481
|
backgroundColor: '#fff',
|
|
2427
|
-
|
|
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
|
-
|
|
2430
|
-
|
|
2431
|
-
alignItems: 'center',
|
|
2432
|
-
justifyContent: 'space-between',
|
|
2433
|
-
marginBottom: 16,
|
|
2434
|
-
paddingVertical: 8
|
|
1491
|
+
platformToggleThumbActive: {
|
|
1492
|
+
alignSelf: 'flex-end'
|
|
2435
1493
|
},
|
|
2436
|
-
|
|
2437
|
-
|
|
1494
|
+
// Dark mode styles
|
|
1495
|
+
darkPlatformItem: {
|
|
1496
|
+
backgroundColor: '#333',
|
|
1497
|
+
borderColor: '#555'
|
|
2438
1498
|
},
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
marginBottom: 32,
|
|
2442
|
-
paddingHorizontal: 24
|
|
1499
|
+
darkText: {
|
|
1500
|
+
color: '#fff'
|
|
2443
1501
|
},
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
fontWeight: '600',
|
|
2447
|
-
color: '#333',
|
|
2448
|
-
textAlign: 'center',
|
|
2449
|
-
flex: 1,
|
|
2450
|
-
marginBottom: 8
|
|
1502
|
+
darkSubText: {
|
|
1503
|
+
color: '#ccc'
|
|
2451
1504
|
},
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
textAlign: 'center'
|
|
1505
|
+
progressIndicator: {
|
|
1506
|
+
flexDirection: 'row',
|
|
1507
|
+
alignItems: 'center',
|
|
1508
|
+
marginTop: 16
|
|
2457
1509
|
},
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
1510
|
+
progressText: {
|
|
1511
|
+
fontSize: 16,
|
|
1512
|
+
fontWeight: '500',
|
|
1513
|
+
color: '#000',
|
|
1514
|
+
marginLeft: 8
|
|
2461
1515
|
},
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
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
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
borderRadius: 4
|
|
1524
|
+
emailHeader: {
|
|
1525
|
+
alignItems: 'center',
|
|
1526
|
+
marginBottom: 32
|
|
2473
1527
|
},
|
|
2474
|
-
|
|
2475
|
-
fontSize:
|
|
1528
|
+
emailTitle: {
|
|
1529
|
+
fontSize: 24,
|
|
2476
1530
|
fontWeight: '600',
|
|
2477
|
-
color: '#
|
|
1531
|
+
color: '#000',
|
|
2478
1532
|
textAlign: 'center',
|
|
1533
|
+
marginTop: 16,
|
|
2479
1534
|
marginBottom: 8
|
|
2480
1535
|
},
|
|
2481
|
-
|
|
2482
|
-
fontSize:
|
|
1536
|
+
emailSubtitle: {
|
|
1537
|
+
fontSize: 16,
|
|
2483
1538
|
color: '#666',
|
|
2484
1539
|
textAlign: 'center'
|
|
2485
1540
|
},
|
|
2486
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2521
|
-
|
|
1545
|
+
emailInput: {
|
|
1546
|
+
borderWidth: 1,
|
|
1547
|
+
borderColor: '#ddd',
|
|
1548
|
+
borderRadius: 12,
|
|
1549
|
+
padding: 16,
|
|
2522
1550
|
fontSize: 16,
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
progressError: {
|
|
2526
|
-
backgroundColor: '#FF3B30'
|
|
1551
|
+
marginBottom: 16,
|
|
1552
|
+
backgroundColor: '#fff'
|
|
2527
1553
|
},
|
|
2528
|
-
|
|
2529
|
-
|
|
1554
|
+
emailSubmitButton: {
|
|
1555
|
+
backgroundColor: '#4CAF50',
|
|
1556
|
+
paddingVertical: 16,
|
|
1557
|
+
paddingHorizontal: 32,
|
|
2530
1558
|
borderRadius: 12,
|
|
2531
|
-
|
|
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
|
-
|
|
2548
|
-
|
|
2549
|
-
marginRight: 8
|
|
1561
|
+
emailSubmitButtonDisabled: {
|
|
1562
|
+
opacity: 0.5
|
|
2550
1563
|
},
|
|
2551
|
-
|
|
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
|
-
|
|
1569
|
+
// Verification code styles
|
|
1570
|
+
developmentNote: {
|
|
2567
1571
|
fontSize: 14,
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
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
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
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
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
1585
|
+
codeDigit: {
|
|
1586
|
+
width: 45,
|
|
1587
|
+
height: 55,
|
|
2604
1588
|
borderWidth: 2,
|
|
2605
|
-
borderColor: '#
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
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
|
-
|
|
2616
|
-
|
|
2617
|
-
fontWeight: 'bold'
|
|
1596
|
+
codeDigitActive: {
|
|
1597
|
+
borderColor: '#4CAF50'
|
|
2618
1598
|
},
|
|
2619
|
-
|
|
2620
|
-
backgroundColor: '#000000',
|
|
1599
|
+
backButton: {
|
|
2621
1600
|
paddingVertical: 12,
|
|
2622
|
-
|
|
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
|
-
|
|
2636
|
-
color: '#
|
|
2637
|
-
fontSize:
|
|
2638
|
-
fontWeight: '600'
|
|
1603
|
+
backButtonText: {
|
|
1604
|
+
color: '#666',
|
|
1605
|
+
fontSize: 16
|
|
2639
1606
|
},
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
1607
|
+
// Expand button styles
|
|
1608
|
+
expandButton: {
|
|
1609
|
+
flexDirection: 'row',
|
|
2643
1610
|
alignItems: 'center',
|
|
2644
|
-
|
|
2645
|
-
|
|
1611
|
+
justifyContent: 'center',
|
|
1612
|
+
padding: 12,
|
|
1613
|
+
backgroundColor: '#f8f9fa',
|
|
1614
|
+
borderRadius: 12,
|
|
1615
|
+
borderWidth: 1,
|
|
1616
|
+
borderColor: '#e9ecef',
|
|
1617
|
+
marginTop: 8
|
|
2646
1618
|
},
|
|
2647
|
-
|
|
1619
|
+
expandButtonText: {
|
|
2648
1620
|
fontSize: 14,
|
|
2649
|
-
|
|
2650
|
-
|
|
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
|
-
|
|
2659
|
-
|
|
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: '#
|
|
2662
|
-
borderRadius: 8,
|
|
2663
|
-
paddingHorizontal: 12,
|
|
2664
|
-
paddingVertical: 8,
|
|
2665
|
-
marginTop: 8,
|
|
2666
|
-
marginHorizontal: 4
|
|
1633
|
+
borderColor: '#e9ecef'
|
|
2667
1634
|
},
|
|
2668
|
-
|
|
2669
|
-
fontSize:
|
|
2670
|
-
|
|
1635
|
+
testModeTitle: {
|
|
1636
|
+
fontSize: 16,
|
|
1637
|
+
fontWeight: '600',
|
|
1638
|
+
color: '#495057',
|
|
1639
|
+
marginBottom: 12,
|
|
2671
1640
|
textAlign: 'center'
|
|
2672
1641
|
},
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
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
|
-
|
|
2678
|
-
|
|
1653
|
+
testDataRequestButtonText: {
|
|
1654
|
+
fontSize: 14,
|
|
1655
|
+
fontWeight: '500',
|
|
1656
|
+
color: '#856404',
|
|
1657
|
+
marginLeft: 8
|
|
2679
1658
|
},
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
1659
|
+
testExistingUserButton: {
|
|
1660
|
+
flexDirection: 'row',
|
|
1661
|
+
alignItems: 'center',
|
|
1662
|
+
justifyContent: 'center',
|
|
1663
|
+
padding: 12,
|
|
1664
|
+
backgroundColor: '#d4edda',
|
|
2684
1665
|
borderRadius: 12,
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
1666
|
+
borderWidth: 1,
|
|
1667
|
+
borderColor: '#c3e6cb',
|
|
1668
|
+
marginBottom: 8
|
|
2688
1669
|
},
|
|
2689
|
-
|
|
1670
|
+
testExistingUserButtonText: {
|
|
2690
1671
|
fontSize: 14,
|
|
2691
|
-
fontWeight: '
|
|
2692
|
-
color: '#
|
|
2693
|
-
|
|
1672
|
+
fontWeight: '500',
|
|
1673
|
+
color: '#155724',
|
|
1674
|
+
marginLeft: 8
|
|
2694
1675
|
},
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
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
|