@opexa/portal-components 0.0.289 → 0.0.290

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 (287) hide show
  1. package/dist/components/Bonus/Bonus.client.js +1 -1
  2. package/dist/components/Cashback/Cashback.client.js +1 -1
  3. package/dist/components/CustomPromo/CustomPromo.js +1 -1
  4. package/dist/components/GameLaunch/GameLaunch.lazy.js +1 -1
  5. package/dist/components/GamesSearch/GamesSearch.js +1 -1
  6. package/dist/components/News/News.js +1 -1
  7. package/dist/components/PortalProvider/FeatureFlag.js +1 -1
  8. package/dist/components/Promo/Promo.client.js +1 -1
  9. package/dist/components/Quests/JourneyQuest.d.ts +1 -0
  10. package/dist/components/Quests/JourneyQuest.js +61 -0
  11. package/dist/components/Quests/Quests.client.js +2 -0
  12. package/dist/components/Search/Search.lazy.js +1 -1
  13. package/dist/constants/GameProvider.d.ts +1 -1
  14. package/dist/constants/GameProvider.js +1 -0
  15. package/dist/ui/AlertDialog/AlertDialog.d.ts +55 -55
  16. package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +5 -5
  17. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  18. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  19. package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
  20. package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
  21. package/dist/ui/Dialog/Dialog.d.ts +55 -55
  22. package/dist/ui/Dialog/dialog.recipe.d.ts +5 -5
  23. package/dist/ui/Drawer/Drawer.d.ts +33 -33
  24. package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
  25. package/dist/ui/Field/Field.d.ts +21 -21
  26. package/dist/ui/Field/field.recipe.d.ts +3 -3
  27. package/package.json +1 -1
  28. package/dist/client/hooks/index.d.ts +0 -65
  29. package/dist/client/hooks/index.js +0 -65
  30. package/dist/client/services/index.d.ts +0 -4
  31. package/dist/client/services/index.js +0 -4
  32. package/dist/client/utils/index.d.ts +0 -3
  33. package/dist/client/utils/index.js +0 -3
  34. package/dist/components/CashbackBonus/CashbackBonus.client.d.ts +0 -2
  35. package/dist/components/CashbackBonus/CashbackBonus.client.js +0 -9
  36. package/dist/components/CashbackBonus/CashbackBonus.d.ts +0 -10
  37. package/dist/components/CashbackBonus/CashbackBonus.js +0 -5
  38. package/dist/components/CashbackBonus/index.d.ts +0 -1
  39. package/dist/components/CashbackBonus/index.js +0 -1
  40. package/dist/components/Disclaimer/ResponsibleGaming.d.ts +0 -10
  41. package/dist/components/Disclaimer/ResponsibleGaming.js +0 -13
  42. package/dist/components/Disclaimer/TermsOfUse.d.ts +0 -11
  43. package/dist/components/Disclaimer/TermsOfUse.js +0 -13
  44. package/dist/components/Empty.d.ts +0 -9
  45. package/dist/components/Empty.js +0 -7
  46. package/dist/components/FeatureFlag/FeatureFlag.d.ts +0 -1
  47. package/dist/components/FeatureFlag/FeatureFlag.js +0 -29
  48. package/dist/components/FeatureFlag/index.d.ts +0 -1
  49. package/dist/components/FeatureFlag/index.js +0 -1
  50. package/dist/components/Games/GameContext.d.ts +0 -2
  51. package/dist/components/Games/GameContext.js +0 -2
  52. package/dist/components/InfiniteScroll.d.ts +0 -10
  53. package/dist/components/InfiniteScroll.js +0 -25
  54. package/dist/components/JackpotCounter/JackpotCounter.client.d.ts +0 -2
  55. package/dist/components/JackpotCounter/JackpotCounter.client.js +0 -66
  56. package/dist/components/JackpotCounter/JackpotCounter.d.ts +0 -17
  57. package/dist/components/JackpotCounter/JackpotCounter.js +0 -21
  58. package/dist/components/JackpotCounter/JackpotCounterItem.d.ts +0 -18
  59. package/dist/components/JackpotCounter/JackpotCounterItem.js +0 -109
  60. package/dist/components/JackpotCounter/JackpotCounterItem.module.css +0 -184
  61. package/dist/components/JackpotCounter/index.d.ts +0 -1
  62. package/dist/components/JackpotCounter/index.js +0 -1
  63. package/dist/components/Jackpots/JackpotDesktop.d.ts +0 -1
  64. package/dist/components/Jackpots/JackpotDesktop.js +0 -45
  65. package/dist/components/Jackpots/JackpotGameProviders.d.ts +0 -5
  66. package/dist/components/Jackpots/JackpotGameProviders.js +0 -41
  67. package/dist/components/Jackpots/JackpotItemDesktop.d.ts +0 -9
  68. package/dist/components/Jackpots/JackpotItemDesktop.js +0 -43
  69. package/dist/components/Jackpots/JackpotItemMobile.d.ts +0 -9
  70. package/dist/components/Jackpots/JackpotItemMobile.js +0 -44
  71. package/dist/components/Jackpots/JackpotMobile.d.ts +0 -1
  72. package/dist/components/Jackpots/JackpotMobile.js +0 -46
  73. package/dist/components/Jackpots/JackpotRules.d.ts +0 -5
  74. package/dist/components/Jackpots/JackpotRules.js +0 -11
  75. package/dist/components/Jackpots/Jackpots.client.d.ts +0 -2
  76. package/dist/components/Jackpots/Jackpots.client.js +0 -29
  77. package/dist/components/Jackpots/JackpotsContext.d.ts +0 -4
  78. package/dist/components/Jackpots/JackpotsContext.js +0 -3
  79. package/dist/components/Jackpots/useJackpotData.d.ts +0 -14
  80. package/dist/components/Jackpots/useJackpotData.js +0 -93
  81. package/dist/components/Jackpots/useJackpotItemData.d.ts +0 -20
  82. package/dist/components/Jackpots/useJackpotItemData.js +0 -87
  83. package/dist/components/KYC/AutoOpen.d.ts +0 -1
  84. package/dist/components/KYC/AutoOpen.js +0 -45
  85. package/dist/components/KYC/CaptureIdDocument.d.ts +0 -1
  86. package/dist/components/KYC/CaptureIdDocument.js +0 -219
  87. package/dist/components/KYC/CaptureSelfie.d.ts +0 -1
  88. package/dist/components/KYC/CaptureSelfie.js +0 -285
  89. package/dist/components/KYC/DisplayImage.d.ts +0 -5
  90. package/dist/components/KYC/DisplayImage.js +0 -8
  91. package/dist/components/KYC/FileUpload.d.ts +0 -10
  92. package/dist/components/KYC/FileUpload.js +0 -72
  93. package/dist/components/KYC/Header.d.ts +0 -1
  94. package/dist/components/KYC/Header.js +0 -8
  95. package/dist/components/KYC/NoCameraError.d.ts +0 -7
  96. package/dist/components/KYC/NoCameraError.js +0 -6
  97. package/dist/components/KYC/PersonOverlayDesktop.d.ts +0 -7
  98. package/dist/components/KYC/PersonOverlayDesktop.js +0 -9
  99. package/dist/components/KYC/Step1.d.ts +0 -1
  100. package/dist/components/KYC/Step1.js +0 -13
  101. package/dist/components/KYC/Step2.d.ts +0 -1
  102. package/dist/components/KYC/Step2.js +0 -13
  103. package/dist/components/KYC/Step3.d.ts +0 -1
  104. package/dist/components/KYC/Step3.js +0 -13
  105. package/dist/components/KYC/Step4.d.ts +0 -1
  106. package/dist/components/KYC/Step4.js +0 -7
  107. package/dist/components/KYC/backup/Header.d.ts +0 -1
  108. package/dist/components/KYC/backup/Header.js +0 -8
  109. package/dist/components/KYC/backup/Indicator.d.ts +0 -1
  110. package/dist/components/KYC/backup/Indicator.js +0 -9
  111. package/dist/components/KYC/backup/KYC.d.ts +0 -1
  112. package/dist/components/KYC/backup/KYC.js +0 -14
  113. package/dist/components/KYC/backup/KYC.lazy.d.ts +0 -1
  114. package/dist/components/KYC/backup/KYC.lazy.js +0 -26
  115. package/dist/components/KYC/backup/KYCContext.d.ts +0 -6
  116. package/dist/components/KYC/backup/KYCContext.js +0 -2
  117. package/dist/components/KYC/backup/Step1.d.ts +0 -1
  118. package/dist/components/KYC/backup/Step1.js +0 -13
  119. package/dist/components/KYC/backup/Step2.d.ts +0 -1
  120. package/dist/components/KYC/backup/Step2.js +0 -13
  121. package/dist/components/KYC/backup/Step3.d.ts +0 -1
  122. package/dist/components/KYC/backup/Step3.js +0 -13
  123. package/dist/components/KYC/backup/Step4.d.ts +0 -1
  124. package/dist/components/KYC/backup/Step4.js +0 -7
  125. package/dist/components/KYC/backup/useKYC.d.ts +0 -10
  126. package/dist/components/KYC/backup/useKYC.js +0 -8
  127. package/dist/components/KYC/loadModels.d.ts +0 -1
  128. package/dist/components/KYC/loadModels.js +0 -9
  129. package/dist/components/KYC/utils.d.ts +0 -9
  130. package/dist/components/KYC/utils.js +0 -79
  131. package/dist/components/Messages/Message.d.ts +0 -1
  132. package/dist/components/Messages/Message.js +0 -34
  133. package/dist/components/Messages/MessageContext.d.ts +0 -6
  134. package/dist/components/Messages/MessageContext.js +0 -2
  135. package/dist/components/Messages/MessageItem.d.ts +0 -4
  136. package/dist/components/Messages/MessageItem.js +0 -34
  137. package/dist/components/Messages/MessagePopup.d.ts +0 -1
  138. package/dist/components/Messages/MessagePopup.js +0 -19
  139. package/dist/components/Messages/MessageTrigger.d.ts +0 -8
  140. package/dist/components/Messages/MessageTrigger.js +0 -19
  141. package/dist/components/Promo/PromoContent.d.ts +0 -2
  142. package/dist/components/Promo/PromoContent.js +0 -9
  143. package/dist/components/Promos/PromoCarousel.d.ts +0 -2
  144. package/dist/components/Promos/PromoCarousel.js +0 -41
  145. package/dist/components/Promos/PromoGrid.d.ts +0 -2
  146. package/dist/components/Promos/PromoGrid.js +0 -12
  147. package/dist/components/Promos/PromoItem.d.ts +0 -7
  148. package/dist/components/Promos/PromoItem.js +0 -10
  149. package/dist/components/Quests/CountdownTimer.d.ts +0 -15
  150. package/dist/components/Quests/CountdownTimer.js +0 -33
  151. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.d.ts +0 -4
  152. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.js +0 -78
  153. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.d.ts +0 -8
  154. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.js +0 -9
  155. package/dist/components/Quests/OnboardingQuest/OnboardingQuest.d.ts +0 -4
  156. package/dist/components/Quests/OnboardingQuest/OnboardingQuest.js +0 -4
  157. package/dist/components/Quests/WageringQuest/WageringQuest.d.ts +0 -4
  158. package/dist/components/Quests/WageringQuest/WageringQuest.js +0 -20
  159. package/dist/components/Quests/WageringQuest/WageringQuestModal.d.ts +0 -9
  160. package/dist/components/Quests/WageringQuest/WageringQuestModal.js +0 -9
  161. package/dist/components/SignUp/SignUp.lazy.d.ts +0 -12
  162. package/dist/components/SignUp/SignUp.lazy.js +0 -18
  163. package/dist/components/SignUp/SignUpContext.d.ts +0 -6
  164. package/dist/components/SignUp/SignUpContext.js +0 -2
  165. package/dist/components/SignUp/SignUpDefault/SignUp.lazy.d.ts +0 -17
  166. package/dist/components/SignUp/SignUpDefault/SignUp.lazy.js +0 -18
  167. package/dist/components/SignUp/SignUpDefault/SignUpContext.d.ts +0 -6
  168. package/dist/components/SignUp/SignUpDefault/SignUpContext.js +0 -2
  169. package/dist/components/SignUp/SignUpDefault/SignUpForm.d.ts +0 -1
  170. package/dist/components/SignUp/SignUpDefault/SignUpForm.js +0 -314
  171. package/dist/components/SignUp/SignUpForm.d.ts +0 -1
  172. package/dist/components/SignUp/SignUpForm.js +0 -288
  173. package/dist/components/SignUp/SignUpKYC/CaptureIdDocument.d.ts +0 -1
  174. package/dist/components/SignUp/SignUpKYC/CaptureIdDocument.js +0 -198
  175. package/dist/components/SignUp/SignUpKYC/CaptureSelfie.d.ts +0 -1
  176. package/dist/components/SignUp/SignUpKYC/CaptureSelfie.js +0 -251
  177. package/dist/components/SignUp/SignUpKYC/ImageUploader.d.ts +0 -10
  178. package/dist/components/SignUp/SignUpKYC/ImageUploader.js +0 -42
  179. package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.d.ts +0 -7
  180. package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.js +0 -9
  181. package/dist/components/SignUp/SignUpKYC/SignUpFormKYC.d.ts +0 -1
  182. package/dist/components/SignUp/SignUpKYC/SignUpFormKYC.js +0 -464
  183. package/dist/components/SignUp/SignUpKYC/useImageUploader.d.ts +0 -11
  184. package/dist/components/SignUp/SignUpKYC/useImageUploader.js +0 -20
  185. package/dist/components/SignUp/SignUpKYC/utils.d.ts +0 -9
  186. package/dist/components/SignUp/SignUpKYC/utils.js +0 -79
  187. package/dist/components/TournamentCounter/TournamentCounter.client.d.ts +0 -2
  188. package/dist/components/TournamentCounter/TournamentCounter.client.js +0 -50
  189. package/dist/components/TournamentCounter/TournamentCounter.d.ts +0 -8
  190. package/dist/components/TournamentCounter/TournamentCounter.js +0 -21
  191. package/dist/components/TournamentCounter/TournamentCounterItem.d.ts +0 -8
  192. package/dist/components/TournamentCounter/TournamentCounterItem.js +0 -106
  193. package/dist/components/TournamentCounter/index.d.ts +0 -1
  194. package/dist/components/TournamentCounter/index.js +0 -1
  195. package/dist/components/Tournaments/TournamentDesktop.d.ts +0 -1
  196. package/dist/components/Tournaments/TournamentDesktop.js +0 -57
  197. package/dist/components/Tournaments/TournamentGameProviders.d.ts +0 -5
  198. package/dist/components/Tournaments/TournamentGameProviders.js +0 -38
  199. package/dist/components/Tournaments/TournamentItemDesktop.d.ts +0 -7
  200. package/dist/components/Tournaments/TournamentItemDesktop.js +0 -56
  201. package/dist/components/Tournaments/TournamentItemMobile.d.ts +0 -7
  202. package/dist/components/Tournaments/TournamentItemMobile.js +0 -54
  203. package/dist/components/Tournaments/TournamentMobile.d.ts +0 -1
  204. package/dist/components/Tournaments/TournamentMobile.js +0 -55
  205. package/dist/components/Tournaments/TournamentRules.d.ts +0 -5
  206. package/dist/components/Tournaments/TournamentRules.js +0 -11
  207. package/dist/components/Tournaments/Tournaments.client.d.ts +0 -2
  208. package/dist/components/Tournaments/Tournaments.client.js +0 -20
  209. package/dist/components/Tournaments/TournamentsContext.d.ts +0 -4
  210. package/dist/components/Tournaments/TournamentsContext.js +0 -3
  211. package/dist/components/Tournaments/useTournamentData.d.ts +0 -10
  212. package/dist/components/Tournaments/useTournamentData.js +0 -72
  213. package/dist/components/Tournaments/useTournamentItemData.d.ts +0 -16
  214. package/dist/components/Tournaments/useTournamentItemData.js +0 -64
  215. package/dist/components/index.d.ts +0 -33
  216. package/dist/components/index.js +0 -33
  217. package/dist/components/shared/IdDocumentField.client.d.ts +0 -25
  218. package/dist/components/shared/IdDocumentField.client.js +0 -204
  219. package/dist/components/shared/IdDocumentField.d.ts +0 -2
  220. package/dist/components/shared/IdDocumentField.js +0 -11
  221. package/dist/components/shared/SelfieField.client.d.ts +0 -20
  222. package/dist/components/shared/SelfieField.client.js +0 -327
  223. package/dist/components/shared/SelfieField.d.ts +0 -2
  224. package/dist/components/shared/SelfieField.js +0 -11
  225. package/dist/constants/BranchCode.d.ts +0 -4
  226. package/dist/constants/BranchCode.js +0 -42
  227. package/dist/constants/endpoints.d.ts +0 -10
  228. package/dist/constants/endpoints.js +0 -41
  229. package/dist/constants/envVars.d.ts +0 -5
  230. package/dist/constants/envVars.js +0 -28
  231. package/dist/constants/gameProviders.d.ts +0 -76
  232. package/dist/constants/gameProviders.js +0 -361
  233. package/dist/constants/gameTypes.d.ts +0 -3
  234. package/dist/constants/gameTypes.js +0 -64
  235. package/dist/constants/headerKeys.d.ts +0 -2
  236. package/dist/constants/headerKeys.js +0 -2
  237. package/dist/constants/secretQuestions.d.ts +0 -3
  238. package/dist/constants/secretQuestions.js +0 -24
  239. package/dist/constants/storageKeys.d.ts +0 -2
  240. package/dist/constants/storageKeys.js +0 -2
  241. package/dist/handlers.d.ts +0 -43
  242. package/dist/handlers.js +0 -297
  243. package/dist/icons/BellRingIcon.d.ts +0 -2
  244. package/dist/icons/BellRingIcon.js +0 -4
  245. package/dist/icons/index.d.ts +0 -65
  246. package/dist/icons/index.js +0 -65
  247. package/dist/images/hacksaw-gaming.png +0 -0
  248. package/dist/server/services/index.d.ts +0 -4
  249. package/dist/server/services/index.js +0 -4
  250. package/dist/server/utils/index.d.ts +0 -29
  251. package/dist/server/utils/index.js +0 -29
  252. package/dist/third-parties/FacebookPixel/FacebookPixel.d.ts +0 -4
  253. package/dist/third-parties/FacebookPixel/FacebookPixel.js +0 -4
  254. package/dist/third-parties/FacebookPixel/api.d.ts +0 -0
  255. package/dist/third-parties/FacebookPixel/api.js +0 -1
  256. package/dist/third-parties/FacebookPixel/index.d.ts +0 -1
  257. package/dist/third-parties/FacebookPixel/index.js +0 -1
  258. package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.d.ts +0 -4
  259. package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.js +0 -4
  260. package/dist/third-parties/GoogleRecaptcha/api.d.ts +0 -0
  261. package/dist/third-parties/GoogleRecaptcha/api.js +0 -1
  262. package/dist/third-parties/GoogleRecaptcha/index.d.ts +0 -1
  263. package/dist/third-parties/GoogleRecaptcha/index.js +0 -1
  264. package/dist/third-parties/index.d.ts +0 -2
  265. package/dist/third-parties/index.js +0 -2
  266. package/dist/ui/Presence.d.ts +0 -2
  267. package/dist/ui/Presence.js +0 -7
  268. package/dist/ui/Prose.d.ts +0 -2
  269. package/dist/ui/Prose.js +0 -5
  270. package/dist/ui/index.d.ts +0 -26
  271. package/dist/ui/index.js +0 -26
  272. package/dist/utils/createErrorFromCode.d.ts +0 -2
  273. package/dist/utils/createErrorFromCode.js +0 -11
  274. package/dist/utils/dataUrlToBlob.d.ts +0 -1
  275. package/dist/utils/dataUrlToBlob.js +0 -11
  276. package/dist/utils/gamesAvailable3pmTo3am.d.ts +0 -1
  277. package/dist/utils/gamesAvailable3pmTo3am.js +0 -1
  278. package/dist/utils/getGameName.d.ts +0 -1
  279. package/dist/utils/getGameName.js +0 -6
  280. package/dist/utils/index.d.ts +0 -17
  281. package/dist/utils/index.js +0 -17
  282. package/dist/utils/isBetween3amAnd3pm.d.ts +0 -1
  283. package/dist/utils/isBetween3amAnd3pm.js +0 -5
  284. package/dist/utils/isMobile.d.ts +0 -5
  285. package/dist/utils/isMobile.js +0 -9
  286. package/dist/utils/resizeImageSize.d.ts +0 -1
  287. package/dist/utils/resizeImageSize.js +0 -6
