@opexa/portal-components 0.0.451 → 0.0.454

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 (52) hide show
  1. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
  2. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts +1 -1
  3. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.d.ts +2 -2
  4. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.d.ts +1 -1
  5. package/dist/components/DepositWithdrawal/Withdrawal/GCashWithdrawal/GCashWithdrawal.js +91 -83
  6. package/dist/components/Quests/JourneyQuest.js +9 -8
  7. package/dist/components/Quests/MultiWageringQuest.d.ts +1 -0
  8. package/dist/components/Quests/MultiWageringQuest.js +91 -0
  9. package/dist/components/Quests/Quests.client.js +7 -1
  10. package/dist/constants/GameProvider.js +7 -0
  11. package/dist/images/game-providers/SAGAMING.png +0 -0
  12. package/dist/services/queries.d.ts +2 -2
  13. package/dist/services/queries.js +7 -0
  14. package/dist/styles/theme.css +3 -0
  15. package/dist/types/index.d.ts +10 -2
  16. package/dist/ui/AlertDialog/AlertDialog.d.ts +88 -88
  17. package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +8 -8
  18. package/dist/ui/Badge/Badge.d.ts +12 -12
  19. package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
  20. package/dist/ui/Badge/badge.recipe.d.ts +3 -3
  21. package/dist/ui/Carousel/Carousel.d.ts +99 -99
  22. package/dist/ui/Carousel/carousel.recipe.d.ts +11 -11
  23. package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
  24. package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
  25. package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
  26. package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
  27. package/dist/ui/Collapsible/Collapsible.d.ts +20 -20
  28. package/dist/ui/Collapsible/collapsible.recipe.d.ts +5 -5
  29. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  30. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  31. package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
  32. package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
  33. package/dist/ui/Dialog/Dialog.d.ts +33 -33
  34. package/dist/ui/Dialog/dialog.recipe.d.ts +3 -3
  35. package/dist/ui/Drawer/Drawer.d.ts +33 -33
  36. package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
  37. package/dist/ui/Menu/Menu.d.ts +252 -252
  38. package/dist/ui/Menu/menu.recipe.d.ts +14 -14
  39. package/dist/ui/Popover/Popover.d.ts +55 -55
  40. package/dist/ui/Popover/popover.recipe.d.ts +5 -5
  41. package/dist/ui/Progress/Progress.d.ts +27 -27
  42. package/dist/ui/Progress/progress.recipe.d.ts +3 -3
  43. package/dist/ui/QrCode/QrCode.d.ts +25 -25
  44. package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
  45. package/dist/ui/Select/Select.d.ts +45 -45
  46. package/dist/ui/Select/select.recipe.d.ts +3 -3
  47. package/dist/ui/Table/Table.d.ts +21 -21
  48. package/dist/ui/Table/table.anatomy.d.ts +1 -1
  49. package/dist/ui/Table/table.recipe.d.ts +3 -3
  50. package/dist/ui/Tabs/Tabs.d.ts +15 -15
  51. package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
  52. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  export declare const OnlineBankDepositContext: (props: {
2
2
  value: {
3
- view: "vca" | "form";
3
+ view: "form" | "vca";
4
4
  status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
5
5
  verify: () => void;
6
6
  reset: () => void;
@@ -13,7 +13,7 @@ export declare const OnlineBankDepositContext: (props: {
13
13
  } & {
14
14
  children?: import("react").ReactNode | undefined;
15
15
  }) => React.ReactNode, useOnlineBankDepositContext: () => {
16
- view: "vca" | "form";
16
+ view: "form" | "vca";
17
17
  status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
18
18
  verify: () => void;
19
19
  reset: () => void;
@@ -1,7 +1,7 @@
1
1
  import type { Deposit } from '../../../../types';
2
2
  export type UseOnlineBankDepositReturn = ReturnType<typeof useOnlineBankDeposit>;
3
3
  export declare function useOnlineBankDeposit(): {
4
- view: "vca" | "form";
4
+ view: "form" | "vca";
5
5
  status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
6
6
  verify: () => void;
7
7
  reset: () => void;
@@ -1,6 +1,6 @@
1
1
  export declare const QRPHDepositContext: (props: {
2
2
  value: {
3
- view: "qrCode" | "form";
3
+ view: "form" | "qrCode";
4
4
  status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
5
5
  verify: () => void;
6
6
  reset: () => void;
@@ -13,7 +13,7 @@ export declare const QRPHDepositContext: (props: {
13
13
  } & {
14
14
  children?: import("react").ReactNode | undefined;
15
15
  }) => React.ReactNode, useQRPHDepositContext: () => {
16
- view: "qrCode" | "form";
16
+ view: "form" | "qrCode";
17
17
  status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
18
18
  verify: () => void;
19
19
  reset: () => void;
@@ -1,7 +1,7 @@
1
1
  import type { Deposit } from '../../../../types';
2
2
  export type UseQRPHDepositReturn = ReturnType<typeof useQRPHDeposit>;
3
3
  export declare function useQRPHDeposit(): {
4
- view: "qrCode" | "form";
4
+ view: "form" | "qrCode";
5
5
  status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
6
6
  verify: () => void;
7
7
  reset: () => void;
@@ -1,35 +1,35 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { zodResolver } from "@hookform/resolvers/zod";
3
- import Link from "next/link";
4
- import { useEffect, useState } from "react";
5
- import { Controller, useForm } from "react-hook-form";
6
- import { z } from "zod";
7
- import { useShallow } from "zustand/shallow";
8
- import { useCreateGCashWithdrawalMutation } from "../../../../client/hooks/useCreateGCashWithdrawalMutation.js";
9
- import { useCreateGCashStandardCashInWithdrawalMutation } from "../../../../client/hooks/useCreateGCashStandardCashInWithdrawal.js";
10
- import { useGlobalStore } from "../../../../client/hooks/useGlobalStore.js";
11
- import { useLocaleInfo } from "../../../../client/hooks/useLocaleInfo.js";
12
- import { useMobileNumberParser } from "../../../../client/hooks/useMobileNumberParser.js";
13
- import { usePaymentSettingsQuery } from "../../../../client/hooks/usePaymentSettingsQuery.js";
14
- import { AlertCircleIcon } from "../../../../icons/AlertCircleIcon.js";
15
- import { ChevronDownIcon } from "../../../../icons/ChevronDownIcon.js";
16
- import { ChevronUpIcon } from "../../../../icons/ChevronUpIcon.js";
17
- import { EyeIcon } from "../../../../icons/EyeIcon.js";
18
- import { EyeOffIcon } from "../../../../icons/EyeOffIcon.js";
19
- import { SpinnerIcon } from "../../../../icons/SpinnerIcon.js";
20
- import { XIcon } from "../../../../icons/XIcon.js";
21
- import { AlertDialog } from "../../../../ui/AlertDialog/index.js";
22
- import { Button } from "../../../../ui/Button/index.js";
23
- import { Field } from "../../../../ui/Field/index.js";
24
- import { NumberInput } from "../../../../ui/NumberInput/index.js";
25
- import { PasswordInput } from "../../../../ui/PasswordInput/index.js";
26
- import { Portal } from "../../../../ui/Portal/index.js";
27
- import { parseDecimal } from "../../../../utils/parseDecimal.js";
28
- import { AmountChoices } from "../../AmountChoices.js";
29
- import { useDepositWithdrawalPropsContext } from "../../DepositWithdrawalContext.js";
30
- import { explainError } from "../../utils.js";
31
- import { TransactionPasswordNotSet } from "../TransactionPasswordNotSet.js";
32
- import { useFeatureFlag } from "../../../../client/hooks/useFeatureFlag.js";
2
+ import { zodResolver } from '@hookform/resolvers/zod';
3
+ import Link from 'next/link';
4
+ import { useEffect, useState } from 'react';
5
+ import { Controller, useForm } from 'react-hook-form';
6
+ import { z } from 'zod';
7
+ import { useShallow } from 'zustand/shallow';
8
+ import { useCreateGCashStandardCashInWithdrawalMutation } from '../../../../client/hooks/useCreateGCashStandardCashInWithdrawal.js';
9
+ import { useCreateGCashWithdrawalMutation } from '../../../../client/hooks/useCreateGCashWithdrawalMutation.js';
10
+ import { useFeatureFlag } from '../../../../client/hooks/useFeatureFlag.js';
11
+ import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
12
+ import { useLocaleInfo } from '../../../../client/hooks/useLocaleInfo.js';
13
+ import { useMobileNumberParser } from '../../../../client/hooks/useMobileNumberParser.js';
14
+ import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSettingsQuery.js';
15
+ import { AlertCircleIcon } from '../../../../icons/AlertCircleIcon.js';
16
+ import { ChevronDownIcon } from '../../../../icons/ChevronDownIcon.js';
17
+ import { ChevronUpIcon } from '../../../../icons/ChevronUpIcon.js';
18
+ import { EyeIcon } from '../../../../icons/EyeIcon.js';
19
+ import { EyeOffIcon } from '../../../../icons/EyeOffIcon.js';
20
+ import { SpinnerIcon } from '../../../../icons/SpinnerIcon.js';
21
+ import { XIcon } from '../../../../icons/XIcon.js';
22
+ import { AlertDialog } from '../../../../ui/AlertDialog/index.js';
23
+ import { Button } from '../../../../ui/Button/index.js';
24
+ import { Field } from '../../../../ui/Field/index.js';
25
+ import { NumberInput } from '../../../../ui/NumberInput/index.js';
26
+ import { PasswordInput } from '../../../../ui/PasswordInput/index.js';
27
+ import { Portal } from '../../../../ui/Portal/index.js';
28
+ import { parseDecimal } from '../../../../utils/parseDecimal.js';
29
+ import { AmountChoices } from '../../AmountChoices.js';
30
+ import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
31
+ import { explainError } from '../../utils.js';
32
+ import { TransactionPasswordNotSet } from '../TransactionPasswordNotSet.js';
33
33
  export function GCashWithdrawal() {
34
34
  const depositWithdrawalProps = useDepositWithdrawalPropsContext();
35
35
  const featureFlag = useFeatureFlag();
@@ -37,34 +37,33 @@ export function GCashWithdrawal() {
37
37
  depositWithdrawal: ctx.depositWithdrawal,
38
38
  hasPendingBonus: ctx.pendingBonus,
39
39
  })));
40
- const [status, setStatus] = useState("waiting");
40
+ const [status, setStatus] = useState('waiting');
41
41
  const localeInfo = useLocaleInfo();
42
42
  const mobileNumberParser = useMobileNumberParser();
43
- const createWithdrawalMutation = featureFlag.enabled
44
- ? useCreateGCashStandardCashInWithdrawalMutation({
45
- onMutate() {
46
- setStatus("processing");
47
- },
48
- onSuccess() {
49
- setStatus("success");
50
- form.reset();
51
- },
52
- onError() {
53
- setStatus("failed");
54
- },
55
- })
56
- : useCreateGCashWithdrawalMutation({
57
- onMutate() {
58
- setStatus("processing");
59
- },
60
- onSuccess() {
61
- setStatus("success");
62
- form.reset();
63
- },
64
- onError() {
65
- setStatus("failed");
66
- },
67
- });
43
+ const createWithdrawalMutationNext = useCreateGCashStandardCashInWithdrawalMutation({
44
+ onMutate() {
45
+ setStatus('processing');
46
+ },
47
+ onSuccess() {
48
+ setStatus('success');
49
+ form.reset();
50
+ },
51
+ onError() {
52
+ setStatus('failed');
53
+ },
54
+ });
55
+ const createWithdrawalMutation = useCreateGCashWithdrawalMutation({
56
+ onMutate() {
57
+ setStatus('processing');
58
+ },
59
+ onSuccess() {
60
+ setStatus('success');
61
+ form.reset();
62
+ },
63
+ onError() {
64
+ setStatus('failed');
65
+ },
66
+ });
68
67
  const paymentSettingsQuery = usePaymentSettingsQuery();
69
68
  const paymentSettings = paymentSettingsQuery.data;
70
69
  const gatewaySettings = paymentSettings?.gcashWithdrawalGatewaySettings;
@@ -75,7 +74,7 @@ export function GCashWithdrawal() {
75
74
  const n = parseDecimal(val, 0);
76
75
  if (n < minimumAmount) {
77
76
  ctx.addIssue({
78
- type: "number",
77
+ type: 'number',
79
78
  code: z.ZodIssueCode.too_small,
80
79
  inclusive: true,
81
80
  minimum: minimumAmount,
@@ -84,7 +83,7 @@ export function GCashWithdrawal() {
84
83
  }
85
84
  if (n > maximumAmount) {
86
85
  ctx.addIssue({
87
- type: "number",
86
+ type: 'number',
88
87
  code: z.ZodIssueCode.too_big,
89
88
  inclusive: true,
90
89
  maximum: maximumAmount,
@@ -94,27 +93,27 @@ export function GCashWithdrawal() {
94
93
  }),
95
94
  password: z
96
95
  .string()
97
- .min(8, "Password must be 8 or more characters")
98
- .max(64, "Password must be not be more than 64 characters"),
96
+ .min(8, 'Password must be 8 or more characters')
97
+ .max(64, 'Password must be not be more than 64 characters'),
99
98
  mobileNumber: z
100
99
  .string()
101
- .regex(localeInfo.mobileNumber.pattern, "Invalid mobile number"),
100
+ .regex(localeInfo.mobileNumber.pattern, 'Invalid mobile number'),
102
101
  });
103
102
  const form = useForm({
104
- mode: "all",
103
+ mode: 'all',
105
104
  resolver: zodResolver(definition),
106
105
  defaultValues: {
107
- amount: "0",
108
- password: "",
109
- mobileNumber: "",
106
+ amount: '0',
107
+ password: '',
108
+ mobileNumber: '',
110
109
  },
111
110
  });
112
111
  useEffect(() => {
113
112
  if (minimumAmount) {
114
113
  form.reset({
115
114
  amount: minimumAmount.toString(),
116
- password: "",
117
- mobileNumber: "",
115
+ password: '',
116
+ mobileNumber: '',
118
117
  });
119
118
  }
120
119
  }, [form, minimumAmount]);
@@ -123,31 +122,40 @@ export function GCashWithdrawal() {
123
122
  globalStore.hasPendingBonus.setOpen(true);
124
123
  return;
125
124
  }
126
- createWithdrawalMutation.mutate({
127
- amount: data.amount,
128
- recipientMobileNumber: mobileNumberParser.format(data.mobileNumber),
129
- transactionPassword: data.password,
130
- });
125
+ if (featureFlag.enabled) {
126
+ createWithdrawalMutationNext.mutate({
127
+ amount: data.amount,
128
+ recipientMobileNumber: mobileNumberParser.format(data.mobileNumber),
129
+ transactionPassword: data.password,
130
+ });
131
+ }
132
+ if (!featureFlag.enabled) {
133
+ createWithdrawalMutation.mutate({
134
+ amount: data.amount,
135
+ recipientMobileNumber: mobileNumberParser.format(data.mobileNumber),
136
+ transactionPassword: data.password,
137
+ });
138
+ }
131
139
  });
132
- return (_jsxs("form", { onSubmit: handleSubmit, noValidate: true, autoComplete: "off", children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.mobileNumber, children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsx(localeInfo.country.flag, { className: "-translate-y-1/2 pointer-events-none absolute top-1/2 left-3.5 size-5" }), _jsx(Field.Input, { className: "pl-10.5", ...form.register("mobileNumber") })] }), _jsx(Field.ErrorText, { children: form.formState.errors.mobileNumber?.message })] }), _jsx(Controller, { control: form.control, name: "amount", render: (o) => (_jsxs(Field.Root, { invalid: !!form.formState.errors.amount, className: "mt-3xl", children: [_jsxs(NumberInput.Root, { min: 0, step: 1, value: o.field.value, onValueChange: (details) => {
140
+ return (_jsxs("form", { onSubmit: handleSubmit, noValidate: true, autoComplete: "off", children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.mobileNumber, children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsx(localeInfo.country.flag, { className: "-translate-y-1/2 pointer-events-none absolute top-1/2 left-3.5 size-5" }), _jsx(Field.Input, { className: "pl-10.5", ...form.register('mobileNumber') })] }), _jsx(Field.ErrorText, { children: form.formState.errors.mobileNumber?.message })] }), _jsx(Controller, { control: form.control, name: "amount", render: (o) => (_jsxs(Field.Root, { invalid: !!form.formState.errors.amount, className: "mt-3xl", children: [_jsxs(NumberInput.Root, { min: 0, step: 1, value: o.field.value, onValueChange: (details) => {
133
141
  o.field.onChange(details.value);
134
142
  }, formatOptions: {
135
143
  maximumFractionDigits: 2,
136
144
  minimumFractionDigits: 0,
137
- }, allowMouseWheel: true, children: [_jsx(NumberInput.Label, { children: "Enter amount you want to withdraw" }), _jsxs(NumberInput.Control, { children: [_jsx(NumberInput.Input, {}), _jsx(NumberInput.IncrementTrigger, { children: _jsx(ChevronUpIcon, {}) }), _jsx(NumberInput.DecrementTrigger, { children: _jsx(ChevronDownIcon, {}) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.amount?.message })] })) }), _jsx(AmountChoices, { value: parseDecimal(form.watch("amount"), 0), onChange: (value) => {
138
- form.setValue("amount", value.toString(), {
145
+ }, allowMouseWheel: true, children: [_jsx(NumberInput.Label, { children: "Enter amount you want to withdraw" }), _jsxs(NumberInput.Control, { children: [_jsx(NumberInput.Input, {}), _jsx(NumberInput.IncrementTrigger, { children: _jsx(ChevronUpIcon, {}) }), _jsx(NumberInput.DecrementTrigger, { children: _jsx(ChevronDownIcon, {}) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.amount?.message })] })) }), _jsx(AmountChoices, { value: parseDecimal(form.watch('amount'), 0), onChange: (value) => {
146
+ form.setValue('amount', value.toString(), {
139
147
  shouldTouch: true,
140
148
  shouldDirty: true,
141
149
  shouldValidate: true,
142
150
  });
143
- }, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), _jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Transaction Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter password", ...form.register("password") }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsx(TransactionPasswordNotSet, {}), _jsx(Button, { type: "submit", className: "mt-6", disabled: createWithdrawalMutation.isPending, children: "Withdraw" }), _jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["Upon withdrawing, you agree to our", " ", _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? "/terms-of-use", onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use" }), " ", "and", " ", _jsx(Link, { href: depositWithdrawalProps.privacyPolicyUrl ?? "/privacy-policy", onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Privacy Policy" }), "."] }), _jsx(AlertDialog.Root, { open: status !== "waiting", onOpenChange: (details) => {
151
+ }, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), _jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Transaction Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter password", ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsx(TransactionPasswordNotSet, {}), _jsx(Button, { type: "submit", className: "mt-6", disabled: createWithdrawalMutation.isPending, children: "Withdraw" }), _jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["Upon withdrawing, you agree to our", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.privacyPolicyUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Privacy Policy" }), "."] }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
144
152
  if (!details.open) {
145
- setStatus("waiting");
153
+ setStatus('waiting');
146
154
  }
147
- }, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+2)]" }), _jsx(AlertDialog.Positioner, { className: "!z-[calc(var(--z-dialog)+3)]", children: _jsxs(AlertDialog.Content, { children: [_jsx(AlertDialog.CloseTrigger, { disabled: status === "processing", children: _jsx(XIcon, {}) }), _jsxs(AlertDialog.Header, { children: [status === "processing" && (_jsx(SpinnerIcon, { className: "size-12 text-text-brand-primary-600" })), status === "success" && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-success-secondary text-text-featured-icon-light-success", children: _jsx(AlertCircleIcon, {}) })), status === "failed" && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-error-secondary text-text-featured-icon-light-error", children: _jsx(AlertCircleIcon, {}) }))] }), _jsxs(AlertDialog.Body, { children: [_jsxs(AlertDialog.Title, { children: [status === "processing" && "Processing Withdraw", status === "success" && "Withdrawal Submitted", status === "failed" && "Withdraw Failed"] }), _jsxs(AlertDialog.Description, { children: [status === "processing" &&
148
- "We're verifying your account and amount. Please hold a moment.", status === "success" &&
149
- "Your withdrawal request has been submitted successfully and is awaiting confirmation. You won’t have to wait long — once approved, the funds will be credited to your account.", status === "failed" &&
150
- explainError(createWithdrawalMutation.error?.name)] })] }), (status === "failed" || status === "success") && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
155
+ }, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+2)]" }), _jsx(AlertDialog.Positioner, { className: "!z-[calc(var(--z-dialog)+3)]", children: _jsxs(AlertDialog.Content, { children: [_jsx(AlertDialog.CloseTrigger, { disabled: status === 'processing', children: _jsx(XIcon, {}) }), _jsxs(AlertDialog.Header, { children: [status === 'processing' && (_jsx(SpinnerIcon, { className: "size-12 text-text-brand-primary-600" })), status === 'success' && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-success-secondary text-text-featured-icon-light-success", children: _jsx(AlertCircleIcon, {}) })), status === 'failed' && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-error-secondary text-text-featured-icon-light-error", children: _jsx(AlertCircleIcon, {}) }))] }), _jsxs(AlertDialog.Body, { children: [_jsxs(AlertDialog.Title, { children: [status === 'processing' && 'Processing Withdraw', status === 'success' && 'Withdrawal Submitted', status === 'failed' && 'Withdraw Failed'] }), _jsxs(AlertDialog.Description, { children: [status === 'processing' &&
156
+ "We're verifying your account and amount. Please hold a moment.", status === 'success' &&
157
+ 'Your withdrawal request has been submitted successfully and is awaiting confirmation. You won’t have to wait long — once approved, the funds will be credited to your account.', status === 'failed' &&
158
+ explainError(createWithdrawalMutation.error?.name)] })] }), (status === 'failed' || status === 'success') && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
151
159
  api.setOpen(false);
