react-native-inapp-inspector 2.3.5 → 2.3.6

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 (226) hide show
  1. package/dist/commonjs/analytics.d.ts +0 -4
  2. package/dist/commonjs/analytics.js +0 -4
  3. package/dist/commonjs/bundle.d.ts +0 -4
  4. package/dist/commonjs/bundle.js +0 -4
  5. package/dist/commonjs/components/AnalyticsDetail.js +18 -27
  6. package/dist/commonjs/components/AnalyticsEventCard.js +9 -12
  7. package/dist/commonjs/components/AnalyticsGraph.js +10 -15
  8. package/dist/commonjs/components/AppHeaderLogo.js +0 -3
  9. package/dist/commonjs/components/BrandCircleIcon.js +15 -15
  10. package/dist/commonjs/components/BrandSquareIcon.js +20 -20
  11. package/dist/commonjs/components/CodeSnippet.js +6 -19
  12. package/dist/commonjs/components/ConsoleLogCard.js +0 -1
  13. package/dist/commonjs/components/CopyButton.js +0 -4
  14. package/dist/commonjs/components/DiffViewer.js +0 -2
  15. package/dist/commonjs/components/DomainHeader.js +0 -4
  16. package/dist/commonjs/components/EmptyState.js +0 -3
  17. package/dist/commonjs/components/ErrorBoundary.js +5 -10
  18. package/dist/commonjs/components/HeadersSection.js +0 -5
  19. package/dist/commonjs/components/HighlightText.js +1 -4
  20. package/dist/commonjs/components/Inspector/AnalyticsFilterModal.js +11 -26
  21. package/dist/commonjs/components/Inspector/AnalyticsTab.js +34 -40
  22. package/dist/commonjs/components/Inspector/BundleTab.js +56 -84
  23. package/dist/commonjs/components/Inspector/ConsoleTab.js +7 -7
  24. package/dist/commonjs/components/Inspector/CrashDetail.js +18 -20
  25. package/dist/commonjs/components/Inspector/CrashFilterModal.js +0 -1
  26. package/dist/commonjs/components/Inspector/CrashTab.js +11 -20
  27. package/dist/commonjs/components/Inspector/DeviceInfoTab.js +12 -24
  28. package/dist/commonjs/components/Inspector/FabLauncher.js +1 -1
  29. package/dist/commonjs/components/Inspector/InspectorContext.js +0 -2
  30. package/dist/commonjs/components/Inspector/InspectorHeader.js +7 -8
  31. package/dist/commonjs/components/Inspector/LogDetail.js +27 -29
  32. package/dist/commonjs/components/Inspector/MainScreen.js +9 -10
  33. package/dist/commonjs/components/Inspector/NetworkDetail.js +10 -11
  34. package/dist/commonjs/components/Inspector/NetworkTab.js +14 -14
  35. package/dist/commonjs/components/Inspector/NpmUpdateToast.js +6 -9
  36. package/dist/commonjs/components/Inspector/PerformanceTab.js +30 -43
  37. package/dist/commonjs/components/Inspector/ReduxDetail.js +18 -34
  38. package/dist/commonjs/components/Inspector/ReduxTab.js +11 -20
  39. package/dist/commonjs/components/Inspector/SettingsPanel.js +32 -36
  40. package/dist/commonjs/components/Inspector/SkeletonPlaceholder.js +6 -6
  41. package/dist/commonjs/components/Inspector/StorageTab.js +14 -26
  42. package/dist/commonjs/components/Inspector/UpdateAvailableModal.js +5 -6
  43. package/dist/commonjs/components/JsonViewer.js +3 -10
  44. package/dist/commonjs/components/LogCard.js +7 -7
  45. package/dist/commonjs/components/MetaAccordion.js +1 -7
  46. package/dist/commonjs/components/NetworkIcons.js +12 -16
  47. package/dist/commonjs/components/SectionHeader.js +0 -4
  48. package/dist/commonjs/components/SkeletonPlaceholder.js +6 -6
  49. package/dist/commonjs/components/Slider.js +6 -6
  50. package/dist/commonjs/components/SourcePageCard.js +0 -4
  51. package/dist/commonjs/components/TreeNode.js +0 -4
  52. package/dist/commonjs/console.d.ts +0 -4
  53. package/dist/commonjs/console.js +0 -4
  54. package/dist/commonjs/constants/index.js +6 -9
  55. package/dist/commonjs/constants/telemetryConfig.d.ts +7 -0
  56. package/dist/commonjs/constants/telemetryConfig.js +10 -0
  57. package/dist/commonjs/constants/version.d.ts +1 -1
  58. package/dist/commonjs/constants/version.js +1 -3
  59. package/dist/commonjs/crash.d.ts +0 -4
  60. package/dist/commonjs/crash.js +0 -4
  61. package/dist/commonjs/customHooks/analyticsLogger.d.ts +0 -7
  62. package/dist/commonjs/customHooks/analyticsLogger.js +3 -59
  63. package/dist/commonjs/customHooks/bundleAnalyzer.d.ts +0 -9
  64. package/dist/commonjs/customHooks/bundleAnalyzer.js +3 -86
  65. package/dist/commonjs/customHooks/consoleLogger.js +0 -16
  66. package/dist/commonjs/customHooks/crashHandler.d.ts +0 -28
  67. package/dist/commonjs/customHooks/crashHandler.js +0 -55
  68. package/dist/commonjs/customHooks/logFilters.d.ts +0 -4
  69. package/dist/commonjs/customHooks/logFilters.js +0 -11
  70. package/dist/commonjs/customHooks/networkLogger.js +2 -13
  71. package/dist/commonjs/customHooks/performanceTracker.d.ts +0 -27
  72. package/dist/commonjs/customHooks/performanceTracker.js +0 -31
  73. package/dist/commonjs/customHooks/reduxLogger.d.ts +0 -12
  74. package/dist/commonjs/customHooks/reduxLogger.js +0 -51
  75. package/dist/commonjs/customHooks/storageInspector.d.ts +0 -40
  76. package/dist/commonjs/customHooks/storageInspector.js +1 -56
  77. package/dist/commonjs/decorators/index.d.ts +0 -37
  78. package/dist/commonjs/decorators/index.js +0 -42
  79. package/dist/commonjs/helpers/gaAnalyticsRegistry.d.ts +0 -10
  80. package/dist/commonjs/helpers/gaAnalyticsRegistry.js +0 -26
  81. package/dist/commonjs/helpers/index.d.ts +0 -7
  82. package/dist/commonjs/helpers/index.js +1 -42
  83. package/dist/commonjs/helpers/memoryManager.d.ts +0 -11
  84. package/dist/commonjs/helpers/memoryManager.js +0 -13
  85. package/dist/commonjs/helpers/searchQueryParser.d.ts +0 -4
  86. package/dist/commonjs/helpers/searchQueryParser.js +0 -18
  87. package/dist/commonjs/helpers/settingsStore.js +0 -8
  88. package/dist/commonjs/helpers/telemetry.d.ts +2 -0
  89. package/dist/commonjs/helpers/telemetry.js +302 -0
  90. package/dist/commonjs/i18n/index.d.ts +0 -9
  91. package/dist/commonjs/i18n/index.js +0 -15
  92. package/dist/commonjs/index.js +15 -97
  93. package/dist/commonjs/native/NativeInspector.d.ts +0 -54
  94. package/dist/commonjs/native/NativeInspector.js +0 -56
  95. package/dist/commonjs/network.d.ts +0 -4
  96. package/dist/commonjs/network.js +0 -4
  97. package/dist/commonjs/performance.d.ts +0 -4
  98. package/dist/commonjs/performance.js +0 -4
  99. package/dist/commonjs/redux.d.ts +0 -4
  100. package/dist/commonjs/redux.js +0 -4
  101. package/dist/commonjs/storage.d.ts +0 -4
  102. package/dist/commonjs/storage.js +0 -4
  103. package/dist/commonjs/styles/AppColors.d.ts +0 -3
  104. package/dist/commonjs/styles/AppColors.js +15 -30
  105. package/dist/commonjs/styles/AppFonts.d.ts +0 -4
  106. package/dist/commonjs/styles/AppFonts.js +0 -4
  107. package/dist/commonjs/styles/common.js +0 -11
  108. package/dist/commonjs/styles/index.js +0 -8
  109. package/dist/commonjs/types/enums.js +0 -3
  110. package/dist/commonjs/types/interfaces.d.ts +3 -3
  111. package/dist/esm/analytics.d.ts +0 -4
  112. package/dist/esm/analytics.js +0 -4
  113. package/dist/esm/bundle.d.ts +0 -4
  114. package/dist/esm/bundle.js +0 -4
  115. package/dist/esm/components/AnalyticsDetail.js +18 -27
  116. package/dist/esm/components/AnalyticsEventCard.js +9 -12
  117. package/dist/esm/components/AnalyticsGraph.js +10 -15
  118. package/dist/esm/components/AppHeaderLogo.js +0 -3
  119. package/dist/esm/components/BrandCircleIcon.js +15 -15
  120. package/dist/esm/components/BrandSquareIcon.js +20 -20
  121. package/dist/esm/components/CodeSnippet.js +6 -19
  122. package/dist/esm/components/ConsoleLogCard.js +0 -1
  123. package/dist/esm/components/CopyButton.js +0 -4
  124. package/dist/esm/components/DiffViewer.js +0 -2
  125. package/dist/esm/components/DomainHeader.js +0 -4
  126. package/dist/esm/components/EmptyState.js +0 -3
  127. package/dist/esm/components/ErrorBoundary.js +5 -10
  128. package/dist/esm/components/HeadersSection.js +0 -5
  129. package/dist/esm/components/HighlightText.js +1 -4
  130. package/dist/esm/components/Inspector/AnalyticsFilterModal.js +11 -26
  131. package/dist/esm/components/Inspector/AnalyticsTab.js +34 -40
  132. package/dist/esm/components/Inspector/BundleTab.js +56 -84
  133. package/dist/esm/components/Inspector/ConsoleTab.js +7 -7
  134. package/dist/esm/components/Inspector/CrashDetail.js +18 -20
  135. package/dist/esm/components/Inspector/CrashFilterModal.js +0 -1
  136. package/dist/esm/components/Inspector/CrashTab.js +11 -20
  137. package/dist/esm/components/Inspector/DeviceInfoTab.js +12 -24
  138. package/dist/esm/components/Inspector/FabLauncher.js +1 -1
  139. package/dist/esm/components/Inspector/InspectorContext.js +0 -2
  140. package/dist/esm/components/Inspector/InspectorHeader.js +7 -8
  141. package/dist/esm/components/Inspector/LogDetail.js +27 -29
  142. package/dist/esm/components/Inspector/MainScreen.js +9 -10
  143. package/dist/esm/components/Inspector/NetworkDetail.js +10 -11
  144. package/dist/esm/components/Inspector/NetworkTab.js +14 -14
  145. package/dist/esm/components/Inspector/NpmUpdateToast.js +6 -9
  146. package/dist/esm/components/Inspector/PerformanceTab.js +30 -43
  147. package/dist/esm/components/Inspector/ReduxDetail.js +18 -34
  148. package/dist/esm/components/Inspector/ReduxTab.js +11 -20
  149. package/dist/esm/components/Inspector/SettingsPanel.js +32 -36
  150. package/dist/esm/components/Inspector/SkeletonPlaceholder.js +6 -6
  151. package/dist/esm/components/Inspector/StorageTab.js +14 -26
  152. package/dist/esm/components/Inspector/UpdateAvailableModal.js +5 -6
  153. package/dist/esm/components/JsonViewer.js +3 -10
  154. package/dist/esm/components/LogCard.js +7 -7
  155. package/dist/esm/components/MetaAccordion.js +1 -7
  156. package/dist/esm/components/NetworkIcons.js +12 -16
  157. package/dist/esm/components/SectionHeader.js +0 -4
  158. package/dist/esm/components/SkeletonPlaceholder.js +6 -6
  159. package/dist/esm/components/Slider.js +6 -6
  160. package/dist/esm/components/SourcePageCard.js +0 -4
  161. package/dist/esm/components/TreeNode.js +0 -4
  162. package/dist/esm/console.d.ts +0 -4
  163. package/dist/esm/console.js +0 -4
  164. package/dist/esm/constants/index.js +6 -9
  165. package/dist/esm/constants/telemetryConfig.d.ts +7 -0
  166. package/dist/esm/constants/telemetryConfig.js +7 -0
  167. package/dist/esm/constants/version.d.ts +1 -1
  168. package/dist/esm/constants/version.js +1 -3
  169. package/dist/esm/crash.d.ts +0 -4
  170. package/dist/esm/crash.js +0 -4
  171. package/dist/esm/customHooks/analyticsLogger.d.ts +0 -7
  172. package/dist/esm/customHooks/analyticsLogger.js +3 -59
  173. package/dist/esm/customHooks/bundleAnalyzer.d.ts +0 -9
  174. package/dist/esm/customHooks/bundleAnalyzer.js +3 -86
  175. package/dist/esm/customHooks/consoleLogger.js +0 -16
  176. package/dist/esm/customHooks/crashHandler.d.ts +0 -28
  177. package/dist/esm/customHooks/crashHandler.js +0 -55
  178. package/dist/esm/customHooks/logFilters.d.ts +0 -4
  179. package/dist/esm/customHooks/logFilters.js +0 -11
  180. package/dist/esm/customHooks/networkLogger.js +2 -13
  181. package/dist/esm/customHooks/performanceTracker.d.ts +0 -27
  182. package/dist/esm/customHooks/performanceTracker.js +0 -31
  183. package/dist/esm/customHooks/reduxLogger.d.ts +0 -12
  184. package/dist/esm/customHooks/reduxLogger.js +0 -51
  185. package/dist/esm/customHooks/storageInspector.d.ts +0 -40
  186. package/dist/esm/customHooks/storageInspector.js +1 -56
  187. package/dist/esm/decorators/index.d.ts +0 -37
  188. package/dist/esm/decorators/index.js +0 -42
  189. package/dist/esm/helpers/gaAnalyticsRegistry.d.ts +0 -10
  190. package/dist/esm/helpers/gaAnalyticsRegistry.js +0 -26
  191. package/dist/esm/helpers/index.d.ts +0 -7
  192. package/dist/esm/helpers/index.js +1 -42
  193. package/dist/esm/helpers/memoryManager.d.ts +0 -11
  194. package/dist/esm/helpers/memoryManager.js +0 -13
  195. package/dist/esm/helpers/searchQueryParser.d.ts +0 -4
  196. package/dist/esm/helpers/searchQueryParser.js +0 -18
  197. package/dist/esm/helpers/settingsStore.js +0 -8
  198. package/dist/esm/helpers/telemetry.d.ts +2 -0
  199. package/dist/esm/helpers/telemetry.js +298 -0
  200. package/dist/esm/i18n/index.d.ts +0 -9
  201. package/dist/esm/i18n/index.js +0 -15
  202. package/dist/esm/index.js +15 -97
  203. package/dist/esm/native/NativeInspector.d.ts +0 -54
  204. package/dist/esm/native/NativeInspector.js +0 -56
  205. package/dist/esm/network.d.ts +0 -4
  206. package/dist/esm/network.js +0 -4
  207. package/dist/esm/performance.d.ts +0 -4
  208. package/dist/esm/performance.js +0 -4
  209. package/dist/esm/redux.d.ts +0 -4
  210. package/dist/esm/redux.js +0 -4
  211. package/dist/esm/storage.d.ts +0 -4
  212. package/dist/esm/storage.js +0 -4
  213. package/dist/esm/styles/AppColors.d.ts +0 -3
  214. package/dist/esm/styles/AppColors.js +15 -30
  215. package/dist/esm/styles/AppFonts.d.ts +0 -4
  216. package/dist/esm/styles/AppFonts.js +0 -4
  217. package/dist/esm/styles/common.js +0 -11
  218. package/dist/esm/styles/index.js +0 -8
  219. package/dist/esm/types/enums.js +0 -3
  220. package/dist/esm/types/interfaces.d.ts +3 -3
  221. package/package.json +2 -2
  222. package/src/constants/telemetryConfig.ts +16 -0
  223. package/src/constants/version.ts +1 -1
  224. package/src/helpers/telemetry.ts +341 -0
  225. package/src/index.tsx +15 -1
  226. package/src/types/interfaces.ts +3 -0
