@onairos/react-native 3.1.18 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +1283 -2304
- 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 +31 -201
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/services/apiKeyService.js +102 -101
- 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 +1284 -2307
- 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/apiKeyService.js +102 -101
- 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 +225 -264
- package/lib/typescript/types/index.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +266 -266
- 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 +1820 -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/apiKeyService.ts +921 -919
- package/src/services/platformAuthService.ts +1113 -1346
- package/src/types/ambient.d.ts +28 -28
- package/src/types/index.ts +238 -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/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,388 @@
|
|
|
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
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
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');
|
|
264
|
-
}
|
|
265
|
-
};
|
|
266
|
-
|
|
267
|
-
// Track if the modal has ever been visible to prevent initial onClose call
|
|
268
|
-
const hasBeenVisibleRef = useRef(false);
|
|
102
|
+
// Define primary platforms (shown by default)
|
|
103
|
+
const primaryPlatforms = platforms.slice(0, 3); // Instagram, YouTube, Gmail
|
|
104
|
+
const additionalPlatforms = platforms.slice(3); // Reddit, Pinterest
|
|
105
|
+
|
|
106
|
+
// Get platforms to display based on showAllPlatforms state
|
|
107
|
+
const platformsToDisplay = showAllPlatforms ? platforms : primaryPlatforms;
|
|
108
|
+
const {
|
|
109
|
+
connectPlatform,
|
|
110
|
+
disconnectPlatform,
|
|
111
|
+
getConnectionStatus,
|
|
112
|
+
isConnecting
|
|
113
|
+
} = useConnections();
|
|
269
114
|
useEffect(() => {
|
|
115
|
+
// Set mounted flag
|
|
116
|
+
isMountedRef.current = true;
|
|
270
117
|
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
118
|
loadInitialStatus();
|
|
275
119
|
// Animate in
|
|
276
120
|
Animated.spring(slideAnim, {
|
|
277
121
|
toValue: 0,
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
useNativeDriver: true
|
|
122
|
+
useNativeDriver: true,
|
|
123
|
+
bounciness: 0
|
|
281
124
|
}).start();
|
|
282
|
-
|
|
125
|
+
|
|
126
|
+
// Set up deep link listener for OAuth callbacks
|
|
127
|
+
// Using the subscription pattern for React Native's Linking API
|
|
128
|
+
const subscription = Linking.addListener('url', ({
|
|
129
|
+
url
|
|
130
|
+
}) => {
|
|
131
|
+
if (isOAuthCallback(url)) {
|
|
132
|
+
handleOAuthCallback(url);
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
// Check for initial URL (app was opened via deep link)
|
|
137
|
+
Linking.getInitialURL().then(initialUrl => {
|
|
138
|
+
if (initialUrl && isOAuthCallback(initialUrl)) {
|
|
139
|
+
handleOAuthCallback(initialUrl);
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
// Initialize platform toggles
|
|
144
|
+
const initialToggles = {};
|
|
145
|
+
platforms.forEach(platform => {
|
|
146
|
+
initialToggles[platform.id] = false;
|
|
147
|
+
});
|
|
148
|
+
setPlatformToggles(initialToggles);
|
|
149
|
+
|
|
150
|
+
// Debug mode for Expo Go
|
|
151
|
+
if (debug || Platform.OS === 'web') {
|
|
152
|
+
console.log('Debug mode enabled - Using mock data for onboarding');
|
|
153
|
+
console.log('Configuration:', {
|
|
154
|
+
auto,
|
|
155
|
+
partner,
|
|
156
|
+
hasInferenceData: !!inferenceData,
|
|
157
|
+
inferenceDataType: typeof inferenceData
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
// Pre-populate with mock connections in debug mode
|
|
161
|
+
if (testMode || Platform.OS === 'web') {
|
|
162
|
+
setConnections({
|
|
163
|
+
instagram: {
|
|
164
|
+
userName: 'instagram_user',
|
|
165
|
+
connected: true
|
|
166
|
+
},
|
|
167
|
+
youtube: {
|
|
168
|
+
userName: 'youtube_user',
|
|
169
|
+
connected: true
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// If there's a preferred platform, pre-connect
|
|
176
|
+
if (preferredPlatform && debug) {
|
|
177
|
+
setConnections(prev => ({
|
|
178
|
+
...prev,
|
|
179
|
+
[preferredPlatform]: {
|
|
180
|
+
userName: `${preferredPlatform}_user`,
|
|
181
|
+
connected: true
|
|
182
|
+
}
|
|
183
|
+
}));
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// Return cleanup function
|
|
283
187
|
return () => {
|
|
188
|
+
// Remove event listener using the subscription
|
|
284
189
|
subscription.remove();
|
|
285
190
|
};
|
|
286
|
-
} else
|
|
287
|
-
//
|
|
191
|
+
} else {
|
|
192
|
+
// Animate out
|
|
288
193
|
Animated.timing(slideAnim, {
|
|
289
194
|
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
|
|
195
|
+
duration: 250,
|
|
196
|
+
useNativeDriver: true
|
|
294
197
|
}).start(() => {
|
|
295
|
-
//
|
|
296
|
-
setTimeout(() => {
|
|
297
|
-
setModalVisible(false);
|
|
298
|
-
onClose(); // Call onClose from props
|
|
299
|
-
}, 16);
|
|
198
|
+
// Reset state if needed
|
|
300
199
|
});
|
|
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
200
|
}
|
|
307
|
-
}, [visible,
|
|
201
|
+
}, [visible, preferredPlatform]);
|
|
308
202
|
|
|
309
|
-
// Cleanup
|
|
203
|
+
// Cleanup effect for unmounting
|
|
310
204
|
useEffect(() => {
|
|
311
205
|
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));
|
|
206
|
+
// Set mounted flag to false
|
|
207
|
+
isMountedRef.current = false;
|
|
342
208
|
|
|
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);
|
|
209
|
+
// Clear any pending timeouts
|
|
210
|
+
if (successTimeoutRef.current) {
|
|
211
|
+
clearTimeout(successTimeoutRef.current);
|
|
212
|
+
successTimeoutRef.current = null;
|
|
373
213
|
}
|
|
374
214
|
};
|
|
375
|
-
|
|
376
|
-
|
|
215
|
+
}, []);
|
|
216
|
+
const handleClose = () => {
|
|
217
|
+
// Clear any pending timeouts before closing
|
|
218
|
+
if (successTimeoutRef.current) {
|
|
219
|
+
clearTimeout(successTimeoutRef.current);
|
|
220
|
+
successTimeoutRef.current = null;
|
|
377
221
|
}
|
|
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
222
|
|
|
407
|
-
|
|
408
|
-
|
|
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
|
-
|
|
423
|
-
// Still set a fallback username even if other loading fails
|
|
424
|
-
const fallbackUsername = (user === null || user === void 0 ? void 0 : user.email) || (user === null || user === void 0 ? void 0 : user.name) || `user_${Math.floor(Math.random() * 10000)}`;
|
|
425
|
-
setUsername(fallbackUsername);
|
|
426
|
-
}
|
|
427
|
-
};
|
|
428
|
-
const handleClose = () => {
|
|
429
|
-
const currentlyCompleting = isCompletingRef.current; // Capture ref's current value
|
|
223
|
+
// Set mounted flag to false
|
|
224
|
+
isMountedRef.current = false;
|
|
430
225
|
|
|
431
|
-
// Animate out
|
|
226
|
+
// Animate out and then call onClose
|
|
432
227
|
Animated.timing(slideAnim, {
|
|
433
228
|
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
|
|
229
|
+
duration: 250,
|
|
230
|
+
useNativeDriver: true
|
|
439
231
|
}).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);
|
|
232
|
+
// Only call onClose if component is still meant to be mounted
|
|
233
|
+
// This prevents the "User closed onboarding" error
|
|
234
|
+
onClose();
|
|
449
235
|
});
|
|
450
236
|
};
|
|
451
|
-
const
|
|
452
|
-
// Trigger haptic feedback when connect button is pressed
|
|
453
|
-
triggerHaptic(HapticType.BUTTON_PRESS);
|
|
454
|
-
setConnectingPlatform(platformId);
|
|
237
|
+
const loadInitialStatus = useCallback(async () => {
|
|
455
238
|
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
|
-
}
|
|
239
|
+
console.log('🔄 Loading initial connection status...');
|
|
240
|
+
const status = await getConnectionStatus();
|
|
241
|
+
console.log('✅ Connection status loaded:', status);
|
|
242
|
+
setConnections(status || {});
|
|
495
243
|
} catch (error) {
|
|
496
|
-
console.error(
|
|
497
|
-
|
|
498
|
-
|
|
244
|
+
console.error('❌ Failed to load connection status:', error);
|
|
245
|
+
// Set empty connections to prevent crashes
|
|
246
|
+
setConnections({});
|
|
499
247
|
}
|
|
500
|
-
};
|
|
248
|
+
}, [getConnectionStatus]);
|
|
501
249
|
const togglePlatform = useCallback(async platformId => {
|
|
502
|
-
// If toggling on, initiate the OAuth flow for the platform
|
|
503
250
|
if (!platformToggles[platformId]) {
|
|
251
|
+
// Attempt to connect platform
|
|
504
252
|
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);
|
|
253
|
+
setIsConnectingPlatform(true);
|
|
254
|
+
console.log(`🔌 Initiating connection for ${platformId}`);
|
|
255
|
+
|
|
256
|
+
// Test API connectivity first
|
|
257
|
+
console.log('🔍 Testing API connectivity...');
|
|
258
|
+
const connectivityTest = await testApiConnectivity();
|
|
259
|
+
if (!connectivityTest.success) {
|
|
260
|
+
console.error('❌ API connectivity test failed:', connectivityTest.error);
|
|
261
|
+
Alert.alert('Network Error', `${connectivityTest.error}\n\nPlease check your internet connection and try again.`);
|
|
520
262
|
return;
|
|
521
263
|
}
|
|
264
|
+
console.log('✅ API connectivity confirmed');
|
|
522
265
|
|
|
523
|
-
//
|
|
524
|
-
if (
|
|
525
|
-
//
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
266
|
+
// Instagram: Use Opacity SDK exclusively
|
|
267
|
+
if (platformId === 'instagram') {
|
|
268
|
+
// Check if Opacity SDK is available
|
|
269
|
+
if (!opacityInit || !OpacityEnvironment || !opacityGet) {
|
|
270
|
+
console.error('❌ Opacity SDK not available for Instagram');
|
|
271
|
+
throw new Error('Instagram connection requires the Opacity SDK. Please ensure @opacity-labs/react-native-opacity is properly installed and configured.');
|
|
272
|
+
}
|
|
273
|
+
console.log('🔌 Initializing Opacity SDK for Instagram...');
|
|
274
|
+
|
|
275
|
+
// Initialize Opacity SDK with your API key
|
|
276
|
+
const apiKey = 'OsamaTest-7bde2407-7360-462a-86b4-b26d7f890cbb';
|
|
277
|
+
await opacityInit({
|
|
278
|
+
apiKey,
|
|
279
|
+
environment: OpacityEnvironment.Production,
|
|
280
|
+
shouldShowErrorsInWebView: true
|
|
281
|
+
});
|
|
282
|
+
console.log('✅ Opacity SDK initialized successfully');
|
|
283
|
+
console.log('📱 Fetching Instagram profile...');
|
|
284
|
+
|
|
285
|
+
// Fetch Instagram profile using Opacity SDK
|
|
286
|
+
const profile = await opacityGet('flow:instagram:profile');
|
|
287
|
+
if (profile && typeof profile === 'object') {
|
|
288
|
+
console.log('✅ Instagram profile retrieved:', profile);
|
|
289
|
+
|
|
290
|
+
// Extract username from profile or use fallback
|
|
291
|
+
const instagramUsername = profile.username || profile.name || username;
|
|
537
292
|
|
|
538
|
-
// Update platform
|
|
293
|
+
// Update platform toggle state
|
|
539
294
|
setPlatformToggles(prev => ({
|
|
540
295
|
...prev,
|
|
541
296
|
[platformId]: true
|
|
542
297
|
}));
|
|
543
298
|
|
|
544
|
-
//
|
|
545
|
-
|
|
299
|
+
// Update connections state with Instagram data
|
|
300
|
+
setConnections(prev => ({
|
|
301
|
+
...prev,
|
|
302
|
+
[platformId]: {
|
|
303
|
+
userName: instagramUsername,
|
|
304
|
+
connected: true,
|
|
305
|
+
profileData: profile // Store additional profile data
|
|
306
|
+
}
|
|
307
|
+
}));
|
|
308
|
+
console.log(`✅ Instagram successfully connected for user: ${instagramUsername}`);
|
|
309
|
+
} else {
|
|
310
|
+
throw new Error('Invalid or empty Instagram profile data returned from Opacity SDK');
|
|
311
|
+
}
|
|
312
|
+
} else {
|
|
313
|
+
// For all other platforms (non-Instagram), check if they have native SDK
|
|
314
|
+
if (hasNativeSDK(platformId)) {
|
|
315
|
+
console.log(`📱 Using native SDK for ${platformId}`);
|
|
316
|
+
// Use native SDK for authentication
|
|
317
|
+
const success = await initiateNativeAuth(platformId, username);
|
|
318
|
+
if (success) {
|
|
319
|
+
console.log(`✅ Native authentication successful for ${platformId}`);
|
|
320
|
+
// Update platform toggle state
|
|
321
|
+
setPlatformToggles(prev => ({
|
|
322
|
+
...prev,
|
|
323
|
+
[platformId]: true
|
|
324
|
+
}));
|
|
325
|
+
|
|
326
|
+
// Update connections state
|
|
327
|
+
setConnections(prev => ({
|
|
328
|
+
...prev,
|
|
329
|
+
[platformId]: {
|
|
330
|
+
userName: username,
|
|
331
|
+
connected: true
|
|
332
|
+
}
|
|
333
|
+
}));
|
|
334
|
+
} else {
|
|
335
|
+
throw new Error(`Native authentication failed for ${platformId}`);
|
|
336
|
+
}
|
|
337
|
+
} else {
|
|
338
|
+
// Use OAuth WebView flow
|
|
339
|
+
console.log(`🌐 Initiating OAuth flow for ${platformId}`);
|
|
340
|
+
const oauthUrl = await initiateOAuth(platformId, username, AppName);
|
|
341
|
+
if (oauthUrl) {
|
|
342
|
+
console.log(`✅ Received OAuth URL for ${platformId}:`, oauthUrl);
|
|
343
|
+
setCurrentPlatform(platformId);
|
|
344
|
+
setOauthUrl(oauthUrl);
|
|
345
|
+
setStep('oauth');
|
|
346
|
+
} else {
|
|
347
|
+
console.error(`❌ No OAuth URL returned for ${platformId}`);
|
|
348
|
+
throw new Error(`Failed to get authorization URL for ${platformId}. Please try again.`);
|
|
349
|
+
}
|
|
546
350
|
}
|
|
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
351
|
}
|
|
559
352
|
} catch (error) {
|
|
560
|
-
console.error(
|
|
561
|
-
|
|
562
|
-
|
|
353
|
+
console.error(`❌ Error connecting ${platformId}:`, error);
|
|
354
|
+
|
|
355
|
+
// Provide user-friendly error messages based on platform
|
|
356
|
+
let errorMessage = 'Unknown error occurred';
|
|
357
|
+
if (error instanceof Error) {
|
|
358
|
+
if (platformId === 'instagram') {
|
|
359
|
+
if (error.message.includes('Initialize')) {
|
|
360
|
+
errorMessage = 'Failed to initialize Instagram connection. Please check your internet connection.';
|
|
361
|
+
} else if (error.message.includes('profile')) {
|
|
362
|
+
errorMessage = 'Unable to retrieve Instagram profile. Please try again or check your Instagram account permissions.';
|
|
363
|
+
} else {
|
|
364
|
+
errorMessage = error.message;
|
|
365
|
+
}
|
|
366
|
+
} else {
|
|
367
|
+
errorMessage = error.message;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
Alert.alert(`${platformId.charAt(0).toUpperCase() + platformId.slice(1)} Connection Failed`, errorMessage, [{
|
|
371
|
+
text: 'OK',
|
|
372
|
+
style: 'default'
|
|
373
|
+
}]);
|
|
374
|
+
} finally {
|
|
375
|
+
setIsConnectingPlatform(false);
|
|
563
376
|
}
|
|
564
377
|
} else {
|
|
565
|
-
//
|
|
378
|
+
// Disconnect platform
|
|
379
|
+
console.log(`🔌 Disconnecting ${platformId}`);
|
|
566
380
|
setPlatformToggles(prev => ({
|
|
567
381
|
...prev,
|
|
568
|
-
[platformId]:
|
|
382
|
+
[platformId]: false
|
|
569
383
|
}));
|
|
570
384
|
|
|
571
|
-
//
|
|
385
|
+
// Update connections state
|
|
572
386
|
setConnections(prev => {
|
|
573
387
|
const newConnections = {
|
|
574
388
|
...prev
|
|
@@ -577,50 +391,50 @@ export const UniversalOnboarding = ({
|
|
|
577
391
|
return newConnections;
|
|
578
392
|
});
|
|
579
393
|
}
|
|
580
|
-
}, [platformToggles, username]);
|
|
394
|
+
}, [platformToggles, username, AppName]);
|
|
581
395
|
|
|
582
|
-
/**
|
|
583
|
-
* Handles OAuth callback URLs
|
|
396
|
+
/**
|
|
397
|
+
* Handles OAuth callback URLs
|
|
584
398
|
*/
|
|
585
399
|
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
|
-
}));
|
|
400
|
+
console.log('🔗 OAuth callback received:', url);
|
|
401
|
+
const result = handleOAuthCallbackUrl(url);
|
|
402
|
+
if (result.success && result.platform && result.code) {
|
|
403
|
+
console.log(`✅ OAuth successful for ${result.platform}`);
|
|
600
404
|
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
405
|
+
// Update connections state
|
|
406
|
+
setConnections(prev => ({
|
|
407
|
+
...prev,
|
|
408
|
+
[result.platform]: {
|
|
409
|
+
userName: username,
|
|
410
|
+
connected: true
|
|
411
|
+
}
|
|
412
|
+
}));
|
|
606
413
|
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
414
|
+
// Update platform toggles
|
|
415
|
+
setPlatformToggles(prev => ({
|
|
416
|
+
...prev,
|
|
417
|
+
[result.platform]: true
|
|
418
|
+
}));
|
|
419
|
+
|
|
420
|
+
// Close OAuth window and return to connect step
|
|
421
|
+
setOauthUrl('');
|
|
422
|
+
setCurrentPlatform('');
|
|
423
|
+
setStep('connect');
|
|
424
|
+
console.log(`🎉 ${result.platform} successfully connected via OAuth`);
|
|
425
|
+
} else {
|
|
426
|
+
console.error('❌ OAuth callback failed or incomplete');
|
|
612
427
|
}
|
|
613
|
-
}, [
|
|
428
|
+
}, [username]);
|
|
614
429
|
|
|
615
|
-
/**
|
|
616
|
-
* Handles
|
|
430
|
+
/**
|
|
431
|
+
* Handles completion of the OAuth flow
|
|
617
432
|
*/
|
|
618
|
-
const handleOAuthSuccess = useCallback(
|
|
619
|
-
console.log(
|
|
620
|
-
console.log(`📝 Received result:`, code);
|
|
621
|
-
if (currentPlatform) {
|
|
622
|
-
console.log(`✅ Updating connection state for ${currentPlatform}`);
|
|
433
|
+
const handleOAuthSuccess = useCallback(code => {
|
|
434
|
+
console.log(`OAuth success for ${currentPlatform} with code: ${code}`);
|
|
623
435
|
|
|
436
|
+
// Update connections for the current platform
|
|
437
|
+
if (currentPlatform) {
|
|
624
438
|
// Update connections state
|
|
625
439
|
setConnections(prev => ({
|
|
626
440
|
...prev,
|
|
@@ -635,893 +449,513 @@ export const UniversalOnboarding = ({
|
|
|
635
449
|
...prev,
|
|
636
450
|
[currentPlatform]: true
|
|
637
451
|
}));
|
|
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`);
|
|
452
|
+
console.log(`Successfully connected ${currentPlatform} for user ${username}`);
|
|
648
453
|
}
|
|
649
454
|
|
|
650
|
-
// Close
|
|
651
|
-
console.log('🔄 Returning to connect step');
|
|
455
|
+
// Close OAuth window and return to connect step
|
|
652
456
|
setOauthUrl('');
|
|
457
|
+
setCurrentPlatform('');
|
|
653
458
|
setStep('connect');
|
|
654
|
-
}, [currentPlatform, username
|
|
655
|
-
|
|
656
|
-
|
|
459
|
+
}, [currentPlatform, username]);
|
|
460
|
+
|
|
461
|
+
// Function to check for existing account (spoofed for now)
|
|
462
|
+
const checkExistingAccount = useCallback(async () => {
|
|
463
|
+
console.log('Checking for existing account...');
|
|
464
|
+
// TODO: Implement actual logic to check cookies/storage for existing account
|
|
465
|
+
// For now, this is spoofed and doesn't do anything
|
|
466
|
+
return false;
|
|
467
|
+
}, []);
|
|
468
|
+
|
|
469
|
+
// Function to handle email submission
|
|
470
|
+
const handleEmailSubmit = useCallback(async () => {
|
|
471
|
+
console.log('🚀 handleEmailSubmit called with email:', email);
|
|
472
|
+
console.log('🧪 testMode value:', testMode);
|
|
473
|
+
console.log('🧪 isTestMode computed:', isTestMode);
|
|
474
|
+
try {
|
|
475
|
+
if (!email || !email.trim()) {
|
|
476
|
+
console.log('❌ No email provided');
|
|
477
|
+
Alert.alert('Error', 'Please enter your email address');
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
// Basic email validation
|
|
482
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
483
|
+
if (!emailRegex.test(email.trim())) {
|
|
484
|
+
console.log('❌ Invalid email format');
|
|
485
|
+
Alert.alert('Error', 'Please enter a valid email address');
|
|
486
|
+
return;
|
|
487
|
+
}
|
|
488
|
+
console.log('📧 Email validation passed, proceeding...');
|
|
489
|
+
|
|
490
|
+
// Check if we should skip API calls entirely (only for specific test scenarios)
|
|
491
|
+
const shouldSkipApiCalls = typeof testMode === 'object' && testMode !== null && testMode.skipApiCalls === true;
|
|
492
|
+
if (shouldSkipApiCalls) {
|
|
493
|
+
console.log('🧪 Test mode with skipApiCalls: true - Skipping API call, proceeding to verification');
|
|
494
|
+
setStep('verify');
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
657
497
|
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
498
|
+
// Add loading state to prevent multiple submissions
|
|
499
|
+
if (isVerifyingCode) {
|
|
500
|
+
console.log('⚠️ Email verification already in progress');
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
setIsVerifyingCode(true);
|
|
504
|
+
console.log('🔄 Starting email verification process...');
|
|
505
|
+
console.log('📡 Will make API call with testMode flag:', isTestMode);
|
|
661
506
|
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
507
|
+
// Wrap the entire API call in a timeout to prevent hanging
|
|
508
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
509
|
+
setTimeout(() => reject(new Error('Request timeout')), 10000); // 10 second timeout
|
|
510
|
+
});
|
|
511
|
+
try {
|
|
512
|
+
// Safety check for function availability with detailed debugging
|
|
513
|
+
console.log('🔍 Checking requestEmailVerification function availability...');
|
|
514
|
+
console.log('🔍 Type of requestEmailVerification:', typeof requestEmailVerification);
|
|
515
|
+
console.log('🔍 requestEmailVerification function:', requestEmailVerification);
|
|
516
|
+
if (typeof requestEmailVerification !== 'function') {
|
|
517
|
+
console.error('❌ requestEmailVerification function not available');
|
|
518
|
+
console.error('❌ Available functions from platformAuthService:', {
|
|
519
|
+
requestEmailVerification: typeof requestEmailVerification,
|
|
520
|
+
verifyEmailCode: typeof verifyEmailCode,
|
|
521
|
+
checkEmailVerificationStatus: typeof checkEmailVerificationStatus
|
|
522
|
+
});
|
|
523
|
+
// In development, just proceed anyway
|
|
524
|
+
console.log('🧪 Proceeding without API call in development mode');
|
|
525
|
+
setStep('verify');
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
console.log('✅ requestEmailVerification function is available');
|
|
529
|
+
console.log('🔄 Making API call to requestEmailVerification...');
|
|
530
|
+
|
|
531
|
+
// Race between API call and timeout
|
|
532
|
+
const result = await Promise.race([requestEmailVerification(email.trim(), isTestMode), timeoutPromise]);
|
|
533
|
+
console.log('📡 Email verification API result:', result);
|
|
534
|
+
if (result && result.success) {
|
|
535
|
+
console.log('✅ Verification code requested successfully');
|
|
536
|
+
setStep('verify');
|
|
537
|
+
} else {
|
|
538
|
+
console.warn('⚠️ Email verification request failed, but proceeding anyway:', result);
|
|
539
|
+
// In development mode, proceed even if API fails
|
|
540
|
+
setStep('verify');
|
|
541
|
+
}
|
|
542
|
+
} catch (verificationError) {
|
|
543
|
+
console.error('❌ Error in email verification API call:', verificationError);
|
|
544
|
+
// In development mode, proceed even if API fails
|
|
545
|
+
console.log('🧪 API failed but proceeding to verification step in development mode');
|
|
546
|
+
setStep('verify');
|
|
547
|
+
} finally {
|
|
548
|
+
setIsVerifyingCode(false);
|
|
549
|
+
}
|
|
550
|
+
} catch (error) {
|
|
551
|
+
console.error('❌ Unexpected error in email submission:', error);
|
|
552
|
+
setIsVerifyingCode(false);
|
|
665
553
|
|
|
666
|
-
//
|
|
554
|
+
// In development mode, still try to proceed
|
|
555
|
+
console.log('🧪 Error occurred but attempting to proceed to verification step');
|
|
667
556
|
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);
|
|
557
|
+
setStep('verify');
|
|
558
|
+
} catch (stepError) {
|
|
559
|
+
console.error('❌ Failed to set step to verify:', stepError);
|
|
560
|
+
Alert.alert('Error', 'An unexpected error occurred. Please try again.');
|
|
677
561
|
}
|
|
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
562
|
}
|
|
686
|
-
|
|
687
|
-
}, [isBackgroundTrainingStarted, backgroundSocketId]);
|
|
563
|
+
}, [email, isVerifyingCode, debug, testMode, isTestMode]);
|
|
688
564
|
|
|
689
|
-
//
|
|
690
|
-
const
|
|
565
|
+
// Function to handle verification code submission
|
|
566
|
+
const handleVerificationSubmit = useCallback(async () => {
|
|
567
|
+
if (!verificationCode.trim() || verificationCode.trim().length !== 6) {
|
|
568
|
+
Alert.alert('Error', 'Please enter a 6-digit verification code');
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
setIsVerifyingCode(true);
|
|
691
572
|
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');
|
|
573
|
+
// Safety check for function availability
|
|
574
|
+
if (typeof verifyEmailCode !== 'function') {
|
|
575
|
+
throw new Error('Email verification service not available');
|
|
700
576
|
}
|
|
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
577
|
|
|
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;
|
|
578
|
+
// Test Mode: Use specific flows
|
|
579
|
+
if (isTestMode) {
|
|
580
|
+
console.log('🧪 Test mode verification - simulating success');
|
|
581
|
+
if (isExistingUserFlow) {
|
|
582
|
+
// Flow 1: Existing User → Data Request → Close (return API URL)
|
|
583
|
+
console.log('🧪 Test Flow 1: Existing User → Show Data Request');
|
|
584
|
+
setIsExistingUser(true);
|
|
585
|
+
setStep('dataRequest');
|
|
586
|
+
return;
|
|
587
|
+
} else if (isNewUserFlow) {
|
|
588
|
+
// Flow 2: New User → Platform Connect → PIN → Training
|
|
589
|
+
console.log('🧪 Test Flow 2: New User → Platform Connect');
|
|
590
|
+
const emailPrefix = email.trim().split('@')[0] || 'TestUser';
|
|
591
|
+
setUsername(emailPrefix);
|
|
592
|
+
setStep('connect');
|
|
593
|
+
return;
|
|
594
|
+
}
|
|
748
595
|
}
|
|
596
|
+
|
|
597
|
+
// Real API call (production) or test mode
|
|
598
|
+
const result = await verifyEmailCode(email.trim(), verificationCode.trim(), isTestMode);
|
|
749
599
|
if (result.success) {
|
|
750
|
-
console.log('
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
console.log('
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
console.log('
|
|
760
|
-
|
|
761
|
-
|
|
600
|
+
console.log('✅ Email verification successful');
|
|
601
|
+
|
|
602
|
+
// Check if user exists in backend (properly typed now)
|
|
603
|
+
const existingUser = result.existingUser || false;
|
|
604
|
+
setIsExistingUser(existingUser);
|
|
605
|
+
if (existingUser) {
|
|
606
|
+
console.log('👤 Existing user detected, showing data request screen');
|
|
607
|
+
setStep('dataRequest');
|
|
608
|
+
} else {
|
|
609
|
+
console.log('🆕 New user, proceeding to platform connection');
|
|
610
|
+
// Safely set username from email prefix
|
|
611
|
+
try {
|
|
612
|
+
const emailPrefix = email.trim().split('@')[0];
|
|
613
|
+
if (emailPrefix && emailPrefix.length > 0) {
|
|
614
|
+
setUsername(emailPrefix);
|
|
615
|
+
} else {
|
|
616
|
+
setUsername('User'); // Fallback username
|
|
617
|
+
}
|
|
618
|
+
} catch (usernameError) {
|
|
619
|
+
console.warn('Failed to extract username from email, using fallback:', usernameError);
|
|
620
|
+
setUsername('User');
|
|
621
|
+
}
|
|
622
|
+
setStep('connect');
|
|
762
623
|
}
|
|
763
|
-
setPersonaStatus('Training model...');
|
|
764
|
-
setPersonaProgress(25);
|
|
765
624
|
} else {
|
|
766
|
-
|
|
767
|
-
setPersonaStatus(`Error: ${result.error || 'Training failed to start'}`);
|
|
768
|
-
setHasError(true);
|
|
769
|
-
stopDotsAnimation();
|
|
625
|
+
Alert.alert('Verification Failed', result.error || 'Invalid verification code');
|
|
770
626
|
}
|
|
771
627
|
} catch (error) {
|
|
772
|
-
console.error('❌
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
628
|
+
console.error('❌ Error verifying code:', error);
|
|
629
|
+
Alert.alert('Error', 'Failed to verify code');
|
|
630
|
+
} finally {
|
|
631
|
+
setIsVerifyingCode(false);
|
|
776
632
|
}
|
|
777
|
-
};
|
|
633
|
+
}, [email, verificationCode]);
|
|
634
|
+
const handlePinSubmit = useCallback(async userPin => {
|
|
635
|
+
setPin(userPin);
|
|
636
|
+
setStep('training');
|
|
778
637
|
|
|
779
|
-
|
|
780
|
-
const continueBackgroundTrainingWithPin = async userPin => {
|
|
638
|
+
// Save session data for "Never Connect Again" functionality
|
|
781
639
|
try {
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
640
|
+
const sessionData = {
|
|
641
|
+
pin: userPin,
|
|
642
|
+
connections,
|
|
643
|
+
platformToggles,
|
|
644
|
+
selectedTier,
|
|
645
|
+
username,
|
|
646
|
+
timestamp: Date.now(),
|
|
647
|
+
appName: AppName,
|
|
648
|
+
inferenceData: auto ? inferenceData : undefined,
|
|
649
|
+
partner
|
|
650
|
+
};
|
|
789
651
|
|
|
790
|
-
//
|
|
791
|
-
|
|
652
|
+
// Store session data in secure storage for future use
|
|
653
|
+
console.log('Saving session data for future "Never Connect Again" functionality:', sessionData);
|
|
792
654
|
|
|
793
|
-
|
|
794
|
-
|
|
655
|
+
// TODO: Implement actual secure storage of session data
|
|
656
|
+
// This would typically involve:
|
|
657
|
+
// 1. Storing encrypted session data locally
|
|
658
|
+
// 2. Setting cookies in WebView for onairos.uk domain
|
|
659
|
+
// 3. Storing authentication tokens securely
|
|
795
660
|
|
|
796
|
-
//
|
|
797
|
-
console.log('
|
|
661
|
+
// For now, we'll simulate this with console logging
|
|
662
|
+
console.log('Session data saved - future apps will detect existing account');
|
|
798
663
|
} catch (error) {
|
|
799
|
-
console.error('
|
|
800
|
-
throw error;
|
|
664
|
+
console.error('Failed to save session data:', error);
|
|
801
665
|
}
|
|
802
|
-
};
|
|
666
|
+
}, [connections, selectedTier, platformToggles, username, AppName, auto, inferenceData, partner]);
|
|
667
|
+
const handleTrainingComplete = useCallback(async () => {
|
|
668
|
+
console.log('🎉 Training completed successfully');
|
|
669
|
+
console.log('🔍 Auto mode enabled:', auto);
|
|
670
|
+
console.log('🔍 Inference data available:', !!inferenceData);
|
|
671
|
+
try {
|
|
672
|
+
if (auto && inferenceData) {
|
|
673
|
+
console.log('🤖 Auto mode: Making API request to get URL and perform inference');
|
|
803
674
|
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
675
|
+
// First, get the API URL from backend
|
|
676
|
+
const apiUrlResponse = await fetch('https://api2.onairos.uk/', {
|
|
677
|
+
method: 'POST',
|
|
678
|
+
headers: {
|
|
679
|
+
'Content-Type': 'application/json'
|
|
680
|
+
},
|
|
681
|
+
body: JSON.stringify({
|
|
682
|
+
Info: {
|
|
683
|
+
storage: 'secure',
|
|
684
|
+
appId: AppName,
|
|
685
|
+
confirmations: Object.keys(requestData || {}),
|
|
686
|
+
EncryptedUserPin: pin,
|
|
687
|
+
// Use the actual PIN from user
|
|
688
|
+
account: email.trim(),
|
|
689
|
+
proofMode: false
|
|
690
|
+
}
|
|
691
|
+
})
|
|
692
|
+
});
|
|
693
|
+
if (!apiUrlResponse.ok) {
|
|
694
|
+
throw new Error(`Failed to get API URL: ${apiUrlResponse.status}`);
|
|
695
|
+
}
|
|
696
|
+
const {
|
|
697
|
+
apiUrl,
|
|
698
|
+
token
|
|
699
|
+
} = await apiUrlResponse.json();
|
|
700
|
+
console.log('✅ Received API URL:', apiUrl);
|
|
701
|
+
console.log('✅ Received token:', (token === null || token === void 0 ? void 0 : token.substring(0, 20)) + '...');
|
|
702
|
+
|
|
703
|
+
// Now make the inference call with the provided data
|
|
704
|
+
const inferenceResponse = await fetch(apiUrl, {
|
|
705
|
+
method: 'POST',
|
|
706
|
+
headers: {
|
|
707
|
+
'Content-Type': 'application/json',
|
|
708
|
+
'Authorization': `Bearer ${token}`
|
|
709
|
+
},
|
|
710
|
+
body: JSON.stringify({
|
|
711
|
+
...inferenceData,
|
|
712
|
+
userEmail: email.trim(),
|
|
713
|
+
appName: AppName,
|
|
714
|
+
timestamp: new Date().toISOString()
|
|
715
|
+
})
|
|
716
|
+
});
|
|
717
|
+
if (!inferenceResponse.ok) {
|
|
718
|
+
throw new Error(`Inference API failed: ${inferenceResponse.status}`);
|
|
719
|
+
}
|
|
720
|
+
const inferenceResults = await inferenceResponse.json();
|
|
721
|
+
console.log('✅ Auto mode inference results:', inferenceResults);
|
|
810
722
|
|
|
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
|
-
}
|
|
723
|
+
// Close the modal first
|
|
724
|
+
handleClose();
|
|
823
725
|
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
726
|
+
// Complete onboarding with inference results
|
|
727
|
+
setTimeout(() => {
|
|
728
|
+
onComplete(apiUrl, token, {
|
|
729
|
+
pin,
|
|
730
|
+
connections,
|
|
731
|
+
platformToggles,
|
|
732
|
+
selectedTier,
|
|
733
|
+
tierData: requestData === null || requestData === void 0 ? void 0 : requestData[selectedTier],
|
|
734
|
+
sessionSaved: true,
|
|
735
|
+
// Add inference data if auto mode is enabled
|
|
736
|
+
...(auto && inferenceData && {
|
|
737
|
+
inferenceData
|
|
738
|
+
}),
|
|
739
|
+
// Add partner info for special partners
|
|
740
|
+
...(partner && {
|
|
741
|
+
partner: partner === 'couplebible' ? 'CoupleBible' : partner
|
|
742
|
+
}),
|
|
743
|
+
autoMode: true,
|
|
744
|
+
inferenceResults,
|
|
745
|
+
apiUrl,
|
|
746
|
+
token
|
|
747
|
+
});
|
|
748
|
+
}, 100);
|
|
749
|
+
} else {
|
|
750
|
+
console.log('📋 Standard mode: Returning API URL for manual use');
|
|
751
|
+
|
|
752
|
+
// Prepare completion data
|
|
753
|
+
const completionData = {
|
|
754
|
+
pin,
|
|
755
|
+
connections,
|
|
756
|
+
platformToggles,
|
|
757
|
+
selectedTier,
|
|
758
|
+
tierData: requestData === null || requestData === void 0 ? void 0 : requestData[selectedTier],
|
|
759
|
+
sessionSaved: true,
|
|
760
|
+
// Add inference data if auto mode is enabled
|
|
761
|
+
...(auto && inferenceData && {
|
|
762
|
+
inferenceData
|
|
763
|
+
}),
|
|
764
|
+
// Add partner info for special partners
|
|
765
|
+
...(partner && {
|
|
766
|
+
partner: partner === 'couplebible' ? 'CoupleBible' : partner
|
|
767
|
+
}),
|
|
768
|
+
autoMode: false
|
|
843
769
|
};
|
|
844
|
-
|
|
845
|
-
setUsername(fallbackUsername);
|
|
846
|
-
console.log('🧑💻 Set user info:', newUserInfo);
|
|
770
|
+
console.log('Completion data prepared:', completionData);
|
|
847
771
|
|
|
848
|
-
//
|
|
849
|
-
|
|
850
|
-
}
|
|
772
|
+
// Close the modal first
|
|
773
|
+
handleClose();
|
|
851
774
|
|
|
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');
|
|
775
|
+
// Then call the completion callback
|
|
776
|
+
setTimeout(() => {
|
|
777
|
+
onComplete('https://api2.onairos.uk', 'dummy-token', completionData);
|
|
778
|
+
}, 100);
|
|
861
779
|
}
|
|
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
780
|
} 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
|
-
};
|
|
781
|
+
console.error('❌ Error in training complete:', error);
|
|
782
|
+
|
|
783
|
+
// Fallback to standard mode
|
|
784
|
+
const completionData = {
|
|
785
|
+
pin,
|
|
786
|
+
connections,
|
|
787
|
+
platformToggles,
|
|
788
|
+
selectedTier,
|
|
789
|
+
tierData: requestData === null || requestData === void 0 ? void 0 : requestData[selectedTier],
|
|
790
|
+
sessionSaved: true,
|
|
791
|
+
// Add inference data if auto mode is enabled
|
|
792
|
+
...(auto && inferenceData && {
|
|
793
|
+
inferenceData
|
|
794
|
+
}),
|
|
795
|
+
// Add partner info for special partners
|
|
796
|
+
...(partner && {
|
|
797
|
+
partner: partner === 'couplebible' ? 'CoupleBible' : partner
|
|
798
|
+
}),
|
|
799
|
+
autoMode: false,
|
|
800
|
+
error: error instanceof Error ? error.message : 'Unknown error'
|
|
801
|
+
};
|
|
802
|
+
console.log('Fallback completion data:', completionData);
|
|
1194
803
|
|
|
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;
|
|
804
|
+
// Close the modal first
|
|
805
|
+
handleClose();
|
|
1208
806
|
|
|
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
|
-
});
|
|
807
|
+
// Then call the completion callback
|
|
808
|
+
setTimeout(() => {
|
|
809
|
+
onComplete('https://api2.onairos.uk', 'dummy-token', completionData);
|
|
810
|
+
}, 100);
|
|
1234
811
|
}
|
|
1235
|
-
};
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
812
|
+
}, [pin, connections, platformToggles, selectedTier, requestData, auto, inferenceData, partner, handleClose, onComplete, AppName, email]);
|
|
813
|
+
const handleDataRequestAccept = useCallback(async () => {
|
|
814
|
+
console.log('Data request accepted for existing user');
|
|
815
|
+
console.log('🔍 Auto mode enabled:', auto);
|
|
816
|
+
console.log('🔍 Inference data available:', !!inferenceData);
|
|
1239
817
|
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
|
-
});
|
|
818
|
+
if (auto && inferenceData) {
|
|
819
|
+
console.log('🤖 Auto mode: Making API request to get URL and perform inference');
|
|
1258
820
|
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
try {
|
|
1262
|
-
const enochRegisterResponse = await fetch('https://api2.onairos.uk/enoch/users/register', {
|
|
821
|
+
// First, get the API URL from backend
|
|
822
|
+
const apiUrlResponse = await fetch('https://api2.onairos.uk/', {
|
|
1263
823
|
method: 'POST',
|
|
1264
824
|
headers: {
|
|
1265
825
|
'Content-Type': 'application/json'
|
|
1266
826
|
},
|
|
1267
827
|
body: JSON.stringify({
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
828
|
+
Info: {
|
|
829
|
+
storage: 'secure',
|
|
830
|
+
// or whatever storage type
|
|
831
|
+
appId: AppName,
|
|
832
|
+
confirmations: Object.keys(requestData || {}),
|
|
833
|
+
EncryptedUserPin: 'temp-pin',
|
|
834
|
+
// This would come from user PIN in real flow
|
|
835
|
+
account: email.trim(),
|
|
836
|
+
proofMode: false
|
|
837
|
+
}
|
|
1271
838
|
})
|
|
1272
839
|
});
|
|
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)}...`);
|
|
840
|
+
if (!apiUrlResponse.ok) {
|
|
841
|
+
throw new Error(`Failed to get API URL: ${apiUrlResponse.status}`);
|
|
842
|
+
}
|
|
843
|
+
const {
|
|
844
|
+
apiUrl,
|
|
845
|
+
token
|
|
846
|
+
} = await apiUrlResponse.json();
|
|
847
|
+
console.log('✅ Received API URL:', apiUrl);
|
|
848
|
+
console.log('✅ Received token:', (token === null || token === void 0 ? void 0 : token.substring(0, 20)) + '...');
|
|
849
|
+
|
|
850
|
+
// Now make the inference call with the provided data
|
|
851
|
+
const inferenceResponse = await fetch(apiUrl, {
|
|
852
|
+
method: 'POST',
|
|
853
|
+
headers: {
|
|
854
|
+
'Content-Type': 'application/json',
|
|
855
|
+
'Authorization': `Bearer ${token}`
|
|
856
|
+
},
|
|
857
|
+
body: JSON.stringify({
|
|
858
|
+
...inferenceData,
|
|
859
|
+
userEmail: email.trim(),
|
|
860
|
+
appName: AppName,
|
|
861
|
+
timestamp: new Date().toISOString()
|
|
862
|
+
})
|
|
863
|
+
});
|
|
864
|
+
if (!inferenceResponse.ok) {
|
|
865
|
+
throw new Error(`Inference API failed: ${inferenceResponse.status}`);
|
|
866
|
+
}
|
|
867
|
+
const inferenceResults = await inferenceResponse.json();
|
|
868
|
+
console.log('✅ Auto mode inference results:', inferenceResults);
|
|
869
|
+
|
|
870
|
+
// Complete onboarding with inference results
|
|
871
|
+
onComplete(apiUrl, token, {
|
|
872
|
+
existingAccount: true,
|
|
873
|
+
email: email.trim(),
|
|
874
|
+
dataRequestAccepted: true,
|
|
875
|
+
requestData,
|
|
876
|
+
autoMode: true,
|
|
877
|
+
inferenceResults,
|
|
878
|
+
apiUrl,
|
|
879
|
+
token
|
|
880
|
+
});
|
|
1326
881
|
} else {
|
|
1327
|
-
console.log('
|
|
882
|
+
console.log('📋 Standard mode: Returning API URL for manual use');
|
|
883
|
+
|
|
884
|
+
// Standard mode: just return the API URL
|
|
885
|
+
onComplete('https://api2.onairos.uk', 'existing-session-token', {
|
|
886
|
+
existingAccount: true,
|
|
887
|
+
email: email.trim(),
|
|
888
|
+
dataRequestAccepted: true,
|
|
889
|
+
requestData,
|
|
890
|
+
autoMode: false
|
|
891
|
+
});
|
|
1328
892
|
}
|
|
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
893
|
} 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
|
|
894
|
+
console.error('❌ Error in data request accept:', error);
|
|
895
|
+
|
|
896
|
+
// Fallback to standard mode
|
|
897
|
+
onComplete('https://api2.onairos.uk', 'existing-session-token', {
|
|
898
|
+
existingAccount: true,
|
|
899
|
+
email: email.trim(),
|
|
900
|
+
dataRequestAccepted: true,
|
|
901
|
+
requestData,
|
|
902
|
+
autoMode: false,
|
|
903
|
+
error: error instanceof Error ? error.message : 'Unknown error'
|
|
1356
904
|
});
|
|
1357
|
-
setStep('pin');
|
|
1358
905
|
}
|
|
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
|
-
});
|
|
906
|
+
}, [email, onComplete, requestData, auto, inferenceData, AppName]);
|
|
907
|
+
const handleDataRequestDecline = useCallback(() => {
|
|
908
|
+
console.log('Data request declined');
|
|
909
|
+
handleClose();
|
|
910
|
+
}, [handleClose]);
|
|
911
|
+
const canProceedToPin = useCallback(() => {
|
|
912
|
+
// Test mode: Always allow proceeding (simulates platform connections)
|
|
913
|
+
if (isTestMode || testModeOptions.skipRealConnections) {
|
|
914
|
+
console.log('🧪 Test mode: Allowing proceed without real platform connections');
|
|
915
|
+
return true;
|
|
916
|
+
}
|
|
1417
917
|
|
|
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
|
-
});
|
|
918
|
+
// Production: Check if at least one platform is connected
|
|
919
|
+
const hasPlatformConnected = Object.values(platformToggles).some(value => value === true);
|
|
1438
920
|
|
|
1439
|
-
|
|
1440
|
-
|
|
921
|
+
// Auto mode validation
|
|
922
|
+
if (auto && partner !== 'couplebible' && !inferenceData) {
|
|
923
|
+
console.warn('Auto mode enabled but no inference data provided (and partner is not couplebible)');
|
|
924
|
+
return false;
|
|
925
|
+
}
|
|
926
|
+
return hasPlatformConnected;
|
|
927
|
+
}, [platformToggles, auto, partner, inferenceData, isTestMode, testModeOptions]);
|
|
928
|
+
const handleProceed = () => {
|
|
929
|
+
console.log('Proceeding to next step');
|
|
930
|
+
// Show success screen first
|
|
931
|
+
setStep('success');
|
|
1441
932
|
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
} catch (error) {
|
|
1446
|
-
console.error('❌ [BACKGROUND] Background training failed:', error);
|
|
1447
|
-
setBackgroundTrainingProgress('');
|
|
1448
|
-
throw error;
|
|
933
|
+
// Clear any existing timeout
|
|
934
|
+
if (successTimeoutRef.current) {
|
|
935
|
+
clearTimeout(successTimeoutRef.current);
|
|
1449
936
|
}
|
|
1450
|
-
}, [userInfo, username, user]);
|
|
1451
937
|
|
|
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;
|
|
938
|
+
// After a delay, proceed to PIN
|
|
939
|
+
successTimeoutRef.current = setTimeout(() => {
|
|
940
|
+
// Only proceed if component is still mounted and visible
|
|
941
|
+
if (isMountedRef.current && visible) {
|
|
942
|
+
setStep('pin');
|
|
1485
943
|
}
|
|
1486
|
-
|
|
1487
|
-
|
|
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();
|
|
1510
|
-
}
|
|
1511
|
-
} catch (error) {
|
|
1512
|
-
console.error('❌ Background training start error:', error);
|
|
1513
|
-
setPersonaStatus(`Error: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
1514
|
-
setHasError(true);
|
|
1515
|
-
stopDotsAnimation();
|
|
1516
|
-
}
|
|
944
|
+
successTimeoutRef.current = null;
|
|
945
|
+
}, 3000);
|
|
1517
946
|
};
|
|
1518
947
|
return /*#__PURE__*/React.createElement(Modal, {
|
|
948
|
+
visible: visible,
|
|
1519
949
|
transparent: true,
|
|
1520
|
-
visible: modalVisible,
|
|
1521
950
|
animationType: "none",
|
|
951
|
+
statusBarTranslucent: true,
|
|
1522
952
|
onRequestClose: handleClose
|
|
953
|
+
}, /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
|
|
954
|
+
onPress: handleClose
|
|
1523
955
|
}, /*#__PURE__*/React.createElement(View, {
|
|
1524
956
|
style: styles.modalOverlay
|
|
957
|
+
}, /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
|
|
958
|
+
onPress: e => e.stopPropagation()
|
|
1525
959
|
}, /*#__PURE__*/React.createElement(Animated.View, {
|
|
1526
960
|
style: [styles.bottomSheet, {
|
|
1527
961
|
transform: [{
|
|
@@ -1532,313 +966,214 @@ export const UniversalOnboarding = ({
|
|
|
1532
966
|
style: styles.container
|
|
1533
967
|
}, /*#__PURE__*/React.createElement(View, {
|
|
1534
968
|
style: styles.handleContainer
|
|
1535
|
-
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
1536
|
-
onPress: handleClose,
|
|
1537
|
-
style: styles.handleButton
|
|
1538
969
|
}, /*#__PURE__*/React.createElement(View, {
|
|
1539
970
|
style: styles.handle
|
|
1540
|
-
}))
|
|
1541
|
-
style: styles.
|
|
971
|
+
})), step === 'email' && /*#__PURE__*/React.createElement(View, {
|
|
972
|
+
style: styles.emailInputContainer
|
|
973
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
974
|
+
style: styles.emailHeader
|
|
975
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
976
|
+
style: styles.onairosIcon
|
|
977
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
978
|
+
source: require('../assets/images/onairos_logo.png'),
|
|
979
|
+
style: styles.onairosLogo,
|
|
980
|
+
resizeMode: "contain"
|
|
981
|
+
})), /*#__PURE__*/React.createElement(Text, {
|
|
982
|
+
style: styles.emailTitle
|
|
983
|
+
}, "Welcome to Onairos"), /*#__PURE__*/React.createElement(Text, {
|
|
984
|
+
style: styles.emailSubtitle
|
|
985
|
+
}, "Enter your email to get started")), /*#__PURE__*/React.createElement(View, {
|
|
986
|
+
style: styles.emailInputSection
|
|
987
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
988
|
+
style: styles.emailInput,
|
|
989
|
+
value: email,
|
|
990
|
+
onChangeText: setEmail,
|
|
991
|
+
placeholder: "Enter your email address",
|
|
992
|
+
keyboardType: "email-address",
|
|
993
|
+
autoCapitalize: "none",
|
|
994
|
+
autoCorrect: false,
|
|
995
|
+
autoFocus: true
|
|
996
|
+
}), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
997
|
+
style: [styles.emailSubmitButton, !email.trim() && styles.emailSubmitButtonDisabled],
|
|
998
|
+
onPress: handleEmailSubmit,
|
|
999
|
+
disabled: !email.trim()
|
|
1000
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
1001
|
+
style: styles.emailSubmitButtonText
|
|
1002
|
+
}, "Continue")))), step === 'verify' && /*#__PURE__*/React.createElement(View, {
|
|
1003
|
+
style: styles.emailInputContainer
|
|
1004
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
1005
|
+
style: styles.emailHeader
|
|
1542
1006
|
}, /*#__PURE__*/React.createElement(View, {
|
|
1007
|
+
style: styles.onairosIcon
|
|
1008
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
1009
|
+
source: require('../assets/images/onairos_logo.png'),
|
|
1010
|
+
style: styles.onairosLogo,
|
|
1011
|
+
resizeMode: "contain"
|
|
1012
|
+
})), /*#__PURE__*/React.createElement(Text, {
|
|
1013
|
+
style: styles.emailTitle
|
|
1014
|
+
}, "Enter Verification Code"), /*#__PURE__*/React.createElement(Text, {
|
|
1015
|
+
style: styles.emailSubtitle
|
|
1016
|
+
}, "We've sent a 6-digit code to ", email), isTestMode && /*#__PURE__*/React.createElement(Text, {
|
|
1017
|
+
style: styles.developmentNote
|
|
1018
|
+
}, "\uD83D\uDD0D Test Mode: Any 6-digit code will work")), /*#__PURE__*/React.createElement(View, {
|
|
1019
|
+
style: styles.emailInputSection
|
|
1020
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
1021
|
+
style: styles.codeInputContainer
|
|
1022
|
+
}, [0, 1, 2, 3, 4, 5].map(index => /*#__PURE__*/React.createElement(TextInput, {
|
|
1023
|
+
key: index,
|
|
1024
|
+
ref: ref => codeInputRefs.current[index] = ref,
|
|
1025
|
+
style: [styles.codeDigit, verificationCode.length === index && styles.codeDigitActive],
|
|
1026
|
+
value: verificationCode[index] || '',
|
|
1027
|
+
onChangeText: text => {
|
|
1028
|
+
if (text.length <= 1 && /^\d*$/.test(text)) {
|
|
1029
|
+
const newCode = verificationCode.split('');
|
|
1030
|
+
newCode[index] = text;
|
|
1031
|
+
const updatedCode = newCode.join('').slice(0, 6);
|
|
1032
|
+
setVerificationCode(updatedCode);
|
|
1033
|
+
|
|
1034
|
+
// Auto-focus next input
|
|
1035
|
+
if (text && index < 5) {
|
|
1036
|
+
var _codeInputRefs$curren;
|
|
1037
|
+
(_codeInputRefs$curren = codeInputRefs.current[index + 1]) === null || _codeInputRefs$curren === void 0 || _codeInputRefs$curren.focus();
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
},
|
|
1041
|
+
onKeyPress: ({
|
|
1042
|
+
nativeEvent
|
|
1043
|
+
}) => {
|
|
1044
|
+
// Handle backspace to move to previous input
|
|
1045
|
+
if (nativeEvent.key === 'Backspace' && !verificationCode[index] && index > 0) {
|
|
1046
|
+
var _codeInputRefs$curren2;
|
|
1047
|
+
(_codeInputRefs$curren2 = codeInputRefs.current[index - 1]) === null || _codeInputRefs$curren2 === void 0 || _codeInputRefs$curren2.focus();
|
|
1048
|
+
}
|
|
1049
|
+
},
|
|
1050
|
+
keyboardType: "number-pad",
|
|
1051
|
+
maxLength: 1,
|
|
1052
|
+
textAlign: "center",
|
|
1053
|
+
autoFocus: index === 0
|
|
1054
|
+
}))), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
1055
|
+
style: [styles.emailSubmitButton, (verificationCode.length !== 6 || isVerifyingCode) && styles.emailSubmitButtonDisabled],
|
|
1056
|
+
onPress: handleVerificationSubmit,
|
|
1057
|
+
disabled: verificationCode.length !== 6 || isVerifyingCode
|
|
1058
|
+
}, isVerifyingCode ? /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
1059
|
+
size: "small",
|
|
1060
|
+
color: "#fff"
|
|
1061
|
+
}) : /*#__PURE__*/React.createElement(Text, {
|
|
1062
|
+
style: styles.emailSubmitButtonText
|
|
1063
|
+
}, "Verify")), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
1064
|
+
style: styles.backButton,
|
|
1065
|
+
onPress: () => setStep('email')
|
|
1066
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
1067
|
+
style: styles.backButtonText
|
|
1068
|
+
}, "\u2190 Back to email")))), step === 'connect' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
|
|
1543
1069
|
style: styles.header
|
|
1544
1070
|
}, /*#__PURE__*/React.createElement(View, {
|
|
1545
1071
|
style: styles.headerContent
|
|
1546
1072
|
}, /*#__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
1073
|
style: styles.onairosIcon
|
|
1554
1074
|
}, /*#__PURE__*/React.createElement(Image, {
|
|
1555
|
-
source: require('../assets/images/
|
|
1556
|
-
style: styles.
|
|
1075
|
+
source: require('../assets/images/onairos_logo.png'),
|
|
1076
|
+
style: styles.onairosLogo,
|
|
1557
1077
|
resizeMode: "contain"
|
|
1558
|
-
}))
|
|
1078
|
+
})), /*#__PURE__*/React.createElement(Icon, {
|
|
1079
|
+
name: "arrow-forward",
|
|
1080
|
+
size: 24,
|
|
1081
|
+
color: "#666",
|
|
1082
|
+
style: styles.arrow
|
|
1083
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
1084
|
+
style: styles.appIcon
|
|
1085
|
+
}, appIcon ? /*#__PURE__*/React.createElement(Image, {
|
|
1086
|
+
source: appIcon,
|
|
1087
|
+
style: styles.appIconImage,
|
|
1088
|
+
resizeMode: "contain"
|
|
1089
|
+
}) : /*#__PURE__*/React.createElement(Text, {
|
|
1090
|
+
style: styles.appIconText
|
|
1091
|
+
}, AppName.charAt(0))))), /*#__PURE__*/React.createElement(ScrollView, {
|
|
1092
|
+
style: styles.content,
|
|
1093
|
+
contentContainerStyle: styles.scrollContent,
|
|
1094
|
+
showsVerticalScrollIndicator: true,
|
|
1095
|
+
bounces: true,
|
|
1096
|
+
scrollEnabled: true,
|
|
1097
|
+
nestedScrollEnabled: true,
|
|
1098
|
+
keyboardShouldPersistTaps: "handled"
|
|
1099
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
1559
1100
|
style: styles.titleContainer
|
|
1560
1101
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
1561
1102
|
style: styles.mainTitle
|
|
1562
|
-
},
|
|
1103
|
+
}, "Let ", AppName, " learn about you from your data and apps"), /*#__PURE__*/React.createElement(Text, {
|
|
1563
1104
|
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, {
|
|
1105
|
+
}, "None of your app data is shared with ANYONE"), (debug || testMode) && /*#__PURE__*/React.createElement(Text, {
|
|
1106
|
+
style: styles.developmentNote
|
|
1107
|
+
}, "\uD83E\uDDEA Test Mode: You can proceed without connecting any platforms")), /*#__PURE__*/React.createElement(View, {
|
|
1605
1108
|
style: styles.platformsContainer
|
|
1606
|
-
},
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1109
|
+
}, platformsToDisplay.map(platform => /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
1110
|
+
key: platform.id,
|
|
1111
|
+
style: styles.platformItem,
|
|
1112
|
+
onPress: () => togglePlatform(platform.id),
|
|
1113
|
+
disabled: isConnectingPlatform
|
|
1611
1114
|
}, /*#__PURE__*/React.createElement(View, {
|
|
1612
1115
|
style: styles.platformInfo
|
|
1613
|
-
}, /*#__PURE__*/React.createElement(
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
1618
|
-
style: styles.platformIconText
|
|
1619
|
-
}, "@")), /*#__PURE__*/React.createElement(Text, {
|
|
1116
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
1117
|
+
source: platform.icon,
|
|
1118
|
+
style: styles.platformIcon,
|
|
1119
|
+
resizeMode: "contain"
|
|
1120
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
1620
1121
|
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
|
-
}]
|
|
1122
|
+
}, platform.name)), isConnectingPlatform && currentPlatform === platform.id ? /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
1123
|
+
size: "small",
|
|
1124
|
+
color: COLORS.primary
|
|
1125
|
+
}) : /*#__PURE__*/React.createElement(View, {
|
|
1126
|
+
style: [styles.platformToggle, platformToggles[platform.id] && styles.platformToggleActive]
|
|
1127
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
1128
|
+
style: [styles.platformToggleThumb, platformToggles[platform.id] && styles.platformToggleThumbActive]
|
|
1129
|
+
})))), additionalPlatforms.length > 0 && /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
1130
|
+
style: styles.expandButton,
|
|
1131
|
+
onPress: () => setShowAllPlatforms(!showAllPlatforms)
|
|
1132
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
1133
|
+
name: showAllPlatforms ? "expand_less" : "add",
|
|
1134
|
+
size: 24,
|
|
1135
|
+
color: COLORS.primary
|
|
1136
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
1137
|
+
style: styles.expandButtonText
|
|
1138
|
+
}, showAllPlatforms ? "Show Less" : `${additionalPlatforms.length} More Connectors`))), showTestControls && /*#__PURE__*/React.createElement(View, {
|
|
1139
|
+
style: styles.testModeContainer
|
|
1651
1140
|
}, /*#__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,
|
|
1141
|
+
style: styles.testModeTitle
|
|
1142
|
+
}, "\uD83E\uDDEA Test Mode - 2 Main Flows"), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
1143
|
+
style: styles.testExistingUserButton,
|
|
1743
1144
|
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
|
-
}
|
|
1145
|
+
// Flow 1: Existing User
|
|
1146
|
+
setIsExistingUser(true);
|
|
1147
|
+
setStep('dataRequest');
|
|
1784
1148
|
}
|
|
1785
|
-
}, /*#__PURE__*/React.createElement(
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1149
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
1150
|
+
name: "person",
|
|
1151
|
+
size: 20,
|
|
1152
|
+
color: "#28a745"
|
|
1153
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
1154
|
+
style: styles.testExistingUserButtonText
|
|
1155
|
+
}, "Flow 1: Existing User (Email \u2192 Code \u2192 Data Request \u2192 Close)")), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
1156
|
+
style: styles.testSkipToTrainingButton,
|
|
1157
|
+
onPress: () => {
|
|
1158
|
+
// Flow 2: New User - Skip to connect step
|
|
1159
|
+
setStep('connect');
|
|
1790
1160
|
}
|
|
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, {
|
|
1161
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
1162
|
+
name: "person-add",
|
|
1163
|
+
size: 20,
|
|
1164
|
+
color: "#17a2b8"
|
|
1165
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
1166
|
+
style: styles.testSkipToTrainingButtonText
|
|
1167
|
+
}, "Flow 2: New User (Connect \u2192 PIN \u2192 Training)")), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
1168
|
+
style: styles.testDataRequestButton,
|
|
1169
|
+
onPress: () => setStep('dataRequest')
|
|
1170
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
1171
|
+
name: "preview",
|
|
1172
|
+
size: 20,
|
|
1173
|
+
color: COLORS.primary
|
|
1174
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
1175
|
+
style: styles.testDataRequestButtonText
|
|
1176
|
+
}, "Preview Data Request Screen")))), /*#__PURE__*/React.createElement(View, {
|
|
1842
1177
|
style: styles.footer
|
|
1843
1178
|
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
1844
1179
|
style: styles.footerButtonCancel,
|
|
@@ -1846,155 +1181,58 @@ export const UniversalOnboarding = ({
|
|
|
1846
1181
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
1847
1182
|
style: styles.footerButtonText
|
|
1848
1183
|
}, "Cancel")), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
1849
|
-
style: [styles.footerButtonConfirm, !
|
|
1184
|
+
style: [styles.footerButtonConfirm, !canProceedToPin() && styles.footerButtonDisabled],
|
|
1850
1185
|
onPress: handleProceed,
|
|
1851
|
-
disabled: !
|
|
1186
|
+
disabled: !canProceedToPin()
|
|
1852
1187
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
1853
1188
|
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
|
|
1189
|
+
}, "Connect")))), step === 'success' && /*#__PURE__*/React.createElement(View, {
|
|
1190
|
+
style: styles.successContainer
|
|
1868
1191
|
}, /*#__PURE__*/React.createElement(View, {
|
|
1869
|
-
style: styles.
|
|
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
|
|
1887
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
1888
|
-
style: styles.personaProgressBar
|
|
1192
|
+
style: styles.successContent
|
|
1889
1193
|
}, /*#__PURE__*/React.createElement(View, {
|
|
1890
|
-
style:
|
|
1891
|
-
|
|
1892
|
-
|
|
1194
|
+
style: styles.successIcon
|
|
1195
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
1196
|
+
name: "check",
|
|
1197
|
+
size: 48,
|
|
1198
|
+
color: "#fff"
|
|
1893
1199
|
})), /*#__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
|
|
1200
|
+
style: styles.successTitle
|
|
1201
|
+
}, "Never Connect Again!"), /*#__PURE__*/React.createElement(Text, {
|
|
1202
|
+
style: styles.successSubtitle
|
|
1203
|
+
}, "Your login session has been saved"), /*#__PURE__*/React.createElement(View, {
|
|
1204
|
+
style: styles.successMessage
|
|
1991
1205
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
1992
|
-
style: styles.
|
|
1993
|
-
}, "
|
|
1994
|
-
style:
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1206
|
+
style: styles.successMessageText
|
|
1207
|
+
}, "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, {
|
|
1208
|
+
style: styles.progressIndicator
|
|
1209
|
+
}, /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
1210
|
+
size: "small",
|
|
1211
|
+
color: "#4CAF50"
|
|
1212
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
1213
|
+
style: styles.progressText
|
|
1214
|
+
}, "Continuing...")))), step === 'pin' && /*#__PURE__*/React.createElement(PinInput, {
|
|
1215
|
+
onSubmit: handlePinSubmit,
|
|
1216
|
+
minLength: 8,
|
|
1217
|
+
requireSpecialChar: true,
|
|
1218
|
+
requireNumber: true,
|
|
1219
|
+
onBack: () => setStep('connect')
|
|
1220
|
+
}), step === 'training' && /*#__PURE__*/React.createElement(TrainingModal, {
|
|
1221
|
+
visible: step === 'training',
|
|
1222
|
+
progress: training.progress,
|
|
1223
|
+
eta: training.eta,
|
|
1224
|
+
onCancel: handleClose,
|
|
1225
|
+
onComplete: handleTrainingComplete,
|
|
1226
|
+
modelKey: "onairosTrainingModel",
|
|
1227
|
+
username: username,
|
|
1228
|
+
test: isTestMode
|
|
1229
|
+
}), step === 'dataRequest' && /*#__PURE__*/React.createElement(DataRequestScreen, {
|
|
1230
|
+
onAccept: handleDataRequestAccept,
|
|
1231
|
+
onDecline: handleDataRequestDecline,
|
|
1232
|
+
requestData: requestData || {},
|
|
1233
|
+
AppName: AppName,
|
|
1234
|
+
appIcon: appIcon
|
|
1235
|
+
}), step === 'oauth' && oauthUrl && /*#__PURE__*/React.createElement(OAuthWebView, {
|
|
1998
1236
|
url: oauthUrl,
|
|
1999
1237
|
platform: currentPlatform,
|
|
2000
1238
|
onClose: () => {
|
|
@@ -2003,146 +1241,32 @@ export const UniversalOnboarding = ({
|
|
|
2003
1241
|
},
|
|
2004
1242
|
onSuccess: handleOAuthSuccess,
|
|
2005
1243
|
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")))))));
|
|
1244
|
+
})))))));
|
|
2120
1245
|
};
|
|
2121
1246
|
const styles = StyleSheet.create({
|
|
2122
1247
|
modalOverlay: {
|
|
2123
1248
|
flex: 1,
|
|
1249
|
+
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
2124
1250
|
justifyContent: 'flex-end',
|
|
2125
|
-
|
|
1251
|
+
alignItems: 'center'
|
|
2126
1252
|
},
|
|
2127
1253
|
bottomSheet: {
|
|
2128
|
-
backgroundColor: '#
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
width: '100%'
|
|
1254
|
+
backgroundColor: '#fff',
|
|
1255
|
+
width: width,
|
|
1256
|
+
height: height * 0.8,
|
|
1257
|
+
borderTopLeftRadius: 24,
|
|
1258
|
+
borderTopRightRadius: 24,
|
|
1259
|
+
overflow: 'hidden'
|
|
2135
1260
|
},
|
|
2136
1261
|
container: {
|
|
2137
|
-
flex: 1
|
|
1262
|
+
flex: 1,
|
|
1263
|
+
backgroundColor: '#fff'
|
|
2138
1264
|
},
|
|
2139
1265
|
handleContainer: {
|
|
1266
|
+
width: '100%',
|
|
2140
1267
|
alignItems: 'center',
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
handleButton: {
|
|
2144
|
-
padding: 10,
|
|
2145
|
-
width: 60
|
|
1268
|
+
paddingTop: 12,
|
|
1269
|
+
paddingBottom: 8
|
|
2146
1270
|
},
|
|
2147
1271
|
handle: {
|
|
2148
1272
|
width: 40,
|
|
@@ -2151,58 +1275,57 @@ const styles = StyleSheet.create({
|
|
|
2151
1275
|
backgroundColor: '#E0E0E0'
|
|
2152
1276
|
},
|
|
2153
1277
|
header: {
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
paddingHorizontal: 24
|
|
1278
|
+
padding: 24,
|
|
1279
|
+
alignItems: 'center'
|
|
2157
1280
|
},
|
|
2158
1281
|
headerContent: {
|
|
2159
1282
|
flexDirection: 'row',
|
|
2160
1283
|
alignItems: 'center',
|
|
2161
1284
|
justifyContent: 'center',
|
|
2162
|
-
marginBottom:
|
|
1285
|
+
marginBottom: 16
|
|
2163
1286
|
},
|
|
2164
1287
|
appIcon: {
|
|
2165
1288
|
width: 48,
|
|
2166
1289
|
height: 48,
|
|
2167
|
-
borderRadius:
|
|
1290
|
+
borderRadius: 16,
|
|
2168
1291
|
backgroundColor: '#F5F5F5',
|
|
2169
1292
|
alignItems: 'center',
|
|
2170
1293
|
justifyContent: 'center'
|
|
2171
1294
|
},
|
|
2172
1295
|
appIconText: {
|
|
2173
1296
|
fontSize: 24,
|
|
2174
|
-
|
|
2175
|
-
|
|
1297
|
+
color: '#000'
|
|
1298
|
+
},
|
|
1299
|
+
appIconImage: {
|
|
1300
|
+
width: 32,
|
|
1301
|
+
height: 32
|
|
2176
1302
|
},
|
|
2177
1303
|
arrow: {
|
|
2178
|
-
marginHorizontal: 16
|
|
2179
|
-
fontSize: 24,
|
|
2180
|
-
color: '#666'
|
|
1304
|
+
marginHorizontal: 16
|
|
2181
1305
|
},
|
|
2182
1306
|
onairosIcon: {
|
|
2183
|
-
width:
|
|
2184
|
-
height:
|
|
2185
|
-
borderRadius:
|
|
2186
|
-
backgroundColor: '
|
|
1307
|
+
width: 48,
|
|
1308
|
+
height: 48,
|
|
1309
|
+
borderRadius: 16,
|
|
1310
|
+
backgroundColor: '#F5F5F5',
|
|
2187
1311
|
alignItems: 'center',
|
|
2188
1312
|
justifyContent: 'center'
|
|
2189
1313
|
},
|
|
2190
1314
|
onairosIconText: {
|
|
2191
1315
|
fontSize: 24,
|
|
2192
|
-
|
|
2193
|
-
color: '#fff'
|
|
1316
|
+
color: '#000'
|
|
2194
1317
|
},
|
|
2195
|
-
|
|
2196
|
-
width:
|
|
2197
|
-
height:
|
|
1318
|
+
onairosLogo: {
|
|
1319
|
+
width: 32,
|
|
1320
|
+
height: 32
|
|
2198
1321
|
},
|
|
2199
1322
|
titleContainer: {
|
|
2200
|
-
|
|
1323
|
+
marginBottom: 20
|
|
2201
1324
|
},
|
|
2202
1325
|
mainTitle: {
|
|
2203
|
-
fontSize:
|
|
1326
|
+
fontSize: 20,
|
|
2204
1327
|
fontWeight: '600',
|
|
2205
|
-
color: '#
|
|
1328
|
+
color: '#000',
|
|
2206
1329
|
textAlign: 'center',
|
|
2207
1330
|
marginBottom: 12
|
|
2208
1331
|
},
|
|
@@ -2210,102 +1333,44 @@ const styles = StyleSheet.create({
|
|
|
2210
1333
|
fontSize: 14,
|
|
2211
1334
|
color: '#666',
|
|
2212
1335
|
textAlign: 'center',
|
|
2213
|
-
marginBottom:
|
|
2214
|
-
},
|
|
2215
|
-
privacyLink: {
|
|
2216
|
-
color: '#000000',
|
|
2217
|
-
fontWeight: '600',
|
|
2218
|
-
textDecorationLine: 'underline'
|
|
2219
|
-
},
|
|
2220
|
-
boldText: {
|
|
2221
|
-
fontWeight: 'bold'
|
|
1336
|
+
marginBottom: 12
|
|
2222
1337
|
},
|
|
2223
1338
|
content: {
|
|
2224
1339
|
flex: 1,
|
|
2225
1340
|
paddingHorizontal: 24
|
|
2226
1341
|
},
|
|
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
|
|
1342
|
+
scrollContent: {
|
|
1343
|
+
flexGrow: 1,
|
|
1344
|
+
paddingBottom: 20
|
|
2274
1345
|
},
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
height: 34
|
|
2278
|
-
},
|
|
2279
|
-
pinterestIconImage: {
|
|
2280
|
-
width: 48,
|
|
2281
|
-
height: 48
|
|
2282
|
-
},
|
|
2283
|
-
gmailIconImage: {
|
|
2284
|
-
width: 32,
|
|
2285
|
-
height: 32
|
|
1346
|
+
platformsContainer: {
|
|
1347
|
+
marginTop: 16
|
|
2286
1348
|
},
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
borderRadius: 8,
|
|
2291
|
-
backgroundColor: '#F5F5F5',
|
|
1349
|
+
platformItem: {
|
|
1350
|
+
flexDirection: 'row',
|
|
1351
|
+
justifyContent: 'space-between',
|
|
2292
1352
|
alignItems: 'center',
|
|
2293
|
-
|
|
2294
|
-
|
|
1353
|
+
padding: 12,
|
|
1354
|
+
backgroundColor: '#fff',
|
|
1355
|
+
borderRadius: 12,
|
|
1356
|
+
marginBottom: 8,
|
|
1357
|
+
borderWidth: 1,
|
|
1358
|
+
borderColor: '#eee'
|
|
2295
1359
|
},
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
height: 34,
|
|
2299
|
-
borderRadius: 17,
|
|
2300
|
-
backgroundColor: '#F5F5F5',
|
|
1360
|
+
platformInfo: {
|
|
1361
|
+
flexDirection: 'row',
|
|
2301
1362
|
alignItems: 'center',
|
|
2302
|
-
|
|
2303
|
-
|
|
1363
|
+
flex: 1
|
|
1364
|
+
},
|
|
1365
|
+
platformIcon: {
|
|
1366
|
+
width: 24,
|
|
1367
|
+
height: 24,
|
|
1368
|
+
marginRight: 12
|
|
2304
1369
|
},
|
|
2305
1370
|
platformName: {
|
|
2306
1371
|
fontSize: 16,
|
|
2307
|
-
|
|
2308
|
-
|
|
1372
|
+
fontWeight: '500',
|
|
1373
|
+
color: '#000'
|
|
2309
1374
|
},
|
|
2310
1375
|
footer: {
|
|
2311
1376
|
flexDirection: 'row',
|
|
@@ -2313,389 +1378,301 @@ const styles = StyleSheet.create({
|
|
|
2313
1378
|
justifyContent: 'space-between',
|
|
2314
1379
|
padding: 24,
|
|
2315
1380
|
borderTopWidth: 1,
|
|
2316
|
-
borderTopColor: '#
|
|
1381
|
+
borderTopColor: '#eee',
|
|
1382
|
+
backgroundColor: '#fff'
|
|
2317
1383
|
},
|
|
2318
1384
|
footerButtonCancel: {
|
|
2319
|
-
paddingVertical:
|
|
1385
|
+
paddingVertical: 8,
|
|
2320
1386
|
paddingHorizontal: 16
|
|
2321
1387
|
},
|
|
2322
|
-
footerButtonText: {
|
|
2323
|
-
color: '#666',
|
|
2324
|
-
fontSize: 16
|
|
2325
|
-
},
|
|
2326
1388
|
footerButtonConfirm: {
|
|
2327
|
-
paddingVertical:
|
|
2328
|
-
paddingHorizontal:
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
footerButtonConnected: {
|
|
2334
|
-
paddingVertical: 12,
|
|
2335
|
-
paddingHorizontal: 24,
|
|
2336
|
-
backgroundColor: '#E9C46A',
|
|
2337
|
-
borderRadius: 8
|
|
1389
|
+
paddingVertical: 16,
|
|
1390
|
+
paddingHorizontal: 32,
|
|
1391
|
+
borderRadius: 16,
|
|
1392
|
+
backgroundColor: '#fff',
|
|
1393
|
+
borderWidth: 1,
|
|
1394
|
+
borderColor: '#000'
|
|
2338
1395
|
},
|
|
2339
1396
|
footerButtonDisabled: {
|
|
2340
|
-
|
|
1397
|
+
opacity: 0.5
|
|
2341
1398
|
},
|
|
2342
|
-
|
|
2343
|
-
color: '#
|
|
2344
|
-
fontSize: 16
|
|
2345
|
-
fontWeight: '600'
|
|
1399
|
+
footerButtonText: {
|
|
1400
|
+
color: '#666',
|
|
1401
|
+
fontSize: 16
|
|
2346
1402
|
},
|
|
2347
|
-
|
|
1403
|
+
footerButtonTextConfirm: {
|
|
2348
1404
|
color: '#000',
|
|
2349
1405
|
fontSize: 16,
|
|
2350
1406
|
fontWeight: '600'
|
|
2351
1407
|
},
|
|
2352
|
-
|
|
2353
|
-
flex: 1
|
|
2354
|
-
},
|
|
2355
|
-
modalContent: {
|
|
1408
|
+
successContainer: {
|
|
2356
1409
|
flex: 1,
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
borderTopRightRadius: 20,
|
|
2360
|
-
padding: 24
|
|
2361
|
-
},
|
|
2362
|
-
backButton: {
|
|
2363
|
-
padding: 8,
|
|
2364
|
-
width: 40
|
|
1410
|
+
justifyContent: 'center',
|
|
1411
|
+
alignItems: 'center'
|
|
2365
1412
|
},
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
1413
|
+
successContent: {
|
|
1414
|
+
backgroundColor: '#fff',
|
|
1415
|
+
padding: 24,
|
|
1416
|
+
borderRadius: 16,
|
|
1417
|
+
alignItems: 'center'
|
|
2369
1418
|
},
|
|
2370
|
-
|
|
2371
|
-
|
|
1419
|
+
successIcon: {
|
|
1420
|
+
backgroundColor: '#4CAF50',
|
|
1421
|
+
borderRadius: 24,
|
|
1422
|
+
padding: 12,
|
|
1423
|
+
marginBottom: 16
|
|
2372
1424
|
},
|
|
2373
|
-
|
|
2374
|
-
fontSize:
|
|
1425
|
+
successTitle: {
|
|
1426
|
+
fontSize: 22,
|
|
2375
1427
|
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
|
|
1428
|
+
color: '#000',
|
|
1429
|
+
textAlign: 'center',
|
|
1430
|
+
marginBottom: 16
|
|
2394
1431
|
},
|
|
2395
|
-
|
|
2396
|
-
fontSize:
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
marginBottom:
|
|
1432
|
+
successSubtitle: {
|
|
1433
|
+
fontSize: 14,
|
|
1434
|
+
color: '#666',
|
|
1435
|
+
textAlign: 'center',
|
|
1436
|
+
marginBottom: 16
|
|
2400
1437
|
},
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
1438
|
+
successMessage: {
|
|
1439
|
+
backgroundColor: '#f0f0f0',
|
|
1440
|
+
padding: 16,
|
|
1441
|
+
borderRadius: 8,
|
|
1442
|
+
marginBottom: 16
|
|
2405
1443
|
},
|
|
2406
|
-
|
|
2407
|
-
fontSize:
|
|
2408
|
-
|
|
2409
|
-
color: '#333'
|
|
1444
|
+
successMessageText: {
|
|
1445
|
+
fontSize: 14,
|
|
1446
|
+
color: '#666'
|
|
2410
1447
|
},
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
1448
|
+
platformToggle: {
|
|
1449
|
+
width: 50,
|
|
1450
|
+
height: 28,
|
|
1451
|
+
borderRadius: 14,
|
|
1452
|
+
borderWidth: 1,
|
|
1453
|
+
borderColor: '#ddd',
|
|
1454
|
+
backgroundColor: '#f0f0f0',
|
|
1455
|
+
justifyContent: 'center',
|
|
1456
|
+
paddingHorizontal: 2
|
|
2416
1457
|
},
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
color: '#333',
|
|
2421
|
-
marginBottom: 24
|
|
1458
|
+
platformToggleActive: {
|
|
1459
|
+
borderColor: '#4CAF50',
|
|
1460
|
+
backgroundColor: '#4CAF50'
|
|
2422
1461
|
},
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
1462
|
+
platformToggleThumb: {
|
|
1463
|
+
width: 22,
|
|
1464
|
+
height: 22,
|
|
1465
|
+
borderRadius: 11,
|
|
2426
1466
|
backgroundColor: '#fff',
|
|
2427
|
-
|
|
1467
|
+
shadowColor: '#000',
|
|
1468
|
+
shadowOffset: {
|
|
1469
|
+
width: 0,
|
|
1470
|
+
height: 1
|
|
1471
|
+
},
|
|
1472
|
+
shadowOpacity: 0.2,
|
|
1473
|
+
shadowRadius: 2,
|
|
1474
|
+
elevation: 2
|
|
2428
1475
|
},
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
alignItems: 'center',
|
|
2432
|
-
justifyContent: 'space-between',
|
|
2433
|
-
marginBottom: 16,
|
|
2434
|
-
paddingVertical: 8
|
|
1476
|
+
platformToggleThumbActive: {
|
|
1477
|
+
alignSelf: 'flex-end'
|
|
2435
1478
|
},
|
|
2436
|
-
|
|
2437
|
-
|
|
1479
|
+
// Dark mode styles
|
|
1480
|
+
darkPlatformItem: {
|
|
1481
|
+
backgroundColor: '#333',
|
|
1482
|
+
borderColor: '#555'
|
|
2438
1483
|
},
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
marginBottom: 32,
|
|
2442
|
-
paddingHorizontal: 24
|
|
1484
|
+
darkText: {
|
|
1485
|
+
color: '#fff'
|
|
2443
1486
|
},
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
fontWeight: '600',
|
|
2447
|
-
color: '#333',
|
|
2448
|
-
textAlign: 'center',
|
|
2449
|
-
flex: 1,
|
|
2450
|
-
marginBottom: 8
|
|
1487
|
+
darkSubText: {
|
|
1488
|
+
color: '#ccc'
|
|
2451
1489
|
},
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
textAlign: 'center'
|
|
1490
|
+
progressIndicator: {
|
|
1491
|
+
flexDirection: 'row',
|
|
1492
|
+
alignItems: 'center',
|
|
1493
|
+
marginTop: 16
|
|
2457
1494
|
},
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
1495
|
+
progressText: {
|
|
1496
|
+
fontSize: 16,
|
|
1497
|
+
fontWeight: '500',
|
|
1498
|
+
color: '#000',
|
|
1499
|
+
marginLeft: 8
|
|
2461
1500
|
},
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
1501
|
+
// Email input styles
|
|
1502
|
+
emailInputContainer: {
|
|
1503
|
+
flex: 1,
|
|
1504
|
+
justifyContent: 'flex-start',
|
|
1505
|
+
alignItems: 'center',
|
|
1506
|
+
padding: 24,
|
|
1507
|
+
paddingTop: 60
|
|
2468
1508
|
},
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
borderRadius: 4
|
|
1509
|
+
emailHeader: {
|
|
1510
|
+
alignItems: 'center',
|
|
1511
|
+
marginBottom: 32
|
|
2473
1512
|
},
|
|
2474
|
-
|
|
2475
|
-
fontSize:
|
|
1513
|
+
emailTitle: {
|
|
1514
|
+
fontSize: 24,
|
|
2476
1515
|
fontWeight: '600',
|
|
2477
|
-
color: '#
|
|
1516
|
+
color: '#000',
|
|
2478
1517
|
textAlign: 'center',
|
|
1518
|
+
marginTop: 16,
|
|
2479
1519
|
marginBottom: 8
|
|
2480
1520
|
},
|
|
2481
|
-
|
|
2482
|
-
fontSize:
|
|
1521
|
+
emailSubtitle: {
|
|
1522
|
+
fontSize: 16,
|
|
2483
1523
|
color: '#666',
|
|
2484
1524
|
textAlign: 'center'
|
|
2485
1525
|
},
|
|
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',
|
|
1526
|
+
emailInputSection: {
|
|
2509
1527
|
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
|
|
1528
|
+
maxWidth: 320
|
|
2519
1529
|
},
|
|
2520
|
-
|
|
2521
|
-
|
|
1530
|
+
emailInput: {
|
|
1531
|
+
borderWidth: 1,
|
|
1532
|
+
borderColor: '#ddd',
|
|
1533
|
+
borderRadius: 12,
|
|
1534
|
+
padding: 16,
|
|
2522
1535
|
fontSize: 16,
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
progressError: {
|
|
2526
|
-
backgroundColor: '#FF3B30'
|
|
1536
|
+
marginBottom: 16,
|
|
1537
|
+
backgroundColor: '#fff'
|
|
2527
1538
|
},
|
|
2528
|
-
|
|
2529
|
-
|
|
1539
|
+
emailSubmitButton: {
|
|
1540
|
+
backgroundColor: '#4CAF50',
|
|
1541
|
+
paddingVertical: 16,
|
|
1542
|
+
paddingHorizontal: 32,
|
|
2530
1543
|
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
|
|
1544
|
+
alignItems: 'center'
|
|
2546
1545
|
},
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
marginRight: 8
|
|
1546
|
+
emailSubmitButtonDisabled: {
|
|
1547
|
+
opacity: 0.5
|
|
2550
1548
|
},
|
|
2551
|
-
|
|
1549
|
+
emailSubmitButtonText: {
|
|
1550
|
+
color: '#fff',
|
|
2552
1551
|
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
|
|
1552
|
+
fontWeight: '600'
|
|
2565
1553
|
},
|
|
2566
|
-
|
|
1554
|
+
// Verification code styles
|
|
1555
|
+
developmentNote: {
|
|
2567
1556
|
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'
|
|
1557
|
+
color: '#FF9800',
|
|
1558
|
+
textAlign: 'center',
|
|
1559
|
+
marginTop: 8,
|
|
1560
|
+
backgroundColor: '#FFF3E0',
|
|
1561
|
+
padding: 8,
|
|
1562
|
+
borderRadius: 4
|
|
2589
1563
|
},
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
width: 0,
|
|
2596
|
-
height: 0
|
|
2597
|
-
},
|
|
2598
|
-
shadowOpacity: 0.15,
|
|
2599
|
-
shadowRadius: 8
|
|
1564
|
+
codeInputContainer: {
|
|
1565
|
+
flexDirection: 'row',
|
|
1566
|
+
justifyContent: 'space-between',
|
|
1567
|
+
marginBottom: 24,
|
|
1568
|
+
paddingHorizontal: 20
|
|
2600
1569
|
},
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
1570
|
+
codeDigit: {
|
|
1571
|
+
width: 45,
|
|
1572
|
+
height: 55,
|
|
2604
1573
|
borderWidth: 2,
|
|
2605
|
-
borderColor: '#
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
shadowOpacity: 0.3,
|
|
2612
|
-
shadowRadius: 8,
|
|
2613
|
-
elevation: 5
|
|
1574
|
+
borderColor: '#ddd',
|
|
1575
|
+
borderRadius: 8,
|
|
1576
|
+
fontSize: 24,
|
|
1577
|
+
fontWeight: '600',
|
|
1578
|
+
color: '#000',
|
|
1579
|
+
backgroundColor: '#fff'
|
|
2614
1580
|
},
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
fontWeight: 'bold'
|
|
1581
|
+
codeDigitActive: {
|
|
1582
|
+
borderColor: '#4CAF50'
|
|
2618
1583
|
},
|
|
2619
|
-
|
|
2620
|
-
backgroundColor: '#000000',
|
|
1584
|
+
backButton: {
|
|
2621
1585
|
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
|
|
1586
|
+
alignItems: 'center'
|
|
2634
1587
|
},
|
|
2635
|
-
|
|
2636
|
-
color: '#
|
|
2637
|
-
fontSize:
|
|
2638
|
-
fontWeight: '600'
|
|
1588
|
+
backButtonText: {
|
|
1589
|
+
color: '#666',
|
|
1590
|
+
fontSize: 16
|
|
2639
1591
|
},
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
1592
|
+
// Expand button styles
|
|
1593
|
+
expandButton: {
|
|
1594
|
+
flexDirection: 'row',
|
|
2643
1595
|
alignItems: 'center',
|
|
2644
|
-
|
|
2645
|
-
|
|
1596
|
+
justifyContent: 'center',
|
|
1597
|
+
padding: 12,
|
|
1598
|
+
backgroundColor: '#f8f9fa',
|
|
1599
|
+
borderRadius: 12,
|
|
1600
|
+
borderWidth: 1,
|
|
1601
|
+
borderColor: '#e9ecef',
|
|
1602
|
+
marginTop: 8
|
|
2646
1603
|
},
|
|
2647
|
-
|
|
1604
|
+
expandButtonText: {
|
|
2648
1605
|
fontSize: 14,
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
asterisk: {
|
|
2653
|
-
color: '#FF6B6B',
|
|
2654
|
-
fontSize: 16,
|
|
2655
|
-
fontWeight: 'bold',
|
|
2656
|
-
marginLeft: 2
|
|
1606
|
+
fontWeight: '500',
|
|
1607
|
+
color: COLORS.primary,
|
|
1608
|
+
marginLeft: 8
|
|
2657
1609
|
},
|
|
2658
|
-
|
|
2659
|
-
|
|
1610
|
+
// Test mode styles
|
|
1611
|
+
testModeContainer: {
|
|
1612
|
+
marginTop: 16,
|
|
1613
|
+
paddingHorizontal: 16,
|
|
1614
|
+
backgroundColor: '#f8f9fa',
|
|
1615
|
+
borderRadius: 12,
|
|
1616
|
+
padding: 16,
|
|
2660
1617
|
borderWidth: 1,
|
|
2661
|
-
borderColor: '#
|
|
2662
|
-
borderRadius: 8,
|
|
2663
|
-
paddingHorizontal: 12,
|
|
2664
|
-
paddingVertical: 8,
|
|
2665
|
-
marginTop: 8,
|
|
2666
|
-
marginHorizontal: 4
|
|
1618
|
+
borderColor: '#e9ecef'
|
|
2667
1619
|
},
|
|
2668
|
-
|
|
2669
|
-
fontSize:
|
|
2670
|
-
|
|
1620
|
+
testModeTitle: {
|
|
1621
|
+
fontSize: 16,
|
|
1622
|
+
fontWeight: '600',
|
|
1623
|
+
color: '#495057',
|
|
1624
|
+
marginBottom: 12,
|
|
2671
1625
|
textAlign: 'center'
|
|
2672
1626
|
},
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
1627
|
+
testDataRequestButton: {
|
|
1628
|
+
flexDirection: 'row',
|
|
1629
|
+
alignItems: 'center',
|
|
1630
|
+
justifyContent: 'center',
|
|
1631
|
+
padding: 12,
|
|
1632
|
+
backgroundColor: '#fff3cd',
|
|
1633
|
+
borderRadius: 12,
|
|
1634
|
+
borderWidth: 1,
|
|
1635
|
+
borderColor: '#ffeaa7',
|
|
1636
|
+
marginBottom: 8
|
|
2676
1637
|
},
|
|
2677
|
-
|
|
2678
|
-
|
|
1638
|
+
testDataRequestButtonText: {
|
|
1639
|
+
fontSize: 14,
|
|
1640
|
+
fontWeight: '500',
|
|
1641
|
+
color: '#856404',
|
|
1642
|
+
marginLeft: 8
|
|
2679
1643
|
},
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
1644
|
+
testExistingUserButton: {
|
|
1645
|
+
flexDirection: 'row',
|
|
1646
|
+
alignItems: 'center',
|
|
1647
|
+
justifyContent: 'center',
|
|
1648
|
+
padding: 12,
|
|
1649
|
+
backgroundColor: '#d4edda',
|
|
2684
1650
|
borderRadius: 12,
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
1651
|
+
borderWidth: 1,
|
|
1652
|
+
borderColor: '#c3e6cb',
|
|
1653
|
+
marginBottom: 8
|
|
2688
1654
|
},
|
|
2689
|
-
|
|
1655
|
+
testExistingUserButtonText: {
|
|
2690
1656
|
fontSize: 14,
|
|
2691
|
-
fontWeight: '
|
|
2692
|
-
color: '#
|
|
2693
|
-
|
|
1657
|
+
fontWeight: '500',
|
|
1658
|
+
color: '#155724',
|
|
1659
|
+
marginLeft: 8
|
|
2694
1660
|
},
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
1661
|
+
testSkipToTrainingButton: {
|
|
1662
|
+
flexDirection: 'row',
|
|
1663
|
+
alignItems: 'center',
|
|
1664
|
+
justifyContent: 'center',
|
|
1665
|
+
padding: 12,
|
|
1666
|
+
backgroundColor: '#d1ecf1',
|
|
1667
|
+
borderRadius: 12,
|
|
1668
|
+
borderWidth: 1,
|
|
1669
|
+
borderColor: '#bee5eb'
|
|
1670
|
+
},
|
|
1671
|
+
testSkipToTrainingButtonText: {
|
|
1672
|
+
fontSize: 14,
|
|
1673
|
+
fontWeight: '500',
|
|
1674
|
+
color: '#0c5460',
|
|
1675
|
+
marginLeft: 8
|
|
2699
1676
|
}
|
|
2700
1677
|
});
|
|
2701
1678
|
//# sourceMappingURL=UniversalOnboarding.js.map
|