@@ -1,9 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { XIcon } from '../../../icons/XIcon.js';
4
- import { Button } from '../../../ui/Button/index.js';
5
- import { Dialog } from '../../../ui/Dialog/index.js';
6
- import { Portal } from '../../../ui/Portal/index.js';
7
- export function DailyCheckInQuestModal(props) {
8
- return (_jsx(Dialog.Root, { lazyMount: true, unmountOnExit: true, open: props.modalState.isOpen, onOpenChange: ({ open }) => props.modalState.setIsOpen(open), closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)] flex items-center justify-center", children: _jsxs(Dialog.Content, { className: "min-h-auto mx-auto max-w-[343px] rounded-xl px-4 pb-0 pt-5", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "flex flex-col space-y-5", children: [_jsx("p", { className: "text-text-primary-900 text-lg font-semibold", children: "Daily Check-In Rules" }), _jsxs("ul", { className: "text-text-tertiary-600 group list-disc text-wrap pl-4 text-sm font-normal", children: [_jsx("li", { children: "Earn rewards just for checking in each day!" }), _jsx("li", { children: "Stay consistent to unlock special rewards on the 3rd, 5th, and 7th day." }), _jsx("li", { children: "Missing a day will reset your streak, starting again from Day 1." }), _jsx("li", { children: "Each check-in unlocks the next one on the following day." }), _jsx("li", { children: "Successfully check in for 7 consecutive days to complete the quest and reset the cycle." })] })] }), _jsx("div", { className: "pb-4 pt-6", children: _jsx(Button, { onClick: () => props.modalState.setIsOpen(false), children: "Ok" }) })] }) })] }) }));
9
- }
@@ -1,4 +0,0 @@
1
- import type { Quest } from '../../../types';
2
- export declare function OnboardingQuest(props: {
3
- quest: Quest;
4
- }): null;
@@ -1,4 +0,0 @@
1
- export function OnboardingQuest(props) {
2
- console.log('OnboardingQuest not implemented', props.quest);
3
- return null;
4
- }
@@ -1,4 +0,0 @@
1
- import type { Quest } from '../../../types';
2
- export declare function WageringQuest({ quest }: {
3
- quest: Quest;
4
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,20 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { useState } from 'react';
4
- import { twMerge } from 'tailwind-merge';
5
- import { ClockStopWatchIcon } from '../../../icons/ClockStopWatchIcon.js';
6
- import { InfoCircleIcon } from '../../../icons/InfoCircleIcon.js';
7
- import { Badge } from '../../../ui/Badge/index.js';
8
- import CountdownTimer from '../CountdownTimer.js';
9
- import { WageringQuestModal } from './WageringQuestModal.js';
10
- export function WageringQuest({ quest }) {
11
- const [showRules, setShowRules] = useState(false);
12
- const [isExpired, setIsExpired] = useState(false);
13
- const { progressPercentage, turnover, targetTurnover, name, description, endDateTime, bonus, status, } = quest;
14
- return (_jsxs(_Fragment, { children: [_jsx(WageringQuestModal, { questName: name, modalState: {
15
- isOpen: showRules,
16
- setIsOpen: setShowRules,
17
- } }), _jsxs("div", { className: "border-border-primary bg-bg-tertiary flex h-full w-full flex-col space-y-6 rounded-2xl border px-4 pb-6 pt-5", children: [_jsxs("div", { className: "flex flex-col space-y-2", children: [_jsxs("div", { className: "flex max-h-7.5 items-start justify-between", children: [_jsx(CountdownTimer, { endDateTime: endDateTime, renderAction: (timeLeft) => (_jsxs(Badge.Root, { size: "lg", colorScheme: "brand", round: false, children: [_jsx(Badge.Icon, { children: _jsx(ClockStopWatchIcon, {}) }), _jsxs(Badge.Label, { children: [timeLeft.days, "d:", timeLeft.hours, "h:", timeLeft.minutes, "m:", timeLeft.seconds, "s"] })] })), onEnd: () => setIsExpired(true) }), _jsx("div", { role: "button", className: "bg-bg-primary border-border-secondary flex size-9 cursor-pointer items-center justify-center rounded-md border", onClick: () => setShowRules((prev) => !prev), children: _jsx(InfoCircleIcon, { className: "text-text-disabled size-5" }) })] }), _jsx("p", { className: "text-xl font-semibold", children: name }), _jsx("p", { className: "text-text-secondary-700 text-wrap text-sm font-normal", dangerouslySetInnerHTML: { __html: description } })] }), _jsxs("div", { className: "flex w-full flex-col space-y-2", children: [_jsxs("div", { className: "text-text-primary-brand group flex items-center justify-between", children: [_jsxs("p", { children: ["Progress ", parseInt(progressPercentage).toFixed(2), "%"] }), _jsxs("p", { children: [turnover, _jsxs("span", { className: "text-text-quarterary-brand", children: ["/", targetTurnover, " PHP"] })] })] }), _jsx("div", { className: "bg-bg-primary h-2 w-full overflow-hidden rounded-full", children: _jsx("div", { className: "bg-utility-brand-600 h-full rounded-full transition-all duration-300", style: { width: `${progressPercentage}%` } }) })] }), _jsx("div", { className: "flex h-full items-end", children: _jsx("div", { className: "bg-button-secondary-bg border-bg-primary-hover w-full rounded-md border px-3.5 py-2.5 text-center text-white", children: _jsxs("p", { className: twMerge(isExpired || status === 'COMPLETED' || status === 'FAILED'
18
- ? ['opacity-50 grayscale']
19
- : ''), children: ["Complete to get ", _jsxs("span", { className: "text-brand-400", children: ["\u20B1", bonus] }), ' ', "bonus!"] }) }) })] })] }));
20
- }
@@ -1,9 +0,0 @@
1
- interface Props {
2
- questName: string;
3
- modalState: {
4
- isOpen: boolean;
5
- setIsOpen: (isOpen: boolean) => void;
6
- };
7
- }
8
- export declare function WageringQuestModal(props: Props): import("react/jsx-runtime").JSX.Element;
9
- export {};
@@ -1,9 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { XIcon } from '../../../icons/XIcon.js';
4
- import { Button } from '../../../ui/Button/index.js';
5
- import { Dialog } from '../../../ui/Dialog/index.js';
6
- import { Portal } from '../../../ui/Portal/index.js';
7
- export function WageringQuestModal(props) {
8
- return (_jsx(Dialog.Root, { lazyMount: true, unmountOnExit: true, open: props.modalState.isOpen, onOpenChange: ({ open }) => props.modalState.setIsOpen(open), closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)] flex items-center justify-center", children: _jsxs(Dialog.Content, { className: "min-h-auto mx-auto max-w-[343px] rounded-xl px-4 pb-0 pt-5", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "flex flex-col space-y-5", children: [_jsx("p", { className: "text-text-primary-900 text-lg font-semibold", children: props.questName }), _jsxs("ul", { className: "text-text-tertiary-600 group list-disc text-wrap pl-4 text-sm font-normal", children: [_jsx("li", { children: "Earn extra rewards just by playing Slots, every bet counts, win or lose!" }), _jsx("li", { children: "Reach the wagering requirement in bets to complete the quest and claim your reward." })] })] }), _jsx("div", { className: "pb-4 pt-6", children: _jsx(Button, { onClick: () => props.modalState.setIsOpen(false), children: "Ok" }) })] }) })] }) }));
9
- }
@@ -1,12 +0,0 @@
1
- import { type ImageProps } from 'next/image';
2
- import { type ReactNode } from 'react';
3
- import type { Branch } from '../../types';
4
- export interface SignUpProps {
5
- logo: ImageProps['src'];
6
- children?: ReactNode;
7
- /** @default "/terms-and-conditions" */
8
- termsAndConditionsUrl?: string;
9
- className?: string;
10
- branches?: Branch[];
11
- }
12
- export declare function SignUp(props: SignUpProps): import("react/jsx-runtime").JSX.Element;
@@ -1,18 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import Image, {} from 'next/image';
4
- import { Suspense } from 'react';
5
- import { twMerge } from 'tailwind-merge';
6
- import { useShallow } from 'zustand/shallow';
7
- import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
8
- import { XIcon } from '../../icons/XIcon.js';
9
- import { Dialog } from '../../ui/Dialog/index.js';
10
- import { Portal } from '../../ui/Portal/index.js';
11
- import { SignUpPropsProvider } from './SignUpContext.js';
12
- import { SignUpForm } from './SignUpForm.js';
13
- export function SignUp(props) {
14
- const signUpStore = useGlobalStore(useShallow((ctx) => ctx.signUp));
15
- return (_jsx(SignUpPropsProvider, { value: props, children: _jsx(Dialog.Root, { open: signUpStore.open, onOpenChange: (details) => {
16
- signUpStore.setOpen(details.open);
17
- }, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: twMerge('bg-bg-primary-alt mx-auto h-full w-full items-start p-3xl pb-4xl lg:h-auto lg:w-[400px] lg:rounded-xl', props.className), children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto h-auto w-[120px]", draggable: false }), _jsx(Suspense, { children: _jsx(SignUpForm, {}) })] }) })] }) }) }));
18
- }
@@ -1,6 +0,0 @@
1
- import type { SignUpProps } from './SignUp.lazy';
2
- export declare const SignUpPropsProvider: (props: {
3
- value: SignUpProps;
4
- } & {
5
- children?: import("react").ReactNode | undefined;
6
- }) => React.ReactNode, useSignUpPropsContext: () => SignUpProps;
@@ -1,2 +0,0 @@
1
- import { createContext } from '../../client/utils/createContext.js';
2
- export const [SignUpPropsProvider, useSignUpPropsContext] = createContext();
@@ -1,17 +0,0 @@
1
- import { type ImageProps } from 'next/image';
2
- import { type ReactNode } from 'react';
3
- import type { Branch } from '../../../types';
4
- export interface SignUpProps {
5
- logo: ImageProps['src'];
6
- children?: ReactNode;
7
- /** @default "/terms-and-conditions" */
8
- termsAndConditionsUrl?: string;
9
- termsOfUseContent?: ReactNode;
10
- responsibleGamingContent?: ReactNode;
11
- responsibleGamingLogo?: ImageProps['src'];
12
- siteName?: string;
13
- className?: string;
14
- branches?: Branch[];
15
- layout: 'default';
16
- }
17
- export declare function SignUp(props: SignUpProps): import("react/jsx-runtime").JSX.Element;
@@ -1,18 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import Image, {} from 'next/image';
4
- import { Suspense } from 'react';
5
- import { twMerge } from 'tailwind-merge';
6
- import { useShallow } from 'zustand/shallow';
7
- import { useGlobalStore } from '../../../client/hooks/useGlobalStore.js';
8
- import { XIcon } from '../../../icons/XIcon.js';
9
- import { Dialog } from '../../../ui/Dialog/index.js';
10
- import { Portal } from '../../../ui/Portal/index.js';
11
- import { SignUpPropsProvider } from './SignUpContext.js';
12
- import { SignUpForm } from './SignUpForm.js';
13
- export function SignUp(props) {
14
- const signUpStore = useGlobalStore(useShallow((ctx) => ctx.signUp));
15
- return (_jsx(SignUpPropsProvider, { value: props, children: _jsx(Dialog.Root, { open: signUpStore.open, onOpenChange: (details) => {
16
- signUpStore.setOpen(details.open);
17
- }, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: twMerge('bg-bg-primary-alt mx-auto h-full w-full items-start overflow-y-auto p-3xl pb-4xl lg:h-auto lg:w-[400px] lg:rounded-xl', props.className), children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto h-auto w-[120px]", draggable: false }), _jsx(Suspense, { children: _jsx(SignUpForm, {}) })] }) })] }) }) }));
18
- }
@@ -1,6 +0,0 @@
1
- import type { SignUpProps } from './SignUp.lazy';
2
- export declare const SignUpPropsProvider: (props: {
3
- value: SignUpProps;
4
- } & {
5
- children?: import("react").ReactNode | undefined;
6
- }) => React.ReactNode, useSignUpPropsContext: () => SignUpProps;
@@ -1,2 +0,0 @@
1
- import { createContext } from '../../../client/utils/createContext.js';
2
- export const [SignUpPropsProvider, useSignUpPropsContext] = createContext();
@@ -1 +0,0 @@
1
- export declare function SignUpForm(): import("react/jsx-runtime").JSX.Element;
@@ -1,314 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { createListCollection, parseDate } from '@ark-ui/react';
4
- import { zodResolver } from '@hookform/resolvers/zod';
5
- import { ObjectId } from '@opexa/object-id';
6
- import { differenceInYears, format } from 'date-fns';
7
- import { useSearchParams } from 'next/navigation';
8
- import { useEffect, useRef, useState } from 'react';
9
- import { Controller, useForm } from 'react-hook-form';
10
- import { twMerge } from 'tailwind-merge';
11
- import { z } from 'zod';
12
- import { useShallow } from 'zustand/shallow';
13
- import { useControllableState } from '../../../client/hooks/useControllableState.js';
14
- import { useCooldown } from '../../../client/hooks/useCooldown.js';
15
- import { useGlobalStore } from '../../../client/hooks/useGlobalStore.js';
16
- import { useLocaleInfo } from '../../../client/hooks/useLocaleInfo.js';
17
- import { useMobileNumberParser } from '../../../client/hooks/useMobileNumberParser.js';
18
- import { useSendVerificationCodeMutation } from '../../../client/hooks/useSendVerificationCodeMutation.js';
19
- import { useSignInMutation } from '../../../client/hooks/useSignInMutation.js';
20
- import { useSignUpMutation } from '../../../client/hooks/useSignUpMutation.js';
21
- import { useUpdateAccountMutation } from '../../../client/hooks/useUpdateAccountMutation.js';
22
- import { toaster } from '../../../client/utils/toaster.js';
23
- import { BRANCHES } from '../../../constants/index.js';
24
- import { ArrowLeftIcon } from '../../../icons/ArrowLeftIcon.js';
25
- import { CalendarIcon } from '../../../icons/CalendarIcon.js';
26
- import { CheckIcon } from '../../../icons/CheckIcon.js';
27
- import { ChevronDownIcon } from '../../../icons/ChevronDownIcon.js';
28
- import { ChevronLeftIcon } from '../../../icons/ChevronLeftIcon.js';
29
- import { ChevronRightIcon } from '../../../icons/ChevronRightIcon.js';
30
- import { HelpCircleIcon } from '../../../icons/HelpCircleIcon.js';
31
- import { ObjectType } from '../../../services/ObjectType.js';
32
- import { Button } from '../../../ui/Button/index.js';
33
- import { Checkbox } from '../../../ui/Checkbox/index.js';
34
- import { DatePicker } from '../../../ui/DatePicker/index.js';
35
- import { Field } from '../../../ui/Field/index.js';
36
- import { PinInput } from '../../../ui/PinInput/index.js';
37
- import { Select } from '../../../ui/Select/index.js';
38
- import { Tooltip } from '../../../ui/Tooltip/index.js';
39
- import { createPoll } from '../../../utils/createPoll.js';
40
- import { ResponsibleGaming } from '../../Disclaimer/ResponsibleGaming.js';
41
- import { TermsOfUse } from '../../Disclaimer/TermsOfUse.js';
42
- import { useSignUpPropsContext } from './SignUpContext.js';
43
- export function SignUpForm() {
44
- const signUpProps = useSignUpPropsContext();
45
- const branchCollection = createListCollection({
46
- items: signUpProps.branches ?? BRANCHES,
47
- itemToValue: (item) => item.code,
48
- itemToString: (item) => `${item.code} - ${item.name}`,
49
- });
50
- const [step, setStep] = useState(1);
51
- const globalStore = useGlobalStore(useShallow((ctx) => ({
52
- kycReminder: ctx.kycReminder,
53
- signIn: ctx.signIn,
54
- signUp: ctx.signUp,
55
- })));
56
- const search = useSearchParams();
57
- const signUpMutation = useSignUpMutation();
58
- const signInMutation = useSignInMutation();
59
- const updateAccountMutation = useUpdateAccountMutation();
60
- const sendVerificationCodeMutation = useSendVerificationCodeMutation();
61
- const localeInfo = useLocaleInfo();
62
- const mobileNumberParser = useMobileNumberParser();
63
- const Step1Definition = z.object({
64
- mobileNumber: z
65
- .string()
66
- .min(1, 'Mobile number is required')
67
- .superRefine((v, ctx) => {
68
- if (!mobileNumberParser.validate(v)) {
69
- ctx.addIssue({
70
- code: z.ZodIssueCode.custom,
71
- message: 'Invalid mobile number',
72
- });
73
- }
74
- }),
75
- termsAccepted: z.boolean().superRefine((v, ctx) => {
76
- if (!v) {
77
- ctx.addIssue({
78
- code: z.ZodIssueCode.custom,
79
- message: 'You must accept the terms and conditions and the responsible gaming guidelines',
80
- });
81
- }
82
- }),
83
- realName: z
84
- .string()
85
- .transform((val) => val.trim())
86
- .refine((val) => val.length >= 2, {
87
- message: 'Real name must be 2 or more characters',
88
- })
89
- .refine((val) => val.length <= 50, {
90
- message: 'Real name must not be more than 50 characters',
91
- }),
92
- birthDay: z
93
- .date({
94
- invalid_type_error: 'Date of birth is required',
95
- required_error: 'Date of birth is required',
96
- })
97
- .superRefine((val, ctx) => {
98
- const now = new Date();
99
- const age = differenceInYears(now, val);
100
- if (age < 21) {
101
- return ctx.addIssue({
102
- code: z.ZodIssueCode.custom,
103
- message: 'You must be at least 21 years old',
104
- });
105
- }
106
- }),
107
- branchCode: z.string().min(1, 'Branch is required').trim(),
108
- });
109
- const Step2Definition = z.object({
110
- verificationCode: z.array(z.string()).superRefine((val, ctx) => {
111
- if (val.length !== 6 || val.some((v) => v.length !== 1)) {
112
- ctx.addIssue({
113
- code: z.ZodIssueCode.custom,
114
- message: 'Please Enter your 6 digits verification code',
115
- });
116
- }
117
- }),
118
- });
119
- const step1Form = useForm({
120
- mode: 'all',
121
- resolver: zodResolver(Step1Definition),
122
- defaultValues: {
123
- mobileNumber: '',
124
- termsAccepted: false,
125
- branchCode: signUpProps?.branches?.[0]?.code ?? BRANCHES[0].code,
126
- realName: '',
127
- },
128
- });
129
- const step2Form = useForm({
130
- resolver: zodResolver(Step2Definition),
131
- defaultValues: {
132
- verificationCode: Array.from({ length: 6 }).fill(''),
133
- },
134
- });
135
- const cooldown = useCooldown({
136
- max: 60,
137
- duration: 1000 * 60,
138
- });
139
- const form2Ref = useRef(null);
140
- const birthDay = step1Form.watch('birthDay');
141
- const branchCode = step1Form.watch('branchCode', '');
142
- const [isTermsOfUseOpen, setTermsOfUseOpen] = useState(false);
143
- const [isResponsibleGamingOpen, setResponsibleGamingOpen] = useState(false);
144
- const [isTermsOfUseAccepted, setIsTermsOfUseAccepted] = useState(false);
145
- const [isResponsibleGamingAccepted, setIsResponsibleGamingAccepted] = useState(false);
146
- useEffect(() => {
147
- if (isTermsOfUseAccepted && isResponsibleGamingAccepted) {
148
- step1Form.setValue('termsAccepted', true);
149
- }
150
- }, [isResponsibleGamingAccepted, isTermsOfUseAccepted, step1Form]);
151
- return (_jsxs(_Fragment, { children: [_jsx(TermsOfUse, { termsOfUseContent: signUpProps.termsOfUseContent ?? 'Terms of Use content', siteName: signUpProps.siteName ?? 'Site', logo: signUpProps.logo, open: isTermsOfUseOpen, onCloseAction: () => {
152
- setIsTermsOfUseAccepted(true);
153
- setTermsOfUseOpen(false);
154
- }, responsibleGamingLogo: signUpProps.responsibleGamingLogo }), _jsx(ResponsibleGaming, { responsibleGamingContent: signUpProps.responsibleGamingContent ?? 'Responsible Gaming content', logo: signUpProps.logo, open: isResponsibleGamingOpen, onCloseAction: () => {
155
- setIsResponsibleGamingAccepted(true);
156
- setResponsibleGamingOpen(false);
157
- }, responsibleGamingLogo: signUpProps.responsibleGamingLogo }), step === 1 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center text-lg font-semibold", children: "Create an account" }), _jsx("p", { className: "text-text-secondary-700 mt-xs text-center text-sm", children: "Register instantly and start playing!" }), _jsxs("form", { className: "mt-3xl", autoComplete: "off", onSubmit: step1Form.handleSubmit(async (data) => {
158
- try {
159
- await sendVerificationCodeMutation.mutateAsync({
160
- channel: 'SMS',
161
- recipient: mobileNumberParser.format(data.mobileNumber),
162
- });
163
- setStep(2);
164
- cooldown.start();
165
- }
166
- catch (e) {
167
- toaster.error({
168
- description: e instanceof Error
169
- ? e.message
170
- : 'Failed to send verification code',
171
- });
172
- }
173
- }), children: [_jsxs(Field.Root, { invalid: !!step1Form.formState.errors.mobileNumber, children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsxs("div", { className: "absolute left-3.5 top-1/2 flex shrink-0 -translate-y-1/2 items-center gap-md", children: [_jsx(localeInfo.country.flag, { className: "size-5" }), _jsx("span", { className: "text-text-placeholder", children: localeInfo.mobileNumber.areaCode })] }), _jsx(Field.Input, { style: {
174
- paddingLeft: `calc(2.75rem + ${localeInfo.mobileNumber.areaCode.length}ch)`,
175
- }, ...step1Form.register('mobileNumber') })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.mobileNumber?.message })] }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.realName, className: "mt-xl", children: [_jsx(Field.Label, { children: "Real Name" }), _jsx(Field.Input, { placeholder: "Enter your real name", ...step1Form.register('realName') }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.realName?.message })] }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.birthDay, className: "mt-xl", children: [_jsx(DateOfBirthField, { value: birthDay, onChange: (value) => {
176
- if (!value)
177
- return;
178
- step1Form.setValue('birthDay', value, {
179
- shouldDirty: true,
180
- shouldTouch: true,
181
- shouldValidate: true,
182
- });
183
- }, onBlur: () => {
184
- step1Form.trigger('birthDay');
185
- } }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.birthDay?.message })] }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.branchCode, className: "mt-xl", children: [_jsxs(Select.Root, { value: [branchCode], onValueChange: (details) => {
186
- step1Form.setValue('branchCode', details.value.at(0) ??
187
- signUpProps?.branches?.[0]?.code ??
188
- BRANCHES[0].code, {
189
- shouldDirty: true,
190
- shouldTouch: true,
191
- shouldValidate: true,
192
- });
193
- }, collection: branchCollection, positioning: {
194
- sameWidth: true,
195
- placement: 'bottom',
196
- }, lazyMount: true, unmountOnExit: true, children: [_jsxs(Select.Label, { className: "flex items-center gap-1", children: ["Branch", _jsxs(Tooltip.Root, { openDelay: 0, closeDelay: 100, lazyMount: true, unmountOnExit: true, positioning: {
197
- placement: 'top',
198
- }, children: [_jsx(Tooltip.Trigger, { children: _jsx(HelpCircleIcon, { className: "text-text-nav-item-button-icon size-4" }) }), _jsx(Tooltip.Positioner, { children: _jsxs(Tooltip.Content, { children: [_jsx(Tooltip.Arrow, { children: _jsx(Tooltip.ArrowTip, {}) }), "Choose branch closest to your residence."] }) })] })] }), _jsxs(Select.Trigger, { children: [_jsx(Select.ValueText, {}), _jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })] }), _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: branchCollection.items.map((item) => {
199
- const label = branchCollection.stringifyItem(item) ?? '';
200
- return (_jsx(Select.Item, { item: item, "aria-disabled": item.disabled, className: twMerge(item.disabled && 'text-border-disabled'), children: _jsx("div", { title: label, className: "line-clamp-1", children: label }) }, item.code));
201
- }) }) })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.branchCode?.message })] }), _jsx(Controller, { control: step1Form.control, name: "termsAccepted", render: (o) => (_jsxs(Field.Root, { className: "mt-2xl", invalid: o.fieldState.invalid, children: [_jsxs(Checkbox.Root, { checked: o.field.value, onCheckedChange: (details) => {
202
- o.field.onChange(details.checked);
203
- if (!details.checked) {
204
- setIsTermsOfUseAccepted(false);
205
- setIsResponsibleGamingAccepted(false);
206
- }
207
- }, children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsxs(Checkbox.Label, { children: ["I am at least 21 years of age and I have read and accept the", ' ', _jsx("button", { type: "button", className: "text-brand-400 underline underline-offset-2", onClick: () => {
208
- setTermsOfUseOpen(true);
209
- }, children: "Terms and Conditions" }), ' ', "and", ' ', _jsx("button", { type: "button", className: "text-brand-400 underline underline-offset-2", onClick: () => {
210
- setResponsibleGamingOpen(true);
211
- }, children: "Responsible Gaming" }), ' ', "guidelines."] }), _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: step1Form.formState.isSubmitting, children: "Create Account" })] }), _jsxs("div", { className: "mt-6 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-tertiary-600", children: "Already have an account?" }), _jsx("button", { type: "submit", className: "text-button-tertiary-fg font-semibold", onClick: () => {
212
- globalStore.signUp.setOpen(false);
213
- globalStore.signIn.setOpen(true);
214
- }, children: "Log In" })] })] })), step === 2 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center text-lg font-semibold", children: "Check your Phone" }), _jsxs("p", { className: "text-text-secondary-700 mt-xs text-center text-sm", children: ["We\u2019ve sent a verification code to your mobile number", ' ', _jsx("span", { className: "font-semibold", children: mobileNumberParser.format(step1Form.getValues('mobileNumber')) }), ' ', "via text"] }), _jsxs("form", { ref: form2Ref, className: "mt-5", onSubmit: step2Form.handleSubmit(async ({ verificationCode }) => {
215
- const id = ObjectId.generate(ObjectType.MemberAccount).toString();
216
- const { mobileNumber } = step1Form.getValues();
217
- try {
218
- await signUpMutation.mutateAsync({
219
- id,
220
- mobileNumber: mobileNumberParser.format(mobileNumber),
221
- verificationCode: verificationCode.join(''),
222
- referralCode: search.get('referralCode') ?? undefined,
223
- btag: search.get('btag') ?? undefined,
224
- });
225
- const name = mobileNumberParser.format(mobileNumber);
226
- const password = `${name}${id}`;
227
- const pollLogin = createPoll(async () => {
228
- try {
229
- await signInMutation.mutateAsync({
230
- type: 'NAME_AND_PASSWORD',
231
- name,
232
- password,
233
- });
234
- return true;
235
- }
236
- catch {
237
- return false;
238
- }
239
- }, {
240
- until: (ok) => ok,
241
- maxAttempt: 5,
242
- });
243
- const ok = await pollLogin();
244
- if (!ok) {
245
- globalStore.signIn.setOpen(true);
246
- return;
247
- }
248
- else {
249
- const pollUpdateAccount = createPoll(async () => {
250
- try {
251
- await updateAccountMutation.mutateAsync({
252
- branchCode: step1Form.getValues('branchCode'),
253
- realName: step1Form.getValues('realName'),
254
- birthDay: format(step1Form.getValues('birthDay'), 'yyyy-MM-dd'),
255
- });
256
- return true;
257
- }
258
- catch {
259
- return false;
260
- }
261
- }, {
262
- until: (ok) => ok,
263
- maxAttempt: 5,
264
- interval: 300,
265
- });
266
- await pollUpdateAccount();
267
- }
268
- globalStore.signUp.setOpen(false);
269
- globalStore.kycReminder.setOpen(true);
270
- step1Form.reset();
271
- step2Form.reset();
272
- setStep(1);
273
- }
274
- catch (error) {
275
- toaster.error({
276
- description: error instanceof Error
277
- ? error.message
278
- : 'Invalid Verification Code',
279
- });
280
- }
281
- }), children: [_jsx(Controller, { name: "verificationCode", control: step2Form.control, render: (o) => (_jsxs(Field.Root, { invalid: o.fieldState.invalid, children: [_jsxs(PinInput.Root, { placeholder: "0", value: o.field.value, onValueChange: (details) => {
282
- o.field.onChange(details.value);
283
- }, onValueComplete: () => {
284
- form2Ref.current?.requestSubmit();
285
- }, blurOnComplete: true, readOnly: step2Form.formState.isSubmitting, type: "numeric", children: [_jsxs(PinInput.Control, { className: "grid-cols-[1fr_1fr_1fr_auto_1fr_1fr_1fr] items-center gap-md", children: [_jsx(PinInput.Input, { index: 0 }), _jsx(PinInput.Input, { index: 1 }), _jsx(PinInput.Input, { index: 2 }), _jsx("span", { className: "text-text-placeholder-subtle text-2xl font-medium", children: "\u2013" }), _jsx(PinInput.Input, { index: 3 }), _jsx(PinInput.Input, { index: 4 }), _jsx(PinInput.Input, { index: 5 })] }), _jsx(PinInput.HiddenInput, {})] }), _jsx(Field.ErrorText, { children: o.formState.errors.verificationCode?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-4xl", disabled: step2Form.formState.isSubmitting, children: "Verify" }), _jsxs("div", { className: "mt-3 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-secondary-700", children: "Didn't recieve the code?" }), _jsx("button", { type: "button", className: "text-button-secondary-fg font-semibold disabled:cursor-not-allowed disabled:opacity-75", disabled: cooldown.cooling, onClick: async () => {
286
- await sendVerificationCodeMutation.mutateAsync({
287
- channel: 'SMS',
288
- recipient: mobileNumberParser.format(step1Form.getValues('mobileNumber')),
289
- });
290
- cooldown.start();
291
- }, children: cooldown.cooling
292
- ? `Resend in ${cooldown.countdown}s`
293
- : 'Resend' })] }), _jsxs("button", { type: "button", className: "text-text-tertiary-600 mx-auto mt-3xl flex w-fit items-center gap-1 text-sm font-semibold", onClick: () => {
294
- setStep(1);
295
- step2Form.reset();
296
- cooldown.stop();
297
- }, children: [_jsx(ArrowLeftIcon, { className: "size-5" }), "Back"] })] })] }))] }));
298
- }
299
- const DEVICE_TIMEZONE = Intl.DateTimeFormat().resolvedOptions().timeZone;
300
- function DateOfBirthField(props) {
301
- const [value, setValue] = useControllableState({
302
- value: props.value,
303
- defaultValue: props.defaultValue ?? null,
304
- onChange: props.onChange,
305
- });
306
- return (_jsxs(DatePicker.Root, { size: "md", variant: "outline", placeholder: "MM/DD/YYYY", lazyMount: true, unmountOnExit: true, fixedWeeks: true, selectionMode: "single", value: value ? [parseDate(value)] : [], onValueChange: (details) => {
307
- const value = details.value.at(0)?.toDate(DEVICE_TIMEZONE);
308
- setValue(value ?? null);
309
- }, children: [_jsx(DatePicker.Label, { children: "Date of Birth" }), _jsxs(DatePicker.Control, { children: [_jsx(DatePicker.Input, { onBlur: props.onBlur, onFocus: props.onFocus }), _jsx(DatePicker.Trigger, { children: _jsx(CalendarIcon, {}) })] }), _jsx(DatePicker.Positioner, { children: _jsxs(DatePicker.Content, { children: [_jsx(DatePicker.View, { view: "day", children: _jsx(DatePicker.Context, { children: (api) => (_jsxs(_Fragment, { children: [_jsxs(DatePicker.ViewControl, { children: [_jsx(DatePicker.PrevTrigger, { children: _jsx(ChevronLeftIcon, {}) }), _jsx(DatePicker.ViewTrigger, { children: _jsx(DatePicker.RangeText, {}) }), _jsx(DatePicker.NextTrigger, { children: _jsx(ChevronRightIcon, {}) })] }), _jsxs(DatePicker.Table, { children: [_jsx(DatePicker.TableHead, { children: _jsx(DatePicker.TableRow, { children: api.weekDays.map((weekDay, id) => (_jsx(DatePicker.TableHeader, { children: weekDay.short.substring(0, 2) }, id))) }) }), _jsx(DatePicker.TableBody, { children: api.weeks.map((week, id) => (_jsx(DatePicker.TableRow, { children: week.map((day, id) => (_jsx(DatePicker.TableCell, { value: day, children: _jsx(DatePicker.TableCellTrigger, { children: day.day }) }, id))) }, id))) })] })] })) }) }), _jsx(DatePicker.View, { view: "month", children: _jsx(DatePicker.Context, { children: (datePicker) => (_jsxs(_Fragment, { children: [_jsxs(DatePicker.ViewControl, { children: [_jsx(DatePicker.PrevTrigger, { children: _jsx(ChevronLeftIcon, {}) }), _jsx(DatePicker.ViewTrigger, { children: _jsx(DatePicker.RangeText, {}) }), _jsx(DatePicker.NextTrigger, { children: _jsx(ChevronRightIcon, {}) })] }), _jsx(DatePicker.Table, { children: _jsx(DatePicker.TableBody, { children: datePicker
310
- .getMonthsGrid({ columns: 4, format: 'short' })
311
- .map((months, id) => (_jsx(DatePicker.TableRow, { children: months.map((month, id) => (_jsx(DatePicker.TableCell, { value: month.value, children: _jsx(DatePicker.TableCellTrigger, { className: "w-[4.425rem]", children: month.label }) }, id))) }, id))) }) })] })) }) }), _jsx(DatePicker.View, { view: "year", children: _jsx(DatePicker.Context, { children: (datePicker) => (_jsxs(_Fragment, { children: [_jsxs(DatePicker.ViewControl, { children: [_jsx(DatePicker.PrevTrigger, { children: _jsx(ChevronLeftIcon, {}) }), _jsx(DatePicker.ViewTrigger, { children: _jsx(DatePicker.RangeText, {}) }), _jsx(DatePicker.NextTrigger, { children: _jsx(ChevronRightIcon, {}) })] }), _jsx(DatePicker.Table, { children: _jsx(DatePicker.TableBody, { children: datePicker
312
- .getYearsGrid({ columns: 4 })
313
- .map((years, id) => (_jsx(DatePicker.TableRow, { children: years.map((year, id) => (_jsx(DatePicker.TableCell, { value: year.value, children: _jsx(DatePicker.TableCellTrigger, { className: "w-[4.425rem]", children: year.label }) }, id))) }, id))) }) })] })) }) })] }) })] }));
314
- }
@@ -1 +0,0 @@
1
- export declare function SignUpForm(): import("react/jsx-runtime").JSX.Element;