@everymatrix/casino-engagement-suite-jackpot-details 1.36.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.
Files changed (53) hide show
  1. package/dist/casino-engagement-suite-jackpot-details/casino-engagement-suite-jackpot-details.esm.js +1 -0
  2. package/dist/casino-engagement-suite-jackpot-details/index.esm.js +0 -0
  3. package/dist/casino-engagement-suite-jackpot-details/p-9764b08b.entry.js +1 -0
  4. package/dist/casino-engagement-suite-jackpot-details/p-e36472df.js +1 -0
  5. package/dist/casino-engagement-suite-jackpot-details/p-e8978b77.entry.js +1 -0
  6. package/dist/cjs/casino-engagement-suite-jackpot-details.cjs.entry.js +285 -0
  7. package/dist/cjs/casino-engagement-suite-jackpot-details.cjs.js +19 -0
  8. package/dist/cjs/casino-engagement-suite-progress-bar.cjs.entry.js +76 -0
  9. package/dist/cjs/index-8f767151.js +1317 -0
  10. package/dist/cjs/index.cjs.js +2 -0
  11. package/dist/cjs/loader.cjs.js +21 -0
  12. package/dist/collection/collection-manifest.json +19 -0
  13. package/dist/collection/components/casino-engagement-suite-jackpot-details/casino-engagement-suite-jackpot-details.css +358 -0
  14. package/dist/collection/components/casino-engagement-suite-jackpot-details/casino-engagement-suite-jackpot-details.js +460 -0
  15. package/dist/collection/index.js +1 -0
  16. package/dist/collection/models/index.js +1 -0
  17. package/dist/collection/utils/index.js +5 -0
  18. package/dist/collection/utils/locale.utils.js +22 -0
  19. package/dist/components/casino-engagement-suite-jackpot-details.d.ts +11 -0
  20. package/dist/components/casino-engagement-suite-jackpot-details.js +316 -0
  21. package/dist/components/casino-engagement-suite-progress-bar.js +97 -0
  22. package/dist/components/index.d.ts +26 -0
  23. package/dist/components/index.js +1 -0
  24. package/dist/esm/casino-engagement-suite-jackpot-details.entry.js +281 -0
  25. package/dist/esm/casino-engagement-suite-jackpot-details.js +17 -0
  26. package/dist/esm/casino-engagement-suite-progress-bar.entry.js +72 -0
  27. package/dist/esm/index-ec30ecaa.js +1290 -0
  28. package/dist/esm/index.js +1 -0
  29. package/dist/esm/loader.js +17 -0
  30. package/dist/esm/polyfills/core-js.js +11 -0
  31. package/dist/esm/polyfills/css-shim.js +1 -0
  32. package/dist/esm/polyfills/dom.js +79 -0
  33. package/dist/esm/polyfills/es5-html-element.js +1 -0
  34. package/dist/esm/polyfills/index.js +34 -0
  35. package/dist/esm/polyfills/system.js +6 -0
  36. package/dist/index.cjs.js +1 -0
  37. package/dist/index.js +1 -0
  38. package/dist/stencil.config.js +22 -0
  39. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/casino-engagement-suite-jackpot-details/.stencil/packages/casino-engagement-suite-jackpot-details/stencil.config.d.ts +2 -0
  40. package/dist/types/components/casino-engagement-suite-jackpot-details/casino-engagement-suite-jackpot-details.d.ts +82 -0
  41. package/dist/types/components.d.ts +88 -0
  42. package/dist/types/index.d.ts +1 -0
  43. package/dist/types/models/index.d.ts +49 -0
  44. package/dist/types/stencil-public-runtime.d.ts +1565 -0
  45. package/dist/types/utils/index.d.ts +1 -0
  46. package/dist/types/utils/locale.utils.d.ts +1 -0
  47. package/loader/cdn.js +3 -0
  48. package/loader/index.cjs.js +3 -0
  49. package/loader/index.d.ts +12 -0
  50. package/loader/index.es2017.js +3 -0
  51. package/loader/index.js +4 -0
  52. package/loader/package.json +10 -0
  53. package/package.json +19 -0
