@onairos/react-native 3.7.2 → 3.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/lib/commonjs/api/index.js +219 -9
  2. package/lib/commonjs/components/BodyText.js +27 -9
  3. package/lib/commonjs/components/BrandMark.js +111 -10
  4. package/lib/commonjs/components/CodeInput.js +116 -9
  5. package/lib/commonjs/components/EmailInput.js +30 -8
  6. package/lib/commonjs/components/GoogleButton.js +56 -9
  7. package/lib/commonjs/components/HeadingGroup.js +43 -9
  8. package/lib/commonjs/components/LLMDataInputModal.js +664 -14
  9. package/lib/commonjs/components/ModalHeader.js +99 -9
  10. package/lib/commonjs/components/ModalSheet.js +47 -9
  11. package/lib/commonjs/components/Onairos.js +380 -14
  12. package/lib/commonjs/components/OnairosButton.js +313 -13
  13. package/lib/commonjs/components/OnairosSignInButton.js +130 -12
  14. package/lib/commonjs/components/Overlay.js +465 -13
  15. package/lib/commonjs/components/PersonaImage.js +137 -10
  16. package/lib/commonjs/components/PersonaLoadingScreen.js +318 -12
  17. package/lib/commonjs/components/PersonalizationConsentScreen.js +467 -13
  18. package/lib/commonjs/components/PinCreationScreen.js +403 -12
  19. package/lib/commonjs/components/PinInput.js +464 -9
  20. package/lib/commonjs/components/PlatformConnectorsStep.js +1311 -23
  21. package/lib/commonjs/components/PlatformList.js +137 -10
  22. package/lib/commonjs/components/PlatformToggle.js +180 -9
  23. package/lib/commonjs/components/PrimaryButton.js +180 -10
  24. package/lib/commonjs/components/SignInMatchAnimation.js +197 -9
  25. package/lib/commonjs/components/SignInStep.js +345 -12
  26. package/lib/commonjs/components/UniversalOnboarding.js +2780 -30
  27. package/lib/commonjs/components/VerificationStep.js +176 -11
  28. package/lib/commonjs/components/WelcomeScreen.js +461 -22
  29. package/lib/commonjs/components/icons/Basicproficon.js +37 -8
  30. package/lib/commonjs/components/icons/Basicprofile.js +21 -8
  31. package/lib/commonjs/components/icons/Checkbox.js +21 -8
  32. package/lib/commonjs/components/icons/Checkmark.js +27 -8
  33. package/lib/commonjs/components/icons/Contentanalysis.js +21 -8
  34. package/lib/commonjs/components/icons/Contenticon.js +39 -8
  35. package/lib/commonjs/components/icons/EnochE.js +41 -8
  36. package/lib/commonjs/components/icons/Personalityicon.js +30 -8
  37. package/lib/commonjs/components/icons/Personalityprofile.js +21 -8
  38. package/lib/commonjs/components/icons/Personalitytraits.js +21 -8
  39. package/lib/commonjs/components/icons/Userpreferences.js +21 -8
  40. package/lib/commonjs/components/icons/index.js +84 -17
  41. package/lib/commonjs/components/onboarding/OAuthWebView.js +1754 -18
  42. package/lib/commonjs/components/onboarding/OnboardingHeader.js +74 -10
  43. package/lib/commonjs/components/onboarding/PinInput.js +283 -10
  44. package/lib/commonjs/components/onboarding/PlatformConnector.js +249 -11
  45. package/lib/commonjs/config/PLATFORM_APIS.md +849 -0
  46. package/lib/commonjs/config/api.js +56 -7
  47. package/lib/commonjs/constants/index.js +120 -7
  48. package/lib/commonjs/context/AuthContext.js +345 -10
  49. package/lib/commonjs/hooks/useConnectedAccounts.js +111 -9
  50. package/lib/commonjs/hooks/useConnections.js +102 -8
  51. package/lib/commonjs/hooks/useCredentials.js +178 -10
  52. package/lib/commonjs/hooks/useUserConnections.js +148 -10
  53. package/lib/commonjs/index.js +439 -34
  54. package/lib/commonjs/services/apiClient.js +298 -8
  55. package/lib/commonjs/services/biometricPinService.js +180 -8
  56. package/lib/commonjs/services/chatGPTConversationExtractor.js +155 -8
  57. package/lib/commonjs/services/chatGPTConversationService.js +275 -9
  58. package/lib/commonjs/services/claudeConversationExtractor.js +103 -8
  59. package/lib/commonjs/services/claudeConversationService.js +158 -9
  60. package/lib/commonjs/services/connectedAccountsService.js +310 -10
  61. package/lib/commonjs/services/googleAuthService.js +252 -11
  62. package/lib/commonjs/services/hingeDataExtractor.js +105 -8
  63. package/lib/commonjs/services/hingeDataService.js +150 -9
  64. package/lib/commonjs/services/imageCompressionService.js +260 -7
  65. package/lib/commonjs/services/instagramDataExtractor.js +126 -8
  66. package/lib/commonjs/services/instagramDataService.js +163 -9
  67. package/lib/commonjs/services/jwtStorageService.js +276 -7
  68. package/lib/commonjs/services/linkedinDOMExtractor.js +245 -7
  69. package/lib/commonjs/services/linkedinProfileService.js +222 -9
  70. package/lib/commonjs/services/linkedinScrapingService.js +230 -8
  71. package/lib/commonjs/services/llmDataStorage.js +294 -8
  72. package/lib/commonjs/services/mobileTrainingService.js +186 -8
  73. package/lib/commonjs/services/netflixDataExtractor.js +120 -8
  74. package/lib/commonjs/services/netflixDataService.js +198 -9
  75. package/lib/commonjs/services/pinEncryptionService.js +84 -8
  76. package/lib/commonjs/services/pinStorageUtils.js +105 -7
  77. package/lib/commonjs/services/platformAuthService.js +1484 -12
  78. package/lib/commonjs/services/sephoraDataExtractor.js +140 -8
  79. package/lib/commonjs/services/sephoraDataService.js +200 -9
  80. package/lib/commonjs/services/spotifyDataExtractor.js +148 -8
  81. package/lib/commonjs/services/spotifyDataService.js +241 -9
  82. package/lib/commonjs/services/storageService.js +404 -8
  83. package/lib/commonjs/services/telegramDataExtractor.js +115 -8
  84. package/lib/commonjs/services/telegramDataService.js +499 -9
  85. package/lib/commonjs/services/trainingApiHelpers.js +73 -7
  86. package/lib/commonjs/services/userConnectionsService.js +340 -10
  87. package/lib/commonjs/services/youtubeMigrationService.js +416 -10
  88. package/lib/commonjs/theme/index.js +250 -7
  89. package/lib/commonjs/types/ambient.d.js +2 -1
  90. package/lib/commonjs/types/declarations.d.js +2 -1
  91. package/lib/commonjs/types/index.js +6 -1
  92. package/lib/commonjs/types/node-fix.d.js +2 -1
  93. package/lib/commonjs/types/node-override.d.js +2 -1
  94. package/lib/commonjs/types/opacity.d.js +2 -1
  95. package/lib/commonjs/types.js +14 -1
  96. package/lib/commonjs/utils/Portal.js +98 -8
  97. package/lib/commonjs/utils/api.js +130 -9
  98. package/lib/commonjs/utils/assetRegistry.js +210 -35
  99. package/lib/commonjs/utils/auth.js +112 -9
  100. package/lib/commonjs/utils/connectorTests.js +613 -29
  101. package/lib/commonjs/utils/crypto.js +62 -8
  102. package/lib/commonjs/utils/debugHelper.js +64 -1
  103. package/lib/commonjs/utils/encryption.js +76 -7
  104. package/lib/commonjs/utils/eventUtils.js +288 -1
  105. package/lib/commonjs/utils/haptics.js +66 -9
  106. package/lib/commonjs/utils/imagePreloader.js +6 -1
  107. package/lib/commonjs/utils/networkDiagnostics.js +226 -8
  108. package/lib/commonjs/utils/onairosApi.js +350 -9
  109. package/lib/commonjs/utils/programmaticFlow.js +117 -9
  110. package/lib/commonjs/utils/retryHelper.js +220 -1
  111. package/lib/commonjs/utils/secureStorage.js +349 -10
  112. package/lib/commonjs/utils/webviewScripts/chatgpt.js +551 -1
  113. package/lib/commonjs/utils/webviewScripts/claude.js +376 -1
  114. package/lib/commonjs/utils/webviewScripts/hinge.js +411 -1
  115. package/lib/commonjs/utils/webviewScripts/index.js +698 -15
  116. package/lib/commonjs/utils/webviewScripts/instagram.js +454 -1
  117. package/lib/commonjs/utils/webviewScripts/linkedin.js +880 -1
  118. package/lib/commonjs/utils/webviewScripts/netflix.js +382 -1
  119. package/lib/commonjs/utils/webviewScripts/sephora.js +516 -1
  120. package/lib/commonjs/utils/webviewScripts/spotify.js +419 -1
  121. package/lib/commonjs/utils/webviewScripts/telegram.js +678 -1
  122. package/lib/module/api/index.js +211 -1
  123. package/lib/module/components/BodyText.js +20 -1
  124. package/lib/module/components/BrandMark.js +104 -1
  125. package/lib/module/components/CodeInput.js +109 -1
  126. package/lib/module/components/EmailInput.js +23 -1
  127. package/lib/module/components/GoogleButton.js +49 -1
  128. package/lib/module/components/HeadingGroup.js +36 -1
  129. package/lib/module/components/LLMDataInputModal.js +656 -7
  130. package/lib/module/components/ModalHeader.js +92 -1
  131. package/lib/module/components/ModalSheet.js +39 -1
  132. package/lib/module/components/Onairos.js +373 -1
  133. package/lib/module/components/OnairosButton.js +305 -1
  134. package/lib/module/components/OnairosSignInButton.js +121 -1
  135. package/lib/module/components/Overlay.js +456 -1
  136. package/lib/module/components/PersonaImage.js +129 -1
  137. package/lib/module/components/PersonaLoadingScreen.js +310 -1
  138. package/lib/module/components/PersonalizationConsentScreen.js +460 -1
  139. package/lib/module/components/PinCreationScreen.js +396 -1
  140. package/lib/module/components/PinInput.js +456 -1
  141. package/lib/module/components/PlatformConnectorsStep.js +1302 -6
  142. package/lib/module/components/PlatformList.js +129 -1
  143. package/lib/module/components/PlatformToggle.js +173 -1
  144. package/lib/module/components/PrimaryButton.js +172 -1
  145. package/lib/module/components/SignInMatchAnimation.js +189 -1
  146. package/lib/module/components/SignInStep.js +338 -1
  147. package/lib/module/components/UniversalOnboarding.js +2770 -1
  148. package/lib/module/components/VerificationStep.js +168 -1
  149. package/lib/module/components/WelcomeScreen.js +453 -1
  150. package/lib/module/components/icons/Basicproficon.js +30 -1
  151. package/lib/module/components/icons/Basicprofile.js +14 -1
  152. package/lib/module/components/icons/Checkbox.js +14 -1
  153. package/lib/module/components/icons/Checkmark.js +20 -1
  154. package/lib/module/components/icons/Contentanalysis.js +14 -1
  155. package/lib/module/components/icons/Contenticon.js +32 -1
  156. package/lib/module/components/icons/EnochE.js +34 -1
  157. package/lib/module/components/icons/Personalityicon.js +23 -1
  158. package/lib/module/components/icons/Personalityprofile.js +14 -1
  159. package/lib/module/components/icons/Personalitytraits.js +14 -1
  160. package/lib/module/components/icons/Userpreferences.js +14 -1
  161. package/lib/module/components/icons/index.js +13 -1
  162. package/lib/module/components/onboarding/OAuthWebView.js +1746 -1
  163. package/lib/module/components/onboarding/OnboardingHeader.js +66 -1
  164. package/lib/module/components/onboarding/PinInput.js +274 -1
  165. package/lib/module/components/onboarding/PlatformConnector.js +240 -1
  166. package/lib/module/config/PLATFORM_APIS.md +849 -0
  167. package/lib/module/config/api.js +47 -1
  168. package/lib/module/constants/index.js +114 -1
  169. package/lib/module/context/AuthContext.js +335 -1
  170. package/lib/module/hooks/useConnectedAccounts.js +106 -1
  171. package/lib/module/hooks/useConnections.js +95 -1
  172. package/lib/module/hooks/useCredentials.js +171 -6
  173. package/lib/module/hooks/useUserConnections.js +140 -1
  174. package/lib/module/index.js +172 -1
  175. package/lib/module/services/apiClient.js +295 -1
  176. package/lib/module/services/biometricPinService.js +169 -1
  177. package/lib/module/services/chatGPTConversationExtractor.js +149 -1
  178. package/lib/module/services/chatGPTConversationService.js +268 -1
  179. package/lib/module/services/claudeConversationExtractor.js +97 -1
  180. package/lib/module/services/claudeConversationService.js +151 -1
  181. package/lib/module/services/connectedAccountsService.js +293 -1
  182. package/lib/module/services/googleAuthService.js +241 -1
  183. package/lib/module/services/hingeDataExtractor.js +99 -1
  184. package/lib/module/services/hingeDataService.js +143 -1
  185. package/lib/module/services/imageCompressionService.js +250 -1
  186. package/lib/module/services/instagramDataExtractor.js +120 -1
  187. package/lib/module/services/instagramDataService.js +156 -1
  188. package/lib/module/services/jwtStorageService.js +257 -1
  189. package/lib/module/services/linkedinDOMExtractor.js +234 -1
  190. package/lib/module/services/linkedinProfileService.js +210 -1
  191. package/lib/module/services/linkedinScrapingService.js +219 -1
  192. package/lib/module/services/llmDataStorage.js +277 -1
  193. package/lib/module/services/mobileTrainingService.js +173 -1
  194. package/lib/module/services/netflixDataExtractor.js +114 -1
  195. package/lib/module/services/netflixDataService.js +191 -1
  196. package/lib/module/services/pinEncryptionService.js +74 -6
  197. package/lib/module/services/pinStorageUtils.js +93 -1
  198. package/lib/module/services/platformAuthService.js +1461 -1
  199. package/lib/module/services/sephoraDataExtractor.js +134 -1
  200. package/lib/module/services/sephoraDataService.js +193 -1
  201. package/lib/module/services/spotifyDataExtractor.js +142 -1
  202. package/lib/module/services/spotifyDataService.js +234 -1
  203. package/lib/module/services/storageService.js +383 -1
  204. package/lib/module/services/telegramDataExtractor.js +109 -1
  205. package/lib/module/services/telegramDataService.js +493 -1
  206. package/lib/module/services/trainingApiHelpers.js +67 -1
  207. package/lib/module/services/userConnectionsService.js +329 -1
  208. package/lib/module/services/youtubeMigrationService.js +405 -1
  209. package/lib/module/theme/index.js +245 -1
  210. package/lib/module/types.js +10 -1
  211. package/lib/module/utils/Portal.js +90 -1
  212. package/lib/module/utils/api.js +118 -1
  213. package/lib/module/utils/assetRegistry.js +200 -34
  214. package/lib/module/utils/auth.js +100 -1
  215. package/lib/module/utils/connectorTests.js +600 -27
  216. package/lib/module/utils/crypto.js +54 -1
  217. package/lib/module/utils/debugHelper.js +54 -1
  218. package/lib/module/utils/encryption.js +67 -1
  219. package/lib/module/utils/eventUtils.js +270 -1
  220. package/lib/module/utils/haptics.js +59 -8
  221. package/lib/module/utils/imagePreloader.js +3 -1
  222. package/lib/module/utils/networkDiagnostics.js +217 -1
  223. package/lib/module/utils/onairosApi.js +333 -1
  224. package/lib/module/utils/programmaticFlow.js +111 -1
  225. package/lib/module/utils/retryHelper.js +211 -1
  226. package/lib/module/utils/secureStorage.js +330 -6
  227. package/lib/module/utils/webviewScripts/chatgpt.js +545 -1
  228. package/lib/module/utils/webviewScripts/claude.js +370 -1
  229. package/lib/module/utils/webviewScripts/hinge.js +405 -1
  230. package/lib/module/utils/webviewScripts/index.js +434 -1
  231. package/lib/module/utils/webviewScripts/instagram.js +448 -1
  232. package/lib/module/utils/webviewScripts/linkedin.js +874 -1
  233. package/lib/module/utils/webviewScripts/netflix.js +376 -1
  234. package/lib/module/utils/webviewScripts/sephora.js +510 -1
  235. package/lib/module/utils/webviewScripts/spotify.js +413 -1
  236. package/lib/module/utils/webviewScripts/telegram.js +672 -1
  237. package/package.json +2 -2