152
- }, children: status === "failed" ? "Try Again" : "Ok" })) }) }))] }) })] }) })] }));
160
+ }, children: status === 'failed' ? 'Try Again' : 'Ok' })) }) }))] }) })] }) })] }));
153
161
  }
@@ -1,8 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import dynamic from 'next/dynamic';
2
3
  import { useCallback, useMemo } from 'react';
3
4
  import { useShallow } from 'zustand/react/shallow';
4
5
  import { useControllableState } from '../../client/hooks/useControllableState.js';
5
6
  import { useDisclosure } from '../../client/hooks/useDisclosure.js';
7
+ import { useFeatureFlag } from '../../client/hooks/useFeatureFlag.js';
6
8
  import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
7
9
  import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
8
10
  import { CheckIcon } from '../../icons/CheckIcon.js';
@@ -18,11 +20,9 @@ import { Progress } from '../../ui/Progress/index.js';
18
20
  import { Prose } from '../../ui/Prose/index.js';
19
21
  import { formatNumber } from '../../utils/formatNumber.js';
20
22
  import { getPercentage } from '../../utils/getPercentage.js';
23
+ import { FacebookSignInTrigger } from '../SignIn/FacebookSignInTrigger.js';
21
24
  import { useQuestContext } from './QuestsContext.js';
