@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 +1,54 @@
1
- function _0x6865(){const _0x1c8dc8=['-----END\x20PUBLIC\x20KEY-----','KhLTS','YFDOH','replace','zFvwW','fxJLG','trim','\x0a-----END\x20PUBLIC\x20KEY-----','error','FqAfN','toString','binary','AxkHC','base64','irMHb','kaWXE','Error\x20converting\x20base64\x20to\x20buffer:','nWeOX','mHhbU','from','oRlMj','length','BlDww','WWzMT','charCodeAt','buffer','fBPRu'];_0x6865=function(){return _0x1c8dc8;};return _0x6865();}function _0x30df(_0x6865ba,_0x30dfbc){_0x6865ba=_0x6865ba-0x0;const _0x23ce58=_0x6865();let _0x341d84=_0x23ce58[_0x6865ba];return _0x341d84;}import{RSA}from'react-native-rsa-native';import{sha256 as _0x35c151}from'react-native-crypto-js';export const rsaEncrypt=async(_0x1fc0a3,_0x47ba28)=>{const _0x26e1ff={'KhLTS':function(_0x5da2e5,_0x3d7501){return _0x5da2e5!==_0x3d7501;},'zFvwW':'-----BEGIN\x20PUBLIC\x20KEY-----','fxJLG':_0x30df(0x0),'ilfjC':'RSA\x20encryption\x20failed:'};try{if(_0x26e1ff[_0x30df(0x1)](_0x30df(0x2),_0x30df(0x2)))return _0x3c26dd(_0x25d8b4)['toString']();else{const _0xfd17b2=_0x1fc0a3['replace'](/\\n/g,'')[_0x30df(0x3)](/^\s+|\s+$/g,'')[_0x30df(0x3)](_0x26e1ff[_0x30df(0x4)],'')[_0x30df(0x3)](_0x26e1ff[_0x30df(0x5)],'')[_0x30df(0x6)](),_0x5b5ed6='-----BEGIN\x20PUBLIC\x20KEY-----\x0a'+_0xfd17b2+_0x30df(0x7),_0x351934=await RSA['encrypt'](_0x47ba28,_0x5b5ed6);return _0x351934;}}catch(_0x215bab){console[_0x30df(0x8)](_0x26e1ff['ilfjC'],_0x215bab);throw _0x215bab;}};export const sha256=_0x4a417c=>{const _0x19c89f={'FqAfN':function(_0x3a6310,_0x460b32){return _0x3a6310(_0x460b32);}};return _0x19c89f[_0x30df(0x9)](_0x35c151,_0x4a417c)[_0x30df(0xa)]();};export const base64ToBuffer=_0x23d73b=>{const _0x3eabe7={'WWzMT':_0x30df(0xb),'jHrcn':function(_0x3b451e,_0x586f3c){return _0x3b451e<_0x586f3c;},'nWeOX':function(_0x128e31,_0x3f9b3c){return _0x128e31===_0x3f9b3c;},'mHhbU':_0x30df(0xc),'oRlMj':_0x30df(0xd),'BlDww':function(_0x591bff,_0x799542){return _0x591bff<_0x799542;},'SgmPF':_0x30df(0xe),'drpyr':_0x30df(0xf),'fBPRu':_0x30df(0x10)};try{if(_0x3eabe7[_0x30df(0x11)](_0x3eabe7[_0x30df(0x12)],_0x3eabe7['mHhbU'])){const _0x140874=Buffer[_0x30df(0x13)](_0x23d73b,_0x3eabe7[_0x30df(0x14)])[_0x30df(0xa)](_0x30df(0xb)),_0x44ce40=new Uint8Array(_0x140874[_0x30df(0x15)]);for(let _0x15fe39=0x0;_0x3eabe7[_0x30df(0x16)](_0x15fe39,_0x140874['length']);_0x15fe39++){if(_0x3eabe7['SgmPF']===_0x3eabe7['drpyr']){const _0x2f7984=_0x55453e[_0x30df(0x13)](_0x1a9712,_0x30df(0xd))[_0x30df(0xa)](_0x3eabe7[_0x30df(0x17)]),_0x5e0184=new _0x4f3e1d(_0x2f7984[_0x30df(0x15)]);for(let _0x23cbcd=0x0;_0x3eabe7['jHrcn'](_0x23cbcd,_0x2f7984[_0x30df(0x15)]);_0x23cbcd++){_0x5e0184[_0x23cbcd]=_0x2f7984['charCodeAt'](_0x23cbcd);}return _0x5e0184['buffer'];}else _0x44ce40[_0x15fe39]=_0x140874[_0x30df(0x18)](_0x15fe39);}return _0x44ce40[_0x30df(0x19)];}else{_0xe10d75[_0x30df(0x8)]('RSA\x20encryption\x20failed:',_0x308f3e);throw _0x31deb4;}}catch(_0x5df6f8){console['error'](_0x3eabe7[_0x30df(0x1a)],_0x5df6f8);throw _0x5df6f8;}};
1
+ import { RSA } from 'react-native-rsa-native';
2
+ import { sha256 as cryptoSha256 } from 'react-native-crypto-js';
3
+
4
+ /**
5
+ * Encrypt data using RSA
6
+ * @param {string} publicKey - The RSA public key
7
+ * @param {string} data - The data to encrypt
8
+ * @returns {Promise<string>} - The encrypted data
9
+ */
10
+ export const rsaEncrypt = async (publicKey, data) => {
11
+ try {
12
+ // Clean the public key format
13
+ const cleanedKey = publicKey.replace(/\\n/g, '').replace(/^\s+|\s+$/g, '').replace('-----BEGIN PUBLIC KEY-----', '').replace('-----END PUBLIC KEY-----', '').trim();
14
+
15
+ // Format the key properly for the library
16
+ const formattedKey = `-----BEGIN PUBLIC KEY-----\n${cleanedKey}\n-----END PUBLIC KEY-----`;
17
+
18
+ // Encrypt the data
19
+ const encrypted = await RSA.encrypt(data, formattedKey);
20
+ return encrypted;
21
+ } catch (error) {
22
+ console.error('RSA encryption failed:', error);
23
+ throw error;
24
+ }
25
+ };
26
+
27
+ /**
28
+ * Hash data using SHA-256
29
+ * @param {string} data - The data to hash
30
+ * @returns {string} - The hashed data
31
+ */
32
+ export const sha256 = data => {
33
+ return cryptoSha256(data).toString();
34
+ };
35
+
36
+ /**
37
+ * Convert a base64 string to a buffer
38
+ * @param {string} base64String - The base64 string to convert
39
+ * @returns {ArrayBuffer} - The converted buffer
40
+ */
41
+ export const base64ToBuffer = base64String => {
42
+ try {
43
+ const binaryString = Buffer.from(base64String, 'base64').toString('binary');
44
+ const bytes = new Uint8Array(binaryString.length);
45
+ for (let i = 0; i < binaryString.length; i++) {
46
+ bytes[i] = binaryString.charCodeAt(i);
47
+ }
48
+ return bytes.buffer;
49
+ } catch (error) {
50
+ console.error('Error converting base64 to buffer:', error);
51
+ throw error;
52
+ }
53
+ };
54
+ //# sourceMappingURL=crypto.js.map
@@ -1 +1,54 @@
1
- function _0x4cbd(_0xd3afc,_0x4cbd59){_0xd3afc=_0xd3afc-0x0;const _0x136124=_0xd3af();let _0x11a6c3=_0x136124[_0xd3afc];return _0x11a6c3;}const __DEV__=process['env']['NODE_ENV']!=='production';export const logDebug=(_0xf3fbf,_0x152a37)=>{const _0x235b14={'AgZkp':function(_0x43983b,_0x545bd5){return _0x43983b||_0x545bd5;}};__DEV__&&console[_0x4cbd(0x0)](_0x4cbd(0x1)+_0xf3fbf+':',_0x235b14[_0x4cbd(0x2)](_0x152a37,''));};function _0xd3af(){const _0x31c4fc=['log','[Onairos\x20Debug]\x20','AgZkp','RUuqQ','QUhZI','qAFCY','TVFFI','error','GDaJG','AJVCr','AhewB'];_0xd3af=function(){return _0x31c4fc;};return _0xd3af();}export const logError=(_0x20a78e,_0x509e87)=>{const _0x51a941={'TVFFI':function(_0x664ea6,_0x1335be){return _0x664ea6||_0x1335be;},'zwiSy':function(_0x169de3,_0x31105f){return _0x169de3===_0x31105f;},'QUhZI':'evDHs','qAFCY':_0x4cbd(0x3)};__DEV__&&(_0x51a941['zwiSy'](_0x51a941[_0x4cbd(0x4)],_0x51a941[_0x4cbd(0x5)])?_0x4c2613['log']('[Onairos\x20Debug]\x20'+_0x1c9190+':',_0x51a941[_0x4cbd(0x6)](_0x6c09f,'')):console[_0x4cbd(0x7)]('[Onairos\x20Error]\x20'+_0x20a78e+':',_0x509e87));};export const isDebugMode=_0x440d67=>{const _0x573584={'GDaJG':function(_0x411786,_0x467ef1){return _0x411786===_0x467ef1;}};return _0x573584[_0x4cbd(0x8)](_0x440d67,!![])||__DEV__;};export const logApiRequest=(_0x31b120,_0x396117,_0x18a671)=>{const _0x25db7d={'AJVCr':'AhewB','OzVUx':function(_0x4c027d,_0x3fba25,_0x59c5fe){return _0x4c027d(_0x3fba25,_0x59c5fe);}};if(__DEV__){if(_0x25db7d[_0x4cbd(0x9)]!==_0x4cbd(0xa))return _0x2e93f5===!![]||_0x9a5d3a;else _0x25db7d['OzVUx'](logDebug,'API\x20Request',{'method':_0x31b120,'url':_0x396117,'data':_0x18a671||{}});}};
1
+ /**
2
+ * Debug utility functions for Onairos React Native SDK
3
+ */
4
+
5
+ // Determine if we're in dev mode
6
+ const __DEV__ = process.env.NODE_ENV !== 'production';
7
+
8
+ /**
9
+ * Log debug message to console when in development mode
10
+ * @param label Label for the debug message
11
+ * @param data Data to log
12
+ */
13
+ export const logDebug = (label, data) => {
14
+ if (__DEV__) {
15
+ console.log(`[Onairos Debug] ${label}:`, data || '');
16
+ }
17
+ };
18
+
19
+ /**
20
+ * Log error message to console
21
+ * @param label Label for the error message
22
+ * @param error Error object or message
23
+ */
24
+ export const logError = (label, error) => {
25
+ if (__DEV__) {
26
+ console.error(`[Onairos Error] ${label}:`, error);
27
+ }
28
+ };
29
+
30
+ /**
31
+ * Check if debug mode is enabled
32
+ * @param debug Debug flag passed to component
33
+ * @returns Whether debug mode is enabled
34
+ */
35
+ export const isDebugMode = debug => {
36
+ return debug === true || __DEV__;
37
+ };
38
+
39
+ /**
40
+ * Format and log API request details
41
+ * @param method HTTP method
42
+ * @param url API URL
43
+ * @param data Request data
44
+ */
45
+ export const logApiRequest = (method, url, data) => {
46
+ if (__DEV__) {
47
+ logDebug('API Request', {
48
+ method,
49
+ url,
50
+ data: data || {}
51
+ });
52
+ }
53
+ };
54
+ //# sourceMappingURL=debugHelper.js.map
@@ -1 +1,67 @@
1
- import{onairosApi}from'../api';function _0x583c(_0x5b51cf,_0x583c35){_0x5b51cf=_0x5b51cf-0x0;const _0x3dd0aa=_0x5b51();let _0x32a33f=_0x3dd0aa[_0x5b51cf];return _0x32a33f;}export const encryptModelKey=(_0xde9fb2,_0x583baa)=>{const _0x2f42fb={'qzJTM':_0x583c(0x0),'AhlfW':function(_0x591d81,_0x346961){return _0x591d81||_0x346961;}};try{console['log'](_0x2f42fb[_0x583c(0x1)]);if(_0x2f42fb['AhlfW'](!_0xde9fb2,!_0x583baa))throw new Error(_0x583c(0x2));return _0x583c(0x3)+_0x583baa+'_'+Date[_0x583c(0x4)]();}catch(_0x413dcf){console['error'](_0x583c(0x5),_0x413dcf);throw _0x413dcf;}};export const getServerPublicKey=async()=>{const _0x3e0d42={'uuQrS':'Error\x20getting\x20server\x20public\x20key:','HwoHF':_0x583c(0x6),'kYGzt':function(_0x3cc0ee,_0x5c6e18){return _0x3cc0ee!==_0x5c6e18;},'tMtmb':function(_0x5104f7,_0x2b6dfd){return _0x5104f7!==_0x2b6dfd;},'fkcwm':function(_0x51b0a0,_0x4315b3){return _0x51b0a0!==_0x4315b3;},'XGNZN':function(_0x256e4f,_0x512f3b){return _0x256e4f!==_0x512f3b;},'Iafsa':function(_0xffbf4c,_0x128e85){return _0xffbf4c!==_0x128e85;},'ddXIn':_0x583c(0x7)};try{var _0x3d68b8,_0x195cd4;const _0x393b93=await onairosApi['get'](_0x3e0d42[_0x583c(0x8)]);if(_0x3e0d42[_0x583c(0x9)](_0x393b93,null)&&_0x3e0d42[_0x583c(0x9)](_0x393b93,void 0x0)&&_0x3e0d42[_0x583c(0xa)](_0x3d68b8=_0x393b93['data'],null)&&_0x3d68b8!==void 0x0&&_0x3e0d42[_0x583c(0xb)](_0x3d68b8=_0x3d68b8[_0x583c(0xc)],null)&&_0x3e0d42[_0x583c(0x9)](_0x3d68b8,void 0x0)&&_0x3d68b8[_0x583c(0xd)])return _0x393b93['data'][_0x583c(0xc)][_0x583c(0xd)];else{if(_0x393b93!==null&&_0x3e0d42[_0x583c(0xe)](_0x393b93,void 0x0)&&_0x3e0d42[_0x583c(0xe)](_0x195cd4=_0x393b93['data'],null)&&_0x3e0d42[_0x583c(0xf)](_0x195cd4,void 0x0)&&_0x195cd4[_0x583c(0xd)])return _0x393b93['data']['publicKey'];else{if(_0x3e0d42['ddXIn']!==_0x3e0d42[_0x583c(0x10)])return _0x27a47d[_0x583c(0x11)](_0x3e0d42[_0x583c(0x12)],_0x3413a0),'mock_public_key_for_testing';else throw new Error('No\x20public\x20key\x20found\x20in\x20response');}}}catch(_0x42c347){return console[_0x583c(0x11)](_0x3e0d42[_0x583c(0x12)],_0x42c347),'mock_public_key_for_testing';}};function _0x5b51(){const _0x35209b=['Encrypting\x20model\x20key','qzJTM','Public\x20key\x20or\x20model\x20key\x20is\x20missing','encrypted_','now','Error\x20encrypting\x20model\x20key:','public/getPublicKey','dbLWn','HwoHF','kYGzt','tMtmb','fkcwm','data','publicKey','XGNZN','Iafsa','ddXIn','error','uuQrS','Error\x20hashing\x20string:','hash_','replace','NCErO','fallback_hash_'];_0x5b51=function(){return _0x35209b;};return _0x5b51();}export const hashString=async _0x579335=>{const _0x582502={'NCErO':_0x583c(0x13)};try{return _0x583c(0x14)+_0x579335[_0x583c(0x15)](/\s+/g,'_')+'_'+Date[_0x583c(0x4)]();}catch(_0x49220a){return console[_0x583c(0x11)](_0x582502[_0x583c(0x16)],_0x49220a),_0x583c(0x17)+Date['now']();}};
1
+ import { onairosApi } from '../api';
2
+ /**
3
+ * Encrypt a model key using RSA with a public key
4
+ * @param publicKey The public key to encrypt with
5
+ * @param modelKey The model key to encrypt
6
+ * @returns The encrypted model key
7
+ */
8
+ export const encryptModelKey = (publicKey, modelKey) => {
9
+ try {
10
+ console.log('Encrypting model key');
11
+ if (!publicKey || !modelKey) {
12
+ throw new Error('Public key or model key is missing');
13
+ }
14
+
15
+ // In a production environment, this would use RSA encryption
16
+ // For now, we'll use a mock implementation
17
+ // return RSA.encrypt(modelKey, publicKey);
18
+
19
+ // Return a fake encrypted value
20
+ return `encrypted_${modelKey}_${Date.now()}`;
21
+ } catch (error) {
22
+ console.error('Error encrypting model key:', error);
23
+ throw error;
24
+ }
25
+ };
26
+
27
+ /**
28
+ * Get the server's public key
29
+ * @returns The server's public key
30
+ */
31
+ export const getServerPublicKey = async () => {
32
+ try {
33
+ var _response$data, _response$data2;
34
+ // Use the API without generics to prevent TypeScript errors
35
+ const response = await onairosApi.get('public/getPublicKey');
36
+
37
+ // Check for the public key in the response data
38
+ if (response !== null && response !== void 0 && (_response$data = response.data) !== null && _response$data !== void 0 && (_response$data = _response$data.data) !== null && _response$data !== void 0 && _response$data.publicKey) {
39
+ return response.data.data.publicKey;
40
+ } else if (response !== null && response !== void 0 && (_response$data2 = response.data) !== null && _response$data2 !== void 0 && _response$data2.publicKey) {
41
+ return response.data.publicKey;
42
+ } else {
43
+ throw new Error('No public key found in response');
44
+ }
45
+ } catch (error) {
46
+ console.error('Error getting server public key:', error);
47
+ // For testing, return a mock public key
48
+ return 'mock_public_key_for_testing';
49
+ }
50
+ };
51
+
52
+ /**
53
+ * Hash a string using SHA-256
54
+ * @param input The string to hash
55
+ * @returns The hashed string
56
+ */
57
+ export const hashString = async input => {
58
+ try {
59
+ // In a production environment, this would use a proper hashing function
60
+ // For now, we'll return a mock hash
61
+ return `hash_${input.replace(/\s+/g, '_')}_${Date.now()}`;
62
+ } catch (error) {
63
+ console.error('Error hashing string:', error);
64
+ return `fallback_hash_${Date.now()}`;
65
+ }
66
+ };
67
+ //# sourceMappingURL=encryption.js.map
@@ -1 +1,270 @@
1
- export const generateEventCode=(_0x56ca63=0x6)=>{const _0x26285d={'kHpoe':function(_0x334e62,_0x31b065){return _0x334e62<_0x31b065;},'gpvIM':function(_0x30e9e3,_0x46a6bf){return _0x30e9e3!==_0x46a6bf;},'LWLXV':'VbfeC','bMPha':function(_0x24857a,_0x27d476){return _0x24857a*_0x27d476;}},_0x90ce13=_0x398e(0x0);let _0x238c79='';for(let _0xa2074e=0x0;_0x26285d['kHpoe'](_0xa2074e,_0x56ca63);_0xa2074e++){_0x26285d['gpvIM'](_0x26285d[_0x398e(0x1)],_0x26285d[_0x398e(0x1)])?_0x3c392e=_0x2cbddc[_0x398e(0x2)](0x0,0x8):_0x238c79+=_0x90ce13[_0x398e(0x3)](Math['floor'](_0x26285d[_0x398e(0x4)](Math[_0x398e(0x5)](),_0x90ce13[_0x398e(0x6)])));}return _0x238c79;};export const generateSmartEventCode=_0x797357=>{const _0x19c24f={'JCqZP':function(_0x2367c3,_0x262ddd){return _0x2367c3<_0x262ddd;},'bqEpl':_0x398e(0x7),'eujCN':function(_0x4908b9,_0x4cb179){return _0x4908b9-_0x4cb179;},'DCHYj':function(_0x1be5bb,_0x356565){return _0x1be5bb/_0x356565;},'Zsrzq':function(_0x1ce94c,_0x5f2113){return _0x1ce94c*_0x5f2113;},'yzlAt':function(_0x34308f,_0x21aeca){return _0x34308f===_0x21aeca;},'vdUYz':_0x398e(0x8),'xnaEb':function(_0x34950a){return _0x34950a();},'GTfMD':'ZXRGh','tUVmZ':_0x398e(0x9),'gmrJy':function(_0x5bd097,_0x25b07e){return _0x5bd097===_0x25b07e;},'yddkO':_0x398e(0xa),'dvTSF':_0x398e(0xb),'bwYey':_0x398e(0xc),'rbdWE':function(_0xc17c8,_0x1f9ca9){return _0xc17c8(_0x1f9ca9);},'dNeVj':function(_0x579bb9,_0x468ca0){return _0x579bb9-_0x468ca0;},'dJlGL':function(_0xd9c578,_0x3891f7){return _0xd9c578>_0x3891f7;},'ZHHzO':'gPdjz'};if(!_0x797357[_0x398e(0xd)]())return generateEventCode();const _0x3fb9d8=_0x797357[_0x398e(0xd)]()['toUpperCase']()[_0x398e(0xe)](/[^A-Z0-9\s]/g,'')[_0x398e(0xf)](/\s+/)[_0x398e(0x10)](_0x29742c=>_0x29742c[_0x398e(0x6)]>0x0);if(_0x3fb9d8[_0x398e(0x6)]===0x0)return _0x19c24f[_0x398e(0x11)](_0x19c24f[_0x398e(0x12)],_0x398e(0x13))?0x0:_0x19c24f[_0x398e(0x14)](generateEventCode);let _0x2db2f5='';if(_0x3fb9d8[_0x398e(0x6)]>=0x2){if(_0x19c24f[_0x398e(0x15)]===_0x19c24f['tUVmZ'])try{const _0x103a12=new _0x21ea63(),_0x71e7ce=new _0x157ecb(_0x52ace6);return _0x103a12['setHours'](0x0,0x0,0x0,0x0),_0x71e7ce[_0x398e(0x16)](0x0,0x0,0x0,0x0),_0x19c24f[_0x398e(0x17)](_0x71e7ce,_0x103a12);}catch(_0x56a456){return![];}else{const _0x3d610c=_0x3fb9d8[_0x398e(0x18)](0x0,0x3);_0x2db2f5=_0x3d610c[_0x398e(0x19)](_0x428a2f=>_0x428a2f[_0x398e(0x2)](0x0,0x2))[_0x398e(0x1a)]('');}}else{if(_0x19c24f[_0x398e(0x1b)](_0x19c24f[_0x398e(0x1c)],_0x19c24f[_0x398e(0x1d)]))return _0x19c24f['bqEpl'];else _0x2db2f5=_0x3fb9d8[0x0][_0x398e(0x2)](0x0,0x4);}const _0x2dcdfe=new Date()[_0x398e(0x1e)]()[_0x398e(0x1f)]()[_0x398e(0x18)](-0x2);_0x2db2f5+=_0x2dcdfe;if(_0x2db2f5[_0x398e(0x6)]<0x4){if(_0x19c24f[_0x398e(0x1b)](_0x398e(0x20),_0x19c24f[_0x398e(0x21)]))try{const _0x56cb79=new _0x3f7731(),_0x4b4df2=new _0x2f031e(_0x155b23);_0x56cb79['setHours'](0x0,0x0,0x0,0x0),_0x4b4df2[_0x398e(0x16)](0x0,0x0,0x0,0x0);const _0x4a524b=_0x19c24f[_0x398e(0x22)](_0x4b4df2[_0x398e(0x23)](),_0x56cb79[_0x398e(0x23)]()),_0x54aaea=_0x293ebd[_0x398e(0x24)](_0x19c24f[_0x398e(0x25)](_0x4a524b,_0x19c24f['Zsrzq'](_0x19c24f[_0x398e(0x26)](0x3e8,0x3c)*0x3c,0x18)));return _0x54aaea;}catch(_0x21c09a){return 0x0;}else _0x2db2f5+=_0x19c24f['rbdWE'](generateEventCode,_0x19c24f['dNeVj'](0x4,_0x2db2f5[_0x398e(0x6)]));}else{if(_0x19c24f[_0x398e(0x27)](_0x2db2f5[_0x398e(0x6)],0x8)){if(_0x19c24f['ZHHzO']!==_0x19c24f[_0x398e(0x28)])return _0x311b2a;else _0x2db2f5=_0x2db2f5['substring'](0x0,0x8);}}return _0x2db2f5;};export const validateEventCode=_0x466890=>{const _0x4b7391={'OMNwG':_0x398e(0x29),'tDweb':_0x398e(0x2a),'eZqdU':'long','Nvtyy':_0x398e(0x2b),'ROZpm':_0x398e(0x2c),'AyYac':function(_0x346630,_0x25c439){return _0x346630!==_0x25c439;},'hGUjQ':'yplju','tNlBl':function(_0x1ebc74,_0x25c496){return _0x1ebc74>_0x25c496;},'RQZIf':function(_0x5122a0,_0xa0e1ac){return _0x5122a0!==_0xa0e1ac;},'GcWOV':_0x398e(0x2d),'wGbXY':'oNvNB','hmWep':function(_0x4cc7b4,_0x36ed27){return _0x4cc7b4!==_0x36ed27;},'LkSlh':_0x398e(0x2e),'Rmick':_0x398e(0x2f)};if(!_0x466890||!_0x466890['trim']())return{'isValid':![],'error':_0x4b7391['ROZpm']};const _0x5aca5c=_0x466890[_0x398e(0xd)]()['toUpperCase']();if(_0x5aca5c[_0x398e(0x6)]<0x3){if(_0x4b7391[_0x398e(0x30)](_0x398e(0x31),_0x4b7391['hGUjQ']))return{'isValid':![],'error':_0x4b7391[_0x398e(0x32)]};else _0x2a6494=_0x348aca[0x0][_0x398e(0x2)](0x0,0x4);}if(_0x4b7391[_0x398e(0x33)](_0x5aca5c[_0x398e(0x6)],0xa))return _0x4b7391[_0x398e(0x34)](_0x4b7391[_0x398e(0x35)],_0x4b7391[_0x398e(0x36)])?{'isValid':![],'error':_0x398e(0x37)}:{'isValid':![],'error':_0x4b7391[_0x398e(0x32)]};if(!/^[A-Z0-9]+$/[_0x398e(0x38)](_0x5aca5c)){if(_0x4b7391[_0x398e(0x39)](_0x4b7391[_0x398e(0x3a)],_0x4b7391[_0x398e(0x3a)])){const _0x38004f=new _0x1d13b8(_0x37fb21);return _0x38004f[_0x398e(0x3b)](_0x4b7391[_0x398e(0x3c)],{'weekday':_0x4b7391[_0x398e(0x3d)],'year':_0x4b7391[_0x398e(0x3e)],'month':_0x4b7391['eZqdU'],'day':_0x4b7391[_0x398e(0x3e)]});}else return{'isValid':![],'error':_0x4b7391[_0x398e(0x3f)]};}return{'isValid':!![]};};export const formatEventDate=_0x126918=>{const _0x2105c1={'kHWaj':function(_0x57da8d){return _0x57da8d();},'RIIgM':function(_0x13f043,_0x3edfad){return _0x13f043<_0x3edfad;},'iicDU':function(_0x33385e,_0x20e68e){return _0x33385e!==_0x20e68e;},'Sqapv':_0x398e(0x40),'JZHVy':_0x398e(0x2a),'TEqyh':_0x398e(0x41),'KKjFw':_0x398e(0x2b),'dcnBq':_0x398e(0x42),'zPzYG':_0x398e(0x43)};try{if(_0x2105c1[_0x398e(0x44)](_0x2105c1[_0x398e(0x45)],_0x2105c1[_0x398e(0x45)]))return _0x2105c1[_0x398e(0x46)](_0x48db26);else{const _0x59de96=new Date(_0x126918);return _0x59de96['toLocaleDateString'](_0x2105c1[_0x398e(0x47)],{'weekday':_0x2105c1[_0x398e(0x48)],'year':_0x2105c1['KKjFw'],'month':_0x2105c1['TEqyh'],'day':_0x2105c1[_0x398e(0x49)]});}}catch(_0x47d997){if(_0x2105c1[_0x398e(0x4a)]!==_0x2105c1[_0x398e(0x4b)])return _0x126918;else{const _0x5c40aa=new _0x268e79(),_0x5b10ad=new _0x511ecd(_0x2a92f7);return _0x5c40aa[_0x398e(0x16)](0x0,0x0,0x0,0x0),_0x5b10ad[_0x398e(0x16)](0x0,0x0,0x0,0x0),_0x2105c1[_0x398e(0x4c)](_0x5b10ad,_0x5c40aa);}}};export const isEventToday=_0x4e9773=>{const _0x237cda={'aYmpZ':function(_0x4b3ba6,_0x423d31){return _0x4b3ba6-_0x423d31;},'NvOLf':function(_0x137aa2,_0xf01095){return _0x137aa2===_0xf01095;},'DENrJ':_0x398e(0x4d),'IROnR':function(_0x215cf7,_0x532b8b){return _0x215cf7===_0x532b8b;}};try{if(_0x237cda[_0x398e(0x4e)](_0x237cda[_0x398e(0x4f)],_0x398e(0x4d))){const _0x51559a=new Date(),_0x5088c6=new Date(_0x4e9773);return _0x237cda[_0x398e(0x4e)](_0x51559a[_0x398e(0x1e)](),_0x5088c6[_0x398e(0x1e)]())&&_0x51559a['getMonth']()===_0x5088c6[_0x398e(0x50)]()&&_0x237cda['IROnR'](_0x51559a[_0x398e(0x51)](),_0x5088c6['getDate']());}else return _0x237cda[_0x398e(0x52)](_0x280de3['getTime'](),_0x150d2c['getTime']());}catch(_0x4fbc07){return![];}};export const isEventPast=_0x5d58d4=>{const _0x46417e={'nSITF':function(_0x51faf5,_0x2f5738){return _0x51faf5-_0x2f5738;},'JFHBB':function(_0x3a7159,_0x4747b3){return _0x3a7159*_0x4747b3;},'gUOpe':function(_0x2a6edb,_0x1d4000){return _0x2a6edb<_0x1d4000;},'JKFUK':function(_0xc9101f,_0x4c2a96){return _0xc9101f<_0x4c2a96;},'IcbOz':function(_0x32bf74,_0x2dc5d5){return _0x32bf74&&_0x2dc5d5;},'eeLPT':function(_0x2b9fb7,_0x40eadf){return _0x2b9fb7-_0x40eadf;},'UoOLY':function(_0x2749ad,_0x3b514d){return _0x2749ad===_0x3b514d;},'vFPlV':'IqelF','ltIUu':function(_0x2aa9d0,_0x52e0a4){return _0x2aa9d0<_0x52e0a4;},'VLOKA':_0x398e(0x53),'RaSco':'KYJKR'};try{if(_0x46417e[_0x398e(0x54)](_0x46417e[_0x398e(0x55)],_0x398e(0x56))){const _0x4aa977=_0x51910b['length'],_0x831d14=_0x42c0e9['filter'](_0xeda988=>_0xeda988[_0x398e(0x57)])['length'],_0x2adac5=_0x46417e[_0x398e(0x58)](_0x4aa977,_0x831d14),_0x1f054b=_0x2f2474[_0x398e(0x59)]((_0x1c27cd,_0x5f5816)=>_0x1c27cd+_0x5f5816[_0x398e(0x5a)],0x0),_0x17c8f5=_0xaabb54[_0x398e(0x59)]((_0x386b01,_0x5f2fc0)=>_0x386b01+_0x5f2fc0[_0x398e(0x5b)],0x0),_0xc27fff=_0x6a9d65[_0x398e(0x10)](_0x1cfd85=>_0x1cfd85['isActive']&&!_0x3809a9(_0x1cfd85[_0x398e(0x5c)]))[_0x398e(0x6)],_0x45f32e=_0x322733['filter'](_0x586806=>_0x2b9768(_0x586806[_0x398e(0x5c)]))['length'],_0x14ffe4=_0x1b5d07[_0x398e(0x10)](_0x558571=>_0x558571[_0x398e(0x57)]&&_0x7184a1(_0x558571[_0x398e(0x5c)]))[_0x398e(0x6)];return{'total':_0x4aa977,'active':_0x831d14,'inactive':_0x2adac5,'upcoming':_0xc27fff,'past':_0x45f32e,'today':_0x14ffe4,'totalAttendees':_0x1f054b,'totalCapacity':_0x17c8f5,'averageAttendance':_0x17c8f5>0x0?_0x35cc61[_0x398e(0x5d)](_0x46417e['JFHBB'](_0x1f054b/_0x17c8f5,0x64)):0x0};}else{const _0x5f1e58=new Date(),_0x547728=new Date(_0x5d58d4);return _0x5f1e58[_0x398e(0x16)](0x0,0x0,0x0,0x0),_0x547728['setHours'](0x0,0x0,0x0,0x0),_0x46417e[_0x398e(0x5e)](_0x547728,_0x5f1e58);}}catch(_0x223ccc){return _0x46417e[_0x398e(0x5f)]===_0x46417e['RaSco']?_0x4978b7['sort']((_0x5e4b46,_0x15c3af)=>{if(_0x5e4b46[_0x398e(0x57)]&&!_0x15c3af['isActive'])return-0x1;if(!_0x5e4b46['isActive']&&_0x15c3af[_0x398e(0x57)])return 0x1;const _0x1cd185=new _0x2a8735(_0x5e4b46[_0x398e(0x5c)]),_0x255b7a=new _0x5b8e7b(_0x15c3af[_0x398e(0x5c)]),_0x11d181=new _0x5851d0(),_0x5852fe=_0x46417e['gUOpe'](_0x1cd185,_0x11d181),_0x3555f7=_0x46417e[_0x398e(0x60)](_0x255b7a,_0x11d181);if(_0x46417e[_0x398e(0x61)](_0x5852fe,!_0x3555f7))return 0x1;if(!_0x5852fe&&_0x3555f7)return-0x1;return _0x46417e[_0x398e(0x61)](_0x5852fe,_0x3555f7)?_0x46417e['nSITF'](_0x255b7a['getTime'](),_0x1cd185[_0x398e(0x23)]()):_0x46417e[_0x398e(0x62)](_0x1cd185[_0x398e(0x23)](),_0x255b7a[_0x398e(0x23)]());}):![];}};function _0x398e(_0x3f5115,_0x398e6d){_0x3f5115=_0x3f5115-0x0;const _0x56209f=_0x3f51();let _0x2b8cef=_0x56209f[_0x3f5115];return _0x2b8cef;}function _0x3f51(){const _0x63e2db=['ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789','LWLXV','substring','charAt','bMPha','random','length','Past','dAGXv','RgPKT','UNurN','XzgtW','qoUkG','trim','replace','split','filter','yzlAt','vdUYz','tRBla','xnaEb','GTfMD','setHours','JCqZP','slice','map','join','gmrJy','yddkO','dvTSF','getFullYear','toString','bwStK','bwYey','eujCN','getTime','ceil','DCHYj','Zsrzq','dJlGL','ZHHzO','Event\x20code\x20must\x20be\x20at\x20least\x203\x20characters','en-US','numeric','Event\x20code\x20is\x20required','FWZrX','Blejy','Event\x20code\x20must\x20contain\x20only\x20letters\x20and\x20numbers','AyYac','wiamA','OMNwG','tNlBl','RQZIf','GcWOV','wGbXY','Event\x20code\x20must\x20be\x2010\x20characters\x20or\x20less','test','hmWep','LkSlh','toLocaleDateString','tDweb','eZqdU','Nvtyy','Rmick','rGyHM','long','lgNCj','obKXa','iicDU','Sqapv','kHWaj','JZHVy','TEqyh','KKjFw','dcnBq','zPzYG','RIIgM','oeirv','NvOLf','DENrJ','getMonth','getDate','aYmpZ','gAqlf','UoOLY','vFPlV','hfgyo','isActive','nSITF','reduce','attendeeCount','maxAttendees','eventDate','round','ltIUu','VLOKA','JKFUK','IcbOz','eeLPT','Inactive','Today','pWpuh','OfwDH','SJZIw','aNEPi','lfNle','yGtsj','KUUrg','wKFVL','QUxvi','LDbxp','fyWYZ','sort','xFmcP','IWTHd','HQgIl','yTtyG','iTfJk','dZjjc','NxjXH','FYFrP','ihZzb','ROyLr','toLowerCase','title','includes','description','Nwuml','location','organizer','tags','wzVaz','some','from','dDjQd','UIbOr','lbhkp'];_0x3f51=function(){return _0x63e2db;};return _0x3f51();}export const getEventStatus=(_0x302613,_0x23b455)=>{const _0x3d2173={'aNEPi':_0x398e(0x63),'pWpuh':function(_0x584dd8,_0x1219df){return _0x584dd8===_0x1219df;},'yduCb':function(_0x284292,_0x5bb07d){return _0x284292(_0x5bb07d);},'lfNle':_0x398e(0x7),'CtgLs':function(_0x242165,_0x263715){return _0x242165(_0x263715);},'yGtsj':_0x398e(0x64)};if(!_0x23b455)return _0x3d2173[_0x398e(0x65)](_0x398e(0x66),_0x398e(0x67))?_0x3d2173[_0x398e(0x68)]:_0x3d2173[_0x398e(0x68)];if(_0x3d2173['yduCb'](isEventPast,_0x302613))return _0x3d2173[_0x398e(0x69)];if(_0x3d2173['CtgLs'](isEventToday,_0x302613))return _0x3d2173[_0x398e(0x6a)];return'Upcoming';};export const getDaysUntilEvent=_0x20c7e6=>{const _0x1a2e24={'KUUrg':function(_0x2a0847,_0x186d3a){return _0x2a0847/_0x186d3a;},'wKFVL':function(_0x3a3bdd,_0x3daf76){return _0x3a3bdd*_0x3daf76;},'wgwlz':function(_0x5de23a,_0x117e09){return _0x5de23a*_0x117e09;},'QUxvi':function(_0x1ce7cd,_0x451387){return _0x1ce7cd*_0x451387;}};try{const _0x373361=new Date(),_0x300e07=new Date(_0x20c7e6);_0x373361[_0x398e(0x16)](0x0,0x0,0x0,0x0),_0x300e07[_0x398e(0x16)](0x0,0x0,0x0,0x0);const _0x3ae53f=_0x300e07['getTime']()-_0x373361[_0x398e(0x23)](),_0x5e9c88=Math[_0x398e(0x24)](_0x1a2e24[_0x398e(0x6b)](_0x3ae53f,_0x1a2e24[_0x398e(0x6c)](_0x1a2e24['wgwlz'](_0x1a2e24[_0x398e(0x6d)](0x3e8,0x3c),0x3c),0x18)));return _0x5e9c88;}catch(_0x5a1793){return 0x0;}};export const sortEventsByDate=_0x551fa2=>{const _0x125339={'HQgIl':function(_0x2a56a4,_0x12ab8c){return _0x2a56a4===_0x12ab8c;},'yTtyG':function(_0x360758,_0x546410){return _0x360758===_0x546410;},'xFmcP':_0x398e(0x6e),'iTfJk':function(_0x58272c,_0x287b36){return _0x58272c<_0x287b36;},'dZjjc':function(_0x1382f6,_0x35e4e0){return _0x1382f6&&_0x35e4e0;},'NxjXH':function(_0x4499c7,_0x46b196){return _0x4499c7===_0x46b196;},'FYFrP':_0x398e(0x6f),'ihZzb':function(_0x2d5f6d,_0x13a769){return _0x2d5f6d-_0x13a769;},'ROyLr':function(_0x31e55d,_0x187978){return _0x31e55d-_0x187978;}};return _0x551fa2[_0x398e(0x70)]((_0x516841,_0x2d616f)=>{if(_0x125339[_0x398e(0x71)]===_0x398e(0x72))try{const _0xeff174=new _0x8bcc01(),_0x55b325=new _0x14625b(_0x351666);return _0x125339[_0x398e(0x73)](_0xeff174[_0x398e(0x1e)](),_0x55b325[_0x398e(0x1e)]())&&_0xeff174[_0x398e(0x50)]()===_0x55b325[_0x398e(0x50)]()&&_0x125339[_0x398e(0x74)](_0xeff174['getDate'](),_0x55b325['getDate']());}catch(_0x5d6d2f){return![];}else{if(_0x516841['isActive']&&!_0x2d616f[_0x398e(0x57)])return-0x1;if(!_0x516841[_0x398e(0x57)]&&_0x2d616f[_0x398e(0x57)])return 0x1;const _0x58f54e=new Date(_0x516841[_0x398e(0x5c)]),_0x396b4b=new Date(_0x2d616f[_0x398e(0x5c)]),_0x5541e2=new Date(),_0x1b300b=_0x125339[_0x398e(0x75)](_0x58f54e,_0x5541e2),_0x1846ff=_0x396b4b<_0x5541e2;if(_0x125339[_0x398e(0x76)](_0x1b300b,!_0x1846ff))return 0x1;if(_0x125339['dZjjc'](!_0x1b300b,_0x1846ff))return-0x1;return _0x1b300b&&_0x1846ff?_0x125339[_0x398e(0x77)](_0x125339[_0x398e(0x78)],_0x125339[_0x398e(0x78)])?_0x125339[_0x398e(0x79)](_0x396b4b[_0x398e(0x23)](),_0x58f54e['getTime']()):![]:_0x125339[_0x398e(0x7a)](_0x58f54e[_0x398e(0x23)](),_0x396b4b[_0x398e(0x23)]());}});};export const filterEventsBySearch=(_0x50332c,_0x10536a)=>{const _0x23367c={'Nwuml':function(_0x5bfed4,_0x4a5a07){return _0x5bfed4===_0x4a5a07;},'wzVaz':function(_0x335d6f,_0x1b1373){return _0x335d6f===_0x1b1373;}};if(!_0x10536a['trim']())return _0x50332c;const _0x43e710=_0x10536a[_0x398e(0x7b)]()[_0x398e(0xd)]();return _0x50332c[_0x398e(0x10)](_0x1c2de6=>{var _0x41a7fe,_0x3a3a7c,_0x4f14ca;return _0x1c2de6[_0x398e(0x7c)]['toLowerCase']()[_0x398e(0x7d)](_0x43e710)||_0x1c2de6[_0x398e(0x7e)][_0x398e(0x7b)]()[_0x398e(0x7d)](_0x43e710)||_0x1c2de6['code'][_0x398e(0x7b)]()['includes'](_0x43e710)||(_0x23367c[_0x398e(0x7f)](_0x41a7fe=_0x1c2de6[_0x398e(0x80)],null)||_0x23367c[_0x398e(0x7f)](_0x41a7fe,void 0x0)?void 0x0:_0x41a7fe[_0x398e(0x7b)]()[_0x398e(0x7d)](_0x43e710))||((_0x3a3a7c=_0x1c2de6[_0x398e(0x81)])===null||_0x3a3a7c===void 0x0?void 0x0:_0x3a3a7c['toLowerCase']()[_0x398e(0x7d)](_0x43e710))||(_0x23367c[_0x398e(0x7f)](_0x4f14ca=_0x1c2de6[_0x398e(0x82)],null)||_0x23367c[_0x398e(0x83)](_0x4f14ca,void 0x0)?void 0x0:_0x4f14ca[_0x398e(0x84)](_0x107081=>_0x107081[_0x398e(0x7b)]()[_0x398e(0x7d)](_0x43e710)));});};export const getUniqueEventTags=_0x14eded=>{const _0x5ab780=_0x14eded['flatMap'](_0x102821=>_0x102821[_0x398e(0x82)]||[]);return Array[_0x398e(0x85)](new Set(_0x5ab780))[_0x398e(0x70)]();};export const calculateEventStats=_0x223fe4=>{const _0x17bc93={'dDjQd':function(_0x77a662,_0xb8eee3){return _0x77a662-_0xb8eee3;},'ApSge':function(_0x490fb8,_0x2994df){return _0x490fb8>_0x2994df;},'UIbOr':function(_0x4ab9fa,_0x31902d){return _0x4ab9fa*_0x31902d;},'lbhkp':function(_0x3b85ed,_0x4948b5){return _0x3b85ed/_0x4948b5;}},_0x245d04=_0x223fe4[_0x398e(0x6)],_0x2c1834=_0x223fe4[_0x398e(0x10)](_0x58297=>_0x58297[_0x398e(0x57)])[_0x398e(0x6)],_0x2d3c21=_0x17bc93[_0x398e(0x86)](_0x245d04,_0x2c1834),_0x4ce79b=_0x223fe4[_0x398e(0x59)]((_0x5a4d25,_0x9634f2)=>_0x5a4d25+_0x9634f2[_0x398e(0x5a)],0x0),_0x5e20e3=_0x223fe4[_0x398e(0x59)]((_0x39c728,_0x273273)=>_0x39c728+_0x273273['maxAttendees'],0x0),_0x39da14=_0x223fe4['filter'](_0x30557d=>_0x30557d[_0x398e(0x57)]&&!isEventPast(_0x30557d[_0x398e(0x5c)]))[_0x398e(0x6)],_0x554c7=_0x223fe4[_0x398e(0x10)](_0x43368d=>isEventPast(_0x43368d[_0x398e(0x5c)]))['length'],_0x6608c3=_0x223fe4[_0x398e(0x10)](_0x5e46ca=>_0x5e46ca[_0x398e(0x57)]&&isEventToday(_0x5e46ca[_0x398e(0x5c)]))[_0x398e(0x6)];return{'total':_0x245d04,'active':_0x2c1834,'inactive':_0x2d3c21,'upcoming':_0x39da14,'past':_0x554c7,'today':_0x6608c3,'totalAttendees':_0x4ce79b,'totalCapacity':_0x5e20e3,'averageAttendance':_0x17bc93['ApSge'](_0x5e20e3,0x0)?Math[_0x398e(0x5d)](_0x17bc93[_0x398e(0x87)](_0x17bc93[_0x398e(0x88)](_0x4ce79b,_0x5e20e3),0x64)):0x0};};
1
+ /**
2
+ * Event utility functions for event management
3
+ */
4
+
5
+ /**
6
+ * Generate a random alphanumeric event code
7
+ * @param length - Length of the code (default: 6)
8
+ * @returns Random event code
9
+ */
10
+ export const generateEventCode = (length = 6) => {
11
+ const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
12
+ let result = '';
13
+ for (let i = 0; i < length; i++) {
14
+ result += chars.charAt(Math.floor(Math.random() * chars.length));
15
+ }
16
+ return result;
17
+ };
18
+
19
+ /**
20
+ * Generate a smart event code based on the event title
21
+ * @param title - Event title
22
+ * @returns Smart event code
23
+ */
24
+ export const generateSmartEventCode = title => {
25
+ if (!title.trim()) {
26
+ return generateEventCode();
27
+ }
28
+
29
+ // Clean the title and split into words
30
+ const words = title.trim().toUpperCase().replace(/[^A-Z0-9\s]/g, '') // Remove special characters
31
+ .split(/\s+/).filter(word => word.length > 0);
32
+ if (words.length === 0) {
33
+ return generateEventCode();
34
+ }
35
+ let code = '';
36
+
37
+ // Strategy 1: Take first 2 letters of each word (up to 3 words)
38
+ if (words.length >= 2) {
39
+ const significantWords = words.slice(0, 3);
40
+ code = significantWords.map(word => word.substring(0, 2)).join('');
41
+ } else {
42
+ // Strategy 2: Single word - take first 4 letters
43
+ code = words[0].substring(0, 4);
44
+ }
45
+
46
+ // Add current year's last 2 digits
47
+ const currentYear = new Date().getFullYear().toString().slice(-2);
48
+ code += currentYear;
49
+
50
+ // Ensure minimum length of 4 and maximum of 8
51
+ if (code.length < 4) {
52
+ code += generateEventCode(4 - code.length);
53
+ } else if (code.length > 8) {
54
+ code = code.substring(0, 8);
55
+ }
56
+ return code;
57
+ };
58
+
59
+ /**
60
+ * Validate event code format
61
+ * @param code - Event code to validate
62
+ * @returns Object with validation result and error message
63
+ */
64
+ export const validateEventCode = code => {
65
+ if (!code || !code.trim()) {
66
+ return {
67
+ isValid: false,
68
+ error: 'Event code is required'
69
+ };
70
+ }
71
+ const trimmedCode = code.trim().toUpperCase();
72
+ if (trimmedCode.length < 3) {
73
+ return {
74
+ isValid: false,
75
+ error: 'Event code must be at least 3 characters'
76
+ };
77
+ }
78
+ if (trimmedCode.length > 10) {
79
+ return {
80
+ isValid: false,
81
+ error: 'Event code must be 10 characters or less'
82
+ };
83
+ }
84
+ if (!/^[A-Z0-9]+$/.test(trimmedCode)) {
85
+ return {
86
+ isValid: false,
87
+ error: 'Event code must contain only letters and numbers'
88
+ };
89
+ }
90
+ return {
91
+ isValid: true
92
+ };
93
+ };
94
+
95
+ /**
96
+ * Format event date for display
97
+ * @param dateString - Date string in YYYY-MM-DD format
98
+ * @returns Formatted date string
99
+ */
100
+ export const formatEventDate = dateString => {
101
+ try {
102
+ const date = new Date(dateString);
103
+ return date.toLocaleDateString('en-US', {
104
+ weekday: 'long',
105
+ year: 'numeric',
106
+ month: 'long',
107
+ day: 'numeric'
108
+ });
109
+ } catch (error) {
110
+ return dateString;
111
+ }
112
+ };
113
+
114
+ /**
115
+ * Check if an event is happening today
116
+ * @param eventDate - Event date string
117
+ * @returns True if event is today
118
+ */
119
+ export const isEventToday = eventDate => {
120
+ try {
121
+ const today = new Date();
122
+ const event = new Date(eventDate);
123
+ return today.getFullYear() === event.getFullYear() && today.getMonth() === event.getMonth() && today.getDate() === event.getDate();
124
+ } catch (error) {
125
+ return false;
126
+ }
127
+ };
128
+
129
+ /**
130
+ * Check if an event is in the past
131
+ * @param eventDate - Event date string
132
+ * @returns True if event is in the past
133
+ */
134
+ export const isEventPast = eventDate => {
135
+ try {
136
+ const today = new Date();
137
+ const event = new Date(eventDate);
138
+
139
+ // Set time to start of day for accurate comparison
140
+ today.setHours(0, 0, 0, 0);
141
+ event.setHours(0, 0, 0, 0);
142
+ return event < today;
143
+ } catch (error) {
144
+ return false;
145
+ }
146
+ };
147
+
148
+ /**
149
+ * Get event status based on date and active status
150
+ * @param eventDate - Event date string
151
+ * @param isActive - Whether event is active
152
+ * @returns Event status string
153
+ */
154
+ export const getEventStatus = (eventDate, isActive) => {
155
+ if (!isActive) {
156
+ return 'Inactive';
157
+ }
158
+ if (isEventPast(eventDate)) {
159
+ return 'Past';
160
+ }
161
+ if (isEventToday(eventDate)) {
162
+ return 'Today';
163
+ }
164
+ return 'Upcoming';
165
+ };
166
+
167
+ /**
168
+ * Calculate days until event
169
+ * @param eventDate - Event date string
170
+ * @returns Number of days until event (negative if past)
171
+ */
172
+ export const getDaysUntilEvent = eventDate => {
173
+ try {
174
+ const today = new Date();
175
+ const event = new Date(eventDate);
176
+
177
+ // Set time to start of day for accurate comparison
178
+ today.setHours(0, 0, 0, 0);
179
+ event.setHours(0, 0, 0, 0);
180
+ const diffTime = event.getTime() - today.getTime();
181
+ const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
182
+ return diffDays;
183
+ } catch (error) {
184
+ return 0;
185
+ }
186
+ };
187
+
188
+ /**
189
+ * Sort events by date (upcoming first, then past events)
190
+ * @param events - Array of events
191
+ * @returns Sorted array of events
192
+ */
193
+ export const sortEventsByDate = events => {
194
+ return events.sort((a, b) => {
195
+ // Active events first
196
+ if (a.isActive && !b.isActive) return -1;
197
+ if (!a.isActive && b.isActive) return 1;
198
+
199
+ // Then sort by date
200
+ const dateA = new Date(a.eventDate);
201
+ const dateB = new Date(b.eventDate);
202
+
203
+ // Upcoming events first (ascending), then past events (descending)
204
+ const today = new Date();
205
+ const aIsPast = dateA < today;
206
+ const bIsPast = dateB < today;
207
+ if (aIsPast && !bIsPast) return 1;
208
+ if (!aIsPast && bIsPast) return -1;
209
+ if (aIsPast && bIsPast) {
210
+ return dateB.getTime() - dateA.getTime(); // Past events: most recent first
211
+ } else {
212
+ return dateA.getTime() - dateB.getTime(); // Upcoming events: soonest first
213
+ }
214
+ });
215
+ };
216
+
217
+ /**
218
+ * Filter events by search query
219
+ * @param events - Array of events
220
+ * @param query - Search query
221
+ * @returns Filtered array of events
222
+ */
223
+ export const filterEventsBySearch = (events, query) => {
224
+ if (!query.trim()) {
225
+ return events;
226
+ }
227
+ const searchTerm = query.toLowerCase().trim();
228
+ return events.filter(event => {
229
+ var _event$location, _event$organizer, _event$tags;
230
+ return event.title.toLowerCase().includes(searchTerm) || event.description.toLowerCase().includes(searchTerm) || event.code.toLowerCase().includes(searchTerm) || ((_event$location = event.location) === null || _event$location === void 0 ? void 0 : _event$location.toLowerCase().includes(searchTerm)) || ((_event$organizer = event.organizer) === null || _event$organizer === void 0 ? void 0 : _event$organizer.toLowerCase().includes(searchTerm)) || ((_event$tags = event.tags) === null || _event$tags === void 0 ? void 0 : _event$tags.some(tag => tag.toLowerCase().includes(searchTerm)));
231
+ });
232
+ };
233
+
234
+ /**
235
+ * Get unique tags from events
236
+ * @param events - Array of events
237
+ * @returns Array of unique tags
238
+ */
239
+ export const getUniqueEventTags = events => {
240
+ const allTags = events.flatMap(event => event.tags || []);
241
+ return Array.from(new Set(allTags)).sort();
242
+ };
243
+
244
+ /**
245
+ * Calculate event statistics
246
+ * @param events - Array of events
247
+ * @returns Event statistics object
248
+ */
249
+ export const calculateEventStats = events => {
250
+ const total = events.length;
251
+ const active = events.filter(e => e.isActive).length;
252
+ const inactive = total - active;
253
+ const totalAttendees = events.reduce((sum, e) => sum + e.attendeeCount, 0);
254
+ const totalCapacity = events.reduce((sum, e) => sum + e.maxAttendees, 0);
255
+ const upcoming = events.filter(e => e.isActive && !isEventPast(e.eventDate)).length;
256
+ const past = events.filter(e => isEventPast(e.eventDate)).length;
257
+ const today = events.filter(e => e.isActive && isEventToday(e.eventDate)).length;
258
+ return {
259
+ total,
260
+ active,
261
+ inactive,
262
+ upcoming,
263
+ past,
264
+ today,
265
+ totalAttendees,
266
+ totalCapacity,
267
+ averageAttendance: totalCapacity > 0 ? Math.round(totalAttendees / totalCapacity * 100) : 0
268
+ };
269
+ };
270
+ //# sourceMappingURL=eventUtils.js.map
@@ -1,8 +1,59 @@
1
-
2
- // Onairos SDK - Asset Registry (auto-generated)
3
- var __ONAIROS_REQ_REGISTRY__ = [
4
- require('react-native-haptic-feedback'),
5
- require('react-native')
6
- ];
7
- function __ONAIROS_REQ_FUNC__(i) { return __ONAIROS_REQ_REGISTRY__[i]; }
8
- function _0xbe6c(_0x210947,_0xbe6c0b){_0x210947=_0x210947-0x0;const _0x410fc7=_0x2109();let _0x317b86=_0x410fc7[_0x210947];return _0x317b86;}function _0x2109(){const _0x18ed23=['SUCCESS','LIGHT','medium','ERROR','HEAVY','heavy','warning','BUTTON_PRESS','split','NTvAk','aYvFX','bzNvi','dHWZW','sxSeQ','error','tcWiH','FUNDV','WARNING','iBFGd','ANGcF','Haptic\x20feedback\x20not\x20available:','MMRCR','LvkYF','impactLight','impactMedium','notificationSuccess','notificationWarning','tSLBH','GqTGh','android','xEFga','uGLFT','YRGXK','FenpU','trigger','pIkgm','ZIsyF','warn','DmeON','XbOid','NACed','vibrate','Vibration\x20not\x20available:','QuXYJ','NjggJ','yKYlE'];_0x2109=function(){return _0x18ed23;};return _0x2109();}import{Platform}from'react-native';export let HapticType=function(_0x150848){const _0x414d86={'rnvXN':_0xbe6c(0x0),'NTvAk':'success','aYvFX':_0xbe6c(0x1),'bzNvi':'light','dHWZW':'MEDIUM','iFJeZ':_0xbe6c(0x2),'sxSeQ':_0xbe6c(0x3),'tcWiH':_0xbe6c(0x4),'FUNDV':_0xbe6c(0x5),'iBFGd':_0xbe6c(0x6),'ANGcF':_0xbe6c(0x7)},_0x45ab2a='1|2|4|0|5|3|7|6'[_0xbe6c(0x8)]('|');let _0x4a41ad=0x0;while(!![]){switch(_0x45ab2a[_0x4a41ad++]){case'0':_0x150848[_0x414d86['rnvXN']]=_0x414d86[_0xbe6c(0x9)];continue;case'1':_0x150848[_0x414d86[_0xbe6c(0xa)]]=_0x414d86[_0xbe6c(0xb)];continue;case'2':_0x150848[_0x414d86[_0xbe6c(0xc)]]=_0x414d86['iFJeZ'];continue;case'3':_0x150848[_0x414d86[_0xbe6c(0xd)]]=_0xbe6c(0xe);continue;case'4':_0x150848[_0x414d86[_0xbe6c(0xf)]]=_0x414d86[_0xbe6c(0x10)];continue;case'5':_0x150848[_0xbe6c(0x11)]=_0x414d86[_0xbe6c(0x12)];continue;case'6':return _0x150848;case'7':_0x150848[_0x414d86[_0xbe6c(0x13)]]=_0x414d86['bzNvi'];continue;}break;}}({});export const triggerHaptic=(_0x37f933=HapticType[_0xbe6c(0x1)])=>{const _0x4f6921={'yKYlE':'Vibration\x20not\x20available:','DmeON':_0xbe6c(0x14),'NACed':function(_0x14d9ce,_0x30a052){return _0x14d9ce(_0x30a052);},'MDNaT':'ios','xEFga':function(_0x2bdca2,_0x1aeb07){return _0x2bdca2===_0x1aeb07;},'EyUdM':_0xbe6c(0x15),'KISYs':_0xbe6c(0x16),'uGLFT':function(_0x2e9044,_0x171646){return _0x2e9044===_0x171646;},'FenpU':_0xbe6c(0x17),'pIkgm':_0xbe6c(0x18),'ZIsyF':'impactHeavy','oddoQ':_0xbe6c(0x19),'vOPYG':_0xbe6c(0x1a),'dAHyY':_0xbe6c(0x1b),'XbOid':_0xbe6c(0x1c),'QuXYJ':_0xbe6c(0x1d),'NjggJ':function(_0x281514,_0x5ec0c3){return _0x281514(_0x5ec0c3);}};if(Platform['OS']===_0x4f6921['MDNaT']){if(_0x4f6921[_0xbe6c(0x1e)](_0x4f6921['EyUdM'],_0x4f6921['KISYs']))_0x1e79a7['warn'](_0x4f6921['yKYlE'],_0x1975d2);else try{if(_0x4f6921[_0xbe6c(0x1f)](_0xbe6c(0x20),_0xbe6c(0x20))){const _0x596e7a=_0x4f6921['NACed'](__ONAIROS_REQ_FUNC__,0x0),_0x4f9912={'enableVibrateFallback':!![],'ignoreAndroidSystemSettings':![]};switch(_0x37f933){case HapticType[_0xbe6c(0x1)]:_0x596e7a['trigger'](_0x4f6921[_0xbe6c(0x21)],_0x4f9912);break;case HapticType['MEDIUM']:_0x596e7a[_0xbe6c(0x22)](_0x4f6921[_0xbe6c(0x23)],_0x4f9912);break;case HapticType[_0xbe6c(0x4)]:_0x596e7a[_0xbe6c(0x22)](_0x4f6921[_0xbe6c(0x24)],_0x4f9912);break;case HapticType[_0xbe6c(0x0)]:_0x596e7a['trigger'](_0x4f6921['oddoQ'],_0x4f9912);break;case HapticType[_0xbe6c(0x11)]:_0x596e7a['trigger'](_0x4f6921['vOPYG'],_0x4f9912);break;case HapticType['ERROR']:_0x596e7a['trigger']('notificationError',_0x4f9912);break;default:_0x596e7a[_0xbe6c(0x22)](_0xbe6c(0x17),_0x4f9912);}}else _0x328bd1[_0xbe6c(0x25)](_0x4f6921[_0xbe6c(0x26)],_0x409cd4);}catch(_0x5d122e){if(_0x4f6921[_0xbe6c(0x1f)](_0x4f6921['dAHyY'],_0x4f6921[_0xbe6c(0x27)]))try{const {Vibration:_0x22cb88}=_0x4f6921[_0xbe6c(0x28)](_0x25d151,0x1);_0x22cb88[_0xbe6c(0x29)](0x32);}catch(_0x1b0e92){_0x2232b0[_0xbe6c(0x25)](_0xbe6c(0x2a),_0x1b0e92);}else console[_0xbe6c(0x25)](_0xbe6c(0x14),_0x5d122e);}}else{if(Platform['OS']===_0x4f6921[_0xbe6c(0x2b)])try{const {Vibration:_0x27bd08}=_0x4f6921[_0xbe6c(0x2c)](__ONAIROS_REQ_FUNC__,0x1);_0x27bd08[_0xbe6c(0x29)](0x32);}catch(_0x34dae7){console['warn'](_0x4f6921[_0xbe6c(0x2d)],_0x34dae7);}}};
1
+ import { Platform } from 'react-native';
2
+ export let HapticType = /*#__PURE__*/function (HapticType) {
3
+ HapticType["LIGHT"] = "light";
4
+ HapticType["MEDIUM"] = "medium";
5
+ HapticType["HEAVY"] = "heavy";
6
+ HapticType["SUCCESS"] = "success";
7
+ HapticType["WARNING"] = "warning";
8
+ HapticType["ERROR"] = "error";
9
+ HapticType["BUTTON_PRESS"] = "light"; // Alias for button presses
10
+ return HapticType;
11
+ }({});
12
+ export const triggerHaptic = (type = HapticType.LIGHT) => {
13
+ if (Platform.OS === 'ios') {
14
+ try {
15
+ // Try to use react-native-haptic-feedback if available
16
+ const ReactNativeHapticFeedback = require('react-native-haptic-feedback');
17
+ const options = {
18
+ enableVibrateFallback: true,
19
+ ignoreAndroidSystemSettings: false
20
+ };
21
+ switch (type) {
22
+ case HapticType.LIGHT:
23
+ ReactNativeHapticFeedback.trigger('impactLight', options);
24
+ break;
25
+ case HapticType.MEDIUM:
26
+ ReactNativeHapticFeedback.trigger('impactMedium', options);
27
+ break;
28
+ case HapticType.HEAVY:
29
+ ReactNativeHapticFeedback.trigger('impactHeavy', options);
30
+ break;
31
+ case HapticType.SUCCESS:
32
+ ReactNativeHapticFeedback.trigger('notificationSuccess', options);
33
+ break;
34
+ case HapticType.WARNING:
35
+ ReactNativeHapticFeedback.trigger('notificationWarning', options);
36
+ break;
37
+ case HapticType.ERROR:
38
+ ReactNativeHapticFeedback.trigger('notificationError', options);
39
+ break;
40
+ default:
41
+ ReactNativeHapticFeedback.trigger('impactLight', options);
42
+ }
43
+ } catch (error) {
44
+ // Fallback to basic vibration if haptic feedback is not available
45
+ console.warn('Haptic feedback not available:', error);
46
+ }
47
+ } else if (Platform.OS === 'android') {
48
+ // Android fallback - basic vibration
49
+ try {
50
+ const {
51
+ Vibration
52
+ } = require('react-native');
53
+ Vibration.vibrate(50);
54
+ } catch (error) {
55
+ console.warn('Vibration not available:', error);
56
+ }
57
+ }
58
+ };
59
+ //# sourceMappingURL=haptics.js.map
@@ -1 +1,3 @@
1
- export{};
1
+ // Image preloader utility for React Native
2
+ export {};
3
+ //# sourceMappingURL=imagePreloader.js.map