@everymatrix/bonus-powerups-ingame-games 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.
Files changed (64) hide show
  1. package/dist/bonus-powerups-ingame-games/app-globals-0f993ce5.js +1 -0
  2. package/dist/bonus-powerups-ingame-games/bonus-powerups-ingame-games-b2c0935f.js +1 -0
  3. package/dist/bonus-powerups-ingame-games/bonus-powerups-ingame-games.esm.js +1 -0
  4. package/dist/bonus-powerups-ingame-games/bonus-powerups-ingame-games_3.entry.js +1 -0
  5. package/dist/bonus-powerups-ingame-games/index-fd928daa.js +2 -0
  6. package/dist/bonus-powerups-ingame-games/index.esm.js +1 -0
  7. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  8. package/dist/cjs/bonus-powerups-ingame-games-7de80a10.js +317 -0
  9. package/dist/cjs/bonus-powerups-ingame-games.cjs.js +25 -0
  10. package/dist/cjs/bonus-powerups-ingame-games_3.cjs.entry.js +247 -0
  11. package/dist/cjs/index-e3184c85.js +1246 -0
  12. package/dist/cjs/index.cjs.js +10 -0
  13. package/dist/cjs/loader.cjs.js +15 -0
  14. package/dist/collection/assets/Arrow Curve Left.svg +11 -0
  15. package/dist/collection/assets/double-right.svg +4 -0
  16. package/dist/collection/assets/gotoPage.svg +3 -0
  17. package/dist/collection/assets/return.svg +15 -0
  18. package/dist/collection/collection-manifest.json +25 -0
  19. package/dist/collection/components/bonus-powerups-ingame-games/bonus-powerups-ingame-games.css +279 -0
  20. package/dist/collection/components/bonus-powerups-ingame-games/bonus-powerups-ingame-games.js +335 -0
  21. package/dist/collection/components/bonus-powerups-ingame-games/index.js +1 -0
  22. package/dist/collection/index.js +1 -0
  23. package/dist/collection/utils/constants.js +4 -0
  24. package/dist/collection/utils/locale.utils.js +38 -0
  25. package/dist/collection/utils/utils.js +3 -0
  26. package/dist/esm/app-globals-0f993ce5.js +3 -0
  27. package/dist/esm/bonus-powerups-ingame-games-b2c0935f.js +315 -0
  28. package/dist/esm/bonus-powerups-ingame-games.js +20 -0
  29. package/dist/esm/bonus-powerups-ingame-games_3.entry.js +241 -0
  30. package/dist/esm/index-fd928daa.js +1217 -0
  31. package/dist/esm/index.js +2 -0
  32. package/dist/esm/loader.js +11 -0
  33. package/dist/index.cjs.js +1 -0
  34. package/dist/index.js +1 -0
  35. package/dist/stencil.config.dev.js +20 -0
  36. package/dist/stencil.config.js +20 -0
  37. package/dist/storybook/main.js +43 -0
  38. package/dist/storybook/preview.js +9 -0
  39. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-powerups-ingame-games/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
  40. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-powerups-ingame-games/.stencil/libs/common/src/types/casino/powerups.d.ts +60 -0
  41. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-powerups-ingame-games/.stencil/packages/stencil/bonus-powerups-ingame-games/stencil.config.d.ts +2 -0
  42. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-powerups-ingame-games/.stencil/packages/stencil/bonus-powerups-ingame-games/stencil.config.dev.d.ts +2 -0
  43. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-powerups-ingame-games/.stencil/packages/stencil/bonus-powerups-ingame-games/storybook/main.d.ts +3 -0
  44. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-powerups-ingame-games/.stencil/packages/stencil/bonus-powerups-ingame-games/storybook/preview.d.ts +70 -0
  45. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-powerups-ingame-games/.stencil/tools/plugins/index.d.ts +4 -0
  46. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-powerups-ingame-games/.stencil/tools/plugins/lazy-load-chunk-plugin.d.ts +12 -0
  47. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-powerups-ingame-games/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
  48. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-powerups-ingame-games/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
  49. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-powerups-ingame-games/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
  50. package/dist/types/components/bonus-powerups-ingame-games/bonus-powerups-ingame-games.d.ts +34 -0
  51. package/dist/types/components/bonus-powerups-ingame-games/index.d.ts +1 -0
  52. package/dist/types/components.d.ts +69 -0
  53. package/dist/types/index.d.ts +1 -0
  54. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  55. package/dist/types/utils/constants.d.ts +4 -0
  56. package/dist/types/utils/locale.utils.d.ts +2 -0
  57. package/dist/types/utils/utils.d.ts +1 -0
  58. package/loader/cdn.js +1 -0
  59. package/loader/index.cjs.js +1 -0
  60. package/loader/index.d.ts +24 -0
  61. package/loader/index.es2017.js +1 -0
  62. package/loader/index.js +2 -0
  63. package/loader/package.json +11 -0
  64. package/package.json +27 -0
