@everymatrix/bonus-elevate-shop-item 1.43.4 → 1.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/bonus-elevate-shop-item/bonus-elevate-shop-item.esm.js +1 -1
  2. package/dist/bonus-elevate-shop-item/p-961d6b9a.entry.js +1 -0
  3. package/dist/bonus-elevate-shop-item/p-e1255160.js +1 -0
  4. package/dist/bonus-elevate-shop-item/p-ec5f179f.js +2 -0
  5. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  6. package/dist/cjs/bonus-elevate-shop-assets-slider_3.cjs.entry.js +377 -406
  7. package/dist/cjs/bonus-elevate-shop-item.cjs.js +16 -10
  8. package/dist/cjs/index-1035f878.js +1591 -0
  9. package/dist/cjs/loader.cjs.js +6 -12
  10. package/dist/collection/collection-manifest.json +4 -4
  11. package/dist/collection/components/bonus-elevate-shop-item/bonus-elevate-shop-assets-slider.js +207 -222
  12. package/dist/collection/components/bonus-elevate-shop-item/bonus-elevate-shop-item.css +5 -5
  13. package/dist/collection/components/bonus-elevate-shop-item/bonus-elevate-shop-item.js +332 -362
  14. package/dist/collection/components/bonus-elevate-shop-item/index.js +1 -0
  15. package/dist/collection/utils/locale.utils.js +54 -54
  16. package/dist/collection/utils/utils.js +26 -26
  17. package/dist/esm/app-globals-0f993ce5.js +3 -0
  18. package/dist/esm/bonus-elevate-shop-assets-slider_3.entry.js +377 -406
  19. package/dist/esm/bonus-elevate-shop-item.js +13 -10
  20. package/dist/esm/index-fa394550.js +1561 -0
  21. package/dist/esm/loader.js +6 -12
  22. package/dist/stencil.config.dev.js +17 -0
  23. package/dist/stencil.config.js +14 -21
  24. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/bonus-elevate-shop-item/.stencil/packages/stencil/bonus-elevate-shop-item/stencil.config.d.ts +2 -0
  25. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/bonus-elevate-shop-item/.stencil/packages/stencil/bonus-elevate-shop-item/stencil.config.dev.d.ts +2 -0
  26. package/dist/types/components/bonus-elevate-shop-item/bonus-elevate-shop-assets-slider.d.ts +35 -35
  27. package/dist/types/components/bonus-elevate-shop-item/bonus-elevate-shop-item.d.ts +56 -56
  28. package/dist/types/components/bonus-elevate-shop-item/index.d.ts +1 -0
  29. package/dist/types/components.d.ts +17 -1
  30. package/dist/types/models/bonus-elevate-shop-item.d.ts +12 -12
  31. package/dist/types/stencil-public-runtime.d.ts +142 -33
  32. package/loader/cdn.js +1 -3
  33. package/loader/index.cjs.js +1 -3
  34. package/loader/index.d.ts +13 -1
  35. package/loader/index.es2017.js +1 -3
  36. package/loader/index.js +1 -3
  37. package/loader/package.json +1 -0
  38. package/package.json +12 -5
  39. package/dist/bonus-elevate-shop-item/p-3d8363a3.js +0 -1
  40. package/dist/bonus-elevate-shop-item/p-9546c5ba.entry.js +0 -1
  41. package/dist/cjs/index-355d8ffb.js +0 -1653
  42. package/dist/components/bonus-elevate-shop-assets-slider.d.ts +0 -11
  43. package/dist/components/bonus-elevate-shop-assets-slider.js +0 -6
  44. package/dist/components/bonus-elevate-shop-assets-slider2.js +0 -158
  45. package/dist/components/bonus-elevate-shop-item.d.ts +0 -11
  46. package/dist/components/bonus-elevate-shop-item.js +0 -278
  47. package/dist/components/general-styling-wrapper.js +0 -6
  48. package/dist/components/general-styling-wrapper2.js +0 -103
  49. package/dist/components/index.d.ts +0 -26
  50. package/dist/components/index.js +0 -1
  51. package/dist/esm/index-4927ce96.js +0 -1624
  52. package/dist/esm/polyfills/core-js.js +0 -11
  53. package/dist/esm/polyfills/css-shim.js +0 -1
  54. package/dist/esm/polyfills/dom.js +0 -79
  55. package/dist/esm/polyfills/es5-html-element.js +0 -1
  56. package/dist/esm/polyfills/index.js +0 -34
  57. package/dist/esm/polyfills/system.js +0 -6
  58. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/bonus-elevate-shop-item/.stencil/packages/bonus-elevate-shop-item/stencil.config.d.ts +0 -2
@@ -1,202 +1,193 @@
1
- import { r as registerInstance, h, g as getElement, c as createEvent, F as Fragment, H as Host } from './index-4927ce96.js';
1
+ import { r as registerInstance, h, g as getElement, c as createEvent, F as Fragment, H as Host } from './index-fa394550.js';
2
2
 
