@onairos/react-native 3.6.4 → 3.6.6

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 (222) hide show
  1. package/lib/commonjs/api/index.js +1 -1
  2. package/lib/commonjs/components/BodyText.js +1 -1
  3. package/lib/commonjs/components/BrandMark.js +1 -1
  4. package/lib/commonjs/components/CodeInput.js +1 -1
  5. package/lib/commonjs/components/EmailInput.js +1 -1
  6. package/lib/commonjs/components/GoogleButton.js +1 -1
  7. package/lib/commonjs/components/HeadingGroup.js +1 -1
  8. package/lib/commonjs/components/LLMDataInputModal.js +1 -1
  9. package/lib/commonjs/components/ModalHeader.js +1 -1
  10. package/lib/commonjs/components/ModalSheet.js +1 -1
  11. package/lib/commonjs/components/Onairos.js +1 -1
  12. package/lib/commonjs/components/OnairosButton.js +1 -1
  13. package/lib/commonjs/components/OnairosSignInButton.js +1 -1
  14. package/lib/commonjs/components/Overlay.js +1 -1
  15. package/lib/commonjs/components/PersonaImage.js +1 -1
  16. package/lib/commonjs/components/PersonaLoadingScreen.js +1 -1
  17. package/lib/commonjs/components/PersonalizationConsentScreen.js +1 -1
  18. package/lib/commonjs/components/PinCreationScreen.js +1 -1
  19. package/lib/commonjs/components/PinInput.js +1 -1
  20. package/lib/commonjs/components/PlatformConnectorsStep.js +1 -1
  21. package/lib/commonjs/components/PlatformList.js +1 -1
  22. package/lib/commonjs/components/PlatformToggle.js +1 -1
  23. package/lib/commonjs/components/PrimaryButton.js +1 -1
  24. package/lib/commonjs/components/SignInMatchAnimation.js +1 -1
  25. package/lib/commonjs/components/SignInStep.js +1 -1
  26. package/lib/commonjs/components/UniversalOnboarding.js +1 -1
  27. package/lib/commonjs/components/VerificationStep.js +1 -1
  28. package/lib/commonjs/components/WelcomeScreen.js +1 -1
  29. package/lib/commonjs/components/icons/Basicproficon.js +1 -1
  30. package/lib/commonjs/components/icons/Basicprofile.js +1 -1
  31. package/lib/commonjs/components/icons/Checkbox.js +1 -1
  32. package/lib/commonjs/components/icons/Checkmark.js +1 -1
  33. package/lib/commonjs/components/icons/Contentanalysis.js +1 -1
  34. package/lib/commonjs/components/icons/Contenticon.js +1 -1
  35. package/lib/commonjs/components/icons/EnochE.js +1 -1
  36. package/lib/commonjs/components/icons/Personalityicon.js +1 -1
  37. package/lib/commonjs/components/icons/Personalityprofile.js +1 -1
  38. package/lib/commonjs/components/icons/Personalitytraits.js +1 -1
  39. package/lib/commonjs/components/icons/Userpreferences.js +1 -1
  40. package/lib/commonjs/components/icons/index.js +1 -1
  41. package/lib/commonjs/components/onboarding/OAuthWebView.js +1 -1
  42. package/lib/commonjs/components/onboarding/OnboardingHeader.js +1 -1
  43. package/lib/commonjs/components/onboarding/PinInput.js +1 -1
  44. package/lib/commonjs/components/onboarding/PlatformConnector.js +1 -1
  45. package/lib/commonjs/config/api.js +1 -1
  46. package/lib/commonjs/constants/index.js +1 -1
  47. package/lib/commonjs/context/AuthContext.js +1 -1
  48. package/lib/commonjs/hooks/useConnectedAccounts.js +1 -1
  49. package/lib/commonjs/hooks/useConnections.js +1 -1
  50. package/lib/commonjs/hooks/useCredentials.js +1 -1
  51. package/lib/commonjs/hooks/useUserConnections.js +1 -1
  52. package/lib/commonjs/index.js +1 -1
  53. package/lib/commonjs/services/apiClient.js +1 -1
  54. package/lib/commonjs/services/apiKeyService.js +924 -9
  55. package/lib/commonjs/services/authService.js +627 -10
  56. package/lib/commonjs/services/biometricPinService.js +1 -1
  57. package/lib/commonjs/services/chatGPTConversationExtractor.js +1 -1
  58. package/lib/commonjs/services/chatGPTConversationService.js +1 -1
  59. package/lib/commonjs/services/claudeConversationExtractor.js +1 -1
  60. package/lib/commonjs/services/claudeConversationService.js +1 -1
  61. package/lib/commonjs/services/connectedAccountsService.js +1 -1
  62. package/lib/commonjs/services/googleAuthService.js +1 -1
  63. package/lib/commonjs/services/hingeDataExtractor.js +1 -1
  64. package/lib/commonjs/services/hingeDataService.js +1 -1
  65. package/lib/commonjs/services/imageCompressionService.js +1 -1
  66. package/lib/commonjs/services/instagramDataExtractor.js +1 -1
  67. package/lib/commonjs/services/instagramDataService.js +1 -1
  68. package/lib/commonjs/services/jwtStorageService.js +1 -1
  69. package/lib/commonjs/services/linkedinDOMExtractor.js +1 -1
  70. package/lib/commonjs/services/linkedinProfileService.js +1 -1
  71. package/lib/commonjs/services/linkedinScrapingService.js +1 -1
  72. package/lib/commonjs/services/llmDataStorage.js +1 -1
  73. package/lib/commonjs/services/mobileTrainingService.js +1 -1
  74. package/lib/commonjs/services/oauthService.js +391 -11
  75. package/lib/commonjs/services/pinEncryptionService.js +1 -1
  76. package/lib/commonjs/services/pinStorageUtils.js +1 -1
  77. package/lib/commonjs/services/platformAuthService.js +1 -1
  78. package/lib/commonjs/services/sephoraDataExtractor.js +1 -1
  79. package/lib/commonjs/services/sephoraDataService.js +1 -1
  80. package/lib/commonjs/services/storageService.js +1 -1
  81. package/lib/commonjs/services/telegramDataExtractor.js +1 -1
  82. package/lib/commonjs/services/telegramDataService.js +1 -1
  83. package/lib/commonjs/services/trainingApiHelpers.js +1 -1
  84. package/lib/commonjs/services/userConnectionsService.js +1 -1
  85. package/lib/commonjs/services/youtubeMigrationService.js +1 -1
  86. package/lib/commonjs/theme/index.js +1 -1
  87. package/lib/commonjs/types/index.js +1 -1
  88. package/lib/commonjs/types.js +1 -1
  89. package/lib/commonjs/utils/Portal.js +1 -1
  90. package/lib/commonjs/utils/api.js +1 -1
  91. package/lib/commonjs/utils/assetRegistry.js +1 -1
  92. package/lib/commonjs/utils/auth.js +1 -1
  93. package/lib/commonjs/utils/connectorTests.js +1 -1
  94. package/lib/commonjs/utils/crypto.js +1 -1
  95. package/lib/commonjs/utils/debugHelper.js +1 -1
  96. package/lib/commonjs/utils/encryption.js +1 -1
  97. package/lib/commonjs/utils/eventUtils.js +1 -1
  98. package/lib/commonjs/utils/haptics.js +1 -1
  99. package/lib/commonjs/utils/imagePreloader.js +1 -1
  100. package/lib/commonjs/utils/networkDiagnostics.js +1 -1
  101. package/lib/commonjs/utils/onairosApi.js +1 -1
  102. package/lib/commonjs/utils/programmaticFlow.js +1 -1
  103. package/lib/commonjs/utils/retryHelper.js +1 -1
  104. package/lib/commonjs/utils/secureStorage.js +1 -1
  105. package/lib/commonjs/utils/webviewScripts/chatgpt.js +1 -1
  106. package/lib/commonjs/utils/webviewScripts/claude.js +1 -1
  107. package/lib/commonjs/utils/webviewScripts/hinge.js +1 -1
  108. package/lib/commonjs/utils/webviewScripts/index.js +1 -1
  109. package/lib/commonjs/utils/webviewScripts/instagram.js +1 -1
  110. package/lib/commonjs/utils/webviewScripts/linkedin.js +1 -1
  111. package/lib/commonjs/utils/webviewScripts/sephora.js +1 -1
  112. package/lib/commonjs/utils/webviewScripts/telegram.js +1 -1
  113. package/lib/module/api/index.js +1 -1
  114. package/lib/module/components/BodyText.js +1 -1
  115. package/lib/module/components/BrandMark.js +1 -1
  116. package/lib/module/components/CodeInput.js +1 -1
  117. package/lib/module/components/EmailInput.js +1 -1
  118. package/lib/module/components/GoogleButton.js +1 -1
  119. package/lib/module/components/HeadingGroup.js +1 -1
  120. package/lib/module/components/LLMDataInputModal.js +1 -1
  121. package/lib/module/components/ModalHeader.js +1 -1
  122. package/lib/module/components/ModalSheet.js +1 -1
  123. package/lib/module/components/Onairos.js +1 -1
  124. package/lib/module/components/OnairosButton.js +1 -1
  125. package/lib/module/components/OnairosSignInButton.js +1 -1
  126. package/lib/module/components/Overlay.js +1 -1
  127. package/lib/module/components/PersonaImage.js +1 -1
  128. package/lib/module/components/PersonaLoadingScreen.js +1 -1
  129. package/lib/module/components/PersonalizationConsentScreen.js +1 -1
  130. package/lib/module/components/PinCreationScreen.js +1 -1
  131. package/lib/module/components/PinInput.js +1 -1
  132. package/lib/module/components/PlatformConnectorsStep.js +1 -1
  133. package/lib/module/components/PlatformList.js +1 -1
  134. package/lib/module/components/PlatformToggle.js +1 -1
  135. package/lib/module/components/PrimaryButton.js +1 -1
  136. package/lib/module/components/SignInMatchAnimation.js +1 -1
  137. package/lib/module/components/SignInStep.js +1 -1
  138. package/lib/module/components/UniversalOnboarding.js +1 -1
  139. package/lib/module/components/VerificationStep.js +1 -1
  140. package/lib/module/components/WelcomeScreen.js +1 -1
  141. package/lib/module/components/icons/Basicproficon.js +1 -1
  142. package/lib/module/components/icons/Basicprofile.js +1 -1
  143. package/lib/module/components/icons/Checkbox.js +1 -1
  144. package/lib/module/components/icons/Checkmark.js +1 -1
  145. package/lib/module/components/icons/Contentanalysis.js +1 -1
  146. package/lib/module/components/icons/Contenticon.js +1 -1
  147. package/lib/module/components/icons/EnochE.js +1 -1
  148. package/lib/module/components/icons/Personalityicon.js +1 -1
  149. package/lib/module/components/icons/Personalityprofile.js +1 -1
  150. package/lib/module/components/icons/Personalitytraits.js +1 -1
  151. package/lib/module/components/icons/Userpreferences.js +1 -1
  152. package/lib/module/components/onboarding/OAuthWebView.js +1 -1
  153. package/lib/module/components/onboarding/OnboardingHeader.js +1 -1
  154. package/lib/module/components/onboarding/PinInput.js +1 -1
  155. package/lib/module/components/onboarding/PlatformConnector.js +1 -1
  156. package/lib/module/config/api.js +1 -1
  157. package/lib/module/constants/index.js +1 -1
  158. package/lib/module/context/AuthContext.js +1 -1
  159. package/lib/module/hooks/useConnectedAccounts.js +1 -1
  160. package/lib/module/hooks/useConnections.js +1 -1
  161. package/lib/module/hooks/useCredentials.js +1 -1
  162. package/lib/module/hooks/useUserConnections.js +1 -1
  163. package/lib/module/index.js +1 -1
  164. package/lib/module/services/apiClient.js +1 -1
  165. package/lib/module/services/apiKeyService.js +898 -1
  166. package/lib/module/services/authService.js +602 -1
  167. package/lib/module/services/biometricPinService.js +1 -1
  168. package/lib/module/services/chatGPTConversationExtractor.js +1 -1
  169. package/lib/module/services/chatGPTConversationService.js +1 -1
  170. package/lib/module/services/claudeConversationExtractor.js +1 -1
  171. package/lib/module/services/claudeConversationService.js +1 -1
  172. package/lib/module/services/connectedAccountsService.js +1 -1
  173. package/lib/module/services/googleAuthService.js +1 -1
  174. package/lib/module/services/hingeDataExtractor.js +1 -1
  175. package/lib/module/services/hingeDataService.js +1 -1
  176. package/lib/module/services/imageCompressionService.js +1 -1
  177. package/lib/module/services/instagramDataExtractor.js +1 -1
  178. package/lib/module/services/instagramDataService.js +1 -1
  179. package/lib/module/services/jwtStorageService.js +1 -1
  180. package/lib/module/services/linkedinDOMExtractor.js +1 -1
  181. package/lib/module/services/linkedinProfileService.js +1 -1
  182. package/lib/module/services/linkedinScrapingService.js +1 -1
  183. package/lib/module/services/llmDataStorage.js +1 -1
  184. package/lib/module/services/mobileTrainingService.js +1 -1
  185. package/lib/module/services/oauthService.js +381 -1
  186. package/lib/module/services/pinEncryptionService.js +1 -1
  187. package/lib/module/services/pinStorageUtils.js +1 -1
  188. package/lib/module/services/platformAuthService.js +1 -1
  189. package/lib/module/services/sephoraDataExtractor.js +1 -1
  190. package/lib/module/services/sephoraDataService.js +1 -1
  191. package/lib/module/services/storageService.js +1 -1
  192. package/lib/module/services/telegramDataExtractor.js +1 -1
  193. package/lib/module/services/telegramDataService.js +1 -1
  194. package/lib/module/services/trainingApiHelpers.js +1 -1
  195. package/lib/module/services/userConnectionsService.js +1 -1
  196. package/lib/module/services/youtubeMigrationService.js +1 -1
  197. package/lib/module/theme/index.js +1 -1
  198. package/lib/module/types.js +1 -1
  199. package/lib/module/utils/Portal.js +1 -1
  200. package/lib/module/utils/api.js +1 -1
  201. package/lib/module/utils/assetRegistry.js +1 -1
  202. package/lib/module/utils/auth.js +1 -1
  203. package/lib/module/utils/connectorTests.js +1 -1
  204. package/lib/module/utils/crypto.js +1 -1
  205. package/lib/module/utils/debugHelper.js +1 -1
  206. package/lib/module/utils/encryption.js +1 -1
  207. package/lib/module/utils/eventUtils.js +1 -1
  208. package/lib/module/utils/haptics.js +1 -1
  209. package/lib/module/utils/networkDiagnostics.js +1 -1
  210. package/lib/module/utils/onairosApi.js +1 -1
  211. package/lib/module/utils/programmaticFlow.js +1 -1
  212. package/lib/module/utils/retryHelper.js +1 -1
  213. package/lib/module/utils/secureStorage.js +1 -1
  214. package/lib/module/utils/webviewScripts/chatgpt.js +1 -1
  215. package/lib/module/utils/webviewScripts/claude.js +1 -1
  216. package/lib/module/utils/webviewScripts/hinge.js +1 -1
  217. package/lib/module/utils/webviewScripts/index.js +1 -1
  218. package/lib/module/utils/webviewScripts/instagram.js +1 -1
  219. package/lib/module/utils/webviewScripts/linkedin.js +1 -1
  220. package/lib/module/utils/webviewScripts/sephora.js +1 -1
  221. package/lib/module/utils/webviewScripts/telegram.js +1 -1
  222. package/package.json +1 -1