22
25
  import { RemainingTime } from './RemainingTime.js';
23
- import { useFeatureFlag } from '../../client/hooks/useFeatureFlag.js';
24
- import { FacebookSignInTrigger } from '../SignIn/FacebookSignInTrigger.js';
25
- import dynamic from 'next/dynamic';
26
26
  const GoogleSignInButton = dynamic(() => import('../SignIn/GoogleSignInTrigger.js').then((m) => m.GoogleSignInTrigger), {
27
27
  ssr: false,
28
28
  loading: () => null,
@@ -42,7 +42,8 @@ export function JourneyQuest() {
42
42
  }
43
43
  const filteredMilestones = quest.milestones.filter((milestone) => {
44
44
  if (!featureFlag.enabled) {
45
- return milestone.type !== 'LINK_FACEBOOK_ACCOUNT' && milestone.type !== 'LINK_GOOGLE_ACCOUNT';
45
+ return (milestone.type !== 'LINK_FACEBOOK_ACCOUNT' &&
46
+ milestone.type !== 'LINK_GOOGLE_ACCOUNT');
46
47
  }
47
48
  return true;
48
49
  });
@@ -66,7 +67,7 @@ export function JourneyQuest() {
66
67
  ? parseFloat(quest.progressPercentage)
67
68
  : getPercentage(completedCount, total),
68
69
  };
69
- }, [quest]);
70
+ }, [quest, featureFlag]);
70
71
  const progressValue = useMemo(() => {
71
72
  return (progressPercentage || getPercentage(currentMilestone, totalMilestones));
72
73
  }, [progressPercentage, currentMilestone, totalMilestones]);
