@everymatrix/casino-challenge-card 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-challenge-card/app-globals-0f993ce5.js +1 -0
- package/dist/casino-challenge-card/casino-challenge-card-cf383ea4.js +1 -0
- package/dist/casino-challenge-card/casino-challenge-card.entry.js +1 -0
- package/dist/casino-challenge-card/casino-challenge-card.esm.js +1 -0
- package/dist/casino-challenge-card/index-fae081c3.js +2 -0
- package/dist/casino-challenge-card/index.esm.js +1 -0
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/casino-challenge-card-c10f3b5d.js +286 -0
- package/dist/cjs/casino-challenge-card.cjs.entry.js +10 -0
- package/dist/cjs/casino-challenge-card.cjs.js +25 -0
- package/dist/cjs/index-062e337e.js +1203 -0
- package/dist/cjs/index.cjs.js +10 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/casino-challenge-card/casino-challenge-card.css +113 -0
- package/dist/collection/components/casino-challenge-card/casino-challenge-card.js +250 -0
- package/dist/collection/components/casino-challenge-card/index.js +1 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/locale.utils.js +90 -0
- package/dist/collection/utils/types.js +40 -0
- package/dist/collection/utils/utils.js +20 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/casino-challenge-card-cf383ea4.js +284 -0
- package/dist/esm/casino-challenge-card.entry.js +2 -0
- package/dist/esm/casino-challenge-card.js +20 -0
- package/dist/esm/index-fae081c3.js +1177 -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-challenge-card/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenge-card/.stencil/packages/stencil/casino-challenge-card/stencil.config.d.ts +2 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenge-card/.stencil/packages/stencil/casino-challenge-card/stencil.config.dev.d.ts +2 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenge-card/.stencil/packages/stencil/casino-challenge-card/storybook/main.d.ts +3 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenge-card/.stencil/packages/stencil/casino-challenge-card/storybook/preview.d.ts +70 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenge-card/.stencil/tools/plugins/index.d.ts +3 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenge-card/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenge-card/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenge-card/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
- package/dist/types/components/casino-challenge-card/casino-challenge-card.d.ts +47 -0
- package/dist/types/components/casino-challenge-card/index.d.ts +1 -0
- package/dist/types/components.d.ts +87 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1674 -0
- package/dist/types/utils/locale.utils.d.ts +3 -0
- package/dist/types/utils/types.d.ts +124 -0
- package/dist/types/utils/utils.d.ts +2 -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,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const casinoChallengeCard = require('./casino-challenge-card-c10f3b5d.js');
|
|
6
|
+
require('./index-062e337e.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.CasinoChallengeCard = casinoChallengeCard.CasinoChallengeCard;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-062e337e.js');
|
|
6
|
+
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
|
+
|
|
8
|
+
const defineCustomElements = async (win, options) => {
|
|
9
|
+
if (typeof window === 'undefined') return undefined;
|
|
10
|
+
await appGlobals.globalScripts();
|
|
11
|
+
return index.bootstrapLazy([["casino-challenge-card.cjs",[[1,"casino-challenge-card",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"challenge":[16],"tooltipIndex":[32],"timeLeft":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
exports.setNonce = index.setNonce;
|
|
15
|
+
exports.defineCustomElements = defineCustomElements;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
.card {
|
|
2
|
+
width: 308px;
|
|
3
|
+
border-radius: 16px;
|
|
4
|
+
border: 2px solid var(--emw--button-border-color, rgba(221, 255, 207, 0.1019607843));
|
|
5
|
+
background-color: var(--emw--color-background, #141515);
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
position: relative;
|
|
8
|
+
}
|
|
9
|
+
@container challenge-list (max-width: 576px) {
|
|
10
|
+
.card {
|
|
11
|
+
width: 100%;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
.card:hover {
|
|
15
|
+
background: linear-gradient(90deg, rgb(0, 62, 92) 0%, rgb(17, 59, 33) 100%);
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
}
|
|
18
|
+
.card__image {
|
|
19
|
+
width: 100%;
|
|
20
|
+
height: 200px;
|
|
21
|
+
border-radius: 16px 16px 0 0;
|
|
22
|
+
}
|
|
23
|
+
@container challenge-list (max-width: 576px) {
|
|
24
|
+
.card__image {
|
|
25
|
+
height: 224px;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
.card__title {
|
|
29
|
+
color: var(--emw--color-white, #FFFFFF);
|
|
30
|
+
font-size: var(--emw--font-size-medium, 16px);
|
|
31
|
+
margin: 0 0 10px;
|
|
32
|
+
}
|
|
33
|
+
.card__content {
|
|
34
|
+
padding: 20px;
|
|
35
|
+
}
|
|
36
|
+
.card__button {
|
|
37
|
+
margin-top: 20px;
|
|
38
|
+
width: 100%;
|
|
39
|
+
height: 34px;
|
|
40
|
+
background: transparent;
|
|
41
|
+
text-transform: uppercase;
|
|
42
|
+
border-radius: var(--emw--button-border-radius, 99px);
|
|
43
|
+
border: 2px solid var(--emw--button-border-color, #727672);
|
|
44
|
+
font-size: var(--emw--font-size-x-small, 12px);
|
|
45
|
+
font-weight: var(--emw--font-weight-bold, 700);
|
|
46
|
+
color: var(--emw--color-secondary, #e9931e);
|
|
47
|
+
}
|
|
48
|
+
.card__button:hover {
|
|
49
|
+
border-color: var(--emw--color-secondary, #e9931e);
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
}
|
|
52
|
+
.card__badge {
|
|
53
|
+
position: absolute;
|
|
54
|
+
background: white;
|
|
55
|
+
top: 6px;
|
|
56
|
+
right: 6px;
|
|
57
|
+
border-radius: 30px;
|
|
58
|
+
padding: 2px 12px;
|
|
59
|
+
line-height: 22px;
|
|
60
|
+
font-weight: var(--emw--font-weight-medium, 500);
|
|
61
|
+
font-size: var(--emw--font-size-x-small, 12px);
|
|
62
|
+
box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
|
|
63
|
+
backdrop-filter: blur(20px);
|
|
64
|
+
}
|
|
65
|
+
.card__badge span {
|
|
66
|
+
font-weight: var(--emw--font-weight-bold, 700);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.info-item {
|
|
70
|
+
line-height: 24px;
|
|
71
|
+
font-size: var(--emw--font-size-small, 14px);
|
|
72
|
+
font-weight: var(--emw--font-weight-bold, 700);
|
|
73
|
+
color: var(--emw--color-primary, #1dbf51);
|
|
74
|
+
}
|
|
75
|
+
@container challenge-list (min-width: 576px) {
|
|
76
|
+
.info-item {
|
|
77
|
+
white-space: nowrap;
|
|
78
|
+
overflow: hidden;
|
|
79
|
+
text-overflow: ellipsis;
|
|
80
|
+
vertical-align: bottom;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
.info-item__label {
|
|
84
|
+
font-weight: var(--emw--font-weight-medium, 500);
|
|
85
|
+
margin-right: 3px;
|
|
86
|
+
color: var(--emw--color-gray-150, #C8D6CE);
|
|
87
|
+
}
|
|
88
|
+
.info-item__tooltip {
|
|
89
|
+
position: absolute;
|
|
90
|
+
line-height: 22px;
|
|
91
|
+
padding: 8px 12px;
|
|
92
|
+
border-radius: 8px;
|
|
93
|
+
opacity: 1;
|
|
94
|
+
z-index: 200;
|
|
95
|
+
white-space: nowrap;
|
|
96
|
+
font-size: var(--emw--font-size-x-small, 12px);
|
|
97
|
+
font-weight: var(--emw--font-weight-medium, 500);
|
|
98
|
+
color: var(--emw--color-white, #FFFFFF);
|
|
99
|
+
background-color: var(--emw--color-background-secondary, #1B1C2B);
|
|
100
|
+
}
|
|
101
|
+
.info-item__tooltip::before {
|
|
102
|
+
content: "";
|
|
103
|
+
position: absolute;
|
|
104
|
+
top: -5px;
|
|
105
|
+
left: 50%;
|
|
106
|
+
transform: translateX(-50%);
|
|
107
|
+
border-left: 6px solid transparent;
|
|
108
|
+
border-right: 6px solid transparent;
|
|
109
|
+
border-bottom: 6px solid var(--emw--color-background-secondary, #1B1C2B);
|
|
110
|
+
width: 0;
|
|
111
|
+
height: 0;
|
|
112
|
+
z-index: 201;
|
|
113
|
+
}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { resolveTranslationUrl, translate } from "../../utils/locale.utils";
|
|
3
|
+
import { getTimeLeft } from "../../utils/utils";
|
|
4
|
+
import { setClientStyling, setClientStylingURL, setStreamStyling } from "../../../../../../../../libs/common/src/styling/index";
|
|
5
|
+
export class CasinoChallengeCard {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.defaultLanguage = 'en';
|
|
8
|
+
this.onMouseEnterHandler = (index, el) => {
|
|
9
|
+
if (el.scrollWidth > el.clientWidth) {
|
|
10
|
+
this.tooltipIndex = index;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
this.onMouseLeaveHandler = () => {
|
|
14
|
+
this.tooltipIndex = null;
|
|
15
|
+
};
|
|
16
|
+
this.mbSource = undefined;
|
|
17
|
+
this.clientStyling = undefined;
|
|
18
|
+
this.clientStylingUrl = undefined;
|
|
19
|
+
this.translationUrl = '';
|
|
20
|
+
this.language = 'en';
|
|
21
|
+
this.challenge = undefined;
|
|
22
|
+
this.tooltipIndex = null;
|
|
23
|
+
this.timeLeft = undefined;
|
|
24
|
+
}
|
|
25
|
+
get infoItems() {
|
|
26
|
+
const level1 = this.challenge.ChallengeLevels[0];
|
|
27
|
+
const target = level1.Target;
|
|
28
|
+
const targetValue = target.TargetType === 0
|
|
29
|
+
? `${translate('placeBetsOf', this.language)} ${target.Turnover}`
|
|
30
|
+
: target.TargetType === 1
|
|
31
|
+
? `${translate('place', this.language)} ${target.Turnover} ${translate('bet', this.language)}`
|
|
32
|
+
: `${translate('place', this.language)} ${target.BetCount} ${translate('bets', this.language)}`;
|
|
33
|
+
const rewardValue = level1.Rewards.map((r) => r.RewardDescription).join(' + ');
|
|
34
|
+
return [
|
|
35
|
+
{
|
|
36
|
+
lable: translate('totalLevels', this.language),
|
|
37
|
+
value: this.challenge.ChallengeLevels.length
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
lable: translate('level1', this.language),
|
|
41
|
+
value: targetValue
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
lable: translate('get', this.language),
|
|
45
|
+
value: rewardValue
|
|
46
|
+
}
|
|
47
|
+
];
|
|
48
|
+
}
|
|
49
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
50
|
+
if (newValue != oldValue) {
|
|
51
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
handleClientStylingUrlChange(newValue, oldValue) {
|
|
55
|
+
if (newValue != oldValue) {
|
|
56
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
handleMbSourceChange(newValue, oldValue) {
|
|
60
|
+
if (newValue != oldValue) {
|
|
61
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
connectedCallback() {
|
|
65
|
+
this.timerId = setInterval(() => {
|
|
66
|
+
this.updateTime();
|
|
67
|
+
}, 1000);
|
|
68
|
+
}
|
|
69
|
+
componentWillLoad() {
|
|
70
|
+
if (this.translationUrl) {
|
|
71
|
+
resolveTranslationUrl(this.translationUrl);
|
|
72
|
+
}
|
|
73
|
+
this.updateTime();
|
|
74
|
+
}
|
|
75
|
+
componentDidLoad() {
|
|
76
|
+
if (this.stylingContainer) {
|
|
77
|
+
if (this.mbSource)
|
|
78
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
79
|
+
if (this.clientStyling)
|
|
80
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
81
|
+
if (this.clientStylingUrl)
|
|
82
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
disconnectedCallback() {
|
|
86
|
+
if (this.stylingSubscription) {
|
|
87
|
+
this.stylingSubscription.unsubscribe();
|
|
88
|
+
}
|
|
89
|
+
clearInterval(this.timerId);
|
|
90
|
+
}
|
|
91
|
+
updateTime() {
|
|
92
|
+
var _a;
|
|
93
|
+
this.timeLeft = getTimeLeft((_a = this.challenge) === null || _a === void 0 ? void 0 : _a.ChallengeEndTime);
|
|
94
|
+
}
|
|
95
|
+
renderInfoItem(item, index) {
|
|
96
|
+
return (h("div", { class: "info-item", onMouseEnter: (e) => this.onMouseEnterHandler(index, e.currentTarget), onMouseLeave: this.onMouseLeaveHandler }, h("span", { class: "info-item__label" }, item.lable), item.value, this.tooltipIndex === index && h("div", { class: "info-item__tooltip" }, item.value)));
|
|
97
|
+
}
|
|
98
|
+
renderCardBadge() {
|
|
99
|
+
return (h("div", { class: "card__badge" }, this.timeLeft
|
|
100
|
+
? [translate('endsIn', this.language), ' - ', h("span", null, this.timeLeft)]
|
|
101
|
+
: translate('expired', this.language)));
|
|
102
|
+
}
|
|
103
|
+
render() {
|
|
104
|
+
return (h("div", { key: 'ddbd3e0d20b4d75ed70120798c45d7c03715b7df', ref: (el) => (this.stylingContainer = el) }, h("div", { key: '3ca0c4b6ad25b4f60077b894bf73c9686f67a677', class: "card" }, h("img", { key: '1712546c27e75e04bde5832c521038bfd418e57f', class: "card__image", src: this.challenge.ChallengePresentations[this.language].Url ||
|
|
105
|
+
this.challenge.ChallengePresentations[this.defaultLanguage].Url }), this.renderCardBadge(), h("div", { key: '238041db616391c2594bef46778649b8b6282097', class: "card__content" }, h("h1", { key: 'd377b99c7758460df8b1a6e8e39059959347430f', class: "card__title" }, this.challenge.ChallengePresentations[this.language].PresentationName ||
|
|
106
|
+
this.challenge.ChallengePresentations[this.defaultLanguage].PresentationName), this.infoItems.map((x, index) => this.renderInfoItem(x, index)), h("button", { key: 'b53707ce7881cbf16321e3d3728a0e769af6589a', class: "card__button" }, translate('viewDetails', this.language))))));
|
|
107
|
+
}
|
|
108
|
+
static get is() { return "casino-challenge-card"; }
|
|
109
|
+
static get encapsulation() { return "shadow"; }
|
|
110
|
+
static get originalStyleUrls() {
|
|
111
|
+
return {
|
|
112
|
+
"$": ["casino-challenge-card.scss"]
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
static get styleUrls() {
|
|
116
|
+
return {
|
|
117
|
+
"$": ["casino-challenge-card.css"]
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
static get properties() {
|
|
121
|
+
return {
|
|
122
|
+
"mbSource": {
|
|
123
|
+
"type": "string",
|
|
124
|
+
"mutable": false,
|
|
125
|
+
"complexType": {
|
|
126
|
+
"original": "string",
|
|
127
|
+
"resolved": "string",
|
|
128
|
+
"references": {}
|
|
129
|
+
},
|
|
130
|
+
"required": false,
|
|
131
|
+
"optional": false,
|
|
132
|
+
"docs": {
|
|
133
|
+
"tags": [],
|
|
134
|
+
"text": "Client custom styling via message bus"
|
|
135
|
+
},
|
|
136
|
+
"attribute": "mb-source",
|
|
137
|
+
"reflect": true
|
|
138
|
+
},
|
|
139
|
+
"clientStyling": {
|
|
140
|
+
"type": "string",
|
|
141
|
+
"mutable": false,
|
|
142
|
+
"complexType": {
|
|
143
|
+
"original": "string",
|
|
144
|
+
"resolved": "string",
|
|
145
|
+
"references": {}
|
|
146
|
+
},
|
|
147
|
+
"required": false,
|
|
148
|
+
"optional": false,
|
|
149
|
+
"docs": {
|
|
150
|
+
"tags": [],
|
|
151
|
+
"text": "Client custom styling via string"
|
|
152
|
+
},
|
|
153
|
+
"attribute": "client-styling",
|
|
154
|
+
"reflect": true
|
|
155
|
+
},
|
|
156
|
+
"clientStylingUrl": {
|
|
157
|
+
"type": "string",
|
|
158
|
+
"mutable": false,
|
|
159
|
+
"complexType": {
|
|
160
|
+
"original": "string",
|
|
161
|
+
"resolved": "string",
|
|
162
|
+
"references": {}
|
|
163
|
+
},
|
|
164
|
+
"required": false,
|
|
165
|
+
"optional": false,
|
|
166
|
+
"docs": {
|
|
167
|
+
"tags": [],
|
|
168
|
+
"text": "Client custom styling via css file url"
|
|
169
|
+
},
|
|
170
|
+
"attribute": "client-styling-url",
|
|
171
|
+
"reflect": true
|
|
172
|
+
},
|
|
173
|
+
"translationUrl": {
|
|
174
|
+
"type": "string",
|
|
175
|
+
"mutable": false,
|
|
176
|
+
"complexType": {
|
|
177
|
+
"original": "string",
|
|
178
|
+
"resolved": "string",
|
|
179
|
+
"references": {}
|
|
180
|
+
},
|
|
181
|
+
"required": false,
|
|
182
|
+
"optional": false,
|
|
183
|
+
"docs": {
|
|
184
|
+
"tags": [],
|
|
185
|
+
"text": "Client custom translation via json file url"
|
|
186
|
+
},
|
|
187
|
+
"attribute": "translation-url",
|
|
188
|
+
"reflect": true,
|
|
189
|
+
"defaultValue": "''"
|
|
190
|
+
},
|
|
191
|
+
"language": {
|
|
192
|
+
"type": "string",
|
|
193
|
+
"mutable": false,
|
|
194
|
+
"complexType": {
|
|
195
|
+
"original": "string",
|
|
196
|
+
"resolved": "string",
|
|
197
|
+
"references": {}
|
|
198
|
+
},
|
|
199
|
+
"required": false,
|
|
200
|
+
"optional": false,
|
|
201
|
+
"docs": {
|
|
202
|
+
"tags": [],
|
|
203
|
+
"text": "Client custom language for translation"
|
|
204
|
+
},
|
|
205
|
+
"attribute": "language",
|
|
206
|
+
"reflect": true,
|
|
207
|
+
"defaultValue": "'en'"
|
|
208
|
+
},
|
|
209
|
+
"challenge": {
|
|
210
|
+
"type": "unknown",
|
|
211
|
+
"mutable": false,
|
|
212
|
+
"complexType": {
|
|
213
|
+
"original": "IChallenge",
|
|
214
|
+
"resolved": "IChallenge",
|
|
215
|
+
"references": {
|
|
216
|
+
"IChallenge": {
|
|
217
|
+
"location": "import",
|
|
218
|
+
"path": "../../utils/types",
|
|
219
|
+
"id": "../../../../packages/stencil/casino-challenge-card/src/utils/types.ts::IChallenge"
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
"required": false,
|
|
224
|
+
"optional": false,
|
|
225
|
+
"docs": {
|
|
226
|
+
"tags": [],
|
|
227
|
+
"text": "Challenge entity"
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
static get states() {
|
|
233
|
+
return {
|
|
234
|
+
"tooltipIndex": {},
|
|
235
|
+
"timeLeft": {}
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
static get watchers() {
|
|
239
|
+
return [{
|
|
240
|
+
"propName": "clientStyling",
|
|
241
|
+
"methodName": "handleClientStylingChange"
|
|
242
|
+
}, {
|
|
243
|
+
"propName": "clientStylingUrl",
|
|
244
|
+
"methodName": "handleClientStylingUrlChange"
|
|
245
|
+
}, {
|
|
246
|
+
"propName": "mbSource",
|
|
247
|
+
"methodName": "handleMbSourceChange"
|
|
248
|
+
}];
|
|
249
|
+
}
|
|
250
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CasinoChallengeCard } from './casino-challenge-card';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/casino-challenge-card';
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
2
|
+
const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];
|
|
3
|
+
const TRANSLATIONS = {
|
|
4
|
+
en: {
|
|
5
|
+
totalLevels: 'Total levels:',
|
|
6
|
+
level1: 'Level 1:',
|
|
7
|
+
get: 'Get:',
|
|
8
|
+
endsIn: 'Ends In',
|
|
9
|
+
expired: 'Expired',
|
|
10
|
+
viewDetails: 'View details',
|
|
11
|
+
placeBetsOf: 'Place bets of',
|
|
12
|
+
place: 'Place',
|
|
13
|
+
bet: 'bet',
|
|
14
|
+
bets: 'bets'
|
|
15
|
+
},
|
|
16
|
+
ro: {
|
|
17
|
+
totalLevels: 'Niveluri totale:',
|
|
18
|
+
level1: 'Nivel 1:',
|
|
19
|
+
get: 'Obține:',
|
|
20
|
+
endsIn: 'Se termină în',
|
|
21
|
+
expired: 'Expirat',
|
|
22
|
+
viewDetails: 'Vezi detalii',
|
|
23
|
+
placeBetsOf: 'Plasează pariuri de',
|
|
24
|
+
place: 'Plasare',
|
|
25
|
+
bet: 'pariu',
|
|
26
|
+
bets: 'pariuri'
|
|
27
|
+
},
|
|
28
|
+
fr: {
|
|
29
|
+
totalLevels: 'Niveaux totaux :',
|
|
30
|
+
level1: 'Niveau 1 :',
|
|
31
|
+
get: 'Obtenir :',
|
|
32
|
+
endsIn: 'Se termine dans',
|
|
33
|
+
expired: 'Expiré',
|
|
34
|
+
viewDetails: 'Voir les détails',
|
|
35
|
+
placeBetsOf: 'Placez des paris de',
|
|
36
|
+
place: 'Placer',
|
|
37
|
+
bet: 'pari',
|
|
38
|
+
bets: 'paris'
|
|
39
|
+
},
|
|
40
|
+
ar: {
|
|
41
|
+
totalLevels: 'إجمالي المستويات:',
|
|
42
|
+
level1: 'المستوى 1:',
|
|
43
|
+
get: 'احصل على:',
|
|
44
|
+
endsIn: 'ينتهي في',
|
|
45
|
+
expired: 'منتهي الصلاحية',
|
|
46
|
+
viewDetails: 'عرض التفاصيل',
|
|
47
|
+
placeBetsOf: 'قم بوضع رهانات بقيمة',
|
|
48
|
+
place: 'ضع',
|
|
49
|
+
bet: 'رهان',
|
|
50
|
+
bets: 'رهانات'
|
|
51
|
+
},
|
|
52
|
+
hr: {
|
|
53
|
+
totalLevels: 'Ukupno razina:',
|
|
54
|
+
level1: 'Razina 1:',
|
|
55
|
+
get: 'Dobiti:',
|
|
56
|
+
endsIn: 'Završava za',
|
|
57
|
+
expired: 'Isteklo',
|
|
58
|
+
viewDetails: 'Pogledaj detalje',
|
|
59
|
+
placeBetsOf: 'Postavite oklade od',
|
|
60
|
+
place: 'Postavi',
|
|
61
|
+
bet: 'kladnja',
|
|
62
|
+
bets: 'kladnje'
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
export const translate = (key, customLang) => {
|
|
66
|
+
const lang = customLang;
|
|
67
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
68
|
+
};
|
|
69
|
+
export const getTranslations = (data) => {
|
|
70
|
+
Object.keys(data).forEach((item) => {
|
|
71
|
+
for (let key in data[item]) {
|
|
72
|
+
TRANSLATIONS[item][key] = data[item][key];
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
export const resolveTranslationUrl = async (translationUrl) => {
|
|
77
|
+
if (translationUrl) {
|
|
78
|
+
try {
|
|
79
|
+
const response = await fetch(translationUrl);
|
|
80
|
+
if (!response.ok) {
|
|
81
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
82
|
+
}
|
|
83
|
+
const translations = await response.json();
|
|
84
|
+
getTranslations(translations);
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
console.error('Failed to fetch or parse translations from URL:', error);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export var EChallengeLevelTargetType;
|
|
2
|
+
(function (EChallengeLevelTargetType) {
|
|
3
|
+
EChallengeLevelTargetType[EChallengeLevelTargetType["Accumulative"] = 0] = "Accumulative";
|
|
4
|
+
EChallengeLevelTargetType[EChallengeLevelTargetType["SingleBet"] = 1] = "SingleBet";
|
|
5
|
+
EChallengeLevelTargetType[EChallengeLevelTargetType["MultipleOneBetSize"] = 2] = "MultipleOneBetSize";
|
|
6
|
+
})(EChallengeLevelTargetType || (EChallengeLevelTargetType = {}));
|
|
7
|
+
export var EChallengeRecurrenceType;
|
|
8
|
+
(function (EChallengeRecurrenceType) {
|
|
9
|
+
EChallengeRecurrenceType[EChallengeRecurrenceType["Single"] = 0] = "Single";
|
|
10
|
+
EChallengeRecurrenceType[EChallengeRecurrenceType["Daily"] = 1] = "Daily";
|
|
11
|
+
EChallengeRecurrenceType[EChallengeRecurrenceType["Weekly"] = 2] = "Weekly";
|
|
12
|
+
EChallengeRecurrenceType[EChallengeRecurrenceType["Monthly"] = 3] = "Monthly";
|
|
13
|
+
})(EChallengeRecurrenceType || (EChallengeRecurrenceType = {}));
|
|
14
|
+
export var EChallengeRewardType;
|
|
15
|
+
(function (EChallengeRewardType) {
|
|
16
|
+
EChallengeRewardType[EChallengeRewardType["FreeSpins"] = 0] = "FreeSpins";
|
|
17
|
+
EChallengeRewardType[EChallengeRewardType["LuckyWheel"] = 1] = "LuckyWheel";
|
|
18
|
+
EChallengeRewardType[EChallengeRewardType["Leaderboard"] = 2] = "Leaderboard";
|
|
19
|
+
EChallengeRewardType[EChallengeRewardType["Challenge"] = 3] = "Challenge";
|
|
20
|
+
EChallengeRewardType[EChallengeRewardType["Custom"] = 4] = "Custom";
|
|
21
|
+
})(EChallengeRewardType || (EChallengeRewardType = {}));
|
|
22
|
+
export var EChallengeStatus;
|
|
23
|
+
(function (EChallengeStatus) {
|
|
24
|
+
EChallengeStatus[EChallengeStatus["Setup"] = 0] = "Setup";
|
|
25
|
+
EChallengeStatus[EChallengeStatus["Active"] = 1] = "Active";
|
|
26
|
+
EChallengeStatus[EChallengeStatus["Paused"] = 2] = "Paused";
|
|
27
|
+
EChallengeStatus[EChallengeStatus["Closed"] = 3] = "Closed";
|
|
28
|
+
EChallengeStatus[EChallengeStatus["Deleted"] = 4] = "Deleted";
|
|
29
|
+
})(EChallengeStatus || (EChallengeStatus = {}));
|
|
30
|
+
export var EChallengeTriggerType;
|
|
31
|
+
(function (EChallengeTriggerType) {
|
|
32
|
+
EChallengeTriggerType[EChallengeTriggerType["GameLaunch"] = 0] = "GameLaunch";
|
|
33
|
+
EChallengeTriggerType[EChallengeTriggerType["Reward"] = 1] = "Reward";
|
|
34
|
+
EChallengeTriggerType[EChallengeTriggerType["Manual"] = 2] = "Manual";
|
|
35
|
+
})(EChallengeTriggerType || (EChallengeTriggerType = {}));
|
|
36
|
+
export var EChallengeValidityType;
|
|
37
|
+
(function (EChallengeValidityType) {
|
|
38
|
+
EChallengeValidityType[EChallengeValidityType["Period"] = 0] = "Period";
|
|
39
|
+
EChallengeValidityType[EChallengeValidityType["Date"] = 1] = "Date";
|
|
40
|
+
})(EChallengeValidityType || (EChallengeValidityType = {}));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export function format(first, middle, last) {
|
|
2
|
+
return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');
|
|
3
|
+
}
|
|
4
|
+
export function getTimeLeft(endTime) {
|
|
5
|
+
const now = new Date();
|
|
6
|
+
const end = new Date(endTime);
|
|
7
|
+
let diff = end.getTime() - now.getTime();
|
|
8
|
+
if (diff <= 0) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const days = Math.floor(diff / (1000 * 60 * 60 * 24));
|
|
12
|
+
diff -= days * (1000 * 60 * 60 * 24);
|
|
13
|
+
const hours = Math.floor(diff / (1000 * 60 * 60));
|
|
14
|
+
diff -= hours * (1000 * 60 * 60);
|
|
15
|
+
const minutes = Math.floor(diff / (1000 * 60));
|
|
16
|
+
diff -= minutes * (1000 * 60);
|
|
17
|
+
const seconds = Math.floor(diff / 1000);
|
|
18
|
+
const pad = (n) => n.toString().padStart(2, '0');
|
|
19
|
+
return `${pad(days)} : ${pad(hours)} : ${pad(minutes)} : ${pad(seconds)}`;
|
|
20
|
+
}
|