react-native-monflowts 0.0.0-stage → 0.5.0

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 +363 -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,815 @@
1
+ "use strict";
2
+
3
+ import React, { useState, useCallback, useRef, useEffect, useMemo } from 'react';
4
+ import { View, Text, ScrollView, StyleSheet, Alert, Animated, BackHandler } from 'react-native';
5
+ import CoinFlyOverlay from "../components/CoinFlyOverlay.js";
6
+ import MonflowtsPressable from "../components/MonflowtsPressable.js";
7
+ import PlayerCard from "./PlayerCard.js";
8
+ import { COLORS } from "../constants.js";
9
+ import QuitConfirmModal from "../components/QuitConfirmModal.js";
10
+ import SideDemoTab from "../components/SideDemoTab.js";
11
+ import { sounds } from "../SoundManager.js";
12
+ import HypeCallout from "../components/HypeCallout.js";
13
+ import { HYPE_PHRASES, pickPhrase } from "../effects/hypePhrases.js";
14
+ import SvgIcon from "../Icons.js";
15
+ import MonflowtsButton from "../components/MonflowtsButton.js";
16
+ import SessionTimer from "../components/SessionTimer.js";
17
+ import AbandonPolicyNotice from "../components/AbandonPolicyNotice.js";
18
+ import InsufficientFundsOverlay from "../components/InsufficientFundsOverlay.js";
19
+ import GameRulesModal from "../components/GameRulesModal.js";
20
+ import JackpotNearMiss from "../components/JackpotNearMiss.js";
21
+ import { usePlayGame, useInitPlay } from "../hooks/usePlayGame.js";
22
+ import { useCurrency } from "../hooks/useCurrency.js";
23
+ import { useGameStore } from "../stores/gameStore.js";
24
+ import { randomMessageKey } from "../content.js";
25
+ import { t, formatNumber, errorText } from "../i18n.js";
26
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
27
+ function rollSingle() {
28
+ return {
29
+ die1: Math.ceil(Math.random() * 6),
30
+ die2: Math.ceil(Math.random() * 6)
31
+ };
32
+ }
33
+ const DiceBattle = ({
34
+ onBack,
35
+ initialStake,
36
+ stakeCount = 1,
37
+ onWin,
38
+ onLose,
39
+ game,
40
+ balance = 0,
41
+ onTopUp
42
+ }) => {
43
+ const currency = useCurrency();
44
+ const demoMode = useGameStore(s => s.demoMode);
45
+ const toggleDemoMode = useGameStore(s => s.toggleDemoMode);
46
+ const isMultiRound = stakeCount > 1;
47
+ const [isRolling, setIsRolling] = useState(false);
48
+ const [showFundsOverlay, setShowFundsOverlay] = useState(false);
49
+ const [rulesVisible, setRulesVisible] = useState(false);
50
+ const [p1Dice, setP1Dice] = useState({
51
+ die1: 1,
52
+ die2: 1
53
+ });
54
+ const [p2Dice, setP2Dice] = useState({
55
+ die1: 1,
56
+ die2: 1
57
+ });
58
+ const [p1Score, setP1Score] = useState(0);
59
+ const [p2Score, setP2Score] = useState(0);
60
+ const [rounds, setRounds] = useState([]);
61
+ const [roundNum, setRoundNum] = useState(0);
62
+ const [sessionWins, setSessionWins] = useState(0);
63
+ const [sessionTotalWon, setSessionTotalWon] = useState(0);
64
+ const [sessionComplete, setSessionComplete] = useState(false);
65
+ const [showResultOverlay, setShowResultOverlay] = useState(false);
66
+ const diceLive = isRolling || roundNum > 0 && !sessionComplete && !showResultOverlay;
67
+ const [quitVisible, setQuitVisible] = useState(false);
68
+ const handleBack = useCallback(() => {
69
+ if (!diceLive) {
70
+ onBack();
71
+ return;
72
+ }
73
+ setQuitVisible(true);
74
+ }, [diceLive, onBack]);
75
+ useEffect(() => {
76
+ const sub = BackHandler.addEventListener('hardwareBackPress', () => {
77
+ handleBack();
78
+ return true;
79
+ });
80
+ return () => sub.remove();
81
+ }, [handleBack]);
82
+ const [lastAmountWon, setLastAmountWon] = useState(0);
83
+ const intervalRef = useRef(null);
84
+
85
+ // Coin fly animation refs
86
+ const stakePillRef = useRef(null);
87
+ const cardsAreaRef = useRef(null);
88
+ const coinFlyRef = useRef(null);
89
+ const hypeRef = useRef(null);
90
+ const balancePulse = useRef(new Animated.Value(1)).current;
91
+ const {
92
+ play
93
+ } = usePlayGame();
94
+
95
+ // Two-phase play support
96
+ const abandonPolicy = game?.gameplayRules?.abandonPolicy ?? null;
97
+ const initPlay = useInitPlay(game?.gameCode ?? 'DICE_ROLL', abandonPolicy);
98
+
99
+ // Reset session when demo mode toggles so a new session with the correct flag is started
100
+ const prevDemoRef = useRef(demoMode);
101
+ useEffect(() => {
102
+ if (prevDemoRef.current !== demoMode) {
103
+ prevDemoRef.current = demoMode;
104
+ if (initPlay.enabled) {
105
+ initPlay.reset();
106
+ }
107
+ }
108
+ }, [demoMode, initPlay]); // eslint-disable-line react-hooks/exhaustive-deps
109
+
110
+ const rollDice = useCallback(async () => {
111
+ if (isRolling || !game) return;
112
+
113
+ // Block if session expired (two-phase mode)
114
+ if (initPlay.enabled && initPlay.isExpired) return;
115
+
116
+ // Check sufficient balance (non-two-phase mode)
117
+ if (!demoMode && !initPlay.session && balance < initialStake) {
118
+ setShowFundsOverlay(true);
119
+ return;
120
+ }
121
+ sounds.resume();
122
+ setIsRolling(true);
123
+ setRoundNum(r => r + 1);
124
+
125
+ // ── Call server to determine outcome ──
126
+ let serverResult = null;
127
+ try {
128
+ if (initPlay.enabled) {
129
+ // Two-phase: complete the pre-initiated session
130
+ const activeSession = initPlay.session ?? (await initPlay.startSession(initialStake * 100));
131
+ serverResult = await initPlay.completeSession(isMultiRound ? {
132
+ stakeCount
133
+ } : undefined, activeSession);
134
+ } else {
135
+ // Atomic: standard single-call play (only when abandon policy is disabled)
136
+ serverResult = await play(game.gameCode, isMultiRound ? {
137
+ stakeCount
138
+ } : null, undefined, initialStake * 100);
139
+ }
140
+ } catch (e) {
141
+ console.warn('[DiceBattle] play failed:', e?.message ?? e);
142
+ const msg = (e?.message || '').toLowerCase();
143
+ if (msg.includes('insufficient') || msg.includes('balance')) {
144
+ setShowFundsOverlay(true);
145
+ } else {
146
+ Alert.alert(t('dice.battle.playErrorTitle'), errorText(e, 'dice.battle.playFailed'));
147
+ }
148
+ setIsRolling(false);
149
+ return;
150
+ }
151
+
152
+ // Parse server dice values
153
+ const gameResult = serverResult?.gameResult;
154
+ const finalP1 = gameResult?.playerDice ? {
155
+ die1: gameResult.playerDice[0],
156
+ die2: gameResult.playerDice[1]
157
+ } : rollSingle();
158
+ const finalP2 = gameResult?.botDice ? {
159
+ die1: gameResult.botDice[0],
160
+ die2: gameResult.botDice[1]
161
+ } : rollSingle();
162
+
163
+ // ── Tumble animation (12 ticks of random dice) ──
164
+ let ticks = 0;
165
+ intervalRef.current = setInterval(() => {
166
+ setP1Dice(rollSingle());
167
+ setP2Dice(rollSingle());
168
+ sounds.playRollTick();
169
+ ticks++;
170
+ if (ticks >= 12) {
171
+ if (intervalRef.current) clearInterval(intervalRef.current);
172
+ const p1Sum = finalP1.die1 + finalP1.die2;
173
+ const p2Sum = finalP2.die1 + finalP2.die2;
174
+ // Winner follows the SERVER's decision (the amount it actually paid),
175
+ // not a local dice comparison — the server's win logic is RNG/win-control
176
+ // gated, so local sums can disagree with the money. A dice-equal result
177
+ // is shown as a draw only when no money was won.
178
+ const serverAmountWon = (serverResult?.amountWonKobo ?? 0) / 100;
179
+ const winner = serverAmountWon > 0 ? 'p1' : p1Sum === p2Sum ? 'draw' : 'p2';
180
+ setP1Dice(finalP1);
181
+ setP2Dice(finalP2);
182
+ const newP1Score = p1Score + p1Sum;
183
+ const newP2Score = p2Score + p2Sum;
184
+ setP1Score(newP1Score);
185
+ setP2Score(newP2Score);
186
+ const round = {
187
+ id: roundNum + 1,
188
+ p1: finalP1,
189
+ p2: finalP2,
190
+ winner
191
+ };
192
+ setRounds(prev => [round, ...prev]);
193
+ setIsRolling(false);
194
+ const amountWon = (serverResult?.amountWonKobo ?? 0) / 100;
195
+ const session = gameResult?.session;
196
+ const isLastRound = session?.isLastRound ?? true;
197
+ if (isMultiRound) {
198
+ // Multi-round session: accumulate results
199
+ if (amountWon > 0) {
200
+ setSessionWins(w => w + 1);
201
+ setSessionTotalWon(t => t + amountWon);
202
+ sounds.playWinChime();
203
+ hypeRef.current?.show(pickPhrase(amountWon >= 5000 ? HYPE_PHRASES.dice.bigWin : HYPE_PHRASES.dice.win), amountWon >= 5000 ? 'boost' : 'win');
204
+ // Coin fly animation — skip in demo mode (no real money)
205
+ if (!demoMode) {
206
+ coinFlyRef.current?.measureTarget();
207
+ cardsAreaRef.current?.measureInWindow?.((x, y, w, h) => {
208
+ coinFlyRef.current?.fly(x + w / 2, y + h / 2);
209
+ });
210
+ }
211
+ } else {
212
+ sounds.playDrawSound();
213
+ hypeRef.current?.show(pickPhrase(HYPE_PHRASES.dice.loss), 'loss');
214
+ }
215
+ if (isLastRound) {
216
+ // Session complete — show result overlay after a delay so user can see last round
217
+ const totalWon = sessionTotalWon + amountWon;
218
+ setLastAmountWon(totalWon);
219
+ setTimeout(() => {
220
+ setSessionComplete(true);
221
+ setShowResultOverlay(true);
222
+ }, 3000);
223
+ }
224
+ } else {
225
+ // Single round: show result overlay after a delay so user can see the dice
226
+ setLastAmountWon(amountWon);
227
+ if (amountWon > 0) {
228
+ sounds.playWinChime();
229
+ hypeRef.current?.show(pickPhrase(amountWon >= 5000 ? HYPE_PHRASES.dice.bigWin : HYPE_PHRASES.dice.win), amountWon >= 5000 ? 'boost' : 'win');
230
+ if (!demoMode) {
231
+ coinFlyRef.current?.measureTarget();
232
+ cardsAreaRef.current?.measureInWindow?.((x, y, w, h) => {
233
+ coinFlyRef.current?.fly(x + w / 2, y + h / 2);
234
+ });
235
+ }
236
+ } else {
237
+ sounds.playDrawSound();
238
+ hypeRef.current?.show(pickPhrase(HYPE_PHRASES.dice.loss), 'loss');
239
+ }
240
+ setTimeout(() => {
241
+ setShowResultOverlay(true);
242
+ }, 3000);
243
+ }
244
+ }
245
+ }, 80);
246
+ }, [isRolling, p1Score, p2Score, roundNum, initialStake, stakeCount, isMultiRound, sessionTotalWon, onWin, onLose, game, play, initPlay, balance, currency]);
247
+ const resultMsg = useMemo(() => randomMessageKey(lastAmountWon > 0 ? 'dice.battle.win' : 'dice.battle.loss'), [showResultOverlay] // eslint-disable-line react-hooks/exhaustive-deps
248
+ );
249
+ const handleResultPlayAgain = useCallback(() => {
250
+ setShowResultOverlay(false);
251
+ setSessionComplete(false);
252
+ setRoundNum(0);
253
+ setRounds([]);
254
+ setP1Score(0);
255
+ setP2Score(0);
256
+ setSessionWins(0);
257
+ setSessionTotalWon(0);
258
+ setLastAmountWon(0);
259
+ if (initPlay.enabled) initPlay.reset();
260
+ }, [initPlay]);
261
+ const handleResultExit = useCallback(() => {
262
+ if (lastAmountWon > 0) {
263
+ onWin(lastAmountWon);
264
+ } else {
265
+ onLose?.();
266
+ }
267
+ }, [lastAmountWon, onWin, onLose]);
268
+ return /*#__PURE__*/_jsxs(View, {
269
+ style: styles.container,
270
+ children: [/*#__PURE__*/_jsx(HypeCallout, {
271
+ ref: hypeRef,
272
+ style: {
273
+ top: 240
274
+ }
275
+ }), /*#__PURE__*/_jsx(SideDemoTab, {
276
+ enabled: !!game?.demoConfig?.enabled
277
+ }), initPlay.enabled && initPlay.session && /*#__PURE__*/_jsx(SessionTimer, {
278
+ secondsLeft: initPlay.secondsLeft,
279
+ isExpired: initPlay.isExpired
280
+ }), initPlay.enabled && initPlay.isExpired && /*#__PURE__*/_jsxs(View, {
281
+ style: styles.expiredOverlay,
282
+ children: [/*#__PURE__*/_jsx(Text, {
283
+ style: styles.expiredTitle,
284
+ children: t('dice.battle.timesUp')
285
+ }), /*#__PURE__*/_jsx(Text, {
286
+ style: styles.expiredText,
287
+ children: t('dice.battle.stakeForfeited')
288
+ }), /*#__PURE__*/_jsx(MonflowtsButton, {
289
+ title: t('dice.battle.goBack'),
290
+ onPress: onBack
291
+ })]
292
+ }), /*#__PURE__*/_jsxs(View, {
293
+ style: styles.header,
294
+ children: [/*#__PURE__*/_jsx(QuitConfirmModal, {
295
+ visible: quitVisible,
296
+ message: t('dice.battle.quitMessage'),
297
+ onKeepPlaying: () => setQuitVisible(false),
298
+ onQuit: () => {
299
+ setQuitVisible(false);
300
+ onBack();
301
+ }
302
+ }), /*#__PURE__*/_jsx(MonflowtsPressable, {
303
+ style: styles.backBtn,
304
+ onPress: handleBack,
305
+ children: /*#__PURE__*/_jsx(Text, {
306
+ style: styles.backText,
307
+ children: "\u2039"
308
+ })
309
+ }), /*#__PURE__*/_jsxs(View, {
310
+ style: styles.headerCenter,
311
+ children: [/*#__PURE__*/_jsx(Text, {
312
+ style: styles.headerTag,
313
+ children: demoMode ? t('dice.battle.demoMatch') : t('dice.battle.liveMatch')
314
+ }), /*#__PURE__*/_jsx(Text, {
315
+ style: styles.headerTitle,
316
+ children: t('dice.battle.title')
317
+ })]
318
+ }), /*#__PURE__*/_jsxs(View, {
319
+ style: {
320
+ flexDirection: 'row',
321
+ alignItems: 'center',
322
+ gap: 8
323
+ },
324
+ children: [/*#__PURE__*/_jsx(View, {
325
+ style: styles.roundBadge,
326
+ children: /*#__PURE__*/_jsx(Text, {
327
+ style: styles.roundText,
328
+ children: isMultiRound ? t('dice.battle.roundOfTotal', {
329
+ round: roundNum,
330
+ total: stakeCount
331
+ }) : t('dice.battle.roundShort', {
332
+ round: roundNum
333
+ })
334
+ })
335
+ }), /*#__PURE__*/_jsx(MonflowtsPressable, {
336
+ style: styles.backBtn,
337
+ onPress: () => setRulesVisible(true),
338
+ children: /*#__PURE__*/_jsx(Text, {
339
+ style: styles.backText,
340
+ children: "?"
341
+ })
342
+ })]
343
+ })]
344
+ }), /*#__PURE__*/_jsx(AbandonPolicyNotice, {
345
+ abandonPolicy: abandonPolicy
346
+ }), initPlay.enabled && initPlay.error && !initPlay.session && /*#__PURE__*/_jsxs(View, {
347
+ style: {
348
+ padding: 12,
349
+ backgroundColor: '#fef2f2',
350
+ borderRadius: 8,
351
+ margin: 8,
352
+ alignItems: 'center'
353
+ },
354
+ children: [/*#__PURE__*/_jsx(Text, {
355
+ style: {
356
+ color: '#b91c1c',
357
+ fontSize: 13,
358
+ marginBottom: 8,
359
+ textAlign: 'center'
360
+ },
361
+ children: initPlay.error
362
+ }), /*#__PURE__*/_jsx(MonflowtsButton, {
363
+ title: t('dice.battle.retry'),
364
+ onPress: () => initPlay.reset()
365
+ })]
366
+ }), /*#__PURE__*/_jsxs(Animated.View, {
367
+ ref: stakePillRef,
368
+ style: [styles.stakeBar, {
369
+ transform: [{
370
+ scale: balancePulse
371
+ }]
372
+ }],
373
+ children: [/*#__PURE__*/_jsx(Text, {
374
+ style: styles.stakeLabel,
375
+ children: t('dice.battle.stake', {
376
+ amount: initialStake,
377
+ currency
378
+ })
379
+ }), /*#__PURE__*/_jsx(Text, {
380
+ style: styles.stakePrize,
381
+ children: isMultiRound ? t('dice.battle.won', {
382
+ amount: sessionTotalWon,
383
+ currency
384
+ }) : t('dice.battle.winPrizes')
385
+ })]
386
+ }), /*#__PURE__*/_jsxs(View, {
387
+ ref: cardsAreaRef,
388
+ style: styles.cardsArea,
389
+ children: [/*#__PURE__*/_jsx(PlayerCard, {
390
+ playerNumber: 1,
391
+ title: t('dice.battle.you'),
392
+ subtitle: t('dice.battle.player'),
393
+ score: p1Score,
394
+ dice: p1Dice,
395
+ isWinner: !isRolling && rounds[0]?.winner === 'p1',
396
+ bgColor: "#4f46e5",
397
+ isRolling: isRolling
398
+ }), /*#__PURE__*/_jsx(View, {
399
+ style: styles.vsSeparator,
400
+ children: /*#__PURE__*/_jsx(Text, {
401
+ style: styles.vsText,
402
+ children: t('dice.battle.vs')
403
+ })
404
+ }), /*#__PURE__*/_jsx(PlayerCard, {
405
+ playerNumber: 2,
406
+ title: t('dice.battle.bot'),
407
+ subtitle: t('dice.battle.monflowtsAi'),
408
+ score: p2Score,
409
+ dice: p2Dice,
410
+ isWinner: !isRolling && rounds[0]?.winner === 'p2',
411
+ bgColor: "#0f766e",
412
+ isRolling: isRolling
413
+ })]
414
+ }), rounds.length > 0 && /*#__PURE__*/_jsxs(View, {
415
+ style: styles.historySection,
416
+ children: [/*#__PURE__*/_jsx(Text, {
417
+ style: styles.historyTitle,
418
+ children: t('dice.battle.matchHistory')
419
+ }), /*#__PURE__*/_jsx(ScrollView, {
420
+ horizontal: true,
421
+ showsHorizontalScrollIndicator: false,
422
+ children: rounds.slice(0, 5).map(r => /*#__PURE__*/_jsxs(View, {
423
+ style: [styles.historyCard, r.winner === 'p1' && {
424
+ backgroundColor: 'rgba(127,19,236,0.15)',
425
+ borderColor: 'rgba(127,19,236,0.3)'
426
+ }, r.winner === 'p2' && {
427
+ backgroundColor: 'rgba(239,68,68,0.1)',
428
+ borderColor: 'rgba(239,68,68,0.2)'
429
+ }],
430
+ children: [/*#__PURE__*/_jsx(Text, {
431
+ style: styles.historyRound,
432
+ children: t('dice.battle.roundShort', {
433
+ round: r.id
434
+ })
435
+ }), /*#__PURE__*/_jsx(Text, {
436
+ style: [styles.historyResult, r.winner === 'p1' ? {
437
+ color: COLORS.primary
438
+ } : r.winner === 'p2' ? {
439
+ color: COLORS.lossRed
440
+ } : {
441
+ color: COLORS.slateLight
442
+ }],
443
+ children: r.winner === 'p1' ? t('dice.battle.win') : r.winner === 'p2' ? t('dice.battle.loss') : t('dice.battle.draw')
444
+ })]
445
+ }, r.id))
446
+ })]
447
+ }), /*#__PURE__*/_jsx(View, {
448
+ style: styles.footer,
449
+ children: sessionComplete ? /*#__PURE__*/_jsxs(View, {
450
+ style: {
451
+ alignItems: 'center'
452
+ },
453
+ children: [/*#__PURE__*/_jsx(Text, {
454
+ style: {
455
+ color: COLORS.gold,
456
+ fontSize: 16,
457
+ fontWeight: '700',
458
+ marginBottom: 8
459
+ },
460
+ children: t('dice.battle.sessionComplete')
461
+ }), /*#__PURE__*/_jsx(Text, {
462
+ style: {
463
+ color: COLORS.slateLight,
464
+ fontSize: 13
465
+ },
466
+ children: sessionTotalWon > 0 ? t('dice.battle.sessionSummaryWon', {
467
+ wins: sessionWins,
468
+ total: stakeCount,
469
+ amount: sessionTotalWon,
470
+ currency
471
+ }) : t('dice.battle.sessionSummaryNone', {
472
+ wins: sessionWins,
473
+ total: stakeCount
474
+ })
475
+ })]
476
+ }) : /*#__PURE__*/_jsx(MonflowtsButton, {
477
+ title: isMultiRound && roundNum > 0 ? t('dice.battle.rollProgress', {
478
+ round: roundNum,
479
+ total: stakeCount
480
+ }) : t('dice.battle.rollDice'),
481
+ icon: /*#__PURE__*/_jsx(SvgIcon, {
482
+ name: "dice",
483
+ size: 18,
484
+ color: "#ffffff"
485
+ }),
486
+ loading: isRolling,
487
+ loadingText: t('dice.battle.rolling'),
488
+ onPress: rollDice,
489
+ textStyle: styles.rollBtnText
490
+ })
491
+ }), /*#__PURE__*/_jsx(InsufficientFundsOverlay, {
492
+ visible: showFundsOverlay,
493
+ balance: balance,
494
+ required: initialStake,
495
+ currency: currency,
496
+ onDismiss: () => setShowFundsOverlay(false),
497
+ onTopUp: onTopUp
498
+ }), /*#__PURE__*/_jsx(CoinFlyOverlay, {
499
+ ref: coinFlyRef,
500
+ targetRef: stakePillRef,
501
+ balancePulse: balancePulse
502
+ }), /*#__PURE__*/_jsx(GameRulesModal, {
503
+ visible: rulesVisible,
504
+ onClose: () => setRulesVisible(false),
505
+ gameCode: game?.gameCode ?? 'DICE_ROLL'
506
+ }), showResultOverlay && /*#__PURE__*/_jsx(View, {
507
+ style: styles.resultOverlay,
508
+ children: /*#__PURE__*/_jsx(ScrollView, {
509
+ contentContainerStyle: styles.resultScrollContent,
510
+ showsVerticalScrollIndicator: false,
511
+ children: /*#__PURE__*/_jsxs(View, {
512
+ style: styles.resultContent,
513
+ children: [lastAmountWon > 0 ? /*#__PURE__*/_jsx(SvgIcon, {
514
+ name: "trophy",
515
+ size: 48,
516
+ color: COLORS.gold
517
+ }) : /*#__PURE__*/_jsx(SvgIcon, {
518
+ name: "dice",
519
+ size: 48,
520
+ color: COLORS.primary
521
+ }), /*#__PURE__*/_jsxs(Text, {
522
+ style: styles.resultTitle,
523
+ children: [t(`${resultMsg}.title`), /*#__PURE__*/_jsx(Text, {
524
+ style: {
525
+ color: lastAmountWon > 0 ? COLORS.gold : COLORS.primary
526
+ },
527
+ children: t(`${resultMsg}.highlight`)
528
+ })]
529
+ }), lastAmountWon > 0 && /*#__PURE__*/_jsx(Text, {
530
+ style: styles.resultAmount,
531
+ children: t('dice.battle.winAmount', {
532
+ amount: formatNumber(lastAmountWon),
533
+ currency
534
+ })
535
+ }), isMultiRound && /*#__PURE__*/_jsx(Text, {
536
+ style: {
537
+ color: COLORS.slateLight,
538
+ fontSize: 12,
539
+ marginBottom: 4
540
+ },
541
+ children: t('dice.battle.roundsWon', {
542
+ wins: sessionWins,
543
+ total: stakeCount
544
+ })
545
+ }), /*#__PURE__*/_jsx(Text, {
546
+ style: styles.resultSubtitle,
547
+ children: t(`${resultMsg}.sub`)
548
+ }), /*#__PURE__*/_jsx(JackpotNearMiss, {
549
+ jackpotAmountKobo: game?.gameplayRules?.jackpotAmountKobo ?? 0,
550
+ currency: currency
551
+ }), demoMode ? /*#__PURE__*/_jsxs(_Fragment, {
552
+ children: [/*#__PURE__*/_jsx(Text, {
553
+ style: styles.demoHookText,
554
+ children: lastAmountWon > 0 ? t('dice.battle.demoHookWin') : t('dice.battle.demoHookLoss')
555
+ }), /*#__PURE__*/_jsx(MonflowtsButton, {
556
+ title: t('dice.battle.playForReal'),
557
+ icon: /*#__PURE__*/_jsx(SvgIcon, {
558
+ name: "lightning",
559
+ size: 16,
560
+ color: "#ffffff"
561
+ }),
562
+ onPress: () => {
563
+ toggleDemoMode();
564
+ handleResultPlayAgain();
565
+ },
566
+ style: styles.liveCtaButton
567
+ }), /*#__PURE__*/_jsx(MonflowtsButton, {
568
+ title: t('dice.battle.keepPracticing'),
569
+ variant: "outline",
570
+ icon: /*#__PURE__*/_jsx(SvgIcon, {
571
+ name: "refresh",
572
+ size: 16,
573
+ color: "#ffffff"
574
+ }),
575
+ onPress: handleResultPlayAgain,
576
+ style: {
577
+ marginTop: 12
578
+ }
579
+ })]
580
+ }) : /*#__PURE__*/_jsxs(_Fragment, {
581
+ children: [/*#__PURE__*/_jsx(MonflowtsButton, {
582
+ title: lastAmountWon > 0 ? t('dice.battle.collectRollAgain') : t('dice.battle.rollAgain'),
583
+ icon: /*#__PURE__*/_jsx(SvgIcon, {
584
+ name: "refresh",
585
+ size: 16,
586
+ color: "#ffffff"
587
+ }),
588
+ onPress: handleResultPlayAgain
589
+ }), /*#__PURE__*/_jsx(MonflowtsButton, {
590
+ title: lastAmountWon > 0 ? t('dice.battle.collectExit') : t('dice.battle.exit'),
591
+ variant: "outline",
592
+ onPress: handleResultExit,
593
+ style: {
594
+ marginTop: 12
595
+ }
596
+ })]
597
+ })]
598
+ })
599
+ })
600
+ })]
601
+ });
602
+ };
603
+ const styles = StyleSheet.create({
604
+ container: {
605
+ flex: 1,
606
+ backgroundColor: COLORS.backgroundDark,
607
+ paddingTop: 50
608
+ },
609
+ header: {
610
+ flexDirection: 'row',
611
+ alignItems: 'center',
612
+ justifyContent: 'space-between',
613
+ paddingHorizontal: 20,
614
+ paddingBottom: 12
615
+ },
616
+ backBtn: {
617
+ width: 40,
618
+ height: 40,
619
+ borderRadius: 20,
620
+ backgroundColor: 'rgba(15,23,42,0.6)',
621
+ borderWidth: 1,
622
+ borderColor: COLORS.white10,
623
+ alignItems: 'center',
624
+ justifyContent: 'center'
625
+ },
626
+ backText: {
627
+ color: '#fff',
628
+ fontSize: 22
629
+ },
630
+ headerCenter: {
631
+ alignItems: 'center'
632
+ },
633
+ headerTag: {
634
+ fontSize: 9,
635
+ fontWeight: '800',
636
+ color: COLORS.blue,
637
+ letterSpacing: 3,
638
+ marginBottom: 2
639
+ },
640
+ headerTitle: {
641
+ fontSize: 18,
642
+ fontWeight: '700',
643
+ color: '#fff'
644
+ },
645
+ roundBadge: {
646
+ width: 40,
647
+ height: 40,
648
+ borderRadius: 20,
649
+ backgroundColor: COLORS.white05,
650
+ borderWidth: 1,
651
+ borderColor: COLORS.white10,
652
+ alignItems: 'center',
653
+ justifyContent: 'center'
654
+ },
655
+ roundText: {
656
+ fontSize: 13,
657
+ fontWeight: '700',
658
+ color: COLORS.primary
659
+ },
660
+ stakeBar: {
661
+ flexDirection: 'row',
662
+ justifyContent: 'space-between',
663
+ marginHorizontal: 20,
664
+ paddingHorizontal: 16,
665
+ paddingVertical: 8,
666
+ backgroundColor: COLORS.white05,
667
+ borderRadius: 12,
668
+ borderWidth: 1,
669
+ borderColor: COLORS.white10,
670
+ marginBottom: 12
671
+ },
672
+ stakeLabel: {
673
+ fontSize: 11,
674
+ fontWeight: '700',
675
+ color: COLORS.slateLight
676
+ },
677
+ stakePrize: {
678
+ fontSize: 11,
679
+ fontWeight: '700',
680
+ color: COLORS.gold
681
+ },
682
+ cardsArea: {
683
+ flex: 1,
684
+ paddingHorizontal: 20
685
+ },
686
+ vsSeparator: {
687
+ alignItems: 'center',
688
+ paddingVertical: 8
689
+ },
690
+ vsText: {
691
+ fontSize: 14,
692
+ fontWeight: '800',
693
+ color: 'rgba(255,255,255,0.15)',
694
+ fontStyle: 'italic'
695
+ },
696
+ historySection: {
697
+ paddingHorizontal: 20,
698
+ marginBottom: 12
699
+ },
700
+ historyTitle: {
701
+ fontSize: 10,
702
+ fontWeight: '700',
703
+ color: COLORS.slateDark,
704
+ letterSpacing: 2,
705
+ marginBottom: 8,
706
+ textTransform: 'uppercase'
707
+ },
708
+ historyCard: {
709
+ paddingHorizontal: 14,
710
+ paddingVertical: 8,
711
+ borderRadius: 12,
712
+ marginRight: 8,
713
+ backgroundColor: COLORS.white05,
714
+ borderWidth: 1,
715
+ borderColor: COLORS.white10,
716
+ alignItems: 'center'
717
+ },
718
+ historyRound: {
719
+ fontSize: 10,
720
+ color: COLORS.slateLight,
721
+ fontWeight: '700'
722
+ },
723
+ historyResult: {
724
+ fontSize: 12,
725
+ fontWeight: '800',
726
+ marginTop: 2
727
+ },
728
+ footer: {
729
+ paddingHorizontal: 20,
730
+ paddingBottom: 30
731
+ },
732
+ rollBtnText: {
733
+ fontSize: 18,
734
+ fontWeight: '800',
735
+ color: '#fff',
736
+ letterSpacing: 2
737
+ },
738
+ expiredOverlay: {
739
+ ...StyleSheet.absoluteFill,
740
+ backgroundColor: 'rgba(0,0,0,0.85)',
741
+ zIndex: 200,
742
+ alignItems: 'center',
743
+ justifyContent: 'center',
744
+ paddingHorizontal: 32
745
+ },
746
+ expiredTitle: {
747
+ fontSize: 28,
748
+ fontWeight: '800',
749
+ color: COLORS.lossRed,
750
+ marginBottom: 12
751
+ },
752
+ expiredText: {
753
+ fontSize: 16,
754
+ color: COLORS.slateLight,
755
+ textAlign: 'center',
756
+ marginBottom: 24
757
+ },
758
+ resultOverlay: {
759
+ ...StyleSheet.absoluteFill,
760
+ backgroundColor: 'rgba(0,0,0,0.9)',
761
+ zIndex: 300
762
+ },
763
+ resultScrollContent: {
764
+ flexGrow: 1,
765
+ alignItems: 'center',
766
+ justifyContent: 'center',
767
+ paddingHorizontal: 32,
768
+ paddingVertical: 40
769
+ },
770
+ resultContent: {
771
+ alignItems: 'center',
772
+ maxWidth: 320,
773
+ width: '100%'
774
+ },
775
+ resultTitle: {
776
+ fontSize: 24,
777
+ fontWeight: '800',
778
+ color: '#fff',
779
+ textAlign: 'center',
780
+ marginTop: 16,
781
+ marginBottom: 8
782
+ },
783
+ resultAmount: {
784
+ fontSize: 28,
785
+ fontWeight: '800',
786
+ color: COLORS.gold,
787
+ marginBottom: 4
788
+ },
789
+ resultSubtitle: {
790
+ fontSize: 14,
791
+ color: COLORS.slateLight,
792
+ textAlign: 'center',
793
+ marginBottom: 24,
794
+ lineHeight: 20
795
+ },
796
+ demoHookText: {
797
+ fontSize: 15,
798
+ fontWeight: '800',
799
+ color: COLORS.gold,
800
+ textAlign: 'center',
801
+ marginBottom: 12
802
+ },
803
+ liveCtaButton: {
804
+ backgroundColor: COLORS.winGreen,
805
+ shadowColor: COLORS.winGreen,
806
+ shadowOffset: {
807
+ width: 0,
808
+ height: 4
809
+ },
810
+ shadowOpacity: 0.4,
811
+ shadowRadius: 12
812
+ }
813
+ });
814
+ export default DiceBattle;
815
+ //# sourceMappingURL=DiceBattle.js.map