react-native-monflowts 0.0.0-stage → 0.5.1

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 (479) hide show
  1. package/LICENSE +20 -0
  2. package/Monflowts.podspec +22 -0
  3. package/README.md +229 -2
  4. package/android/build.gradle +58 -0
  5. package/android/src/main/AndroidManifest.xml +8 -0
  6. package/android/src/main/java/com/monflowts/MonflowtsAssetsModule.kt +219 -0
  7. package/android/src/main/java/com/monflowts/MonflowtsCrashFeedModule.kt +175 -0
  8. package/android/src/main/java/com/monflowts/MonflowtsHapticModule.kt +170 -0
  9. package/android/src/main/java/com/monflowts/MonflowtsLottieView.kt +96 -0
  10. package/android/src/main/java/com/monflowts/MonflowtsLottieViewManager.kt +53 -0
  11. package/android/src/main/java/com/monflowts/MonflowtsPackage.kt +70 -0
  12. package/android/src/main/java/com/monflowts/MonflowtsSoundModule.kt +132 -0
  13. package/android/src/main/java/com/monflowts/MonflowtsSpeechModule.kt +81 -0
  14. package/android/src/main/java/com/monflowts/MonflowtsSvgView.kt +355 -0
  15. package/android/src/main/java/com/monflowts/MonflowtsSvgViewManager.kt +59 -0
  16. package/android/src/main/java/com/monflowts/MonflowtsWebView.kt +86 -0
  17. package/android/src/main/java/com/monflowts/MonflowtsWebViewManager.kt +33 -0
  18. package/android/src/main/java/com/monflowts/MonflowtsWheelView.kt +98 -0
  19. package/android/src/main/java/com/monflowts/MonflowtsWheelViewManager.kt +46 -0
  20. package/ios/Monflowts-Bridging-Header.h +5 -0
  21. package/ios/MonflowtsAssetsBridge.m +14 -0
  22. package/ios/MonflowtsAssetsModule.swift +217 -0
  23. package/ios/MonflowtsCrashFeedBridge.m +9 -0
  24. package/ios/MonflowtsCrashFeedModule.swift +88 -0
  25. package/ios/MonflowtsHTTP1EventSource.swift +296 -0
  26. package/ios/MonflowtsHapticBridge.m +8 -0
  27. package/ios/MonflowtsHapticModule.swift +55 -0
  28. package/ios/MonflowtsLottieBridge.m +12 -0
  29. package/ios/MonflowtsLottieUIView.swift +95 -0
  30. package/ios/MonflowtsLottieViewManager.swift +13 -0
  31. package/ios/MonflowtsSSEParser.swift +58 -0
  32. package/ios/MonflowtsSoundBridge.m +8 -0
  33. package/ios/MonflowtsSoundModule.swift +100 -0
  34. package/ios/MonflowtsSpeechBridge.m +9 -0
  35. package/ios/MonflowtsSpeechModule.swift +61 -0
  36. package/ios/MonflowtsSvgBridge.m +11 -0
  37. package/ios/MonflowtsSvgUIView.swift +431 -0
  38. package/ios/MonflowtsSvgViewManager.swift +13 -0
  39. package/ios/MonflowtsWebBridge.m +8 -0
  40. package/ios/MonflowtsWebUIView.swift +92 -0
  41. package/ios/MonflowtsWebViewManager.swift +14 -0
  42. package/ios/MonflowtsWheelBridge.m +7 -0
  43. package/ios/MonflowtsWheelUIView.swift +126 -0
  44. package/ios/MonflowtsWheelViewManager.swift +14 -0
  45. package/lib/module/HapticsManager.js +93 -0
  46. package/lib/module/HapticsManager.js.map +1 -0
  47. package/lib/module/HubContent.js +642 -0
  48. package/lib/module/HubContent.js.map +1 -0
  49. package/lib/module/Icons.js +64 -0
  50. package/lib/module/Icons.js.map +1 -0
  51. package/lib/module/MonflowtsHub.js +233 -0
  52. package/lib/module/MonflowtsHub.js.map +1 -0
  53. package/lib/module/NativeLottieView.js +6 -0
  54. package/lib/module/NativeLottieView.js.map +1 -0
  55. package/lib/module/NativeSvgView.js +6 -0
  56. package/lib/module/NativeSvgView.js.map +1 -0
  57. package/lib/module/NativeWebView.js +14 -0
  58. package/lib/module/NativeWebView.js.map +1 -0
  59. package/lib/module/NativeWheelView.js +6 -0
  60. package/lib/module/NativeWheelView.js.map +1 -0
  61. package/lib/module/SoundManager.js +120 -0
  62. package/lib/module/SoundManager.js.map +1 -0
  63. package/lib/module/SpeechManager.js +40 -0
  64. package/lib/module/SpeechManager.js.map +1 -0
  65. package/lib/module/api/client.js +109 -0
  66. package/lib/module/api/client.js.map +1 -0
  67. package/lib/module/api/gameTypes.js +2 -0
  68. package/lib/module/api/gameTypes.js.map +1 -0
  69. package/lib/module/api/http.js +252 -0
  70. package/lib/module/api/http.js.map +1 -0
  71. package/lib/module/api/mutations.js +359 -0
  72. package/lib/module/api/mutations.js.map +1 -0
  73. package/lib/module/api/playerTypes.js +2 -0
  74. package/lib/module/api/playerTypes.js.map +1 -0
  75. package/lib/module/api/queries.js +403 -0
  76. package/lib/module/api/queries.js.map +1 -0
  77. package/lib/module/api/sdkTypes.js +2 -0
  78. package/lib/module/api/sdkTypes.js.map +1 -0
  79. package/lib/module/assets/assetKeys.js +4 -0
  80. package/lib/module/assets/assetKeys.js.map +1 -0
  81. package/lib/module/assets/assetSync.js +61 -0
  82. package/lib/module/assets/assetSync.js.map +1 -0
  83. package/lib/module/assets/nativeAssets.js +25 -0
  84. package/lib/module/assets/nativeAssets.js.map +1 -0
  85. package/lib/module/assets/remote.js +47 -0
  86. package/lib/module/assets/remote.js.map +1 -0
  87. package/lib/module/components/AbandonPolicyNotice.js +200 -0
  88. package/lib/module/components/AbandonPolicyNotice.js.map +1 -0
  89. package/lib/module/components/AnimatedAmount.js +39 -0
  90. package/lib/module/components/AnimatedAmount.js.map +1 -0
  91. package/lib/module/components/CoinFlyOverlay.js +157 -0
  92. package/lib/module/components/CoinFlyOverlay.js.map +1 -0
  93. package/lib/module/components/GameCharacter.js +45 -0
  94. package/lib/module/components/GameCharacter.js.map +1 -0
  95. package/lib/module/components/GameRulesModal.js +279 -0
  96. package/lib/module/components/GameRulesModal.js.map +1 -0
  97. package/lib/module/components/HypeCallout.js +103 -0
  98. package/lib/module/components/HypeCallout.js.map +1 -0
  99. package/lib/module/components/InsufficientFundsOverlay.js +285 -0
  100. package/lib/module/components/InsufficientFundsOverlay.js.map +1 -0
  101. package/lib/module/components/JackpotNearMiss.js +89 -0
  102. package/lib/module/components/JackpotNearMiss.js.map +1 -0
  103. package/lib/module/components/JackpotTeaser.js +341 -0
  104. package/lib/module/components/JackpotTeaser.js.map +1 -0
  105. package/lib/module/components/MonflowtsButton.js +129 -0
  106. package/lib/module/components/MonflowtsButton.js.map +1 -0
  107. package/lib/module/components/MonflowtsChipGroup.js +40 -0
  108. package/lib/module/components/MonflowtsChipGroup.js.map +1 -0
  109. package/lib/module/components/MonflowtsPressable.js +42 -0
  110. package/lib/module/components/MonflowtsPressable.js.map +1 -0
  111. package/lib/module/components/QuitConfirmModal.js +180 -0
  112. package/lib/module/components/QuitConfirmModal.js.map +1 -0
  113. package/lib/module/components/SessionTimer.js +77 -0
  114. package/lib/module/components/SessionTimer.js.map +1 -0
  115. package/lib/module/components/SideDemoTab.js +110 -0
  116. package/lib/module/components/SideDemoTab.js.map +1 -0
  117. package/lib/module/components/StakeInput.js +138 -0
  118. package/lib/module/components/StakeInput.js.map +1 -0
  119. package/lib/module/constants.js +50 -0
  120. package/lib/module/constants.js.map +1 -0
  121. package/lib/module/content.js +21 -0
  122. package/lib/module/content.js.map +1 -0
  123. package/lib/module/effects/EffectBurst.js +56 -0
  124. package/lib/module/effects/EffectBurst.js.map +1 -0
  125. package/lib/module/effects/beaverStates.js +11 -0
  126. package/lib/module/effects/beaverStates.js.map +1 -0
  127. package/lib/module/effects/hypePhrases.js +67 -0
  128. package/lib/module/effects/hypePhrases.js.map +1 -0
  129. package/lib/module/effects/particleAnims.js +17 -0
  130. package/lib/module/effects/particleAnims.js.map +1 -0
  131. package/lib/module/hooks/useAvailableGames.js +29 -0
  132. package/lib/module/hooks/useAvailableGames.js.map +1 -0
  133. package/lib/module/hooks/useCrash.js +137 -0
  134. package/lib/module/hooks/useCrash.js.map +1 -0
  135. package/lib/module/hooks/useCrashFeed.js +49 -0
  136. package/lib/module/hooks/useCrashFeed.js.map +1 -0
  137. package/lib/module/hooks/useCurrency.js +13 -0
  138. package/lib/module/hooks/useCurrency.js.map +1 -0
  139. package/lib/module/hooks/useFairSeed.js +55 -0
  140. package/lib/module/hooks/useFairSeed.js.map +1 -0
  141. package/lib/module/hooks/useGameEvents.js +186 -0
  142. package/lib/module/hooks/useGameEvents.js.map +1 -0
  143. package/lib/module/hooks/useGameHistory.js +55 -0
  144. package/lib/module/hooks/useGameHistory.js.map +1 -0
  145. package/lib/module/hooks/useLeaderboard.js +83 -0
  146. package/lib/module/hooks/useLeaderboard.js.map +1 -0
  147. package/lib/module/hooks/useMines.js +166 -0
  148. package/lib/module/hooks/useMines.js.map +1 -0
  149. package/lib/module/hooks/useNotifications.js +66 -0
  150. package/lib/module/hooks/useNotifications.js.map +1 -0
  151. package/lib/module/hooks/usePlayGame.js +408 -0
  152. package/lib/module/hooks/usePlayGame.js.map +1 -0
  153. package/lib/module/hooks/usePlinko.js +75 -0
  154. package/lib/module/hooks/usePlinko.js.map +1 -0
  155. package/lib/module/hooks/useRaffleDrawState.js +57 -0
  156. package/lib/module/hooks/useRaffleDrawState.js.map +1 -0
  157. package/lib/module/hooks/useRefreshWallet.js +24 -0
  158. package/lib/module/hooks/useRefreshWallet.js.map +1 -0
  159. package/lib/module/hooks/useResponsive.js +16 -0
  160. package/lib/module/hooks/useResponsive.js.map +1 -0
  161. package/lib/module/hooks/useRevealWin.js +120 -0
  162. package/lib/module/hooks/useRevealWin.js.map +1 -0
  163. package/lib/module/hooks/useScreenShake.js +32 -0
  164. package/lib/module/hooks/useScreenShake.js.map +1 -0
  165. package/lib/module/hooks/useWallet.js +77 -0
  166. package/lib/module/hooks/useWallet.js.map +1 -0
  167. package/lib/module/i18n.js +104 -0
  168. package/lib/module/i18n.js.map +1 -0
  169. package/lib/module/index.js +22 -0
  170. package/lib/module/index.js.map +1 -0
  171. package/lib/module/lottieAnimations.js +15 -0
  172. package/lib/module/lottieAnimations.js.map +1 -0
  173. package/lib/module/package.json +1 -0
  174. package/lib/module/stores/assetStore.js +140 -0
  175. package/lib/module/stores/assetStore.js.map +1 -0
  176. package/lib/module/stores/authStore.js +47 -0
  177. package/lib/module/stores/authStore.js.map +1 -0
  178. package/lib/module/stores/gameStore.js +23 -0
  179. package/lib/module/stores/gameStore.js.map +1 -0
  180. package/lib/module/stores/sdkInitStore.js +155 -0
  181. package/lib/module/stores/sdkInitStore.js.map +1 -0
  182. package/lib/module/stores/settingsStore.js +40 -0
  183. package/lib/module/stores/settingsStore.js.map +1 -0
  184. package/lib/module/theme.js +160 -0
  185. package/lib/module/theme.js.map +1 -0
  186. package/lib/module/types.js +4 -0
  187. package/lib/module/types.js.map +1 -0
  188. package/lib/module/utils/apolloError.js +69 -0
  189. package/lib/module/utils/apolloError.js.map +1 -0
  190. package/lib/module/utils/crashMultiplier.js +8 -0
  191. package/lib/module/utils/crashMultiplier.js.map +1 -0
  192. package/lib/module/utils/crashMultiplier.test.js +34 -0
  193. package/lib/module/utils/crashMultiplier.test.js.map +1 -0
  194. package/lib/module/utils/deviceAnalytics.js +51 -0
  195. package/lib/module/utils/deviceAnalytics.js.map +1 -0
  196. package/lib/module/utils/idempotency.js +66 -0
  197. package/lib/module/utils/idempotency.js.map +1 -0
  198. package/lib/module/utils/layout.js +14 -0
  199. package/lib/module/utils/layout.js.map +1 -0
  200. package/lib/module/utils/safeInlineScript.js +12 -0
  201. package/lib/module/utils/safeInlineScript.js.map +1 -0
  202. package/lib/module/utils/sseClient.js +40 -0
  203. package/lib/module/utils/sseClient.js.map +1 -0
  204. package/lib/module/views/DepositSelect.js +275 -0
  205. package/lib/module/views/DepositSelect.js.map +1 -0
  206. package/lib/module/views/Dice.js +111 -0
  207. package/lib/module/views/Dice.js.map +1 -0
  208. package/lib/module/views/DiceBattle.js +815 -0
  209. package/lib/module/views/DiceBattle.js.map +1 -0
  210. package/lib/module/views/DiceLobby.js +577 -0
  211. package/lib/module/views/DiceLobby.js.map +1 -0
  212. package/lib/module/views/FortuneWheel.js +892 -0
  213. package/lib/module/views/FortuneWheel.js.map +1 -0
  214. package/lib/module/views/Freefall.js +808 -0
  215. package/lib/module/views/Freefall.js.map +1 -0
  216. package/lib/module/views/History.js +366 -0
  217. package/lib/module/views/History.js.map +1 -0
  218. package/lib/module/views/Home.js +554 -0
  219. package/lib/module/views/Home.js.map +1 -0
  220. package/lib/module/views/Jetstream.js +889 -0
  221. package/lib/module/views/Jetstream.js.map +1 -0
  222. package/lib/module/views/Leaderboard.js +1206 -0
  223. package/lib/module/views/Leaderboard.js.map +1 -0
  224. package/lib/module/views/MillionaireHunter.js +1697 -0
  225. package/lib/module/views/MillionaireHunter.js.map +1 -0
  226. package/lib/module/views/Minefield.js +826 -0
  227. package/lib/module/views/Minefield.js.map +1 -0
  228. package/lib/module/views/PaymentWebView.js +546 -0
  229. package/lib/module/views/PaymentWebView.js.map +1 -0
  230. package/lib/module/views/PlayerCard.js +184 -0
  231. package/lib/module/views/PlayerCard.js.map +1 -0
  232. package/lib/module/views/Profile.js +531 -0
  233. package/lib/module/views/Profile.js.map +1 -0
  234. package/lib/module/views/RaffleDraw.js +1242 -0
  235. package/lib/module/views/RaffleDraw.js.map +1 -0
  236. package/lib/module/views/RevealWin.js +1267 -0
  237. package/lib/module/views/RevealWin.js.map +1 -0
  238. package/lib/module/views/Splash.js +370 -0
  239. package/lib/module/views/Splash.js.map +1 -0
  240. package/lib/module/views/Success.js +363 -0
  241. package/lib/module/views/Success.js.map +1 -0
  242. package/lib/module/views/TicketShop.js +372 -0
  243. package/lib/module/views/TicketShop.js.map +1 -0
  244. package/lib/module/views/TriviaLobby.js +582 -0
  245. package/lib/module/views/TriviaLobby.js.map +1 -0
  246. package/lib/module/views/TriviaMaster.js +884 -0
  247. package/lib/module/views/TriviaMaster.js.map +1 -0
  248. package/lib/module/views/Wallet.js +622 -0
  249. package/lib/module/views/Wallet.js.map +1 -0
  250. package/lib/module/views/WithdrawFlow.js +445 -0
  251. package/lib/module/views/WithdrawFlow.js.map +1 -0
  252. package/lib/module/views/gridGeometry.js +26 -0
  253. package/lib/module/views/gridGeometry.js.map +1 -0
  254. package/lib/module/views/revealWinHelpers.js +29 -0
  255. package/lib/module/views/revealWinHelpers.js.map +1 -0
  256. package/lib/module/views/ticketBundlePresets.js +29 -0
  257. package/lib/module/views/ticketBundlePresets.js.map +1 -0
  258. package/lib/module/views/triviaHelpers.js +78 -0
  259. package/lib/module/views/triviaHelpers.js.map +1 -0
  260. package/lib/module/voiceClips.js +16 -0
  261. package/lib/module/voiceClips.js.map +1 -0
  262. package/lib/typescript/package.json +1 -0
  263. package/lib/typescript/src/HapticsManager.d.ts +28 -0
  264. package/lib/typescript/src/HapticsManager.d.ts.map +1 -0
  265. package/lib/typescript/src/HubContent.d.ts +7 -0
  266. package/lib/typescript/src/HubContent.d.ts.map +1 -0
  267. package/lib/typescript/src/Icons.d.ts +14 -0
  268. package/lib/typescript/src/Icons.d.ts.map +1 -0
  269. package/lib/typescript/src/MonflowtsHub.d.ts +5 -0
  270. package/lib/typescript/src/MonflowtsHub.d.ts.map +1 -0
  271. package/lib/typescript/src/NativeLottieView.d.ts +13 -0
  272. package/lib/typescript/src/NativeLottieView.d.ts.map +1 -0
  273. package/lib/typescript/src/NativeSvgView.d.ts +12 -0
  274. package/lib/typescript/src/NativeSvgView.d.ts.map +1 -0
  275. package/lib/typescript/src/NativeWebView.d.ts +22 -0
  276. package/lib/typescript/src/NativeWebView.d.ts.map +1 -0
  277. package/lib/typescript/src/NativeWheelView.d.ts +9 -0
  278. package/lib/typescript/src/NativeWheelView.d.ts.map +1 -0
  279. package/lib/typescript/src/SoundManager.d.ts +29 -0
  280. package/lib/typescript/src/SoundManager.d.ts.map +1 -0
  281. package/lib/typescript/src/SpeechManager.d.ts +10 -0
  282. package/lib/typescript/src/SpeechManager.d.ts.map +1 -0
  283. package/lib/typescript/src/api/client.d.ts +7 -0
  284. package/lib/typescript/src/api/client.d.ts.map +1 -0
  285. package/lib/typescript/src/api/gameTypes.d.ts +326 -0
  286. package/lib/typescript/src/api/gameTypes.d.ts.map +1 -0
  287. package/lib/typescript/src/api/http.d.ts +61 -0
  288. package/lib/typescript/src/api/http.d.ts.map +1 -0
  289. package/lib/typescript/src/api/mutations.d.ts +22 -0
  290. package/lib/typescript/src/api/mutations.d.ts.map +1 -0
  291. package/lib/typescript/src/api/playerTypes.d.ts +53 -0
  292. package/lib/typescript/src/api/playerTypes.d.ts.map +1 -0
  293. package/lib/typescript/src/api/queries.d.ts +21 -0
  294. package/lib/typescript/src/api/queries.d.ts.map +1 -0
  295. package/lib/typescript/src/api/sdkTypes.d.ts +87 -0
  296. package/lib/typescript/src/api/sdkTypes.d.ts.map +1 -0
  297. package/lib/typescript/src/assets/assetKeys.d.ts +3 -0
  298. package/lib/typescript/src/assets/assetKeys.d.ts.map +1 -0
  299. package/lib/typescript/src/assets/assetSync.d.ts +41 -0
  300. package/lib/typescript/src/assets/assetSync.d.ts.map +1 -0
  301. package/lib/typescript/src/assets/nativeAssets.d.ts +30 -0
  302. package/lib/typescript/src/assets/nativeAssets.d.ts.map +1 -0
  303. package/lib/typescript/src/assets/remote.d.ts +8 -0
  304. package/lib/typescript/src/assets/remote.d.ts.map +1 -0
  305. package/lib/typescript/src/components/AbandonPolicyNotice.d.ts +16 -0
  306. package/lib/typescript/src/components/AbandonPolicyNotice.d.ts.map +1 -0
  307. package/lib/typescript/src/components/AnimatedAmount.d.ts +12 -0
  308. package/lib/typescript/src/components/AnimatedAmount.d.ts.map +1 -0
  309. package/lib/typescript/src/components/CoinFlyOverlay.d.ts +17 -0
  310. package/lib/typescript/src/components/CoinFlyOverlay.d.ts.map +1 -0
  311. package/lib/typescript/src/components/GameCharacter.d.ts +14 -0
  312. package/lib/typescript/src/components/GameCharacter.d.ts.map +1 -0
  313. package/lib/typescript/src/components/GameRulesModal.d.ts +10 -0
  314. package/lib/typescript/src/components/GameRulesModal.d.ts.map +1 -0
  315. package/lib/typescript/src/components/HypeCallout.d.ts +11 -0
  316. package/lib/typescript/src/components/HypeCallout.d.ts.map +1 -0
  317. package/lib/typescript/src/components/InsufficientFundsOverlay.d.ts +12 -0
  318. package/lib/typescript/src/components/InsufficientFundsOverlay.d.ts.map +1 -0
  319. package/lib/typescript/src/components/JackpotNearMiss.d.ts +8 -0
  320. package/lib/typescript/src/components/JackpotNearMiss.d.ts.map +1 -0
  321. package/lib/typescript/src/components/JackpotTeaser.d.ts +13 -0
  322. package/lib/typescript/src/components/JackpotTeaser.d.ts.map +1 -0
  323. package/lib/typescript/src/components/MonflowtsButton.d.ts +21 -0
  324. package/lib/typescript/src/components/MonflowtsButton.d.ts.map +1 -0
  325. package/lib/typescript/src/components/MonflowtsChipGroup.d.ts +18 -0
  326. package/lib/typescript/src/components/MonflowtsChipGroup.d.ts.map +1 -0
  327. package/lib/typescript/src/components/MonflowtsPressable.d.ts +39 -0
  328. package/lib/typescript/src/components/MonflowtsPressable.d.ts.map +1 -0
  329. package/lib/typescript/src/components/QuitConfirmModal.d.ts +11 -0
  330. package/lib/typescript/src/components/QuitConfirmModal.d.ts.map +1 -0
  331. package/lib/typescript/src/components/SessionTimer.d.ts +14 -0
  332. package/lib/typescript/src/components/SessionTimer.d.ts.map +1 -0
  333. package/lib/typescript/src/components/SideDemoTab.d.ts +18 -0
  334. package/lib/typescript/src/components/SideDemoTab.d.ts.map +1 -0
  335. package/lib/typescript/src/components/StakeInput.d.ts +16 -0
  336. package/lib/typescript/src/components/StakeInput.d.ts.map +1 -0
  337. package/lib/typescript/src/constants.d.ts +21 -0
  338. package/lib/typescript/src/constants.d.ts.map +1 -0
  339. package/lib/typescript/src/content.d.ts +53 -0
  340. package/lib/typescript/src/content.d.ts.map +1 -0
  341. package/lib/typescript/src/effects/EffectBurst.d.ts +20 -0
  342. package/lib/typescript/src/effects/EffectBurst.d.ts.map +1 -0
  343. package/lib/typescript/src/effects/beaverStates.d.ts +4 -0
  344. package/lib/typescript/src/effects/beaverStates.d.ts.map +1 -0
  345. package/lib/typescript/src/effects/hypePhrases.d.ts +11 -0
  346. package/lib/typescript/src/effects/hypePhrases.d.ts.map +1 -0
  347. package/lib/typescript/src/effects/particleAnims.d.ts +9 -0
  348. package/lib/typescript/src/effects/particleAnims.d.ts.map +1 -0
  349. package/lib/typescript/src/hooks/useAvailableGames.d.ts +14 -0
  350. package/lib/typescript/src/hooks/useAvailableGames.d.ts.map +1 -0
  351. package/lib/typescript/src/hooks/useCrash.d.ts +13 -0
  352. package/lib/typescript/src/hooks/useCrash.d.ts.map +1 -0
  353. package/lib/typescript/src/hooks/useCrashFeed.d.ts +22 -0
  354. package/lib/typescript/src/hooks/useCrashFeed.d.ts.map +1 -0
  355. package/lib/typescript/src/hooks/useCurrency.d.ts +6 -0
  356. package/lib/typescript/src/hooks/useCurrency.d.ts.map +1 -0
  357. package/lib/typescript/src/hooks/useFairSeed.d.ts +8 -0
  358. package/lib/typescript/src/hooks/useFairSeed.d.ts.map +1 -0
  359. package/lib/typescript/src/hooks/useGameEvents.d.ts +50 -0
  360. package/lib/typescript/src/hooks/useGameEvents.d.ts.map +1 -0
  361. package/lib/typescript/src/hooks/useGameHistory.d.ts +14 -0
  362. package/lib/typescript/src/hooks/useGameHistory.d.ts.map +1 -0
  363. package/lib/typescript/src/hooks/useLeaderboard.d.ts +71 -0
  364. package/lib/typescript/src/hooks/useLeaderboard.d.ts.map +1 -0
  365. package/lib/typescript/src/hooks/useMines.d.ts +11 -0
  366. package/lib/typescript/src/hooks/useMines.d.ts.map +1 -0
  367. package/lib/typescript/src/hooks/useNotifications.d.ts +26 -0
  368. package/lib/typescript/src/hooks/useNotifications.d.ts.map +1 -0
  369. package/lib/typescript/src/hooks/usePlayGame.d.ts +62 -0
  370. package/lib/typescript/src/hooks/usePlayGame.d.ts.map +1 -0
  371. package/lib/typescript/src/hooks/usePlinko.d.ts +8 -0
  372. package/lib/typescript/src/hooks/usePlinko.d.ts.map +1 -0
  373. package/lib/typescript/src/hooks/useRaffleDrawState.d.ts +50 -0
  374. package/lib/typescript/src/hooks/useRaffleDrawState.d.ts.map +1 -0
  375. package/lib/typescript/src/hooks/useRefreshWallet.d.ts +8 -0
  376. package/lib/typescript/src/hooks/useRefreshWallet.d.ts.map +1 -0
  377. package/lib/typescript/src/hooks/useResponsive.d.ts +8 -0
  378. package/lib/typescript/src/hooks/useResponsive.d.ts.map +1 -0
  379. package/lib/typescript/src/hooks/useRevealWin.d.ts +10 -0
  380. package/lib/typescript/src/hooks/useRevealWin.d.ts.map +1 -0
  381. package/lib/typescript/src/hooks/useScreenShake.d.ts +14 -0
  382. package/lib/typescript/src/hooks/useScreenShake.d.ts.map +1 -0
  383. package/lib/typescript/src/hooks/useWallet.d.ts +23 -0
  384. package/lib/typescript/src/hooks/useWallet.d.ts.map +1 -0
  385. package/lib/typescript/src/i18n.d.ts +29 -0
  386. package/lib/typescript/src/i18n.d.ts.map +1 -0
  387. package/lib/typescript/src/index.d.ts +12 -0
  388. package/lib/typescript/src/index.d.ts.map +1 -0
  389. package/lib/typescript/src/lottieAnimations.d.ts +2 -0
  390. package/lib/typescript/src/lottieAnimations.d.ts.map +1 -0
  391. package/lib/typescript/src/stores/assetStore.d.ts +17 -0
  392. package/lib/typescript/src/stores/assetStore.d.ts.map +1 -0
  393. package/lib/typescript/src/stores/authStore.d.ts +25 -0
  394. package/lib/typescript/src/stores/authStore.d.ts.map +1 -0
  395. package/lib/typescript/src/stores/gameStore.d.ts +14 -0
  396. package/lib/typescript/src/stores/gameStore.d.ts.map +1 -0
  397. package/lib/typescript/src/stores/sdkInitStore.d.ts +38 -0
  398. package/lib/typescript/src/stores/sdkInitStore.d.ts.map +1 -0
  399. package/lib/typescript/src/stores/settingsStore.d.ts +23 -0
  400. package/lib/typescript/src/stores/settingsStore.d.ts.map +1 -0
  401. package/lib/typescript/src/theme.d.ts +149 -0
  402. package/lib/typescript/src/theme.d.ts.map +1 -0
  403. package/lib/typescript/src/types.d.ts +49 -0
  404. package/lib/typescript/src/types.d.ts.map +1 -0
  405. package/lib/typescript/src/utils/apolloError.d.ts +12 -0
  406. package/lib/typescript/src/utils/apolloError.d.ts.map +1 -0
  407. package/lib/typescript/src/utils/crashMultiplier.d.ts +2 -0
  408. package/lib/typescript/src/utils/crashMultiplier.d.ts.map +1 -0
  409. package/lib/typescript/src/utils/crashMultiplier.test.d.ts +2 -0
  410. package/lib/typescript/src/utils/crashMultiplier.test.d.ts.map +1 -0
  411. package/lib/typescript/src/utils/deviceAnalytics.d.ts +3 -0
  412. package/lib/typescript/src/utils/deviceAnalytics.d.ts.map +1 -0
  413. package/lib/typescript/src/utils/idempotency.d.ts +14 -0
  414. package/lib/typescript/src/utils/idempotency.d.ts.map +1 -0
  415. package/lib/typescript/src/utils/layout.d.ts +10 -0
  416. package/lib/typescript/src/utils/layout.d.ts.map +1 -0
  417. package/lib/typescript/src/utils/safeInlineScript.d.ts +5 -0
  418. package/lib/typescript/src/utils/safeInlineScript.d.ts.map +1 -0
  419. package/lib/typescript/src/utils/sseClient.d.ts +5 -0
  420. package/lib/typescript/src/utils/sseClient.d.ts.map +1 -0
  421. package/lib/typescript/src/views/DepositSelect.d.ts +9 -0
  422. package/lib/typescript/src/views/DepositSelect.d.ts.map +1 -0
  423. package/lib/typescript/src/views/Dice.d.ts +10 -0
  424. package/lib/typescript/src/views/Dice.d.ts.map +1 -0
  425. package/lib/typescript/src/views/DiceBattle.d.ts +15 -0
  426. package/lib/typescript/src/views/DiceBattle.d.ts.map +1 -0
  427. package/lib/typescript/src/views/DiceLobby.d.ts +12 -0
  428. package/lib/typescript/src/views/DiceLobby.d.ts.map +1 -0
  429. package/lib/typescript/src/views/FortuneWheel.d.ts +13 -0
  430. package/lib/typescript/src/views/FortuneWheel.d.ts.map +1 -0
  431. package/lib/typescript/src/views/Freefall.d.ts +13 -0
  432. package/lib/typescript/src/views/Freefall.d.ts.map +1 -0
  433. package/lib/typescript/src/views/History.d.ts +7 -0
  434. package/lib/typescript/src/views/History.d.ts.map +1 -0
  435. package/lib/typescript/src/views/Home.d.ts +13 -0
  436. package/lib/typescript/src/views/Home.d.ts.map +1 -0
  437. package/lib/typescript/src/views/Jetstream.d.ts +14 -0
  438. package/lib/typescript/src/views/Jetstream.d.ts.map +1 -0
  439. package/lib/typescript/src/views/Leaderboard.d.ts +8 -0
  440. package/lib/typescript/src/views/Leaderboard.d.ts.map +1 -0
  441. package/lib/typescript/src/views/MillionaireHunter.d.ts +13 -0
  442. package/lib/typescript/src/views/MillionaireHunter.d.ts.map +1 -0
  443. package/lib/typescript/src/views/Minefield.d.ts +13 -0
  444. package/lib/typescript/src/views/Minefield.d.ts.map +1 -0
  445. package/lib/typescript/src/views/PaymentWebView.d.ts +29 -0
  446. package/lib/typescript/src/views/PaymentWebView.d.ts.map +1 -0
  447. package/lib/typescript/src/views/PlayerCard.d.ts +15 -0
  448. package/lib/typescript/src/views/PlayerCard.d.ts.map +1 -0
  449. package/lib/typescript/src/views/Profile.d.ts +9 -0
  450. package/lib/typescript/src/views/Profile.d.ts.map +1 -0
  451. package/lib/typescript/src/views/RaffleDraw.d.ts +12 -0
  452. package/lib/typescript/src/views/RaffleDraw.d.ts.map +1 -0
  453. package/lib/typescript/src/views/RevealWin.d.ts +13 -0
  454. package/lib/typescript/src/views/RevealWin.d.ts.map +1 -0
  455. package/lib/typescript/src/views/Splash.d.ts +10 -0
  456. package/lib/typescript/src/views/Splash.d.ts.map +1 -0
  457. package/lib/typescript/src/views/Success.d.ts +12 -0
  458. package/lib/typescript/src/views/Success.d.ts.map +1 -0
  459. package/lib/typescript/src/views/TicketShop.d.ts +15 -0
  460. package/lib/typescript/src/views/TicketShop.d.ts.map +1 -0
  461. package/lib/typescript/src/views/TriviaLobby.d.ts +12 -0
  462. package/lib/typescript/src/views/TriviaLobby.d.ts.map +1 -0
  463. package/lib/typescript/src/views/TriviaMaster.d.ts +16 -0
  464. package/lib/typescript/src/views/TriviaMaster.d.ts.map +1 -0
  465. package/lib/typescript/src/views/Wallet.d.ts +10 -0
  466. package/lib/typescript/src/views/Wallet.d.ts.map +1 -0
  467. package/lib/typescript/src/views/WithdrawFlow.d.ts +9 -0
  468. package/lib/typescript/src/views/WithdrawFlow.d.ts.map +1 -0
  469. package/lib/typescript/src/views/gridGeometry.d.ts +19 -0
  470. package/lib/typescript/src/views/gridGeometry.d.ts.map +1 -0
  471. package/lib/typescript/src/views/revealWinHelpers.d.ts +15 -0
  472. package/lib/typescript/src/views/revealWinHelpers.d.ts.map +1 -0
  473. package/lib/typescript/src/views/ticketBundlePresets.d.ts +18 -0
  474. package/lib/typescript/src/views/ticketBundlePresets.d.ts.map +1 -0
  475. package/lib/typescript/src/views/triviaHelpers.d.ts +31 -0
  476. package/lib/typescript/src/views/triviaHelpers.d.ts.map +1 -0
  477. package/lib/typescript/src/voiceClips.d.ts +4 -0
  478. package/lib/typescript/src/voiceClips.d.ts.map +1 -0
  479. package/package.json +160 -4
