@onairos/react-native 3.6.3 → 3.6.5

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
- Object[_0x2080(0x0)](exports,_0x2080(0x1),{'value':!![]}),exports[_0x2080(0x2)]=exports[_0x2080(0x3)]=exports['disconnectPlatform']=exports[_0x2080(0x4)]=exports[_0x2080(0x5)]=exports[_0x2080(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':'YOUR_INSTAGRAM_CLIENT_ID','redirectUri':_0x2080(0x7),'scope':_0x2080(0x8),'authorizationEndpoint':_0x2080(0x9),'tokenEndpoint':_0x2080(0xa),'responseType':_0x2080(0xb)},'youtube':{'clientId':'YOUR_YOUTUBE_CLIENT_ID','redirectUri':_0x2080(0xc),'scope':_0x2080(0xd),'authorizationEndpoint':_0x2080(0xe),'tokenEndpoint':_0x2080(0xf),'responseType':_0x2080(0xb)},'pinterest':{'clientId':_0x2080(0x10),'redirectUri':'onairosanime://auth/pinterest','scope':_0x2080(0x11),'authorizationEndpoint':_0x2080(0x12),'tokenEndpoint':_0x2080(0x13),'responseType':'code'},'reddit':{'clientId':_0x2080(0x14),'redirectUri':'onairosanime://auth/reddit','scope':_0x2080(0x15),'authorizationEndpoint':'https://www.reddit.com/api/v1/authorize','tokenEndpoint':_0x2080(0x16),'responseType':'code'}},generateState=()=>{const _0x504dd1=Math['random']()[_0x2080(0x17)](0x24)[_0x2080(0x18)](0x2,0xf);return(0x0,_crypto[_0x2080(0x19)])(_0x504dd1)[_0x2080(0x18)](0x0,0xa);},initializeOAuthService=()=>{const _0x4a6432={'RPOQJ':'url'};_reactNative[_0x2080(0x1a)]['addEventListener'](_0x4a6432[_0x2080(0x1b)],handleDeepLink);};exports[_0x2080(0x3)]=initializeOAuthService;const cleanupOAuthService=()=>{const _0x4511a9={'WYZOm':'function','IKLye':_0x2080(0x1c)};typeof _reactNative[_0x2080(0x1a)][_0x2080(0x1d)]===_0x4511a9[_0x2080(0x1e)]&&_reactNative[_0x2080(0x1a)][_0x2080(0x1d)](_0x4511a9[_0x2080(0x1f)]);};exports[_0x2080(0x5)]=cleanupOAuthService;let currentOAuthState=null,currentOAuthPlatform=null,currentOAuthResolve=null,currentOAuthReject=null;const handleDeepLink=async _0x55a39e=>{const _0x742ce5={'iTvbQ':_0x2080(0x20),'GaDgC':_0x2080(0x21),'zlJsE':function(_0x3784dd,_0x106ef5){return _0x3784dd===_0x106ef5;},'vpRHu':_0x2080(0x22),'AaSnZ':function(_0x4fdb33,_0x5b0ed7){return _0x4fdb33!==_0x5b0ed7;},'PsMsx':function(_0xb2f423,_0x17d498){return _0xb2f423===_0x17d498;},'kUNLI':_0x2080(0x23),'pogbs':'ILZHJ','yJlNB':'code','GyCiV':_0x2080(0x24),'PkMTk':_0x2080(0x25),'WimCf':function(_0x5b7092,_0x545ad8){return _0x5b7092!==_0x545ad8;},'SOhNT':_0x2080(0x26),'UHrGQ':function(_0x930b80,_0x22ac19){return _0x930b80===_0x22ac19;},'eSahC':_0x2080(0x27),'ZugYX':function(_0x6ddd7b,_0x1360da){return _0x6ddd7b(_0x1360da);},'hsUTM':_0x2080(0x28),'OMZnB':_0x2080(0x29),'jZLtS':function(_0xa87169,_0x59609a){return _0xa87169(_0x59609a);},'PpyfY':_0x2080(0x2a),'ZeQus':_0x2080(0x2b),'QUZDI':function(_0x35148c,_0x5bd511,_0x4e4b7d){return _0x35148c(_0x5bd511,_0x4e4b7d);},'ddQaA':function(_0x14d163,_0x25e5ef){return _0x14d163(_0x25e5ef);},'CUpUM':function(_0x2079b8,_0x311053){return _0x2079b8(_0x311053);},'OzpLB':function(_0x4069e4,_0x58a7e1){return _0x4069e4(_0x58a7e1);}};try{const {url:_0x3dd91f}=_0x55a39e;if(!_0x3dd91f['startsWith'](_0x742ce5['GaDgC'])){if(_0x742ce5['zlJsE']('bcsUO',_0x742ce5['vpRHu']))return;else return;}const _0x440b62=_0x3dd91f[_0x2080(0x2c)]('onairosanime://auth/')[0x1]['split']('?')[0x0];if(_0x742ce5[_0x2080(0x2d)](_0x440b62,currentOAuthPlatform)){if(_0x742ce5[_0x2080(0x2e)](_0x742ce5['kUNLI'],_0x742ce5[_0x2080(0x2f)]))return _0x339838[_0x2080(0x25)](_0x2080(0x30)+_0x21e017+'):',_0x46bcc5),![];else return;}const _0x31fcc4=new URL(_0x3dd91f)['searchParams'],_0x186728=_0x31fcc4[_0x2080(0x31)](_0x742ce5[_0x2080(0x32)]),_0x563fb0=_0x31fcc4['get'](_0x742ce5[_0x2080(0x33)]),_0x45fa53=_0x31fcc4['get'](_0x742ce5[_0x2080(0x34)]);if(_0x563fb0!==currentOAuthState){if(_0x742ce5[_0x2080(0x35)](_0x742ce5[_0x2080(0x36)],_0x742ce5[_0x2080(0x36)])){_0x4d2358[_0x2080(0x25)](_0x2080(0x37)+_0x55aeba+'):',_0x572732);throw _0x22e1d6;}else{if(currentOAuthReject){if(_0x742ce5[_0x2080(0x38)]('mPLhV',_0x742ce5[_0x2080(0x39)]))_0x742ce5[_0x2080(0x3a)](currentOAuthReject,new Error(_0x742ce5[_0x2080(0x3b)]));else throw new _0xa0441('Unsupported\x20platform:\x20'+_0xb2d2cb);}return;}}if(_0x45fa53){if(currentOAuthReject){if(_0x742ce5[_0x2080(0x3c)]===_0x2080(0x29))_0x742ce5['jZLtS'](currentOAuthReject,new Error(_0x2080(0x3d)+_0x45fa53));else throw new _0x4b1990(_0x2e690f[_0x2080(0x25)]||_0x742ce5[_0x2080(0x3e)]);}return;}if(_0x186728){if(_0x742ce5[_0x2080(0x3f)]===_0x742ce5[_0x2080(0x40)])throw new _0xc336a6(_0x2080(0x41)+_0x4e528d);else{const _0x226de9=await _0x742ce5[_0x2080(0x42)](exchangeCodeForToken,_0x440b62,_0x186728);currentOAuthResolve&&_0x742ce5[_0x2080(0x43)](currentOAuthResolve,_0x226de9);}}else currentOAuthReject&&_0x742ce5['CUpUM'](currentOAuthReject,new Error(_0x2080(0x44)));}catch(_0x54a50c){console[_0x2080(0x25)](_0x2080(0x45),_0x54a50c),currentOAuthReject&&_0x742ce5[_0x2080(0x46)](currentOAuthReject,_0x54a50c);}finally{currentOAuthState=null,currentOAuthPlatform=null,currentOAuthResolve=null,currentOAuthReject=null;}},exchangeCodeForToken=async(_0x5c14bc,_0x112c73)=>{const _0x489997={'fnaxv':'client_id','JgGDS':_0x2080(0x47),'kBaKT':_0x2080(0x48),'pWtmx':_0x2080(0x24),'ZnRHW':_0x2080(0x49),'jzvmK':function(_0x12aab9,_0x58019d,_0x588221){return _0x12aab9(_0x58019d,_0x588221);},'xqwbo':function(_0xf43a96,_0x176d05){return _0xf43a96===_0x176d05;},'sBLyR':'YgRsw'};try{const _0xebfeee=OAUTH_CONFIGS[_0x5c14bc];if(!_0xebfeee)throw new Error(_0x2080(0x41)+_0x5c14bc);const _0x26b3a5=new URLSearchParams({'grant_type':_0x489997[_0x2080(0x4a)],'code':_0x112c73,'redirect_uri':_0xebfeee['redirectUri'],'client_id':_0xebfeee['clientId']}),_0x2ec420=await _0x489997[_0x2080(0x4b)](fetch,_0xebfeee[_0x2080(0x4c)],{'method':'POST','headers':{'Content-Type':_0x2080(0x4d)},'body':_0x26b3a5[_0x2080(0x17)]()}),_0x13905c=await _0x2ec420[_0x2080(0x4e)]();if(!_0x2ec420['ok'])throw new Error(_0x13905c['error']||_0x2080(0x4f));const _0xe5ef8c=await _0x489997[_0x2080(0x4b)](fetchUserInfo,_0x5c14bc,_0x13905c[_0x2080(0x50)]);return{'token':_0x13905c[_0x2080(0x50)],'refreshToken':_0x13905c[_0x2080(0x51)],'expiresIn':_0x13905c[_0x2080(0x52)],'username':_0xe5ef8c[_0x2080(0x53)],'userId':_0xe5ef8c['id']};}catch(_0x1e2270){if(_0x489997[_0x2080(0x54)](_0x2080(0x55),_0x489997[_0x2080(0x56)])){const _0x3e063b=_0x12d368[_0x16a1ae];if(!_0x3e063b)throw new _0x13b3da(_0x2080(0x41)+_0x580616);const _0x311e17=_0x375aff(),_0x3da160=new _0x363c42(_0x3e063b[_0x2080(0x57)]);_0x3da160['searchParams'][_0x2080(0x58)](_0x489997[_0x2080(0x59)],_0x3e063b[_0x2080(0x5a)]),_0x3da160['searchParams']['append'](_0x489997[_0x2080(0x5b)],_0x3e063b[_0x2080(0x5c)]),_0x3da160[_0x2080(0x5d)]['append'](_0x489997['kBaKT'],_0x3e063b[_0x2080(0x5e)]),_0x3da160[_0x2080(0x5d)][_0x2080(0x58)]('scope',_0x3e063b['scope']),_0x3da160[_0x2080(0x5d)][_0x2080(0x58)](_0x489997[_0x2080(0x5f)],_0x311e17),_0x1394df=_0x311e17,_0x5f259a=_0x31de72,_0x10aa01=_0x5d1bd4,_0x101826=_0x547de1,_0x5aedb0['Linking'][_0x2080(0x60)](_0x3da160['toString']());}else{console['error'](_0x2080(0x37)+_0x5c14bc+'):',_0x1e2270);throw _0x1e2270;}}},fetchUserInfo=async(_0x2ccb3d,_0x2e36e9)=>{const _0x4978d5={'CVZCi':function(_0x1909f6,_0x3c3361){return _0x1909f6(_0x3c3361);},'WEczo':'https://graph.instagram.com/me?fields=id,username','TZvOz':_0x2080(0x61),'tVyHV':'pinterest','IoYzH':_0x2080(0x62),'kyfvC':_0x2080(0x63),'PDOly':function(_0x33511f,_0x28ac19,_0x3ccbb2){return _0x33511f(_0x28ac19,_0x3ccbb2);},'oCTCt':function(_0x4d943c,_0x4715d9){return _0x4d943c===_0x4715d9;},'Ssffy':_0x2080(0x64),'lbvjM':_0x2080(0x65),'jmZae':_0x2080(0x66),'kpbHl':function(_0x1560e6,_0x5b2d3d){return _0x1560e6!==_0x5b2d3d;},'zHmWc':'NFCfB'};try{let _0x57c2b4,_0xf28dda={'Authorization':_0x2080(0x67)+_0x2e36e9};switch(_0x2ccb3d){case'instagram':_0x57c2b4=_0x4978d5[_0x2080(0x68)];break;case _0x4978d5['TZvOz']:_0x57c2b4=_0x2080(0x69);break;case _0x4978d5[_0x2080(0x6a)]:_0x57c2b4=_0x4978d5['IoYzH'];break;case _0x2080(0x66):_0x57c2b4=_0x4978d5[_0x2080(0x6b)];break;default:throw new Error('Unsupported\x20platform:\x20'+_0x2ccb3d);}const _0x19dc55=await _0x4978d5[_0x2080(0x6c)](fetch,_0x57c2b4,{'headers':_0xf28dda}),_0x367762=await _0x19dc55[_0x2080(0x4e)]();if(!_0x19dc55['ok']){if(_0x4978d5['oCTCt'](_0x2080(0x6d),_0x4978d5[_0x2080(0x6e)]))_0x4978d5[_0x2080(0x6f)](_0x30201e,_0x37621b);else throw new Error(_0x367762[_0x2080(0x25)]||'Failed\x20to\x20fetch\x20user\x20info');}switch(_0x2ccb3d){case _0x4978d5[_0x2080(0x70)]:return{'id':_0x367762['id'],'username':_0x367762[_0x2080(0x53)]};case _0x4978d5[_0x2080(0x71)]:return{'id':_0x367762[_0x2080(0x72)][0x0]['id'],'username':_0x367762[_0x2080(0x72)][0x0][_0x2080(0x73)]['title']};case _0x4978d5[_0x2080(0x6a)]:return{'id':_0x367762['id'],'username':_0x367762[_0x2080(0x53)]||_0x367762[_0x2080(0x74)]};case _0x4978d5[_0x2080(0x75)]:return{'id':_0x367762['id'],'username':_0x367762['name']};default:throw new Error(_0x2080(0x41)+_0x2ccb3d);}}catch(_0xa9015f){if(_0x4978d5[_0x2080(0x76)](_0x4978d5[_0x2080(0x77)],_0x4978d5['zHmWc']))return;else{console[_0x2080(0x25)](_0x2080(0x78)+_0x2ccb3d+'):',_0xa9015f);throw _0xa9015f;}}},connectPlatform=_0x220f07=>{const _0x3411bc={'MmqYf':function(_0x273fbe,_0x538501){return _0x273fbe!==_0x538501;},'mBpmD':_0x2080(0x79),'RhvSP':function(_0x48a1e4){return _0x48a1e4();},'MEfoa':'response_type','gauuV':_0x2080(0x7a)};return new Promise((_0x1839d9,_0x243138)=>{try{const _0xf23a41=OAUTH_CONFIGS[_0x220f07];if(!_0xf23a41){if(_0x3411bc['MmqYf']('pWLxg',_0x3411bc[_0x2080(0x7b)]))throw new Error(_0x2080(0x41)+_0x220f07);else{_0x11b72e[_0x2080(0x25)](_0x2080(0x78)+_0x441b5d+'):',_0x38c064);throw _0x299d57;}}const _0x46fa99=_0x3411bc['RhvSP'](generateState),_0x1f505a=new URL(_0xf23a41['authorizationEndpoint']);_0x1f505a[_0x2080(0x5d)][_0x2080(0x58)](_0x2080(0x7c),_0xf23a41[_0x2080(0x5a)]),_0x1f505a[_0x2080(0x5d)][_0x2080(0x58)](_0x2080(0x47),_0xf23a41[_0x2080(0x5c)]),_0x1f505a[_0x2080(0x5d)][_0x2080(0x58)](_0x3411bc['MEfoa'],_0xf23a41['responseType']),_0x1f505a[_0x2080(0x5d)][_0x2080(0x58)](_0x3411bc['gauuV'],_0xf23a41['scope']),_0x1f505a[_0x2080(0x5d)][_0x2080(0x58)](_0x2080(0x24),_0x46fa99),currentOAuthState=_0x46fa99,currentOAuthPlatform=_0x220f07,currentOAuthResolve=_0x1839d9,currentOAuthReject=_0x243138,_reactNative[_0x2080(0x1a)][_0x2080(0x60)](_0x1f505a[_0x2080(0x17)]());}catch(_0xb4a7f0){_0x243138(_0xb4a7f0);}});};exports[_0x2080(0x4)]=connectPlatform;const disconnectPlatform=async(_0x4eeacc,_0x29bfea)=>{const _0x5dcfaa={'TXjHd':_0x2080(0x45),'qEpLa':function(_0x184ef7,_0x1cfbc8){return _0x184ef7(_0x1cfbc8);},'DjnLn':_0x2080(0x4f),'xflUi':_0x2080(0x7d),'hIMii':function(_0x125bae,_0x5c9c80){return _0x125bae in _0x5c9c80;},'qJrkZ':function(_0x17e6d4,_0x3f45c0){return _0x17e6d4!==_0x3f45c0;},'GRpdO':_0x2080(0x7e),'LbVPZ':function(_0x3ad07f,_0x1ebab9){return _0x3ad07f!==_0x1ebab9;},'QHFBv':'hbNdg'};try{await _api[_0x2080(0x7f)][_0x2080(0x80)](_0x5dcfaa['xflUi'],{'platform':_0x4eeacc,'username':_0x29bfea[_0x2080(0x53)]});const _0x5a547b={..._0x29bfea['platforms']};return _0x5a547b&&_0x5dcfaa[_0x2080(0x81)](_0x4eeacc,_0x5a547b)&&(_0x5dcfaa[_0x2080(0x82)](_0x2080(0x7e),_0x5dcfaa[_0x2080(0x83)])?(_0x18f159[_0x2080(0x25)](_0x5dcfaa[_0x2080(0x84)],_0x20556d),_0x169a36&&_0x5dcfaa['qEpLa'](_0x239f30,_0x1e3fd7)):delete _0x5a547b[_0x4eeacc]),await(0x0,_secureStorage[_0x2080(0x85)])({..._0x29bfea,'platforms':_0x5a547b}),!![];}catch(_0x58c90a){if(_0x5dcfaa[_0x2080(0x86)](_0x5dcfaa[_0x2080(0x87)],_0x5dcfaa[_0x2080(0x87)]))throw new _0x30f694(_0x2c78a1[_0x2080(0x25)]||_0x5dcfaa[_0x2080(0x88)]);else return console[_0x2080(0x25)](_0x2080(0x89)+_0x4eeacc+'):',_0x58c90a),![];}};exports['disconnectPlatform']=disconnectPlatform;function _0x2080(_0x498632,_0x208001){_0x498632=_0x498632-0x0;const _0x33bb8e=_0x4986();let _0x204aa4=_0x33bb8e[_0x498632];return _0x204aa4;}const storePlatformConnection=async(_0x5f4d90,_0x38a035,_0x5eee7c)=>{const _0x394fe3={'JLbYG':_0x2080(0x1c),'ZZsPt':function(_0x4f27bc,_0x38cbd4){return _0x4f27bc===_0x38cbd4;},'AKRWy':_0x2080(0x65),'PiLmy':function(_0x1f7f35,_0x3a2940){return _0x1f7f35===_0x3a2940;},'igBbq':_0x2080(0x61),'yoDMq':function(_0x28d865,_0x2b6eae){return _0x28d865===_0x2b6eae;},'hGeBA':'reddit','nUUGE':function(_0x8f72df,_0x560118){return _0x8f72df!==_0x560118;},'hpURE':'gqsLb','LPyOK':function(_0x4822c2,_0x218f93){return _0x4822c2+_0x218f93;},'atsbN':function(_0x229696,_0x33f9df){return _0x229696*_0x33f9df;},'sYSEc':function(_0x2aa25c,_0x18ba9b){return _0x2aa25c!==_0x18ba9b;},'WRIup':_0x2080(0x8a)};try{const _0xa5f8e5=_0x394fe3[_0x2080(0x8b)](_0x5f4d90,_0x394fe3[_0x2080(0x8c)])||_0x394fe3['PiLmy'](_0x5f4d90,_0x394fe3['igBbq'])||_0x5f4d90===_0x2080(0x8d)||_0x394fe3[_0x2080(0x8e)](_0x5f4d90,_0x394fe3[_0x2080(0x8f)]);if(!_0xa5f8e5){if(_0x394fe3[_0x2080(0x90)](_0x394fe3[_0x2080(0x91)],'gqsLb'))throw new _0x5bc407(_0x2080(0x41)+_0x111825);else throw new Error(_0x2080(0x41)+_0x5f4d90);}const _0x588786={..._0x5eee7c[_0x2080(0x92)]},_0x1bf5b3={'username':_0x38a035['username'],'userId':_0x38a035[_0x2080(0x93)],'token':_0x38a035[_0x2080(0x94)],'refreshToken':_0x38a035['refreshToken'],'expiresAt':_0x38a035[_0x2080(0x95)]?_0x394fe3[_0x2080(0x96)](Date[_0x2080(0x97)](),_0x394fe3[_0x2080(0x98)](_0x38a035['expiresIn'],0x3e8)):null,'connectedAt':Date[_0x2080(0x97)]()};if(_0x394fe3['PiLmy'](_0x5f4d90,_0x394fe3[_0x2080(0x8c)]))_0x588786[_0x2080(0x65)]=_0x1bf5b3;else{if(_0x5f4d90===_0x2080(0x61))_0x588786[_0x2080(0x61)]=_0x1bf5b3;else{if(_0x5f4d90===_0x2080(0x8d))_0x588786[_0x2080(0x8d)]=_0x1bf5b3;else{if(_0x5f4d90===_0x394fe3[_0x2080(0x8f)])_0x588786[_0x2080(0x66)]=_0x1bf5b3;}}}return await(0x0,_secureStorage[_0x2080(0x85)])({..._0x5eee7c,'platforms':_0x588786}),!![];}catch(_0x40133f){if(_0x394fe3[_0x2080(0x99)](_0x394fe3[_0x2080(0x9a)],_0x394fe3['WRIup']))_0x2bbc6b[_0x2080(0x1a)]['addEventListener'](_0x394fe3[_0x2080(0x9b)],_0x1a9f77);else return console['error'](_0x2080(0x30)+_0x5f4d90+'):',_0x40133f),![];}};exports[_0x2080(0x2)]=storePlatformConnection;const OAuthService=exports['OAuthService']={'initializeOAuthService':initializeOAuthService,'cleanupOAuthService':cleanupOAuthService,'connectPlatform':connectPlatform,'disconnectPlatform':disconnectPlatform,'storePlatformConnection':storePlatformConnection,'_apiBaseUrl':''+_api2['API_CONFIG'][_0x2080(0x9c)]};function _0x4986(){const _0x51d721=['defineProperty','__esModule','storePlatformConnection','initializeOAuthService','connectPlatform','cleanupOAuthService','OAuthService','onairosanime://auth/instagram','user_profile,user_media','https://api.instagram.com/oauth/authorize','https://api.instagram.com/oauth/access_token','code','onairosanime://auth/youtube','https://www.googleapis.com/auth/youtube.readonly','https://accounts.google.com/o/oauth2/auth','https://oauth2.googleapis.com/token','YOUR_PINTEREST_CLIENT_ID','boards:read,pins:read','https://www.pinterest.com/oauth/','https://api.pinterest.com/v5/oauth/token','YOUR_REDDIT_CLIENT_ID','identity,read','https://www.reddit.com/api/v1/access_token','toString','substring','sha256','Linking','RPOQJ','url','removeAllListeners','WYZOm','IKLye','Failed\x20to\x20fetch\x20user\x20info','onairosanime://auth/','bcsUO','SsidM','state','error','mYuLK','mPLhV','OAuth\x20state\x20mismatch\x20-\x20possible\x20CSRF\x20attack','qXZSF','WErUa','mLoya','split','AaSnZ','PsMsx','pogbs','Error\x20storing\x20platform\x20connection\x20(','get','yJlNB','GyCiV','PkMTk','WimCf','SOhNT','Error\x20exchanging\x20code\x20for\x20token\x20(','UHrGQ','eSahC','ZugYX','hsUTM','OMZnB','OAuth\x20error:\x20','iTvbQ','PpyfY','ZeQus','Unsupported\x20platform:\x20','QUZDI','ddQaA','No\x20authorization\x20code\x20received','Error\x20handling\x20OAuth\x20deep\x20link:','OzpLB','redirect_uri','response_type','authorization_code','ZnRHW','jzvmK','tokenEndpoint','application/x-www-form-urlencoded','json','Failed\x20to\x20exchange\x20code\x20for\x20token','access_token','refresh_token','expires_in','username','xqwbo','xrgwC','sBLyR','authorizationEndpoint','append','fnaxv','clientId','JgGDS','redirectUri','searchParams','responseType','pWtmx','openURL','youtube','https://api.pinterest.com/v5/user_account','https://oauth.reddit.com/api/v1/me','Kamdt','instagram','reddit','Bearer\x20','WEczo','https://www.googleapis.com/youtube/v3/channels?part=snippet&mine=true','tVyHV','kyfvC','PDOly','tmbld','Ssffy','CVZCi','lbvjM','TZvOz','items','snippet','full_name','jmZae','kpbHl','zHmWc','Error\x20fetching\x20user\x20info\x20(','infHg','scope','mBpmD','client_id','/users/disconnect-platform','rQKkZ','onairosApi','post','hIMii','qJrkZ','GRpdO','TXjHd','updateCredentials','LbVPZ','QHFBv','DjnLn','Error\x20disconnecting\x20platform\x20(','IxzOm','ZZsPt','AKRWy','pinterest','yoDMq','hGeBA','nUUGE','hpURE','platforms','userId','token','expiresIn','LPyOK','now','atsbN','sYSEc','WRIup','JLbYG','BASE_URL'];_0x4986=function(){return _0x51d721;};return _0x4986();}
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,_0x54cc(0x0),{'value':!![]}),exports['hashPin']=exports['getEncryptedPinForAPI']=exports[_0x54cc(0x1)]=exports[_0x54cc(0x2)]=void 0x0;var _pinStorageUtils=__ONAIROS_REQ_FUNC__(0x0);const CryptoJS=__ONAIROS_REQ_FUNC__(0x1),ENCRYPTION_KEY=_0x54cc(0x3),encryptPin=_0x3c0ece=>{const _0x578ee9={'XOafI':_0x54cc(0x4),'VuQsU':_0x54cc(0x5),'QsiDF':_0x54cc(0x6),'VnlVV':'🔐\x20PIN\x20encrypted\x20successfully','RhffK':_0x54cc(0x7),'lDnHD':_0x54cc(0x8),'FAsEP':_0x54cc(0x9)};try{if(_0x578ee9['QsiDF']!==_0x578ee9['QsiDF']){const _0xf8259e=_0x10b99f[_0x54cc(0xa)][_0x54cc(0xb)](_0x2c1762,_0x53702a),_0x494b24=_0xf8259e['toString'](_0x56ba46['enc'][_0x54cc(0xc)]);return _0x102646[_0x54cc(0xd)](_0x578ee9['XOafI']),_0x494b24;}else{const _0xea4c73=CryptoJS[_0x54cc(0xa)][_0x54cc(0xe)](_0x3c0ece,ENCRYPTION_KEY)[_0x54cc(0xf)]();return console['log'](_0x578ee9[_0x54cc(0x10)]),_0xea4c73;}}catch(_0x564eed){if(_0x578ee9[_0x54cc(0x11)]===_0x578ee9['lDnHD'])return _0x17f600[_0x54cc(0x12)](_0x578ee9[_0x54cc(0x13)],_0x4377f8),null;else{console[_0x54cc(0x12)](_0x578ee9['FAsEP'],_0x564eed);throw _0x564eed;}}};exports['encryptPin']=encryptPin;const decryptPin=_0x20c83e=>{const _0x3722ff={'nDuQu':_0x54cc(0x14),'shuWL':function(_0x1d81d9,_0x2c6d64){return _0x1d81d9!==_0x2c6d64;},'FkQdr':_0x54cc(0x15),'yTQkS':_0x54cc(0x16),'NdWZl':_0x54cc(0x4),'iZJuS':_0x54cc(0x17)};try{if(_0x3722ff['shuWL'](_0x3722ff[_0x54cc(0x18)],_0x3722ff[_0x54cc(0x19)])){const _0x1544f4=CryptoJS[_0x54cc(0xa)][_0x54cc(0xb)](_0x20c83e,ENCRYPTION_KEY),_0x27569d=_0x1544f4[_0x54cc(0xf)](CryptoJS['enc'][_0x54cc(0xc)]);return console['log'](_0x3722ff[_0x54cc(0x1a)]),_0x27569d;}else{const _0x2d2131=_0x38a984[_0x54cc(0x1b)](_0x295df0+_0x277586)['toString']();return _0x33483d[_0x54cc(0xd)](_0x3722ff[_0x54cc(0x1c)]),_0x2d2131;}}catch(_0x2baa09){console[_0x54cc(0x12)](_0x3722ff[_0x54cc(0x1d)],_0x2baa09);throw _0x2baa09;}};exports[_0x54cc(0x2)]=decryptPin;function _0x54cc(_0xe99cbe,_0x54cc2d){_0xe99cbe=_0xe99cbe-0x0;const _0x2f6270=_0xe99c();let _0x176a1e=_0x2f6270[_0xe99cbe];return _0x176a1e;}const getEncryptedPinForAPI=async()=>{const _0x5dfea0={'oMQHJ':_0x54cc(0x1e)};try{const _0x3b9a1c=(0x0,_pinStorageUtils[_0x54cc(0x1f)])();if(!_0x3b9a1c)return console[_0x54cc(0xd)]('⚠️\x20No\x20temporary\x20PIN\x20available\x20for\x20encryption'),null;const _0x1ddfeb=encryptPin(_0x3b9a1c);return console[_0x54cc(0xd)](_0x5dfea0[_0x54cc(0x20)]),_0x1ddfeb;}catch(_0xa4ec83){return console[_0x54cc(0x12)](_0x54cc(0x5),_0xa4ec83),null;}};exports[_0x54cc(0x21)]=getEncryptedPinForAPI;function _0xe99c(){const _0x3fb81d=['__esModule','encryptPin','decryptPin','onairos-pin-encryption-key-2024','🔓\x20PIN\x20decrypted\x20successfully','❌\x20Error\x20getting\x20encrypted\x20PIN\x20for\x20API:','MTALN','Mucaj','KIMIi','❌\x20Error\x20encrypting\x20PIN:','AES','decrypt','Utf8','log','encrypt','toString','VnlVV','RhffK','error','VuQsU','🔒\x20PIN\x20hashed\x20successfully','NMWiT','UREBZ','❌\x20Error\x20decrypting\x20PIN:','FkQdr','yTQkS','NdWZl','SHA256','nDuQu','iZJuS','✅\x20PIN\x20encrypted\x20for\x20API\x20transmission','getTemporaryPin','oMQHJ','getEncryptedPinForAPI','bqiSf','❌\x20Error\x20hashing\x20PIN:','MkmVO','ABGwp','DFdQp','RfypR','eEsQw','bpTPJ','hashPin'];_0xe99c=function(){return _0x3fb81d;};return _0xe99c();}const hashPin=_0x224fad=>{const _0x244769={'eEsQw':_0x54cc(0x9),'MkmVO':function(_0x71a631,_0x23c993){return _0x71a631===_0x23c993;},'ABGwp':_0x54cc(0x22),'DFdQp':function(_0x58d71,_0x72ad8a){return _0x58d71+_0x72ad8a;},'RfypR':_0x54cc(0x14),'bpTPJ':_0x54cc(0x23)};try{if(_0x244769[_0x54cc(0x24)](_0x244769[_0x54cc(0x25)],_0x244769['ABGwp'])){const _0x1d758a=CryptoJS[_0x54cc(0x1b)](_0x244769[_0x54cc(0x26)](_0x224fad,ENCRYPTION_KEY))['toString']();return console[_0x54cc(0xd)](_0x244769[_0x54cc(0x27)]),_0x1d758a;}else{_0x30ac7c['error'](_0x244769[_0x54cc(0x28)],_0x3b16a8);throw _0x418844;}}catch(_0xc9e297){console['error'](_0x244769[_0x54cc(0x29)],_0xc9e297);throw _0xc9e297;}};exports[_0x54cc(0x2a)]=hashPin;
8
+ Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[_0x1bb8(0x0)]=exports[_0x1bb8(0x1)]=exports[_0x1bb8(0x2)]=exports[_0x1bb8(0x3)]=void 0x0;var _pinStorageUtils=__ONAIROS_REQ_FUNC__(0x0);function _0x1bb8(_0x2455e9,_0x1bb872){_0x2455e9=_0x2455e9-0x0;const _0x132c83=_0x2455();let _0x2f15fd=_0x132c83[_0x2455e9];return _0x2f15fd;}const CryptoJS=__ONAIROS_REQ_FUNC__(0x1),ENCRYPTION_KEY=_0x1bb8(0x4),encryptPin=_0x4690d8=>{const _0x44d64f={'YVERI':_0x1bb8(0x5),'EUluU':_0x1bb8(0x6),'KAMxu':_0x1bb8(0x7),'ctSHj':_0x1bb8(0x8),'vnipV':function(_0x5d00bd,_0x520ec5){return _0x5d00bd===_0x520ec5;},'RUwRH':_0x1bb8(0x9),'TqdaH':_0x1bb8(0xa)};try{if(_0x44d64f[_0x1bb8(0xb)](_0x44d64f[_0x1bb8(0xc)],_0x44d64f[_0x1bb8(0xc)])){const _0x56bb2a=CryptoJS[_0x1bb8(0xd)][_0x1bb8(0xe)](_0x4690d8,ENCRYPTION_KEY)[_0x1bb8(0xf)]();return console['log'](_0x1bb8(0x5)),_0x56bb2a;}else try{const _0x5b22f7=_0x493b1e[_0x1bb8(0xd)][_0x1bb8(0xe)](_0x6a17f8,_0x13763e)['toString']();return _0x56c802[_0x1bb8(0x10)](_0x44d64f[_0x1bb8(0x11)]),_0x5b22f7;}catch(_0x224729){_0x15857b[_0x1bb8(0x12)](_0x44d64f['EUluU'],_0x224729);throw _0x224729;}}catch(_0x2737b3){if(_0x1bb8(0xa)===_0x44d64f[_0x1bb8(0x13)]){console['error'](_0x44d64f[_0x1bb8(0x14)],_0x2737b3);throw _0x2737b3;}else{const _0x38137d=(0x0,_0x1efce1[_0x1bb8(0x15)])();if(!_0x38137d)return _0x237288[_0x1bb8(0x10)](_0x44d64f['KAMxu']),null;const _0x16fc27=_0x18649a(_0x38137d);return _0x3ab483[_0x1bb8(0x10)](_0x44d64f[_0x1bb8(0x16)]),_0x16fc27;}}};exports[_0x1bb8(0x2)]=encryptPin;function _0x2455(){const _0x5c0190=['hashPin','getEncryptedPinForAPI','encryptPin','decryptPin','onairos-pin-encryption-key-2024','🔐\x20PIN\x20encrypted\x20successfully','❌\x20Error\x20encrypting\x20PIN:','⚠️\x20No\x20temporary\x20PIN\x20available\x20for\x20encryption','✅\x20PIN\x20encrypted\x20for\x20API\x20transmission','xoyPi','ruaiT','vnipV','RUwRH','AES','encrypt','toString','log','YVERI','error','TqdaH','EUluU','getTemporaryPin','ctSHj','🔓\x20PIN\x20decrypted\x20successfully','enc','Utf8','WxWpp','NYPKD','❌\x20Error\x20getting\x20encrypted\x20PIN\x20for\x20API:','❌\x20Error\x20hashing\x20PIN:','MFQvV','VpPcL','LmSpZ','SHA256','isyDQ','ZVovC','drAze'];_0x2455=function(){return _0x5c0190;};return _0x2455();}const decryptPin=_0x481ccd=>{const _0x41165b={'ZJvSV':_0x1bb8(0x17),'LBSiN':'❌\x20Error\x20decrypting\x20PIN:'};try{const _0x273e57=CryptoJS['AES']['decrypt'](_0x481ccd,ENCRYPTION_KEY),_0x10a642=_0x273e57[_0x1bb8(0xf)](CryptoJS[_0x1bb8(0x18)][_0x1bb8(0x19)]);return console['log'](_0x41165b['ZJvSV']),_0x10a642;}catch(_0x39e915){console[_0x1bb8(0x12)](_0x41165b['LBSiN'],_0x39e915);throw _0x39e915;}};exports[_0x1bb8(0x3)]=decryptPin;const getEncryptedPinForAPI=async()=>{const _0x5c06e2={'WxWpp':function(_0x3a16b0,_0xb0e7b7){return _0x3a16b0(_0xb0e7b7);},'NYPKD':_0x1bb8(0x8)};try{const _0x100ff1=(0x0,_pinStorageUtils[_0x1bb8(0x15)])();if(!_0x100ff1)return console[_0x1bb8(0x10)]('⚠️\x20No\x20temporary\x20PIN\x20available\x20for\x20encryption'),null;const _0x19da54=_0x5c06e2[_0x1bb8(0x1a)](encryptPin,_0x100ff1);return console[_0x1bb8(0x10)](_0x5c06e2[_0x1bb8(0x1b)]),_0x19da54;}catch(_0xf833fa){return console[_0x1bb8(0x12)](_0x1bb8(0x1c),_0xf833fa),null;}};exports[_0x1bb8(0x1)]=getEncryptedPinForAPI;const hashPin=_0x648379=>{const _0xa069ac={'isyDQ':function(_0x3693f3,_0x12a550){return _0x3693f3+_0x12a550;},'drAze':_0x1bb8(0x1d),'VpPcL':function(_0x2af65e,_0x1d75fb){return _0x2af65e!==_0x1d75fb;},'LmSpZ':_0x1bb8(0x1e),'ZVovC':'🔒\x20PIN\x20hashed\x20successfully'};try{if(_0xa069ac[_0x1bb8(0x1f)](_0xa069ac[_0x1bb8(0x20)],_0xa069ac['LmSpZ']))try{const _0x2957f1=_0x1501ba[_0x1bb8(0x21)](_0xa069ac['isyDQ'](_0x1af123,_0x27ee68))[_0x1bb8(0xf)]();return _0x6273af[_0x1bb8(0x10)]('🔒\x20PIN\x20hashed\x20successfully'),_0x2957f1;}catch(_0x438ca0){_0x52345a[_0x1bb8(0x12)](_0xa069ac['drAze'],_0x438ca0);throw _0x438ca0;}else{const _0x3ec9b6=CryptoJS[_0x1bb8(0x21)](_0xa069ac[_0x1bb8(0x22)](_0x648379,ENCRYPTION_KEY))['toString']();return console[_0x1bb8(0x10)](_0xa069ac[_0x1bb8(0x23)]),_0x3ec9b6;}}catch(_0x24f0be){console[_0x1bb8(0x12)](_0xa069ac[_0x1bb8(0x24)],_0x24f0be);throw _0x24f0be;}};exports[_0x1bb8(0x0)]=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[_0x4933(0x0)](exports,'__esModule',{'value':!![]}),exports[_0x4933(0x1)]=exports[_0x4933(0x2)]=exports[_0x4933(0x3)]=exports['getStoredPinForTraining']=exports[_0x4933(0x4)]=exports[_0x4933(0x5)]=exports['clearStoredPin']=void 0x0;var _biometricPinService=__ONAIROS_REQ_FUNC__(0x0);const getStoredPinForTraining=async()=>{const _0x2aca4b={'XkwYL':_0x4933(0x6),'Qrgmx':'🗑️\x20Temporary\x20PIN\x20cleared','PASaj':'🔓\x20Retrieving\x20stored\x20PIN\x20for\x20training...','XEhWx':_0x4933(0x7),'yrvTo':'⚠️\x20No\x20PIN\x20stored\x20in\x20secure\x20storage','AgvvT':function(_0x50c4a,_0x1f3856){return _0x50c4a!==_0x1f3856;},'ZgMJS':_0x4933(0x8),'ksoDP':'✅\x20PIN\x20retrieved\x20successfully\x20for\x20training','pORxM':_0x4933(0x9),'wNkJr':'❌\x20Error\x20retrieving\x20stored\x20PIN:'};try{console[_0x4933(0xa)](_0x2aca4b[_0x4933(0xb)]);const _0x553e8e=await _biometricPinService[_0x4933(0xc)][_0x4933(0xd)]();if(!_0x553e8e){if(_0x4933(0x7)===_0x2aca4b[_0x4933(0xe)])return console[_0x4933(0xa)](_0x2aca4b[_0x4933(0xf)]),null;else _0x4c6c59=_0x444a5d,_0x35f8a1[_0x4933(0xa)](_0x2aca4b['XkwYL']);}const _0x3c9728=await _biometricPinService[_0x4933(0xc)][_0x4933(0x10)]();if(_0x3c9728){if(_0x2aca4b[_0x4933(0x11)](_0x2aca4b[_0x4933(0x12)],_0x2aca4b[_0x4933(0x12)]))_0xf78f4d=null,_0x32b3f3[_0x4933(0xa)](_0x2aca4b[_0x4933(0x13)]);else return console[_0x4933(0xa)](_0x2aca4b['ksoDP']),_0x3c9728;}else return console['log'](_0x2aca4b[_0x4933(0x14)]),null;}catch(_0xc1fc92){return console[_0x4933(0x15)](_0x2aca4b['wNkJr'],_0xc1fc92),null;}};exports[_0x4933(0x16)]=getStoredPinForTraining;const hasStoredPin=async()=>{const _0x5f44bb={'tuyzN':function(_0x4b1f,_0x11c34a){return _0x4b1f!==_0x11c34a;},'wHGXL':_0x4933(0x17),'JPZKa':_0x4933(0x18)};try{return await _biometricPinService['biometricPinService'][_0x4933(0xd)]();}catch(_0x389944){return _0x5f44bb['tuyzN'](_0x4933(0x19),_0x5f44bb['wHGXL'])?(console['error'](_0x5f44bb['JPZKa'],_0x389944),![]):(_0x5a2605['error'](_0x4933(0x1a),_0x23a19a),null);}};exports[_0x4933(0x2)]=hasStoredPin;const clearStoredPin=async()=>{const _0x26123b={'knHhD':'❌\x20Failed\x20to\x20retrieve\x20PIN\x20or\x20user\x20cancelled\x20authentication','UZyNB':_0x4933(0x1b),'ZXRTR':function(_0x11a5c4,_0x51dc6a){return _0x11a5c4!==_0x51dc6a;},'vfgut':'AwWxx','vBwbm':'OhTMW','Vwrlx':_0x4933(0x1c)};try{return console[_0x4933(0xa)](_0x26123b[_0x4933(0x1d)]),await _biometricPinService[_0x4933(0xc)][_0x4933(0x1e)]();}catch(_0x559da0){return _0x26123b['ZXRTR'](_0x26123b['vfgut'],_0x26123b[_0x4933(0x1f)])?(console['error'](_0x26123b[_0x4933(0x20)],_0x559da0),![]):(_0x30a9c9['log'](_0x26123b['knHhD']),null);}};function _0x4933(_0x2e5fbb,_0x493368){_0x2e5fbb=_0x2e5fbb-0x0;const _0xde1b77=_0x2e5f();let _0x512891=_0xde1b77[_0x2e5fbb];return _0x512891;}function _0x2e5f(){const _0xff7650=['defineProperty','setTemporaryPin','hasStoredPin','getTemporaryPin','getPinForTraining','clearTemporaryPin','📝\x20Temporary\x20PIN\x20set\x20for\x20training','mLkGW','eGvkN','❌\x20Failed\x20to\x20retrieve\x20PIN\x20or\x20user\x20cancelled\x20authentication','log','PASaj','biometricPinService','isPinStored','XEhWx','yrvTo','retrievePinWithBiometric','AgvvT','ZgMJS','Qrgmx','pORxM','error','getStoredPinForTraining','uvPIS','❌\x20Error\x20checking\x20PIN\x20storage:','OucAE','❌\x20Error\x20retrieving\x20stored\x20PIN:','🗑️\x20Clearing\x20stored\x20PIN...','❌\x20Error\x20clearing\x20stored\x20PIN:','UZyNB','removePinFromStorage','vBwbm','Vwrlx','clearStoredPin','dCotd','📝\x20Using\x20temporary\x20PIN\x20for\x20training','AUdcl','dIxQx','WKLvq'];_0x2e5f=function(){return _0xff7650;};return _0x2e5f();}exports[_0x4933(0x21)]=clearStoredPin;const getPinForTraining=async _0x27b1c3=>{const _0x1f427a={'FWBsF':_0x4933(0x18),'DdaRQ':_0x4933(0x22),'AUdcl':_0x4933(0x23),'dIxQx':function(_0x4774af){return _0x4774af();}};if(_0x27b1c3)return _0x1f427a['DdaRQ']===_0x1f427a['DdaRQ']?(console[_0x4933(0xa)](_0x1f427a[_0x4933(0x24)]),_0x27b1c3):(_0x3c9755['error'](_0x1f427a['FWBsF'],_0x507c98),![]);return await _0x1f427a[_0x4933(0x25)](getStoredPinForTraining);};exports[_0x4933(0x4)]=getPinForTraining;let temporaryPin=null;const setTemporaryPin=_0x5cd19a=>{const _0x2365da={'WKLvq':'📝\x20Temporary\x20PIN\x20set\x20for\x20training'};temporaryPin=_0x5cd19a,console['log'](_0x2365da[_0x4933(0x26)]);};exports[_0x4933(0x1)]=setTemporaryPin;const getTemporaryPin=()=>{return temporaryPin;};exports['getTemporaryPin']=getTemporaryPin;const clearTemporaryPin=()=>{temporaryPin=null,console[_0x4933(0xa)]('🗑️\x20Temporary\x20PIN\x20cleared');};exports['clearTemporaryPin']=clearTemporaryPin;
7
+ Object[_0x269b(0x0)](exports,_0x269b(0x1),{'value':!![]}),exports['setTemporaryPin']=exports[_0x269b(0x2)]=exports[_0x269b(0x3)]=exports[_0x269b(0x4)]=exports[_0x269b(0x5)]=exports['clearTemporaryPin']=exports[_0x269b(0x6)]=void 0x0;function _0x1f6f(){const _0x30d0a7=['defineProperty','__esModule','hasStoredPin','getTemporaryPin','getStoredPinForTraining','getPinForTraining','clearStoredPin','❌\x20Error\x20checking\x20PIN\x20storage:','❌\x20Failed\x20to\x20retrieve\x20PIN\x20or\x20user\x20cancelled\x20authentication','WBhTa','SoUcp','bUwKI','✅\x20PIN\x20retrieved\x20successfully\x20for\x20training','❌\x20Error\x20retrieving\x20stored\x20PIN:','log','biometricPinService','isPinStored','uveOQ','eiWNu','error','OChmA','tgvUJ','XptdX','PunKz','kzWKA','NaZVA','QeIoU','xUNTS','jwcnD','🗑️\x20Temporary\x20PIN\x20cleared','HDedA','🗑️\x20Clearing\x20stored\x20PIN...','❌\x20Error\x20clearing\x20stored\x20PIN:','ORQaD','CUUrt','removePinFromStorage','ZWybX','yhoML','📝\x20Using\x20temporary\x20PIN\x20for\x20training','bhbOs','📝\x20Temporary\x20PIN\x20set\x20for\x20training','setTemporaryPin','Glzwy','clearTemporaryPin'];_0x1f6f=function(){return _0x30d0a7;};return _0x1f6f();}var _biometricPinService=__ONAIROS_REQ_FUNC__(0x0);const getStoredPinForTraining=async()=>{const _0x1e6d54={'OChmA':_0x269b(0x7),'PunKz':_0x269b(0x8),'irumb':function(_0x54f1b9,_0x19f99b){return _0x54f1b9===_0x19f99b;},'uveOQ':_0x269b(0x9),'eiWNu':_0x269b(0xa),'tgvUJ':'⚠️\x20No\x20PIN\x20stored\x20in\x20secure\x20storage','XptdX':_0x269b(0xb),'JHMFc':_0x269b(0xc),'kzWKA':_0x269b(0xd)};try{console[_0x269b(0xe)]('🔓\x20Retrieving\x20stored\x20PIN\x20for\x20training...');const _0xfe5c5f=await _biometricPinService[_0x269b(0xf)][_0x269b(0x10)]();if(!_0xfe5c5f)return _0x1e6d54['irumb'](_0x1e6d54[_0x269b(0x11)],_0x1e6d54[_0x269b(0x12)])?(_0x2755bd[_0x269b(0x13)](_0x1e6d54[_0x269b(0x14)],_0x56a07a),![]):(console[_0x269b(0xe)](_0x1e6d54[_0x269b(0x15)]),null);const _0x2411db=await _biometricPinService['biometricPinService']['retrievePinWithBiometric']();return _0x2411db?_0x1e6d54[_0x269b(0x16)]===_0x1e6d54[_0x269b(0x16)]?(console[_0x269b(0xe)](_0x1e6d54['JHMFc']),_0x2411db):(_0x4f32d7[_0x269b(0xe)](_0x1e6d54['PunKz']),null):(console[_0x269b(0xe)](_0x1e6d54[_0x269b(0x17)]),null);}catch(_0x5dda47){return console[_0x269b(0x13)](_0x1e6d54[_0x269b(0x18)],_0x5dda47),null;}};exports[_0x269b(0x4)]=getStoredPinForTraining;const hasStoredPin=async()=>{const _0x333413={'QeIoU':function(_0x3a0d7b,_0x308942){return _0x3a0d7b!==_0x308942;},'DGSUI':_0x269b(0x19),'xUNTS':'AzLcw','jwcnD':_0x269b(0x7)};try{return await _biometricPinService[_0x269b(0xf)][_0x269b(0x10)]();}catch(_0x1329e7){if(_0x333413[_0x269b(0x1a)](_0x333413['DGSUI'],_0x333413[_0x269b(0x1b)]))return console[_0x269b(0x13)](_0x333413[_0x269b(0x1c)],_0x1329e7),![];else _0x3ac135=null,_0x1254dd[_0x269b(0xe)](_0x269b(0x1d));}};exports[_0x269b(0x2)]=hasStoredPin;const clearStoredPin=async()=>{const _0x26f56e={'ZWybX':_0x269b(0xd),'ORQaD':_0x269b(0x1e),'CUUrt':_0x269b(0x1f),'yhoML':_0x269b(0x20)};try{return _0x26f56e[_0x269b(0x21)]===_0x269b(0x1e)?(console[_0x269b(0xe)](_0x26f56e[_0x269b(0x22)]),await _biometricPinService[_0x269b(0xf)][_0x269b(0x23)]()):(_0x28f2fd[_0x269b(0x13)](_0x26f56e[_0x269b(0x24)],_0x142c79),null);}catch(_0xdbb2dc){return console[_0x269b(0x13)](_0x26f56e[_0x269b(0x25)],_0xdbb2dc),![];}};exports['clearStoredPin']=clearStoredPin;const getPinForTraining=async _0x6003f4=>{const _0x2ed1b9={'bhbOs':function(_0x39a392){return _0x39a392();}};if(_0x6003f4)return console[_0x269b(0xe)](_0x269b(0x26)),_0x6003f4;return await _0x2ed1b9[_0x269b(0x27)](getStoredPinForTraining);};exports[_0x269b(0x5)]=getPinForTraining;let temporaryPin=null;const setTemporaryPin=_0x4edef1=>{temporaryPin=_0x4edef1,console[_0x269b(0xe)](_0x269b(0x28));};exports[_0x269b(0x29)]=setTemporaryPin;const getTemporaryPin=()=>{return temporaryPin;};exports[_0x269b(0x3)]=getTemporaryPin;const clearTemporaryPin=()=>{const _0x275977={'Glzwy':_0x269b(0x1d)};temporaryPin=null,console[_0x269b(0xe)](_0x275977[_0x269b(0x2a)]);};function _0x269b(_0x1f6f2f,_0x269b41){_0x1f6f2f=_0x1f6f2f-0x0;const _0x22da62=_0x1f6f();let _0x5d9da7=_0x22da62[_0x1f6f2f];return _0x5d9da7;}exports[_0x269b(0x2b)]=clearTemporaryPin;