@onairos/react-native 3.7.1 → 3.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/lib/commonjs/api/index.js +219 -9
  2. package/lib/commonjs/assets/icons/spotify.png +0 -0
  3. package/lib/commonjs/assets/images/spotify.png +0 -0
  4. package/lib/commonjs/components/BodyText.js +27 -9
  5. package/lib/commonjs/components/BrandMark.js +111 -10
  6. package/lib/commonjs/components/CodeInput.js +116 -9
  7. package/lib/commonjs/components/EmailInput.js +30 -8
  8. package/lib/commonjs/components/GoogleButton.js +56 -9
  9. package/lib/commonjs/components/HeadingGroup.js +43 -9
  10. package/lib/commonjs/components/LLMDataInputModal.js +664 -14
  11. package/lib/commonjs/components/ModalHeader.js +99 -9
  12. package/lib/commonjs/components/ModalSheet.js +47 -9
  13. package/lib/commonjs/components/Onairos.js +380 -14
  14. package/lib/commonjs/components/OnairosButton.js +313 -13
  15. package/lib/commonjs/components/OnairosSignInButton.js +130 -12
  16. package/lib/commonjs/components/Overlay.js +465 -13
  17. package/lib/commonjs/components/PersonaImage.js +137 -10
  18. package/lib/commonjs/components/PersonaLoadingScreen.js +318 -12
  19. package/lib/commonjs/components/PersonalizationConsentScreen.js +467 -13
  20. package/lib/commonjs/components/PinCreationScreen.js +403 -12
  21. package/lib/commonjs/components/PinInput.js +464 -9
  22. package/lib/commonjs/components/PlatformConnectorsStep.js +1311 -23
  23. package/lib/commonjs/components/PlatformList.js +137 -10
  24. package/lib/commonjs/components/PlatformToggle.js +180 -9
  25. package/lib/commonjs/components/PrimaryButton.js +180 -10
  26. package/lib/commonjs/components/SignInMatchAnimation.js +197 -9
  27. package/lib/commonjs/components/SignInStep.js +345 -12
  28. package/lib/commonjs/components/UniversalOnboarding.js +2780 -30
  29. package/lib/commonjs/components/VerificationStep.js +176 -11
  30. package/lib/commonjs/components/WelcomeScreen.js +461 -22
  31. package/lib/commonjs/components/icons/Basicproficon.js +37 -8
  32. package/lib/commonjs/components/icons/Basicprofile.js +21 -8
  33. package/lib/commonjs/components/icons/Checkbox.js +21 -8
  34. package/lib/commonjs/components/icons/Checkmark.js +27 -8
  35. package/lib/commonjs/components/icons/Contentanalysis.js +21 -8
  36. package/lib/commonjs/components/icons/Contenticon.js +39 -8
  37. package/lib/commonjs/components/icons/EnochE.js +41 -8
  38. package/lib/commonjs/components/icons/Personalityicon.js +30 -8
  39. package/lib/commonjs/components/icons/Personalityprofile.js +21 -8
  40. package/lib/commonjs/components/icons/Personalitytraits.js +21 -8
  41. package/lib/commonjs/components/icons/Userpreferences.js +21 -8
  42. package/lib/commonjs/components/icons/index.js +84 -17
  43. package/lib/commonjs/components/onboarding/OAuthWebView.js +1754 -18
  44. package/lib/commonjs/components/onboarding/OnboardingHeader.js +74 -10
  45. package/lib/commonjs/components/onboarding/PinInput.js +283 -10
  46. package/lib/commonjs/components/onboarding/PlatformConnector.js +249 -11
  47. package/lib/commonjs/config/PLATFORM_APIS.md +849 -0
  48. package/lib/commonjs/config/api.js +56 -7
  49. package/lib/commonjs/constants/index.js +120 -7
  50. package/lib/commonjs/context/AuthContext.js +345 -10
  51. package/lib/commonjs/hooks/useConnectedAccounts.js +111 -9
  52. package/lib/commonjs/hooks/useConnections.js +102 -8
  53. package/lib/commonjs/hooks/useCredentials.js +178 -10
  54. package/lib/commonjs/hooks/useUserConnections.js +148 -10
  55. package/lib/commonjs/index.js +439 -34
  56. package/lib/commonjs/services/apiClient.js +298 -8
  57. package/lib/commonjs/services/biometricPinService.js +180 -8
  58. package/lib/commonjs/services/chatGPTConversationExtractor.js +155 -8
  59. package/lib/commonjs/services/chatGPTConversationService.js +275 -9
  60. package/lib/commonjs/services/claudeConversationExtractor.js +103 -8
  61. package/lib/commonjs/services/claudeConversationService.js +158 -9
  62. package/lib/commonjs/services/connectedAccountsService.js +310 -10
  63. package/lib/commonjs/services/googleAuthService.js +252 -11
  64. package/lib/commonjs/services/hingeDataExtractor.js +105 -8
  65. package/lib/commonjs/services/hingeDataService.js +150 -9
  66. package/lib/commonjs/services/imageCompressionService.js +260 -7
  67. package/lib/commonjs/services/instagramDataExtractor.js +126 -8
  68. package/lib/commonjs/services/instagramDataService.js +163 -9
  69. package/lib/commonjs/services/jwtStorageService.js +276 -7
  70. package/lib/commonjs/services/linkedinDOMExtractor.js +245 -7
  71. package/lib/commonjs/services/linkedinProfileService.js +222 -9
  72. package/lib/commonjs/services/linkedinScrapingService.js +230 -8
  73. package/lib/commonjs/services/llmDataStorage.js +294 -8
  74. package/lib/commonjs/services/mobileTrainingService.js +186 -8
  75. package/lib/commonjs/services/netflixDataExtractor.js +120 -8
  76. package/lib/commonjs/services/netflixDataService.js +198 -9
  77. package/lib/commonjs/services/pinEncryptionService.js +84 -8
  78. package/lib/commonjs/services/pinStorageUtils.js +105 -7
  79. package/lib/commonjs/services/platformAuthService.js +1484 -12
  80. package/lib/commonjs/services/sephoraDataExtractor.js +140 -8
  81. package/lib/commonjs/services/sephoraDataService.js +200 -9
  82. package/lib/commonjs/services/spotifyDataExtractor.js +148 -8
  83. package/lib/commonjs/services/spotifyDataService.js +241 -9
  84. package/lib/commonjs/services/storageService.js +404 -8
  85. package/lib/commonjs/services/telegramDataExtractor.js +115 -8
  86. package/lib/commonjs/services/telegramDataService.js +499 -9
  87. package/lib/commonjs/services/trainingApiHelpers.js +73 -7
  88. package/lib/commonjs/services/userConnectionsService.js +340 -10
  89. package/lib/commonjs/services/youtubeMigrationService.js +416 -10
  90. package/lib/commonjs/theme/index.js +250 -7
  91. package/lib/commonjs/types/ambient.d.js +2 -1
  92. package/lib/commonjs/types/declarations.d.js +2 -1
  93. package/lib/commonjs/types/index.js +6 -1
  94. package/lib/commonjs/types/node-fix.d.js +2 -1
  95. package/lib/commonjs/types/node-override.d.js +2 -1
  96. package/lib/commonjs/types/opacity.d.js +2 -1
  97. package/lib/commonjs/types.js +14 -1
  98. package/lib/commonjs/utils/Portal.js +98 -8
  99. package/lib/commonjs/utils/api.js +130 -9
  100. package/lib/commonjs/utils/assetRegistry.js +210 -35
  101. package/lib/commonjs/utils/auth.js +112 -9
  102. package/lib/commonjs/utils/connectorTests.js +613 -29
  103. package/lib/commonjs/utils/crypto.js +62 -8
  104. package/lib/commonjs/utils/debugHelper.js +64 -1
  105. package/lib/commonjs/utils/encryption.js +76 -7
  106. package/lib/commonjs/utils/eventUtils.js +288 -1
  107. package/lib/commonjs/utils/haptics.js +66 -9
  108. package/lib/commonjs/utils/imagePreloader.js +6 -1
  109. package/lib/commonjs/utils/networkDiagnostics.js +226 -8
  110. package/lib/commonjs/utils/onairosApi.js +350 -9
  111. package/lib/commonjs/utils/programmaticFlow.js +117 -9
  112. package/lib/commonjs/utils/retryHelper.js +220 -1
  113. package/lib/commonjs/utils/secureStorage.js +349 -10
  114. package/lib/commonjs/utils/webviewScripts/chatgpt.js +551 -1
  115. package/lib/commonjs/utils/webviewScripts/claude.js +376 -1
  116. package/lib/commonjs/utils/webviewScripts/hinge.js +411 -1
  117. package/lib/commonjs/utils/webviewScripts/index.js +698 -15
  118. package/lib/commonjs/utils/webviewScripts/instagram.js +454 -1
  119. package/lib/commonjs/utils/webviewScripts/linkedin.js +880 -1
  120. package/lib/commonjs/utils/webviewScripts/netflix.js +382 -1
  121. package/lib/commonjs/utils/webviewScripts/sephora.js +516 -1
  122. package/lib/commonjs/utils/webviewScripts/spotify.js +419 -1
  123. package/lib/commonjs/utils/webviewScripts/telegram.js +678 -1
  124. package/lib/module/api/index.js +211 -1
  125. package/lib/module/assets/icons/spotify.png +0 -0
  126. package/lib/module/assets/images/spotify.png +0 -0
  127. package/lib/module/components/BodyText.js +20 -1
  128. package/lib/module/components/BrandMark.js +104 -1
  129. package/lib/module/components/CodeInput.js +109 -1
  130. package/lib/module/components/EmailInput.js +23 -1
  131. package/lib/module/components/GoogleButton.js +49 -1
  132. package/lib/module/components/HeadingGroup.js +36 -1
  133. package/lib/module/components/LLMDataInputModal.js +656 -7
  134. package/lib/module/components/ModalHeader.js +92 -1
  135. package/lib/module/components/ModalSheet.js +39 -1
  136. package/lib/module/components/Onairos.js +373 -1
  137. package/lib/module/components/OnairosButton.js +305 -1
  138. package/lib/module/components/OnairosSignInButton.js +121 -1
  139. package/lib/module/components/Overlay.js +456 -1
  140. package/lib/module/components/PersonaImage.js +129 -1
  141. package/lib/module/components/PersonaLoadingScreen.js +310 -1
  142. package/lib/module/components/PersonalizationConsentScreen.js +460 -1
  143. package/lib/module/components/PinCreationScreen.js +396 -1
  144. package/lib/module/components/PinInput.js +456 -1
  145. package/lib/module/components/PlatformConnectorsStep.js +1302 -6
  146. package/lib/module/components/PlatformList.js +129 -1
  147. package/lib/module/components/PlatformToggle.js +173 -1
  148. package/lib/module/components/PrimaryButton.js +172 -1
  149. package/lib/module/components/SignInMatchAnimation.js +189 -1
  150. package/lib/module/components/SignInStep.js +338 -1
  151. package/lib/module/components/UniversalOnboarding.js +2770 -1
  152. package/lib/module/components/VerificationStep.js +168 -1
  153. package/lib/module/components/WelcomeScreen.js +453 -1
  154. package/lib/module/components/icons/Basicproficon.js +30 -1
  155. package/lib/module/components/icons/Basicprofile.js +14 -1
  156. package/lib/module/components/icons/Checkbox.js +14 -1
  157. package/lib/module/components/icons/Checkmark.js +20 -1
  158. package/lib/module/components/icons/Contentanalysis.js +14 -1
  159. package/lib/module/components/icons/Contenticon.js +32 -1
  160. package/lib/module/components/icons/EnochE.js +34 -1
  161. package/lib/module/components/icons/Personalityicon.js +23 -1
  162. package/lib/module/components/icons/Personalityprofile.js +14 -1
  163. package/lib/module/components/icons/Personalitytraits.js +14 -1
  164. package/lib/module/components/icons/Userpreferences.js +14 -1
  165. package/lib/module/components/icons/index.js +13 -1
  166. package/lib/module/components/onboarding/OAuthWebView.js +1746 -1
  167. package/lib/module/components/onboarding/OnboardingHeader.js +66 -1
  168. package/lib/module/components/onboarding/PinInput.js +274 -1
  169. package/lib/module/components/onboarding/PlatformConnector.js +240 -1
  170. package/lib/module/config/PLATFORM_APIS.md +849 -0
  171. package/lib/module/config/api.js +47 -1
  172. package/lib/module/constants/index.js +114 -1
  173. package/lib/module/context/AuthContext.js +335 -1
  174. package/lib/module/hooks/useConnectedAccounts.js +106 -1
  175. package/lib/module/hooks/useConnections.js +95 -1
  176. package/lib/module/hooks/useCredentials.js +171 -6
  177. package/lib/module/hooks/useUserConnections.js +140 -1
  178. package/lib/module/index.js +172 -1
  179. package/lib/module/services/apiClient.js +295 -1
  180. package/lib/module/services/biometricPinService.js +169 -1
  181. package/lib/module/services/chatGPTConversationExtractor.js +149 -1
  182. package/lib/module/services/chatGPTConversationService.js +268 -1
  183. package/lib/module/services/claudeConversationExtractor.js +97 -1
  184. package/lib/module/services/claudeConversationService.js +151 -1
  185. package/lib/module/services/connectedAccountsService.js +293 -1
  186. package/lib/module/services/googleAuthService.js +241 -1
  187. package/lib/module/services/hingeDataExtractor.js +99 -1
  188. package/lib/module/services/hingeDataService.js +143 -1
  189. package/lib/module/services/imageCompressionService.js +250 -1
  190. package/lib/module/services/instagramDataExtractor.js +120 -1
  191. package/lib/module/services/instagramDataService.js +156 -1
  192. package/lib/module/services/jwtStorageService.js +257 -1
  193. package/lib/module/services/linkedinDOMExtractor.js +234 -1
  194. package/lib/module/services/linkedinProfileService.js +210 -1
  195. package/lib/module/services/linkedinScrapingService.js +219 -1
  196. package/lib/module/services/llmDataStorage.js +277 -1
  197. package/lib/module/services/mobileTrainingService.js +173 -1
  198. package/lib/module/services/netflixDataExtractor.js +114 -1
  199. package/lib/module/services/netflixDataService.js +191 -1
  200. package/lib/module/services/pinEncryptionService.js +74 -6
  201. package/lib/module/services/pinStorageUtils.js +93 -1
  202. package/lib/module/services/platformAuthService.js +1461 -1
  203. package/lib/module/services/sephoraDataExtractor.js +134 -1
  204. package/lib/module/services/sephoraDataService.js +193 -1
  205. package/lib/module/services/spotifyDataExtractor.js +142 -1
  206. package/lib/module/services/spotifyDataService.js +234 -1
  207. package/lib/module/services/storageService.js +383 -1
  208. package/lib/module/services/telegramDataExtractor.js +109 -1
  209. package/lib/module/services/telegramDataService.js +493 -1
  210. package/lib/module/services/trainingApiHelpers.js +67 -1
  211. package/lib/module/services/userConnectionsService.js +329 -1
  212. package/lib/module/services/youtubeMigrationService.js +405 -1
  213. package/lib/module/theme/index.js +245 -1
  214. package/lib/module/types.js +10 -1
  215. package/lib/module/utils/Portal.js +90 -1
  216. package/lib/module/utils/api.js +118 -1
  217. package/lib/module/utils/assetRegistry.js +200 -34
  218. package/lib/module/utils/auth.js +100 -1
  219. package/lib/module/utils/connectorTests.js +600 -27
  220. package/lib/module/utils/crypto.js +54 -1
  221. package/lib/module/utils/debugHelper.js +54 -1
  222. package/lib/module/utils/encryption.js +67 -1
  223. package/lib/module/utils/eventUtils.js +270 -1
  224. package/lib/module/utils/haptics.js +59 -8
  225. package/lib/module/utils/imagePreloader.js +3 -1
  226. package/lib/module/utils/networkDiagnostics.js +217 -1
  227. package/lib/module/utils/onairosApi.js +333 -1
  228. package/lib/module/utils/programmaticFlow.js +111 -1
  229. package/lib/module/utils/retryHelper.js +211 -1
  230. package/lib/module/utils/secureStorage.js +330 -6
  231. package/lib/module/utils/webviewScripts/chatgpt.js +545 -1
  232. package/lib/module/utils/webviewScripts/claude.js +370 -1
  233. package/lib/module/utils/webviewScripts/hinge.js +405 -1
  234. package/lib/module/utils/webviewScripts/index.js +434 -1
  235. package/lib/module/utils/webviewScripts/instagram.js +448 -1
  236. package/lib/module/utils/webviewScripts/linkedin.js +874 -1
  237. package/lib/module/utils/webviewScripts/netflix.js +376 -1
  238. package/lib/module/utils/webviewScripts/sephora.js +510 -1
  239. package/lib/module/utils/webviewScripts/spotify.js +413 -1
  240. package/lib/module/utils/webviewScripts/telegram.js +672 -1
  241. package/package.json +2 -2