@@ -1,11 +1,391 @@
1
- 'use strict';
2
- // Onairos SDK - Asset Registry (auto-generated)
3
- var __ONAIROS_REQ_REGISTRY__ = [
4
- require("react-native"),
5
- require("../utils/secureStorage"),
6
- require("../utils/crypto"),
7
- require("../api"),
8
- require("../config/api")
9
- ];
10
- function __ONAIROS_REQ_FUNC__(i) { return __ONAIROS_REQ_REGISTRY__[i]; }
11
- function _0x13b7(_0x103c92,_0x13b786){_0x103c92=_0x103c92-0x0;const _0x2a8b29=_0x103c();let _0x28ee2d=_0x2a8b29[_0x103c92];return _0x28ee2d;}Object[_0x13b7(0x0)](exports,'__esModule',{'value':!![]}),exports[_0x13b7(0x1)]=exports[_0x13b7(0x2)]=exports[_0x13b7(0x3)]=exports[_0x13b7(0x4)]=exports[_0x13b7(0x5)]=exports[_0x13b7(0x6)]=void 0x0;var _reactNative=__ONAIROS_REQ_FUNC__(0x0),_secureStorage=__ONAIROS_REQ_FUNC__(0x1),_crypto=__ONAIROS_REQ_FUNC__(0x2),_api=__ONAIROS_REQ_FUNC__(0x3),_api2=__ONAIROS_REQ_FUNC__(0x4);const OAUTH_CONFIGS={'instagram':{'clientId':_0x13b7(0x7),'redirectUri':_0x13b7(0x8),'scope':_0x13b7(0x9),'authorizationEndpoint':'https://api.instagram.com/oauth/authorize','tokenEndpoint':_0x13b7(0xa),'responseType':'code'},'youtube':{'clientId':'YOUR_YOUTUBE_CLIENT_ID','redirectUri':_0x13b7(0xb),'scope':_0x13b7(0xc),'authorizationEndpoint':'https://accounts.google.com/o/oauth2/auth','tokenEndpoint':_0x13b7(0xd),'responseType':_0x13b7(0xe)},'pinterest':{'clientId':'YOUR_PINTEREST_CLIENT_ID','redirectUri':_0x13b7(0xf),'scope':_0x13b7(0x10),'authorizationEndpoint':_0x13b7(0x11),'tokenEndpoint':_0x13b7(0x12),'responseType':_0x13b7(0xe)},'reddit':{'clientId':_0x13b7(0x13),'redirectUri':_0x13b7(0x14),'scope':'identity,read','authorizationEndpoint':_0x13b7(0x15),'tokenEndpoint':'https://www.reddit.com/api/v1/access_token','responseType':_0x13b7(0xe)}},generateState=()=>{const _0x2c6aa5=Math[_0x13b7(0x16)]()['toString'](0x24)[_0x13b7(0x17)](0x2,0xf);return(0x0,_crypto[_0x13b7(0x18)])(_0x2c6aa5)['substring'](0x0,0xa);},initializeOAuthService=()=>{const _0x2eb16a={'Nligh':_0x13b7(0x19)};_reactNative[_0x13b7(0x1a)][_0x13b7(0x1b)](_0x2eb16a['Nligh'],handleDeepLink);};exports[_0x13b7(0x2)]=initializeOAuthService;const cleanupOAuthService=()=>{const _0x3799ca={'yNKnZ':_0x13b7(0x1c),'OpFIw':_0x13b7(0x19),'AQcHP':function(_0x5820b6,_0x5c05b0){return _0x5820b6===_0x5c05b0;}};_0x3799ca[_0x13b7(0x1d)](typeof _reactNative[_0x13b7(0x1a)][_0x13b7(0x1e)],_0x3799ca[_0x13b7(0x1f)])&&(_0x3799ca[_0x13b7(0x1d)](_0x13b7(0x20),_0x13b7(0x21))?typeof _0x271005[_0x13b7(0x1a)][_0x13b7(0x1e)]===_0x3799ca['yNKnZ']&&_0x408a65['Linking'][_0x13b7(0x1e)](_0x3799ca[_0x13b7(0x22)]):_reactNative[_0x13b7(0x1a)][_0x13b7(0x1e)](_0x13b7(0x19)));};exports[_0x13b7(0x5)]=cleanupOAuthService;let currentOAuthState=null,currentOAuthPlatform=null,currentOAuthResolve=null,currentOAuthReject=null;const handleDeepLink=async _0x2e920a=>{const _0x1e4d93={'nZlRU':_0x13b7(0x23),'cMnDa':function(_0x4db5fb,_0x3907e){return _0x4db5fb(_0x3907e);},'uuyZR':_0x13b7(0x19),'Tewhh':function(_0x11cfcf,_0x5e4799){return _0x11cfcf===_0x5e4799;},'UKHNQ':'IonHQ','kpGlq':_0x13b7(0x24),'jnhXt':function(_0x2ed4e2,_0xe9d6ff){return _0x2ed4e2!==_0xe9d6ff;},'tliWZ':'code','EDAla':_0x13b7(0x25),'VxWmO':_0x13b7(0x26),'NTbGf':'OAuth\x20state\x20mismatch\x20-\x20possible\x20CSRF\x20attack','ltYMK':function(_0x768e8f,_0x3c4781){return _0x768e8f(_0x3c4781);},'OZfRB':_0x13b7(0x27),'qmBgV':'gsyXN','bBwpP':function(_0x3b2c3e,_0x289d40){return _0x3b2c3e===_0x289d40;},'SHDKW':_0x13b7(0x28),'cyuPp':function(_0x123b26,_0x2c7b3f){return _0x123b26(_0x2c7b3f);},'rkARI':_0x13b7(0x29),'BNZQk':function(_0x52bc7a,_0x286a82){return _0x52bc7a!==_0x286a82;},'LxCXO':'cCQbW','AWRXs':_0x13b7(0x2a),'FGEzr':function(_0xf5d02a,_0xa6367a){return _0xf5d02a!==_0xa6367a;},'qGKbm':_0x13b7(0x2b)};try{if(_0x1e4d93[_0x13b7(0x2c)]('IonHQ',_0x1e4d93['UKHNQ'])){const {url:_0x122881}=_0x2e920a;if(!_0x122881[_0x13b7(0x2d)](_0x1e4d93[_0x13b7(0x2e)]))return;const _0x5677af=_0x122881[_0x13b7(0x2f)](_0x1e4d93[_0x13b7(0x2e)])[0x1]['split']('?')[0x0];if(_0x1e4d93['jnhXt'](_0x5677af,currentOAuthPlatform))return;const _0x5ef9db=new URL(_0x122881)[_0x13b7(0x30)],_0x5c80cd=_0x5ef9db[_0x13b7(0x31)](_0x1e4d93[_0x13b7(0x32)]),_0x308da2=_0x5ef9db[_0x13b7(0x31)](_0x1e4d93[_0x13b7(0x33)]),_0x5ec4f6=_0x5ef9db[_0x13b7(0x31)](_0x1e4d93[_0x13b7(0x34)]);if(_0x1e4d93[_0x13b7(0x35)](_0x308da2,currentOAuthState)){currentOAuthReject&&_0x1e4d93[_0x13b7(0x36)](currentOAuthReject,new Error(_0x1e4d93[_0x13b7(0x37)]));return;}if(_0x5ec4f6){currentOAuthReject&&_0x1e4d93[_0x13b7(0x38)](currentOAuthReject,new Error(_0x13b7(0x39)+_0x5ec4f6));return;}if(_0x5c80cd){const _0x2b28ca=await exchangeCodeForToken(_0x5677af,_0x5c80cd);currentOAuthResolve&&currentOAuthResolve(_0x2b28ca);}else{if(_0x1e4d93[_0x13b7(0x35)](_0x1e4d93['OZfRB'],_0x1e4d93[_0x13b7(0x3a)])){if(currentOAuthReject){if(_0x1e4d93[_0x13b7(0x3b)](_0x13b7(0x28),_0x1e4d93['SHDKW']))_0x1e4d93[_0x13b7(0x3c)](currentOAuthReject,new Error(_0x1e4d93[_0x13b7(0x3d)]));else throw new _0x3bf0b7(_0x13b7(0x3e)+_0x4d138a);}}else _0x14e439['error'](_0x1e4d93[_0x13b7(0x3f)],_0x4b9083),_0x2c2ddb&&_0x1e4d93[_0x13b7(0x36)](_0x185d6d,_0x1a800a);}}else _0x538cea[_0x13b7(0x1a)]['addEventListener'](_0x1e4d93[_0x13b7(0x40)],_0x154641);}catch(_0x12bfc6){if(_0x1e4d93[_0x13b7(0x41)](_0x1e4d93[_0x13b7(0x42)],_0x1e4d93[_0x13b7(0x43)])){console['error'](_0x1e4d93['nZlRU'],_0x12bfc6);if(currentOAuthReject){if(_0x1e4d93[_0x13b7(0x44)](_0x1e4d93[_0x13b7(0x45)],_0x13b7(0x46)))currentOAuthReject(_0x12bfc6);else throw new _0x45bfb3('Unsupported\x20platform:\x20'+_0xfb9d2d);}}else _0x2f3676=null,_0x34e087=null,_0x157187=null,_0x5976d8=null;}finally{currentOAuthState=null,currentOAuthPlatform=null,currentOAuthResolve=null,currentOAuthReject=null;}},exchangeCodeForToken=async(_0x1ae69a,_0x5d8e0e)=>{const _0x5b352d={'ysOns':function(_0x3176d5){return _0x3176d5();},'dpyRt':_0x13b7(0x47),'Apkel':_0x13b7(0x48),'cLypT':_0x13b7(0x49),'fRZjQ':_0x13b7(0x4a),'KKyrK':_0x13b7(0x25),'LOuDd':function(_0x1a42c8,_0x2d6338){return _0x1a42c8(_0x2d6338);},'uycVp':function(_0x15f123,_0x21921b){return _0x15f123!==_0x21921b;},'aMbWm':_0x13b7(0x4b),'GEyFd':_0x13b7(0x4c),'LdZhD':'nBChC','zxNtF':_0x13b7(0x4d),'bsczF':_0x13b7(0x4e),'zVgfm':function(_0x163f4a,_0x4d881d,_0x3c96c5){return _0x163f4a(_0x4d881d,_0x3c96c5);},'yxdmr':_0x13b7(0x4f),'MbDFD':_0x13b7(0x50)};try{if(_0x5b352d[_0x13b7(0x51)](_0x5b352d['aMbWm'],_0x5b352d[_0x13b7(0x52)])){const _0x2f1a75=OAUTH_CONFIGS[_0x1ae69a];if(!_0x2f1a75){if(_0x5b352d[_0x13b7(0x53)]!==_0x5b352d[_0x13b7(0x54)])throw new Error(_0x13b7(0x3e)+_0x1ae69a);else{_0x4af0a2['error'](_0x13b7(0x55)+_0x843d1+'):',_0x10f056);throw _0x5dd495;}}const _0x10361d=new URLSearchParams({'grant_type':_0x5b352d[_0x13b7(0x56)],'code':_0x5d8e0e,'redirect_uri':_0x2f1a75[_0x13b7(0x57)],'client_id':_0x2f1a75[_0x13b7(0x58)]}),_0x503547=await _0x5b352d[_0x13b7(0x59)](fetch,_0x2f1a75[_0x13b7(0x5a)],{'method':'POST','headers':{'Content-Type':_0x5b352d['yxdmr']},'body':_0x10361d['toString']()}),_0x233d5c=await _0x503547[_0x13b7(0x5b)]();if(!_0x503547['ok'])throw new Error(_0x233d5c['error']||_0x13b7(0x5c));const _0x256dee=await fetchUserInfo(_0x1ae69a,_0x233d5c[_0x13b7(0x5d)]);return{'token':_0x233d5c[_0x13b7(0x5d)],'refreshToken':_0x233d5c[_0x13b7(0x5e)],'expiresIn':_0x233d5c['expires_in'],'username':_0x256dee['username'],'userId':_0x256dee['id']};}else{_0x3d12c8[_0x13b7(0x26)](_0x13b7(0x5f)+_0x3d433d+'):',_0x60a62d);throw _0x2d8d9a;}}catch(_0x1a125a){if(_0x5b352d[_0x13b7(0x51)](_0x5b352d[_0x13b7(0x60)],_0x5b352d[_0x13b7(0x60)]))try{const _0x222c6f=_0x2a2735[_0x4b4f89];if(!_0x222c6f)throw new _0x19999e(_0x13b7(0x3e)+_0x6e3634);const _0x2ce33e=_0x5b352d[_0x13b7(0x61)](_0x345eca),_0x2f9c1c=new _0x438ad5(_0x222c6f[_0x13b7(0x62)]);_0x2f9c1c['searchParams'][_0x13b7(0x63)](_0x5b352d[_0x13b7(0x64)],_0x222c6f[_0x13b7(0x58)]),_0x2f9c1c[_0x13b7(0x30)][_0x13b7(0x63)](_0x5b352d['Apkel'],_0x222c6f['redirectUri']),_0x2f9c1c[_0x13b7(0x30)]['append'](_0x5b352d[_0x13b7(0x65)],_0x222c6f[_0x13b7(0x66)]),_0x2f9c1c['searchParams'][_0x13b7(0x63)](_0x5b352d[_0x13b7(0x67)],_0x222c6f[_0x13b7(0x4a)]),_0x2f9c1c['searchParams'][_0x13b7(0x63)](_0x5b352d[_0x13b7(0x68)],_0x2ce33e),_0x4e9870=_0x2ce33e,_0x1dc5c6=_0x170064,_0x32ba07=_0x9c2c80,_0x4ad07b=_0x4f0943,_0x4dbca1[_0x13b7(0x1a)][_0x13b7(0x69)](_0x2f9c1c['toString']());}catch(_0x40f94d){_0x5b352d[_0x13b7(0x6a)](_0x293d24,_0x40f94d);}else{console[_0x13b7(0x26)](_0x13b7(0x55)+_0x1ae69a+'):',_0x1a125a);throw _0x1a125a;}}},fetchUserInfo=async(_0x2ee072,_0x4b900f)=>{const _0xdb144b={'SqoNH':_0x13b7(0x5c),'mHsPC':_0x13b7(0x6b),'xYiGB':'https://graph.instagram.com/me?fields=id,username','DvmKq':'youtube','rrWIj':_0x13b7(0x6c),'OPsms':'pinterest','Wporv':_0x13b7(0x6d),'TzFXd':'reddit','Khouf':'https://oauth.reddit.com/api/v1/me','Gpmmn':function(_0x59f557,_0x5bd5a5,_0x950cb9){return _0x59f557(_0x5bd5a5,_0x950cb9);},'AVkTU':function(_0x24eccf,_0xf4c94b){return _0x24eccf!==_0xf4c94b;},'vZXhb':_0x13b7(0x6e),'NSXos':_0x13b7(0x6f)};try{let _0x2c9c54,_0x2537db={'Authorization':_0x13b7(0x70)+_0x4b900f};switch(_0x2ee072){case _0xdb144b[_0x13b7(0x71)]:_0x2c9c54=_0xdb144b[_0x13b7(0x72)];break;case _0xdb144b['DvmKq']:_0x2c9c54=_0xdb144b['rrWIj'];break;case _0xdb144b[_0x13b7(0x73)]:_0x2c9c54=_0xdb144b[_0x13b7(0x74)];break;case _0xdb144b[_0x13b7(0x75)]:_0x2c9c54=_0xdb144b[_0x13b7(0x76)];break;default:throw new Error('Unsupported\x20platform:\x20'+_0x2ee072);}const _0x1a4d69=await _0xdb144b[_0x13b7(0x77)](fetch,_0x2c9c54,{'headers':_0x2537db}),_0xedf6ae=await _0x1a4d69[_0x13b7(0x5b)]();if(!_0x1a4d69['ok']){if(_0xdb144b['AVkTU'](_0x13b7(0x6e),_0xdb144b[_0x13b7(0x78)]))throw new _0xe56dc5(_0x2a9858[_0x13b7(0x26)]||_0xdb144b[_0x13b7(0x79)]);else throw new Error(_0xedf6ae[_0x13b7(0x26)]||_0xdb144b[_0x13b7(0x7a)]);}switch(_0x2ee072){case _0xdb144b['mHsPC']:return{'id':_0xedf6ae['id'],'username':_0xedf6ae[_0x13b7(0x7b)]};case _0xdb144b['DvmKq']:return{'id':_0xedf6ae[_0x13b7(0x7c)][0x0]['id'],'username':_0xedf6ae['items'][0x0]['snippet'][_0x13b7(0x7d)]};case'pinterest':return{'id':_0xedf6ae['id'],'username':_0xedf6ae[_0x13b7(0x7b)]||_0xedf6ae['full_name']};case _0xdb144b[_0x13b7(0x75)]:return{'id':_0xedf6ae['id'],'username':_0xedf6ae[_0x13b7(0x7e)]};default:throw new Error(_0x13b7(0x3e)+_0x2ee072);}}catch(_0x1f3fc8){console[_0x13b7(0x26)]('Error\x20fetching\x20user\x20info\x20('+_0x2ee072+'):',_0x1f3fc8);throw _0x1f3fc8;}},connectPlatform=_0x3599c2=>{const _0x351885={'zsiEI':_0x13b7(0x6f),'BzKvm':_0x13b7(0x7f),'vNffj':'client_id','zkfbC':_0x13b7(0x48),'JVvji':_0x13b7(0x49),'bozVS':_0x13b7(0x4a),'PPuik':_0x13b7(0x25),'ECAMG':function(_0x83a86a,_0x67add6){return _0x83a86a!==_0x67add6;},'PWsTi':_0x13b7(0x80),'SLpKH':function(_0x28102c,_0x58e7b3){return _0x28102c(_0x58e7b3);}};return new Promise((_0x4ebb64,_0x3ebfc4)=>{if(_0x351885[_0x13b7(0x81)]!==_0x351885[_0x13b7(0x81)])return _0x55448d[_0x13b7(0x26)](_0x13b7(0x82)+_0x103094+'):',_0x56d088),![];else try{const _0xb60ad1=OAUTH_CONFIGS[_0x3599c2];if(!_0xb60ad1)throw new Error(_0x13b7(0x3e)+_0x3599c2);const _0x19d188=generateState(),_0x47d062=new URL(_0xb60ad1[_0x13b7(0x62)]);_0x47d062[_0x13b7(0x30)]['append'](_0x351885[_0x13b7(0x83)],_0xb60ad1[_0x13b7(0x58)]),_0x47d062[_0x13b7(0x30)][_0x13b7(0x63)](_0x351885['zkfbC'],_0xb60ad1[_0x13b7(0x57)]),_0x47d062[_0x13b7(0x30)][_0x13b7(0x63)](_0x351885[_0x13b7(0x84)],_0xb60ad1['responseType']),_0x47d062[_0x13b7(0x30)][_0x13b7(0x63)](_0x351885[_0x13b7(0x85)],_0xb60ad1[_0x13b7(0x4a)]),_0x47d062[_0x13b7(0x30)][_0x13b7(0x63)](_0x351885[_0x13b7(0x86)],_0x19d188),currentOAuthState=_0x19d188,currentOAuthPlatform=_0x3599c2,currentOAuthResolve=_0x4ebb64,currentOAuthReject=_0x3ebfc4,_reactNative[_0x13b7(0x1a)][_0x13b7(0x69)](_0x47d062[_0x13b7(0x87)]());}catch(_0x28723d){if(_0x351885[_0x13b7(0x88)](_0x351885[_0x13b7(0x89)],_0x351885[_0x13b7(0x89)]))throw new _0x381b69(_0xe7e00d[_0x13b7(0x26)]||_0x351885[_0x13b7(0x8a)]);else _0x351885['SLpKH'](_0x3ebfc4,_0x28723d);}});};exports[_0x13b7(0x4)]=connectPlatform;const disconnectPlatform=async(_0x3bc0f8,_0x2a6f25)=>{const _0x482300={'JbEKb':_0x13b7(0x29),'fpHDz':function(_0x3f8564,_0x3745e3){return _0x3f8564(_0x3745e3);},'TKrNN':_0x13b7(0x8b),'FQmap':function(_0x4b7abc,_0x3e6630){return _0x4b7abc in _0x3e6630;},'BPmWC':function(_0x157777,_0x3db20a){return _0x157777!==_0x3db20a;},'zOpFw':function(_0x458f42,_0x5a07b7){return _0x458f42!==_0x5a07b7;},'uPQKO':_0x13b7(0x8c),'VjNqv':_0x13b7(0x8d)};try{await _api[_0x13b7(0x8e)][_0x13b7(0x8f)](_0x482300['TKrNN'],{'platform':_0x3bc0f8,'username':_0x2a6f25['username']});const _0x5b7895={..._0x2a6f25[_0x13b7(0x90)]};return _0x5b7895&&_0x482300['FQmap'](_0x3bc0f8,_0x5b7895)&&(_0x482300['BPmWC'](_0x13b7(0x91),'JuyyD')?delete _0x5b7895[_0x3bc0f8]:_0x3259ff&&_0x1d8b7b(new _0x281bab(_0x482300['JbEKb']))),await(0x0,_secureStorage['updateCredentials'])({..._0x2a6f25,'platforms':_0x5b7895}),!![];}catch(_0x78f088){if(_0x482300[_0x13b7(0x92)](_0x482300[_0x13b7(0x93)],_0x482300[_0x13b7(0x94)]))return console[_0x13b7(0x26)](_0x13b7(0x95)+_0x3bc0f8+'):',_0x78f088),![];else _0x482300[_0x13b7(0x96)](_0x47a994,new _0x1b3e4a('OAuth\x20error:\x20'+_0x57bead));}};exports[_0x13b7(0x3)]=disconnectPlatform;const storePlatformConnection=async(_0x1fc503,_0x16eb26,_0x3e1fc9)=>{const _0xd4038d={'URsFz':function(_0x20d0ef,_0x167791){return _0x20d0ef(_0x167791);},'MchxB':_0x13b7(0x97),'YlBAV':function(_0x283e81,_0x412e78){return _0x283e81===_0x412e78;},'IyUDC':_0x13b7(0x6b),'IiNQt':'youtube','CjYvS':'pinterest','kDTnJ':function(_0x13378f,_0x146acb){return _0x13378f!==_0x146acb;},'FMJyM':_0x13b7(0x98),'tTasj':function(_0x38d398,_0xcfb099){return _0x38d398*_0xcfb099;},'QKNag':function(_0x31dc31,_0x2a04a9){return _0x31dc31===_0x2a04a9;},'qkGgB':function(_0x391394,_0x5649b2){return _0x391394===_0x5649b2;},'gQcDJ':_0x13b7(0x99)};try{if(_0xd4038d['YlBAV'](_0x13b7(0x9a),'anzVC')){const _0x14be7e=_0xd4038d[_0x13b7(0x9b)](_0x1fc503,_0xd4038d[_0x13b7(0x9c)])||_0xd4038d[_0x13b7(0x9b)](_0x1fc503,_0xd4038d[_0x13b7(0x9d)])||_0xd4038d[_0x13b7(0x9b)](_0x1fc503,_0xd4038d['CjYvS'])||_0xd4038d[_0x13b7(0x9b)](_0x1fc503,_0x13b7(0x99));if(!_0x14be7e){if(_0xd4038d['kDTnJ'](_0xd4038d[_0x13b7(0x9e)],_0xd4038d[_0x13b7(0x9e)]))return _0x146f0a['error'](_0x13b7(0x95)+_0x14187b+'):',_0x57e85f),![];else throw new Error(_0x13b7(0x3e)+_0x1fc503);}const _0xf6c65b={..._0x3e1fc9[_0x13b7(0x90)]},_0x30663a={'username':_0x16eb26[_0x13b7(0x7b)],'userId':_0x16eb26[_0x13b7(0x9f)],'token':_0x16eb26[_0x13b7(0xa0)],'refreshToken':_0x16eb26[_0x13b7(0xa1)],'expiresAt':_0x16eb26['expiresIn']?Date[_0x13b7(0xa2)]()+_0xd4038d[_0x13b7(0xa3)](_0x16eb26[_0x13b7(0xa4)],0x3e8):null,'connectedAt':Date[_0x13b7(0xa2)]()};if(_0xd4038d[_0x13b7(0x9b)](_0x1fc503,_0xd4038d[_0x13b7(0x9c)]))_0xf6c65b[_0x13b7(0x6b)]=_0x30663a;else{if(_0xd4038d[_0x13b7(0xa5)](_0x1fc503,_0xd4038d[_0x13b7(0x9d)]))_0xf6c65b[_0x13b7(0xa6)]=_0x30663a;else{if(_0x1fc503===_0xd4038d[_0x13b7(0xa7)])_0xf6c65b[_0x13b7(0xa8)]=_0x30663a;else{if(_0xd4038d[_0x13b7(0xa9)](_0x1fc503,_0xd4038d[_0x13b7(0xaa)]))_0xf6c65b[_0x13b7(0x99)]=_0x30663a;}}}return await(0x0,_secureStorage[_0x13b7(0xab)])({..._0x3e1fc9,'platforms':_0xf6c65b}),!![];}else _0xd4038d[_0x13b7(0xac)](_0x105557,new _0x2aeb77(_0xd4038d['MchxB']));}catch(_0x594fe7){return console[_0x13b7(0x26)](_0x13b7(0x82)+_0x1fc503+'):',_0x594fe7),![];}};function _0x103c(){const _0x18d9cb=['defineProperty','storePlatformConnection','initializeOAuthService','disconnectPlatform','connectPlatform','cleanupOAuthService','OAuthService','YOUR_INSTAGRAM_CLIENT_ID','onairosanime://auth/instagram','user_profile,user_media','https://api.instagram.com/oauth/access_token','onairosanime://auth/youtube','https://www.googleapis.com/auth/youtube.readonly','https://oauth2.googleapis.com/token','code','onairosanime://auth/pinterest','boards:read,pins:read','https://www.pinterest.com/oauth/','https://api.pinterest.com/v5/oauth/token','YOUR_REDDIT_CLIENT_ID','onairosanime://auth/reddit','https://www.reddit.com/api/v1/authorize','random','substring','sha256','url','Linking','addEventListener','function','AQcHP','removeAllListeners','yNKnZ','bwQwD','icobX','OpFIw','Error\x20handling\x20OAuth\x20deep\x20link:','onairosanime://auth/','state','error','geYtH','ZnDLg','No\x20authorization\x20code\x20received','GdETm','DTDMV','Tewhh','startsWith','kpGlq','split','searchParams','get','tliWZ','EDAla','VxWmO','jnhXt','cMnDa','NTbGf','ltYMK','OAuth\x20error:\x20','qmBgV','bBwpP','cyuPp','rkARI','Unsupported\x20platform:\x20','nZlRU','uuyZR','BNZQk','LxCXO','AWRXs','FGEzr','qGKbm','dYSgg','client_id','redirect_uri','response_type','scope','EYIzg','zJbog','trwZS','authorization_code','application/x-www-form-urlencoded','amtRA','uycVp','GEyFd','LdZhD','zxNtF','Error\x20exchanging\x20code\x20for\x20token\x20(','bsczF','redirectUri','clientId','zVgfm','tokenEndpoint','json','Failed\x20to\x20exchange\x20code\x20for\x20token','access_token','refresh_token','Error\x20fetching\x20user\x20info\x20(','MbDFD','ysOns','authorizationEndpoint','append','dpyRt','cLypT','responseType','fRZjQ','KKyrK','openURL','LOuDd','instagram','https://www.googleapis.com/youtube/v3/channels?part=snippet&mine=true','https://api.pinterest.com/v5/user_account','VTeER','Failed\x20to\x20fetch\x20user\x20info','Bearer\x20','mHsPC','xYiGB','OPsms','Wporv','TzFXd','Khouf','Gpmmn','vZXhb','SqoNH','NSXos','username','items','title','name','JhphR','lYgAo','BzKvm','Error\x20storing\x20platform\x20connection\x20(','vNffj','JVvji','bozVS','PPuik','toString','ECAMG','PWsTi','zsiEI','/users/disconnect-platform','oyxCP','sxVDF','onairosApi','post','platforms','RxREN','zOpFw','uPQKO','VjNqv','Error\x20disconnecting\x20platform\x20(','fpHDz','OAuth\x20state\x20mismatch\x20-\x20possible\x20CSRF\x20attack','meOLz','reddit','anzVC','YlBAV','IyUDC','IiNQt','FMJyM','userId','token','refreshToken','now','tTasj','expiresIn','QKNag','youtube','CjYvS','pinterest','qkGgB','gQcDJ','updateCredentials','URsFz','API_CONFIG'];_0x103c=function(){return _0x18d9cb;};return _0x103c();}exports[_0x13b7(0x1)]=storePlatformConnection;const OAuthService=exports[_0x13b7(0x6)]={'initializeOAuthService':initializeOAuthService,'cleanupOAuthService':cleanupOAuthService,'connectPlatform':connectPlatform,'disconnectPlatform':disconnectPlatform,'storePlatformConnection':storePlatformConnection,'_apiBaseUrl':''+_api2[_0x13b7(0xad)]['BASE_URL']};
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.storePlatformConnection = exports.initializeOAuthService = exports.disconnectPlatform = exports.connectPlatform = exports.cleanupOAuthService = exports.OAuthService = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _secureStorage = require("../utils/secureStorage");
9
+ var _crypto = require("../utils/crypto");
10
+ var _api = require("../api");
11
+ var _api2 = require("../config/api");
12
+ // Define OAuth configuration types
13
+
14
+ // Platform-specific OAuth configurations
15
+ const OAUTH_CONFIGS = {
16
+ instagram: {
17
+ clientId: 'YOUR_INSTAGRAM_CLIENT_ID',
18
+ // Replace with actual client ID
19
+ redirectUri: 'onairosanime://auth/instagram',
20
+ scope: 'user_profile,user_media',
21
+ authorizationEndpoint: 'https://api.instagram.com/oauth/authorize',
22
+ tokenEndpoint: 'https://api.instagram.com/oauth/access_token',
23
+ responseType: 'code'
24
+ },
25
+ youtube: {
26
+ clientId: 'YOUR_YOUTUBE_CLIENT_ID',
27
+ // Replace with actual client ID
28
+ redirectUri: 'onairosanime://auth/youtube',
29
+ scope: 'https://www.googleapis.com/auth/youtube.readonly',
30
+ authorizationEndpoint: 'https://accounts.google.com/o/oauth2/auth',
31
+ tokenEndpoint: 'https://oauth2.googleapis.com/token',
32
+ responseType: 'code'
33
+ },
34
+ pinterest: {
35
+ clientId: 'YOUR_PINTEREST_CLIENT_ID',
36
+ // Replace with actual client ID
37
+ redirectUri: 'onairosanime://auth/pinterest',
38
+ scope: 'boards:read,pins:read',
39
+ authorizationEndpoint: 'https://www.pinterest.com/oauth/',
40
+ tokenEndpoint: 'https://api.pinterest.com/v5/oauth/token',
41
+ responseType: 'code'
42
+ },
43
+ reddit: {
44
+ clientId: 'YOUR_REDDIT_CLIENT_ID',
45
+ // Replace with actual client ID
46
+ redirectUri: 'onairosanime://auth/reddit',
47
+ scope: 'identity,read',
48
+ authorizationEndpoint: 'https://www.reddit.com/api/v1/authorize',
49
+ tokenEndpoint: 'https://www.reddit.com/api/v1/access_token',
50
+ responseType: 'code'
51
+ }
52
+ };
53
+
54
+ /**
55
+ * Generate a state value for OAuth to prevent CSRF attacks
56
+ */
57
+ const generateState = () => {
58
+ const randomValue = Math.random().toString(36).substring(2, 15);
59
+ return (0, _crypto.sha256)(randomValue).substring(0, 10);
60
+ };
61
+
62
+ /**
63
+ * Initialize OAuth service handlers and listeners
64
+ */
65
+ const initializeOAuthService = () => {
66
+ // Set up deep linking handlers for OAuth redirects
67
+ _reactNative.Linking.addEventListener('url', handleDeepLink);
68
+ };
69
+
70
+ /**
71
+ * Clean up OAuth service handlers and listeners
72
+ */
73
+ exports.initializeOAuthService = initializeOAuthService;
74
+ const cleanupOAuthService = () => {
75
+ // Use the modern React Native Linking API
76
+ if (typeof _reactNative.Linking.removeAllListeners === 'function') {
77
+ _reactNative.Linking.removeAllListeners('url');
78
+ }
79
+ };
80
+
81
+ // Keep track of current OAuth state and callbacks
82
+ exports.cleanupOAuthService = cleanupOAuthService;
83
+ let currentOAuthState = null;
84
+ let currentOAuthPlatform = null;
85
+ let currentOAuthResolve = null;
86
+ let currentOAuthReject = null;
87
+
88
+ /**
89
+ * Handle deep link callbacks from OAuth providers
90
+ */
91
+ const handleDeepLink = async event => {
92
+ try {
93
+ const {
94
+ url
95
+ } = event;
96
+
97
+ // Check if this is an OAuth callback URL
98
+ if (!url.startsWith('onairosanime://auth/')) {
99
+ return;
100
+ }
101
+
102
+ // Extract platform from URL path
103
+ const platform = url.split('onairosanime://auth/')[1].split('?')[0];
104
+
105
+ // Only handle if it matches current OAuth flow
106
+ if (platform !== currentOAuthPlatform) {
107
+ return;
108
+ }
109
+
110
+ // Parse URL parameters
111
+ const params = new URL(url).searchParams;
112
+ const code = params.get('code');
113
+ const state = params.get('state');
114
+ const error = params.get('error');
115
+
116
+ // Validate state to prevent CSRF attacks
117
+ if (state !== currentOAuthState) {
118
+ if (currentOAuthReject) {
119
+ currentOAuthReject(new Error('OAuth state mismatch - possible CSRF attack'));
120
+ }
121
+ return;
122
+ }
123
+
124
+ // Handle errors
125
+ if (error) {
126
+ if (currentOAuthReject) {
127
+ currentOAuthReject(new Error(`OAuth error: ${error}`));
128
+ }
129
+ return;
130
+ }
131
+
132
+ // Proceed with token exchange if code is present
133
+ if (code) {
134
+ const tokenResult = await exchangeCodeForToken(platform, code);
135
+ if (currentOAuthResolve) {
136
+ currentOAuthResolve(tokenResult);
137
+ }
138
+ } else {
139
+ if (currentOAuthReject) {
140
+ currentOAuthReject(new Error('No authorization code received'));
141
+ }
142
+ }
143
+ } catch (error) {
144
+ console.error('Error handling OAuth deep link:', error);
145
+ if (currentOAuthReject) {
146
+ currentOAuthReject(error);
147
+ }
148
+ } finally {
149
+ // Reset state
150
+ currentOAuthState = null;
151
+ currentOAuthPlatform = null;
152
+ currentOAuthResolve = null;
153
+ currentOAuthReject = null;
154
+ }
155
+ };
156
+
157
+ /**
158
+ * Exchange OAuth authorization code for access token
159
+ */
160
+ const exchangeCodeForToken = async (platform, code) => {
161
+ try {
162
+ const config = OAUTH_CONFIGS[platform];
163
+ if (!config) {
164
+ throw new Error(`Unsupported platform: ${platform}`);
165
+ }
166
+
167
+ // Prepare token request parameters
168
+ const params = new URLSearchParams({
169
+ grant_type: 'authorization_code',
170
+ code,
171
+ redirect_uri: config.redirectUri,
172
+ client_id: config.clientId
173
+ });
174
+
175
+ // Exchange code for token
176
+ const response = await fetch(config.tokenEndpoint, {
177
+ method: 'POST',
178
+ headers: {
179
+ 'Content-Type': 'application/x-www-form-urlencoded'
180
+ },
181
+ body: params.toString()
182
+ });
183
+ const data = await response.json();
184
+ if (!response.ok) {
185
+ throw new Error(data.error || 'Failed to exchange code for token');
186
+ }
187
+
188
+ // Fetch user information based on the platform
189
+ const userInfo = await fetchUserInfo(platform, data.access_token);
190
+ return {
191
+ token: data.access_token,
192
+ refreshToken: data.refresh_token,
193
+ expiresIn: data.expires_in,
194
+ username: userInfo.username,
195
+ userId: userInfo.id
196
+ };
197
+ } catch (error) {
198
+ console.error(`Error exchanging code for token (${platform}):`, error);
199
+ throw error;
200
+ }
201
+ };
202
+
203
+ /**
204
+ * Fetch user information from the connected platform
205
+ */
206
+ const fetchUserInfo = async (platform, accessToken) => {
207
+ try {
208
+ let endpoint;
209
+ let headers = {
210
+ Authorization: `Bearer ${accessToken}`
211
+ };
212
+
213
+ // Platform-specific API endpoints for user info
214
+ switch (platform) {
215
+ case 'instagram':
216
+ endpoint = 'https://graph.instagram.com/me?fields=id,username';
217
+ break;
218
+ case 'youtube':
219
+ endpoint = 'https://www.googleapis.com/youtube/v3/channels?part=snippet&mine=true';
220
+ break;
221
+ case 'pinterest':
222
+ endpoint = 'https://api.pinterest.com/v5/user_account';
223
+ break;
224
+ case 'reddit':
225
+ endpoint = 'https://oauth.reddit.com/api/v1/me';
226
+ break;
227
+ default:
228
+ throw new Error(`Unsupported platform: ${platform}`);
229
+ }
230
+ const response = await fetch(endpoint, {
231
+ headers
232
+ });
233
+ const data = await response.json();
234
+ if (!response.ok) {
235
+ throw new Error(data.error || 'Failed to fetch user info');
236
+ }
237
+
238
+ // Extract user information based on platform-specific response format
239
+ switch (platform) {
240
+ case 'instagram':
241
+ return {
242
+ id: data.id,
243
+ username: data.username
244
+ };
245
+ case 'youtube':
246
+ return {
247
+ id: data.items[0].id,
248
+ username: data.items[0].snippet.title
249
+ };
250
+ case 'pinterest':
251
+ return {
252
+ id: data.id,
253
+ username: data.username || data.full_name
254
+ };
255
+ case 'reddit':
256
+ return {
257
+ id: data.id,
258
+ username: data.name
259
+ };
260
+ default:
261
+ throw new Error(`Unsupported platform: ${platform}`);
262
+ }
263
+ } catch (error) {
264
+ console.error(`Error fetching user info (${platform}):`, error);
265
+ throw error;
266
+ }
267
+ };
268
+
269
+ /**
270
+ * Connect to a platform using OAuth
271
+ */
272
+ const connectPlatform = platform => {
273
+ return new Promise((resolve, reject) => {
274
+ try {
275
+ const config = OAUTH_CONFIGS[platform];
276
+ if (!config) {
277
+ throw new Error(`Unsupported platform: ${platform}`);
278
+ }
279
+
280
+ // Generate state for CSRF protection
281
+ const state = generateState();
282
+
283
+ // Build authorization URL
284
+ const authUrl = new URL(config.authorizationEndpoint);
285
+ authUrl.searchParams.append('client_id', config.clientId);
286
+ authUrl.searchParams.append('redirect_uri', config.redirectUri);
287
+ authUrl.searchParams.append('response_type', config.responseType);
288
+ authUrl.searchParams.append('scope', config.scope);
289
+ authUrl.searchParams.append('state', state);
290
+
291
+ // Set up current OAuth state for callback handling
292
+ currentOAuthState = state;
293
+ currentOAuthPlatform = platform;
294
+ currentOAuthResolve = resolve;
295
+ currentOAuthReject = reject;
296
+
297
+ // Open browser or WebView to the authorization URL
298
+ _reactNative.Linking.openURL(authUrl.toString());
299
+ } catch (error) {
300
+ reject(error);
301
+ }
302
+ });
303
+ };
304
+
305
+ /**
306
+ * Disconnect from a platform
307
+ */
308
+ exports.connectPlatform = connectPlatform;
309
+ const disconnectPlatform = async (platform, credentials) => {
310
+ try {
311
+ // Call Onairos API to disconnect platform
312
+ await _api.onairosApi.post('/users/disconnect-platform', {
313
+ platform,
314
+ username: credentials.username
315
+ });
316
+
317
+ // Update local credentials to remove platform
318
+ const updatedPlatforms = {
319
+ ...credentials.platforms
320
+ };
321
+
322
+ // Type-safe platform removal using keyof operator
323
+ if (updatedPlatforms && platform in updatedPlatforms) {
324
+ delete updatedPlatforms[platform];
325
+ }
326
+ await (0, _secureStorage.updateCredentials)({
327
+ ...credentials,
328
+ platforms: updatedPlatforms
329
+ });
330
+ return true;
331
+ } catch (error) {
332
+ console.error(`Error disconnecting platform (${platform}):`, error);
333
+ return false;
334
+ }
335
+ };
336
+
337
+ /**
338
+ * Store platform connection data in user credentials
339
+ */
340
+ exports.disconnectPlatform = disconnectPlatform;
341
+ const storePlatformConnection = async (platform, connectionData, credentials) => {
342
+ try {
343
+ // Only accept valid platform types
344
+ const validPlatform = platform === 'instagram' || platform === 'youtube' || platform === 'pinterest' || platform === 'reddit';
345
+ if (!validPlatform) {
346
+ throw new Error(`Unsupported platform: ${platform}`);
347
+ }
348
+
349
+ // Update platforms in credentials with type safety
350
+ const updatedPlatforms = {
351
+ ...credentials.platforms
352
+ };
353
+
354
+ // Type-safe assignment
355
+ const platformData = {
356
+ username: connectionData.username,
357
+ userId: connectionData.userId,
358
+ token: connectionData.token,
359
+ refreshToken: connectionData.refreshToken,
360
+ expiresAt: connectionData.expiresIn ? Date.now() + connectionData.expiresIn * 1000 : null,
361
+ connectedAt: Date.now()
362
+ };
363
+
364
+ // Assign platform data based on platform type
365
+ if (platform === 'instagram') updatedPlatforms.instagram = platformData;else if (platform === 'youtube') updatedPlatforms.youtube = platformData;else if (platform === 'pinterest') updatedPlatforms.pinterest = platformData;else if (platform === 'reddit') updatedPlatforms.reddit = platformData;
366
+
367
+ // Update stored credentials
368
+ await (0, _secureStorage.updateCredentials)({
369
+ ...credentials,
370
+ platforms: updatedPlatforms
371
+ });
372
+ return true;
373
+ } catch (error) {
374
+ console.error(`Error storing platform connection (${platform}):`, error);
375
+ return false;
376
+ }
377
+ };
378
+ exports.storePlatformConnection = storePlatformConnection;
379
+ /**
380
+ * Service for handling OAuth connections to various platforms
381
+ */
382
+ const OAuthService = exports.OAuthService = {
383
+ initializeOAuthService,
384
+ cleanupOAuthService,
385
+ connectPlatform,
386
+ disconnectPlatform,
387
+ storePlatformConnection,
388
+ // Base API URL
389
+ _apiBaseUrl: `${_api2.API_CONFIG.BASE_URL}`
390
+ };
391
+ //# sourceMappingURL=oauthService.js.map
@@ -5,4 +5,4 @@ var __ONAIROS_REQ_REGISTRY__ = [
5
5
  require('react-native-crypto-js')
6
6
  ];