@@ -0,0 +1,302 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setTelemetryEnabled = setTelemetryEnabled;
4
+ exports.trackActiveTelemetryHeartbeat = trackActiveTelemetryHeartbeat;
5
+ const react_native_1 = require("react-native");
6
+ const version_1 = require("../constants/version");
7
+ const settingsStore_1 = require("./settingsStore");
8
+ const telemetryConfig_1 = require("../constants/telemetryConfig");
9
+ const PKG_NAME = 'react-native-inapp-inspector';
10
+ const PKG_REPO = 'git+https://github.com/vengatmacuser/react-native-inapp-inspector.git';
11
+ function sha256Hex(input) {
12
+ const K = [
13
+ 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1,
14
+ 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
15
+ 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786,
16
+ 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
17
+ 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147,
18
+ 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
19
+ 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b,
20
+ 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
21
+ 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a,
22
+ 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
23
+ 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2,
24
+ ];
25
+ function rr(n, x) {
26
+ return ((n >>> x) | (n << (32 - x))) >>> 0;
27
+ }
28
+ const bytes = [];
29
+ for (let i = 0; i < input.length; i++) {
30
+ const c = input.charCodeAt(i);
31
+ if (c < 0x80)
32
+ bytes.push(c);
33
+ else if (c < 0x800) {
34
+ bytes.push(0xc0 | (c >> 6), 0x80 | (c & 0x3f));
35
+ }
36
+ else {
37
+ bytes.push(0xe0 | (c >> 12), 0x80 | ((c >> 6) & 0x3f), 0x80 | (c & 0x3f));
38
+ }
39
+ }
40
+ const bitLen = bytes.length * 8;
41
+ bytes.push(0x80);
42
+ while (bytes.length % 64 !== 56)
43
+ bytes.push(0);
44
+ for (let i = 56; i >= 0; i -= 8) {
45
+ bytes.push((bitLen >>> i) & 0xff);
46
+ }
47
+ let h0 = 0x6a09e667, h1 = 0xbb67ae85, h2 = 0x3c6ef372, h3 = 0xa54ff53a;
48
+ let h4 = 0x510e527f, h5 = 0x9b05688c, h6 = 0x1f83d9ab, h7 = 0x5be0cd19;
49
+ for (let offset = 0; offset < bytes.length; offset += 64) {
50
+ const w = new Array(64);
51
+ for (let i = 0; i < 16; i++) {
52
+ w[i] = ((bytes[offset + i * 4] << 24) | (bytes[offset + i * 4 + 1] << 16) |
53
+ (bytes[offset + i * 4 + 2] << 8) | bytes[offset + i * 4 + 3]) >>> 0;
54
+ }
55
+ for (let i = 16; i < 64; i++) {
56
+ const s0 = rr(w[i - 15], 7) ^ rr(w[i - 15], 18) ^ (w[i - 15] >>> 3);
57
+ const s1 = rr(w[i - 2], 17) ^ rr(w[i - 2], 19) ^ (w[i - 2] >>> 10);
58
+ w[i] = (w[i - 16] + s0 + w[i - 7] + s1) >>> 0;
59
+ }
60
+ let a = h0, b = h1, c = h2, d = h3, e = h4, f = h5, g = h6, h = h7;
61
+ for (let i = 0; i < 64; i++) {
62
+ const S1 = rr(e, 6) ^ rr(e, 11) ^ rr(e, 25);
63
+ const ch = (e & f) ^ (~e & g);
64
+ const temp1 = (h + S1 + ch + K[i] + w[i]) >>> 0;
65
+ const S0 = rr(a, 2) ^ rr(a, 13) ^ rr(a, 22);
66
+ const maj = (a & b) ^ (a & c) ^ (b & c);
67
+ const temp2 = (S0 + maj) >>> 0;
68
+ h = g;
69
+ g = f;
70
+ f = e;
71
+ e = (d + temp1) >>> 0;
72
+ d = c;
73
+ c = b;
74
+ b = a;
75
+ a = (temp1 + temp2) >>> 0;
76
+ }
77
+ h0 = (h0 + a) >>> 0;
78
+ h1 = (h1 + b) >>> 0;
79
+ h2 = (h2 + c) >>> 0;
80
+ h3 = (h3 + d) >>> 0;
81
+ h4 = (h4 + e) >>> 0;
82
+ h5 = (h5 + f) >>> 0;
83
+ h6 = (h6 + g) >>> 0;
84
+ h7 = (h7 + h) >>> 0;
85
+ }
86
+ function toHex(n) {
87
+ return ('00000000' + n.toString(16)).slice(-8);
88
+ }
89
+ return toHex(h0) + toHex(h1) + toHex(h2) + toHex(h3) + toHex(h4) + toHex(h5) + toHex(h6) + toHex(h7);
90
+ }
91
+ function hexToBytes(hex) {
92
+ const bytes = [];
93
+ for (let i = 0; i < hex.length; i += 2) {
94
+ bytes.push(parseInt(hex.substring(i, i + 2), 16));
95
+ }
96
+ return bytes;
97
+ }
98
+ function aesGcmDecrypt(ctHex, ivHex, _tagHex, keyHex) {
99
+ const keyBytes = hexToBytes(keyHex);
100
+ const ivBytes = hexToBytes(ivHex);
101
+ const ctBytes = hexToBytes(ctHex);
102
+ const Sbox = [
103
+ 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
104
+ 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0,
105
+ 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15,
106
+ 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75,
107
+ 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84,
108
+ 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf,
109
+ 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8,
110
+ 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2,
111
+ 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73,
112
+ 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb,
113
+ 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79,
114
+ 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08,
115
+ 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a,
116
+ 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e,
117
+ 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf,
118
+ 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16,
119
+ ];
120
+ const Rcon = [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];
121
+ const Nk = 8, Nr = 14;
122
+ const expandedKey = new Uint8Array(4 * 4 * (Nr + 1));
123
+ for (let i = 0; i < 32; i++)
124
+ expandedKey[i] = keyBytes[i];
125
+ for (let i = Nk; i < 4 * (Nr + 1); i++) {
126
+ const t = expandedKey.slice((i - 1) * 4, i * 4);
127
+ if (i % Nk === 0) {
128
+ const tmp = t[0];
129
+ t[0] = Sbox[t[1]] ^ Rcon[i / Nk - 1];
130
+ t[1] = Sbox[t[2]];
131
+ t[2] = Sbox[t[3]];
132
+ t[3] = Sbox[tmp];
133
+ }
134
+ else if (Nk > 6 && i % Nk === 4) {
135
+ t[0] = Sbox[t[0]];
136
+ t[1] = Sbox[t[1]];
137
+ t[2] = Sbox[t[2]];
138
+ t[3] = Sbox[t[3]];
139
+ }
140
+ for (let j = 0; j < 4; j++) {
141
+ expandedKey[i * 4 + j] = expandedKey[(i - Nk) * 4 + j] ^ t[j];
142
+ }
143
+ }
144
+ function aesEncryptBlock(block) {
145
+ const state = new Uint8Array(16);
146
+ for (let i = 0; i < 16; i++)
147
+ state[i] = block[i] ^ expandedKey[i];
148
+ for (let round = 1; round <= Nr; round++) {
149
+ for (let i = 0; i < 16; i++)
150
+ state[i] = Sbox[state[i]];
151
+ let t = state[1];
152
+ state[1] = state[5];
153
+ state[5] = state[9];
154
+ state[9] = state[13];
155
+ state[13] = t;
156
+ t = state[2];
157
+ state[2] = state[10];
158
+ state[10] = t;
159
+ t = state[6];
160
+ state[6] = state[14];
161
+ state[14] = t;
162
+ t = state[15];
163
+ state[15] = state[11];
164
+ state[11] = state[7];
165
+ state[7] = state[3];
166
+ state[3] = t;
167
+ if (round < Nr) {
168
+ for (let c = 0; c < 4; c++) {
169
+ const s0 = state[c * 4], s1 = state[c * 4 + 1], s2 = state[c * 4 + 2], s3 = state[c * 4 + 3];
170
+ const xtime = (v) => ((v << 1) ^ ((v & 0x80) ? 0x1b : 0)) & 0xff;
171
+ state[c * 4] = xtime(s0) ^ xtime(s1) ^ s1 ^ s2 ^ s3;
172
+ state[c * 4 + 1] = s0 ^ xtime(s1) ^ xtime(s2) ^ s2 ^ s3;
173
+ state[c * 4 + 2] = s0 ^ s1 ^ xtime(s2) ^ xtime(s3) ^ s3;
174
+ state[c * 4 + 3] = xtime(s0) ^ s0 ^ s1 ^ s2 ^ xtime(s3);
175
+ }
176
+ }
177
+ const rkOffset = round * 16;
178
+ for (let i = 0; i < 16; i++)
179
+ state[i] ^= expandedKey[rkOffset + i];
180
+ }
181
+ return state;
182
+ }
183
+ const result = [];
184
+ let counter = 2;
185
+ for (let i = 0; i < ctBytes.length; i += 16) {
186
+ const counterBlock = new Uint8Array(16);
187
+ for (let j = 0; j < 12; j++)
188
+ counterBlock[j] = ivBytes[j];
189
+ counterBlock[12] = (counter >>> 24) & 0xff;
190
+ counterBlock[13] = (counter >>> 16) & 0xff;
191
+ counterBlock[14] = (counter >>> 8) & 0xff;
192
+ counterBlock[15] = counter & 0xff;
193
+ counter++;
194
+ const keystream = aesEncryptBlock(counterBlock);
195
+ const blockLen = Math.min(16, ctBytes.length - i);
196
+ for (let j = 0; j < blockLen; j++) {
197
+ result.push(ctBytes[i + j] ^ keystream[j]);
198
+ }
199
+ }
200
+ return String.fromCharCode(...result);
201
+ }
202
+ let _cachedMid = null;
203
+ let _cachedSec = null;
204
+ function getCredentials() {
205
+ if (_cachedMid !== null && _cachedSec !== null) {
206
+ return { measurementId: _cachedMid, apiSecret: _cachedSec };
207
+ }
208
+ if (!telemetryConfig_1.ENC_MID || !telemetryConfig_1.ENC_SEC || !telemetryConfig_1.TELEMETRY_SALT) {
209
+ _cachedMid = '';
210
+ _cachedSec = '';
211
+ return { measurementId: '', apiSecret: '' };
212
+ }
213
+ try {
214
+ const keyMaterial = `${PKG_NAME}::${telemetryConfig_1.TELEMETRY_SALT}::${PKG_REPO}`;
215
+ const keyHex = sha256Hex(keyMaterial);
216
+ _cachedMid = aesGcmDecrypt(telemetryConfig_1.ENC_MID, telemetryConfig_1.ENC_MID_IV, telemetryConfig_1.ENC_MID_TAG, keyHex);
217
+ _cachedSec = aesGcmDecrypt(telemetryConfig_1.ENC_SEC, telemetryConfig_1.ENC_SEC_IV, telemetryConfig_1.ENC_SEC_TAG, keyHex);
218
+ }
219
+ catch {
220
+ _cachedMid = '';
221
+ _cachedSec = '';
222
+ }
223
+ return { measurementId: _cachedMid, apiSecret: _cachedSec };
224
+ }
225
+ function getCollectUrl() {
226
+ const { measurementId, apiSecret } = getCredentials();
227
+ if (!measurementId || !apiSecret)
228
+ return '';
229
+ return `https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`;
230
+ }
231
+ const PING_INTERVAL_MS = 24 * 60 * 60 * 1000;
232
+ let isTelemetryEnabled = true;
233
+ function setTelemetryEnabled(enabled) {
234
+ isTelemetryEnabled = enabled;
235
+ }
236
+ async function getOrCreateClientId() {
237
+ try {
238
+ const settings = await (0, settingsStore_1.loadSettings)();
239
+ if (settings.telemetryClientId) {
240
+ return settings.telemetryClientId;
241
+ }
242
+ const part1 = Math.floor(100000000 + Math.random() * 900000000);
243
+ const part2 = Math.floor(1000000000 + Math.random() * 9000000000);
244
+ const newId = `${part1}.${part2}`;
245
+ (0, settingsStore_1.saveSettings)({ ...settings, telemetryClientId: newId });
246
+ return newId;
247
+ }
248
+ catch {
249
+ return `${Math.floor(100000000 + Math.random() * 900000000)}.${Math.floor(1000000000 + Math.random() * 9000000000)}`;
250
+ }
251
+ }
252
+ function getSystemMetadata(environment) {
253
+ const rnConstants = react_native_1.Platform.constants;
254
+ const rnVersion = rnConstants?.reactNativeVersion
255
+ ? `${rnConstants.reactNativeVersion.major}.${rnConstants.reactNativeVersion.minor}.${rnConstants.reactNativeVersion.patch}`
256
+ : 'unknown';
257
+ const isHermes = Boolean(typeof global.HermesInternal === 'object' && global.HermesInternal !== null);
258
+ const isFabric = Boolean(global?.nativeFabricUIManager !== undefined);
259
+ const isDev = Boolean(typeof __DEV__ !== 'undefined' && __DEV__);
260
+ return {
261
+ lib_version: version_1.LIB_VERSION,
262
+ platform: react_native_1.Platform.OS,
263
+ os_version: String(react_native_1.Platform.Version || 'unknown'),
264
+ rn_version: rnVersion,
265
+ is_hermes: isHermes,
266
+ is_fabric: isFabric,
267
+ is_dev: isDev,
268
+ environment: environment || (isDev ? 'DEV' : 'PROD'),
269
+ engagement_time_msec: 1000,
270
+ };
271
+ }
272
+ async function trackActiveTelemetryHeartbeat(telemetryEnabled = true, environment) {
273
+ if (telemetryEnabled === false) {
274
+ isTelemetryEnabled = false;
275
+ return;
276
+ }
277
+ isTelemetryEnabled = true;
278
+ const url = getCollectUrl();
279
+ if (!url)
280
+ return;
281
+ try {
282
+ const settings = await (0, settingsStore_1.loadSettings)();
283
+ const lastPing = settings.telemetryLastPing || 0;
284
+ const now = Date.now();
285
+ if (now - lastPing < PING_INTERVAL_MS)
286
+ return;
287
+ const clientId = await getOrCreateClientId();
288
+ const params = getSystemMetadata(environment);
289
+ await fetch(url, {
290
+ method: 'POST',
291
+ headers: { 'Content-Type': 'application/json' },
292
+ body: JSON.stringify({
293
+ client_id: clientId,
294
+ non_personalized_ads: true,
295
+ events: [{ name: 'inspector_active_heartbeat', params }],
296
+ }),
297
+ });
298
+ (0, settingsStore_1.saveSettings)({ ...settings, telemetryLastPing: now });
299
+ }
300
+ catch {
301
+ }
302
+ }
@@ -1,8 +1,5 @@
1
1
  import React from 'react';
