@onairos/react-native 3.7.2 → 3.7.3

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 +116 -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 +109 -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,169 @@
1
- import*as Keychain from'react-native-keychain';import{Platform}from'react-native';const PIN_SERVICE_KEY=_0x19c5(0x0),PIN_USERNAME='user_pin';export const isBiometricAvailable=async()=>{const _0x2fd8df={'cfnbg':_0x19c5(0x1),'hOJTC':function(_0x313472,_0x773edf){return _0x313472===_0x773edf;},'zuyDV':function(_0x305783,_0x38c9bf){return _0x305783===_0x38c9bf;},'KoDZr':function(_0x5423b0,_0x3368da){return _0x5423b0===_0x3368da;},'LVFPF':'❌\x20Error\x20checking\x20biometric\x20availability:'};try{const _0x328a1d=await Keychain[_0x19c5(0x2)]();return console['log'](_0x2fd8df[_0x19c5(0x3)],_0x328a1d),_0x2fd8df[_0x19c5(0x4)](_0x328a1d,Keychain['BIOMETRY_TYPE'][_0x19c5(0x5)])||_0x328a1d===Keychain[_0x19c5(0x6)][_0x19c5(0x7)]||_0x2fd8df[_0x19c5(0x8)](_0x328a1d,Keychain[_0x19c5(0x6)][_0x19c5(0x9)])||_0x2fd8df[_0x19c5(0xa)](_0x328a1d,Keychain[_0x19c5(0x6)][_0x19c5(0xb)])||_0x2fd8df[_0x19c5(0x4)](_0x328a1d,Keychain['BIOMETRY_TYPE'][_0x19c5(0xc)]);}catch(_0x34dcb7){return console[_0x19c5(0xd)](_0x2fd8df[_0x19c5(0xe)],_0x34dcb7),![];}};function _0x19c5(_0x323fdc,_0x19c55d){_0x323fdc=_0x323fdc-0x0;const _0x7de8b7=_0x323f();let _0x519e28=_0x7de8b7[_0x323fdc];return _0x519e28;}function _0x323f(){const _0x10b26f=['OnairosEventsPIN','📱\x20Biometric\x20support:','getSupportedBiometryType','cfnbg','hOJTC','FACE_ID','BIOMETRY_TYPE','TOUCH_ID','zuyDV','FINGERPRINT','KoDZr','FACE','IRIS','error','LVFPF','❌\x20Error\x20checking\x20biometric\x20availability:','❌\x20Face\x20ID/Touch\x20ID\x20not\x20available\x20on\x20this\x20device','Authenticate\x20with\x20biometric\x20to\x20secure\x20your\x20PIN','👤\x20Requesting\x20Face\x20ID\x20authentication...','🔍\x20Keychain\x20storage\x20result:','ElYoX','❌\x20Error\x20details:','KWzqV','BiometryNotAvailable','📱\x20Face\x20ID/Touch\x20ID\x20not\x20available','NxEQm','BiometryLockout','🔒\x20Face\x20ID\x20locked\x20out\x20-\x20too\x20many\x20failed\x20attempts','log','🔐\x20Starting\x20Face\x20ID\x20authentication\x20for\x20PIN\x20storage...','uRokU','MKUOx','📱\x20Face\x20ID\x20available,\x20showing\x20authentication\x20prompt...','BIOMETRY_CURRENT_SET','BIOMETRICS','yytFS','hLJiJ','FzljD','rnlxt','android','obLMm','OhVrZ','setGenericPassword','✅\x20Face\x20ID\x20authentication\x20successful\x20-\x20PIN\x20stored\x20securely','bHuKY','avCXb','PYXSB','TIntz','code','domain','BSjct','message','NglDx','hpFju','AqEmx','rUZGr','QMXZp','jUdJK','includes','IXBVt','oLYdy','yuKxX','OUXfU','uCxAl','fJwCO','TuEjC','✅\x20PIN\x20retrieved\x20successfully','password','PXdST','VNvzM','qORtA','UipCM','❌\x20Error\x20removing\x20PIN\x20from\x20storage:','👤\x20User\x20cancelled\x20Face\x20ID\x20authentication','UpKUM','uUJlx','UserCancel','SZwsa','emmVO','📱\x20Biometric\x20not\x20available','getGenericPassword','AyMPS','oKvsc','VQPEs','âš ī¸\x20No\x20PIN\x20found\x20in\x20secure\x20storage','YmyZL','swmzD','ScEIe','itzKn','👤\x20User\x20cancelled\x20biometric\x20authentication','QjtNe','jEvCC','uPUwK','BvxRy','SBRnb','tvMeJ','❌\x20Error\x20checking\x20PIN\x20storage:','ZDLyD','eRbRA','mMRfX','đŸ—‘ī¸\x20Removing\x20PIN\x20from\x20secure\x20storage...','QPVqx','NXRGm','NUdef','resetGenericPassword','✅\x20PIN\x20removed\x20successfully'];_0x323f=function(){return _0x10b26f;};return _0x323f();}export const storePinWithBiometric=async _0xd151c4=>{const _0x3cfcb2={'PYXSB':_0x19c5(0xf),'MKUOx':_0x19c5(0x10),'uRokU':function(_0x563f9a){return _0x563f9a();},'yytFS':function(_0x453a97,_0x48370b){return _0x453a97===_0x48370b;},'hLJiJ':'Authenticate\x20with\x20Face\x20ID\x20to\x20secure\x20your\x20PIN','FzljD':'Cancel','rnlxt':function(_0x132e18,_0x25e57b){return _0x132e18===_0x25e57b;},'obLMm':_0x19c5(0x11),'OhVrZ':_0x19c5(0x12),'bHuKY':_0x19c5(0x13),'avCXb':_0x19c5(0x14),'TIntz':'❌\x20Face\x20ID\x20authentication\x20failed:','izZFF':_0x19c5(0x15),'qtRCZ':function(_0x3ee3e4,_0x42ae75){return _0x3ee3e4!==_0x42ae75;},'BSjct':function(_0x559841,_0x16c438){return _0x559841!==_0x16c438;},'Oluqz':function(_0x42b63c,_0x4139a7){return _0x42b63c!==_0x4139a7;},'NglDx':'UserCancel','KKqbL':function(_0x2f4ab2,_0x4621f7){return _0x2f4ab2===_0x4621f7;},'hpFju':function(_0x5b0663,_0xf5c476){return _0x5b0663===_0xf5c476;},'AqEmx':_0x19c5(0x16),'rUZGr':'👤\x20User\x20cancelled\x20Face\x20ID\x20authentication','QMXZp':function(_0x3b8b21,_0x3fd19b){return _0x3b8b21!==_0x3fd19b;},'jUdJK':function(_0x1e11a8,_0x47887f){return _0x1e11a8!==_0x47887f;},'IXBVt':_0x19c5(0x17),'oLYdy':function(_0x16cdfc,_0x4a37be){return _0x16cdfc===_0x4a37be;},'yuKxX':_0x19c5(0x18),'OUXfU':function(_0x40e26d,_0x2c82f6){return _0x40e26d!==_0x2c82f6;},'uCxAl':'AuthenticationFailed','fJwCO':function(_0x4ab767,_0x51b2f4){return _0x4ab767===_0x51b2f4;},'TuEjC':_0x19c5(0x19),'HBkzf':'đŸšĢ\x20Face\x20ID\x20authentication\x20failed','PXdST':function(_0x5a3846,_0xc10880){return _0x5a3846!==_0xc10880;},'TxPYq':_0x19c5(0x1a),'iYncg':function(_0x3ec4c9,_0x8315a4){return _0x3ec4c9===_0x8315a4;},'VNvzM':function(_0x339152,_0x358c07){return _0x339152===_0x358c07;},'qORtA':_0x19c5(0x1b),'UipCM':'❌\x20Unknown\x20Face\x20ID\x20error:'};try{console[_0x19c5(0x1c)](_0x19c5(0x1d));const _0x38b78e=await _0x3cfcb2[_0x19c5(0x1e)](isBiometricAvailable);if(!_0x38b78e)return console[_0x19c5(0xd)](_0x3cfcb2[_0x19c5(0x1f)]),![];console[_0x19c5(0x1c)](_0x19c5(0x20));const _0x36349e={'accessControl':Keychain['ACCESS_CONTROL'][_0x19c5(0x21)],'authenticationType':Keychain['AUTHENTICATION_TYPE'][_0x19c5(0x22)],'touchID':!![],'showModal':!![],'kLocalizedFallbackTitle':'',..._0x3cfcb2[_0x19c5(0x23)](Platform['OS'],'ios')&&{'localizedPrompt':_0x3cfcb2[_0x19c5(0x24)],'localizedCancel':_0x3cfcb2[_0x19c5(0x25)]},..._0x3cfcb2[_0x19c5(0x26)](Platform['OS'],_0x19c5(0x27))&&{'promptMessage':_0x3cfcb2[_0x19c5(0x28)],'cancelButtonText':_0x3cfcb2[_0x19c5(0x25)]}};console[_0x19c5(0x1c)](_0x3cfcb2[_0x19c5(0x29)]);const _0x26aefb=await Keychain[_0x19c5(0x2a)](PIN_USERNAME,_0xd151c4,{'service':PIN_SERVICE_KEY,..._0x36349e});return console['log'](_0x19c5(0x2b)),console[_0x19c5(0x1c)](_0x3cfcb2[_0x19c5(0x2c)],_0x26aefb),!![];}catch(_0x5d5bcc){if(_0x3cfcb2[_0x19c5(0x2d)]!==_0x3cfcb2[_0x19c5(0x2d)])return _0x143b9e[_0x19c5(0xd)](_0x3cfcb2[_0x19c5(0x2e)],_0x1fc87e),![];else{var _0x58c4f5,_0x4438c2,_0x489e9f,_0x2967a5;console[_0x19c5(0xd)](_0x3cfcb2[_0x19c5(0x2f)],_0x5d5bcc),console[_0x19c5(0xd)](_0x3cfcb2['izZFF'],{'message':_0x5d5bcc['message'],'code':_0x5d5bcc[_0x19c5(0x30)],'domain':_0x5d5bcc[_0x19c5(0x31)],'userInfo':_0x5d5bcc['userInfo']});if(_0x3cfcb2['qtRCZ'](_0x5d5bcc,null)&&_0x3cfcb2[_0x19c5(0x32)](_0x5d5bcc,void 0x0)&&(_0x58c4f5=_0x5d5bcc[_0x19c5(0x33)])!==null&&_0x3cfcb2['Oluqz'](_0x58c4f5,void 0x0)&&_0x58c4f5['includes'](_0x3cfcb2[_0x19c5(0x34)])||_0x3cfcb2['KKqbL'](_0x3cfcb2[_0x19c5(0x35)](_0x5d5bcc,null)||_0x3cfcb2[_0x19c5(0x35)](_0x5d5bcc,void 0x0)?void 0x0:_0x5d5bcc[_0x19c5(0x30)],-0x80))return _0x3cfcb2[_0x19c5(0x23)]('KWzqV',_0x3cfcb2[_0x19c5(0x36)])?(console['log'](_0x3cfcb2[_0x19c5(0x37)]),![]):(_0x367880[_0x19c5(0xd)](_0x3cfcb2['MKUOx']),![]);else{if(_0x3cfcb2[_0x19c5(0x38)](_0x5d5bcc,null)&&_0x5d5bcc!==void 0x0&&_0x3cfcb2[_0x19c5(0x39)](_0x4438c2=_0x5d5bcc[_0x19c5(0x33)],null)&&_0x3cfcb2['jUdJK'](_0x4438c2,void 0x0)&&_0x4438c2[_0x19c5(0x3a)](_0x3cfcb2[_0x19c5(0x3b)])||(_0x3cfcb2[_0x19c5(0x23)](_0x5d5bcc,null)||_0x3cfcb2[_0x19c5(0x3c)](_0x5d5bcc,void 0x0)?void 0x0:_0x5d5bcc['code'])===-0x6)return console['log'](_0x3cfcb2[_0x19c5(0x3d)]),![];else{if(_0x5d5bcc!==null&&_0x3cfcb2[_0x19c5(0x32)](_0x5d5bcc,void 0x0)&&_0x3cfcb2[_0x19c5(0x3e)](_0x489e9f=_0x5d5bcc[_0x19c5(0x33)],null)&&_0x489e9f!==void 0x0&&_0x489e9f['includes'](_0x3cfcb2[_0x19c5(0x3f)])||(_0x3cfcb2[_0x19c5(0x40)](_0x5d5bcc,null)||_0x5d5bcc===void 0x0?void 0x0:_0x5d5bcc[_0x19c5(0x30)])===-0x1)return _0x3cfcb2[_0x19c5(0x23)](_0x3cfcb2[_0x19c5(0x41)],_0x19c5(0x19))?(console[_0x19c5(0x1c)](_0x3cfcb2['HBkzf']),![]):(_0x45cd88[_0x19c5(0x1c)](_0x19c5(0x42)),_0xa79690[_0x19c5(0x43)]);else{if(_0x3cfcb2[_0x19c5(0x32)](_0x5d5bcc,null)&&_0x3cfcb2[_0x19c5(0x44)](_0x5d5bcc,void 0x0)&&(_0x2967a5=_0x5d5bcc[_0x19c5(0x33)])!==null&&_0x2967a5!==void 0x0&&_0x2967a5['includes'](_0x3cfcb2['TxPYq'])||_0x3cfcb2['iYncg'](_0x3cfcb2[_0x19c5(0x45)](_0x5d5bcc,null)||_0x3cfcb2['yytFS'](_0x5d5bcc,void 0x0)?void 0x0:_0x5d5bcc['code'],-0x8))return console[_0x19c5(0x1c)](_0x3cfcb2[_0x19c5(0x46)]),![];}}}return console[_0x19c5(0xd)](_0x3cfcb2[_0x19c5(0x47)],_0x5d5bcc[_0x19c5(0x33)]),![];}}};export const retrievePinWithBiometric=async()=>{const _0x5da2f0={'oKvsc':_0x19c5(0x48),'QjtNe':_0x19c5(0x18),'SBRnb':_0x19c5(0x49),'ScEIe':function(_0x851299,_0x2c3a13){return _0x851299===_0x2c3a13;},'AyMPS':_0x19c5(0x4a),'yIwTJ':_0x19c5(0x4b),'VQPEs':_0x19c5(0x42),'ywNNZ':'❌\x20Error\x20retrieving\x20PIN\x20with\x20biometric:','YmyZL':function(_0x49cb25,_0x44f96f){return _0x49cb25!==_0x44f96f;},'swmzD':_0x19c5(0x4c),'itzKn':_0x19c5(0x4d),'jEvCC':function(_0x305e43,_0x1552ab){return _0x305e43!==_0x1552ab;},'uPUwK':'BiometryNotAvailable','BvxRy':_0x19c5(0x4e),'tvMeJ':_0x19c5(0x4f)};try{console[_0x19c5(0x1c)]('🔓\x20Retrieving\x20PIN\x20with\x20biometric\x20authentication...');const _0x49fb47=await Keychain[_0x19c5(0x50)]({'service':PIN_SERVICE_KEY});return _0x49fb47&&_0x49fb47['password']?_0x5da2f0['ScEIe'](_0x5da2f0[_0x19c5(0x51)],_0x5da2f0['yIwTJ'])?(_0x59b4be[_0x19c5(0xd)](_0x5da2f0[_0x19c5(0x52)],_0x1ba8b0),![]):(console[_0x19c5(0x1c)](_0x5da2f0[_0x19c5(0x53)]),_0x49fb47['password']):(console[_0x19c5(0x1c)](_0x19c5(0x54)),null);}catch(_0x2b4630){var _0x40142d,_0x562d84;console[_0x19c5(0xd)](_0x5da2f0['ywNNZ'],_0x2b4630);if(_0x2b4630!==null&&_0x5da2f0[_0x19c5(0x55)](_0x2b4630,void 0x0)&&(_0x40142d=_0x2b4630[_0x19c5(0x33)])!==null&&_0x5da2f0[_0x19c5(0x55)](_0x40142d,void 0x0)&&_0x40142d[_0x19c5(0x3a)](_0x5da2f0[_0x19c5(0x56)]))return _0x5da2f0[_0x19c5(0x57)](_0x5da2f0[_0x19c5(0x58)],_0x5da2f0[_0x19c5(0x58)])?(console[_0x19c5(0x1c)](_0x19c5(0x59)),null):(_0x22eacd[_0x19c5(0x1c)](_0x5da2f0[_0x19c5(0x5a)]),![]);else{if(_0x5da2f0['YmyZL'](_0x2b4630,null)&&_0x5da2f0[_0x19c5(0x5b)](_0x2b4630,void 0x0)&&(_0x562d84=_0x2b4630[_0x19c5(0x33)])!==null&&_0x5da2f0[_0x19c5(0x55)](_0x562d84,void 0x0)&&_0x562d84[_0x19c5(0x3a)](_0x5da2f0[_0x19c5(0x5c)]))return _0x19c5(0x4e)!==_0x5da2f0[_0x19c5(0x5d)]?(_0x577a4a[_0x19c5(0x1c)](_0x5da2f0[_0x19c5(0x5e)]),![]):(console[_0x19c5(0x1c)](_0x5da2f0[_0x19c5(0x5f)]),null);}return null;}};export const isPinStored=async()=>{const _0x1c2375={'MewIe':_0x19c5(0x4f),'ZDLyD':function(_0x35a454,_0x3a1a28){return _0x35a454!==_0x3a1a28;},'eRbRA':'zOmZx','mMRfX':_0x19c5(0x60)};try{const _0x5e5ea1=await Keychain['getGenericPassword']({'service':PIN_SERVICE_KEY});return!!(_0x5e5ea1&&_0x5e5ea1[_0x19c5(0x43)]);}catch(_0x2139bc){return _0x1c2375[_0x19c5(0x61)](_0x1c2375[_0x19c5(0x62)],_0x1c2375[_0x19c5(0x62)])?(_0x20b515['log'](_0x1c2375['MewIe']),null):(console['error'](_0x1c2375[_0x19c5(0x63)],_0x2139bc),![]);}};export const removePinFromStorage=async()=>{const _0x1dab8c={'QPVqx':function(_0x3cae95,_0xf027a5){return _0x3cae95!==_0xf027a5;},'NXRGm':'OXuMP','NUdef':_0x19c5(0x64),'xeTUR':_0x19c5(0x48)};try{return _0x1dab8c[_0x19c5(0x65)](_0x1dab8c[_0x19c5(0x66)],_0x1dab8c[_0x19c5(0x66)])?(_0x44caee[_0x19c5(0x1c)](_0x19c5(0x1b)),![]):(console[_0x19c5(0x1c)](_0x1dab8c[_0x19c5(0x67)]),await Keychain[_0x19c5(0x68)]({'service':PIN_SERVICE_KEY}),console['log'](_0x19c5(0x69)),!![]);}catch(_0x574c66){return console[_0x19c5(0xd)](_0x1dab8c['xeTUR'],_0x574c66),![];}};export const biometricPinService={'storePinWithBiometric':storePinWithBiometric,'retrievePinWithBiometric':retrievePinWithBiometric,'isPinStored':isPinStored,'removePinFromStorage':removePinFromStorage,'isBiometricAvailable':isBiometricAvailable};
1
+ import * as Keychain from 'react-native-keychain';
2
+ import { Platform } from 'react-native';
3
+
4
+ // Service key for PIN storage
5
+ const PIN_SERVICE_KEY = 'OnairosEventsPIN';
6
+ const PIN_USERNAME = 'user_pin';
7
+ /**
8
+ * Check if biometric authentication is available on the device
9
+ */
10
+ export const isBiometricAvailable = async () => {
11
+ try {
12
+ const biometryType = await Keychain.getSupportedBiometryType();
13
+ console.log('📱 Biometric support:', biometryType);
14
+
15
+ // Check for Face ID on iOS or any biometric on Android
16
+ return biometryType === Keychain.BIOMETRY_TYPE.FACE_ID || biometryType === Keychain.BIOMETRY_TYPE.TOUCH_ID || biometryType === Keychain.BIOMETRY_TYPE.FINGERPRINT || biometryType === Keychain.BIOMETRY_TYPE.FACE || biometryType === Keychain.BIOMETRY_TYPE.IRIS;
17
+ } catch (error) {
18
+ console.error('❌ Error checking biometric availability:', error);
19
+ return false;
20
+ }
21
+ };
22
+
23
+ /**
24
+ * Store PIN with biometric authentication
25
+ */
26
+ export const storePinWithBiometric = async pin => {
27
+ try {
28
+ console.log('🔐 Starting Face ID authentication for PIN storage...');
29
+
30
+ // Check if biometric is available - REQUIRED for this implementation
31
+ const biometricAvailable = await isBiometricAvailable();
32
+ if (!biometricAvailable) {
33
+ console.error('❌ Face ID/Touch ID not available on this device');
34
+ return false;
35
+ }
36
+ console.log('📱 Face ID available, showing authentication prompt...');
37
+
38
+ // Configure keychain options for MANDATORY biometric authentication
39
+ const keychainOptions = {
40
+ accessControl: Keychain.ACCESS_CONTROL.BIOMETRY_CURRENT_SET,
41
+ authenticationType: Keychain.AUTHENTICATION_TYPE.BIOMETRICS,
42
+ touchID: true,
43
+ showModal: true,
44
+ kLocalizedFallbackTitle: '',
45
+ // Disable fallback to prevent passcode option
46
+ // Add explicit prompts for better UX
47
+ ...(Platform.OS === 'ios' && {
48
+ localizedPrompt: 'Authenticate with Face ID to secure your PIN',
49
+ localizedCancel: 'Cancel'
50
+ }),
51
+ ...(Platform.OS === 'android' && {
52
+ promptMessage: 'Authenticate with biometric to secure your PIN',
53
+ cancelButtonText: 'Cancel'
54
+ })
55
+ };
56
+
57
+ // Store the PIN - this will trigger the Face ID prompt
58
+ console.log('👤 Requesting Face ID authentication...');
59
+ const result = await Keychain.setGenericPassword(PIN_USERNAME, pin, {
60
+ service: PIN_SERVICE_KEY,
61
+ ...keychainOptions
62
+ });
63
+ console.log('✅ Face ID authentication successful - PIN stored securely');
64
+ console.log('🔍 Keychain storage result:', result);
65
+ return true;
66
+ } catch (error) {
67
+ var _error$message, _error$message2, _error$message3, _error$message4;
68
+ console.error('❌ Face ID authentication failed:', error);
69
+ console.error('❌ Error details:', {
70
+ message: error.message,
71
+ code: error.code,
72
+ domain: error.domain,
73
+ userInfo: error.userInfo
74
+ });
75
+
76
+ // Handle specific error cases
77
+ if (error !== null && error !== void 0 && (_error$message = error.message) !== null && _error$message !== void 0 && _error$message.includes('UserCancel') || (error === null || error === void 0 ? void 0 : error.code) === -128) {
78
+ console.log('👤 User cancelled Face ID authentication');
79
+ return false;
80
+ } else if (error !== null && error !== void 0 && (_error$message2 = error.message) !== null && _error$message2 !== void 0 && _error$message2.includes('BiometryNotAvailable') || (error === null || error === void 0 ? void 0 : error.code) === -6) {
81
+ console.log('📱 Face ID/Touch ID not available');
82
+ return false;
83
+ } else if (error !== null && error !== void 0 && (_error$message3 = error.message) !== null && _error$message3 !== void 0 && _error$message3.includes('AuthenticationFailed') || (error === null || error === void 0 ? void 0 : error.code) === -1) {
84
+ console.log('đŸšĢ Face ID authentication failed');
85
+ return false;
86
+ } else if (error !== null && error !== void 0 && (_error$message4 = error.message) !== null && _error$message4 !== void 0 && _error$message4.includes('BiometryLockout') || (error === null || error === void 0 ? void 0 : error.code) === -8) {
87
+ console.log('🔒 Face ID locked out - too many failed attempts');
88
+ return false;
89
+ }
90
+ console.error('❌ Unknown Face ID error:', error.message);
91
+ return false;
92
+ }
93
+ };
94
+
95
+ /**
96
+ * Retrieve PIN with biometric authentication
97
+ */
98
+ export const retrievePinWithBiometric = async () => {
99
+ try {
100
+ console.log('🔓 Retrieving PIN with biometric authentication...');
101
+
102
+ // Retrieve the PIN (will prompt for biometric if configured)
103
+ const credentials = await Keychain.getGenericPassword({
104
+ service: PIN_SERVICE_KEY
105
+ });
106
+ if (credentials && credentials.password) {
107
+ console.log('✅ PIN retrieved successfully');
108
+ return credentials.password;
109
+ } else {
110
+ console.log('âš ī¸ No PIN found in secure storage');
111
+ return null;
112
+ }
113
+ } catch (error) {
114
+ var _error$message5, _error$message6;
115
+ console.error('❌ Error retrieving PIN with biometric:', error);
116
+
117
+ // Handle specific error cases
118
+ if (error !== null && error !== void 0 && (_error$message5 = error.message) !== null && _error$message5 !== void 0 && _error$message5.includes('UserCancel')) {
119
+ console.log('👤 User cancelled biometric authentication');
120
+ return null;
121
+ } else if (error !== null && error !== void 0 && (_error$message6 = error.message) !== null && _error$message6 !== void 0 && _error$message6.includes('BiometryNotAvailable')) {
122
+ console.log('📱 Biometric not available');
123
+ return null;
124
+ }
125
+ return null;
126
+ }
127
+ };
128
+
129
+ /**
130
+ * Check if PIN is stored in secure storage
131
+ */
132
+ export const isPinStored = async () => {
133
+ try {
134
+ const credentials = await Keychain.getGenericPassword({
135
+ service: PIN_SERVICE_KEY
136
+ });
137
+ return !!(credentials && credentials.password);
138
+ } catch (error) {
139
+ console.error('❌ Error checking PIN storage:', error);
140
+ return false;
141
+ }
142
+ };
143
+
144
+ /**
145
+ * Remove PIN from secure storage
146
+ */
147
+ export const removePinFromStorage = async () => {
148
+ try {
149
+ console.log('đŸ—‘ī¸ Removing PIN from secure storage...');
150
+ await Keychain.resetGenericPassword({
151
+ service: PIN_SERVICE_KEY
152
+ });
153
+ console.log('✅ PIN removed successfully');
154
+ return true;
155
+ } catch (error) {
156
+ console.error('❌ Error removing PIN from storage:', error);
157
+ return false;
158
+ }
159
+ };
160
+
161
+ // Export the service object
162
+ export const biometricPinService = {
163
+ storePinWithBiometric,
164
+ retrievePinWithBiometric,
165
+ isPinStored,
166
+ removePinFromStorage,
167
+ isBiometricAvailable
168
+ };
169
+ //# sourceMappingURL=biometricPinService.js.map
@@ -1 +1,149 @@
1
- import{storeChatGPTConversations,storeChatGPTMemories}from'./chatGPTConversationService';import{Alert}from'react-native';function _0x7c52(_0x2d4c6e,_0x7c5205){_0x2d4c6e=_0x2d4c6e-0x0;const _0x3517b5=_0x2d4c();let _0x2ec15b=_0x3517b5[_0x2d4c6e];return _0x2ec15b;}export const useChatGPTConversationExtractor=()=>{const _0x117a19={'QeDfz':function(_0x4bf5bb,_0x3e5b6b){return _0x4bf5bb>_0x3e5b6b;},'hsjrJ':'âš ī¸\x20[CHATGPT_EXTRACTOR]\x20Invalid\x20conversation:','xhiDB':function(_0x412734,_0x12feeb){return _0x412734!==_0x12feeb;},'RlYLg':_0x7c52(0x0),'ArcxB':_0x7c52(0x1),'WcMtH':_0x7c52(0x2),'WiGEU':'❌\x20[CHATGPT_EXTRACTOR]\x20Unexpected\x20error\x20storing\x20memories:','UPRyO':_0x7c52(0x3),'vQLcn':function(_0x48ee1f,_0x3e7984){return _0x48ee1f===_0x3e7984;},'gcSMp':_0x7c52(0x4),'qNQzs':'🚀\x20[CHATGPT_EXTRACTOR]\x20Initiating\x20conversation\x20export','reGqI':_0x7c52(0x5),'jerrs':_0x7c52(0x6),'OGBHI':_0x7c52(0x7),'kjkZv':_0x7c52(0x8),'zqVJf':_0x7c52(0x9),'ECSLU':_0x7c52(0xa),'ouTVP':function(_0x2d7ba2,_0x46df69){return _0x2d7ba2===_0x46df69;},'skAiR':_0x7c52(0xb),'QirjI':function(_0xa4f21d,_0x2b6b09){return _0xa4f21d<_0x2b6b09;},'lNNMe':'cXfUu','VxyPV':function(_0x498a7d,_0x1a4650){return _0x498a7d-_0x1a4650;},'RbTjI':_0x7c52(0xc),'ewImX':function(_0x39b450,_0x5c2bb6,_0x402e57){return _0x39b450(_0x5c2bb6,_0x402e57);},'DMGCC':_0x7c52(0xd),'mgLqb':_0x7c52(0xe),'wwjJH':_0x7c52(0xf),'eLRGH':_0x7c52(0x10),'RfZVw':'Export\x20Failed','PLYQQ':'An\x20unknown\x20error\x20occurred\x20during\x20conversation\x20storage.','mBNme':'FtgcU','piERC':_0x7c52(0x11),'gqaTN':_0x7c52(0x12),'sShVH':_0x7c52(0x13),'djTRo':_0x7c52(0x14),'wPuNQ':_0x7c52(0x15),'WiTWe':_0x7c52(0x16),'oyHtt':function(_0x1b926f,_0x319699){return _0x1b926f===_0x319699;},'uuALc':'PEngm','LVMWJ':_0x7c52(0x17),'cbqUj':function(_0x2a7c69,_0x15e9cb){return _0x2a7c69(_0x15e9cb);},'MJorA':function(_0x2a86d8,_0x49c4c9){return _0x2a86d8===_0x49c4c9;},'fjHgY':_0x7c52(0x18),'cMJYl':function(_0x3bd26f,_0x572fe4){return _0x3bd26f!==_0x572fe4;},'IFmce':function(_0x24c678,_0x42d3f3){return _0x24c678!==_0x42d3f3;},'YmyaY':function(_0x1824dd,_0x57e811){return _0x1824dd!==_0x57e811;},'jstaK':_0x7c52(0x19),'bfKai':function(_0x5c7f57,_0x38e9f1){return _0x5c7f57!==_0x38e9f1;},'rICzt':_0x7c52(0x1a)},_0xec622=async(_0x1f5aa9,_0x24caea)=>{const _0x3217c7={'yBxCB':_0x117a19[_0x7c52(0x1b)],'MTjxs':_0x117a19[_0x7c52(0x1c)],'GYcQA':_0x117a19[_0x7c52(0x1d)],'LcZsk':_0x117a19['WiGEU'],'XQITe':_0x117a19[_0x7c52(0x1e)]};if(_0x117a19[_0x7c52(0x1f)](_0x117a19['gcSMp'],_0x117a19[_0x7c52(0x20)])){console[_0x7c52(0x21)](_0x117a19['qNQzs']),console[_0x7c52(0x21)](_0x117a19[_0x7c52(0x22)],_0x1f5aa9),console[_0x7c52(0x21)](_0x117a19['jerrs'],_0x24caea['length']);if(!_0x1f5aa9)return _0x117a19['OGBHI']!==_0x117a19[_0x7c52(0x23)]?(console[_0x7c52(0x24)](_0x117a19[_0x7c52(0x25)]),Alert['alert'](_0x117a19[_0x7c52(0x26)],_0x7c52(0x27),[{'text':'OK','style':_0x117a19['WcMtH']}]),![]):(_0x4926fc['error'](_0x7c52(0x28)),Alert[_0x7c52(0x29)](_0x3217c7[_0x7c52(0x2a)],_0x3217c7[_0x7c52(0x2b)],[{'text':'OK','style':_0x3217c7[_0x7c52(0x2c)]}]),![]);if(!_0x24caea||_0x117a19['ouTVP'](_0x24caea['length'],0x0))return console[_0x7c52(0x21)](_0x117a19[_0x7c52(0x2d)]),!![];const _0x688589=_0x24caea[_0x7c52(0x2e)](_0x5c5dfc=>{const _0x73212e=_0x5c5dfc[_0x7c52(0x2f)]&&_0x5c5dfc['title']&&Array[_0x7c52(0x30)](_0x5c5dfc[_0x7c52(0x31)])&&_0x117a19[_0x7c52(0x32)](_0x5c5dfc[_0x7c52(0x31)]['length'],0x0);return!_0x73212e&&console[_0x7c52(0x33)](_0x117a19[_0x7c52(0x34)],_0x5c5dfc),_0x73212e;});if(_0x117a19['vQLcn'](_0x688589[_0x7c52(0x35)],0x0))return console[_0x7c52(0x24)](_0x7c52(0x28)),Alert['alert'](_0x7c52(0x0),_0x117a19['ArcxB'],[{'text':'OK','style':_0x7c52(0x2)}]),![];if(_0x117a19[_0x7c52(0x36)](_0x688589[_0x7c52(0x35)],_0x24caea['length'])){if(_0x117a19[_0x7c52(0x1f)](_0x117a19[_0x7c52(0x37)],_0x117a19[_0x7c52(0x37)]))console['warn'](_0x7c52(0x38)+_0x117a19['VxyPV'](_0x24caea['length'],_0x688589[_0x7c52(0x35)])+_0x7c52(0x39));else return _0x101240['error'](_0x3217c7[_0x7c52(0x3a)],_0xb54cf4),![];}try{console['log'](_0x117a19[_0x7c52(0x3b)]);const _0x13b29d=await _0x117a19[_0x7c52(0x3c)](storeChatGPTConversations,_0x1f5aa9,_0x688589);if(_0x13b29d[_0x7c52(0x3d)])return console[_0x7c52(0x21)](_0x117a19['DMGCC']),console['log'](_0x117a19['mgLqb'],_0x13b29d[_0x7c52(0x3e)]),!![];else{if(_0x117a19[_0x7c52(0x3f)](_0x7c52(0x40),_0x117a19['wwjJH'])){var _0x1b409a;return _0x2df45a[_0x7c52(0x21)](_0x7c52(0x41)),_0x117a19['xhiDB'](_0x1b409a=_0xc9e168[_0x7c52(0x3e)],null)&&_0x1b409a!==void 0x0&&_0x1b409a[_0x7c52(0x42)]&&_0x1c6dbd[_0x7c52(0x21)](_0x7c52(0x43)+_0x1ed0f9['data'][_0x7c52(0x42)]+_0x7c52(0x44)),!![];}else return console[_0x7c52(0x24)](_0x117a19[_0x7c52(0x45)],_0x13b29d[_0x7c52(0x24)]),Alert[_0x7c52(0x29)](_0x117a19[_0x7c52(0x46)],_0x13b29d[_0x7c52(0x24)]||_0x117a19[_0x7c52(0x47)],[{'text':'OK','style':_0x117a19[_0x7c52(0x1d)]}]),![];}}catch(_0x5716d0){return _0x7c52(0x48)===_0x117a19[_0x7c52(0x49)]?(_0x5328a4[_0x7c52(0x24)](_0x3217c7['XQITe'],_0x12a61a[_0x7c52(0x24)]),![]):(console[_0x7c52(0x24)](_0x117a19[_0x7c52(0x4a)],_0x5716d0),Alert['alert']('Export\x20Error',_0x117a19[_0x7c52(0x4b)],[{'text':'OK','style':_0x117a19['WcMtH']}]),![]);}}else return _0x539bef['log']('✅\x20[CHATGPT_EXTRACTOR]\x20Export\x20completed\x20successfully'),_0x188984[_0x7c52(0x21)](_0x7c52(0xe),_0x22c72f[_0x7c52(0x3e)]),!![];},_0x441892=async _0x101c16=>{const _0x286aee={'nnFgb':function(_0x548ba1,_0x7e7426){return _0x117a19[_0x7c52(0x32)](_0x548ba1,_0x7e7426);},'VJyed':_0x117a19['hsjrJ'],'Jslxa':_0x7c52(0x11),'kcote':_0x117a19[_0x7c52(0x4c)],'xantj':_0x117a19[_0x7c52(0x4b)],'UOSXw':_0x117a19[_0x7c52(0x1d)]};if(_0x117a19['wPuNQ']!==_0x7c52(0x15)){const _0x4a0d86=_0x591f05[_0x7c52(0x2f)]&&_0x4b9ba3[_0x7c52(0x4d)]&&_0x2c48a0[_0x7c52(0x30)](_0x3c14b2[_0x7c52(0x31)])&&_0x286aee[_0x7c52(0x4e)](_0x504f8c[_0x7c52(0x31)][_0x7c52(0x35)],0x0);return!_0x4a0d86&&_0x3b123b['warn'](_0x286aee[_0x7c52(0x4f)],_0x35f564),_0x4a0d86;}else{var _0x24c112,_0x30a124,_0x8dfd02;console[_0x7c52(0x21)](_0x117a19[_0x7c52(0x50)]);if(!_0x101c16)return console[_0x7c52(0x33)](_0x7c52(0x13)),![];const _0x2d274c=(_0x101c16===null||_0x117a19[_0x7c52(0x1f)](_0x101c16,void 0x0)||(_0x24c112=_0x101c16[_0x7c52(0x51)])===null||_0x117a19[_0x7c52(0x3f)](_0x24c112,void 0x0)?void 0x0:_0x24c112[_0x7c52(0x35)])||0x0,_0x21e256=(_0x117a19[_0x7c52(0x1f)](_0x101c16,null)||_0x101c16===void 0x0||_0x117a19['vQLcn'](_0x30a124=_0x101c16[_0x7c52(0x52)],null)||_0x30a124===void 0x0?void 0x0:_0x30a124[_0x7c52(0x35)])||0x0,_0x193ab1=(_0x101c16===null||_0x117a19[_0x7c52(0x3f)](_0x101c16,void 0x0)||(_0x8dfd02=_0x101c16[_0x7c52(0x53)])===null||_0x8dfd02===void 0x0?void 0x0:_0x8dfd02[_0x7c52(0x35)])||0x0;console[_0x7c52(0x21)]('📋\x20[CHATGPT_EXTRACTOR]\x20Found\x20'+_0x2d274c+_0x7c52(0x54)+_0x21e256+_0x7c52(0x55)+_0x193ab1+_0x7c52(0x44));if(_0x117a19[_0x7c52(0x56)](_0x2d274c,0x0)&&_0x117a19['ouTVP'](_0x21e256,0x0)&&_0x193ab1===0x0){if(_0x117a19[_0x7c52(0x57)]===_0x7c52(0x58))_0x3ea356[_0x7c52(0x33)]('âš ī¸\x20[CHATGPT_EXTRACTOR]\x20Filtered\x20out\x20'+_0x117a19[_0x7c52(0x59)](_0x919dd[_0x7c52(0x35)],_0x48537c[_0x7c52(0x35)])+_0x7c52(0x39));else return console[_0x7c52(0x21)](_0x7c52(0x5a)),!![];}try{console[_0x7c52(0x21)](_0x117a19[_0x7c52(0x5b)]);const _0x2ffcc8=await _0x117a19[_0x7c52(0x5c)](storeChatGPTMemories,_0x101c16);if(_0x2ffcc8['success']){if(_0x117a19[_0x7c52(0x5d)](_0x117a19[_0x7c52(0x5e)],_0x117a19[_0x7c52(0x5e)])){var _0x3b2d20;return console[_0x7c52(0x21)](_0x7c52(0x41)),_0x117a19[_0x7c52(0x5f)](_0x3b2d20=_0x2ffcc8['data'],null)&&_0x117a19[_0x7c52(0x60)](_0x3b2d20,void 0x0)&&_0x3b2d20['memoriesCount']&&console[_0x7c52(0x21)](_0x7c52(0x43)+_0x2ffcc8[_0x7c52(0x3e)][_0x7c52(0x42)]+_0x7c52(0x44)),!![];}else return _0x26bf63[_0x7c52(0x33)](_0x117a19['sShVH']),![];}else return _0x117a19['YmyaY'](_0x117a19[_0x7c52(0x61)],_0x117a19['jstaK'])?(_0x10d3b6[_0x7c52(0x24)](_0x286aee[_0x7c52(0x62)],_0x40f054),Alert[_0x7c52(0x29)](_0x286aee[_0x7c52(0x63)],_0x286aee['xantj'],[{'text':'OK','style':_0x286aee[_0x7c52(0x64)]}]),![]):(console[_0x7c52(0x24)](_0x117a19[_0x7c52(0x1e)],_0x2ffcc8['error']),![]);}catch(_0x27d59a){return _0x117a19[_0x7c52(0x65)](_0x117a19['rICzt'],_0x117a19['rICzt'])?(_0x56ad63[_0x7c52(0x24)](_0x7c52(0x9)),Alert['alert'](_0x7c52(0xa),'Username\x20is\x20required\x20to\x20export\x20ChatGPT\x20conversations.',[{'text':'OK','style':_0x286aee[_0x7c52(0x64)]}]),![]):(console['error'](_0x117a19[_0x7c52(0x66)],_0x27d59a),![]);}}};return{'initiateConversationExport':_0xec622,'storeMemories':_0x441892};};function _0x2d4c(){const _0x448b93=['Data\x20Error','No\x20valid\x20conversations\x20found\x20to\x20export.','default','❌\x20[CHATGPT_EXTRACTOR]\x20Memories\x20storage\x20failed:','XcRbq','👤\x20[CHATGPT_EXTRACTOR]\x20Username:','📊\x20[CHATGPT_EXTRACTOR]\x20Conversations\x20to\x20send:','OXHuj','YIVer','❌\x20[CHATGPT_EXTRACTOR]\x20Username\x20is\x20required','Error','â„šī¸\x20[CHATGPT_EXTRACTOR]\x20No\x20conversations\x20to\x20export\x20-\x20treating\x20as\x20success\x20(connected)','📡\x20[CHATGPT_EXTRACTOR]\x20Sending\x20to\x20backend...','✅\x20[CHATGPT_EXTRACTOR]\x20Export\x20completed\x20successfully','📊\x20[CHATGPT_EXTRACTOR]\x20Backend\x20response:','UMRek','❌\x20[CHATGPT_EXTRACTOR]\x20Backend\x20storage\x20failed:','❌\x20[CHATGPT_EXTRACTOR]\x20Unexpected\x20error\x20during\x20export:','Failed\x20to\x20connect\x20to\x20the\x20conversation\x20storage\x20service.\x20Please\x20check\x20your\x20network\x20connection.','âš ī¸\x20[CHATGPT_EXTRACTOR]\x20No\x20memories\x20data\x20provided','Export\x20Error','CNcEt','🧠\x20[CHATGPT_EXTRACTOR]\x20Storing\x20ChatGPT\x20memories...','📡\x20[CHATGPT_EXTRACTOR]\x20Sending\x20memories\x20to\x20backend...','veNfD','SyyKX','xoRXf','RlYLg','ArcxB','WcMtH','UPRyO','vQLcn','gcSMp','log','reGqI','kjkZv','error','zqVJf','ECSLU','Username\x20is\x20required\x20to\x20export\x20ChatGPT\x20conversations.','❌\x20[CHATGPT_EXTRACTOR]\x20No\x20valid\x20conversations\x20after\x20filtering','alert','yBxCB','MTjxs','GYcQA','skAiR','filter','conversation_id','isArray','user_messages','QeDfz','warn','hsjrJ','length','QirjI','lNNMe','âš ī¸\x20[CHATGPT_EXTRACTOR]\x20Filtered\x20out\x20','\x20invalid\x20conversations','LcZsk','RbTjI','ewImX','success','data','ouTVP','FoCkF','✅\x20[CHATGPT_EXTRACTOR]\x20Memories\x20stored\x20successfully','memoriesCount','📋\x20[CHATGPT_EXTRACTOR]\x20Backend\x20stored\x20','\x20memories','eLRGH','RfZVw','PLYQQ','xprns','mBNme','piERC','gqaTN','djTRo','title','nnFgb','VJyed','WiTWe','items','memory_entries','memories','\x20memory\x20items,\x20','\x20memory\x20entries,\x20','oyHtt','uuALc','rmGaZ','VxyPV','â„šī¸\x20[CHATGPT_EXTRACTOR]\x20No\x20memories\x20to\x20store\x20-\x20treating\x20as\x20success','LVMWJ','cbqUj','MJorA','fjHgY','cMJYl','IFmce','jstaK','Jslxa','kcote','UOSXw','bfKai','WiGEU'];_0x2d4c=function(){return _0x448b93;};return _0x2d4c();}
1
+ /**
2
+ * ChatGPT Conversation Extractor
3
+ *
4
+ * Orchestrates the ChatGPT conversation export flow:
5
+ * 1. Receives extracted conversations from WebView
6
+ * 2. Validates and formats data
7
+ * 3. Sends to backend via chatGPTConversationService
8
+ * 4. Also handles ChatGPT memories export
9
+ *
10
+ * This acts as the bridge between OAuthWebView and the backend API.
11
+ *
12
+ * @reference iOS implementation: onairos-flutter/ios/Classes/OnairosChatGPTConnectorPlugin.swift
13
+ */
14
+
15
+ import { storeChatGPTConversations, storeChatGPTMemories } from './chatGPTConversationService';
16
+ import { Alert } from 'react-native';
17
+
18
+ /**
19
+ * Hook for ChatGPT conversation extraction operations
20
+ */
21
+ export const useChatGPTConversationExtractor = () => {
22
+ /**
23
+ * Initiate conversation export to backend
24
+ *
25
+ * @param username - User identifier
26
+ * @param conversations - Array of conversations with user messages
27
+ * @returns true if successful, false otherwise
28
+ */
29
+ const initiateConversationExport = async (username, conversations) => {
30
+ console.log('🚀 [CHATGPT_EXTRACTOR] Initiating conversation export');
31
+ console.log('👤 [CHATGPT_EXTRACTOR] Username:', username);
32
+ console.log('📊 [CHATGPT_EXTRACTOR] Conversations to send:', conversations.length);
33
+
34
+ // Validation
35
+ if (!username) {
36
+ console.error('❌ [CHATGPT_EXTRACTOR] Username is required');
37
+ Alert.alert('Error', 'Username is required to export ChatGPT conversations.', [{
38
+ text: 'OK',
39
+ style: 'default'
40
+ }]);
41
+ return false;
42
+ }
43
+
44
+ // Handle 0 conversations as success - user might be new or have cleared history
45
+ // This matches iOS behavior where empty conversations still counts as successful connection
46
+ if (!conversations || conversations.length === 0) {
47
+ console.log('â„šī¸ [CHATGPT_EXTRACTOR] No conversations to export - treating as success (connected)');
48
+ return true;
49
+ }
50
+
51
+ // Validate conversation structure
52
+ const validConversations = conversations.filter(conv => {
53
+ const isValid = conv.conversation_id && conv.title && Array.isArray(conv.user_messages) && conv.user_messages.length > 0;
54
+ if (!isValid) {
55
+ console.warn('âš ī¸ [CHATGPT_EXTRACTOR] Invalid conversation:', conv);
56
+ }
57
+ return isValid;
58
+ });
59
+ if (validConversations.length === 0) {
60
+ console.error('❌ [CHATGPT_EXTRACTOR] No valid conversations after filtering');
61
+ Alert.alert('Data Error', 'No valid conversations found to export.', [{
62
+ text: 'OK',
63
+ style: 'default'
64
+ }]);
65
+ return false;
66
+ }
67
+ if (validConversations.length < conversations.length) {
68
+ console.warn(`âš ī¸ [CHATGPT_EXTRACTOR] Filtered out ${conversations.length - validConversations.length} invalid conversations`);
69
+ }
70
+ try {
71
+ console.log('📡 [CHATGPT_EXTRACTOR] Sending to backend...');
72
+ const result = await storeChatGPTConversations(username, validConversations);
73
+ if (result.success) {
74
+ console.log('✅ [CHATGPT_EXTRACTOR] Export completed successfully');
75
+ console.log('📊 [CHATGPT_EXTRACTOR] Backend response:', result.data);
76
+ return true;
77
+ } else {
78
+ console.error('❌ [CHATGPT_EXTRACTOR] Backend storage failed:', result.error);
79
+ Alert.alert('Export Failed', result.error || 'An unknown error occurred during conversation storage.', [{
80
+ text: 'OK',
81
+ style: 'default'
82
+ }]);
83
+ return false;
84
+ }
85
+ } catch (error) {
86
+ console.error('❌ [CHATGPT_EXTRACTOR] Unexpected error during export:', error);
87
+ Alert.alert('Export Error', 'Failed to connect to the conversation storage service. Please check your network connection.', [{
88
+ text: 'OK',
89
+ style: 'default'
90
+ }]);
91
+ return false;
92
+ }
93
+ };
94
+
95
+ /**
96
+ * Store ChatGPT memories on backend
97
+ * MATCHES iOS: OnairosChatGPTConnectorPlugin.swift saveMemories() + sendMemoriesToBackend()
98
+ *
99
+ * @param memoriesData - Raw ChatGPT memories JSON from WebView
100
+ * @returns true if successful, false otherwise
101
+ */
102
+ const storeMemories = async memoriesData => {
103
+ var _memoriesData$items, _memoriesData$memory_, _memoriesData$memorie;
104
+ console.log('🧠 [CHATGPT_EXTRACTOR] Storing ChatGPT memories...');
105
+
106
+ // Validation
107
+ if (!memoriesData) {
108
+ console.warn('âš ī¸ [CHATGPT_EXTRACTOR] No memories data provided');
109
+ return false;
110
+ }
111
+
112
+ // Count items (matches iOS logging)
113
+ const itemsCount = (memoriesData === null || memoriesData === void 0 || (_memoriesData$items = memoriesData.items) === null || _memoriesData$items === void 0 ? void 0 : _memoriesData$items.length) || 0;
114
+ const entriesCount = (memoriesData === null || memoriesData === void 0 || (_memoriesData$memory_ = memoriesData.memory_entries) === null || _memoriesData$memory_ === void 0 ? void 0 : _memoriesData$memory_.length) || 0;
115
+ const memoriesCount = (memoriesData === null || memoriesData === void 0 || (_memoriesData$memorie = memoriesData.memories) === null || _memoriesData$memorie === void 0 ? void 0 : _memoriesData$memorie.length) || 0;
116
+ console.log(`📋 [CHATGPT_EXTRACTOR] Found ${itemsCount} memory items, ${entriesCount} memory entries, ${memoriesCount} memories`);
117
+
118
+ // If no memories, still treat as success (user might not have any memories)
119
+ if (itemsCount === 0 && entriesCount === 0 && memoriesCount === 0) {
120
+ console.log('â„šī¸ [CHATGPT_EXTRACTOR] No memories to store - treating as success');
121
+ return true;
122
+ }
123
+ try {
124
+ console.log('📡 [CHATGPT_EXTRACTOR] Sending memories to backend...');
125
+ const result = await storeChatGPTMemories(memoriesData);
126
+ if (result.success) {
127
+ var _result$data;
128
+ console.log('✅ [CHATGPT_EXTRACTOR] Memories stored successfully');
129
+ if ((_result$data = result.data) !== null && _result$data !== void 0 && _result$data.memoriesCount) {
130
+ console.log(`📋 [CHATGPT_EXTRACTOR] Backend stored ${result.data.memoriesCount} memories`);
131
+ }
132
+ return true;
133
+ } else {
134
+ console.error('❌ [CHATGPT_EXTRACTOR] Memories storage failed:', result.error);
135
+ // Don't show alert for memories failure - it's secondary data
136
+ // The main conversation export is what matters
137
+ return false;
138
+ }
139
+ } catch (error) {
140
+ console.error('❌ [CHATGPT_EXTRACTOR] Unexpected error storing memories:', error);
141
+ return false;
142
+ }
143
+ };
144
+ return {
145
+ initiateConversationExport,
146
+ storeMemories
147
+ };
148
+ };
149
+ //# sourceMappingURL=chatGPTConversationExtractor.js.map