7
7
  function __ONAIROS_REQ_FUNC__(i) { return __ONAIROS_REQ_REGISTRY__[i]; }
8
- Object['defineProperty'](exports,_0xb2d1(0x0),{'value':!![]}),exports[_0xb2d1(0x1)]=exports['getEncryptedPinForAPI']=exports[_0xb2d1(0x2)]=exports[_0xb2d1(0x3)]=void 0x0;function _0x29b0(){const _0x20da3e=['__esModule','hashPin','encryptPin','decryptPin','🔐\x20PIN\x20encrypted\x20successfully','❌\x20Error\x20encrypting\x20PIN:','qRdeI','YMqew','encrypt','toString','log','uVHTu','AES','error','nZDQb','🔒\x20PIN\x20hashed\x20successfully','yucbi','Rwfmo','🔓\x20PIN\x20decrypted\x20successfully','ihOBF','❌\x20Error\x20decrypting\x20PIN:','MMXXD','oIbWA','YLVeJ','decrypt','enc','Utf8','viQqt','uwtvn','NIXSF','gqaGQ','SHA256','ezrAC','⚠️\x20No\x20temporary\x20PIN\x20available\x20for\x20encryption','vNRMB','ZzUOo','✅\x20PIN\x20encrypted\x20for\x20API\x20transmission','wCUSC','HnWfN','getTemporaryPin','trECo','KRArL','❌\x20Error\x20getting\x20encrypted\x20PIN\x20for\x20API:','UAvhB','WAkzl','getEncryptedPinForAPI','❌\x20Error\x20hashing\x20PIN:','UfsxZ'];_0x29b0=function(){return _0x20da3e;};return _0x29b0();}var _pinStorageUtils=__ONAIROS_REQ_FUNC__(0x0);const CryptoJS=__ONAIROS_REQ_FUNC__(0x1),ENCRYPTION_KEY='onairos-pin-encryption-key-2024',encryptPin=_0x3b5f45=>{const _0x3823b2={'uVHTu':_0xb2d1(0x4),'qRdeI':function(_0x14d155,_0x1b3bc9){return _0x14d155===_0x1b3bc9;},'nZDQb':_0xb2d1(0x5)};try{if(_0x3823b2[_0xb2d1(0x6)](_0xb2d1(0x7),_0xb2d1(0x7))){const _0x47f09=CryptoJS['AES'][_0xb2d1(0x8)](_0x3b5f45,ENCRYPTION_KEY)[_0xb2d1(0x9)]();return console[_0xb2d1(0xa)](_0x3823b2[_0xb2d1(0xb)]),_0x47f09;}else try{const _0x3269f8=_0x54340e[_0xb2d1(0xc)][_0xb2d1(0x8)](_0x9a2fe9,_0x1ae77f)[_0xb2d1(0x9)]();return _0x5db476['log'](_0x3823b2[_0xb2d1(0xb)]),_0x3269f8;}catch(_0x57ee3d){_0x55fad7[_0xb2d1(0xd)]('❌\x20Error\x20encrypting\x20PIN:',_0x57ee3d);throw _0x57ee3d;}}catch(_0x3b90de){console[_0xb2d1(0xd)](_0x3823b2[_0xb2d1(0xe)],_0x3b90de);throw _0x3b90de;}};exports[_0xb2d1(0x2)]=encryptPin;const decryptPin=_0xf3c79f=>{const _0x171ab3={'uxUpF':'❌\x20Error\x20encrypting\x20PIN:','ezrAC':_0xb2d1(0xf),'MMXXD':function(_0x1fc206,_0x1a4fea){return _0x1fc206!==_0x1a4fea;},'oIbWA':_0xb2d1(0x10),'YLVeJ':_0xb2d1(0x11),'viQqt':_0xb2d1(0x12),'uwtvn':function(_0x5c93da,_0x2a8df9){return _0x5c93da===_0x2a8df9;},'NIXSF':_0xb2d1(0x13),'gqaGQ':_0xb2d1(0x14)};try{if(_0x171ab3[_0xb2d1(0x15)](_0x171ab3[_0xb2d1(0x16)],_0x171ab3[_0xb2d1(0x17)])){const _0x4a12b8=CryptoJS[_0xb2d1(0xc)][_0xb2d1(0x18)](_0xf3c79f,ENCRYPTION_KEY),_0x8379eb=_0x4a12b8['toString'](CryptoJS[_0xb2d1(0x19)][_0xb2d1(0x1a)]);return console[_0xb2d1(0xa)](_0x171ab3[_0xb2d1(0x1b)]),_0x8379eb;}else{_0x21be8f[_0xb2d1(0xd)](_0x171ab3['uxUpF'],_0x47508a);throw _0x3ef686;}}catch(_0x46f62c){if(_0x171ab3[_0xb2d1(0x1c)](_0x171ab3['NIXSF'],_0x171ab3[_0xb2d1(0x1d)])){console[_0xb2d1(0xd)](_0x171ab3[_0xb2d1(0x1e)],_0x46f62c);throw _0x46f62c;}else{const _0x131c2a=_0x3f050c[_0xb2d1(0x1f)](_0x103228+_0x5c3178)[_0xb2d1(0x9)]();return _0x1f4d99[_0xb2d1(0xa)](_0x171ab3[_0xb2d1(0x20)]),_0x131c2a;}}};function _0xb2d1(_0x29b0d2,_0xb2d183){_0x29b0d2=_0x29b0d2-0x0;const _0x5c56e7=_0x29b0();let _0x3b70f1=_0x5c56e7[_0x29b0d2];return _0x3b70f1;}exports[_0xb2d1(0x3)]=decryptPin;const getEncryptedPinForAPI=async()=>{const _0x37e4bb={'trECo':_0xb2d1(0x21),'KRArL':function(_0x48c161,_0xb7bbc7){return _0x48c161(_0xb7bbc7);},'wCUSC':function(_0x453155,_0x282ace){return _0x453155===_0x282ace;},'HnWfN':_0xb2d1(0x22),'UAvhB':_0xb2d1(0x23),'WAkzl':_0xb2d1(0x24)};try{if(_0x37e4bb[_0xb2d1(0x25)](_0x37e4bb[_0xb2d1(0x26)],'xFBBn'))try{const _0x640fc8=(0x0,_0x20a8c3[_0xb2d1(0x27)])();if(!_0x640fc8)return _0x3d09d2[_0xb2d1(0xa)](_0x37e4bb[_0xb2d1(0x28)]),null;const _0x5e0570=_0x37e4bb[_0xb2d1(0x29)](_0x34e07b,_0x640fc8);return _0x2e3227[_0xb2d1(0xa)](_0xb2d1(0x24)),_0x5e0570;}catch(_0x50e413){return _0x13be6e['error'](_0xb2d1(0x2a),_0x50e413),null;}else{const _0x376f38=(0x0,_pinStorageUtils[_0xb2d1(0x27)])();if(!_0x376f38)return _0x37e4bb['wCUSC']('lWmDE',_0x37e4bb[_0xb2d1(0x2b)])?(_0x546d44[_0xb2d1(0xa)](_0x37e4bb['trECo']),null):(console[_0xb2d1(0xa)](_0xb2d1(0x21)),null);const _0x2b8023=_0x37e4bb[_0xb2d1(0x29)](encryptPin,_0x376f38);return console[_0xb2d1(0xa)](_0x37e4bb[_0xb2d1(0x2c)]),_0x2b8023;}}catch(_0x51148d){return console[_0xb2d1(0xd)](_0xb2d1(0x2a),_0x51148d),null;}};exports[_0xb2d1(0x2d)]=getEncryptedPinForAPI;const hashPin=_0x232c09=>{const _0x163d92={'qnLrz':function(_0x18d0f6,_0x195c7f){return _0x18d0f6+_0x195c7f;},'UfsxZ':_0xb2d1(0x2e)};try{const _0x2d2194=CryptoJS[_0xb2d1(0x1f)](_0x163d92['qnLrz'](_0x232c09,ENCRYPTION_KEY))[_0xb2d1(0x9)]();return console['log'](_0xb2d1(0xf)),_0x2d2194;}catch(_0x167a20){console[_0xb2d1(0xd)](_0x163d92[_0xb2d1(0x2f)],_0x167a20);throw _0x167a20;}};exports[_0xb2d1(0x1)]=hashPin;
8
+ Object[_0x152e(0x0)](exports,'__esModule',{'value':!![]}),exports[_0x152e(0x1)]=exports[_0x152e(0x2)]=exports[_0x152e(0x3)]=exports[_0x152e(0x4)]=void 0x0;var _pinStorageUtils=__ONAIROS_REQ_FUNC__(0x0);const CryptoJS=__ONAIROS_REQ_FUNC__(0x1),ENCRYPTION_KEY=_0x152e(0x5),encryptPin=_0x1fa9d2=>{const _0x4beedd={'LImtm':_0x152e(0x6),'QulWY':_0x152e(0x7),'lHxGH':'✅\x20PIN\x20encrypted\x20for\x20API\x20transmission','DSprU':_0x152e(0x8),'gMUMa':function(_0x39c79f,_0x434c08){return _0x39c79f!==_0x434c08;},'LCqCo':'lnxri','yElns':_0x152e(0x9),'xILTv':function(_0x57b89e,_0x36a74f){return _0x57b89e!==_0x36a74f;},'CereD':_0x152e(0xa),'HIJEj':'SHQNU'};try{if(_0x4beedd['gMUMa'](_0x4beedd[_0x152e(0xb)],_0x4beedd[_0x152e(0xb)])){const _0x424237=_0x112116[_0x152e(0xc)][_0x152e(0xd)](_0x41a55c,_0x1ec397),_0x423b51=_0x424237[_0x152e(0xe)](_0x377c09[_0x152e(0xf)]['Utf8']);return _0x424114[_0x152e(0x10)](_0x4beedd[_0x152e(0x11)]),_0x423b51;}else{const _0x4e7863=CryptoJS[_0x152e(0xc)]['encrypt'](_0x1fa9d2,ENCRYPTION_KEY)[_0x152e(0xe)]();return console[_0x152e(0x10)](_0x4beedd[_0x152e(0x12)]),_0x4e7863;}}catch(_0x165ea){if(_0x4beedd[_0x152e(0x13)](_0x4beedd['CereD'],_0x4beedd[_0x152e(0x14)])){console['error']('❌\x20Error\x20encrypting\x20PIN:',_0x165ea);throw _0x165ea;}else try{const _0x121999=(0x0,_0x1e3768['getTemporaryPin'])();if(!_0x121999)return _0x506bcb['log'](_0x4beedd[_0x152e(0x15)]),null;const _0x486e2d=_0x3c06ce(_0x121999);return _0x1b46ff[_0x152e(0x10)](_0x4beedd['lHxGH']),_0x486e2d;}catch(_0x420f57){return _0x35fc2d['error'](_0x4beedd['DSprU'],_0x420f57),null;}}};exports['encryptPin']=encryptPin;function _0x52a8(){const _0x1e5c42=['defineProperty','hashPin','getEncryptedPinForAPI','encryptPin','decryptPin','onairos-pin-encryption-key-2024','🔓\x20PIN\x20decrypted\x20successfully','⚠️\x20No\x20temporary\x20PIN\x20available\x20for\x20encryption','❌\x20Error\x20getting\x20encrypted\x20PIN\x20for\x20API:','🔐\x20PIN\x20encrypted\x20successfully','YoAzX','LCqCo','AES','decrypt','toString','enc','log','LImtm','yElns','xILTv','HIJEj','QulWY','dbycw','IDygk','GLsmC','Utf8','MeRCb','getTemporaryPin','✅\x20PIN\x20encrypted\x20for\x20API\x20transmission','uKYKz','PSbpI','UNNop','error','NShQQ','vuCAv','JPlWM','gynXD','vjIeZ','❌\x20Error\x20encrypting\x20PIN:','🔒\x20PIN\x20hashed\x20successfully','❌\x20Error\x20hashing\x20PIN:','SHA256','NaFqz','jPHWH','cuxaJ','NRPKC','eyEGQ','encrypt','jFrMA'];_0x52a8=function(){return _0x1e5c42;};return _0x52a8();}const decryptPin=_0x252486=>{const _0x155dc3={'dbycw':function(_0x3df97c,_0x57a5a2){return _0x3df97c!==_0x57a5a2;},'MeRCb':'🔓\x20PIN\x20decrypted\x20successfully','JyuYl':'❌\x20Error\x20decrypting\x20PIN:'};try{if(_0x155dc3[_0x152e(0x16)](_0x152e(0x17),_0x152e(0x18))){const _0x3f1414=CryptoJS[_0x152e(0xc)][_0x152e(0xd)](_0x252486,ENCRYPTION_KEY),_0x4148e0=_0x3f1414[_0x152e(0xe)](CryptoJS[_0x152e(0xf)][_0x152e(0x19)]);return console['log'](_0x155dc3[_0x152e(0x1a)]),_0x4148e0;}else{const _0x4613d8=(0x0,_0x1fdac0[_0x152e(0x1b)])();if(!_0x4613d8)return _0x279983['log'](_0x152e(0x7)),null;const _0x1c6099=_0xbf863e(_0x4613d8);return _0xcf714b[_0x152e(0x10)](_0x152e(0x1c)),_0x1c6099;}}catch(_0x37a26d){console['error'](_0x155dc3['JyuYl'],_0x37a26d);throw _0x37a26d;}};exports[_0x152e(0x4)]=decryptPin;const getEncryptedPinForAPI=async()=>{const _0x45c36f={'NShQQ':_0x152e(0x8),'vjIeZ':_0x152e(0x9),'PSbpI':function(_0xcf3f77,_0x16fed7){return _0xcf3f77===_0x16fed7;},'qbcnB':_0x152e(0x1d),'vuCAv':function(_0x135435,_0x5eddad){return _0x135435!==_0x5eddad;},'JPlWM':'ySUdX','HUYGE':_0x152e(0x7),'NGwWz':function(_0x26dffa,_0x8aa157){return _0x26dffa(_0x8aa157);}};try{if(_0x45c36f[_0x152e(0x1e)](_0x45c36f['qbcnB'],_0x152e(0x1f)))return _0x5a1a36[_0x152e(0x20)](_0x45c36f[_0x152e(0x21)],_0x4a6b80),null;else{const _0x516a49=(0x0,_pinStorageUtils['getTemporaryPin'])();if(!_0x516a49){if(_0x45c36f[_0x152e(0x22)](_0x45c36f[_0x152e(0x23)],_0x152e(0x24)))return console[_0x152e(0x10)](_0x45c36f['HUYGE']),null;else try{const _0x460db1=_0x5d9cfa[_0x152e(0xc)]['encrypt'](_0x3c3a8c,_0x27b2ea)[_0x152e(0xe)]();return _0x27aa4c['log'](_0x45c36f[_0x152e(0x25)]),_0x460db1;}catch(_0xecbff6){_0x18e643[_0x152e(0x20)](_0x152e(0x26),_0xecbff6);throw _0xecbff6;}}const _0x46a9ff=_0x45c36f['NGwWz'](encryptPin,_0x516a49);return console['log'](_0x152e(0x1c)),_0x46a9ff;}}catch(_0xfca5a2){return console['error'](_0x45c36f[_0x152e(0x21)],_0xfca5a2),null;}};function _0x152e(_0x52a8e6,_0x152e59){_0x52a8e6=_0x52a8e6-0x0;const _0x543d5d=_0x52a8();let _0x5b7c35=_0x543d5d[_0x52a8e6];return _0x5b7c35;}exports[_0x152e(0x2)]=getEncryptedPinForAPI;const hashPin=_0x469b84=>{const _0xef8a70={'jFrMA':_0x152e(0x9),'ZaYhS':function(_0x47f6a9,_0x384114){return _0x47f6a9+_0x384114;},'NaFqz':_0x152e(0x27),'jPHWH':function(_0x425abb,_0x2b1a79){return _0x425abb!==_0x2b1a79;},'eyEGQ':_0x152e(0x28)};try{const _0x33d717=CryptoJS[_0x152e(0x29)](_0xef8a70['ZaYhS'](_0x469b84,ENCRYPTION_KEY))['toString']();return console['log'](_0xef8a70[_0x152e(0x2a)]),_0x33d717;}catch(_0x4c0f12){if(_0xef8a70[_0x152e(0x2b)](_0x152e(0x2c),_0x152e(0x2d))){console[_0x152e(0x20)](_0xef8a70[_0x152e(0x2e)],_0x4c0f12);throw _0x4c0f12;}else{const _0x2e0b6f=_0x1c3efb['AES'][_0x152e(0x2f)](_0x3799a7,_0x261a3a)[_0x152e(0xe)]();return _0x470247['log'](_0xef8a70[_0x152e(0x30)]),_0x2e0b6f;}}};exports[_0x152e(0x1)]=hashPin;
@@ -4,4 +4,4 @@ var __ONAIROS_REQ_REGISTRY__ = [
4
4
  require("./biometricPinService")
5
5
  ];
