@everymatrix/player-elevate-level 1.44.0 → 1.45.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/bonus-elevate-levels_8.cjs.entry.js +644 -674
- package/dist/cjs/index-91eb0bf0.js +1682 -0
- package/dist/cjs/loader.cjs.js +7 -13
- package/dist/cjs/{player-elevate-card-items-9e7a9a23.js → player-elevate-card-items-ae20c19f.js} +171 -285
- package/dist/cjs/player-elevate-card.cjs.entry.js +59 -70
- package/dist/cjs/player-elevate-level.cjs.js +17 -11
- package/dist/cjs/player-elevate-pointcard.cjs.entry.js +61 -77
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/components/player-elevate-level/index.js +1 -0
- package/dist/collection/components/player-elevate-level/player-elevate-level.js +208 -209
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/bonus-elevate-levels_8.entry.js +644 -674
- package/dist/esm/index-32ed7fbd.js +1651 -0
- package/dist/esm/loader.js +7 -13
- package/dist/esm/{player-elevate-card-items-08ee8fab.js → player-elevate-card-items-2eccd763.js} +172 -285
- package/dist/esm/player-elevate-card.entry.js +59 -70
- package/dist/esm/player-elevate-level.js +14 -11
- package/dist/esm/player-elevate-pointcard.entry.js +61 -77
- package/dist/player-elevate-level/p-5f93600c.entry.js +1 -0
- package/dist/player-elevate-level/p-6d39391e.js +2 -0
- package/dist/player-elevate-level/p-73e5a291.entry.js +1 -0
- package/dist/player-elevate-level/p-a622755e.js +1 -0
- package/dist/player-elevate-level/p-acd808d7.entry.js +1 -0
- package/dist/player-elevate-level/p-e1255160.js +1 -0
- package/dist/player-elevate-level/player-elevate-level.esm.js +1 -1
- package/dist/stencil.config.dev.js +17 -0
- package/dist/stencil.config.js +14 -22
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/player-elevate-level/.stencil/packages/stencil/player-elevate-level/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/player-elevate-level/.stencil/packages/stencil/player-elevate-level/stencil.config.dev.d.ts +2 -0
- package/dist/types/components/player-elevate-level/index.d.ts +1 -0
- package/dist/types/components/player-elevate-level/player-elevate-level.d.ts +41 -41
- package/dist/types/stencil-public-runtime.d.ts +142 -33
- package/loader/cdn.js +1 -3
- package/loader/index.cjs.js +1 -3
- package/loader/index.d.ts +13 -1
- package/loader/index.es2017.js +1 -3
- package/loader/index.js +1 -3
- package/loader/package.json +1 -0
- package/package.json +12 -6
- package/dist/cjs/index-c706b0d2.js +0 -1726
- package/dist/components/bonus-elevate-levels.js +0 -6
- package/dist/components/bonus-elevate-levels2.js +0 -138
- package/dist/components/elevate-level-list.js +0 -6
- package/dist/components/elevate-level-list2.js +0 -198
- package/dist/components/elevate-level-presentation.js +0 -6
- package/dist/components/elevate-level-presentation2.js +0 -31
- package/dist/components/elevate-levels-data.js +0 -6
- package/dist/components/elevate-levels-data2.js +0 -102
- package/dist/components/general-styling-wrapper.js +0 -6
- package/dist/components/general-styling-wrapper2.js +0 -103
- package/dist/components/index.d.ts +0 -26
- package/dist/components/index.js +0 -1
- package/dist/components/player-elevate-card-data.js +0 -6
- package/dist/components/player-elevate-card-data2.js +0 -635
- package/dist/components/player-elevate-card-items.js +0 -2250
- package/dist/components/player-elevate-card.js +0 -126
- package/dist/components/player-elevate-level.d.ts +0 -11
- package/dist/components/player-elevate-level.js +0 -107
- package/dist/components/player-elevate-loyaltycard.js +0 -6
- package/dist/components/player-elevate-loyaltycard2.js +0 -129
- package/dist/components/player-elevate-pointcard.js +0 -135
- package/dist/esm/index-104132db.js +0 -1696
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/player-elevate-level/p-04a5ef33.entry.js +0 -1
- package/dist/player-elevate-level/p-46fd6f51.js +0 -1
- package/dist/player-elevate-level/p-6766466f.js +0 -1
- package/dist/player-elevate-level/p-d5d234f8.entry.js +0 -1
- package/dist/player-elevate-level/p-d8ae2452.entry.js +0 -1
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/player-elevate-level/.stencil/packages/player-elevate-level/stencil.config.d.ts +0 -2
|
@@ -1,635 +0,0 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, createEvent } from '@stencil/core/internal/client';
|
|
2
|
-
|
|
3
|
-
const DEFAULT_LANGUAGE = 'en';
|
|
4
|
-
const SUPPORTED_LANGUAGES = ['ro', 'en'];
|
|
5
|
-
const TRANSLATIONS = {
|
|
6
|
-
en: {
|
|
7
|
-
redeem: 'Redeem',
|
|
8
|
-
expireOn: 'Expire on ',
|
|
9
|
-
pointsToBeExpired: '${expirationPoints} points to expire in ${expireDay} days',
|
|
10
|
-
pointsToBeExpiredDay: '${expirationPoints} points to expire in ${expireDay} day',
|
|
11
|
-
pointsToBeExpiredHours: '${expirationPoints} points to expire in ${expireDay} hours',
|
|
12
|
-
pointsToBeExpiredHour: '${expirationPoints} points to expire in ${expireDay} hour',
|
|
13
|
-
tipsForNextLevel: 'Need ${pointsToReach} to reach ${levelName}',
|
|
14
|
-
spendablePoints: 'Spendable Points:',
|
|
15
|
-
details: 'Details',
|
|
16
|
-
earningRules: 'Earning Rules',
|
|
17
|
-
xp: 'XP',
|
|
18
|
-
sp: 'Coins',
|
|
19
|
-
termAndConditions: 'Term & Conditions',
|
|
20
|
-
},
|
|
21
|
-
'zh-hk': {
|
|
22
|
-
redeem: '兑奖',
|
|
23
|
-
expireOn: 'Expire on ',
|
|
24
|
-
pointsToBeExpired: '${expirationPoints} points to expire in ${expireDay} days',
|
|
25
|
-
pointsToBeExpiredDay: '${expirationPoints} points to expire in ${expireDay} day',
|
|
26
|
-
pointsToBeExpiredHours: '${expirationPoints} points to expire in ${expireDay} hours',
|
|
27
|
-
pointsToBeExpiredHour: '${expirationPoints} points to expire in ${expireDay} hour',
|
|
28
|
-
tipsForNextLevel: 'Need ${pointsToReach} to reach ${levelName}',
|
|
29
|
-
spendablePoints: 'Spendable Points:',
|
|
30
|
-
details: '明细',
|
|
31
|
-
earningRules: 'Earning Rules',
|
|
32
|
-
xp: 'XP',
|
|
33
|
-
sp: 'Coins',
|
|
34
|
-
termAndConditions: 'Term & Conditions',
|
|
35
|
-
},
|
|
36
|
-
de: {
|
|
37
|
-
redeem: 'Redeem',
|
|
38
|
-
expireOn: 'Expire on ',
|
|
39
|
-
pointsToBeExpired: '${expirationPoints} points to expire in ${expireDay} days',
|
|
40
|
-
pointsToBeExpiredDay: '${expirationPoints} points to expire in ${expireDay} day',
|
|
41
|
-
pointsToBeExpiredHours: '${expirationPoints} points to expire in ${expireDay} hours',
|
|
42
|
-
pointsToBeExpiredHour: '${expirationPoints} points to expire in ${expireDay} hour',
|
|
43
|
-
tipsForNextLevel: 'Need ${pointsToReach} to reach ${levelName}',
|
|
44
|
-
spendablePoints: 'Spendable Points:',
|
|
45
|
-
details: 'Details',
|
|
46
|
-
earningRules: 'Earning Rules',
|
|
47
|
-
xp: 'XP',
|
|
48
|
-
sp: 'Coins',
|
|
49
|
-
termAndConditions: 'Term & Conditions',
|
|
50
|
-
},
|
|
51
|
-
it: {
|
|
52
|
-
redeem: 'Redeem',
|
|
53
|
-
expireOn: 'Expire on ',
|
|
54
|
-
pointsToBeExpired: '${expirationPoints} points to expire in ${expireDay} days',
|
|
55
|
-
pointsToBeExpiredDay: '${expirationPoints} points to expire in ${expireDay} day',
|
|
56
|
-
pointsToBeExpiredHours: '${expirationPoints} points to expire in ${expireDay} hours',
|
|
57
|
-
pointsToBeExpiredHour: '${expirationPoints} points to expire in ${expireDay} hour',
|
|
58
|
-
tipsForNextLevel: 'Need ${pointsToReach} to reach ${levelName}',
|
|
59
|
-
spendablePoints: 'Spendable Points:',
|
|
60
|
-
details: 'Details',
|
|
61
|
-
earningRules: 'Earning Rules',
|
|
62
|
-
xp: 'XP',
|
|
63
|
-
sp: 'Coins',
|
|
64
|
-
termAndConditions: 'Term & Conditions',
|
|
65
|
-
},
|
|
66
|
-
fr: {
|
|
67
|
-
redeem: 'Redeem',
|
|
68
|
-
expireOn: 'Expire on ',
|
|
69
|
-
pointsToBeExpired: '${expirationPoints} points to expire in ${expireDay} days',
|
|
70
|
-
pointsToBeExpiredDay: '${expirationPoints} points to expire in ${expireDay} day',
|
|
71
|
-
pointsToBeExpiredHours: '${expirationPoints} points to expire in ${expireDay} hours',
|
|
72
|
-
pointsToBeExpiredHour: '${expirationPoints} points to expire in ${expireDay} hour',
|
|
73
|
-
tipsForNextLevel: 'Need ${pointsToReach} to reach ${levelName}',
|
|
74
|
-
spendablePoints: 'Spendable Points:',
|
|
75
|
-
details: 'Details',
|
|
76
|
-
earningRules: 'Earning Rules',
|
|
77
|
-
xp: 'XP',
|
|
78
|
-
sp: 'Coins',
|
|
79
|
-
termAndConditions: 'Term & Conditions',
|
|
80
|
-
},
|
|
81
|
-
es: {
|
|
82
|
-
redeem: 'Redeem'
|
|
83
|
-
},
|
|
84
|
-
tr: {
|
|
85
|
-
redeem: 'Redeem'
|
|
86
|
-
},
|
|
87
|
-
ru: {
|
|
88
|
-
redeem: 'Redeem'
|
|
89
|
-
},
|
|
90
|
-
ro: {
|
|
91
|
-
redeem: 'Redeem'
|
|
92
|
-
},
|
|
93
|
-
hr: {
|
|
94
|
-
redeem: 'Otkupiti',
|
|
95
|
-
expireOn: 'Istječe',
|
|
96
|
-
pointsToBeExpired: '${expirationPoints} bodova ističe za ${expireDay} dana',
|
|
97
|
-
tipsForNextLevel: 'Trebate ${pointsToReach} da dosegnete razinu ${levelName}',
|
|
98
|
-
spendablePoints: 'Bodovi za potrošit:',
|
|
99
|
-
details: 'Detalji',
|
|
100
|
-
xp: 'XP',
|
|
101
|
-
},
|
|
102
|
-
hu: {
|
|
103
|
-
redeem: 'Redeem'
|
|
104
|
-
},
|
|
105
|
-
pl: {
|
|
106
|
-
redeem: 'Redeem'
|
|
107
|
-
},
|
|
108
|
-
pt: {
|
|
109
|
-
redeem: 'Redeem'
|
|
110
|
-
},
|
|
111
|
-
sl: {
|
|
112
|
-
redeem: 'Redeem'
|
|
113
|
-
},
|
|
114
|
-
sr: {
|
|
115
|
-
redeem: 'Redeem'
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
const translate = (key, customLang) => {
|
|
119
|
-
const lang = customLang;
|
|
120
|
-
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
121
|
-
};
|
|
122
|
-
const translateWithParams = (key, params) => {
|
|
123
|
-
const lang = params['lang'];
|
|
124
|
-
let templateString = TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
125
|
-
if (!params) {
|
|
126
|
-
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
127
|
-
}
|
|
128
|
-
Object.keys(params).forEach((paramName) => {
|
|
129
|
-
templateString = templateString.replace(new RegExp('\\$\{' + paramName + '\}', 'gm'), params[paramName]);
|
|
130
|
-
});
|
|
131
|
-
return templateString;
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
function _typeof(o) {
|
|
135
|
-
"@babel/helpers - typeof";
|
|
136
|
-
|
|
137
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
138
|
-
return typeof o;
|
|
139
|
-
} : function (o) {
|
|
140
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
141
|
-
}, _typeof(o);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
function requiredArgs(required, args) {
|
|
145
|
-
if (args.length < required) {
|
|
146
|
-
throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* @name toDate
|
|
152
|
-
* @category Common Helpers
|
|
153
|
-
* @summary Convert the given argument to an instance of Date.
|
|
154
|
-
*
|
|
155
|
-
* @description
|
|
156
|
-
* Convert the given argument to an instance of Date.
|
|
157
|
-
*
|
|
158
|
-
* If the argument is an instance of Date, the function returns its clone.
|
|
159
|
-
*
|
|
160
|
-
* If the argument is a number, it is treated as a timestamp.
|
|
161
|
-
*
|
|
162
|
-
* If the argument is none of the above, the function returns Invalid Date.
|
|
163
|
-
*
|
|
164
|
-
* **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
|
|
165
|
-
*
|
|
166
|
-
* @param {Date|Number} argument - the value to convert
|
|
167
|
-
* @returns {Date} the parsed date in the local time zone
|
|
168
|
-
* @throws {TypeError} 1 argument required
|
|
169
|
-
*
|
|
170
|
-
* @example
|
|
171
|
-
* // Clone the date:
|
|
172
|
-
* const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
|
|
173
|
-
* //=> Tue Feb 11 2014 11:30:30
|
|
174
|
-
*
|
|
175
|
-
* @example
|
|
176
|
-
* // Convert the timestamp to date:
|
|
177
|
-
* const result = toDate(1392098430000)
|
|
178
|
-
* //=> Tue Feb 11 2014 11:30:30
|
|
179
|
-
*/
|
|
180
|
-
function toDate(argument) {
|
|
181
|
-
requiredArgs(1, arguments);
|
|
182
|
-
var argStr = Object.prototype.toString.call(argument);
|
|
183
|
-
|
|
184
|
-
// Clone the date
|
|
185
|
-
if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
|
|
186
|
-
// Prevent the date to lose the milliseconds when passed to new Date() in IE10
|
|
187
|
-
return new Date(argument.getTime());
|
|
188
|
-
} else if (typeof argument === 'number' || argStr === '[object Number]') {
|
|
189
|
-
return new Date(argument);
|
|
190
|
-
} else {
|
|
191
|
-
if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
|
|
192
|
-
// eslint-disable-next-line no-console
|
|
193
|
-
console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
|
|
194
|
-
// eslint-disable-next-line no-console
|
|
195
|
-
console.warn(new Error().stack);
|
|
196
|
-
}
|
|
197
|
-
return new Date(NaN);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
|
|
203
|
-
* They usually appear for dates that denote time before the timezones were introduced
|
|
204
|
-
* (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
|
|
205
|
-
* and GMT+01:00:00 after that date)
|
|
206
|
-
*
|
|
207
|
-
* Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
|
|
208
|
-
* which would lead to incorrect calculations.
|
|
209
|
-
*
|
|
210
|
-
* This function returns the timezone offset in milliseconds that takes seconds in account.
|
|
211
|
-
*/
|
|
212
|
-
function getTimezoneOffsetInMilliseconds(date) {
|
|
213
|
-
var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
|
|
214
|
-
utcDate.setUTCFullYear(date.getFullYear());
|
|
215
|
-
return date.getTime() - utcDate.getTime();
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* @name startOfDay
|
|
220
|
-
* @category Day Helpers
|
|
221
|
-
* @summary Return the start of a day for the given date.
|
|
222
|
-
*
|
|
223
|
-
* @description
|
|
224
|
-
* Return the start of a day for the given date.
|
|
225
|
-
* The result will be in the local timezone.
|
|
226
|
-
*
|
|
227
|
-
* @param {Date|Number} date - the original date
|
|
228
|
-
* @returns {Date} the start of a day
|
|
229
|
-
* @throws {TypeError} 1 argument required
|
|
230
|
-
*
|
|
231
|
-
* @example
|
|
232
|
-
* // The start of a day for 2 September 2014 11:55:00:
|
|
233
|
-
* const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
|
|
234
|
-
* //=> Tue Sep 02 2014 00:00:00
|
|
235
|
-
*/
|
|
236
|
-
function startOfDay(dirtyDate) {
|
|
237
|
-
requiredArgs(1, arguments);
|
|
238
|
-
var date = toDate(dirtyDate);
|
|
239
|
-
date.setHours(0, 0, 0, 0);
|
|
240
|
-
return date;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
var MILLISECONDS_IN_DAY = 86400000;
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* @name differenceInCalendarDays
|
|
247
|
-
* @category Day Helpers
|
|
248
|
-
* @summary Get the number of calendar days between the given dates.
|
|
249
|
-
*
|
|
250
|
-
* @description
|
|
251
|
-
* Get the number of calendar days between the given dates. This means that the times are removed
|
|
252
|
-
* from the dates and then the difference in days is calculated.
|
|
253
|
-
*
|
|
254
|
-
* @param {Date|Number} dateLeft - the later date
|
|
255
|
-
* @param {Date|Number} dateRight - the earlier date
|
|
256
|
-
* @returns {Number} the number of calendar days
|
|
257
|
-
* @throws {TypeError} 2 arguments required
|
|
258
|
-
*
|
|
259
|
-
* @example
|
|
260
|
-
* // How many calendar days are between
|
|
261
|
-
* // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
|
|
262
|
-
* const result = differenceInCalendarDays(
|
|
263
|
-
* new Date(2012, 6, 2, 0, 0),
|
|
264
|
-
* new Date(2011, 6, 2, 23, 0)
|
|
265
|
-
* )
|
|
266
|
-
* //=> 366
|
|
267
|
-
* // How many calendar days are between
|
|
268
|
-
* // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
|
|
269
|
-
* const result = differenceInCalendarDays(
|
|
270
|
-
* new Date(2011, 6, 3, 0, 1),
|
|
271
|
-
* new Date(2011, 6, 2, 23, 59)
|
|
272
|
-
* )
|
|
273
|
-
* //=> 1
|
|
274
|
-
*/
|
|
275
|
-
function differenceInCalendarDays(dirtyDateLeft, dirtyDateRight) {
|
|
276
|
-
requiredArgs(2, arguments);
|
|
277
|
-
var startOfDayLeft = startOfDay(dirtyDateLeft);
|
|
278
|
-
var startOfDayRight = startOfDay(dirtyDateRight);
|
|
279
|
-
var timestampLeft = startOfDayLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfDayLeft);
|
|
280
|
-
var timestampRight = startOfDayRight.getTime() - getTimezoneOffsetInMilliseconds(startOfDayRight);
|
|
281
|
-
|
|
282
|
-
// Round the number of days to the nearest integer
|
|
283
|
-
// because the number of milliseconds in a day is not constant
|
|
284
|
-
// (e.g. it's different in the day of the daylight saving time clock shift)
|
|
285
|
-
return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY);
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* Days in 1 week.
|
|
290
|
-
*
|
|
291
|
-
* @name daysInWeek
|
|
292
|
-
* @constant
|
|
293
|
-
* @type {number}
|
|
294
|
-
* @default
|
|
295
|
-
*/
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
* Milliseconds in 1 hour
|
|
299
|
-
*
|
|
300
|
-
* @name millisecondsInHour
|
|
301
|
-
* @constant
|
|
302
|
-
* @type {number}
|
|
303
|
-
* @default
|
|
304
|
-
*/
|
|
305
|
-
var millisecondsInHour = 3600000;
|
|
306
|
-
|
|
307
|
-
/**
|
|
308
|
-
* @name differenceInMilliseconds
|
|
309
|
-
* @category Millisecond Helpers
|
|
310
|
-
* @summary Get the number of milliseconds between the given dates.
|
|
311
|
-
*
|
|
312
|
-
* @description
|
|
313
|
-
* Get the number of milliseconds between the given dates.
|
|
314
|
-
*
|
|
315
|
-
* @param {Date|Number} dateLeft - the later date
|
|
316
|
-
* @param {Date|Number} dateRight - the earlier date
|
|
317
|
-
* @returns {Number} the number of milliseconds
|
|
318
|
-
* @throws {TypeError} 2 arguments required
|
|
319
|
-
*
|
|
320
|
-
* @example
|
|
321
|
-
* // How many milliseconds are between
|
|
322
|
-
* // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?
|
|
323
|
-
* const result = differenceInMilliseconds(
|
|
324
|
-
* new Date(2014, 6, 2, 12, 30, 21, 700),
|
|
325
|
-
* new Date(2014, 6, 2, 12, 30, 20, 600)
|
|
326
|
-
* )
|
|
327
|
-
* //=> 1100
|
|
328
|
-
*/
|
|
329
|
-
function differenceInMilliseconds(dateLeft, dateRight) {
|
|
330
|
-
requiredArgs(2, arguments);
|
|
331
|
-
return toDate(dateLeft).getTime() - toDate(dateRight).getTime();
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
var roundingMap = {
|
|
335
|
-
ceil: Math.ceil,
|
|
336
|
-
round: Math.round,
|
|
337
|
-
floor: Math.floor,
|
|
338
|
-
trunc: function trunc(value) {
|
|
339
|
-
return value < 0 ? Math.ceil(value) : Math.floor(value);
|
|
340
|
-
} // Math.trunc is not supported by IE
|
|
341
|
-
};
|
|
342
|
-
|
|
343
|
-
var defaultRoundingMethod = 'trunc';
|
|
344
|
-
function getRoundingMethod(method) {
|
|
345
|
-
return method ? roundingMap[method] : roundingMap[defaultRoundingMethod];
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
/**
|
|
349
|
-
* @name differenceInHours
|
|
350
|
-
* @category Hour Helpers
|
|
351
|
-
* @summary Get the number of hours between the given dates.
|
|
352
|
-
*
|
|
353
|
-
* @description
|
|
354
|
-
* Get the number of hours between the given dates.
|
|
355
|
-
*
|
|
356
|
-
* @param {Date|Number} dateLeft - the later date
|
|
357
|
-
* @param {Date|Number} dateRight - the earlier date
|
|
358
|
-
* @param {Object} [options] - an object with options.
|
|
359
|
-
* @param {String} [options.roundingMethod='trunc'] - a rounding method (`ceil`, `floor`, `round` or `trunc`)
|
|
360
|
-
* @returns {Number} the number of hours
|
|
361
|
-
* @throws {TypeError} 2 arguments required
|
|
362
|
-
*
|
|
363
|
-
* @example
|
|
364
|
-
* // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00?
|
|
365
|
-
* const result = differenceInHours(
|
|
366
|
-
* new Date(2014, 6, 2, 19, 0),
|
|
367
|
-
* new Date(2014, 6, 2, 6, 50)
|
|
368
|
-
* )
|
|
369
|
-
* //=> 12
|
|
370
|
-
*/
|
|
371
|
-
function differenceInHours(dateLeft, dateRight, options) {
|
|
372
|
-
requiredArgs(2, arguments);
|
|
373
|
-
var diff = differenceInMilliseconds(dateLeft, dateRight) / millisecondsInHour;
|
|
374
|
-
return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
/**
|
|
378
|
-
* @name isBefore
|
|
379
|
-
* @category Common Helpers
|
|
380
|
-
* @summary Is the first date before the second one?
|
|
381
|
-
*
|
|
382
|
-
* @description
|
|
383
|
-
* Is the first date before the second one?
|
|
384
|
-
*
|
|
385
|
-
* @param {Date|Number} date - the date that should be before the other one to return true
|
|
386
|
-
* @param {Date|Number} dateToCompare - the date to compare with
|
|
387
|
-
* @returns {Boolean} the first date is before the second date
|
|
388
|
-
* @throws {TypeError} 2 arguments required
|
|
389
|
-
*
|
|
390
|
-
* @example
|
|
391
|
-
* // Is 10 July 1989 before 11 February 1987?
|
|
392
|
-
* const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))
|
|
393
|
-
* //=> false
|
|
394
|
-
*/
|
|
395
|
-
function isBefore(dirtyDate, dirtyDateToCompare) {
|
|
396
|
-
requiredArgs(2, arguments);
|
|
397
|
-
var date = toDate(dirtyDate);
|
|
398
|
-
var dateToCompare = toDate(dirtyDateToCompare);
|
|
399
|
-
return date.getTime() < dateToCompare.getTime();
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
function updateProgressSvg(progressElementRef, percent) {
|
|
403
|
-
const svgElement = progressElementRef.querySelector('#total_level');
|
|
404
|
-
const endLockWidth = 17, pointR = 6.5;
|
|
405
|
-
//Total Widget of the progress
|
|
406
|
-
const barWidth = svgElement.getBBox().width;
|
|
407
|
-
//The filled width according to current progress
|
|
408
|
-
const levelPercent = percent > 1 ? 1 : percent;
|
|
409
|
-
const widthOnBar = (levelPercent * barWidth - endLockWidth) < 0 ? 0 : levelPercent * barWidth - endLockWidth;
|
|
410
|
-
//update bar's width, widthOnBar
|
|
411
|
-
const levelBar = progressElementRef.querySelector('#current_level');
|
|
412
|
-
//update filters, x = widthOnBar
|
|
413
|
-
const levelFilter = progressElementRef.querySelector('#filter_current_level');
|
|
414
|
-
//update circle, widthOnBar+10
|
|
415
|
-
const levelCircle = progressElementRef.querySelector('#circle_current_level');
|
|
416
|
-
svgElement.setAttribute('viewbox', `0 0 ${widthOnBar} 28`);
|
|
417
|
-
levelBar.setAttribute('width', `${widthOnBar}`);
|
|
418
|
-
levelCircle.setAttribute('cx', `${(widthOnBar < pointR ? pointR : widthOnBar)}`);
|
|
419
|
-
levelFilter.setAttribute('x', `${widthOnBar - 8}`);
|
|
420
|
-
//update lock location
|
|
421
|
-
const endLockElement = progressElementRef.querySelector('#lock');
|
|
422
|
-
// wrapper of endLock, include ball and heatfilter1_d_305_23
|
|
423
|
-
const filter1 = progressElementRef.querySelector('#filter_heart_ball');
|
|
424
|
-
// ball in endlockfilter2_i_305_23
|
|
425
|
-
const filter2 = progressElementRef.querySelector('#filter_ball');
|
|
426
|
-
// heart in endlockfilter3_d_305_23
|
|
427
|
-
const filter3 = progressElementRef.querySelector('#filter_heart');
|
|
428
|
-
//wrapper of lockfilter4_d_305_23
|
|
429
|
-
const filterLock = progressElementRef.querySelector('#filter_lock');
|
|
430
|
-
// shadow of ball paint0_linear_305_23
|
|
431
|
-
const paint0 = progressElementRef.querySelector('#paint0_linear_ball');
|
|
432
|
-
//paint in lockpaint1_linear_305_23
|
|
433
|
-
const paint1 = progressElementRef.querySelector('#paint1_linear_lock');
|
|
434
|
-
// box of lock and heart, for move position dynamically
|
|
435
|
-
const lockBox = progressElementRef.querySelector('#lock_box');
|
|
436
|
-
const heartBox = progressElementRef.querySelector('#heart_box');
|
|
437
|
-
const rightPaddingOfLockWidth = 10, cxOfEndLockEle = barWidth - rightPaddingOfLockWidth;
|
|
438
|
-
//set cx of lockElement
|
|
439
|
-
endLockElement.setAttribute('cx', `${cxOfEndLockEle}`);
|
|
440
|
-
//set cx of sub Elements
|
|
441
|
-
paint1.setAttribute('x1', `${cxOfEndLockEle}`);
|
|
442
|
-
paint1.setAttribute('x2', `${cxOfEndLockEle}`);
|
|
443
|
-
paint0.setAttribute('x1', `${cxOfEndLockEle - 6}`);
|
|
444
|
-
paint0.setAttribute('x2', `${cxOfEndLockEle - 6 + 11.2}`);
|
|
445
|
-
filterLock.setAttribute('x', `${cxOfEndLockEle - 6}`);
|
|
446
|
-
filter3.setAttribute('x', `${cxOfEndLockEle - 6 - 2}`);
|
|
447
|
-
filter2.setAttribute('x', `${cxOfEndLockEle - 6 - 2 - 2}`);
|
|
448
|
-
filter1.setAttribute('x', `${cxOfEndLockEle - 6 - 2 - 2 - 4}`);
|
|
449
|
-
lockBox.setAttribute('x', `${cxOfEndLockEle - 6}`);
|
|
450
|
-
heartBox.setAttribute('x', `${cxOfEndLockEle - 6}`);
|
|
451
|
-
svgElement.parentElement.style.opacity = '1';
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
const playerElevateCardDataCss = ":host {\n display: block;\n width: 360px;\n height: 230px;\n}\n\n.ElevateCardWrapper {\n contain: layout inline-size;\n width: 100%;\n height: fit-content;\n min-height: 218px;\n}\n\n.Outer {\n container-type: inline-size;\n font-size: 12px;\n background-size: cover;\n background-repeat: no-repeat;\n line-height: initial;\n width: 100%;\n height: 100%;\n}\n\n.Dark {\n color: var(--emfe-w-color-gray150, #efefef);\n}\n\n.Light {\n color: var(--emfe-w-color-black, #0e0e0e);\n}\n\n@container (min-width: 381px) {\n .Outer {\n background-size: cover;\n }\n .Outer .OuterCover {\n min-height: 190px;\n }\n}\n@container (min-width: 260px) {\n .Outer {\n background-size: contain;\n }\n}\n.OuterCover {\n width: 100%;\n height: 100%;\n content: \"\";\n background-repeat: no-repeat;\n background-size: cover;\n border-radius: 15px;\n}\n\n.Inner {\n display: flex;\n flex-direction: column;\n min-height: 158px;\n}\n.Inner .Content {\n padding: 15px;\n flex-wrap: wrap;\n gap: 8px;\n}\n.Inner .Row {\n display: flex;\n flex-direction: row;\n}\n.Inner .CardCell {\n display: flex;\n}\n.Inner .LevelProgress svg {\n transition: opacity 0.4s;\n}\n.Inner .LevelInfo {\n display: flex;\n flex-direction: column;\n}\n.Inner .LevelInfo .ElevateLevel .LevelName {\n height: 28px;\n border-radius: 5px;\n line-height: 28px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.Inner .LevelInfo.Level0 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level0button-shadow, rgba(191, 84, 6, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level0-bg0, #E2792C) 0%, var(--emfe-w-elevate-color-level0-bg1, rgba(242, 151, 99, 0)) 100%);\n}\n.Inner .LevelInfo.Level1 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level1button-shadow, rgba(151, 151, 151, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level1-bg0, #BEBFED) 0%, var(--emfe-w-elevate-color-level1-bg1, rgba(216, 217, 233, 0)) 100%);\n}\n.Inner .LevelInfo.Level2 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level2button-shadow, rgba(191, 120, 6, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level2-bg0, #FCC410) 0%, var(--emfe-w-elevate-color-level2-bg1, rgba(255, 189, 43, 0)) 100%);\n}\n.Inner .LevelInfo.Level3 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level3button-shadow, rgba(65, 6, 191, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level3-bg0, #B1A2DB) 0%, var(--emfe-w-elevate-color-level3-bg1, rgba(203, 202, 245, 0)) 100%);\n}\n.Inner .LevelInfo.Level4 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level4button-shadow, rgba(65, 6, 191, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level4-bg0, #B1A2DB) 0%, var(--emfe-w-elevate-color-level4-bg1, rgba(203, 202, 245, 0)) 100%);\n}\n.Inner .LevelInfo .ElevateLevel {\n display: flex;\n}\n.Inner .LevelInfo {\n flex: 1;\n flex-grow: 1;\n min-width: 150px;\n}\n.Inner .PlayerImg {\n width: 29%;\n margin: auto;\n max-width: 100px;\n min-width: 30px;\n order: 0;\n}\n.Inner .PlayerAvatar {\n max-width: 100px;\n flex-basis: 100px;\n height: auto;\n margin: auto;\n padding-top: 10px;\n}\n.Inner .PlayerAvatar .Avatar, .Inner .PlayerAvatar .Badge {\n width: 100%;\n height: 100%;\n}\n.Inner .PlayerAvatar .Avatar {\n border-radius: 50%;\n background-size: contain;\n background-repeat: no-repeat;\n}\n.Inner .ElevateLevel .ExpirationDate {\n max-width: 138px;\n min-width: 118px;\n}\n.Inner .PlayerName, .Inner .RedeemButton, .Inner .ElevateLevel {\n text-transform: capitalize;\n width: 100%;\n}\n.Inner .PlayerName {\n font-size: 16px;\n}\n.Inner .Row .PointsInfo {\n display: table;\n font-weight: 600;\n}\n.Inner .Row .Redeem {\n justify-content: flex-end;\n margin-left: auto;\n}\n.Inner .Row .Redeem:hover {\n color: var(--emfe-w-elevate-color-redeem-hover, #00ABA4);\n cursor: pointer;\n}\n.Inner .Row .RedeemButton:hover span {\n color: var(emfe-w-elevate-color-redeem-text-hover, #f1f1f1);\n font-weight: bold;\n}\n.Inner .Row .RedeemButton {\n width: 95px;\n height: 35px;\n display: flex;\n align-items: center;\n border-radius: 10px;\n background: var(--emfe-w-elevate-color-redeem-bg, linear-gradient(0deg, #26CC37, #26CC37)), linear-gradient(117.99deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.89%), linear-gradient(283.85deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.47%), linear-gradient(268.18deg, rgba(255, 255, 255, 0.6) -17.36%, rgba(239, 239, 239, 0) 15.78%);\n box-shadow: 0px 4px 4px 0px #00000040;\n}\n.Inner .Row .RedeemButton span {\n color: var(--emfe-w-color-white, #fff);\n line-height: 18px;\n font-size: 15px;\n text-align: center;\n width: 100%;\n}\n.Inner .Row .Points {\n font-size: large;\n vertical-align: middle;\n}\n.Inner .Row .Points .XP {\n font-size: x-small;\n}\n.Inner .Row .ExpirationPoints {\n font-size: small;\n text-align: right;\n font-weight: bold;\n color: var(--emfe-w-color-red, #9e595f);\n}";
|
|
455
|
-
|
|
456
|
-
const PlayerElevateCardData = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
457
|
-
constructor() {
|
|
458
|
-
super();
|
|
459
|
-
this.__registerHost();
|
|
460
|
-
this.playerElevateLeveLoaded = createEvent(this, "playerElevateLeveLoaded", 7);
|
|
461
|
-
}
|
|
462
|
-
handleWindowResizs() {
|
|
463
|
-
this.initLevelProgressbar();
|
|
464
|
-
}
|
|
465
|
-
onParamsChanged() {
|
|
466
|
-
this.loadElevateInfo();
|
|
467
|
-
}
|
|
468
|
-
redeemGiftButtonHandler() {
|
|
469
|
-
this.loadElevateInfo();
|
|
470
|
-
}
|
|
471
|
-
onRedeemClick() {
|
|
472
|
-
window.postMessage({ type: 'BEERedeemClicked' }, window.location.href);
|
|
473
|
-
}
|
|
474
|
-
loadLevels() {
|
|
475
|
-
let url = new URL(`${this.params.endpoint}/v1/elevate/levels?language=${this.params.language}`);
|
|
476
|
-
return new Promise((resolve, reject) => {
|
|
477
|
-
return fetch(url.href, {
|
|
478
|
-
method: 'GET',
|
|
479
|
-
})
|
|
480
|
-
.then((res) => res.json())
|
|
481
|
-
.then((res) => {
|
|
482
|
-
this.levels = res.data;
|
|
483
|
-
resolve(true);
|
|
484
|
-
})
|
|
485
|
-
.catch((err) => {
|
|
486
|
-
reject(err);
|
|
487
|
-
});
|
|
488
|
-
});
|
|
489
|
-
}
|
|
490
|
-
calcuatePointsToBeExpired(walletTotalInfo) {
|
|
491
|
-
let pointExpireInfoAsString = '';
|
|
492
|
-
if (!walletTotalInfo || !walletTotalInfo.aboutToExpire ||
|
|
493
|
-
walletTotalInfo.aboutToExpire.length == 0 ||
|
|
494
|
-
walletTotalInfo.aboutToExpire[0].points <= 0) {
|
|
495
|
-
return pointExpireInfoAsString;
|
|
496
|
-
}
|
|
497
|
-
walletTotalInfo.aboutToExpire.sort((expire1, expire2) => {
|
|
498
|
-
return isBefore(new Date(expire1.expireTime), new Date(expire2.expireTime))
|
|
499
|
-
? -1
|
|
500
|
-
: 1;
|
|
501
|
-
});
|
|
502
|
-
const aboutToExpire = walletTotalInfo.aboutToExpire[0];
|
|
503
|
-
const daysToExpried = differenceInCalendarDays(new Date(aboutToExpire.expireTime), new Date());
|
|
504
|
-
let hoursToExpired = 0, expiredTranslationKey = daysToExpried === 0 ? 'pointsToBeExpiredDay' : 'pointsToBeExpired';
|
|
505
|
-
if (daysToExpried == 0) {
|
|
506
|
-
hoursToExpired = differenceInHours(new Date(aboutToExpire.expireTime), new Date());
|
|
507
|
-
expiredTranslationKey = hoursToExpired > 1 ? 'pointsToBeExpiredHours' : 'pointsToBeExpiredHour';
|
|
508
|
-
}
|
|
509
|
-
pointExpireInfoAsString = translateWithParams(expiredTranslationKey, {
|
|
510
|
-
expirationPoints: aboutToExpire.points,
|
|
511
|
-
expireDay: daysToExpried,
|
|
512
|
-
});
|
|
513
|
-
return pointExpireInfoAsString;
|
|
514
|
-
}
|
|
515
|
-
loadPlayerLevelInfo() {
|
|
516
|
-
let url = new URL(`${this.params.endpoint}/v1/elevate/playerInfo?language=${this.params.language}`);
|
|
517
|
-
return new Promise((resolve, reject) => {
|
|
518
|
-
return fetch(url.href, {
|
|
519
|
-
method: 'GET',
|
|
520
|
-
headers: {
|
|
521
|
-
'X-Sessionid': this.params.session,
|
|
522
|
-
'Content-Type': 'application/json',
|
|
523
|
-
},
|
|
524
|
-
})
|
|
525
|
-
.then((res) => res.json())
|
|
526
|
-
.then((res) => {
|
|
527
|
-
var _a, _b, _c;
|
|
528
|
-
if (!res.success) {
|
|
529
|
-
console.error('Exception when fetch user elevateinfo, ', res.errorCode, res.errorMessage);
|
|
530
|
-
reject(true);
|
|
531
|
-
return;
|
|
532
|
-
}
|
|
533
|
-
let playerElevateInfo = res.data;
|
|
534
|
-
this.playerElevateLevel = playerElevateInfo.level;
|
|
535
|
-
this.playerElevateLevel.name = this.playerElevateLevel.presentation.displayName || this.playerElevateLevel.name;
|
|
536
|
-
this.playerElevateLevel.spendablePoints = ((_a = playerElevateInfo.spendableWallet) === null || _a === void 0 ? void 0 : _a.total.points) || 0;
|
|
537
|
-
this.playerElevateLeveLoaded.emit({ elevateLevel: this.playerElevateLevel });
|
|
538
|
-
const spendableTotal = (_b = res.data.spendableWallet) === null || _b === void 0 ? void 0 : _b.total;
|
|
539
|
-
const loyaltyWalletTotal = (_c = res.data.loyaltyWallet) === null || _c === void 0 ? void 0 : _c.total;
|
|
540
|
-
this.playerElevateLeveLoaded.emit({
|
|
541
|
-
elevateLevelWalletTotal: spendableTotal,
|
|
542
|
-
loyaltyWalletTotal
|
|
543
|
-
});
|
|
544
|
-
let spExpireInfoAsString = this.calcuatePointsToBeExpired(spendableTotal);
|
|
545
|
-
let xpExpireInfoAsString = this.calcuatePointsToBeExpired(loyaltyWalletTotal);
|
|
546
|
-
if (spExpireInfoAsString || xpExpireInfoAsString) {
|
|
547
|
-
this.playerElevateLeveLoaded.emit({
|
|
548
|
-
pointExpireString: spExpireInfoAsString,
|
|
549
|
-
xpExpireString: xpExpireInfoAsString
|
|
550
|
-
});
|
|
551
|
-
}
|
|
552
|
-
resolve(this.playerElevateLevel);
|
|
553
|
-
})
|
|
554
|
-
.catch((err) => {
|
|
555
|
-
console.log('error ', err);
|
|
556
|
-
reject(true);
|
|
557
|
-
});
|
|
558
|
-
});
|
|
559
|
-
}
|
|
560
|
-
setLoyaltyProgress(percent) {
|
|
561
|
-
updateProgressSvg(this.loyaltyProgressEle, percent);
|
|
562
|
-
}
|
|
563
|
-
initLevelProgressbar() {
|
|
564
|
-
setTimeout(() => {
|
|
565
|
-
this.loyaltyProgressEle =
|
|
566
|
-
this.elevateCardRef.parentElement.querySelector('#LevelProgress');
|
|
567
|
-
if (!this.loyaltyProgressEle) {
|
|
568
|
-
return;
|
|
569
|
-
}
|
|
570
|
-
this.setLoyaltyProgress(!this.playerElevateLevel.nextLevel
|
|
571
|
-
? 1 : (this.playerElevateLevel.loyaltyPoints / this.playerElevateLevel.nextLevel.entryPoints));
|
|
572
|
-
this.params['playerElevateLevel'] = this.playerElevateLevel;
|
|
573
|
-
}, 80);
|
|
574
|
-
}
|
|
575
|
-
componentDidRender() {
|
|
576
|
-
this.initLevelProgressbar();
|
|
577
|
-
}
|
|
578
|
-
loadElevateInfo() {
|
|
579
|
-
if (!this.params.endpoint || !this.params.session) {
|
|
580
|
-
return;
|
|
581
|
-
}
|
|
582
|
-
const promises = [];
|
|
583
|
-
promises.push(this.loadPlayerLevelInfo());
|
|
584
|
-
if (this.params.calculateLevelFlag) {
|
|
585
|
-
promises.push(this.loadLevels());
|
|
586
|
-
}
|
|
587
|
-
Promise.all(promises).then((res) => {
|
|
588
|
-
console.log('elevate-init', res);
|
|
589
|
-
this.initLevelProgressbar();
|
|
590
|
-
if (!this.levels) {
|
|
591
|
-
return;
|
|
592
|
-
}
|
|
593
|
-
this.levels.sort((level1, level2) => {
|
|
594
|
-
return level1.firstEntryPoints > level2.firstEntryPoints ? 1 : -1;
|
|
595
|
-
});
|
|
596
|
-
const playerPoints = this.playerElevateLevel.loyaltyPoints;
|
|
597
|
-
let playerLevelNumber = 0;
|
|
598
|
-
this.levels.forEach((elevateLevel, idx) => {
|
|
599
|
-
if (playerPoints > elevateLevel.firstEntryPoints) {
|
|
600
|
-
playerLevelNumber = idx;
|
|
601
|
-
}
|
|
602
|
-
});
|
|
603
|
-
this.playerElevateLeveLoaded.emit({
|
|
604
|
-
calculatedLevelFlag: playerLevelNumber,
|
|
605
|
-
});
|
|
606
|
-
});
|
|
607
|
-
}
|
|
608
|
-
componentWillLoad() {
|
|
609
|
-
this.loadElevateInfo();
|
|
610
|
-
}
|
|
611
|
-
get elevateCardRef() { return this; }
|
|
612
|
-
static get watchers() { return {
|
|
613
|
-
"params": ["onParamsChanged"]
|
|
614
|
-
}; }
|
|
615
|
-
static get style() { return playerElevateCardDataCss; }
|
|
616
|
-
}, [0, "player-elevate-card-data", {
|
|
617
|
-
"params": [8],
|
|
618
|
-
"playerElevateLevel": [32],
|
|
619
|
-
"pointExpireString": [32]
|
|
620
|
-
}, [[9, "resize", "handleWindowResizs"], [8, "redeemGiftButton", "redeemGiftButtonHandler"]]]);
|
|
621
|
-
function defineCustomElement() {
|
|
622
|
-
if (typeof customElements === "undefined") {
|
|
623
|
-
return;
|
|
624
|
-
}
|
|
625
|
-
const components = ["player-elevate-card-data"];
|
|
626
|
-
components.forEach(tagName => { switch (tagName) {
|
|
627
|
-
case "player-elevate-card-data":
|
|
628
|
-
if (!customElements.get(tagName)) {
|
|
629
|
-
customElements.define(tagName, PlayerElevateCardData);
|
|
630
|
-
}
|
|
631
|
-
break;
|
|
632
|
-
} });
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
export { PlayerElevateCardData as P, TRANSLATIONS as T, _typeof as _, translate as a, translateWithParams as b, defineCustomElement as d, getTimezoneOffsetInMilliseconds as g, requiredArgs as r, toDate as t };
|