@@ -0,0 +1,316 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
+
3
+ const DEFAULT_LANGUAGE = 'en';
4
+ const SUPPORTED_LANGUAGES = ['en'];
5
+ const TRANSLATIONS = {
6
+ en: {
7
+ jackpots: 'Jackpots',
8
+ join: 'Join',
9
+ unjoin: 'Unjoin',
10
+ info: 'Info',
11
+ games: 'Games',
12
+ operatorContribution: 'Operator Contribution',
13
+ type: 'Type',
14
+ winningProbability: 'Winning Probability',
15
+ tc: 'Terms & Conditions',
16
+ jackpotIsWon: 'Jackpot’s won!',
17
+ loadMore: 'Load More',
18
+ jackpotDetails: 'Jackpot Details',
19
+ }
20
+ };
21
+ const translate = (key, customLang) => {
22
+ const lang = customLang;
23
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
24
+ };
25
+
26
+ function formatBalance(amount, currency, maxAmount = 99999999) {
27
+ amount = Math.min(amount, maxAmount);
28
+ return `${currency} ${new Intl.NumberFormat('en', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
29
+ .format(amount)}`;
30
+ }
31
+
32
+ const casinoEngagementSuiteJackpotDetailsCss = ":host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none}button:focus{outline:none}button:not(:disabled){cursor:pointer}.PopupButton{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:var(--emw--color-typography, #1E1638);border-radius:99px;min-width:88px;min-height:32px;font-size:14px;font-weight:700;position:relative;font-family:\"Montserrat\", sans-serif}.PopupButton.Active{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.PopupButton.Active::before{content:\"\";position:absolute;inset:0;padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude;border-radius:99px}.PopupButton.Loading{opacity:0.5;pointer-events:none}.JackpotDetailsPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative}.JackpotDetailsPopup.Disabled .JackpotDetailsHeader{opacity:0.5}.JackpotDetailsPopup.Disabled .JackpotDetailsTabs{cursor:default;pointer-events:none}.JackpotDetailsPopup.Disabled .JackpotInfoItem{color:var(--emw--color-primary, #8F8B9C)}.JackpotDetailsNavigation{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.JackpotDetailsNavigation .JackpotIconButton{width:16px;height:16px;cursor:pointer;display:flex;justify-content:center;align-items:center}.JackpotDetailsNavigation .JackpotPopupName{color:var(--emw--color-gray-100, #BBB9C3);font-size:16px;font-weight:500;line-height:16px;display:none}.JackpotDetailsPopupContent{padding:8px 18px 18px;overflow:hidden;height:100%;display:flex;flex-direction:column}.JackpotDetailsHeader{display:flex;justify-content:space-between;align-items:center;gap:12px}.JackpotDetailsHeader .JackpotDetailsHeaderSecondCol{text-align:right}.JackpotDetailsHeader .JackpotType{text-transform:uppercase;font-family:\"Montserrat\", sans-serif;font-size:var(--emw--font-size-medium, 18px);font-weight:var(--emw--font-weight-bold, 700);line-height:22px;color:var(--emfe-w-color-white, #FFF);word-break:break-all}.JackpotDetailsHeader .JackpotBalance{margin-top:8px;font-family:Montserrat, sans-serif;font-size:18px;font-weight:var(--emw--font-weight-bold, 800);line-height:18px}.JackpotDetailsHeader .JackpotIsWon{margin-top:8px;font-family:Montserrat, sans-serif;font-weight:var(--emw--font-weight-bold, 700);font-size:12px;line-height:15px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-text-fill-color:transparent;-webkit-background-clip:text}.JackpotDetailsPopup.Mega .JackpotBalance{background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);-webkit-text-fill-color:transparent;-webkit-background-clip:text}.JackpotDetailsPopup.Major .JackpotBalance{background:linear-gradient(180deg, #A19FA0 5.36%, #E1DBDB 28.86%, #FEFFFF 36.86%, #E1DBDB 44.36%, #5E5B5F 91.86%);-webkit-text-fill-color:transparent;-webkit-background-clip:text}.JackpotDetailsPopup.Minor .JackpotBalance{background:linear-gradient(180deg, #A0522C 5.36%, #FFAB8C 28.86%, #FFEEDF 36.86%, #FFAB8C 44.36%, #6A3A21 91.86%);-webkit-text-fill-color:transparent;-webkit-background-clip:text}.JackpotGamesLoadMore::before,.JackpotJoinButton.Joined::before{content:\"\";position:absolute;inset:0;border-radius:var(--emw--button-border-radius, 4px);padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.JackpotGamesButton{margin-top:12px;align-self:center;min-width:140px}.JackpotCountdown{font-size:var(--emw--font-size-x-small, 12px);line-height:12px;margin-top:12px;color:var(--emw--color-gray-150, #BBB9C3)}.JackpotCountdown.Suspended{font-weight:var(--emw--font-weight-bold, 700);color:var(--emfe-w-color-white, #FFF);text-transform:capitalize}.JackpotDetailsTabsWrapper{display:flex;flex-direction:column}.JackpotDetailsTabs{margin:20px 0 12px;display:flex;position:relative}.JackpotDetailsTabs .JackpotDetailsTab{padding:9px 16px 7px;font-weight:500;font-size:12px;line-height:15px;color:var(--emw--color-background, #666178);border-bottom:2px solid transparent;cursor:pointer}.JackpotDetailsTabs .JackpotDetailsTab.Active{color:var(--emw--color-typography, #FFF);border-color:var(--emw--color-typography, #FFF)}.JackpotDetailsTabs::after{content:\"\";position:absolute;bottom:0;left:0;width:100%;height:1px;background-color:var(--emw--color-typography, #FFF);opacity:0.1}.JackpotInfoItem{margin-bottom:8px;color:var(--emw--color-typography, #FFF);font-size:14px;line-height:17px}.JackpotInfoItem span{font-weight:var(--emw--font-weight-bold, 700)}.JackpotInfoItem .tc{color:var(--emw--color-primary, #59D1FF)}.JackpotGamesListWrapper{overflow:auto;flex-grow:1}.JackpotGamesList{display:flex;gap:10px;flex-wrap:wrap}.JackpotGamesList .JackpotGamesListItem{width:calc(25% - 8px);aspect-ratio:74/40;cursor:pointer}.JackpotGamesList .JackpotGamesListItem.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.JackpotDetailsButton{margin-bottom:12px;display:flex;align-items:center;font-size:var(--emw--font-size-x-small, 12px);line-height:12px;color:var(--emw--color-primary-variant, #666178);cursor:pointer}.JackpotDetailsButton .Toggle{width:16px;height:16px;margin-right:4px}.JackpotDetailsButton .Closed{background:center/100% url(\"https://static.everymatrix.com/gic/img/engagement-suite/eye-closed.svg\")}.JackpotDetailsButton .Open{background:center/100% url(\"https://static.everymatrix.com/gic/img/engagement-suite/eye-open.svg\")}.JackpotDescription{margin-bottom:20px;color:var(--emw--color-typography, #FFF);font-size:var(--emw--font-size-small, 14px);line-height:17px}.JackpotDetailsPopup.Tablet .JackpotDetailsButton,.JackpotDetailsPopup.Desktop .JackpotDetailsButton{margin-bottom:20px}.JackpotDetailsPopup.Tablet .JackpotDescription,.JackpotDetailsPopup.Desktop .JackpotDescription{font-size:var(--emw--font-size-medium, 16px);line-height:22px}.JackpotDetailsPopup.Tablet .JackpotPopupName,.JackpotDetailsPopup.Desktop .JackpotPopupName{display:block}.JackpotDetailsPopup.Tablet .JackpotDetailsNavigation,.JackpotDetailsPopup.Desktop .JackpotDetailsNavigation{padding-top:16px}.JackpotDetailsPopup.Tablet .JackpotIconButton,.JackpotDetailsPopup.Desktop .JackpotIconButton{width:24px;height:24px}.JackpotDetailsPopup.Tablet .JackpotDetailsPopupContent,.JackpotDetailsPopup.Desktop .JackpotDetailsPopupContent{padding:20px 24px 30px}.JackpotDetailsPopup.Tablet .JackpotBalance,.JackpotDetailsPopup.Tablet .JackpotType,.JackpotDetailsPopup.Desktop .JackpotBalance,.JackpotDetailsPopup.Desktop .JackpotType{line-height:27px;font-size:22px}.JackpotDetailsPopup.Tablet .JackpotBalance,.JackpotDetailsPopup.Desktop .JackpotBalance{font-weight:var(--emw--font-weight-bold, 700)}.JackpotDetailsPopup.Tablet .PopupButton,.JackpotDetailsPopup.Desktop .PopupButton{min-height:36px;font-size:16px}.JackpotDetailsPopup.Tablet .JackpotCountdown,.JackpotDetailsPopup.Desktop .JackpotCountdown{font-size:var(--emw--font-size-small, 14px);line-height:14px}.JackpotDetailsPopup.Tablet .JackpotDetailsTabs,.JackpotDetailsPopup.Desktop .JackpotDetailsTabs{margin-bottom:20px}.JackpotDetailsPopup.Tablet .JackpotInfoItem,.JackpotDetailsPopup.Desktop .JackpotInfoItem{font-size:16px;line-height:20px}.JackpotDetailsPopup.Tablet .JackpotIsWon,.JackpotDetailsPopup.Desktop .JackpotIsWon{font-size:14px;line-height:17px}.JackpotDetailsPopup.Tablet .JackpotGamesList,.JackpotDetailsPopup.Desktop .JackpotGamesList{gap:12px}.JackpotDetailsPopup.Tablet .JackpotGamesList .JackpotGamesListItem,.JackpotDetailsPopup.Desktop .JackpotGamesList .JackpotGamesListItem{width:calc(20% - 10px)}.JackpotDetailsPopup.Tablet .JackpotDetailsTabs .JackpotDetailsTab,.JackpotDetailsPopup.Desktop .JackpotDetailsTabs .JackpotDetailsTab{font-size:16px;line-height:20px}";
33
+
34
+ const CasinoEngagementSuiteJackpotDetails$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
35
+ constructor() {
36
+ super();
37
+ this.__registerHost();
38
+ this.__attachShadow();
39
+ this.close = createEvent(this, "close", 7);
40
+ this.back = createEvent(this, "back", 7);
41
+ /**
42
+ * Client custom styling via string
43
+ */
44
+ this.clientStyling = '';
45
+ /**
46
+ * Client custom styling via url
47
+ */
48
+ this.clientStylingUrl = '';
49
+ /**
50
+ * Language of the widget
51
+ */
52
+ this.language = 'en';
53
+ /**
54
+ * Current game slug
55
+ */
56
+ this.gameSlug = '';
57
+ /**
58
+ * User's device type
59
+ */
60
+ this.device = 'Mobile';
61
+ this.limitStylingAppends = false;
62
+ this.timer = '';
63
+ this.disabledStatus = '';
64
+ this.activeTab = 1;
65
+ this.visibleGames = [];
66
+ this.loading = false;
67
+ this.enabled = false;
68
+ this.showDetails = false;
69
+ this.maxVisibleGames = 0;
70
+ this.handleTabChange = (e) => {
71
+ this.activeTab = +(e.target.getAttribute('data-index'));
72
+ this.visibleGames = [];
73
+ this.maxVisibleGames = 0;
74
+ };
75
+ this.handleLoadMore = () => {
76
+ this.visibleGames = this.jackpot.GamesInfo.slice(0, this.visibleGames.length + this.maxVisibleGames);
77
+ };
78
+ this.toggleShowDetails = () => {
79
+ this.showDetails = !this.showDetails;
80
+ };
81
+ this.changeJackpotStatus = (ev) => {
82
+ ev.stopPropagation();
83
+ window.postMessage({
84
+ type: 'JackpotChangeStatusRequest',
85
+ data: {
86
+ [this.jackpot.Id]: !this.jackpot.Enabled,
87
+ },
88
+ });
89
+ this.loading = true;
90
+ };
91
+ this.setClientStyling = () => {
92
+ let sheet = document.createElement('style');
93
+ sheet.innerHTML = this.clientStyling;
94
+ this.host.prepend(sheet);
95
+ };
96
+ this.setClientStylingURL = () => {
97
+ let url = new URL(this.clientStylingUrl);
98
+ let cssFile = document.createElement('style');
99
+ fetch(url.href)
100
+ .then((res) => res.text())
101
+ .then((data) => {
102
+ cssFile.innerHTML = data;
103
+ setTimeout(() => { this.host.prepend(cssFile); }, 1);
104
+ })
105
+ .catch((err) => {
106
+ console.log('Error ', err);
107
+ });
108
+ };
109
+ this.handleCloseClick = () => {
110
+ this.close.emit();
111
+ };
112
+ this.handleBackClick = () => {
113
+ this.back.emit();
114
+ };
115
+ this.onGameClick = (ev) => {
116
+ const slug = ev.currentTarget.getAttribute('data-slug');
117
+ if (slug) {
118
+ window.postMessage({
119
+ type: 'EngagementSuiteGameRedirect',
120
+ data: {
121
+ Slug: slug
122
+ }
123
+ });
124
+ }
125
+ };
126
+ }
127
+ handleEvent(e) {
128
+ const { type, data } = e === null || e === void 0 ? void 0 : e.data;
129
+ switch (type) {
130
+ case 'UpdateJackpotStatus': {
131
+ this.updateJackpotStatus(e.data.data);
132
+ break;
133
+ }
134
+ case 'JoinJackpotResult': {
135
+ const res = data;
136
+ if (res.Success && this.jackpot.Id in res.JackpotIds) {
137
+ this.enabled = this.jackpot.Enabled = res.JackpotIds[this.jackpot.Id];
138
+ }
139
+ this.loading = false;
140
+ break;
141
+ }
142
+ case 'UpdateJackpotBalance': {
143
+ const jackpotUpdate = data
144
+ .find((updateMessage => updateMessage.JackpotId === this.jackpot.Id));
145
+ if (jackpotUpdate) {
146
+ this.balance = this.jackpot.Balance = jackpotUpdate.Balance;
147
+ this.winBalance = this.jackpot.WinBalance = jackpotUpdate.WinBalance;
148
+ }
149
+ }
150
+ }
151
+ }
152
+ componentWillLoad() {
153
+ this.startCountdown();
154
+ this.enabled = this.jackpot.Enabled;
155
+ this.balance = this.jackpot.Balance;
156
+ this.winBalance = this.jackpot.WinBalance;
157
+ }
158
+ componentDidRender() {
159
+ if (!this.limitStylingAppends && this.host) {
160
+ if (this.clientStyling)
161
+ this.setClientStyling();
162
+ if (this.clientStylingUrl)
163
+ this.setClientStylingURL();
164
+ this.limitStylingAppends = true;
165
+ }
166
+ if (this.activeTab === 2 && !this.maxVisibleGames) {
167
+ const gap = this.device === 'Mobile' ? 10 : 12;
168
+ const gamesPerRow = this.device === 'Mobile' ? 4 : 5;
169
+ const availableWidth = this.gamesListWrapperEl.offsetWidth - (gap * (gamesPerRow - 1));
170
+ const gameElWidth = availableWidth / gamesPerRow;
171
+ const gameElHeight = (gameElWidth / 74 * 40) + gap;
172
+ this.maxVisibleGames = Math.floor(this.gamesListWrapperEl.offsetHeight / gameElHeight) * gamesPerRow;
173
+ this.visibleGames = this.jackpot.GamesInfo.slice(0, this.maxVisibleGames);
174
+ }
175
+ }
176
+ disconnectedCallback() {
177
+ this.clearInterval();
178
+ }
179
+ clearInterval() {
180
+ if (this.interval) {
181
+ clearInterval(this.interval);
182
+ this.interval = null;
183
+ }
184
+ }
185
+ updateJackpotStatus(event) {
186
+ if (event.IsClosed) {
187
+ this.clearInterval();
188
+ this.disabledStatus = event.Reason;
189
+ this.activeTab = 1;
190
+ }
191
+ else {
192
+ this.disabledStatus = '';
193
+ this.jackpot.JackpotEndTime = event.JackpotEndTime;
194
+ this.startCountdown();
195
+ }
196
+ }
197
+ getTopNavigationTemplate() {
198
+ return (h("div", { class: "JackpotDetailsNavigation" }, h("button", { class: "JackpotIconButton", onClick: this.handleBackClick }, h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/back.svg", alt: "back" })), h("div", { class: "JackpotPopupName" }, translate('jackpots', this.language)), h("button", { class: "JackpotIconButton", onClick: this.handleCloseClick }, h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", alt: "close" }))));
199
+ }
200
+ getJackpotBalance() {
201
+ return formatBalance(this.winBalance || this.balance, this.jackpot.Currency);
202
+ }
203
+ getJoinButtonClasses() {
204
+ return {
205
+ PopupButton: true,
206
+ Active: this.enabled,
207
+ Loading: this.loading
208
+ };
209
+ }
210
+ getJackpotDetailsHeaderTemplate() {
211
+ return (h("div", { class: "JackpotDetailsHeader" }, h("div", null, h("div", { class: "JackpotType" }, this.jackpot.Type), h("div", { class: "JackpotBalance" }, this.getJackpotBalance())), h("div", { class: "JackpotDetailsHeaderSecondCol" }, h("button", { disabled: !!this.disabledStatus, onClick: this.changeJackpotStatus, class: this.getJoinButtonClasses() }, this.enabled
212
+ ? translate('unjoin', this.language)
213
+ : translate('join', this.language)), this.winBalance && h("div", { class: "JackpotIsWon" }, translate('jackpotIsWon', this.language)))));
214
+ }
215
+ getTabsTemplate() {
216
+ return h("div", { class: "JackpotDetailsTabs" }, h("div", { "data-index": "1", onClick: this.handleTabChange, class: `JackpotDetailsTab ${this.activeTab === 1 ? 'Active' : ''}` }, translate('info', this.language)), h("div", { "data-index": "2", onClick: this.handleTabChange, class: `JackpotDetailsTab ${this.activeTab === 2 ? 'Active' : ''}` }, translate('games', this.language)));
217
+ }
218
+ getTabsContentTemplate() {
219
+ return this.activeTab === 1
220
+ ? this.getJackpotInfoTemplate()
221
+ : this.getGamesTemplate();
222
+ }
223
+ getJackpotDetailsTemplate() {
224
+ return h("div", null, h("div", { class: "JackpotDetailsButton", onClick: this.toggleShowDetails }, h("div", { class: `Toggle ${this.showDetails ? 'Closed' : 'Open'}` }), h("span", null, translate('jackpotDetails', this.language))), this.showDetails && h("p", { class: "JackpotDescription" }, this.jackpot.Description));
225
+ }
226
+ getJackpotInfoTemplate() {
227
+ return h("div", null, this.jackpot.Description && this.getJackpotDetailsTemplate(), h("div", { class: "JackpotInfo" }, h("div", { class: "JackpotInfoItem" }, translate('operatorContribution', this.language), ":\u00A0", h("span", null, this.jackpot.OperatorContributionPercent, "%")), h("div", { class: "JackpotInfoItem" }, translate('type', this.language), ":\u00A0", h("span", null, this.jackpot.JackpotTypePresentation)), h("div", { class: "JackpotInfoItem" }, translate('winningProbability', this.language), ":\u00A0", h("span", null, "1:", this.jackpot.Probability)), this.jackpot.JackpotRulesUrl && h("div", { class: "JackpotInfoItem" }, h("a", { class: "tc", href: this.jackpot.JackpotRulesUrl, target: "_blank" }, translate('tc', this.jackpot.JackpotRulesUrl)))));
228
+ }
229
+ getGamesTemplate() {
230
+ const list = this.visibleGames.map((game) => {
231
+ return h("div", { onClick: this.onGameClick, class: `JackpotGamesListItem ${game.GameSlug === this.gameSlug ? 'Disabled' : ''}`, key: game.CasinoGameId, "data-slug": game.GameSlug, style: { background: `center / cover url(${game.GameIcon}) no-repeat` }, title: game.GameName });
232
+ });
233
+ return [
234
+ h("div", { class: "JackpotGamesListWrapper", ref: el => this.gamesListWrapperEl = el }, h("div", { class: "JackpotGamesList" }, list)),
235
+ this.visibleGames.length < this.jackpot.GamesInfo.length
236
+ ? h("button", { class: "PopupButton Active JackpotGamesButton", onClick: this.handleLoadMore }, translate('loadMore', this.language))
237
+ : ''
238
+ ];
239
+ }
240
+ getJackpotCountdown() {
241
+ const timerMessage = this.disabledStatus || this.timer;
242
+ return (h("div", { class: `JackpotCountdown ${this.disabledStatus ? 'Suspended' : ''}` }, timerMessage));
243
+ }
244
+ startCountdown() {
245
+ this.updateTimer();
246
+ this.interval = setInterval(() => {
247
+ this.updateTimer();
248
+ }, 1000);
249
+ }
250
+ updateTimer() {
251
+ const expirationTime = new Date(this.jackpot.JackpotEndTime).getTime();
252
+ const now = new Date().getTime();
253
+ const distance = expirationTime - now;
254
+ if (distance < 1) {
255
+ this.clearInterval();
256
+ return;
257
+ }
258
+ const { days, hours, minutes, seconds } = {
259
+ days: String(Math.floor(distance / (1000 * 60 * 60 * 24))).padStart(2, '0'),
260
+ hours: String(Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))).padStart(2, '0'),
261
+ minutes: String(Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60))).padStart(2, '0'),
262
+ seconds: String(Math.floor((distance % (1000 * 60)) / 1000)).padStart(2, '0')
263
+ };
264
+ this.timer = days === '00'
265
+ ? `${hours}h:${minutes}m:${seconds}s`
266
+ : `${days}d:${hours}h:${minutes}m`;
267
+ }
268
+ getPopupClasses() {
269
+ return {
270
+ JackpotDetailsPopup: true,
271
+ Disabled: !!this.disabledStatus,
272
+ [this.device]: true,
273
+ [this.jackpot.Type.charAt(0).toUpperCase() + this.jackpot.Type.slice(1)]: true
274
+ };
275
+ }
276
+ render() {
277
+ return h("div", { class: this.getPopupClasses() }, this.getTopNavigationTemplate(), h("div", { class: "JackpotDetailsPopupContent" }, this.getJackpotDetailsHeaderTemplate(), this.getJackpotCountdown(), this.getTabsTemplate(), this.getTabsContentTemplate()));
278
+ }
279
+ get host() { return this; }
280
+ static get style() { return casinoEngagementSuiteJackpotDetailsCss; }
281
+ }, [1, "casino-engagement-suite-jackpot-details", {
282
+ "clientStyling": [513, "client-styling"],
283
+ "clientStylingUrl": [513, "client-styling-url"],
284
+ "jackpot": [16],
285
+ "language": [1],
286
+ "gameSlug": [1, "game-slug"],
287
+ "device": [1],
288
+ "limitStylingAppends": [32],
289
+ "timer": [32],
290
+ "disabledStatus": [32],
291
+ "activeTab": [32],
292
+ "visibleGames": [32],
293
+ "loading": [32],
294
+ "enabled": [32],
295
+ "balance": [32],
296
+ "winBalance": [32],
297
+ "showDetails": [32]
298
+ }, [[8, "message", "handleEvent"]]]);
299
+ function defineCustomElement$1() {
300
+ if (typeof customElements === "undefined") {
301
+ return;
302
+ }
303
+ const components = ["casino-engagement-suite-jackpot-details"];
304
+ components.forEach(tagName => { switch (tagName) {
305
+ case "casino-engagement-suite-jackpot-details":
306
+ if (!customElements.get(tagName)) {
307
+ customElements.define(tagName, CasinoEngagementSuiteJackpotDetails$1);
308
+ }
309
+ break;
310
+ } });
311
+ }
312
+
313
+ const CasinoEngagementSuiteJackpotDetails = CasinoEngagementSuiteJackpotDetails$1;
314
+ const defineCustomElement = defineCustomElement$1;
315
+
316
+ export { CasinoEngagementSuiteJackpotDetails, defineCustomElement };
@@ -0,0 +1,97 @@
1
+ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
+
3
+ const casinoEngagementSuiteProgressBarCss = ":host{display:block;font-family:inherit}:host(.Desktop) .ProgressBarPercent{font-size:14px;line-height:14px}.ProgressBarBackground{height:8px;background-color:var(--emw--color-background, #666178);border-radius:4px;position:relative}.ProgressBarLine{position:absolute;left:0;top:0;bottom:0;border-radius:4px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);transition:width ease-out 0.3s}.ProgressBarInfo{margin-bottom:8px;display:flex;justify-content:space-between;align-items:center}.ProgressBarPercent{font-weight:700;font-size:12px;line-height:12px}.HidePercent .ProgressBarPercent{display:none}.ProgressBar:not(.Disabled) .ProgressBarPercent{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.ProgressBar.Disabled .ProgressBarPercent{color:var(--emw--color-background, #666178)}.ProgressBar.Disabled .ProgressBarLine{background:var(--emw--color-background-secondary, #474668)}";
4
+
5
+ const CasinoEngagementSuiteProgressBar$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
+ constructor() {
7
+ super();
8
+ this.__registerHost();
9
+ this.__attachShadow();
10
+ /**
11
+ * Value for the widget
12
+ */
13
+ this.value = 0;
14
+ /**
15
+ * Shows disabled styles
16
+ */
17
+ this.disabled = false;
18
+ /**
19
+ * Hide percent value
20
+ */
21
+ this.hidePercent = false;
22
+ /**
23
+ * Client custom styling via string
24
+ */
25
+ this.clientStyling = '';
26
+ /**
27
+ * Client custom styling via url
28
+ */
29
+ this.clientStylingUrl = '';
30
+ this.limitStylingAppends = false;
31
+ this.setClientStyling = () => {
32
+ let sheet = document.createElement('style');
33
+ sheet.innerHTML = this.clientStyling;
34
+ this.host.prepend(sheet);
35
+ };
36
+ this.setClientStylingURL = () => {
37
+ let url = new URL(this.clientStylingUrl);
38
+ let cssFile = document.createElement('style');
39
+ fetch(url.href)
40
+ .then((res) => res.text())
41
+ .then((data) => {
42
+ cssFile.innerHTML = data;
43
+ setTimeout(() => { this.host.prepend(cssFile); }, 1);
44
+ })
45
+ .catch((err) => {
46
+ console.log('Error ', err);
47
+ });
48
+ };
49
+ }
50
+ componentDidRender() {
51
+ if (!this.limitStylingAppends && this.host) {
52
+ if (this.clientStyling)
53
+ this.setClientStyling();
54
+ if (this.clientStylingUrl)
55
+ this.setClientStylingURL();
56
+ this.limitStylingAppends = true;
57
+ }
58
+ }
59
+ getProgressBarClasses() {
60
+ return {
61
+ ProgressBar: true,
62
+ Completed: this.value === 100,
63
+ Disabled: this.disabled,
64
+ HidePercent: this.hidePercent
65
+ };
66
+ }
67
+ render() {
68
+ return h("div", { class: this.getProgressBarClasses(), part: "ProgressBar" }, h("div", { class: "ProgressBarInfo", part: "ProgressBarInfo" }, h("slot", { name: "Title" }, h("div", null)), h("slot", { name: "Percent" }, h("div", { class: "ProgressBarPercent", part: "ProgressBarPercent" }, this.value, "%"))), h("div", { class: "ProgressBarBackground", part: "ProgressBarBackground" }, h("div", { class: "ProgressBarLine", part: "ProgressBarLine", style: { width: this.value + '%' } })));
69
+ }
70
+ get host() { return this; }
71
+ static get style() { return casinoEngagementSuiteProgressBarCss; }
72
+ }, [1, "casino-engagement-suite-progress-bar", {
73
+ "value": [2],
74
+ "disabled": [4],
75
+ "hidePercent": [4, "hide-percent"],
76
+ "clientStyling": [513, "client-styling"],
77
+ "clientStylingUrl": [513, "client-styling-url"],
78
+ "limitStylingAppends": [32]
79
+ }]);
80
+ function defineCustomElement$1() {
81
+ if (typeof customElements === "undefined") {
82
+ return;
83
+ }
84
+ const components = ["casino-engagement-suite-progress-bar"];
85
+ components.forEach(tagName => { switch (tagName) {
86
+ case "casino-engagement-suite-progress-bar":
87
+ if (!customElements.get(tagName)) {
88
+ customElements.define(tagName, CasinoEngagementSuiteProgressBar$1);
89
+ }
90
+ break;
91
+ } });
92
+ }
93
+
94
+ const CasinoEngagementSuiteProgressBar = CasinoEngagementSuiteProgressBar$1;
95
+ const defineCustomElement = defineCustomElement$1;
96
+
97
+ export { CasinoEngagementSuiteProgressBar, defineCustomElement };
@@ -0,0 +1,26 @@
1
+ /* CasinoEngagementSuiteJackpotDetails custom elements */
2
+
3
+ import type { Components, JSX } from "../types/components";
4
+
5
+ /**
6
+ * Used to manually set the base path where assets can be found.
7
+ * If the script is used as "module", it's recommended to use "import.meta.url",
8
+ * such as "setAssetPath(import.meta.url)". Other options include
9
+ * "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
10
+ * dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
11
+ * But do note that this configuration depends on how your script is bundled, or lack of
12
+ * bundling, and where your assets can be loaded from. Additionally custom bundling
13
+ * will have to ensure the static assets are copied to its build directory.
14
+ */
15
+ export declare const setAssetPath: (path: string) => void;
16
+
17
+ export interface SetPlatformOptions {
18
+ raf?: (c: FrameRequestCallback) => number;
19
+ ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
20
+ rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
21
+ }
22
+ export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
23
+
24
+ export type { Components, JSX };
25
+
26
+ export * from '../types';
@@ -0,0 +1 @@
1
+ export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';