@everymatrix/casino-bonuses-controller 1.22.5
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/README.md +30 -0
- package/dist/casino-bonuses-controller.js +1452 -0
- package/dist/casino-bonuses-controller.js.map +1 -0
- package/index.html +42 -0
- package/index.js +1 -0
- package/package.json +39 -0
- package/public/favicon.png +0 -0
- package/public/reset.css +48 -0
- package/rollup.config.js +59 -0
- package/src/CasinoBonusesController.svelte +882 -0
- package/src/base.ts +175 -0
- package/src/component/CasinoBonusCard.svelte +1154 -0
- package/src/component/CasinoBonusPagination.svelte +192 -0
- package/src/component/CasinoBonusProgress.svelte +97 -0
- package/src/i18n.js +28 -0
- package/src/index.ts +11 -0
- package/src/pagination.js +121 -0
- package/src/translation.js +65 -0
- package/stories/CasinoBonusesController.stories.js +13 -0
- package/tsconfig.json +6 -0
|
@@ -0,0 +1,882 @@
|
|
|
1
|
+
<svelte:options tag={null} />
|
|
2
|
+
<script lang="ts">
|
|
3
|
+
import {onMount} from 'svelte';
|
|
4
|
+
import { _, addNewMessages, setLocale } from './i18n';
|
|
5
|
+
import { isMobile } from 'rvhelper';
|
|
6
|
+
import { BonusControllerTranslations } from './translation';
|
|
7
|
+
import moment from 'moment';
|
|
8
|
+
import '@vaadin/vaadin-date-picker/vaadin-date-picker.js';
|
|
9
|
+
import './component/CasinoBonusCard.svelte'
|
|
10
|
+
import './component/CasinoBonusPagination.svelte'
|
|
11
|
+
|
|
12
|
+
export let endpoint = '';
|
|
13
|
+
export let lang = 'en';
|
|
14
|
+
export let session = '';
|
|
15
|
+
export let currency: string = 'EUR';
|
|
16
|
+
export let limit: string = '';
|
|
17
|
+
export let cmsendpoint: string = '';
|
|
18
|
+
export let clientstyling: string = '';
|
|
19
|
+
export let clientstylingurl: string = '';
|
|
20
|
+
export let translationurl: string = '';
|
|
21
|
+
let userAgent:String = window.navigator.userAgent;
|
|
22
|
+
let mobileView:Boolean = false;
|
|
23
|
+
let bonuses: any = [];
|
|
24
|
+
let isLoading: boolean = true;
|
|
25
|
+
let errorMessage: string = '';
|
|
26
|
+
let currentPage:number = 1;
|
|
27
|
+
let totalItems:number = 0;
|
|
28
|
+
let paginationLimit: number = 2;
|
|
29
|
+
let maxDate:string;
|
|
30
|
+
let lastMonth:string;
|
|
31
|
+
let customStylingContainer: HTMLElement;
|
|
32
|
+
let bonusCode:string = '';
|
|
33
|
+
let invalidBonusField:boolean = true;
|
|
34
|
+
let invalidBonusCode: boolean = false;
|
|
35
|
+
let bonusModal:boolean = false;
|
|
36
|
+
maxDate = moment(new Date()).format('YYYY-MM-DD');
|
|
37
|
+
lastMonth = moment(new Date()).subtract(3, 'months').format('YYYY-MM-DD')
|
|
38
|
+
|
|
39
|
+
let bonusCalendarStartDate:string = lastMonth;
|
|
40
|
+
let bonusCalendarEndDate:string = maxDate;
|
|
41
|
+
let startCalendar:HTMLElement;
|
|
42
|
+
let endCalendar:HTMLElement;
|
|
43
|
+
|
|
44
|
+
let bonusStatus: string = 'active';
|
|
45
|
+
|
|
46
|
+
let isButtonClickable: boolean = true;
|
|
47
|
+
let StatusForFilter = ['active','completed','claimable'];
|
|
48
|
+
let forfeitWalletID = '';
|
|
49
|
+
if (isMobile(userAgent)) {
|
|
50
|
+
mobileView = true;
|
|
51
|
+
paginationLimit = 1;
|
|
52
|
+
}
|
|
53
|
+
let isMounted = false;
|
|
54
|
+
const setClientStyling = (): void => {
|
|
55
|
+
let sheet = document.createElement('style');
|
|
56
|
+
sheet.innerHTML = clientstyling;
|
|
57
|
+
customStylingContainer.appendChild(sheet);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const setClientStylingURL = (): void => {
|
|
61
|
+
let url:URL = new URL(clientstylingurl);
|
|
62
|
+
let cssFile:HTMLElement = document.createElement('style');
|
|
63
|
+
|
|
64
|
+
fetch(url.href)
|
|
65
|
+
.then((res:any) => res.text())
|
|
66
|
+
.then((data:any) => {
|
|
67
|
+
cssFile.innerHTML = data
|
|
68
|
+
|
|
69
|
+
setTimeout(() => { customStylingContainer.appendChild(cssFile) }, 1);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
const setTranslationUrl = ():void => {
|
|
73
|
+
let url:string = translationurl;
|
|
74
|
+
|
|
75
|
+
fetch(url).then((res:any) => res.json())
|
|
76
|
+
.then((res) => {
|
|
77
|
+
Object.keys(res).forEach((item:any):void => {
|
|
78
|
+
addNewMessages(item, res[item]);
|
|
79
|
+
});
|
|
80
|
+
}).catch((err:any) => {
|
|
81
|
+
console.log(err);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
Object.keys(BonusControllerTranslations).forEach((item: any) => {
|
|
85
|
+
addNewMessages(item, BonusControllerTranslations[item]);
|
|
86
|
+
});
|
|
87
|
+
onMount(() => {
|
|
88
|
+
window.addEventListener('message', messageHandler, false);
|
|
89
|
+
isMounted = true;
|
|
90
|
+
return () => {
|
|
91
|
+
startCalendar.removeEventListener('change', startCalendarHandler);
|
|
92
|
+
endCalendar.removeEventListener('change', endCalendarHandler);
|
|
93
|
+
window.removeEventListener('message', messageHandler);
|
|
94
|
+
isMounted = false;
|
|
95
|
+
}
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
const messageHandler = (e: any): void=>{
|
|
99
|
+
switch (e.data.type) {
|
|
100
|
+
case 'PaginationChange':
|
|
101
|
+
currentPage = e.data.page;
|
|
102
|
+
getPage(currentPage);
|
|
103
|
+
break;
|
|
104
|
+
case 'OnBonusClaimed':
|
|
105
|
+
claimBonus(e.data.bonusCode);
|
|
106
|
+
break;
|
|
107
|
+
case 'OnBonusForfeit':
|
|
108
|
+
forfeitWalletID = e.data.bonus.id;
|
|
109
|
+
bonusModal = true;
|
|
110
|
+
default:
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const init = async (): Promise<void> =>{
|
|
116
|
+
getPage(1);
|
|
117
|
+
setLocale(lang);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const claimBonus = async (bonusCode: string,claimByCode?: boolean): Promise<any>=>{
|
|
121
|
+
isButtonClickable = false;
|
|
122
|
+
const response = await claimBonusRequest(bonusCode);
|
|
123
|
+
if(!response.success) {
|
|
124
|
+
errorMessage = response.errorMessage;
|
|
125
|
+
if(claimByCode){
|
|
126
|
+
invalidBonusCode = true;
|
|
127
|
+
}else{
|
|
128
|
+
window.postMessage({ type:'OnBonusClaimError',message:errorMessage,bonusCode:bonusCode});
|
|
129
|
+
}
|
|
130
|
+
}else{
|
|
131
|
+
invalidBonusCode = false;
|
|
132
|
+
getPage(1);
|
|
133
|
+
}
|
|
134
|
+
window.postMessage({ type:'OnBonusClaimedDone'});
|
|
135
|
+
isButtonClickable = true;
|
|
136
|
+
};
|
|
137
|
+
const claimBonusRequest = async (bonusCode: string): Promise<any> =>{
|
|
138
|
+
return await fetchBase(endpoint + "/v1/bonus/claim", {
|
|
139
|
+
method: "PUT",
|
|
140
|
+
body: JSON.stringify({
|
|
141
|
+
bonusCode,
|
|
142
|
+
currency
|
|
143
|
+
}),
|
|
144
|
+
headers: {
|
|
145
|
+
'x-SessionId': session,
|
|
146
|
+
'accept': 'text/plain',
|
|
147
|
+
'Content-Type': 'application/json-patch+json',
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
const forfeitBonus = async (bonusCode: string): Promise<any> =>{
|
|
152
|
+
isButtonClickable = false;
|
|
153
|
+
const response = await forfeitBonusRequest(bonusCode);
|
|
154
|
+
if(!response.success) {
|
|
155
|
+
errorMessage = response.errorMessage;
|
|
156
|
+
}else{
|
|
157
|
+
getPage(1);
|
|
158
|
+
}
|
|
159
|
+
window.postMessage({ type:'OnBonusForfeitedDone'});
|
|
160
|
+
isButtonClickable = true;
|
|
161
|
+
bonusModal = false;
|
|
162
|
+
};
|
|
163
|
+
const forfeitBonusRequest = async(bonusID: string): Promise<any> => {
|
|
164
|
+
const url = new URL(`${endpoint}/v1/bonus/forfeit`);
|
|
165
|
+
const params = {
|
|
166
|
+
bonusID,
|
|
167
|
+
lang
|
|
168
|
+
};
|
|
169
|
+
Object.keys(params).map(k => {
|
|
170
|
+
url.searchParams.append(k, params[k])
|
|
171
|
+
});
|
|
172
|
+
return await fetchBase(url, {
|
|
173
|
+
method: "DELETE",
|
|
174
|
+
headers: {
|
|
175
|
+
'x-SessionId': session,
|
|
176
|
+
'accept': 'text/plain',
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
const closeBonusModal = (): void => {
|
|
181
|
+
window.postMessage({ type: 'EnableScroll'}, window.location.href);
|
|
182
|
+
window.postMessage({ type: 'OnBonusForfeitedDone'});
|
|
183
|
+
bonusModal = false;
|
|
184
|
+
}
|
|
185
|
+
const getPage = async (pageNumber: number): Promise<any> =>{
|
|
186
|
+
if(currentPage !== pageNumber){
|
|
187
|
+
currentPage = pageNumber;
|
|
188
|
+
}
|
|
189
|
+
const offset = (pageNumber - 1) * Number(limit);
|
|
190
|
+
isLoading = true;
|
|
191
|
+
bonuses = [];
|
|
192
|
+
const response = await getBonuses(endpoint, session,offset, {
|
|
193
|
+
lang,
|
|
194
|
+
limit
|
|
195
|
+
});
|
|
196
|
+
if(!response.success) {
|
|
197
|
+
errorMessage = response.errorMessage;
|
|
198
|
+
}else{
|
|
199
|
+
totalItems = response.total;
|
|
200
|
+
bonuses = (response.items || response.bonuses);
|
|
201
|
+
}
|
|
202
|
+
isLoading = false;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
const getBonuses = async (endpoint: string, session: string, offset: number, options: any = {}):Promise<any> => {
|
|
206
|
+
const {
|
|
207
|
+
limit,
|
|
208
|
+
lang: language,
|
|
209
|
+
...rest
|
|
210
|
+
} = options;
|
|
211
|
+
const path = (() => {
|
|
212
|
+
switch (bonusStatus) {
|
|
213
|
+
case 'claimable':
|
|
214
|
+
return bonusStatus;
|
|
215
|
+
default:
|
|
216
|
+
return 'granted';
|
|
217
|
+
}
|
|
218
|
+
})();
|
|
219
|
+
const params = {
|
|
220
|
+
pagination: `limit=${limit},offset=${offset}`,
|
|
221
|
+
language,
|
|
222
|
+
...rest,
|
|
223
|
+
sortOrder: 'desc'
|
|
224
|
+
};
|
|
225
|
+
if(bonusStatus === 'completed'){
|
|
226
|
+
let startDate: string = new Date(bonusCalendarStartDate).toISOString();
|
|
227
|
+
let endDate: string = new Date(bonusCalendarEndDate+' 23:59:59').toISOString();
|
|
228
|
+
params.startTime = startDate;
|
|
229
|
+
params.endTime = endDate;
|
|
230
|
+
params.type = 'standard,freeBet,freeRound,cashBack,stakeBack,oddsBoost,wagering';
|
|
231
|
+
params.status = 'completed,released,forfeited,expired,closed';
|
|
232
|
+
}
|
|
233
|
+
if(bonusStatus === 'active'){
|
|
234
|
+
params.type = 'standard,freeBet,freeRound,cashBack,stakeBack,oddsBoost,wagering';
|
|
235
|
+
params.status = 'active';
|
|
236
|
+
}
|
|
237
|
+
const url = new URL(`${endpoint}/v1/bonus/${path}`);
|
|
238
|
+
if(bonusStatus !== 'claimable'){
|
|
239
|
+
url.searchParams.append('expand' , 'freeSpin');
|
|
240
|
+
}else{
|
|
241
|
+
delete params.sortOrder;
|
|
242
|
+
}
|
|
243
|
+
Object.keys(params).map(k => {
|
|
244
|
+
url.searchParams.append(k, params[k])
|
|
245
|
+
});
|
|
246
|
+
return await fetchBase(url, {
|
|
247
|
+
headers: {
|
|
248
|
+
...(session ? { 'x-SessionId': session } : {}),
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
const classWithPart = (partAndClass, extraClass = ''): object => ({
|
|
254
|
+
part: partAndClass,
|
|
255
|
+
class: [partAndClass, extraClass].join(' '),
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
const fetchBase = async (url, options = {}): Promise<any> => {
|
|
259
|
+
let res;
|
|
260
|
+
res = await fetch(url, options);
|
|
261
|
+
if(res.ok === false){
|
|
262
|
+
return {
|
|
263
|
+
errorMessage: res.status
|
|
264
|
+
}
|
|
265
|
+
}else{
|
|
266
|
+
res = await res.json();
|
|
267
|
+
return res;
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
const startCalendarHandler = (e: any): void => {
|
|
272
|
+
bonusCalendarStartDate = e.target.value;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
const endCalendarHandler = (e: any): void => {
|
|
276
|
+
bonusCalendarEndDate = e.target.value;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
const setCalendarEventListener = (): void => {
|
|
280
|
+
startCalendar.addEventListener('change', startCalendarHandler, false);
|
|
281
|
+
endCalendar.addEventListener('change', endCalendarHandler, false);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
const checkBonusCode = (): boolean => {
|
|
285
|
+
invalidBonusCode = false;
|
|
286
|
+
if (bonusCode) {
|
|
287
|
+
return true;
|
|
288
|
+
} else {
|
|
289
|
+
return false;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
const validateBonusCode = (): void => {
|
|
294
|
+
invalidBonusField = !checkBonusCode();
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
$: startCalendar && endCalendar && setCalendarEventListener();
|
|
298
|
+
$: classWithPartMatchMobile = (partAndClass, extraClass = '') =>
|
|
299
|
+
classWithPart(`${partAndClass}${mobileView ? ` ${partAndClass}Mobile` : ''}`, extraClass);
|
|
300
|
+
|
|
301
|
+
$: initialLoad = endpoint && session && lang && limit;
|
|
302
|
+
$: initialLoad && init();
|
|
303
|
+
$: clientstyling && customStylingContainer && setClientStyling();
|
|
304
|
+
$: clientstylingurl && customStylingContainer && setClientStylingURL();
|
|
305
|
+
$: translationurl && setTranslationUrl();
|
|
306
|
+
</script>
|
|
307
|
+
|
|
308
|
+
<div {...classWithPart('BonusesController')} bind:this={customStylingContainer}>
|
|
309
|
+
<div {...classWithPartMatchMobile('BonusFilterWrapper')}>
|
|
310
|
+
<div class="BonusFilterContainer" part="BonusFilterContainer">
|
|
311
|
+
{#each StatusForFilter as status}
|
|
312
|
+
<button type="button" {...classWithPartMatchMobile('BonusStatusFilter')} class:active={status === bonusStatus} on:click={() => {bonusStatus = status; getPage(1)}} disabled={isLoading}>{status}</button>
|
|
313
|
+
{/each}
|
|
314
|
+
</div>
|
|
315
|
+
</div>
|
|
316
|
+
{#if bonusStatus === 'claimable'}
|
|
317
|
+
<div {...classWithPartMatchMobile('BonusCodeContainer')}>
|
|
318
|
+
<label for="BonusCode"><span class="Asterisk">*</span>{$_(`bonus.bonusCode`)}</label>
|
|
319
|
+
<div {...classWithPartMatchMobile('BonusCodeWrapper')} >
|
|
320
|
+
<input {...classWithPartMatchMobile('BonusCodeInput')} bind:value={bonusCode} on:keyup={validateBonusCode} type="text" id="BonusCode" placeholder={$_(`bonus.placeholder`)}/>
|
|
321
|
+
<button {...classWithPartMatchMobile('BonusClaimButton')} disabled={invalidBonusField || !isButtonClickable} on:click={()=>{claimBonus(bonusCode,true)}}>{$_(`bonus.claim`)}</button>
|
|
322
|
+
</div>
|
|
323
|
+
{#if invalidBonusCode}
|
|
324
|
+
<p class="InvalidBonusCodeMessage" part="InvalidBonusCodeMessage">{$_(`bonus.invalidBonusCode`)}</p>
|
|
325
|
+
{/if}
|
|
326
|
+
</div>
|
|
327
|
+
{:else if bonusStatus === 'completed'}
|
|
328
|
+
<div {...classWithPartMatchMobile('BonusCalendarWrapper')}>
|
|
329
|
+
<div {...classWithPart('BonusCalendarTitle')}>{$_(`bonus.canlendarTitle`)}</div>
|
|
330
|
+
<div {...classWithPart('BonusCalendarContent')}>
|
|
331
|
+
<div {...classWithPartMatchMobile('BonusCalendarContainer')} >
|
|
332
|
+
<div {...classWithPartMatchMobile('BonusCalendarStartDate')} >
|
|
333
|
+
<label for="BonusCalendarStartDate">{$_(`bonus.from`)}</label>
|
|
334
|
+
<vaadin-date-picker bind:this={startCalendar} max={maxDate} value={lastMonth} placeholder="From"
|
|
335
|
+
{...classWithPart('VaadinDatePicker')} >
|
|
336
|
+
</vaadin-date-picker>
|
|
337
|
+
</div>
|
|
338
|
+
<div {...classWithPartMatchMobile('BonusCalendarEndDate')}>
|
|
339
|
+
<label for="BonusCalendarEndDate">{$_(`bonus.to`)}</label>
|
|
340
|
+
<vaadin-date-picker bind:this={endCalendar} value={maxDate} placeholder="To"
|
|
341
|
+
{...classWithPart('VaadinDatePicker')}>
|
|
342
|
+
</vaadin-date-picker>
|
|
343
|
+
</div>
|
|
344
|
+
</div>
|
|
345
|
+
<button {...classWithPartMatchMobile('BonusFilterButton')} on:click={() => getPage(1)} disabled={isLoading}>{$_(`bonus.filter`)}</button>
|
|
346
|
+
</div>
|
|
347
|
+
</div>
|
|
348
|
+
{/if}
|
|
349
|
+
|
|
350
|
+
{#if isLoading}
|
|
351
|
+
<div {...classWithPart('ModalLoader')}></div>
|
|
352
|
+
{:else}
|
|
353
|
+
{#if bonuses.length > 0}
|
|
354
|
+
<ul {...classWithPart('BonusList')}>
|
|
355
|
+
{#each bonuses as item}
|
|
356
|
+
<li {...classWithPartMatchMobile('BonusItem')}>
|
|
357
|
+
<casino-bonus-card {...{
|
|
358
|
+
rawbonus: JSON.stringify(item),
|
|
359
|
+
status:bonusStatus,
|
|
360
|
+
cmsendpoint: cmsendpoint,
|
|
361
|
+
lang: lang,
|
|
362
|
+
clientstyling: clientstyling,
|
|
363
|
+
clientstylingurl: clientstylingurl,
|
|
364
|
+
translationurl: translationurl
|
|
365
|
+
}}
|
|
366
|
+
/>
|
|
367
|
+
</li>
|
|
368
|
+
{/each}
|
|
369
|
+
</ul>
|
|
370
|
+
{:else}
|
|
371
|
+
{#if errorMessage}
|
|
372
|
+
<div style="color: red;">{$_(`bonus.error`)}: {errorMessage}</div>
|
|
373
|
+
{:else}
|
|
374
|
+
{$_(`bonus.noBonus`)}
|
|
375
|
+
{/if}
|
|
376
|
+
{/if}
|
|
377
|
+
{#if bonuses.length !== 0}
|
|
378
|
+
<casino-bonus-pagination totalitems={totalItems} currentpage={currentPage} pagesize={limit} limit={paginationLimit} clientstyling={clientstyling} clientstylingurl={clientstylingurl}></casino-bonus-pagination>
|
|
379
|
+
{/if}
|
|
380
|
+
{/if}
|
|
381
|
+
|
|
382
|
+
{#if bonusModal}
|
|
383
|
+
<div {...classWithPartMatchMobile('ModalWrapper')} >
|
|
384
|
+
<div {...classWithPart('ModalContent')}>
|
|
385
|
+
<div {...classWithPart('ModalBody')}>
|
|
386
|
+
<p {...classWithPart('ModalText')}>{$_('bonus.forfeitMessage')}</p>
|
|
387
|
+
<div {...classWithPart('ModalButtons')}>
|
|
388
|
+
<button {...classWithPart('ModalCancel')} on:click={closeBonusModal}>{$_('bonus.forfeitCancel')}</button>
|
|
389
|
+
<button {...classWithPart('ModalConfirm')} on:click={()=>forfeitBonus(forfeitWalletID)}>{$_('bonus.forfeitConfirm')}</button>
|
|
390
|
+
</div>
|
|
391
|
+
</div>
|
|
392
|
+
</div>
|
|
393
|
+
</div>
|
|
394
|
+
{/if}
|
|
395
|
+
</div>
|
|
396
|
+
|
|
397
|
+
<style lang="scss">
|
|
398
|
+
:host {
|
|
399
|
+
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
*,
|
|
403
|
+
*::before,
|
|
404
|
+
*::after {
|
|
405
|
+
margin: 0;
|
|
406
|
+
padding: 0;
|
|
407
|
+
list-style: none;
|
|
408
|
+
text-decoration: none;
|
|
409
|
+
outline: none;
|
|
410
|
+
box-sizing: border-box;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.BonusList{
|
|
414
|
+
display: flex;
|
|
415
|
+
flex-wrap: wrap;
|
|
416
|
+
}
|
|
417
|
+
.BonusItem{
|
|
418
|
+
flex: 0 0 50%;
|
|
419
|
+
max-width: 50%;
|
|
420
|
+
padding: 10px;
|
|
421
|
+
}
|
|
422
|
+
.BonusItemMobile {
|
|
423
|
+
flex: 0 0 100%;
|
|
424
|
+
max-width: 100%;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
.BonusPaginationWrapper {
|
|
428
|
+
margin: 40px 0;
|
|
429
|
+
display: flex;
|
|
430
|
+
justify-content: center;
|
|
431
|
+
&.BonusPaginationWrapperMobile {
|
|
432
|
+
flex-wrap: wrap;
|
|
433
|
+
text-align: center;
|
|
434
|
+
}
|
|
435
|
+
.BonusesFirst, .BonusesPrev, .BonusesNext, .BonusesLast {
|
|
436
|
+
color: var(--emfe-w-bonus-pagination-primary,var(--emfe-w-color-blue, #00AEEF));
|
|
437
|
+
font-size: 16px;
|
|
438
|
+
cursor: pointer;
|
|
439
|
+
padding: 5px 10px;
|
|
440
|
+
font-weight: 700;
|
|
441
|
+
&.Inactive {
|
|
442
|
+
color: var(--emfe-w-bonus-pagination-inactive-text,var(--emfe-w-color-gray-100, #E6E6E6));
|
|
443
|
+
cursor: default;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
.BonusesPage {
|
|
447
|
+
margin: 0 5px;
|
|
448
|
+
color: var(--emfe-w-bonus-pagination-text,var(--emfe-w-color-gray-300, #58586B));
|
|
449
|
+
font-size: 16px;
|
|
450
|
+
cursor: pointer;
|
|
451
|
+
padding: 5px 10px;
|
|
452
|
+
&.BonusPageActive {
|
|
453
|
+
background-color: var(--emfe-w-bonus-pagination-active-bg,var(--emfe-w-color-white, #FFFFFF));
|
|
454
|
+
font-weight: 700;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
.ModalLoader {
|
|
459
|
+
display: block;
|
|
460
|
+
width: 80px;
|
|
461
|
+
height: 80px;
|
|
462
|
+
margin: 0 auto
|
|
463
|
+
}
|
|
464
|
+
.ModalLoader:after {
|
|
465
|
+
content: " ";
|
|
466
|
+
display: block;
|
|
467
|
+
width: 64px;
|
|
468
|
+
height: 64px;
|
|
469
|
+
margin: 8px;
|
|
470
|
+
border-radius: 50%;
|
|
471
|
+
border: 6px solid var(--emfe-w-bonus-pagination-border,var(--emfe-w-color-blue, #00AEEF));
|
|
472
|
+
border-color: var(--emfe-w-bonus-pagination-border,var(--emfe-w-color-blue, #00AEEF)) transparent var(--emfe-w-bonus-pagination-primary,var(--emfe-w-color-blue, #00AEEF)) transparent;
|
|
473
|
+
animation: LoaderForModal 1.2s linear infinite;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
@keyframes LoaderForModal {
|
|
477
|
+
0% {
|
|
478
|
+
transform: rotate(0deg);
|
|
479
|
+
}
|
|
480
|
+
100% {
|
|
481
|
+
transform: rotate(360deg);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
.BonusCalendarWrapper{
|
|
487
|
+
display: flex;
|
|
488
|
+
gap: 20px;
|
|
489
|
+
flex-wrap: wrap;
|
|
490
|
+
background: var(--emfe-w-bonus-calendar-bg,var(--emfe-w-color-gray-50, #F4F4F4));
|
|
491
|
+
border-radius: 5px;
|
|
492
|
+
padding: 27px;
|
|
493
|
+
width: calc(50% - 20px);
|
|
494
|
+
margin: 10px;
|
|
495
|
+
}
|
|
496
|
+
.BonusCalendarContent {
|
|
497
|
+
display: flex;
|
|
498
|
+
gap: 20px;
|
|
499
|
+
flex-wrap: wrap;
|
|
500
|
+
}
|
|
501
|
+
.BonusCalendarContainer {
|
|
502
|
+
display: flex;
|
|
503
|
+
gap: 20px;
|
|
504
|
+
flex-wrap: wrap;
|
|
505
|
+
flex: 4;
|
|
506
|
+
&.BonusCalendarContainerMobile {
|
|
507
|
+
flex-direction: row;
|
|
508
|
+
gap: 0;
|
|
509
|
+
justify-content: space-between;
|
|
510
|
+
padding-bottom: 0;
|
|
511
|
+
width: 100%;
|
|
512
|
+
flex-direction: column;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
.BonusCalendarTitle {
|
|
516
|
+
font-size: 18px;
|
|
517
|
+
font-weight: 700;
|
|
518
|
+
width: 100%;
|
|
519
|
+
}
|
|
520
|
+
.BonusCalendarStartDate,
|
|
521
|
+
.BonusCalendarEndDate {
|
|
522
|
+
color: var(--emfe-w-bonus-calendar-text,var(--emfe-w-color-gray-300, #58586B));
|
|
523
|
+
display: flex;
|
|
524
|
+
position: relative;
|
|
525
|
+
align-items: center;
|
|
526
|
+
gap: 10px;
|
|
527
|
+
min-width: 140px;
|
|
528
|
+
flex: 0 0 47%;
|
|
529
|
+
flex-wrap: wrap;
|
|
530
|
+
vaadin-date-picker {
|
|
531
|
+
width: 100%;
|
|
532
|
+
}
|
|
533
|
+
&.BonusesCalendarMobile {
|
|
534
|
+
flex-direction: column;
|
|
535
|
+
align-items: flex-start;
|
|
536
|
+
gap: 5px;
|
|
537
|
+
width: 100%;
|
|
538
|
+
.VaadinDatePicker {
|
|
539
|
+
width: 100%;
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
label {
|
|
544
|
+
font-size: 14px;
|
|
545
|
+
font-weight: 300;
|
|
546
|
+
width: 100%;
|
|
547
|
+
text-transform: capitalize;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
input {
|
|
551
|
+
width: 100%;
|
|
552
|
+
height: 44px;
|
|
553
|
+
border: 1px solid var(--emfe-w-bonus-calendar-border,var(--emfe-w-color-gray-100, #E6E6E6));
|
|
554
|
+
border-radius: 5px;
|
|
555
|
+
box-sizing: border-box;
|
|
556
|
+
padding: 5px 15px;
|
|
557
|
+
font-size: 16px;
|
|
558
|
+
line-height: 18px;
|
|
559
|
+
outline-color: var(--emfe-w-bonus-calendar-outline,var(--emfe-w-color-primary, #00AEEF));
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
.BonusFilterButton {
|
|
564
|
+
flex: 2;
|
|
565
|
+
background: var(--emfe-w-bonus-filter-bg,var(--emfe-w-color-yellow, #F39C12));
|
|
566
|
+
outline: 5px solid var(--emfe-w-bonus-filter-outline,var(--emfe-w-color-yellow, rgba(243,156,18,0.3)));
|
|
567
|
+
border-radius: 9px;
|
|
568
|
+
border: 0;
|
|
569
|
+
width: 180px;
|
|
570
|
+
max-width: 180px;
|
|
571
|
+
height: 38px;
|
|
572
|
+
font-size: 18px;
|
|
573
|
+
font-weight: 400;
|
|
574
|
+
text-align: center;
|
|
575
|
+
transition-duration: 0.5s;
|
|
576
|
+
transition-property: outline, color, background;
|
|
577
|
+
box-sizing: border-box;
|
|
578
|
+
cursor: pointer;
|
|
579
|
+
color: var(--emfe-w-bonus-filter-text,var(--emfe-w-color-white, #FFFFFF));
|
|
580
|
+
align-self: end;
|
|
581
|
+
margin-bottom: 5px;
|
|
582
|
+
&[disabled] {
|
|
583
|
+
opacity: 0.3;
|
|
584
|
+
cursor: not-allowed;
|
|
585
|
+
}
|
|
586
|
+
&.BonusFilterButtonMobile {
|
|
587
|
+
width: 100%;
|
|
588
|
+
min-width: 100%;
|
|
589
|
+
}
|
|
590
|
+
&:hover {
|
|
591
|
+
background: var(--emfe-w-bonus-filter-bg,var(--emfe-w-color-yellow, #F38B12));
|
|
592
|
+
outline: 0;
|
|
593
|
+
}
|
|
594
|
+
&:active {
|
|
595
|
+
background: var(--emfe-w-bonus-filter-bg,var(--emfe-w-color-yellow, #F38B12));
|
|
596
|
+
outline-color: var(--emfe-w-bonus-filter-outline,var(--emfe-w-color-yellow, rgba(243,156,18,0.6)));
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
.BonusFilterWrapper {
|
|
600
|
+
display: flex;
|
|
601
|
+
gap: 15px;
|
|
602
|
+
padding: 10px;
|
|
603
|
+
align-items:flex-start;
|
|
604
|
+
|
|
605
|
+
&.BonusFilterWrapperMobile {
|
|
606
|
+
width: 100%;
|
|
607
|
+
flex-direction: column;
|
|
608
|
+
gap: 10px;
|
|
609
|
+
padding:0;
|
|
610
|
+
padding-bottom: 15px;
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
.BonusFilterContainer {
|
|
614
|
+
display: flex;
|
|
615
|
+
gap: 5px;
|
|
616
|
+
border-bottom: 5px solid var(--emfe-w-bonus-filter-border,var(--emfe-w-color-green, #53B65A));
|
|
617
|
+
width: 100%;
|
|
618
|
+
}
|
|
619
|
+
.BonusStatusFilter {
|
|
620
|
+
color: var(--emfe-w-bonus-status-filter-text,var(--emfe-w-color-gray-300, #6D6D6D));
|
|
621
|
+
cursor: pointer;
|
|
622
|
+
width: 200px;
|
|
623
|
+
height: 50px;
|
|
624
|
+
font-size: 18px;
|
|
625
|
+
text-transform: capitalize;
|
|
626
|
+
text-align: center;
|
|
627
|
+
transition-duration: 0.5s;
|
|
628
|
+
box-sizing: border-box;
|
|
629
|
+
padding: 15px;
|
|
630
|
+
background: var(--emfe-w-bonus-status-filter-bg,var(--emfe-w-color-white, #FFFFFF));
|
|
631
|
+
border: 1px solid var(--emfe-w-bonus-status-filter-border,var(--emfe-w-color-gray-300, #767171));
|
|
632
|
+
border-bottom: 0;
|
|
633
|
+
border-radius: 5px 5px 0px 0px;
|
|
634
|
+
|
|
635
|
+
&.BonusStatusFilterMobile {
|
|
636
|
+
width: 100%;
|
|
637
|
+
height: 44px;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
&.active {
|
|
641
|
+
color: var(--emfe-w-bonus-status-active-bg,var(--emfe-w-color-white, #FFFFFF));
|
|
642
|
+
background: var(--emfe-w-bonus-status-active-bg,var(--emfe-w-color-gray-300, #4E5662));
|
|
643
|
+
border: 0.5px solid var(--emfe-w-bonus-status-active-border,var(--emfe-w-color-gray-300, #767171));
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
.BonusPageNumber {
|
|
647
|
+
color: var(--emfe-w-bonus-page-number-text,var(--emfe-w-color-gray-150, #9C9C9C));
|
|
648
|
+
flex: 1;
|
|
649
|
+
display: flex;
|
|
650
|
+
flex-wrap: wrap;
|
|
651
|
+
}
|
|
652
|
+
.BonusPageNumberTabs{
|
|
653
|
+
display: flex;
|
|
654
|
+
.BonusPageNumberTab {
|
|
655
|
+
cursor: pointer;
|
|
656
|
+
width: 36px;
|
|
657
|
+
height: 36px;
|
|
658
|
+
padding: 10px;
|
|
659
|
+
text-align: center;
|
|
660
|
+
&.active {
|
|
661
|
+
color: var(--emfe-w-bonus-page-number-text,var(--emfe-w-color-white, #FFFFFF));
|
|
662
|
+
background: var(--emfe-w-bonus-page-number-active,var(--emfe-w-color-yellow, #F39C12));
|
|
663
|
+
border-radius: 50%;
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
.BonusCodeContainer {
|
|
669
|
+
color: var(--emfe-w-bonus-page-number-text,var(--emfe-w-color-black, #000000));
|
|
670
|
+
display: flex;
|
|
671
|
+
flex-direction: column;
|
|
672
|
+
position: relative;
|
|
673
|
+
width: calc(50% - 20px);
|
|
674
|
+
background: #F4F4F4;
|
|
675
|
+
border-radius: 5px;
|
|
676
|
+
padding: 36px;
|
|
677
|
+
margin: 10px;
|
|
678
|
+
label {
|
|
679
|
+
font-size: 18px;
|
|
680
|
+
font-weight: 700;
|
|
681
|
+
padding-bottom: 20px;
|
|
682
|
+
}
|
|
683
|
+
.Asterisk {
|
|
684
|
+
color : var(--emfe-w-bonus-card-red,var(--emfe-w-color-red, #FD2839));
|
|
685
|
+
}
|
|
686
|
+
&.BonusCodeContainerMobile {
|
|
687
|
+
width: 100%;
|
|
688
|
+
margin: 0 0 10px;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
.BonusCodeWrapper {
|
|
692
|
+
display: flex;
|
|
693
|
+
gap: 10px;
|
|
694
|
+
&.BonusCodeWrapperMobile {
|
|
695
|
+
flex-direction: column;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
.BonusCodeInput {
|
|
699
|
+
flex:3;
|
|
700
|
+
height: 50px;
|
|
701
|
+
border: 1px solid var(--emfe-w-bonus-code-border,var(--emfe-w-color-gray-50, #D1D1D1));
|
|
702
|
+
border-radius: 5px;
|
|
703
|
+
box-sizing: border-box;
|
|
704
|
+
padding: 5px 15px;
|
|
705
|
+
font-size: 16px;
|
|
706
|
+
line-height: 18px;
|
|
707
|
+
&:focus {
|
|
708
|
+
outline-color: var(--emfe-w-bonus-code-outline,var(--emfe-w-color-gray-100, #C1C1C1));
|
|
709
|
+
}
|
|
710
|
+
&.BonusCodeInputMobile {
|
|
711
|
+
width: 100%;
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
.BonusClaimButton {
|
|
716
|
+
background: var(--emfe-w-bonus-claim-bg,var(--emfe-w-color-yellow, #F39C12));
|
|
717
|
+
outline: 5px solid var(--emfe-w-bonus-claim-outline,var(--emfe-w-color-yellow, rgba(243,156,18,0.3)));
|
|
718
|
+
border-radius: 9px;
|
|
719
|
+
border: 0;
|
|
720
|
+
width: 180px;
|
|
721
|
+
height: 38px;
|
|
722
|
+
font-size: 18px;
|
|
723
|
+
font-weight: 400;
|
|
724
|
+
text-align: center;
|
|
725
|
+
transition-duration: 0.5s;
|
|
726
|
+
box-sizing: border-box;
|
|
727
|
+
margin-top:5px;
|
|
728
|
+
cursor: pointer;
|
|
729
|
+
color: var(--emfe-w-bonus-claim-text,var(--emfe-w-color-white, #FFFFFF));
|
|
730
|
+
&[disabled] {
|
|
731
|
+
opacity: 0.3;
|
|
732
|
+
cursor: not-allowed;
|
|
733
|
+
}
|
|
734
|
+
&.BonusClaimButtonMobile {
|
|
735
|
+
width: 100%;
|
|
736
|
+
}
|
|
737
|
+
&:hover {
|
|
738
|
+
background: var(--emfe-w-bonus-claim-hover-bg,var(--emfe-w-color-yellow, #F38B12));
|
|
739
|
+
outline: 0;
|
|
740
|
+
}
|
|
741
|
+
&:active {
|
|
742
|
+
background: var(--emfe-w-bonus-claim-active-bg,var(--emfe-w-color-yellow, #F38B12));
|
|
743
|
+
outline-color: var(--emfe-w-bonus-claim-active-outline,var(--emfe-w-color-white, rgba(243, 156, 18, 0.6)));
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
&.InvalidField {
|
|
749
|
+
input {
|
|
750
|
+
border: 1px solid var(--emfe-w-color-primary, #00AEEF);
|
|
751
|
+
background: var(--emfe-w-color-primary-50, #FBECF4);
|
|
752
|
+
color: var(--emfe-w-color-primary, #00AEEF);
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
.InvalidBonusCodeMessage {
|
|
757
|
+
color: var(--emfe-w-color-error, #FD2839);
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
.ModalWrapper {
|
|
762
|
+
position: fixed;
|
|
763
|
+
top: 0;
|
|
764
|
+
right: 0;
|
|
765
|
+
bottom: 0;
|
|
766
|
+
left: 0;
|
|
767
|
+
background-color: var(--emfe-w-bonus-modal-bg,var(--emfe-w-color-black, rgba(0,0,0,0.7)));
|
|
768
|
+
display: flex;
|
|
769
|
+
justify-content: center;
|
|
770
|
+
align-items: center;
|
|
771
|
+
z-index: 100;
|
|
772
|
+
.ModalContent {
|
|
773
|
+
background-color: var(--emfe-w-bonus-modal-bg,var(--emfe-w-color-white, #FFFFFF));
|
|
774
|
+
position: relative;
|
|
775
|
+
padding: 30px;
|
|
776
|
+
border-top: 5px solid var(--emfe-w-bonus-modal-border,var(--emfe-w-color-primary, #00AEEF));
|
|
777
|
+
border-radius: 5px;
|
|
778
|
+
}
|
|
779
|
+
.ModalBody {
|
|
780
|
+
background-color: var(--emfe-w-bonus-modal-bg,var(--emfe-w-color-gray-50, #F9F8F8));
|
|
781
|
+
padding: 30px;
|
|
782
|
+
text-align: center;
|
|
783
|
+
.ModalText {
|
|
784
|
+
font-size: 22px;
|
|
785
|
+
margin-bottom: 40px;
|
|
786
|
+
}
|
|
787
|
+
.ModalButtons {
|
|
788
|
+
display: flex;
|
|
789
|
+
gap: 36px;
|
|
790
|
+
}
|
|
791
|
+
.ModalCancel, .ModalConfirm {
|
|
792
|
+
background: transparent;
|
|
793
|
+
border: 1px solid var(--emfe-w-bonus-modal-border,var(--emfe-w-color-gray-300, #58586B));
|
|
794
|
+
color: var(--emfe-w-bonus-modal-text,var(--emfe-w-color-gray-300, #58586B));
|
|
795
|
+
cursor: pointer;
|
|
796
|
+
border-radius: 5px;
|
|
797
|
+
width: 180px;
|
|
798
|
+
height: 38px;
|
|
799
|
+
font-size: 18px;
|
|
800
|
+
text-transform: capitalize;
|
|
801
|
+
text-align: center;
|
|
802
|
+
transition-duration: 0.5s;
|
|
803
|
+
box-sizing: border-box;
|
|
804
|
+
padding: 10px;
|
|
805
|
+
}
|
|
806
|
+
.ModalConfirm {
|
|
807
|
+
background: var(--emfe-w-bonus-modal-bg,var(--emfe-w-color-primary, #00AEEF));
|
|
808
|
+
border: 1px solid var(--emfe-w-bonus-modal-bg,var(--emfe-w-color-primary, #00AEEF));
|
|
809
|
+
color: var(--emfe-w-bonus-modal-text,var(--emfe-w-color-white, #FFFFFF));
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
.ModalWrapper.ModalWrapperMobile {
|
|
815
|
+
.ModalContent {
|
|
816
|
+
padding: 20px;
|
|
817
|
+
width: 80vw;
|
|
818
|
+
border-top: none;
|
|
819
|
+
}
|
|
820
|
+
.ModalBody {
|
|
821
|
+
padding: 0;
|
|
822
|
+
background: transparent;
|
|
823
|
+
}
|
|
824
|
+
.ModalText {
|
|
825
|
+
font-size: 16px;
|
|
826
|
+
}
|
|
827
|
+
.ModalButtons {
|
|
828
|
+
gap: 10px;
|
|
829
|
+
}
|
|
830
|
+
.ModalCancel, .ModalConfirm {
|
|
831
|
+
height: 40px;
|
|
832
|
+
width: 50%;
|
|
833
|
+
font-size: 14px;
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
@media only screen and (max-width: 1024px) {
|
|
838
|
+
.BonusCodeContainer {
|
|
839
|
+
width: 100%;
|
|
840
|
+
}
|
|
841
|
+
.BonusCalendarWrapper, .BonusCalendarContent, .BonusCalendarContainer {
|
|
842
|
+
width: 100%;
|
|
843
|
+
flex-wrap: wrap;
|
|
844
|
+
}
|
|
845
|
+
.BonusCalendarWrapper {
|
|
846
|
+
margin: 10px 0 0 0;
|
|
847
|
+
}
|
|
848
|
+
.BonusFilterWrapper {
|
|
849
|
+
width: 100%;
|
|
850
|
+
flex-direction: column;
|
|
851
|
+
gap: 10px;
|
|
852
|
+
padding: 10px 0;
|
|
853
|
+
}
|
|
854
|
+
.BonusStatusFilter {
|
|
855
|
+
width: 100%;
|
|
856
|
+
}
|
|
857
|
+
.BonusFilterButton {
|
|
858
|
+
margin-top: 0;
|
|
859
|
+
}
|
|
860
|
+
.BonusFilterButton, .BonusClaimButton {
|
|
861
|
+
width: 100%;
|
|
862
|
+
}
|
|
863
|
+
.BonusItem {
|
|
864
|
+
flex: 0 0 100%;
|
|
865
|
+
max-width: 100%;
|
|
866
|
+
padding: 0;
|
|
867
|
+
margin: 10px 0 0 0;
|
|
868
|
+
}
|
|
869
|
+
.BonusCalendarStartDate,
|
|
870
|
+
.BonusCalendarEndDate {
|
|
871
|
+
flex-direction: column;
|
|
872
|
+
align-items: flex-start;
|
|
873
|
+
gap: 5px;
|
|
874
|
+
.VaadinDatePicker {
|
|
875
|
+
width: 100%;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
.BonusCalendarTitle {
|
|
879
|
+
width: 100%;
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
</style>
|