@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,281 @@
1
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index-ec30ecaa.js';
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 = class {
35
+ constructor(hostRef) {
36
+ registerInstance(this, hostRef);
37
+ this.close = createEvent(this, "close", 7);
38
+ this.back = createEvent(this, "back", 7);
39
+ /**
40
+ * Client custom styling via string
41
+ */
42
+ this.clientStyling = '';
43
+ /**
44
+ * Client custom styling via url
45
+ */
46
+ this.clientStylingUrl = '';
47
+ /**
48
+ * Language of the widget
49
+ */
50
+ this.language = 'en';
51
+ /**
52
+ * Current game slug
53
+ */
54
+ this.gameSlug = '';
55
+ /**
56
+ * User's device type
57
+ */
58
+ this.device = 'Mobile';
59
+ this.limitStylingAppends = false;
60
+ this.timer = '';
61
+ this.disabledStatus = '';
62
+ this.activeTab = 1;
63
+ this.visibleGames = [];
64
+ this.loading = false;
65
+ this.enabled = false;
66
+ this.showDetails = false;
67
+ this.maxVisibleGames = 0;
68
+ this.handleTabChange = (e) => {
69
+ this.activeTab = +(e.target.getAttribute('data-index'));
70
+ this.visibleGames = [];
71
+ this.maxVisibleGames = 0;
72
+ };
73
+ this.handleLoadMore = () => {
74
+ this.visibleGames = this.jackpot.GamesInfo.slice(0, this.visibleGames.length + this.maxVisibleGames);
75
+ };
76
+ this.toggleShowDetails = () => {
77
+ this.showDetails = !this.showDetails;
78
+ };
79
+ this.changeJackpotStatus = (ev) => {
80
+ ev.stopPropagation();
81
+ window.postMessage({
82
+ type: 'JackpotChangeStatusRequest',
83
+ data: {
84
+ [this.jackpot.Id]: !this.jackpot.Enabled,
85
+ },
86
+ });
87
+ this.loading = true;
88
+ };
89
+ this.setClientStyling = () => {
90
+ let sheet = document.createElement('style');
91
+ sheet.innerHTML = this.clientStyling;
92
+ this.host.prepend(sheet);
93
+ };
94
+ this.setClientStylingURL = () => {
95
+ let url = new URL(this.clientStylingUrl);
96
+ let cssFile = document.createElement('style');
97
+ fetch(url.href)
98
+ .then((res) => res.text())
99
+ .then((data) => {
100
+ cssFile.innerHTML = data;
101
+ setTimeout(() => { this.host.prepend(cssFile); }, 1);
102
+ })
103
+ .catch((err) => {
104
+ console.log('Error ', err);
105
+ });
106
+ };
107
+ this.handleCloseClick = () => {
108
+ this.close.emit();
109
+ };
110
+ this.handleBackClick = () => {
111
+ this.back.emit();
112
+ };
113
+ this.onGameClick = (ev) => {
114
+ const slug = ev.currentTarget.getAttribute('data-slug');
115
+ if (slug) {
116
+ window.postMessage({
117
+ type: 'EngagementSuiteGameRedirect',
118
+ data: {
119
+ Slug: slug
120
+ }
121
+ });
122
+ }
123
+ };
124
+ }
125
+ handleEvent(e) {
126
+ const { type, data } = e === null || e === void 0 ? void 0 : e.data;
127
+ switch (type) {
128
+ case 'UpdateJackpotStatus': {
129
+ this.updateJackpotStatus(e.data.data);
130
+ break;
131
+ }
132
+ case 'JoinJackpotResult': {
133
+ const res = data;
134
+ if (res.Success && this.jackpot.Id in res.JackpotIds) {
135
+ this.enabled = this.jackpot.Enabled = res.JackpotIds[this.jackpot.Id];
136
+ }
137
+ this.loading = false;
138
+ break;
139
+ }
140
+ case 'UpdateJackpotBalance': {
141
+ const jackpotUpdate = data
142
+ .find((updateMessage => updateMessage.JackpotId === this.jackpot.Id));
143
+ if (jackpotUpdate) {
144
+ this.balance = this.jackpot.Balance = jackpotUpdate.Balance;
145
+ this.winBalance = this.jackpot.WinBalance = jackpotUpdate.WinBalance;
146
+ }
147
+ }
148
+ }
149
+ }
150
+ componentWillLoad() {
151
+ this.startCountdown();
152
+ this.enabled = this.jackpot.Enabled;
153
+ this.balance = this.jackpot.Balance;
154
+ this.winBalance = this.jackpot.WinBalance;
155
+ }
156
+ componentDidRender() {
157
+ if (!this.limitStylingAppends && this.host) {
158
+ if (this.clientStyling)
159
+ this.setClientStyling();
160
+ if (this.clientStylingUrl)
161
+ this.setClientStylingURL();
162
+ this.limitStylingAppends = true;
163
+ }
164
+ if (this.activeTab === 2 && !this.maxVisibleGames) {
165
+ const gap = this.device === 'Mobile' ? 10 : 12;
166
+ const gamesPerRow = this.device === 'Mobile' ? 4 : 5;
167
+ const availableWidth = this.gamesListWrapperEl.offsetWidth - (gap * (gamesPerRow - 1));
168
+ const gameElWidth = availableWidth / gamesPerRow;
169
+ const gameElHeight = (gameElWidth / 74 * 40) + gap;
170
+ this.maxVisibleGames = Math.floor(this.gamesListWrapperEl.offsetHeight / gameElHeight) * gamesPerRow;
171
+ this.visibleGames = this.jackpot.GamesInfo.slice(0, this.maxVisibleGames);
172
+ }
173
+ }
174
+ disconnectedCallback() {
175
+ this.clearInterval();
176
+ }
177
+ clearInterval() {
178
+ if (this.interval) {
179
+ clearInterval(this.interval);
180
+ this.interval = null;
181
+ }
182
+ }
183
+ updateJackpotStatus(event) {
184
+ if (event.IsClosed) {
185
+ this.clearInterval();
186
+ this.disabledStatus = event.Reason;
187
+ this.activeTab = 1;
188
+ }
189
+ else {
190
+ this.disabledStatus = '';
191
+ this.jackpot.JackpotEndTime = event.JackpotEndTime;
192
+ this.startCountdown();
193
+ }
194
+ }
195
+ getTopNavigationTemplate() {
196
+ 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" }))));
197
+ }
198
+ getJackpotBalance() {
199
+ return formatBalance(this.winBalance || this.balance, this.jackpot.Currency);
200
+ }
201
+ getJoinButtonClasses() {
202
+ return {
203
+ PopupButton: true,
204
+ Active: this.enabled,
205
+ Loading: this.loading
206
+ };
207
+ }
208
+ getJackpotDetailsHeaderTemplate() {
209
+ 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
210
+ ? translate('unjoin', this.language)
211
+ : translate('join', this.language)), this.winBalance && h("div", { class: "JackpotIsWon" }, translate('jackpotIsWon', this.language)))));
212
+ }
213
+ getTabsTemplate() {
214
+ 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)));
215
+ }
216
+ getTabsContentTemplate() {
217
+ return this.activeTab === 1
218
+ ? this.getJackpotInfoTemplate()
219
+ : this.getGamesTemplate();
220
+ }
221
+ getJackpotDetailsTemplate() {
222
+ 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));
223
+ }
224
+ getJackpotInfoTemplate() {
225
+ 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)))));
226
+ }
227
+ getGamesTemplate() {
228
+ const list = this.visibleGames.map((game) => {
229
+ 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 });
230
+ });
231
+ return [
232
+ h("div", { class: "JackpotGamesListWrapper", ref: el => this.gamesListWrapperEl = el }, h("div", { class: "JackpotGamesList" }, list)),
233
+ this.visibleGames.length < this.jackpot.GamesInfo.length
234
+ ? h("button", { class: "PopupButton Active JackpotGamesButton", onClick: this.handleLoadMore }, translate('loadMore', this.language))
235
+ : ''
236
+ ];
237
+ }
238
+ getJackpotCountdown() {
239
+ const timerMessage = this.disabledStatus || this.timer;
240
+ return (h("div", { class: `JackpotCountdown ${this.disabledStatus ? 'Suspended' : ''}` }, timerMessage));
241
+ }
242
+ startCountdown() {
243
+ this.updateTimer();
244
+ this.interval = setInterval(() => {
245
+ this.updateTimer();
246
+ }, 1000);
247
+ }
248
+ updateTimer() {
249
+ const expirationTime = new Date(this.jackpot.JackpotEndTime).getTime();
250
+ const now = new Date().getTime();
251
+ const distance = expirationTime - now;
252
+ if (distance < 1) {
253
+ this.clearInterval();
254
+ return;
255
+ }
256
+ const { days, hours, minutes, seconds } = {
257
+ days: String(Math.floor(distance / (1000 * 60 * 60 * 24))).padStart(2, '0'),
258
+ hours: String(Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))).padStart(2, '0'),
259
+ minutes: String(Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60))).padStart(2, '0'),
260
+ seconds: String(Math.floor((distance % (1000 * 60)) / 1000)).padStart(2, '0')
261
+ };
262
+ this.timer = days === '00'
263
+ ? `${hours}h:${minutes}m:${seconds}s`
264
+ : `${days}d:${hours}h:${minutes}m`;
265
+ }
266
+ getPopupClasses() {
267
+ return {
268
+ JackpotDetailsPopup: true,
269
+ Disabled: !!this.disabledStatus,
270
+ [this.device]: true,
271
+ [this.jackpot.Type.charAt(0).toUpperCase() + this.jackpot.Type.slice(1)]: true
272
+ };
273
+ }
274
+ render() {
275
+ return h("div", { class: this.getPopupClasses() }, this.getTopNavigationTemplate(), h("div", { class: "JackpotDetailsPopupContent" }, this.getJackpotDetailsHeaderTemplate(), this.getJackpotCountdown(), this.getTabsTemplate(), this.getTabsContentTemplate()));
276
+ }
277
+ get host() { return getElement(this); }
278
+ };
279
+ CasinoEngagementSuiteJackpotDetails.style = casinoEngagementSuiteJackpotDetailsCss;
280
+
281
+ export { CasinoEngagementSuiteJackpotDetails as casino_engagement_suite_jackpot_details };
@@ -0,0 +1,17 @@
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-ec30ecaa.js';
2
+
3
+ /*
4
+ Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
5
+ */
6
+ const patchBrowser = () => {
7
+ const importMeta = import.meta.url;
8
+ const opts = {};
9
+ if (importMeta !== '') {
10
+ opts.resourcesUrl = new URL('.', importMeta).href;
11
+ }
12
+ return promiseResolve(opts);
13
+ };
14
+
15
+ patchBrowser().then(options => {
16
+ return bootstrapLazy([["casino-engagement-suite-jackpot-details",[[1,"casino-engagement-suite-jackpot-details",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"jackpot":[16],"language":[1],"gameSlug":[1,"game-slug"],"device":[1],"limitStylingAppends":[32],"timer":[32],"disabledStatus":[32],"activeTab":[32],"visibleGames":[32],"loading":[32],"enabled":[32],"balance":[32],"winBalance":[32],"showDetails":[32]},[[8,"message","handleEvent"]]]]],["casino-engagement-suite-progress-bar",[[1,"casino-engagement-suite-progress-bar",{"value":[2],"disabled":[4],"hidePercent":[4,"hide-percent"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"limitStylingAppends":[32]}]]]], options);
17
+ });
@@ -0,0 +1,72 @@
1
+ import { r as registerInstance, h, g as getElement } from './index-ec30ecaa.js';
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 = class {
6
+ constructor(hostRef) {
7
+ registerInstance(this, hostRef);
8
+ /**
9
+ * Value for the widget
10
+ */
11
+ this.value = 0;
12
+ /**
13
+ * Shows disabled styles
14
+ */
15
+ this.disabled = false;
16
+ /**
17
+ * Hide percent value
18
+ */
19
+ this.hidePercent = false;
20
+ /**
21
+ * Client custom styling via string
22
+ */
23
+ this.clientStyling = '';
24
+ /**
25
+ * Client custom styling via url
26
+ */
27
+ this.clientStylingUrl = '';
28
+ this.limitStylingAppends = false;
29
+ this.setClientStyling = () => {
30
+ let sheet = document.createElement('style');
31
+ sheet.innerHTML = this.clientStyling;
32
+ this.host.prepend(sheet);
33
+ };
34
+ this.setClientStylingURL = () => {
35
+ let url = new URL(this.clientStylingUrl);
36
+ let cssFile = document.createElement('style');
37
+ fetch(url.href)
38
+ .then((res) => res.text())
39
+ .then((data) => {
40
+ cssFile.innerHTML = data;
41
+ setTimeout(() => { this.host.prepend(cssFile); }, 1);
42
+ })
43
+ .catch((err) => {
44
+ console.log('Error ', err);
45
+ });
46
+ };
47
+ }
48
+ componentDidRender() {
49
+ if (!this.limitStylingAppends && this.host) {
50
+ if (this.clientStyling)
51
+ this.setClientStyling();
52
+ if (this.clientStylingUrl)
53
+ this.setClientStylingURL();
54
+ this.limitStylingAppends = true;
55
+ }
56
+ }
57
+ getProgressBarClasses() {
58
+ return {
59
+ ProgressBar: true,
60
+ Completed: this.value === 100,
61
+ Disabled: this.disabled,
62
+ HidePercent: this.hidePercent
63
+ };
64
+ }
65
+ render() {
66
+ 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 + '%' } })));
67
+ }
68
+ get host() { return getElement(this); }
69
+ };
70
+ CasinoEngagementSuiteProgressBar.style = casinoEngagementSuiteProgressBarCss;
71
+
72
+ export { CasinoEngagementSuiteProgressBar as casino_engagement_suite_progress_bar };