@@ -0,0 +1,315 @@
1
+ import { r as registerInstance, c as createEvent, h } from './index-fd928daa.js';
2
+
3
+ const StyleCacheKey = '__WIDGET_GLOBAL_STYLE_CACHE__';
4
+
5
+ /**
6
+ * @name setClientStyling
7
+ * @description Method used to create and append to the passed element of the widget a style element with the content received
8
+ * @param {HTMLElement} stylingContainer The reference element of the widget
9
+ * @param {string} clientStyling The style content
10
+ */
11
+ function setClientStyling(stylingContainer, clientStyling) {
12
+ if (stylingContainer) {
13
+ const sheet = document.createElement('style');
14
+ sheet.innerHTML = clientStyling;
15
+ stylingContainer.appendChild(sheet);
16
+ }
17
+ }
18
+
19
+ /**
20
+ * @name setClientStylingURL
21
+ * @description Method used to create and append to the passed element of the widget a style element with the content fetched from a given URL
22
+ * @param {HTMLElement} stylingContainer The reference element of the widget
23
+ * @param {string} clientStylingUrl The URL of the style content
24
+ */
25
+ function setClientStylingURL(stylingContainer, clientStylingUrl) {
26
+ if (!stylingContainer || !clientStylingUrl) return;
27
+
28
+ const url = new URL(clientStylingUrl);
29
+
30
+ fetch(url.href)
31
+ .then((res) => res.text())
32
+ .then((data) => {
33
+ const cssFile = document.createElement('style');
34
+ cssFile.innerHTML = data;
35
+ if (stylingContainer) {
36
+ stylingContainer.appendChild(cssFile);
37
+ }
38
+ })
39
+ .catch((err) => {
40
+ console.error('There was an error while trying to load client styling from URL', err);
41
+ });
42
+ }
43
+
44
+ /**
45
+ * @name setStreamLibrary
46
+ * @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
47
+ * @param {HTMLElement} stylingContainer The highest element of the widget
48
+ * @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
49
+ * @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
50
+ * @param {boolean} useAdoptedStyleSheets A flag to gradually enable testing of adoptedStyleSheets
51
+ */
52
+ function setStreamStyling(stylingContainer, domain, subscription, useAdoptedStyleSheets = false) {
53
+ if (!window.emMessageBus) return;
54
+
55
+ const supportAdoptStyle = 'adoptedStyleSheets' in Document.prototype;
56
+
57
+ if (!supportAdoptStyle || !useAdoptedStyleSheets) {
58
+ subscription = getStyleTagSubscription(stylingContainer, domain);
59
+
60
+ return subscription;
61
+ }
62
+
63
+ if (!window[StyleCacheKey]) {
64
+ window[StyleCacheKey] = {};
65
+ }
66
+ subscription = getAdoptStyleSubscription(stylingContainer, domain);
67
+
68
+ const originalUnsubscribe = subscription.unsubscribe.bind(subscription);
69
+ const wrappedUnsubscribe = () => {
70
+ if (window[StyleCacheKey][domain]) {
71
+ const cachedObject = window[StyleCacheKey][domain];
72
+ cachedObject.refCount > 1
73
+ ? (cachedObject.refCount = cachedObject.refCount - 1)
74
+ : delete window[StyleCacheKey][domain];
75
+ }
76
+
77
+ originalUnsubscribe();
78
+ };
79
+ subscription.unsubscribe = wrappedUnsubscribe;
80
+
81
+ return subscription;
82
+ }
83
+
84
+ function getStyleTagSubscription(stylingContainer, domain) {
85
+ const sheet = document.createElement('style');
86
+
87
+ return window.emMessageBus.subscribe(domain, (data) => {
88
+ if (stylingContainer) {
89
+ sheet.innerHTML = data;
90
+ stylingContainer.appendChild(sheet);
91
+ }
92
+ });
93
+ }
94
+
95
+ function getAdoptStyleSubscription(stylingContainer, domain) {
96
+ return window.emMessageBus.subscribe(domain, (data) => {
97
+ if (!stylingContainer) return;
98
+
99
+ const shadowRoot = stylingContainer.getRootNode();
100
+ const cacheStyleObject = window[StyleCacheKey];
101
+ let cachedStyle = cacheStyleObject[domain] && cacheStyleObject[domain].sheet;
102
+
103
+ if (!cachedStyle) {
104
+ cachedStyle = new CSSStyleSheet();
105
+ cachedStyle.replaceSync(data);
106
+ cacheStyleObject[domain] = {
107
+ sheet: cachedStyle,
108
+ refCount: 1
109
+ };
110
+ } else {
111
+ cacheStyleObject[domain].refCount = cacheStyleObject[domain].refCount + 1;
112
+ }
113
+
114
+ const currentSheets = shadowRoot.adoptedStyleSheets || [];
115
+ if (!currentSheets.includes(cachedStyle)) {
116
+ shadowRoot.adoptedStyleSheets = [...currentSheets, cachedStyle];
117
+ }
118
+ });
119
+ }
120
+
121
+ const powerUpGameSearchConditions = {
122
+ expand: "games",
123
+ fields: "id,powerUpID,powerUpName,displayName,games(id,gameId,slug,name,thumbnail)"
124
+ };
125
+
126
+ const ReturnSvg = `<svg width="14" height="14" viewBox="0 0 14 14"
127
+ fill="none" xmlns="http://www.w3.org/2000/svg">
128
+ <g clip-path="url(#clip0_4119_5439)">
129
+ <path d="M11.1533 12.8332C11.8242 11.9932 12.25 10.9315 12.25 9.759C12.25 6.959 9.7475 4.6665 6.69667 4.6665H1.75"
130
+ stroke="currentColor" stroke-width="0.952264" stroke-miterlimit="10" stroke-linecap="round"
131
+ stroke-linejoin="round" />
132
+ <path d="M5.25 1.16699L1.75 4.66699L5.25 8.16699" stroke="currentColor" stroke-width="0.952264" stroke-miterlimit="10"
133
+ stroke-linecap="round" stroke-linejoin="round" />
134
+ </g>
135
+ <defs>
136
+ <clipPath id="clip0_4119_5439">
137
+ <rect width="14" height="14" fill="white" />
138
+ </clipPath>
139
+ </defs>
140
+ </svg>
141
+ `;
142
+
143
+ const DEFAULT_LANGUAGE = 'en';
144
+ const TRANSLATIONS = {
145
+ en: {
146
+ playNow: 'Play Now',
147
+ games: 'Games',
148
+ noDataFound: 'No data found',
149
+ loading: 'Loading',
150
+ loadingMore: 'Loading More'
151
+ }
152
+ };
153
+ const translate = (key, customLang, values) => {
154
+ const lang = customLang;
155
+ let translation = TRANSLATIONS[(lang !== undefined) && (lang in TRANSLATIONS) ? lang : DEFAULT_LANGUAGE][key];
156
+ if (values !== undefined) {
157
+ for (const [key, value] of Object.entries(values.values)) {
158
+ const regex = new RegExp(`{${key}}`, 'g');
159
+ translation = translation.replace(regex, value);
160
+ }
161
+ }
162
+ return translation;
163
+ };
164
+
165
+ const bonusPowerupsIngameGamesCss = ":host{display:block;height:100%;--game-amount-line:3}.IngamePowerUpGamesContainer{height:100%;display:flex;padding:var(--emw--ingame-power-container-padding, 8px);justify-content:flex-start;flex-direction:column}.IngamePowerUpGamesContainer .CircleLinearBorder{background:rgba(9, 9, 9, 0.5019607843);position:relative;width:26px;height:26px;border-radius:20px;background:none;overflow:hidden;border:1.5px solid transparent;display:flex;align-items:center;justify-content:center;cursor:pointer}.IngamePowerUpGamesContainer .CircleLinearBorder svg{border-radius:20px;padding:4.5px;background:var(--emw--ingame-color-powerup-bg, rgba(9, 9, 9, 0.8980392157));z-index:1}.IngamePowerUpGamesContainer .CircleLinearBorder::before{content:\"\";position:absolute;top:-1.5px;left:-1.5px;right:-1.5px;bottom:-1.5px;z-index:-1;border-radius:21.5px;background:linear-gradient(0deg, var(--emw--ingame-color-white10, rgba(255, 255, 255, 0.0666666667)), var(--emw--ingame-color-white10, rgba(255, 255, 255, 0.0666666667))), linear-gradient(35.22deg, var(--emw--ingame-color-white10, rgba(255, 255, 255, 0)), var(--emw--ingame-color-white30, rgba(255, 255, 255, 0.5490196078)) 89.19%)}.IngamePowerUpGamesContainer .TopBar,.IngamePowerUpGamesContainer .Loading{padding:15px}.IngamePowerUpGamesContainer .TopBar{display:flex;align-items:center;gap:5px}.IngamePowerUpGamesContainer .TopBar .ReturnIcon{width:26px;height:26px;display:flex;border-radius:20px;padding:0;backdrop-filter:blur(13.7647px);justify-content:center;align-items:center}.IngamePowerUpGamesContainer .TopBar .ReturnIcon svg{color:var(--emw--ingame-color-white60, #f0f0f0)}.IngamePowerUpGamesContainer .TopBar .Title{font-weight:600;font-size:0.9rem;line-height:100%;text-align:center;vertical-align:middle;color:var(--emw--ingame-color-neutural-95, #EDEFF2);display:flex;flex-direction:row}.IngamePowerUpGamesContainer .TopBar .Title .Name{font-size:1.1rem}.IngamePowerUpGamesContainer .TopBar .Title .Label{font-size:1.1rem;font-weight:bold;color:var(--emw--ingame-color-neutural-95, #EDEFF2)}.IngamePowerUpGamesContainer .TopBar .TextContent{font-weight:400;font-size:0.9rem;line-height:1.1rem;vertical-align:middle;color:var(--emw--ingame-color-white70, rgba(255, 255, 255, 0.6980392157))}.IngamePowerUpGamesContainer .GamesWrapper{height:calc(100% - 90px);overflow:hidden;width:100%;margin-bottom:10px;scrollbar-width:thin;scrollbar-color:var(--emw--color-background, hsl(254, 8.53%, 54.93%)) transparent}.IngamePowerUpGamesContainer .Games{overflow:auto;scrollbar-width:thin;scrollbar-color:var(--emw--color-background, hsl(254, 8.53%, 54.93%)) transparent}.IngamePowerUpGamesContainer .GamesList{display:flex;height:100%;justify-content:center;flex:1;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--emw--background-gray-color, gray) transparent}.IngamePowerUpGamesContainer .GamesList::-webkit-scrollbar-track{background-color:transparent;border-radius:5px}.IngamePowerUpGamesContainer .GamesList .Games{padding:15px;display:flex;align-items:flex-start;justify-content:flex-start;flex-wrap:wrap;gap:calc(30px / (var(--game-amount-line, 3) - 1))}.IngamePowerUpGamesContainer .GamesList .Games .Game{width:calc((100% - 30px) / var(--game-amount-line, 3));cursor:pointer;position:relative}.IngamePowerUpGamesContainer .GamesList .Games .Game:hover .mask-filter{opacity:1}.IngamePowerUpGamesContainer .GamesList .Games .Game:hover img{opacity:0.4;filter:blur(1.5px)}.IngamePowerUpGamesContainer .GamesList .Games .Game:hover .GameMask{mix-blend-mode:screen;background-color:var(--emw--color-powup-green, #24B24E);display:flex;justify-content:center;align-items:center;position:absolute;width:100%;opacity:1;left:0;height:100%;top:0;border-radius:8px}.IngamePowerUpGamesContainer .GamesList .Games .Game:hover .GameMask .GameStartBtn{opacity:1}.IngamePowerUpGamesContainer .GameMask{display:none;transition:display;transition-duration:0.2s;opacity:0;position:absolute;width:70%;height:100%}.IngamePowerUpGamesContainer .GameMask .GameStartBtn{width:80px;height:22px;border-radius:8px;opacity:1;padding:4px 5px;background:linear-gradient(180deg, var(--emw--color-powup-green, #24B24E) 0%, var(--emw--color-powup-light-green, #18CE51) 100%);border:1px solid var(--emw--ingame-color-white, #FFFFFF);display:flex;align-items:center;justify-content:space-between;cursor:pointer}.IngamePowerUpGamesContainer .GameMask .GameStartBtn .PlayIcon{background-image:url('data:image/svg+xml;charset=utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"11\" height=\"11\" viewBox=\"0 0 11 11\" fill=\"none\"><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M5.5 1C3.01472 1 1 3.01472 1 5.5C1 7.98528 3.01472 10 5.5 10C7.98528 10 10 7.98528 10 5.5C10 3.01472 7.98528 1 5.5 1ZM0 5.5C0 2.46243 2.46243 0 5.5 0C8.53757 0 11 2.46243 11 5.5C11 8.53757 8.53757 11 5.5 11C2.46243 11 0 8.53757 0 5.5ZM5.12255 3.21652C5.12728 3.21956 5.13199 3.22259 5.13668 3.22561L7.49698 4.74294C7.50129 4.74571 7.50562 4.74849 7.50998 4.75129C7.58551 4.79982 7.66805 4.85285 7.73381 4.90413C7.80355 4.95852 7.91363 5.05446 7.97854 5.20809C8.0574 5.39471 8.0574 5.60529 7.97854 5.79191C7.91363 5.94554 7.80355 6.04148 7.73381 6.09587C7.66805 6.14715 7.58551 6.20018 7.50998 6.24871C7.50562 6.25151 7.50129 6.25429 7.49698 6.25706L5.13668 7.77439C5.13199 7.77741 5.12727 7.78045 5.12255 7.78348C5.03469 7.84 4.9423 7.89941 4.86094 7.94176C4.77909 7.98436 4.63056 8.05332 4.44657 8.04018C4.22957 8.02468 4.02999 7.91572 3.89961 7.74157C3.78907 7.59391 3.76675 7.43167 3.75832 7.33979C3.74995 7.24844 3.74997 7.1386 3.75 7.03414C3.75 7.02852 3.75 7.02292 3.75 7.01733V3.98267C3.75 3.97708 3.75 3.97148 3.75 3.96586C3.74997 3.8614 3.74995 3.75156 3.75832 3.66021C3.76675 3.56833 3.78907 3.40609 3.89961 3.25843C4.02999 3.08428 4.22957 2.97532 4.44657 2.95982C4.63056 2.94668 4.77909 3.01564 4.86094 3.05824C4.94231 3.10059 5.03469 3.16001 5.12255 3.21652ZM4.75 4.16583V6.83417L6.82537 5.5L4.75 4.16583Z\" fill=\"white\"/> <path d=\"M4.75 6.83417V4.16583L6.82537 5.5L4.75 6.83417Z\" fill=\"white\"/></svg>');height:16px;width:16px;background-repeat:no-repeat;background-size:contain}.Games .Container{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;height:calc(100% - 120px);overflow:auto}.Games .Container .Game{width:105px}@keyframes smart-animate1{0%{opacity:0.15;transform:translateX(0px)}35%{opacity:1;transform:translateX(36px)}75%{opacity:1;transform:translateX(0px)}100%{opacity:0.15;transform:translateX(0px)}}@keyframes smart-animate2{0%{opacity:1}35%{opacity:0.15}75%{opacity:0.5}100%{opacity:1}}@keyframes smart-animate3{0%{opacity:0.5;transform:translateX(0px)}35%{opacity:0.15;transform:translateX(-36px)}75%{opacity:0.15;transform:translateX(0px)}100%{opacity:0.5;transform:translateX(0px)}}.smart-loader{margin:50px auto;display:flex;flex-direction:row;align-items:center;justify-content:center;width:100px;gap:10px}.smart-loader .smart-item{width:3px;height:20px;opacity:0.15;animation-delay:200ms;animation-duration:1000ms;animation-timing-function:ease-out;animation-fill-mode:forwards;padding:1px;margin:5px 0;background:var(--emw--ingame-color-powerup-brightgreen, #00FA5A);border-radius:4px;animation-iteration-count:infinite;animation-direction:normal}.smart-loader .smart-item:nth-child(1){animation-name:smart-animate1}.smart-loader .smart-item:nth-child(2){animation-name:smart-animate2;height:36px}.smart-loader .smart-item:nth-child(3){animation-name:smart-animate3}";
166
+ const BonusPowerupsIngameGamesStyle0 = bonusPowerupsIngameGamesCss;
167
+
168
+ const BonusPowerupsIngameGames = class {
169
+ constructor(hostRef) {
170
+ registerInstance(this, hostRef);
171
+ this.backFromPowerupGamesEvent = createEvent(this, "backFromPowerupGames", 7);
172
+ this.mbSource = undefined;
173
+ this.clientStyling = undefined;
174
+ this.clientStylingUrl = undefined;
175
+ this.translationUrl = undefined;
176
+ this.language = 'en';
177
+ this.endpoint = undefined;
178
+ this.session = undefined;
179
+ this.powerupId = undefined;
180
+ this.isLoadingGames = false;
181
+ this.powerUpGames = { items: [], total: 0 };
182
+ this.powerUp = undefined;
183
+ this.limit = 30;
184
+ }
185
+ initializeGamesObserver() {
186
+ if (this.loadMoreGamesObserver) {
187
+ this.loadMoreGamesObserver.disconnect();
188
+ }
189
+ this.loadMoreGamesObserver = new IntersectionObserver((entries) => {
190
+ entries.forEach((entry) => {
191
+ if (entry.isIntersecting) {
192
+ this.loadMoreGames().catch(console.error);
193
+ }
194
+ });
195
+ });
196
+ if (this.lastGameElement) {
197
+ this.loadMoreGamesObserver.observe(this.lastGameElement);
198
+ }
199
+ }
200
+ async loadMoreGames() {
201
+ var _a, _b, _c, _d;
202
+ if (this.isLoadingGames || (this.powerUpGames.total > 0 && this.powerUpGames.items.length >= this.powerUpGames.total)) {
203
+ return;
204
+ }
205
+ this.isLoadingGames = true;
206
+ if (this.abortController) {
207
+ this.abortController.abort();
208
+ }
209
+ this.abortController = new AbortController();
210
+ try {
211
+ const url = new URL(`${this.endpoint}/v1/elevate/powerups/available?pagination=games(limit=${this.limit},offset=${((_b = (_a = this.powerUpGames) === null || _a === void 0 ? void 0 : _a.items) === null || _b === void 0 ? void 0 : _b.length) || 0})`);
212
+ const options = {
213
+ headers: {
214
+ 'Content-Type': 'application/json',
215
+ 'x-SessionId': this.session
216
+ },
217
+ method: 'GET',
218
+ signal: this.abortController.signal
219
+ };
220
+ url.searchParams.append('filter', `id=${this.powerupId}`);
221
+ Object.entries(powerUpGameSearchConditions).forEach(([key, value]) => {
222
+ url.searchParams.append(key, value);
223
+ });
224
+ url.searchParams.append('language', this.language);
225
+ const response = await fetch(url, options);
226
+ if (!response.ok) {
227
+ throw new Error(`HTTP error! status: ${response.status}`);
228
+ }
229
+ const res = await response.json();
230
+ this.powerUp = res.data[0];
231
+ const newGames = ((_c = this.powerUp.games) === null || _c === void 0 ? void 0 : _c.items) || [];
232
+ this.powerUpGames = {
233
+ items: [...this.powerUpGames.items, ...newGames],
234
+ total: ((_d = this.powerUp.games) === null || _d === void 0 ? void 0 : _d.total) || this.powerUpGames.total
235
+ };
236
+ }
237
+ catch (e) {
238
+ if (e.name !== 'AbortError') {
239
+ console.error('Failed to load more games:', e);
240
+ }
241
+ }
242
+ finally {
243
+ if (!this.abortController.signal.aborted) {
244
+ this.isLoadingGames = false;
245
+ }
246
+ }
247
+ }
248
+ onGameClick(game) {
249
+ window.postMessage({ type: 'EngagementSuiteGameRedirect', data: { Slug: game.slug } });
250
+ }
251
+ componentDidUpdate() {
252
+ if (this.powerUpGames.items.length < this.powerUpGames.total) {
253
+ this.initializeGamesObserver();
254
+ }
255
+ }
256
+ render() {
257
+ var _a, _b;
258
+ return h("div", { key: '0d034307e070a8ba1d88303c3e3093ba567444b2', class: 'IngamePowerUpGamesContainer', ref: (el) => (this.stylingContainer = el) }, h("div", { key: '7b01f05d91d274da4ae0de3fc63e55927946b095', class: 'TopBar' }, h("div", { key: 'f8664bf99bb12513f281fe67ee24cd0794d9ba66', class: 'ReturnIcon CircleLinearBorder', onClick: this.backFromPowerupGamesEvent.emit, innerHTML: ReturnSvg }), this.powerUp &&
259
+ h("div", { key: '56083e9dfbc469875b0448f471c455ef8e1fb613', class: 'Title TextContent' }, h("span", { key: '6cde7a32b98c4f8d240cfda6f715e2d3fd4b0a25', class: 'Name' }, this.powerUp.displayName), " /", h("div", { key: 'a2045a41ad40665fa553b7f1e2a25628344188fc', class: 'Label' }, translate('games', this.language)), h("div", { key: 'a2cc2c8a5ebb29b097da802984099860410e0c25', class: 'GamesTotal' }, "( ", this.powerUpGames.total || '', " )"))), h("div", { key: 'b335d598aeea740b4e4a2e58a4061bf092abb773', class: 'GamesWrapper Card ' }, this.isLoadingGames && this.powerUpGames.items.length === 0 &&
260
+ h("div", { key: 'fced976e5554f7864fcf8755494c0cfd74f19a0f', class: 'Loading' }, h("div", { key: '8653c05c761078e11d6c060e5f1d519a133f2d8a', class: 'smart-loader' }, h("div", { key: '4404881893636a48de508d95ab8d6bd09d05acae', class: "smart-item" }), h("div", { key: '8aeafd883609d5840f7603b58300ee9c9350746c', class: "smart-item" }), h("div", { key: 'ded309b5a38d7775c27b3b38dd78746caf5aa557', class: "smart-item" }))), !this.isLoadingGames && !this.powerUp ?
261
+ h("div", { class: 'NoData' }, translate('noDataFound', this.language), " ")
262
+ :
263
+ h("div", { class: 'CircleInner GamesList' }, h("div", { class: 'Games FlexRow' }, this.powerUpGames.total > 0 &&
264
+ this.powerUpGames.items.map((g, index) => {
265
+ const isLastItem = index === this.powerUpGames.items.length - 1;
266
+ return h("div", { class: 'Game', ref: isLastItem ? (el) => (this.lastGameElement = el) : null }, h("ui-image", { src: g.thumbnail, alt: g.name }), h("div", { class: 'GameMask', onClick: this.onGameClick.bind(this, g) }, h("div", { class: 'GameStartBtn' }, h("div", { class: 'PlayIcon' }), h("span", null, translate('playNow', this.language)))));
267
+ }), this.isLoadingGames && ((_b = (_a = this.powerUpGames) === null || _a === void 0 ? void 0 : _a.items) === null || _b === void 0 ? void 0 : _b.length) > this.limit &&
268
+ h("p", { class: 'LoadingMore' }, translate('loadingMore', this.language))))));
269
+ }
270
+ handleClientStylingChange(newValue, oldValue) {
271
+ if (newValue != oldValue) {
272
+ setClientStyling(this.stylingContainer, this.clientStyling);
273
+ }
274
+ }
275
+ handleClientStylingUrlChange(newValue, oldValue) {
276
+ if (newValue != oldValue) {
277
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
278
+ }
279
+ }
280
+ handleMbSourceChange(newValue, oldValue) {
281
+ if (newValue != oldValue) {
282
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
283
+ }
284
+ }
285
+ componentWillLoad() {
286
+ this.loadMoreGames();
287
+ }
288
+ componentDidLoad() {
289
+ if (this.stylingContainer) {
290
+ if (this.mbSource)
291
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
292
+ if (this.clientStyling)
293
+ setClientStyling(this.stylingContainer, this.clientStyling);
294
+ if (this.clientStylingUrl)
295
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
296
+ }
297
+ }
298
+ disconnectedCallback() {
299
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
300
+ if (this.abortController) {
301
+ this.abortController.abort();
302
+ }
303
+ if (this.loadMoreGamesObserver) {
304
+ this.loadMoreGamesObserver.disconnect();
305
+ }
306
+ }
307
+ static get watchers() { return {
308
+ "clientStyling": ["handleClientStylingChange"],
309
+ "clientStylingUrl": ["handleClientStylingUrlChange"],
310
+ "mbSource": ["handleMbSourceChange"]
311
+ }; }
312
+ };
313
+ BonusPowerupsIngameGames.style = BonusPowerupsIngameGamesStyle0;
314
+
315
+ export { BonusPowerupsIngameGames as B };
@@ -0,0 +1,20 @@
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-fd928daa.js';
2
+ export { s as setNonce } from './index-fd928daa.js';
3
+ import { g as globalScripts } from './app-globals-0f993ce5.js';
4
+
5
+ /*
6
+ Stencil Client Patch Browser v4.19.2 | MIT Licensed | https://stenciljs.com
7
+ */
8
+ var patchBrowser = () => {
9
+ const importMeta = import.meta.url;
10
+ const opts = {};
11
+ if (importMeta !== "") {
12
+ opts.resourcesUrl = new URL(".", importMeta).href;
13
+ }
14
+ return promiseResolve(opts);
15
+ };
16
+
17
+ patchBrowser().then(async (options) => {
18
+ await globalScripts();
19
+ return bootstrapLazy([["bonus-powerups-ingame-games_3",[[1,"bonus-powerups-ingame-games",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"endpoint":[513],"session":[513],"powerupId":[513,"powerup-id"],"isLoadingGames":[32],"powerUpGames":[32],"powerUp":[32],"limit":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[0,"ui-image",{"src":[1],"width":[1],"height":[1],"alt":[1],"styles":[8],"detectDistance":[1,"detect-distance"],"imgLoaded":[32],"shouldLoad":[32]},null,{"src":["handleSrc"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1]},null,{"structure":["handleStructureChange"]}]]]], options);
20
+ });
@@ -0,0 +1,241 @@
1
+ export { B as bonus_powerups_ingame_games } from './bonus-powerups-ingame-games-b2c0935f.js';
2
+ import { r as registerInstance, h, H as Host, g as getElement } from './index-fd928daa.js';
3
+
4
+ const uiImageCss = ".HostContainer{display:block}.UiContainer{height:100%;width:100%;border-radius:inherit;object-fit:inherit}.UiContainer .Image{border-radius:inherit}.Hidden{opacity:0;transition:opacity 0.5s ease-in-out}.Visible{opacity:1;border-radius:var(--emw--border-radius-medium, 10px);transition:opacity 0.5s ease-in-out}";
5
+ const UiImageStyle0 = uiImageCss;
6
+
7
+ const UiImage = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.src = undefined;
11
+ this.width = undefined;
12
+ this.height = undefined;
13
+ this.alt = undefined;
14
+ this.styles = undefined;
15
+ this.detectDistance = '200px';
16
+ this.imgLoaded = false;
17
+ this.shouldLoad = false;
18
+ }
19
+ handleSrc() {
20
+ if (!this.shouldLoad) {
21
+ return;
22
+ }
23
+ const preloadedImage = new Image();
24
+ preloadedImage.onload = () => {
25
+ if (this.image) {
26
+ this.image.src = this.src;
27
+ this.imgLoaded = true;
28
+ preloadedImage.onload = null;
29
+ }
30
+ };
31
+ preloadedImage.src = this.src;
32
+ }
33
+ componentDidLoad() {
34
+ if ('IntersectionObserver' in window) {
35
+ this.el.__uxComponent = this;
36
+ if (!window.EMUxObserver) {
37
+ window.EMUxObserver = new IntersectionObserver((entries) => {
38
+ entries.forEach(entry => {
39
+ if (entry.isIntersecting) {
40
+ const comp = entry.target.__uxComponent;
41
+ if (comp) {
42
+ comp.shouldLoad = true;
43
+ comp.handleSrc();
44
+ }
45
+ window.EMUxObserver.unobserve(entry.target);
46
+ }
47
+ });
48
+ }, { rootMargin: this.detectDistance });
49
+ }
50
+ window.EMUxObserver.observe(this.el);
51
+ }
52
+ else {
53
+ this.shouldLoad = true;
54
+ this.handleSrc();
55
+ }
56
+ }
57
+ render() {
58
+ return (h(Host, { key: 'f506ba73852f257ad80bf59ca177d2065a5f365e', class: "HostContainer" }, !this.imgLoaded && (h("ui-skeleton", { key: '564ebfab701f827ddc2debccb7615926dbc9e876', class: "UiContainer", structure: "image", width: "100%", height: "100%" })), h("img", { key: '2188ca4494c10587f064acc5459ffc468948f497', ref: (el) => (this.image = el), src: this.shouldLoad ? this.src : undefined, onLoad: () => (this.imgLoaded = true), style: this.styles, class: `UiContainer ${this.imgLoaded ? 'Visible' : 'Hidden'}`, alt: this.alt, width: this.width, height: this.height, loading: "lazy" })));
59
+ }
60
+ get el() { return getElement(this); }
61
+ static get watchers() { return {
62
+ "src": ["handleSrc"]
63
+ }; }
64
+ };
65
+ UiImage.style = UiImageStyle0;
66
+
67
+ const uiSkeletonCss = ":host{display:block}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.SkeletonRectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 10px)}.SkeletonCircle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.SkeletonText{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 10px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.SkeletonText:last-child{width:calc(var(--emw-skeleton-text-width, 400px) - 100px)}.SkeletonTitle{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 10px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.SkeletonImage{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, unset)}.SkeletonLogo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 10px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, #e0e0e0)}100%{background-color:var(--emw-skeleton-secondary-color, #f0f0f0)}}";
68
+ const UiSkeletonStyle0 = uiSkeletonCss;
69
+
70
+ const UiSkeleton = class {
71
+ constructor(hostRef) {
72
+ registerInstance(this, hostRef);
73
+ this.stylingValue = {
74
+ width: this.handleStylingProps(this.width),
75
+ height: this.handleStylingProps(this.height),
76
+ borderRadius: this.handleStylingProps(this.borderRadius),
77
+ marginBottom: this.handleStylingProps(this.marginBottom),
78
+ marginTop: this.handleStylingProps(this.marginTop),
79
+ marginLeft: this.handleStylingProps(this.marginLeft),
80
+ marginRight: this.handleStylingProps(this.marginRight),
81
+ size: this.handleStylingProps(this.size),
82
+ };
83
+ this.structure = undefined;
84
+ this.width = 'unset';
85
+ this.height = 'unset';
86
+ this.borderRadius = 'unset';
87
+ this.marginBottom = 'unset';
88
+ this.marginTop = 'unset';
89
+ this.marginLeft = 'unset';
90
+ this.marginRight = 'unset';
91
+ this.animation = true;
92
+ this.rows = 0;
93
+ this.size = '100%';
94
+ }
95
+ handleStructureChange(newValue, oldValue) {
96
+ if (oldValue !== newValue) {
97
+ this.handleStructure(newValue);
98
+ }
99
+ }
100
+ handleStylingProps(value) {
101
+ switch (typeof value) {
102
+ case 'number':
103
+ return value === 0 ? 0 : `${value}px`;
104
+ case 'undefined':
105
+ return 'unset';
106
+ case 'string':
107
+ if (['auto', 'unset', 'none', 'inherit', 'initial'].includes(value) ||
108
+ value.endsWith('px') ||
109
+ value.endsWith('%')) {
110
+ return value;
111
+ }
112
+ else {
113
+ return 'unset';
114
+ }
115
+ default:
116
+ return 'unset';
117
+ }
118
+ }
119
+ handleStructure(structure) {
120
+ switch (structure) {
121
+ case 'logo':
122
+ return this.renderLogo();
123
+ case 'image':
124
+ return this.renderImage();
125
+ case 'title':
126
+ return this.renderTitle();
127
+ case 'text':
128
+ return this.renderText();
129
+ case 'rectangle':
130
+ return this.renderRectangle();
131
+ case 'circle':
132
+ return this.renderCircle();
133
+ default:
134
+ return null;
135
+ }
136
+ }
137
+ renderLogo() {
138
+ return (h("div", { class: "SkeletonContainer" }, h("div", { class: 'SkeletonLogo ' + (this.animation ? 'Skeleton' : '') })));
139
+ }
140
+ renderImage() {
141
+ return h("div", { class: 'SkeletonImage ' + (this.animation ? 'Skeleton' : '') });
142
+ }
143
+ renderTitle() {
144
+ return (h("div", { class: "SkeletonContainer" }, h("div", { class: 'SkeletonTitle ' + (this.animation ? 'Skeleton' : '') })));
145
+ }
146
+ renderText() {
147
+ return (h("div", { class: "SkeletonContainer" }, Array.from({ length: this.rows > 0 ? this.rows : 1 }).map((_, index) => (h("div", { key: index, class: 'SkeletonText ' + (this.animation ? 'Skeleton' : '') })))));
148
+ }
149
+ renderRectangle() {
150
+ return (h("div", { class: "SkeletonContainer" }, h("div", { class: 'SkeletonRectangle ' + (this.animation ? 'Skeleton' : '') })));
151
+ }
152
+ renderCircle() {
153
+ return (h("div", { class: "SkeletonContainer" }, h("div", { class: 'SkeletonCircle ' + (this.animation ? 'Skeleton' : '') })));
154
+ }
155
+ render() {
156
+ let styleBlock = '';
157
+ switch (this.structure) {
158
+ case 'logo':
159
+ styleBlock = `
160
+ :host {
161
+ --emw-skeleton-logo-width: ${this.stylingValue.width};
162
+ --emw-skeleton-logo-height: ${this.stylingValue.height};
163
+ --emw-skeleton-logo-border-radius: ${this.stylingValue.borderRadius};
164
+ --emw-skeleton-logo-margin-bottom: ${this.stylingValue.marginBottom};
165
+ --emw-skeleton-logo-margin-top: ${this.stylingValue.marginTop};
166
+ --emw-skeleton-logo-margin-left: ${this.stylingValue.marginLeft};
167
+ --emw-skeleton-logo-margin-right: ${this.stylingValue.marginRight};
168
+ }
169
+ `;
170
+ break;
171
+ case 'image':
172
+ styleBlock = `
173
+ :host {
174
+ --emw-skeleton-image-width: ${this.stylingValue.width};
175
+ --emw-skeleton-image-height: ${this.stylingValue.height};
176
+ --emw-skeleton-image-border-radius: ${this.stylingValue.borderRadius};
177
+ --emw-skeleton-image-margin-bottom: ${this.stylingValue.marginBottom};
178
+ --emw-skeleton-image-margin-top: ${this.stylingValue.marginTop};
179
+ --emw-skeleton-image-margin-left: ${this.stylingValue.marginLeft};
180
+ --emw-skeleton-image-margin-right: ${this.stylingValue.marginRight};
181
+ }
182
+ `;
183
+ break;
184
+ case 'title':
185
+ styleBlock = `
186
+ :host {
187
+ --emw-skeleton-title-width: ${this.stylingValue.width};
188
+ --emw-skeleton-title-height: ${this.stylingValue.height};
189
+ --emw-skeleton-title-border-radius: ${this.stylingValue.borderRadius};
190
+ --emw-skeleton-title-margin-bottom: ${this.stylingValue.marginBottom};
191
+ --emw-skeleton-title-margin-top: ${this.stylingValue.marginTop};
192
+ --emw-skeleton-title-margin-left: ${this.stylingValue.marginLeft};
193
+ --emw-skeleton-title-margin-right: ${this.stylingValue.marginRight};
194
+ }
195
+ `;
196
+ break;
197
+ case 'text':
198
+ styleBlock = `
199
+ :host {
200
+ --emw-skeleton-text-width: ${this.stylingValue.width};
201
+ --emw-skeleton-text-height: ${this.stylingValue.height};
202
+ --emw-skeleton-text-border-radius: ${this.stylingValue.borderRadius};
203
+ --emw-skeleton-text-margin-bottom: ${this.stylingValue.marginBottom};
204
+ --emw-skeleton-text-margin-top: ${this.stylingValue.marginTop};
205
+ --emw-skeleton-text-margin-left: ${this.stylingValue.marginLeft};
206
+ --emw-skeleton-text-margin-right: ${this.stylingValue.marginRight};
207
+ }
208
+ `;
209
+ break;
210
+ case 'rectangle':
211
+ styleBlock = `
212
+ :host {
213
+ --emw-skeleton-rectangle-width: ${this.stylingValue.width};
214
+ --emw-skeleton-rectangle-height: ${this.stylingValue.height};
215
+ --emw-skeleton-rectangle-border-radius: ${this.stylingValue.borderRadius};
216
+ --emw-skeleton-rectangle-margin-bottom: ${this.stylingValue.marginBottom};
217
+ --emw-skeleton-rectangle-margin-top: ${this.stylingValue.marginTop};
218
+ --emw-skeleton-rectangle-margin-left: ${this.stylingValue.marginLeft};
219
+ --emw-skeleton-rectangle-margin-right: ${this.stylingValue.marginRight};
220
+ }
221
+ `;
222
+ break;
223
+ case 'circle':
224
+ styleBlock = `
225
+ :host {
226
+ --emw-skeleton-circle-size: ${this.stylingValue.size};
227
+ }
228
+ `;
229
+ break;
230
+ default:
231
+ styleBlock = '';
232
+ }
233
+ return (h(Host, { key: 'c2a2650acd416962a2bc4e1a7ee18bc6d8e2def8' }, h("style", { key: '9bd7fc1f9e9ed9f17735a7b72fce6f09696f5e19' }, styleBlock), this.handleStructure(this.structure)));
234
+ }
235
+ static get watchers() { return {
236
+ "structure": ["handleStructureChange"]
237
+ }; }
238
+ };
239
+ UiSkeleton.style = UiSkeletonStyle0;
240
+
241
+ export { UiImage as ui_image, UiSkeleton as ui_skeleton };