6
6
  function __ONAIROS_REQ_FUNC__(i) { return __ONAIROS_REQ_REGISTRY__[i]; }
7
- Object[_0x8327(0x0)](exports,_0x8327(0x1),{'value':!![]}),exports['setTemporaryPin']=exports[_0x8327(0x2)]=exports[_0x8327(0x3)]=exports[_0x8327(0x4)]=exports[_0x8327(0x5)]=exports[_0x8327(0x6)]=exports[_0x8327(0x7)]=void 0x0;var _biometricPinService=__ONAIROS_REQ_FUNC__(0x0);const getStoredPinForTraining=async()=>{const _0x1d5b7e={'kDsOf':_0x8327(0x8),'CwwmF':_0x8327(0x9),'PLBvM':_0x8327(0xa)};try{console['log'](_0x1d5b7e[_0x8327(0xb)]);const _0x423cba=await _biometricPinService[_0x8327(0xc)][_0x8327(0xd)]();if(!_0x423cba)return console[_0x8327(0xe)](_0x8327(0xf)),null;const _0x240d01=await _biometricPinService[_0x8327(0xc)]['retrievePinWithBiometric']();return _0x240d01?(console[_0x8327(0xe)](_0x1d5b7e[_0x8327(0x10)]),_0x240d01):(console['log'](_0x1d5b7e['PLBvM']),null);}catch(_0x2b8ab4){return console['error'](_0x8327(0x11),_0x2b8ab4),null;}};exports[_0x8327(0x4)]=getStoredPinForTraining;const hasStoredPin=async()=>{const _0x5eb4c5={'seyGo':_0x8327(0x12)};try{return await _biometricPinService[_0x8327(0xc)][_0x8327(0xd)]();}catch(_0x3dfa59){return console[_0x8327(0x13)](_0x5eb4c5['seyGo'],_0x3dfa59),![];}};exports[_0x8327(0x2)]=hasStoredPin;const clearStoredPin=async()=>{const _0x5ed8fb={'clnMk':_0x8327(0x14),'eHsJr':_0x8327(0x15)};try{return console[_0x8327(0xe)](_0x5ed8fb['clnMk']),await _biometricPinService[_0x8327(0xc)][_0x8327(0x16)]();}catch(_0x92c859){return console[_0x8327(0x13)](_0x5ed8fb['eHsJr'],_0x92c859),![];}};exports[_0x8327(0x7)]=clearStoredPin;const getPinForTraining=async _0x1a7541=>{const _0x1374b9={'EXSma':_0x8327(0x17),'nRSQE':function(_0x53c7f7){return _0x53c7f7();}};if(_0x1a7541)return console['log'](_0x1374b9[_0x8327(0x18)]),_0x1a7541;return await _0x1374b9[_0x8327(0x19)](getStoredPinForTraining);};exports[_0x8327(0x5)]=getPinForTraining;let temporaryPin=null;const setTemporaryPin=_0xd0fea6=>{const _0x4d1176={'NAwtC':_0x8327(0x1a)};temporaryPin=_0xd0fea6,console[_0x8327(0xe)](_0x4d1176[_0x8327(0x1b)]);};exports[_0x8327(0x1c)]=setTemporaryPin;function _0x5547(){const _0x63dc1a=['defineProperty','__esModule','hasStoredPin','getTemporaryPin','getStoredPinForTraining','getPinForTraining','clearTemporaryPin','clearStoredPin','🔓\x20Retrieving\x20stored\x20PIN\x20for\x20training...','✅\x20PIN\x20retrieved\x20successfully\x20for\x20training','❌\x20Failed\x20to\x20retrieve\x20PIN\x20or\x20user\x20cancelled\x20authentication','kDsOf','biometricPinService','isPinStored','log','⚠️\x20No\x20PIN\x20stored\x20in\x20secure\x20storage','CwwmF','❌\x20Error\x20retrieving\x20stored\x20PIN:','❌\x20Error\x20checking\x20PIN\x20storage:','error','🗑️\x20Clearing\x20stored\x20PIN...','❌\x20Error\x20clearing\x20stored\x20PIN:','removePinFromStorage','📝\x20Using\x20temporary\x20PIN\x20for\x20training','EXSma','nRSQE','📝\x20Temporary\x20PIN\x20set\x20for\x20training','NAwtC','setTemporaryPin','YXXyu'];_0x5547=function(){return _0x63dc1a;};return _0x5547();}const getTemporaryPin=()=>{return temporaryPin;};exports[_0x8327(0x3)]=getTemporaryPin;const clearTemporaryPin=()=>{const _0x4baf3f={'YXXyu':'🗑️\x20Temporary\x20PIN\x20cleared'};temporaryPin=null,console[_0x8327(0xe)](_0x4baf3f[_0x8327(0x1d)]);};function _0x8327(_0x554753,_0x8327e6){_0x554753=_0x554753-0x0;const _0x3cc868=_0x5547();let _0x324beb=_0x3cc868[_0x554753];return _0x324beb;}exports[_0x8327(0x6)]=clearTemporaryPin;
7
+ Object[_0x3a52(0x0)](exports,'__esModule',{'value':!![]}),exports[_0x3a52(0x1)]=exports[_0x3a52(0x2)]=exports[_0x3a52(0x3)]=exports['getStoredPinForTraining']=exports[_0x3a52(0x4)]=exports[_0x3a52(0x5)]=exports[_0x3a52(0x6)]=void 0x0;var _biometricPinService=__ONAIROS_REQ_FUNC__(0x0);const getStoredPinForTraining=async()=>{const _0x3c6291={'ndYmZ':'❌\x20Error\x20clearing\x20stored\x20PIN:','ACutK':_0x3a52(0x7),'tUtSH':_0x3a52(0x8),'HpzFS':'⚠️\x20No\x20PIN\x20stored\x20in\x20secure\x20storage','QYpaF':function(_0x498534,_0x1d789b){return _0x498534!==_0x1d789b;},'TVNOC':'OokSn','fcegx':function(_0x7588be,_0x118855){return _0x7588be===_0x118855;},'qCQPP':'NMEnP','sbEbf':'ilTNJ','HdSzW':'❌\x20Failed\x20to\x20retrieve\x20PIN\x20or\x20user\x20cancelled\x20authentication','CIrFc':_0x3a52(0x9)};try{if(_0x3c6291[_0x3a52(0xa)]!==_0x3c6291['tUtSH'])return _0x5c2184[_0x3a52(0xb)](_0x3c6291[_0x3a52(0xc)],_0x4a4e1f),![];else{console[_0x3a52(0xd)]('🔓\x20Retrieving\x20stored\x20PIN\x20for\x20training...');const _0x30d6d2=await _biometricPinService[_0x3a52(0xe)]['isPinStored']();if(!_0x30d6d2)return console['log'](_0x3c6291[_0x3a52(0xf)]),null;const _0x103d71=await _biometricPinService[_0x3a52(0xe)][_0x3a52(0x10)]();if(_0x103d71)return _0x3c6291[_0x3a52(0x11)](_0x3c6291['TVNOC'],_0x3c6291['TVNOC'])?(_0x43fa16[_0x3a52(0xd)](_0x3c6291[_0x3a52(0x12)]),_0x401a77):(console[_0x3a52(0xd)](_0x3a52(0x7)),_0x103d71);else{if(_0x3c6291[_0x3a52(0x13)](_0x3c6291[_0x3a52(0x14)],_0x3c6291[_0x3a52(0x15)]))_0x570a6d=_0x4c456a,_0xdc2a21[_0x3a52(0xd)]('📝\x20Temporary\x20PIN\x20set\x20for\x20training');else return console[_0x3a52(0xd)](_0x3c6291[_0x3a52(0x16)]),null;}}}catch(_0x571546){return console[_0x3a52(0xb)](_0x3c6291[_0x3a52(0x17)],_0x571546),null;}};exports['getStoredPinForTraining']=getStoredPinForTraining;const hasStoredPin=async()=>{const _0x4c98aa={'xkiZx':_0x3a52(0x18),'CzAwd':_0x3a52(0x19),'KsHcf':_0x3a52(0x1a),'nqrZs':_0x3a52(0x1b)};try{return await _biometricPinService[_0x3a52(0xe)][_0x3a52(0x1c)]();}catch(_0x597365){return _0x4c98aa[_0x3a52(0x1d)]!==_0x4c98aa['KsHcf']?(console['error'](_0x4c98aa[_0x3a52(0x1e)],_0x597365),![]):(_0x15c6db[_0x3a52(0xd)](_0x4c98aa['xkiZx']),_0x78cfb8);}};exports['hasStoredPin']=hasStoredPin;const clearStoredPin=async()=>{const _0x63d8a={'YhICc':_0x3a52(0x1f),'LnOvC':_0x3a52(0x20)};try{return console[_0x3a52(0xd)](_0x63d8a[_0x3a52(0x21)]),await _biometricPinService['biometricPinService'][_0x3a52(0x22)]();}catch(_0x519cfd){return console['error'](_0x63d8a[_0x3a52(0x23)],_0x519cfd),![];}};exports['clearStoredPin']=clearStoredPin;function _0x3a52(_0x52b8ce,_0x3a521c){_0x52b8ce=_0x52b8ce-0x0;const _0x1f228d=_0x52b8();let _0x4dcda5=_0x1f228d[_0x52b8ce];return _0x4dcda5;}const getPinForTraining=async _0x124306=>{const _0x5cd773={'BntBn':_0x3a52(0x9),'XBlLj':function(_0x3cf596,_0x3d6def){return _0x3cf596===_0x3d6def;},'Dojmp':_0x3a52(0x24),'apdMl':_0x3a52(0x18),'vLDgw':function(_0x403574){return _0x403574();}};if(_0x124306)return _0x5cd773[_0x3a52(0x25)](_0x5cd773['Dojmp'],_0x3a52(0x24))?(console[_0x3a52(0xd)](_0x5cd773[_0x3a52(0x26)]),_0x124306):(_0x18191c['error'](_0x5cd773[_0x3a52(0x27)],_0x256f35),null);return await _0x5cd773[_0x3a52(0x28)](getStoredPinForTraining);};exports[_0x3a52(0x4)]=getPinForTraining;let temporaryPin=null;const setTemporaryPin=_0x5f22ca=>{const _0x24a43f={'SRGQC':_0x3a52(0x29)};temporaryPin=_0x5f22ca,console[_0x3a52(0xd)](_0x24a43f[_0x3a52(0x2a)]);};exports[_0x3a52(0x1)]=setTemporaryPin;const getTemporaryPin=()=>{return temporaryPin;};exports[_0x3a52(0x3)]=getTemporaryPin;const clearTemporaryPin=()=>{const _0x1dc914={'HbHoS':_0x3a52(0x2b)};temporaryPin=null,console['log'](_0x1dc914['HbHoS']);};function _0x52b8(){const _0x26cfdb=['defineProperty','setTemporaryPin','hasStoredPin','getTemporaryPin','getPinForTraining','clearTemporaryPin','clearStoredPin','✅\x20PIN\x20retrieved\x20successfully\x20for\x20training','bpcVp','❌\x20Error\x20retrieving\x20stored\x20PIN:','tUtSH','error','ndYmZ','log','biometricPinService','HpzFS','retrievePinWithBiometric','QYpaF','ACutK','fcegx','qCQPP','sbEbf','HdSzW','CIrFc','📝\x20Using\x20temporary\x20PIN\x20for\x20training','zinsM','lPdlg','❌\x20Error\x20checking\x20PIN\x20storage:','isPinStored','CzAwd','nqrZs','🗑️\x20Clearing\x20stored\x20PIN...','❌\x20Error\x20clearing\x20stored\x20PIN:','YhICc','removePinFromStorage','LnOvC','hTzeq','XBlLj','apdMl','BntBn','vLDgw','📝\x20Temporary\x20PIN\x20set\x20for\x20training','SRGQC','🗑️\x20Temporary\x20PIN\x20cleared'];_0x52b8=function(){return _0x26cfdb;};return _0x52b8();}exports[_0x3a52(0x5)]=clearTemporaryPin;