@everymatrix/casino-engagement-suite-tournament 1.46.0 → 1.46.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/casino-engagement-suite-tournament/casino-engagement-suite-tournament.esm.js +1 -1
- package/dist/casino-engagement-suite-tournament/index.esm.js +1 -1
- package/dist/casino-engagement-suite-tournament/p-2dc46ff5.js +2 -0
- package/dist/casino-engagement-suite-tournament/{p-0f4e94ab.entry.js → p-e969a6a6.entry.js} +1 -1
- package/dist/casino-engagement-suite-tournament/p-ecf7465a.js +1 -0
- package/dist/cjs/casino-engagement-suite-progress-bar_3.cjs.entry.js +2 -2
- package/dist/cjs/casino-engagement-suite-tournament-81cbca40.js +733 -0
- package/dist/cjs/casino-engagement-suite-tournament.cjs.js +2 -2
- package/dist/cjs/{index-16d5d7c3.js → index-6f030cde.js} +28 -43
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/casino-engagement-suite-tournament/casino-engagement-suite-tournament.css +101 -68
- package/dist/collection/components/casino-engagement-suite-tournament/casino-engagement-suite-tournament.js +168 -313
- package/dist/collection/shared/GradientRoundedButton.js +1 -1
- package/dist/collection/shared/renderBar.js +2 -2
- package/dist/collection/shared/renders.dialog.js +49 -0
- package/dist/collection/shared/renders.js +8 -0
- package/dist/collection/shared/renders.page.js +117 -0
- package/dist/collection/shared/renders.tab.js +30 -0
- package/dist/collection/shared/renders.util.js +18 -0
- package/dist/collection/utils/api.apdater.js +2 -2
- package/dist/collection/utils/bussiness.js +38 -0
- package/dist/collection/utils/message.js +63 -0
- package/dist/collection/utils/translations.js +8 -9
- package/dist/collection/utils/types.js +5 -5
- package/dist/collection/utils/util.date.js +1 -1
- package/dist/collection/utils/utils.js +6 -2
- package/dist/esm/casino-engagement-suite-progress-bar_3.entry.js +2 -2
- package/dist/esm/casino-engagement-suite-tournament-65c77450.js +731 -0
- package/dist/esm/casino-engagement-suite-tournament.js +3 -3
- package/dist/esm/{index-3962add4.js → index-224e880a.js} +29 -43
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/stencil.config.dev.js +2 -0
- package/dist/types/components/casino-engagement-suite-tournament/casino-engagement-suite-tournament.d.ts +27 -52
- package/dist/types/components.d.ts +16 -0
- package/dist/types/shared/GradientRoundedButton.d.ts +1 -1
- package/dist/types/shared/renderBar.d.ts +1 -1
- package/dist/types/shared/renders.d.ts +6 -0
- package/dist/types/shared/renders.dialog.d.ts +2 -0
- package/dist/types/shared/renders.page.d.ts +2 -0
- package/dist/types/shared/renders.tab.d.ts +3 -0
- package/dist/types/shared/renders.util.d.ts +2 -0
- package/dist/types/utils/api.apdater.d.ts +1 -1
- package/dist/types/utils/bussiness.d.ts +32 -0
- package/dist/types/utils/message.d.ts +17 -0
- package/dist/types/utils/translations.d.ts +8 -9
- package/dist/types/utils/types.d.ts +14 -5
- package/dist/types/utils/utils.d.ts +1 -0
- package/package.json +1 -1
- package/dist/casino-engagement-suite-tournament/p-1bf11325.js +0 -2
- package/dist/casino-engagement-suite-tournament/p-5df3ac81.js +0 -1
- package/dist/cjs/casino-engagement-suite-tournament-1b738bb2.js +0 -560
- package/dist/esm/casino-engagement-suite-tournament-d8471680.js +0 -558
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { tournamentAdapter } from "../utils/api.apdater";
|
|
3
|
+
import { classnames } from "../utils/utils";
|
|
4
|
+
import { DialogType, LeaderboardPage, TournamentState } from "../utils/types";
|
|
5
|
+
import { renderGradientRoundedButton } from "./GradientRoundedButton";
|
|
6
|
+
import { iconBack, iconClose, iconQuestion } from "./icons";
|
|
7
|
+
import { renderCloseBar } from "./renderBar";
|
|
8
|
+
import { renderTimeBar } from "./renders.util";
|
|
9
|
+
import { Tab } from "../utils/translations";
|
|
10
|
+
import { messageSender } from "../utils/message";
|
|
11
|
+
export const page = {
|
|
12
|
+
list(instance) {
|
|
13
|
+
var _a;
|
|
14
|
+
if (!instance.tournamentList) {
|
|
15
|
+
instance.tournamentList = (_a = instance.leaderboardsInit) === null || _a === void 0 ? void 0 : _a.map(item => tournamentAdapter(item));
|
|
16
|
+
return h("general-animation-loading", null);
|
|
17
|
+
}
|
|
18
|
+
const { locale } = instance;
|
|
19
|
+
if (instance.tournamentList.length) {
|
|
20
|
+
const onClickListItemChangePage = (tournament) => {
|
|
21
|
+
instance.setPage(LeaderboardPage.item, { tournament });
|
|
22
|
+
instance.newIdList = instance.newIdList.filter(id => id !== tournament.id);
|
|
23
|
+
};
|
|
24
|
+
return renderLeaderboardContainer(instance, h("div", { class: "Leaderboards Row" }, instance.tournamentList.map(_tournament => (h("div", { class: classnames("LeaderboardsItem", _tournament.playerEnrolled ? ' GradientRounded Hollow' : ''), onClick: () => onClickListItemChangePage(_tournament) }, h("div", { class: "LeaderboardsItemContainer" }, renderTitleContainer(instance, _tournament), renderTimeBar(instance, _tournament)), h("div", { class: "LeaderboardLabels" }, instance.newIdList.includes(_tournament.id) && (h("div", { class: "LeaderboardLabel" }, h("span", null, "new")))))))));
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
return renderLeaderboardContainer(instance, h("div", { class: "NoLeaderboards Row" }, h("div", null, locale.NoLeaderboards), h("div", null, locale.NoLeaderboardsTip)));
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
item(instance) {
|
|
31
|
+
if (!instance.tournamentItem)
|
|
32
|
+
return h("general-animation-loading", null);
|
|
33
|
+
const renderTabs = () => {
|
|
34
|
+
const { locale, tab } = instance;
|
|
35
|
+
const onClickTab = (tab) => {
|
|
36
|
+
instance.tab = tab;
|
|
37
|
+
switch (tab) {
|
|
38
|
+
case Tab.leaderboard:
|
|
39
|
+
instance.leaderboards = undefined;
|
|
40
|
+
messageSender.UpdateLeaderboardsReq(instance.tournamentItem);
|
|
41
|
+
break;
|
|
42
|
+
case Tab.games:
|
|
43
|
+
messageSender.UpdateTournamentsItemReq(instance.tournamentItem);
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
return (h("div", { class: "TabsContainer" }, h("div", { class: "Tabs" }, Object.keys(Tab).map((_tab) => (h("div", { class: classnames({ active: tab === _tab }),
|
|
48
|
+
onClick: () => onClickTab(_tab) }, locale[_tab]))))));
|
|
49
|
+
};
|
|
50
|
+
return renderLeaderboardContainer(instance, [
|
|
51
|
+
renderTitleContainer(instance, instance.tournamentItem),
|
|
52
|
+
renderTabs(),
|
|
53
|
+
instance.renders.tab[instance.tab]()
|
|
54
|
+
]);
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
const renderTitleContainer = (instance, tournament) => {
|
|
58
|
+
const { locale } = instance;
|
|
59
|
+
const onClickItemJoin = (tournament) => {
|
|
60
|
+
if (tournament.playerEnrolled) {
|
|
61
|
+
instance.openDialog(DialogType.unjoin, tournament);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
instance.actionJoin(tournament);
|
|
65
|
+
instance.tournamentItem = tournament;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
return (h("div", { class: "TitleContainer" }, h("div", { class: "Title" }, tournament.nameOrTitle), tournament.state !== TournamentState.Closed && (h("div", null, renderGradientRoundedButton({
|
|
69
|
+
statedClasses: {
|
|
70
|
+
isHollow: tournament.playerEnrolled,
|
|
71
|
+
isPending: instance.isActionJoinPending,
|
|
72
|
+
},
|
|
73
|
+
onClick: (e) => {
|
|
74
|
+
e.stopPropagation();
|
|
75
|
+
onClickItemJoin(tournament);
|
|
76
|
+
},
|
|
77
|
+
innerHTML: tournament.playerEnrolled ? locale.Unjoin : locale.Join,
|
|
78
|
+
})))));
|
|
79
|
+
};
|
|
80
|
+
const renderLeaderboardContainer = (instance, render) => {
|
|
81
|
+
const { dialog: { isOpen } } = instance;
|
|
82
|
+
const renderBar = renderCloseBar({
|
|
83
|
+
right: (h("span", { onClick: () => instance.closeDialog() }, iconClose))
|
|
84
|
+
});
|
|
85
|
+
const renderDialogContent = () => {
|
|
86
|
+
switch (instance.dialog.type) {
|
|
87
|
+
case DialogType.unjoin:
|
|
88
|
+
return instance.renders.dialog.unjoin(); //renderDialogContentUnjoin()
|
|
89
|
+
case DialogType.tip:
|
|
90
|
+
return (h("div", { class: "Tip" }, instance.locale.Tip));
|
|
91
|
+
case DialogType.gift:
|
|
92
|
+
return instance.renders.dialog.gift();
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
const getWrapperBarData = () => {
|
|
96
|
+
const { page, locale } = instance;
|
|
97
|
+
switch (page) {
|
|
98
|
+
case LeaderboardPage.list:
|
|
99
|
+
return {
|
|
100
|
+
left: h("span", { onClick: () => instance.openDialog(DialogType.tip) }, iconQuestion),
|
|
101
|
+
middle: locale.Leaderboards
|
|
102
|
+
};
|
|
103
|
+
case LeaderboardPage.item:
|
|
104
|
+
return {
|
|
105
|
+
left: (h("span", { onClick: () => instance.setPage(LeaderboardPage.list) }, iconBack)),
|
|
106
|
+
middle: '',
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
const renderCloseBarInLayout = () => {
|
|
111
|
+
const { left, middle } = getWrapperBarData();
|
|
112
|
+
return renderCloseBar({ left, middle,
|
|
113
|
+
right: (h("span", { onClick: () => instance.close.emit() }, iconClose))
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
return (h("div", { class: `Wrapper ${instance.device}` }, h("div", { class: classnames("WrapperContent", { faded: isOpen }) }, renderCloseBarInLayout(), h("div", { class: "Root" }, h("div", { class: "Main" }, render))), h("div", { class: "WrapperUtil" }, h("dialog", { open: isOpen }, h("div", { class: "GradientRounded Hollow" }, renderBar, isOpen && renderDialogContent())))));
|
|
117
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { localePostprocess } from "../utils/translations";
|
|
3
|
+
import { iconEyeClose, iconEyeOpen, iconReward } from "./icons";
|
|
4
|
+
import { classnames } from "../utils/utils";
|
|
5
|
+
import { renderTimeBar } from "./renders.util";
|
|
6
|
+
import { isTournamentClosed } from "../utils/bussiness";
|
|
7
|
+
export const tab = {
|
|
8
|
+
info(instance) {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
const { locale, tournamentItem: tournament, isShowInfo } = instance;
|
|
11
|
+
return (h("div", { class: "InfoContainer" }, renderTimeBar(instance, tournament), (h("section", { class: "ShowInfo", onClick: () => instance.isShowInfo = !instance.isShowInfo }, h("p", null, h("span", null, isShowInfo ? iconEyeClose : iconEyeOpen), h("span", null, locale.LeaderboardDetails)))), isShowInfo && (h("section", { class: "Info" }, h("div", null, tournament.description), h("div", { class: "Criterias" }, h("div", null, locale.ScoreCriteria, ": ", h("span", null, tournament.scoreCriteria)), h("div", null, locale.MinimumBetCriteria, ": ", h("span", null, tournament.minBetCount))), h("div", { class: "TC" }, h("a", { href: tournament.termsUrl, target: '_blank' }, locale.TC)))), isTournamentClosed(instance.tournamentItem) && ((_a = instance.leaderboards) === null || _a === void 0 ? void 0 : _a.find(l => l.isMe)) && (h("section", { class: "ResultPrize", innerHTML: localePostprocess(locale.TipPrize, getResultPrize((_b = instance.leaderboards) === null || _b === void 0 ? void 0 : _b.find(l => l.isMe))) })), h("section", { class: "Prizes" }, h("div", { class: "PrizesHeader" }, iconReward, h("span", { class: "PrizesText" }, locale.Prizes)), tournament.prizes.map((prize, index) => (h("div", { class: "Prize" }, index + 1, " ", locale.Place, ": ", h("span", { class: "PrizeText" }, prize.name)))))));
|
|
12
|
+
},
|
|
13
|
+
leaderboard(instance) {
|
|
14
|
+
if (!instance.leaderboards)
|
|
15
|
+
return h("general-animation-loading", null);
|
|
16
|
+
if (!instance.leaderboards.length)
|
|
17
|
+
return '';
|
|
18
|
+
return (h("table", { class: "Leaderboards" }, instance.leaderboards.map(leaderboard => (h("tr", { class: classnames({ isMe: leaderboard.isMe }) }, h("td", { class: "LeaderboardRank" }, h("span", null, leaderboard.rank)), h("td", { class: "LeaderboardName" }, leaderboard.shortName), h("td", { class: "LeaderboardScore" }, leaderboard.score), h("td", { class: "LeaderboardPrize" }, leaderboard.prizeName))))));
|
|
19
|
+
},
|
|
20
|
+
games(instance) {
|
|
21
|
+
var _a;
|
|
22
|
+
return (h("div", { class: "Games" }, (_a = instance.tournamentItem.games) === null || _a === void 0 ? void 0 : _a.map(game => (h("div", null, h("img", { src: game.defaultThumbnail, alt: "" }))))));
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
const getResultPrize = (leaderboard) => {
|
|
26
|
+
return {
|
|
27
|
+
prize: leaderboard.prizeName,
|
|
28
|
+
place: leaderboard.rank,
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { addSeconds, formatDate, getDifference, getProgress } from "../utils/util.date";
|
|
3
|
+
import { renderGradientRoundedButton } from "./GradientRoundedButton";
|
|
4
|
+
export const renderTimeBar = (instance, tournament) => {
|
|
5
|
+
return (h("section", { class: "TimeContainer" }, h("div", { class: 'Time' }, tournament.playerEnrolled ? ([
|
|
6
|
+
h("div", null, getDifference(addSeconds(tournament.startTime, instance.time), tournament.endTime)),
|
|
7
|
+
h("div", null, renderGradientRoundedButton({
|
|
8
|
+
statedClasses: {
|
|
9
|
+
isHollow: true,
|
|
10
|
+
isPendding: false,
|
|
11
|
+
},
|
|
12
|
+
innerHTML: `${getProgress(tournament.startTime, tournament.endTime)}%`
|
|
13
|
+
}))
|
|
14
|
+
]) : ([
|
|
15
|
+
h("div", null, formatDate(tournament.startTime)),
|
|
16
|
+
h("div", null, formatDate(tournament.endTime))
|
|
17
|
+
])), h("casino-engagement-suite-progress-bar", { value: Number(getProgress(tournament.startTime, tournament.endTime)), "hide-percent": true })));
|
|
18
|
+
};
|
|
@@ -4,7 +4,7 @@ export const tournamentAdapter = (tournamentApi) => {
|
|
|
4
4
|
'endTime',
|
|
5
5
|
'closeTime',
|
|
6
6
|
'exhibitionStartTime',
|
|
7
|
-
'exhibitionEndTime'
|
|
7
|
+
'exhibitionEndTime'
|
|
8
8
|
];
|
|
9
9
|
const tournament = {};
|
|
10
10
|
Object.keys(tournamentApi).map((key) => {
|
|
@@ -24,7 +24,7 @@ export const leaderboardsAdapter = (leaderboardRes) => {
|
|
|
24
24
|
if (!item) {
|
|
25
25
|
return leaderboards;
|
|
26
26
|
}
|
|
27
|
-
return leaderboards.map(leaderboard => {
|
|
27
|
+
return leaderboards.map((leaderboard) => {
|
|
28
28
|
if (item && item.userID === leaderboard.userID) {
|
|
29
29
|
return Object.assign(Object.assign({}, leaderboard), { isMe: true });
|
|
30
30
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { TournamentState } from "./types";
|
|
2
|
+
export const getMaxRankStr = (list) => {
|
|
3
|
+
let itemHaveMaxRank;
|
|
4
|
+
list.map((item) => {
|
|
5
|
+
var _a;
|
|
6
|
+
const rank = (_a = item.leaderBoard) === null || _a === void 0 ? void 0 : _a.rank;
|
|
7
|
+
if (!rank) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
if (!itemHaveMaxRank) {
|
|
11
|
+
itemHaveMaxRank = item;
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
if (rank < itemHaveMaxRank.leaderBoard.rank) {
|
|
16
|
+
itemHaveMaxRank = item;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
if (!itemHaveMaxRank) {
|
|
21
|
+
return '-';
|
|
22
|
+
}
|
|
23
|
+
const maxRankStr = `${itemHaveMaxRank.leaderBoard.rank} / ${itemHaveMaxRank.endRank}`;
|
|
24
|
+
return maxRankStr;
|
|
25
|
+
};
|
|
26
|
+
export const isTournamentClosed = (tournament) => {
|
|
27
|
+
return [TournamentState.Closed, TournamentState.Closing].includes(tournament.state);
|
|
28
|
+
};
|
|
29
|
+
export const getTournamentListByItem = (tournamentList, tournament) => {
|
|
30
|
+
return tournamentList.map((_tournament) => {
|
|
31
|
+
if (_tournament.id === tournament.id) {
|
|
32
|
+
return tournament;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
return _tournament;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { leaderboardsAdapter, tournamentAdapter } from "./api.apdater";
|
|
2
|
+
import { getMaxRankStr } from "./bussiness";
|
|
3
|
+
import { LeaderboardPage } from "./types";
|
|
4
|
+
export const messageSender = {
|
|
5
|
+
UpdateSuiteBarState: (labels) => window.postMessage({ type: 'UpdateLeaderboardState', labels }),
|
|
6
|
+
JoinTournamentReq: (tournament) => { var _a, _b; return window.postMessage({ type: 'JoinTournamentReq', bonusCode: (_b = (_a = tournament.wallets) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.code }); },
|
|
7
|
+
UnjoinTournamentReq: (tournament) => window.postMessage({ type: 'UnjoinTournamentReq', id: tournament.id }),
|
|
8
|
+
UpdateTournamentsItemReq: (tournament) => window.postMessage({ type: 'UpdateTournamentsItemReq', id: tournament.id }),
|
|
9
|
+
UpdateLeaderboardsReq: (tournament, query) => window.postMessage({ type: 'UpdateLeaderboardsReq', id: tournament.id, query }),
|
|
10
|
+
UpdateLeaderboardsPlayerReq: () => window.postMessage({ type: 'UpdateLeaderboardsPlayerReq' })
|
|
11
|
+
};
|
|
12
|
+
export const messageReceiver = (instance) => {
|
|
13
|
+
const receiver = {
|
|
14
|
+
UpdateLeaderboardsPlayerRes: (rest) => {
|
|
15
|
+
const rankStr = getMaxRankStr(rest.data.items);
|
|
16
|
+
window.postMessage({ type: 'UpdateLeaderboardState', rank: rankStr });
|
|
17
|
+
},
|
|
18
|
+
UpdateLeaderboardStateReq: () => {
|
|
19
|
+
window.postMessage({ type: 'UpdateLeaderboardState', labels: ['win', 'new'] });
|
|
20
|
+
},
|
|
21
|
+
UpdateTournamentsItemRes: (rest) => {
|
|
22
|
+
const tournamentNew = tournamentAdapter(rest.data.item);
|
|
23
|
+
instance.tournamentItem = tournamentNew;
|
|
24
|
+
updateTournamentListByItem(instance, tournamentNew);
|
|
25
|
+
},
|
|
26
|
+
UpdateLeaderboardsRes: (rest) => {
|
|
27
|
+
instance.leaderboards = leaderboardsAdapter(rest.data);
|
|
28
|
+
},
|
|
29
|
+
JoinTournamentRes: (rest) => commonJoinRes(instance, rest),
|
|
30
|
+
UnjoinTournamentRes: (rest) => commonJoinRes(instance, rest)
|
|
31
|
+
};
|
|
32
|
+
return receiver;
|
|
33
|
+
};
|
|
34
|
+
const commonJoinRes = (instance, rest) => {
|
|
35
|
+
const { success } = rest;
|
|
36
|
+
if (success) {
|
|
37
|
+
instance.tournamentItem = Object.assign(Object.assign({}, instance.tournamentItem), { playerEnrolled: !!!instance.tournamentItem.playerEnrolled });
|
|
38
|
+
switch (instance.page) {
|
|
39
|
+
case LeaderboardPage.item: {
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
case LeaderboardPage.list: {
|
|
43
|
+
updateTournamentListByItem(instance, instance.tournamentItem);
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (instance.nextPage) {
|
|
49
|
+
instance.setPage(instance.nextPage);
|
|
50
|
+
instance.nextPage = undefined;
|
|
51
|
+
}
|
|
52
|
+
instance.isActionJoinPending = false;
|
|
53
|
+
};
|
|
54
|
+
const updateTournamentListByItem = (instance, tournament) => {
|
|
55
|
+
instance.tournamentList = instance.tournamentList.map((_tournament) => {
|
|
56
|
+
if (_tournament.id === tournament.id) {
|
|
57
|
+
return tournamentAdapter(tournament);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
return _tournament;
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export var Tab;
|
|
2
2
|
(function (Tab) {
|
|
3
|
-
Tab["
|
|
4
|
-
Tab["
|
|
5
|
-
Tab["
|
|
3
|
+
Tab["info"] = "info";
|
|
4
|
+
Tab["leaderboard"] = "leaderboard";
|
|
5
|
+
Tab["games"] = "games";
|
|
6
6
|
})(Tab || (Tab = {}));
|
|
7
7
|
export var Time;
|
|
8
8
|
(function (Time) {
|
|
@@ -10,7 +10,7 @@ export var Time;
|
|
|
10
10
|
Time["Ends"] = "Ends";
|
|
11
11
|
})(Time || (Time = {}));
|
|
12
12
|
export const localePostprocess = (translationText, props) => {
|
|
13
|
-
Object.keys(props).map(key => {
|
|
13
|
+
Object.keys(props).map((key) => {
|
|
14
14
|
translationText = translationText.replace(`{${key}}`, props[key]);
|
|
15
15
|
});
|
|
16
16
|
return translationText;
|
|
@@ -19,10 +19,9 @@ export const TRANSLATIONS = Object.assign(Object.assign(Object.assign({ Join: 'J
|
|
|
19
19
|
Title: 'Quit Leaderboard?',
|
|
20
20
|
Description: 'Any progress on the current Leaderboard won’t be kept and you can not rejoin the Leaderboard any more. <br /><br />Would you still like to quit?',
|
|
21
21
|
ButtonYes: 'Yes, I want to quit leaderboard',
|
|
22
|
-
ButtonNo: 'No, Stay on the leaderboard'
|
|
23
|
-
},
|
|
22
|
+
ButtonNo: 'No, Stay on the leaderboard'
|
|
23
|
+
}, WinDialog: {
|
|
24
24
|
Tile: 'Congratulations!',
|
|
25
|
-
Description: 'You
|
|
26
|
-
|
|
27
|
-
ButtonNo: 'Not interested',
|
|
25
|
+
Description: 'You won <span>{tournamentName}</span>!',
|
|
26
|
+
ButtonContinue: 'Continue'
|
|
28
27
|
}, NoLeaderboards: 'No Leaderboards yet', NoLeaderboardsTip: 'Try winning tickets to Leaderboards as rewards or launching other booster games', Leaderboards: 'Leaderboards', TipPrize: 'You took <span>{place}</span> place and win <span>{prize}</span>', Tip: 'Competition where your real money bets contribute towards the leaderboard score calculation to win the leaderboard reward.' });
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
export var LeaderboardPage;
|
|
2
2
|
(function (LeaderboardPage) {
|
|
3
|
-
LeaderboardPage["
|
|
4
|
-
LeaderboardPage["
|
|
5
|
-
LeaderboardPage["Item"] = "Item";
|
|
3
|
+
LeaderboardPage["list"] = "list";
|
|
4
|
+
LeaderboardPage["item"] = "item";
|
|
6
5
|
})(LeaderboardPage || (LeaderboardPage = {}));
|
|
7
6
|
export var TournamentState;
|
|
8
7
|
(function (TournamentState) {
|
|
@@ -13,6 +12,7 @@ export var TournamentState;
|
|
|
13
12
|
})(TournamentState || (TournamentState = {}));
|
|
14
13
|
export var DialogType;
|
|
15
14
|
(function (DialogType) {
|
|
16
|
-
DialogType["
|
|
17
|
-
DialogType["
|
|
15
|
+
DialogType["unjoin"] = "unjoin";
|
|
16
|
+
DialogType["tip"] = "tip";
|
|
17
|
+
DialogType["gift"] = "gift";
|
|
18
18
|
})(DialogType || (DialogType = {}));
|
|
@@ -34,5 +34,5 @@ export function getDifference(startDate, endDate) {
|
|
|
34
34
|
return formattedDiff;
|
|
35
35
|
}
|
|
36
36
|
export function getProgress(startDate, endDate) {
|
|
37
|
-
return (100 * (new Date().getTime() - startDate.getTime()) / (endDate.getTime() - startDate.getTime())).toFixed(0);
|
|
37
|
+
return ((100 * (new Date().getTime() - startDate.getTime())) / (endDate.getTime() - startDate.getTime())).toFixed(0);
|
|
38
38
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export const classnames = (...args) => {
|
|
2
2
|
let classnameArray = [];
|
|
3
|
-
args.map(arg => {
|
|
3
|
+
args.map((arg) => {
|
|
4
4
|
switch (typeof arg) {
|
|
5
5
|
case 'string':
|
|
6
6
|
classnameArray.push(arg);
|
|
7
7
|
break;
|
|
8
8
|
case 'object':
|
|
9
|
-
Object.keys(arg).map(k => {
|
|
9
|
+
Object.keys(arg).map((k) => {
|
|
10
10
|
if (arg[k]) {
|
|
11
11
|
classnameArray.push(k);
|
|
12
12
|
}
|
|
@@ -16,3 +16,7 @@ export const classnames = (...args) => {
|
|
|
16
16
|
});
|
|
17
17
|
return classnameArray.join(' ');
|
|
18
18
|
};
|
|
19
|
+
export const getNewItems = (newList, oldList, getCondition) => {
|
|
20
|
+
const newItems = newList.filter((newItem) => !oldList.some((oldItem) => getCondition(newItem, oldItem)));
|
|
21
|
+
return newItems;
|
|
22
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, h, g as getElement } from './index-
|
|
2
|
-
export { C as casino_engagement_suite_tournament } from './casino-engagement-suite-tournament-
|
|
1
|
+
import { r as registerInstance, h, g as getElement } from './index-224e880a.js';
|
|
2
|
+
export { C as casino_engagement_suite_tournament } from './casino-engagement-suite-tournament-65c77450.js';
|
|
3
3
|
|
|
4
4
|
const casinoEngagementSuiteProgressBarCss = ":host{display:block;font-family:inherit}:host(.Desktop) .ProgressBarPercent{font-size:var(--emw--font-size-small, 14px);line-height:14px}@keyframes indeterminate{0%{left:-200%;right:100%}60%{left:110%;right:-10%}to{left:110%;right:-10%}}.ProgressBarBackground{height:8px;background-color:var(--emw--color-gray-300, #666178);border-radius:var(--emw--border-radius-small, 4px);position:relative;overflow:hidden}.ProgressBarLine{position:absolute;left:0;top:0;bottom:0;border-radius:var(--emw--border-radius-small, 4px);background:var(--emw--engagement-suite-gradient-button, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%));transition:width ease-out 0.3s}.ProgressBarLine.Indeterminate{animation:indeterminate 1s linear infinite}.ProgressBarInfo{margin-bottom:8px;display:flex;justify-content:space-between;align-items:center}.ProgressBarPercent{font-weight:var(--emw--font-weight-bold, 700);font-size:var(--emw--font-size-x-small, 12px);line-height:12px}.HidePercent .ProgressBarPercent{display:none}.ProgressBar:not(.Disabled) .ProgressBarPercent{background:var(--emw--engagement-suite-gradient-button, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%));-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.ProgressBar.Disabled .ProgressBarPercent{color:var(--emw--color-gray-300, #666178)}.ProgressBar.Disabled .ProgressBarLine{background:var(--emw--color-background-secondary, #474668)}";
|
|
5
5
|
const CasinoEngagementSuiteProgressBarStyle0 = casinoEngagementSuiteProgressBarCss;
|