@everymatrix/casino-engagement-suite-challenges-details 1.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/casino-engagement-suite-challenges-details/casino-engagement-suite-challenges-details.esm.js +1 -0
- package/dist/casino-engagement-suite-challenges-details/index.esm.js +0 -0
- package/dist/casino-engagement-suite-challenges-details/p-27926b27.entry.js +1 -0
- package/dist/casino-engagement-suite-challenges-details/p-764c820d.js +1 -0
- package/dist/cjs/casino-engagement-suite-challenges-details.cjs.entry.js +190 -0
- package/dist/cjs/casino-engagement-suite-challenges-details.cjs.js +19 -0
- package/dist/cjs/index-ec28d374.js +1198 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/casino-engagement-suite-challenges-details/casino-engagement-suite-challenges-details.css +270 -0
- package/dist/collection/components/casino-engagement-suite-challenges-details/casino-engagement-suite-challenges-details.js +319 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/models/casino-challenges-details.js +15 -0
- package/dist/collection/utils/locale.utils.js +20 -0
- package/dist/components/casino-engagement-suite-challenges-details.d.ts +11 -0
- package/dist/components/casino-engagement-suite-challenges-details.js +215 -0
- package/dist/components/index.d.ts +26 -0
- package/dist/components/index.js +1 -0
- package/dist/esm/casino-engagement-suite-challenges-details.entry.js +186 -0
- package/dist/esm/casino-engagement-suite-challenges-details.js +17 -0
- package/dist/esm/index-13f457d0.js +1171 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/stencil.config.js +22 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/casino-engagement-suite-challenges-details/.stencil/packages/casino-engagement-suite-challenges-details/stencil.config.d.ts +2 -0
- package/dist/types/components/casino-engagement-suite-challenges-details/casino-engagement-suite-challenges-details.d.ts +53 -0
- package/dist/types/components.d.ts +87 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/models/casino-challenges-details.d.ts +58 -0
- package/dist/types/stencil-public-runtime.d.ts +1565 -0
- package/dist/types/utils/locale.utils.d.ts +1 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +12 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +10 -0
- package/package.json +19 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-ec28d374.js');
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
9
|
+
*/
|
|
10
|
+
const patchEsm = () => {
|
|
11
|
+
return index.promiseResolve();
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const defineCustomElements = (win, options) => {
|
|
15
|
+
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
|
+
return patchEsm().then(() => {
|
|
17
|
+
return index.bootstrapLazy([["casino-engagement-suite-challenges-details.cjs",[[1,"casino-engagement-suite-challenges-details",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"challenge":[16],"language":[1],"gameSlug":[1,"game-slug"],"device":[1],"limitStylingAppends":[32],"timer":[32],"showDetails":[32],"isExpiredChallenge":[32]}]]]], options);
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
exports.defineCustomElements = defineCustomElements;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"entries": [
|
|
3
|
+
"./components/casino-engagement-suite-challenges-details/casino-engagement-suite-challenges-details.js"
|
|
4
|
+
],
|
|
5
|
+
"compiler": {
|
|
6
|
+
"name": "@stencil/core",
|
|
7
|
+
"version": "2.15.2",
|
|
8
|
+
"typescriptVersion": "4.5.4"
|
|
9
|
+
},
|
|
10
|
+
"collections": [],
|
|
11
|
+
"bundles": []
|
|
12
|
+
}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;900&display=swap");
|
|
2
|
+
:host {
|
|
3
|
+
display: block;
|
|
4
|
+
font-family: inherit;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
* {
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
margin: 0;
|
|
10
|
+
padding: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
button {
|
|
14
|
+
border: none;
|
|
15
|
+
background: none;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
}
|
|
18
|
+
button:focus {
|
|
19
|
+
outline: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.ChallengeDetailsPopup {
|
|
23
|
+
display: flex;
|
|
24
|
+
height: 100%;
|
|
25
|
+
background-color: var(--emw--color-background, #1E1638);
|
|
26
|
+
border-radius: 8px;
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
position: relative;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.ChallengeActions {
|
|
33
|
+
display: flex;
|
|
34
|
+
justify-content: space-between;
|
|
35
|
+
align-items: center;
|
|
36
|
+
padding: 12px 8px 8px;
|
|
37
|
+
}
|
|
38
|
+
.ChallengeActions .ChallengeIconButton {
|
|
39
|
+
width: 16px;
|
|
40
|
+
height: 16px;
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
}
|
|
43
|
+
.ChallengeActions .ChallengePopupName {
|
|
44
|
+
color: var(--emw--color-gray-100, #BBB9C3);
|
|
45
|
+
font-size: 16px;
|
|
46
|
+
font-weight: 500;
|
|
47
|
+
line-height: 16px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.ChallengeDetails {
|
|
51
|
+
padding: 0px 19px 10px;
|
|
52
|
+
overflow-y: auto;
|
|
53
|
+
-ms-overflow-style: none;
|
|
54
|
+
scrollbar-width: none;
|
|
55
|
+
}
|
|
56
|
+
.ChallengeDetails::-webkit-scrollbar {
|
|
57
|
+
display: none;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.ChallengeDetailsHeader {
|
|
61
|
+
display: flex;
|
|
62
|
+
justify-content: space-between;
|
|
63
|
+
gap: 12px;
|
|
64
|
+
}
|
|
65
|
+
.ChallengeDetailsHeader .ChallengeName {
|
|
66
|
+
font-family: "Montserrat", sans-serif;
|
|
67
|
+
font-size: var(--emw--font-size-medium, 18px);
|
|
68
|
+
font-weight: var(--emw--font-weight-bold, 700);
|
|
69
|
+
line-height: 22px;
|
|
70
|
+
color: var(--emfe-w-color-white, #FFF);
|
|
71
|
+
word-break: break-all;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.ChallengeJoinButton.Joined::before {
|
|
75
|
+
content: "";
|
|
76
|
+
position: absolute;
|
|
77
|
+
inset: 0;
|
|
78
|
+
border-radius: var(--emw--button-border-radius, 4px);
|
|
79
|
+
padding: 1px;
|
|
80
|
+
background: linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);
|
|
81
|
+
-webkit-mask: linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);
|
|
82
|
+
-webkit-mask-composite: xor;
|
|
83
|
+
mask-composite: exclude;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.ChallengeJoinButton {
|
|
87
|
+
transition: all 0.5s ease-out;
|
|
88
|
+
background: linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);
|
|
89
|
+
color: var(--emw--color-typography, #1E1638);
|
|
90
|
+
border-radius: 99px;
|
|
91
|
+
min-width: 88px;
|
|
92
|
+
height: 32px;
|
|
93
|
+
font-size: 14px;
|
|
94
|
+
font-weight: 700;
|
|
95
|
+
position: relative;
|
|
96
|
+
font-family: "Montserrat", sans-serif;
|
|
97
|
+
}
|
|
98
|
+
.ChallengeJoinButton.Joined {
|
|
99
|
+
background: linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);
|
|
100
|
+
-webkit-background-clip: text;
|
|
101
|
+
background-clip: text;
|
|
102
|
+
-webkit-text-fill-color: transparent;
|
|
103
|
+
}
|
|
104
|
+
.ChallengeJoinButton.Joined::before {
|
|
105
|
+
border-radius: 99px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.Disabled {
|
|
109
|
+
opacity: 0.5;
|
|
110
|
+
pointer-events: none;
|
|
111
|
+
cursor: auto;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.ChallengeCountdown {
|
|
115
|
+
font-weight: var(--emw--font-weight-normal, 400);
|
|
116
|
+
font-size: var(--emw--font-size-x-small, 12px);
|
|
117
|
+
line-height: 12px;
|
|
118
|
+
margin: 12px 0 24px;
|
|
119
|
+
color: var(--emw--color-gray-150, #BBB9C3);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.ChallengeCountdown.Expired {
|
|
123
|
+
font-weight: var(--emw--font-weight-normal, 700);
|
|
124
|
+
color: var(--emfe-w-color-white, #FFF);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.ChallengeCollapseButton {
|
|
128
|
+
margin-bottom: 14px;
|
|
129
|
+
display: flex;
|
|
130
|
+
flex-direction: row;
|
|
131
|
+
align-items: center;
|
|
132
|
+
color: var(--emw--color-primary-variant, #666178);
|
|
133
|
+
cursor: pointer;
|
|
134
|
+
}
|
|
135
|
+
.ChallengeCollapseButton .Toggle {
|
|
136
|
+
width: 16px;
|
|
137
|
+
height: 16px;
|
|
138
|
+
display: block;
|
|
139
|
+
margin-right: 4px;
|
|
140
|
+
}
|
|
141
|
+
.ChallengeCollapseButton .Closed {
|
|
142
|
+
background: url("https://static.everymatrix.com/gic/img/engagement-suite/eye-closed.svg") no-repeat center/contain;
|
|
143
|
+
}
|
|
144
|
+
.ChallengeCollapseButton .Open {
|
|
145
|
+
background: url("https://static.everymatrix.com/gic/img/engagement-suite/eye-open.svg") no-repeat center/contain;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.CollapseDetails {
|
|
149
|
+
display: none;
|
|
150
|
+
font-size: var(--emw--font-size-small, 14px);
|
|
151
|
+
line-height: 17px;
|
|
152
|
+
font-weight: var(--emw--font-weight-normal, 400);
|
|
153
|
+
}
|
|
154
|
+
.CollapseDetails .ChallengeDescription {
|
|
155
|
+
color: var(--emfe-w-color-white, #FFF);
|
|
156
|
+
margin-bottom: 12px;
|
|
157
|
+
}
|
|
158
|
+
.CollapseDetails .TC {
|
|
159
|
+
margin: 12px 0 16px;
|
|
160
|
+
}
|
|
161
|
+
.CollapseDetails .TC a {
|
|
162
|
+
color: var(--emw--color-secondary, #59D1FF);
|
|
163
|
+
}
|
|
164
|
+
.CollapseDetails .ChallengeGames {
|
|
165
|
+
width: 100%;
|
|
166
|
+
overflow-y: auto;
|
|
167
|
+
display: flex;
|
|
168
|
+
gap: 4px;
|
|
169
|
+
}
|
|
170
|
+
.CollapseDetails .ChallengeGames::-webkit-scrollbar {
|
|
171
|
+
height: 2px;
|
|
172
|
+
background: none;
|
|
173
|
+
}
|
|
174
|
+
.CollapseDetails .ChallengeGames::-webkit-scrollbar-thumb {
|
|
175
|
+
border-radius: 4px;
|
|
176
|
+
background-color: var(--emw--color-background, #666178);
|
|
177
|
+
}
|
|
178
|
+
.CollapseDetails .ChallengeGames .Game img {
|
|
179
|
+
width: 96px;
|
|
180
|
+
height: 50px;
|
|
181
|
+
border-radius: 2px;
|
|
182
|
+
cursor: pointer;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.ShowDetails {
|
|
186
|
+
display: block;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.ChallengeLevels {
|
|
190
|
+
display: flex;
|
|
191
|
+
flex-direction: column;
|
|
192
|
+
gap: 16px;
|
|
193
|
+
margin-top: 24px;
|
|
194
|
+
color: var(--emw--color-primary, #8F8B9C);
|
|
195
|
+
font-size: var(--emw--font-size-small, 12px);
|
|
196
|
+
font-weight: var(--emw--font-weight-normal, 400);
|
|
197
|
+
line-height: 12px;
|
|
198
|
+
}
|
|
199
|
+
.ChallengeLevels .ChallengeLevelCard {
|
|
200
|
+
border: 1px solid var(--emw--button-border-color, #403956);
|
|
201
|
+
padding: 16px;
|
|
202
|
+
border-radius: 8px;
|
|
203
|
+
}
|
|
204
|
+
.ChallengeLevels .ChallengeLevelCard .ChallengeRewardMessage {
|
|
205
|
+
margin-top: 10px;
|
|
206
|
+
display: flex;
|
|
207
|
+
flex-direction: row;
|
|
208
|
+
align-items: center;
|
|
209
|
+
gap: 4px;
|
|
210
|
+
}
|
|
211
|
+
.ChallengeLevels .ChallengeLevelCard .ChallengeRewardMessage .CustomRewardMessage {
|
|
212
|
+
font-weight: var(--emw--font-weight-semibold, 600);
|
|
213
|
+
line-height: 15px;
|
|
214
|
+
word-break: break-all;
|
|
215
|
+
}
|
|
216
|
+
.ChallengeLevels .InProgress {
|
|
217
|
+
position: relative;
|
|
218
|
+
border: none;
|
|
219
|
+
}
|
|
220
|
+
.ChallengeLevels .InProgress .ChallengeLevelTarget,
|
|
221
|
+
.ChallengeLevels .InProgress .CustomRewardMessage {
|
|
222
|
+
color: var(--emfe-w-color-white, #FFF);
|
|
223
|
+
}
|
|
224
|
+
.ChallengeLevels .InProgress::before {
|
|
225
|
+
content: "";
|
|
226
|
+
position: absolute;
|
|
227
|
+
inset: 0;
|
|
228
|
+
border-radius: 8px;
|
|
229
|
+
padding: 1px;
|
|
230
|
+
background: linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);
|
|
231
|
+
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
232
|
+
-webkit-mask-composite: xor;
|
|
233
|
+
mask-composite: exclude;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.ChallengeDetailsPopup.Tablet .ChallengeIconButton,
|
|
237
|
+
.ChallengeDetailsPopup.Desktop .ChallengeIconButton {
|
|
238
|
+
width: 24px;
|
|
239
|
+
height: 24px;
|
|
240
|
+
}
|
|
241
|
+
.ChallengeDetailsPopup.Tablet .ChallengeDetails,
|
|
242
|
+
.ChallengeDetailsPopup.Desktop .ChallengeDetails {
|
|
243
|
+
padding: 20px 24px;
|
|
244
|
+
}
|
|
245
|
+
.ChallengeDetailsPopup.Tablet .ChallengeName,
|
|
246
|
+
.ChallengeDetailsPopup.Desktop .ChallengeName {
|
|
247
|
+
line-height: 27px;
|
|
248
|
+
font-size: 22px;
|
|
249
|
+
}
|
|
250
|
+
.ChallengeDetailsPopup.Tablet .ChallengeJoinButton,
|
|
251
|
+
.ChallengeDetailsPopup.Desktop .ChallengeJoinButton {
|
|
252
|
+
min-width: 100px;
|
|
253
|
+
height: 36px;
|
|
254
|
+
font-size: 16px;
|
|
255
|
+
}
|
|
256
|
+
.ChallengeDetailsPopup.Tablet .ChallengeCountdown,
|
|
257
|
+
.ChallengeDetailsPopup.Tablet .ChallengeLevels,
|
|
258
|
+
.ChallengeDetailsPopup.Desktop .ChallengeCountdown,
|
|
259
|
+
.ChallengeDetailsPopup.Desktop .ChallengeLevels {
|
|
260
|
+
font-size: var(--emw--font-size-small, 14px);
|
|
261
|
+
line-height: 14px;
|
|
262
|
+
}
|
|
263
|
+
.ChallengeDetailsPopup.Tablet .ChallengeCollapseButton,
|
|
264
|
+
.ChallengeDetailsPopup.Desktop .ChallengeCollapseButton {
|
|
265
|
+
margin-bottom: 12px;
|
|
266
|
+
}
|
|
267
|
+
.ChallengeDetailsPopup.Tablet .ChallengeLevels .CustomRewardMessage,
|
|
268
|
+
.ChallengeDetailsPopup.Desktop .ChallengeLevels .CustomRewardMessage {
|
|
269
|
+
line-height: 17px;
|
|
270
|
+
}
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { Component, h, Prop, State, Element, Event, Watch } from '@stencil/core';
|
|
2
|
+
import { translate } from '../../utils/locale.utils';
|
|
3
|
+
import { ChallengeProgressStatus } from '../../models/casino-challenges-details';
|
|
4
|
+
export class CasinoEngagementSuiteChallengesDetails {
|
|
5
|
+
constructor() {
|
|
6
|
+
/**
|
|
7
|
+
* Client custom styling via string
|
|
8
|
+
*/
|
|
9
|
+
this.clientStyling = '';
|
|
10
|
+
/**
|
|
11
|
+
* Client custom styling via url
|
|
12
|
+
*/
|
|
13
|
+
this.clientStylingUrl = '';
|
|
14
|
+
/**
|
|
15
|
+
* Language of the widget
|
|
16
|
+
*/
|
|
17
|
+
this.language = 'en';
|
|
18
|
+
/**
|
|
19
|
+
* Current game slug
|
|
20
|
+
*/
|
|
21
|
+
this.gameSlug = '';
|
|
22
|
+
/**
|
|
23
|
+
* User's device type
|
|
24
|
+
*/
|
|
25
|
+
this.device = 'Mobile';
|
|
26
|
+
this.limitStylingAppends = false;
|
|
27
|
+
this.timer = '';
|
|
28
|
+
this.showDetails = false;
|
|
29
|
+
this.isExpiredChallenge = false;
|
|
30
|
+
this.setClientStyling = () => {
|
|
31
|
+
let sheet = document.createElement('style');
|
|
32
|
+
sheet.innerHTML = this.clientStyling;
|
|
33
|
+
this.host.prepend(sheet);
|
|
34
|
+
};
|
|
35
|
+
this.setClientStylingURL = () => {
|
|
36
|
+
let url = new URL(this.clientStylingUrl);
|
|
37
|
+
let cssFile = document.createElement('style');
|
|
38
|
+
fetch(url.href)
|
|
39
|
+
.then((res) => res.text())
|
|
40
|
+
.then((data) => {
|
|
41
|
+
cssFile.innerHTML = data;
|
|
42
|
+
setTimeout(() => { this.host.prepend(cssFile); }, 1);
|
|
43
|
+
})
|
|
44
|
+
.catch((err) => {
|
|
45
|
+
console.log('Error ', err);
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
this.handleCloseClick = () => {
|
|
49
|
+
this.close.emit();
|
|
50
|
+
clearInterval(this.interval);
|
|
51
|
+
this.isExpiredChallenge = false;
|
|
52
|
+
this.showDetails = false;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
challengePropHandler() {
|
|
56
|
+
this.updateTimer();
|
|
57
|
+
this.startCountdown();
|
|
58
|
+
}
|
|
59
|
+
componentWillLoad() {
|
|
60
|
+
this.challengePropHandler();
|
|
61
|
+
}
|
|
62
|
+
componentDidRender() {
|
|
63
|
+
if (!this.limitStylingAppends && this.host) {
|
|
64
|
+
if (this.clientStyling)
|
|
65
|
+
this.setClientStyling();
|
|
66
|
+
if (this.clientStylingUrl)
|
|
67
|
+
this.setClientStylingURL();
|
|
68
|
+
this.limitStylingAppends = true;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
getActionsTemplate() {
|
|
72
|
+
return (h("header", { class: "ChallengeActions" },
|
|
73
|
+
h("button", { class: "ChallengeIconButton" },
|
|
74
|
+
h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/back.svg", alt: "back" })),
|
|
75
|
+
this.device !== 'Mobile' && h("div", { class: "ChallengePopupName" }, translate('challenges', this.language)),
|
|
76
|
+
h("button", { class: "ChallengeIconButton", onClick: this.handleCloseClick },
|
|
77
|
+
h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", alt: "close" }))));
|
|
78
|
+
}
|
|
79
|
+
getChallengeHeader() {
|
|
80
|
+
const presentationName = this.challenge.ChallengePresentation.PresentationName;
|
|
81
|
+
const inProgressChallenge = this.challenge.Status === ChallengeProgressStatus.InProgress;
|
|
82
|
+
return (h("div", { class: "ChallengeDetailsHeader" },
|
|
83
|
+
h("span", { class: "ChallengeName" }, presentationName),
|
|
84
|
+
h("button", { class: `ChallengeJoinButton ${inProgressChallenge ? 'Joined' : ''}
|
|
85
|
+
${this.isExpiredChallenge ? 'Disabled' : ''}` }, inProgressChallenge
|
|
86
|
+
? translate('unjoin', this.language)
|
|
87
|
+
: translate('join', this.language))));
|
|
88
|
+
}
|
|
89
|
+
getChallengeCountdown() {
|
|
90
|
+
const timerMessage = this.isExpiredChallenge ? 'Expired' : this.timer;
|
|
91
|
+
return (h("div", { class: `ChallengeCountdown ${this.isExpiredChallenge ? 'Expired' : ''}` }, timerMessage));
|
|
92
|
+
}
|
|
93
|
+
getChallengeDetails() {
|
|
94
|
+
const description = this.challenge.ChallengePresentation.Description;
|
|
95
|
+
const url = this.challenge.ChallengePresentation.Url;
|
|
96
|
+
const games = this.challenge.Games;
|
|
97
|
+
return (h("div", { class: `CollapseDetails ${this.showDetails ? 'ShowDetails' : ''}` },
|
|
98
|
+
description && h("span", { class: "ChallengeDescription" }, description),
|
|
99
|
+
url && (h("div", { class: "TC" },
|
|
100
|
+
h("a", { href: url, target: "_blank" }, translate('tc', this.language)))),
|
|
101
|
+
(games === null || games === void 0 ? void 0 : games.length) && (h("div", { class: "ChallengeGames" }, games.map((game) => (h("div", { class: "Game" },
|
|
102
|
+
h("img", { src: game.GameIcon, alt: game.GameName, onClick: () => this.onGameClick(game.GameSlug), class: `${game.GameSlug === this.gameSlug ? 'Disabled' : ''}` }))))))));
|
|
103
|
+
}
|
|
104
|
+
onGameClick(gameSlug) {
|
|
105
|
+
window.postMessage({ type: 'GameClick', slug: gameSlug });
|
|
106
|
+
}
|
|
107
|
+
startCountdown() {
|
|
108
|
+
this.interval = setInterval(() => {
|
|
109
|
+
this.updateTimer();
|
|
110
|
+
}, 1000);
|
|
111
|
+
}
|
|
112
|
+
updateTimer() {
|
|
113
|
+
const expirationTime = new Date(this.challenge.ExpirationTime).getTime();
|
|
114
|
+
const now = new Date().getTime();
|
|
115
|
+
const distance = expirationTime - now;
|
|
116
|
+
if (distance < 1) {
|
|
117
|
+
clearInterval(this.interval);
|
|
118
|
+
this.timer = '';
|
|
119
|
+
this.isExpiredChallenge = true;
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
const { days, hours, minutes, seconds } = {
|
|
123
|
+
days: String(Math.floor(distance / (1000 * 60 * 60 * 24))).padStart(2, '0'),
|
|
124
|
+
hours: String(Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))).padStart(2, '0'),
|
|
125
|
+
minutes: String(Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60))).padStart(2, '0'),
|
|
126
|
+
seconds: String(Math.floor((distance % (1000 * 60)) / 1000)).padStart(2, '0')
|
|
127
|
+
};
|
|
128
|
+
this.timer = days === '00'
|
|
129
|
+
? `${hours}h:${minutes}m:${seconds}s`
|
|
130
|
+
: `${days}d:${hours}h:${minutes}m`;
|
|
131
|
+
}
|
|
132
|
+
getLevelTarget(level) {
|
|
133
|
+
let levelTarget = `${translate('place', this.language)} ${level.TargetTurnover}`;
|
|
134
|
+
if (level.LevelTargetType === 1) {
|
|
135
|
+
levelTarget += ` ${translate('bet', this.language)}`;
|
|
136
|
+
}
|
|
137
|
+
else if (level.LevelTargetType === 2) {
|
|
138
|
+
levelTarget += ` ${translate('bets', this.language)} X ${level.TargetBetCount}`;
|
|
139
|
+
}
|
|
140
|
+
return (h("span", { class: "ChallengeLevelTarget" }, levelTarget));
|
|
141
|
+
}
|
|
142
|
+
getChallengeLevels() {
|
|
143
|
+
return (h("div", { class: "ChallengeLevels" }, this.challenge.LevelProgresses.map((level, index) => (h("div", { class: `ChallengeLevelCard ${level.ProgressStatus === 1 ? 'InProgress' : ''}` },
|
|
144
|
+
h("div", { class: "ChallengeLevelHeader" },
|
|
145
|
+
h("span", null,
|
|
146
|
+
"Level ",
|
|
147
|
+
index + 1,
|
|
148
|
+
": "),
|
|
149
|
+
this.getLevelTarget(level)),
|
|
150
|
+
h("div", { class: "ChallengeRewardMessage" },
|
|
151
|
+
h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/reward.svg", alt: "win" }),
|
|
152
|
+
h("span", null,
|
|
153
|
+
translate('win', this.language),
|
|
154
|
+
": "),
|
|
155
|
+
h("span", { class: "CustomRewardMessage" }, level.CustomRewardMessage)))))));
|
|
156
|
+
}
|
|
157
|
+
getToggleButton() {
|
|
158
|
+
return (h("div", { class: "ChallengeCollapseButton", onClick: () => this.showDetails = !this.showDetails },
|
|
159
|
+
h("span", { class: `Toggle ${this.showDetails ? 'Closed' : 'Open'}` }),
|
|
160
|
+
h("span", null, translate('details', this.language))));
|
|
161
|
+
}
|
|
162
|
+
render() {
|
|
163
|
+
return h("div", { class: `ChallengeDetailsPopup ${this.device}` },
|
|
164
|
+
this.getActionsTemplate(),
|
|
165
|
+
h("div", { class: "ChallengeDetails" },
|
|
166
|
+
this.getChallengeHeader(),
|
|
167
|
+
this.getChallengeCountdown(),
|
|
168
|
+
this.getToggleButton(),
|
|
169
|
+
this.getChallengeDetails(),
|
|
170
|
+
this.getChallengeLevels()));
|
|
171
|
+
}
|
|
172
|
+
static get is() { return "casino-engagement-suite-challenges-details"; }
|
|
173
|
+
static get encapsulation() { return "shadow"; }
|
|
174
|
+
static get originalStyleUrls() { return {
|
|
175
|
+
"$": ["casino-engagement-suite-challenges-details.scss"]
|
|
176
|
+
}; }
|
|
177
|
+
static get styleUrls() { return {
|
|
178
|
+
"$": ["casino-engagement-suite-challenges-details.css"]
|
|
179
|
+
}; }
|
|
180
|
+
static get properties() { return {
|
|
181
|
+
"clientStyling": {
|
|
182
|
+
"type": "string",
|
|
183
|
+
"mutable": false,
|
|
184
|
+
"complexType": {
|
|
185
|
+
"original": "string",
|
|
186
|
+
"resolved": "string",
|
|
187
|
+
"references": {}
|
|
188
|
+
},
|
|
189
|
+
"required": false,
|
|
190
|
+
"optional": false,
|
|
191
|
+
"docs": {
|
|
192
|
+
"tags": [],
|
|
193
|
+
"text": "Client custom styling via string"
|
|
194
|
+
},
|
|
195
|
+
"attribute": "client-styling",
|
|
196
|
+
"reflect": true,
|
|
197
|
+
"defaultValue": "''"
|
|
198
|
+
},
|
|
199
|
+
"clientStylingUrl": {
|
|
200
|
+
"type": "string",
|
|
201
|
+
"mutable": false,
|
|
202
|
+
"complexType": {
|
|
203
|
+
"original": "string",
|
|
204
|
+
"resolved": "string",
|
|
205
|
+
"references": {}
|
|
206
|
+
},
|
|
207
|
+
"required": false,
|
|
208
|
+
"optional": false,
|
|
209
|
+
"docs": {
|
|
210
|
+
"tags": [],
|
|
211
|
+
"text": "Client custom styling via url"
|
|
212
|
+
},
|
|
213
|
+
"attribute": "client-styling-url",
|
|
214
|
+
"reflect": true,
|
|
215
|
+
"defaultValue": "''"
|
|
216
|
+
},
|
|
217
|
+
"challenge": {
|
|
218
|
+
"type": "unknown",
|
|
219
|
+
"mutable": false,
|
|
220
|
+
"complexType": {
|
|
221
|
+
"original": "Challenge",
|
|
222
|
+
"resolved": "Challenge",
|
|
223
|
+
"references": {
|
|
224
|
+
"Challenge": {
|
|
225
|
+
"location": "import",
|
|
226
|
+
"path": "../../models/casino-challenges-details"
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
"required": false,
|
|
231
|
+
"optional": false,
|
|
232
|
+
"docs": {
|
|
233
|
+
"tags": [],
|
|
234
|
+
"text": "Selected challenge"
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
"language": {
|
|
238
|
+
"type": "string",
|
|
239
|
+
"mutable": false,
|
|
240
|
+
"complexType": {
|
|
241
|
+
"original": "string",
|
|
242
|
+
"resolved": "string",
|
|
243
|
+
"references": {}
|
|
244
|
+
},
|
|
245
|
+
"required": false,
|
|
246
|
+
"optional": false,
|
|
247
|
+
"docs": {
|
|
248
|
+
"tags": [],
|
|
249
|
+
"text": "Language of the widget"
|
|
250
|
+
},
|
|
251
|
+
"attribute": "language",
|
|
252
|
+
"reflect": false,
|
|
253
|
+
"defaultValue": "'en'"
|
|
254
|
+
},
|
|
255
|
+
"gameSlug": {
|
|
256
|
+
"type": "string",
|
|
257
|
+
"mutable": false,
|
|
258
|
+
"complexType": {
|
|
259
|
+
"original": "string",
|
|
260
|
+
"resolved": "string",
|
|
261
|
+
"references": {}
|
|
262
|
+
},
|
|
263
|
+
"required": false,
|
|
264
|
+
"optional": false,
|
|
265
|
+
"docs": {
|
|
266
|
+
"tags": [],
|
|
267
|
+
"text": "Current game slug"
|
|
268
|
+
},
|
|
269
|
+
"attribute": "game-slug",
|
|
270
|
+
"reflect": false,
|
|
271
|
+
"defaultValue": "''"
|
|
272
|
+
},
|
|
273
|
+
"device": {
|
|
274
|
+
"type": "string",
|
|
275
|
+
"mutable": false,
|
|
276
|
+
"complexType": {
|
|
277
|
+
"original": "\"Mobile\" | \"Tablet\" | \"Desktop\"",
|
|
278
|
+
"resolved": "\"Desktop\" | \"Mobile\" | \"Tablet\"",
|
|
279
|
+
"references": {}
|
|
280
|
+
},
|
|
281
|
+
"required": false,
|
|
282
|
+
"optional": false,
|
|
283
|
+
"docs": {
|
|
284
|
+
"tags": [],
|
|
285
|
+
"text": "User's device type"
|
|
286
|
+
},
|
|
287
|
+
"attribute": "device",
|
|
288
|
+
"reflect": false,
|
|
289
|
+
"defaultValue": "'Mobile' as 'Mobile' | 'Tablet' | 'Desktop'"
|
|
290
|
+
}
|
|
291
|
+
}; }
|
|
292
|
+
static get states() { return {
|
|
293
|
+
"limitStylingAppends": {},
|
|
294
|
+
"timer": {},
|
|
295
|
+
"showDetails": {},
|
|
296
|
+
"isExpiredChallenge": {}
|
|
297
|
+
}; }
|
|
298
|
+
static get events() { return [{
|
|
299
|
+
"method": "close",
|
|
300
|
+
"name": "close",
|
|
301
|
+
"bubbles": true,
|
|
302
|
+
"cancelable": true,
|
|
303
|
+
"composed": true,
|
|
304
|
+
"docs": {
|
|
305
|
+
"tags": [],
|
|
306
|
+
"text": ""
|
|
307
|
+
},
|
|
308
|
+
"complexType": {
|
|
309
|
+
"original": "void",
|
|
310
|
+
"resolved": "void",
|
|
311
|
+
"references": {}
|
|
312
|
+
}
|
|
313
|
+
}]; }
|
|
314
|
+
static get elementRef() { return "host"; }
|
|
315
|
+
static get watchers() { return [{
|
|
316
|
+
"propName": "challenge",
|
|
317
|
+
"methodName": "challengePropHandler"
|
|
318
|
+
}]; }
|
|
319
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export var ChallengeLevelProgressStatus;
|
|
2
|
+
(function (ChallengeLevelProgressStatus) {
|
|
3
|
+
ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["Closed"] = 0] = "Closed";
|
|
4
|
+
ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["InProgress"] = 1] = "InProgress";
|
|
5
|
+
ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["Fillup"] = 2] = "Fillup";
|
|
6
|
+
ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["Completed"] = 3] = "Completed";
|
|
7
|
+
})(ChallengeLevelProgressStatus || (ChallengeLevelProgressStatus = {}));
|
|
8
|
+
export var ChallengeProgressStatus;
|
|
9
|
+
(function (ChallengeProgressStatus) {
|
|
10
|
+
ChallengeProgressStatus[ChallengeProgressStatus["Started"] = 0] = "Started";
|
|
11
|
+
ChallengeProgressStatus[ChallengeProgressStatus["InProgress"] = 1] = "InProgress";
|
|
12
|
+
ChallengeProgressStatus[ChallengeProgressStatus["PendingLevelReward"] = 2] = "PendingLevelReward";
|
|
13
|
+
ChallengeProgressStatus[ChallengeProgressStatus["Completed"] = 3] = "Completed";
|
|
14
|
+
ChallengeProgressStatus[ChallengeProgressStatus["Expired"] = 4] = "Expired";
|
|
15
|
+
})(ChallengeProgressStatus || (ChallengeProgressStatus = {}));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
2
|
+
const SUPPORTED_LANGUAGES = ['en'];
|
|
3
|
+
const TRANSLATIONS = {
|
|
4
|
+
en: {
|
|
5
|
+
challenges: 'Challenges',
|
|
6
|
+
join: 'Join',
|
|
7
|
+
unjoin: 'Unjoin',
|
|
8
|
+
details: 'Challenge Details',
|
|
9
|
+
tc: 'Terms & Conditions',
|
|
10
|
+
level: 'Level',
|
|
11
|
+
place: 'Place',
|
|
12
|
+
bet: 'bet',
|
|
13
|
+
bets: 'bets',
|
|
14
|
+
win: 'Win'
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
export const translate = (key, customLang) => {
|
|
18
|
+
const lang = customLang;
|
|
19
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
20
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface CasinoEngagementSuiteChallengesDetails extends Components.CasinoEngagementSuiteChallengesDetails, HTMLElement {}
|
|
4
|
+
export const CasinoEngagementSuiteChallengesDetails: {
|
|
5
|
+
prototype: CasinoEngagementSuiteChallengesDetails;
|
|
6
|
+
new (): CasinoEngagementSuiteChallengesDetails;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|