@everymatrix/casino-challenges-overlay-drawer 0.0.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-challenges-overlay-drawer/app-globals-0f993ce5.js +1 -0
- package/dist/casino-challenges-overlay-drawer/casino-challenge-details-events_21.entry.js +1 -0
- package/dist/casino-challenges-overlay-drawer/casino-challenges-overlay-drawer-b6d3a238.js +1 -0
- package/dist/casino-challenges-overlay-drawer/casino-challenges-overlay-drawer.esm.js +1 -0
- package/dist/casino-challenges-overlay-drawer/index-25fd45d2.js +2 -0
- package/dist/casino-challenges-overlay-drawer/index.esm.js +1 -0
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/casino-challenge-details-events_21.cjs.entry.js +4459 -0
- package/dist/cjs/casino-challenges-overlay-drawer-ee68086b.js +1002 -0
- package/dist/cjs/casino-challenges-overlay-drawer.cjs.js +25 -0
- package/dist/cjs/index-d2288c94.js +1592 -0
- package/dist/cjs/index.cjs.js +10 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/collection/assets/arrow-down.svg +3 -0
- package/dist/collection/assets/arrow-up.svg +3 -0
- package/dist/collection/assets/check.svg +3 -0
- package/dist/collection/assets/chevron-up.svg +3 -0
- package/dist/collection/assets/chevron.svg +4 -0
- package/dist/collection/assets/cross.svg +4 -0
- package/dist/collection/assets/crown.svg +12 -0
- package/dist/collection/assets/error.svg +3 -0
- package/dist/collection/assets/gift.svg +24 -0
- package/dist/collection/assets/link.svg +3 -0
- package/dist/collection/assets/lock.svg +3 -0
- package/dist/collection/assets/notification.svg +20 -0
- package/dist/collection/assets/opt-out.svg +3 -0
- package/dist/collection/assets/revert-icon.svg +4 -0
- package/dist/collection/assets/reward-gift.svg +123 -0
- package/dist/collection/assets/slot.svg +59 -0
- package/dist/collection/assets/sport.svg +34 -0
- package/dist/collection/assets/swipe.svg +3 -0
- package/dist/collection/assets/target.svg +16 -0
- package/dist/collection/assets/term-and-condition.svg +3 -0
- package/dist/collection/collection-manifest.json +48 -0
- package/dist/collection/components/casino-challenges-overlay-drawer/casino-challenges-overlay-drawer.css +260 -0
- package/dist/collection/components/casino-challenges-overlay-drawer/casino-challenges-overlay-drawer.js +793 -0
- package/dist/collection/components/casino-challenges-overlay-drawer/index.js +1 -0
- package/dist/collection/components/components/casino-challenge-opt-out-modal/casino-challenge-opt-out-modal.css +141 -0
- package/dist/collection/components/components/casino-challenge-opt-out-modal/casino-challenge-opt-out-modal.js +124 -0
- package/dist/collection/components/components/casino-challenge-overlay-background/casino-challenge-overlay-background.css +89 -0
- package/dist/collection/components/components/casino-challenge-overlay-background/casino-challenge-overlay-background.js +44 -0
- package/dist/collection/components/components/casino-challenges-claim-code/casino-challenges-claim-code.css +143 -0
- package/dist/collection/components/components/casino-challenges-claim-code/casino-challenges-claim-code.js +260 -0
- package/dist/collection/components/components/casino-challenges-empty-state/casino-challenges-empty-state.css +35 -0
- package/dist/collection/components/components/casino-challenges-empty-state/casino-challenges-empty-state.js +80 -0
- package/dist/collection/components/components/casino-challenges-overlay-drawer-history/casino-challenges-overlay-drawer-history.css +37 -0
- package/dist/collection/components/components/casino-challenges-overlay-drawer-history/casino-challenges-overlay-drawer-history.js +335 -0
- package/dist/collection/components/components/casino-challenges-overlay-drawer-history/components/casino-challenge-drawer-history-item/casino-challenge-drawer-history-item.css +170 -0
- package/dist/collection/components/components/casino-challenges-overlay-drawer-history/components/casino-challenge-drawer-history-item/casino-challenge-drawer-history-item.js +173 -0
- package/dist/collection/components/components/casino-challenges-overlay-loader/casino-challenges-overlay-loader.css +83 -0
- package/dist/collection/components/components/casino-challenges-overlay-loader/casino-challenges-overlay-loader.js +63 -0
- package/dist/collection/components/components/casino-challenges-overlay-tabs/casino-challenges-overlay-tabs.css +116 -0
- package/dist/collection/components/components/casino-challenges-overlay-tabs/casino-challenges-overlay-tabs.js +171 -0
- package/dist/collection/components/components/swipe-up/swipe-up.css +61 -0
- package/dist/collection/components/components/swipe-up/swipe-up.js +155 -0
- package/dist/collection/consts.js +3829 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/general-info-utils.js +105 -0
- package/dist/collection/utils/levels-utils.js +55 -0
- package/dist/collection/utils/locale.utils.js +146 -0
- package/dist/collection/utils/types.js +160 -0
- package/dist/collection/utils/utils.js +54 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/casino-challenge-details-events_21.entry.js +4436 -0
- package/dist/esm/casino-challenges-overlay-drawer-b6d3a238.js +994 -0
- package/dist/esm/casino-challenges-overlay-drawer.js +20 -0
- package/dist/esm/index-25fd45d2.js +1563 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/loader.js +11 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/stencil.config.dev.js +19 -0
- package/dist/stencil.config.js +19 -0
- package/dist/storybook/main.js +43 -0
- package/dist/storybook/preview.js +9 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-overlay-drawer/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-overlay-drawer/.stencil/packages/stencil/casino-challenges-overlay-drawer/stencil.config.d.ts +2 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-overlay-drawer/.stencil/packages/stencil/casino-challenges-overlay-drawer/stencil.config.dev.d.ts +2 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-overlay-drawer/.stencil/packages/stencil/casino-challenges-overlay-drawer/storybook/main.d.ts +3 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-overlay-drawer/.stencil/packages/stencil/casino-challenges-overlay-drawer/storybook/preview.d.ts +70 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-overlay-drawer/.stencil/tools/plugins/index.d.ts +4 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-overlay-drawer/.stencil/tools/plugins/lazy-load-chunk-plugin.d.ts +12 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-overlay-drawer/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-overlay-drawer/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-overlay-drawer/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
- package/dist/types/components/casino-challenges-overlay-drawer/casino-challenges-overlay-drawer.d.ts +77 -0
- package/dist/types/components/casino-challenges-overlay-drawer/index.d.ts +1 -0
- package/dist/types/components/components/casino-challenge-opt-out-modal/casino-challenge-opt-out-modal.d.ts +12 -0
- package/dist/types/components/components/casino-challenge-overlay-background/casino-challenge-overlay-background.d.ts +6 -0
- package/dist/types/components/components/casino-challenges-claim-code/casino-challenges-claim-code.d.ts +49 -0
- package/dist/types/components/components/casino-challenges-empty-state/casino-challenges-empty-state.d.ts +6 -0
- package/dist/types/components/components/casino-challenges-overlay-drawer-history/casino-challenges-overlay-drawer-history.d.ts +33 -0
- package/dist/types/components/components/casino-challenges-overlay-drawer-history/components/casino-challenge-drawer-history-item/casino-challenge-drawer-history-item.d.ts +12 -0
- package/dist/types/components/components/casino-challenges-overlay-loader/casino-challenges-overlay-loader.d.ts +5 -0
- package/dist/types/components/components/casino-challenges-overlay-tabs/casino-challenges-overlay-tabs.d.ts +16 -0
- package/dist/types/components/components/swipe-up/swipe-up.d.ts +20 -0
- package/dist/types/components.d.ts +362 -0
- package/dist/types/consts.d.ts +585 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1674 -0
- package/dist/types/utils/general-info-utils.d.ts +10 -0
- package/dist/types/utils/levels-utils.d.ts +5 -0
- package/dist/types/utils/locale.utils.d.ts +12 -0
- package/dist/types/utils/types.d.ts +327 -0
- package/dist/types/utils/utils.d.ts +7 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/loader/package.json +11 -0
- package/package.json +27 -0
|
@@ -0,0 +1,994 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-25fd45d2.js';
|
|
2
|
+
|
|
3
|
+
const StyleCacheKey = '__WIDGET_GLOBAL_STYLE_CACHE__';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @name setClientStyling
|
|
7
|
+
* @description Method used to create and append to the passed element of the widget a style element with the content received
|
|
8
|
+
* @param {HTMLElement} stylingContainer The reference element of the widget
|
|
9
|
+
* @param {string} clientStyling The style content
|
|
10
|
+
*/
|
|
11
|
+
function setClientStyling(stylingContainer, clientStyling) {
|
|
12
|
+
if (stylingContainer) {
|
|
13
|
+
const sheet = document.createElement('style');
|
|
14
|
+
sheet.innerHTML = clientStyling;
|
|
15
|
+
stylingContainer.appendChild(sheet);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @name setClientStylingURL
|
|
21
|
+
* @description Method used to create and append to the passed element of the widget a style element with the content fetched from a given URL
|
|
22
|
+
* @param {HTMLElement} stylingContainer The reference element of the widget
|
|
23
|
+
* @param {string} clientStylingUrl The URL of the style content
|
|
24
|
+
*/
|
|
25
|
+
function setClientStylingURL(stylingContainer, clientStylingUrl) {
|
|
26
|
+
if (!stylingContainer || !clientStylingUrl) return;
|
|
27
|
+
|
|
28
|
+
const url = new URL(clientStylingUrl);
|
|
29
|
+
|
|
30
|
+
fetch(url.href)
|
|
31
|
+
.then((res) => res.text())
|
|
32
|
+
.then((data) => {
|
|
33
|
+
const cssFile = document.createElement('style');
|
|
34
|
+
cssFile.innerHTML = data;
|
|
35
|
+
if (stylingContainer) {
|
|
36
|
+
stylingContainer.appendChild(cssFile);
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
.catch((err) => {
|
|
40
|
+
console.error('There was an error while trying to load client styling from URL', err);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @name setStreamLibrary
|
|
46
|
+
* @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
|
|
47
|
+
* @param {HTMLElement} stylingContainer The highest element of the widget
|
|
48
|
+
* @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
|
|
49
|
+
* @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
|
|
50
|
+
* @param {boolean} useAdoptedStyleSheets A flag to gradually enable testing of adoptedStyleSheets
|
|
51
|
+
*/
|
|
52
|
+
function setStreamStyling(stylingContainer, domain, subscription, useAdoptedStyleSheets = false) {
|
|
53
|
+
if (!window.emMessageBus) return;
|
|
54
|
+
|
|
55
|
+
const supportAdoptStyle = 'adoptedStyleSheets' in Document.prototype;
|
|
56
|
+
|
|
57
|
+
if (!supportAdoptStyle || !useAdoptedStyleSheets) {
|
|
58
|
+
subscription = getStyleTagSubscription(stylingContainer, domain);
|
|
59
|
+
|
|
60
|
+
return subscription;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (!window[StyleCacheKey]) {
|
|
64
|
+
window[StyleCacheKey] = {};
|
|
65
|
+
}
|
|
66
|
+
subscription = getAdoptStyleSubscription(stylingContainer, domain);
|
|
67
|
+
|
|
68
|
+
const originalUnsubscribe = subscription.unsubscribe.bind(subscription);
|
|
69
|
+
const wrappedUnsubscribe = () => {
|
|
70
|
+
if (window[StyleCacheKey][domain]) {
|
|
71
|
+
const cachedObject = window[StyleCacheKey][domain];
|
|
72
|
+
cachedObject.refCount > 1
|
|
73
|
+
? (cachedObject.refCount = cachedObject.refCount - 1)
|
|
74
|
+
: delete window[StyleCacheKey][domain];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
originalUnsubscribe();
|
|
78
|
+
};
|
|
79
|
+
subscription.unsubscribe = wrappedUnsubscribe;
|
|
80
|
+
|
|
81
|
+
return subscription;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function getStyleTagSubscription(stylingContainer, domain) {
|
|
85
|
+
const sheet = document.createElement('style');
|
|
86
|
+
|
|
87
|
+
return window.emMessageBus.subscribe(domain, (data) => {
|
|
88
|
+
if (stylingContainer) {
|
|
89
|
+
sheet.innerHTML = data;
|
|
90
|
+
stylingContainer.appendChild(sheet);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function getAdoptStyleSubscription(stylingContainer, domain) {
|
|
96
|
+
return window.emMessageBus.subscribe(domain, (data) => {
|
|
97
|
+
if (!stylingContainer) return;
|
|
98
|
+
|
|
99
|
+
const shadowRoot = stylingContainer.getRootNode();
|
|
100
|
+
const cacheStyleObject = window[StyleCacheKey];
|
|
101
|
+
let cachedStyle = cacheStyleObject[domain] && cacheStyleObject[domain].sheet;
|
|
102
|
+
|
|
103
|
+
if (!cachedStyle) {
|
|
104
|
+
cachedStyle = new CSSStyleSheet();
|
|
105
|
+
cachedStyle.replaceSync(data);
|
|
106
|
+
cacheStyleObject[domain] = {
|
|
107
|
+
sheet: cachedStyle,
|
|
108
|
+
refCount: 1
|
|
109
|
+
};
|
|
110
|
+
} else {
|
|
111
|
+
cacheStyleObject[domain].refCount = cacheStyleObject[domain].refCount + 1;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const currentSheets = shadowRoot.adoptedStyleSheets || [];
|
|
115
|
+
if (!currentSheets.includes(cachedStyle)) {
|
|
116
|
+
shadowRoot.adoptedStyleSheets = [...currentSheets, cachedStyle];
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const isMobile = () => {
|
|
122
|
+
let userAgent = window.navigator.userAgent;
|
|
123
|
+
return !!(userAgent.toLowerCase().match(/android/i) ||
|
|
124
|
+
userAgent.toLowerCase().match(/blackberry|bb/i) ||
|
|
125
|
+
userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
|
|
126
|
+
userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
|
|
127
|
+
};
|
|
128
|
+
const hasUpdateDataChanged = (prev, next) => {
|
|
129
|
+
if (!prev)
|
|
130
|
+
return true;
|
|
131
|
+
if (prev.ProgressId !== next.ProgressId)
|
|
132
|
+
return true;
|
|
133
|
+
if (prev.Levels.length !== next.Levels.length)
|
|
134
|
+
return true;
|
|
135
|
+
for (let i = 0; i < next.Levels.length; i++) {
|
|
136
|
+
const a = prev.Levels[i];
|
|
137
|
+
const b = next.Levels[i];
|
|
138
|
+
if (a.LevelId !== b.LevelId ||
|
|
139
|
+
a.ProgressStatus !== b.ProgressStatus ||
|
|
140
|
+
a.ProgressPercentage !== b.ProgressPercentage) {
|
|
141
|
+
return true;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return false;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
148
|
+
const TRANSLATIONS = {
|
|
149
|
+
en: {
|
|
150
|
+
title: 'Challenges',
|
|
151
|
+
promo: 'Promo',
|
|
152
|
+
active: 'Active',
|
|
153
|
+
pendingTab: 'Pending',
|
|
154
|
+
finishedTab: 'Finished',
|
|
155
|
+
levels: 'Levels',
|
|
156
|
+
level: 'Level',
|
|
157
|
+
seeAll: 'See All',
|
|
158
|
+
games: 'Games',
|
|
159
|
+
rules: 'Rules',
|
|
160
|
+
events: 'Events',
|
|
161
|
+
codeTab: 'Code',
|
|
162
|
+
endsIn: 'Ends In',
|
|
163
|
+
expired: 'Expired',
|
|
164
|
+
placeBetsOf: 'Place bets of',
|
|
165
|
+
place: 'Place',
|
|
166
|
+
bet: 'bet',
|
|
167
|
+
bets: 'bets',
|
|
168
|
+
minBet: 'min bet',
|
|
169
|
+
forfeited: 'Forfeited',
|
|
170
|
+
finished: 'Finished',
|
|
171
|
+
suspended: 'Suspended',
|
|
172
|
+
completed: 'Completed',
|
|
173
|
+
unavailable: 'Unavailable',
|
|
174
|
+
optIn: 'Opt In',
|
|
175
|
+
optOutLeavingText: 'Leaving the challenge will cancel your progress and disqualify from future participation',
|
|
176
|
+
optOutLeavingActionText: 'Opt out of Challenge',
|
|
177
|
+
optOutModalTitle: 'Opt out of challenge?',
|
|
178
|
+
optOudModalDescription: 'Current progress will be lost, but you will keep earned rewards. You will not be able to opt in for this challenge again.',
|
|
179
|
+
optOutModalConfirm: 'Opt Out',
|
|
180
|
+
optOutModalCancel: 'Cancel',
|
|
181
|
+
optOutSuccessMessage: 'You’ve opted out of the challenge.',
|
|
182
|
+
resume: 'Resume',
|
|
183
|
+
pause: 'Pause',
|
|
184
|
+
join: 'Join to Start',
|
|
185
|
+
deposit: 'Deposit',
|
|
186
|
+
launchGame: 'Launch Game',
|
|
187
|
+
launchDescription: 'Launch any game from the Games tab to unlock the Challenge',
|
|
188
|
+
depositAmountDescription: 'to unlock the Challenge',
|
|
189
|
+
noDepositAmountDescription: 'Deposit any amount to unlock the Challenge',
|
|
190
|
+
claimByButton: 'Claim',
|
|
191
|
+
claimDescription: 'Click Claim button to unlock the Challenge',
|
|
192
|
+
resumeDescription: 'Your progress is saved while Challenge is suspended',
|
|
193
|
+
optInDescription: 'You are ready to opt-in!',
|
|
194
|
+
pausedDescription: 'Your progress is saved while Challenge is paused',
|
|
195
|
+
congrats: 'Congratulations!',
|
|
196
|
+
forfeitNotification: 'Unfortunately, your progress has been forfeited, and you are no longer eligible to continue this challenge. Check out other available challenges!',
|
|
197
|
+
optedOutNotification: 'You’ve left this challenge. Your progress has been lost, and rejoining is no longer possible. Discover other available challenges.',
|
|
198
|
+
completedNofitication: "You've successfully completed this challenge! Explore the next one and keep playing to earn more rewards!",
|
|
199
|
+
expiredNotification: 'Unfortunately, this challenge has expired and is no longer available to complete. Try another one that’s still active!',
|
|
200
|
+
pendingDescription: "You can join this challenge once you've finished the previous progress in the Active tab",
|
|
201
|
+
terms: 'Terms & Conditions',
|
|
202
|
+
readFullTerms: 'Read full Terms & Conditions',
|
|
203
|
+
contribution: 'contribution',
|
|
204
|
+
endDate: 'End Date',
|
|
205
|
+
back: 'Back',
|
|
206
|
+
all: 'All Challenges',
|
|
207
|
+
sports: 'Sports',
|
|
208
|
+
casino: 'Casino',
|
|
209
|
+
contributionType: 'Contribution Type',
|
|
210
|
+
contributionRule: 'Contribution Rule',
|
|
211
|
+
isContributeToOne: 'Bets contribute only to the earliest started challenge (if there are multiple started challenges)',
|
|
212
|
+
isNotContributeToOne: 'Bets contribute to all started challenges',
|
|
213
|
+
bonusMoney: 'Bonus Money',
|
|
214
|
+
realMoney: 'Real Money',
|
|
215
|
+
mixedMoney: 'Real and Bonus Money contribution',
|
|
216
|
+
defaultRule: 'All events - ',
|
|
217
|
+
fundsUsed: 'Funds Used',
|
|
218
|
+
sportsbookRealMoney: 'Only Real Money bets can contribute',
|
|
219
|
+
sportsbookBonusMoney: 'Only Bonus bets can contribute',
|
|
220
|
+
sportsbookMixMoney: 'Both Real Money and Bonus bets can contribute',
|
|
221
|
+
eligibleMatchTypes: 'Eligible Match Types',
|
|
222
|
+
preLiveMatchType: 'Only Pre-Match bets can contribute',
|
|
223
|
+
liveMatchType: 'Only Live bets can contribute',
|
|
224
|
+
mixMatchType: 'Both Pre-Match and Live bets can contribute',
|
|
225
|
+
eligibleBetTypes: 'Eligible Bet Types',
|
|
226
|
+
single: 'Single',
|
|
227
|
+
multi: 'Multi/Combi',
|
|
228
|
+
betBuilder: 'Only Bet Builder Bets',
|
|
229
|
+
nonBetBuilder: 'Only Non-Bet Builder Bets',
|
|
230
|
+
mixBetBuilder: 'Bet Builder & Non-Bet Builder Bets',
|
|
231
|
+
system: 'System',
|
|
232
|
+
banker: 'Only Banker Bets',
|
|
233
|
+
nonBanker: 'Only Non-Banker Bets',
|
|
234
|
+
mixBanker: 'Banker & Non-Banker Bets',
|
|
235
|
+
oddsPerSection: 'Odds per Selection',
|
|
236
|
+
totalOdds: 'Total Odds',
|
|
237
|
+
totalLevels: 'Total Levels',
|
|
238
|
+
selections: 'Selections',
|
|
239
|
+
time: 'time',
|
|
240
|
+
times: 'times',
|
|
241
|
+
winStakeRatio: 'Win/Stake Ratio',
|
|
242
|
+
promoTabEmptyHeader: 'Nothing here - yet!',
|
|
243
|
+
promoTabEmptyDescription: 'No challenges at the moment. Try exploring events or keep playing to unlock new ones.',
|
|
244
|
+
activeTabEmptyHeader: 'No active challenges yet',
|
|
245
|
+
activeTabEmptyDescription: 'Check Promo tab to find available offers',
|
|
246
|
+
pendingTabEmptyHeader: 'No pending challenges yet',
|
|
247
|
+
pendingTabEmptyDescription: 'Check Promo tab to find available offers',
|
|
248
|
+
finishedTabEmptyHeader: 'No finished challenges yet',
|
|
249
|
+
finishedTabEmptyDescription: 'Check Promo tab to find available offers',
|
|
250
|
+
yourProgress: 'Your Progress',
|
|
251
|
+
claimCodeTitle: 'Enter the secret code to unlock hidden quests and rewards.',
|
|
252
|
+
claimCodeSuccessMessage: 'The code was successfully applied.',
|
|
253
|
+
claimCodeInputLabel: '3–30 characters, no spaces',
|
|
254
|
+
claimCodeBtnText: 'Apply Code',
|
|
255
|
+
claimCodeError: 'Invalid format. Use Latin letters, numbers, or symbols.',
|
|
256
|
+
claimCodeDescription: 'Enter code to unlock the challenge',
|
|
257
|
+
status: 'Status',
|
|
258
|
+
grantClaimByButtonSuccessMessage: 'Challenge has been triggered successfully and is now available on the Active tab'
|
|
259
|
+
},
|
|
260
|
+
da: {
|
|
261
|
+
title: ''
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
const translate = (key, customLang) => {
|
|
265
|
+
const lang = customLang;
|
|
266
|
+
return TRANSLATIONS[lang !== undefined && lang in TRANSLATIONS ? lang : DEFAULT_LANGUAGE][key];
|
|
267
|
+
};
|
|
268
|
+
const getTranslations = (data) => {
|
|
269
|
+
Object.keys(data).forEach((item) => {
|
|
270
|
+
if (!TRANSLATIONS[item]) {
|
|
271
|
+
TRANSLATIONS[item] = {};
|
|
272
|
+
}
|
|
273
|
+
for (let key in data[item]) {
|
|
274
|
+
TRANSLATIONS[item][key] = data[item][key];
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
};
|
|
278
|
+
const resolveTranslationUrl = async (translationUrl) => {
|
|
279
|
+
if (translationUrl) {
|
|
280
|
+
try {
|
|
281
|
+
const response = await fetch(translationUrl);
|
|
282
|
+
if (!response.ok) {
|
|
283
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
284
|
+
}
|
|
285
|
+
const translations = await response.json();
|
|
286
|
+
getTranslations(translations);
|
|
287
|
+
}
|
|
288
|
+
catch (error) {
|
|
289
|
+
console.error('Failed to fetch or parse translations from URL:', error);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
var EChallengeLevelTargetType;
|
|
295
|
+
(function (EChallengeLevelTargetType) {
|
|
296
|
+
EChallengeLevelTargetType[EChallengeLevelTargetType["Accumulative"] = 0] = "Accumulative";
|
|
297
|
+
EChallengeLevelTargetType[EChallengeLevelTargetType["SingleBet"] = 1] = "SingleBet";
|
|
298
|
+
EChallengeLevelTargetType[EChallengeLevelTargetType["MultipleOneBetSize"] = 2] = "MultipleOneBetSize";
|
|
299
|
+
EChallengeLevelTargetType[EChallengeLevelTargetType["BetMultiplier"] = 3] = "BetMultiplier";
|
|
300
|
+
})(EChallengeLevelTargetType || (EChallengeLevelTargetType = {}));
|
|
301
|
+
var EChallengeRecurrenceType;
|
|
302
|
+
(function (EChallengeRecurrenceType) {
|
|
303
|
+
EChallengeRecurrenceType[EChallengeRecurrenceType["Single"] = 0] = "Single";
|
|
304
|
+
EChallengeRecurrenceType[EChallengeRecurrenceType["Daily"] = 1] = "Daily";
|
|
305
|
+
EChallengeRecurrenceType[EChallengeRecurrenceType["Weekly"] = 2] = "Weekly";
|
|
306
|
+
EChallengeRecurrenceType[EChallengeRecurrenceType["Monthly"] = 3] = "Monthly";
|
|
307
|
+
})(EChallengeRecurrenceType || (EChallengeRecurrenceType = {}));
|
|
308
|
+
var EChallengeRewardType;
|
|
309
|
+
(function (EChallengeRewardType) {
|
|
310
|
+
EChallengeRewardType[EChallengeRewardType["FreeSpins"] = 0] = "FreeSpins";
|
|
311
|
+
EChallengeRewardType[EChallengeRewardType["LuckyWheel"] = 1] = "LuckyWheel";
|
|
312
|
+
EChallengeRewardType[EChallengeRewardType["Leaderboard"] = 2] = "Leaderboard";
|
|
313
|
+
EChallengeRewardType[EChallengeRewardType["Challenge"] = 3] = "Challenge";
|
|
314
|
+
EChallengeRewardType[EChallengeRewardType["Custom"] = 4] = "Custom";
|
|
315
|
+
})(EChallengeRewardType || (EChallengeRewardType = {}));
|
|
316
|
+
var EChallengeProgressLevelStatus;
|
|
317
|
+
(function (EChallengeProgressLevelStatus) {
|
|
318
|
+
EChallengeProgressLevelStatus[EChallengeProgressLevelStatus["Closed"] = 0] = "Closed";
|
|
319
|
+
EChallengeProgressLevelStatus[EChallengeProgressLevelStatus["InProgress"] = 1] = "InProgress";
|
|
320
|
+
EChallengeProgressLevelStatus[EChallengeProgressLevelStatus["Fillup"] = 2] = "Fillup";
|
|
321
|
+
EChallengeProgressLevelStatus[EChallengeProgressLevelStatus["Completed"] = 3] = "Completed";
|
|
322
|
+
})(EChallengeProgressLevelStatus || (EChallengeProgressLevelStatus = {}));
|
|
323
|
+
var EChallengeProgressStatus;
|
|
324
|
+
(function (EChallengeProgressStatus) {
|
|
325
|
+
EChallengeProgressStatus[EChallengeProgressStatus["Started"] = 0] = "Started";
|
|
326
|
+
EChallengeProgressStatus[EChallengeProgressStatus["InProgress"] = 1] = "InProgress";
|
|
327
|
+
EChallengeProgressStatus[EChallengeProgressStatus["PendingLevelReward"] = 2] = "PendingLevelReward";
|
|
328
|
+
EChallengeProgressStatus[EChallengeProgressStatus["Completed"] = 3] = "Completed";
|
|
329
|
+
EChallengeProgressStatus[EChallengeProgressStatus["Expired"] = 4] = "Expired";
|
|
330
|
+
EChallengeProgressStatus[EChallengeProgressStatus["Forfeited"] = 5] = "Forfeited";
|
|
331
|
+
EChallengeProgressStatus[EChallengeProgressStatus["Awaiting"] = 6] = "Awaiting";
|
|
332
|
+
EChallengeProgressStatus[EChallengeProgressStatus["Paused"] = 7] = "Paused";
|
|
333
|
+
})(EChallengeProgressStatus || (EChallengeProgressStatus = {}));
|
|
334
|
+
var EChallengeStatus;
|
|
335
|
+
(function (EChallengeStatus) {
|
|
336
|
+
EChallengeStatus[EChallengeStatus["Draft"] = 0] = "Draft";
|
|
337
|
+
EChallengeStatus[EChallengeStatus["Enabled"] = 1] = "Enabled";
|
|
338
|
+
EChallengeStatus[EChallengeStatus["Paused"] = 2] = "Paused";
|
|
339
|
+
EChallengeStatus[EChallengeStatus["Closed"] = 3] = "Closed";
|
|
340
|
+
EChallengeStatus[EChallengeStatus["Deleted"] = 4] = "Deleted";
|
|
341
|
+
})(EChallengeStatus || (EChallengeStatus = {}));
|
|
342
|
+
var EChallengeTriggerType;
|
|
343
|
+
(function (EChallengeTriggerType) {
|
|
344
|
+
EChallengeTriggerType[EChallengeTriggerType["GameLaunch"] = 0] = "GameLaunch";
|
|
345
|
+
EChallengeTriggerType[EChallengeTriggerType["Reward"] = 1] = "Reward";
|
|
346
|
+
EChallengeTriggerType[EChallengeTriggerType["Manual"] = 2] = "Manual";
|
|
347
|
+
EChallengeTriggerType[EChallengeTriggerType["Claim"] = 3] = "Claim";
|
|
348
|
+
EChallengeTriggerType[EChallengeTriggerType["Event"] = 4] = "Event";
|
|
349
|
+
EChallengeTriggerType[EChallengeTriggerType["Deposit"] = 5] = "Deposit";
|
|
350
|
+
EChallengeTriggerType[EChallengeTriggerType["ClaimByButton"] = 6] = "ClaimByButton";
|
|
351
|
+
})(EChallengeTriggerType || (EChallengeTriggerType = {}));
|
|
352
|
+
var EChallengeValidityType;
|
|
353
|
+
(function (EChallengeValidityType) {
|
|
354
|
+
EChallengeValidityType[EChallengeValidityType["Period"] = 0] = "Period";
|
|
355
|
+
EChallengeValidityType[EChallengeValidityType["Date"] = 1] = "Date";
|
|
356
|
+
})(EChallengeValidityType || (EChallengeValidityType = {}));
|
|
357
|
+
var EContributedFrom;
|
|
358
|
+
(function (EContributedFrom) {
|
|
359
|
+
EContributedFrom[EContributedFrom["Casino"] = 0] = "Casino";
|
|
360
|
+
EContributedFrom[EContributedFrom["Any"] = 1] = "Any";
|
|
361
|
+
EContributedFrom[EContributedFrom["Sportsbook"] = 2] = "Sportsbook";
|
|
362
|
+
})(EContributedFrom || (EContributedFrom = {}));
|
|
363
|
+
var EMatchType;
|
|
364
|
+
(function (EMatchType) {
|
|
365
|
+
EMatchType[EMatchType["Any"] = 0] = "Any";
|
|
366
|
+
EMatchType[EMatchType["Live"] = 1] = "Live";
|
|
367
|
+
EMatchType[EMatchType["PreLive"] = 2] = "PreLive";
|
|
368
|
+
})(EMatchType || (EMatchType = {}));
|
|
369
|
+
var EBetType;
|
|
370
|
+
(function (EBetType) {
|
|
371
|
+
EBetType[EBetType["Single"] = 0] = "Single";
|
|
372
|
+
EBetType[EBetType["Multiple"] = 1] = "Multiple";
|
|
373
|
+
EBetType[EBetType["System"] = 2] = "System";
|
|
374
|
+
})(EBetType || (EBetType = {}));
|
|
375
|
+
var EBanker;
|
|
376
|
+
(function (EBanker) {
|
|
377
|
+
EBanker[EBanker["Any"] = 0] = "Any";
|
|
378
|
+
EBanker[EBanker["BankerOnly"] = 1] = "BankerOnly";
|
|
379
|
+
EBanker[EBanker["NotBankerOnly"] = 2] = "NotBankerOnly";
|
|
380
|
+
})(EBanker || (EBanker = {}));
|
|
381
|
+
var EBetBuilder;
|
|
382
|
+
(function (EBetBuilder) {
|
|
383
|
+
EBetBuilder[EBetBuilder["Any"] = 0] = "Any";
|
|
384
|
+
EBetBuilder[EBetBuilder["BetBuilderOnly"] = 1] = "BetBuilderOnly";
|
|
385
|
+
EBetBuilder[EBetBuilder["NotBetBuilderOnly"] = 2] = "NotBetBuilderOnly";
|
|
386
|
+
})(EBetBuilder || (EBetBuilder = {}));
|
|
387
|
+
var EWalletTypes;
|
|
388
|
+
(function (EWalletTypes) {
|
|
389
|
+
EWalletTypes[EWalletTypes["RealCash"] = 0] = "RealCash";
|
|
390
|
+
EWalletTypes[EWalletTypes["BonusMoney"] = 1] = "BonusMoney";
|
|
391
|
+
EWalletTypes[EWalletTypes["Mixed"] = 2] = "Mixed";
|
|
392
|
+
})(EWalletTypes || (EWalletTypes = {}));
|
|
393
|
+
var EChallengesTabs;
|
|
394
|
+
(function (EChallengesTabs) {
|
|
395
|
+
EChallengesTabs[EChallengesTabs["Promo"] = 0] = "Promo";
|
|
396
|
+
EChallengesTabs[EChallengesTabs["Active"] = 1] = "Active";
|
|
397
|
+
EChallengesTabs[EChallengesTabs["Pending"] = 2] = "Pending";
|
|
398
|
+
EChallengesTabs[EChallengesTabs["Finished"] = 3] = "Finished";
|
|
399
|
+
EChallengesTabs[EChallengesTabs["Code"] = 4] = "Code";
|
|
400
|
+
})(EChallengesTabs || (EChallengesTabs = {}));
|
|
401
|
+
var EChallengeDetailsTabs;
|
|
402
|
+
(function (EChallengeDetailsTabs) {
|
|
403
|
+
EChallengeDetailsTabs[EChallengeDetailsTabs["Levels"] = 0] = "Levels";
|
|
404
|
+
EChallengeDetailsTabs[EChallengeDetailsTabs["Games"] = 1] = "Games";
|
|
405
|
+
EChallengeDetailsTabs[EChallengeDetailsTabs["Events"] = 2] = "Events";
|
|
406
|
+
EChallengeDetailsTabs[EChallengeDetailsTabs["Rules"] = 3] = "Rules";
|
|
407
|
+
})(EChallengeDetailsTabs || (EChallengeDetailsTabs = {}));
|
|
408
|
+
const HistoryItemLevelStatusDictionary = ['Completed', 'Expired', 'Forfeited'];
|
|
409
|
+
var EHistoryItemLevelStatus;
|
|
410
|
+
(function (EHistoryItemLevelStatus) {
|
|
411
|
+
EHistoryItemLevelStatus[EHistoryItemLevelStatus["Completed"] = 0] = "Completed";
|
|
412
|
+
EHistoryItemLevelStatus[EHistoryItemLevelStatus["Expired"] = 1] = "Expired";
|
|
413
|
+
EHistoryItemLevelStatus[EHistoryItemLevelStatus["Forfeited"] = 2] = "Forfeited";
|
|
414
|
+
})(EHistoryItemLevelStatus || (EHistoryItemLevelStatus = {}));
|
|
415
|
+
var EPostMessageRequestType;
|
|
416
|
+
(function (EPostMessageRequestType) {
|
|
417
|
+
EPostMessageRequestType["ChallengesHistory"] = "ChallengesHistoryRequest";
|
|
418
|
+
EPostMessageRequestType["ChallengePromoTab"] = "ChallengePromoTabRequest";
|
|
419
|
+
EPostMessageRequestType["ClaimChallengeByCode"] = "ClaimChallengeByCodeRequest";
|
|
420
|
+
EPostMessageRequestType["ChallengeJoin"] = "ChallengeJoinRequest";
|
|
421
|
+
EPostMessageRequestType["RedirectToDepositPage"] = "RedirectToDepositPage";
|
|
422
|
+
EPostMessageRequestType["ClaimChallengeByButton"] = "ClaimChallengeByButtonRequest";
|
|
423
|
+
EPostMessageRequestType["GetChallengeGames"] = "GetChallengeGamesRequest";
|
|
424
|
+
EPostMessageRequestType["ChallengeIsNew"] = "ChallengeIsNewRequest";
|
|
425
|
+
EPostMessageRequestType["ChallengeInGameRedirect"] = "ChallengeInGameRedirect";
|
|
426
|
+
EPostMessageRequestType["ForfeitChallenge"] = "ForfeitChallengeRequest";
|
|
427
|
+
})(EPostMessageRequestType || (EPostMessageRequestType = {}));
|
|
428
|
+
var EPostMessageResponseType;
|
|
429
|
+
(function (EPostMessageResponseType) {
|
|
430
|
+
EPostMessageResponseType["ChallengesHistory"] = "ChallengesHistoryResponse";
|
|
431
|
+
EPostMessageResponseType["ChallengePromoTab"] = "ChallengePromoTabResponse";
|
|
432
|
+
EPostMessageResponseType["ClaimChallengeByCode"] = "ClaimChallengeByCodeResponse";
|
|
433
|
+
EPostMessageResponseType["ChallengeJoin"] = "ChallengeJoinResponse";
|
|
434
|
+
EPostMessageResponseType["ClaimChallengeByButton"] = "ClaimChallengeByButtonResponse";
|
|
435
|
+
EPostMessageResponseType["GetChallengeGames"] = "GetChallengeGamesResponse";
|
|
436
|
+
EPostMessageResponseType["ChallengeIsNew"] = "ChallengeIsNewResponse";
|
|
437
|
+
EPostMessageResponseType["ForfeitChallenge"] = "ForfeitChallengeResponse";
|
|
438
|
+
EPostMessageResponseType["ChangeChallengeProgressStatus"] = "ChangeChallengeProgressStatus";
|
|
439
|
+
EPostMessageResponseType["ChallengeChangeStatusNotification"] = "ChallengeChangeStatusNotification";
|
|
440
|
+
EPostMessageResponseType["ChallengeForfeitNotification"] = "ChallengeForfeitNotification";
|
|
441
|
+
EPostMessageResponseType["UpdateChallengeProgress"] = "UpdateChallengeProgress";
|
|
442
|
+
EPostMessageResponseType["NewChallengeProgressGranted"] = "NewChallengeProgressGranted";
|
|
443
|
+
})(EPostMessageResponseType || (EPostMessageResponseType = {}));
|
|
444
|
+
|
|
445
|
+
const crossSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTIuNSAxNy41TDE3LjUgMi41IiBzdHJva2U9IndoaXRlIiBzdHJva2Utd2lkdGg9IjEuMDA0NTkiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+CjxwYXRoIGQ9Ik0yLjUgMi41TDE3LjUgMTcuNSIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIxLjAwNDU5IiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K';
|
|
446
|
+
|
|
447
|
+
const errorSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUiIGhlaWdodD0iMTUiIHZpZXdCb3g9IjAgMCAxNSAxNSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03LjMzMzMzIDEuMzMzMzNDNC4wMTk2MiAxLjMzMzMzIDEuMzMzMzMgNC4wMTk2MiAxLjMzMzMzIDcuMzMzMzNDMS4zMzMzMyAxMC42NDcgNC4wMTk2MiAxMy4zMzMzIDcuMzMzMzMgMTMuMzMzM0MxMC42NDcgMTMuMzMzMyAxMy4zMzMzIDEwLjY0NyAxMy4zMzMzIDcuMzMzMzNDMTMuMzMzMyA0LjAxOTYyIDEwLjY0NyAxLjMzMzMzIDcuMzMzMzMgMS4zMzMzM1pNMCA3LjMzMzMzQzAgMy4yODMyNSAzLjI4MzI1IDAgNy4zMzMzMyAwQzExLjM4MzQgMCAxNC42NjY3IDMuMjgzMjUgMTQuNjY2NyA3LjMzMzMzQzE0LjY2NjcgMTEuMzgzNCAxMS4zODM0IDE0LjY2NjcgNy4zMzMzMyAxNC42NjY3QzMuMjgzMjUgMTQuNjY2NyAwIDExLjM4MzQgMCA3LjMzMzMzWk03LjMzMzMzIDRDNy43MDE1MiA0IDggNC4yOTg0OCA4IDQuNjY2NjdWNy4zMzMzM0M4IDcuNzAxNTIgNy43MDE1MiA4IDcuMzMzMzMgOEM2Ljk2NTE0IDggNi42NjY2NyA3LjcwMTUyIDYuNjY2NjcgNy4zMzMzM1Y0LjY2NjY3QzYuNjY2NjcgNC4yOTg0OCA2Ljk2NTE0IDQgNy4zMzMzMyA0Wk02LjY2NjY3IDEwQzYuNjY2NjcgOS42MzE4MSA2Ljk2NTE0IDkuMzMzMzMgNy4zMzMzMyA5LjMzMzMzSDcuMzRDNy43MDgxOSA5LjMzMzMzIDguMDA2NjcgOS42MzE4MSA4LjAwNjY3IDEwQzguMDA2NjcgMTAuMzY4MiA3LjcwODE5IDEwLjY2NjcgNy4zNCAxMC42NjY3SDcuMzMzMzNDNi45NjUxNCAxMC42NjY3IDYuNjY2NjcgMTAuMzY4MiA2LjY2NjY3IDEwWiIgZmlsbD0iI0ZGNEQ0RiIvPgo8L3N2Zz4K';
|
|
448
|
+
|
|
449
|
+
const checkSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUiIGhlaWdodD0iMTUiIHZpZXdCb3g9IjAgMCAxNSAxNSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03LjMzMzMzIDEuMzMzMzNDNC4wMTk2MiAxLjMzMzMzIDEuMzMzMzMgNC4wMTk2MiAxLjMzMzMzIDcuMzMzMzNDMS4zMzMzMyAxMC42NDcgNC4wMTk2MiAxMy4zMzMzIDcuMzMzMzMgMTMuMzMzM0MxMC42NDcgMTMuMzMzMyAxMy4zMzMzIDEwLjY0NyAxMy4zMzMzIDcuMzMzMzNDMTMuMzMzMyA0LjAxOTYyIDEwLjY0NyAxLjMzMzMzIDcuMzMzMzMgMS4zMzMzM1pNMCA3LjMzMzMzQzAgMy4yODMyNSAzLjI4MzI1IDAgNy4zMzMzMyAwQzExLjM4MzQgMCAxNC42NjY3IDMuMjgzMjUgMTQuNjY2NyA3LjMzMzMzQzE0LjY2NjcgMTEuMzgzNCAxMS4zODM0IDE0LjY2NjcgNy4zMzMzMyAxNC42NjY3QzMuMjgzMjUgMTQuNjY2NyAwIDExLjM4MzQgMCA3LjMzMzMzWk0xMC44MDQ3IDQuODYxOTNDMTEuMDY1MSA1LjEyMjI4IDExLjA2NTEgNS41NDQzOSAxMC44MDQ3IDUuODA0NzRMNi44MDQ3NCA5LjgwNDc0QzYuNTQ0MzkgMTAuMDY1MSA2LjEyMjI4IDEwLjA2NTEgNS44NjE5MyA5LjgwNDc0TDMuODYxOTMgNy44MDQ3NEMzLjYwMTU4IDcuNTQ0MzkgMy42MDE1OCA3LjEyMjI4IDMuODYxOTMgNi44NjE5M0M0LjEyMjI4IDYuNjAxNTggNC41NDQzOSA2LjYwMTU4IDQuODA0NzQgNi44NjE5M0w2LjMzMzMzIDguMzkwNTJMOS44NjE5MyA0Ljg2MTkzQzEwLjEyMjMgNC42MDE1OCAxMC41NDQ0IDQuNjAxNTggMTAuODA0NyA0Ljg2MTkzWiIgZmlsbD0iIzAwRkE1QSIvPgo8L3N2Zz4K';
|
|
450
|
+
|
|
451
|
+
const casinoChallengesOverlayDrawerCss = "@import url(\"https://fonts.googleapis.com/css2?family=Teachers:ital,wght@0,400..800;1,400..800&display=swap\");\n.container {\n z-index: 301;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n container-name: challenges-game-page;\n container-type: size;\n}\n\n.mobile .challenges__drawer {\n width: 100%;\n height: 100%;\n left: 0;\n bottom: 0;\n border-radius: 0;\n backdrop-filter: blur(16px);\n border: none;\n max-width: none;\n min-width: initial;\n}\n.mobile .challenges__drawer .content-spacer {\n margin-bottom: 32px;\n}\n.mobile .challenges__drawer .content-spacer.one-slide {\n margin-bottom: 38px;\n}\n.mobile .challenges__drawer__content {\n padding: 16px 0 0;\n}\n.mobile .challenges__drawer__content .content-details {\n height: calc(100% - 30px);\n}\n.mobile .challenges__drawer__title {\n height: 26px;\n font-size: var(--emw--font-size-large, 18px);\n}\n.mobile .challenges__drawer__close {\n right: 16px;\n width: 26px;\n height: 26px;\n}\n.mobile .challenges__drawer__close img {\n width: 14px;\n}\n.mobile .challenges__backdrop {\n display: none;\n}\n.mobile .notification {\n padding: 8px 16px;\n gap: 8px;\n}\n.mobile .notification .row {\n margin: 15px 0 14px 0;\n}\n.mobile .notification__icon {\n width: 16px;\n height: 16px;\n}\n.mobile .notification__message {\n font-size: var(--emw--font-size-small, 14px);\n}\n\n.challenges__drawer {\n z-index: 302;\n position: fixed;\n left: 62px;\n bottom: 76px;\n border: 1px solid var(--emw--color-container-border, rgba(255, 255, 255, 0.0705882353));\n background: var(--emw--color-Overlay-Background, rgba(9, 9, 9, 0.8));\n backdrop-filter: blur(11px);\n box-sizing: border-box;\n width: 35%;\n min-width: 400px;\n max-width: 600px;\n height: calc(100% - 20px - 76px);\n border-radius: 30px;\n opacity: 1;\n font-family: var(--emw--font-family-primary, \"Teachers\"), sans-serif;\n container-name: challenges-drawer;\n container-type: size;\n}\n.challenges__drawer__title {\n height: 36px;\n color: var(--emw--color-title, #edeff2);\n text-align: center;\n font-size: var(--emw--font-size-large-xl, 22px);\n font-weight: var(--emw--font-weight-semibold, 600);\n margin: 0;\n position: relative;\n z-index: 1;\n align-content: center;\n}\n.challenges__drawer__close {\n outline: none;\n background: transparent;\n border-radius: 20px;\n border: 1.5px solid var(--emw--color-container-border, rgba(255, 255, 255, 0.0705882353));\n background: var(--emw--color-container-background, rgba(9, 9, 9, 0.5019607843));\n backdrop-filter: blur(6.882352829px);\n cursor: pointer;\n width: 36px;\n height: 36px;\n min-width: 36px;\n min-height: 36px;\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: 0;\n right: 24px;\n}\n.challenges__drawer__content {\n height: 100%;\n position: relative;\n z-index: 2;\n padding: 24px 0 0;\n box-sizing: border-box;\n}\n.challenges__drawer__content .content-header {\n width: 100%;\n flex-shrink: 0;\n}\n.challenges__drawer__content .content-details {\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n}\n.challenges__drawer__content .content-sub-page {\n display: flex;\n height: 100%;\n}\n.challenges__drawer .content-spacer {\n margin-bottom: 24px;\n}\n.challenges__drawer, .challenges__drawer * {\n scrollbar-width: thin;\n scrollbar-color: var(--emw--color-gray-250, rgba(255, 255, 255, 0.3)) transparent;\n}\n.challenges__drawer::-webkit-scrollbar, .challenges__drawer *::-webkit-scrollbar {\n width: 3px;\n}\n.challenges__drawer::-webkit-scrollbar-track, .challenges__drawer *::-webkit-scrollbar-track {\n background: transparent;\n}\n.challenges__drawer::-webkit-scrollbar-thumb, .challenges__drawer *::-webkit-scrollbar-thumb {\n background: var(--emw--color-gray-250, rgba(255, 255, 255, 0.3));\n opacity: 0.3;\n border-radius: 999px;\n transition: none;\n width: 3px;\n}\n.challenges__drawer::-webkit-scrollbar-thumb:hover, .challenges__drawer *::-webkit-scrollbar-thumb:hover {\n background: var(--emw--color-gray-250, rgba(255, 255, 255, 0.3));\n opacity: 0.3;\n width: 3px;\n}\n.challenges__drawer::-webkit-scrollbar-button, .challenges__drawer *::-webkit-scrollbar-button {\n display: none;\n}\n.challenges__backdrop {\n border: none;\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: var(--emw--color-gray-backdrop, rgba(0, 0, 0, 0.6));\n z-index: 301;\n opacity: 1;\n}\n\n.notification {\n display: flex;\n position: fixed;\n z-index: 400;\n align-items: center;\n bottom: 76px;\n right: 0;\n padding: 24px;\n gap: 12px;\n max-width: 445px;\n box-sizing: border-box;\n border-radius: 20px 0 0 20px;\n border-top: 1px solid var(--emw--status-badge-success-color, #d6fff0);\n border-bottom: 1px solid var(--emw--status-badge-success-color, #d6fff0);\n border-left: 1px solid var(--emw--status-badge-success-color, #d6fff0);\n background: var(--emw--background-success-notification, linear-gradient(112deg, rgba(74, 255, 135, 0.2) 0%, rgba(74, 255, 135, 0) 100%));\n backdrop-filter: blur(16px);\n color: var(--emw--color-white, #ffffff);\n font-family: var(--emw--font-family-primary, \"Teachers\"), sans-serif;\n}\n.notification.errored {\n border-top: 1px solid var(--emw--status-badge-red-bg, #d63d1e);\n border-bottom: 1px solid var(--emw--status-badge-red-bg, #d63d1e);\n border-left: 1px solid var(--emw--status-badge-red-bg, #d63d1e);\n background: var(--emw--background-error-notification, rgba(9, 9, 9, 0.4));\n}\n.notification .row {\n display: flex;\n align-items: flex-start;\n}\n.notification__icon {\n width: 18px;\n height: 18px;\n margin-right: 12px;\n}\n.notification__message {\n margin: 0;\n font-size: var(--emw--font-size-medium, 16px);\n font-weight: var(--emw--font-weight-medium, 500);\n}\n.notification__message .active-tab {\n color: var(--emw--border-success-color, #00b74f);\n text-decoration-line: underline;\n cursor: pointer;\n}\n\ncasino-challenges-overlay-drawer-details {\n flex: 1;\n}\n\n@container challenges-game-page (width <= 1430px) {\n .challenges__drawer {\n width: 40%;\n left: 45px;\n }\n}\n@container challenges-game-page (width <= 1250px) {\n .challenges__drawer {\n width: 45%;\n }\n}\n@container challenges-game-page (width <= 1000px) {\n .challenges__drawer {\n width: 50%;\n left: 25px;\n }\n}\n@container challenges-game-page (width <= 800px) {\n .challenges__drawer__content {\n padding: 20px 0 0;\n }\n}\n@container challenges-game-page (height <= 850px) {\n .challenges__drawer {\n bottom: 36px;\n height: calc(100% - 20px - 36px);\n }\n .challenges__drawer .content-spacer {\n margin-bottom: 18px;\n }\n}\n@container challenges-drawer (height <= 760px) {\n .challenges__drawer .content-spacer {\n margin-bottom: 12px;\n }\n}";
|
|
452
|
+
const CasinoChallengesOverlayDrawerStyle0 = casinoChallengesOverlayDrawerCss;
|
|
453
|
+
|
|
454
|
+
const CasinoChallengesOverlayDrawer = class {
|
|
455
|
+
constructor(hostRef) {
|
|
456
|
+
registerInstance(this, hostRef);
|
|
457
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
458
|
+
this.EMPTY_STATE_PAGE_DESCRIPTION_MAP = {
|
|
459
|
+
[EChallengesTabs.Promo]: {
|
|
460
|
+
header: (_a = TRANSLATIONS[this.language]) === null || _a === void 0 ? void 0 : _a.promoTabEmptyHeader,
|
|
461
|
+
description: (_b = TRANSLATIONS[this.language]) === null || _b === void 0 ? void 0 : _b.promoTabEmptyDescription
|
|
462
|
+
},
|
|
463
|
+
[EChallengesTabs.Active]: {
|
|
464
|
+
header: (_c = TRANSLATIONS[this.language]) === null || _c === void 0 ? void 0 : _c.activeTabEmptyHeader,
|
|
465
|
+
description: (_d = TRANSLATIONS[this.language]) === null || _d === void 0 ? void 0 : _d.activeTabEmptyDescription
|
|
466
|
+
},
|
|
467
|
+
[EChallengesTabs.Pending]: {
|
|
468
|
+
header: (_e = TRANSLATIONS[this.language]) === null || _e === void 0 ? void 0 : _e.pendingTabEmptyHeader,
|
|
469
|
+
description: (_f = TRANSLATIONS[this.language]) === null || _f === void 0 ? void 0 : _f.pendingTabEmptyDescription
|
|
470
|
+
},
|
|
471
|
+
[EChallengesTabs.Finished]: {
|
|
472
|
+
header: (_g = TRANSLATIONS[this.language]) === null || _g === void 0 ? void 0 : _g.finishedTabEmptyHeader,
|
|
473
|
+
description: (_h = TRANSLATIONS[this.language]) === null || _h === void 0 ? void 0 : _h.finishedTabEmptyDescription
|
|
474
|
+
}
|
|
475
|
+
};
|
|
476
|
+
this.onActiveChallengeChange = (e) => {
|
|
477
|
+
var _a, _b, _c;
|
|
478
|
+
if (!(e === null || e === void 0 ? void 0 : e.detail)) {
|
|
479
|
+
return;
|
|
480
|
+
}
|
|
481
|
+
this.removeOptedOutChallenge();
|
|
482
|
+
if (this.activeTabIndex === EChallengesTabs.Active) {
|
|
483
|
+
this.updateActiveChallenge((_a = this.activeChallenges) === null || _a === void 0 ? void 0 : _a.find((challenge) => (challenge === null || challenge === void 0 ? void 0 : challenge.Id) === e.detail));
|
|
484
|
+
}
|
|
485
|
+
else if (this.activeTabIndex === EChallengesTabs.Pending) {
|
|
486
|
+
this.updateActiveChallenge((_b = this.pendingChallenges) === null || _b === void 0 ? void 0 : _b.find((challenge) => (challenge === null || challenge === void 0 ? void 0 : challenge.Id) === e.detail));
|
|
487
|
+
}
|
|
488
|
+
else {
|
|
489
|
+
this.updateActiveChallenge((_c = this.promoChallenges) === null || _c === void 0 ? void 0 : _c.find((challenge) => (challenge === null || challenge === void 0 ? void 0 : challenge.Id) === e.detail));
|
|
490
|
+
}
|
|
491
|
+
};
|
|
492
|
+
this.onSeeMoreClick = (e) => {
|
|
493
|
+
this.detailsSubPageInfo = { open: e.detail.open, tab: e.detail.tab };
|
|
494
|
+
};
|
|
495
|
+
this.onLoadMorePlayerHistory = (e) => {
|
|
496
|
+
window.postMessage({
|
|
497
|
+
type: EPostMessageRequestType.ChallengesHistory,
|
|
498
|
+
data: e.detail
|
|
499
|
+
});
|
|
500
|
+
};
|
|
501
|
+
this.isInactiveChallenge = (challenge) => [
|
|
502
|
+
EChallengeProgressStatus.Awaiting,
|
|
503
|
+
EChallengeProgressStatus.Forfeited,
|
|
504
|
+
EChallengeProgressStatus.Completed,
|
|
505
|
+
EChallengeProgressStatus.Expired
|
|
506
|
+
].includes(challenge.Status) || challenge.ChallengeStatus === EChallengeStatus.Paused;
|
|
507
|
+
this.updateActiveChallenge = (challenge) => {
|
|
508
|
+
var _a;
|
|
509
|
+
this.activeChallenge = challenge;
|
|
510
|
+
this.activeProgressId = (_a = this.activeChallenge) === null || _a === void 0 ? void 0 : _a.Id;
|
|
511
|
+
};
|
|
512
|
+
this.removeOptedOutChallenge = () => {
|
|
513
|
+
var _a;
|
|
514
|
+
if (this.isOptedOut) {
|
|
515
|
+
this.isOptedOut = false;
|
|
516
|
+
this.activeChallenges = (_a = this.activeChallenges) === null || _a === void 0 ? void 0 : _a.filter((activeChallenge) => { var _a; return (activeChallenge === null || activeChallenge === void 0 ? void 0 : activeChallenge.Id) !== ((_a = this.activeChallenge) === null || _a === void 0 ? void 0 : _a.Id); });
|
|
517
|
+
this.activeChallenge = null;
|
|
518
|
+
}
|
|
519
|
+
};
|
|
520
|
+
this.handleTabClick = (event) => {
|
|
521
|
+
if (event.detail !== this.activeTabIndex) {
|
|
522
|
+
this.removeOptedOutChallenge();
|
|
523
|
+
this.activeTabIndex = event.detail;
|
|
524
|
+
if (this.activeTabIndex === EChallengesTabs.Promo) {
|
|
525
|
+
window.postMessage({
|
|
526
|
+
type: EPostMessageRequestType.ChallengePromoTab,
|
|
527
|
+
data: {}
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
if (this.activeTabIndex === EChallengesTabs.Active) {
|
|
531
|
+
this.updateActiveChallenge(this.activeChallenges[0]);
|
|
532
|
+
}
|
|
533
|
+
if (this.activeTabIndex === EChallengesTabs.Pending) {
|
|
534
|
+
this.updateActiveChallenge(this.pendingChallenges[0]);
|
|
535
|
+
}
|
|
536
|
+
if (this.activeTabIndex === EChallengesTabs.Finished) {
|
|
537
|
+
window.postMessage({
|
|
538
|
+
type: EPostMessageRequestType.ChallengesHistory,
|
|
539
|
+
data: {
|
|
540
|
+
PageSize: 20,
|
|
541
|
+
PageNumber: 0
|
|
542
|
+
}
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
if (event.detail !== EChallengesTabs.Code)
|
|
546
|
+
this.emptyState = this.EMPTY_STATE_PAGE_DESCRIPTION_MAP[event.detail];
|
|
547
|
+
}
|
|
548
|
+
};
|
|
549
|
+
this.openNotification = (notification) => {
|
|
550
|
+
this.notification = notification;
|
|
551
|
+
setTimeout(() => (this.notification = null), 10000);
|
|
552
|
+
};
|
|
553
|
+
this.renderNotification = () => {
|
|
554
|
+
var _a, _b, _c;
|
|
555
|
+
return (h("div", { class: `notification ${((_a = this.notification) === null || _a === void 0 ? void 0 : _a.errored) ? 'errored' : ''}` }, h("div", { class: "row" }, h("img", { src: ((_b = this.notification) === null || _b === void 0 ? void 0 : _b.errored) ? errorSvg : checkSvg, class: "notification__icon", alt: "" }), h("p", { class: "notification__message" }, (_c = this.notification) === null || _c === void 0 ? void 0 : _c.message))));
|
|
556
|
+
};
|
|
557
|
+
this.renderHeader = (isMobile) => {
|
|
558
|
+
return (h("div", null, h("h1", { class: "challenges__drawer__title" }, h("span", null, translate('title', this.language)), h("button", { class: "challenges__drawer__close", onClick: this.onCloseClick }, h("img", { src: crossSvg, alt: "" }))), h("casino-challenges-overlay-tabs", { onTabClick: this.handleTabClick, activeTabIndex: this.activeTabIndex, activeTabHasNotification: false, pendingTabHasNotification: false, language: this.language, "is-mobile": isMobile })));
|
|
559
|
+
};
|
|
560
|
+
this.isEmptyState = () => {
|
|
561
|
+
if (!this.loading && this.activeTabIndex !== EChallengesTabs.Code) {
|
|
562
|
+
if (this.activeTabIndex === EChallengesTabs.Active && !this.activeChallenges.length) {
|
|
563
|
+
return true;
|
|
564
|
+
}
|
|
565
|
+
else if (this.activeTabIndex === EChallengesTabs.Pending && !this.pendingChallenges.length) {
|
|
566
|
+
return true;
|
|
567
|
+
}
|
|
568
|
+
else if (this.activeTabIndex === EChallengesTabs.Promo && !this.promoChallenges.length) {
|
|
569
|
+
return true;
|
|
570
|
+
}
|
|
571
|
+
else if (this.activeTabIndex === EChallengesTabs.Finished && !this.playerHistory.length) {
|
|
572
|
+
return true;
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
return false;
|
|
576
|
+
};
|
|
577
|
+
this.renderEmptyState = (isMobile) => {
|
|
578
|
+
var _a, _b;
|
|
579
|
+
return (h("div", null, this.renderHeader(isMobile), h("casino-challenges-empty-state", { header: (_a = this.emptyState) === null || _a === void 0 ? void 0 : _a.header, description: (_b = this.emptyState) === null || _b === void 0 ? void 0 : _b.description, "is-mobile": isMobile })));
|
|
580
|
+
};
|
|
581
|
+
this.renderFinishedTab = (isMobile) => {
|
|
582
|
+
return (h("div", null, this.renderHeader(isMobile), h("casino-challenges-overlay-drawer-history", { mbSource: this.mbSource, clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, translationUrl: this.translationUrl, language: this.language, isMobile: isMobile, historyItems: this.playerHistory, hasMore: this.hasMorePlayerHistory, onLoadMore: this.onLoadMorePlayerHistory, loading: this.loading })));
|
|
583
|
+
};
|
|
584
|
+
this.renderCodeTab = (isMobile) => {
|
|
585
|
+
return (h("div", null, this.renderHeader(isMobile), h("casino-challenges-claim-code", { "is-mobile": isMobile })));
|
|
586
|
+
};
|
|
587
|
+
this.renderChallengeDetails = (isMobile, isUnique = false) => {
|
|
588
|
+
return (h("casino-challenges-overlay-drawer-details", { challenge: this.activeChallenge, swipped: this.swipped, progress: this.progress, "is-mobile": isMobile, "is-unique": isUnique, "is-opted-out": this.isOptedOut, "active-challenges-tab-index": this.activeTabIndex, onSeeMoreClick: this.onSeeMoreClick, detailsSubPageInfo: this.detailsSubPageInfo, challengeGames: this.challengeGames, onCloseClick: this.onCloseClick }));
|
|
589
|
+
};
|
|
590
|
+
this.renderChallengesTabs = (isMobile) => {
|
|
591
|
+
const challenges = this.activeTabIndex === EChallengesTabs.Active
|
|
592
|
+
? this.activeChallenges
|
|
593
|
+
: this.activeTabIndex === EChallengesTabs.Pending
|
|
594
|
+
? this.pendingChallenges
|
|
595
|
+
: this.promoChallenges;
|
|
596
|
+
const isUnique = challenges.length === 1;
|
|
597
|
+
return (h("swipe-up", { onSwippedUp: (e) => {
|
|
598
|
+
this.swipped = e.detail.swipped;
|
|
599
|
+
this.progress = e.detail.progress;
|
|
600
|
+
}, isMobile: isMobile, isOneSlider: isUnique }, h("div", { class: "content-header", slot: "header" }, this.renderHeader(isMobile), h("div", { class: { 'content-spacer': this.swipped || !isMobile, 'one-slide': isUnique && this.swipped } }, h("casino-challenges-overlay-slider", { mbSource: this.mbSource, clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, translationUrl: this.translationUrl, language: this.language, challenges: challenges, isMobile: isMobile, onActiveChallengeChange: this.onActiveChallengeChange, initialProgressId: this.activeProgressId, activeTabIndex: this.activeTabIndex }))), h("div", { class: "content-details", slot: "details" }, this.renderChallengeDetails(isMobile, isUnique))));
|
|
601
|
+
};
|
|
602
|
+
this.onCloseClick = () => {
|
|
603
|
+
var _a, _b;
|
|
604
|
+
this.pendingChallenges = (_a = this.pendingChallenges) === null || _a === void 0 ? void 0 : _a.filter((c) => c.Status === EChallengeProgressStatus.Awaiting);
|
|
605
|
+
this.activeChallenges = (_b = this.activeChallenges) === null || _b === void 0 ? void 0 : _b.filter((challenge) => !this.isInactiveChallenge(challenge));
|
|
606
|
+
this.detailsSubPageInfo = { open: false, tab: null };
|
|
607
|
+
this.loading = false;
|
|
608
|
+
this.isOptedOut = false;
|
|
609
|
+
this.handleClose();
|
|
610
|
+
};
|
|
611
|
+
this.mbSource = undefined;
|
|
612
|
+
this.clientStyling = undefined;
|
|
613
|
+
this.clientStylingUrl = undefined;
|
|
614
|
+
this.translationUrl = '';
|
|
615
|
+
this.language = 'en';
|
|
616
|
+
this.isOpen = false;
|
|
617
|
+
this.handleClose = () => { };
|
|
618
|
+
this.challenges = [];
|
|
619
|
+
this.initialProgressId = '';
|
|
620
|
+
this.activeChallenge = null;
|
|
621
|
+
this.activeProgressId = '';
|
|
622
|
+
this.activeTabIndex = EChallengesTabs.Active;
|
|
623
|
+
this.error = '';
|
|
624
|
+
this.hasError = false;
|
|
625
|
+
this.swipped = false;
|
|
626
|
+
this.detailsSubPageInfo = undefined;
|
|
627
|
+
this.progress = 0;
|
|
628
|
+
this.loading = false;
|
|
629
|
+
this.notification = null;
|
|
630
|
+
this.optOutModaIsOpen = false;
|
|
631
|
+
this.isOptedOut = false;
|
|
632
|
+
this.prevUpdateEvent = undefined;
|
|
633
|
+
this.challengeGames = [];
|
|
634
|
+
this.activeChallenges = [];
|
|
635
|
+
this.pendingChallenges = [];
|
|
636
|
+
this.promoChallenges = [];
|
|
637
|
+
this.playerHistory = [];
|
|
638
|
+
this.hasMorePlayerHistory = false;
|
|
639
|
+
this.emptyState = {
|
|
640
|
+
header: (_j = TRANSLATIONS[this.language]) === null || _j === void 0 ? void 0 : _j.activeTabEmptyHeader,
|
|
641
|
+
description: (_k = TRANSLATIONS[this.language]) === null || _k === void 0 ? void 0 : _k.activeTabEmptyDescription
|
|
642
|
+
};
|
|
643
|
+
}
|
|
644
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
645
|
+
if (newValue != oldValue) {
|
|
646
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
handleClientStylingUrlChange(newValue, oldValue) {
|
|
650
|
+
if (newValue != oldValue) {
|
|
651
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
handleMbSourceChange(newValue, oldValue) {
|
|
655
|
+
if (newValue != oldValue) {
|
|
656
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
handleIsOpenChange(newValue) {
|
|
660
|
+
var _a;
|
|
661
|
+
if (newValue) {
|
|
662
|
+
if (this.initialProgressId && this.challenges.length) {
|
|
663
|
+
this.activeTabIndex = EChallengesTabs.Active;
|
|
664
|
+
this.activeProgressId = this.initialProgressId;
|
|
665
|
+
const currentChallenge = ((_a = this.activeChallenges) === null || _a === void 0 ? void 0 : _a.find((x) => x.Id === this.activeProgressId)) || this.activeChallenges[0];
|
|
666
|
+
this.updateActiveChallenge(currentChallenge || null);
|
|
667
|
+
}
|
|
668
|
+
else {
|
|
669
|
+
this.activeTabIndex = EChallengesTabs.Promo;
|
|
670
|
+
window.postMessage({
|
|
671
|
+
type: EPostMessageRequestType.ChallengePromoTab,
|
|
672
|
+
data: {}
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
onActiveChallengeChanged() {
|
|
678
|
+
this.challengeGames = [];
|
|
679
|
+
}
|
|
680
|
+
onOpenOptOut() {
|
|
681
|
+
this.optOutModaIsOpen = true;
|
|
682
|
+
}
|
|
683
|
+
onCloseOptOut() {
|
|
684
|
+
this.optOutModaIsOpen = false;
|
|
685
|
+
}
|
|
686
|
+
onConfirmOptOut() {
|
|
687
|
+
window.postMessage({
|
|
688
|
+
type: EPostMessageRequestType.ForfeitChallenge,
|
|
689
|
+
data: {
|
|
690
|
+
ChallengeId: this.activeChallenge.ChallengeId
|
|
691
|
+
}
|
|
692
|
+
});
|
|
693
|
+
}
|
|
694
|
+
onChallengeExpired(event) {
|
|
695
|
+
if (!(event === null || event === void 0 ? void 0 : event.detail)) {
|
|
696
|
+
return;
|
|
697
|
+
}
|
|
698
|
+
switch (this.activeTabIndex) {
|
|
699
|
+
case EChallengesTabs.Active:
|
|
700
|
+
this.activeChallenges = this.updateChallenge(this.activeChallenges, event.detail, {
|
|
701
|
+
Status: EChallengeProgressStatus.Expired
|
|
702
|
+
});
|
|
703
|
+
break;
|
|
704
|
+
case EChallengesTabs.Pending:
|
|
705
|
+
this.pendingChallenges = this.updateChallenge(this.pendingChallenges, event.detail, {
|
|
706
|
+
Status: EChallengeProgressStatus.Expired
|
|
707
|
+
});
|
|
708
|
+
break;
|
|
709
|
+
case EChallengesTabs.Promo:
|
|
710
|
+
this.promoChallenges = this.updateChallenge(this.promoChallenges, event.detail, {
|
|
711
|
+
Status: EChallengeProgressStatus.Expired
|
|
712
|
+
});
|
|
713
|
+
break;
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
handleEvent(e) {
|
|
717
|
+
var _a, _b, _c, _d;
|
|
718
|
+
const { type, data, success, errorMessage } = e === null || e === void 0 ? void 0 : e.data;
|
|
719
|
+
console.log('\nReceived event: ', e === null || e === void 0 ? void 0 : e.data.type);
|
|
720
|
+
console.log(e); // left here temporarily for debugging in the developer environment
|
|
721
|
+
switch (type) {
|
|
722
|
+
case EPostMessageResponseType.ChallengePromoTab: {
|
|
723
|
+
if (success) {
|
|
724
|
+
this.promoChallenges = data || [];
|
|
725
|
+
this.updateActiveChallenge(this.promoChallenges[0]);
|
|
726
|
+
}
|
|
727
|
+
else {
|
|
728
|
+
this.promoChallenges = [];
|
|
729
|
+
this.updateActiveChallenge(null);
|
|
730
|
+
this.openNotification({ message: errorMessage, errored: true });
|
|
731
|
+
}
|
|
732
|
+
this.loading = false;
|
|
733
|
+
break;
|
|
734
|
+
}
|
|
735
|
+
case EPostMessageResponseType.ChallengesHistory: {
|
|
736
|
+
if (success) {
|
|
737
|
+
if (this.playerHistory.length < ((_a = e === null || e === void 0 ? void 0 : e.data) === null || _a === void 0 ? void 0 : _a.totalItem)) {
|
|
738
|
+
this.playerHistory = [...this.playerHistory, ...data];
|
|
739
|
+
}
|
|
740
|
+
else {
|
|
741
|
+
this.playerHistory = data;
|
|
742
|
+
}
|
|
743
|
+
this.hasMorePlayerHistory = ((_b = e === null || e === void 0 ? void 0 : e.data) === null || _b === void 0 ? void 0 : _b.totalItem) > this.playerHistory.length;
|
|
744
|
+
}
|
|
745
|
+
else {
|
|
746
|
+
this.openNotification({ message: errorMessage, errored: true });
|
|
747
|
+
}
|
|
748
|
+
this.loading = false;
|
|
749
|
+
break;
|
|
750
|
+
}
|
|
751
|
+
case EPostMessageResponseType.ClaimChallengeByCode: {
|
|
752
|
+
if (success) {
|
|
753
|
+
this.openNotification({ message: translate('claimCodeSuccessMessage', this.language) });
|
|
754
|
+
this.activeChallenges = [...this.activeChallenges, data];
|
|
755
|
+
}
|
|
756
|
+
else {
|
|
757
|
+
this.openNotification({ message: errorMessage, errored: true });
|
|
758
|
+
}
|
|
759
|
+
this.loading = false;
|
|
760
|
+
break;
|
|
761
|
+
}
|
|
762
|
+
case EPostMessageResponseType.ChallengeJoin: {
|
|
763
|
+
if (success) {
|
|
764
|
+
const isJoining = [EChallengeProgressStatus.Paused, EChallengeProgressStatus.Started].includes((_c = this.activeChallenge) === null || _c === void 0 ? void 0 : _c.Status);
|
|
765
|
+
const id = isJoining ? data === null || data === void 0 ? void 0 : data.joinId : data === null || data === void 0 ? void 0 : data.unjoinId;
|
|
766
|
+
const status = isJoining ? EChallengeProgressStatus.InProgress : EChallengeProgressStatus.Paused;
|
|
767
|
+
this.activeChallenges = this.updateChallenge(this.activeChallenges, id, {
|
|
768
|
+
Status: status
|
|
769
|
+
});
|
|
770
|
+
}
|
|
771
|
+
else {
|
|
772
|
+
this.openNotification({ message: errorMessage, errored: true });
|
|
773
|
+
}
|
|
774
|
+
this.loading = false;
|
|
775
|
+
break;
|
|
776
|
+
}
|
|
777
|
+
case EPostMessageResponseType.ChallengeIsNew: {
|
|
778
|
+
if (success) {
|
|
779
|
+
this.updateChallengeByProgressId(data === null || data === void 0 ? void 0 : data.challengeProgressId, { IsNew: false });
|
|
780
|
+
}
|
|
781
|
+
else {
|
|
782
|
+
this.openNotification({ message: errorMessage, errored: true });
|
|
783
|
+
}
|
|
784
|
+
break;
|
|
785
|
+
}
|
|
786
|
+
case EPostMessageResponseType.GetChallengeGames: {
|
|
787
|
+
if (success) {
|
|
788
|
+
this.challengeGames = data;
|
|
789
|
+
}
|
|
790
|
+
else {
|
|
791
|
+
this.openNotification({ message: errorMessage, errored: true });
|
|
792
|
+
}
|
|
793
|
+
this.loading = false;
|
|
794
|
+
break;
|
|
795
|
+
}
|
|
796
|
+
case EPostMessageResponseType.ClaimChallengeByButton: {
|
|
797
|
+
if (success) {
|
|
798
|
+
const challenge = Array.isArray(data) ? data[0] : data;
|
|
799
|
+
if (challenge) {
|
|
800
|
+
challenge.IsNew = false;
|
|
801
|
+
this.activeChallenges = [...this.activeChallenges, challenge];
|
|
802
|
+
this.updateActiveChallenge(challenge);
|
|
803
|
+
this.activeTabIndex = EChallengesTabs.Active;
|
|
804
|
+
this.openNotification({ message: translate('grantClaimByButtonSuccessMessage', this.language) });
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
else {
|
|
808
|
+
this.openNotification({ message: errorMessage, errored: true });
|
|
809
|
+
}
|
|
810
|
+
this.loading = false;
|
|
811
|
+
break;
|
|
812
|
+
}
|
|
813
|
+
case EPostMessageResponseType.ForfeitChallenge: {
|
|
814
|
+
this.optOutModaIsOpen = false;
|
|
815
|
+
if (success) {
|
|
816
|
+
this.openNotification({ message: translate('optOutSuccessMessage', this.language) });
|
|
817
|
+
this.detailsSubPageInfo = { open: false, tab: null };
|
|
818
|
+
this.isOptedOut = true;
|
|
819
|
+
}
|
|
820
|
+
else {
|
|
821
|
+
this.openNotification({ message: errorMessage, errored: true });
|
|
822
|
+
}
|
|
823
|
+
this.loading = false;
|
|
824
|
+
break;
|
|
825
|
+
}
|
|
826
|
+
//
|
|
827
|
+
case EPostMessageResponseType.ChangeChallengeProgressStatus: {
|
|
828
|
+
this.updateChallengeByProgressId(data === null || data === void 0 ? void 0 : data.ChallengeProgressId, { Status: data === null || data === void 0 ? void 0 : data.ChallengeProgressStatus });
|
|
829
|
+
break;
|
|
830
|
+
}
|
|
831
|
+
case EPostMessageResponseType.ChallengeChangeStatusNotification: {
|
|
832
|
+
this.updateChallengeById(data === null || data === void 0 ? void 0 : data.ChallengeId, {
|
|
833
|
+
ChallengeStatus: (data === null || data === void 0 ? void 0 : data.IsEnabled) ? EChallengeStatus.Enabled : EChallengeStatus.Paused
|
|
834
|
+
});
|
|
835
|
+
break;
|
|
836
|
+
}
|
|
837
|
+
case EPostMessageResponseType.ChallengeForfeitNotification: {
|
|
838
|
+
this.updateChallengeById(data === null || data === void 0 ? void 0 : data.ChallengeId, { Status: EChallengeProgressStatus.Forfeited });
|
|
839
|
+
break;
|
|
840
|
+
}
|
|
841
|
+
case EPostMessageResponseType.UpdateChallengeProgress: {
|
|
842
|
+
const newChallenge = data;
|
|
843
|
+
if (!hasUpdateDataChanged(this.prevUpdateEvent, newChallenge)) {
|
|
844
|
+
return;
|
|
845
|
+
}
|
|
846
|
+
this.prevUpdateEvent = newChallenge;
|
|
847
|
+
this.activeChallenges = (_d = this.activeChallenges) === null || _d === void 0 ? void 0 : _d.map((challenge) => {
|
|
848
|
+
if (challenge.Id !== (newChallenge === null || newChallenge === void 0 ? void 0 : newChallenge.ProgressId))
|
|
849
|
+
return challenge;
|
|
850
|
+
const updatedLevels = challenge.LevelProgresses.map((level) => {
|
|
851
|
+
const newLevelData = newChallenge === null || newChallenge === void 0 ? void 0 : newChallenge.Levels.find((l) => l.LevelId === level.LevelId);
|
|
852
|
+
if (!newLevelData)
|
|
853
|
+
return level;
|
|
854
|
+
return Object.assign(Object.assign({}, level), { ProgressStatus: newLevelData.ProgressStatus, ProgressPercentage: newLevelData.ProgressPercentage });
|
|
855
|
+
});
|
|
856
|
+
return Object.assign(Object.assign({}, challenge), { Status: newChallenge === null || newChallenge === void 0 ? void 0 : newChallenge.Status, LevelProgresses: updatedLevels });
|
|
857
|
+
});
|
|
858
|
+
break;
|
|
859
|
+
}
|
|
860
|
+
case EPostMessageResponseType.NewChallengeProgressGranted:
|
|
861
|
+
const isPending = (data === null || data === void 0 ? void 0 : data.Status) === EChallengeProgressStatus.Awaiting;
|
|
862
|
+
const challenges = isPending ? this.pendingChallenges : this.activeChallenges;
|
|
863
|
+
if (challenges === null || challenges === void 0 ? void 0 : challenges.some((x) => x.Id === (data === null || data === void 0 ? void 0 : data.Id)))
|
|
864
|
+
break;
|
|
865
|
+
if (isPending) {
|
|
866
|
+
this.pendingChallenges = [...challenges, data];
|
|
867
|
+
}
|
|
868
|
+
else {
|
|
869
|
+
this.activeChallenges = [...challenges, data];
|
|
870
|
+
}
|
|
871
|
+
break;
|
|
872
|
+
// component loading state processing for requests
|
|
873
|
+
case EPostMessageRequestType.ChallengeJoin:
|
|
874
|
+
case EPostMessageRequestType.GetChallengeGames:
|
|
875
|
+
case EPostMessageRequestType.ClaimChallengeByButton:
|
|
876
|
+
case EPostMessageRequestType.RedirectToDepositPage:
|
|
877
|
+
case EPostMessageRequestType.ChallengeInGameRedirect:
|
|
878
|
+
case EPostMessageRequestType.ChallengesHistory:
|
|
879
|
+
case EPostMessageRequestType.ChallengePromoTab:
|
|
880
|
+
case EPostMessageRequestType.ClaimChallengeByCode:
|
|
881
|
+
case EPostMessageRequestType.ForfeitChallenge:
|
|
882
|
+
this.loading = true;
|
|
883
|
+
break;
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
componentWillLoad() {
|
|
887
|
+
var _a;
|
|
888
|
+
if (this.translationUrl) {
|
|
889
|
+
resolveTranslationUrl(this.translationUrl);
|
|
890
|
+
}
|
|
891
|
+
if ((_a = this.challenges) === null || _a === void 0 ? void 0 : _a.length) {
|
|
892
|
+
const challenges = [...this.challenges];
|
|
893
|
+
this.pendingChallenges = challenges.filter((c) => c.Status === EChallengeProgressStatus.Awaiting);
|
|
894
|
+
this.activeChallenges = challenges.filter((challenge) => !this.isInactiveChallenge(challenge));
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
componentDidLoad() {
|
|
898
|
+
if (this.stylingContainer) {
|
|
899
|
+
if (this.mbSource)
|
|
900
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
901
|
+
if (this.clientStyling)
|
|
902
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
903
|
+
if (this.clientStylingUrl)
|
|
904
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
disconnectedCallback() {
|
|
908
|
+
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
909
|
+
}
|
|
910
|
+
updateChallenge(challenges, progressId, updates) {
|
|
911
|
+
var _a;
|
|
912
|
+
if (((_a = this.activeChallenge) === null || _a === void 0 ? void 0 : _a.Id) === progressId) {
|
|
913
|
+
this.activeChallenge = Object.assign(Object.assign({}, this.activeChallenge), updates);
|
|
914
|
+
}
|
|
915
|
+
return challenges.map((challenge) => (challenge.Id === progressId ? Object.assign(Object.assign({}, challenge), updates) : challenge));
|
|
916
|
+
}
|
|
917
|
+
updateChallengeList(list, challengeId, updates) {
|
|
918
|
+
let changed = false;
|
|
919
|
+
const updated = list.map((challenge) => {
|
|
920
|
+
if (challenge.ChallengeId === challengeId) {
|
|
921
|
+
changed = true;
|
|
922
|
+
return Object.assign(Object.assign({}, challenge), updates);
|
|
923
|
+
}
|
|
924
|
+
return challenge;
|
|
925
|
+
});
|
|
926
|
+
return changed ? updated : list;
|
|
927
|
+
}
|
|
928
|
+
updateChallengeById(challengeId, updates) {
|
|
929
|
+
var _a;
|
|
930
|
+
if (((_a = this.activeChallenge) === null || _a === void 0 ? void 0 : _a.ChallengeId) === challengeId) {
|
|
931
|
+
this.activeChallenge = Object.assign(Object.assign({}, this.activeChallenge), updates);
|
|
932
|
+
}
|
|
933
|
+
this.activeChallenges = this.updateChallengeList(this.activeChallenges, challengeId, updates);
|
|
934
|
+
this.pendingChallenges = this.updateChallengeList(this.pendingChallenges, challengeId, updates);
|
|
935
|
+
this.promoChallenges = this.updateChallengeList(this.promoChallenges, challengeId, updates);
|
|
936
|
+
}
|
|
937
|
+
updateChallengeByProgressId(progressId, updates) {
|
|
938
|
+
var _a;
|
|
939
|
+
if (((_a = this.activeChallenge) === null || _a === void 0 ? void 0 : _a.Id) === progressId) {
|
|
940
|
+
this.activeChallenge = Object.assign(Object.assign({}, this.activeChallenge), updates);
|
|
941
|
+
}
|
|
942
|
+
if (this.activeChallenges.find((x) => x.Id === progressId)) {
|
|
943
|
+
this.activeChallenges = this.activeChallenges.map((challenge) => challenge.Id === progressId ? Object.assign(Object.assign({}, challenge), updates) : challenge);
|
|
944
|
+
}
|
|
945
|
+
else if (this.pendingChallenges.find((x) => x.Id === progressId)) {
|
|
946
|
+
this.pendingChallenges = this.pendingChallenges.map((challenge) => challenge.Id === progressId ? Object.assign(Object.assign({}, challenge), updates) : challenge);
|
|
947
|
+
}
|
|
948
|
+
else {
|
|
949
|
+
this.promoChallenges = this.promoChallenges.map((challenge) => challenge.Id === progressId ? Object.assign(Object.assign({}, challenge), updates) : challenge);
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
renderContent(isMobile, showEmptyState) {
|
|
953
|
+
var _a;
|
|
954
|
+
if (showEmptyState) {
|
|
955
|
+
return this.renderEmptyState(isMobile);
|
|
956
|
+
}
|
|
957
|
+
if ((_a = this.detailsSubPageInfo) === null || _a === void 0 ? void 0 : _a.open) {
|
|
958
|
+
return (h("div", { class: "content-sub-page", slot: "details" }, this.renderChallengeDetails(isMobile)));
|
|
959
|
+
}
|
|
960
|
+
switch (this.activeTabIndex) {
|
|
961
|
+
case EChallengesTabs.Promo:
|
|
962
|
+
case EChallengesTabs.Active:
|
|
963
|
+
case EChallengesTabs.Pending:
|
|
964
|
+
return this.renderChallengesTabs(isMobile);
|
|
965
|
+
case EChallengesTabs.Code:
|
|
966
|
+
return this.renderCodeTab(isMobile);
|
|
967
|
+
case EChallengesTabs.Finished:
|
|
968
|
+
return this.renderFinishedTab(isMobile);
|
|
969
|
+
default:
|
|
970
|
+
return;
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
render() {
|
|
974
|
+
if (!this.isOpen) {
|
|
975
|
+
return;
|
|
976
|
+
}
|
|
977
|
+
const isMobile$1 = isMobile() || window.innerWidth <= 768;
|
|
978
|
+
const showEmptyState = this.isEmptyState();
|
|
979
|
+
return (h("div", { ref: (el) => (this.stylingContainer = el), class: {
|
|
980
|
+
container: true,
|
|
981
|
+
mobile: isMobile$1
|
|
982
|
+
} }, h("div", { class: "challenges__backdrop", onClick: this.onCloseClick }), h("div", { class: "challenges__drawer" }, h("casino-challenge-overlay-background", { empty: showEmptyState }), h("div", { class: "challenges__drawer__content" }, this.renderContent(isMobile$1, showEmptyState)), this.loading && h("casino-challenges-overlay-loader", { "full-size": true, "is-mobile": isMobile$1 }), h("casino-challenge-opt-out-modal", { open: this.optOutModaIsOpen, "is-mobile": isMobile$1, language: this.language })), this.notification && this.renderNotification()));
|
|
983
|
+
}
|
|
984
|
+
static get watchers() { return {
|
|
985
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
986
|
+
"clientStylingUrl": ["handleClientStylingUrlChange"],
|
|
987
|
+
"mbSource": ["handleMbSourceChange"],
|
|
988
|
+
"isOpen": ["handleIsOpenChange"],
|
|
989
|
+
"activeChallenge": ["onActiveChallengeChanged"]
|
|
990
|
+
}; }
|
|
991
|
+
};
|
|
992
|
+
CasinoChallengesOverlayDrawer.style = CasinoChallengesOverlayDrawerStyle0;
|
|
993
|
+
|
|
994
|
+
export { CasinoChallengesOverlayDrawer as C, EHistoryItemLevelStatus as E, HistoryItemLevelStatusDictionary as H, EPostMessageRequestType as a, setClientStylingURL as b, setStreamStyling as c, EChallengesTabs as d, resolveTranslationUrl as r, setClientStyling as s, translate as t };
|