@@ -99,7 +100,7 @@ function Rules(props) {
99
100
  return false;
100
101
  return milestones.every((milestone) => milestone.isCompleted);
101
102
  }, [milestones]);
102
- return (_jsx(Dialog.Root, { lazyMount: true, unmountOnExit: true, open: open, onOpenChange: (details) => setOpen(details.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: "mx-auto min-h-auto min-w-[21.438rem] max-w-[400px] overflow-y-auto rounded-xl px-4 py-5 mt-40", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "group flex flex-col space-y-5 text-sm text-text-quarterary-brand", children: [_jsx("h2", { className: "font-semibold text-lg text-text-primary-900", children: quest?.name || 'Quest' }), _jsx("p", { children: quest?.description ||
103
+ return (_jsx(Dialog.Root, { lazyMount: true, unmountOnExit: true, open: open, onOpenChange: (details) => setOpen(details.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: "mx-auto mt-40 min-h-auto min-w-[21.438rem] max-w-[400px] overflow-y-auto rounded-xl px-4 py-5", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "group flex flex-col space-y-5 text-sm text-text-quarterary-brand", children: [_jsx("h2", { className: "font-semibold text-lg text-text-primary-900", children: quest?.name || 'Quest' }), _jsx("p", { children: quest?.description ||
103
104
  'Ready for a challenge? Complete them all and get amazing rewards!' }), milestones.map((milestone) => (_jsxs("div", { className: "flex flex-col space-y-2.5 rounded-xl bg-bg-tertiary p-3", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("p", { className: "font-medium text-base text-white", children: milestone.label }), milestone.isCompleted && (_jsx("div", { className: "flex w-fit items-center gap-1 rounded-full border border-utility-success-200 bg-utility-success-50 px-2 py-0.5 font-medium text-utility-success-700 text-xs", children: "Complete" }))] }), milestone.description ? (_jsx(Prose, { dangerouslySetInnerHTML: {
104
105
  __html: milestone.description,
105
106
  } })) : milestone.bonus ? (_jsxs("p", { className: "ml-1", children: [milestone.key === 'REGISTRATION' &&
@@ -122,8 +123,8 @@ function Rules(props) {
122
123
  }, "aria-label": `Complete ${milestone.label}`, children: [milestone.key === 'ACCOUNT_VERIFICATION' ? (_jsx(FileCheck02Icon, { className: "size-5" })) : (_jsx(CoinsHandIcon, { className: "size-5" })), milestone.key === 'FIRST_DEPOSIT'
123
124
  ? 'Deposit'
124
125
  : 'Verify Account'] })), !milestone.isCompleted &&
125
- milestone.key === 'LINK_FACEBOOK_ACCOUNT' && (_jsx(FacebookSignInTrigger, { text: 'Link Facebook Account', className: 'items-center justify-center rounded-md font-semibold shadow-xs disabled:opacity-60 disabled:shadow-none aria-disabled:cursor-not-allowed aria-disabled:opacity-60 aria-disabled:shadow-none h-10 gap-md px-3 text-sm flex w-full bg-button-primary-bg text-button-primary-fg' })), !milestone.isCompleted &&
126
- milestone.key === 'LINK_GOOGLE_ACCOUNT' && (_jsx(GoogleSignInButton, { text: 'Link Google Account', className: 'items-center justify-center rounded-md font-semibold shadow-xs disabled:opacity-60 disabled:shadow-none aria-disabled:cursor-not-allowed aria-disabled:opacity-60 aria-disabled:shadow-none h-10 gap-md px-3 text-sm flex w-full bg-button-primary-bg text-button-primary-fg' }))] }, milestone.key))), quest?.bonus && (_jsx("div", { className: "flex h-full items-end", children: allMilestonesCompleted ? (_jsx(Button, { size: "sm", onClick: () => setOpen(false), "aria-label": "Close", className: "w-full", children: "Close" })) : (_jsx("div", { className: "w-full rounded-md border border-bg-primary-hover bg-button-secondary-bg px-3.5 py-2.5 text-center text-white", children: _jsxs("p", { children: ["Complete target to", ' ', _jsxs("span", { className: "text-brand-400", children: ["\u20B1", quest?.bonus] }), ' ', "bonus!"] }) })) }))] })] }) })] }) }));
126
+ milestone.key === 'LINK_FACEBOOK_ACCOUNT' && (_jsx(FacebookSignInTrigger, { text: "Link Facebook Account", className: "flex h-10 w-full items-center justify-center gap-md rounded-md bg-button-primary-bg px-3 font-semibold text-button-primary-fg text-sm shadow-xs disabled:opacity-60 disabled:shadow-none aria-disabled:cursor-not-allowed aria-disabled:opacity-60 aria-disabled:shadow-none" })), !milestone.isCompleted &&
127
+ milestone.key === 'LINK_GOOGLE_ACCOUNT' && (_jsx(GoogleSignInButton, { text: "Link Google Account", className: "flex h-10 w-full items-center justify-center gap-md rounded-md bg-button-primary-bg px-3 font-semibold text-button-primary-fg text-sm shadow-xs disabled:opacity-60 disabled:shadow-none aria-disabled:cursor-not-allowed aria-disabled:opacity-60 aria-disabled:shadow-none" }))] }, milestone.key))), quest?.bonus && (_jsx("div", { className: "flex h-full items-end", children: allMilestonesCompleted ? (_jsx(Button, { size: "sm", onClick: () => setOpen(false), "aria-label": "Close", className: "w-full", children: "Close" })) : (_jsx("div", { className: "w-full rounded-md border border-bg-primary-hover bg-button-secondary-bg px-3.5 py-2.5 text-center text-white", children: _jsxs("p", { children: ["Complete target to", ' ', _jsxs("span", { className: "text-brand-400", children: ["\u20B1", quest?.bonus] }), ' ', "bonus!"] }) })) }))] })] }) })] }) }));
127
128
  }