2
2
  type TranslationParams = Record<string, any>;
3
- /**
4
- * Standalone zero-dependency translation function
5
- */
6
3
  export declare function t(key: string, optionsOrFallback?: TranslationParams | string): string;
7
4
  export declare function setLanguage(lang: string): void;
8
5
  export declare function addTranslations(lang: string, translations: Record<string, any>): void;
@@ -16,9 +13,6 @@ export declare const i18n: {
16
13
  addTranslations: typeof addTranslations;
17
14
  setTranslations: typeof setTranslations;
18
15
  };
19
- /**
20
- * React hook compatible with react-i18next useTranslation()
21
- */
22
16
  export declare function useTranslation(): {
23
17
  t: typeof t;
24
18
  i18n: {
@@ -31,9 +25,6 @@ export declare function useTranslation(): {
31
25
  setTranslations: typeof setTranslations;
32
26
  };
33
27
  };
34
- /**
35
- * Backward-compatible I18nextProvider component
36
- */
37
28
  export declare const I18nextProvider: ({ children }: {
38
29
  children?: React.ReactNode;
39
30
  i18n?: any;
@@ -15,9 +15,6 @@ const localeRegistry = {
15
15
  en: en_json_1.default,
16
16
  };
17
17
  let currentLanguage = 'en';
18
- /**
19
- * Lightweight nested lookup for translation keys (e.g. "network.headers")
20
- */
21
18
  function lookupKey(obj, path) {
22
19
  if (!obj || !path)
23
20
  return undefined;
@@ -30,9 +27,6 @@ function lookupKey(obj, path) {
30
27
  }
31
28
  return current;
32
29
  }
33
- /**
34
- * Interpolates {{key}} placeholders in string templates
35
- */
36
30
  function interpolate(template, params) {
37
31
  if (!params || typeof template !== 'string')
38
32
  return template;
@@ -40,9 +34,6 @@ function interpolate(template, params) {
40
34
  return params[key] !== undefined ? String(params[key]) : `{{${key}}}`;
41
35
  });
42
36
  }
43
- /**
44
- * Standalone zero-dependency translation function
45
- */
46
37
  function t(key, optionsOrFallback) {
47
38
  const activeBundle = localeRegistry[currentLanguage] || localeRegistry.en;
48
39
  let raw = lookupKey(activeBundle, key);
@@ -86,18 +77,12 @@ exports.i18n = {
86
77
  addTranslations,
87
78
  setTranslations,
88
79
  };
89
- /**
90
- * React hook compatible with react-i18next useTranslation()
91
- */
92
80
  function useTranslation() {
93
81
  return {
94
82
  t,
95
83
  i18n: exports.i18n,
96
84
  };
97
85
  }
98
- /**
99
- * Backward-compatible I18nextProvider component
100
- */
101
86
  const I18nextProvider = ({ children }) => {
102
87
  return react_1.default.createElement(react_1.default.Fragment, null, children);
103
88
  };