3
3
  const BonusElevateShopAssetsSlider = class {
4
- constructor(hostRef) {
5
- registerInstance(this, hostRef);
6
- /**
7
- * Show slider dots
8
- */
9
- this.showSliderDots = false;
10
- /**
11
- * Show slider navigate arrows
12
- */
13
- this.showSliderArrows = true;
14
- this.itemsPerPage = 1;
15
- this.sliderItems = [];
16
- /**
17
- * Slider variables
18
- */
19
- this.activeIndex = 0;
20
- this.xDown = null;
21
- this.yDown = null;
22
- this.orientationChangeHandler = () => {
23
- setTimeout(() => {
4
+ constructor(hostRef) {
5
+ registerInstance(this, hostRef);
6
+ this.xDown = null;
7
+ this.yDown = null;
8
+ this.orientationChangeHandler = () => {
9
+ setTimeout(() => {
10
+ this.recalculateItemsPerPage();
11
+ }, 10);
12
+ };
13
+ this.resizeHandler = () => {
14
+ this.recalculateItemsPerPage();
15
+ };
16
+ this.showSliderDots = false;
17
+ this.showSliderArrows = true;
18
+ this.itemsPerPage = 1;
19
+ this.sliderItems = [];
20
+ this.activeIndex = 0;
21
+ }
22
+ setActive(index) {
23
+ var _a;
24
+ const maxLength = (_a = this.sliderItems) === null || _a === void 0 ? void 0 : _a.length;
25
+ if (index >= 0) {
26
+ if (index >= maxLength - 1) {
27
+ this.activeIndex = maxLength - 1;
28
+ }
29
+ else {
30
+ this.activeIndex = index;
31
+ }
32
+ }
33
+ else {
34
+ this.activeIndex = 0;
35
+ }
36
+ }
37
+ move(direction) {
38
+ this.setActive(this.activeIndex + direction);
39
+ }
40
+ goTo(index) {
41
+ let diff = this.activeIndex - index;
42
+ if (diff > 0) {
43
+ for (let i = 0; i < diff; i++) {
44
+ this.move(-1);
45
+ }
46
+ }
47
+ else {
48
+ for (let i = 0; i > diff; i--) {
49
+ this.move(1);
50
+ }
51
+ }
52
+ }
53
+ handleTouchStart(evt) {
54
+ const firstTouch = this.getTouches(evt)[0];
55
+ this.xDown = firstTouch.clientX;
56
+ this.yDown = firstTouch.clientY;
57
+ }
58
+ getTouches(evt) {
59
+ return evt.touches || evt.originalEvent.touches;
60
+ }
61
+ handleTouchMove(evt) {
62
+ if (!this.xDown || !this.yDown)
63
+ return;
64
+ let xUp = evt.touches[0].clientX;
65
+ let yUp = evt.touches[0].clientY;
66
+ let xDiff = this.xDown - xUp;
67
+ let yDiff = this.yDown - yUp;
68
+ if (Math.abs(xDiff) > Math.abs(yDiff)) {
69
+ if (xDiff > 0) {
70
+ this.move(1);
71
+ }
72
+ else {
73
+ this.move(-1);
74
+ }
75
+ }
76
+ this.xDown = null;
77
+ this.yDown = null;
78
+ }
79
+ ;
80
+ recalculateItemsPerPage() {
81
+ if (!this.sliderItemsElement)
82
+ return;
83
+ this.itemElementWidth = this.sliderItemsElement.clientWidth;
84
+ this.sliderItemsElementWidth = (this.sliderItems.length - 1) * this.itemElementWidth;
85
+ }
86
+ ;
87
+ renderDots() {
88
+ var _a;
89
+ const dots = [];
90
+ for (let index = 0; index < ((_a = this.sliderItems) === null || _a === void 0 ? void 0 : _a.length) / this.itemsPerPage; index++) {
91
+ dots.push(h("li", { class: index == this.activeIndex ? 'active' : 'default', onClick: () => { this.goTo(index); this.setActive(index); } }));
92
+ }
93
+ return dots;
94
+ }
95
+ componentDidRender() {
96
+ this.el.addEventListener('touchstart', this.handleTouchStart.bind(this), { passive: true });
97
+ this.el.addEventListener('touchmove', this.handleTouchMove.bind(this), { passive: true });
24
98
  this.recalculateItemsPerPage();
25
- }, 10);
26
- };
27
- this.resizeHandler = () => {
28
- this.recalculateItemsPerPage();
29
- };
30
- }
31
- setActive(index) {
32
- var _a;
33
- const maxLength = (_a = this.sliderItems) === null || _a === void 0 ? void 0 : _a.length;
34
- if (index >= 0) {
35
- if (index >= maxLength - 1) {
36
- this.activeIndex = maxLength - 1;
37
- }
38
- else {
39
- this.activeIndex = index;
40
- }
41
- }
42
- else {
43
- this.activeIndex = 0;
44
- }
45
- }
46
- move(direction) {
47
- this.setActive(this.activeIndex + direction);
48
- }
49
- goTo(index) {
50
- let diff = this.activeIndex - index;
51
- if (diff > 0) {
52
- for (let i = 0; i < diff; i++) {
53
- this.move(-1);
54
- }
55
- }
56
- else {
57
- for (let i = 0; i > diff; i--) {
58
- this.move(1);
59
- }
60
- }
61
- }
62
- handleTouchStart(evt) {
63
- const firstTouch = this.getTouches(evt)[0];
64
- this.xDown = firstTouch.clientX;
65
- this.yDown = firstTouch.clientY;
66
- }
67
- getTouches(evt) {
68
- return evt.touches || evt.originalEvent.touches;
69
- }
70
- handleTouchMove(evt) {
71
- if (!this.xDown || !this.yDown)
72
- return;
73
- let xUp = evt.touches[0].clientX;
74
- let yUp = evt.touches[0].clientY;
75
- let xDiff = this.xDown - xUp;
76
- let yDiff = this.yDown - yUp;
77
- if (Math.abs(xDiff) > Math.abs(yDiff)) {
78
- if (xDiff > 0) {
79
- this.move(1);
80
- }
81
- else {
82
- this.move(-1);
83
- }
84
- }
85
- this.xDown = null;
86
- this.yDown = null;
87
- }
88
- ;
89
- recalculateItemsPerPage() {
90
- if (!this.sliderItemsElement)
91
- return;
92
- this.itemElementWidth = this.sliderItemsElement.clientWidth;
93
- this.sliderItemsElementWidth = (this.sliderItems.length - 1) * this.itemElementWidth;
94
- }
95
- ;
96
- renderDots() {
97
- var _a;
98
- const dots = [];
99
- for (let index = 0; index < ((_a = this.sliderItems) === null || _a === void 0 ? void 0 : _a.length) / this.itemsPerPage; index++) {
100
- dots.push(h("li", { class: index == this.activeIndex ? 'active' : 'default', onClick: () => { this.goTo(index); this.setActive(index); } }));
101
- }
102
- return dots;
103
- }
104
- componentDidRender() {
105
- this.el.addEventListener('touchstart', this.handleTouchStart.bind(this), { passive: true });
106
- this.el.addEventListener('touchmove', this.handleTouchMove.bind(this), { passive: true });
107
- this.recalculateItemsPerPage();
108
- }
109
- componentDidUpdate() {
110
- this.recalculateItemsPerPage();
111
- }
112
- connectedCallback() {
113
- window.screen.orientation.addEventListener('change', this.orientationChangeHandler);
114
- }
115
- disconnectedCallback() {
116
- this.el.removeEventListener('touchstart', this.handleTouchStart);
117
- this.el.removeEventListener('touchmove', this.handleTouchMove);
118
- window.screen.orientation.removeEventListener('change', this.orientationChangeHandler);
119
- window.removeEventListener('resize', this.resizeHandler);
120
- }
121
- render() {
122
- var _a;
123
- const styles = {
124
- transform: `translate(${(this.sliderItemsElementWidth / (((_a = this.sliderItems) === null || _a === void 0 ? void 0 : _a.length) - 1) * this.activeIndex) * -1}px, 0px)`
125
- };
126
- const itemStyle = {
127
- width: `${this.itemElementWidth / this.itemsPerPage}px`
128
- };
129
- return h("div", { class: "SliderWrapper" }, h("div", { class: 'MainContent ' }, this.showSliderArrows &&
130
- h("div", { class: `SliderNavButton LeftArrow ${this.activeIndex === 0 ? 'DisabledArrow ' : ''} ${this.sliderItems.length === 1 ? 'HiddenArrow ' : ''}`, onClick: () => this.move(-1) }, h("svg", { fill: "none", stroke: "var(--emfe-w-color-secondary, #FD2839)", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M15 19l-7-7 7-7" }))), h("div", { class: 'ItemsWrapper', ref: (el) => this.sliderItemsElement = el }, h("div", { class: 'Items AssetsItems', style: styles }, this.sliderItems.map((assetUrl) => h("img", { class: `img${this.itemsPerPage}`, alt: 'Gift Thumbnails', style: itemStyle, src: assetUrl })))), this.showSliderArrows &&
131
- h("div", { class: `SliderNavButton RightArrow ${this.sliderItems.length === 1 ? 'HiddenArrow ' : ''}
132
- ${(this.activeIndex === (this.sliderItems.length - 1) || this.itemsPerPage == this.sliderItems.length) ? 'DisabledArrow' : ''}`, onClick: () => this.move(1) }, h("svg", { fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M9 5l7 7-7 7" })))), this.showSliderDots && this.sliderItems.length > 1 &&
133
- h("div", { class: "DotsWrapper" }, h("ul", { class: "Dots" }, this.renderDots())));
134
- }
135
- get el() { return getElement(this); }
99
+ }
100
+ componentDidUpdate() {
101
+ this.recalculateItemsPerPage();
102
+ }
103
+ connectedCallback() {
104
+ window.screen.orientation.addEventListener('change', this.orientationChangeHandler);
105
+ }
106
+ disconnectedCallback() {
107
+ this.el.removeEventListener('touchstart', this.handleTouchStart);
108
+ this.el.removeEventListener('touchmove', this.handleTouchMove);
109
+ window.screen.orientation.removeEventListener('change', this.orientationChangeHandler);
110
+ window.removeEventListener('resize', this.resizeHandler);
111
+ }
112
+ render() {
113
+ var _a;
114
+ const styles = {
115
+ transform: `translate(${(this.sliderItemsElementWidth / (((_a = this.sliderItems) === null || _a === void 0 ? void 0 : _a.length) - 1) * this.activeIndex) * -1}px, 0px)`
116
+ };
117
+ const itemStyle = {
118
+ width: `${this.itemElementWidth / this.itemsPerPage}px`
119
+ };
120
+ return h("div", { key: '210d648ae90dd04e350c0cddb2047061f5989bd8', class: "SliderWrapper" }, h("div", { key: '240a214bc772890145b8317bfda32f6099150726', class: 'MainContent ' }, this.showSliderArrows &&
121
+ h("div", { key: 'e8e144fbc2906ee0c5e77cc00c33fb1e89ced29f', class: `SliderNavButton LeftArrow ${this.activeIndex === 0 ? 'DisabledArrow ' : ''} ${this.sliderItems.length === 1 ? 'HiddenArrow ' : ''}`, onClick: () => this.move(-1) }, h("svg", { key: '068a669fa96d11532199f2f2eb44e3a4c3f31e10', fill: "none", stroke: "var(--emfe-w-color-secondary, #FD2839)", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '2789bb8d91ce4ec7f0fd7c3c6b9f3c7b7e682088', "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M15 19l-7-7 7-7" }))), h("div", { key: '034ef81e4d9a8dea56fd42791e8a08940dfa4af6', class: 'ItemsWrapper', ref: (el) => this.sliderItemsElement = el }, h("div", { key: 'f412b5f0978348e4d9e0af682d151a1880f6e86d', class: 'Items AssetsItems', style: styles }, this.sliderItems.map((assetUrl) => h("img", { class: `img${this.itemsPerPage}`, alt: 'Gift Thumbnails', style: itemStyle, src: assetUrl })))), this.showSliderArrows &&
122
+ h("div", { key: '0f8549f8a5bcf2f1cfcde601930610fe5cc98427', class: `SliderNavButton RightArrow ${this.sliderItems.length === 1 ? 'HiddenArrow ' : ''}
123
+ ${(this.activeIndex === (this.sliderItems.length - 1) || this.itemsPerPage == this.sliderItems.length) ? 'DisabledArrow' : ''}`, onClick: () => this.move(1) }, h("svg", { key: '5758a9a73af5f7fa4618ae1b4bb30d838b509d9f', fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '720c5f0f496e8817fc9017ec4e8706cb9644e9ef', "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M9 5l7 7-7 7" })))), this.showSliderDots && this.sliderItems.length > 1 &&
124
+ h("div", { key: '9c1b9c57b1871d7463569ea9566b28e925870d59', class: "DotsWrapper" }, h("ul", { key: '548d1d0f2c46170e07aa7ed4019dc3469e2e3950', class: "Dots" }, this.renderDots())));
125
+ }
126
+ get el() { return getElement(this); }
136
127
  };
137
128
 
138
129
  const DEFAULT_LANGUAGE = 'en';
139
130
  const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hu'];
140
131
  const TRANSLATIONS = {
141
- en: {
142
- coins: 'Coins',
143
- noGiftPresentation: 'No description',
144
- redeem: 'Redeem',
145
- noDataFound: 'No data found',
146
- error4003: 'Invalid Session',
147
- redeemFailed: 'Failed to redeem'
148
- },
149
- ro: {
150
- coins: 'Coins',
151
- noGiftPresentation: 'No description',
152
- redeem: 'Redeem',
153
- noDataFound: 'No data found',
154
- error4003: 'Invalid Session',
155
- redeemFailed: 'Failed to redeem'
156
- },
157
- fr: {
158
- coins: 'Coins',
159
- noGiftPresentation: 'No description',
160
- redeem: 'Redeem',
161
- noDataFound: 'No data found',
162
- error4003: 'Invalid Session',
163
- redeemFailed: 'Failed to redeem',
164
- },
165
- ar: {
166
- coins: 'Coins',
167
- noGiftPresentation: 'No description',
168
- redeem: 'Redeem',
169
- noDataFound: 'No data found',
170
- error4003: 'Invalid Session',
171
- redeemFailed: 'Failed to redeem',
172
- },
173
- hu: {
174
- coins: 'Coins',
175
- noGiftPresentation: 'No description',
176
- redeem: 'Redeem',
177
- noDataFound: 'No data found',
178
- error4003: 'Invalid Session',
179
- redeemFailed: 'Failed to redeem',
180
- }
132
+ en: {
133
+ coins: 'Coins',
134
+ noGiftPresentation: 'No description',
135
+ redeem: 'Redeem',
136
+ noDataFound: 'No data found',
137
+ error4003: 'Invalid Session',
138
+ redeemFailed: 'Failed to redeem'
139
+ },
140
+ ro: {
141
+ coins: 'Coins',
142
+ noGiftPresentation: 'No description',
143
+ redeem: 'Redeem',
144
+ noDataFound: 'No data found',
145
+ error4003: 'Invalid Session',
146
+ redeemFailed: 'Failed to redeem'
147
+ },
148
+ fr: {
149
+ coins: 'Coins',
150
+ noGiftPresentation: 'No description',
151
+ redeem: 'Redeem',
152
+ noDataFound: 'No data found',
153
+ error4003: 'Invalid Session',
154
+ redeemFailed: 'Failed to redeem',
155
+ },
156
+ ar: {
157
+ coins: 'Coins',
158
+ noGiftPresentation: 'No description',
159
+ redeem: 'Redeem',
160
+ noDataFound: 'No data found',
161
+ error4003: 'Invalid Session',
162
+ redeemFailed: 'Failed to redeem',
163
+ },
164
+ hu: {
165
+ coins: 'Coins',
166
+ noGiftPresentation: 'No description',
167
+ redeem: 'Redeem',
168
+ noDataFound: 'No data found',
169
+ error4003: 'Invalid Session',
170
+ redeemFailed: 'Failed to redeem',
171
+ }
181
172
  };
182
173
  const translate = (key, customLang) => {
183
- const lang = customLang;
184
- return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
174
+ const lang = customLang;
175
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
185
176
  };
186
177
  const getTranslations = (url) => {
187
- // fetch url, get the data, replace the TRANSLATIONS content
188
- return new Promise((resolve) => {
189
- fetch(url)
190
- .then((res) => res.json())
191
- .then((data) => {
192
- Object.keys(data).forEach((item) => {
193
- for (let key in data[item]) {
194
- TRANSLATIONS[item][key] = data[item][key];
195
- }
196
- });
197
- resolve(true);
178
+ // fetch url, get the data, replace the TRANSLATIONS content
179
+ return new Promise((resolve) => {
180
+ fetch(url)
181
+ .then((res) => res.json())
182
+ .then((data) => {
183
+ Object.keys(data).forEach((item) => {
184
+ for (let key in data[item]) {
185
+ TRANSLATIONS[item][key] = data[item][key];
186
+ }
187
+ });
188
+ resolve(true);
189
+ });
198
190
  });
199
- });
200
191
  };
201
192
 
202
193
  /**
@@ -206,245 +197,225 @@ const getTranslations = (url) => {
206
197
  * @returns {Boolean} true or false
207
198
  */
208
199
  const getDevice = () => {
209
- let userAgent = window.navigator.userAgent;
210
- if (userAgent.toLowerCase().match(/android/i)) {
211
- return 'Android';
212
- }
213
- if (userAgent.toLowerCase().match(/iphone/i)) {
214
- return 'iPhone';
215
- }
216
- if (userAgent.toLowerCase().match(/ipad|ipod/i)) {
217
- return 'iPad';
218
- }
219
- return 'PC';
220
- };
221
- const getDevicePlatform = () => {
222
- const device = getDevice();
223
- if (device) {
224
- if (device === 'PC') {
225
- return 'dk';
200
+ let userAgent = window.navigator.userAgent;
201
+ if (userAgent.toLowerCase().match(/android/i)) {
202
+ return 'Android';
203
+ }
204
+ if (userAgent.toLowerCase().match(/iphone/i)) {
205
+ return 'iPhone';
226
206
  }
227
- else if (device === 'iPad' || device === 'iPhone') {
228
- return 'ios';
207
+ if (userAgent.toLowerCase().match(/ipad|ipod/i)) {
208
+ return 'iPad';
229
209
  }
230
- else {
231
- return 'mtWeb';
210
+ return 'PC';
211
+ };
212
+ const getDevicePlatform = () => {
213
+ const device = getDevice();
214
+ if (device) {
215
+ if (device === 'PC') {
216
+ return 'dk';
217
+ }
218
+ else if (device === 'iPad' || device === 'iPhone') {
219
+ return 'ios';
220
+ }
221
+ else {
222
+ return 'mtWeb';
223
+ }
232
224
  }
233
- }
234
225
  };
235
226
 
236
- const bonusElevateShopItemCss = ":host{display:block}.ElevateDetails{display:flex;flex-direction:row;flex-wrap:wrap;padding:10px;width:calc(100% - 20px);}.ElevateDetails .RedeemError{display:none}.ElevateDetails .Error{color:var(--emfe-w-color-error, #FD2839)}.ElevateDetails .Row{flex-direction:row;display:flex}.ElevateDetails .Col{flex-direction:column;display:flex}.ElevateDetails .Details{padding:20px}.ElevateDetails .ThumbnailRow{display:flex;flex-direction:column;justify-content:space-between;min-width:268px;max-width:398px}.ElevateDetails .ThumbnailRow .BackButton{width:20px;height:20px;padding:5px;background:white;box-shadow:0px 4px 40px 0px rgba(138, 149, 158, 0.2);margin:10px 0 10px;cursor:pointer;animation-timing-function:ease-out;animation-duration:300ms;transition-property:all;border:1px solid #e4e6e8;border-radius:5px;text-align:center}.ElevateDetails .ThumbnailRow .BackButton:hover{background:#e3dede}.ElevateDetails .ThumbnailRow .Thumbnails{display:flex;flex-direction:column;position:relative;width:calc(100% - 40px)}.ElevateDetails .ShopItemDetail{flex-grow:1;min-width:300px}.ElevateDetails .GiftPoints .Points{font-size:21px}.ElevateDetails .GiftPoints .PointsLabel{font-size:12px;color:var(--emfe-w-color-gray-300, #4e5a37);font-weight:400;line-height:29px;letter-spacing:0.04em;text-align:left}.ElevateDetails .RedeemButton:hover{font-weight:800;border:2px solid var(--emfe-w-color-gray-300, #e5e7d5)}.ElevateDetails .RedeemButton.Disabled:hover{font-weight:normal;border:2px solid transparent}.ElevateDetails .RedeemButton{margin-top:50px;color:#f1f1f1;font-size:20px;padding:16px 25px 16px 25px;border-radius:18px;text-align:center;cursor:pointer;background:linear-gradient(0deg, #26CC37, #26CC37), linear-gradient(283.85deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.47%), linear-gradient(117.99deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.89%), linear-gradient(268.18deg, rgba(255, 255, 255, 0.6) -17.36%, rgba(239, 239, 239, 0) 15.78%);border:2px solid;border-image-source:linear-gradient(283.85deg, rgba(190, 40, 40, 0.5) 0%, rgba(56, 64, 179, 0) 33.47%);box-shadow:0px 4px 4px 0px rgba(0, 0, 0, 0.25)}.ElevateDetails .RedeemButton.DkButton{width:80px;padding:8px;font-size:16px;border-radius:5px}.ElevateDetails .RedeemButton.Disabled{background:linear-gradient(0deg, #b8c4b9, #9eb0a0), linear-gradient(283.85deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.47%), linear-gradient(117.99deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.89%), linear-gradient(268.18deg, rgba(255, 255, 255, 0.6) -17.36%, rgba(239, 239, 239, 0) 15.78%)}.ElevateDetails .SliderWrapper{display:flex;flex-direction:column;position:relative;width:calc(100% - 40px)}.ElevateDetails .SliderWrapper .MainContent{display:flex;flex-direction:row;justify-content:space-around}.ElevateDetails .SliderWrapper .MainContent .LeftArrow,.ElevateDetails .SliderWrapper .MainContent .RightArrow{width:20px}.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper{overflow:hidden;display:inline-flex;width:calc(100% - 40px);flex-direction:column}.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper .Items{display:inline-flex;transition:transform 0.4s ease-in-out;transform:translateX(0px);margin:auto}.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper img.img2{width:50%}.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper img.img3{width:30%}.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper img,.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper img.img1{max-width:100%;background:#efefef;border:1px solid #efefef;border-radius:18px;border:1px;margin:10px 0 10px}.ElevateDetails .SliderWrapper .DotsWrapper{width:100%;margin:0 auto;height:30px}.ElevateDetails .SliderWrapper .DotsWrapper ul.Dots{display:flex;justify-content:center;padding:0}.ElevateDetails .SliderWrapper .DotsWrapper ul.Dots li{height:10px;width:10px;background:#ccc;border-radius:50%;margin-left:3px;margin-right:3px;list-style:none;cursor:pointer}.ElevateDetails .SliderWrapper .DotsWrapper ul.Dots li:hover{background:#bbb}.ElevateDetails .SliderWrapper .DotsWrapper ul.Dots li.active{border:solid 1px var(--emfe-w-color-secondary, #FD2839);background:var(--emfe-w-color-secondary, #FD2839)}.ElevateDetails .SliderWrapper .DotsWrapper ul.Dots li.default{border:solid 1px var(--emfe-w-color-secondary, #FD2839);background-color:#FFF}.ElevateDetails .SliderNavButton{border:0px;width:25px;display:flex;align-items:center;justify-content:center;cursor:pointer}.ElevateDetails .SliderNavButton.HiddenArrow{visibility:hidden}.ElevateDetails .SliderNavButton svg{width:20px;stroke:var(--emfe-w-color-secondary, #FD2839)}.ElevateDetails .DisabledArrow svg{opacity:0.2;stroke:var(--emfe-w-color-secondary, #FD2839);pointer-events:none}";
227
+ const bonusElevateShopItemCss = ":host{display:block}.ElevateDetails{display:flex;flex-direction:row;flex-wrap:wrap;padding:10px;width:calc(100% - 20px);}.ElevateDetails .RedeemError{display:none}.ElevateDetails .Error{color:var(--emfe-w-color-error, #FD2839)}.ElevateDetails .Row{flex-direction:row;display:flex}.ElevateDetails .Col{flex-direction:column;display:flex}.ElevateDetails .Details{padding:20px}.ElevateDetails .ThumbnailRow{display:flex;flex-direction:column;justify-content:space-between;min-width:268px;max-width:398px}.ElevateDetails .ThumbnailRow .BackButton{width:20px;height:20px;padding:5px;background:white;box-shadow:0px 4px 40px 0px rgba(138, 149, 158, 0.2);margin:10px 0 10px;cursor:pointer;animation-timing-function:ease-out;animation-duration:300ms;transition-property:all;border:1px solid #e4e6e8;border-radius:5px;text-align:center}.ElevateDetails .ThumbnailRow .BackButton:hover{background:rgb(227, 222, 222)}.ElevateDetails .ThumbnailRow .Thumbnails{display:flex;flex-direction:column;position:relative;width:calc(100% - 40px)}.ElevateDetails .ShopItemDetail{flex-grow:1;min-width:300px}.ElevateDetails .GiftPoints .Points{font-size:21px}.ElevateDetails .GiftPoints .PointsLabel{font-size:12px;color:var(--emfe-w-color-gray-300, rgb(78, 90, 55));font-weight:400;line-height:29px;letter-spacing:0.04em;text-align:left}.ElevateDetails .RedeemButton:hover{font-weight:800;border:2px solid var(--emfe-w-color-gray-300, rgb(229, 231, 213))}.ElevateDetails .RedeemButton.Disabled:hover{font-weight:normal;border:2px solid transparent}.ElevateDetails .RedeemButton{margin-top:50px;color:#f1f1f1;font-size:20px;padding:16px 25px 16px 25px;border-radius:18px;text-align:center;cursor:pointer;background:linear-gradient(0deg, #26CC37, #26CC37), linear-gradient(283.85deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.47%), linear-gradient(117.99deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.89%), linear-gradient(268.18deg, rgba(255, 255, 255, 0.6) -17.36%, rgba(239, 239, 239, 0) 15.78%);border:2px solid;border-image-source:linear-gradient(283.85deg, rgba(190, 40, 40, 0.5) 0%, rgba(56, 64, 179, 0) 33.47%);box-shadow:0px 4px 4px 0px rgba(0, 0, 0, 0.25)}.ElevateDetails .RedeemButton.DkButton{width:80px;padding:8px;font-size:16px;border-radius:5px}.ElevateDetails .RedeemButton.Disabled{background:linear-gradient(0deg, #b8c4b9, #9eb0a0), linear-gradient(283.85deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.47%), linear-gradient(117.99deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.89%), linear-gradient(268.18deg, rgba(255, 255, 255, 0.6) -17.36%, rgba(239, 239, 239, 0) 15.78%)}.ElevateDetails .SliderWrapper{display:flex;flex-direction:column;position:relative;width:calc(100% - 40px)}.ElevateDetails .SliderWrapper .MainContent{display:flex;flex-direction:row;justify-content:space-around}.ElevateDetails .SliderWrapper .MainContent .LeftArrow,.ElevateDetails .SliderWrapper .MainContent .RightArrow{width:20px}.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper{overflow:hidden;display:inline-flex;width:calc(100% - 40px);flex-direction:column}.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper .Items{display:inline-flex;transition:transform 0.4s ease-in-out;transform:translateX(0px);margin:auto}.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper img.img2{width:50%}.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper img.img3{width:30%}.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper img,.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper img.img1{max-width:100%;background:rgb(239, 239, 239);border:1px solid rgb(239, 239, 239);border-radius:18px;border:1px;margin:10px 0 10px}.ElevateDetails .SliderWrapper .DotsWrapper{width:100%;margin:0 auto;height:30px}.ElevateDetails .SliderWrapper .DotsWrapper ul.Dots{display:flex;justify-content:center;padding:0}.ElevateDetails .SliderWrapper .DotsWrapper ul.Dots li{height:10px;width:10px;background:#ccc;border-radius:50%;margin-left:3px;margin-right:3px;list-style:none;cursor:pointer}.ElevateDetails .SliderWrapper .DotsWrapper ul.Dots li:hover{background:#bbb}.ElevateDetails .SliderWrapper .DotsWrapper ul.Dots li.active{border:solid 1px var(--emfe-w-color-secondary, #FD2839);background:var(--emfe-w-color-secondary, #FD2839)}.ElevateDetails .SliderWrapper .DotsWrapper ul.Dots li.default{border:solid 1px var(--emfe-w-color-secondary, #FD2839);background-color:#FFF}.ElevateDetails .SliderNavButton{border:0px;width:25px;display:flex;align-items:center;justify-content:center;cursor:pointer}.ElevateDetails .SliderNavButton.HiddenArrow{visibility:hidden}.ElevateDetails .SliderNavButton svg{width:20px;stroke:var(--emfe-w-color-secondary, #FD2839)}.ElevateDetails .DisabledArrow svg{opacity:0.2;stroke:var(--emfe-w-color-secondary, #FD2839);pointer-events:none}";
228
+ const BonusElevateShopItemStyle0 = bonusElevateShopItemCss;
237
229
 
238
230
  const BonusElevateShopItem = class {
239
- constructor(hostRef) {
240
- registerInstance(this, hostRef);
241
- this.redeemGiftButton = createEvent(this, "redeemGiftButton", 7);
242
- /**
243
- * Currently selected language.
244
- */
245
- this.language = 'en';
246
- /**
247
- * Client custom styling via inline styles
248
- */
249
- this.clientStyling = '';
250
- /**
251
- * Client custom styling via url
252
- */
253
- this.clientStylingUrl = '';
254
- /**
255
- * Translation via url
256
- */
257
- this.translationUrl = '';
258
- /**
259
- * Show slider dots
260
- */
261
- this.showSliderDots = false;
262
- /**
263
- * Show slider navigate arrows
264
- */
265
- this.showSliderArrows = true;
266
- this.isGiftNotFound = false;
267
- this.redeemErrorMsg = '';
268
- this.isRedeeming = false;
269
- this.bindedHandler = this.handleMessage.bind(this);
270
- this.deviceType = getDevicePlatform();
271
- }
272
- redeemGiftConfirm() {
273
- window.postMessage({ type: 'BEERedeemConfirm', shopItem: this.elevateGift }, window.location.href);
274
- }
275
- handleMessage(message) {
276
- if (message.data && message.data.type === "bee-redeem-confirmed" &&
277
- message.data.id == this.elevateGift.id) {
278
- this.redeemGift();
279
- }
280
- }
281
- onBackClicked() {
282
- window.postMessage({ type: 'OnGiftDetailsBackButtonClicked' }, window.location.href);
283
- }
284
- redeemGift() {
285
- if (this.elevateGift.available.toLowerCase() === 'false') {
286
- return;
287
- }
288
- let url = new URL(`${this.endpoint}/v1/elevate/redeem`);
289
- let claimGiftOptions = {
290
- method: 'PUT',
291
- headers: {
292
- 'x-SessionId': this.session,
293
- 'Content-Type': 'application/json-patch+json',
294
- },
295
- body: JSON.stringify({ giftId: this.elevateGift.id }),
296
- };
297
- this.redeemErrorMsg = '';
298
- this.isRedeeming = true;
299
- fetch(url.toString(), claimGiftOptions)
300
- .then((res) => res.json())
301
- .then((res) => {
302
- if (res.success) {
303
- this.redeemGiftButton.emit();
304
- window.postMessage({ type: 'BEEGiftRedeem', itemId: this.elevateGift.id }, window.location.href);
305
- }
306
- else {
307
- let translatedError = translate(`error${res.errorCode}`, this.language);
308
- this.redeemErrorMsg = translatedError ? translatedError : translate('redeemFailed', this.language);
309
- window.postMessage({ type: 'BEEGiftRedeemFailed', itemId: this.elevateGift.id, res }, window.location.href);
310
- }
311
- })
312
- .catch((err) => {
313
- window.postMessage({ type: 'BEEGiftClaimFailed', itemId: this.elevateGift.id, err }, window.location.href);
314
- }).finally(() => {
315
- this.isRedeeming = false;
316
- });
317
- }
318
- async loadElevateGift() {
319
- let url = new URL(`${this.endpoint}/v1/elevate/shop?language=${this.language}&filter=id=${this.itemId}`);
320
- let options = {
321
- headers: {
322
- 'Content-Type': 'application/json',
323
- 'x-SessionId': this.session,
324
- },
325
- method: 'GET',
326
- };
327
- await new Promise((resolve) => {
328
- fetch(url.href, options)
329
- .then((res) => res.json())
330
- .then((data) => {
331
- let filteredGifts = data.data;
332
- if (filteredGifts && filteredGifts.length == 1) {
333
- this.elevateGift = filteredGifts[0];
334
- this.isGiftNotFound = false;
231
+ constructor(hostRef) {
232
+ registerInstance(this, hostRef);
233
+ this.redeemGiftButton = createEvent(this, "redeemGiftButton", 7);
234
+ this.bindedHandler = this.handleMessage.bind(this);
235
+ this.deviceType = getDevicePlatform();
236
+ this.endpoint = undefined;
237
+ this.language = 'en';
238
+ this.itemId = undefined;
239
+ this.elevateGift = undefined;
240
+ this.session = undefined;
241
+ this.clientStyling = '';
242
+ this.clientStylingUrl = '';
243
+ this.translationUrl = '';
244
+ this.showSliderDots = false;
245
+ this.showSliderArrows = true;
246
+ this.isGiftNotFound = false;
247
+ this.redeemErrorMsg = '';
248
+ this.isRedeeming = false;
249
+ }
250
+ redeemGiftConfirm() {
251
+ window.postMessage({ type: 'BEERedeemConfirm', shopItem: this.elevateGift }, window.location.href);
252
+ }
253
+ handleMessage(message) {
254
+ if (message.data && message.data.type === "bee-redeem-confirmed" &&
255
+ message.data.id == this.elevateGift.id) {
256
+ this.redeemGift();
257
+ }
258
+ }
259
+ onBackClicked() {
260
+ window.postMessage({ type: 'OnGiftDetailsBackButtonClicked' }, window.location.href);
261
+ }
262
+ redeemGift() {
263
+ if (this.elevateGift.available.toLowerCase() === 'false') {
264
+ return;
265
+ }
266
+ let url = new URL(`${this.endpoint}/v1/elevate/redeem`);
267
+ let claimGiftOptions = {
268
+ method: 'PUT',
269
+ headers: {
270
+ 'x-SessionId': this.session,
271
+ 'Content-Type': 'application/json-patch+json',
272
+ },
273
+ body: JSON.stringify({ giftId: this.elevateGift.id }),
274
+ };
275
+ this.redeemErrorMsg = '';
276
+ this.isRedeeming = true;
277
+ fetch(url.toString(), claimGiftOptions)
278
+ .then((res) => res.json())
279
+ .then((res) => {
280
+ if (res.success) {
281
+ this.redeemGiftButton.emit();
282
+ window.postMessage({ type: 'BEEGiftRedeem', itemId: this.elevateGift.id }, window.location.href);
283
+ }
284
+ else {
285
+ let translatedError = translate(`error${res.errorCode}`, this.language);
286
+ this.redeemErrorMsg = translatedError ? translatedError : translate('redeemFailed', this.language);
287
+ window.postMessage({ type: 'BEEGiftRedeemFailed', itemId: this.elevateGift.id, res }, window.location.href);
288
+ }
289
+ })
290
+ .catch((err) => {
291
+ window.postMessage({ type: 'BEEGiftClaimFailed', itemId: this.elevateGift.id, err }, window.location.href);
292
+ }).finally(() => {
293
+ this.isRedeeming = false;
294
+ });
295
+ }
296
+ async loadElevateGift() {
297
+ let url = new URL(`${this.endpoint}/v1/elevate/shop?language=${this.language}&filter=id=${this.itemId}`);
298
+ let options = {
299
+ headers: {
300
+ 'Content-Type': 'application/json',
301
+ 'x-SessionId': this.session,
302
+ },
303
+ method: 'GET',
304
+ };
305
+ await new Promise((resolve) => {
306
+ fetch(url.href, options)
307
+ .then((res) => res.json())
308
+ .then((data) => {
309
+ let filteredGifts = data.data;
310
+ if (filteredGifts && filteredGifts.length == 1) {
311
+ this.elevateGift = filteredGifts[0];
312
+ this.isGiftNotFound = false;
313
+ }
314
+ else {
315
+ this.isGiftNotFound = true;
316
+ }
317
+ resolve(true);
318
+ });
319
+ });
320
+ }
321
+ disconnectedCallback() {
322
+ window.removeEventListener('message', this.bindedHandler, false);
323
+ }
324
+ componentDidLoad() {
325
+ window.addEventListener('message', this.bindedHandler, false);
326
+ }
327
+ async componentWillLoad() {
328
+ if (this.translationUrl.length > 2) {
329
+ await getTranslations(this.translationUrl);
330
+ }
331
+ if (this.elevateGift) {
332
+ this.isGiftNotFound = false;
335
333
  }
336
334
  else {
337
- this.isGiftNotFound = true;
335
+ await this.loadElevateGift();
338
336
  }
339
- resolve(true);
340
- });
341
- });
342
- }
343
- disconnectedCallback() {
344
- window.removeEventListener('message', this.bindedHandler, false);
345
- }
346
- componentDidLoad() {
347
- window.addEventListener('message', this.bindedHandler, false);
348
- }
349
- async componentWillLoad() {
350
- if (this.translationUrl.length > 2) {
351
- await getTranslations(this.translationUrl);
352
- }
353
- if (this.elevateGift) {
354
- this.isGiftNotFound = false;
355
- }
356
- else {
357
- await this.loadElevateGift();
358
- }
359
- }
360
- render() {
361
- return (h(Host, null, h("general-styling-wrapper", { clientStylingUrl: this.clientStylingUrl, clientStyling: this.clientStyling }), h("div", { class: 'ElevateDetails' }, this.isGiftNotFound && (h(Fragment, null, h("div", { class: "Row ThumbnailRow" }, h("div", { class: "BackButton", onClick: () => {
362
- this.onBackClicked();
363
- } }, '<')), h("div", { class: "Thumnails GiftNotFound" }, translate('noDataFound', this.language), "."))), this.elevateGift && h(Fragment, null, h("div", { class: "ThumbnailRow" }, h("div", { class: 'Row' }, h("div", { class: "BackButton", onClick: () => { this.onBackClicked(); } }, '<'), h("bonus-elevate-shop-assets-slider", { class: 'Thumbnails', itemsPerPage: 1, sliderItems: this.elevateGift.presentation.assets, showSliderDots: this.showSliderDots })), h("div", { class: 'Col Details' }, h("h3", { class: "GiftName" }, this.elevateGift.presentation.displayName || this.elevateGift.displayName), h("div", { class: "GiftPoints" }, h("span", { class: "Points" }, this.elevateGift.points, " "), h("span", { class: " PointsLabel" }, translate('coins', this.language))))), h("div", { class: 'ShopItemDetail Details' }, h("div", { class: "GiftPresentation" }, h("p", null, this.elevateGift.presentation.description ? this.elevateGift.presentation.description : translate('noGiftPresentation', this.language))), h("div", { class: `RedeemButton ${this.elevateGift.available === 'false' || this.isRedeeming ? 'Disabled' : ''}
364
- ${this.deviceType == 'dk' ? 'DkButton' : ''}`, onClick: this.redeemGiftConfirm.bind(this) }, translate('redeem', this.language)), h("span", { class: 'RedeemError Error' }, " ", this.redeemErrorMsg, " "))))));
365
- }
337
+ }
338
+ render() {
339
+ return (h(Host, { key: '6f28f64d3413dd82bc81fc6fd975baa992d06289' }, h("general-styling-wrapper", { key: '88dedbfb25562fbe95a69748649ed9c14a2c42f6', clientStylingUrl: this.clientStylingUrl, clientStyling: this.clientStyling }), h("div", { key: '9f2a66f9d48882220ab5d3850f343e995ffe9a6b', class: 'ElevateDetails' }, this.isGiftNotFound && (h(Fragment, { key: '91f4079bf7af7e4d61b1681a9848c72c9a2249d5' }, h("div", { key: 'e0427680e0d7e94e51644f12a2430a6a42e3d340', class: "Row ThumbnailRow" }, h("div", { key: '4fd78968b2fdf281b7c22596351b366058cfcec3', class: "BackButton", onClick: () => {
340
+ this.onBackClicked();
341
+ } }, '<')), h("div", { key: 'eeb8cbc40429cf1ebf7a5f0de3d5b8226a40437b', class: "Thumnails GiftNotFound" }, translate('noDataFound', this.language), "."))), this.elevateGift && h(Fragment, { key: '45380d051b279d9c7fcd580f06252911763073e0' }, h("div", { key: 'c440d72501fb91601106fbf74a866887bc02ee43', class: "ThumbnailRow" }, h("div", { key: '005f436acbc51372d013e1931d54b71738f2e0fc', class: 'Row' }, h("div", { key: 'a9ace30abf1c50d639c31bb047d7b7d7cb6b27b8', class: "BackButton", onClick: () => { this.onBackClicked(); } }, '<'), h("bonus-elevate-shop-assets-slider", { key: '8c4121e66a3fae912e72fc10c6a81354a7b36e9f', class: 'Thumbnails', itemsPerPage: 1, sliderItems: this.elevateGift.presentation.assets, showSliderDots: this.showSliderDots })), h("div", { key: 'c6a207dfe14402e4d1890e7b787bf4b5a2247160', class: 'Col Details' }, h("h3", { key: 'c190b88ab4d1e13885593b9d6b9c62b161bdff23', class: "GiftName" }, this.elevateGift.presentation.displayName || this.elevateGift.displayName), h("div", { key: 'befddb7b8dff3bb73377da4bfb30ce003dcccb7b', class: "GiftPoints" }, h("span", { key: '4e879d150709e670b2c7c90f0034c75c4ba30386', class: "Points" }, this.elevateGift.points, " "), h("span", { key: 'a7d28d964b41126a76f9988d0f4fc05653787066', class: " PointsLabel" }, translate('coins', this.language))))), h("div", { key: '14d2374d40825ac91b275fda81ca22d40f21c0be', class: 'ShopItemDetail Details' }, h("div", { key: '197bb9c0089173f8c4f180e115068f6204a6f7ea', class: "GiftPresentation" }, h("p", { key: '30be8dbec63f8f4d2bc3687d7e992d73c534a20f' }, this.elevateGift.presentation.description ? this.elevateGift.presentation.description : translate('noGiftPresentation', this.language))), h("div", { key: '7e0a9e4d03f338137649c9477a44c7036aea1609', class: `RedeemButton ${this.elevateGift.available === 'false' || this.isRedeeming ? 'Disabled' : ''}
342
+ ${this.deviceType == 'dk' ? 'DkButton' : ''}`, onClick: this.redeemGiftConfirm.bind(this) }, translate('redeem', this.language)), h("span", { key: '89b70f02565437ed28b175c65d0767354b6c9d6b', class: 'RedeemError Error' }, " ", this.redeemErrorMsg, " "))))));
343
+ }
366
344
  };
367
- BonusElevateShopItem.style = bonusElevateShopItemCss;
345
+ BonusElevateShopItem.style = BonusElevateShopItemStyle0;
368
346
 
369
347
  const mergeTranslations = (url, target) => {
370
- return new Promise((resolve) => {
371
- fetch(url)
372
- .then((res) => res.json())
373
- .then((data) => {
374
- Object.keys(data).forEach((item) => {
375
- target[item] = target[item] ? target[item] : {};
376
- for (let key in data[item]) {
377
- target[item][key] = data[item][key];
378
- }
379
- });
380
- resolve(true);
348
+ return new Promise((resolve) => {
349
+ fetch(url)
350
+ .then((res) => res.json())
351
+ .then((data) => {
352
+ Object.keys(data).forEach((item) => {
353
+ target[item] = target[item] ? target[item] : {};
354
+ for (let key in data[item]) {
355
+ target[item][key] = data[item][key];
356
+ }
357
+ });
358
+ resolve(true);
359
+ });
381
360
  });
382
- });
383
361
  };
384
362
 
385
363
  const generalStylingWrapperCss = ":host{display:block}";
364
+ const GeneralStylingWrapperStyle0 = generalStylingWrapperCss;
386
365
 
387
366
  const GeneralStylingWrapper = class {
388
- constructor(hostRef) {
389
- registerInstance(this, hostRef);
390
- /**
391
- * Client custom styling via inline styles
392
- */
393
- this.clientStyling = '';
394
- /**
395
- * Client custom styling via url
396
- */
397
- this.clientStylingUrl = '';
398
- /**
399
- * Translation via url
400
- */
401
- this.translationUrl = '';
402
- this.stylingAppends = false;
403
- this.setClientStyling = () => {
404
- let sheet = document.createElement('style');
405
- sheet.innerHTML = this.clientStyling;
406
- this.el.prepend(sheet);
407
- };
408
- this.setClientStylingURL = () => {
409
- let url = new URL(this.clientStylingUrl);
410
- let cssFile = document.createElement('style');
411
- fetch(url.href)
412
- .then((res) => res.text())
413
- .then((data) => {
414
- cssFile.innerHTML = data;
415
- setTimeout(() => {
416
- this.el.prepend(cssFile);
417
- }, 1);
418
- })
419
- .catch((err) => {
420
- console.log('error ', err);
421
- });
422
- };
423
- }
424
- componentDidRender() {
425
- // start custom styling area
426
- if (!this.stylingAppends) {
427
- if (this.clientStyling)
428
- this.setClientStyling();
429
- if (this.clientStylingUrl)
430
- this.setClientStylingURL();
431
- this.stylingAppends = true;
432
- }
433
- // end custom styling area
434
- }
435
- async componentWillLoad() {
436
- const promises = [];
437
- if (this.translationUrl) {
438
- const translationPromise = mergeTranslations(this.translationUrl, this.targetTranslations);
439
- promises.push(translationPromise);
440
- }
441
- return await Promise.all(promises);
442
- }
443
- render() {
444
- return (h("div", { class: "StyleShell" }, h("slot", { name: "mainContent" })));
445
- }
446
- get el() { return getElement(this); }
367
+ constructor(hostRef) {
368
+ registerInstance(this, hostRef);
369
+ this.stylingAppends = false;
370
+ this.setClientStyling = () => {
371
+ let sheet = document.createElement('style');
372
+ sheet.innerHTML = this.clientStyling;
373
+ this.el.prepend(sheet);
374
+ };
375
+ this.setClientStylingURL = () => {
376
+ let url = new URL(this.clientStylingUrl);
377
+ let cssFile = document.createElement('style');
378
+ fetch(url.href)
379
+ .then((res) => res.text())
380
+ .then((data) => {
381
+ cssFile.innerHTML = data;
382
+ setTimeout(() => {
383
+ this.el.prepend(cssFile);
384
+ }, 1);
385
+ })
386
+ .catch((err) => {
387
+ console.log('error ', err);
388
+ });
389
+ };
390
+ this.clientStyling = '';
391
+ this.clientStylingUrl = '';
392
+ this.translationUrl = '';
393
+ this.targetTranslations = undefined;
394
+ }
395
+ componentDidRender() {
396
+ // start custom styling area
397
+ if (!this.stylingAppends) {
398
+ if (this.clientStyling)
399
+ this.setClientStyling();
400
+ if (this.clientStylingUrl)
401
+ this.setClientStylingURL();
402
+ this.stylingAppends = true;
403
+ }
404
+ // end custom styling area
405
+ }
406
+ async componentWillLoad() {
407
+ const promises = [];
408
+ if (this.translationUrl) {
409
+ const translationPromise = mergeTranslations(this.translationUrl, this.targetTranslations);
410
+ promises.push(translationPromise);
411
+ }
412
+ return await Promise.all(promises);
413
+ }
414
+ render() {
415
+ return (h("div", { key: '4d3414408c7662f88331dbe655966237f74d6958', class: "StyleShell" }, h("slot", { key: '1d004644d84602c4314bdf5dfc26b55b160f57df', name: "mainContent" })));
416
+ }
417
+ get el() { return getElement(this); }
447
418
  };
448
- GeneralStylingWrapper.style = generalStylingWrapperCss;
419
+ GeneralStylingWrapper.style = GeneralStylingWrapperStyle0;
449
420
 
450
421
  export { BonusElevateShopAssetsSlider as bonus_elevate_shop_assets_slider, BonusElevateShopItem as bonus_elevate_shop_item, GeneralStylingWrapper as general_styling_wrapper };