128
129
  function QuestMilestone({ label, bonus, isCompleted = false, }) {
129
130
  const localeInfo = useLocaleInfo();
@@ -0,0 +1 @@
1
+ export declare function MultiWageringQuest(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,91 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useCallback, useMemo } from 'react';
3
+ import { useControllableState } from '../../client/hooks/useControllableState.js';
4
+ import { useDisclosure } from '../../client/hooks/useDisclosure.js';
5
+ import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
6
+ import { Lock01Icon } from '../../icons/Lock01Icon.js';
7
+ import { XIcon } from '../../icons/XIcon.js';
8
+ import { Badge } from '../../ui/Badge/index.js';
9
+ import { Button } from '../../ui/Button/index.js';
10
+ import { Dialog } from '../../ui/Dialog/index.js';
11
+ import { Portal } from '../../ui/Portal/index.js';
12
+ import { Progress } from '../../ui/Progress/index.js';
13
+ import { formatNumber } from '../../utils/formatNumber.js';
14
+ import { useQuestContext } from './QuestsContext.js';
15
+ import { RemainingTime } from './RemainingTime.js';
16
+ export function MultiWageringQuest() {
17
+ const disclosure = useDisclosure();
18
+ const quest = useQuestContext();
19
+ const { stages, totalStage, currentStage, progressPercentage } = useMemo(() => {
20
+ const currentStage = quest.stages.filter((m) => m.cleared).length;
21
+ if (!quest?.stages) {
22
+ return {
23
+ stages: [],
24
+ totalStage: 0,
25
+ currentStage: 0,
26
+ progressPercentage: 0,
27
+ };
28
+ }
29
+ const transformedStages = quest.stages.map((stage) => ({
30
+ bonusAmount: stage.bonusAmount,
31
+ bonusTurnoverRequirementMultiplier: stage.bonusTurnoverRequirementMultiplier,
32
+ cleared: stage.cleared,
33
+ dateTimeCleared: stage.dateTimeCleared,
34
+ targetTurnover: stage.targetTurnover,
35
+ }));
36
+ const total = quest.stages.length;
37
+ return {
38
+ stages: transformedStages,
39
+ totalStage: total,
40
+ currentStage: currentStage === 0 ? 1 : currentStage,
41
+ progressPercentage: +quest.progressPercentage,
42
+ };
43
+ }, [quest]);
44
+ const handleViewDetails = useCallback(() => {
45
+ disclosure.setOpen(true);
46
+ }, [disclosure]);
47
+ const localeInfo = useLocaleInfo();
48
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex h-full w-full flex-col space-y-6 rounded-2xl border border-border-primary bg-bg-tertiary px-4 pt-5 pb-6", children: [_jsxs("div", { className: "flex flex-col space-y-2", children: [_jsxs("div", { className: "flex max-h-7.5 items-center justify-between", children: [_jsx(RemainingTime, { endOfDay: true }), quest.status === 'COMPLETED' && (_jsx(Badge.Root, { colorScheme: "success", size: "lg", round: false, children: _jsxs(Badge.Label, { children: ["Final Bonus:", ' ', formatNumber(quest.bonus, {
49
+ currency: localeInfo.currency.code,
50
+ })] }) }))] }), _jsx("p", { className: "font-semibold text-xl", children: quest?.name || 'Journey Quest' }), _jsx("div", { className: "text-sm", dangerouslySetInnerHTML: {
51
+ __html: quest?.description ||
52
+ 'Ready for a challenge? Complete them all and get amazing rewards!',
53
+ } }), _jsxs("div", { className: "flex items-center justify-between pt-5", children: [_jsxs("p", { className: "text-sm", children: ["Progress: ", quest.progressPercentage, "%"] }), _jsxs("p", { className: "text-sm", children: [quest.turnover, _jsxs("span", { className: "text-[#667085]", children: ["/", quest.targetTurnover, " PHP"] })] })] }), _jsx(Progress.Root, { max: 100, className: "h-2 rounded-full bg-bg-primary", value: progressPercentage, children: _jsx(Progress.Track, { children: _jsx(Progress.Range, { className: "bg-utility-brand-600" }) }) }), _jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("p", { className: "text-sm text-text-quarterary-brand", children: ["Stage ", currentStage, " of ", totalStage] }), _jsx(Badge.Root, { size: "lg", colorScheme: "brand", round: false, children: _jsxs(Badge.Label, { className: "flex items-center justify-center text-xs", children: [_jsx("p", { className: "flex h-[10px] items-center justify-center", children: "+" }), ' ', formatNumber(quest.stages?.reduce((curr, prev) => {
54
+ return curr + Number(prev.bonusAmount || 0);
55
+ }, 0), {
56
+ currency: localeInfo.currency.code,
57
+ maxDecimalPlaces: 0,
58
+ minDecimalPlaces: 0,
59
+ }), ' ', "Bonus"] }) })] })] }), _jsx("div", { className: "flex h-full items-end", children: _jsx(Button, { size: "sm", onClick: handleViewDetails, "aria-label": "View Details", disabled: false, className: "disabled:bg-bg-primary disabled:text-text-disabled", children: "View Details" }) })] }), _jsx(Stages, { open: disclosure.open, onOpenChange: disclosure.setOpen, quest: quest, stages: stages })] }));
60
+ }
61
+ function Stages(props) {
62
+ const [open, setOpen] = useControllableState({
63
+ value: props.open,
64
+ defaultValue: props.defaultOpen ?? false,
65
+ onChange: props.onOpenChange,
66
+ });
67
+ const currentStage = useMemo(() => {
68
+ const stage = props?.stages?.findLastIndex((stage) => stage.cleared) ?? 0;
69
+ return stage !== -1 ? stage + 1 : 1;
70
+ }, [props.stages]);
71
+ return (_jsx(Dialog.Root, { lazyMount: true, unmountOnExit: true, open: open, onOpenChange: (details) => setOpen(details.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: "mx-auto mt-40 min-h-auto min-w-[23rem] max-w-[25rem] overflow-y-auto rounded-xl px-4 py-5", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "group flex flex-col space-y-5 text-sm text-text-quarterary-brand", children: [_jsx("h2", { className: "font-semibold text-lg text-text-primary-900", children: props.quest?.name || 'Quest' }), _jsx("div", { dangerouslySetInnerHTML: {
72
+ __html: props.quest?.description ||
73
+ 'Ready for a challenge? Complete them all and get amazing rewards!',
74
+ } }), _jsx("div", { className: "flex w-full flex-col space-y-3", children: props.stages.map((stage, idx) => {
75
+ if (currentStage >= idx + 1) {
76
+ return (_jsx(QuestWageringStageUnlocked, { data: stage, bonus: stage.bonusAmount, stage: idx, isCompleted: stage.cleared }, idx));
77
+ }
78
+ else {
79
+ return _jsx(QuestWageringStageLocked, { stage: idx }, idx);
80
+ }
81
+ }) }), _jsx(Button, { size: "sm", onClick: () => setOpen(false), "aria-label": "Close", className: "w-full", children: "Close" })] })] }) })] }) }));
82
+ }
83
+ function QuestWageringStageUnlocked({ bonus, stage, data, isCompleted = false, }) {
84
+ const localeInfo = useLocaleInfo();
85
+ return (_jsxs("div", { className: "mb-4 flex flex-col justify-between rounded-xl bg-bg-secondary p-3", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("p", { className: "font-medium", children: ["Stage ", stage + 1] }), _jsx(Badge.Root, { colorScheme: isCompleted ? 'success' : 'blue', size: "md", round: true, children: _jsx(Badge.Label, { children: data.cleared ? 'Completed' : 'Ongoing' }) })] }), _jsxs("div", { className: "mt-2.5 flex items-center justify-between", children: [_jsxs("p", { children: ["Progress ", data.cleared ? 100 : 0, "%"] }), _jsx("div", { className: "rounded-[6px] border border-border-secondary bg-bg-secondary-alt px-1.5 py-0.5", children: _jsxs("p", { className: "font-medium text-xs leading-tight", children: ["+", formatNumber(bonus, {
86
+ currency: localeInfo.currency.code,
87
+ }), ' ', "Bonus"] }) })] }), _jsx(Progress.Root, { max: 100, className: "mt-2 h-2 rounded-full bg-bg-primary", value: data.cleared ? 100 : 0, children: _jsx(Progress.Track, { children: _jsx(Progress.Range, { className: "bg-utility-brand-600" }) }) })] }));
88
+ }
89
+ function QuestWageringStageLocked({ stage }) {
90
+ return (_jsxs("div", { className: "mb-4 flex items-center justify-between rounded-xl bg-bg-secondary p-3", children: [_jsxs("p", { className: "font-medium", children: ["Stage ", stage + 1] }), _jsx("div", { className: "flex items-center justify-center rounded-full border border-border-lock bg-bg-lock p-1", children: _jsx(Lock01Icon, { className: "size-3 stroke-3 font-medium text-text-lock" }) })] }));
91
+ }
@@ -6,11 +6,13 @@ import { useState, } from 'react';
6
6
  import { twMerge } from 'tailwind-merge';