@@ -1 +1,54 @@
1
- import{RSA}from'react-native-rsa-native';import{sha256 as _0x3772c1}from'react-native-crypto-js';function _0x2bd6(){const _0x1a6b47=['-----END\x20PUBLIC\x20KEY-----','RSA\x20encryption\x20failed:','replace','-----BEGIN\x20PUBLIC\x20KEY-----','dljtZ','trim','-----BEGIN\x20PUBLIC\x20KEY-----\x0a','\x0a-----END\x20PUBLIC\x20KEY-----','encrypt','error','VgGKc','toString','base64','binary','from','HaPdD','VNynW','length','YUYtv','charCodeAt','buffer','dttJO','YIHPC','gVUcR','Error\x20converting\x20base64\x20to\x20buffer:'];_0x2bd6=function(){return _0x1a6b47;};return _0x2bd6();}export const rsaEncrypt=async(_0x36d604,_0x2a5444)=>{const _0x4d55c9={'dljtZ':_0x53e2(0x0),'qRPnA':_0x53e2(0x1)};try{const _0x49f96f=_0x36d604[_0x53e2(0x2)](/\\n/g,'')[_0x53e2(0x2)](/^\s+|\s+$/g,'')[_0x53e2(0x2)](_0x53e2(0x3),'')[_0x53e2(0x2)](_0x4d55c9[_0x53e2(0x4)],'')[_0x53e2(0x5)](),_0x4e2714=_0x53e2(0x6)+_0x49f96f+_0x53e2(0x7),_0x1960d3=await RSA[_0x53e2(0x8)](_0x2a5444,_0x4e2714);return _0x1960d3;}catch(_0x4cd011){console[_0x53e2(0x9)](_0x4d55c9['qRPnA'],_0x4cd011);throw _0x4cd011;}};function _0x53e2(_0x2bd6be,_0x53e290){_0x2bd6be=_0x2bd6be-0x0;const _0x3703cf=_0x2bd6();let _0x3f9836=_0x3703cf[_0x2bd6be];return _0x3f9836;}export const sha256=_0x31cf8e=>{const _0x322d53={'VgGKc':function(_0x18e612,_0x495f20){return _0x18e612(_0x495f20);}};return _0x322d53[_0x53e2(0xa)](_0x3772c1,_0x31cf8e)[_0x53e2(0xb)]();};export const base64ToBuffer=_0x182c5a=>{const _0x46824a={'HaPdD':_0x53e2(0xc),'VNynW':_0x53e2(0xd),'YUYtv':function(_0x1830a9,_0x539573){return _0x1830a9<_0x539573;},'dttJO':function(_0x4055af,_0x77d126){return _0x4055af!==_0x77d126;},'YIHPC':'KOxWG','gVUcR':'hwEHb'};try{const _0x477739=Buffer[_0x53e2(0xe)](_0x182c5a,_0x46824a[_0x53e2(0xf)])['toString'](_0x46824a[_0x53e2(0x10)]),_0x5b631a=new Uint8Array(_0x477739[_0x53e2(0x11)]);for(let _0x14d2d7=0x0;_0x46824a[_0x53e2(0x12)](_0x14d2d7,_0x477739[_0x53e2(0x11)]);_0x14d2d7++){_0x5b631a[_0x14d2d7]=_0x477739[_0x53e2(0x13)](_0x14d2d7);}return _0x5b631a[_0x53e2(0x14)];}catch(_0x4e2a97){if(_0x46824a[_0x53e2(0x15)](_0x46824a[_0x53e2(0x16)],_0x46824a[_0x53e2(0x17)])){console['error'](_0x53e2(0x18),_0x4e2a97);throw _0x4e2a97;}else _0x5cf4cc[_0x203265]=_0x5f1d84['charCodeAt'](_0x272a12);}};
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 _0x4c4f(){const _0x92dff8=['env','NODE_ENV','production','PLxoK','SuZIL','mSRUU','[Onairos\x20Error]\x20','VFnck','API\x20Request','pfiQR','IcxoX'];_0x4c4f=function(){return _0x92dff8;};return _0x4c4f();}const __DEV__=process[_0x3748(0x0)][_0x3748(0x1)]!==_0x3748(0x2);export const logDebug=(_0x4e6723,_0x35bb90)=>{__DEV__&&console['log']('[Onairos\x20Debug]\x20'+_0x4e6723+':',_0x35bb90||'');};export const logError=(_0xe0ab3,_0x5db2e9)=>{const _0x27ee2e={'gzSHj':_0x3748(0x3),'mSRUU':_0x3748(0x4)};if(__DEV__){if(_0x27ee2e['gzSHj']===_0x27ee2e[_0x3748(0x5)])return _0x3551d1===!![]||_0x3ffe5d;else console['error'](_0x3748(0x6)+_0xe0ab3+':',_0x5db2e9);}};export const isDebugMode=_0x335d34=>{const _0x33f2af={'VFnck':function(_0xa5222b,_0x21d9a4){return _0xa5222b===_0x21d9a4;}};return _0x33f2af[_0x3748(0x7)](_0x335d34,!![])||__DEV__;};function _0x3748(_0x4c4fba,_0x374832){_0x4c4fba=_0x4c4fba-0x0;const _0x3fce59=_0x4c4f();let _0x4bf515=_0x3fce59[_0x4c4fba];return _0x4bf515;}export const logApiRequest=(_0x4e9f59,_0x26d33c,_0x119274)=>{const _0xab8426={'pfiQR':_0x3748(0x8),'IcxoX':function(_0x5e9dc0,_0x8d8e69){return _0x5e9dc0||_0x8d8e69;}};__DEV__&&logDebug(_0xab8426[_0x3748(0x9)],{'method':_0x4e9f59,'url':_0x26d33c,'data':_0xab8426[_0x3748(0xa)](_0x119274,{})});};
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';export const encryptModelKey=(_0x4a1057,_0x4bd822)=>{const _0x2e33a6={'QPJRv':'Encrypting\x20model\x20key','YYVIK':function(_0x494b58,_0x559daf){return _0x494b58||_0x559daf;},'iCfrF':_0x30c0(0x0),'mxSPh':_0x30c0(0x1),'HDzIC':function(_0x4ed2cb,_0x210dba){return _0x4ed2cb===_0x210dba;},'uJnRf':_0x30c0(0x2)};try{if(_0x2e33a6[_0x30c0(0x3)](_0x2e33a6['uJnRf'],_0x2e33a6[_0x30c0(0x4)])){console['log'](_0x2e33a6[_0x30c0(0x5)]);if(_0x2e33a6[_0x30c0(0x6)](!_0x4a1057,!_0x4bd822))throw new Error(_0x2e33a6[_0x30c0(0x7)]);return _0x30c0(0x8)+_0x4bd822+'_'+Date[_0x30c0(0x9)]();}else try{_0x391a2a[_0x30c0(0xa)](_0x2e33a6[_0x30c0(0x5)]);if(_0x2e33a6[_0x30c0(0x6)](!_0x24e857,!_0x3b2ccc))throw new _0x336795(_0x2e33a6['iCfrF']);return'encrypted_'+_0x28209e+'_'+_0x3435e1[_0x30c0(0x9)]();}catch(_0x2b8d70){_0x1d8191['error'](_0x2e33a6[_0x30c0(0xb)],_0x2b8d70);throw _0x2b8d70;}}catch(_0x490eea){console[_0x30c0(0xc)](_0x2e33a6[_0x30c0(0xb)],_0x490eea);throw _0x490eea;}};function _0x30c0(_0x1f4512,_0x30c034){_0x1f4512=_0x1f4512-0x0;const _0x3a421c=_0x1f45();let _0x1ff9e0=_0x3a421c[_0x1f4512];return _0x1ff9e0;}export const getServerPublicKey=async()=>{const _0x5a9841={'JaNuc':'No\x20public\x20key\x20found\x20in\x20response','qOphn':_0x30c0(0xd),'IWPka':_0x30c0(0xe),'dZqSB':_0x30c0(0xf),'GqfiG':function(_0x55a932,_0x563db7){return _0x55a932!==_0x563db7;},'JVQYB':function(_0x32a6a6,_0x385530){return _0x32a6a6!==_0x385530;},'wknAp':function(_0xe35b3e,_0x5aeb50){return _0xe35b3e!==_0x5aeb50;},'Jeftw':function(_0x593a11,_0x4c301c){return _0x593a11!==_0x4c301c;},'suCzb':function(_0xd3d28d,_0x382b80){return _0xd3d28d===_0x382b80;},'EfCfU':_0x30c0(0x10),'lvAeP':_0x30c0(0x11),'AbSWC':function(_0x4a7f6b,_0x299fc7){return _0x4a7f6b!==_0x299fc7;},'nqfdf':_0x30c0(0x12),'ooGfG':_0x30c0(0x13),'iVBwR':function(_0x228167,_0x1ec9f9){return _0x228167!==_0x1ec9f9;},'Vfdiv':_0x30c0(0x14),'uoKak':_0x30c0(0x15)};try{var _0x50ccc4,_0x19703e;const _0x52513a=await onairosApi['get'](_0x5a9841[_0x30c0(0x16)]);if(_0x52513a!==null&&_0x5a9841[_0x30c0(0x17)](_0x52513a,void 0x0)&&_0x5a9841[_0x30c0(0x18)](_0x50ccc4=_0x52513a[_0x30c0(0x19)],null)&&_0x5a9841[_0x30c0(0x1a)](_0x50ccc4,void 0x0)&&_0x5a9841[_0x30c0(0x1a)](_0x50ccc4=_0x50ccc4['data'],null)&&_0x5a9841['Jeftw'](_0x50ccc4,void 0x0)&&_0x50ccc4[_0x30c0(0x1b)]){if(_0x5a9841['suCzb'](_0x5a9841[_0x30c0(0x1c)],_0x5a9841[_0x30c0(0x1d)]))throw new _0x228ed3(_0x5a9841['JaNuc']);else return _0x52513a[_0x30c0(0x19)][_0x30c0(0x19)][_0x30c0(0x1b)];}else{if(_0x5a9841['JVQYB'](_0x52513a,null)&&_0x52513a!==void 0x0&&_0x5a9841[_0x30c0(0x1e)](_0x19703e=_0x52513a['data'],null)&&_0x5a9841[_0x30c0(0x1f)](_0x19703e,void 0x0)&&_0x19703e[_0x30c0(0x1b)]){if(_0x5a9841['GqfiG'](_0x5a9841[_0x30c0(0x20)],'yCAiZ'))try{return _0x30c0(0x21)+_0x57bb0b['replace'](/\s+/g,'_')+'_'+_0x168644[_0x30c0(0x9)]();}catch(_0x528aae){return _0x22a552[_0x30c0(0xc)](_0x5a9841['qOphn'],_0x528aae),_0x30c0(0x22)+_0x16b074[_0x30c0(0x9)]();}else return _0x52513a[_0x30c0(0x19)]['publicKey'];}else{if(_0x5a9841[_0x30c0(0x23)](_0x5a9841[_0x30c0(0x24)],_0x30c0(0x13)))throw new Error(_0x5a9841[_0x30c0(0x25)]);else return _0xccacf8['error'](_0x5a9841[_0x30c0(0x26)],_0x191003),_0x30c0(0x15);}}}catch(_0x55a779){return _0x5a9841[_0x30c0(0x27)](_0x30c0(0x28),_0x5a9841['Vfdiv'])?(console[_0x30c0(0xc)](_0x5a9841[_0x30c0(0x26)],_0x55a779),_0x5a9841[_0x30c0(0x29)]):_0x5567d5[_0x30c0(0x19)][_0x30c0(0x1b)];}};export const hashString=async _0x1ce4e0=>{try{return _0x30c0(0x21)+_0x1ce4e0['replace'](/\s+/g,'_')+'_'+Date[_0x30c0(0x9)]();}catch(_0x2b95c4){return console[_0x30c0(0xc)](_0x30c0(0xd),_0x2b95c4),_0x30c0(0x22)+Date[_0x30c0(0x9)]();}};function _0x1f45(){const _0x57b108=['Public\x20key\x20or\x20model\x20key\x20is\x20missing','Error\x20encrypting\x20model\x20key:','swmkP','HDzIC','uJnRf','QPJRv','YYVIK','iCfrF','encrypted_','now','log','mxSPh','error','Error\x20hashing\x20string:','Error\x20getting\x20server\x20public\x20key:','public/getPublicKey','LAtAE','piTAN','yCAiZ','kcdyU','JSwuk','mock_public_key_for_testing','dZqSB','GqfiG','JVQYB','data','wknAp','publicKey','EfCfU','lvAeP','Jeftw','AbSWC','nqfdf','hash_','fallback_hash_','suCzb','ooGfG','JaNuc','IWPka','iVBwR','KCdTB','uoKak'];_0x1f45=function(){return _0x57b108;};return _0x1f45();}
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
- function _0xab99(){const _0x2e01ec=['PqGHR','charAt','floor','random','en-US','long','numeric','hbkDq','ZKxuo','trim','sjCqN','toUpperCase','replace','split','filter','length','XhGRR','osJun','KMsRz','fWatz','slice','map','substring','getFullYear','revVD','uhoDn','OZIxr','KLxCA','AojWu','taoLk','toLocaleDateString','rVQFG','xrRTl','VFkRU','Event\x20code\x20is\x20required','Event\x20code\x20must\x20be\x20at\x20least\x203\x20characters','eCjoX','EPiHq','hVosP','tRYuU','dblQw','jKdwb','OislG','Iejuu','test','nQiFo','evKuI','YuDTz','RxWrh','kfolg','GSXhc','ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789','cHalO','JsTCa','VnFce','HsOhG','getDate','TnZCn','uREzN','wYVgb','kcJkp','Event\x20code\x20must\x20be\x2010\x20characters\x20or\x20less','EuXgm','qsvEG','qPzam','setHours','Past','Upcoming','bitrT','UEBGt','Today','SeKve','lIBbx','getTime','ceil','xkCBB','ujGvG','tHIBq','sort','OwCwe','jsScI','XaQmM','cWvxK','isActive','eventDate','zRERP','QczOC','nRVpw','CxkhU','LmgEq','DCZoP','UKXhe','GSiNR','WLKkh','toLowerCase','includes','description','code','TFckA','location','hJXxQ','organizer','tags','qyXHX','ZjfsG','reduce','attendeeCount','GwoYN','round','rRUZj'];_0xab99=function(){return _0x2e01ec;};return _0xab99();}export const generateEventCode=(_0xefc064=0x6)=>{const _0x6ae6b2={'PqGHR':function(_0x4cb138,_0x19e8ec){return _0x4cb138<_0x19e8ec;},'wYpvT':function(_0x504caa,_0x40f4f0){return _0x504caa*_0x40f4f0;}},_0x5432c0='ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';let _0x1aba03='';for(let _0x165f63=0x0;_0x6ae6b2[_0x5188(0x0)](_0x165f63,_0xefc064);_0x165f63++){_0x1aba03+=_0x5432c0[_0x5188(0x1)](Math[_0x5188(0x2)](_0x6ae6b2['wYpvT'](Math[_0x5188(0x3)](),_0x5432c0['length'])));}return _0x1aba03;};export const generateSmartEventCode=_0x42dc97=>{const _0x33f9d9={'sjCqN':function(_0x50d3dc){return _0x50d3dc();},'rVQFG':_0x5188(0x4),'xrRTl':_0x5188(0x5),'VFkRU':_0x5188(0x6),'XhGRR':function(_0x450172){return _0x450172();},'osJun':function(_0xd12bdd,_0x41522b){return _0xd12bdd===_0x41522b;},'KMsRz':'AxqHz','fWatz':_0x5188(0x7),'revVD':function(_0x57d27e,_0x48aef9){return _0x57d27e<_0x48aef9;},'OZIxr':'uhoDn','MvmPC':function(_0x16893c,_0x42ef9d){return _0x16893c-_0x42ef9d;},'KLxCA':function(_0x426621,_0x19d228){return _0x426621>_0x19d228;},'AojWu':function(_0x42b574,_0xa4e1df){return _0x42b574===_0xa4e1df;},'taoLk':_0x5188(0x8)};if(!_0x42dc97[_0x5188(0x9)]())return _0x33f9d9[_0x5188(0xa)](generateEventCode);const _0x438dc6=_0x42dc97['trim']()[_0x5188(0xb)]()[_0x5188(0xc)](/[^A-Z0-9\s]/g,'')[_0x5188(0xd)](/\s+/)[_0x5188(0xe)](_0x57cdf8=>_0x57cdf8[_0x5188(0xf)]>0x0);if(_0x438dc6[_0x5188(0xf)]===0x0)return _0x33f9d9[_0x5188(0x10)](generateEventCode);let _0x52e061='';if(_0x438dc6[_0x5188(0xf)]>=0x2){if(_0x33f9d9[_0x5188(0x11)](_0x33f9d9[_0x5188(0x12)],_0x33f9d9[_0x5188(0x13)]))return _0x3a46da();else{const _0xf621f7=_0x438dc6[_0x5188(0x14)](0x0,0x3);_0x52e061=_0xf621f7[_0x5188(0x15)](_0x353eec=>_0x353eec[_0x5188(0x16)](0x0,0x2))['join']('');}}else _0x52e061=_0x438dc6[0x0][_0x5188(0x16)](0x0,0x4);const _0x46211a=new Date()[_0x5188(0x17)]()['toString']()[_0x5188(0x14)](-0x2);_0x52e061+=_0x46211a;if(_0x33f9d9[_0x5188(0x18)](_0x52e061['length'],0x4)){if(_0x5188(0x19)===_0x33f9d9[_0x5188(0x1a)])_0x52e061+=generateEventCode(_0x33f9d9['MvmPC'](0x4,_0x52e061['length']));else return _0x33f9d9[_0x5188(0xa)](_0x40764a);}else{if(_0x33f9d9[_0x5188(0x1b)](_0x52e061[_0x5188(0xf)],0x8)){if(_0x33f9d9[_0x5188(0x1c)](_0x33f9d9['taoLk'],_0x33f9d9[_0x5188(0x1d)]))_0x52e061=_0x52e061['substring'](0x0,0x8);else{const _0x35e80e=new _0x504722(_0x352655);return _0x35e80e[_0x5188(0x1e)](_0x33f9d9[_0x5188(0x1f)],{'weekday':_0x33f9d9[_0x5188(0x20)],'year':_0x5188(0x6),'month':_0x33f9d9[_0x5188(0x20)],'day':_0x33f9d9[_0x5188(0x21)]});}}}return _0x52e061;};export const validateEventCode=_0x31a3c5=>{const _0x21a797={'hVosP':_0x5188(0x22),'dblQw':_0x5188(0x23),'tRYuU':function(_0x1f3dc7,_0x9f881d){return _0x1f3dc7<_0x9f881d;},'jKdwb':function(_0x1e8cd2,_0x189f12){return _0x1e8cd2===_0x189f12;},'OislG':_0x5188(0x24),'Iejuu':'Event\x20code\x20must\x20be\x2010\x20characters\x20or\x20less','nQiFo':function(_0x4e427f,_0x15f4f4){return _0x4e427f!==_0x15f4f4;},'YuDTz':_0x5188(0x25),'VGEhD':'Event\x20code\x20must\x20contain\x20only\x20letters\x20and\x20numbers'};if(!_0x31a3c5||!_0x31a3c5['trim']())return{'isValid':![],'error':_0x21a797[_0x5188(0x26)]};const _0x45c64b=_0x31a3c5[_0x5188(0x9)]()[_0x5188(0xb)]();if(_0x21a797[_0x5188(0x27)](_0x45c64b[_0x5188(0xf)],0x3))return{'isValid':![],'error':_0x21a797[_0x5188(0x28)]};if(_0x45c64b[_0x5188(0xf)]>0xa)return _0x21a797[_0x5188(0x29)](_0x21a797[_0x5188(0x2a)],_0x5188(0x24))?{'isValid':![],'error':_0x21a797[_0x5188(0x2b)]}:{'isValid':![],'error':_0x21a797[_0x5188(0x26)]};if(!/^[A-Z0-9]+$/[_0x5188(0x2c)](_0x45c64b))return _0x21a797[_0x5188(0x2d)](_0x5188(0x2e),_0x21a797[_0x5188(0x2f)])?{'isValid':![],'error':_0x21a797['VGEhD']}:{'isValid':![],'error':_0x21a797[_0x5188(0x28)]};return{'isValid':!![]};};export const formatEventDate=_0x3e4438=>{const _0x283daf={'RxWrh':_0x5188(0x4),'kfolg':'long','GSXhc':_0x5188(0x6)};try{const _0x40b444=new Date(_0x3e4438);return _0x40b444[_0x5188(0x1e)](_0x283daf[_0x5188(0x30)],{'weekday':_0x283daf[_0x5188(0x31)],'year':_0x283daf[_0x5188(0x32)],'month':_0x5188(0x5),'day':_0x283daf[_0x5188(0x32)]});}catch(_0x5bcc27){return _0x3e4438;}};export const isEventToday=_0x9b2985=>{const _0x22f681={'wYVgb':_0x5188(0x33),'iUKAE':function(_0x230b1c,_0x56797f){return _0x230b1c<_0x56797f;},'kcJkp':function(_0x201fb2,_0xfc40e8){return _0x201fb2*_0xfc40e8;},'VnFce':'JsTCa','HsOhG':function(_0x28cd0b,_0x55c5c1){return _0x28cd0b===_0x55c5c1;},'TnZCn':function(_0x5df828,_0x2fa923){return _0x5df828===_0x2fa923;},'uREzN':_0x5188(0x34)};try{if(_0x5188(0x35)===_0x22f681[_0x5188(0x36)]){const _0x2d3c64=new Date(),_0xf345ba=new Date(_0x9b2985);return _0x2d3c64[_0x5188(0x17)]()===_0xf345ba[_0x5188(0x17)]()&&_0x22f681[_0x5188(0x37)](_0x2d3c64['getMonth'](),_0xf345ba['getMonth']())&&_0x22f681['TnZCn'](_0x2d3c64[_0x5188(0x38)](),_0xf345ba[_0x5188(0x38)]());}else return 0x0;}catch(_0x53ea1a){if(_0x22f681[_0x5188(0x39)](_0x22f681['uREzN'],_0x22f681[_0x5188(0x3a)]))return![];else{const _0x190445=_0x22f681[_0x5188(0x3b)];let _0x49c34b='';for(let _0x8b664a=0x0;_0x22f681['iUKAE'](_0x8b664a,_0x1b17af);_0x8b664a++){_0x49c34b+=_0x190445[_0x5188(0x1)](_0x25de85[_0x5188(0x2)](_0x22f681[_0x5188(0x3c)](_0x40037f['random'](),_0x190445[_0x5188(0xf)])));}return _0x49c34b;}}};function _0x5188(_0x518821,_0x20082d){_0x518821=_0x518821-0x0;const _0x106296=_0xab99();let _0x2efa96=_0x106296[_0x518821];return _0x2efa96;}export const isEventPast=_0x232686=>{const _0x4bcff9={'qPzam':_0x5188(0x3d),'EuXgm':function(_0x904bad,_0x5129af){return _0x904bad===_0x5129af;},'IBKDK':'FobjL','qsvEG':'ZxyrV'};try{if(_0x4bcff9[_0x5188(0x3e)](_0x4bcff9['IBKDK'],_0x4bcff9[_0x5188(0x3f)]))return{'isValid':![],'error':_0x4bcff9[_0x5188(0x40)]};else{const _0x2315c9=new Date(),_0x2f77b4=new Date(_0x232686);return _0x2315c9[_0x5188(0x41)](0x0,0x0,0x0,0x0),_0x2f77b4[_0x5188(0x41)](0x0,0x0,0x0,0x0),_0x2f77b4<_0x2315c9;}}catch(_0x4d5b0f){return![];}};export const getEventStatus=(_0x7c6cbe,_0x4fd455)=>{const _0x35ed22={'TEvqF':'Inactive','vyCqJ':function(_0x5439c8,_0x3bfdb9){return _0x5439c8(_0x3bfdb9);},'bitrT':_0x5188(0x42),'UEBGt':function(_0x37c037,_0x589659){return _0x37c037(_0x589659);},'SeKve':_0x5188(0x43)};if(!_0x4fd455)return _0x35ed22['TEvqF'];if(_0x35ed22['vyCqJ'](isEventPast,_0x7c6cbe))return _0x35ed22[_0x5188(0x44)];if(_0x35ed22[_0x5188(0x45)](isEventToday,_0x7c6cbe))return _0x5188(0x46);return _0x35ed22[_0x5188(0x47)];};export const getDaysUntilEvent=_0x24cae=>{const _0x569826={'lIBbx':function(_0x55cb59,_0x3eb4b7){return _0x55cb59-_0x3eb4b7;},'xkCBB':function(_0x18c13e,_0x470e8b){return _0x18c13e/_0x470e8b;},'ujGvG':function(_0x44c43a,_0x34d794){return _0x44c43a*_0x34d794;}};try{const _0xfa7bd5=new Date(),_0x299cb8=new Date(_0x24cae);_0xfa7bd5[_0x5188(0x41)](0x0,0x0,0x0,0x0),_0x299cb8['setHours'](0x0,0x0,0x0,0x0);const _0x1516f3=_0x569826[_0x5188(0x48)](_0x299cb8[_0x5188(0x49)](),_0xfa7bd5[_0x5188(0x49)]()),_0x39a7da=Math[_0x5188(0x4a)](_0x569826[_0x5188(0x4b)](_0x1516f3,_0x569826[_0x5188(0x4c)](0x3e8*0x3c,0x3c)*0x18));return _0x39a7da;}catch(_0x62907b){return 0x0;}};export const sortEventsByDate=_0x28dcf0=>{const _0x22ca94={'FMpez':function(_0x108869,_0x442f41){return _0x108869<_0x442f41;},'PNhyw':function(_0x4124f3,_0x3574d9){return _0x4124f3===_0x3574d9;},'OwCwe':_0x5188(0x4d),'jsScI':'fMzWx','Nesab':function(_0x17098f,_0x2a51a4){return _0x17098f<_0x2a51a4;},'zRERP':function(_0x201274,_0x11a372){return _0x201274<_0x11a372;},'fyRTU':function(_0x103b1f,_0x2ae1d3){return _0x103b1f&&_0x2ae1d3;},'QczOC':function(_0x5c91c7,_0x332202){return _0x5c91c7&&_0x332202;},'OYehN':function(_0x3ba550,_0x34c0a3){return _0x3ba550-_0x34c0a3;},'nRVpw':function(_0x7987de,_0x4add66){return _0x7987de!==_0x4add66;},'kMXOT':'mMaIE','LmgEq':function(_0x4a4d76,_0x18fb02){return _0x4a4d76-_0x18fb02;}};return _0x28dcf0[_0x5188(0x4e)]((_0x94f9f4,_0x568379)=>{const _0x219ade={'XaQmM':function(_0xdde3ca,_0x18e6e4){return _0xdde3ca===_0x18e6e4;},'cWvxK':function(_0x5b1976,_0x50a76a){return _0x5b1976===_0x50a76a;}};if(_0x22ca94['PNhyw'](_0x22ca94[_0x5188(0x4f)],_0x22ca94[_0x5188(0x50)]))try{const _0x13d62d=new _0x9204cb(),_0x3eefa6=new _0x48017f(_0x1f4fe0);return _0x219ade[_0x5188(0x51)](_0x13d62d[_0x5188(0x17)](),_0x3eefa6[_0x5188(0x17)]())&&_0x219ade[_0x5188(0x52)](_0x13d62d['getMonth'](),_0x3eefa6['getMonth']())&&_0x219ade[_0x5188(0x52)](_0x13d62d[_0x5188(0x38)](),_0x3eefa6[_0x5188(0x38)]());}catch(_0x442c88){return![];}else{if(_0x94f9f4[_0x5188(0x53)]&&!_0x568379[_0x5188(0x53)])return-0x1;if(!_0x94f9f4['isActive']&&_0x568379[_0x5188(0x53)])return 0x1;const _0x54dc88=new Date(_0x94f9f4[_0x5188(0x54)]),_0x1cbe9d=new Date(_0x568379[_0x5188(0x54)]),_0x11cb60=new Date(),_0x36fb04=_0x22ca94['Nesab'](_0x54dc88,_0x11cb60),_0x5da64c=_0x22ca94[_0x5188(0x55)](_0x1cbe9d,_0x11cb60);if(_0x22ca94['fyRTU'](_0x36fb04,!_0x5da64c))return 0x1;if(_0x22ca94[_0x5188(0x56)](!_0x36fb04,_0x5da64c))return-0x1;if(_0x22ca94[_0x5188(0x56)](_0x36fb04,_0x5da64c))return _0x22ca94['OYehN'](_0x1cbe9d[_0x5188(0x49)](),_0x54dc88[_0x5188(0x49)]());else{if(_0x22ca94[_0x5188(0x57)](_0x5188(0x58),_0x22ca94['kMXOT']))return _0x22ca94[_0x5188(0x59)](_0x54dc88[_0x5188(0x49)](),_0x1cbe9d['getTime']());else try{const _0x4d9711=new _0x2f9150(),_0x4b759f=new _0x2d9d26(_0x27b9a4);return _0x4d9711[_0x5188(0x41)](0x0,0x0,0x0,0x0),_0x4b759f[_0x5188(0x41)](0x0,0x0,0x0,0x0),_0x22ca94['FMpez'](_0x4b759f,_0x4d9711);}catch(_0x5ef0d3){return![];}}}});};export const filterEventsBySearch=(_0x34c482,_0x19adcf)=>{const _0x4ead88={'AsOMC':'Inactive','GSiNR':function(_0xfe91d8,_0x103d54){return _0xfe91d8(_0x103d54);},'WLKkh':_0x5188(0x43),'TFckA':function(_0x289cf9,_0x20616d){return _0x289cf9===_0x20616d;},'hJXxQ':function(_0x869b2c,_0x652029){return _0x869b2c===_0x652029;},'qyXHX':function(_0x51f411,_0x3ddcaf){return _0x51f411===_0x3ddcaf;},'DCZoP':function(_0x15837a,_0x166394){return _0x15837a!==_0x166394;},'LrLZo':'hZuNZ'};if(!_0x19adcf['trim']()){if(_0x4ead88[_0x5188(0x5a)](_0x5188(0x5b),_0x4ead88['LrLZo']))return _0x34c482;else{if(!_0x202f57)return _0x4ead88['AsOMC'];if(_0x4ead88[_0x5188(0x5c)](_0x3e9742,_0x363698))return _0x5188(0x42);if(_0x1fa913(_0x1a72e2))return _0x5188(0x46);return _0x4ead88[_0x5188(0x5d)];}}const _0x552ad1=_0x19adcf['toLowerCase']()[_0x5188(0x9)]();return _0x34c482['filter'](_0x4e7c7a=>{var _0x4fc5f5,_0x51b10e,_0x550751;return _0x4e7c7a['title'][_0x5188(0x5e)]()[_0x5188(0x5f)](_0x552ad1)||_0x4e7c7a[_0x5188(0x60)][_0x5188(0x5e)]()[_0x5188(0x5f)](_0x552ad1)||_0x4e7c7a[_0x5188(0x61)][_0x5188(0x5e)]()[_0x5188(0x5f)](_0x552ad1)||(_0x4ead88[_0x5188(0x62)](_0x4fc5f5=_0x4e7c7a[_0x5188(0x63)],null)||_0x4ead88[_0x5188(0x62)](_0x4fc5f5,void 0x0)?void 0x0:_0x4fc5f5['toLowerCase']()[_0x5188(0x5f)](_0x552ad1))||(_0x4ead88[_0x5188(0x64)](_0x51b10e=_0x4e7c7a[_0x5188(0x65)],null)||_0x51b10e===void 0x0?void 0x0:_0x51b10e['toLowerCase']()['includes'](_0x552ad1))||((_0x550751=_0x4e7c7a[_0x5188(0x66)])===null||_0x4ead88[_0x5188(0x67)](_0x550751,void 0x0)?void 0x0:_0x550751['some'](_0x139876=>_0x139876[_0x5188(0x5e)]()[_0x5188(0x5f)](_0x552ad1)));});};export const getUniqueEventTags=_0xbbec9f=>{const _0x32abec=_0xbbec9f['flatMap'](_0x35dfc6=>_0x35dfc6[_0x5188(0x66)]||[]);return Array['from'](new Set(_0x32abec))[_0x5188(0x4e)]();};export const calculateEventStats=_0x487d9b=>{const _0x4204ab={'ZjfsG':function(_0x3b74c2,_0x4884b2){return _0x3b74c2-_0x4884b2;},'GwoYN':function(_0x138bba,_0x20fad6){return _0x138bba>_0x20fad6;},'hODrH':function(_0x1cd469,_0x1f750f){return _0x1cd469*_0x1f750f;},'rRUZj':function(_0x128ab4,_0x45cfcb){return _0x128ab4/_0x45cfcb;}},_0x5f255d=_0x487d9b[_0x5188(0xf)],_0x57166e=_0x487d9b[_0x5188(0xe)](_0x515cec=>_0x515cec['isActive'])[_0x5188(0xf)],_0x574c31=_0x4204ab[_0x5188(0x68)](_0x5f255d,_0x57166e),_0x26e3e4=_0x487d9b[_0x5188(0x69)]((_0x5358f9,_0x5565a9)=>_0x5358f9+_0x5565a9[_0x5188(0x6a)],0x0),_0x209f41=_0x487d9b[_0x5188(0x69)]((_0x3793dc,_0x1b6219)=>_0x3793dc+_0x1b6219['maxAttendees'],0x0),_0x4efe29=_0x487d9b[_0x5188(0xe)](_0x419f64=>_0x419f64[_0x5188(0x53)]&&!isEventPast(_0x419f64[_0x5188(0x54)]))['length'],_0x383eb=_0x487d9b[_0x5188(0xe)](_0x35fd22=>isEventPast(_0x35fd22[_0x5188(0x54)]))[_0x5188(0xf)],_0x1beb48=_0x487d9b['filter'](_0x489adf=>_0x489adf['isActive']&&isEventToday(_0x489adf[_0x5188(0x54)]))['length'];return{'total':_0x5f255d,'active':_0x57166e,'inactive':_0x574c31,'upcoming':_0x4efe29,'past':_0x383eb,'today':_0x1beb48,'totalAttendees':_0x26e3e4,'totalCapacity':_0x209f41,'averageAttendance':_0x4204ab[_0x5188(0x6b)](_0x209f41,0x0)?Math[_0x5188(0x6c)](_0x4204ab['hODrH'](_0x4204ab[_0x5188(0x6d)](_0x26e3e4,_0x209f41),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
- import{Platform}from'react-native';export let HapticType=function(_0x386f54){const _0x38c880={'CXTDW':'7|1|3|2|6|0|4|5','AmaCz':'ERROR','fZOqD':_0x52f0(0x0),'SpbHw':_0x52f0(0x1),'XpArU':'heavy','MJExg':_0x52f0(0x2),'NFuMH':_0x52f0(0x3)},_0x5c9b60=_0x38c880[_0x52f0(0x4)][_0x52f0(0x5)]('|');let _0x42fbde=0x0;while(!![]){switch(_0x5c9b60[_0x42fbde++]){case'0':_0x386f54[_0x38c880['AmaCz']]=_0x52f0(0x6);continue;case'1':_0x386f54[_0x52f0(0x7)]=_0x38c880[_0x52f0(0x8)];continue;case'2':_0x386f54[_0x52f0(0x9)]=_0x38c880[_0x52f0(0xa)];continue;case'3':_0x386f54['HEAVY']=_0x38c880[_0x52f0(0xb)];continue;case'4':_0x386f54[_0x38c880[_0x52f0(0xc)]]=_0x38c880[_0x52f0(0xd)];continue;case'5':return _0x386f54;case'6':_0x386f54['WARNING']=_0x52f0(0xe);continue;case'7':_0x386f54[_0x52f0(0xf)]=_0x38c880[_0x52f0(0xd)];continue;}break;}}({});function _0x52f0(_0x2028cf,_0x52f091){_0x2028cf=_0x2028cf-0x0;const _0x33c39c=_0x2028();let _0x5ca66b=_0x33c39c[_0x2028cf];return _0x5ca66b;}function _0x2028(){const _0x57f991=['medium','success','BUTTON_PRESS','light','CXTDW','split','error','MEDIUM','fZOqD','SUCCESS','SpbHw','XpArU','MJExg','NFuMH','warning','LIGHT','0|4|2|3|5|6|7|1','ERROR','OMKbp','mXPVB','impactMedium','impactHeavy','notificationWarning','notificationError','impactLight','android','XvcMX','ios','yuUVi','vibrate','KTRaA','wCOMU','XBlVF','CUInX','ePTim','sNTlH','lMPQY','rruvH','hfgIU','trigger','HEAVY','jAszm','notificationSuccess','WARNING','DkUgV','GrgFZ','warn','Haptic\x20feedback\x20not\x20available:','bniIB','npYKf','yXggl'];_0x2028=function(){return _0x57f991;};return _0x2028();}export const triggerHaptic=(_0x3844ce=HapticType[_0x52f0(0xf)])=>{const _0xf34c9b={'yXggl':function(_0x483746,_0x97f172){return _0x483746(_0x97f172);},'fOBvc':_0x52f0(0x10),'SibaI':_0x52f0(0xf),'wCOMU':'heavy','XBlVF':_0x52f0(0x9),'CUInX':_0x52f0(0x1),'ePTim':_0x52f0(0x7),'sNTlH':'WARNING','lMPQY':_0x52f0(0xe),'rruvH':_0x52f0(0x11),'OqprI':'BUTTON_PRESS','hfgIU':_0x52f0(0x3),'OOStz':'Haptic\x20feedback\x20not\x20available:','XvcMX':function(_0x26f048,_0x2cd970){return _0x26f048===_0x2cd970;},'NMiRb':function(_0x407216,_0x4bd0e8){return _0x407216!==_0x4bd0e8;},'yuUVi':_0x52f0(0x12),'KTRaA':_0x52f0(0x13),'vLMmO':_0x52f0(0x14),'jAszm':_0x52f0(0x15),'DkUgV':_0x52f0(0x16),'GrgFZ':_0x52f0(0x17),'uPRgb':_0x52f0(0x18),'bniIB':_0x52f0(0x19),'NaxSB':'LDUFX','LMXoH':'Vibration\x20not\x20available:'};if(_0xf34c9b[_0x52f0(0x1a)](Platform['OS'],_0x52f0(0x1b))){if(_0xf34c9b['NMiRb'](_0xf34c9b[_0x52f0(0x1c)],'OMKbp')){const {Vibration:_0x5553eb}=_0xf34c9b['yXggl'](_0x2c3e11,0x1);_0x5553eb[_0x52f0(0x1d)](0x32);}else try{if(_0xf34c9b[_0x52f0(0x1a)]('VlihO',_0xf34c9b[_0x52f0(0x1e)])){const _0x827f33=_0xf34c9b['fOBvc']['split']('|');let _0x2b7b4e=0x0;while(!![]){switch(_0x827f33[_0x2b7b4e++]){case'0':_0x227f76[_0xf34c9b['SibaI']]=_0x52f0(0x3);continue;case'1':return _0x3cc8cf;case'2':_0x3e1844['HEAVY']=_0xf34c9b[_0x52f0(0x1f)];continue;case'3':_0x2b3fff[_0xf34c9b[_0x52f0(0x20)]]=_0xf34c9b[_0x52f0(0x21)];continue;case'4':_0x5f0317[_0xf34c9b[_0x52f0(0x22)]]=_0x52f0(0x0);continue;case'5':_0x4dd661[_0xf34c9b[_0x52f0(0x23)]]=_0xf34c9b[_0x52f0(0x24)];continue;case'6':_0x1ce6e7[_0xf34c9b[_0x52f0(0x25)]]=_0x52f0(0x6);continue;case'7':_0x398c80[_0xf34c9b['OqprI']]=_0xf34c9b[_0x52f0(0x26)];continue;}break;}}else{const _0x455345=__ONAIROS_REQ_FUNC__(0x0),_0x5cd860={'enableVibrateFallback':!![],'ignoreAndroidSystemSettings':![]};switch(_0x3844ce){case HapticType[_0x52f0(0xf)]:_0x455345[_0x52f0(0x27)](_0x52f0(0x18),_0x5cd860);break;case HapticType[_0x52f0(0x7)]:_0x455345[_0x52f0(0x27)](_0xf34c9b['vLMmO'],_0x5cd860);break;case HapticType[_0x52f0(0x28)]:_0x455345[_0x52f0(0x27)](_0xf34c9b[_0x52f0(0x29)],_0x5cd860);break;case HapticType[_0x52f0(0x9)]:_0x455345[_0x52f0(0x27)](_0x52f0(0x2a),_0x5cd860);break;case HapticType[_0x52f0(0x2b)]:_0x455345[_0x52f0(0x27)](_0xf34c9b[_0x52f0(0x2c)],_0x5cd860);break;case HapticType['ERROR']:_0x455345['trigger'](_0xf34c9b[_0x52f0(0x2d)],_0x5cd860);break;default:_0x455345[_0x52f0(0x27)](_0xf34c9b['uPRgb'],_0x5cd860);}}}catch(_0x268962){console[_0x52f0(0x2e)](_0x52f0(0x2f),_0x268962);}}else{if(Platform['OS']===_0xf34c9b[_0x52f0(0x30)]){if(_0x52f0(0x31)!==_0xf34c9b['NaxSB'])try{const {Vibration:_0x2fe4a2}=_0xf34c9b[_0x52f0(0x32)](__ONAIROS_REQ_FUNC__,0x1);_0x2fe4a2[_0x52f0(0x1d)](0x32);}catch(_0x43e5d2){console[_0x52f0(0x2e)](_0xf34c9b['LMXoH'],_0x43e5d2);}else _0x2f1bf3['warn'](_0xf34c9b['OOStz'],_0x1a3283);}}};
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