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