7
7
  import { z } from 'zod';
8
8
  import { useAvailableQuestsQuery } from '../../client/hooks/useAvailableQuestsQuery.js';
9
+ import { useFeatureFlag } from '../../client/hooks/useFeatureFlag.js';
9
10
  import { SpinnerIcon } from '../../icons/SpinnerIcon.js';
10
11
  import closeChest from '../../images/close-chest.png';
11
12
  import { SegmentGroup } from '../../ui/SegmentGroup/index.js';
12
13
  import { DailyCheckInQuest, } from './DailyCheckInQuest.js';
13
14
  import { JourneyQuest } from './JourneyQuest.js';
15
+ import { MultiWageringQuest } from './MultiWageringQuest.js';
14
16
  import { OnboardingQuest } from './OnboardingQuest.js';
15
17
  import { QuestContext } from './QuestsContext.js';
16
18
  import { WageringQuest, } from './WageringQuest.js';
@@ -19,12 +21,14 @@ const QUEST_COMPONENT_MAP = {
19
21
  ONBOARDING: OnboardingQuest,
20
22
  WAGERING: WageringQuest,
21
23
  JOURNEY: JourneyQuest,
24
+ MULTI_WAGERING: MultiWageringQuest,
22
25
  };
23
26
  const TabDefinition = z.enum(['AVAILABLE', 'COMPLETED', 'FAILED']);
