@opexa/portal-sdk 0.0.137 → 0.0.139
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.
- package/dist/index.js +98 -89
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +532 -453
- package/dist/index.mjs.map +1 -1
- package/dist/sdk/types.d.ts +8 -2
- package/dist/services/types.d.ts +13 -3
- package/dist/utils/const.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(A,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("@opexa/object-id")):typeof define=="function"&&define.amd?define(["exports","@opexa/object-id"],w):(A=typeof globalThis<"u"?globalThis:A||self,w(A.sdk={},A.objectId))})(this,function(A,w){"use strict";var vr=Object.defineProperty;var Nr=(A,w,b)=>w in A?vr(A,w,{enumerable:!0,configurable:!0,writable:!0,value:b}):A[w]=b;var u=(A,w,b)=>Nr(A,typeof w!="symbol"?w+"":w,b);const b={Account:8,Deposit:9,Withdrawal:14,Verification:15,File:16,Game:203,GameSession:204,MayaSession:230},E="google-recaptcha-response";function i(o,...e){let t="";for(const[r,a]of o.entries()){const m=e.at(r)??"";t=`${t}${a}${m}`}return t.trim()}const ve=i`
|
|
2
2
|
fragment FileFragment on File {
|
|
3
3
|
id
|
|
4
4
|
url
|
|
5
5
|
status
|
|
6
6
|
dateTimeCreated
|
|
7
7
|
}
|
|
8
|
-
`,
|
|
9
|
-
${
|
|
8
|
+
`,Qe=i`
|
|
9
|
+
${ve}
|
|
10
10
|
|
|
11
11
|
query File($id: ObjectId!) {
|
|
12
12
|
node(id: $id) {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
`,
|
|
18
|
+
`,je=i`
|
|
19
19
|
mutation UploadPrivateImageFile($input: UploadFileInput!) {
|
|
20
20
|
uploadPrivateImageFile(input: $input) {
|
|
21
21
|
... on FileFormatNotSupportedError {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
`,
|
|
32
|
+
`,Ke=i`
|
|
33
33
|
query Wallet {
|
|
34
34
|
wallet {
|
|
35
35
|
id
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
dateTimeLastUpdated
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
`,
|
|
42
|
+
`,ze=i`
|
|
43
43
|
query PointsWallet {
|
|
44
44
|
pointsWallet {
|
|
45
45
|
id
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
dateTimeCreated
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
`,
|
|
51
|
+
`,Je=i`
|
|
52
52
|
mutation RedeemPointsToCash($input: RedeemPointsToCashInput!) {
|
|
53
53
|
redeemPointsToCash(input: $input) {
|
|
54
54
|
... on InsufficientPointsError {
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
`,
|
|
59
|
+
`,Xe=i`
|
|
60
60
|
query PointsWalletTransactions(
|
|
61
61
|
$first: Int
|
|
62
62
|
$after: Cursor
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
`,
|
|
87
|
+
`,We={current:i`
|
|
88
88
|
query GameSession($id: ObjectId!) {
|
|
89
89
|
node(id: $id) {
|
|
90
90
|
... on GameSession {
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
`},
|
|
115
|
+
`},xe=i`
|
|
116
116
|
mutation CreateGameSession($input: CreateGameSessionInput!) {
|
|
117
117
|
createGameSession(input: $input) {
|
|
118
118
|
... on GameDoesNotExistError {
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
`,
|
|
123
|
+
`,Ue={current:i`
|
|
124
124
|
mutation EndGameSession($input: EndGameSessionInput!) {
|
|
125
125
|
endGameSession(input: $input)
|
|
126
126
|
}
|
|
@@ -138,13 +138,13 @@
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
`},
|
|
141
|
+
`},Ze=i`
|
|
142
142
|
query RecommendedGames {
|
|
143
143
|
recommendedGames {
|
|
144
144
|
id
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
|
-
`,
|
|
147
|
+
`,et=i`
|
|
148
148
|
query Announcements($first: Int, $after: Cursor, $filter: AnnouncementFilterInput) {
|
|
149
149
|
announcements(first: $first, after: $after, filter: $filter) {
|
|
150
150
|
edges {
|
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
-
`,
|
|
173
|
+
`,tt=i`
|
|
174
174
|
query WithdrawalRecords($first: Int, $after: Cursor, $filter: WithdrawalRecordFilterInput) {
|
|
175
175
|
member {
|
|
176
176
|
withdrawalRecords(first: $first, after: $after, filter: $filter) {
|
|
@@ -254,7 +254,7 @@
|
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
|
-
`,
|
|
257
|
+
`,rt=i`
|
|
258
258
|
mutation CreateGCashWithdrawal($input: CreateGCashWithdrawalInput!) {
|
|
259
259
|
createGCashWithdrawal(input: $input) {
|
|
260
260
|
... on AccountNotVerifiedError {
|
|
@@ -275,9 +275,12 @@
|
|
|
275
275
|
... on WithdrawalDailyLimitExceededError {
|
|
276
276
|
__typename
|
|
277
277
|
}
|
|
278
|
+
... on ReCAPTCHAVerificationFailedError {
|
|
279
|
+
__typename
|
|
280
|
+
}
|
|
278
281
|
}
|
|
279
282
|
}
|
|
280
|
-
`,
|
|
283
|
+
`,at=i`
|
|
281
284
|
mutation CreateMayaWithdrawal($input: CreateMayaWithdrawalInput!) {
|
|
282
285
|
createMayaWithdrawal(input: $input) {
|
|
283
286
|
... on AccountNotVerifiedError {
|
|
@@ -300,7 +303,7 @@
|
|
|
300
303
|
}
|
|
301
304
|
}
|
|
302
305
|
}
|
|
303
|
-
`,
|
|
306
|
+
`,nt=i`
|
|
304
307
|
mutation CreateMayaAppWithdrawal($input: CreateMayaAppWithdrawalInput!) {
|
|
305
308
|
createMayaAppWithdrawal(input: $input) {
|
|
306
309
|
... on AccountNotVerifiedError {
|
|
@@ -320,7 +323,7 @@
|
|
|
320
323
|
}
|
|
321
324
|
}
|
|
322
325
|
}
|
|
323
|
-
`,
|
|
326
|
+
`,ot=i`
|
|
324
327
|
mutation CreateBankWithdrawal($input: CreateBankWithdrawalInput!) {
|
|
325
328
|
createBankWithdrawal(input: $input) {
|
|
326
329
|
... on MobileNumberNotVerifiedError {
|
|
@@ -328,7 +331,7 @@
|
|
|
328
331
|
}
|
|
329
332
|
}
|
|
330
333
|
}
|
|
331
|
-
`,
|
|
334
|
+
`,it=i`
|
|
332
335
|
mutation CreateAIOInstapayWithdrawal($input: CreateAIOInstapayWithdrawalInput!) {
|
|
333
336
|
createAIOInstapayWithdrawal(input: $input) {
|
|
334
337
|
... on AccountNotVerifiedError {
|
|
@@ -348,7 +351,7 @@
|
|
|
348
351
|
}
|
|
349
352
|
}
|
|
350
353
|
}
|
|
351
|
-
`,
|
|
354
|
+
`,st=i`
|
|
352
355
|
query InstapayBankList {
|
|
353
356
|
instapayBankList {
|
|
354
357
|
id
|
|
@@ -356,11 +359,11 @@
|
|
|
356
359
|
name
|
|
357
360
|
}
|
|
358
361
|
}
|
|
359
|
-
`,
|
|
362
|
+
`,mt=i`
|
|
360
363
|
query RemainingDailyWithdrawalsCount {
|
|
361
364
|
remainingDailyWithdrawalsCount
|
|
362
365
|
}
|
|
363
|
-
`,
|
|
366
|
+
`,dt=i`
|
|
364
367
|
query DepositRecords($after: Cursor, $first: Int, $filter: DepositRecordFilterInput) {
|
|
365
368
|
member {
|
|
366
369
|
depositRecords(after: $after, first: $first, filter: $filter) {
|
|
@@ -389,7 +392,7 @@
|
|
|
389
392
|
}
|
|
390
393
|
}
|
|
391
394
|
}
|
|
392
|
-
`,
|
|
395
|
+
`,ct=i`
|
|
393
396
|
mutation CreateGCashDeposit($input: CreateGCashDepositInput!) {
|
|
394
397
|
createGCashDeposit(input: $input) {
|
|
395
398
|
... on DepositPromoMaximumAmountExceededError {
|
|
@@ -416,9 +419,12 @@
|
|
|
416
419
|
... on WalletDoesNotExistError {
|
|
417
420
|
__typename
|
|
418
421
|
}
|
|
422
|
+
... on ReCAPTCHAVerificationFailedError {
|
|
423
|
+
__typename
|
|
424
|
+
}
|
|
419
425
|
}
|
|
420
426
|
}
|
|
421
|
-
`,
|
|
427
|
+
`,ut=i`
|
|
422
428
|
mutation CreateMayaDeposit($input: CreateMayaDepositInput!) {
|
|
423
429
|
createMayaDeposit(input: $input) {
|
|
424
430
|
... on DepositPromoMaximumAmountExceededError {
|
|
@@ -447,7 +453,7 @@
|
|
|
447
453
|
}
|
|
448
454
|
}
|
|
449
455
|
}
|
|
450
|
-
`,
|
|
456
|
+
`,lt=i`
|
|
451
457
|
mutation CreateMayaAppDeposit($input: CreateMayaAppDepositInput!) {
|
|
452
458
|
createMayaAppDeposit(input: $input) {
|
|
453
459
|
... on DepositPromoMaximumAmountExceededError {
|
|
@@ -476,7 +482,7 @@
|
|
|
476
482
|
}
|
|
477
483
|
}
|
|
478
484
|
}
|
|
479
|
-
`,
|
|
485
|
+
`,pt=i`
|
|
480
486
|
mutation CreateAIOQRPHDeposit($input: CreateAIOQRPHDepositInput!) {
|
|
481
487
|
createAIOQRPHDeposit(input: $input) {
|
|
482
488
|
... on DepositPromoMaximumAmountExceededError {
|
|
@@ -503,9 +509,12 @@
|
|
|
503
509
|
... on WalletDoesNotExistError {
|
|
504
510
|
__typename
|
|
505
511
|
}
|
|
512
|
+
... on ReCAPTCHAVerificationFailedError {
|
|
513
|
+
__typename
|
|
514
|
+
}
|
|
506
515
|
}
|
|
507
516
|
}
|
|
508
|
-
`,
|
|
517
|
+
`,ft=i`
|
|
509
518
|
mutation CreateAIOOnlineBankDeposit($input: CreateAIOOnlineBankDepositInput!) {
|
|
510
519
|
createAIOOnlineBankDeposit(input: $input) {
|
|
511
520
|
... on DepositPromoMaximumAmountExceededError {
|
|
@@ -534,7 +543,7 @@
|
|
|
534
543
|
}
|
|
535
544
|
}
|
|
536
545
|
}
|
|
537
|
-
`,
|
|
546
|
+
`,wt=i`
|
|
538
547
|
query Deposit($id: ObjectId!) {
|
|
539
548
|
node(id: $id) {
|
|
540
549
|
... on GCashDeposit {
|
|
@@ -578,13 +587,13 @@
|
|
|
578
587
|
}
|
|
579
588
|
}
|
|
580
589
|
}
|
|
581
|
-
`,
|
|
590
|
+
`,yt=i`
|
|
582
591
|
query DepositsCount {
|
|
583
592
|
member {
|
|
584
593
|
depositsCount
|
|
585
594
|
}
|
|
586
595
|
}
|
|
587
|
-
`,
|
|
596
|
+
`,ht=i`
|
|
588
597
|
query BetRecords($first: Int, $after: Cursor, $filter: BetRecordFilterInput) {
|
|
589
598
|
member {
|
|
590
599
|
betRecords(first: $first, after: $after, filter: $filter) {
|
|
@@ -622,7 +631,7 @@
|
|
|
622
631
|
}
|
|
623
632
|
}
|
|
624
633
|
}
|
|
625
|
-
`,
|
|
634
|
+
`,gt=i`
|
|
626
635
|
query LatestBetRecords {
|
|
627
636
|
latestBetRecords {
|
|
628
637
|
id
|
|
@@ -639,7 +648,7 @@
|
|
|
639
648
|
dateTimeCreated
|
|
640
649
|
}
|
|
641
650
|
}
|
|
642
|
-
`,
|
|
651
|
+
`,At=i`
|
|
643
652
|
query TransactionRecords($first: Int, $after: Cursor, $filter: TransactionRecordFilter) {
|
|
644
653
|
member {
|
|
645
654
|
transactionRecords(first: $first, after: $after, filter: $filter) {
|
|
@@ -665,8 +674,8 @@
|
|
|
665
674
|
}
|
|
666
675
|
}
|
|
667
676
|
}
|
|
668
|
-
`,
|
|
669
|
-
${
|
|
677
|
+
`,Ne=i`
|
|
678
|
+
${ve}
|
|
670
679
|
|
|
671
680
|
fragment PromoFragment on Promo {
|
|
672
681
|
id
|
|
@@ -687,7 +696,7 @@
|
|
|
687
696
|
dateTimeLastUpdated
|
|
688
697
|
}
|
|
689
698
|
`,bt=i`
|
|
690
|
-
${
|
|
699
|
+
${Ne}
|
|
691
700
|
|
|
692
701
|
query Promos {
|
|
693
702
|
promos {
|
|
@@ -695,14 +704,14 @@
|
|
|
695
704
|
}
|
|
696
705
|
}
|
|
697
706
|
`,Et=i`
|
|
698
|
-
${
|
|
707
|
+
${Ne}
|
|
699
708
|
|
|
700
709
|
query AvailablePromos($filter: PromoFilterInput) {
|
|
701
710
|
availablePromos(filter: $filter) {
|
|
702
711
|
...PromoFragment
|
|
703
712
|
}
|
|
704
713
|
}
|
|
705
|
-
`,
|
|
714
|
+
`,St=i`
|
|
706
715
|
fragment SpotBonusFragment on SpotBonusPromo {
|
|
707
716
|
id
|
|
708
717
|
name
|
|
@@ -742,16 +751,16 @@
|
|
|
742
751
|
code
|
|
743
752
|
maximumBonusesCountLimit
|
|
744
753
|
}
|
|
745
|
-
`,
|
|
746
|
-
${
|
|
754
|
+
`,Ct=i`
|
|
755
|
+
${St}
|
|
747
756
|
|
|
748
757
|
query PromoByCode($code: String!) {
|
|
749
758
|
promoByCode(code: $code) {
|
|
750
759
|
...SpotBonusFragment
|
|
751
760
|
}
|
|
752
761
|
}
|
|
753
|
-
`,
|
|
754
|
-
${
|
|
762
|
+
`,qe=i`
|
|
763
|
+
${ve}
|
|
755
764
|
|
|
756
765
|
fragment CashbackFragment on Cashback {
|
|
757
766
|
id
|
|
@@ -769,16 +778,16 @@
|
|
|
769
778
|
dateTimeCreated
|
|
770
779
|
dateTimeLastUpdated
|
|
771
780
|
}
|
|
772
|
-
`,
|
|
773
|
-
${
|
|
781
|
+
`,kt=i`
|
|
782
|
+
${qe}
|
|
774
783
|
|
|
775
784
|
query Cashbacks {
|
|
776
785
|
cashbacks {
|
|
777
786
|
...CashbackFragment
|
|
778
787
|
}
|
|
779
788
|
}
|
|
780
|
-
`,
|
|
781
|
-
${
|
|
789
|
+
`,Tt=i`
|
|
790
|
+
${Ne}
|
|
782
791
|
|
|
783
792
|
query Bonus {
|
|
784
793
|
bonus {
|
|
@@ -807,7 +816,7 @@
|
|
|
807
816
|
}
|
|
808
817
|
}
|
|
809
818
|
`,_t=i`
|
|
810
|
-
${
|
|
819
|
+
${Ne}
|
|
811
820
|
|
|
812
821
|
query Bonuses {
|
|
813
822
|
bonuses {
|
|
@@ -835,8 +844,8 @@
|
|
|
835
844
|
dateTimeLastUpdated
|
|
836
845
|
}
|
|
837
846
|
}
|
|
838
|
-
`,
|
|
839
|
-
${
|
|
847
|
+
`,Rt=i`
|
|
848
|
+
${qe}
|
|
840
849
|
|
|
841
850
|
query CashbackBonuses {
|
|
842
851
|
cashbackBonuses {
|
|
@@ -850,7 +859,7 @@
|
|
|
850
859
|
dateTimeLastUpdated
|
|
851
860
|
}
|
|
852
861
|
}
|
|
853
|
-
`,
|
|
862
|
+
`,Dt=i`
|
|
854
863
|
mutation ClaimCashbackBonus($input: ClaimCashbackBonusInput!) {
|
|
855
864
|
claimCashbackBonus(input: $input) {
|
|
856
865
|
... on CashbackBonusDoesNotExistError {
|
|
@@ -864,7 +873,7 @@
|
|
|
864
873
|
dateTimeLastActive
|
|
865
874
|
}
|
|
866
875
|
}
|
|
867
|
-
`;const
|
|
876
|
+
`;const Mt=i`
|
|
868
877
|
query MemberAccount {
|
|
869
878
|
memberAccount: self {
|
|
870
879
|
... on MemberAccount {
|
|
@@ -888,8 +897,8 @@
|
|
|
888
897
|
}
|
|
889
898
|
}
|
|
890
899
|
}
|
|
891
|
-
`,
|
|
892
|
-
${
|
|
900
|
+
`,vt=i`
|
|
901
|
+
${ve}
|
|
893
902
|
|
|
894
903
|
query MemberVerification {
|
|
895
904
|
memberAccount: self {
|
|
@@ -913,7 +922,7 @@
|
|
|
913
922
|
}
|
|
914
923
|
}
|
|
915
924
|
}
|
|
916
|
-
`,
|
|
925
|
+
`,Nt=i`
|
|
917
926
|
mutation RegisterMemberAccount(
|
|
918
927
|
$input: RegisterMemberAccountInput!
|
|
919
928
|
$referralCode: String
|
|
@@ -952,7 +961,7 @@
|
|
|
952
961
|
}
|
|
953
962
|
}
|
|
954
963
|
}
|
|
955
|
-
`,
|
|
964
|
+
`,It=i`
|
|
956
965
|
mutation RegisterMemberAccountViaMobile(
|
|
957
966
|
$input: RegisterMemberAccountViaMobileInput!
|
|
958
967
|
$referralCode: String
|
|
@@ -982,7 +991,7 @@
|
|
|
982
991
|
}
|
|
983
992
|
}
|
|
984
993
|
}
|
|
985
|
-
`,
|
|
994
|
+
`,Pt=i`
|
|
986
995
|
mutation RegisterMemberAccount(
|
|
987
996
|
$input: RegisterMemberAccountInput_next!
|
|
988
997
|
$reCAPTCHAResponse: String
|
|
@@ -1022,7 +1031,7 @@
|
|
|
1022
1031
|
}
|
|
1023
1032
|
}
|
|
1024
1033
|
}
|
|
1025
|
-
`,
|
|
1034
|
+
`,Ot=i`
|
|
1026
1035
|
mutation UpdateMemberAccount($input: UpdateMemberAccountInput!) {
|
|
1027
1036
|
updateMemberAccount(input: $input) {
|
|
1028
1037
|
... on AccountNameNotAvailableError {
|
|
@@ -1048,7 +1057,7 @@
|
|
|
1048
1057
|
}
|
|
1049
1058
|
}
|
|
1050
1059
|
}
|
|
1051
|
-
`,
|
|
1060
|
+
`,Bt=i`
|
|
1052
1061
|
mutation ResetPassword($input: ResetPasswordInput!, $verificationCode: String) {
|
|
1053
1062
|
resetPassword(input: $input, verificationCode: $verificationCode) {
|
|
1054
1063
|
... on AccountNotFoundError {
|
|
@@ -1059,11 +1068,11 @@
|
|
|
1059
1068
|
}
|
|
1060
1069
|
}
|
|
1061
1070
|
}
|
|
1062
|
-
`,
|
|
1071
|
+
`,Wt=i`
|
|
1063
1072
|
mutation DeleteMemberAccount($input: DeleteMemberAccountInput!) {
|
|
1064
1073
|
deleteMemberAccount(input: $input)
|
|
1065
1074
|
}
|
|
1066
|
-
`,
|
|
1075
|
+
`,xt=i`
|
|
1067
1076
|
mutation VerifyMobileNumber($input: VerifyMobileNumberInput!) {
|
|
1068
1077
|
verifyMobileNumber(input: $input) {
|
|
1069
1078
|
... on InvalidSMSVerificationCodeError {
|
|
@@ -1074,7 +1083,7 @@
|
|
|
1074
1083
|
}
|
|
1075
1084
|
}
|
|
1076
1085
|
}
|
|
1077
|
-
`,
|
|
1086
|
+
`,Ut=i`
|
|
1078
1087
|
mutation CreateMemberVerification($input: CreateMemberVerificationInput!) {
|
|
1079
1088
|
createMemberVerification(input: $input) {
|
|
1080
1089
|
... on FileDoesNotExistError {
|
|
@@ -1088,7 +1097,7 @@
|
|
|
1088
1097
|
}
|
|
1089
1098
|
}
|
|
1090
1099
|
}
|
|
1091
|
-
`,
|
|
1100
|
+
`,qt=i`
|
|
1092
1101
|
mutation UpdateMemberVerification($input: UpdateMemberVerificationInput!) {
|
|
1093
1102
|
updateMemberVerification(input: $input) {
|
|
1094
1103
|
... on FileDoesNotExistError {
|
|
@@ -1105,7 +1114,7 @@
|
|
|
1105
1114
|
}
|
|
1106
1115
|
}
|
|
1107
1116
|
}
|
|
1108
|
-
|
|
1117
|
+
`,$t=i`
|
|
1109
1118
|
query ProfileCompletion {
|
|
1110
1119
|
profileCompletion {
|
|
1111
1120
|
completionPercentage
|
|
@@ -1116,7 +1125,7 @@
|
|
|
1116
1125
|
accountPassword
|
|
1117
1126
|
}
|
|
1118
1127
|
}
|
|
1119
|
-
|
|
1128
|
+
`,Lt=i`
|
|
1120
1129
|
mutation SendVerificationCode($input: SendVerificationCodeInput!) {
|
|
1121
1130
|
sendVerificationCode(input: $input) {
|
|
1122
1131
|
... on InvalidPlatformError {
|
|
@@ -1127,7 +1136,7 @@
|
|
|
1127
1136
|
}
|
|
1128
1137
|
}
|
|
1129
1138
|
}
|
|
1130
|
-
`,
|
|
1139
|
+
`,Ft=i`
|
|
1131
1140
|
fragment DepositGatewaySettingsCoreData on DepositGatewaySettings {
|
|
1132
1141
|
minimumAmount
|
|
1133
1142
|
maximumAmount
|
|
@@ -1192,7 +1201,7 @@
|
|
|
1192
1201
|
multiplier
|
|
1193
1202
|
}
|
|
1194
1203
|
}
|
|
1195
|
-
`,
|
|
1204
|
+
`,Ht=i`
|
|
1196
1205
|
query Platform {
|
|
1197
1206
|
timezone
|
|
1198
1207
|
currency
|
|
@@ -1257,7 +1266,7 @@
|
|
|
1257
1266
|
...WithdrawalGatewaySettingsCoreData
|
|
1258
1267
|
}
|
|
1259
1268
|
}
|
|
1260
|
-
`,
|
|
1269
|
+
`,Yt=i`
|
|
1261
1270
|
query MayaSession($id: ObjectId!) {
|
|
1262
1271
|
mayaSession(id: $id) {
|
|
1263
1272
|
id
|
|
@@ -1265,11 +1274,11 @@
|
|
|
1265
1274
|
dateTimeCreated
|
|
1266
1275
|
}
|
|
1267
1276
|
}
|
|
1268
|
-
`,
|
|
1277
|
+
`,Qt=i`
|
|
1269
1278
|
mutation ValidateMayaSession {
|
|
1270
1279
|
validateMayaSession: validMayaSession
|
|
1271
1280
|
}
|
|
1272
|
-
`,
|
|
1281
|
+
`,jt=i`
|
|
1273
1282
|
query ActivityRecords($after: Cursor, $first: Int, $filter: ActivityRecordsFilterInput) {
|
|
1274
1283
|
member {
|
|
1275
1284
|
activityRecords(after: $after, first: $first, filter: $filter) {
|
|
@@ -1294,11 +1303,11 @@
|
|
|
1294
1303
|
}
|
|
1295
1304
|
}
|
|
1296
1305
|
}
|
|
1297
|
-
`,
|
|
1306
|
+
`,Kt=i`
|
|
1298
1307
|
query ReferralCode {
|
|
1299
1308
|
referralCode
|
|
1300
1309
|
}
|
|
1301
|
-
`,
|
|
1310
|
+
`,zt=i`
|
|
1302
1311
|
mutation UpdateReferralCode($input: UpdateReferralCodeInput!) {
|
|
1303
1312
|
updateReferralCode(input: $input) {
|
|
1304
1313
|
... on ReferralCodeNotAvailableError {
|
|
@@ -1306,7 +1315,7 @@
|
|
|
1306
1315
|
}
|
|
1307
1316
|
}
|
|
1308
1317
|
}
|
|
1309
|
-
`,
|
|
1318
|
+
`,Ie=i`
|
|
1310
1319
|
fragment ReferralFragment on Referral {
|
|
1311
1320
|
id
|
|
1312
1321
|
upline {
|
|
@@ -1324,7 +1333,7 @@
|
|
|
1324
1333
|
commission
|
|
1325
1334
|
dateTimeCreated
|
|
1326
1335
|
}
|
|
1327
|
-
`,
|
|
1336
|
+
`,Jt=i`
|
|
1328
1337
|
query Referrals($first: Int, $after: Cursor, $filter: ReferralFilterInput) {
|
|
1329
1338
|
member {
|
|
1330
1339
|
referrals(first: $first, after: $after, filter: $filter) {
|
|
@@ -1345,24 +1354,24 @@
|
|
|
1345
1354
|
}
|
|
1346
1355
|
}
|
|
1347
1356
|
|
|
1348
|
-
${
|
|
1349
|
-
`,
|
|
1357
|
+
${Ie}
|
|
1358
|
+
`,Xt=i`
|
|
1350
1359
|
query UplinesByName($search: String!, $first: Int) {
|
|
1351
1360
|
uplinesByName(search: $search, first: $first) {
|
|
1352
1361
|
...ReferralFragment
|
|
1353
1362
|
}
|
|
1354
1363
|
}
|
|
1355
1364
|
|
|
1356
|
-
${
|
|
1357
|
-
`,
|
|
1365
|
+
${Ie}
|
|
1366
|
+
`,Zt=i`
|
|
1358
1367
|
query DownlinesByName($search: String!, $first: Int) {
|
|
1359
1368
|
downlinesByName(search: $search, first: $first) {
|
|
1360
1369
|
...ReferralFragment
|
|
1361
1370
|
}
|
|
1362
1371
|
}
|
|
1363
1372
|
|
|
1364
|
-
${
|
|
1365
|
-
`,
|
|
1373
|
+
${Ie}
|
|
1374
|
+
`,er=i`
|
|
1366
1375
|
query ReferralCommission {
|
|
1367
1376
|
member {
|
|
1368
1377
|
referralCommission {
|
|
@@ -1381,13 +1390,13 @@
|
|
|
1381
1390
|
}
|
|
1382
1391
|
}
|
|
1383
1392
|
}
|
|
1384
|
-
`,
|
|
1393
|
+
`,tr=i`
|
|
1385
1394
|
query PointsClubSettings {
|
|
1386
1395
|
pointsClubSettings {
|
|
1387
1396
|
multiplier
|
|
1388
1397
|
}
|
|
1389
1398
|
}
|
|
1390
|
-
`,
|
|
1399
|
+
`,rr=i`
|
|
1391
1400
|
query Messages($first: Int, $after: Cursor, $filter: MessageFilterInput) {
|
|
1392
1401
|
messages(first: $first, after: $after, filter: $filter) {
|
|
1393
1402
|
edges {
|
|
@@ -1417,21 +1426,21 @@
|
|
|
1417
1426
|
}
|
|
1418
1427
|
}
|
|
1419
1428
|
}
|
|
1420
|
-
`,
|
|
1429
|
+
`,ar=i`
|
|
1421
1430
|
query UnreadMessagesCount($filter: MessageFilterInput) {
|
|
1422
1431
|
messages(filter: $filter) {
|
|
1423
1432
|
totalCount
|
|
1424
1433
|
}
|
|
1425
1434
|
}
|
|
1426
|
-
`,
|
|
1435
|
+
`,nr=i`
|
|
1427
1436
|
mutation MarkMessageAsRead($id: ObjectId!) {
|
|
1428
1437
|
markMessageAsRead(id: $id)
|
|
1429
1438
|
}
|
|
1430
|
-
`,
|
|
1439
|
+
`,or=i`
|
|
1431
1440
|
mutation MarkAllMessageAsRead {
|
|
1432
1441
|
markAllMessageAsRead
|
|
1433
1442
|
}
|
|
1434
|
-
`,
|
|
1443
|
+
`,ir=i`
|
|
1435
1444
|
mutation ClaimReward($id: ObjectId!) {
|
|
1436
1445
|
claimReward(id: $id) {
|
|
1437
1446
|
... on RewardAlreadyClaimedError {
|
|
@@ -1442,7 +1451,7 @@
|
|
|
1442
1451
|
}
|
|
1443
1452
|
}
|
|
1444
1453
|
}
|
|
1445
|
-
`,
|
|
1454
|
+
`,sr=i`
|
|
1446
1455
|
mutation ClaimSpotBonus($code: String!) {
|
|
1447
1456
|
claimSpotBonus(code: $code) {
|
|
1448
1457
|
... on InvalidPromoCodeError {
|
|
@@ -1456,17 +1465,17 @@
|
|
|
1456
1465
|
}
|
|
1457
1466
|
}
|
|
1458
1467
|
}
|
|
1459
|
-
`,
|
|
1468
|
+
`,mr=i`
|
|
1460
1469
|
query OnboardingStatus {
|
|
1461
1470
|
onboardingStatus
|
|
1462
1471
|
}
|
|
1463
|
-
`,
|
|
1472
|
+
`,dr=i`
|
|
1464
1473
|
mutation CompleteOnboarding($input: CompleteOnboardingInput!) {
|
|
1465
1474
|
completeOnboarding(input: $input)
|
|
1466
1475
|
}
|
|
1467
|
-
`,
|
|
1476
|
+
`,cr=i`
|
|
1468
1477
|
mutation SkipOnboarding {
|
|
1469
1478
|
skipOnboarding
|
|
1470
1479
|
}
|
|
1471
|
-
`;function l(o){return{name:o,message:{MaximumBonusesCountLimitExceededError:"Maximum bonuses reached",InvalidPromoCodeError:"Invalid Promo Code",SpotBonusAlreadyClaimedError:"This promo code has already been redeemed and cannot be used again",RewardAlreadyExpiredError:"Reward is either expired or no longer available",AccountNameNotAvailableError:"Username is no longer available",AccountNotFoundError:"Account does not exist",AccountNotVerifiedError:"Account is not verified",CashbackBonusDoesNotExistError:"Cashback bonus does not exists",DepositPromoMaximumAmountExceededError:"Deposit amount exceeds maximum amount",DepositPromoMinimumAmountNotMetError:"Deposit amount does not meet minimum amount",EmailAddressNotAvailableError:"Email is no longer available",FileDoesNotExistError:"File does not exist",FileFormatNotSupportedError:"File format is not supported",FileNameTooLongError:"File name is too long",FileNotReadyError:"File is not yet ready",FileSizeTooBigError:"File size is too big",GameDoesNotExistError:"Game does not exist",HasActiveBonusError:"Account has active bonus",InsufficientPointsError:"Insufficient points",InvalidPlatformError:"Invalid platform",InvalidReCAPTCHAResponseError:"Invalid reCAPTCHA",InvalidSMSVerificationCodeError:"Invalid SMS verification code",InvalidTransactionPasswordError:"Invalid transaction password",InvalidVerificationCodeError:"Invalid verification code",InvalidWithdrawalAmountError:"Invalid withdrawal amount",MaximumDepositAmountExceededError:"Maximum deposit amount exceeded",MemberVerificationAlreadyApprovedError:"Member verification is already approved",MemberVerificationAlreadyExistsError:"Member verification already exists",MemberVerificationDoesNotExistError:"Member verification does not exist",MinimumAgeRequirementError:"Minimum age requirement not met",MinimumDepositAmountNotMetError:"Minimum deposit amount not met",MinimumFirstDepositAmountNotMetError:"Minimum first deposit amount not met",MobileNumberAlreadyVerifiedError:"Mobile number is already verified",MobileNumberNotAvailableError:"Mobile number is no longer available",MobileNumberNotVerifiedError:"Mobile number is not verified",NickNameNotAvailableError:"Nickname is no longer available",NotEnoughBalanceError:"Insufficient balance",NotReadyToSendVerficationCodeError:"Not ready to send verification code",PromoNotEnabledError:"Promo is not enabled",RealNameAlreadySetError:"Real name is already set",ValidIdAlreadySetError:"Valid ID is already set",WalletDoesNotExistError:"Wallet does not exist",WithdrawalDailyLimitExceededError:"Daily withdrawal limit exceeded",GameProviderError:"Game provider error",GameSessionAlreadyClosedError:"Game session is already closed",GameSessionDoesNotExistError:"Game session does not exist",ReferralCodeNotAvailableError:"Referral code is no longer available",AccountBlacklistedError:"Account is blacklisted",InvalidTokenError:"Invalid token",InvalidTokenOrSecretAnswerError:"Invalid token or secret answer",SessionExpiredError:"Session expired",RateLimitExceededError:"Maximum number of requests reached",RewardAlreadyClaimedError:"Reward is already claimed",ReCAPTCHAVerificationFailedError:"Invalid reCAPTCHA"}[o]}}class cr{constructor(e){d(this,"client");this.client=e}async memberAccount(){const e=await this.client.request(Dt);return e.ok?{ok:!0,data:e.data.memberAccount}:e}async registerMemberAccount(e){const{reCAPTCHAResponse:t,...r}=e,a=await this.client.request(vt,r,{headers:{...t&&{"google-recaptcha-response":t}}});return a.ok?a.data.registerMemberAccount?{ok:!1,error:l(a.data.registerMemberAccount.__typename)}:{ok:!0}:a}async registerMemberAccountViaMobile(e){const{reCAPTCHAResponse:t,...r}=e,a=await this.client.request(Nt,r,{headers:{...t&&{"google-recaptcha-response":t}}});return a.ok?a.data.registerMemberAccountViaMobile?{ok:!1,error:l(a.data.registerMemberAccountViaMobile.__typename)}:{ok:!0}:a}async registerMemberAccount__next(e){const{reCAPTCHAResponse:t,...r}=e,a=await this.client.request(It,r,{headers:{...t&&{"google-recaptcha-response":t}}});return a.ok?a.data.registerMemberAccount?{ok:!1,error:l(a.data.registerMemberAccount.__typename)}:{ok:!0}:a}async updateMemberAccount(e){const t=await this.client.request(Pt,e);return t.ok?t.data.updateMemberAccount?{ok:!1,error:l(t.data.updateMemberAccount.__typename)}:{ok:!0}:t}async deleteMemberAccount(e){const t=await this.client.request(Bt,e);return t.ok?t.data.deleteMemberAccount?{ok:!0}:{ok:!1,error:{name:"UnknownError",message:"Something went wrong."}}:t}async resetPassword(e){const t=await this.client.request(Ot,e);return t.ok?t.data.resetPassword?{ok:!1,error:l(t.data.resetPassword.__typename)}:{ok:!0}:t}async profileCompletion(){const e=await this.client.request(qt);return e.ok?{ok:!0,data:e.data.profileCompletion}:e}async platform(){return await this.client.request(Lt)}async sendVerificationCode(e){const t=await this.client.request($t,e);return t.ok?t.data.sendVerificationCode?{ok:!1,error:l(t.data.sendVerificationCode.__typename)}:{ok:!0}:t}async paymentSettings(){return await this.client.request(Vt)}async verifyMobileNumber(e){const t=await this.client.request(Wt,e);return t.ok?t.data.verifyMobileNumber?{ok:!1,error:l(t.data.verifyMobileNumber.__typename)}:{ok:!0}:t}async createMemberVerification(e){const t=await this.client.request(xt,e);return t.ok?t.data.createMemberVerification?{ok:!1,error:l(t.data.createMemberVerification.__typename)}:{ok:!0}:t}async updateMemberVerification(e){const t=await this.client.request(Ut,e);return t.ok?t.data.updateMemberVerification?{ok:!1,error:l(t.data.updateMemberVerification.__typename)}:{ok:!0}:t}async memberVerification(){const e=await this.client.request(Mt);return e.ok?{ok:!0,data:e.data.memberAccount.verification}:e}async announcements(e){const t=await this.client.request(Ze,e);return t.ok?{ok:!0,data:t.data.announcements}:t}async registerMayaMemberAccount(e){const t=await this.client.request(Gt,e);return t.ok?t.data.registerMayaMemberAccount?{ok:!1,error:l(t.data.registerMayaMemberAccount.__typename)}:{ok:!0}:t}async referralCode(){const e=await this.client.request(jt);return e.ok?{ok:!0,data:e.data.referralCode}:e}async updateReferralCode(e){const t=await this.client.request(Kt,e);return t.ok?t.data.updateReferralCode?{ok:!1,error:l(t.data.updateReferralCode.__typename)}:{ok:!0}:t}async pointsClubSettings(){const e=await this.client.request(er);return e.ok?{ok:!0,data:e.data.pointsClubSettings}:e}}function h(o,e){const t=Ie[o]?Ie[o]:Ie[500];return{name:t.name,message:e??t.message}}const Ie={400:{name:"HttpBadRequest",message:"Bad Request"},401:{name:"HttpUnauthorized",message:"Unauthorized"},403:{name:"HttpForbidden",message:"Forbidden"},404:{name:"HttpNotFound",message:"Not Found"},408:{name:"HttpRequestTimeout",message:"Request Timeout"},429:{name:"HttpTooManyRequests",message:"Too Many Requests"},500:{name:"HttpInternalServerError",message:"Internal Server Error"}};class dr{constructor(e){d(this,"url");d(this,"platform");this.url=e.url,this.platform=e.platform}get headers(){const e=new Headers;return e.append("Accept","application/json, text/plain"),e.append("Content-Type","application/json"),e.append("Platform-Code",this.platform),e.append("Role","MEMBER"),e}async createSession(e){const t=new Headers(this.headers);if(e.name){const r=`${e.name}:${e.password}`,a=Buffer.from(r).toString("base64");t.set("Authorization",`Basic ${a}`)}if(e.mobileNumber){const r=`${e.mobileNumber}:${e.verificationCode}`,a=Buffer.from(r).toString("base64");console.log(`MobileNumberOTP ${a}`),t.set("Authorization",`MobileNumberOTP ${a}`)}e.sessionId&&t.set("Authorization",`MayaSession ${e.sessionId}`),e.token&&t.set("Authorization",`Token ${e.token}`),e.reCAPTCHAResponse&&t.set("google-recaptcha-response",e.reCAPTCHAResponse);try{const r=await fetch(`${this.url}/sessions`,{method:"POST",headers:t}),a=await r.json();return r.ok?{ok:!0,data:a}:a.code==="ACCOUNT_BLACKLISTED"?{ok:!1,error:l("AccountBlacklistedError")}:a.code==="INVALID_RECAPTCHA_RESPONSE"?{ok:!1,error:l("InvalidReCAPTCHAResponseError")}:{ok:!1,error:h(r.status)}}catch{return{ok:!1,error:h(500)}}}async authenticate(e){const t=new Headers(this.headers);if(e.type==="SECURITY_QUESTION"){t.set("Authorization",`Bearer ${e.token}`);try{const r=await fetch(`${this.url}/session/${e.token}/authenticate`,{method:"POST",headers:t,body:JSON.stringify({secretAnswer:e.secretAnswer})}),a=await r.json();return r.ok?{ok:!0,data:a}:r.status===401||r.status===403?{ok:!1,error:l("InvalidTokenOrSecretAnswerError")}:{ok:!1,error:h(r.status)}}catch{return{ok:!1,error:h(500)}}}throw new Error("Invalid input 'type'")}async refreshSession(e){const t=new Headers(this.headers);t.append("Authorization",`Bearer ${e}`);try{const r=await fetch(`${this.url}/session:refresh`,{method:"POST",headers:t}),a=await r.json();return r.ok?{ok:!0,data:a}:a.code==="ACCOUNT_BLACKLISTED"?{ok:!1,error:l("AccountBlacklistedError")}:r.status===403||r.status===401?{ok:!1,error:l("InvalidTokenError")}:{ok:!1,error:h(r.status)}}catch{return{ok:!1,error:h(500)}}}async destroySession(e){const t=new Headers(this.headers);t.append("Authorization",`Bearer ${e}`);try{const r=await fetch(`${this.url}/session`,{method:"DELETE",headers:t});return r.ok?{ok:!0}:{ok:!1,error:h(r.status)}}catch{return{ok:!1,error:h(500)}}}async verifySession(e){const t=new Headers(this.headers);t.append("Authorization",`Bearer ${e}`);try{return(await fetch(`${this.url}/session`,{method:"GET",headers:t})).ok}catch{return!0}}async sendVerificationCode(e){if(e.channel==="EMAIL")throw new Error("Email channel is not yet supported");function t(r){switch(r){case"MEMBER_NOT_FOUND":return"AccountNotFoundError";case"RATE_LIMIT_REACH":return"RateLimitExceededError";case"NOT_READY_TO_SEND_VERIFICATION_ERROR":return"NotReadyToSendVerficationCodeError";default:return null}}try{const r=await fetch(`${this.url}/otps`,{method:"POST",headers:this.headers,body:JSON.stringify(e)});if(r.status===403){const a=await r.json(),m=t(a.message);return m?{ok:!1,error:l(m)}:{ok:!1,error:h(r.status,a.message)}}return r.ok?{ok:!0}:{ok:!1,error:h(r.status)}}catch{return{ok:!1,error:h(500)}}}}class lr{constructor(e){d(this,"url");d(this,"siteId");d(this,"platformId");this.url=e.url,this.siteId=e.site,this.platformId=e.platform}async self(){const e=await this.getJson(`/sites/${this.siteId}`);return e.ok?{ok:!0,data:e.data.data}:e}async games(e){var a,m,s,u,c,p,y,f,R,D,M,v,N,I,g,G,P,k,O,B,W,x,_,U,q,$,L,F,V,H,Y,Q;const t=new URLSearchParams;e!=null&&e.first&&t.set("first",e.first.toString()),e!=null&&e.after&&t.set("after",e.after),e!=null&&e.search&&t.set("search",e.search),(m=(a=e==null?void 0:e.filter)==null?void 0:a.type)!=null&&m.equal&&t.set("filter[type][eq]",e.filter.type.equal),(u=(s=e==null?void 0:e.filter)==null?void 0:s.type)!=null&&u.notEqual&&t.set("filter[type][neq]",e.filter.type.notEqual),(p=(c=e==null?void 0:e.filter)==null?void 0:c.type)!=null&&p.in&&t.set("filter[type][in]",e.filter.type.in.join(",")),(f=(y=e==null?void 0:e.filter)==null?void 0:y.type)!=null&&f.notIn&&t.set("filter[type][nin]",e.filter.type.notIn.join(",")),(D=(R=e==null?void 0:e.filter)==null?void 0:R.provider)!=null&&D.equal&&t.set("filter[provider][eq]",e.filter.provider.equal),(v=(M=e==null?void 0:e.filter)==null?void 0:M.provider)!=null&&v.notEqual&&t.set("filter[provider][neq]",e.filter.provider.notEqual),(I=(N=e==null?void 0:e.filter)==null?void 0:N.provider)!=null&&I.in&&t.set("filter[provider][in]",e.filter.provider.in.join(",")),(G=(g=e==null?void 0:e.filter)==null?void 0:g.provider)!=null&&G.notIn&&t.set("filter[provider][nin]",e.filter.provider.notIn.join(",")),(k=(P=e==null?void 0:e.filter)==null?void 0:P.tags)!=null&&k.equal&&t.set("filter[tags][eq]",e.filter.tags.equal.toLowerCase()),(B=(O=e==null?void 0:e.filter)==null?void 0:O.tags)!=null&&B.notEqual&&t.set("filter[tags][neq]",e.filter.tags.notEqual.toLowerCase()),(x=(W=e==null?void 0:e.filter)==null?void 0:W.tags)!=null&&x.in&&t.set("filter[tags][in]",e.filter.tags.in.map(C=>C.toLowerCase()).join(",")),(U=(_=e==null?void 0:e.filter)==null?void 0:_.tags)!=null&&U.notIn&&t.set("filter[tags][nin]",e.filter.tags.notIn.map(C=>C.toLowerCase()).join(",")),($=(q=e==null?void 0:e.filter)==null?void 0:q.reference)!=null&&$.equal&&t.set("filter[reference][eq]",e.filter.reference.equal),(F=(L=e==null?void 0:e.filter)==null?void 0:L.reference)!=null&&F.notEqual&&t.set("filter[reference][neq]",e.filter.reference.notEqual),(H=(V=e==null?void 0:e.filter)==null?void 0:V.reference)!=null&&H.in&&t.set("filter[reference][in]",e.filter.reference.in.join(",")),(Q=(Y=e==null?void 0:e.filter)==null?void 0:Y.reference)!=null&&Q.notIn&&t.set("filter[reference][nin]",e.filter.reference.notIn.join(",")),e!=null&&e.sort&&t.set("sort[order]",e.sort);const r=await this.getJson("/games",t);return r.ok?{ok:!0,data:{edges:r.data.data.map(C=>({node:C,cursor:C.cursor})),totalCount:r.data.totalCount??0,pageInfo:{hasNextPage:!!r.data.next,endCursor:r.data.next}}}:r}async game(e){var r;const t=await this.getJson(`/games/${e}`);return((r=t.error)==null?void 0:r.name)==="HttpNotFound"?{ok:!0,data:null}:t.ok?{ok:!0,data:t.data.data}:t}async getJson(e,t){const r=new Request(`${this.url}${e}?${(t==null?void 0:t.toString())??""}`,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json","Site-ID":this.siteId,"Platform-ID":this.platformId}});try{const a=await fetch(r);return a.ok?{ok:!0,data:await a.json()}:{ok:!1,error:h(a.status)}}catch{return{ok:!1,error:h(500)}}}}class pr{constructor(e){d(this,"client");this.client=e}async file(e){const t=await this.client.request(Ye,e);return t.ok?{ok:!0,data:t.data.node}:t}async uploadPrivateImageFile(e){const t=await this.client.upload(Qe,e);return t.ok?t.data.uploadPrivateImageFile?{ok:!1,error:l(t.data.uploadPrivateImageFile.__typename)}:{ok:!0}:t}}class fr{constructor(e){d(this,"client");this.client=e}async gameSession(e){const t=await this.client.request(Be.legacy,e);return t.ok?{ok:!0,data:t.data.node?{...t.data.node,game:t.data.node.game.id}:null}:t}async createGameSession(e){const t=await this.client.request(We,e);return t.ok?t.data.createGameSession?{ok:!1,error:l(t.data.createGameSession.__typename)}:{ok:!0}:t}async endGameSession(e){const t=await this.client.request(xe.legacy,e);return t.ok?t.data.endGameSession?{ok:!1,error:{name:"UnknownError",message:"Something went wrong."}}:{ok:!0}:t}}class wr{constructor(e){d(this,"client");this.client=e}async latestBetRecords(){const e=await this.client.request(ht);return e.ok?{ok:!0,data:e.data.latestBetRecords}:e}async platform(){const e=await this.client.request(Ft);return e.ok?{ok:!0,data:e.data}:e}async recommendedGames(){const e=await this.client.request(Xe);return e.ok?{ok:!0,data:e.data.recommendedGames}:e}async onboardingStatus(){const e=await this.client.request(sr);return e.ok?{ok:e.ok,data:e.data.onboardingStatus??[]}:e}async completeOnboarding(e){const t=await this.client.request(mr,e);return t.ok?t.data.completeOnboarding?{ok:!0}:{ok:!1,error:{name:"UnknownError",message:"Something went wrong"}}:t}async skipOnboarding(){const e=await this.client.request(ur);return e.ok?e.data.skipOnboarding?{ok:!0}:{ok:!1,error:{name:"UnknownError",message:"Something went wrong"}}:e}}class yr{constructor(e){d(this,"client");this.client=e}async betRecords(e){const t=await this.client.request(yt,e);return t.ok?{ok:t.ok,data:t.data.member.betRecords}:t}async transactionRecords(e){const t=await this.client.request(gt,e);return t.ok?{ok:t.ok,data:t.data.member.transactionRecords}:t}async withdrawalRecords(e){const t=await this.client.request(et,e);return t.ok?{ok:t.ok,data:t.data.member.withdrawalRecords}:t}async depositRecords(e){const t=await this.client.request(mt,e);return t.ok?{ok:t.ok,data:t.data.member.depositRecords}:t}async depositsCount(){const e=await this.client.request(wt);return e.ok?{ok:e.ok,data:e.data.member.depositsCount}:e}async pointsWalletTransactions(e){const t=await this.client.request(Je,e);return t.ok?{ok:t.ok,data:t.data.member.pointsWalletTransactions}:t}async activityRecords(e){const t=await this.client.request(Qt,e);return t.ok?{ok:t.ok,data:t.data.member.activityRecords}:t}async referrals(e){const t=await this.client.request(zt,e);return t.ok?{ok:t.ok,data:t.data.member.referrals}:t}async referralCommission(){const e=await this.client.request(Zt);return e.ok?{ok:e.ok,data:e.data.member.referralCommission}:e}async uplinesByName(e){const t=await this.client.request(Jt,e);return t.ok?{ok:t.ok,data:t.data.uplinesByName}:t}async downlinesByName(e){const t=await this.client.request(Xt,e);return t.ok?{ok:t.ok,data:t.data.downlinesByName}:t}async promoByCode(e){const t=await this.client.request(St,e);return t.ok?{ok:t.ok,data:t.data.promoByCode}:t}}class hr{constructor(e){d(this,"client");this.client=e}async messages(e){const t=await this.client.request(tr,e);return t.ok?{ok:t.ok,data:t.data.messages}:t}async unreadMessagesCount(e){const t=await this.client.request(rr,{...e,filter:{...e==null?void 0:e.filter,markedAsRead:{equal:!1}}});return t.ok?{ok:t.ok,data:t.data.messages.totalCount}:t}async markMessageAsRead(e){const t=await this.client.request(ar,e);return t.ok?t.data.markMessageAsRead?{ok:!0}:{ok:!1,error:{name:"UnknownError",message:"Something went wrong."}}:t}async markAllMessageAsRead(){const e=await this.client.request(nr);return e.ok?e.data.markAllMessageAsRead?{ok:!0}:{ok:!1,error:{name:"UnknownError",message:"Something went wrong."}}:e}async claimReward(e){const t=await this.client.request(or,e);return t.ok?t.data.claimReward?{ok:!1,error:l(t.data.claimReward.__typename)}:{ok:!0}:t}}class gr{constructor(e){d(this,"client");this.client=e}async promos(){const e=await this.client.request(bt);return e.ok?{ok:e.ok,data:e.data.promos}:e}async cashbacks(){const e=await this.client.request(Ct);return e.ok?{ok:e.ok,data:e.data.cashbacks}:e}async availablePromos(e){const t=await this.client.request(Et,e);return t.ok?{ok:t.ok,data:t.data.availablePromos}:t}async cashbackBonuses(){const e=await this.client.request(Tt);return e.ok?{ok:e.ok,data:e.data.cashbackBonuses}:e}async claimCashbackBonus(e){const t=await this.client.request(Rt,e);return t.ok?t.data.claimCashbackBonus?{ok:!1,error:l(t.data.claimCashbackBonus.__typename)}:{ok:!0}:{ok:t.ok,error:t.error}}async bonus(){const e=await this.client.request(kt);return e.ok?{ok:e.ok,data:e.data.bonus}:e}async wallet(){const e=await this.client.request(je);return e.ok?{ok:e.ok,data:e.data.wallet}:e}async deposit(e){const t=await this.client.request(ft,e);return t.ok?{ok:t.ok,data:t.data.node}:t}async createGCashDeposit(e){const t=await this.client.request(ut,e);return t.ok?t.data.createGCashDeposit?{ok:!1,error:l(t.data.createGCashDeposit.__typename)}:{ok:!0}:t}async createMayaDeposit(e){const t=await this.client.request(ct,e);return t.ok?t.data.createMayaDeposit?{ok:!1,error:l(t.data.createMayaDeposit.__typename)}:{ok:!0}:t}async createAIOQRPHDeposit(e){const t=await this.client.request(lt,e);return t.ok?t.data.createAIOQRPHDeposit?{ok:!1,error:l(t.data.createAIOQRPHDeposit.__typename)}:{ok:!0}:t}async createAIOOnlineBankDeposit(e){const t=await this.client.request(pt,e);return t.ok?t.data.createAIOOnlineBankDeposit?{ok:!1,error:l(t.data.createAIOOnlineBankDeposit.__typename)}:{ok:!0}:t}async createMayaAppDeposit(e){const t=await this.client.request(dt,e);return t.ok?t.data.createMayaAppDeposit?{ok:!1,error:l(t.data.createMayaAppDeposit.__typename)}:{ok:!0}:t}async createGCashWithdrawal(e){const t=await this.client.request(tt,e);return t.ok?t.data.createGCashWithdrawal?{ok:!1,error:l(t.data.createGCashWithdrawal.__typename)}:{ok:!0}:t}async createMayaWithdrawal(e){const t=await this.client.request(rt,e);return t.ok?t.data.createMayaWithdrawal?{ok:!1,error:l(t.data.createMayaWithdrawal.__typename)}:{ok:!0}:t}async createMayaAppWithdrawal(e){const t=await this.client.request(at,e);return t.ok?t.data.createMayaAppWithdrawal?{ok:!1,error:l(t.data.createMayaAppWithdrawal.__typename)}:{ok:!0}:t}async createBankWithdrawal(e){const t=await this.client.request(nt,e);return t.ok?t.data.createBankWithdrawal?{ok:!1,error:l(t.data.createBankWithdrawal.__typename)}:{ok:!0}:t}async createAIOInstapayWithdrawal(e){const t=await this.client.request(ot,e);return t.ok?t.data.createAIOInstapayWithdrawal?{ok:!1,error:l(t.data.createAIOInstapayWithdrawal.__typename)}:{ok:!0}:t}async instapayBankList(){const e=await this.client.request(it);return e.ok?{ok:e.ok,data:e.data.instapayBankList}:e}async remainingDailyWithdrawalsCount(){const e=await this.client.request(st);return e.ok?{ok:e.ok,data:e.data.remainingDailyWithdrawalsCount}:e}async pointsWallet(){const e=await this.client.request(Ke);return e.ok?{ok:e.ok,data:e.data.pointsWallet}:e}async redeemPointsToCash(e){const t=await this.client.request(ze,e);return t.ok?t.data.redeemPointsToCash?{ok:!1,error:l(t.data.redeemPointsToCash.__typename)}:{ok:!0}:t}async mayaSession(e){const t=await this.client.request(Ht,e);return t.ok?{ok:t.ok,data:t.data.mayaSession}:t}async gameSession(e){const t=await this.client.request(Be.current,e);return t.ok?{ok:!0,data:t.data.node}:t}async createGameSession(e){const t=await this.client.request(We,e);return t.ok?t.data.createGameSession?{ok:!1,error:l(t.data.createGameSession.__typename)}:{ok:!0}:t}async endGameSession(e){const t=await this.client.request(xe.current,e);return t.ok?t.data.endGameSession?{ok:!0}:{ok:!1,error:{name:"UnknownError",message:"Something went wrong."}}:t}async validateMayaSession(){const e=await this.client.request(Yt);return e.ok?e.data.validateMayaSession?{ok:!0}:{ok:!1,error:{name:"UnknownError",message:"Something went wrong."}}:e}async bonuses(){const e=await this.client.request(_t);return e.ok?{ok:e.ok,data:e.data.bonuses??[]}:e}async claimSpotBonus(e){const t=await this.client.request(ir,e);return t.ok?t.data.claimSpotBonus?{ok:!1,error:l(t.data.claimSpotBonus.__typename)}:{ok:!0}:{ok:t.ok,error:t.error}}}function Ge(o){return new Date(o.getTime())}function j(o,e){const t=Ge(o);return t.setMinutes(t.getMinutes()+e),t}function Pe(o,e){return o.getTime()>e.getTime()}class br{constructor(e){d(this,"config");d(this,"cache");this.cache={},this.config={cacheTime:5,...e}}set(e,t){const r=j(new Date,this.config.cacheTime);this.cache[e]={value:t,validUntil:r}}get(e){const t=this.cache[e];return!t||Pe(new Date,t.validUntil)?null:t.value}}function Er(o,e,t){return o<e?e:o>t?t:o}function Oe(o){return Object.prototype.toString.call(o)==="[object Object]"&&Object(o)===o}function Ar(o){const e=[];function t(r,a=[]){for(const m in r){const s=r[m];Oe(s)?t(s,[...a,m]):Array.isArray(s)?t(Sr(s),[...a,m]):e.push({key:[...a,m],value:s})}}return t(o),e}function Sr(o){return o.reduce((e,t,r)=>(e[r]=t,e),{})}class K{constructor(e,t){d(this,"url");d(this,"options");d(this,"middlewares");var a;const r=new Headers((a=t==null?void 0:t.fetchOptions)==null?void 0:a.headers);this.url=e,this.options={...t==null?void 0:t.fetchOptions,headers:r},this.middlewares=(t==null?void 0:t.middlewares)??[]}async request(e,t,r){const a=$e(this.options,r),m=JSON.stringify({query:e,variables:t}),s=new Headers(a.headers);s.set("Content-Type","application/json"),s.set("Accept","application/json");const u=new URL(this.url),c=qe(e);c&&u.searchParams.set(`_${c.type}`,c.name);const p=await this.runMiddlewares(new Request(u,{...a,body:m,headers:s,method:"POST"}));return await this.exec(p)}async upload(e,t,r){const a=$e(this.options,r),m=this.createUploadBody(e,t),s=new Headers(a.headers);s.delete("Content-Type");const u=new URL(this.url),c=qe(e);c&&u.searchParams.set(`_${c.type}`,c.name);const p=await this.runMiddlewares(new Request(u,{...a,body:m,headers:s,method:"POST"}));return await this.exec(p)}async exec(e){var t,r,a,m,s,u;try{const c=await fetch(e);if(!c.ok)return{ok:!1,error:h(c.status)};const p=await c.json(),y=p.data,f=(t=p.errors)==null?void 0:t.at(0);return f?((r=f.extensions)==null?void 0:r.code)==="FORBIDDEN"||((a=f.extensions)==null?void 0:a.code)==="ACCESS_TOKEN_EXPIRED"?{ok:!1,error:h(403,f.message)}:((m=f.extensions)==null?void 0:m.code)==="UNAUTHORIZED"?{ok:!1,error:h(401,f.message)}:((s=f.extensions)==null?void 0:s.code)==="BAD_USER_INPUT"||((u=f.extensions)==null?void 0:u.code)==="BAD_REQUEST"?{ok:!1,error:h(400,f.message)}:{ok:!1,error:h(500,f.message)}:{ok:!0,data:y}}catch{return{ok:!1,error:h(500)}}}async runMiddlewares(e){let t=e.clone();for(const r of this.middlewares)t=await r(t);return t}createUploadBody(e,t){const r=Ar(t).filter(s=>s.value instanceof File||s.value instanceof Blob),a=new FormData;a.append("operations",JSON.stringify({query:e,variables:t}));const m={};return r.forEach((s,u)=>{m[u.toString()]=[`variables.${s.key.join(".")}`]}),a.append("map",JSON.stringify(m)),r.forEach((s,u)=>{a.append(u.toString(),s.value)}),a}}function qe(o){const e=o.match(/(query|mutation)\s+(\w+)/);if(!e)return null;const t=e.at(1),r=e.at(2);return t&&r?{type:t,name:r}:null}function $e(o,e){return o?e?{...o,...e,headers:Cr(o.headers,e.headers)}:o??{}:e??{}}function Cr(o,e){if(!o)return e;if(!e)return o;const t=new Headers;return new Headers(o).forEach((r,a)=>t.append(a,r)),new Headers(e).forEach((r,a)=>t.append(a,r)),t}function kr(o){return o==="INR"?"en-IN":o==="MYR"?"en-MY":o==="IDR"?"en-ID":o==="USD"?"en-US":"en-PH"}function _r(o){return o==="en-IN"?"+91":o==="en-MY"?"+60":o==="en-ID"?"+62":o==="en-US"?"+1":"+63"}function T(o,e){const t=_r(e);return o.startsWith(t)?o:o.startsWith(t.substring(1))?`+${o}`:o.startsWith("0")?`${t}${o.substring(1)}`:`${t}${o}`}async function A(o){const e=new TextEncoder().encode(o),t=await crypto.subtle.digest("SHA-256",e);return Array.from(new Uint8Array(t)).map(m=>m.toString(16).padStart(2,"0")).join("")}class Le{constructor(e){d(this,"enabled");this.enabled=(e==null?void 0:e.enabled)??!0}info(e){this.enabled&&console.log(`\x1B[34m[info] ${e}`)}warn(e){this.enabled&&console.log(`\x1B[33m[warn] ${e}`)}error(e){this.enabled&&console.log(`\x1B[31m[error] ${e}`)}success(e){this.enabled&&console.log(`\x1B[32m[success] ${e}`)}}function z(o,e){const t=Ge(o);return t.setDate(t.getDate()+e),t}function Fe(o){return new Promise(e=>{setTimeout(e,o)})}function Ve(o,e){const{until:t,interval:r=1e3,maxAttempt:a=3}=e;async function m(s,u){const c=u??a,p=await o(...s);return t(p)?p:c>1?(await Fe(r*((a-c)/2)),m(s,c-1)):p}return async(...s)=>await m(s)}function J(o,e){const t=Ge(o);return t.setMinutes(t.getMinutes()-e),t}class Tr{constructor(e){d(this,"logger");d(this,"storageKey","session");d(this,"authService");d(this,"walletService");d(this,"_refreshing",!1);this.authService=e.authService,this.walletService=e.walletService,this.logger=new Le({enabled:e.logs??!1})}get refreshing(){return this._refreshing}set refreshing(e){this._refreshing=e}async create(e){var a;if(this.isServer)return this.logger.warn("'localStorage' is not available on the server."),{ok:!1,error:{name:"UnknownError",message:"Server sign in is not supported."}};if(e.type==="MAYA"){const s=await Ve(()=>this.walletService.mayaSession({id:e.sessionId}),{until:y=>{var f;return y.ok&&((f=y.data)==null?void 0:f.member)!=null},interval:1e3,maxAttempt:5})();if(!s.ok)return s;if(!((a=s.data)!=null&&a.member))return{ok:!1,error:{name:"HttpForbidden",message:"Forbidden"}};const c=await Ve(()=>this.authService.createSession(e),{until:y=>y.ok,interval:1e3,maxAttempt:5})();if(!c.ok)return c;const p=new Date;return window.localStorage.setItem(this.storageKey,JSON.stringify({...c.data,accessTokenExpiresAt:j(p,8).getTime(),refreshTokenExpiresAt:J(z(p,30),2).getTime()})),{ok:!0,data:null}}if(e.type==="MOBILE_NUMBER"){const m=await this.authService.createSession(e);if(m.ok){const s=new Date;return window.localStorage.setItem(this.storageKey,JSON.stringify({...m.data,accessTokenExpiresAt:j(s,8).getTime(),refreshTokenExpiresAt:J(z(s,30),2).getTime()})),{ok:!0,data:null}}return m}if(e.type==="TOKEN"){const m=await this.authService.createSession({token:e.token});if(m.ok){const s=new Date;return window.localStorage.setItem(this.storageKey,JSON.stringify({...m.data,accessTokenExpiresAt:j(s,8).getTime(),refreshTokenExpiresAt:J(z(s,30),2).getTime()})),{ok:!0,data:null}}return m}const t=await this.authService.createSession(e);if(!t.ok)return t;if(t.data.authenticator)return{ok:!0,data:{authenticator:t.data.authenticator}};const r=new Date;return window.localStorage.setItem(this.storageKey,JSON.stringify({...t.data,accessTokenExpiresAt:j(r,8).getTime(),refreshTokenExpiresAt:J(z(r,30),2).getTime()})),{ok:!0,data:null}}async createFromAuthenticator(e){const t=await this.authService.authenticate(e);if(t.ok){const r=new Date;return this.isServer?this.logger.warn("'localStorage' is not available on the server."):window.localStorage.setItem(this.storageKey,JSON.stringify({...t.data,accessTokenExpiresAt:j(r,8).getTime(),refreshTokenExpiresAt:J(z(r,30),2).getTime()})),{ok:!0}}else return t}async get(){if(this.isServer)return this.logger.warn("'localStorage' is not available on the server."),{ok:!0,data:null};if(this.refreshing)return await Fe(1e3),await this.get();const e=window.localStorage.getItem(this.storageKey);if(!e)return{ok:!0,data:null};try{let t=JSON.parse(e),r=new Date;const a=new Date(t.accessTokenExpiresAt),m=new Date(t.refreshTokenExpiresAt);if(Pe(r,m))return this.logger.warn("Session expired. Logging out.."),window.localStorage.removeItem(this.storageKey),{ok:!1,error:{name:"SessionExpiredError",message:"Session expired."}};if(Pe(r,a)){this.logger.info("Refreshing session..."),this.refreshing=!0;const s=await this.authService.refreshSession(t.refreshToken);if(this.refreshing=!1,!s.ok)return this.logger.error(`Failed to refresh session: ${s.error.message}`),s.error.name==="InvalidTokenError"||s.error.name==="AccountBlacklistedError"?(window.localStorage.removeItem(this.storageKey),{ok:!1,error:s.error}):(this.logger.warn("Old session returned."),{ok:!0,data:t});this.logger.success("Session refreshed!"),r=new Date,t={...t,...s.data,accessTokenExpiresAt:j(r,8).getTime(),refreshTokenExpiresAt:J(z(r,30),2).getTime()},window.localStorage.setItem(this.storageKey,JSON.stringify(t))}return{ok:!0,data:t}}catch{return{ok:!1,error:{name:"UnknownError",message:"Something went wrong."}}}}async destroy(){var t;if(this.isServer){this.logger.warn("'localStorage' is not available on the server.");return}const e=await this.get();(t=e.data)!=null&&t.accessToken&&await this.authService.destroySession(e.data.accessToken),window.localStorage.removeItem(this.storageKey)}async verify(){var r,a,m;if(this.isServer)return this.logger.warn("'localStorage' is not available on the server."),!0;const e=await this.get();if(((r=e.error)==null?void 0:r.name)==="InvalidTokenError"||((a=e.error)==null?void 0:a.name)==="SessionExpiredError"||((m=e.error)==null?void 0:m.name)==="AccountBlacklistedError")return!1;if(!e.data)return!0;const t=await this.authService.verifySession(e.data.accessToken);return t||window.localStorage.removeItem(this.storageKey),t}get isServer(){return typeof window>"u"}}function S(o){const e={};for(const t in o){const r=o[t];if(r!==null&&r!==void 0){if(Oe(r)){e[t]=S(r);continue}if(Array.isArray(r)){e[t]=r.map(a=>Oe(a)?S(a):a);continue}e[t]=r}}return e}function n(o,e){if(typeof o=="number"&&!Number.isNaN(o))return o;if(typeof o=="string"){const t=Number.parseFloat(o);if(!Number.isNaN(t))return t}return e}class Rr{get transform(){return{site:this.site.bind(this),platform:this.platform.bind(this),account:this.account.bind(this),wallet:this.wallet.bind(this),verificationDetails:this.verificationDetails.bind(this),profileCompletion:this.profileCompletion.bind(this),announcement:this.announcement.bind(this),withdrawalRecord:this.withdrawalRecord.bind(this),deposit:this.deposit.bind(this),depositRecord:this.depositRecord.bind(this),betRecord:this.betRecord.bind(this),latestBetRecord:this.latestBetRecord.bind(this),transactionRecord:this.transactionRecord.bind(this),game:this.game.bind(this),gameSession:this.gameSession.bind(this),promo:this.promo.bind(this),cashback:this.cashback.bind(this),bonus:this.bonus.bind(this),cashbackBonus:this.cashbackBonus.bind(this),file:this.file.bind(this),pointsWallet:this.pointsWallet.bind(this),pointsWalletTransaction:this.pointsWalletTransaction.bind(this),activityRecord:this.activityRecord.bind(this),referral:this.referral.bind(this),referralCommission:this.referralCommission.bind(this),platform__next:this.platform__next.bind(this),pointsClubSettings:this.pointsClubSettings.bind(this),paymentSettings:this.paymentSettings.bind(this),message:this.message.bind(this),instapayBank:this.instapayBank.bind(this),promoByCode:this.promoByCode.bind(this)}}site(e){const t={id:e.id,name:e.name,logo:e.logo??void 0,fields:e.config.fields};return S(t)}platform(e){var t,r,a,m,s,u,c,p,y,f,R,D,M,v,N,I,g,G,P,k,O,B,W,x,_,U,q,$,L,F,V,H,Y,Q,C,X,Z,ee,te,re,ae,ne,oe,ie,se,me,ue,ce,de,le,pe,fe,we,ye,he,ge,be,Ee,Ae,Se,Ce,ke,_e,Te,Re,De,He;return{timezone:e.timezone,currency:e.currency,paymentSettings:{minimumFirstDepositAmount:n(e.minimumFirstDepositAmount),restrictWithdrawalsToVerifiedMembers:e.restrictWithdrawalsToVerifiedMembers,depositGateway:{bank:{androidEnabled:((t=e.bankDepositGatewaySettings)==null?void 0:t.androidEnabled)??!1,iosEnabled:((r=e.bankDepositGatewaySettings)==null?void 0:r.iosEnabled)??!1,webEnabled:((a=e.bankDepositGatewaySettings)==null?void 0:a.webEnabled)??!1,mobileWebEnabled:((m=e.bankDepositGatewaySettings)==null?void 0:m.mobileWebEnabled)??!1,minimumAmount:n((s=e.bankDepositGatewaySettings)==null?void 0:s.minimumAmount),maximumAmount:n((u=e.bankDepositGatewaySettings)==null?void 0:u.maximumAmount)},gcash:{androidEnabled:((c=e.gcashDepositGatewaySettings)==null?void 0:c.androidEnabled)??!1,iosEnabled:((p=e.gcashDepositGatewaySettings)==null?void 0:p.iosEnabled)??!1,webEnabled:((y=e.gcashDepositGatewaySettings)==null?void 0:y.webEnabled)??!1,mobileWebEnabled:((f=e.gcashDepositGatewaySettings)==null?void 0:f.mobileWebEnabled)??!1,minimumAmount:n((R=e.gcashDepositGatewaySettings)==null?void 0:R.minimumAmount),maximumAmount:n((D=e.gcashDepositGatewaySettings)==null?void 0:D.maximumAmount)},maya:{androidEnabled:((M=e.mayaDepositGatewaySettings)==null?void 0:M.androidEnabled)??!1,iosEnabled:((v=e.mayaDepositGatewaySettings)==null?void 0:v.iosEnabled)??!1,webEnabled:((N=e.mayaDepositGatewaySettings)==null?void 0:N.webEnabled)??!1,mobileWebEnabled:((I=e.mayaDepositGatewaySettings)==null?void 0:I.mobileWebEnabled)??!1,minimumAmount:n((g=e.mayaDepositGatewaySettings)==null?void 0:g.minimumAmount),maximumAmount:n((G=e.mayaDepositGatewaySettings)==null?void 0:G.maximumAmount)},mayaApp:{androidEnabled:((P=e.mayaAppDepositGatewaySettings)==null?void 0:P.androidEnabled)??!1,iosEnabled:((k=e.mayaAppDepositGatewaySettings)==null?void 0:k.iosEnabled)??!1,webEnabled:((O=e.mayaAppDepositGatewaySettings)==null?void 0:O.webEnabled)??!1,mobileWebEnabled:((B=e.mayaAppDepositGatewaySettings)==null?void 0:B.mobileWebEnabled)??!1,minimumAmount:n((W=e.mayaAppDepositGatewaySettings)==null?void 0:W.minimumAmount),maximumAmount:n((x=e.mayaAppDepositGatewaySettings)==null?void 0:x.maximumAmount)},onlineBank:{androidEnabled:((_=e.onlineBankDepositGatewaySettings)==null?void 0:_.androidEnabled)??!1,iosEnabled:((U=e.onlineBankDepositGatewaySettings)==null?void 0:U.iosEnabled)??!1,webEnabled:((q=e.onlineBankDepositGatewaySettings)==null?void 0:q.webEnabled)??!1,mobileWebEnabled:(($=e.onlineBankDepositGatewaySettings)==null?void 0:$.mobileWebEnabled)??!1,minimumAmount:n((L=e.onlineBankDepositGatewaySettings)==null?void 0:L.minimumAmount),maximumAmount:n((F=e.onlineBankDepositGatewaySettings)==null?void 0:F.maximumAmount)},qrph:{androidEnabled:((V=e.qrphDepositGatewaySettings)==null?void 0:V.androidEnabled)??!1,iosEnabled:((H=e.qrphDepositGatewaySettings)==null?void 0:H.iosEnabled)??!1,webEnabled:((Y=e.qrphDepositGatewaySettings)==null?void 0:Y.webEnabled)??!1,mobileWebEnabled:((Q=e.qrphDepositGatewaySettings)==null?void 0:Q.mobileWebEnabled)??!1,minimumAmount:n((C=e.qrphDepositGatewaySettings)==null?void 0:C.minimumAmount),maximumAmount:n((X=e.qrphDepositGatewaySettings)==null?void 0:X.maximumAmount)}},withdrawalGateway:{bank:{androidEnabled:((Z=e.bankWithdrawalGatewaySettings)==null?void 0:Z.androidEnabled)??!1,iosEnabled:((ee=e.bankWithdrawalGatewaySettings)==null?void 0:ee.iosEnabled)??!1,webEnabled:((te=e.bankWithdrawalGatewaySettings)==null?void 0:te.webEnabled)??!1,mobileWebEnabled:((re=e.bankWithdrawalGatewaySettings)==null?void 0:re.mobileWebEnabled)??!1,minimumAmount:n((ae=e.bankWithdrawalGatewaySettings)==null?void 0:ae.minimumAmount),maximumAmount:n((ne=e.bankWithdrawalGatewaySettings)==null?void 0:ne.maximumAmount)},gcash:{androidEnabled:((oe=e.gcashWithdrawalGatewaySettings)==null?void 0:oe.androidEnabled)??!1,iosEnabled:((ie=e.gcashWithdrawalGatewaySettings)==null?void 0:ie.iosEnabled)??!1,webEnabled:((se=e.gcashWithdrawalGatewaySettings)==null?void 0:se.webEnabled)??!1,mobileWebEnabled:((me=e.gcashWithdrawalGatewaySettings)==null?void 0:me.mobileWebEnabled)??!1,minimumAmount:n((ue=e.gcashWithdrawalGatewaySettings)==null?void 0:ue.minimumAmount),maximumAmount:n((ce=e.gcashWithdrawalGatewaySettings)==null?void 0:ce.maximumAmount,1e6)},maya:{androidEnabled:((de=e.mayaWithdrawalGatewaySettings)==null?void 0:de.androidEnabled)??!1,iosEnabled:((le=e.mayaWithdrawalGatewaySettings)==null?void 0:le.iosEnabled)??!1,webEnabled:((pe=e.mayaWithdrawalGatewaySettings)==null?void 0:pe.webEnabled)??!1,mobileWebEnabled:((fe=e.mayaWithdrawalGatewaySettings)==null?void 0:fe.mobileWebEnabled)??!1,minimumAmount:n((we=e.mayaWithdrawalGatewaySettings)==null?void 0:we.minimumAmount),maximumAmount:n((ye=e.mayaWithdrawalGatewaySettings)==null?void 0:ye.maximumAmount)},mayaApp:{androidEnabled:((he=e.mayaAppWithdrawalGatewaySettings)==null?void 0:he.androidEnabled)??!1,iosEnabled:((ge=e.mayaAppWithdrawalGatewaySettings)==null?void 0:ge.iosEnabled)??!1,webEnabled:((be=e.mayaAppWithdrawalGatewaySettings)==null?void 0:be.webEnabled)??!1,mobileWebEnabled:((Ee=e.mayaAppWithdrawalGatewaySettings)==null?void 0:Ee.mobileWebEnabled)??!1,minimumAmount:n((Ae=e.mayaAppWithdrawalGatewaySettings)==null?void 0:Ae.minimumAmount),maximumAmount:n((Se=e.mayaAppWithdrawalGatewaySettings)==null?void 0:Se.maximumAmount,1e6)},instapay:{androidEnabled:((Ce=e.instapayWithdrawalGatewaySettings)==null?void 0:Ce.androidEnabled)??!1,iosEnabled:((ke=e.instapayWithdrawalGatewaySettings)==null?void 0:ke.iosEnabled)??!1,webEnabled:((_e=e.instapayWithdrawalGatewaySettings)==null?void 0:_e.webEnabled)??!1,mobileWebEnabled:((Te=e.instapayWithdrawalGatewaySettings)==null?void 0:Te.mobileWebEnabled)??!1,minimumAmount:n((Re=e.instapayWithdrawalGatewaySettings)==null?void 0:Re.minimumAmount),maximumAmount:n((De=e.instapayWithdrawalGatewaySettings)==null?void 0:De.maximumAmount,1e6)}}},pointsClubSettings:{multiplier:n((He=e.pointsClubSettings)==null?void 0:He.multiplier,0)}}}platform__next(e){return{currency:e.currency,timezone:e.timezone,locale:kr(e.currency)}}pointsClubSettings(e){return{multiplier:n(e.multiplier,0)}}paymentSettings(e){var t,r,a,m,s,u,c,p,y,f,R,D,M,v,N,I,g,G,P,k,O,B,W,x,_,U,q,$,L,F,V,H,Y,Q,C,X,Z,ee,te,re,ae,ne,oe,ie,se,me,ue,ce,de,le,pe,fe,we,ye,he,ge,be,Ee,Ae,Se,Ce,ke,_e,Te,Re,De;return{minimumFirstDepositAmount:n(e.minimumFirstDepositAmount),restrictWithdrawalsToVerifiedMembers:e.restrictWithdrawalsToVerifiedMembers,depositGateway:{bank:{androidEnabled:((t=e.bankDepositGatewaySettings)==null?void 0:t.androidEnabled)??!1,iosEnabled:((r=e.bankDepositGatewaySettings)==null?void 0:r.iosEnabled)??!1,webEnabled:((a=e.bankDepositGatewaySettings)==null?void 0:a.webEnabled)??!1,mobileWebEnabled:((m=e.bankDepositGatewaySettings)==null?void 0:m.mobileWebEnabled)??!1,minimumAmount:n((s=e.bankDepositGatewaySettings)==null?void 0:s.minimumAmount),maximumAmount:n((u=e.bankDepositGatewaySettings)==null?void 0:u.maximumAmount)},gcash:{androidEnabled:((c=e.gcashDepositGatewaySettings)==null?void 0:c.androidEnabled)??!1,iosEnabled:((p=e.gcashDepositGatewaySettings)==null?void 0:p.iosEnabled)??!1,webEnabled:((y=e.gcashDepositGatewaySettings)==null?void 0:y.webEnabled)??!1,mobileWebEnabled:((f=e.gcashDepositGatewaySettings)==null?void 0:f.mobileWebEnabled)??!1,minimumAmount:n((R=e.gcashDepositGatewaySettings)==null?void 0:R.minimumAmount),maximumAmount:n((D=e.gcashDepositGatewaySettings)==null?void 0:D.maximumAmount)},maya:{androidEnabled:((M=e.mayaDepositGatewaySettings)==null?void 0:M.androidEnabled)??!1,iosEnabled:((v=e.mayaDepositGatewaySettings)==null?void 0:v.iosEnabled)??!1,webEnabled:((N=e.mayaDepositGatewaySettings)==null?void 0:N.webEnabled)??!1,mobileWebEnabled:((I=e.mayaDepositGatewaySettings)==null?void 0:I.mobileWebEnabled)??!1,minimumAmount:n((g=e.mayaDepositGatewaySettings)==null?void 0:g.minimumAmount),maximumAmount:n((G=e.mayaDepositGatewaySettings)==null?void 0:G.maximumAmount)},mayaApp:{androidEnabled:((P=e.mayaAppDepositGatewaySettings)==null?void 0:P.androidEnabled)??!1,iosEnabled:((k=e.mayaAppDepositGatewaySettings)==null?void 0:k.iosEnabled)??!1,webEnabled:((O=e.mayaAppDepositGatewaySettings)==null?void 0:O.webEnabled)??!1,mobileWebEnabled:((B=e.mayaAppDepositGatewaySettings)==null?void 0:B.mobileWebEnabled)??!1,minimumAmount:n((W=e.mayaAppDepositGatewaySettings)==null?void 0:W.minimumAmount),maximumAmount:n((x=e.mayaAppDepositGatewaySettings)==null?void 0:x.maximumAmount)},onlineBank:{androidEnabled:((_=e.onlineBankDepositGatewaySettings)==null?void 0:_.androidEnabled)??!1,iosEnabled:((U=e.onlineBankDepositGatewaySettings)==null?void 0:U.iosEnabled)??!1,webEnabled:((q=e.onlineBankDepositGatewaySettings)==null?void 0:q.webEnabled)??!1,mobileWebEnabled:(($=e.onlineBankDepositGatewaySettings)==null?void 0:$.mobileWebEnabled)??!1,minimumAmount:n((L=e.onlineBankDepositGatewaySettings)==null?void 0:L.minimumAmount),maximumAmount:n((F=e.onlineBankDepositGatewaySettings)==null?void 0:F.maximumAmount)},qrph:{androidEnabled:((V=e.qrphDepositGatewaySettings)==null?void 0:V.androidEnabled)??!1,iosEnabled:((H=e.qrphDepositGatewaySettings)==null?void 0:H.iosEnabled)??!1,webEnabled:((Y=e.qrphDepositGatewaySettings)==null?void 0:Y.webEnabled)??!1,mobileWebEnabled:((Q=e.qrphDepositGatewaySettings)==null?void 0:Q.mobileWebEnabled)??!1,minimumAmount:n((C=e.qrphDepositGatewaySettings)==null?void 0:C.minimumAmount),maximumAmount:n((X=e.qrphDepositGatewaySettings)==null?void 0:X.maximumAmount)}},withdrawalGateway:{bank:{androidEnabled:((Z=e.bankWithdrawalGatewaySettings)==null?void 0:Z.androidEnabled)??!1,iosEnabled:((ee=e.bankWithdrawalGatewaySettings)==null?void 0:ee.iosEnabled)??!1,webEnabled:((te=e.bankWithdrawalGatewaySettings)==null?void 0:te.webEnabled)??!1,mobileWebEnabled:((re=e.bankWithdrawalGatewaySettings)==null?void 0:re.mobileWebEnabled)??!1,minimumAmount:n((ae=e.bankWithdrawalGatewaySettings)==null?void 0:ae.minimumAmount),maximumAmount:n((ne=e.bankWithdrawalGatewaySettings)==null?void 0:ne.maximumAmount)},gcash:{androidEnabled:((oe=e.gcashWithdrawalGatewaySettings)==null?void 0:oe.androidEnabled)??!1,iosEnabled:((ie=e.gcashWithdrawalGatewaySettings)==null?void 0:ie.iosEnabled)??!1,webEnabled:((se=e.gcashWithdrawalGatewaySettings)==null?void 0:se.webEnabled)??!1,mobileWebEnabled:((me=e.gcashWithdrawalGatewaySettings)==null?void 0:me.mobileWebEnabled)??!1,minimumAmount:n((ue=e.gcashWithdrawalGatewaySettings)==null?void 0:ue.minimumAmount),maximumAmount:n((ce=e.gcashWithdrawalGatewaySettings)==null?void 0:ce.maximumAmount,1e6)},maya:{androidEnabled:((de=e.mayaWithdrawalGatewaySettings)==null?void 0:de.androidEnabled)??!1,iosEnabled:((le=e.mayaWithdrawalGatewaySettings)==null?void 0:le.iosEnabled)??!1,webEnabled:((pe=e.mayaWithdrawalGatewaySettings)==null?void 0:pe.webEnabled)??!1,mobileWebEnabled:((fe=e.mayaWithdrawalGatewaySettings)==null?void 0:fe.mobileWebEnabled)??!1,minimumAmount:n((we=e.mayaWithdrawalGatewaySettings)==null?void 0:we.minimumAmount),maximumAmount:n((ye=e.mayaWithdrawalGatewaySettings)==null?void 0:ye.maximumAmount)},mayaApp:{androidEnabled:((he=e.mayaAppWithdrawalGatewaySettings)==null?void 0:he.androidEnabled)??!1,iosEnabled:((ge=e.mayaAppWithdrawalGatewaySettings)==null?void 0:ge.iosEnabled)??!1,webEnabled:((be=e.mayaAppWithdrawalGatewaySettings)==null?void 0:be.webEnabled)??!1,mobileWebEnabled:((Ee=e.mayaAppWithdrawalGatewaySettings)==null?void 0:Ee.mobileWebEnabled)??!1,minimumAmount:n((Ae=e.mayaAppWithdrawalGatewaySettings)==null?void 0:Ae.minimumAmount),maximumAmount:n((Se=e.mayaAppWithdrawalGatewaySettings)==null?void 0:Se.maximumAmount,1e6)},instapay:{androidEnabled:((Ce=e.instapayWithdrawalGatewaySettings)==null?void 0:Ce.androidEnabled)??!1,iosEnabled:((ke=e.instapayWithdrawalGatewaySettings)==null?void 0:ke.iosEnabled)??!1,webEnabled:((_e=e.instapayWithdrawalGatewaySettings)==null?void 0:_e.webEnabled)??!1,mobileWebEnabled:((Te=e.instapayWithdrawalGatewaySettings)==null?void 0:Te.mobileWebEnabled)??!1,minimumAmount:n((Re=e.instapayWithdrawalGatewaySettings)==null?void 0:Re.minimumAmount),maximumAmount:n((De=e.instapayWithdrawalGatewaySettings)==null?void 0:De.maximumAmount,1e6)}}}}account(e){const t={id:e.id,name:e.name,status:e.status,verified:e.verified,nickName:e.nickName??void 0,realName:e.realName??void 0,dateOfBirth:e.birthDay?new Date(e.birthDay):void 0,emailAddress:e.emailAddress??void 0,mobileNumber:e.mobileNumber??void 0,mobileNumberVerified:e.mobileNumberVerified??!1,mobileNumberVerificationRequired:e.mobileNumberVerificationRequired??!1,validId:e.validId||void 0,verificationStatus:e.verificationStatus,transactionPassword:e.transactionPassword,secretAnswerSubmitted:e.secretAnswerSubmitted??!1,dateTimeCreated:new Date(e.dateTimeCreated),dateTimeLastUpdated:new Date(e.dateTimeLastUpdated)};return S(t)}wallet(e){return{id:e.id,balance:n(e.balance,0),currency:e.currency,dateTimeCreated:new Date(e.dateTimeCreated),dateTimeLastUpdated:new Date(e.dateTimeLastUpdated)}}verificationDetails(e){return{id:e.id,status:e.status,address:e.address,permanentAddress:e.permanentAddress,nationality:e.nationality,natureOfWork:e.natureOfWork,placeOfBirth:e.placeOfBirth,sourceOfIncome:e.sourceOfIncome,selfieImage:this.file(e.selfieImage),idFrontImage:this.file(e.idFrontImage)}}profileCompletion(e){return{accountPassword:e.accountPassword??!1,accountVerification:e.accountVerification??!1,mobileNumberVerification:e.mobileNumberVerification??!1,personalInformation:e.personalInformation??!1,transactionPassword:e.transactionPassword??!1,completionPercentage:n(e.completionPercentage,0)}}announcement(e){return{id:e.id,type:e.type,title:e.title,status:e.status,message:e.message,activationEndDateTime:new Date(e.activationEndDateTime),activationStartDateTime:new Date(e.activationStartDateTime),dateTimeCreated:new Date(e.dateTimeCreated),dateTimeLastUpdated:new Date(e.dateTimeLastUpdated)}}withdrawalRecord(e){const t={id:e.id,type:e.type,bank:e.bank,status:e.status,amount:n(e.amount,0),netAmount:n(e.netAmount,0),fee:n(e.fee,0),reference:e.reference??void 0,error:e.error??void 0,withdrawalNumber:e.withdrawalNumber,recipientMobileNumber:e.recipientMobileNumber??void 0,dateTimeConfirmed:e.dateTimeConfirmed?new Date(e.dateTimeConfirmed):void 0,dateTimeCreated:new Date(e.dateTimeCreated),dateTimeLastUpdated:new Date(e.dateTimeLastUpdated)};return S(t)}deposit(e){const t={id:e.id,type:e.type,status:e.status,vca:e.vca??void 0,qrCode:e.qrCode??void 0,checkoutUrl:e.checkoutUrl??void 0};return S(t)}depositRecord(e){const t={id:e.id,type:e.type,status:e.status,amount:n(e.amount,0),fee:n(e.fee,0),netAmount:n(e.netAmount,0),reference:e.reference??void 0,depositNumber:e.depositNumber,dateTimeCreated:new Date(e.dateTimeCreated),dateTimeLastUpdated:new Date(e.dateTimeLastUpdated),error:e.error??void 0};return S(t)}betRecord(e){var r;const t={id:e.id,bet:n(e.bet,0),payout:n(e.payout,0),status:e.status,jackpotContribution:n(e.jackpotContribution,0),jackpotPayout:n(e.jackpotPayout,0),winloss:n(e.winloss),validBet:n(e.validBet,0),vendorRoundId:e.vendorRoundId??void 0,game:e.game?this.game(e.game):void 0,serialCode:e.serialCode,dateTimeSettled:e.dateTimeSettled?new Date(e.dateTimeSettled):void 0,dateTimeCreated:new Date(e.dateTimeCreated),dateTimeLastUpdated:new Date(e.dateTimeLastUpdated),betContent:e.betContent??void 0,contestName:e.contestName??void 0,externalCategory:e.externalCategory??void 0,metadata:{odds:((r=e.metadata)==null?void 0:r.odds)??void 0}};return S(t)}latestBetRecord(e){return{id:e.id,member:e.member,game:e.game?this.game(e.game):void 0,bet:n(e.bet,0),payout:n(e.payout,0),validBet:n(e.validBet,0),dateTimeSettled:new Date(e.dateTimeSettled),dateTimeCreated:new Date(e.dateTimeCreated)}}transactionRecord(e){const t={id:e.id,type:e.type,amount:n(e.amount,0),content:e.content??void 0,currentBalance:n(e.currentBalance,0),referenceNumber:e.referenceNumber,dateTimeCreated:new Date(e.dateTimeCreated)};return S(t)}game(e){return{id:e.id,type:e.type,tags:e.tags??[],name:e.name,images:[e.customImage,e.image].filter(Boolean),provider:e.provider,reference:e.reference}}gameSession(e){const t={id:e.id,status:e.status,launchUrl:e.launchUrl??void 0,dateTimeCreated:new Date(e.dateTimeCreated),dateTimeLastUpdated:new Date(e.dateTimeLastUpdated)};return S(t)}promo(e){return{id:e.id,type:e.type,name:e.name,status:e.status,description:e.description,banner:e.banner?this.file(e.banner):null,maximumBonusAmount:n(e.maximumBonusAmount),minimumBonusAmount:n(e.minimumBonusAmount),maximumDepositAmount:n(e.maximumDepositAmount),minimumDepositAmount:n(e.minimumDepositAmount),activationEndDateTime:new Date(e.activationEndDateTime),activationStartDateTime:new Date(e.activationStartDateTime),dateTimeCreated:new Date(e.dateTimeCreated),dateTimeLastUpdated:new Date(e.dateTimeLastUpdated)}}cashback(e){return{id:e.id,name:e.name,description:e.description,status:e.status,minimumCashback:n(e.minimumCashback,0),maximumMonthlyCashback:n(e.maximumMonthlyCashback),banner:e.banner?this.file(e.banner):null,activationEndDateTime:new Date(e.activationEndDateTime),activationStartDateTime:new Date(e.activationStartDateTime),dateTimeCreated:new Date(e.dateTimeCreated),dateTimeLastUpdated:new Date(e.dateTimeLastUpdated),turnoverContributionPercentagePerGameProvider:Object.entries(e.turnoverContributionPercentagePerGameProvider).reduce((r,[a,m])=>(r[a]=n(m,0),r),{})}}bonus(e){const t={id:e.id,promo:this.promo(e.promo),deposit:e.deposit?{type:e.deposit.type,status:e.deposit.status,fee:n(e.deposit.fee,0),amount:n(e.deposit.amount,0),netAmount:n(e.deposit.netAmount,0),reference:e.deposit.reference??void 0,dateTimeCreated:new Date(e.deposit.dateTimeCreated),dateTimeLastUpdated:new Date(e.deposit.dateTimeLastUpdated)}:void 0,balance:n(e.balance,0),amount:n(e.amount,0),expiration:new Date(e.expiration),turnoverRequirement:n(e.turnoverRequirement,0),currentTurnoverRequirementContribution:n(e.currentTurnoverRequirementContribution,0),currentTurnoverRequirementContributionPercentage:n(e.currentTurnoverRequirementContributionPercentage,0),dateTimeCreated:new Date(e.dateTimeCreated),dateTimeLastUpdated:new Date(e.dateTimeLastUpdated)};return S(t)}cashbackBonus(e){return{id:e.id,total:n(e.total,0),balance:n(e.balance,0),cashback:this.cashback(e.cashback),dateTimeCreated:new Date(e.dateTimeCreated),dateTimeLastUpdated:new Date(e.dateTimeLastUpdated)}}file(e){const t={id:e.id,url:e.url??void 0,status:e.status,dateTimeCreated:new Date(e.dateTimeCreated)};return S(t)}pointsWallet(e){return{id:e.id,points:n(e.points,0),account:e.account,dateTimeCreated:new Date(e.dateTimeCreated)}}pointsWalletTransaction(e){return{id:e.id,type:e.type,amount:n(e.amount,0),balance:n(e.balance,0),dateTimeCreated:new Date(e.dateTimeCreated)}}activityRecord(e){const t={id:e.id,type:e.type,amount:e.amount?n(e.amount,0):void 0,domain:e.domain??void 0,details:e.details,dateTimeCreated:new Date(e.dateTimeCreated)};return S(t)}referral(e){return{id:e.id,level:e.level,upline:e.upline,downline:e.downline,turnover:n(e.turnover,0),commission:n(e.commission,0),dateTimeCreated:new Date(e.dateTimeCreated)}}referralCommission(e){return{id:e.id,commission:n(e.commission,0),level1Commission:n(e.level1Commission,0),level2Commission:n(e.level2Commission,0),level3Commission:n(e.level3Commission,0),referralsCount:e.referralsCount,level1ReferralsCount:e.level1ReferralsCount,level2ReferralsCount:e.level2ReferralsCount,level3ReferralsCount:e.level3ReferralsCount,referralCode:e.referralCode,dateTimeCreated:new Date(e.dateTimeCreated),dateTimeLastUpdated:new Date(e.dateTimeLastUpdated)}}message(e){return{id:e.id,icon:e.icon,logo:e.logo,image:e.image,title:e.title,popup:e.popup,content:e.content,actions:e.actions,markedAsRead:e.markedAsRead,dateTimeCreated:new Date(e.dateTimeCreated)}}instapayBank(e){return e}promoByCode(e){return{activeBonusesCount:e.activeBonusesCount,bonusesCount:e.bonusesCount,cancelledBonusesCount:e.cancelledBonusesCount,clearedBonusesCount:e.clearedBonusesCount,closedBonusesCount:e.closedBonusesCount,closedBonusesCountPercentage:n(e.closedBonusesCountPercentage,0),code:e.code,daysToClear:e.daysToClear,enabledGameProviders:e.enabledGameProviders,id:e.id,expiredBonusesCount:e.expiredBonusesCount,maximumBonusesCountLimit:e.maximumBonusesCountLimit,name:e.name,status:e.status,totalBet:n(e.totalBet,0),totalBonus:n(e.totalBonus,0),totalBonusBalance:n(e.totalBonusBalance,0),totalBonusCashedOut:n(e.totalBonusCashedOut,0),totalDeposit:n(e.totalDeposit,0),turnoverRequirementMultiplier:n(e.turnoverRequirementMultiplier,0),type:e.type,zeroedOutBonusesCount:e.zeroedOutBonusesCount,zeroOutThreshold:n(e.zeroOutThreshold,0),bonusAmount:n(e.bonusAmount,0),description:e.description,turnoverRequirementType:e.turnoverRequirementType,activationEndDateTime:e.activationEndDateTime?new Date(e.activationEndDateTime):void 0,activationStartDateTime:e.activationStartDateTime?new Date(e.activationStartDateTime):void 0,dateTimeClosed:e.dateTimeClosed?new Date(e.dateTimeClosed):void 0,dateTimeLastUpdated:new Date(e.dateTimeLastUpdated),dateTimeCreated:new Date(e.dateTimeCreated),turnoverRequirementContributionPercentagePerGameProvider:Object.entries(e.turnoverRequirementContributionPercentagePerGameProvider).reduce((t,[r,a])=>(t[r]=n(a,0),t),{}),minimumTicketOddFactorPerSportsGameProvider:Object.entries(e.minimumTicketOddFactorPerSportsGameProvider).reduce((t,[r,a])=>(t[r]=n(a,0),t),{}),banner:e.banner}}}class Dr{constructor(e){d(this,"cmsPortalService");d(this,"authService");d(this,"gameService");d(this,"fileService");d(this,"walletService");d(this,"accountService");d(this,"reportService");d(this,"portalService");d(this,"triggerService");d(this,"sessionManager");d(this,"transformer");d(this,"logger");d(this,"cache");const{site:t,sitePlatform:r,platform:a,environment:m,logs:s}=e,u=m==="production";this.transformer=new Rr,this.logger=new Le({enabled:s??!1});const c=u?"https://auth.opexa.io":"https://auth.development.opexa.io",p=u?"https://wallet.opexa.io/graphql":"https://wallet.development.opexa.io/graphql",y=u?"https://report.opexa.io/graphql":"https://report.development.opexa.io/graphql",f=u?"https://account.opexa.io/graphql":"https://account.development.opexa.io/graphql",R=u?"https://portal.opexa.io/graphql":"https://portal.development.opexa.io/graphql",D=u?"https://file.opexa.io/graphql":"https://file.development.opexa.io/graphql",M=u?"https://game.opexa.io/graphql":"https://game.development.opexa.io/graphql",v=u?"https://trigger.opexa.io/graphql":"https://trigger.development.opexa.io/graphql",N="https://portal-api.opexacms.io/v1",I=new lr({url:N,site:t,platform:r}),g={middlewares:[this.authMiddleware],fetchOptions:{headers:{Role:"MEMBER","Platform-Code":a}}},G=new fr(new K(M,g)),P=new pr(new K(D,g)),k=new gr(new K(p,g)),O=new cr(new K(f,g)),B=new yr(new K(y,g)),W=new wr(new K(R,g)),x=new hr(new K(v,g)),_=new dr({url:c,platform:a}),U=new Tr({logs:s,authService:_,walletService:k});this.authService=_,this.gameService=G,this.fileService=P,this.walletService=k,this.accountService=O,this.reportService=B,this.portalService=W,this.triggerService=x,this.sessionManager=U,this.cmsPortalService=I,this.cache=new br}get authMiddleware(){return async e=>{this.logger.info("Checking for session");const t=await this.sessionManager.get();return t.data?(e.headers.append("Authorization",`Bearer ${t.data.accessToken}`),this.logger.info("Session found"),this.logger.success("Added 'Authorization' header")):this.logger.info("No session found"),e}}get locale(){return new Promise(e=>{const t="locale",r=this.cache.get(t);if(r)return e(r);this.platform__next().then(a=>{a.ok?(this.cache.set(t,a.data.locale),e(a.data.locale)):(this.logger.warn("Failed to fetch currency. Using 'PH' as fallback"),e("en-PH"))})})}async signIn(e){switch(e.type){case"NAME_AND_PASSWORD":{const t=await this.sessionManager.create({...e,password:await A(e.password)});return t.ok?t.data?{ok:!0,data:{"2FAEnabled":!0,authenticator:t.data.authenticator}}:{ok:!0,data:{"2FAEnabled":!1}}:t}case"TOKEN":{const t=await this.sessionManager.create({type:"TOKEN",token:e.token});return t.ok?{ok:!0}:t}case"MOBILE_NUMBER":{const t=await this.sessionManager.create({type:"MOBILE_NUMBER",mobileNumber:T(e.mobileNumber,await this.locale),verificationCode:e.verificationCode,reCAPTCHAResponse:e.reCAPTCHAResponse});return t.ok?{ok:!0}:t}default:{const t=await this.sessionManager.create(e);return t.ok?{ok:!0}:t}}}async authenticate(e){switch(e.type){case"SECURITY_QUESTION":return await this.sessionManager.createFromAuthenticator({type:"SECURITY_QUESTION",token:e.token,secretAnswer:await A(e.secretAnswer)});default:return{ok:!1,error:{name:"HttpBadRequest",message:"Invalid input 'type'"}}}}async signOut(){await this.sessionManager.destroy()}watchSession(e){const t=Er(e.interval??3e4,3e4,6e4);let r=null;const a=()=>setTimeout(async()=>{await this.sessionManager.verify()||await e.onInvalid(),r=a()},t);return r=a(),function(){r&&clearTimeout(r)}}async session(){const e=await this.sessionManager.get();return e.ok?{ok:!0,data:e.data?{id:e.data.session.id,dateTimeCreated:new Date(e.data.session.dateTimeCreated)}:null}:e}async validateMayaSession(){return await this.walletService.validateMayaSession()}async site(){const e=await this.cmsPortalService.self();return e.ok?{ok:!0,data:this.transformer.transform.site(e.data)}:e}async platform(){const e=await this.accountService.platform();return e.ok?{ok:!0,data:this.transformer.transform.platform(e.data)}:e}async platform__next(){const e=await this.portalService.platform();return e.ok?{ok:!0,data:this.transformer.transform.platform__next(e.data)}:e}async paymentSettings(){const e=await this.accountService.paymentSettings();return e.ok?{ok:!0,data:this.transformer.transform.paymentSettings(e.data)}:e}async account(){const e=await this.accountService.memberAccount();return e.ok?{ok:!0,data:this.transformer.transform.account(e.data)}:e}async createAccount(e){const t=e.id??w.ObjectId.generate(E.Account).toString(),r=await this.accountService.registerMemberAccount({input:{id:t,btag:e.btag,name:e.name,domain:e.domain,birthDay:typeof e.dateOfBirth=="string"?e.dateOfBirth:this.formatYmd(e.dateOfBirth),password:await A(e.password),mobileNumber:T(e.mobileNumber,await this.locale)},referralCode:e.referralCode,verificationCode:e.verificationCode,reCAPTCHAResponse:e.reCAPTCHAResponse});return r.ok?{ok:!0,data:{id:t}}:r}async createAccount__next(e){const t=e.id??w.ObjectId.generate(E.Account).toString();if(e.type==="MOBILE_NUMBER"){const a=await this.accountService.registerMemberAccountViaMobile({input:{id:t,btag:e.btag,domain:e.domain,mobileNumber:T(e.mobileNumber,await this.locale)},referralCode:e.referralCode,verificationCode:e.verificationCode,reCAPTCHAResponse:e.reCAPTCHAResponse});return a.ok?{ok:!0,data:{id:t}}:a}const r=await this.accountService.registerMemberAccount__next({input:{id:t,name:e.name,btag:e.btag,domain:e.domain,password:await A(e.password),mobileNumber:e.mobileNumber?T(e.mobileNumber,await this.locale):void 0},reCAPTCHAResponse:e.reCAPTCHAResponse});return r.ok?{ok:!0,data:{id:t}}:r}async registerMayaAccount(e){return await this.accountService.registerMayaMemberAccount({input:{name:e.name,password:await A(e.password),domain:e.domain}})}async updateAccount(e,t){const{password:r,dateOfBirth:a,mobileNumber:m,secretAnswer:s,transactionPassword:u,...c}=t;return await this.accountService.updateMemberAccount({input:{id:e,data:{...c,password:r?await A(r):void 0,transactionPassword:u?await A(u):void 0,mobileNumber:m?T(m,await this.locale):void 0,secretAnswer:s?await A(s):void 0,birthDay:a?typeof a=="string"?a:this.formatYmd(a):void 0}}})}async deleteAccount(e){return await this.accountService.deleteMemberAccount({input:{id:e}})}async verificationDetails(){const e=await this.accountService.memberVerification();return e.ok?{ok:!0,data:e.data?this.transformer.transform.verificationDetails(e.data):null}:e}async submitVerificationDetails(e){const t=e.id??w.ObjectId.generate(E.Verification).toString(),r=await this.accountService.createMemberVerification({input:{id:t,...e}});return r.ok?{ok:!0,data:{id:t}}:r}async updateVerificationDetails(e,t){return await this.accountService.updateMemberVerification({input:{id:e,data:{...t}}})}async resetPassword(e){return await this.accountService.resetPassword({input:{mobileNumber:T(e.mobileNumber,await this.locale),newPassword:await A(e.newPassword)},verificationCode:e.verificationCode})}async verifyMobileNumber(e){return await this.accountService.verifyMobileNumber({input:{verificationCode:e}})}async profileCompletion(){const e=await this.accountService.profileCompletion();return e.ok?{ok:!0,data:this.transformer.transform.profileCompletion(e.data)}:e}async sendVerificationCode(e){return await this.accountService.sendVerificationCode({input:{channel:"SMS",recipient:T(e,await this.locale)}})}async sendVerificationCode__next(e){if(e.type==="SMS")return this.authService.sendVerificationCode({channel:"SMS",recipient:T(e.mobileNumber,await this.locale),...e.strict&&{verificationType:"MEMBER"}});throw new Error("'Email' verification code is not yet supported")}async wallet(){const e=await this.walletService.wallet();return e.ok?{ok:!0,data:e.data?this.transformer.transform.wallet(e.data):null}:e}async announcements(e){const t=await this.accountService.announcements({...e,filter:{...e==null?void 0:e.filter,visibility:{in:["MEMBER","GLOBAL"]}}});return t.ok?{ok:!0,data:{announcements:t.data.edges.map(({cursor:r,node:a})=>({...this.transformer.transform.announcement(a),cursor:r})),totalCount:t.data.totalCount,endCursor:t.data.pageInfo.endCursor??void 0,hasNextPage:t.data.pageInfo.hasNextPage}}:t}async createWithdrawal(e){const t=e.id??w.ObjectId.generate(E.Withdrawal).toString();if(e.type==="BANK"){const r=await this.walletService.createBankWithdrawal({input:{id:t,amount:e.amount.toString(),transactionPassword:await A(e.transactionPassword)}});if(!r.ok)return r}if(e.type==="GCASH"){const r=await this.walletService.createGCashWithdrawal({input:{id:t,amount:e.amount.toString(),transactionPassword:await A(e.transactionPassword),recipientMobileNumber:T(e.recipientMobileNumber,await this.locale)}});if(!r.ok)return r}if(e.type==="MAYA"){const r=await this.walletService.createMayaWithdrawal({input:{id:t,amount:e.amount.toString(),transactionPassword:await A(e.transactionPassword),recipientMobileNumber:T(e.recipientMobileNumber,await this.locale)}});if(!r.ok)return r}if(e.type==="MAYA_APP"){const r=await this.walletService.createMayaAppWithdrawal({input:{id:t,amount:e.amount.toString(),transactionPassword:await A(e.transactionPassword)}});if(!r.ok)return r}if(e.type==="AIO_INSTAPAY"){const r=await this.walletService.createAIOInstapayWithdrawal({input:{id:t,amount:e.amount.toString(),bankCode:e.bankCode,accountNumber:e.accountNumber,transactionPassword:await A(e.transactionPassword)}});if(!r.ok)return r}return{ok:!0,data:{id:t}}}async withdrawalRecords(e){const t=await this.reportService.withdrawalRecords(e);return t.ok?{ok:!0,data:{withdrawalRecords:t.data.edges.map(({cursor:r,node:a})=>({...this.transformer.transform.withdrawalRecord(a),cursor:r})),totalCount:t.data.totalCount,endCursor:t.data.pageInfo.endCursor??void 0,hasNextPage:t.data.pageInfo.hasNextPage}}:t}async remainingDailyWithdrawalsCount(){return await this.walletService.remainingDailyWithdrawalsCount()}async instapayBankList(){const e=await this.walletService.instapayBankList();return e.ok?{ok:!0,data:e.data.map(this.transformer.transform.instapayBank)}:e}async createDeposit(e){const t=e.id??w.ObjectId.generate(E.Deposit).toString();if(e.type==="MAYA"){const r=await this.walletService.createMayaDeposit({input:{id:t,amount:e.amount.toString(),promo:e.promo}});if(!r.ok)return r}if(e.type==="MAYA_APP"){const r=await this.walletService.createMayaAppDeposit({input:{id:t,amount:e.amount.toString(),promo:e.promo}});if(!r.ok)return r}if(e.type==="GCASH"){const r=await this.walletService.createGCashDeposit({input:{id:t,amount:e.amount.toString(),promo:e.promo}});if(!r.ok)return r}if(e.type==="AIO_ONLINE_BANK"){const r=await this.walletService.createAIOOnlineBankDeposit({input:{id:t,amount:e.amount.toString(),promo:e.promo}});if(!r.ok)return r}if(e.type==="AIO_QRPH"){const r=await this.walletService.createAIOQRPHDeposit({input:{id:t,amount:e.amount.toString(),promo:e.promo}});if(!r.ok)return r}return{ok:!0,data:{id:t}}}async deposit(e){const t=await this.walletService.deposit({id:e});return t.ok?{ok:!0,data:t.data?this.transformer.transform.deposit(t.data):null}:t}async depositRecords(e){const t=await this.reportService.depositRecords(e);return t.ok?{ok:!0,data:{depositRecords:t.data.edges.map(({cursor:r,node:a})=>({...this.transformer.transform.depositRecord(a),cursor:r})),totalCount:t.data.totalCount,endCursor:t.data.pageInfo.endCursor??void 0,hasNextPage:t.data.pageInfo.hasNextPage}}:t}async depositsCount(){return await this.reportService.depositsCount()}async betRecords(e){const t=await this.reportService.betRecords({...e,...(e==null?void 0:e.filter)&&{filter:{...e.filter.status&&{status:e.filter.status},...e.filter.serialCode&&{serialCode:e.filter.serialCode},...e.filter.vendorRoundId&&{vendorRoundId:e.filter.vendorRoundId},...e.filter.gameType&&{game__type:e.filter.gameType},...e.filter.gameProvider&&{game__provider:e.filter.gameProvider},...e.filter.dateTimeCreated&&{dateTimeCreated:e.filter.dateTimeCreated}}}});if(!t.ok)return t;const r=[...new Set(t.data.edges.map(m=>m.node.game.id))];if(r.length<=0)return{ok:!0,data:{betRecords:[],totalCount:0,endCursor:void 0,hasNextPage:!1}};const a=await this.cmsPortalService.games({filter:{reference:{in:r}}});return a.ok?{ok:!0,data:{betRecords:t.data.edges.map(({cursor:m,node:s})=>{var c;const u=(c=a.data.edges.find(p=>s.game.id===p.node.reference))==null?void 0:c.node;return{...this.transformer.transform.betRecord({...s,game:u}),cursor:m}}),totalCount:t.data.totalCount,endCursor:t.data.pageInfo.endCursor??void 0,hasNextPage:t.data.pageInfo.hasNextPage}}:a}async latestBetRecords(){const e=await this.portalService.latestBetRecords();if(!e.ok)return e;const t=[...new Set(e.data.map(a=>a.game.id))];if(t.length<=0)return{ok:!0,data:[]};const r=await this.cmsPortalService.games({filter:{reference:{in:t}}});return r.ok?{ok:!0,data:e.data.map(a=>{var s;const m=(s=r.data.edges.find(u=>u.node.reference===a.game.id))==null?void 0:s.node;return this.transformer.transform.latestBetRecord({...a,game:m})})}:r}async transactionRecords(e){const t=await this.reportService.transactionRecords(e);return t.ok?{ok:!0,data:{transactionRecords:t.data.edges.map(({cursor:r,node:a})=>({...this.transformer.transform.transactionRecord(a),cursor:r})),totalCount:t.data.totalCount,endCursor:t.data.pageInfo.endCursor??void 0,hasNextPage:t.data.pageInfo.hasNextPage}}:t}async promos(){const e=await this.walletService.promos();return e.ok?{ok:!0,data:e.data.map(this.transformer.transform.promo)}:e}async availablePromos(){const e=await this.walletService.availablePromos();return e.ok?{ok:!0,data:e.data.map(this.transformer.transform.promo)}:e}async cashbacks(){const e=await this.walletService.cashbacks();return e.ok?{ok:!0,data:e.data.map(this.transformer.transform.cashback)}:e}async bonus(){const e=await this.walletService.bonus();return e.ok?{ok:!0,data:e.data?this.transformer.transform.bonus(e.data):null}:e}async cashbackBonuses(){const e=await this.walletService.cashbackBonuses();return e.ok?{ok:!0,data:e.data.map(this.transformer.transform.cashbackBonus)}:e}async claimCashbackBonus(e){return await this.walletService.claimCashbackBonus({input:{id:e}})}async claimSpotBonus(e){return await this.walletService.claimSpotBonus({code:e})}async promoByCode(e){const t=await this.reportService.promoByCode({code:e});return t.ok?{ok:!0,data:this.transformer.transform.promoByCode(t.data)}:t}async game(e){const t=await this.cmsPortalService.game(e);return t.ok?{ok:!0,data:t.data?this.transformer.transform.game(t.data):null}:t}async games(e){const t=await this.cmsPortalService.games(e);return t.ok?{ok:!0,data:{games:t.data.edges.map(({cursor:r,node:a})=>({...this.transformer.transform.game(a),cursor:r})),totalCount:t.data.totalCount,hasNextPage:t.data.pageInfo.hasNextPage,endCursor:t.data.pageInfo.endCursor??void 0}}:t}async recommendedGames(e){const t=await this.portalService.recommendedGames();if(!t.ok)return t;const r=[...new Set(t.data.map(m=>m.id))];if(r.length<=0)return{ok:!0,data:{games:[],totalCount:0,hasNextPage:!1,endCursor:void 0}};const a=await this.cmsPortalService.games({first:e==null?void 0:e.first,after:e==null?void 0:e.after,filter:{reference:{in:r}}});return a.ok?{ok:!0,data:{games:a.data.edges.map(({cursor:m,node:s})=>({...this.transformer.transform.game(s),cursor:m})),totalCount:a.data.totalCount,hasNextPage:a.data.pageInfo.hasNextPage,endCursor:a.data.pageInfo.endCursor??void 0}}:a}async gameSession(e){const t=await this.walletService.gameSession({id:e});if(!t.ok)return t;if(t.data)return{ok:!0,data:this.transformer.transform.gameSession(t.data)};const r=await this.gameService.gameSession({id:e});return r.ok?{ok:!0,data:r.data?this.transformer.transform.gameSession(r.data):null}:r}async createGameSession(e){const t=e.id??w.ObjectId.generate(E.GameSession).toString();if(e.game.startsWith("SPORTS:")){const p=await w.ObjectId.generateFromKey(E.Game,e.game).then(f=>f.toString()),y=await this.gameService.createGameSession({input:{id:t,game:p}});return y.ok?{ok:!0,data:{id:t}}:y}const a=await this.game(e.game);if(!a.data)return{ok:!1,error:{name:"GameDoesNotExistError",message:"Game does not exist"}};const{provider:m,reference:s}=a.data,c=["RTG","DARWIN","DRBINGO","MEGABALL","EVOLUTION","EVOLUTION_NETENT","EVOLUTION_REDTIGER","HOLLYWOODTV"].includes(m)?await this.walletService.createGameSession({input:{id:t,game:s}}):await this.gameService.createGameSession({input:{id:t,game:s}});return c.ok?{ok:!0,data:{id:t}}:c}async endGameSession(e){const t=await this.walletService.endGameSession({input:{id:e}});return t.ok?t:await this.gameService.endGameSession({input:{id:e}})}async file(e){const t=await this.fileService.file({id:e});return t.ok?{ok:!0,data:t.data?this.transformer.transform.file(t.data):null}:t}async uploadImageFile(e){const t=e.id??w.ObjectId.generate(E.File).toString(),r=await this.fileService.uploadPrivateImageFile({input:{id:t,file:e.file}});return r.ok?{ok:!0,data:{id:t}}:r}async pointsWallet(){const e=await this.walletService.pointsWallet();return e.ok?{ok:!0,data:e.data?this.transformer.transform.pointsWallet(e.data):null}:e}async redeemPoints(e){return await this.walletService.redeemPointsToCash({input:{amount:e.amount.toString()}})}async pointsWalletTransactions(e){const t=await this.reportService.pointsWalletTransactions(e);return t.ok?{ok:!0,data:{pointsWalletTransactions:t.data.edges.map(({cursor:r,node:a})=>({...this.transformer.transform.pointsWalletTransaction(a),cursor:r})),totalCount:t.data.totalCount,hasNextPage:t.data.pageInfo.hasNextPage,endCursor:t.data.pageInfo.endCursor??void 0}}:t}async activityRecords(e){const t=await this.reportService.activityRecords(e);return t.ok?{ok:!0,data:{activityRecords:t.data.edges.map(({cursor:r,node:a})=>({...this.transformer.transform.activityRecord(a),cursor:r})),totalCount:t.data.totalCount,hasNextPage:t.data.pageInfo.hasNextPage,endCursor:t.data.pageInfo.endCursor??void 0}}:t}async referralCode(){const e=await this.accountService.referralCode();return e.ok?{ok:!0,data:e.data??null}:e}async updateReferralCode(e){return await this.accountService.updateReferralCode({input:e})}async referrals(e){const t=await this.reportService.referrals(e);return t.ok?{ok:!0,data:{referrals:t.data.edges.map(({cursor:r,node:a})=>({...this.transformer.transform.referral(a),cursor:r})),totalCount:t.data.totalCount,hasNextPage:t.data.pageInfo.hasNextPage,endCursor:t.data.pageInfo.endCursor??void 0}}:t}async referralCommission(){const e=await this.reportService.referralCommission();return e.ok?{ok:!0,data:e.data?this.transformer.transform.referralCommission(e.data):null}:e}async uplinesByName(e){const t=await this.reportService.uplinesByName(e);return t.ok?{ok:!0,data:t.data.map(this.transformer.transform.referral)}:t}async downlinesByName(e){const t=await this.reportService.downlinesByName(e);return t.ok?{ok:!0,data:t.data.map(this.transformer.transform.referral)}:t}async pointsClubSettings(){const e=await this.accountService.pointsClubSettings();return e.ok?{ok:!0,data:e.data?this.transformer.transform.pointsClubSettings(e.data):null}:e}async messages(e){const t=await this.triggerService.messages(e);return t.ok?{ok:!0,data:{messages:t.data.edges.map(({cursor:r,node:a})=>({...this.transformer.transform.message(a),cursor:r})),totalCount:t.data.totalCount,hasNextPage:t.data.pageInfo.hasNextPage,endCursor:t.data.pageInfo.endCursor??void 0}}:t}async unreadMessagesCount(e){return await this.triggerService.unreadMessagesCount(e)}async markMessageAsRead(e){return await this.triggerService.markMessageAsRead({id:e})}async markAllMessageAsRead(){return await this.triggerService.markAllMessageAsRead()}async claimReward(e){return await this.triggerService.claimReward({id:e})}async bonuses(){const e=await this.walletService.bonuses();return e.ok?{ok:!0,data:e.data.map(this.transformer.transform.bonus)}:e}formatYmd(e){const t=s=>s.toString().padStart(2,"0"),r=e.getFullYear(),a=t(e.getMonth()+1),m=t(e.getDate());return`${r}-${a}-${m}`}async onboardingStatus(){const e=await this.portalService.onboardingStatus();return e.ok?{ok:!0,data:e.data}:e}async completeOnboarding(e){return await this.portalService.completeOnboarding({input:{favoriteGameTypes:e.favoriteGameTypes,playerExperience:e.playerExperience}})}async skipOnboarding(){return await this.portalService.skipOnboarding()}}Object.defineProperty(b,"ObjectId",{enumerable:!0,get:()=>w.ObjectId}),b.ObjectType=E,b.Sdk=Dr,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
|
|
1480
|
+
`;function l(o){return{name:o,message:{MaximumBonusesCountLimitExceededError:"Maximum bonuses reached",InvalidPromoCodeError:"Invalid Promo Code",SpotBonusAlreadyClaimedError:"This promo code has already been redeemed and cannot be used again",RewardAlreadyExpiredError:"Reward is either expired or no longer available",AccountNameNotAvailableError:"Username is no longer available",AccountNotFoundError:"Account does not exist",AccountNotVerifiedError:"Account is not verified",CashbackBonusDoesNotExistError:"Cashback bonus does not exists",DepositPromoMaximumAmountExceededError:"Deposit amount exceeds maximum amount",DepositPromoMinimumAmountNotMetError:"Deposit amount does not meet minimum amount",EmailAddressNotAvailableError:"Email is no longer available",FileDoesNotExistError:"File does not exist",FileFormatNotSupportedError:"File format is not supported",FileNameTooLongError:"File name is too long",FileNotReadyError:"File is not yet ready",FileSizeTooBigError:"File size is too big",GameDoesNotExistError:"Game does not exist",HasActiveBonusError:"Account has active bonus",InsufficientPointsError:"Insufficient points",InvalidPlatformError:"Invalid platform",InvalidReCAPTCHAResponseError:"Invalid reCAPTCHA",InvalidSMSVerificationCodeError:"Invalid SMS verification code",InvalidTransactionPasswordError:"Invalid transaction password",InvalidVerificationCodeError:"Invalid verification code",InvalidWithdrawalAmountError:"Invalid withdrawal amount",MaximumDepositAmountExceededError:"Maximum deposit amount exceeded",MemberVerificationAlreadyApprovedError:"Member verification is already approved",MemberVerificationAlreadyExistsError:"Member verification already exists",MemberVerificationDoesNotExistError:"Member verification does not exist",MinimumAgeRequirementError:"Minimum age requirement not met",MinimumDepositAmountNotMetError:"Minimum deposit amount not met",MinimumFirstDepositAmountNotMetError:"Minimum first deposit amount not met",MobileNumberAlreadyVerifiedError:"Mobile number is already verified",MobileNumberNotAvailableError:"Mobile number is no longer available",MobileNumberNotVerifiedError:"Mobile number is not verified",NickNameNotAvailableError:"Nickname is no longer available",NotEnoughBalanceError:"Insufficient balance",NotReadyToSendVerficationCodeError:"Not ready to send verification code",PromoNotEnabledError:"Promo is not enabled",RealNameAlreadySetError:"Real name is already set",ValidIdAlreadySetError:"Valid ID is already set",WalletDoesNotExistError:"Wallet does not exist",WithdrawalDailyLimitExceededError:"Daily withdrawal limit exceeded",GameProviderError:"Game provider error",GameSessionAlreadyClosedError:"Game session is already closed",GameSessionDoesNotExistError:"Game session does not exist",ReferralCodeNotAvailableError:"Referral code is no longer available",AccountBlacklistedError:"Account is blacklisted",InvalidTokenError:"Invalid token",InvalidTokenOrSecretAnswerError:"Invalid token or secret answer",SessionExpiredError:"Session expired",RateLimitExceededError:"Maximum number of requests reached",RewardAlreadyClaimedError:"Reward is already claimed",ReCAPTCHAVerificationFailedError:"Invalid reCAPTCHA"}[o]}}class ur{constructor(e){u(this,"client");this.client=e}async memberAccount(){const e=await this.client.request(Mt);return e.ok?{ok:!0,data:e.data.memberAccount}:e}async registerMemberAccount(e){const{reCAPTCHAResponse:t,...r}=e,a=await this.client.request(Nt,r,{headers:{...t&&{[E]:t}}});return a.ok?a.data.registerMemberAccount?{ok:!1,error:l(a.data.registerMemberAccount.__typename)}:{ok:!0}:a}async registerMemberAccountViaMobile(e){const{reCAPTCHAResponse:t,...r}=e,a=await this.client.request(It,r,{headers:{...t&&{[E]:t}}});return a.ok?a.data.registerMemberAccountViaMobile?{ok:!1,error:l(a.data.registerMemberAccountViaMobile.__typename)}:{ok:!0}:a}async registerMemberAccount__next(e){const{reCAPTCHAResponse:t,...r}=e,a=await this.client.request(Pt,r,{headers:{...t&&{[E]:t}}});return a.ok?a.data.registerMemberAccount?{ok:!1,error:l(a.data.registerMemberAccount.__typename)}:{ok:!0}:a}async updateMemberAccount(e){const t=await this.client.request(Ot,e);return t.ok?t.data.updateMemberAccount?{ok:!1,error:l(t.data.updateMemberAccount.__typename)}:{ok:!0}:t}async deleteMemberAccount(e){const t=await this.client.request(Wt,e);return t.ok?t.data.deleteMemberAccount?{ok:!0}:{ok:!1,error:{name:"UnknownError",message:"Something went wrong."}}:t}async resetPassword(e){const t=await this.client.request(Bt,e);return t.ok?t.data.resetPassword?{ok:!1,error:l(t.data.resetPassword.__typename)}:{ok:!0}:t}async profileCompletion(){const e=await this.client.request($t);return e.ok?{ok:!0,data:e.data.profileCompletion}:e}async platform(){return await this.client.request(Ft)}async sendVerificationCode(e){const t=await this.client.request(Lt,e);return t.ok?t.data.sendVerificationCode?{ok:!1,error:l(t.data.sendVerificationCode.__typename)}:{ok:!0}:t}async paymentSettings(){return await this.client.request(Vt)}async verifyMobileNumber(e){const t=await this.client.request(xt,e);return t.ok?t.data.verifyMobileNumber?{ok:!1,error:l(t.data.verifyMobileNumber.__typename)}:{ok:!0}:t}async createMemberVerification(e){const t=await this.client.request(Ut,e);return t.ok?t.data.createMemberVerification?{ok:!1,error:l(t.data.createMemberVerification.__typename)}:{ok:!0}:t}async updateMemberVerification(e){const t=await this.client.request(qt,e);return t.ok?t.data.updateMemberVerification?{ok:!1,error:l(t.data.updateMemberVerification.__typename)}:{ok:!0}:t}async memberVerification(){const e=await this.client.request(vt);return e.ok?{ok:!0,data:e.data.memberAccount.verification}:e}async announcements(e){const t=await this.client.request(et,e);return t.ok?{ok:!0,data:t.data.announcements}:t}async registerMayaMemberAccount(e){const t=await this.client.request(Gt,e);return t.ok?t.data.registerMayaMemberAccount?{ok:!1,error:l(t.data.registerMayaMemberAccount.__typename)}:{ok:!0}:t}async referralCode(){const e=await this.client.request(Kt);return e.ok?{ok:!0,data:e.data.referralCode}:e}async updateReferralCode(e){const t=await this.client.request(zt,e);return t.ok?t.data.updateReferralCode?{ok:!1,error:l(t.data.updateReferralCode.__typename)}:{ok:!0}:t}async pointsClubSettings(){const e=await this.client.request(tr);return e.ok?{ok:!0,data:e.data.pointsClubSettings}:e}}function h(o,e){const t=Pe[o]?Pe[o]:Pe[500];return{name:t.name,message:e??t.message}}const Pe={400:{name:"HttpBadRequest",message:"Bad Request"},401:{name:"HttpUnauthorized",message:"Unauthorized"},403:{name:"HttpForbidden",message:"Forbidden"},404:{name:"HttpNotFound",message:"Not Found"},408:{name:"HttpRequestTimeout",message:"Request Timeout"},429:{name:"HttpTooManyRequests",message:"Too Many Requests"},500:{name:"HttpInternalServerError",message:"Internal Server Error"}};class lr{constructor(e){u(this,"url");u(this,"platform");this.url=e.url,this.platform=e.platform}get headers(){const e=new Headers;return e.append("Accept","application/json, text/plain"),e.append("Content-Type","application/json"),e.append("Platform-Code",this.platform),e.append("Role","MEMBER"),e}async createSession(e){const t=new Headers(this.headers);if(e.name){const r=`${e.name}:${e.password}`,a=Buffer.from(r).toString("base64");t.set("Authorization",`Basic ${a}`)}if(e.mobileNumber){const r=`${e.mobileNumber}:${e.verificationCode}`,a=Buffer.from(r).toString("base64");console.log(`MobileNumberOTP ${a}`),t.set("Authorization",`MobileNumberOTP ${a}`)}e.sessionId&&t.set("Authorization",`MayaSession ${e.sessionId}`),e.token&&t.set("Authorization",`Token ${e.token}`),e.reCAPTCHAResponse&&t.set(E,e.reCAPTCHAResponse);try{const r=await fetch(`${this.url}/sessions`,{method:"POST",headers:t}),a=await r.json();return r.ok?{ok:!0,data:a}:a.code==="ACCOUNT_BLACKLISTED"?{ok:!1,error:l("AccountBlacklistedError")}:a.code==="INVALID_RECAPTCHA_RESPONSE"?{ok:!1,error:l("InvalidReCAPTCHAResponseError")}:{ok:!1,error:h(r.status)}}catch{return{ok:!1,error:h(500)}}}async authenticate(e){const t=new Headers(this.headers);if(e.type==="SECURITY_QUESTION"){t.set("Authorization",`Bearer ${e.token}`);try{const r=await fetch(`${this.url}/session/${e.token}/authenticate`,{method:"POST",headers:t,body:JSON.stringify({secretAnswer:e.secretAnswer})}),a=await r.json();return r.ok?{ok:!0,data:a}:r.status===401||r.status===403?{ok:!1,error:l("InvalidTokenOrSecretAnswerError")}:{ok:!1,error:h(r.status)}}catch{return{ok:!1,error:h(500)}}}throw new Error("Invalid input 'type'")}async refreshSession(e){const t=new Headers(this.headers);t.append("Authorization",`Bearer ${e}`);try{const r=await fetch(`${this.url}/session:refresh`,{method:"POST",headers:t}),a=await r.json();return r.ok?{ok:!0,data:a}:a.code==="ACCOUNT_BLACKLISTED"?{ok:!1,error:l("AccountBlacklistedError")}:r.status===403||r.status===401?{ok:!1,error:l("InvalidTokenError")}:{ok:!1,error:h(r.status)}}catch{return{ok:!1,error:h(500)}}}async destroySession(e){const t=new Headers(this.headers);t.append("Authorization",`Bearer ${e}`);try{const r=await fetch(`${this.url}/session`,{method:"DELETE",headers:t});return r.ok?{ok:!0}:{ok:!1,error:h(r.status)}}catch{return{ok:!1,error:h(500)}}}async verifySession(e){const t=new Headers(this.headers);t.append("Authorization",`Bearer ${e}`);try{return(await fetch(`${this.url}/session`,{method:"GET",headers:t})).ok}catch{return!0}}async sendVerificationCode(e){if(e.channel==="EMAIL")throw new Error("Email channel is not yet supported");function t(r){switch(r){case"MEMBER_NOT_FOUND":return"AccountNotFoundError";case"RATE_LIMIT_REACH":return"RateLimitExceededError";case"NOT_READY_TO_SEND_VERIFICATION_ERROR":return"NotReadyToSendVerficationCodeError";default:return null}}try{const r=await fetch(`${this.url}/otps`,{method:"POST",headers:this.headers,body:JSON.stringify(e)});if(r.status===403){const a=await r.json(),m=t(a.message);return m?{ok:!1,error:l(m)}:{ok:!1,error:h(r.status,a.message)}}return r.ok?{ok:!0}:{ok:!1,error:h(r.status)}}catch{return{ok:!1,error:h(500)}}}}class pr{constructor(e){u(this,"url");u(this,"siteId");u(this,"platformId");this.url=e.url,this.siteId=e.site,this.platformId=e.platform}async self(){const e=await this.getJson(`/sites/${this.siteId}`);return e.ok?{ok:!0,data:e.data.data}:e}async games(e){var a,m,s,d,c,p,y,f,D,M,v,N,I,P,g,G,O,T,B,W,x,U,_,q,$,L,F,H,V,Y,Q,j;const t=new URLSearchParams;e!=null&&e.first&&t.set("first",e.first.toString()),e!=null&&e.after&&t.set("after",e.after),e!=null&&e.search&&t.set("search",e.search),(m=(a=e==null?void 0:e.filter)==null?void 0:a.type)!=null&&m.equal&&t.set("filter[type][eq]",e.filter.type.equal),(d=(s=e==null?void 0:e.filter)==null?void 0:s.type)!=null&&d.notEqual&&t.set("filter[type][neq]",e.filter.type.notEqual),(p=(c=e==null?void 0:e.filter)==null?void 0:c.type)!=null&&p.in&&t.set("filter[type][in]",e.filter.type.in.join(",")),(f=(y=e==null?void 0:e.filter)==null?void 0:y.type)!=null&&f.notIn&&t.set("filter[type][nin]",e.filter.type.notIn.join(",")),(M=(D=e==null?void 0:e.filter)==null?void 0:D.provider)!=null&&M.equal&&t.set("filter[provider][eq]",e.filter.provider.equal),(N=(v=e==null?void 0:e.filter)==null?void 0:v.provider)!=null&&N.notEqual&&t.set("filter[provider][neq]",e.filter.provider.notEqual),(P=(I=e==null?void 0:e.filter)==null?void 0:I.provider)!=null&&P.in&&t.set("filter[provider][in]",e.filter.provider.in.join(",")),(G=(g=e==null?void 0:e.filter)==null?void 0:g.provider)!=null&&G.notIn&&t.set("filter[provider][nin]",e.filter.provider.notIn.join(",")),(T=(O=e==null?void 0:e.filter)==null?void 0:O.tags)!=null&&T.equal&&t.set("filter[tags][eq]",e.filter.tags.equal.toLowerCase()),(W=(B=e==null?void 0:e.filter)==null?void 0:B.tags)!=null&&W.notEqual&&t.set("filter[tags][neq]",e.filter.tags.notEqual.toLowerCase()),(U=(x=e==null?void 0:e.filter)==null?void 0:x.tags)!=null&&U.in&&t.set("filter[tags][in]",e.filter.tags.in.map(k=>k.toLowerCase()).join(",")),(q=(_=e==null?void 0:e.filter)==null?void 0:_.tags)!=null&&q.notIn&&t.set("filter[tags][nin]",e.filter.tags.notIn.map(k=>k.toLowerCase()).join(",")),(L=($=e==null?void 0:e.filter)==null?void 0:$.reference)!=null&&L.equal&&t.set("filter[reference][eq]",e.filter.reference.equal),(H=(F=e==null?void 0:e.filter)==null?void 0:F.reference)!=null&&H.notEqual&&t.set("filter[reference][neq]",e.filter.reference.notEqual),(Y=(V=e==null?void 0:e.filter)==null?void 0:V.reference)!=null&&Y.in&&t.set("filter[reference][in]",e.filter.reference.in.join(",")),(j=(Q=e==null?void 0:e.filter)==null?void 0:Q.reference)!=null&&j.notIn&&t.set("filter[reference][nin]",e.filter.reference.notIn.join(",")),e!=null&&e.sort&&t.set("sort[order]",e.sort);const r=await this.getJson("/games",t);return r.ok?{ok:!0,data:{edges:r.data.data.map(k=>({node:k,cursor:k.cursor})),totalCount:r.data.totalCount??0,pageInfo:{hasNextPage:!!r.data.next,endCursor:r.data.next}}}:r}async game(e){var r;const t=await this.getJson(`/games/${e}`);return((r=t.error)==null?void 0:r.name)==="HttpNotFound"?{ok:!0,data:null}:t.ok?{ok:!0,data:t.data.data}:t}async getJson(e,t){const r=new Request(`${this.url}${e}?${(t==null?void 0:t.toString())??""}`,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json","Site-ID":this.siteId,"Platform-ID":this.platformId}});try{const a=await fetch(r);return a.ok?{ok:!0,data:await a.json()}:{ok:!1,error:h(a.status)}}catch{return{ok:!1,error:h(500)}}}}class fr{constructor(e){u(this,"client");this.client=e}async file(e){const t=await this.client.request(Qe,e);return t.ok?{ok:!0,data:t.data.node}:t}async uploadPrivateImageFile(e){const t=await this.client.upload(je,e);return t.ok?t.data.uploadPrivateImageFile?{ok:!1,error:l(t.data.uploadPrivateImageFile.__typename)}:{ok:!0}:t}}class wr{constructor(e){u(this,"client");this.client=e}async gameSession(e){const t=await this.client.request(We.legacy,e);return t.ok?{ok:!0,data:t.data.node?{...t.data.node,game:t.data.node.game.id}:null}:t}async createGameSession(e){const t=await this.client.request(xe,e);return t.ok?t.data.createGameSession?{ok:!1,error:l(t.data.createGameSession.__typename)}:{ok:!0}:t}async endGameSession(e){const t=await this.client.request(Ue.legacy,e);return t.ok?t.data.endGameSession?{ok:!1,error:{name:"UnknownError",message:"Something went wrong."}}:{ok:!0}:t}}class yr{constructor(e){u(this,"client");this.client=e}async latestBetRecords(){const e=await this.client.request(gt);return e.ok?{ok:!0,data:e.data.latestBetRecords}:e}async platform(){const e=await this.client.request(Ht);return e.ok?{ok:!0,data:e.data}:e}async recommendedGames(){const e=await this.client.request(Ze);return e.ok?{ok:!0,data:e.data.recommendedGames}:e}async onboardingStatus(){const e=await this.client.request(mr);return e.ok?{ok:e.ok,data:e.data.onboardingStatus??[]}:e}async completeOnboarding(e){const t=await this.client.request(dr,e);return t.ok?t.data.completeOnboarding?{ok:!0}:{ok:!1,error:{name:"UnknownError",message:"Something went wrong"}}:t}async skipOnboarding(){const e=await this.client.request(cr);return e.ok?e.data.skipOnboarding?{ok:!0}:{ok:!1,error:{name:"UnknownError",message:"Something went wrong"}}:e}}class hr{constructor(e){u(this,"client");this.client=e}async betRecords(e){const t=await this.client.request(ht,e);return t.ok?{ok:t.ok,data:t.data.member.betRecords}:t}async transactionRecords(e){const t=await this.client.request(At,e);return t.ok?{ok:t.ok,data:t.data.member.transactionRecords}:t}async withdrawalRecords(e){const t=await this.client.request(tt,e);return t.ok?{ok:t.ok,data:t.data.member.withdrawalRecords}:t}async depositRecords(e){const t=await this.client.request(dt,e);return t.ok?{ok:t.ok,data:t.data.member.depositRecords}:t}async depositsCount(){const e=await this.client.request(yt);return e.ok?{ok:e.ok,data:e.data.member.depositsCount}:e}async pointsWalletTransactions(e){const t=await this.client.request(Xe,e);return t.ok?{ok:t.ok,data:t.data.member.pointsWalletTransactions}:t}async activityRecords(e){const t=await this.client.request(jt,e);return t.ok?{ok:t.ok,data:t.data.member.activityRecords}:t}async referrals(e){const t=await this.client.request(Jt,e);return t.ok?{ok:t.ok,data:t.data.member.referrals}:t}async referralCommission(){const e=await this.client.request(er);return e.ok?{ok:e.ok,data:e.data.member.referralCommission}:e}async uplinesByName(e){const t=await this.client.request(Xt,e);return t.ok?{ok:t.ok,data:t.data.uplinesByName}:t}async downlinesByName(e){const t=await this.client.request(Zt,e);return t.ok?{ok:t.ok,data:t.data.downlinesByName}:t}async promoByCode(e){const t=await this.client.request(Ct,e);return t.ok?{ok:t.ok,data:t.data.promoByCode}:t}}class gr{constructor(e){u(this,"client");this.client=e}async messages(e){const t=await this.client.request(rr,e);return t.ok?{ok:t.ok,data:t.data.messages}:t}async unreadMessagesCount(e){const t=await this.client.request(ar,{...e,filter:{...e==null?void 0:e.filter,markedAsRead:{equal:!1}}});return t.ok?{ok:t.ok,data:t.data.messages.totalCount}:t}async markMessageAsRead(e){const t=await this.client.request(nr,e);return t.ok?t.data.markMessageAsRead?{ok:!0}:{ok:!1,error:{name:"UnknownError",message:"Something went wrong."}}:t}async markAllMessageAsRead(){const e=await this.client.request(or);return e.ok?e.data.markAllMessageAsRead?{ok:!0}:{ok:!1,error:{name:"UnknownError",message:"Something went wrong."}}:e}async claimReward(e){const t=await this.client.request(ir,e);return t.ok?t.data.claimReward?{ok:!1,error:l(t.data.claimReward.__typename)}:{ok:!0}:t}}class Ar{constructor(e){u(this,"client");this.client=e}async promos(){const e=await this.client.request(bt);return e.ok?{ok:e.ok,data:e.data.promos}:e}async cashbacks(){const e=await this.client.request(kt);return e.ok?{ok:e.ok,data:e.data.cashbacks}:e}async availablePromos(e){const t=await this.client.request(Et,e);return t.ok?{ok:t.ok,data:t.data.availablePromos}:t}async cashbackBonuses(){const e=await this.client.request(Rt);return e.ok?{ok:e.ok,data:e.data.cashbackBonuses}:e}async claimCashbackBonus(e){const t=await this.client.request(Dt,e);return t.ok?t.data.claimCashbackBonus?{ok:!1,error:l(t.data.claimCashbackBonus.__typename)}:{ok:!0}:{ok:t.ok,error:t.error}}async bonus(){const e=await this.client.request(Tt);return e.ok?{ok:e.ok,data:e.data.bonus}:e}async wallet(){const e=await this.client.request(Ke);return e.ok?{ok:e.ok,data:e.data.wallet}:e}async deposit(e){const t=await this.client.request(wt,e);return t.ok?{ok:t.ok,data:t.data.node}:t}async createGCashDeposit(e){const{reCAPTCHAResponse:t,...r}=e,a=await this.client.request(ct,r,{headers:{...t&&{[E]:t}}});return a.ok?a.data.createGCashDeposit?{ok:!1,error:l(a.data.createGCashDeposit.__typename)}:{ok:!0}:a}async createMayaDeposit(e){const{reCAPTCHAResponse:t,...r}=e,a=await this.client.request(ut,r,{headers:{...t&&{[E]:t}}});return a.ok?a.data.createMayaDeposit?{ok:!1,error:l(a.data.createMayaDeposit.__typename)}:{ok:!0}:a}async createAIOQRPHDeposit(e){const{reCAPTCHAResponse:t,...r}=e,a=await this.client.request(pt,r,{headers:{...t&&{[E]:t}}});return a.ok?a.data.createAIOQRPHDeposit?{ok:!1,error:l(a.data.createAIOQRPHDeposit.__typename)}:{ok:!0}:a}async createAIOOnlineBankDeposit(e){const{reCAPTCHAResponse:t,...r}=e,a=await this.client.request(ft,r,{headers:{...t&&{[E]:t}}});return a.ok?a.data.createAIOOnlineBankDeposit?{ok:!1,error:l(a.data.createAIOOnlineBankDeposit.__typename)}:{ok:!0}:a}async createMayaAppDeposit(e){const{reCAPTCHAResponse:t,...r}=e,a=await this.client.request(lt,r,{headers:{...t&&{[E]:t}}});return a.ok?a.data.createMayaAppDeposit?{ok:!1,error:l(a.data.createMayaAppDeposit.__typename)}:{ok:!0}:a}async createGCashWithdrawal(e){const{reCAPTCHAResponse:t,...r}=e,a=await this.client.request(rt,r,{headers:{...t&&{[E]:t}}});return a.ok?a.data.createGCashWithdrawal?{ok:!1,error:l(a.data.createGCashWithdrawal.__typename)}:{ok:!0}:a}async createMayaWithdrawal(e){const{reCAPTCHAResponse:t,...r}=e,a=await this.client.request(at,r,{headers:{...t&&{[E]:t}}});return a.ok?a.data.createMayaWithdrawal?{ok:!1,error:l(a.data.createMayaWithdrawal.__typename)}:{ok:!0}:a}async createMayaAppWithdrawal(e){const{reCAPTCHAResponse:t,...r}=e,a=await this.client.request(nt,r,{headers:{...t&&{[E]:t}}});return a.ok?a.data.createMayaAppWithdrawal?{ok:!1,error:l(a.data.createMayaAppWithdrawal.__typename)}:{ok:!0}:a}async createBankWithdrawal(e){const{reCAPTCHAResponse:t,...r}=e,a=await this.client.request(ot,r,{headers:{...t&&{[E]:t}}});return a.ok?a.data.createBankWithdrawal?{ok:!1,error:l(a.data.createBankWithdrawal.__typename)}:{ok:!0}:a}async createAIOInstapayWithdrawal(e){const{reCAPTCHAResponse:t,...r}=e,a=await this.client.request(it,r,{headers:{...t&&{[E]:t}}});return a.ok?a.data.createAIOInstapayWithdrawal?{ok:!1,error:l(a.data.createAIOInstapayWithdrawal.__typename)}:{ok:!0}:a}async instapayBankList(){const e=await this.client.request(st);return e.ok?{ok:e.ok,data:e.data.instapayBankList}:e}async remainingDailyWithdrawalsCount(){const e=await this.client.request(mt);return e.ok?{ok:e.ok,data:e.data.remainingDailyWithdrawalsCount}:e}async pointsWallet(){const e=await this.client.request(ze);return e.ok?{ok:e.ok,data:e.data.pointsWallet}:e}async redeemPointsToCash(e){const t=await this.client.request(Je,e);return t.ok?t.data.redeemPointsToCash?{ok:!1,error:l(t.data.redeemPointsToCash.__typename)}:{ok:!0}:t}async mayaSession(e){const t=await this.client.request(Yt,e);return t.ok?{ok:t.ok,data:t.data.mayaSession}:t}async gameSession(e){const t=await this.client.request(We.current,e);return t.ok?{ok:!0,data:t.data.node}:t}async createGameSession(e){const t=await this.client.request(xe,e);return t.ok?t.data.createGameSession?{ok:!1,error:l(t.data.createGameSession.__typename)}:{ok:!0}:t}async endGameSession(e){const t=await this.client.request(Ue.current,e);return t.ok?t.data.endGameSession?{ok:!0}:{ok:!1,error:{name:"UnknownError",message:"Something went wrong."}}:t}async validateMayaSession(){const e=await this.client.request(Qt);return e.ok?e.data.validateMayaSession?{ok:!0}:{ok:!1,error:{name:"UnknownError",message:"Something went wrong."}}:e}async bonuses(){const e=await this.client.request(_t);return e.ok?{ok:e.ok,data:e.data.bonuses??[]}:e}async claimSpotBonus(e){const t=await this.client.request(sr,e);return t.ok?t.data.claimSpotBonus?{ok:!1,error:l(t.data.claimSpotBonus.__typename)}:{ok:!0}:{ok:t.ok,error:t.error}}}function Ge(o){return new Date(o.getTime())}function K(o,e){const t=Ge(o);return t.setMinutes(t.getMinutes()+e),t}function Oe(o,e){return o.getTime()>e.getTime()}class br{constructor(e){u(this,"config");u(this,"cache");this.cache={},this.config={cacheTime:5,...e}}set(e,t){const r=K(new Date,this.config.cacheTime);this.cache[e]={value:t,validUntil:r}}get(e){const t=this.cache[e];return!t||Oe(new Date,t.validUntil)?null:t.value}}function Er(o,e,t){return o<e?e:o>t?t:o}function Be(o){return Object.prototype.toString.call(o)==="[object Object]"&&Object(o)===o}function Sr(o){const e=[];function t(r,a=[]){for(const m in r){const s=r[m];Be(s)?t(s,[...a,m]):Array.isArray(s)?t(Cr(s),[...a,m]):e.push({key:[...a,m],value:s})}}return t(o),e}function Cr(o){return o.reduce((e,t,r)=>(e[r]=t,e),{})}class z{constructor(e,t){u(this,"url");u(this,"options");u(this,"middlewares");var a;const r=new Headers((a=t==null?void 0:t.fetchOptions)==null?void 0:a.headers);this.url=e,this.options={...t==null?void 0:t.fetchOptions,headers:r},this.middlewares=(t==null?void 0:t.middlewares)??[]}async request(e,t,r){const a=Le(this.options,r),m=JSON.stringify({query:e,variables:t}),s=new Headers(a.headers);s.set("Content-Type","application/json"),s.set("Accept","application/json");const d=new URL(this.url),c=$e(e);c&&d.searchParams.set(`_${c.type}`,c.name);const p=await this.runMiddlewares(new Request(d,{...a,body:m,headers:s,method:"POST"}));return await this.exec(p)}async upload(e,t,r){const a=Le(this.options,r),m=this.createUploadBody(e,t),s=new Headers(a.headers);s.delete("Content-Type");const d=new URL(this.url),c=$e(e);c&&d.searchParams.set(`_${c.type}`,c.name);const p=await this.runMiddlewares(new Request(d,{...a,body:m,headers:s,method:"POST"}));return await this.exec(p)}async exec(e){var t,r,a,m,s,d;try{const c=await fetch(e);if(!c.ok)return{ok:!1,error:h(c.status)};const p=await c.json(),y=p.data,f=(t=p.errors)==null?void 0:t.at(0);return f?((r=f.extensions)==null?void 0:r.code)==="FORBIDDEN"||((a=f.extensions)==null?void 0:a.code)==="ACCESS_TOKEN_EXPIRED"?{ok:!1,error:h(403,f.message)}:((m=f.extensions)==null?void 0:m.code)==="UNAUTHORIZED"?{ok:!1,error:h(401,f.message)}:((s=f.extensions)==null?void 0:s.code)==="BAD_USER_INPUT"||((d=f.extensions)==null?void 0:d.code)==="BAD_REQUEST"?{ok:!1,error:h(400,f.message)}:{ok:!1,error:h(500,f.message)}:{ok:!0,data:y}}catch{return{ok:!1,error:h(500)}}}async runMiddlewares(e){let t=e.clone();for(const r of this.middlewares)t=await r(t);return t}createUploadBody(e,t){const r=Sr(t).filter(s=>s.value instanceof File||s.value instanceof Blob),a=new FormData;a.append("operations",JSON.stringify({query:e,variables:t}));const m={};return r.forEach((s,d)=>{m[d.toString()]=[`variables.${s.key.join(".")}`]}),a.append("map",JSON.stringify(m)),r.forEach((s,d)=>{a.append(d.toString(),s.value)}),a}}function $e(o){const e=o.match(/(query|mutation)\s+(\w+)/);if(!e)return null;const t=e.at(1),r=e.at(2);return t&&r?{type:t,name:r}:null}function Le(o,e){return o?e?{...o,...e,headers:kr(o.headers,e.headers)}:o??{}:e??{}}function kr(o,e){if(!o)return e;if(!e)return o;const t=new Headers;return new Headers(o).forEach((r,a)=>t.append(a,r)),new Headers(e).forEach((r,a)=>t.append(a,r)),t}function Tr(o){return o==="INR"?"en-IN":o==="MYR"?"en-MY":o==="IDR"?"en-ID":o==="USD"?"en-US":"en-PH"}function _r(o){return o==="en-IN"?"+91":o==="en-MY"?"+60":o==="en-ID"?"+62":o==="en-US"?"+1":"+63"}function R(o,e){const t=_r(e);return o.startsWith(t)?o:o.startsWith(t.substring(1))?`+${o}`:o.startsWith("0")?`${t}${o.substring(1)}`:`${t}${o}`}async function S(o){const e=new TextEncoder().encode(o),t=await crypto.subtle.digest("SHA-256",e);return Array.from(new Uint8Array(t)).map(m=>m.toString(16).padStart(2,"0")).join("")}class Fe{constructor(e){u(this,"enabled");this.enabled=(e==null?void 0:e.enabled)??!0}info(e){this.enabled&&console.log(`\x1B[34m[info] ${e}`)}warn(e){this.enabled&&console.log(`\x1B[33m[warn] ${e}`)}error(e){this.enabled&&console.log(`\x1B[31m[error] ${e}`)}success(e){this.enabled&&console.log(`\x1B[32m[success] ${e}`)}}function J(o,e){const t=Ge(o);return t.setDate(t.getDate()+e),t}function He(o){return new Promise(e=>{setTimeout(e,o)})}function Ve(o,e){const{until:t,interval:r=1e3,maxAttempt:a=3}=e;async function m(s,d){const c=d??a,p=await o(...s);return t(p)?p:c>1?(await He(r*((a-c)/2)),m(s,c-1)):p}return async(...s)=>await m(s)}function X(o,e){const t=Ge(o);return t.setMinutes(t.getMinutes()-e),t}class Rr{constructor(e){u(this,"logger");u(this,"storageKey","session");u(this,"authService");u(this,"walletService");u(this,"_refreshing",!1);this.authService=e.authService,this.walletService=e.walletService,this.logger=new Fe({enabled:e.logs??!1})}get refreshing(){return this._refreshing}set refreshing(e){this._refreshing=e}async create(e){var a;if(this.isServer)return this.logger.warn("'localStorage' is not available on the server."),{ok:!1,error:{name:"UnknownError",message:"Server sign in is not supported."}};if(e.type==="MAYA"){const s=await Ve(()=>this.walletService.mayaSession({id:e.sessionId}),{until:y=>{var f;return y.ok&&((f=y.data)==null?void 0:f.member)!=null},interval:1e3,maxAttempt:5})();if(!s.ok)return s;if(!((a=s.data)!=null&&a.member))return{ok:!1,error:{name:"HttpForbidden",message:"Forbidden"}};const c=await Ve(()=>this.authService.createSession(e),{until:y=>y.ok,interval:1e3,maxAttempt:5})();if(!c.ok)return c;const p=new Date;return window.localStorage.setItem(this.storageKey,JSON.stringify({...c.data,accessTokenExpiresAt:K(p,8).getTime(),refreshTokenExpiresAt:X(J(p,30),2).getTime()})),{ok:!0,data:null}}if(e.type==="MOBILE_NUMBER"){const m=await this.authService.createSession(e);if(m.ok){const s=new Date;return window.localStorage.setItem(this.storageKey,JSON.stringify({...m.data,accessTokenExpiresAt:K(s,8).getTime(),refreshTokenExpiresAt:X(J(s,30),2).getTime()})),{ok:!0,data:null}}return m}if(e.type==="TOKEN"){const m=await this.authService.createSession({token:e.token});if(m.ok){const s=new Date;return window.localStorage.setItem(this.storageKey,JSON.stringify({...m.data,accessTokenExpiresAt:K(s,8).getTime(),refreshTokenExpiresAt:X(J(s,30),2).getTime()})),{ok:!0,data:null}}return m}const t=await this.authService.createSession(e);if(!t.ok)return t;if(t.data.authenticator)return{ok:!0,data:{authenticator:t.data.authenticator}};const r=new Date;return window.localStorage.setItem(this.storageKey,JSON.stringify({...t.data,accessTokenExpiresAt:K(r,8).getTime(),refreshTokenExpiresAt:X(J(r,30),2).getTime()})),{ok:!0,data:null}}async createFromAuthenticator(e){const t=await this.authService.authenticate(e);if(t.ok){const r=new Date;return this.isServer?this.logger.warn("'localStorage' is not available on the server."):window.localStorage.setItem(this.storageKey,JSON.stringify({...t.data,accessTokenExpiresAt:K(r,8).getTime(),refreshTokenExpiresAt:X(J(r,30),2).getTime()})),{ok:!0}}else return t}async get(){if(this.isServer)return this.logger.warn("'localStorage' is not available on the server."),{ok:!0,data:null};if(this.refreshing)return await He(1e3),await this.get();const e=window.localStorage.getItem(this.storageKey);if(!e)return{ok:!0,data:null};try{let t=JSON.parse(e),r=new Date;const a=new Date(t.accessTokenExpiresAt),m=new Date(t.refreshTokenExpiresAt);if(Oe(r,m))return this.logger.warn("Session expired. Logging out.."),window.localStorage.removeItem(this.storageKey),{ok:!1,error:{name:"SessionExpiredError",message:"Session expired."}};if(Oe(r,a)){this.logger.info("Refreshing session..."),this.refreshing=!0;const s=await this.authService.refreshSession(t.refreshToken);if(this.refreshing=!1,!s.ok)return this.logger.error(`Failed to refresh session: ${s.error.message}`),s.error.name==="InvalidTokenError"||s.error.name==="AccountBlacklistedError"?(window.localStorage.removeItem(this.storageKey),{ok:!1,error:s.error}):(this.logger.warn("Old session returned."),{ok:!0,data:t});this.logger.success("Session refreshed!"),r=new Date,t={...t,...s.data,accessTokenExpiresAt:K(r,8).getTime(),refreshTokenExpiresAt:X(J(r,30),2).getTime()},window.localStorage.setItem(this.storageKey,JSON.stringify(t))}return{ok:!0,data:t}}catch{return{ok:!1,error:{name:"UnknownError",message:"Something went wrong."}}}}async destroy(){var t;if(this.isServer){this.logger.warn("'localStorage' is not available on the server.");return}const e=await this.get();(t=e.data)!=null&&t.accessToken&&await this.authService.destroySession(e.data.accessToken),window.localStorage.removeItem(this.storageKey)}async verify(){var r,a,m;if(this.isServer)return this.logger.warn("'localStorage' is not available on the server."),!0;const e=await this.get();if(((r=e.error)==null?void 0:r.name)==="InvalidTokenError"||((a=e.error)==null?void 0:a.name)==="SessionExpiredError"||((m=e.error)==null?void 0:m.name)==="AccountBlacklistedError")return!1;if(!e.data)return!0;const t=await this.authService.verifySession(e.data.accessToken);return t||window.localStorage.removeItem(this.storageKey),t}get isServer(){return typeof window>"u"}}function C(o){const e={};for(const t in o){const r=o[t];if(r!==null&&r!==void 0){if(Be(r)){e[t]=C(r);continue}if(Array.isArray(r)){e[t]=r.map(a=>Be(a)?C(a):a);continue}e[t]=r}}return e}function n(o,e){if(typeof o=="number"&&!Number.isNaN(o))return o;if(typeof o=="string"){const t=Number.parseFloat(o);if(!Number.isNaN(t))return t}return e}class Dr{get transform(){return{site:this.site.bind(this),platform:this.platform.bind(this),account:this.account.bind(this),wallet:this.wallet.bind(this),verificationDetails:this.verificationDetails.bind(this),profileCompletion:this.profileCompletion.bind(this),announcement:this.announcement.bind(this),withdrawalRecord:this.withdrawalRecord.bind(this),deposit:this.deposit.bind(this),depositRecord:this.depositRecord.bind(this),betRecord:this.betRecord.bind(this),latestBetRecord:this.latestBetRecord.bind(this),transactionRecord:this.transactionRecord.bind(this),game:this.game.bind(this),gameSession:this.gameSession.bind(this),promo:this.promo.bind(this),cashback:this.cashback.bind(this),bonus:this.bonus.bind(this),cashbackBonus:this.cashbackBonus.bind(this),file:this.file.bind(this),pointsWallet:this.pointsWallet.bind(this),pointsWalletTransaction:this.pointsWalletTransaction.bind(this),activityRecord:this.activityRecord.bind(this),referral:this.referral.bind(this),referralCommission:this.referralCommission.bind(this),platform__next:this.platform__next.bind(this),pointsClubSettings:this.pointsClubSettings.bind(this),paymentSettings:this.paymentSettings.bind(this),message:this.message.bind(this),instapayBank:this.instapayBank.bind(this),promoByCode:this.promoByCode.bind(this)}}site(e){const t={id:e.id,name:e.name,logo:e.logo??void 0,fields:e.config.fields};return C(t)}platform(e){var t,r,a,m,s,d,c,p,y,f,D,M,v,N,I,P,g,G,O,T,B,W,x,U,_,q,$,L,F,H,V,Y,Q,j,k,Z,ee,te,re,ae,ne,oe,ie,se,me,de,ce,ue,le,pe,fe,we,ye,he,ge,Ae,be,Ee,Se,Ce,ke,Te,_e,Re,De,Me,Ye;return{timezone:e.timezone,currency:e.currency,paymentSettings:{minimumFirstDepositAmount:n(e.minimumFirstDepositAmount),restrictWithdrawalsToVerifiedMembers:e.restrictWithdrawalsToVerifiedMembers,depositGateway:{bank:{androidEnabled:((t=e.bankDepositGatewaySettings)==null?void 0:t.androidEnabled)??!1,iosEnabled:((r=e.bankDepositGatewaySettings)==null?void 0:r.iosEnabled)??!1,webEnabled:((a=e.bankDepositGatewaySettings)==null?void 0:a.webEnabled)??!1,mobileWebEnabled:((m=e.bankDepositGatewaySettings)==null?void 0:m.mobileWebEnabled)??!1,minimumAmount:n((s=e.bankDepositGatewaySettings)==null?void 0:s.minimumAmount),maximumAmount:n((d=e.bankDepositGatewaySettings)==null?void 0:d.maximumAmount)},gcash:{androidEnabled:((c=e.gcashDepositGatewaySettings)==null?void 0:c.androidEnabled)??!1,iosEnabled:((p=e.gcashDepositGatewaySettings)==null?void 0:p.iosEnabled)??!1,webEnabled:((y=e.gcashDepositGatewaySettings)==null?void 0:y.webEnabled)??!1,mobileWebEnabled:((f=e.gcashDepositGatewaySettings)==null?void 0:f.mobileWebEnabled)??!1,minimumAmount:n((D=e.gcashDepositGatewaySettings)==null?void 0:D.minimumAmount),maximumAmount:n((M=e.gcashDepositGatewaySettings)==null?void 0:M.maximumAmount)},maya:{androidEnabled:((v=e.mayaDepositGatewaySettings)==null?void 0:v.androidEnabled)??!1,iosEnabled:((N=e.mayaDepositGatewaySettings)==null?void 0:N.iosEnabled)??!1,webEnabled:((I=e.mayaDepositGatewaySettings)==null?void 0:I.webEnabled)??!1,mobileWebEnabled:((P=e.mayaDepositGatewaySettings)==null?void 0:P.mobileWebEnabled)??!1,minimumAmount:n((g=e.mayaDepositGatewaySettings)==null?void 0:g.minimumAmount),maximumAmount:n((G=e.mayaDepositGatewaySettings)==null?void 0:G.maximumAmount)},mayaApp:{androidEnabled:((O=e.mayaAppDepositGatewaySettings)==null?void 0:O.androidEnabled)??!1,iosEnabled:((T=e.mayaAppDepositGatewaySettings)==null?void 0:T.iosEnabled)??!1,webEnabled:((B=e.mayaAppDepositGatewaySettings)==null?void 0:B.webEnabled)??!1,mobileWebEnabled:((W=e.mayaAppDepositGatewaySettings)==null?void 0:W.mobileWebEnabled)??!1,minimumAmount:n((x=e.mayaAppDepositGatewaySettings)==null?void 0:x.minimumAmount),maximumAmount:n((U=e.mayaAppDepositGatewaySettings)==null?void 0:U.maximumAmount)},onlineBank:{androidEnabled:((_=e.onlineBankDepositGatewaySettings)==null?void 0:_.androidEnabled)??!1,iosEnabled:((q=e.onlineBankDepositGatewaySettings)==null?void 0:q.iosEnabled)??!1,webEnabled:(($=e.onlineBankDepositGatewaySettings)==null?void 0:$.webEnabled)??!1,mobileWebEnabled:((L=e.onlineBankDepositGatewaySettings)==null?void 0:L.mobileWebEnabled)??!1,minimumAmount:n((F=e.onlineBankDepositGatewaySettings)==null?void 0:F.minimumAmount),maximumAmount:n((H=e.onlineBankDepositGatewaySettings)==null?void 0:H.maximumAmount)},qrph:{androidEnabled:((V=e.qrphDepositGatewaySettings)==null?void 0:V.androidEnabled)??!1,iosEnabled:((Y=e.qrphDepositGatewaySettings)==null?void 0:Y.iosEnabled)??!1,webEnabled:((Q=e.qrphDepositGatewaySettings)==null?void 0:Q.webEnabled)??!1,mobileWebEnabled:((j=e.qrphDepositGatewaySettings)==null?void 0:j.mobileWebEnabled)??!1,minimumAmount:n((k=e.qrphDepositGatewaySettings)==null?void 0:k.minimumAmount),maximumAmount:n((Z=e.qrphDepositGatewaySettings)==null?void 0:Z.maximumAmount)}},withdrawalGateway:{bank:{androidEnabled:((ee=e.bankWithdrawalGatewaySettings)==null?void 0:ee.androidEnabled)??!1,iosEnabled:((te=e.bankWithdrawalGatewaySettings)==null?void 0:te.iosEnabled)??!1,webEnabled:((re=e.bankWithdrawalGatewaySettings)==null?void 0:re.webEnabled)??!1,mobileWebEnabled:((ae=e.bankWithdrawalGatewaySettings)==null?void 0:ae.mobileWebEnabled)??!1,minimumAmount:n((ne=e.bankWithdrawalGatewaySettings)==null?void 0:ne.minimumAmount),maximumAmount:n((oe=e.bankWithdrawalGatewaySettings)==null?void 0:oe.maximumAmount)},gcash:{androidEnabled:((ie=e.gcashWithdrawalGatewaySettings)==null?void 0:ie.androidEnabled)??!1,iosEnabled:((se=e.gcashWithdrawalGatewaySettings)==null?void 0:se.iosEnabled)??!1,webEnabled:((me=e.gcashWithdrawalGatewaySettings)==null?void 0:me.webEnabled)??!1,mobileWebEnabled:((de=e.gcashWithdrawalGatewaySettings)==null?void 0:de.mobileWebEnabled)??!1,minimumAmount:n((ce=e.gcashWithdrawalGatewaySettings)==null?void 0:ce.minimumAmount),maximumAmount:n((ue=e.gcashWithdrawalGatewaySettings)==null?void 0:ue.maximumAmount,1e6)},maya:{androidEnabled:((le=e.mayaWithdrawalGatewaySettings)==null?void 0:le.androidEnabled)??!1,iosEnabled:((pe=e.mayaWithdrawalGatewaySettings)==null?void 0:pe.iosEnabled)??!1,webEnabled:((fe=e.mayaWithdrawalGatewaySettings)==null?void 0:fe.webEnabled)??!1,mobileWebEnabled:((we=e.mayaWithdrawalGatewaySettings)==null?void 0:we.mobileWebEnabled)??!1,minimumAmount:n((ye=e.mayaWithdrawalGatewaySettings)==null?void 0:ye.minimumAmount),maximumAmount:n((he=e.mayaWithdrawalGatewaySettings)==null?void 0:he.maximumAmount)},mayaApp:{androidEnabled:((ge=e.mayaAppWithdrawalGatewaySettings)==null?void 0:ge.androidEnabled)??!1,iosEnabled:((Ae=e.mayaAppWithdrawalGatewaySettings)==null?void 0:Ae.iosEnabled)??!1,webEnabled:((be=e.mayaAppWithdrawalGatewaySettings)==null?void 0:be.webEnabled)??!1,mobileWebEnabled:((Ee=e.mayaAppWithdrawalGatewaySettings)==null?void 0:Ee.mobileWebEnabled)??!1,minimumAmount:n((Se=e.mayaAppWithdrawalGatewaySettings)==null?void 0:Se.minimumAmount),maximumAmount:n((Ce=e.mayaAppWithdrawalGatewaySettings)==null?void 0:Ce.maximumAmount,1e6)},instapay:{androidEnabled:((ke=e.instapayWithdrawalGatewaySettings)==null?void 0:ke.androidEnabled)??!1,iosEnabled:((Te=e.instapayWithdrawalGatewaySettings)==null?void 0:Te.iosEnabled)??!1,webEnabled:((_e=e.instapayWithdrawalGatewaySettings)==null?void 0:_e.webEnabled)??!1,mobileWebEnabled:((Re=e.instapayWithdrawalGatewaySettings)==null?void 0:Re.mobileWebEnabled)??!1,minimumAmount:n((De=e.instapayWithdrawalGatewaySettings)==null?void 0:De.minimumAmount),maximumAmount:n((Me=e.instapayWithdrawalGatewaySettings)==null?void 0:Me.maximumAmount,1e6)}}},pointsClubSettings:{multiplier:n((Ye=e.pointsClubSettings)==null?void 0:Ye.multiplier,0)}}}platform__next(e){return{currency:e.currency,timezone:e.timezone,locale:Tr(e.currency)}}pointsClubSettings(e){return{multiplier:n(e.multiplier,0)}}paymentSettings(e){var t,r,a,m,s,d,c,p,y,f,D,M,v,N,I,P,g,G,O,T,B,W,x,U,_,q,$,L,F,H,V,Y,Q,j,k,Z,ee,te,re,ae,ne,oe,ie,se,me,de,ce,ue,le,pe,fe,we,ye,he,ge,Ae,be,Ee,Se,Ce,ke,Te,_e,Re,De,Me;return{minimumFirstDepositAmount:n(e.minimumFirstDepositAmount),restrictWithdrawalsToVerifiedMembers:e.restrictWithdrawalsToVerifiedMembers,depositGateway:{bank:{androidEnabled:((t=e.bankDepositGatewaySettings)==null?void 0:t.androidEnabled)??!1,iosEnabled:((r=e.bankDepositGatewaySettings)==null?void 0:r.iosEnabled)??!1,webEnabled:((a=e.bankDepositGatewaySettings)==null?void 0:a.webEnabled)??!1,mobileWebEnabled:((m=e.bankDepositGatewaySettings)==null?void 0:m.mobileWebEnabled)??!1,minimumAmount:n((s=e.bankDepositGatewaySettings)==null?void 0:s.minimumAmount),maximumAmount:n((d=e.bankDepositGatewaySettings)==null?void 0:d.maximumAmount)},gcash:{androidEnabled:((c=e.gcashDepositGatewaySettings)==null?void 0:c.androidEnabled)??!1,iosEnabled:((p=e.gcashDepositGatewaySettings)==null?void 0:p.iosEnabled)??!1,webEnabled:((y=e.gcashDepositGatewaySettings)==null?void 0:y.webEnabled)??!1,mobileWebEnabled:((f=e.gcashDepositGatewaySettings)==null?void 0:f.mobileWebEnabled)??!1,minimumAmount:n((D=e.gcashDepositGatewaySettings)==null?void 0:D.minimumAmount),maximumAmount:n((M=e.gcashDepositGatewaySettings)==null?void 0:M.maximumAmount)},maya:{androidEnabled:((v=e.mayaDepositGatewaySettings)==null?void 0:v.androidEnabled)??!1,iosEnabled:((N=e.mayaDepositGatewaySettings)==null?void 0:N.iosEnabled)??!1,webEnabled:((I=e.mayaDepositGatewaySettings)==null?void 0:I.webEnabled)??!1,mobileWebEnabled:((P=e.mayaDepositGatewaySettings)==null?void 0:P.mobileWebEnabled)??!1,minimumAmount:n((g=e.mayaDepositGatewaySettings)==null?void 0:g.minimumAmount),maximumAmount:n((G=e.mayaDepositGatewaySettings)==null?void 0:G.maximumAmount)},mayaApp:{androidEnabled:((O=e.mayaAppDepositGatewaySettings)==null?void 0:O.androidEnabled)??!1,iosEnabled:((T=e.mayaAppDepositGatewaySettings)==null?void 0:T.iosEnabled)??!1,webEnabled:((B=e.mayaAppDepositGatewaySettings)==null?void 0:B.webEnabled)??!1,mobileWebEnabled:((W=e.mayaAppDepositGatewaySettings)==null?void 0:W.mobileWebEnabled)??!1,minimumAmount:n((x=e.mayaAppDepositGatewaySettings)==null?void 0:x.minimumAmount),maximumAmount:n((U=e.mayaAppDepositGatewaySettings)==null?void 0:U.maximumAmount)},onlineBank:{androidEnabled:((_=e.onlineBankDepositGatewaySettings)==null?void 0:_.androidEnabled)??!1,iosEnabled:((q=e.onlineBankDepositGatewaySettings)==null?void 0:q.iosEnabled)??!1,webEnabled:(($=e.onlineBankDepositGatewaySettings)==null?void 0:$.webEnabled)??!1,mobileWebEnabled:((L=e.onlineBankDepositGatewaySettings)==null?void 0:L.mobileWebEnabled)??!1,minimumAmount:n((F=e.onlineBankDepositGatewaySettings)==null?void 0:F.minimumAmount),maximumAmount:n((H=e.onlineBankDepositGatewaySettings)==null?void 0:H.maximumAmount)},qrph:{androidEnabled:((V=e.qrphDepositGatewaySettings)==null?void 0:V.androidEnabled)??!1,iosEnabled:((Y=e.qrphDepositGatewaySettings)==null?void 0:Y.iosEnabled)??!1,webEnabled:((Q=e.qrphDepositGatewaySettings)==null?void 0:Q.webEnabled)??!1,mobileWebEnabled:((j=e.qrphDepositGatewaySettings)==null?void 0:j.mobileWebEnabled)??!1,minimumAmount:n((k=e.qrphDepositGatewaySettings)==null?void 0:k.minimumAmount),maximumAmount:n((Z=e.qrphDepositGatewaySettings)==null?void 0:Z.maximumAmount)}},withdrawalGateway:{bank:{androidEnabled:((ee=e.bankWithdrawalGatewaySettings)==null?void 0:ee.androidEnabled)??!1,iosEnabled:((te=e.bankWithdrawalGatewaySettings)==null?void 0:te.iosEnabled)??!1,webEnabled:((re=e.bankWithdrawalGatewaySettings)==null?void 0:re.webEnabled)??!1,mobileWebEnabled:((ae=e.bankWithdrawalGatewaySettings)==null?void 0:ae.mobileWebEnabled)??!1,minimumAmount:n((ne=e.bankWithdrawalGatewaySettings)==null?void 0:ne.minimumAmount),maximumAmount:n((oe=e.bankWithdrawalGatewaySettings)==null?void 0:oe.maximumAmount)},gcash:{androidEnabled:((ie=e.gcashWithdrawalGatewaySettings)==null?void 0:ie.androidEnabled)??!1,iosEnabled:((se=e.gcashWithdrawalGatewaySettings)==null?void 0:se.iosEnabled)??!1,webEnabled:((me=e.gcashWithdrawalGatewaySettings)==null?void 0:me.webEnabled)??!1,mobileWebEnabled:((de=e.gcashWithdrawalGatewaySettings)==null?void 0:de.mobileWebEnabled)??!1,minimumAmount:n((ce=e.gcashWithdrawalGatewaySettings)==null?void 0:ce.minimumAmount),maximumAmount:n((ue=e.gcashWithdrawalGatewaySettings)==null?void 0:ue.maximumAmount,1e6)},maya:{androidEnabled:((le=e.mayaWithdrawalGatewaySettings)==null?void 0:le.androidEnabled)??!1,iosEnabled:((pe=e.mayaWithdrawalGatewaySettings)==null?void 0:pe.iosEnabled)??!1,webEnabled:((fe=e.mayaWithdrawalGatewaySettings)==null?void 0:fe.webEnabled)??!1,mobileWebEnabled:((we=e.mayaWithdrawalGatewaySettings)==null?void 0:we.mobileWebEnabled)??!1,minimumAmount:n((ye=e.mayaWithdrawalGatewaySettings)==null?void 0:ye.minimumAmount),maximumAmount:n((he=e.mayaWithdrawalGatewaySettings)==null?void 0:he.maximumAmount)},mayaApp:{androidEnabled:((ge=e.mayaAppWithdrawalGatewaySettings)==null?void 0:ge.androidEnabled)??!1,iosEnabled:((Ae=e.mayaAppWithdrawalGatewaySettings)==null?void 0:Ae.iosEnabled)??!1,webEnabled:((be=e.mayaAppWithdrawalGatewaySettings)==null?void 0:be.webEnabled)??!1,mobileWebEnabled:((Ee=e.mayaAppWithdrawalGatewaySettings)==null?void 0:Ee.mobileWebEnabled)??!1,minimumAmount:n((Se=e.mayaAppWithdrawalGatewaySettings)==null?void 0:Se.minimumAmount),maximumAmount:n((Ce=e.mayaAppWithdrawalGatewaySettings)==null?void 0:Ce.maximumAmount,1e6)},instapay:{androidEnabled:((ke=e.instapayWithdrawalGatewaySettings)==null?void 0:ke.androidEnabled)??!1,iosEnabled:((Te=e.instapayWithdrawalGatewaySettings)==null?void 0:Te.iosEnabled)??!1,webEnabled:((_e=e.instapayWithdrawalGatewaySettings)==null?void 0:_e.webEnabled)??!1,mobileWebEnabled:((Re=e.instapayWithdrawalGatewaySettings)==null?void 0:Re.mobileWebEnabled)??!1,minimumAmount:n((De=e.instapayWithdrawalGatewaySettings)==null?void 0:De.minimumAmount),maximumAmount:n((Me=e.instapayWithdrawalGatewaySettings)==null?void 0:Me.maximumAmount,1e6)}}}}account(e){const t={id:e.id,name:e.name,status:e.status,verified:e.verified,nickName:e.nickName??void 0,realName:e.realName??void 0,dateOfBirth:e.birthDay?new Date(e.birthDay):void 0,emailAddress:e.emailAddress??void 0,mobileNumber:e.mobileNumber??void 0,mobileNumberVerified:e.mobileNumberVerified??!1,mobileNumberVerificationRequired:e.mobileNumberVerificationRequired??!1,validId:e.validId||void 0,verificationStatus:e.verificationStatus,transactionPassword:e.transactionPassword,secretAnswerSubmitted:e.secretAnswerSubmitted??!1,dateTimeCreated:new Date(e.dateTimeCreated),dateTimeLastUpdated:new Date(e.dateTimeLastUpdated)};return C(t)}wallet(e){return{id:e.id,balance:n(e.balance,0),currency:e.currency,dateTimeCreated:new Date(e.dateTimeCreated),dateTimeLastUpdated:new Date(e.dateTimeLastUpdated)}}verificationDetails(e){return{id:e.id,status:e.status,address:e.address,permanentAddress:e.permanentAddress,nationality:e.nationality,natureOfWork:e.natureOfWork,placeOfBirth:e.placeOfBirth,sourceOfIncome:e.sourceOfIncome,selfieImage:this.file(e.selfieImage),idFrontImage:this.file(e.idFrontImage)}}profileCompletion(e){return{accountPassword:e.accountPassword??!1,accountVerification:e.accountVerification??!1,mobileNumberVerification:e.mobileNumberVerification??!1,personalInformation:e.personalInformation??!1,transactionPassword:e.transactionPassword??!1,completionPercentage:n(e.completionPercentage,0)}}announcement(e){return{id:e.id,type:e.type,title:e.title,status:e.status,message:e.message,activationEndDateTime:new Date(e.activationEndDateTime),activationStartDateTime:new Date(e.activationStartDateTime),dateTimeCreated:new Date(e.dateTimeCreated),dateTimeLastUpdated:new Date(e.dateTimeLastUpdated)}}withdrawalRecord(e){const t={id:e.id,type:e.type,bank:e.bank,status:e.status,amount:n(e.amount,0),netAmount:n(e.netAmount,0),fee:n(e.fee,0),reference:e.reference??void 0,error:e.error??void 0,withdrawalNumber:e.withdrawalNumber,recipientMobileNumber:e.recipientMobileNumber??void 0,dateTimeConfirmed:e.dateTimeConfirmed?new Date(e.dateTimeConfirmed):void 0,dateTimeCreated:new Date(e.dateTimeCreated),dateTimeLastUpdated:new Date(e.dateTimeLastUpdated)};return C(t)}deposit(e){const t={id:e.id,type:e.type,status:e.status,vca:e.vca??void 0,qrCode:e.qrCode??void 0,checkoutUrl:e.checkoutUrl??void 0};return C(t)}depositRecord(e){const t={id:e.id,type:e.type,status:e.status,amount:n(e.amount,0),fee:n(e.fee,0),netAmount:n(e.netAmount,0),reference:e.reference??void 0,depositNumber:e.depositNumber,dateTimeCreated:new Date(e.dateTimeCreated),dateTimeLastUpdated:new Date(e.dateTimeLastUpdated),error:e.error??void 0};return C(t)}betRecord(e){var r;const t={id:e.id,bet:n(e.bet,0),payout:n(e.payout,0),status:e.status,jackpotContribution:n(e.jackpotContribution,0),jackpotPayout:n(e.jackpotPayout,0),winloss:n(e.winloss),validBet:n(e.validBet,0),vendorRoundId:e.vendorRoundId??void 0,game:e.game?this.game(e.game):void 0,serialCode:e.serialCode,dateTimeSettled:e.dateTimeSettled?new Date(e.dateTimeSettled):void 0,dateTimeCreated:new Date(e.dateTimeCreated),dateTimeLastUpdated:new Date(e.dateTimeLastUpdated),betContent:e.betContent??void 0,contestName:e.contestName??void 0,externalCategory:e.externalCategory??void 0,metadata:{odds:((r=e.metadata)==null?void 0:r.odds)??void 0}};return C(t)}latestBetRecord(e){return{id:e.id,member:e.member,game:e.game?this.game(e.game):void 0,bet:n(e.bet,0),payout:n(e.payout,0),validBet:n(e.validBet,0),dateTimeSettled:new Date(e.dateTimeSettled),dateTimeCreated:new Date(e.dateTimeCreated)}}transactionRecord(e){const t={id:e.id,type:e.type,amount:n(e.amount,0),content:e.content??void 0,currentBalance:n(e.currentBalance,0),referenceNumber:e.referenceNumber,dateTimeCreated:new Date(e.dateTimeCreated)};return C(t)}game(e){return{id:e.id,type:e.type,tags:e.tags??[],name:e.name,images:[e.customImage,e.image].filter(Boolean),provider:e.provider,reference:e.reference}}gameSession(e){const t={id:e.id,status:e.status,launchUrl:e.launchUrl??void 0,dateTimeCreated:new Date(e.dateTimeCreated),dateTimeLastUpdated:new Date(e.dateTimeLastUpdated)};return C(t)}promo(e){return{id:e.id,type:e.type,name:e.name,status:e.status,description:e.description,banner:e.banner?this.file(e.banner):null,maximumBonusAmount:n(e.maximumBonusAmount),minimumBonusAmount:n(e.minimumBonusAmount),maximumDepositAmount:n(e.maximumDepositAmount),minimumDepositAmount:n(e.minimumDepositAmount),activationEndDateTime:new Date(e.activationEndDateTime),activationStartDateTime:new Date(e.activationStartDateTime),dateTimeCreated:new Date(e.dateTimeCreated),dateTimeLastUpdated:new Date(e.dateTimeLastUpdated)}}cashback(e){return{id:e.id,name:e.name,description:e.description,status:e.status,minimumCashback:n(e.minimumCashback,0),maximumMonthlyCashback:n(e.maximumMonthlyCashback),banner:e.banner?this.file(e.banner):null,activationEndDateTime:new Date(e.activationEndDateTime),activationStartDateTime:new Date(e.activationStartDateTime),dateTimeCreated:new Date(e.dateTimeCreated),dateTimeLastUpdated:new Date(e.dateTimeLastUpdated),turnoverContributionPercentagePerGameProvider:Object.entries(e.turnoverContributionPercentagePerGameProvider).reduce((r,[a,m])=>(r[a]=n(m,0),r),{})}}bonus(e){const t={id:e.id,promo:this.promo(e.promo),deposit:e.deposit?{type:e.deposit.type,status:e.deposit.status,fee:n(e.deposit.fee,0),amount:n(e.deposit.amount,0),netAmount:n(e.deposit.netAmount,0),reference:e.deposit.reference??void 0,dateTimeCreated:new Date(e.deposit.dateTimeCreated),dateTimeLastUpdated:new Date(e.deposit.dateTimeLastUpdated)}:void 0,balance:n(e.balance,0),amount:n(e.amount,0),expiration:new Date(e.expiration),turnoverRequirement:n(e.turnoverRequirement,0),currentTurnoverRequirementContribution:n(e.currentTurnoverRequirementContribution,0),currentTurnoverRequirementContributionPercentage:n(e.currentTurnoverRequirementContributionPercentage,0),dateTimeCreated:new Date(e.dateTimeCreated),dateTimeLastUpdated:new Date(e.dateTimeLastUpdated)};return C(t)}cashbackBonus(e){return{id:e.id,total:n(e.total,0),balance:n(e.balance,0),cashback:this.cashback(e.cashback),dateTimeCreated:new Date(e.dateTimeCreated),dateTimeLastUpdated:new Date(e.dateTimeLastUpdated)}}file(e){const t={id:e.id,url:e.url??void 0,status:e.status,dateTimeCreated:new Date(e.dateTimeCreated)};return C(t)}pointsWallet(e){return{id:e.id,points:n(e.points,0),account:e.account,dateTimeCreated:new Date(e.dateTimeCreated)}}pointsWalletTransaction(e){return{id:e.id,type:e.type,amount:n(e.amount,0),balance:n(e.balance,0),dateTimeCreated:new Date(e.dateTimeCreated)}}activityRecord(e){const t={id:e.id,type:e.type,amount:e.amount?n(e.amount,0):void 0,domain:e.domain??void 0,details:e.details,dateTimeCreated:new Date(e.dateTimeCreated)};return C(t)}referral(e){return{id:e.id,level:e.level,upline:e.upline,downline:e.downline,turnover:n(e.turnover,0),commission:n(e.commission,0),dateTimeCreated:new Date(e.dateTimeCreated)}}referralCommission(e){return{id:e.id,commission:n(e.commission,0),level1Commission:n(e.level1Commission,0),level2Commission:n(e.level2Commission,0),level3Commission:n(e.level3Commission,0),referralsCount:e.referralsCount,level1ReferralsCount:e.level1ReferralsCount,level2ReferralsCount:e.level2ReferralsCount,level3ReferralsCount:e.level3ReferralsCount,referralCode:e.referralCode,dateTimeCreated:new Date(e.dateTimeCreated),dateTimeLastUpdated:new Date(e.dateTimeLastUpdated)}}message(e){return{id:e.id,icon:e.icon,logo:e.logo,image:e.image,title:e.title,popup:e.popup,content:e.content,actions:e.actions,markedAsRead:e.markedAsRead,dateTimeCreated:new Date(e.dateTimeCreated)}}instapayBank(e){return e}promoByCode(e){return{activeBonusesCount:e.activeBonusesCount,bonusesCount:e.bonusesCount,cancelledBonusesCount:e.cancelledBonusesCount,clearedBonusesCount:e.clearedBonusesCount,closedBonusesCount:e.closedBonusesCount,closedBonusesCountPercentage:n(e.closedBonusesCountPercentage,0),code:e.code,daysToClear:e.daysToClear,enabledGameProviders:e.enabledGameProviders,id:e.id,expiredBonusesCount:e.expiredBonusesCount,maximumBonusesCountLimit:e.maximumBonusesCountLimit,name:e.name,status:e.status,totalBet:n(e.totalBet,0),totalBonus:n(e.totalBonus,0),totalBonusBalance:n(e.totalBonusBalance,0),totalBonusCashedOut:n(e.totalBonusCashedOut,0),totalDeposit:n(e.totalDeposit,0),turnoverRequirementMultiplier:n(e.turnoverRequirementMultiplier,0),type:e.type,zeroedOutBonusesCount:e.zeroedOutBonusesCount,zeroOutThreshold:n(e.zeroOutThreshold,0),bonusAmount:n(e.bonusAmount,0),description:e.description,turnoverRequirementType:e.turnoverRequirementType,activationEndDateTime:e.activationEndDateTime?new Date(e.activationEndDateTime):void 0,activationStartDateTime:e.activationStartDateTime?new Date(e.activationStartDateTime):void 0,dateTimeClosed:e.dateTimeClosed?new Date(e.dateTimeClosed):void 0,dateTimeLastUpdated:new Date(e.dateTimeLastUpdated),dateTimeCreated:new Date(e.dateTimeCreated),turnoverRequirementContributionPercentagePerGameProvider:Object.entries(e.turnoverRequirementContributionPercentagePerGameProvider).reduce((t,[r,a])=>(t[r]=n(a,0),t),{}),minimumTicketOddFactorPerSportsGameProvider:Object.entries(e.minimumTicketOddFactorPerSportsGameProvider).reduce((t,[r,a])=>(t[r]=n(a,0),t),{}),banner:e.banner}}}class Mr{constructor(e){u(this,"cmsPortalService");u(this,"authService");u(this,"gameService");u(this,"fileService");u(this,"walletService");u(this,"accountService");u(this,"reportService");u(this,"portalService");u(this,"triggerService");u(this,"sessionManager");u(this,"transformer");u(this,"logger");u(this,"cache");const{site:t,sitePlatform:r,platform:a,environment:m,logs:s}=e,d=m==="production";this.transformer=new Dr,this.logger=new Fe({enabled:s??!1});const c=d?"https://auth.opexa.io":"https://auth.development.opexa.io",p=d?"https://wallet.opexa.io/graphql":"https://wallet.development.opexa.io/graphql",y=d?"https://report.opexa.io/graphql":"https://report.development.opexa.io/graphql",f=d?"https://account.opexa.io/graphql":"https://account.development.opexa.io/graphql",D=d?"https://portal.opexa.io/graphql":"https://portal.development.opexa.io/graphql",M=d?"https://file.opexa.io/graphql":"https://file.development.opexa.io/graphql",v=d?"https://game.opexa.io/graphql":"https://game.development.opexa.io/graphql",N=d?"https://trigger.opexa.io/graphql":"https://trigger.development.opexa.io/graphql",I="https://portal-api.opexacms.io/v1",P=new pr({url:I,site:t,platform:r}),g={middlewares:[this.authMiddleware],fetchOptions:{headers:{Role:"MEMBER","Platform-Code":a}}},G=new wr(new z(v,g)),O=new fr(new z(M,g)),T=new Ar(new z(p,g)),B=new ur(new z(f,g)),W=new hr(new z(y,g)),x=new yr(new z(D,g)),U=new gr(new z(N,g)),_=new lr({url:c,platform:a}),q=new Rr({logs:s,authService:_,walletService:T});this.authService=_,this.gameService=G,this.fileService=O,this.walletService=T,this.accountService=B,this.reportService=W,this.portalService=x,this.triggerService=U,this.sessionManager=q,this.cmsPortalService=P,this.cache=new br}get authMiddleware(){return async e=>{this.logger.info("Checking for session");const t=await this.sessionManager.get();return t.data?(e.headers.append("Authorization",`Bearer ${t.data.accessToken}`),this.logger.info("Session found"),this.logger.success("Added 'Authorization' header")):this.logger.info("No session found"),e}}get locale(){return new Promise(e=>{const t="locale",r=this.cache.get(t);if(r)return e(r);this.platform__next().then(a=>{a.ok?(this.cache.set(t,a.data.locale),e(a.data.locale)):(this.logger.warn("Failed to fetch currency. Using 'PH' as fallback"),e("en-PH"))})})}async signIn(e){switch(e.type){case"NAME_AND_PASSWORD":{const t=await this.sessionManager.create({...e,password:await S(e.password)});return t.ok?t.data?{ok:!0,data:{"2FAEnabled":!0,authenticator:t.data.authenticator}}:{ok:!0,data:{"2FAEnabled":!1}}:t}case"TOKEN":{const t=await this.sessionManager.create({type:"TOKEN",token:e.token});return t.ok?{ok:!0}:t}case"MOBILE_NUMBER":{const t=await this.sessionManager.create({type:"MOBILE_NUMBER",mobileNumber:R(e.mobileNumber,await this.locale),verificationCode:e.verificationCode,reCAPTCHAResponse:e.reCAPTCHAResponse});return t.ok?{ok:!0}:t}default:{const t=await this.sessionManager.create(e);return t.ok?{ok:!0}:t}}}async authenticate(e){switch(e.type){case"SECURITY_QUESTION":return await this.sessionManager.createFromAuthenticator({type:"SECURITY_QUESTION",token:e.token,secretAnswer:await S(e.secretAnswer)});default:return{ok:!1,error:{name:"HttpBadRequest",message:"Invalid input 'type'"}}}}async signOut(){await this.sessionManager.destroy()}watchSession(e){const t=Er(e.interval??3e4,3e4,6e4);let r=null;const a=()=>setTimeout(async()=>{await this.sessionManager.verify()||await e.onInvalid(),r=a()},t);return r=a(),function(){r&&clearTimeout(r)}}async session(){const e=await this.sessionManager.get();return e.ok?{ok:!0,data:e.data?{id:e.data.session.id,dateTimeCreated:new Date(e.data.session.dateTimeCreated)}:null}:e}async validateMayaSession(){return await this.walletService.validateMayaSession()}async site(){const e=await this.cmsPortalService.self();return e.ok?{ok:!0,data:this.transformer.transform.site(e.data)}:e}async platform(){const e=await this.accountService.platform();return e.ok?{ok:!0,data:this.transformer.transform.platform(e.data)}:e}async platform__next(){const e=await this.portalService.platform();return e.ok?{ok:!0,data:this.transformer.transform.platform__next(e.data)}:e}async paymentSettings(){const e=await this.accountService.paymentSettings();return e.ok?{ok:!0,data:this.transformer.transform.paymentSettings(e.data)}:e}async account(){const e=await this.accountService.memberAccount();return e.ok?{ok:!0,data:this.transformer.transform.account(e.data)}:e}async createAccount(e){const t=e.id??w.ObjectId.generate(b.Account).toString(),r=await this.accountService.registerMemberAccount({input:{id:t,btag:e.btag,name:e.name,domain:e.domain,birthDay:typeof e.dateOfBirth=="string"?e.dateOfBirth:this.formatYmd(e.dateOfBirth),password:await S(e.password),mobileNumber:R(e.mobileNumber,await this.locale)},referralCode:e.referralCode,verificationCode:e.verificationCode,reCAPTCHAResponse:e.reCAPTCHAResponse});return r.ok?{ok:!0,data:{id:t}}:r}async createAccount__next(e){const t=e.id??w.ObjectId.generate(b.Account).toString();if(e.type==="MOBILE_NUMBER"){const a=await this.accountService.registerMemberAccountViaMobile({input:{id:t,btag:e.btag,domain:e.domain,mobileNumber:R(e.mobileNumber,await this.locale)},referralCode:e.referralCode,verificationCode:e.verificationCode,reCAPTCHAResponse:e.reCAPTCHAResponse});return a.ok?{ok:!0,data:{id:t}}:a}const r=await this.accountService.registerMemberAccount__next({input:{id:t,name:e.name,btag:e.btag,domain:e.domain,password:await S(e.password),mobileNumber:e.mobileNumber?R(e.mobileNumber,await this.locale):void 0},reCAPTCHAResponse:e.reCAPTCHAResponse});return r.ok?{ok:!0,data:{id:t}}:r}async registerMayaAccount(e){return await this.accountService.registerMayaMemberAccount({input:{name:e.name,password:await S(e.password),domain:e.domain}})}async updateAccount(e,t){const{password:r,dateOfBirth:a,mobileNumber:m,secretAnswer:s,transactionPassword:d,...c}=t;return await this.accountService.updateMemberAccount({input:{id:e,data:{...c,password:r?await S(r):void 0,transactionPassword:d?await S(d):void 0,mobileNumber:m?R(m,await this.locale):void 0,secretAnswer:s?await S(s):void 0,birthDay:a?typeof a=="string"?a:this.formatYmd(a):void 0}}})}async deleteAccount(e){return await this.accountService.deleteMemberAccount({input:{id:e}})}async verificationDetails(){const e=await this.accountService.memberVerification();return e.ok?{ok:!0,data:e.data?this.transformer.transform.verificationDetails(e.data):null}:e}async submitVerificationDetails(e){const t=e.id??w.ObjectId.generate(b.Verification).toString(),r=await this.accountService.createMemberVerification({input:{id:t,...e}});return r.ok?{ok:!0,data:{id:t}}:r}async updateVerificationDetails(e,t){return await this.accountService.updateMemberVerification({input:{id:e,data:{...t}}})}async resetPassword(e){return await this.accountService.resetPassword({input:{mobileNumber:R(e.mobileNumber,await this.locale),newPassword:await S(e.newPassword)},verificationCode:e.verificationCode})}async verifyMobileNumber(e){return await this.accountService.verifyMobileNumber({input:{verificationCode:e}})}async profileCompletion(){const e=await this.accountService.profileCompletion();return e.ok?{ok:!0,data:this.transformer.transform.profileCompletion(e.data)}:e}async sendVerificationCode(e){return await this.accountService.sendVerificationCode({input:{channel:"SMS",recipient:R(e,await this.locale)}})}async sendVerificationCode__next(e){if(e.type==="SMS")return this.authService.sendVerificationCode({channel:"SMS",recipient:R(e.mobileNumber,await this.locale),...e.strict&&{verificationType:"MEMBER"}});throw new Error("'Email' verification code is not yet supported")}async wallet(){const e=await this.walletService.wallet();return e.ok?{ok:!0,data:e.data?this.transformer.transform.wallet(e.data):null}:e}async announcements(e){const t=await this.accountService.announcements({...e,filter:{...e==null?void 0:e.filter,visibility:{in:["MEMBER","GLOBAL"]}}});return t.ok?{ok:!0,data:{announcements:t.data.edges.map(({cursor:r,node:a})=>({...this.transformer.transform.announcement(a),cursor:r})),totalCount:t.data.totalCount,endCursor:t.data.pageInfo.endCursor??void 0,hasNextPage:t.data.pageInfo.hasNextPage}}:t}async createWithdrawal(e){const t=e.id??w.ObjectId.generate(b.Withdrawal).toString();if(e.type==="BANK"){const r=await this.walletService.createBankWithdrawal({input:{id:t,amount:e.amount.toString(),transactionPassword:await S(e.transactionPassword)},reCAPTCHAResponse:e.reCAPTCHAResponse});if(!r.ok)return r}if(e.type==="GCASH"){const r=await this.walletService.createGCashWithdrawal({input:{id:t,amount:e.amount.toString(),transactionPassword:await S(e.transactionPassword),recipientMobileNumber:R(e.recipientMobileNumber,await this.locale)},reCAPTCHAResponse:e.reCAPTCHAResponse});if(!r.ok)return r}if(e.type==="MAYA"){const r=await this.walletService.createMayaWithdrawal({input:{id:t,amount:e.amount.toString(),transactionPassword:await S(e.transactionPassword),recipientMobileNumber:R(e.recipientMobileNumber,await this.locale)},reCAPTCHAResponse:e.reCAPTCHAResponse});if(!r.ok)return r}if(e.type==="MAYA_APP"){const r=await this.walletService.createMayaAppWithdrawal({input:{id:t,amount:e.amount.toString(),transactionPassword:await S(e.transactionPassword)},reCAPTCHAResponse:e.reCAPTCHAResponse});if(!r.ok)return r}if(e.type==="AIO_INSTAPAY"){const r=await this.walletService.createAIOInstapayWithdrawal({input:{id:t,amount:e.amount.toString(),bankCode:e.bankCode,accountNumber:e.accountNumber,transactionPassword:await S(e.transactionPassword)},reCAPTCHAResponse:e.reCAPTCHAResponse});if(!r.ok)return r}return{ok:!0,data:{id:t}}}async withdrawalRecords(e){const t=await this.reportService.withdrawalRecords(e);return t.ok?{ok:!0,data:{withdrawalRecords:t.data.edges.map(({cursor:r,node:a})=>({...this.transformer.transform.withdrawalRecord(a),cursor:r})),totalCount:t.data.totalCount,endCursor:t.data.pageInfo.endCursor??void 0,hasNextPage:t.data.pageInfo.hasNextPage}}:t}async remainingDailyWithdrawalsCount(){return await this.walletService.remainingDailyWithdrawalsCount()}async instapayBankList(){const e=await this.walletService.instapayBankList();return e.ok?{ok:!0,data:e.data.map(this.transformer.transform.instapayBank)}:e}async createDeposit(e){const t=e.id??w.ObjectId.generate(b.Deposit).toString();if(e.type==="MAYA"){const r=await this.walletService.createMayaDeposit({input:{id:t,amount:e.amount.toString(),promo:e.promo},reCAPTCHAResponse:e.reCAPTCHAResponse});if(!r.ok)return r}if(e.type==="MAYA_APP"){const r=await this.walletService.createMayaAppDeposit({input:{id:t,amount:e.amount.toString(),promo:e.promo},reCAPTCHAResponse:e.reCAPTCHAResponse});if(!r.ok)return r}if(e.type==="GCASH"){const r=await this.walletService.createGCashDeposit({input:{id:t,amount:e.amount.toString(),promo:e.promo},reCAPTCHAResponse:e.reCAPTCHAResponse});if(!r.ok)return r}if(e.type==="AIO_ONLINE_BANK"){const r=await this.walletService.createAIOOnlineBankDeposit({input:{id:t,amount:e.amount.toString(),promo:e.promo},reCAPTCHAResponse:e.reCAPTCHAResponse});if(!r.ok)return r}if(e.type==="AIO_QRPH"){const r=await this.walletService.createAIOQRPHDeposit({input:{id:t,amount:e.amount.toString(),promo:e.promo},reCAPTCHAResponse:e.reCAPTCHAResponse});if(!r.ok)return r}return{ok:!0,data:{id:t}}}async deposit(e){const t=await this.walletService.deposit({id:e});return t.ok?{ok:!0,data:t.data?this.transformer.transform.deposit(t.data):null}:t}async depositRecords(e){const t=await this.reportService.depositRecords(e);return t.ok?{ok:!0,data:{depositRecords:t.data.edges.map(({cursor:r,node:a})=>({...this.transformer.transform.depositRecord(a),cursor:r})),totalCount:t.data.totalCount,endCursor:t.data.pageInfo.endCursor??void 0,hasNextPage:t.data.pageInfo.hasNextPage}}:t}async depositsCount(){return await this.reportService.depositsCount()}async betRecords(e){const t=await this.reportService.betRecords({...e,...(e==null?void 0:e.filter)&&{filter:{...e.filter.status&&{status:e.filter.status},...e.filter.serialCode&&{serialCode:e.filter.serialCode},...e.filter.vendorRoundId&&{vendorRoundId:e.filter.vendorRoundId},...e.filter.gameType&&{game__type:e.filter.gameType},...e.filter.gameProvider&&{game__provider:e.filter.gameProvider},...e.filter.dateTimeCreated&&{dateTimeCreated:e.filter.dateTimeCreated}}}});if(!t.ok)return t;const r=[...new Set(t.data.edges.map(m=>m.node.game.id))];if(r.length<=0)return{ok:!0,data:{betRecords:[],totalCount:0,endCursor:void 0,hasNextPage:!1}};const a=await this.cmsPortalService.games({filter:{reference:{in:r}}});return a.ok?{ok:!0,data:{betRecords:t.data.edges.map(({cursor:m,node:s})=>{var c;const d=(c=a.data.edges.find(p=>s.game.id===p.node.reference))==null?void 0:c.node;return{...this.transformer.transform.betRecord({...s,game:d}),cursor:m}}),totalCount:t.data.totalCount,endCursor:t.data.pageInfo.endCursor??void 0,hasNextPage:t.data.pageInfo.hasNextPage}}:a}async latestBetRecords(){const e=await this.portalService.latestBetRecords();if(!e.ok)return e;const t=[...new Set(e.data.map(a=>a.game.id))];if(t.length<=0)return{ok:!0,data:[]};const r=await this.cmsPortalService.games({filter:{reference:{in:t}}});return r.ok?{ok:!0,data:e.data.map(a=>{var s;const m=(s=r.data.edges.find(d=>d.node.reference===a.game.id))==null?void 0:s.node;return this.transformer.transform.latestBetRecord({...a,game:m})})}:r}async transactionRecords(e){const t=await this.reportService.transactionRecords(e);return t.ok?{ok:!0,data:{transactionRecords:t.data.edges.map(({cursor:r,node:a})=>({...this.transformer.transform.transactionRecord(a),cursor:r})),totalCount:t.data.totalCount,endCursor:t.data.pageInfo.endCursor??void 0,hasNextPage:t.data.pageInfo.hasNextPage}}:t}async promos(){const e=await this.walletService.promos();return e.ok?{ok:!0,data:e.data.map(this.transformer.transform.promo)}:e}async availablePromos(){const e=await this.walletService.availablePromos();return e.ok?{ok:!0,data:e.data.map(this.transformer.transform.promo)}:e}async cashbacks(){const e=await this.walletService.cashbacks();return e.ok?{ok:!0,data:e.data.map(this.transformer.transform.cashback)}:e}async bonus(){const e=await this.walletService.bonus();return e.ok?{ok:!0,data:e.data?this.transformer.transform.bonus(e.data):null}:e}async cashbackBonuses(){const e=await this.walletService.cashbackBonuses();return e.ok?{ok:!0,data:e.data.map(this.transformer.transform.cashbackBonus)}:e}async claimCashbackBonus(e){return await this.walletService.claimCashbackBonus({input:{id:e}})}async claimSpotBonus(e){return await this.walletService.claimSpotBonus({code:e})}async promoByCode(e){const t=await this.reportService.promoByCode({code:e});return t.ok?{ok:!0,data:this.transformer.transform.promoByCode(t.data)}:t}async game(e){const t=await this.cmsPortalService.game(e);return t.ok?{ok:!0,data:t.data?this.transformer.transform.game(t.data):null}:t}async games(e){const t=await this.cmsPortalService.games(e);return t.ok?{ok:!0,data:{games:t.data.edges.map(({cursor:r,node:a})=>({...this.transformer.transform.game(a),cursor:r})),totalCount:t.data.totalCount,hasNextPage:t.data.pageInfo.hasNextPage,endCursor:t.data.pageInfo.endCursor??void 0}}:t}async recommendedGames(e){const t=await this.portalService.recommendedGames();if(!t.ok)return t;const r=[...new Set(t.data.map(m=>m.id))];if(r.length<=0)return{ok:!0,data:{games:[],totalCount:0,hasNextPage:!1,endCursor:void 0}};const a=await this.cmsPortalService.games({first:e==null?void 0:e.first,after:e==null?void 0:e.after,filter:{reference:{in:r}}});return a.ok?{ok:!0,data:{games:a.data.edges.map(({cursor:m,node:s})=>({...this.transformer.transform.game(s),cursor:m})),totalCount:a.data.totalCount,hasNextPage:a.data.pageInfo.hasNextPage,endCursor:a.data.pageInfo.endCursor??void 0}}:a}async gameSession(e){const t=await this.walletService.gameSession({id:e});if(!t.ok)return t;if(t.data)return{ok:!0,data:this.transformer.transform.gameSession(t.data)};const r=await this.gameService.gameSession({id:e});return r.ok?{ok:!0,data:r.data?this.transformer.transform.gameSession(r.data):null}:r}async createGameSession(e){const t=e.id??w.ObjectId.generate(b.GameSession).toString();if(e.game.startsWith("SPORTS:")){const p=await w.ObjectId.generateFromKey(b.Game,e.game).then(f=>f.toString()),y=await this.gameService.createGameSession({input:{id:t,game:p}});return y.ok?{ok:!0,data:{id:t}}:y}const a=await this.game(e.game);if(!a.data)return{ok:!1,error:{name:"GameDoesNotExistError",message:"Game does not exist"}};const{provider:m,reference:s}=a.data,c=["RTG","DARWIN","DRBINGO","MEGABALL","EVOLUTION","EVOLUTION_NETENT","EVOLUTION_REDTIGER","HOLLYWOODTV"].includes(m)?await this.walletService.createGameSession({input:{id:t,game:s}}):await this.gameService.createGameSession({input:{id:t,game:s}});return c.ok?{ok:!0,data:{id:t}}:c}async endGameSession(e){const t=await this.walletService.endGameSession({input:{id:e}});return t.ok?t:await this.gameService.endGameSession({input:{id:e}})}async file(e){const t=await this.fileService.file({id:e});return t.ok?{ok:!0,data:t.data?this.transformer.transform.file(t.data):null}:t}async uploadImageFile(e){const t=e.id??w.ObjectId.generate(b.File).toString(),r=await this.fileService.uploadPrivateImageFile({input:{id:t,file:e.file}});return r.ok?{ok:!0,data:{id:t}}:r}async pointsWallet(){const e=await this.walletService.pointsWallet();return e.ok?{ok:!0,data:e.data?this.transformer.transform.pointsWallet(e.data):null}:e}async redeemPoints(e){return await this.walletService.redeemPointsToCash({input:{amount:e.amount.toString()}})}async pointsWalletTransactions(e){const t=await this.reportService.pointsWalletTransactions(e);return t.ok?{ok:!0,data:{pointsWalletTransactions:t.data.edges.map(({cursor:r,node:a})=>({...this.transformer.transform.pointsWalletTransaction(a),cursor:r})),totalCount:t.data.totalCount,hasNextPage:t.data.pageInfo.hasNextPage,endCursor:t.data.pageInfo.endCursor??void 0}}:t}async activityRecords(e){const t=await this.reportService.activityRecords(e);return t.ok?{ok:!0,data:{activityRecords:t.data.edges.map(({cursor:r,node:a})=>({...this.transformer.transform.activityRecord(a),cursor:r})),totalCount:t.data.totalCount,hasNextPage:t.data.pageInfo.hasNextPage,endCursor:t.data.pageInfo.endCursor??void 0}}:t}async referralCode(){const e=await this.accountService.referralCode();return e.ok?{ok:!0,data:e.data??null}:e}async updateReferralCode(e){return await this.accountService.updateReferralCode({input:e})}async referrals(e){const t=await this.reportService.referrals(e);return t.ok?{ok:!0,data:{referrals:t.data.edges.map(({cursor:r,node:a})=>({...this.transformer.transform.referral(a),cursor:r})),totalCount:t.data.totalCount,hasNextPage:t.data.pageInfo.hasNextPage,endCursor:t.data.pageInfo.endCursor??void 0}}:t}async referralCommission(){const e=await this.reportService.referralCommission();return e.ok?{ok:!0,data:e.data?this.transformer.transform.referralCommission(e.data):null}:e}async uplinesByName(e){const t=await this.reportService.uplinesByName(e);return t.ok?{ok:!0,data:t.data.map(this.transformer.transform.referral)}:t}async downlinesByName(e){const t=await this.reportService.downlinesByName(e);return t.ok?{ok:!0,data:t.data.map(this.transformer.transform.referral)}:t}async pointsClubSettings(){const e=await this.accountService.pointsClubSettings();return e.ok?{ok:!0,data:e.data?this.transformer.transform.pointsClubSettings(e.data):null}:e}async messages(e){const t=await this.triggerService.messages(e);return t.ok?{ok:!0,data:{messages:t.data.edges.map(({cursor:r,node:a})=>({...this.transformer.transform.message(a),cursor:r})),totalCount:t.data.totalCount,hasNextPage:t.data.pageInfo.hasNextPage,endCursor:t.data.pageInfo.endCursor??void 0}}:t}async unreadMessagesCount(e){return await this.triggerService.unreadMessagesCount(e)}async markMessageAsRead(e){return await this.triggerService.markMessageAsRead({id:e})}async markAllMessageAsRead(){return await this.triggerService.markAllMessageAsRead()}async claimReward(e){return await this.triggerService.claimReward({id:e})}async bonuses(){const e=await this.walletService.bonuses();return e.ok?{ok:!0,data:e.data.map(this.transformer.transform.bonus)}:e}formatYmd(e){const t=s=>s.toString().padStart(2,"0"),r=e.getFullYear(),a=t(e.getMonth()+1),m=t(e.getDate());return`${r}-${a}-${m}`}async onboardingStatus(){const e=await this.portalService.onboardingStatus();return e.ok?{ok:!0,data:e.data}:e}async completeOnboarding(e){return await this.portalService.completeOnboarding({input:{favoriteGameTypes:e.favoriteGameTypes,playerExperience:e.playerExperience}})}async skipOnboarding(){return await this.portalService.skipOnboarding()}}Object.defineProperty(A,"ObjectId",{enumerable:!0,get:()=>w.ObjectId}),A.ObjectType=b,A.Sdk=Mr,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
|
|
1472
1481
|
//# sourceMappingURL=index.js.map
|