@@ -0,0 +1,884 @@
1
+ "use strict";
2
+
3
+ import React, { useState, useEffect, useRef, useCallback, useMemo } from 'react';
4
+ import { View, Text, StyleSheet, Animated, Alert, BackHandler, ScrollView } from 'react-native';
5
+ import CoinFlyOverlay from "../components/CoinFlyOverlay.js";
6
+ import MonflowtsPressable from "../components/MonflowtsPressable.js";
7
+ import { COLORS } from "../constants.js";
8
+ import { sounds } from "../SoundManager.js";
9
+ import HypeCallout from "../components/HypeCallout.js";
10
+ import QuitConfirmModal from "../components/QuitConfirmModal.js";
11
+ import { HYPE_PHRASES, pickPhrase } from "../effects/hypePhrases.js";
12
+ import SvgIcon from "../Icons.js";
13
+ import MonflowtsButton from "../components/MonflowtsButton.js";
14
+ import SideDemoTab from "../components/SideDemoTab.js";
15
+ import { useFastFinger } from "../hooks/usePlayGame.js";
16
+ import { useCurrency } from "../hooks/useCurrency.js";
17
+ import { useGameStore } from "../stores/gameStore.js";
18
+ import { gameRules, randomMessageKey } from "../content.js";
19
+ import { t, formatNumber, errorText } from "../i18n.js";
20
+ import { buildTriviaAnswerPayload, canSubmitTriviaAnswer, resolveNextTriviaQuestion } from "./triviaHelpers.js";
21
+ import InsufficientFundsOverlay from "../components/InsufficientFundsOverlay.js";
22
+ import GameRulesModal from "../components/GameRulesModal.js";
23
+ import JackpotNearMiss from "../components/JackpotNearMiss.js";
24
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
25
+ const TriviaMaster = ({
26
+ onBack,
27
+ initialStake,
28
+ stakeCount = 1,
29
+ categoryId,
30
+ onWin,
31
+ onLose,
32
+ balance,
33
+ game,
34
+ onTopUp
35
+ }) => {
36
+ const currency = useCurrency();
37
+ const [currentQ, setCurrentQ] = useState(0);
38
+ const fallbackRules = gameRules('FAST_FINGER');
39
+ const [totalQuestions, setTotalQuestions] = useState(fallbackRules.questionCount ?? 0);
40
+ const [selected, setSelected] = useState(null);
41
+ const [score, setScore] = useState(0);
42
+ const [timeLeft, setTimeLeft] = useState(fallbackRules.timeLimitSeconds ?? 0);
43
+ const [gameOver, setGameOver] = useState(false);
44
+ const [sessionStarted, setSessionStarted] = useState(false);
45
+ const [showResult, setShowResult] = useState(false);
46
+ const [correctIndex, setCorrectIndex] = useState(null);
47
+ const [questionText, setQuestionText] = useState('');
48
+ const [options, setOptions] = useState([]);
49
+ const [finalWinAmount, setFinalWinAmount] = useState(0);
50
+ const [showFundsOverlay, setShowFundsOverlay] = useState(false);
51
+ const [rulesVisible, setRulesVisible] = useState(false);
52
+ const [serverPassed, setServerPassed] = useState(undefined);
53
+ const timerProgress = useRef(new Animated.Value(1)).current;
54
+ const gamePlayIdRef = useRef(null);
55
+ const allQuestionsRef = useRef([]);
56
+ const timeLimitRef = useRef(fallbackRules.timeLimitSeconds ?? 0);
57
+ const {
58
+ startSession,
59
+ answerQuestion,
60
+ forfeit,
61
+ endSession
62
+ } = useFastFinger();
63
+ const demoMode = useGameStore(s => s.demoMode);
64
+ const debitDemoBalance = useGameStore(s => s.debitDemoBalance);
65
+
66
+ // ── Multi-session state ──
67
+ const isMultiRound = stakeCount > 1;
68
+ const [currentRound, setCurrentRound] = useState(1);
69
+ const [_sessionTotalWon, setSessionTotalWon] = useState(0);
70
+ const sessionTotalWonRef = useRef(0);
71
+ const [sessionRoundWins, setSessionRoundWins] = useState(0);
72
+ const [_sessionComplete, setSessionComplete] = useState(false);
73
+
74
+ // Coin fly animation refs
75
+ const coinFlyTargetRef = useRef(null);
76
+ const questionCardRef = useRef(null);
77
+ const coinFlyRef = useRef(null);
78
+ const hypeRef = useRef(null);
79
+ const balancePulse = useRef(new Animated.Value(1)).current;
80
+ const [coinFlyDone, setCoinFlyDone] = useState(false);
81
+ const handleSubmitRef = useRef(() => {});
82
+ const timerAnimationRef = useRef(null);
83
+ const timerIntervalRef = useRef(null);
84
+ const transitionTimeoutRef = useRef(null);
85
+ const nextRoundTimeoutRef = useRef(null);
86
+ const submissionLockedRef = useRef(false);
87
+ const clearTriviaTimer = useCallback(() => {
88
+ if (timerIntervalRef.current) {
89
+ clearInterval(timerIntervalRef.current);
90
+ timerIntervalRef.current = null;
91
+ }
92
+ if (timerAnimationRef.current) {
93
+ timerAnimationRef.current.stop();
94
+ timerAnimationRef.current = null;
95
+ }
96
+ }, []);
97
+ const clearPendingTransitions = useCallback(() => {
98
+ if (transitionTimeoutRef.current) {
99
+ clearTimeout(transitionTimeoutRef.current);
100
+ transitionTimeoutRef.current = null;
101
+ }
102
+ if (nextRoundTimeoutRef.current) {
103
+ clearTimeout(nextRoundTimeoutRef.current);
104
+ nextRoundTimeoutRef.current = null;
105
+ }
106
+ }, []);
107
+
108
+ // ── Start session on mount ──
109
+ useEffect(() => {
110
+ if (sessionStarted || !game) return;
111
+ setSessionStarted(true);
112
+ (async () => {
113
+ try {
114
+ const session = await startSession({
115
+ categoryId,
116
+ stakeAmountKobo: initialStake * 100
117
+ });
118
+ if (session) {
119
+ if (demoMode) debitDemoBalance(initialStake);
120
+ gamePlayIdRef.current = session.gamePlayId;
121
+ allQuestionsRef.current = session.questions;
122
+ submissionLockedRef.current = false;
123
+ const limit = session.timeLimitSeconds || (gameRules('FAST_FINGER').timeLimitSeconds ?? 0);
124
+ timeLimitRef.current = limit;
125
+ setTotalQuestions(session.questionCount);
126
+ // Show first question
127
+ const firstQ = session.questions[0];
128
+ if (firstQ) {
129
+ setQuestionText(firstQ.questionText);
130
+ setOptions(firstQ.options);
131
+ }
132
+ setTimeLeft(limit);
133
+ }
134
+ } catch (err) {
135
+ const msg = (err?.message || '').toLowerCase();
136
+ if (msg.includes('insufficient') || msg.includes('balance')) {
137
+ setShowFundsOverlay(true);
138
+ } else {
139
+ Alert.alert(t('trivia.startFailed.title'), errorText(err, 'trivia.startFailed.message'), [{
140
+ text: t('trivia.startFailed.goBack'),
141
+ onPress: onBack
142
+ }]);
143
+ }
144
+ }
145
+ })();
146
+ }, [sessionStarted, game, categoryId, startSession, onBack, demoMode, debitDemoBalance, initialStake]);
147
+
148
+ // ── Forfeit confirmation on back press ──
149
+ const [quitVisible, setQuitVisible] = useState(false);
150
+ const handleBackPress = useCallback(() => {
151
+ if (gameOver) {
152
+ onBack();
153
+ return;
154
+ }
155
+ setQuitVisible(true);
156
+ }, [gameOver, onBack]);
157
+ const handleForfeitQuit = useCallback(async () => {
158
+ setQuitVisible(false);
159
+ if (gamePlayIdRef.current) {
160
+ try {
161
+ await forfeit(gamePlayIdRef.current);
162
+ } catch {/* ignore */}
163
+ }
164
+ endSession();
165
+ onLose?.();
166
+ onBack();
167
+ }, [forfeit, endSession, onLose, onBack]);
168
+
169
+ // Handle Android hardware back button
170
+ useEffect(() => {
171
+ const sub = BackHandler.addEventListener('hardwareBackPress', () => {
172
+ handleBackPress();
173
+ return true;
174
+ });
175
+ return () => sub.remove();
176
+ }, [handleBackPress]);
177
+
178
+ // ── Timer countdown ──
179
+ useEffect(() => {
180
+ clearTriviaTimer();
181
+ if (gameOver || showResult || !questionText) return;
182
+ const limit = timeLimitRef.current;
183
+ timerProgress.setValue(1);
184
+ timerAnimationRef.current = Animated.timing(timerProgress, {
185
+ toValue: 0,
186
+ duration: limit * 1000,
187
+ useNativeDriver: false
188
+ });
189
+ timerAnimationRef.current.start();
190
+ setTimeLeft(limit);
191
+ let remaining = limit;
192
+ timerIntervalRef.current = setInterval(() => {
193
+ remaining -= 1;
194
+ setTimeLeft(remaining);
195
+ if (remaining <= 0) {
196
+ clearTriviaTimer();
197
+ handleSubmitRef.current(-1);
198
+ return;
199
+ }
200
+ if (remaining <= 4) sounds.playCountdownTick();
201
+ }, 1000);
202
+ return clearTriviaTimer;
203
+ }, [currentQ, gameOver, questionText, showResult, clearTriviaTimer, timerProgress]);
204
+ useEffect(() => () => {
205
+ clearTriviaTimer();
206
+ clearPendingTransitions();
207
+ }, [clearPendingTransitions, clearTriviaTimer]);
208
+ const handleSubmit = useCallback(async answerIdx => {
209
+ if (!canSubmitTriviaAnswer({
210
+ gamePlayId: gamePlayIdRef.current,
211
+ submissionLocked: submissionLockedRef.current,
212
+ showResult
213
+ })) return;
214
+ submissionLockedRef.current = true;
215
+ clearTriviaTimer();
216
+ setShowResult(true);
217
+ setSelected(answerIdx >= 0 ? answerIdx : null);
218
+ const answerPayload = buildTriviaAnswerPayload(answerIdx);
219
+ const activeGamePlayId = gamePlayIdRef.current;
220
+ if (!activeGamePlayId) {
221
+ submissionLockedRef.current = false;
222
+ setShowResult(false);
223
+ return;
224
+ }
225
+ try {
226
+ const result = await answerQuestion(activeGamePlayId, currentQ, answerPayload.selectedOptionIndex);
227
+ if (result) {
228
+ const isCorrect = answerIdx >= 0 && result.correct;
229
+ setCorrectIndex(result.correctOptionIndex);
230
+ if (isCorrect) {
231
+ sounds.playWinChime();
232
+ setScore(result.correctCount);
233
+ hypeRef.current?.show(pickPhrase(HYPE_PHRASES.trivia.win), 'win');
234
+ } else {
235
+ sounds.playDrawSound();
236
+ setScore(result.correctCount);
237
+ hypeRef.current?.show(pickPhrase(HYPE_PHRASES.trivia.loss), 'loss');
238
+ }
239
+ transitionTimeoutRef.current = setTimeout(() => {
240
+ transitionTimeoutRef.current = null;
241
+ if (!result.sessionComplete) {
242
+ const nextQ = resolveNextTriviaQuestion({
243
+ result,
244
+ currentQuestionIndex: currentQ,
245
+ questions: allQuestionsRef.current
246
+ });
247
+ setCurrentQ(c => c + 1);
248
+ setSelected(null);
249
+ setCorrectIndex(null);
250
+ setShowResult(false);
251
+ submissionLockedRef.current = false;
252
+ if (nextQ) {
253
+ setQuestionText(nextQ.questionText);
254
+ setOptions(nextQ.options);
255
+ }
256
+ } else {
257
+ // Session complete
258
+ const amountWon = (result.amountWonKobo ?? 0) / 100;
259
+ if (isMultiRound && currentRound < stakeCount) {
260
+ // Track this round's win
261
+ sessionTotalWonRef.current += amountWon;
262
+ setSessionTotalWon(sessionTotalWonRef.current);
263
+ if (amountWon > 0) setSessionRoundWins(w => w + 1);
264
+
265
+ // Refresh wallet for next round
266
+ onLose?.();
267
+
268
+ // Auto-start next round after brief delay
269
+ nextRoundTimeoutRef.current = setTimeout(() => {
270
+ nextRoundTimeoutRef.current = null;
271
+ setCurrentRound(r => r + 1);
272
+ // Reset quiz state for next round
273
+ setCurrentQ(0);
274
+ setSelected(null);
275
+ setCorrectIndex(null);
276
+ setScore(0);
277
+ setTimeLeft(timeLimitRef.current);
278
+ setShowResult(false);
279
+ setQuestionText('');
280
+ setOptions([]);
281
+ setFinalWinAmount(0);
282
+ setCoinFlyDone(false);
283
+ submissionLockedRef.current = false;
284
+ gamePlayIdRef.current = null;
285
+ allQuestionsRef.current = [];
286
+ timerProgress.setValue(1);
287
+ setSessionStarted(false); // triggers new startSession
288
+ }, 1200);
289
+ } else {
290
+ // Last round (or single round)
291
+ if (isMultiRound) {
292
+ sessionTotalWonRef.current += amountWon;
293
+ setSessionTotalWon(sessionTotalWonRef.current);
294
+ if (amountWon > 0) setSessionRoundWins(w => w + 1);
295
+ setSessionComplete(true);
296
+ setFinalWinAmount(sessionTotalWonRef.current);
297
+ } else {
298
+ setFinalWinAmount(amountWon);
299
+ }
300
+ if (result.passed !== undefined) setServerPassed(result.passed);
301
+ setGameOver(true);
302
+ if (!isMultiRound && amountWon <= 0 || isMultiRound && sessionTotalWonRef.current <= 0) {
303
+ onLose?.();
304
+ }
305
+ }
306
+ }
307
+ }, 1500);
308
+ }
309
+ } catch (err) {
310
+ submissionLockedRef.current = false;
311
+ setShowResult(false);
312
+ setSelected(null);
313
+ const msg = err?.message || 'Something went wrong';
314
+ if (msg.toLowerCase().includes('expired')) {
315
+ setGameOver(true);
316
+ setFinalWinAmount(0);
317
+ onLose?.();
318
+ }
319
+ }
320
+ }, [currentQ, showResult, clearTriviaTimer, answerQuestion, onLose, isMultiRound, currentRound, stakeCount, timerProgress]);
321
+ handleSubmitRef.current = handleSubmit;
322
+ const resetGame = useCallback(() => {
323
+ clearTriviaTimer();
324
+ clearPendingTransitions();
325
+ submissionLockedRef.current = false;
326
+ setCurrentQ(0);
327
+ setSelected(null);
328
+ setCorrectIndex(null);
329
+ setScore(0);
330
+ setTimeLeft(timeLimitRef.current);
331
+ setGameOver(false);
332
+ setSessionStarted(false);
333
+ setShowResult(false);
334
+ setQuestionText('');
335
+ setOptions([]);
336
+ setFinalWinAmount(0);
337
+ setCoinFlyDone(false);
338
+ setServerPassed(undefined);
339
+ gamePlayIdRef.current = null;
340
+ allQuestionsRef.current = [];
341
+ timerProgress.setValue(1);
342
+ // Reset multi-session state
343
+ setCurrentRound(1);
344
+ setSessionTotalWon(0);
345
+ sessionTotalWonRef.current = 0;
346
+ setSessionRoundWins(0);
347
+ setSessionComplete(false);
348
+ }, [clearPendingTransitions, clearTriviaTimer, timerProgress]);
349
+ const timerColor = timeLeft <= 5 ? COLORS.lossRed : timeLeft <= 10 ? COLORS.gold : COLORS.primary;
350
+ const resultMsg = useMemo(() => {
351
+ const passed = isMultiRound ? sessionRoundWins > 0 : serverPassed === true && finalWinAmount > 0;
352
+ const hasWinnings = finalWinAmount > 0;
353
+ if (passed) return randomMessageKey('trivia.win');
354
+ if (hasWinnings) return randomMessageKey('trivia.consolation');
355
+ return randomMessageKey('trivia.loss');
356
+ }, [gameOver]); // eslint-disable-line react-hooks/exhaustive-deps
357
+
358
+ if (gameOver) {
359
+ const passed = isMultiRound ? sessionRoundWins > 0 : serverPassed === true && finalWinAmount > 0;
360
+ const hasWinnings = finalWinAmount > 0;
361
+ return /*#__PURE__*/_jsxs(View, {
362
+ style: styles.gameOverContainer,
363
+ children: [/*#__PURE__*/_jsxs(ScrollView, {
364
+ contentContainerStyle: styles.gameOverScrollContent,
365
+ showsVerticalScrollIndicator: false,
366
+ children: [passed || hasWinnings ? /*#__PURE__*/_jsx(SvgIcon, {
367
+ name: "trophy",
368
+ size: 48,
369
+ color: COLORS.gold
370
+ }) : /*#__PURE__*/_jsx(SvgIcon, {
371
+ name: "sparkles",
372
+ size: 48,
373
+ color: COLORS.primary
374
+ }), /*#__PURE__*/_jsx(Text, {
375
+ style: styles.gameOverTitle,
376
+ children: t(`${resultMsg}.title`)
377
+ }), /*#__PURE__*/_jsx(Animated.View, {
378
+ ref: coinFlyTargetRef,
379
+ style: {
380
+ transform: [{
381
+ scale: balancePulse
382
+ }]
383
+ },
384
+ children: /*#__PURE__*/_jsx(Text, {
385
+ style: styles.gameOverScore,
386
+ children: isMultiRound ? t('trivia.result.roundsWon', {
387
+ won: sessionRoundWins,
388
+ total: stakeCount
389
+ }) : t('trivia.result.correct', {
390
+ score,
391
+ total: totalQuestions
392
+ })
393
+ })
394
+ }), /*#__PURE__*/_jsx(Text, {
395
+ ref: questionCardRef,
396
+ style: styles.gameOverSubtitle,
397
+ children: hasWinnings ? passed ? t('trivia.result.youWon', {
398
+ amount: formatNumber(finalWinAmount),
399
+ currency
400
+ }) : t('trivia.result.youReceivedBack', {
401
+ amount: formatNumber(finalWinAmount),
402
+ currency
403
+ }) : t(`${resultMsg}.sub`)
404
+ }), hasWinnings && /*#__PURE__*/_jsx(Text, {
405
+ style: styles.gameOverMotivation,
406
+ children: t(`${resultMsg}.sub`)
407
+ }), /*#__PURE__*/_jsx(JackpotNearMiss, {
408
+ jackpotAmountKobo: game?.gameplayRules?.jackpotAmountKobo ?? 0,
409
+ currency: currency
410
+ }), hasWinnings && !coinFlyDone && /*#__PURE__*/_jsx(MonflowtsButton, {
411
+ title: demoMode ? t('trivia.result.continue') : t('trivia.result.collectWinnings'),
412
+ icon: /*#__PURE__*/_jsx(SvgIcon, {
413
+ name: "diamond",
414
+ size: 16,
415
+ color: "#ffffff"
416
+ }),
417
+ onPress: () => {
418
+ sounds.playWinChime();
419
+ hypeRef.current?.show(pickPhrase(HYPE_PHRASES.trivia.bigWin), 'boost');
420
+ if (demoMode) {
421
+ setCoinFlyDone(true);
422
+ onWin(finalWinAmount);
423
+ } else {
424
+ coinFlyRef.current?.measureTarget();
425
+ questionCardRef.current?.measureInWindow?.((x, y, w, h) => {
426
+ coinFlyRef.current?.fly(x + w / 2, y + h / 2, () => {
427
+ setCoinFlyDone(true);
428
+ onWin(finalWinAmount);
429
+ });
430
+ });
431
+ }
432
+ },
433
+ style: {
434
+ marginBottom: 12
435
+ }
436
+ }), coinFlyDone && /*#__PURE__*/_jsx(MonflowtsButton, {
437
+ title: t('trivia.result.playAgain'),
438
+ icon: /*#__PURE__*/_jsx(SvgIcon, {
439
+ name: "refresh",
440
+ size: 16,
441
+ color: "#ffffff"
442
+ }),
443
+ onPress: resetGame
444
+ }), !hasWinnings && /*#__PURE__*/_jsx(MonflowtsButton, {
445
+ title: t('trivia.result.playAgain'),
446
+ icon: /*#__PURE__*/_jsx(SvgIcon, {
447
+ name: "refresh",
448
+ size: 16,
449
+ color: "#ffffff"
450
+ }),
451
+ onPress: resetGame
452
+ }), /*#__PURE__*/_jsx(MonflowtsButton, {
453
+ title: t('trivia.result.backToGames'),
454
+ variant: "outline",
455
+ onPress: onBack,
456
+ style: {
457
+ marginTop: 12
458
+ },
459
+ textStyle: styles.gameOverBtnText
460
+ })]
461
+ }), /*#__PURE__*/_jsx(CoinFlyOverlay, {
462
+ ref: coinFlyRef,
463
+ targetRef: coinFlyTargetRef,
464
+ balancePulse: balancePulse
465
+ })]
466
+ });
467
+ }
468
+ return /*#__PURE__*/_jsxs(View, {
469
+ style: styles.container,
470
+ children: [/*#__PURE__*/_jsx(HypeCallout, {
471
+ ref: hypeRef,
472
+ style: {
473
+ top: 250
474
+ }
475
+ }), /*#__PURE__*/_jsx(QuitConfirmModal, {
476
+ visible: quitVisible,
477
+ message: t('trivia.quit.message'),
478
+ quitLabel: t('trivia.quit.confirm'),
479
+ onKeepPlaying: () => setQuitVisible(false),
480
+ onQuit: () => {
481
+ void handleForfeitQuit();
482
+ }
483
+ }), /*#__PURE__*/_jsx(SideDemoTab, {
484
+ enabled: !!game?.demoConfig?.enabled
485
+ }), /*#__PURE__*/_jsxs(View, {
486
+ style: styles.header,
487
+ children: [/*#__PURE__*/_jsx(MonflowtsPressable, {
488
+ style: styles.circleBtn,
489
+ onPress: handleBackPress,
490
+ children: /*#__PURE__*/_jsx(Text, {
491
+ style: styles.btnIcon,
492
+ children: "\u2039"
493
+ })
494
+ }), /*#__PURE__*/_jsxs(View, {
495
+ style: styles.headerCenter,
496
+ children: [/*#__PURE__*/_jsx(Text, {
497
+ style: styles.progressText,
498
+ children: t('trivia.question.progress', {
499
+ current: currentQ + 1,
500
+ total: totalQuestions
501
+ })
502
+ }), /*#__PURE__*/_jsx(View, {
503
+ style: styles.progressBar,
504
+ children: /*#__PURE__*/_jsx(View, {
505
+ style: [styles.progressFill, {
506
+ width: `${(currentQ + 1) / totalQuestions * 100}%`
507
+ }]
508
+ })
509
+ })]
510
+ }), /*#__PURE__*/_jsxs(View, {
511
+ style: {
512
+ flexDirection: 'row',
513
+ alignItems: 'center',
514
+ gap: 8
515
+ },
516
+ children: [isMultiRound && /*#__PURE__*/_jsx(View, {
517
+ style: styles.roundBadge,
518
+ children: /*#__PURE__*/_jsx(Text, {
519
+ style: styles.roundText,
520
+ children: t('trivia.round.badge', {
521
+ current: currentRound,
522
+ total: stakeCount
523
+ })
524
+ })
525
+ }), /*#__PURE__*/_jsxs(View, {
526
+ style: styles.scorePill,
527
+ children: [/*#__PURE__*/_jsx(SvgIcon, {
528
+ name: "star",
529
+ size: 16,
530
+ color: COLORS.gold
531
+ }), /*#__PURE__*/_jsx(Text, {
532
+ style: [styles.scoreText, {
533
+ marginLeft: 4
534
+ }],
535
+ children: score
536
+ })]
537
+ }), /*#__PURE__*/_jsx(MonflowtsPressable, {
538
+ style: styles.circleBtn,
539
+ onPress: () => setRulesVisible(true),
540
+ children: /*#__PURE__*/_jsx(Text, {
541
+ style: styles.btnIcon,
542
+ children: "?"
543
+ })
544
+ })]
545
+ })]
546
+ }), /*#__PURE__*/_jsxs(View, {
547
+ style: styles.timerArea,
548
+ children: [/*#__PURE__*/_jsx(View, {
549
+ style: [styles.timerCircle, {
550
+ borderColor: timerColor
551
+ }],
552
+ children: /*#__PURE__*/_jsx(Text, {
553
+ style: [styles.timerText, {
554
+ color: timerColor
555
+ }],
556
+ children: timeLeft
557
+ })
558
+ }), /*#__PURE__*/_jsx(Animated.View, {
559
+ style: [styles.timerBar, {
560
+ width: timerProgress.interpolate({
561
+ inputRange: [0, 1],
562
+ outputRange: ['0%', '100%']
563
+ }),
564
+ backgroundColor: timerColor
565
+ }]
566
+ })]
567
+ }), /*#__PURE__*/_jsxs(View, {
568
+ style: styles.questionCard,
569
+ children: [/*#__PURE__*/_jsx(Text, {
570
+ style: styles.questionType,
571
+ children: t('trivia.question.type')
572
+ }), /*#__PURE__*/_jsx(Text, {
573
+ style: styles.questionText,
574
+ children: questionText
575
+ })]
576
+ }), /*#__PURE__*/_jsx(View, {
577
+ style: styles.optionsArea,
578
+ children: options.map((opt, i) => {
579
+ let optStyle = styles.optionDefault;
580
+ let textStyle = styles.optionTextDefault;
581
+ if (showResult) {
582
+ if (i === correctIndex) {
583
+ optStyle = styles.optionCorrect;
584
+ textStyle = styles.optionTextCorrect;
585
+ } else if (i === selected && i !== correctIndex) {
586
+ optStyle = styles.optionWrong;
587
+ textStyle = styles.optionTextWrong;
588
+ }
589
+ } else if (i === selected) {
590
+ optStyle = styles.optionSelected;
591
+ textStyle = styles.optionTextSelected;
592
+ }
593
+ return /*#__PURE__*/_jsxs(MonflowtsPressable, {
594
+ style: [styles.option, optStyle],
595
+ onPress: () => handleSubmit(i),
596
+ activeOpacity: 0.85,
597
+ disabled: showResult,
598
+ disableSound: showResult,
599
+ sound: "select",
600
+ haptic: "selection",
601
+ children: [/*#__PURE__*/_jsx(View, {
602
+ style: [styles.optionLetter, showResult && i === correctIndex && {
603
+ backgroundColor: 'rgba(34,197,94,0.2)',
604
+ borderColor: 'rgba(34,197,94,0.3)'
605
+ }],
606
+ children: /*#__PURE__*/_jsx(Text, {
607
+ style: styles.optionLetterText,
608
+ children: String.fromCharCode(65 + i)
609
+ })
610
+ }), /*#__PURE__*/_jsx(Text, {
611
+ style: [styles.optionText, textStyle],
612
+ children: opt
613
+ }), showResult && i === correctIndex && /*#__PURE__*/_jsx(Text, {
614
+ style: styles.correctIcon,
615
+ children: "\u2713"
616
+ }), showResult && i === selected && i !== correctIndex && /*#__PURE__*/_jsx(Text, {
617
+ style: styles.wrongIcon,
618
+ children: "\u2717"
619
+ })]
620
+ }, i);
621
+ })
622
+ }), /*#__PURE__*/_jsx(InsufficientFundsOverlay, {
623
+ visible: showFundsOverlay,
624
+ balance: balance,
625
+ required: initialStake,
626
+ currency: currency,
627
+ onDismiss: () => {
628
+ setShowFundsOverlay(false);
629
+ onBack();
630
+ },
631
+ onTopUp: onTopUp
632
+ }), /*#__PURE__*/_jsx(GameRulesModal, {
633
+ visible: rulesVisible,
634
+ onClose: () => setRulesVisible(false),
635
+ gameCode: game?.gameCode ?? 'FAST_FINGER'
636
+ })]
637
+ });
638
+ };
639
+ const styles = StyleSheet.create({
640
+ container: {
641
+ flex: 1,
642
+ backgroundColor: COLORS.backgroundDark,
643
+ paddingTop: 50
644
+ },
645
+ gameOverContainer: {
646
+ flex: 1,
647
+ backgroundColor: COLORS.backgroundDark
648
+ },
649
+ gameOverScrollContent: {
650
+ flexGrow: 1,
651
+ alignItems: 'center',
652
+ justifyContent: 'center',
653
+ padding: 32
654
+ },
655
+ gameOverEmoji: {
656
+ fontSize: 80,
657
+ marginBottom: 16
658
+ },
659
+ gameOverTitle: {
660
+ fontSize: 32,
661
+ fontWeight: '800',
662
+ color: '#fff',
663
+ marginBottom: 8
664
+ },
665
+ gameOverScore: {
666
+ fontSize: 20,
667
+ fontWeight: '700',
668
+ color: COLORS.primary,
669
+ marginBottom: 8
670
+ },
671
+ gameOverSubtitle: {
672
+ fontSize: 14,
673
+ color: COLORS.slateLight,
674
+ marginBottom: 8,
675
+ textAlign: 'center'
676
+ },
677
+ gameOverMotivation: {
678
+ fontSize: 13,
679
+ color: COLORS.slateDark,
680
+ marginBottom: 32,
681
+ textAlign: 'center',
682
+ lineHeight: 18
683
+ },
684
+ gameOverBtnText: {
685
+ fontSize: 16,
686
+ fontWeight: '800',
687
+ color: '#fff',
688
+ letterSpacing: 2
689
+ },
690
+ header: {
691
+ flexDirection: 'row',
692
+ alignItems: 'center',
693
+ justifyContent: 'space-between',
694
+ paddingHorizontal: 20,
695
+ marginBottom: 16
696
+ },
697
+ circleBtn: {
698
+ width: 40,
699
+ height: 40,
700
+ borderRadius: 20,
701
+ backgroundColor: COLORS.white05,
702
+ borderWidth: 1,
703
+ borderColor: COLORS.white10,
704
+ alignItems: 'center',
705
+ justifyContent: 'center'
706
+ },
707
+ btnIcon: {
708
+ color: '#fff',
709
+ fontSize: 22
710
+ },
711
+ headerCenter: {
712
+ flex: 1,
713
+ marginHorizontal: 16
714
+ },
715
+ progressText: {
716
+ fontSize: 11,
717
+ color: COLORS.slateLight,
718
+ fontWeight: '600',
719
+ marginBottom: 6
720
+ },
721
+ progressBar: {
722
+ height: 4,
723
+ backgroundColor: COLORS.white10,
724
+ borderRadius: 2,
725
+ overflow: 'hidden'
726
+ },
727
+ progressFill: {
728
+ height: '100%',
729
+ backgroundColor: COLORS.primary,
730
+ borderRadius: 2
731
+ },
732
+ scorePill: {
733
+ flexDirection: 'row',
734
+ alignItems: 'center',
735
+ gap: 4,
736
+ backgroundColor: COLORS.white05,
737
+ borderWidth: 1,
738
+ borderColor: COLORS.white10,
739
+ borderRadius: 20,
740
+ paddingHorizontal: 12,
741
+ paddingVertical: 6
742
+ },
743
+ scoreIcon: {
744
+ fontSize: 14
745
+ },
746
+ scoreText: {
747
+ fontSize: 16,
748
+ fontWeight: '800',
749
+ color: COLORS.gold
750
+ },
751
+ timerArea: {
752
+ paddingHorizontal: 20,
753
+ alignItems: 'center',
754
+ marginBottom: 20
755
+ },
756
+ timerCircle: {
757
+ width: 56,
758
+ height: 56,
759
+ borderRadius: 28,
760
+ borderWidth: 3,
761
+ alignItems: 'center',
762
+ justifyContent: 'center',
763
+ marginBottom: 10
764
+ },
765
+ timerText: {
766
+ fontSize: 22,
767
+ fontWeight: '800'
768
+ },
769
+ timerBar: {
770
+ height: 3,
771
+ borderRadius: 2,
772
+ width: '100%'
773
+ },
774
+ questionCard: {
775
+ marginHorizontal: 20,
776
+ backgroundColor: 'rgba(15,23,42,0.6)',
777
+ borderWidth: 1,
778
+ borderColor: COLORS.white10,
779
+ borderRadius: 20,
780
+ padding: 24,
781
+ marginBottom: 20
782
+ },
783
+ questionType: {
784
+ fontSize: 9,
785
+ fontWeight: '800',
786
+ color: COLORS.primary,
787
+ letterSpacing: 3,
788
+ marginBottom: 12
789
+ },
790
+ questionText: {
791
+ fontSize: 18,
792
+ fontWeight: '700',
793
+ color: '#fff',
794
+ lineHeight: 26
795
+ },
796
+ optionsArea: {
797
+ paddingHorizontal: 20,
798
+ gap: 10
799
+ },
800
+ option: {
801
+ flexDirection: 'row',
802
+ alignItems: 'center',
803
+ borderRadius: 16,
804
+ padding: 16,
805
+ gap: 12
806
+ },
807
+ optionDefault: {
808
+ backgroundColor: COLORS.white05,
809
+ borderWidth: 1,
810
+ borderColor: COLORS.white10
811
+ },
812
+ optionSelected: {
813
+ backgroundColor: 'rgba(127,19,236,0.15)',
814
+ borderWidth: 1,
815
+ borderColor: 'rgba(127,19,236,0.4)'
816
+ },
817
+ optionCorrect: {
818
+ backgroundColor: 'rgba(34,197,94,0.1)',
819
+ borderWidth: 1,
820
+ borderColor: 'rgba(34,197,94,0.4)'
821
+ },
822
+ optionWrong: {
823
+ backgroundColor: 'rgba(239,68,68,0.1)',
824
+ borderWidth: 1,
825
+ borderColor: 'rgba(239,68,68,0.4)'
826
+ },
827
+ optionLetter: {
828
+ width: 32,
829
+ height: 32,
830
+ borderRadius: 8,
831
+ backgroundColor: COLORS.white05,
832
+ borderWidth: 1,
833
+ borderColor: COLORS.white10,
834
+ alignItems: 'center',
835
+ justifyContent: 'center'
836
+ },
837
+ optionLetterText: {
838
+ fontSize: 13,
839
+ fontWeight: '700',
840
+ color: COLORS.slateLight
841
+ },
842
+ optionText: {
843
+ flex: 1,
844
+ fontSize: 15,
845
+ fontWeight: '600'
846
+ },
847
+ optionTextDefault: {
848
+ color: '#fff'
849
+ },
850
+ optionTextSelected: {
851
+ color: '#fff'
852
+ },
853
+ optionTextCorrect: {
854
+ color: COLORS.winGreen
855
+ },
856
+ optionTextWrong: {
857
+ color: COLORS.lossRed
858
+ },
859
+ correctIcon: {
860
+ fontSize: 18,
861
+ fontWeight: '800',
862
+ color: COLORS.winGreen
863
+ },
864
+ wrongIcon: {
865
+ fontSize: 18,
866
+ fontWeight: '800',
867
+ color: COLORS.lossRed
868
+ },
869
+ roundBadge: {
870
+ backgroundColor: 'rgba(127,19,236,0.2)',
871
+ borderWidth: 1,
872
+ borderColor: 'rgba(127,19,236,0.4)',
873
+ borderRadius: 12,
874
+ paddingHorizontal: 8,
875
+ paddingVertical: 3
876
+ },
877
+ roundText: {
878
+ fontSize: 11,
879
+ fontWeight: '800',
880
+ color: COLORS.primary
881
+ }
882
+ });
883
+ export default TriviaMaster;
884
+ //# sourceMappingURL=TriviaMaster.js.map