24
27
  export function Quests__client(props) {
25
28
  const { className, style, heading } = props;
26
29
  const classNames = isString(className) ? { root: className } : className;
27
30
  const [tab, setTab] = useState('AVAILABLE');
31
+ const featureFlag = useFeatureFlag();
28
32
  const questsQuery = useAvailableQuestsQuery({
29
33
  refetchInterval: 7500,
30
34
  });
@@ -51,7 +55,9 @@ export function Quests__client(props) {
51
55
  return (_jsxs("div", { style: style, className: twMerge(classNames?.root), children: [_jsx("h2", { className: "font-semibold text-lg", children: heading ?? 'Quests' }), _jsxs(SegmentGroup.Root, { value: tab, onValueChange: (details) => {
52
56
  setTab(TabDefinition.catch('AVAILABLE').parse(details.value));
53
57
  }, className: "mt-3 w-full overflow-x-auto lg:mt-4.5 lg:w-fit", children: [_jsxs(SegmentGroup.Item, { value: "AVAILABLE", className: "w-full lg:w-fit", children: [_jsx(SegmentGroup.ItemText, { children: "Available" }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }), _jsxs(SegmentGroup.Item, { value: "COMPLETED", className: "w-full lg:w-fit", children: [_jsx(SegmentGroup.ItemText, { children: "Completed" }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }), _jsxs(SegmentGroup.Item, { value: "FAILED", className: "w-full lg:w-fit", children: [_jsx(SegmentGroup.ItemText, { children: "Failed" }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }), _jsx(SegmentGroup.Indicator, {})] }), _jsx("div", { className: "mt-3xl grid gap-3xl lg:mt-lg lg:grid-cols-3", children: quests.map((quest) => {
54
- const Quest = QUEST_COMPONENT_MAP[quest.type];
58
+ const Quest = quest.stages?.length && featureFlag.enabled
59
+ ? QUEST_COMPONENT_MAP['MULTI_WAGERING']
60
+ : QUEST_COMPONENT_MAP[quest.type];
55
61
  return (_jsx(QuestContext, { value: quest, children: _jsx(Quest, { className: quest.type === 'WAGERING'
56
62
  ? classNames?.wageringQuest
57
63
  : quest.type === 'DAILY_CHECKIN'
@@ -39,6 +39,7 @@ import saba from '../images/game-providers/SABA.png';
39
39
  import spinix from '../images/game-providers/SPINIX.png';
40
40
  import spribe from '../images/game-providers/SPRIBE.png';
41
41
  import yellowbat from '../images/game-providers/YELLOWBAT.png';
42
+ import sagaming from '../images/game-providers/SAGAMING.png';
42
43
  export const GAME_PROVIDER_DATA = {
43
44
  ALIZE: {
44
45
  id: 'ALIZE',
@@ -304,6 +305,12 @@ export const GAME_PROVIDER_DATA = {
304
305
  slug: 'big-time-gaming',
305
306
  logo: btg,
306
307
  },
308
+ SAGAMING: {
309
+ id: 'SAGAMING',
310
+ name: 'SAGAMING',
311
+ slug: 'sagaming',
312
+ logo: sagaming,
313
+ },
307
314
  };
308
315
  export const GAME_PROVIDERS = Object.values(GAME_PROVIDER_DATA).map(({ id }) => id);
309
316
  export const LEGACY_GAME_PROVIDERS = [
@@ -110,10 +110,10 @@ export declare const COMPLETE_ONBOARDING = "\n mutation CompleteOnboarding($inp
110
110
  export declare const SKIP_ONBOARDING = "\n mutation SkipOnboarding {\n skipOnboarding\n }\n";
111
111
  export declare const QUEST_PROGRAM_FRAGMENT = "\n fragment QuestProgramFragment on QuestProgram {\n status\n type\n name\n description\n }\n";
112
112
  export declare const DAILY_CHECKIN_FRAGMENT = "\n \n fragment QuestProgramFragment on QuestProgram {\n status\n type\n name\n description\n }\n\n fragment DailyCheckinQuestFragment on DailyCheckInQuest {\n id\n name\n description\n type\n program {\n ...QuestProgramFragment\n }\n\n status\n progressPercentage\n turnover\n endDateTime\n dateTimeCreated\n lastCheckInDate\n startDateTime\n checkInStreak\n\n thirdDayBonusAmount\n seventhDayBonusAmount\n sixthDayBonusAmount\n }\n";
113
- export declare const WAGERING_FRAGMENT = "\n fragment WageringQuestFragment on WageringQuest {\n bonus\n id\n name\n type\n description\n program {\n ...QuestProgramFragment\n }\n\n status\n progressPercentage\n turnover\n targetTurnover\n endDateTime\n dateTimeCreated\n }\n";
113
+ export declare const WAGERING_FRAGMENT = "\n fragment WageringQuestFragment on WageringQuest {\n bonus\n id\n name\n type\n description\n program {\n ...QuestProgramFragment\n }\n\n status\n progressPercentage\n turnover\n targetTurnover\n endDateTime\n dateTimeCreated\n stages{\n targetTurnover\n bonusTurnoverRequirementMultiplier\n bonusAmount\n cleared\n dateTimeCleared\n }\n }\n";
114
114
  export declare const JOURNEY_FRAGMENT = "\n fragment JourneyQuestFragment on JourneyQuest {\n id\n name\n description\n program {\n ...QuestProgramFragment\n }\n status\n type\n progressPercentage\n bonus\n bonusAwarded\n dateTimeCreated\n endDateTime\n milestones {\n id\n type\n name\n bonusAmount\n cleared\n description\n }\n }\n";
115
115
  export declare const ONBOARDING_QUEST_FRAGMENT = "\n fragment OnboardingQuestFragment on OnboardingQuest {\n id\n name\n description\n program {\n ...QuestProgramFragment\n }\n\n status\n type\n progressPercentage\n bonus\n endDateTime\n dateTimeCreated\n firstDepositCompleted\n accountVerificationCompleted\n }\n";
116
- export declare const AVAILABLE_QUESTS = "\n \n fragment WageringQuestFragment on WageringQuest {\n bonus\n id\n name\n type\n description\n program {\n ...QuestProgramFragment\n }\n\n status\n progressPercentage\n turnover\n targetTurnover\n endDateTime\n dateTimeCreated\n }\n\n \n \n fragment QuestProgramFragment on QuestProgram {\n status\n type\n name\n description\n }\n\n fragment DailyCheckinQuestFragment on DailyCheckInQuest {\n id\n name\n description\n type\n program {\n ...QuestProgramFragment\n }\n\n status\n progressPercentage\n turnover\n endDateTime\n dateTimeCreated\n lastCheckInDate\n startDateTime\n checkInStreak\n\n thirdDayBonusAmount\n seventhDayBonusAmount\n sixthDayBonusAmount\n }\n\n \n fragment OnboardingQuestFragment on OnboardingQuest {\n id\n name\n description\n program {\n ...QuestProgramFragment\n }\n\n status\n type\n progressPercentage\n bonus\n endDateTime\n dateTimeCreated\n firstDepositCompleted\n accountVerificationCompleted\n }\n\n \n fragment JourneyQuestFragment on JourneyQuest {\n id\n name\n description\n program {\n ...QuestProgramFragment\n }\n status\n type\n progressPercentage\n bonus\n bonusAwarded\n dateTimeCreated\n endDateTime\n milestones {\n id\n type\n name\n bonusAmount\n cleared\n description\n }\n }\n\n\n query AvailableQuests {\n availableQuests {\n ... on Quest {\n ... on WageringQuest {\n ...WageringQuestFragment\n }\n ... on DailyCheckInQuest {\n ...DailyCheckinQuestFragment\n }\n ... on OnboardingQuest {\n ...OnboardingQuestFragment\n }\n ... on JourneyQuest {\n ...JourneyQuestFragment\n }\n }\n }\n }\n";
116
+ export declare const AVAILABLE_QUESTS = "\n \n fragment WageringQuestFragment on WageringQuest {\n bonus\n id\n name\n type\n description\n program {\n ...QuestProgramFragment\n }\n\n status\n progressPercentage\n turnover\n targetTurnover\n endDateTime\n dateTimeCreated\n stages{\n targetTurnover\n bonusTurnoverRequirementMultiplier\n bonusAmount\n cleared\n dateTimeCleared\n }\n }\n\n \n \n fragment QuestProgramFragment on QuestProgram {\n status\n type\n name\n description\n }\n\n fragment DailyCheckinQuestFragment on DailyCheckInQuest {\n id\n name\n description\n type\n program {\n ...QuestProgramFragment\n }\n\n status\n progressPercentage\n turnover\n endDateTime\n dateTimeCreated\n lastCheckInDate\n startDateTime\n checkInStreak\n\n thirdDayBonusAmount\n seventhDayBonusAmount\n sixthDayBonusAmount\n }\n\n \n fragment OnboardingQuestFragment on OnboardingQuest {\n id\n name\n description\n program {\n ...QuestProgramFragment\n }\n\n status\n type\n progressPercentage\n bonus\n endDateTime\n dateTimeCreated\n firstDepositCompleted\n accountVerificationCompleted\n }\n\n \n fragment JourneyQuestFragment on JourneyQuest {\n id\n name\n description\n program {\n ...QuestProgramFragment\n }\n status\n type\n progressPercentage\n bonus\n bonusAwarded\n dateTimeCreated\n endDateTime\n milestones {\n id\n type\n name\n bonusAmount\n cleared\n description\n }\n }\n\n\n query AvailableQuests {\n availableQuests {\n ... on Quest {\n ... on WageringQuest {\n ...WageringQuestFragment\n }\n ... on DailyCheckInQuest {\n ...DailyCheckinQuestFragment\n }\n ... on OnboardingQuest {\n ...OnboardingQuestFragment\n }\n ... on JourneyQuest {\n ...JourneyQuestFragment\n }\n }\n }\n }\n";
117
117
  export declare const AVAILABLE_QUEST_IDS = "\n query AvailableQuestIds {\n availableQuests {\n ... on Node {\n id\n }\n }\n }\n";
118
118
  export declare const CHECK_IN_DAILY_QUEST = "\n mutation checkInDailyCheckInQuest($input: CheckInDailyCheckInQuestInput!) {\n checkInDailyCheckInQuest(input: $input)\n }\n";
119
119
  export declare const TOP_WINS = "\n query TopWins($first: Int) {\n topWins(first: $first) {\n id\n game {\n id\n name\n type\n provider\n }\n member {\n id\n name\n }\n multiplier\n payout\n }\n }\n";
@@ -2422,6 +2422,13 @@ export const WAGERING_FRAGMENT = /* GraphQL */ `
2422
2422
  targetTurnover
2423
2423
  endDateTime
2424
2424
  dateTimeCreated
2425
+ stages{
2426
+ targetTurnover
2427
+ bonusTurnoverRequirementMultiplier
2428
+ bonusAmount
2429
+ cleared
2430
+ dateTimeCleared
2431
+ }
2425
2432
  }
2426
2433
  `;
2427
2434
  export const JOURNEY_FRAGMENT = /* GraphQL */ `
@@ -274,6 +274,9 @@
274
274
 
275
275
  --color-border-checkbox-primary: #373a41;
276
276
  --color-bg-progress-bar-primary: var(--color-bg-primary);
277
+ --color-bg-lock: #161B26;
278
+ --color-border-lock: #333741;
279
+ --color-text-lock: #85888E;
277
280
 
278
281
 
279
282
  --font-sans: var(--font-sans);