@@ -1,9 +1,117 @@
1
- 'use strict';
2
- // Onairos SDK - Asset Registry (auto-generated)
3
- var __ONAIROS_REQ_REGISTRY__ = [
4
- require("../services/platformAuthService"),
5
- require('../components/UniversalOnboarding'),
6
- require('react')
7
- ];
8
- function __ONAIROS_REQ_FUNC__(i) { return __ONAIROS_REQ_REGISTRY__[i]; }
9
- function _0x267f(_0x81be1c,_0x267f85){_0x81be1c=_0x81be1c-0x0;const _0x331cb0=_0x81be();let _0x3e5b2b=_0x331cb0[_0x81be1c];return _0x3e5b2b;}Object[_0x267f(0x0)](exports,'__esModule',{'value':!![]}),exports[_0x267f(0x1)]=exports['executeOnairosFlow']=void 0x0;var _platformAuthService=__ONAIROS_REQ_FUNC__(0x0);function _0x81be(){const _0x1290f6=['defineProperty','startOnairosFlow','object','default','ItQBt','function','__esModule','BifTe','has','set','BdFQf','hasOwnProperty','getOwnPropertyDescriptor','get','UuAGF','✅\x20Onairos\x20flow\x20completed\x20successfully','GRWoL','❌\x20Onairos\x20flow\x20rejected:','Onairos\x20flow\x20was\x20rejected','uWEZl','rNTDd','📱\x20Onairos\x20modal\x20should\x20be\x20displayed','gsBKG','axYKp','🚀\x20Starting\x20Onairos\x20flow\x20programmatically...','❌\x20Failed\x20to\x20execute\x20Onairos\x20flow:','McYut','IOcBk','log','hKGGm','initializePlatformAuthService','resolve','then','vsnuN','WtpNP','mKfdg','VtcqF','KwnWX','hpCal','close','ErHkM','tBsRN','nzKuV','INwhg','aoYYC','EOTtM','fIHAh','tUQMQ','call','oKDxW','onRejection','tuhYF','KNLlZ','createElement','User\x20closed\x20the\x20modal','AppName','requestData','returnLink','debug','testMode','QCzPm','YzfzV','IjOfq','wDbcE','rxrLW','WrYpD','error','whHHZ','executeOnairosFlow','Pre-check\x20failed','preCheck','WpHaI','iWyKJ','uNMMu','FAfTJ','iBbKY'];_0x81be=function(){return _0x1290f6;};return _0x81be();}function _interopRequireWildcard(_0x42fd84,_0x2f0cb4){const _0x269e4a={'BifTe':function(_0x199b7b,_0x515f40){return _0x199b7b!=_0x515f40;},'wAuzi':_0x267f(0x2),'vdKfQ':function(_0x418d28,_0x4dde48){return _0x418d28!=_0x4dde48;},'BdFQf':_0x267f(0x3),'UuAGF':function(_0x192f8f,_0x570470,_0x466153,_0x42a5a1){return _0x192f8f(_0x570470,_0x466153,_0x42a5a1);},'ItQBt':function(_0x5934bb,_0x1a4bb8){return _0x5934bb==_0x1a4bb8;}};if(_0x269e4a[_0x267f(0x4)](_0x267f(0x5),typeof WeakMap))var _0x59e725=new WeakMap(),_0x1e4f16=new WeakMap();return(_interopRequireWildcard=function(_0xe2579b,_0x21d70e){if(!_0x21d70e&&_0xe2579b&&_0xe2579b[_0x267f(0x6)])return _0xe2579b;var _0x44b52d,_0x285147,_0x56d1dd={'__proto__':null,'default':_0xe2579b};if(null===_0xe2579b||_0x269e4a[_0x267f(0x7)](_0x269e4a['wAuzi'],typeof _0xe2579b)&&_0x269e4a['vdKfQ'](_0x267f(0x5),typeof _0xe2579b))return _0x56d1dd;if(_0x44b52d=_0x21d70e?_0x1e4f16:_0x59e725){if(_0x44b52d[_0x267f(0x8)](_0xe2579b))return _0x44b52d['get'](_0xe2579b);_0x44b52d[_0x267f(0x9)](_0xe2579b,_0x56d1dd);}for(const _0xadf249 in _0xe2579b)_0x269e4a[_0x267f(0xa)]!==_0xadf249&&{}[_0x267f(0xb)]['call'](_0xe2579b,_0xadf249)&&((_0x285147=(_0x44b52d=Object[_0x267f(0x0)])&&Object[_0x267f(0xc)](_0xe2579b,_0xadf249))&&(_0x285147[_0x267f(0xd)]||_0x285147[_0x267f(0x9)])?_0x269e4a[_0x267f(0xe)](_0x44b52d,_0x56d1dd,_0xadf249,_0x285147):_0x56d1dd[_0xadf249]=_0xe2579b[_0xadf249]);return _0x56d1dd;})(_0x42fd84,_0x2f0cb4);}const executeOnairosFlow=async _0x419da1=>{const _0x194074={'ayVdo':_0x267f(0xf),'ErHkM':'lMSpV','tBsRN':_0x267f(0x10),'fDDtk':function(_0x411dd1){return _0x411dd1();},'nzKuV':_0x267f(0x11),'INwhg':function(_0x301d1e,_0x50ed9e){return _0x301d1e===_0x50ed9e;},'aoYYC':'EOTtM','tuhYF':function(_0x1bb97a,_0xf76fc2){return _0x1bb97a(_0xf76fc2);},'KNLlZ':function(_0x11840f,_0x347693){return _0x11840f||_0x347693;},'DwbGt':_0x267f(0x12),'vsnuN':function(_0x5a10be,_0x5c8ccb){return _0x5a10be&&_0x5c8ccb;},'DTbkS':function(_0x1047e5,_0x5e67b2){return _0x1047e5!=_0x5e67b2;},'WtpNP':_0x267f(0x2),'VtcqF':function(_0x4de522,_0x54d642){return _0x4de522!==_0x54d642;},'mKfdg':function(_0x2f136b,_0x28823e,_0x355eef,_0x16220b){return _0x2f136b(_0x28823e,_0x355eef,_0x16220b);},'KwnWX':_0x267f(0x13),'hpCal':_0x267f(0x14),'QCzPm':_0x267f(0x15),'WGYKK':function(_0x3820ea,_0x26bd31){return _0x3820ea===_0x26bd31;},'YzfzV':function(_0x48f2e0,_0x5400a0){return _0x48f2e0!=_0x5400a0;},'IjOfq':function(_0x6258a6,_0xdbe115){return _0x6258a6!=_0xdbe115;},'wDbcE':_0x267f(0x5),'JpVMd':function(_0x440a4b,_0x38e252){return _0x440a4b!==_0x38e252;},'rxrLW':_0x267f(0x3),'rzPLw':function(_0x15c4f4,_0xf0659c){return _0x15c4f4==_0xf0659c;},'McYut':function(_0x154109,_0x12ac8f){return _0x154109!==_0x12ac8f;},'riXeT':_0x267f(0x16),'IOcBk':_0x267f(0x17),'hKGGm':_0x267f(0x18),'TzDmG':function(_0x38fed2,_0x2d2ee5){return _0x38fed2!==_0x2d2ee5;},'rvTAA':'Qcsos','whHHZ':_0x267f(0x19)};try{if(_0x194074[_0x267f(0x1a)](_0x194074['riXeT'],_0x194074[_0x267f(0x1b)])){console[_0x267f(0x1c)](_0x194074[_0x267f(0x1d)]),await(0x0,_platformAuthService[_0x267f(0x1e)])();const {UniversalOnboarding:_0x3469ed}=await Promise[_0x267f(0x1f)]()[_0x267f(0x20)](()=>_interopRequireWildcard(__ONAIROS_REQ_FUNC__(0x1))),React=await Promise[_0x267f(0x1f)]()['then'](()=>_interopRequireWildcard(__ONAIROS_REQ_FUNC__(0x2)));return new Promise((_0x3bddf0,_0x46fd19)=>{const _0xc80451={'fIHAh':function(_0x407cc7,_0x173dc4){return _0x194074[_0x267f(0x21)](_0x407cc7,_0x173dc4);},'JnhXz':function(_0x571315,_0x1dd8ef){return _0x194074['DTbkS'](_0x571315,_0x1dd8ef);},'tYnuP':_0x194074[_0x267f(0x22)],'tUQMQ':function(_0x13718b,_0x19a854){return _0x194074['VtcqF'](_0x13718b,_0x19a854);},'oKDxW':function(_0x443498,_0x2ca07f,_0x5a84bb,_0x32df11){return _0x194074[_0x267f(0x23)](_0x443498,_0x2ca07f,_0x5a84bb,_0x32df11);}};if(_0x194074[_0x267f(0x24)](_0x194074[_0x267f(0x25)],_0x194074[_0x267f(0x26)])){let _0x33c13c=null;const _0x270fb4=(_0x546c87,_0x28610b,_0x112521)=>{console['log'](_0x194074['ayVdo']),_0x33c13c&&_0x33c13c['close']&&_0x33c13c[_0x267f(0x27)](),_0x419da1['onResolved']&&(_0x194074[_0x267f(0x28)]===_0x194074[_0x267f(0x29)]?_0x27c981[_0x267f(0x27)]():_0x419da1['onResolved'](_0x546c87,_0x28610b,_0x112521)),_0x194074['fDDtk'](_0x3bddf0);},_0x558384=_0x1a42db=>{console[_0x267f(0x1c)](_0x194074[_0x267f(0x2a)],_0x1a42db);if(_0x33c13c&&_0x33c13c[_0x267f(0x27)]){if(_0x194074[_0x267f(0x2b)](_0x194074[_0x267f(0x2c)],_0x267f(0x2d)))_0x33c13c['close']();else{if(_0xc80451[_0x267f(0x2e)](!_0x408573,_0x1b5f5a)&&_0x31a41c[_0x267f(0x6)])return _0x539035;var _0x167525,_0xaec5e2,_0x2f6808={'__proto__':null,'default':_0x17dcb8};if(null===_0x2f84fc||_0xc80451['JnhXz'](_0xc80451['tYnuP'],typeof _0x3b0cb4)&&'function'!=typeof _0x1149c0)return _0x2f6808;if(_0x167525=_0x4849d1?_0x8e525d:_0x3195d0){if(_0x167525[_0x267f(0x8)](_0x5bdd3d))return _0x167525[_0x267f(0xd)](_0x95c440);_0x167525[_0x267f(0x9)](_0x277e8e,_0x2f6808);}for(const _0x4ecd57 in _0x4076f2)_0xc80451[_0x267f(0x2f)](_0x267f(0x3),_0x4ecd57)&&{}[_0x267f(0xb)][_0x267f(0x30)](_0x49d49a,_0x4ecd57)&&((_0xaec5e2=(_0x167525=_0x2b077d['defineProperty'])&&_0x417fb6['getOwnPropertyDescriptor'](_0x33ed97,_0x4ecd57))&&(_0xaec5e2['get']||_0xaec5e2['set'])?_0xc80451[_0x267f(0x31)](_0x167525,_0x2f6808,_0x4ecd57,_0xaec5e2):_0x2f6808[_0x4ecd57]=_0x352933[_0x4ecd57]);return _0x2f6808;}}_0x419da1[_0x267f(0x32)]&&_0x419da1['onRejection'](_0x1a42db),_0x194074[_0x267f(0x33)](_0x46fd19,new Error(_0x194074[_0x267f(0x34)](_0x1a42db,_0x194074['DwbGt'])));},_0xf1e6a=React[_0x267f(0x35)](_0x3469ed,{'visible':!![],'onClose':()=>_0x558384(_0x267f(0x36)),'AppName':_0x419da1[_0x267f(0x37)],'requestData':_0x419da1[_0x267f(0x38)],'returnLink':_0x419da1[_0x267f(0x39)],'onComplete':_0x270fb4,'preferredPlatform':_0x419da1['preferredPlatform'],'debug':_0x419da1[_0x267f(0x3a)],'testMode':_0x419da1[_0x267f(0x3b)]});_0x33c13c=_0xf1e6a,console['log'](_0x194074[_0x267f(0x3c)]);}else _0xe1b590['onResolved'](_0xcbd2a2,_0x483295,_0x97c6f7);});}else{if(_0x194074['rzPLw'](_0x194074['wDbcE'],typeof _0x411545))var _0x353ffe=new _0x5c2d83(),_0x1cf5b9=new _0x117ea5();return(_0x1be119=function(_0x3183da,_0xffd60e){if(_0x194074['vsnuN'](!_0xffd60e,_0x3183da)&&_0x3183da[_0x267f(0x6)])return _0x3183da;var _0x19a2e6,_0x455a18,_0x5afa41={'__proto__':null,'default':_0x3183da};if(_0x194074['WGYKK'](null,_0x3183da)||_0x194074[_0x267f(0x3d)](_0x194074[_0x267f(0x22)],typeof _0x3183da)&&_0x194074[_0x267f(0x3e)](_0x194074[_0x267f(0x3f)],typeof _0x3183da))return _0x5afa41;if(_0x19a2e6=_0xffd60e?_0x1cf5b9:_0x353ffe){if(_0x19a2e6[_0x267f(0x8)](_0x3183da))return _0x19a2e6[_0x267f(0xd)](_0x3183da);_0x19a2e6[_0x267f(0x9)](_0x3183da,_0x5afa41);}for(const _0x3176a3 in _0x3183da)_0x194074['JpVMd'](_0x194074[_0x267f(0x40)],_0x3176a3)&&{}[_0x267f(0xb)][_0x267f(0x30)](_0x3183da,_0x3176a3)&&((_0x455a18=(_0x19a2e6=_0x53ae1d[_0x267f(0x0)])&&_0x14172e['getOwnPropertyDescriptor'](_0x3183da,_0x3176a3))&&(_0x455a18['get']||_0x455a18['set'])?_0x194074[_0x267f(0x23)](_0x19a2e6,_0x5afa41,_0x3176a3,_0x455a18):_0x5afa41[_0x3176a3]=_0x3183da[_0x3176a3]);return _0x5afa41;})(_0x464e1c,_0xbb4ede);}}catch(_0x4686c8){if(_0x194074['TzDmG'](_0x267f(0x41),_0x194074['rvTAA'])){console[_0x267f(0x42)](_0x194074[_0x267f(0x43)],_0x4686c8);throw _0x4686c8;}else{if(_0x1237f1[_0x267f(0x8)](_0x404552))return _0x118d35[_0x267f(0xd)](_0x5c1763);_0x1ab8c5['set'](_0x86b940,_0x503fbe);}}};exports[_0x267f(0x44)]=executeOnairosFlow;const startOnairosFlow=async _0x49caf2=>{const _0x4d6206={'WpHaI':'❌\x20Pre-check\x20failed,\x20not\x20starting\x20Onairos\x20flow','iWyKJ':function(_0xa099af,_0x183ce4){return _0xa099af!==_0x183ce4;},'uNMMu':'EqWDu','FAfTJ':_0x267f(0x45),'iBbKY':function(_0x2d3090,_0x5d6fcc){return _0x2d3090(_0x5d6fcc);}};if(_0x49caf2[_0x267f(0x46)]){const _0x501f4a=await _0x49caf2[_0x267f(0x46)]();if(!_0x501f4a){console[_0x267f(0x1c)](_0x4d6206[_0x267f(0x47)]);_0x49caf2[_0x267f(0x32)]&&(_0x4d6206[_0x267f(0x48)](_0x4d6206[_0x267f(0x49)],_0x4d6206[_0x267f(0x49)])?_0x1b6c35[_0x267f(0x32)](_0xf998d7):_0x49caf2[_0x267f(0x32)](_0x4d6206[_0x267f(0x4a)]));return;}}return _0x4d6206[_0x267f(0x4b)](executeOnairosFlow,_0x49caf2);};exports[_0x267f(0x1)]=startOnairosFlow;
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.startOnairosFlow = exports.executeOnairosFlow = void 0;
7
+ var _platformAuthService = require("../services/platformAuthService");
8
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); } /**
9
+ * Programmatic Onairos Flow
10
+ *
11
+ * This function executes the complete Onairos authentication and onboarding flow
12
+ * that can be attached to custom buttons or called programmatically.
13
+ */
14
+ /**
15
+ * Execute the complete Onairos flow programmatically
16
+ * This is the same logic that the OnairosButton uses internally
17
+ *
18
+ * @param options Configuration options for the flow
19
+ * @returns Promise that resolves when flow is complete
20
+ */
21
+ const executeOnairosFlow = async options => {
22
+ try {
23
+ console.log('🚀 Starting Onairos flow programmatically...');
24
+
25
+ // Initialize API key service if not already initialized
26
+ await (0, _platformAuthService.initializePlatformAuthService)();
27
+
28
+ // Import components dynamically to avoid circular dependencies
29
+ const {
30
+ UniversalOnboarding
31
+ } = await Promise.resolve().then(() => _interopRequireWildcard(require('../components/UniversalOnboarding')));
32
+ const React = await Promise.resolve().then(() => _interopRequireWildcard(require('react')));
33
+
34
+ // Create a promise that resolves when the flow is complete
35
+ return new Promise((resolve, reject) => {
36
+ let modalRef = null;
37
+ const handleComplete = (apiUrl, token, userData) => {
38
+ console.log('✅ Onairos flow completed successfully');
39
+
40
+ // Clean up modal
41
+ if (modalRef && modalRef.close) {
42
+ modalRef.close();
43
+ }
44
+
45
+ // Call user's onResolved callback
46
+ if (options.onResolved) {
47
+ options.onResolved(apiUrl, token, userData);
48
+ }
49
+ resolve();
50
+ };
51
+ const handleRejection = error => {
52
+ console.log('❌ Onairos flow rejected:', error);
53
+
54
+ // Clean up modal
55
+ if (modalRef && modalRef.close) {
56
+ modalRef.close();
57
+ }
58
+
59
+ // Call user's onRejection callback
60
+ if (options.onRejection) {
61
+ options.onRejection(error);
62
+ }
63
+ reject(new Error(error || 'Onairos flow was rejected'));
64
+ };
65
+
66
+ // Create and show the Universal Onboarding modal
67
+ const modalElement = React.createElement(UniversalOnboarding, {
68
+ visible: true,
69
+ onClose: () => handleRejection('User closed the modal'),
70
+ AppName: options.AppName,
71
+ requestData: options.requestData,
72
+ returnLink: options.returnLink,
73
+ onComplete: handleComplete,
74
+ preferredPlatform: options.preferredPlatform,
75
+ debug: options.debug,
76
+ testMode: options.testMode
77
+ });
78
+
79
+ // Store modal reference for cleanup
80
+ modalRef = modalElement;
81
+
82
+ // Note: In a real implementation, you'd need to render this modal
83
+ // This is a simplified version - the actual implementation would
84
+ // need to handle React rendering in the current app context
85
+ console.log('📱 Onairos modal should be displayed');
86
+ });
87
+ } catch (error) {
88
+ console.error('❌ Failed to execute Onairos flow:', error);
89
+ throw error;
90
+ }
91
+ };
92
+
93
+ /**
94
+ * Simple wrapper function that matches the OnairosButton click behavior
95
+ *
96
+ * @param options Configuration options for the flow
97
+ * @returns Promise that resolves when flow is complete
98
+ */
99
+ exports.executeOnairosFlow = executeOnairosFlow;
100
+ const startOnairosFlow = async options => {
101
+ // Pre-check if provided
102
+ if (options.preCheck) {
103
+ const canProceed = await options.preCheck();
104
+ if (!canProceed) {
105
+ console.log('❌ Pre-check failed, not starting Onairos flow');
106
+ if (options.onRejection) {
107
+ options.onRejection('Pre-check failed');
108
+ }
109
+ return;
110
+ }
111
+ }
112
+
113
+ // Execute the flow
114
+ return executeOnairosFlow(options);
115
+ };
116
+ exports.startOnairosFlow = startOnairosFlow;
117
+ //# sourceMappingURL=programmaticFlow.js.map
@@ -1 +1,220 @@
1
- 'use strict';Object[_0x5126(0x0)](exports,_0x5126(0x1),{'value':!![]}),exports[_0x5126(0x2)]=exports[_0x5126(0x3)]=exports[_0x5126(0x4)]=void 0x0,exports[_0x5126(0x5)]=fetchWithRetry,exports[_0x5126(0x6)]=healthCheck,exports[_0x5126(0x7)]=withRetry;function _0x5126(_0x487d78,_0x512634){_0x487d78=_0x487d78-0x0;const _0x24bef8=_0x487d();let _0x180803=_0x24bef8[_0x487d78];return _0x180803;}function _0x487d(){const _0xa977a4=['defineProperty','__esModule','NETWORK_RETRY_OPTIONS','DEFAULT_RETRY_OPTIONS','API_RETRY_OPTIONS','fetchWithRetry','healthCheck','withRetry','Network\x20request\x20failed','bnNxq','status','DLbGB','dQYTU','hQHKc','voZNw','name','message','includes','DKryZ','fetch','kDdcJ','snNtN','JSON\x20Parse\x20error','Unexpected\x20character','FRkzb','RzYgJ','Wqfyg','gOLAh','now','RmYvs','NVvPw','maxRetries','NxpaJ','wtxaO','ZJXcg','error','enableLogging','log','nZWnd','NhkQs','shouldRetry','baseDelay','exponentialBackoff','iGIHo','Jxeys','⏳\x20Waiting\x20','ms\x20before\x20retry\x20(attempt\x20','min','Wegtq','pow','maxDelay','Vijdk','oBqWk','random','onRetry','ylxvP','ZttRf','ynTgB','Unknown\x20error','DFeQD','mtvzr','LGyOF','timeout','ENOTFOUND','rLHqH','gFddY','PUXqy','xLKmM','RlUNB','kvMWa','KLASE','),\x20retrying\x20in\x20','ms:\x20','AbortError','ipAoE','hWFjW','DNS','LBhNY','zMDtX','success','data','OnairosReactNative/HealthCheck','KsrLa','signal','BshSl','yQujZ','ytxaO'];_0x487d=function(){return _0xa977a4;};return _0x487d();}const DEFAULT_RETRY_OPTIONS=exports[_0x5126(0x3)]={'maxRetries':0x3,'baseDelay':0x3e8,'maxDelay':0x1388,'exponentialBackoff':!![],'enableLogging':![],'shouldRetry':(_0x1e20cf,_0x5ce4a6)=>{const _0x140b30={'ndyxJ':function(_0x4057ee,_0x3fea27){return _0x4057ee>=_0x3fea27;},'DLbGB':function(_0x121181,_0x457877){return _0x121181<_0x457877;},'dQYTU':function(_0x988080,_0x32684c){return _0x988080!==_0x32684c;},'hQHKc':function(_0x207d58,_0x4e5792){return _0x207d58!==_0x4e5792;},'voZNw':function(_0x23f8d5,_0x4bc24a){return _0x23f8d5===_0x4bc24a;},'TAWTl':'AbortError','DKryZ':_0x5126(0x8),'kDdcJ':function(_0x527ada,_0x494b99){return _0x527ada>=_0x494b99;},'ZiCFY':'ZricP','snNtN':_0x5126(0x9)};if(_0x140b30['ndyxJ'](_0x1e20cf[_0x5126(0xa)],0x190)&&_0x140b30[_0x5126(0xb)](_0x1e20cf[_0x5126(0xa)],0x1f4)&&_0x140b30[_0x5126(0xc)](_0x1e20cf['status'],0x198)&&_0x140b30[_0x5126(0xd)](_0x1e20cf[_0x5126(0xa)],0x1ad))return![];if(_0x140b30[_0x5126(0xe)](_0x1e20cf[_0x5126(0xf)],_0x140b30['TAWTl'])||_0x1e20cf[_0x5126(0x10)][_0x5126(0x11)](_0x140b30[_0x5126(0x12)])||_0x1e20cf[_0x5126(0x10)]['includes'](_0x5126(0x13))||_0x1e20cf[_0x5126(0x10)][_0x5126(0x11)]('ENOTFOUND')||_0x1e20cf[_0x5126(0x10)][_0x5126(0x11)]('timeout')||_0x140b30[_0x5126(0x14)](_0x1e20cf[_0x5126(0xa)],0x1f4))return _0x140b30['ZiCFY']!==_0x140b30[_0x5126(0x15)]?!![]:!![];if(_0x1e20cf[_0x5126(0x10)][_0x5126(0x11)](_0x5126(0x16))||_0x1e20cf[_0x5126(0x10)]['includes'](_0x5126(0x17)))return!![];return![];}};async function withRetry(_0x32b519,_0x1c14e9={}){const _0x1ac2d0={'RmYvs':function(_0x179843,_0x5e297c){return _0x179843<=_0x5e297c;},'NVvPw':function(_0x40eb79,_0x266225){return _0x40eb79+_0x266225;},'NxpaJ':function(_0x1fd920,_0x1b6f82){return _0x1fd920===_0x1b6f82;},'wtxaO':_0x5126(0x18),'ZJXcg':_0x5126(0x19),'nZWnd':function(_0x22cc9e){return _0x22cc9e();},'mtvzr':function(_0x1c0298,_0x288dbd){return _0x1c0298-_0x288dbd;},'iGIHo':function(_0x97d511,_0x186e96){return _0x97d511!==_0x186e96;},'NhkQs':'IGAZT','TjKZs':_0x5126(0x1a),'vrHlX':function(_0x3eef9d,_0x521847){return _0x3eef9d>_0x521847;},'Jxeys':_0x5126(0x1b),'Wegtq':function(_0x25a836,_0x276545){return _0x25a836*_0x276545;},'Vijdk':function(_0x4ae31b,_0xf4b690){return _0x4ae31b*_0xf4b690;},'oBqWk':function(_0x359039,_0x48b3d0){return _0x359039*_0x48b3d0;},'gZxfG':'tZokF','ylxvP':'WoMDn','ZttRf':'wPtNZ','ynTgB':function(_0x15ef2b,_0x2f747a){return _0x15ef2b+_0x2f747a;},'DFeQD':function(_0x515d13,_0x42b14d){return _0x515d13+_0x42b14d;}},_0x52da8c={...DEFAULT_RETRY_OPTIONS,..._0x1c14e9},_0x36f775=Date[_0x5126(0x1c)]();let _0x2860d3=null;for(let _0x241e47=0x1;_0x1ac2d0[_0x5126(0x1d)](_0x241e47,_0x1ac2d0[_0x5126(0x1e)](_0x52da8c[_0x5126(0x1f)],0x1));_0x241e47++){if(_0x1ac2d0[_0x5126(0x20)](_0x1ac2d0[_0x5126(0x21)],_0x1ac2d0[_0x5126(0x22)]))_0xac6842[_0x5126(0x23)]('❌\x20All\x20retry\x20attempts\x20exhausted\x20or\x20error\x20not\x20retryable:\x20'+_0x4f2350[_0x5126(0x10)]);else try{_0x52da8c[_0x5126(0x24)]&&_0x241e47>0x1&&console[_0x5126(0x25)]('🔄\x20Retry\x20attempt\x20'+_0x241e47+'/'+_0x1ac2d0[_0x5126(0x1e)](_0x52da8c[_0x5126(0x1f)],0x1));const _0x5f0f77=await _0x1ac2d0[_0x5126(0x26)](_0x32b519);return{'success':!![],'data':_0x5f0f77,'attempts':_0x241e47,'totalDuration':_0x1ac2d0['mtvzr'](Date[_0x5126(0x1c)](),_0x36f775)};}catch(_0x2ef70a){if(_0x1ac2d0['iGIHo'](_0x1ac2d0[_0x5126(0x27)],_0x1ac2d0['TjKZs'])){_0x2860d3=_0x2ef70a;const _0x25f8b6=_0x52da8c[_0x5126(0x28)]?_0x52da8c[_0x5126(0x28)](_0x2ef70a,_0x241e47):!![];if(_0x1ac2d0['vrHlX'](_0x241e47,_0x52da8c['maxRetries'])||!_0x25f8b6){_0x52da8c[_0x5126(0x24)]&&console[_0x5126(0x23)]('❌\x20All\x20retry\x20attempts\x20exhausted\x20or\x20error\x20not\x20retryable:\x20'+_0x2ef70a['message']);break;}let _0x2548fd=_0x52da8c[_0x5126(0x29)];_0x52da8c[_0x5126(0x2a)]&&(_0x1ac2d0[_0x5126(0x2b)](_0x5126(0x1b),_0x1ac2d0[_0x5126(0x2c)])?_0x19eb15[_0x5126(0x25)](_0x5126(0x2d)+_0x3395b9+_0x5126(0x2e)+_0x46ffc0+'/'+(_0x4b46c4['maxRetries']+0x1)+')'):_0x2548fd=Math[_0x5126(0x2f)](_0x1ac2d0[_0x5126(0x30)](_0x52da8c['baseDelay'],Math[_0x5126(0x31)](0x2,_0x241e47-0x1)),_0x52da8c[_0x5126(0x32)]));const _0x24ee4e=_0x1ac2d0[_0x5126(0x33)](_0x1ac2d0[_0x5126(0x34)](Math[_0x5126(0x35)](),0.1),_0x2548fd);_0x2548fd=Math['floor'](_0x2548fd+_0x24ee4e);_0x52da8c[_0x5126(0x36)]&&(_0x1ac2d0[_0x5126(0x2b)](_0x1ac2d0['gZxfG'],_0x1ac2d0[_0x5126(0x37)])?_0x52da8c[_0x5126(0x36)](_0x2ef70a,_0x241e47,_0x2548fd):_0x30df76[_0x5126(0x36)](_0x5120dc,_0x195230,_0x1c0616));if(_0x52da8c[_0x5126(0x24)]){if(_0x1ac2d0[_0x5126(0x38)]!==_0x1ac2d0['ZttRf'])throw _0x2dc690['error'];else console[_0x5126(0x25)]('⏳\x20Waiting\x20'+_0x2548fd+_0x5126(0x2e)+_0x241e47+'/'+_0x1ac2d0[_0x5126(0x39)](_0x52da8c['maxRetries'],0x1)+')');}await new Promise(_0xabcdf7=>setTimeout(()=>_0xabcdf7(),_0x2548fd));}else return!![];}}return{'success':![],'error':_0x2860d3||new Error(_0x5126(0x3a)),'attempts':_0x1ac2d0[_0x5126(0x3b)](_0x52da8c[_0x5126(0x1f)],0x1),'totalDuration':_0x1ac2d0[_0x5126(0x3c)](Date[_0x5126(0x1c)](),_0x36f775)};}const API_RETRY_OPTIONS=exports[_0x5126(0x4)]={'maxRetries':0x3,'baseDelay':0x3e8,'maxDelay':0x1388,'exponentialBackoff':!![],'shouldRetry':(_0x298e62,_0x30b81e)=>{const _0x413787={'rLHqH':function(_0x3e6401,_0x41fda1){return _0x3e6401===_0x41fda1;},'toGIW':function(_0x122b5b,_0x103296){return _0x122b5b!==_0x103296;},'gFddY':_0x5126(0x3d),'xLKmM':function(_0x2b194c,_0x3aff3c){return _0x2b194c===_0x3aff3c;},'PUXqy':'validation\x20endpoint','RlUNB':function(_0x1ca398,_0x2799d3){return _0x1ca398>=_0x2799d3;},'yIctp':function(_0x10f901,_0x2526d9){return _0x10f901===_0x2526d9;},'Zhdic':_0x5126(0x3e),'kvMWa':_0x5126(0x13),'SyhAj':_0x5126(0x3f),'KLASE':_0x5126(0x16),'dBlpK':'HTML\x20page\x20instead\x20of\x20JSON'};if(_0x413787[_0x5126(0x40)](_0x298e62['status'],0x191)||_0x413787[_0x5126(0x40)](_0x298e62[_0x5126(0xa)],0x193))return _0x413787['toGIW'](_0x413787[_0x5126(0x41)],_0x413787['gFddY'])?![]:![];if(_0x298e62[_0x5126(0xa)]===0x190||_0x413787['xLKmM'](_0x298e62[_0x5126(0xa)],0x194)&&!_0x298e62[_0x5126(0x10)]['includes'](_0x413787[_0x5126(0x42)]))return![];if(_0x413787[_0x5126(0x43)](_0x298e62[_0x5126(0xa)],0x1ad))return _0x30b81e<=0x2;if(_0x413787[_0x5126(0x44)](_0x298e62[_0x5126(0xa)],0x1f4))return!![];if(_0x413787['yIctp'](_0x298e62[_0x5126(0xf)],'AbortError')||_0x298e62[_0x5126(0x10)][_0x5126(0x11)](_0x413787['Zhdic'])||_0x298e62[_0x5126(0x10)][_0x5126(0x11)](_0x5126(0x8))||_0x298e62[_0x5126(0x10)][_0x5126(0x11)](_0x413787[_0x5126(0x45)])||_0x298e62[_0x5126(0x10)]['includes'](_0x413787['SyhAj']))return!![];if(_0x298e62[_0x5126(0x10)][_0x5126(0x11)](_0x413787[_0x5126(0x46)])||_0x298e62[_0x5126(0x10)]['includes'](_0x5126(0x17))||_0x298e62[_0x5126(0x10)]['includes'](_0x413787['dBlpK']))return!![];return![];},'onRetry':(_0x2b7ac6,_0x22d4cf,_0x397c21)=>{console['warn']('⚠️\x20API\x20call\x20failed\x20(attempt\x20'+_0x22d4cf+_0x5126(0x47)+_0x397c21+_0x5126(0x48)+_0x2b7ac6[_0x5126(0x10)]);}},NETWORK_RETRY_OPTIONS=exports[_0x5126(0x2)]={'maxRetries':0x2,'baseDelay':0x7d0,'maxDelay':0x1f40,'exponentialBackoff':!![],'shouldRetry':(_0x49b54e,_0x2c484a)=>{const _0x1da2a5={'ipAoE':_0x5126(0x8),'hWFjW':_0x5126(0x3f),'LBhNY':_0x5126(0x49)};return _0x49b54e['message'][_0x5126(0x11)](_0x1da2a5[_0x5126(0x4a)])||_0x49b54e['message']['includes'](_0x1da2a5[_0x5126(0x4b)])||_0x49b54e[_0x5126(0x10)][_0x5126(0x11)](_0x5126(0x4c))||_0x49b54e['name']===_0x1da2a5[_0x5126(0x4d)];}};async function fetchWithRetry(_0x42c323,_0x456cbc={},_0xe14fe3=API_RETRY_OPTIONS){const _0x5f43fc={'zMDtX':function(_0x17fb00,_0x4bbfa8,_0x3cda3f){return _0x17fb00(_0x4bbfa8,_0x3cda3f);}},_0x2ce658=await _0x5f43fc[_0x5126(0x4e)](withRetry,()=>fetch(_0x42c323,_0x456cbc),_0xe14fe3);if(!_0x2ce658[_0x5126(0x4f)])throw _0x2ce658[_0x5126(0x23)];return _0x2ce658[_0x5126(0x50)];}async function healthCheck(_0x106fdd,_0x989d51=0x1388){const _0x2228c6={'CJGPj':function(_0x26f695,_0x4bee56,_0xa57587){return _0x26f695(_0x4bee56,_0xa57587);},'KsrLa':function(_0x360014,_0x57e40f,_0x505f67){return _0x360014(_0x57e40f,_0x505f67);},'BshSl':_0x5126(0x51),'yQujZ':function(_0x384aeb,_0x300362){return _0x384aeb-_0x300362;},'EkyZi':function(_0x310b0a,_0x33af3a){return _0x310b0a!==_0x33af3a;},'ytxaO':'FsUTm'},_0x409013=Date[_0x5126(0x1c)]();try{const _0x55aead=new AbortController(),_0x3d381f=_0x2228c6['CJGPj'](setTimeout,()=>_0x55aead['abort'](),_0x989d51),_0x16ae69=await _0x2228c6[_0x5126(0x52)](fetch,_0x106fdd,{'method':'GET','signal':_0x55aead[_0x5126(0x53)],'headers':{'User-Agent':_0x2228c6[_0x5126(0x54)]}});return clearTimeout(_0x3d381f),{'reachable':!![],'status':_0x16ae69[_0x5126(0xa)],'duration':_0x2228c6[_0x5126(0x55)](Date[_0x5126(0x1c)](),_0x409013)};}catch(_0x3bbf07){return _0x2228c6['EkyZi'](_0x2228c6[_0x5126(0x56)],_0x2228c6[_0x5126(0x56)])?!![]:{'reachable':![],'error':_0x3bbf07['message'],'duration':_0x2228c6[_0x5126(0x55)](Date[_0x5126(0x1c)](),_0x409013)};}}
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.NETWORK_RETRY_OPTIONS = exports.DEFAULT_RETRY_OPTIONS = exports.API_RETRY_OPTIONS = void 0;
7
+ exports.fetchWithRetry = fetchWithRetry;
8
+ exports.healthCheck = healthCheck;
9
+ exports.withRetry = withRetry;
10
+ /**
11
+ * 🔄 Retry Helper Utility
12
+ *
13
+ * Provides robust retry logic with exponential backoff for network operations.
14
+ * Used throughout the Onairos SDK for handling transient failures gracefully.
15
+ */
16
+
17
+ /**
18
+ * Default retry options for the Onairos SDK
19
+ */
20
+ const DEFAULT_RETRY_OPTIONS = exports.DEFAULT_RETRY_OPTIONS = {
21
+ maxRetries: 3,
22
+ baseDelay: 1000,
23
+ maxDelay: 5000,
24
+ exponentialBackoff: true,
25
+ enableLogging: false,
26
+ shouldRetry: (error, attempt) => {
27
+ // Don't retry client errors (4xx) except for 408 (timeout) and 429 (rate limit)
28
+ if (error.status >= 400 && error.status < 500 && error.status !== 408 && error.status !== 429) {
29
+ return false;
30
+ }
31
+
32
+ // Retry network errors, timeouts, and server errors (5xx)
33
+ if (error.name === 'AbortError' || error.message.includes('Network request failed') || error.message.includes('fetch') || error.message.includes('ENOTFOUND') || error.message.includes('timeout') || error.status >= 500) {
34
+ return true;
35
+ }
36
+
37
+ // Retry JSON parse errors (likely server issues)
38
+ if (error.message.includes('JSON Parse error') || error.message.includes('Unexpected character')) {
39
+ return true;
40
+ }
41
+ return false;
42
+ }
43
+ };
44
+
45
+ /**
46
+ * Execute a function with retry logic and exponential backoff
47
+ * @param fn Function to execute (should return a Promise)
48
+ * @param options Retry configuration options
49
+ * @returns Promise with retry result
50
+ */
51
+ async function withRetry(fn, options = {}) {
52
+ const config = {
53
+ ...DEFAULT_RETRY_OPTIONS,
54
+ ...options
55
+ };
56
+ const startTime = Date.now();
57
+ let lastError = null;
58
+ for (let attempt = 1; attempt <= config.maxRetries + 1; attempt++) {
59
+ try {
60
+ if (config.enableLogging && attempt > 1) {
61
+ console.log(`🔄 Retry attempt ${attempt}/${config.maxRetries + 1}`);
62
+ }
63
+ const result = await fn();
64
+ return {
65
+ success: true,
66
+ data: result,
67
+ attempts: attempt,
68
+ totalDuration: Date.now() - startTime
69
+ };
70
+ } catch (error) {
71
+ lastError = error;
72
+
73
+ // Check if we should retry this error
74
+ const shouldRetryError = config.shouldRetry ? config.shouldRetry(error, attempt) : true;
75
+
76
+ // If this is the last attempt or we shouldn't retry, throw the error
77
+ if (attempt > config.maxRetries || !shouldRetryError) {
78
+ if (config.enableLogging) {
79
+ console.error(`❌ All retry attempts exhausted or error not retryable: ${error.message}`);
80
+ }
81
+ break;
82
+ }
83
+
84
+ // Calculate delay for next attempt
85
+ let delay = config.baseDelay;
86
+ if (config.exponentialBackoff) {
87
+ delay = Math.min(config.baseDelay * Math.pow(2, attempt - 1), config.maxDelay);
88
+ }
89
+
90
+ // Add some jitter to prevent thundering herd
91
+ const jitter = Math.random() * 0.1 * delay;
92
+ delay = Math.floor(delay + jitter);
93
+ if (config.onRetry) {
94
+ config.onRetry(error, attempt, delay);
95
+ }
96
+ if (config.enableLogging) {
97
+ console.log(`⏳ Waiting ${delay}ms before retry (attempt ${attempt}/${config.maxRetries + 1})`);
98
+ }
99
+
100
+ // Wait before next attempt
101
+ await new Promise(resolve => setTimeout(() => resolve(), delay));
102
+ }
103
+ }
104
+ return {
105
+ success: false,
106
+ error: lastError || new Error('Unknown error'),
107
+ attempts: config.maxRetries + 1,
108
+ totalDuration: Date.now() - startTime
109
+ };
110
+ }
111
+
112
+ /**
113
+ * Retry configuration for API calls
114
+ */
115
+ const API_RETRY_OPTIONS = exports.API_RETRY_OPTIONS = {
116
+ maxRetries: 3,
117
+ baseDelay: 1000,
118
+ maxDelay: 5000,
119
+ exponentialBackoff: true,
120
+ shouldRetry: (error, attempt) => {
121
+ // Enhanced retry logic for API calls
122
+
123
+ // Never retry authentication errors (401) or permission errors (403)
124
+ if (error.status === 401 || error.status === 403) {
125
+ return false;
126
+ }
127
+
128
+ // Never retry bad request errors (400) or not found (404) unless it's a specific case
129
+ if (error.status === 400 || error.status === 404 && !error.message.includes('validation endpoint')) {
130
+ return false;
131
+ }
132
+
133
+ // Retry rate limiting (429) with longer delays
134
+ if (error.status === 429) {
135
+ return attempt <= 2; // Limit retries for rate limiting
136
+ }
137
+
138
+ // Retry server errors (5xx)
139
+ if (error.status >= 500) {
140
+ return true;
141
+ }
142
+
143
+ // Retry timeout and network errors
144
+ if (error.name === 'AbortError' || error.message.includes('timeout') || error.message.includes('Network request failed') || error.message.includes('fetch') || error.message.includes('ENOTFOUND')) {
145
+ return true;
146
+ }
147
+
148
+ // Retry JSON parse errors (server returning HTML instead of JSON)
149
+ if (error.message.includes('JSON Parse error') || error.message.includes('Unexpected character') || error.message.includes('HTML page instead of JSON')) {
150
+ return true;
151
+ }
152
+ return false;
153
+ },
154
+ onRetry: (error, attempt, delay) => {
155
+ console.warn(`⚠️ API call failed (attempt ${attempt}), retrying in ${delay}ms: ${error.message}`);
156
+ }
157
+ };
158
+
159
+ /**
160
+ * Specialized retry for network/connectivity issues
161
+ */
162
+ const NETWORK_RETRY_OPTIONS = exports.NETWORK_RETRY_OPTIONS = {
163
+ maxRetries: 2,
164
+ baseDelay: 2000,
165
+ maxDelay: 8000,
166
+ exponentialBackoff: true,
167
+ shouldRetry: (error, attempt) => {
168
+ // Only retry actual network/connectivity issues
169
+ return error.message.includes('Network request failed') || error.message.includes('ENOTFOUND') || error.message.includes('DNS') || error.name === 'AbortError';
170
+ }
171
+ };
172
+
173
+ /**
174
+ * Create a retry wrapper for fetch requests
175
+ * @param url Request URL
176
+ * @param options Fetch options
177
+ * @param retryOptions Retry configuration
178
+ * @returns Promise with fetch response
179
+ */
180
+ async function fetchWithRetry(url, options = {}, retryOptions = API_RETRY_OPTIONS) {
181
+ const result = await withRetry(() => fetch(url, options), retryOptions);
182
+ if (!result.success) {
183
+ throw result.error;
184
+ }
185
+ return result.data;
186
+ }
187
+
188
+ /**
189
+ * Health check function with retry for testing connectivity
190
+ * @param url URL to check
191
+ * @param timeout Timeout in milliseconds
192
+ * @returns Promise indicating if the service is reachable
193
+ */
194
+ async function healthCheck(url, timeout = 5000) {
195
+ const startTime = Date.now();
196
+ try {
197
+ const controller = new AbortController();
198
+ const timeoutId = setTimeout(() => controller.abort(), timeout);
199
+ const response = await fetch(url, {
200
+ method: 'GET',
201
+ signal: controller.signal,
202
+ headers: {
203
+ 'User-Agent': 'OnairosReactNative/HealthCheck'
204
+ }
205
+ });
206
+ clearTimeout(timeoutId);
207
+ return {
208
+ reachable: true,
209
+ status: response.status,
210
+ duration: Date.now() - startTime
211
+ };
212
+ } catch (error) {
213
+ return {
214
+ reachable: false,
215
+ error: error.message,
216
+ duration: Date.now() - startTime
217
+ };
218
+ }
219
+ }
220
+ //# sourceMappingURL=retryHelper.js.map