@onairos/react-native 3.7.2 → 3.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/lib/commonjs/api/index.js +219 -9
  2. package/lib/commonjs/components/BodyText.js +27 -9
  3. package/lib/commonjs/components/BrandMark.js +111 -10
  4. package/lib/commonjs/components/CodeInput.js +120 -9
  5. package/lib/commonjs/components/EmailInput.js +30 -8
  6. package/lib/commonjs/components/GoogleButton.js +56 -9
  7. package/lib/commonjs/components/HeadingGroup.js +43 -9
  8. package/lib/commonjs/components/LLMDataInputModal.js +664 -14
  9. package/lib/commonjs/components/ModalHeader.js +99 -9
  10. package/lib/commonjs/components/ModalSheet.js +47 -9
  11. package/lib/commonjs/components/Onairos.js +380 -14
  12. package/lib/commonjs/components/OnairosButton.js +313 -13
  13. package/lib/commonjs/components/OnairosSignInButton.js +130 -12
  14. package/lib/commonjs/components/Overlay.js +465 -13
  15. package/lib/commonjs/components/PersonaImage.js +137 -10
  16. package/lib/commonjs/components/PersonaLoadingScreen.js +318 -12
  17. package/lib/commonjs/components/PersonalizationConsentScreen.js +467 -13
  18. package/lib/commonjs/components/PinCreationScreen.js +403 -12
  19. package/lib/commonjs/components/PinInput.js +464 -9
  20. package/lib/commonjs/components/PlatformConnectorsStep.js +1311 -23
  21. package/lib/commonjs/components/PlatformList.js +137 -10
  22. package/lib/commonjs/components/PlatformToggle.js +180 -9
  23. package/lib/commonjs/components/PrimaryButton.js +180 -10
  24. package/lib/commonjs/components/SignInMatchAnimation.js +197 -9
  25. package/lib/commonjs/components/SignInStep.js +345 -12
  26. package/lib/commonjs/components/UniversalOnboarding.js +2780 -30
  27. package/lib/commonjs/components/VerificationStep.js +176 -11
  28. package/lib/commonjs/components/WelcomeScreen.js +461 -22
  29. package/lib/commonjs/components/icons/Basicproficon.js +37 -8
  30. package/lib/commonjs/components/icons/Basicprofile.js +21 -8
  31. package/lib/commonjs/components/icons/Checkbox.js +21 -8
  32. package/lib/commonjs/components/icons/Checkmark.js +27 -8
  33. package/lib/commonjs/components/icons/Contentanalysis.js +21 -8
  34. package/lib/commonjs/components/icons/Contenticon.js +39 -8
  35. package/lib/commonjs/components/icons/EnochE.js +41 -8
  36. package/lib/commonjs/components/icons/Personalityicon.js +30 -8
  37. package/lib/commonjs/components/icons/Personalityprofile.js +21 -8
  38. package/lib/commonjs/components/icons/Personalitytraits.js +21 -8
  39. package/lib/commonjs/components/icons/Userpreferences.js +21 -8
  40. package/lib/commonjs/components/icons/index.js +84 -17
  41. package/lib/commonjs/components/onboarding/OAuthWebView.js +1754 -18
  42. package/lib/commonjs/components/onboarding/OnboardingHeader.js +74 -10
  43. package/lib/commonjs/components/onboarding/PinInput.js +283 -10
  44. package/lib/commonjs/components/onboarding/PlatformConnector.js +249 -11
  45. package/lib/commonjs/config/PLATFORM_APIS.md +849 -0
  46. package/lib/commonjs/config/api.js +56 -7
  47. package/lib/commonjs/constants/index.js +120 -7
  48. package/lib/commonjs/context/AuthContext.js +345 -10
  49. package/lib/commonjs/hooks/useConnectedAccounts.js +111 -9
  50. package/lib/commonjs/hooks/useConnections.js +102 -8
  51. package/lib/commonjs/hooks/useCredentials.js +178 -10
  52. package/lib/commonjs/hooks/useUserConnections.js +148 -10
  53. package/lib/commonjs/index.js +439 -34
  54. package/lib/commonjs/services/apiClient.js +298 -8
  55. package/lib/commonjs/services/biometricPinService.js +180 -8
  56. package/lib/commonjs/services/chatGPTConversationExtractor.js +155 -8
  57. package/lib/commonjs/services/chatGPTConversationService.js +275 -9
  58. package/lib/commonjs/services/claudeConversationExtractor.js +103 -8
  59. package/lib/commonjs/services/claudeConversationService.js +158 -9
  60. package/lib/commonjs/services/connectedAccountsService.js +310 -10
  61. package/lib/commonjs/services/googleAuthService.js +252 -11
  62. package/lib/commonjs/services/hingeDataExtractor.js +105 -8
  63. package/lib/commonjs/services/hingeDataService.js +150 -9
  64. package/lib/commonjs/services/imageCompressionService.js +260 -7
  65. package/lib/commonjs/services/instagramDataExtractor.js +126 -8
  66. package/lib/commonjs/services/instagramDataService.js +163 -9
  67. package/lib/commonjs/services/jwtStorageService.js +276 -7
  68. package/lib/commonjs/services/linkedinDOMExtractor.js +245 -7
  69. package/lib/commonjs/services/linkedinProfileService.js +222 -9
  70. package/lib/commonjs/services/linkedinScrapingService.js +230 -8
  71. package/lib/commonjs/services/llmDataStorage.js +294 -8
  72. package/lib/commonjs/services/mobileTrainingService.js +186 -8
  73. package/lib/commonjs/services/netflixDataExtractor.js +120 -8
  74. package/lib/commonjs/services/netflixDataService.js +198 -9
  75. package/lib/commonjs/services/pinEncryptionService.js +84 -8
  76. package/lib/commonjs/services/pinStorageUtils.js +105 -7
  77. package/lib/commonjs/services/platformAuthService.js +1484 -12
  78. package/lib/commonjs/services/sephoraDataExtractor.js +140 -8
  79. package/lib/commonjs/services/sephoraDataService.js +200 -9
  80. package/lib/commonjs/services/spotifyDataExtractor.js +148 -8
  81. package/lib/commonjs/services/spotifyDataService.js +241 -9
  82. package/lib/commonjs/services/storageService.js +404 -8
  83. package/lib/commonjs/services/telegramDataExtractor.js +115 -8
  84. package/lib/commonjs/services/telegramDataService.js +499 -9
  85. package/lib/commonjs/services/trainingApiHelpers.js +73 -7
  86. package/lib/commonjs/services/userConnectionsService.js +340 -10
  87. package/lib/commonjs/services/youtubeMigrationService.js +416 -10
  88. package/lib/commonjs/theme/index.js +250 -7
  89. package/lib/commonjs/types/ambient.d.js +2 -1
  90. package/lib/commonjs/types/declarations.d.js +2 -1
  91. package/lib/commonjs/types/index.js +6 -1
  92. package/lib/commonjs/types/node-fix.d.js +2 -1
  93. package/lib/commonjs/types/node-override.d.js +2 -1
  94. package/lib/commonjs/types/opacity.d.js +2 -1
  95. package/lib/commonjs/types.js +14 -1
  96. package/lib/commonjs/utils/Portal.js +98 -8
  97. package/lib/commonjs/utils/api.js +130 -9
  98. package/lib/commonjs/utils/assetRegistry.js +210 -35
  99. package/lib/commonjs/utils/auth.js +112 -9
  100. package/lib/commonjs/utils/connectorTests.js +613 -29
  101. package/lib/commonjs/utils/crypto.js +62 -8
  102. package/lib/commonjs/utils/debugHelper.js +64 -1
  103. package/lib/commonjs/utils/encryption.js +76 -7
  104. package/lib/commonjs/utils/eventUtils.js +288 -1
  105. package/lib/commonjs/utils/haptics.js +66 -9
  106. package/lib/commonjs/utils/imagePreloader.js +6 -1
  107. package/lib/commonjs/utils/networkDiagnostics.js +226 -8
  108. package/lib/commonjs/utils/onairosApi.js +350 -9
  109. package/lib/commonjs/utils/programmaticFlow.js +117 -9
  110. package/lib/commonjs/utils/retryHelper.js +220 -1
  111. package/lib/commonjs/utils/secureStorage.js +349 -10
  112. package/lib/commonjs/utils/webviewScripts/chatgpt.js +551 -1
  113. package/lib/commonjs/utils/webviewScripts/claude.js +376 -1
  114. package/lib/commonjs/utils/webviewScripts/hinge.js +411 -1
  115. package/lib/commonjs/utils/webviewScripts/index.js +698 -15
  116. package/lib/commonjs/utils/webviewScripts/instagram.js +454 -1
  117. package/lib/commonjs/utils/webviewScripts/linkedin.js +880 -1
  118. package/lib/commonjs/utils/webviewScripts/netflix.js +382 -1
  119. package/lib/commonjs/utils/webviewScripts/sephora.js +516 -1
  120. package/lib/commonjs/utils/webviewScripts/spotify.js +419 -1
  121. package/lib/commonjs/utils/webviewScripts/telegram.js +678 -1
  122. package/lib/module/api/index.js +211 -1
  123. package/lib/module/components/BodyText.js +20 -1
  124. package/lib/module/components/BrandMark.js +104 -1
  125. package/lib/module/components/CodeInput.js +113 -1
  126. package/lib/module/components/EmailInput.js +23 -1
  127. package/lib/module/components/GoogleButton.js +49 -1
  128. package/lib/module/components/HeadingGroup.js +36 -1
  129. package/lib/module/components/LLMDataInputModal.js +656 -7
  130. package/lib/module/components/ModalHeader.js +92 -1
  131. package/lib/module/components/ModalSheet.js +39 -1
  132. package/lib/module/components/Onairos.js +373 -1
  133. package/lib/module/components/OnairosButton.js +305 -1
  134. package/lib/module/components/OnairosSignInButton.js +121 -1
  135. package/lib/module/components/Overlay.js +456 -1
  136. package/lib/module/components/PersonaImage.js +129 -1
  137. package/lib/module/components/PersonaLoadingScreen.js +310 -1
  138. package/lib/module/components/PersonalizationConsentScreen.js +460 -1
  139. package/lib/module/components/PinCreationScreen.js +396 -1
  140. package/lib/module/components/PinInput.js +456 -1
  141. package/lib/module/components/PlatformConnectorsStep.js +1302 -6
  142. package/lib/module/components/PlatformList.js +129 -1
  143. package/lib/module/components/PlatformToggle.js +173 -1
  144. package/lib/module/components/PrimaryButton.js +172 -1
  145. package/lib/module/components/SignInMatchAnimation.js +189 -1
  146. package/lib/module/components/SignInStep.js +338 -1
  147. package/lib/module/components/UniversalOnboarding.js +2770 -1
  148. package/lib/module/components/VerificationStep.js +168 -1
  149. package/lib/module/components/WelcomeScreen.js +453 -1
  150. package/lib/module/components/icons/Basicproficon.js +30 -1
  151. package/lib/module/components/icons/Basicprofile.js +14 -1
  152. package/lib/module/components/icons/Checkbox.js +14 -1
  153. package/lib/module/components/icons/Checkmark.js +20 -1
  154. package/lib/module/components/icons/Contentanalysis.js +14 -1
  155. package/lib/module/components/icons/Contenticon.js +32 -1
  156. package/lib/module/components/icons/EnochE.js +34 -1
  157. package/lib/module/components/icons/Personalityicon.js +23 -1
  158. package/lib/module/components/icons/Personalityprofile.js +14 -1
  159. package/lib/module/components/icons/Personalitytraits.js +14 -1
  160. package/lib/module/components/icons/Userpreferences.js +14 -1
  161. package/lib/module/components/icons/index.js +13 -1
  162. package/lib/module/components/onboarding/OAuthWebView.js +1746 -1
  163. package/lib/module/components/onboarding/OnboardingHeader.js +66 -1
  164. package/lib/module/components/onboarding/PinInput.js +274 -1
  165. package/lib/module/components/onboarding/PlatformConnector.js +240 -1
  166. package/lib/module/config/PLATFORM_APIS.md +849 -0
  167. package/lib/module/config/api.js +47 -1
  168. package/lib/module/constants/index.js +114 -1
  169. package/lib/module/context/AuthContext.js +335 -1
  170. package/lib/module/hooks/useConnectedAccounts.js +106 -1
  171. package/lib/module/hooks/useConnections.js +95 -1
  172. package/lib/module/hooks/useCredentials.js +171 -6
  173. package/lib/module/hooks/useUserConnections.js +140 -1
  174. package/lib/module/index.js +172 -1
  175. package/lib/module/services/apiClient.js +295 -1
  176. package/lib/module/services/biometricPinService.js +169 -1
  177. package/lib/module/services/chatGPTConversationExtractor.js +149 -1
  178. package/lib/module/services/chatGPTConversationService.js +268 -1
  179. package/lib/module/services/claudeConversationExtractor.js +97 -1
  180. package/lib/module/services/claudeConversationService.js +151 -1
  181. package/lib/module/services/connectedAccountsService.js +293 -1
  182. package/lib/module/services/googleAuthService.js +241 -1
  183. package/lib/module/services/hingeDataExtractor.js +99 -1
  184. package/lib/module/services/hingeDataService.js +143 -1
  185. package/lib/module/services/imageCompressionService.js +250 -1
  186. package/lib/module/services/instagramDataExtractor.js +120 -1
  187. package/lib/module/services/instagramDataService.js +156 -1
  188. package/lib/module/services/jwtStorageService.js +257 -1
  189. package/lib/module/services/linkedinDOMExtractor.js +234 -1
  190. package/lib/module/services/linkedinProfileService.js +210 -1
  191. package/lib/module/services/linkedinScrapingService.js +219 -1
  192. package/lib/module/services/llmDataStorage.js +277 -1
  193. package/lib/module/services/mobileTrainingService.js +173 -1
  194. package/lib/module/services/netflixDataExtractor.js +114 -1
  195. package/lib/module/services/netflixDataService.js +191 -1
  196. package/lib/module/services/pinEncryptionService.js +74 -6
  197. package/lib/module/services/pinStorageUtils.js +93 -1
  198. package/lib/module/services/platformAuthService.js +1461 -1
  199. package/lib/module/services/sephoraDataExtractor.js +134 -1
  200. package/lib/module/services/sephoraDataService.js +193 -1
  201. package/lib/module/services/spotifyDataExtractor.js +142 -1
  202. package/lib/module/services/spotifyDataService.js +234 -1
  203. package/lib/module/services/storageService.js +383 -1
  204. package/lib/module/services/telegramDataExtractor.js +109 -1
  205. package/lib/module/services/telegramDataService.js +493 -1
  206. package/lib/module/services/trainingApiHelpers.js +67 -1
  207. package/lib/module/services/userConnectionsService.js +329 -1
  208. package/lib/module/services/youtubeMigrationService.js +405 -1
  209. package/lib/module/theme/index.js +245 -1
  210. package/lib/module/types.js +10 -1
  211. package/lib/module/utils/Portal.js +90 -1
  212. package/lib/module/utils/api.js +118 -1
  213. package/lib/module/utils/assetRegistry.js +200 -34
  214. package/lib/module/utils/auth.js +100 -1
  215. package/lib/module/utils/connectorTests.js +600 -27
  216. package/lib/module/utils/crypto.js +54 -1
  217. package/lib/module/utils/debugHelper.js +54 -1
  218. package/lib/module/utils/encryption.js +67 -1
  219. package/lib/module/utils/eventUtils.js +270 -1
  220. package/lib/module/utils/haptics.js +59 -8
  221. package/lib/module/utils/imagePreloader.js +3 -1
  222. package/lib/module/utils/networkDiagnostics.js +217 -1
  223. package/lib/module/utils/onairosApi.js +333 -1
  224. package/lib/module/utils/programmaticFlow.js +111 -1
  225. package/lib/module/utils/retryHelper.js +211 -1
  226. package/lib/module/utils/secureStorage.js +330 -6
  227. package/lib/module/utils/webviewScripts/chatgpt.js +545 -1
  228. package/lib/module/utils/webviewScripts/claude.js +370 -1
  229. package/lib/module/utils/webviewScripts/hinge.js +405 -1
  230. package/lib/module/utils/webviewScripts/index.js +434 -1
  231. package/lib/module/utils/webviewScripts/instagram.js +448 -1
  232. package/lib/module/utils/webviewScripts/linkedin.js +874 -1
  233. package/lib/module/utils/webviewScripts/netflix.js +376 -1
  234. package/lib/module/utils/webviewScripts/sephora.js +510 -1
  235. package/lib/module/utils/webviewScripts/spotify.js +413 -1
  236. package/lib/module/utils/webviewScripts/telegram.js +672 -1
  237. package/package.json +2 -2
