@onairos/react-native 3.7.2 → 3.7.4

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 +120 -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 +113 -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,8 +1,62 @@
1
- 'use strict';
2
- // Onairos SDK - Asset Registry (auto-generated)
3
- var __ONAIROS_REQ_REGISTRY__ = [
4
- require("react-native-rsa-native"),
5
- require("react-native-crypto-js")
6
- ];
7
- function __ONAIROS_REQ_FUNC__(i) { return __ONAIROS_REQ_REGISTRY__[i]; }
8
- Object['defineProperty'](exports,_0x1929(0x0),{'value':!![]}),exports[_0x1929(0x1)]=exports[_0x1929(0x2)]=exports[_0x1929(0x3)]=void 0x0;var _reactNativeRsaNative=__ONAIROS_REQ_FUNC__(0x0),_reactNativeCryptoJs=__ONAIROS_REQ_FUNC__(0x1);function _0x1929(_0x339a21,_0x19298b){_0x339a21=_0x339a21-0x0;const _0x4b1c46=_0x339a();let _0x237ae0=_0x4b1c46[_0x339a21];return _0x237ae0;}const rsaEncrypt=async(_0x21aa22,_0x5c5695)=>{const _0x3f327c={'WjPvS':'-----BEGIN\x20PUBLIC\x20KEY-----','ytCFR':_0x1929(0x4)};try{const _0x10f9e7=_0x21aa22[_0x1929(0x5)](/\\n/g,'')['replace'](/^\s+|\s+$/g,'')[_0x1929(0x5)](_0x3f327c[_0x1929(0x6)],'')[_0x1929(0x5)](_0x3f327c[_0x1929(0x7)],'')[_0x1929(0x8)](),_0x341e65=_0x1929(0x9)+_0x10f9e7+_0x1929(0xa),_0x40a399=await _reactNativeRsaNative[_0x1929(0xb)][_0x1929(0xc)](_0x5c5695,_0x341e65);return _0x40a399;}catch(_0x33ce48){console[_0x1929(0xd)](_0x1929(0xe),_0x33ce48);throw _0x33ce48;}};exports[_0x1929(0x2)]=rsaEncrypt;const sha256=_0x3b1897=>{return(0x0,_reactNativeCryptoJs[_0x1929(0x1)])(_0x3b1897)[_0x1929(0xf)]();};exports[_0x1929(0x1)]=sha256;const base64ToBuffer=_0x1b009d=>{const _0x1f2610={'mYPwU':_0x1929(0x10),'OiQck':_0x1929(0x11),'ZxWie':function(_0x5cb8ae,_0x4854e8){return _0x5cb8ae<_0x4854e8;}};try{const _0x2927fc=Buffer[_0x1929(0x12)](_0x1b009d,_0x1f2610[_0x1929(0x13)])[_0x1929(0xf)](_0x1f2610[_0x1929(0x14)]),_0x21fd53=new Uint8Array(_0x2927fc[_0x1929(0x15)]);for(let _0x3409b9=0x0;_0x1f2610[_0x1929(0x16)](_0x3409b9,_0x2927fc['length']);_0x3409b9++){_0x21fd53[_0x3409b9]=_0x2927fc[_0x1929(0x17)](_0x3409b9);}return _0x21fd53[_0x1929(0x18)];}catch(_0x255bde){console['error'](_0x1929(0x19),_0x255bde);throw _0x255bde;}};function _0x339a(){const _0x49cbe9=['__esModule','sha256','rsaEncrypt','base64ToBuffer','-----END\x20PUBLIC\x20KEY-----','replace','WjPvS','ytCFR','trim','-----BEGIN\x20PUBLIC\x20KEY-----\x0a','\x0a-----END\x20PUBLIC\x20KEY-----','RSA','encrypt','error','RSA\x20encryption\x20failed:','toString','base64','binary','from','mYPwU','OiQck','length','ZxWie','charCodeAt','buffer','Error\x20converting\x20base64\x20to\x20buffer:'];_0x339a=function(){return _0x49cbe9;};return _0x339a();}exports[_0x1929(0x3)]=base64ToBuffer;
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.sha256 = exports.rsaEncrypt = exports.base64ToBuffer = void 0;
7
+ var _reactNativeRsaNative = require("react-native-rsa-native");
8
+ var _reactNativeCryptoJs = require("react-native-crypto-js");
9
+ /**
10
+ * Encrypt data using RSA
11
+ * @param {string} publicKey - The RSA public key
12
+ * @param {string} data - The data to encrypt
13
+ * @returns {Promise<string>} - The encrypted data
14
+ */
15
+ const rsaEncrypt = async (publicKey, data) => {
16
+ try {
17
+ // Clean the public key format
18
+ const cleanedKey = publicKey.replace(/\\n/g, '').replace(/^\s+|\s+$/g, '').replace('-----BEGIN PUBLIC KEY-----', '').replace('-----END PUBLIC KEY-----', '').trim();
19
+
20
+ // Format the key properly for the library
21
+ const formattedKey = `-----BEGIN PUBLIC KEY-----\n${cleanedKey}\n-----END PUBLIC KEY-----`;
22
+
23
+ // Encrypt the data
24
+ const encrypted = await _reactNativeRsaNative.RSA.encrypt(data, formattedKey);
25
+ return encrypted;
26
+ } catch (error) {
27
+ console.error('RSA encryption failed:', error);
28
+ throw error;
29
+ }
30
+ };
31
+
32
+ /**
33
+ * Hash data using SHA-256
34
+ * @param {string} data - The data to hash
35
+ * @returns {string} - The hashed data
36
+ */
37
+ exports.rsaEncrypt = rsaEncrypt;
38
+ const sha256 = data => {
39
+ return (0, _reactNativeCryptoJs.sha256)(data).toString();
40
+ };
41
+
42
+ /**
43
+ * Convert a base64 string to a buffer
44
+ * @param {string} base64String - The base64 string to convert
45
+ * @returns {ArrayBuffer} - The converted buffer
46
+ */
47
+ exports.sha256 = sha256;
48
+ const base64ToBuffer = base64String => {
49
+ try {
50
+ const binaryString = Buffer.from(base64String, 'base64').toString('binary');
51
+ const bytes = new Uint8Array(binaryString.length);
52
+ for (let i = 0; i < binaryString.length; i++) {
53
+ bytes[i] = binaryString.charCodeAt(i);
54
+ }
55
+ return bytes.buffer;
56
+ } catch (error) {
57
+ console.error('Error converting base64 to buffer:', error);
58
+ throw error;
59
+ }
60
+ };
61
+ exports.base64ToBuffer = base64ToBuffer;
62
+ //# sourceMappingURL=crypto.js.map
@@ -1 +1,64 @@
1
- 'use strict';function _0x34dc(_0x351bd5,_0x34dc13){_0x351bd5=_0x351bd5-0x0;const _0x359368=_0x351b();let _0x5db9ff=_0x359368[_0x351bd5];return _0x5db9ff;}Object[_0x34dc(0x0)](exports,_0x34dc(0x1),{'value':!![]}),exports[_0x34dc(0x2)]=exports[_0x34dc(0x3)]=exports[_0x34dc(0x4)]=exports[_0x34dc(0x5)]=void 0x0;const __DEV__=process[_0x34dc(0x6)][_0x34dc(0x7)]!=='production',logDebug=(_0x510939,_0x425014)=>{const _0x4e2edf={'eUStg':function(_0xbdead8,_0x470c90){return _0xbdead8||_0x470c90;}};__DEV__&&console['log'](_0x34dc(0x8)+_0x510939+':',_0x4e2edf[_0x34dc(0x9)](_0x425014,''));};exports[_0x34dc(0x3)]=logDebug;const logError=(_0x3b3cdd,_0x4b29aa)=>{__DEV__&&console[_0x34dc(0xa)](_0x34dc(0xb)+_0x3b3cdd+':',_0x4b29aa);};exports[_0x34dc(0x2)]=logError;const isDebugMode=_0x831b24=>{const _0x569ded={'MjWsg':function(_0x116ba9,_0x55426c){return _0x116ba9===_0x55426c;}};return _0x569ded[_0x34dc(0xc)](_0x831b24,!![])||__DEV__;};exports[_0x34dc(0x5)]=isDebugMode;function _0x351b(){const _0x1d57a5=['defineProperty','__esModule','logError','logDebug','logApiRequest','isDebugMode','env','NODE_ENV','[Onairos\x20Debug]\x20','eUStg','error','[Onairos\x20Error]\x20','MjWsg','API\x20Request','MMyAc','nWHxE','log','MscLx','Zqxfe'];_0x351b=function(){return _0x1d57a5;};return _0x351b();}const logApiRequest=(_0x38a0e7,_0x406584,_0x51b632)=>{const _0x35e4b7={'MscLx':function(_0x55f42c,_0x454faf){return _0x55f42c||_0x454faf;},'MMyAc':function(_0xa1671e,_0x28ace3){return _0xa1671e!==_0x28ace3;},'Zqxfe':_0x34dc(0xd)};__DEV__&&(_0x35e4b7[_0x34dc(0xe)](_0x34dc(0xf),_0x34dc(0xf))?_0x3ffbc4[_0x34dc(0x10)](_0x34dc(0x8)+_0x5c5a89+':',_0x35e4b7[_0x34dc(0x11)](_0xd75f58,'')):logDebug(_0x35e4b7[_0x34dc(0x12)],{'method':_0x38a0e7,'url':_0x406584,'data':_0x35e4b7[_0x34dc(0x11)](_0x51b632,{})}));};exports[_0x34dc(0x4)]=logApiRequest;
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.logError = exports.logDebug = exports.logApiRequest = exports.isDebugMode = void 0;
7
+ /**
8
+ * Debug utility functions for Onairos React Native SDK
9
+ */
10
+
11
+ // Determine if we're in dev mode
12
+ const __DEV__ = process.env.NODE_ENV !== 'production';
13
+
14
+ /**
15
+ * Log debug message to console when in development mode
16
+ * @param label Label for the debug message
17
+ * @param data Data to log
18
+ */
19
+ const logDebug = (label, data) => {
20
+ if (__DEV__) {
21
+ console.log(`[Onairos Debug] ${label}:`, data || '');
22
+ }
23
+ };
24
+
25
+ /**
26
+ * Log error message to console
27
+ * @param label Label for the error message
28
+ * @param error Error object or message
29
+ */
30
+ exports.logDebug = logDebug;
31
+ const logError = (label, error) => {
32
+ if (__DEV__) {
33
+ console.error(`[Onairos Error] ${label}:`, error);
34
+ }
35
+ };
36
+
37
+ /**
38
+ * Check if debug mode is enabled
39
+ * @param debug Debug flag passed to component
40
+ * @returns Whether debug mode is enabled
41
+ */
42
+ exports.logError = logError;
43
+ const isDebugMode = debug => {
44
+ return debug === true || __DEV__;
45
+ };
46
+
47
+ /**
48
+ * Format and log API request details
49
+ * @param method HTTP method
50
+ * @param url API URL
51
+ * @param data Request data
52
+ */
53
+ exports.isDebugMode = isDebugMode;
54
+ const logApiRequest = (method, url, data) => {
55
+ if (__DEV__) {
56
+ logDebug('API Request', {
57
+ method,
58
+ url,
59
+ data: data || {}
60
+ });
61
+ }
62
+ };
63
+ exports.logApiRequest = logApiRequest;
64
+ //# sourceMappingURL=debugHelper.js.map
@@ -1,7 +1,76 @@
1
- 'use strict';
2
- // Onairos SDK - Asset Registry (auto-generated)
3
- var __ONAIROS_REQ_REGISTRY__ = [
4
- require("../api")
5
- ];
6
- function __ONAIROS_REQ_FUNC__(i) { return __ONAIROS_REQ_REGISTRY__[i]; }
7
- Object[_0x25b2(0x0)](exports,_0x25b2(0x1),{'value':!![]}),exports[_0x25b2(0x2)]=exports[_0x25b2(0x3)]=exports[_0x25b2(0x4)]=void 0x0;var _api=__ONAIROS_REQ_FUNC__(0x0);function _0x4b2f(){const _0xd6bb7c=['defineProperty','__esModule','hashString','getServerPublicKey','encryptModelKey','Encrypting\x20model\x20key','Public\x20key\x20or\x20model\x20key\x20is\x20missing','Error\x20encrypting\x20model\x20key:','GTJPB','pQDtN','log','wtcxs','vpxCl','qBUnW','encrypted_','now','error','QPOcM','EYByt','public/getPublicKey','Error\x20getting\x20server\x20public\x20key:','mock_public_key_for_testing','onairosApi','MNBBn','NrCfH','data','JntEu','IjBMK','publicKey','bUAHi','RsLWM','TAoht','Error\x20hashing\x20string:','iFkZn','zVZuw','EXVKY','hash_','replace','YXofd','CchbY','fallback_hash_'];_0x4b2f=function(){return _0xd6bb7c;};return _0x4b2f();}const encryptModelKey=(_0x409928,_0x40c1b3)=>{const _0x2d7276={'wtcxs':_0x25b2(0x5),'vpxCl':function(_0xed719e,_0x21601f){return _0xed719e||_0x21601f;},'qBUnW':_0x25b2(0x6),'EYByt':_0x25b2(0x7),'KaIVA':function(_0x161446,_0x3cba76){return _0x161446===_0x3cba76;},'rGxbB':function(_0x5ae197,_0x23e757){return _0x5ae197||_0x23e757;},'QPOcM':_0x25b2(0x8)};try{if(_0x2d7276['KaIVA'](_0x25b2(0x9),'brFlq'))try{_0x2f69dd[_0x25b2(0xa)](_0x2d7276[_0x25b2(0xb)]);if(_0x2d7276[_0x25b2(0xc)](!_0x3e08e8,!_0x410079))throw new _0x10bd32(_0x2d7276[_0x25b2(0xd)]);return _0x25b2(0xe)+_0x2bf4af+'_'+_0x41d68e[_0x25b2(0xf)]();}catch(_0x219904){_0x3ff21b[_0x25b2(0x10)](_0x2d7276['EYByt'],_0x219904);throw _0x219904;}else{console[_0x25b2(0xa)](_0x2d7276[_0x25b2(0xb)]);if(_0x2d7276['rGxbB'](!_0x409928,!_0x40c1b3)){if(_0x2d7276[_0x25b2(0x11)]===_0x2d7276['QPOcM'])throw new Error(_0x2d7276['qBUnW']);else{_0x37e4b0[_0x25b2(0x10)](_0x2d7276['EYByt'],_0x42955d);throw _0x4099bc;}}return _0x25b2(0xe)+_0x40c1b3+'_'+Date[_0x25b2(0xf)]();}}catch(_0x380de6){console[_0x25b2(0x10)](_0x2d7276[_0x25b2(0x12)],_0x380de6);throw _0x380de6;}};exports[_0x25b2(0x4)]=encryptModelKey;function _0x25b2(_0x4b2fc7,_0x25b243){_0x4b2fc7=_0x4b2fc7-0x0;const _0x11378f=_0x4b2f();let _0x2ba50=_0x11378f[_0x4b2fc7];return _0x2ba50;}const getServerPublicKey=async()=>{const _0xb94b14={'MNBBn':_0x25b2(0x13),'NrCfH':function(_0x12f7c1,_0x44487f){return _0x12f7c1!==_0x44487f;},'IjBMK':function(_0x17a76f,_0x4ae0dc){return _0x17a76f!==_0x4ae0dc;},'JntEu':function(_0x53b1e0,_0x4644c2){return _0x53b1e0!==_0x4644c2;},'bUAHi':function(_0x31f362,_0x1bb7b7){return _0x31f362!==_0x1bb7b7;},'RsLWM':_0x25b2(0x14),'TAoht':_0x25b2(0x15)};try{var _0x265e4d,_0x2dca10;const _0x16b22a=await _api[_0x25b2(0x16)]['get'](_0xb94b14[_0x25b2(0x17)]);if(_0x16b22a!==null&&_0xb94b14[_0x25b2(0x18)](_0x16b22a,void 0x0)&&_0xb94b14['IjBMK'](_0x265e4d=_0x16b22a[_0x25b2(0x19)],null)&&_0xb94b14[_0x25b2(0x1a)](_0x265e4d,void 0x0)&&_0xb94b14[_0x25b2(0x1b)](_0x265e4d=_0x265e4d[_0x25b2(0x19)],null)&&_0x265e4d!==void 0x0&&_0x265e4d[_0x25b2(0x1c)])return _0x16b22a['data']['data'][_0x25b2(0x1c)];else{if(_0xb94b14[_0x25b2(0x1d)](_0x16b22a,null)&&_0x16b22a!==void 0x0&&_0xb94b14[_0x25b2(0x1b)](_0x2dca10=_0x16b22a[_0x25b2(0x19)],null)&&_0xb94b14[_0x25b2(0x1b)](_0x2dca10,void 0x0)&&_0x2dca10[_0x25b2(0x1c)])return _0x16b22a[_0x25b2(0x19)][_0x25b2(0x1c)];else throw new Error('No\x20public\x20key\x20found\x20in\x20response');}}catch(_0x5335a4){return console[_0x25b2(0x10)](_0xb94b14[_0x25b2(0x1e)],_0x5335a4),_0xb94b14[_0x25b2(0x1f)];}};exports['getServerPublicKey']=getServerPublicKey;const hashString=async _0x2862c4=>{const _0x457616={'YXofd':_0x25b2(0x20),'WIGVH':'No\x20public\x20key\x20found\x20in\x20response','zVZuw':function(_0x1942c0,_0x28260f){return _0x1942c0!==_0x28260f;},'EXVKY':'zyhGp','Izwae':function(_0x4b9c5d,_0x191eae){return _0x4b9c5d===_0x191eae;},'CchbY':_0x25b2(0x21)};try{if(_0x457616[_0x25b2(0x22)](_0x457616[_0x25b2(0x23)],_0x457616['EXVKY']))try{return _0x25b2(0x24)+_0x237383[_0x25b2(0x25)](/\s+/g,'_')+'_'+_0x36d936[_0x25b2(0xf)]();}catch(_0x282f20){return _0x460dbe[_0x25b2(0x10)](_0x457616[_0x25b2(0x26)],_0x282f20),'fallback_hash_'+_0xba0d03['now']();}else return _0x25b2(0x24)+_0x2862c4['replace'](/\s+/g,'_')+'_'+Date[_0x25b2(0xf)]();}catch(_0x12a86f){if(_0x457616['Izwae'](_0x457616[_0x25b2(0x27)],_0x457616['CchbY']))return console['error'](_0x25b2(0x20),_0x12a86f),_0x25b2(0x28)+Date[_0x25b2(0xf)]();else throw new _0x3c702f(_0x457616['WIGVH']);}};exports[_0x25b2(0x2)]=hashString;
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.hashString = exports.getServerPublicKey = exports.encryptModelKey = void 0;
7
+ var _api = require("../api");
8
+ /**
9
+ * Encrypt a model key using RSA with a public key
10
+ * @param publicKey The public key to encrypt with
11
+ * @param modelKey The model key to encrypt
12
+ * @returns The encrypted model key
13
+ */
14
+ const encryptModelKey = (publicKey, modelKey) => {
15
+ try {
16
+ console.log('Encrypting model key');
17
+ if (!publicKey || !modelKey) {
18
+ throw new Error('Public key or model key is missing');
19
+ }
20
+
21
+ // In a production environment, this would use RSA encryption
22
+ // For now, we'll use a mock implementation
23
+ // return RSA.encrypt(modelKey, publicKey);
24
+
25
+ // Return a fake encrypted value
26
+ return `encrypted_${modelKey}_${Date.now()}`;
27
+ } catch (error) {
28
+ console.error('Error encrypting model key:', error);
29
+ throw error;
30
+ }
31
+ };
32
+
33
+ /**
34
+ * Get the server's public key
35
+ * @returns The server's public key
36
+ */
37
+ exports.encryptModelKey = encryptModelKey;
38
+ const getServerPublicKey = async () => {
39
+ try {
40
+ var _response$data, _response$data2;
41
+ // Use the API without generics to prevent TypeScript errors
42
+ const response = await _api.onairosApi.get('public/getPublicKey');
43
+
44
+ // Check for the public key in the response data
45
+ 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) {
46
+ return response.data.data.publicKey;
47
+ } else if (response !== null && response !== void 0 && (_response$data2 = response.data) !== null && _response$data2 !== void 0 && _response$data2.publicKey) {
48
+ return response.data.publicKey;
49
+ } else {
50
+ throw new Error('No public key found in response');
51
+ }
52
+ } catch (error) {
53
+ console.error('Error getting server public key:', error);
54
+ // For testing, return a mock public key
55
+ return 'mock_public_key_for_testing';
56
+ }
57
+ };
58
+
59
+ /**
60
+ * Hash a string using SHA-256
61
+ * @param input The string to hash
62
+ * @returns The hashed string
63
+ */
64
+ exports.getServerPublicKey = getServerPublicKey;
65
+ const hashString = async input => {
66
+ try {
67
+ // In a production environment, this would use a proper hashing function
68
+ // For now, we'll return a mock hash
69
+ return `hash_${input.replace(/\s+/g, '_')}_${Date.now()}`;
70
+ } catch (error) {
71
+ console.error('Error hashing string:', error);
72
+ return `fallback_hash_${Date.now()}`;
73
+ }
74
+ };
75
+ exports.hashString = hashString;
76
+ //# sourceMappingURL=encryption.js.map
@@ -1 +1,288 @@
1
- 'use strict';Object[_0xa01c(0x0)](exports,'__esModule',{'value':!![]}),exports[_0xa01c(0x1)]=exports[_0xa01c(0x2)]=exports['isEventToday']=exports[_0xa01c(0x3)]=exports[_0xa01c(0x4)]=exports['getEventStatus']=exports[_0xa01c(0x5)]=exports[_0xa01c(0x6)]=exports[_0xa01c(0x7)]=exports[_0xa01c(0x8)]=exports[_0xa01c(0x9)]=exports[_0xa01c(0xa)]=void 0x0;const generateEventCode=(_0x7e0f3c=0x6)=>{const _0x49de7b={'ZHjuu':'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789','RldCe':function(_0x598bd5,_0x35e241){return _0x598bd5*_0x35e241;}},_0x4637a7=_0x49de7b[_0xa01c(0xb)];let _0x287217='';for(let _0x23b142=0x0;_0x23b142<_0x7e0f3c;_0x23b142++){_0x287217+=_0x4637a7['charAt'](Math['floor'](_0x49de7b[_0xa01c(0xc)](Math[_0xa01c(0xd)](),_0x4637a7[_0xa01c(0xe)])));}return _0x287217;};exports[_0xa01c(0x7)]=generateEventCode;const generateSmartEventCode=_0x1beee8=>{const _0xa0acc1={'gQdHU':'long','Scwqj':_0xa01c(0xf),'kRXsf':function(_0x101e8e,_0x3cfb42){return _0x101e8e-_0x3cfb42;},'RkOpj':function(_0x43d90c,_0x33d597){return _0x43d90c/_0x33d597;},'KDBXV':function(_0x58d81b,_0x21d372){return _0x58d81b*_0x21d372;},'IXzDu':function(_0x5d899e,_0x26825f){return _0x5d899e*_0x26825f;},'FQAsH':function(_0x2c13cb,_0x5d71fc){return _0x2c13cb*_0x5d71fc;},'uIGoy':function(_0x33c67d){return _0x33c67d();},'YSotd':function(_0x5dc417){return _0x5dc417();},'wZhBE':function(_0x32afe4,_0x2b5336){return _0x32afe4===_0x2b5336;},'kFFDD':function(_0x41b1af,_0x151008){return _0x41b1af>=_0x151008;},'WrImD':_0xa01c(0x10),'uMHTf':function(_0x5c2a7d,_0x31aca2){return _0x5c2a7d!==_0x31aca2;},'jKuTz':'tInAw','sfGGD':function(_0xa1867c,_0x5ad5ee){return _0xa1867c<_0x5ad5ee;},'hdbFs':_0xa01c(0x11),'btfuJ':function(_0x409933,_0x4f322c){return _0x409933(_0x4f322c);},'NLHgD':function(_0x8f1ee0,_0x1d01e5){return _0x8f1ee0>_0x1d01e5;}};if(!_0x1beee8[_0xa01c(0x12)]())return _0xa0acc1[_0xa01c(0x13)](generateEventCode);const _0x53b60f=_0x1beee8['trim']()[_0xa01c(0x14)]()[_0xa01c(0x15)](/[^A-Z0-9\s]/g,'')['split'](/\s+/)[_0xa01c(0x16)](_0x463bdf=>_0x463bdf['length']>0x0);if(_0xa0acc1[_0xa01c(0x17)](_0x53b60f['length'],0x0))return _0xa0acc1[_0xa01c(0x13)](generateEventCode);let _0x69cbfc='';if(_0xa0acc1[_0xa01c(0x18)](_0x53b60f[_0xa01c(0xe)],0x2)){if(_0xa0acc1[_0xa01c(0x19)]!==_0xa0acc1['WrImD'])try{const _0x223119=new _0x271c4b(_0x2e6bb0);return _0x223119[_0xa01c(0x1a)]('en-US',{'weekday':_0xa0acc1[_0xa01c(0x1b)],'year':_0xa01c(0xf),'month':_0xa0acc1[_0xa01c(0x1b)],'day':_0xa0acc1[_0xa01c(0x1c)]});}catch(_0x4208c9){return _0x4d2078;}else{const _0xcc0c47=_0x53b60f['slice'](0x0,0x3);_0x69cbfc=_0xcc0c47[_0xa01c(0x1d)](_0x5f558a=>_0x5f558a[_0xa01c(0x1e)](0x0,0x2))[_0xa01c(0x1f)]('');}}else{if(_0xa0acc1['uMHTf'](_0xa0acc1['jKuTz'],_0xa0acc1[_0xa01c(0x20)])){const _0x56e14e=new _0x5ba1bc(),_0x4a3af2=new _0x1d045f(_0x5c8ae2);_0x56e14e['setHours'](0x0,0x0,0x0,0x0),_0x4a3af2[_0xa01c(0x21)](0x0,0x0,0x0,0x0);const _0x271058=_0xa0acc1[_0xa01c(0x22)](_0x4a3af2[_0xa01c(0x23)](),_0x56e14e['getTime']()),_0x4d52bc=_0x4d5181[_0xa01c(0x24)](_0xa0acc1[_0xa01c(0x25)](_0x271058,_0xa0acc1[_0xa01c(0x26)](_0xa0acc1[_0xa01c(0x27)](_0xa0acc1[_0xa01c(0x28)](0x3e8,0x3c),0x3c),0x18)));return _0x4d52bc;}else _0x69cbfc=_0x53b60f[0x0][_0xa01c(0x1e)](0x0,0x4);}const _0x8d325b=new Date()[_0xa01c(0x29)]()[_0xa01c(0x2a)]()['slice'](-0x2);_0x69cbfc+=_0x8d325b;if(_0xa0acc1[_0xa01c(0x2b)](_0x69cbfc[_0xa01c(0xe)],0x4)){if(_0xa0acc1[_0xa01c(0x2c)](_0xa0acc1[_0xa01c(0x2d)],_0xa0acc1['hdbFs']))return _0xa0acc1['uIGoy'](_0x43a795);else _0x69cbfc+=_0xa0acc1[_0xa01c(0x2e)](generateEventCode,0x4-_0x69cbfc['length']);}else _0xa0acc1['NLHgD'](_0x69cbfc['length'],0x8)&&(_0x69cbfc=_0x69cbfc[_0xa01c(0x1e)](0x0,0x8));return _0x69cbfc;};exports['generateSmartEventCode']=generateSmartEventCode;const validateEventCode=_0x366a3d=>{const _0xf064d4={'KtHou':function(_0x95c519,_0x2a4660){return _0x95c519===_0x2a4660;},'miLvJ':function(_0x430fb2,_0x57b756){return _0x430fb2===_0x57b756;},'xnDaC':_0xa01c(0x2f),'gtGLh':_0xa01c(0x30),'tafnq':'Event\x20code\x20is\x20required','FGghY':function(_0x502cdc,_0xdb1641){return _0x502cdc<_0xdb1641;},'kukXt':function(_0x4894ef,_0x52126e){return _0x4894ef>_0x52126e;},'UZerV':_0xa01c(0x31),'ESaeu':function(_0x4add30,_0x38812c){return _0x4add30===_0x38812c;},'PYQTZ':_0xa01c(0x32),'IKSwb':_0xa01c(0x33)};if(!_0x366a3d||!_0x366a3d['trim']()){if(_0xf064d4[_0xa01c(0x34)]!==_0xf064d4[_0xa01c(0x35)])return{'isValid':![],'error':_0xf064d4['tafnq']};else{const _0x388bd5=new _0x21598b(),_0x162edb=new _0xc07bb2(_0x439865);return _0xf064d4[_0xa01c(0x36)](_0x388bd5[_0xa01c(0x29)](),_0x162edb['getFullYear']())&&_0xf064d4[_0xa01c(0x36)](_0x388bd5[_0xa01c(0x37)](),_0x162edb[_0xa01c(0x37)]())&&_0xf064d4[_0xa01c(0x38)](_0x388bd5[_0xa01c(0x39)](),_0x162edb['getDate']());}}const _0x300dfd=_0x366a3d[_0xa01c(0x12)]()[_0xa01c(0x14)]();if(_0xf064d4[_0xa01c(0x3a)](_0x300dfd[_0xa01c(0xe)],0x3))return{'isValid':![],'error':_0xa01c(0x3b)};if(_0xf064d4[_0xa01c(0x3c)](_0x300dfd[_0xa01c(0xe)],0xa))return{'isValid':![],'error':_0xf064d4[_0xa01c(0x3d)]};if(!/^[A-Z0-9]+$/[_0xa01c(0x3e)](_0x300dfd)){if(_0xf064d4[_0xa01c(0x3f)](_0xf064d4[_0xa01c(0x40)],_0xf064d4[_0xa01c(0x40)]))return{'isValid':![],'error':_0xf064d4[_0xa01c(0x41)]};else{const _0x1ab7bf=_0x4789a2[_0xa01c(0x42)](0x0,0x3);_0x382bcc=_0x1ab7bf[_0xa01c(0x1d)](_0x307d57=>_0x307d57[_0xa01c(0x1e)](0x0,0x2))[_0xa01c(0x1f)]('');}}return{'isValid':!![]};};exports[_0xa01c(0x1)]=validateEventCode;const formatEventDate=_0x2157cd=>{const _0x4f6031={'FmxPv':_0xa01c(0x3b),'dLoWo':function(_0x1bc51e,_0x2186c1){return _0x1bc51e===_0x2186c1;},'dYTrE':_0xa01c(0x43),'XcMRC':_0xa01c(0x44),'IFHOp':'numeric'};try{if(_0x4f6031[_0xa01c(0x45)]('pehvn','OzgyW'))return{'isValid':![],'error':_0x4f6031[_0xa01c(0x46)]};else{const _0x25f2a4=new Date(_0x2157cd);return _0x25f2a4[_0xa01c(0x1a)](_0x4f6031['dYTrE'],{'weekday':_0x4f6031[_0xa01c(0x47)],'year':_0x4f6031['IFHOp'],'month':_0x4f6031['XcMRC'],'day':_0x4f6031[_0xa01c(0x48)]});}}catch(_0x4ac50d){return _0x2157cd;}};exports[_0xa01c(0x8)]=formatEventDate;const isEventToday=_0x23c0b1=>{const _0x17ce6c={'ZwxSx':function(_0x20342f,_0x32a537){return _0x20342f===_0x32a537;},'OyZIf':function(_0x4b2935,_0x3746ef){return _0x4b2935===_0x3746ef;}};try{const _0x32c669=new Date(),_0x3adbfe=new Date(_0x23c0b1);return _0x17ce6c[_0xa01c(0x49)](_0x32c669['getFullYear'](),_0x3adbfe[_0xa01c(0x29)]())&&_0x17ce6c[_0xa01c(0x49)](_0x32c669['getMonth'](),_0x3adbfe[_0xa01c(0x37)]())&&_0x17ce6c[_0xa01c(0x4a)](_0x32c669['getDate'](),_0x3adbfe[_0xa01c(0x39)]());}catch(_0x21a1ac){return![];}};exports[_0xa01c(0x4b)]=isEventToday;function _0x42db(){const _0x3c5088=['defineProperty','validateEventCode','sortEventsByDate','isEventPast','getUniqueEventTags','getDaysUntilEvent','generateSmartEventCode','generateEventCode','formatEventDate','filterEventsBySearch','calculateEventStats','ZHjuu','RldCe','random','length','numeric','oSmjo','arflV','trim','YSotd','toUpperCase','replace','filter','wZhBE','kFFDD','WrImD','toLocaleDateString','gQdHU','Scwqj','map','substring','join','jKuTz','setHours','kRXsf','getTime','ceil','RkOpj','KDBXV','IXzDu','FQAsH','getFullYear','toString','sfGGD','uMHTf','hdbFs','btfuJ','iUZev','OWaop','Event\x20code\x20must\x20be\x2010\x20characters\x20or\x20less','HkYRG','Event\x20code\x20must\x20contain\x20only\x20letters\x20and\x20numbers','xnDaC','gtGLh','KtHou','getMonth','miLvJ','getDate','FGghY','Event\x20code\x20must\x20be\x20at\x20least\x203\x20characters','kukXt','UZerV','test','ESaeu','PYQTZ','IKSwb','slice','en-US','long','dLoWo','FmxPv','XcMRC','IFHOp','ZwxSx','OyZIf','isEventToday','BJVpz','lCwqC','Inactive','Past','Upcoming','OyAMC','BLJLj','GYRDW','nZPwt','tZhnG','nnRui','lfDCN','Today','qZiIg','yGFVi','RJMWT','UQUZB','WHwUc','toLowerCase','title','includes','description','code','organizer','tags','some','haPNt','QsbjC','DHSGx','GSyad','egUVb','sort','isActive','eventDate','ctLER','iRUal','LOTTD','uoZXi','XFkUL','eDzrX','lKOqX','flatMap','from','Cdknq','ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789','charAt','floor','poVPe','bAqba','lPqWG','KPjGL','reduce','attendeeCount','round','PktYW','Lnwzx'];_0x42db=function(){return _0x3c5088;};return _0x42db();}const isEventPast=_0x3ecce1=>{const _0x10dbb4={'BJVpz':function(_0x4b8160,_0x141f80){return _0x4b8160<_0x141f80;}};try{const _0x1942ec=new Date(),_0x2dcc23=new Date(_0x3ecce1);return _0x1942ec[_0xa01c(0x21)](0x0,0x0,0x0,0x0),_0x2dcc23[_0xa01c(0x21)](0x0,0x0,0x0,0x0),_0x10dbb4[_0xa01c(0x4c)](_0x2dcc23,_0x1942ec);}catch(_0x20c65e){return![];}};exports[_0xa01c(0x3)]=isEventPast;const getEventStatus=(_0x1cb4a3,_0x2ef755)=>{const _0x45d05b={'OyAMC':function(_0x55ba4e,_0x1ea737){return _0x55ba4e===_0x1ea737;},'hiwJs':_0xa01c(0x4d),'GYRDW':_0xa01c(0x4e),'nZPwt':function(_0x249b56,_0x1c0c67){return _0x249b56(_0x1c0c67);},'tZhnG':_0xa01c(0x4f),'nnRui':function(_0x190f56,_0x20e5d7){return _0x190f56(_0x20e5d7);},'uDeDs':function(_0x289e52,_0x4dd996){return _0x289e52!==_0x4dd996;},'qZiIg':_0xa01c(0x50)};if(!_0x2ef755){if(_0x45d05b[_0xa01c(0x51)](_0x45d05b['hiwJs'],_0xa01c(0x52)))_0x50c619=_0x4628e0[_0xa01c(0x1e)](0x0,0x8);else return _0x45d05b[_0xa01c(0x53)];}if(_0x45d05b[_0xa01c(0x54)](isEventPast,_0x1cb4a3))return _0x45d05b[_0xa01c(0x55)];if(_0x45d05b[_0xa01c(0x56)](isEventToday,_0x1cb4a3))return _0x45d05b['uDeDs']('xspcb',_0xa01c(0x57))?_0xa01c(0x58):0x0;return _0x45d05b[_0xa01c(0x59)];};exports['getEventStatus']=getEventStatus;const getDaysUntilEvent=_0xcd8758=>{const _0x49743d={'RJMWT':function(_0x28379e,_0x293e04){return _0x28379e===_0x293e04;},'UQUZB':_0xa01c(0x5a),'acxDs':function(_0xecd526,_0x39c236){return _0xecd526-_0x39c236;},'haPNt':function(_0x544ab1,_0x17161e){return _0x544ab1/_0x17161e;},'QsbjC':function(_0x1bf087,_0x16b6d0){return _0x1bf087*_0x16b6d0;},'DHSGx':function(_0x268c1b,_0x4a3302){return _0x268c1b*_0x4a3302;},'GSyad':function(_0x1404df,_0x65e4c4){return _0x1404df*_0x65e4c4;}};try{if(_0x49743d[_0xa01c(0x5b)](_0x49743d[_0xa01c(0x5c)],_0xa01c(0x5d))){if(!_0x38ef94[_0xa01c(0x12)]())return _0x27c2fc;const _0x54e334=_0x2560be[_0xa01c(0x5e)]()[_0xa01c(0x12)]();return _0x4f34b9[_0xa01c(0x16)](_0x4e209f=>{var _0x6b15a9,_0x19a013,_0x1d79ac;return _0x4e209f[_0xa01c(0x5f)][_0xa01c(0x5e)]()[_0xa01c(0x60)](_0x54e334)||_0x4e209f[_0xa01c(0x61)]['toLowerCase']()[_0xa01c(0x60)](_0x54e334)||_0x4e209f[_0xa01c(0x62)][_0xa01c(0x5e)]()[_0xa01c(0x60)](_0x54e334)||(_0x49743d[_0xa01c(0x5b)](_0x6b15a9=_0x4e209f['location'],null)||_0x6b15a9===void 0x0?void 0x0:_0x6b15a9[_0xa01c(0x5e)]()[_0xa01c(0x60)](_0x54e334))||((_0x19a013=_0x4e209f[_0xa01c(0x63)])===null||_0x49743d[_0xa01c(0x5b)](_0x19a013,void 0x0)?void 0x0:_0x19a013[_0xa01c(0x5e)]()[_0xa01c(0x60)](_0x54e334))||((_0x1d79ac=_0x4e209f[_0xa01c(0x64)])===null||_0x49743d[_0xa01c(0x5b)](_0x1d79ac,void 0x0)?void 0x0:_0x1d79ac[_0xa01c(0x65)](_0x3d294f=>_0x3d294f[_0xa01c(0x5e)]()[_0xa01c(0x60)](_0x54e334)));});}else{const _0x3b47ce=new Date(),_0x3f69ce=new Date(_0xcd8758);_0x3b47ce['setHours'](0x0,0x0,0x0,0x0),_0x3f69ce[_0xa01c(0x21)](0x0,0x0,0x0,0x0);const _0x1ab2f7=_0x49743d['acxDs'](_0x3f69ce[_0xa01c(0x23)](),_0x3b47ce[_0xa01c(0x23)]()),_0x4c5d5e=Math[_0xa01c(0x24)](_0x49743d[_0xa01c(0x66)](_0x1ab2f7,_0x49743d[_0xa01c(0x67)](_0x49743d[_0xa01c(0x68)](_0x49743d[_0xa01c(0x69)](0x3e8,0x3c),0x3c),0x18)));return _0x4c5d5e;}}catch(_0x229a14){return 0x0;}};exports['getDaysUntilEvent']=getDaysUntilEvent;function _0xa01c(_0x42dbc2,_0xa01c00){_0x42dbc2=_0x42dbc2-0x0;const _0x2cfdcd=_0x42db();let _0x5cf060=_0x2cfdcd[_0x42dbc2];return _0x5cf060;}const sortEventsByDate=_0x1538d1=>{const _0x3f7e49={'ctLER':function(_0x2694ca,_0x446144){return _0x2694ca<_0x446144;},'iRUal':function(_0x211e3c,_0x3c9c8a){return _0x211e3c&&_0x3c9c8a;},'lWULF':function(_0x3a79ee,_0x3e8e32){return _0x3a79ee&&_0x3e8e32;},'LOTTD':function(_0x52438f,_0x1334eb){return _0x52438f!==_0x1334eb;},'uoZXi':'fVUeJ','XFkUL':'HGKWG','CdSZC':function(_0x3697e9,_0x1e415e){return _0x3697e9-_0x1e415e;},'eDzrX':function(_0x4d51a6,_0x540cbc){return _0x4d51a6===_0x540cbc;},'uegbG':'WFyDj','DdZEP':_0xa01c(0x6a),'xBzfx':function(_0x195484,_0x3bc99e){return _0x195484-_0x3bc99e;}};return _0x1538d1[_0xa01c(0x6b)]((_0x12d315,_0x45f5f9)=>{if(_0x12d315[_0xa01c(0x6c)]&&!_0x45f5f9[_0xa01c(0x6c)])return-0x1;if(!_0x12d315[_0xa01c(0x6c)]&&_0x45f5f9['isActive'])return 0x1;const _0x4b845a=new Date(_0x12d315[_0xa01c(0x6d)]),_0x163359=new Date(_0x45f5f9['eventDate']),_0x111266=new Date(),_0x56dd23=_0x4b845a<_0x111266,_0x2bd822=_0x3f7e49[_0xa01c(0x6e)](_0x163359,_0x111266);if(_0x3f7e49[_0xa01c(0x6f)](_0x56dd23,!_0x2bd822))return 0x1;if(_0x3f7e49['lWULF'](!_0x56dd23,_0x2bd822))return-0x1;return _0x56dd23&&_0x2bd822?_0x3f7e49[_0xa01c(0x70)](_0x3f7e49[_0xa01c(0x71)],_0x3f7e49[_0xa01c(0x72)])?_0x3f7e49['CdSZC'](_0x163359[_0xa01c(0x23)](),_0x4b845a[_0xa01c(0x23)]()):![]:_0x3f7e49[_0xa01c(0x73)](_0x3f7e49['uegbG'],_0x3f7e49['DdZEP'])?_0x505288:_0x3f7e49['xBzfx'](_0x4b845a[_0xa01c(0x23)](),_0x163359['getTime']());});};exports[_0xa01c(0x2)]=sortEventsByDate;const filterEventsBySearch=(_0x7f1392,_0x1bb325)=>{const _0x213898={'pzsqh':function(_0x4a9e62,_0xaadf04){return _0x4a9e62<_0xaadf04;},'poVPe':function(_0x29b3ed,_0x23c730){return _0x29b3ed*_0x23c730;},'tOBCw':function(_0x609b10,_0x270d5a){return _0x609b10===_0x270d5a;},'bAqba':function(_0xd3c3eb,_0x23a725){return _0xd3c3eb===_0x23a725;},'lPqWG':function(_0x3fcda7,_0x31a534){return _0x3fcda7===_0x31a534;},'lKOqX':function(_0xd8b695,_0x31bcf6){return _0xd8b695!==_0x31bcf6;},'djGxB':'UZAbd'};if(!_0x1bb325[_0xa01c(0x12)]()){if(_0x213898[_0xa01c(0x74)]('ImWpV',_0x213898['djGxB']))return _0x7f1392;else{const _0x10fc4f=_0x5e2da9[_0xa01c(0x75)](_0x4dbfc7=>_0x4dbfc7[_0xa01c(0x64)]||[]);return _0x5c0601[_0xa01c(0x76)](new _0x566fc8(_0x10fc4f))[_0xa01c(0x6b)]();}}const _0x34da8d=_0x1bb325['toLowerCase']()[_0xa01c(0x12)]();return _0x7f1392[_0xa01c(0x16)](_0x57dbcd=>{if(_0x213898['tOBCw'](_0xa01c(0x77),'sperH')){const _0x4c405c=_0xa01c(0x78);let _0x265aab='';for(let _0x1f70fa=0x0;_0x213898['pzsqh'](_0x1f70fa,_0x16879b);_0x1f70fa++){_0x265aab+=_0x4c405c[_0xa01c(0x79)](_0x4be7f2[_0xa01c(0x7a)](_0x213898[_0xa01c(0x7b)](_0x412e2b['random'](),_0x4c405c[_0xa01c(0xe)])));}return _0x265aab;}else{var _0xfc0799,_0x233060,_0x33a9c4;return _0x57dbcd['title'][_0xa01c(0x5e)]()[_0xa01c(0x60)](_0x34da8d)||_0x57dbcd[_0xa01c(0x61)]['toLowerCase']()[_0xa01c(0x60)](_0x34da8d)||_0x57dbcd['code'][_0xa01c(0x5e)]()[_0xa01c(0x60)](_0x34da8d)||(_0x213898[_0xa01c(0x7c)](_0xfc0799=_0x57dbcd['location'],null)||_0xfc0799===void 0x0?void 0x0:_0xfc0799[_0xa01c(0x5e)]()[_0xa01c(0x60)](_0x34da8d))||((_0x233060=_0x57dbcd[_0xa01c(0x63)])===null||_0x233060===void 0x0?void 0x0:_0x233060[_0xa01c(0x5e)]()[_0xa01c(0x60)](_0x34da8d))||(_0x213898[_0xa01c(0x7d)](_0x33a9c4=_0x57dbcd['tags'],null)||_0x213898[_0xa01c(0x7c)](_0x33a9c4,void 0x0)?void 0x0:_0x33a9c4[_0xa01c(0x65)](_0x5dab95=>_0x5dab95[_0xa01c(0x5e)]()[_0xa01c(0x60)](_0x34da8d)));}});};exports[_0xa01c(0x9)]=filterEventsBySearch;const getUniqueEventTags=_0x58e13d=>{const _0x1f42b7=_0x58e13d[_0xa01c(0x75)](_0xb1ed95=>_0xb1ed95[_0xa01c(0x64)]||[]);return Array[_0xa01c(0x76)](new Set(_0x1f42b7))['sort']();};exports['getUniqueEventTags']=getUniqueEventTags;const calculateEventStats=_0x364628=>{const _0x38629b={'KPjGL':function(_0x2c8361,_0x1bd132){return _0x2c8361-_0x1bd132;},'eFRRN':function(_0x1bc4c9,_0x304bae){return _0x1bc4c9>_0x304bae;},'PktYW':function(_0x58576a,_0x4105d6){return _0x58576a*_0x4105d6;},'Lnwzx':function(_0x4e40ff,_0x26f93f){return _0x4e40ff/_0x26f93f;}},_0x5e9b16=_0x364628[_0xa01c(0xe)],_0x11ceab=_0x364628[_0xa01c(0x16)](_0x205384=>_0x205384[_0xa01c(0x6c)])['length'],_0x11c5ac=_0x38629b[_0xa01c(0x7e)](_0x5e9b16,_0x11ceab),_0x54aa39=_0x364628[_0xa01c(0x7f)]((_0x1dcc79,_0x222beb)=>_0x1dcc79+_0x222beb[_0xa01c(0x80)],0x0),_0x5751ff=_0x364628[_0xa01c(0x7f)]((_0x2869a5,_0x33e0fd)=>_0x2869a5+_0x33e0fd['maxAttendees'],0x0),_0x4978e1=_0x364628[_0xa01c(0x16)](_0x132303=>_0x132303[_0xa01c(0x6c)]&&!isEventPast(_0x132303[_0xa01c(0x6d)]))[_0xa01c(0xe)],_0x558e8a=_0x364628[_0xa01c(0x16)](_0x16c01a=>isEventPast(_0x16c01a[_0xa01c(0x6d)]))[_0xa01c(0xe)],_0x517e85=_0x364628[_0xa01c(0x16)](_0x1365b2=>_0x1365b2[_0xa01c(0x6c)]&&isEventToday(_0x1365b2[_0xa01c(0x6d)]))[_0xa01c(0xe)];return{'total':_0x5e9b16,'active':_0x11ceab,'inactive':_0x11c5ac,'upcoming':_0x4978e1,'past':_0x558e8a,'today':_0x517e85,'totalAttendees':_0x54aa39,'totalCapacity':_0x5751ff,'averageAttendance':_0x38629b['eFRRN'](_0x5751ff,0x0)?Math[_0xa01c(0x81)](_0x38629b[_0xa01c(0x82)](_0x38629b[_0xa01c(0x83)](_0x54aa39,_0x5751ff),0x64)):0x0};};exports[_0xa01c(0xa)]=calculateEventStats;
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.validateEventCode = exports.sortEventsByDate = exports.isEventToday = exports.isEventPast = exports.getUniqueEventTags = exports.getEventStatus = exports.getDaysUntilEvent = exports.generateSmartEventCode = exports.generateEventCode = exports.formatEventDate = exports.filterEventsBySearch = exports.calculateEventStats = void 0;
7
+ /**
8
+ * Event utility functions for event management
9
+ */
10
+
11
+ /**
12
+ * Generate a random alphanumeric event code
13
+ * @param length - Length of the code (default: 6)
14
+ * @returns Random event code
15
+ */
16
+ const generateEventCode = (length = 6) => {
17
+ const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
18
+ let result = '';
19
+ for (let i = 0; i < length; i++) {
20
+ result += chars.charAt(Math.floor(Math.random() * chars.length));
21
+ }
22
+ return result;
23
+ };
24
+
25
+ /**
26
+ * Generate a smart event code based on the event title
27
+ * @param title - Event title
28
+ * @returns Smart event code
29
+ */
30
+ exports.generateEventCode = generateEventCode;
31
+ const generateSmartEventCode = title => {
32
+ if (!title.trim()) {
33
+ return generateEventCode();
34
+ }
35
+
36
+ // Clean the title and split into words
37
+ const words = title.trim().toUpperCase().replace(/[^A-Z0-9\s]/g, '') // Remove special characters
38
+ .split(/\s+/).filter(word => word.length > 0);
39
+ if (words.length === 0) {
40
+ return generateEventCode();
41
+ }
42
+ let code = '';
43
+
44
+ // Strategy 1: Take first 2 letters of each word (up to 3 words)
45
+ if (words.length >= 2) {
46
+ const significantWords = words.slice(0, 3);
47
+ code = significantWords.map(word => word.substring(0, 2)).join('');
48
+ } else {
49
+ // Strategy 2: Single word - take first 4 letters
50
+ code = words[0].substring(0, 4);
51
+ }
52
+
53
+ // Add current year's last 2 digits
54
+ const currentYear = new Date().getFullYear().toString().slice(-2);
55
+ code += currentYear;
56
+
57
+ // Ensure minimum length of 4 and maximum of 8
58
+ if (code.length < 4) {
59
+ code += generateEventCode(4 - code.length);
60
+ } else if (code.length > 8) {
61
+ code = code.substring(0, 8);
62
+ }
63
+ return code;
64
+ };
65
+
66
+ /**
67
+ * Validate event code format
68
+ * @param code - Event code to validate
69
+ * @returns Object with validation result and error message
70
+ */
71
+ exports.generateSmartEventCode = generateSmartEventCode;
72
+ const validateEventCode = code => {
73
+ if (!code || !code.trim()) {
74
+ return {
75
+ isValid: false,
76
+ error: 'Event code is required'
77
+ };
78
+ }
79
+ const trimmedCode = code.trim().toUpperCase();
80
+ if (trimmedCode.length < 3) {
81
+ return {
82
+ isValid: false,
83
+ error: 'Event code must be at least 3 characters'
84
+ };
85
+ }
86
+ if (trimmedCode.length > 10) {
87
+ return {
88
+ isValid: false,
89
+ error: 'Event code must be 10 characters or less'
90
+ };
91
+ }
92
+ if (!/^[A-Z0-9]+$/.test(trimmedCode)) {
93
+ return {
94
+ isValid: false,
95
+ error: 'Event code must contain only letters and numbers'
96
+ };
97
+ }
98
+ return {
99
+ isValid: true
100
+ };
101
+ };
102
+
103
+ /**
104
+ * Format event date for display
105
+ * @param dateString - Date string in YYYY-MM-DD format
106
+ * @returns Formatted date string
107
+ */
108
+ exports.validateEventCode = validateEventCode;
109
+ const formatEventDate = dateString => {
110
+ try {
111
+ const date = new Date(dateString);
112
+ return date.toLocaleDateString('en-US', {
113
+ weekday: 'long',
114
+ year: 'numeric',
115
+ month: 'long',
116
+ day: 'numeric'
117
+ });
118
+ } catch (error) {
119
+ return dateString;
120
+ }
121
+ };
122
+
123
+ /**
124
+ * Check if an event is happening today
125
+ * @param eventDate - Event date string
126
+ * @returns True if event is today
127
+ */
128
+ exports.formatEventDate = formatEventDate;
129
+ const isEventToday = eventDate => {
130
+ try {
131
+ const today = new Date();
132
+ const event = new Date(eventDate);
133
+ return today.getFullYear() === event.getFullYear() && today.getMonth() === event.getMonth() && today.getDate() === event.getDate();
134
+ } catch (error) {
135
+ return false;
136
+ }
137
+ };
138
+
139
+ /**
140
+ * Check if an event is in the past
141
+ * @param eventDate - Event date string
142
+ * @returns True if event is in the past
143
+ */
144
+ exports.isEventToday = isEventToday;
145
+ const isEventPast = eventDate => {
146
+ try {
147
+ const today = new Date();
148
+ const event = new Date(eventDate);
149
+
150
+ // Set time to start of day for accurate comparison
151
+ today.setHours(0, 0, 0, 0);
152
+ event.setHours(0, 0, 0, 0);
153
+ return event < today;
154
+ } catch (error) {
155
+ return false;
156
+ }
157
+ };
158
+
159
+ /**
160
+ * Get event status based on date and active status
161
+ * @param eventDate - Event date string
162
+ * @param isActive - Whether event is active
163
+ * @returns Event status string
164
+ */
165
+ exports.isEventPast = isEventPast;
166
+ const getEventStatus = (eventDate, isActive) => {
167
+ if (!isActive) {
168
+ return 'Inactive';
169
+ }
170
+ if (isEventPast(eventDate)) {
171
+ return 'Past';
172
+ }
173
+ if (isEventToday(eventDate)) {
174
+ return 'Today';
175
+ }
176
+ return 'Upcoming';
177
+ };
178
+
179
+ /**
180
+ * Calculate days until event
181
+ * @param eventDate - Event date string
182
+ * @returns Number of days until event (negative if past)
183
+ */
184
+ exports.getEventStatus = getEventStatus;
185
+ const getDaysUntilEvent = eventDate => {
186
+ try {
187
+ const today = new Date();
188
+ const event = new Date(eventDate);
189
+
190
+ // Set time to start of day for accurate comparison
191
+ today.setHours(0, 0, 0, 0);
192
+ event.setHours(0, 0, 0, 0);
193
+ const diffTime = event.getTime() - today.getTime();
194
+ const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
195
+ return diffDays;
196
+ } catch (error) {
197
+ return 0;
198
+ }
199
+ };
200
+
201
+ /**
202
+ * Sort events by date (upcoming first, then past events)
203
+ * @param events - Array of events
204
+ * @returns Sorted array of events
205
+ */
206
+ exports.getDaysUntilEvent = getDaysUntilEvent;
207
+ const sortEventsByDate = events => {
208
+ return events.sort((a, b) => {
209
+ // Active events first
210
+ if (a.isActive && !b.isActive) return -1;
211
+ if (!a.isActive && b.isActive) return 1;
212
+
213
+ // Then sort by date
214
+ const dateA = new Date(a.eventDate);
215
+ const dateB = new Date(b.eventDate);
216
+
217
+ // Upcoming events first (ascending), then past events (descending)
218
+ const today = new Date();
219
+ const aIsPast = dateA < today;
220
+ const bIsPast = dateB < today;
221
+ if (aIsPast && !bIsPast) return 1;
222
+ if (!aIsPast && bIsPast) return -1;
223
+ if (aIsPast && bIsPast) {
224
+ return dateB.getTime() - dateA.getTime(); // Past events: most recent first
225
+ } else {
226
+ return dateA.getTime() - dateB.getTime(); // Upcoming events: soonest first
227
+ }
228
+ });
229
+ };
230
+
231
+ /**
232
+ * Filter events by search query
233
+ * @param events - Array of events
234
+ * @param query - Search query
235
+ * @returns Filtered array of events
236
+ */
237
+ exports.sortEventsByDate = sortEventsByDate;
238
+ const filterEventsBySearch = (events, query) => {
239
+ if (!query.trim()) {
240
+ return events;
241
+ }
242
+ const searchTerm = query.toLowerCase().trim();
243
+ return events.filter(event => {
244
+ var _event$location, _event$organizer, _event$tags;
245
+ 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)));
246
+ });
247
+ };
248
+
249
+ /**
250
+ * Get unique tags from events
251
+ * @param events - Array of events
252
+ * @returns Array of unique tags
253
+ */
254
+ exports.filterEventsBySearch = filterEventsBySearch;
255
+ const getUniqueEventTags = events => {
256
+ const allTags = events.flatMap(event => event.tags || []);
257
+ return Array.from(new Set(allTags)).sort();
258
+ };
259
+
260
+ /**
261
+ * Calculate event statistics
262
+ * @param events - Array of events
263
+ * @returns Event statistics object
264
+ */
265
+ exports.getUniqueEventTags = getUniqueEventTags;
266
+ const calculateEventStats = events => {
267
+ const total = events.length;
268
+ const active = events.filter(e => e.isActive).length;
269
+ const inactive = total - active;
270
+ const totalAttendees = events.reduce((sum, e) => sum + e.attendeeCount, 0);
271
+ const totalCapacity = events.reduce((sum, e) => sum + e.maxAttendees, 0);
272
+ const upcoming = events.filter(e => e.isActive && !isEventPast(e.eventDate)).length;
273
+ const past = events.filter(e => isEventPast(e.eventDate)).length;
274
+ const today = events.filter(e => e.isActive && isEventToday(e.eventDate)).length;
275
+ return {
276
+ total,
277
+ active,
278
+ inactive,
279
+ upcoming,
280
+ past,
281
+ today,
282
+ totalAttendees,
283
+ totalCapacity,
284
+ averageAttendance: totalCapacity > 0 ? Math.round(totalAttendees / totalCapacity * 100) : 0
285
+ };
286
+ };
287
+ exports.calculateEventStats = calculateEventStats;
288
+ //# sourceMappingURL=eventUtils.js.map
@@ -1,9 +1,66 @@
1
- 'use strict';
2
- // Onairos SDK - Asset Registry (auto-generated)
3
- var __ONAIROS_REQ_REGISTRY__ = [
4
- require("react-native"),
5
- require('react-native-haptic-feedback'),
6
- require('react-native')
7
- ];
8
- function __ONAIROS_REQ_FUNC__(i) { return __ONAIROS_REQ_REGISTRY__[i]; }
9
- Object[_0x6e48(0x0)](exports,_0x6e48(0x1),{'value':!![]}),exports['triggerHaptic']=exports[_0x6e48(0x2)]=void 0x0;var _reactNative=__ONAIROS_REQ_FUNC__(0x0);let HapticType=exports['HapticType']=function(_0x218b88){const _0x5ad676={'QKnkC':_0x6e48(0x3),'AJbPU':_0x6e48(0x4),'fbwhL':_0x6e48(0x5),'FxaOD':_0x6e48(0x6),'IXkbk':'HEAVY','OytnR':_0x6e48(0x7),'GxVli':_0x6e48(0x8),'oYkwo':_0x6e48(0x9),'SMGgf':'SUCCESS','YyZLK':_0x6e48(0xa),'UVcUa':'WARNING','JNJZq':'warning'},_0x4be767=_0x5ad676['QKnkC'][_0x6e48(0xb)]('|');let _0x5dc1d2=0x0;while(!![]){switch(_0x4be767[_0x5dc1d2++]){case'0':_0x218b88[_0x5ad676['AJbPU']]=_0x5ad676[_0x6e48(0xc)];continue;case'1':_0x218b88[_0x6e48(0xd)]=_0x5ad676[_0x6e48(0xc)];continue;case'2':return _0x218b88;case'3':_0x218b88[_0x5ad676['FxaOD']]=_0x6e48(0xe);continue;case'4':_0x218b88[_0x5ad676[_0x6e48(0xf)]]=_0x5ad676['OytnR'];continue;case'5':_0x218b88[_0x5ad676[_0x6e48(0x10)]]=_0x5ad676[_0x6e48(0x11)];continue;case'6':_0x218b88[_0x5ad676[_0x6e48(0x12)]]=_0x5ad676[_0x6e48(0x13)];continue;case'7':_0x218b88[_0x5ad676[_0x6e48(0x14)]]=_0x5ad676[_0x6e48(0x15)];continue;}break;}}({});const triggerHaptic=(_0xcb3ce=HapticType['LIGHT'])=>{const _0x40370d={'HKDeN':_0x6e48(0x16),'KopBV':function(_0x1c86b4,_0x27be38){return _0x1c86b4(_0x27be38);},'ulOqA':_0x6e48(0x17),'RXXpI':_0x6e48(0x18),'cfWuD':function(_0x227e39,_0x4ba279){return _0x227e39!==_0x4ba279;},'wrQVf':_0x6e48(0x19),'tWUwt':_0x6e48(0x1a),'mYpmH':'notificationWarning','cQckE':_0x6e48(0x1b),'rCWDn':function(_0xdf0f92,_0x3fd420){return _0xdf0f92===_0x3fd420;},'MtkOc':_0x6e48(0x1c),'InSfY':function(_0x4e2ffc,_0x5d0dc1){return _0x4e2ffc!==_0x5d0dc1;},'KwQyr':_0x6e48(0x1d)};if(_reactNative['Platform']['OS']===_0x40370d[_0x6e48(0x1e)])try{if(_0x40370d[_0x6e48(0x1f)](_0x40370d[_0x6e48(0x20)],_0x6e48(0x21))){const _0x19df15=_0x40370d['KopBV'](__ONAIROS_REQ_FUNC__,0x1),_0x1dd12b={'enableVibrateFallback':!![],'ignoreAndroidSystemSettings':![]};switch(_0xcb3ce){case HapticType[_0x6e48(0xd)]:_0x19df15[_0x6e48(0x22)](_0x40370d[_0x6e48(0x23)],_0x1dd12b);break;case HapticType[_0x6e48(0x6)]:_0x19df15['trigger'](_0x6e48(0x24),_0x1dd12b);break;case HapticType[_0x6e48(0x25)]:_0x19df15[_0x6e48(0x22)](_0x6e48(0x26),_0x1dd12b);break;case HapticType[_0x6e48(0x27)]:_0x19df15[_0x6e48(0x22)](_0x6e48(0x28),_0x1dd12b);break;case HapticType[_0x6e48(0x29)]:_0x19df15[_0x6e48(0x22)](_0x40370d[_0x6e48(0x2a)],_0x1dd12b);break;case HapticType[_0x6e48(0x8)]:_0x19df15[_0x6e48(0x22)](_0x40370d[_0x6e48(0x2b)],_0x1dd12b);break;default:_0x19df15[_0x6e48(0x22)](_0x40370d[_0x6e48(0x23)],_0x1dd12b);}}else _0x369d85['warn'](_0x40370d[_0x6e48(0x2c)],_0x1cdcca);}catch(_0x3a4af0){console[_0x6e48(0x2d)](_0x40370d[_0x6e48(0x2c)],_0x3a4af0);}else{if(_0x40370d[_0x6e48(0x2e)](_reactNative[_0x6e48(0x2f)]['OS'],_0x40370d[_0x6e48(0x30)])){if(_0x40370d[_0x6e48(0x31)](_0x6e48(0x32),_0x6e48(0x32))){const {Vibration:_0x1ad94d}=_0x5714ec(0x2);_0x1ad94d[_0x6e48(0x33)](0x32);}else try{const {Vibration:_0x5567bd}=_0x40370d[_0x6e48(0x34)](__ONAIROS_REQ_FUNC__,0x2);_0x5567bd['vibrate'](0x32);}catch(_0x2dff5e){if(_0x40370d[_0x6e48(0x35)]===_0x6e48(0x1d))console[_0x6e48(0x2d)](_0x6e48(0x17),_0x2dff5e);else try{const {Vibration:_0x15fac4}=_0x40370d[_0x6e48(0x34)](_0x37f6d9,0x2);_0x15fac4[_0x6e48(0x33)](0x32);}catch(_0x4196f1){_0x40997c[_0x6e48(0x2d)](_0x40370d[_0x6e48(0x36)],_0x4196f1);}}}}};function _0x4852(){const _0x37cc83=['defineProperty','__esModule','HapticType','1|3|4|6|7|5|0|2','BUTTON_PRESS','light','MEDIUM','heavy','ERROR','error','success','split','fbwhL','LIGHT','medium','IXkbk','GxVli','oYkwo','SMGgf','YyZLK','UVcUa','JNJZq','Haptic\x20feedback\x20not\x20available:','Vibration\x20not\x20available:','ios','DsvtL','impactLight','notificationError','android','EyoCS','RXXpI','cfWuD','wrQVf','mMRxh','trigger','tWUwt','impactMedium','HEAVY','impactHeavy','SUCCESS','notificationSuccess','WARNING','mYpmH','cQckE','HKDeN','warn','rCWDn','Platform','MtkOc','InSfY','PYPIR','vibrate','KopBV','KwQyr','ulOqA'];_0x4852=function(){return _0x37cc83;};return _0x4852();}function _0x6e48(_0x4852f4,_0x6e4801){_0x4852f4=_0x4852f4-0x0;const _0x92d744=_0x4852();let _0x3e7e19=_0x92d744[_0x4852f4];return _0x3e7e19;}exports['triggerHaptic']=triggerHaptic;
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.triggerHaptic = exports.HapticType = void 0;
7
+ var _reactNative = require("react-native");
8
+ let HapticType = exports.HapticType = /*#__PURE__*/function (HapticType) {
9
+ HapticType["LIGHT"] = "light";
10
+ HapticType["MEDIUM"] = "medium";
11
+ HapticType["HEAVY"] = "heavy";
12
+ HapticType["SUCCESS"] = "success";
13
+ HapticType["WARNING"] = "warning";
14
+ HapticType["ERROR"] = "error";
15
+ HapticType["BUTTON_PRESS"] = "light"; // Alias for button presses
16
+ return HapticType;
17
+ }({});
18
+ const triggerHaptic = (type = HapticType.LIGHT) => {
19
+ if (_reactNative.Platform.OS === 'ios') {
20
+ try {
21
+ // Try to use react-native-haptic-feedback if available
22
+ const ReactNativeHapticFeedback = require('react-native-haptic-feedback');
23
+ const options = {
24
+ enableVibrateFallback: true,
25
+ ignoreAndroidSystemSettings: false
26
+ };
27
+ switch (type) {
28
+ case HapticType.LIGHT:
29
+ ReactNativeHapticFeedback.trigger('impactLight', options);
30
+ break;
31
+ case HapticType.MEDIUM:
32
+ ReactNativeHapticFeedback.trigger('impactMedium', options);
33
+ break;
34
+ case HapticType.HEAVY:
35
+ ReactNativeHapticFeedback.trigger('impactHeavy', options);
36
+ break;
37
+ case HapticType.SUCCESS:
38
+ ReactNativeHapticFeedback.trigger('notificationSuccess', options);
39
+ break;
40
+ case HapticType.WARNING:
41
+ ReactNativeHapticFeedback.trigger('notificationWarning', options);
42
+ break;
43
+ case HapticType.ERROR:
44
+ ReactNativeHapticFeedback.trigger('notificationError', options);
45
+ break;
46
+ default:
47
+ ReactNativeHapticFeedback.trigger('impactLight', options);
48
+ }
49
+ } catch (error) {
50
+ // Fallback to basic vibration if haptic feedback is not available
51
+ console.warn('Haptic feedback not available:', error);
52
+ }
53
+ } else if (_reactNative.Platform.OS === 'android') {
54
+ // Android fallback - basic vibration
55
+ try {
56
+ const {
57
+ Vibration
58
+ } = require('react-native');
59
+ Vibration.vibrate(50);
60
+ } catch (error) {
61
+ console.warn('Vibration not available:', error);
62
+ }
63
+ }
64
+ };
65
+ exports.triggerHaptic = triggerHaptic;
66
+ //# sourceMappingURL=haptics.js.map
@@ -1 +1,6 @@
1
- 'use strict';function _0x6603(){var _0x159753=['__esModule'];_0x6603=function(){return _0x159753;};return _0x6603();}function _0x565a(_0x660373,_0x565a33){_0x660373=_0x660373-0x0;var _0x5ef487=_0x6603();var _0x37d2b5=_0x5ef487[_0x660373];return _0x37d2b5;}Object['defineProperty'](exports,_0x565a(0x0),{'value':!![]});
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=imagePreloader.js.map