@@ -1 +1,329 @@
1
- import{getAuthToken,getUserProfile,ensureAuthentication}from'./authService';import AsyncStorage from'@react-native-async-storage/async-storage';function _0x1633(_0x5b21dd,_0x163304){_0x5b21dd=_0x5b21dd-0x0;const _0x3bc1ea=_0x5b21();let _0x30eb3c=_0x3bc1ea[_0x5b21dd];return _0x30eb3c;}import{API_CONFIG}from'../config/api';const getUserIdWithFallbacks=async()=>{const _0x795f05={'cXrzM':_0x1633(0x0),'Ukuyq':_0x1633(0x1),'YgdKa':_0x1633(0x2),'OgEbZ':_0x1633(0x3),'MSvdg':'âš ī¸\x20[CONNECTIONS\x20API]\x20No\x20authentication\x20token\x20available\x20for\x20user\x20ID\x20connections\x20request','vKuHA':_0x1633(0x4),'XRMnY':'❌\x20[NETWORK\x20ERROR]\x20Full\x20error\x20details:','rlaaP':function(_0x208418,_0x437eff){return _0x208418!==_0x437eff;},'Tbdsc':_0x1633(0x5),'JzUGG':function(_0x33d1e8){return _0x33d1e8();},'pZarM':function(_0x59be31,_0x332786){return _0x59be31!==_0x332786;},'wEtYy':'✅\x20[USER\x20ID]\x20Got\x20user\x20ID\x20from\x20getUserProfile:','OgFMJ':'âš ī¸\x20[USER\x20ID]\x20getUserProfile\x20returned\x20invalid/fallback\x20ID:','mDAvb':function(_0x4736e7,_0x3ffda7){return _0x4736e7===_0x3ffda7;},'VsDPJ':function(_0x285a27,_0x421cb4){return _0x285a27!==_0x421cb4;},'YslGj':_0x1633(0x6),'TJSFV':_0x1633(0x7),'Iuudh':_0x1633(0x8),'sjPQS':_0x1633(0x9),'yXXMS':function(_0x6b56cf,_0x7a519b){return _0x6b56cf!==_0x7a519b;},'ZfeYM':'marker','xWPwq':function(_0x53147b,_0x50d0d9){return _0x53147b>_0x50d0d9;},'WGiiU':'wmpdh','xklFI':_0x1633(0xa),'IPoHJ':'âš ī¸\x20[USER\x20ID]\x20Invalid\x20stored\x20user\x20ID\x20found:','nErMS':_0x1633(0xb),'SObtV':function(_0x46bd12,_0x3ee678){return _0x46bd12>_0x3ee678;},'OyTHq':function(_0x260125,_0x251add){return _0x260125!==_0x251add;},'ajJur':'✅\x20[USER\x20ID]\x20Got\x20username\x20from\x20AsyncStorage\x20(backend\x20supports\x20usernames):','TcHZj':_0x1633(0xc),'ibYzD':_0x1633(0xd),'IrFYC':_0x1633(0xe),'xiqMO':function(_0x4c5b15,_0x5bd900){return _0x4c5b15!==_0x5bd900;},'HgMzf':'KUUnx','pGboF':'âš ī¸\x20[USER\x20ID]\x20Invalid\x20stored\x20email\x20found:','MNKBV':function(_0x579207){return _0x579207();},'OsXuS':function(_0x1e46e6,_0x25f956){return _0x1e46e6===_0x25f956;},'KiPwK':'DGeUP','wFPaw':_0x1633(0xf)};try{console[_0x1633(0x10)]('🔍\x20[USER\x20ID]\x20Attempting\x20to\x20get\x20user\x20identifier\x20with\x20multiple\x20methods...');try{if(_0x795f05[_0x1633(0x11)](_0x795f05[_0x1633(0x12)],_0x795f05[_0x1633(0x12)]))_0x484055[_0x1633(0x10)](_0x795f05[_0x1633(0x13)],_0x5caca9),_0x5b0bc7=_0x2c0ca1;else{const _0x4b67bd=await _0x795f05['JzUGG'](getUserProfile);if(_0x795f05[_0x1633(0x14)](_0x4b67bd,null)&&_0x795f05[_0x1633(0x14)](_0x4b67bd,void 0x0)&&_0x4b67bd['id']&&_0x795f05['rlaaP'](_0x4b67bd['id'],_0x1633(0x15)))return console['log'](_0x795f05[_0x1633(0x16)],_0x4b67bd['id']),_0x4b67bd['id'];else console[_0x1633(0x17)](_0x795f05['OgFMJ'],_0x4b67bd===null||_0x795f05[_0x1633(0x18)](_0x4b67bd,void 0x0)?void 0x0:_0x4b67bd['id']);}}catch(_0x38fbdf){_0x795f05[_0x1633(0x19)](_0x795f05['YslGj'],_0x795f05[_0x1633(0x1a)])?console[_0x1633(0x17)](_0x795f05[_0x1633(0x1b)],_0x38fbdf):_0x130d2c[_0x1633(0x10)](_0x795f05['Ukuyq']);}const _0x2ccb66=await AsyncStorage['getItem'](_0x795f05['sjPQS']);if(_0x2ccb66&&_0x795f05['yXXMS'](_0x2ccb66,_0x795f05[_0x1633(0x1c)])&&_0x2ccb66!==_0x1633(0x15)&&_0x795f05[_0x1633(0x1d)](_0x2ccb66[_0x1633(0x1e)],0xa)){if('wmpdh'!==_0x795f05[_0x1633(0x1f)]){const _0x578350=_0x278c64[_0x1633(0x20)][_0x1633(0x21)](_0x4aee5f);return _0x4fd380['log'](_0x795f05[_0x1633(0x22)],_0x578350[_0x1633(0x1e)]),_0x578350;}else return console[_0x1633(0x10)](_0x795f05['xklFI'],_0x2ccb66),_0x2ccb66;}else _0x2ccb66&&console[_0x1633(0x17)](_0x795f05[_0x1633(0x23)],_0x2ccb66);const _0x2298c7=await AsyncStorage[_0x1633(0x24)](_0x795f05[_0x1633(0x25)]);if(_0x2298c7&&_0x795f05[_0x1633(0x26)](_0x2298c7[_0x1633(0x1e)],0x2)&&_0x795f05[_0x1633(0x27)](_0x2298c7,_0x795f05[_0x1633(0x1c)]))return console[_0x1633(0x10)](_0x795f05[_0x1633(0x28)],_0x2298c7),_0x2298c7;else{if(_0x2298c7){if(_0x795f05['OyTHq']('SArbc',_0x795f05[_0x1633(0x29)]))console['warn'](_0x795f05[_0x1633(0x2a)],_0x2298c7);else return _0x147f2d[_0x1633(0x10)](_0x795f05['OgEbZ'],_0x4f3517),[];}}const _0x447660=await AsyncStorage[_0x1633(0x24)](_0x795f05[_0x1633(0x2b)]);if(_0x447660&&_0x447660[_0x1633(0x2c)]('@')&&_0x795f05[_0x1633(0x26)](_0x447660['length'],0x5))return _0x795f05[_0x1633(0x2d)]('KUUnx',_0x795f05[_0x1633(0x2e)])?(_0x4a72ee[_0x1633(0x17)](_0x795f05[_0x1633(0x2f)]),[]):(console['log'](_0x1633(0x30),_0x447660),_0x447660);else _0x447660&&console['warn'](_0x795f05[_0x1633(0x31)],_0x447660);try{const _0x190326=await _0x795f05[_0x1633(0x32)](getAuthToken);if(_0x190326&&_0x795f05['mDAvb'](_0x190326[_0x1633(0x33)]('.')[_0x1633(0x1e)],0x3)){if(_0x795f05[_0x1633(0x34)](_0x1633(0x35),_0x795f05[_0x1633(0x36)]))console['log'](_0x795f05['Ukuyq']);else return _0x576bdb[_0x1633(0x10)](_0x795f05[_0x1633(0x37)],_0x2ea253),_0x45ff99[_0x1633(0x10)](_0x795f05['XRMnY'],_0x278f97[_0x1633(0x38)](_0x53e9bf,_0xf48655[_0x1633(0x39)](_0x2ad090))),[];}}catch(_0x42f857){console[_0x1633(0x17)]('âš ī¸\x20[USER\x20ID]\x20JWT\x20token\x20access\x20failed:',_0x42f857);}return console[_0x1633(0x3a)]('❌\x20[USER\x20ID]\x20No\x20valid\x20user\x20identifier\x20found'),null;}catch(_0x544f66){return console[_0x1633(0x3a)](_0x795f05[_0x1633(0x3b)],_0x544f66),null;}};function _0x5b21(){const _0x5133a8=['🔄\x20[USER\x20DEBUG]\x20Using\x20stored\x20user\x20ID\x20as\x20fallback:','🔍\x20[USER\x20ID]\x20JWT\x20token\x20found\x20but\x20no\x20local\x20user\x20identifier\x20-\x20backend\x20should\x20handle\x20via\x20token','🔄\x20Transformed\x20connections\x20by\x20username:','❌\x20Error\x20in\x20getUserConnections:','❌\x20Error\x20fetching\x20connections\x20by\x20username:','szgXq','IUwvE','yAIQi','âš ī¸\x20[USER\x20ID]\x20getUserProfile\x20failed:','user_id','✅\x20[USER\x20ID]\x20Got\x20user\x20ID\x20from\x20AsyncStorage:','onairos_username','uPEDk','âš ī¸\x20[USER\x20ID]\x20Invalid\x20stored\x20username\x20found:','user_email','❌\x20[USER\x20ID]\x20Error\x20getting\x20user\x20identifier:','log','rlaaP','Tbdsc','cXrzM','pZarM','fallback_user','wEtYy','warn','mDAvb','VsDPJ','TJSFV','Iuudh','ZfeYM','xWPwq','length','WGiiU','connections','map','YgdKa','IPoHJ','getItem','nErMS','SObtV','OyTHq','ajJur','TcHZj','ibYzD','IrFYC','includes','xiqMO','HgMzf','MSvdg','✅\x20[USER\x20ID]\x20Got\x20email\x20from\x20AsyncStorage\x20(backend\x20supports\x20usernames):','pGboF','MNKBV','split','OsXuS','DGeUP','KiPwK','vKuHA','stringify','getOwnPropertyNames','error','wFPaw','level1','level2','level4','level5','🔄\x20Transforming\x20API\x20connection:','Hi!\x20Nice\x20to\x20meet\x20you.','oljME','name','photo','GMGHA','interests','sharedPassions','compatibility','_id','sqvfJ','random','Unknown\x20User','description','Looking\x20to\x20connect','mutualConnections','conversationStarters','JVXie','meaningfulCoincidences','mutualConnectionsList','context','âš ī¸\x20[CONNECTIONS\x20API]\x20No\x20authentication\x20token\x20available\x20for\x20connections\x20request','âš ī¸\x20[CONNECTIONS\x20API]\x20This\x20may\x20result\x20in\x20limited\x20or\x20cached\x20data\x20from\x20backend','NHoog','🔍\x20Fetching\x20connections\x20for\x20username:','mock','✅\x20API\x20connections\x20fetched\x20by\x20username:','❌\x20[NETWORK\x20ERROR]\x20Full\x20error\x20details:','zATBX','xnzqD','kxGyQ','✅\x20[CONNECTIONS\x20API]\x20Using\x20authenticated\x20request\x20with\x20token:','substring','...','API\x20function\x20not\x20available','DoFLO','XbKZg','success','kumCi','source','NaDhy','edWpi','wtagX','rILpY','wnQXp','âš ī¸\x20[USER\x20ID]\x20Invalid\x20stored\x20email\x20found:','wQMRG','liONG','âš ī¸\x20[CONNECTIONS\x20API]\x20No\x20authentication\x20token\x20available\x20for\x20user\x20ID\x20connections\x20request','✅\x20API\x20connections\x20fetched\x20by\x20userId:','🔄\x20Transformed\x20connections\x20by\x20userId:','❌\x20Error\x20fetching\x20connections\x20by\x20userId:','❌\x20[NETWORK\x20ERROR\x20FALLBACK]\x20Full\x20error\x20details:','PnzkN','pCXMf','uHRjY','KTFQm','qHSXm','SXGbJ','QDETd','NpdKW','uJAix','mmkCy','🔄\x20[USER\x20DEBUG]\x20Using\x20stored\x20username\x20as\x20email\x20fallback:','âš ī¸\x20[USER\x20ID]\x20getUserProfile\x20returned\x20invalid/fallback\x20ID:','AoaFD','🔍\x20[USER\x20DEBUG]\x20Checking\x20all\x20available\x20user\x20data\x20sources...','auth_token','🔍\x20[USER\x20DEBUG]\x20AsyncStorage\x20data:','CKdRK','🔄\x20[USER\x20DEBUG]\x20Using\x20stored\x20email\x20as\x20fallback:','đŸŽ¯\x20[USER\x20DEBUG]\x20Final\x20user\x20identifiers\x20to\x20use:','đŸŽ¯\x20PRIORITY:\x20Attempting\x20to\x20fetch\x20connections\x20by\x20email\x20(working\x20endpoint):','✅\x20Successfully\x20got\x20connections\x20by\x20email:','âš ī¸\x20No\x20connections\x20found\x20by\x20email,\x20trying\x20user\x20ID...','✅\x20Successfully\x20got\x20connections\x20by\x20user\x20ID:','âš ī¸\x20No\x20user\x20identifier\x20available\x20or\x20no\x20connections\x20found','DyRYR','RtQcb','disls','BXwog','lovmu','ZhaiS','aFnRI','tnKUR','none','bujWE','RFhBx','QWWEg','email','fZqlB','WahTm','GcUkg','yfnaR','nspZv','âš ī¸\x20[USER\x20ID]\x20Invalid\x20stored\x20user\x20ID\x20found:','DkPxS','YwFlr','DrTZg','inRQt','eFBwS','Gddqk','QDIFd','bLABN','FgBDH','ydMOJ','âš ī¸\x20No\x20connections\x20found\x20by\x20user\x20ID','CRDBx','SAqNx','GykKf','OCoVn','iYjFO','KWAmN','âš ī¸\x20[DEPRECATED]\x20uploadProfilePicture\x20has\x20been\x20removed\x20from\x20SDK','jnbXh'];_0x5b21=function(){return _0x5133a8;};return _0x5b21();}import{PERSONA_IMAGES}from'../utils/assetRegistry';const samImage=PERSONA_IMAGES[_0x1633(0x3c)],anandImage=PERSONA_IMAGES[_0x1633(0x3d)],chrisImage=PERSONA_IMAGES['level3'],katieImage=PERSONA_IMAGES[_0x1633(0x3e)],yanniImage=PERSONA_IMAGES[_0x1633(0x3f)],API_BASE_URL=API_CONFIG['BASE_URL'],transformAPIConnection=_0x36c074=>{const _0x5e0d18={'oljME':_0x1633(0x40),'GMGHA':function(_0x442d0,_0x3cbf27){return _0x442d0===_0x3cbf27;},'sqvfJ':function(_0x25ba1f,_0x77edca){return _0x25ba1f*_0x77edca;},'JVXie':_0x1633(0x41),'NyErt':function(_0x575cba,_0x3196a0){return _0x575cba===_0x3196a0;}};var _0x4482d0,_0x1a9c16;return console[_0x1633(0x10)](_0x5e0d18[_0x1633(0x42)],{'id':_0x36c074['id'],'name':_0x36c074[_0x1633(0x43)],'description':_0x36c074['description'],'hasPhoto':!!_0x36c074[_0x1633(0x44)],'photoLength':(_0x4482d0=_0x36c074[_0x1633(0x44)])===null||_0x5e0d18[_0x1633(0x45)](_0x4482d0,void 0x0)?void 0x0:_0x4482d0[_0x1633(0x1e)],'interests':_0x36c074[_0x1633(0x46)],'sharedPassions':_0x36c074[_0x1633(0x47)],'complementaryQualities':_0x36c074['complementaryQualities'],'compatibility':_0x36c074[_0x1633(0x48)]}),{'id':parseInt(_0x36c074['id'])||parseInt(_0x36c074[_0x1633(0x49)]||'')||_0x5e0d18[_0x1633(0x4a)](Math[_0x1633(0x4b)](),0x3e8),'name':_0x36c074[_0x1633(0x43)]||_0x1633(0x4c),'description':_0x36c074[_0x1633(0x4d)]||_0x1633(0x4e),'photo':_0x36c074[_0x1633(0x44)]||'','bio':_0x36c074['bio']||'','interests':_0x36c074[_0x1633(0x46)]||[],'mutualConnections':_0x36c074[_0x1633(0x4f)]||0x0,'compatibility':_0x36c074[_0x1633(0x48)]||0x0,'conversationStarters':_0x36c074[_0x1633(0x50)]||[_0x5e0d18[_0x1633(0x51)]],'sharedPassions':_0x36c074['sharedPassions']||[],'complementaryQualities':_0x36c074['complementaryQualities']||[],'meaningfulCoincidences':_0x36c074[_0x1633(0x52)]||[],'mutualConnectionsList':(_0x5e0d18[_0x1633(0x45)](_0x1a9c16=_0x36c074[_0x1633(0x53)],null)||_0x5e0d18['NyErt'](_0x1a9c16,void 0x0)?void 0x0:_0x1a9c16[_0x1633(0x21)](_0x4edcfd=>({'name':_0x4edcfd[_0x1633(0x43)],'photo':_0x4edcfd[_0x1633(0x44)],'context':_0x4edcfd[_0x1633(0x54)]})))||[]};};export const getUserConnectionsByUsername=async _0x2194cc=>{const _0x27e758={'kxGyQ':_0x1633(0x55),'JIWKD':_0x1633(0x56),'zATBX':function(_0x355df8,_0x29275f){return _0x355df8!==_0x29275f;},'xnzqD':_0x1633(0x57),'QbUjB':_0x1633(0x58),'YkYNx':function(_0x40062a){return _0x40062a();},'DoFLO':_0x1633(0x59),'XbKZg':_0x1633(0x5a),'kumCi':function(_0x369967,_0x305487){return _0x369967===_0x305487;},'NaDhy':function(_0x1e458b,_0x4270fa){return _0x1e458b!==_0x4270fa;},'edWpi':function(_0x2dbce8,_0x78a541){return _0x2dbce8!==_0x78a541;},'wtagX':function(_0xabda6a,_0x4e887a){return _0xabda6a>_0x4e887a;},'PyWPc':_0x1633(0x2),'rILpY':'❌\x20Error\x20fetching\x20connections\x20by\x20username:','wnQXp':_0x1633(0x5b)};try{if(_0x27e758[_0x1633(0x5c)]('NHoog',_0x27e758[_0x1633(0x5d)]))return _0x3ab938['warn'](_0x27e758[_0x1633(0x5e)]),_0x593639[_0x1633(0x17)](_0x27e758['JIWKD']),[];else{var _0x1cadec,_0x4692ad;console[_0x1633(0x10)](_0x27e758['QbUjB'],_0x2194cc);const _0x132ee5=await _0x27e758['YkYNx'](getAuthToken);if(!_0x132ee5)return console[_0x1633(0x17)](_0x27e758[_0x1633(0x5e)]),console[_0x1633(0x17)](_0x1633(0x56)),[];console[_0x1633(0x10)](_0x1633(0x5f),_0x132ee5[_0x1633(0x60)](0x0,0x14)+_0x1633(0x61));const _0x4e981a={'success':![],'message':_0x1633(0x62),'connections':[],'source':_0x27e758[_0x1633(0x63)]};console[_0x1633(0x10)](_0x27e758[_0x1633(0x64)],{'success':_0x4e981a[_0x1633(0x65)],'connectionsCount':(_0x27e758[_0x1633(0x66)](_0x1cadec=_0x4e981a[_0x1633(0x20)],null)||_0x1cadec===void 0x0?void 0x0:_0x1cadec['length'])||0x0,'source':_0x4e981a[_0x1633(0x67)],'firstConnection':_0x27e758[_0x1633(0x68)](_0x4692ad=_0x4e981a[_0x1633(0x20)],null)&&_0x27e758[_0x1633(0x69)](_0x4692ad,void 0x0)&&_0x4692ad[0x0]?{'id':_0x4e981a[_0x1633(0x20)][0x0]['id'],'name':_0x4e981a[_0x1633(0x20)][0x0][_0x1633(0x43)],'description':_0x4e981a[_0x1633(0x20)][0x0]['description']}:null});if(_0x4e981a[_0x1633(0x65)]&&_0x4e981a[_0x1633(0x20)]&&_0x27e758[_0x1633(0x6a)](_0x4e981a[_0x1633(0x20)]['length'],0x0)){const _0x185277=_0x4e981a[_0x1633(0x20)][_0x1633(0x21)](transformAPIConnection);return console[_0x1633(0x10)](_0x27e758['PyWPc'],_0x185277[_0x1633(0x1e)]),_0x185277;}return[];}}catch(_0x4068a2){return console['log'](_0x27e758[_0x1633(0x6b)],_0x4068a2),console[_0x1633(0x10)](_0x27e758[_0x1633(0x6c)],JSON[_0x1633(0x38)](_0x4068a2,Object[_0x1633(0x39)](_0x4068a2))),[];}};export const getUserConnectionsByUserId=async _0x9293ad=>{const _0x57823b={'XqbXg':_0x1633(0x8),'gBGml':_0x1633(0x6d),'PnzkN':function(_0x564dcf,_0x4b1db2){return _0x564dcf!==_0x4b1db2;},'pCXMf':_0x1633(0x6e),'IoWba':function(_0x3dd556){return _0x3dd556();},'uHRjY':'itypW','KTFQm':_0x1633(0x6f),'qHSXm':_0x1633(0x70),'SXGbJ':_0x1633(0x62),'QDETd':_0x1633(0x59),'VzFrH':_0x1633(0x71),'NpdKW':function(_0x437f9c,_0x23d4e8){return _0x437f9c===_0x23d4e8;},'uJAix':function(_0xb4f50b,_0x5e7130){return _0xb4f50b>_0x5e7130;},'mmkCy':_0x1633(0x72),'ohcDh':_0x1633(0x73),'kAMhH':_0x1633(0x74)};try{if(_0x57823b[_0x1633(0x75)](_0x57823b[_0x1633(0x76)],_0x57823b[_0x1633(0x76)]))_0x41a85f[_0x1633(0x17)](_0x57823b['XqbXg'],_0x1330e5);else{var _0x228569,_0x522a5b;console[_0x1633(0x10)]('🔍\x20Fetching\x20connections\x20for\x20userId:',_0x9293ad);const _0x1f6900=await _0x57823b['IoWba'](getAuthToken);if(!_0x1f6900){if(_0x57823b[_0x1633(0x77)]===_0x57823b[_0x1633(0x78)])_0x1b28fc[_0x1633(0x17)](_0x57823b['gBGml'],_0x53c74f);else return console[_0x1633(0x17)](_0x57823b[_0x1633(0x79)]),[];}console[_0x1633(0x10)]('✅\x20[CONNECTIONS\x20API]\x20Using\x20authenticated\x20request\x20with\x20token:',_0x1f6900[_0x1633(0x60)](0x0,0x14)+_0x1633(0x61));const _0x56486b={'success':![],'message':_0x57823b[_0x1633(0x7a)],'connections':[],'source':_0x57823b[_0x1633(0x7b)]};console[_0x1633(0x10)](_0x57823b['VzFrH'],{'success':_0x56486b[_0x1633(0x65)],'connectionsCount':(_0x57823b[_0x1633(0x7c)](_0x228569=_0x56486b['connections'],null)||_0x57823b[_0x1633(0x7c)](_0x228569,void 0x0)?void 0x0:_0x228569['length'])||0x0,'source':_0x56486b[_0x1633(0x67)],'firstConnection':(_0x522a5b=_0x56486b[_0x1633(0x20)])!==null&&_0x57823b[_0x1633(0x75)](_0x522a5b,void 0x0)&&_0x522a5b[0x0]?{'id':_0x56486b[_0x1633(0x20)][0x0]['id'],'name':_0x56486b['connections'][0x0][_0x1633(0x43)],'description':_0x56486b[_0x1633(0x20)][0x0]['description']}:null});if(_0x56486b[_0x1633(0x65)]&&_0x56486b['connections']&&_0x57823b[_0x1633(0x7d)](_0x56486b['connections'][_0x1633(0x1e)],0x0)){const _0x49f05f=_0x56486b[_0x1633(0x20)][_0x1633(0x21)](transformAPIConnection);return console[_0x1633(0x10)](_0x57823b[_0x1633(0x7e)],_0x49f05f[_0x1633(0x1e)]),_0x49f05f;}return[];}}catch(_0x987298){return console[_0x1633(0x10)](_0x57823b['ohcDh'],_0x987298),console[_0x1633(0x10)](_0x57823b['kAMhH'],JSON['stringify'](_0x987298,Object[_0x1633(0x39)](_0x987298))),[];}};export const getUserConnections=async()=>{const _0xabfff7={'nspZv':_0x1633(0x7f),'SAqNx':_0x1633(0x80),'GykKf':function(_0x431f71,_0x32851a){return _0x431f71===_0x32851a;},'WahTm':function(_0x23357b,_0x810293){return _0x23357b===_0x810293;},'KWAmN':'🔄\x20Transformed\x20connections\x20by\x20userId:','RtQcb':_0x1633(0x81),'GgYWB':function(_0x1c3b58,_0x343591){return _0x1c3b58(_0x343591);},'disls':'USER_CONNECTIONS','BXwog':_0x1633(0x82),'lovmu':_0x1633(0xb),'ZhaiS':_0x1633(0x9),'aFnRI':_0x1633(0x83),'tnKUR':_0x1633(0x84),'bujWE':function(_0x3252ab){return _0x3252ab();},'bpjDX':'đŸŽ¯\x20getUserConnections\x20-\x20User\x20profile:','RFhBx':function(_0x439f54,_0x109e26){return _0x439f54!==_0x109e26;},'QWWEg':function(_0x5426a0,_0xe3ec1a){return _0x5426a0===_0xe3ec1a;},'fZqlB':function(_0x3a4dc8,_0x504d63){return _0x3a4dc8===_0x504d63;},'GcUkg':function(_0x480454,_0x327b84){return _0x480454===_0x327b84;},'kaOyF':function(_0xba424e,_0x1bac7c){return _0xba424e===_0x1bac7c;},'jUnAr':function(_0x3a8d4d,_0x12a40b){return _0x3a8d4d===_0x12a40b;},'yfnaR':_0x1633(0x85),'DkPxS':function(_0x6e9e17,_0x3204ab){return _0x6e9e17&&_0x3204ab;},'YwFlr':_0x1633(0x86),'DrTZg':_0x1633(0x87),'inRQt':_0x1633(0x88),'eFBwS':function(_0x54aaa3,_0x132787){return _0x54aaa3>_0x132787;},'UhSuc':_0x1633(0x89),'Gddqk':_0x1633(0x8a),'QDIFd':function(_0x96db4f,_0x395dfa){return _0x96db4f(_0x395dfa);},'jFvyR':function(_0x42faae,_0x567986){return _0x42faae>_0x567986;},'bLABN':'YzliW','ydMOJ':_0x1633(0x8b),'CRDBx':_0x1633(0x8c),'OCoVn':_0x1633(0x8d),'iYjFO':_0x1633(0x3)};try{if(_0xabfff7[_0x1633(0x8e)]===_0xabfff7[_0x1633(0x8e)]){await _0xabfff7['GgYWB'](ensureAuthentication,_0xabfff7[_0x1633(0x8f)]),console[_0x1633(0x10)](_0xabfff7[_0x1633(0x90)]);const _0x188d66=await AsyncStorage[_0x1633(0x24)](_0xabfff7[_0x1633(0x91)]),_0x42b0ef=await AsyncStorage[_0x1633(0x24)](_0x1633(0xe)),_0x3b670e=await AsyncStorage[_0x1633(0x24)](_0xabfff7[_0x1633(0x92)]),_0x61d94c=await AsyncStorage['getItem'](_0xabfff7[_0x1633(0x93)]);console[_0x1633(0x10)](_0xabfff7[_0x1633(0x94)],{'storedUsername':_0x188d66,'storedEmail':_0x42b0ef,'storedUserId':_0x3b670e,'hasAuthToken':!!_0x61d94c,'authTokenPreview':_0x61d94c?_0x61d94c[_0x1633(0x60)](0x0,0x14)+_0x1633(0x61):_0x1633(0x95)});const _0x450947=await _0xabfff7[_0x1633(0x96)](getUserProfile);console['log'](_0xabfff7['bpjDX'],{'hasId':!!(_0x450947!==null&&_0x450947!==void 0x0&&_0x450947['id']),'hasEmail':!!(_0x450947!==null&&_0xabfff7[_0x1633(0x97)](_0x450947,void 0x0)&&_0x450947['email']),'email':_0xabfff7[_0x1633(0x98)](_0x450947,null)||_0xabfff7[_0x1633(0x98)](_0x450947,void 0x0)?void 0x0:_0x450947[_0x1633(0x99)],'id':_0xabfff7[_0x1633(0x9a)](_0x450947,null)||_0xabfff7[_0x1633(0x9b)](_0x450947,void 0x0)?void 0x0:_0x450947['id']});let _0x5cd275=_0x450947===null||_0xabfff7[_0x1633(0x9c)](_0x450947,void 0x0)?void 0x0:_0x450947['email'],_0x349454=_0xabfff7['kaOyF'](_0x450947,null)||_0xabfff7['jUnAr'](_0x450947,void 0x0)?void 0x0:_0x450947['id'];!_0x5cd275&&_0x188d66&&(_0xabfff7[_0x1633(0x9d)]===_0xabfff7[_0x1633(0x9d)]?(console['log'](_0xabfff7[_0x1633(0x9e)],_0x188d66),_0x5cd275=_0x188d66):_0x9d1a24[_0x1633(0x17)](_0x1633(0x9f),_0x48b300));_0xabfff7[_0x1633(0xa0)](!_0x5cd275,_0x42b0ef)&&(console['log'](_0xabfff7[_0x1633(0xa1)],_0x42b0ef),_0x5cd275=_0x42b0ef);_0xabfff7[_0x1633(0xa0)](!_0x349454,_0x3b670e)&&(console[_0x1633(0x10)](_0x1633(0x0),_0x3b670e),_0x349454=_0x3b670e);console[_0x1633(0x10)](_0xabfff7[_0x1633(0xa2)],{'userEmail':_0x5cd275,'userId':_0x349454,'willTryEmail':!!_0x5cd275,'willTryUserId':!!_0x349454});if(_0x5cd275){console['log'](_0xabfff7[_0x1633(0xa3)],_0x5cd275);const _0x48c193=await getUserConnectionsByUsername(_0x5cd275);if(_0xabfff7[_0x1633(0xa4)](_0x48c193[_0x1633(0x1e)],0x0))return console[_0x1633(0x10)](_0xabfff7['UhSuc'],_0x48c193[_0x1633(0x1e)]),_0x48c193;console[_0x1633(0x10)](_0xabfff7[_0x1633(0xa5)]);}if(_0x349454){console[_0x1633(0x10)]('đŸŽ¯\x20FALLBACK:\x20Attempting\x20to\x20fetch\x20connections\x20by\x20user\x20ID:',_0x349454);const _0x10058f=await _0xabfff7[_0x1633(0xa6)](getUserConnectionsByUserId,_0x349454);if(_0xabfff7['jFvyR'](_0x10058f[_0x1633(0x1e)],0x0)){if(_0xabfff7[_0x1633(0xa7)]===_0x1633(0xa8))_0x2b5e50[_0x1633(0x10)](_0xabfff7['nspZv'],_0x4be8a3),_0x318acc=_0x20503c;else return console[_0x1633(0x10)](_0xabfff7[_0x1633(0xa9)],_0x10058f[_0x1633(0x1e)]),_0x10058f;}console[_0x1633(0x10)](_0x1633(0xaa));}return console[_0x1633(0x10)](_0xabfff7[_0x1633(0xab)]),[];}else _0x78f552[_0x1633(0x17)](_0xabfff7[_0x1633(0xac)],_0xabfff7[_0x1633(0xad)](_0x5b9278,null)||_0xabfff7[_0x1633(0x9b)](_0x24ac46,void 0x0)?void 0x0:_0x25b55f['id']);}catch(_0xb8faa7){if(_0xabfff7['OCoVn']===_0xabfff7[_0x1633(0xae)])return console[_0x1633(0x10)](_0xabfff7[_0x1633(0xaf)],_0xb8faa7),[];else{const _0x11fcc2=_0x4e8cd0[_0x1633(0x20)][_0x1633(0x21)](_0x2fd0c9);return _0x131135['log'](_0xabfff7[_0x1633(0xb0)],_0x11fcc2[_0x1633(0x1e)]),_0x11fcc2;}}};export const uploadProfilePicture=async(_0x3e8d1f,_0x1b7852)=>{const _0x22f63b={'TZNJN':_0x1633(0xb1),'jnbXh':'â„šī¸\x20Consuming\x20apps\x20should\x20call\x20/enoch/users/{id}/profile-picture/base64\x20directly','mUNMi':'uploadProfilePicture\x20has\x20been\x20removed\x20from\x20SDK.\x20Consuming\x20apps\x20should\x20call\x20the\x20Enoch\x20API\x20directly.'};return console['warn'](_0x22f63b['TZNJN']),console[_0x1633(0x17)](_0x22f63b[_0x1633(0xb2)]),{'success':![],'error':_0x22f63b['mUNMi']};};
1
+ import { getAuthToken, getUserProfile, ensureAuthentication } from './authService';
2
+ import AsyncStorage from '@react-native-async-storage/async-storage';
3
+ import { API_CONFIG } from '../config/api';
4
+
5
+ /**
6
+ * Get user identifier (ID or username) using multiple fallback methods
7
+ * Backend now supports both user IDs and usernames for profile picture uploads
8
+ * @returns Promise<string | null>
9
+ */
10
+ const getUserIdWithFallbacks = async () => {
11
+ try {
12
+ console.log('🔍 [USER ID] Attempting to get user identifier with multiple methods...');
13
+
14
+ // Method 1: Try getUserProfile first
15
+ try {
16
+ const userProfile = await getUserProfile();
17
+ if (userProfile !== null && userProfile !== void 0 && userProfile.id && userProfile.id !== 'fallback_user') {
18
+ console.log('✅ [USER ID] Got user ID from getUserProfile:', userProfile.id);
19
+ return userProfile.id;
20
+ } else {
21
+ console.warn('âš ī¸ [USER ID] getUserProfile returned invalid/fallback ID:', userProfile === null || userProfile === void 0 ? void 0 : userProfile.id);
22
+ }
23
+ } catch (error) {
24
+ console.warn('âš ī¸ [USER ID] getUserProfile failed:', error);
25
+ }
26
+
27
+ // Method 2: Check AsyncStorage for stored user ID (but validate it)
28
+ const storedUserId = await AsyncStorage.getItem('user_id');
29
+ if (storedUserId && storedUserId !== 'marker' && storedUserId !== 'fallback_user' && storedUserId.length > 10) {
30
+ console.log('✅ [USER ID] Got user ID from AsyncStorage:', storedUserId);
31
+ return storedUserId;
32
+ } else if (storedUserId) {
33
+ console.warn('âš ī¸ [USER ID] Invalid stored user ID found:', storedUserId);
34
+ }
35
+
36
+ // Method 3: Try stored username (backend now supports usernames!)
37
+ const storedUsername = await AsyncStorage.getItem('onairos_username');
38
+ if (storedUsername && storedUsername.length > 2 && storedUsername !== 'marker') {
39
+ console.log('✅ [USER ID] Got username from AsyncStorage (backend supports usernames):', storedUsername);
40
+ return storedUsername;
41
+ } else if (storedUsername) {
42
+ console.warn('âš ī¸ [USER ID] Invalid stored username found:', storedUsername);
43
+ }
44
+
45
+ // Method 4: Try stored email as username fallback
46
+ const storedEmail = await AsyncStorage.getItem('user_email');
47
+ if (storedEmail && storedEmail.includes('@') && storedEmail.length > 5) {
48
+ console.log('✅ [USER ID] Got email from AsyncStorage (backend supports usernames):', storedEmail);
49
+ return storedEmail;
50
+ } else if (storedEmail) {
51
+ console.warn('âš ī¸ [USER ID] Invalid stored email found:', storedEmail);
52
+ }
53
+
54
+ // Method 5: Check JWT token for user info (but don't decode, just log)
55
+ try {
56
+ const token = await getAuthToken();
57
+ if (token && token.split('.').length === 3) {
58
+ console.log('🔍 [USER ID] JWT token found but no local user identifier - backend should handle via token');
59
+ // Don't try to decode JWT here - let the backend handle it
60
+ }
61
+ } catch (error) {
62
+ console.warn('âš ī¸ [USER ID] JWT token access failed:', error);
63
+ }
64
+ console.error('❌ [USER ID] No valid user identifier found');
65
+ return null;
66
+ } catch (error) {
67
+ console.error('❌ [USER ID] Error getting user identifier:', error);
68
+ return null;
69
+ }
70
+ };
71
+
72
+ // Import images for fallback connections from centralized registry
73
+ import { PERSONA_IMAGES } from '../utils/assetRegistry';
74
+ const samImage = PERSONA_IMAGES.level1;
75
+ const anandImage = PERSONA_IMAGES.level2;
76
+ const chrisImage = PERSONA_IMAGES.level3;
77
+ const katieImage = PERSONA_IMAGES.level4;
78
+ const yanniImage = PERSONA_IMAGES.level5;
79
+ const API_BASE_URL = API_CONFIG.BASE_URL;
80
+
81
+ // Interface for API connection response - updated to match actual backend format
82
+
83
+ // Interface for API response
84
+
85
+ // Interface for the transformed connection used by UI
86
+
87
+ /**
88
+ * Transform API connection to UI connection format
89
+ */
90
+ const transformAPIConnection = apiConnection => {
91
+ var _apiConnection$photo, _apiConnection$mutual;
92
+ console.log('🔄 Transforming API connection:', {
93
+ id: apiConnection.id,
94
+ name: apiConnection.name,
95
+ description: apiConnection.description,
96
+ hasPhoto: !!apiConnection.photo,
97
+ photoLength: (_apiConnection$photo = apiConnection.photo) === null || _apiConnection$photo === void 0 ? void 0 : _apiConnection$photo.length,
98
+ interests: apiConnection.interests,
99
+ sharedPassions: apiConnection.sharedPassions,
100
+ complementaryQualities: apiConnection.complementaryQualities,
101
+ compatibility: apiConnection.compatibility
102
+ });
103
+ return {
104
+ id: parseInt(apiConnection.id) || parseInt(apiConnection._id || '') || Math.random() * 1000,
105
+ // Try id first, then _id, then random
106
+ name: apiConnection.name || 'Unknown User',
107
+ description: apiConnection.description || 'Looking to connect',
108
+ photo: apiConnection.photo || '',
109
+ // This will be a URL string from API, or empty string
110
+ bio: apiConnection.bio || '',
111
+ interests: apiConnection.interests || [],
112
+ mutualConnections: apiConnection.mutualConnections || 0,
113
+ compatibility: apiConnection.compatibility || 0,
114
+ conversationStarters: apiConnection.conversationStarters || ['Hi! Nice to meet you.'],
115
+ // UI REQUIRED FIELDS - These are actually rendered in ProfileDetailScreen
116
+ sharedPassions: apiConnection.sharedPassions || [],
117
+ // Don't fallback to interests since we now have separate Interests section
118
+ complementaryQualities: apiConnection.complementaryQualities || [],
119
+ meaningfulCoincidences: apiConnection.meaningfulCoincidences || [],
120
+ mutualConnectionsList: ((_apiConnection$mutual = apiConnection.mutualConnectionsList) === null || _apiConnection$mutual === void 0 ? void 0 : _apiConnection$mutual.map(mutual => ({
121
+ name: mutual.name,
122
+ photo: mutual.photo,
123
+ // URL string from API
124
+ context: mutual.context
125
+ }))) || []
126
+ };
127
+ };
128
+
129
+ /**
130
+ * Get user connections by username
131
+ * @param username - Username to fetch connections for
132
+ * @returns Promise<Connection[]>
133
+ */
134
+ export const getUserConnectionsByUsername = async username => {
135
+ try {
136
+ var _response$connections, _response$connections2;
137
+ console.log('🔍 Fetching connections for username:', username);
138
+ const token = await getAuthToken();
139
+
140
+ // Enhanced token validation and warning
141
+ if (!token) {
142
+ console.warn('âš ī¸ [CONNECTIONS API] No authentication token available for connections request');
143
+ console.warn('âš ī¸ [CONNECTIONS API] This may result in limited or cached data from backend');
144
+ return []; // Return empty array instead of making unauthenticated request
145
+ }
146
+ console.log('✅ [CONNECTIONS API] Using authenticated request with token:', `${token.substring(0, 20)}...`);
147
+
148
+ // Use the same pattern as other working APIs - import and call with token
149
+ // const { getUserConnectionsByUsername: apiCall } = await import('../../services/api'); // Commented out - path issue
150
+ const response = {
151
+ success: false,
152
+ message: 'API function not available',
153
+ connections: [],
154
+ source: 'mock'
155
+ };
156
+ console.log('✅ API connections fetched by username:', {
157
+ success: response.success,
158
+ connectionsCount: ((_response$connections = response.connections) === null || _response$connections === void 0 ? void 0 : _response$connections.length) || 0,
159
+ source: response.source,
160
+ firstConnection: (_response$connections2 = response.connections) !== null && _response$connections2 !== void 0 && _response$connections2[0] ? {
161
+ id: response.connections[0].id,
162
+ name: response.connections[0].name,
163
+ description: response.connections[0].description
164
+ } : null
165
+ });
166
+ if (response.success && response.connections && response.connections.length > 0) {
167
+ const transformedConnections = response.connections.map(transformAPIConnection);
168
+ console.log('🔄 Transformed connections by username:', transformedConnections.length);
169
+ return transformedConnections;
170
+ }
171
+ return [];
172
+ } catch (error) {
173
+ console.log('❌ Error fetching connections by username:', error);
174
+ console.log('❌ [NETWORK ERROR] Full error details:', JSON.stringify(error, Object.getOwnPropertyNames(error)));
175
+ return [];
176
+ }
177
+ };
178
+
179
+ /**
180
+ * Get user connections by user ID
181
+ * @param userId - User ID to fetch connections for
182
+ * @returns Promise<Connection[]>
183
+ */
184
+ export const getUserConnectionsByUserId = async userId => {
185
+ try {
186
+ var _response$connections3, _response$connections4;
187
+ console.log('🔍 Fetching connections for userId:', userId);
188
+ const token = await getAuthToken();
189
+ if (!token) {
190
+ console.warn('âš ī¸ [CONNECTIONS API] No authentication token available for user ID connections request');
191
+ return []; // Return empty array instead of making unauthenticated request
192
+ }
193
+ console.log('✅ [CONNECTIONS API] Using authenticated request with token:', `${token.substring(0, 20)}...`);
194
+
195
+ // Use the same pattern as other working APIs - import and call with token
196
+ // const { getUserConnections: apiCall } = await import('../../services/api'); // Commented out - path issue
197
+ const response = {
198
+ success: false,
199
+ message: 'API function not available',
200
+ connections: [],
201
+ source: 'mock'
202
+ };
203
+ console.log('✅ API connections fetched by userId:', {
204
+ success: response.success,
205
+ connectionsCount: ((_response$connections3 = response.connections) === null || _response$connections3 === void 0 ? void 0 : _response$connections3.length) || 0,
206
+ source: response.source,
207
+ firstConnection: (_response$connections4 = response.connections) !== null && _response$connections4 !== void 0 && _response$connections4[0] ? {
208
+ id: response.connections[0].id,
209
+ name: response.connections[0].name,
210
+ description: response.connections[0].description
211
+ } : null
212
+ });
213
+ if (response.success && response.connections && response.connections.length > 0) {
214
+ const transformedConnections = response.connections.map(transformAPIConnection);
215
+ console.log('🔄 Transformed connections by userId:', transformedConnections.length);
216
+ return transformedConnections;
217
+ }
218
+ return [];
219
+ } catch (error) {
220
+ console.log('❌ Error fetching connections by userId:', error);
221
+ console.log('❌ [NETWORK ERROR FALLBACK] Full error details:', JSON.stringify(error, Object.getOwnPropertyNames(error)));
222
+ return [];
223
+ }
224
+ };
225
+
226
+ /**
227
+ * Get user connections with automatic detection of user info
228
+ * PRIORITIZES the working email/username endpoint over the failing user ID endpoint
229
+ * @returns Promise<Connection[]>
230
+ */
231
+ export const getUserConnections = async () => {
232
+ try {
233
+ // ENHANCED DEBUG: Check authentication status first
234
+ await ensureAuthentication('USER_CONNECTIONS');
235
+
236
+ // ENHANCED DEBUG: Check what user data we actually have available
237
+ console.log('🔍 [USER DEBUG] Checking all available user data sources...');
238
+
239
+ // Check AsyncStorage for user data
240
+ const storedUsername = await AsyncStorage.getItem('onairos_username');
241
+ const storedEmail = await AsyncStorage.getItem('user_email');
242
+ const storedUserId = await AsyncStorage.getItem('user_id');
243
+ const authToken = await AsyncStorage.getItem('auth_token');
244
+ console.log('🔍 [USER DEBUG] AsyncStorage data:', {
245
+ storedUsername,
246
+ storedEmail,
247
+ storedUserId,
248
+ hasAuthToken: !!authToken,
249
+ authTokenPreview: authToken ? `${authToken.substring(0, 20)}...` : 'none'
250
+ });
251
+
252
+ // First try to get user profile to determine username/userId
253
+ const userProfile = await getUserProfile();
254
+ console.log('đŸŽ¯ getUserConnections - User profile:', {
255
+ hasId: !!(userProfile !== null && userProfile !== void 0 && userProfile.id),
256
+ hasEmail: !!(userProfile !== null && userProfile !== void 0 && userProfile.email),
257
+ email: userProfile === null || userProfile === void 0 ? void 0 : userProfile.email,
258
+ id: userProfile === null || userProfile === void 0 ? void 0 : userProfile.id
259
+ });
260
+
261
+ // FALLBACK: If getUserProfile fails, try to use stored data directly
262
+ let userEmail = userProfile === null || userProfile === void 0 ? void 0 : userProfile.email;
263
+ let userId = userProfile === null || userProfile === void 0 ? void 0 : userProfile.id;
264
+ if (!userEmail && storedUsername) {
265
+ console.log('🔄 [USER DEBUG] Using stored username as email fallback:', storedUsername);
266
+ userEmail = storedUsername;
267
+ }
268
+ if (!userEmail && storedEmail) {
269
+ console.log('🔄 [USER DEBUG] Using stored email as fallback:', storedEmail);
270
+ userEmail = storedEmail;
271
+ }
272
+ if (!userId && storedUserId) {
273
+ console.log('🔄 [USER DEBUG] Using stored user ID as fallback:', storedUserId);
274
+ userId = storedUserId;
275
+ }
276
+ console.log('đŸŽ¯ [USER DEBUG] Final user identifiers to use:', {
277
+ userEmail,
278
+ userId,
279
+ willTryEmail: !!userEmail,
280
+ willTryUserId: !!userId
281
+ });
282
+
283
+ // PRIORITY 1: Try by email/username first (this endpoint is working!)
284
+ if (userEmail) {
285
+ console.log('đŸŽ¯ PRIORITY: Attempting to fetch connections by email (working endpoint):', userEmail);
286
+ const connections = await getUserConnectionsByUsername(userEmail);
287
+ if (connections.length > 0) {
288
+ console.log('✅ Successfully got connections by email:', connections.length);
289
+ return connections;
290
+ }
291
+ console.log('âš ī¸ No connections found by email, trying user ID...');
292
+ }
293
+
294
+ // PRIORITY 2: Try by user ID only if email fails (this endpoint has ObjectId issues)
295
+ if (userId) {
296
+ console.log('đŸŽ¯ FALLBACK: Attempting to fetch connections by user ID:', userId);
297
+ const connections = await getUserConnectionsByUserId(userId);
298
+ if (connections.length > 0) {
299
+ console.log('✅ Successfully got connections by user ID:', connections.length);
300
+ return connections;
301
+ }
302
+ console.log('âš ī¸ No connections found by user ID');
303
+ }
304
+ console.log('âš ī¸ No user identifier available or no connections found');
305
+ return [];
306
+ } catch (error) {
307
+ console.log('❌ Error in getUserConnections:', error);
308
+ return [];
309
+ }
310
+ };
311
+
312
+ /**
313
+ * @deprecated This function uses Enoch-specific endpoints and has been removed from the SDK.
314
+ * Consuming apps (like OnairosEvents) should call the profile picture API directly:
315
+ * POST /enoch/users/{userIdentifier}/profile-picture/base64
316
+ *
317
+ * @param _imageUri - Image URI (file:// or base64)
318
+ * @param _fileType - File type (jpg, png)
319
+ * @returns Promise with error indicating deprecation
320
+ */
321
+ export const uploadProfilePicture = async (_imageUri, _fileType) => {
322
+ console.warn('âš ī¸ [DEPRECATED] uploadProfilePicture has been removed from SDK');
323
+ console.warn('â„šī¸ Consuming apps should call /enoch/users/{id}/profile-picture/base64 directly');
324
+ return {
325
+ success: false,
326
+ error: 'uploadProfilePicture has been removed from SDK. Consuming apps should call the Enoch API directly.'
327
+ };
328
+ };
329
+ //# sourceMappingURL=userConnectionsService.js.map