@everymatrix/casino-engagement-suite-jackpot-details 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/casino-engagement-suite-jackpot-details/casino-engagement-suite-jackpot-details.esm.js +1 -1
- package/dist/casino-engagement-suite-jackpot-details/p-33f229da.entry.js +1 -0
- package/dist/casino-engagement-suite-jackpot-details/p-be66309f.entry.js +1 -0
- package/dist/casino-engagement-suite-jackpot-details/p-c7ee604a.js +2 -0
- package/dist/casino-engagement-suite-jackpot-details/p-e1255160.js +1 -0
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/casino-engagement-suite-jackpot-details.cjs.entry.js +286 -284
- package/dist/cjs/casino-engagement-suite-jackpot-details.cjs.js +17 -11
- package/dist/cjs/casino-engagement-suite-progress-bar.cjs.entry.js +58 -75
- package/dist/cjs/index-d83151b6.js +1331 -0
- package/dist/cjs/loader.cjs.js +7 -13
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/components/casino-engagement-suite-jackpot-details/casino-engagement-suite-jackpot-details.css +95 -104
- package/dist/collection/components/casino-engagement-suite-jackpot-details/casino-engagement-suite-jackpot-details.js +476 -526
- package/dist/collection/components/casino-engagement-suite-jackpot-details/index.js +1 -0
- package/dist/collection/utils/index.js +3 -3
- package/dist/collection/utils/locale.utils.js +24 -22
- package/dist/collection/utils/utils.js +3 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/casino-engagement-suite-jackpot-details.entry.js +286 -284
- package/dist/esm/casino-engagement-suite-jackpot-details.js +14 -11
- package/dist/esm/casino-engagement-suite-progress-bar.entry.js +58 -75
- package/dist/esm/index-0237d1e2.js +1303 -0
- package/dist/esm/loader.js +7 -13
- package/dist/stencil.config.dev.js +17 -0
- package/dist/stencil.config.js +14 -19
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-engagement-suite-jackpot-details/.stencil/packages/stencil/casino-engagement-suite-jackpot-details/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-engagement-suite-jackpot-details/.stencil/packages/stencil/casino-engagement-suite-jackpot-details/stencil.config.dev.d.ts +2 -0
- package/dist/types/components/casino-engagement-suite-jackpot-details/casino-engagement-suite-jackpot-details.d.ts +89 -88
- package/dist/types/components/casino-engagement-suite-jackpot-details/index.d.ts +1 -0
- package/dist/types/components.d.ts +19 -2
- package/dist/types/models/index.d.ts +38 -37
- package/dist/types/stencil-public-runtime.d.ts +142 -33
- package/dist/types/utils/utils.d.ts +1 -0
- 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 -2
- package/dist/casino-engagement-suite-jackpot-details/p-0135e830.js +0 -1
- package/dist/casino-engagement-suite-jackpot-details/p-8fee813c.entry.js +0 -1
- package/dist/casino-engagement-suite-jackpot-details/p-b361748c.entry.js +0 -1
- package/dist/cjs/index-84a14c86.js +0 -1349
- package/dist/components/casino-engagement-suite-jackpot-details.d.ts +0 -11
- package/dist/components/casino-engagement-suite-jackpot-details.js +0 -439
- package/dist/components/casino-engagement-suite-progress-bar.js +0 -110
- package/dist/components/index.d.ts +0 -26
- package/dist/components/index.js +0 -1
- package/dist/esm/index-5707e619.js +0 -1322
- 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/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/casino-engagement-suite-jackpot-details/.stencil/packages/casino-engagement-suite-jackpot-details/stencil.config.d.ts +0 -2
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Components, JSX } from "../types/components";
|
|
2
|
-
|
|
3
|
-
interface CasinoEngagementSuiteJackpotDetails extends Components.CasinoEngagementSuiteJackpotDetails, HTMLElement {}
|
|
4
|
-
export const CasinoEngagementSuiteJackpotDetails: {
|
|
5
|
-
prototype: CasinoEngagementSuiteJackpotDetails;
|
|
6
|
-
new (): CasinoEngagementSuiteJackpotDetails;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Used to define this component and all nested components recursively.
|
|
10
|
-
*/
|
|
11
|
-
export const defineCustomElement: () => void;
|
|
@@ -1,439 +0,0 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
|
|
3
|
-
function _typeof(o) {
|
|
4
|
-
"@babel/helpers - typeof";
|
|
5
|
-
|
|
6
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
7
|
-
return typeof o;
|
|
8
|
-
} : function (o) {
|
|
9
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
10
|
-
}, _typeof(o);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function requiredArgs(required, args) {
|
|
14
|
-
if (args.length < required) {
|
|
15
|
-
throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @name toDate
|
|
21
|
-
* @category Common Helpers
|
|
22
|
-
* @summary Convert the given argument to an instance of Date.
|
|
23
|
-
*
|
|
24
|
-
* @description
|
|
25
|
-
* Convert the given argument to an instance of Date.
|
|
26
|
-
*
|
|
27
|
-
* If the argument is an instance of Date, the function returns its clone.
|
|
28
|
-
*
|
|
29
|
-
* If the argument is a number, it is treated as a timestamp.
|
|
30
|
-
*
|
|
31
|
-
* If the argument is none of the above, the function returns Invalid Date.
|
|
32
|
-
*
|
|
33
|
-
* **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
|
|
34
|
-
*
|
|
35
|
-
* @param {Date|Number} argument - the value to convert
|
|
36
|
-
* @returns {Date} the parsed date in the local time zone
|
|
37
|
-
* @throws {TypeError} 1 argument required
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* // Clone the date:
|
|
41
|
-
* const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
|
|
42
|
-
* //=> Tue Feb 11 2014 11:30:30
|
|
43
|
-
*
|
|
44
|
-
* @example
|
|
45
|
-
* // Convert the timestamp to date:
|
|
46
|
-
* const result = toDate(1392098430000)
|
|
47
|
-
* //=> Tue Feb 11 2014 11:30:30
|
|
48
|
-
*/
|
|
49
|
-
function toDate(argument) {
|
|
50
|
-
requiredArgs(1, arguments);
|
|
51
|
-
var argStr = Object.prototype.toString.call(argument);
|
|
52
|
-
|
|
53
|
-
// Clone the date
|
|
54
|
-
if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
|
|
55
|
-
// Prevent the date to lose the milliseconds when passed to new Date() in IE10
|
|
56
|
-
return new Date(argument.getTime());
|
|
57
|
-
} else if (typeof argument === 'number' || argStr === '[object Number]') {
|
|
58
|
-
return new Date(argument);
|
|
59
|
-
} else {
|
|
60
|
-
if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
|
|
61
|
-
// eslint-disable-next-line no-console
|
|
62
|
-
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");
|
|
63
|
-
// eslint-disable-next-line no-console
|
|
64
|
-
console.warn(new Error().stack);
|
|
65
|
-
}
|
|
66
|
-
return new Date(NaN);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* @name isBefore
|
|
72
|
-
* @category Common Helpers
|
|
73
|
-
* @summary Is the first date before the second one?
|
|
74
|
-
*
|
|
75
|
-
* @description
|
|
76
|
-
* Is the first date before the second one?
|
|
77
|
-
*
|
|
78
|
-
* @param {Date|Number} date - the date that should be before the other one to return true
|
|
79
|
-
* @param {Date|Number} dateToCompare - the date to compare with
|
|
80
|
-
* @returns {Boolean} the first date is before the second date
|
|
81
|
-
* @throws {TypeError} 2 arguments required
|
|
82
|
-
*
|
|
83
|
-
* @example
|
|
84
|
-
* // Is 10 July 1989 before 11 February 1987?
|
|
85
|
-
* const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))
|
|
86
|
-
* //=> false
|
|
87
|
-
*/
|
|
88
|
-
function isBefore(dirtyDate, dirtyDateToCompare) {
|
|
89
|
-
requiredArgs(2, arguments);
|
|
90
|
-
var date = toDate(dirtyDate);
|
|
91
|
-
var dateToCompare = toDate(dirtyDateToCompare);
|
|
92
|
-
return date.getTime() < dateToCompare.getTime();
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
const DEFAULT_LANGUAGE = 'en';
|
|
96
|
-
const SUPPORTED_LANGUAGES = ['en'];
|
|
97
|
-
const TRANSLATIONS = {
|
|
98
|
-
en: {
|
|
99
|
-
jackpots: 'Jackpots',
|
|
100
|
-
join: 'Join',
|
|
101
|
-
unjoin: 'Unjoin',
|
|
102
|
-
info: 'Info',
|
|
103
|
-
games: 'Games',
|
|
104
|
-
operatorContribution: 'Operator Contribution',
|
|
105
|
-
betContribution: 'Bet Contribution',
|
|
106
|
-
type: 'Type',
|
|
107
|
-
winningProbability: 'Winning Probability',
|
|
108
|
-
tc: 'Terms & Conditions',
|
|
109
|
-
jackpotIsWon: 'Jackpot is won!',
|
|
110
|
-
loadMore: 'Load More',
|
|
111
|
-
jackpotDetails: 'Jackpot Details',
|
|
112
|
-
minBet: 'Min Bet',
|
|
113
|
-
maxBet: 'Max Bet',
|
|
114
|
-
Suspended: 'Suspended',
|
|
115
|
-
Closed: 'Closed',
|
|
116
|
-
contributionTooltip: 'A % of the bet that will be contributed by the casino to the jackpot amount.'
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
const translate = (key, customLang) => {
|
|
120
|
-
const lang = customLang;
|
|
121
|
-
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
function formatBalance(amount, currency, maxAmount = 99999999) {
|
|
125
|
-
amount = Math.min(amount, maxAmount);
|
|
126
|
-
return `${currency} ${new Intl.NumberFormat('en', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
|
|
127
|
-
.format(amount)}`;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
const casinoEngagementSuiteJackpotDetailsCss = ":host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;touch-action:manipulation}button:focus{outline:none}button:not(:disabled){cursor:pointer}.PopupButton{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:var(--emw--color-typography, #1E1638);border-radius:99px;min-width:88px;min-height:32px;font-size:14px;font-weight:700;position:relative;font-family:\"Montserrat\", sans-serif}.PopupButton.Active{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.PopupButton.Active::before{content:\"\";position:absolute;inset:0;padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude;border-radius:99px}.PopupButton.Loading{opacity:0.5;pointer-events:none}.JackpotDetailsPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative}.JackpotDetailsPopup.Disabled .JackpotDetailsHeader{opacity:0.5}.JackpotDetailsPopup.Disabled .JackpotDetailsTabs{cursor:default;pointer-events:none}.JackpotDetailsPopup.Disabled .JackpotDescription,.JackpotDetailsPopup.Disabled .TermsAndConditions,.JackpotDetailsPopup.Disabled .JackpotInfoItem{color:var(--emw--color-primary, #8F8B9C)}.JackpotGamesListWrapper,.JackpotInfoTabContent{overflow-x:auto;scrollbar-gutter:stable}.JackpotGamesListWrapper::-webkit-scrollbar,.JackpotInfoTabContent::-webkit-scrollbar{width:3px;background:none}.JackpotGamesListWrapper::-webkit-scrollbar-thumb,.JackpotInfoTabContent::-webkit-scrollbar-thumb{border-radius:4px;background:var(--emw--color-gray-transparency-30, rgba(255, 255, 255, 0.3))}.JackpotDetailsNavigation{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.JackpotDetailsNavigation .JackpotIconButton{width:16px;height:16px;cursor:pointer;display:flex;justify-content:center;align-items:center}.JackpotDetailsNavigation .JackpotPopupName{color:var(--emw--color-gray-100, #BBB9C3);font-size:16px;font-weight:500;line-height:16px;display:none}.JackpotDetailsPopupContent{padding:8px 18px 18px;overflow:hidden;height:100%;display:flex;flex-direction:column}.JackpotDetailsHeader{display:flex;justify-content:space-between;align-items:center;gap:12px}.JackpotDetailsHeader .JackpotDetailsHeaderSecondCol{text-align:right}.JackpotDetailsHeader .JackpotType{text-transform:uppercase;font-family:\"Montserrat\", sans-serif;font-size:var(--emw--font-size-medium, 18px);font-weight:var(--emw--font-weight-bold, 700);line-height:22px;color:var(--emfe-w-color-white, #FFF);word-break:break-all}.JackpotDetailsHeader .JackpotBalance{margin-top:8px;font-family:Montserrat, sans-serif;font-size:18px;font-weight:var(--emw--font-weight-bold, 800);line-height:18px}.JackpotDetailsHeader .JackpotIsWon{margin-top:8px;font-family:Montserrat, sans-serif;font-weight:var(--emw--font-weight-bold, 700);font-size:12px;line-height:15px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-text-fill-color:transparent;-webkit-background-clip:text}.JackpotDetailsPopup.Mega .JackpotBalance{background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);-webkit-text-fill-color:transparent;-webkit-background-clip:text}.JackpotDetailsPopup.Major .JackpotBalance{background:linear-gradient(180deg, #A19FA0 5.36%, #E1DBDB 28.86%, #FEFFFF 36.86%, #E1DBDB 44.36%, #5E5B5F 91.86%);-webkit-text-fill-color:transparent;-webkit-background-clip:text}.JackpotDetailsPopup.Minor .JackpotBalance{background:linear-gradient(180deg, #A0522C 5.36%, #FFAB8C 28.86%, #FFEEDF 36.86%, #FFAB8C 44.36%, #6A3A21 91.86%);-webkit-text-fill-color:transparent;-webkit-background-clip:text}.JackpotGamesLoadMore::before,.JackpotJoinButton.Joined::before{content:\"\";position:absolute;inset:0;border-radius:var(--emw--button-border-radius, 4px);padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.JackpotGamesButton{margin-top:12px;align-self:center;min-width:140px}.JackpotCountdown{font-size:var(--emw--font-size-x-small, 12px);line-height:12px;margin-top:12px;color:var(--emw--color-gray-150, #BBB9C3)}.JackpotCountdown.Suspended{font-weight:var(--emw--font-weight-bold, 700);color:var(--emfe-w-color-white, #FFF);text-transform:capitalize}.JackpotDetailsTabsWrapper{display:flex;flex-direction:column}.JackpotDetailsTabs{margin-top:20px;display:flex;position:relative}.JackpotDetailsTabs .JackpotDetailsTab{padding:9px 16px 7px;font-weight:500;font-size:12px;line-height:15px;color:var(--emw--color-background, #666178);border-bottom:2px solid transparent;cursor:pointer}.JackpotDetailsTabs .JackpotDetailsTab.Active{color:var(--emw--color-typography, #FFF);border-color:var(--emw--color-typography, #FFF)}.JackpotDetailsTabs::after{content:\"\";position:absolute;bottom:0;left:0;width:100%;height:1px;background-color:var(--emw--color-typography, #FFF);opacity:0.1}.JackpotInfoItem{margin-bottom:8px;color:var(--emw--color-typography, #FFF);font-size:14px;line-height:17px;display:flex;align-items:center}.JackpotInfoItem span{font-weight:var(--emw--font-weight-bold, 700)}.JackpotContributionTooltipButton{margin-left:5px;width:16px;height:16px;background:center/100% url(https://static.everymatrix.com/gic/img/engagement-suite/help.svg)}.JackpotGamesListWrapper{overflow:auto;flex-grow:1}.JackpotGamesList{display:flex;gap:10px;flex-wrap:wrap}.JackpotGamesList .JackpotGamesListItem{width:calc(25% - 8px);aspect-ratio:74/40;cursor:pointer}.JackpotGamesList .JackpotGamesListItem.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.JackpotDetailsButton{margin-top:12px;display:flex;align-items:center;font-size:var(--emw--font-size-x-small, 12px);line-height:12px;color:var(--emw--color-primary-variant, #666178);cursor:pointer}.JackpotDetailsButton .Toggle{width:16px;height:16px;margin-right:4px}.JackpotDetailsButton .Closed{background:center/100% url(\"https://static.everymatrix.com/gic/img/engagement-suite/eye-closed.svg\")}.JackpotDetailsButton .Open{background:center/100% url(\"https://static.everymatrix.com/gic/img/engagement-suite/eye-open.svg\")}.JackpotInfo{margin-top:24px}.JackpotDescription{margin-top:12px;color:var(--emw--color-typography, #FFF);font-size:var(--emw--font-size-small, 14px);line-height:17px}.TermsAndConditions{display:block;margin-top:12px;color:var(--emw--color-primary, #59D1FF);font-size:var(--emw--font-size-small, 14px);line-height:17px}.JackpotsTooltipBackdrop{padding:48px 30px 0;position:absolute;width:100%;height:100%;inset:0;background-color:rgba(0, 0, 0, 0.5)}.JackpotsTooltipBackdrop .JackpotsTooltip{border:1px solid var(--emw--button-border-color, #403956);background-color:var(--emw--color-background, #1E1638);border-radius:8px;padding:32px;font-size:var(--emw--font-size-small, 14px);line-height:17px;color:var(--emw--color-gray-100, #BBB9C3);position:relative}.JackpotsTooltipBackdrop .JackpotsTooltip .JackpotsIconButton{top:12px;right:12px;position:absolute}.JackpotDetailsPopup.Tablet .JackpotsTooltipBackdrop,.JackpotDetailsPopup.Desktop .JackpotsTooltipBackdrop{padding:90px 75px 0}.JackpotDetailsPopup.Tablet .JackpotsTooltip,.JackpotDetailsPopup.Desktop .JackpotsTooltip{padding:60px 65px;font-size:var(--emw--font-size-small, 16px);line-height:20px}.JackpotDetailsPopup.Tablet .JackpotsTooltip .JackpotsIconButton,.JackpotDetailsPopup.Desktop .JackpotsTooltip .JackpotsIconButton{top:24px;right:24px}.JackpotDetailsPopup.Tablet .JackpotDetailsButton,.JackpotDetailsPopup.Desktop .JackpotDetailsButton{margin-top:20px}.JackpotDetailsPopup.Tablet .JackpotDescription,.JackpotDetailsPopup.Desktop .JackpotDescription{font-size:var(--emw--font-size-medium, 16px);line-height:22px}.JackpotDetailsPopup.Tablet .JackpotPopupName,.JackpotDetailsPopup.Desktop .JackpotPopupName{display:block}.JackpotDetailsPopup.Tablet .JackpotDetailsNavigation,.JackpotDetailsPopup.Desktop .JackpotDetailsNavigation{padding-top:16px}.JackpotDetailsPopup.Tablet .JackpotContributionTooltipButton,.JackpotDetailsPopup.Tablet .JackpotIconButton,.JackpotDetailsPopup.Desktop .JackpotContributionTooltipButton,.JackpotDetailsPopup.Desktop .JackpotIconButton{width:24px;height:24px}.JackpotDetailsPopup.Tablet .JackpotDetailsPopupContent,.JackpotDetailsPopup.Desktop .JackpotDetailsPopupContent{padding:20px 24px 30px}.JackpotDetailsPopup.Tablet .JackpotBalance,.JackpotDetailsPopup.Tablet .JackpotType,.JackpotDetailsPopup.Desktop .JackpotBalance,.JackpotDetailsPopup.Desktop .JackpotType{line-height:27px;font-size:22px}.JackpotDetailsPopup.Tablet .JackpotBalance,.JackpotDetailsPopup.Desktop .JackpotBalance{font-weight:var(--emw--font-weight-bold, 700)}.JackpotDetailsPopup.Tablet .PopupButton,.JackpotDetailsPopup.Desktop .PopupButton{min-height:36px;font-size:16px}.JackpotDetailsPopup.Tablet .JackpotCountdown,.JackpotDetailsPopup.Desktop .JackpotCountdown{font-size:var(--emw--font-size-small, 14px);line-height:14px}.JackpotDetailsPopup.Tablet .JackpotInfoItem,.JackpotDetailsPopup.Desktop .JackpotInfoItem{font-size:16px;line-height:20px}.JackpotDetailsPopup.Tablet .JackpotIsWon,.JackpotDetailsPopup.Desktop .JackpotIsWon{font-size:14px;line-height:17px}.JackpotDetailsPopup.Tablet .JackpotGamesList,.JackpotDetailsPopup.Desktop .JackpotGamesList{gap:12px}.JackpotDetailsPopup.Tablet .JackpotGamesList .JackpotGamesListItem,.JackpotDetailsPopup.Desktop .JackpotGamesList .JackpotGamesListItem{width:calc(20% - 10px)}.JackpotDetailsPopup.Tablet .JackpotDetailsTabs .JackpotDetailsTab,.JackpotDetailsPopup.Desktop .JackpotDetailsTabs .JackpotDetailsTab{font-size:16px;line-height:20px}";
|
|
131
|
-
|
|
132
|
-
const CasinoEngagementSuiteJackpotDetails$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
133
|
-
constructor() {
|
|
134
|
-
super();
|
|
135
|
-
this.__registerHost();
|
|
136
|
-
this.__attachShadow();
|
|
137
|
-
this.close = createEvent(this, "close", 7);
|
|
138
|
-
this.back = createEvent(this, "back", 7);
|
|
139
|
-
/**
|
|
140
|
-
* Client custom styling via string
|
|
141
|
-
*/
|
|
142
|
-
this.clientStyling = '';
|
|
143
|
-
/**
|
|
144
|
-
* Client custom styling via url
|
|
145
|
-
*/
|
|
146
|
-
this.clientStylingUrl = '';
|
|
147
|
-
/**
|
|
148
|
-
* Language of the widget
|
|
149
|
-
*/
|
|
150
|
-
this.language = 'en';
|
|
151
|
-
/**
|
|
152
|
-
* Current game slug
|
|
153
|
-
*/
|
|
154
|
-
this.gameSlug = '';
|
|
155
|
-
/**
|
|
156
|
-
* User's device type
|
|
157
|
-
*/
|
|
158
|
-
this.device = 'Mobile';
|
|
159
|
-
this.limitStylingAppends = false;
|
|
160
|
-
this.timer = '';
|
|
161
|
-
this.disabledStatus = '';
|
|
162
|
-
this.activeTab = 1;
|
|
163
|
-
this.visibleGames = [];
|
|
164
|
-
this.enabled = false;
|
|
165
|
-
this.showDetails = false;
|
|
166
|
-
this.jackpotEndTime = '';
|
|
167
|
-
this.showTooltip = false;
|
|
168
|
-
this.maxVisibleGames = 0;
|
|
169
|
-
this.handleTabChange = (e) => {
|
|
170
|
-
this.activeTab = +(e.target.getAttribute('data-index'));
|
|
171
|
-
this.visibleGames = [];
|
|
172
|
-
this.maxVisibleGames = 0;
|
|
173
|
-
};
|
|
174
|
-
this.handleLoadMore = () => {
|
|
175
|
-
this.visibleGames = this.jackpot.GamesInfo.slice(0, this.visibleGames.length + this.maxVisibleGames);
|
|
176
|
-
};
|
|
177
|
-
this.toggleShowDetails = () => {
|
|
178
|
-
this.showDetails = !this.showDetails;
|
|
179
|
-
};
|
|
180
|
-
this.toggleTooltip = () => {
|
|
181
|
-
this.showTooltip = !this.showTooltip;
|
|
182
|
-
};
|
|
183
|
-
this.setClientStyling = () => {
|
|
184
|
-
let sheet = document.createElement('style');
|
|
185
|
-
sheet.innerHTML = this.clientStyling;
|
|
186
|
-
this.host.prepend(sheet);
|
|
187
|
-
};
|
|
188
|
-
this.setClientStylingURL = () => {
|
|
189
|
-
let url = new URL(this.clientStylingUrl);
|
|
190
|
-
let cssFile = document.createElement('style');
|
|
191
|
-
fetch(url.href)
|
|
192
|
-
.then((res) => res.text())
|
|
193
|
-
.then((data) => {
|
|
194
|
-
cssFile.innerHTML = data;
|
|
195
|
-
setTimeout(() => { this.host.prepend(cssFile); }, 1);
|
|
196
|
-
})
|
|
197
|
-
.catch((err) => {
|
|
198
|
-
console.log('Error ', err);
|
|
199
|
-
});
|
|
200
|
-
};
|
|
201
|
-
this.handleCloseClick = () => {
|
|
202
|
-
this.close.emit();
|
|
203
|
-
};
|
|
204
|
-
this.handleBackClick = () => {
|
|
205
|
-
this.back.emit();
|
|
206
|
-
};
|
|
207
|
-
this.onGameClick = (ev) => {
|
|
208
|
-
const slug = ev.currentTarget.getAttribute('data-slug');
|
|
209
|
-
if (slug) {
|
|
210
|
-
window.postMessage({
|
|
211
|
-
type: 'EngagementSuiteGameRedirect',
|
|
212
|
-
data: {
|
|
213
|
-
Slug: slug
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
handleEvent(e) {
|
|
220
|
-
const { type, data } = e === null || e === void 0 ? void 0 : e.data;
|
|
221
|
-
switch (type) {
|
|
222
|
-
case 'UpdateJackpotStatus': {
|
|
223
|
-
const data = e.data.data;
|
|
224
|
-
if (this.jackpot.JackpotId === data.JackpotId) {
|
|
225
|
-
this.updateJackpotStatus(e.data.data);
|
|
226
|
-
}
|
|
227
|
-
break;
|
|
228
|
-
}
|
|
229
|
-
case 'JoinJackpotResult': {
|
|
230
|
-
const res = data;
|
|
231
|
-
if (res.Success && this.jackpot.JackpotId in res.JackpotIds) {
|
|
232
|
-
this.enabled = this.jackpot.Enabled = res.JackpotIds[this.jackpot.JackpotId];
|
|
233
|
-
}
|
|
234
|
-
break;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
handleJackpotUpdate() {
|
|
239
|
-
this.balance = this.jackpot.Balance;
|
|
240
|
-
this.winBalance = this.jackpot.WinBalance;
|
|
241
|
-
}
|
|
242
|
-
handleResize() {
|
|
243
|
-
this.activeTab === 2 && this.setVisibleGames();
|
|
244
|
-
this.showTooltip = false;
|
|
245
|
-
}
|
|
246
|
-
componentWillLoad() {
|
|
247
|
-
this.enabled = this.jackpot.Enabled;
|
|
248
|
-
this.balance = this.jackpot.Balance;
|
|
249
|
-
this.winBalance = this.jackpot.WinBalance;
|
|
250
|
-
this.jackpotEndTime = this.jackpot.JackpotEndTime;
|
|
251
|
-
this.disabledStatus = this.jackpot.Reason || '';
|
|
252
|
-
this.startCountdown();
|
|
253
|
-
}
|
|
254
|
-
componentDidRender() {
|
|
255
|
-
if (!this.limitStylingAppends && this.host) {
|
|
256
|
-
if (this.clientStyling)
|
|
257
|
-
this.setClientStyling();
|
|
258
|
-
if (this.clientStylingUrl)
|
|
259
|
-
this.setClientStylingURL();
|
|
260
|
-
this.limitStylingAppends = true;
|
|
261
|
-
}
|
|
262
|
-
if (this.activeTab === 2 && !this.maxVisibleGames) {
|
|
263
|
-
this.setVisibleGames();
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
disconnectedCallback() {
|
|
267
|
-
this.clearInterval();
|
|
268
|
-
}
|
|
269
|
-
clearInterval() {
|
|
270
|
-
if (this.interval) {
|
|
271
|
-
clearInterval(this.interval);
|
|
272
|
-
this.interval = null;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
setVisibleGames() {
|
|
276
|
-
const gap = this.device === 'Mobile' ? 10 : 12;
|
|
277
|
-
const gamesPerRow = this.device === 'Mobile' ? 4 : 5;
|
|
278
|
-
const availableWidth = this.gamesListWrapperEl.offsetWidth - (gap * (gamesPerRow - 1));
|
|
279
|
-
const gameElWidth = availableWidth / gamesPerRow;
|
|
280
|
-
const gameElHeight = (gameElWidth / 74 * 40) + gap;
|
|
281
|
-
this.maxVisibleGames = Math.max(Math.floor(this.gamesListWrapperEl.offsetHeight / gameElHeight) * gamesPerRow, gamesPerRow);
|
|
282
|
-
this.visibleGames = this.jackpot.GamesInfo.slice(0, this.maxVisibleGames);
|
|
283
|
-
}
|
|
284
|
-
updateJackpotStatus(event) {
|
|
285
|
-
if (event.IsClosed) {
|
|
286
|
-
this.clearInterval();
|
|
287
|
-
this.disabledStatus = event.Reason;
|
|
288
|
-
this.activeTab = 1;
|
|
289
|
-
}
|
|
290
|
-
else {
|
|
291
|
-
this.disabledStatus = '';
|
|
292
|
-
this.jackpotEndTime = event.JackpotEndTime;
|
|
293
|
-
this.startCountdown();
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
getTopNavigationTemplate() {
|
|
297
|
-
return (h("div", { class: "JackpotDetailsNavigation" }, h("button", { class: "JackpotIconButton", onClick: this.handleBackClick }, h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/back.svg", alt: "back" })), h("div", { class: "JackpotPopupName" }, translate('jackpots', this.language)), h("button", { class: "JackpotIconButton", onClick: this.handleCloseClick }, h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", alt: "close" }))));
|
|
298
|
-
}
|
|
299
|
-
getJackpotBalance() {
|
|
300
|
-
return formatBalance(this.balance, this.jackpot.Currency);
|
|
301
|
-
}
|
|
302
|
-
getJoinButtonClasses() {
|
|
303
|
-
return {
|
|
304
|
-
PopupButton: true,
|
|
305
|
-
Active: this.enabled,
|
|
306
|
-
Loading: this.jackpot.Pending
|
|
307
|
-
};
|
|
308
|
-
}
|
|
309
|
-
getJackpotDetailsHeaderTemplate() {
|
|
310
|
-
const joinButtonDisabled = isBefore(new Date(this.jackpot.JackpotEndTime), new Date()) || !!this.disabledStatus;
|
|
311
|
-
return (h("div", { class: "JackpotDetailsHeader" }, h("div", null, h("div", { class: "JackpotType" }, this.jackpot.Type), h("div", { class: "JackpotBalance" }, this.getJackpotBalance())), h("div", { class: "JackpotDetailsHeaderSecondCol" }, h("button", { disabled: joinButtonDisabled, onClick: this.jackpotChangeStatusRequest, class: this.getJoinButtonClasses(), "data-id": this.jackpot.JackpotId }, this.enabled
|
|
312
|
-
? translate('unjoin', this.language)
|
|
313
|
-
: translate('join', this.language)), !!this.winBalance && h("div", { class: "JackpotIsWon" }, translate('jackpotIsWon', this.language)))));
|
|
314
|
-
}
|
|
315
|
-
getTabsTemplate() {
|
|
316
|
-
return h("div", { class: "JackpotDetailsTabs" }, h("div", { "data-index": "1", onClick: this.handleTabChange, class: `JackpotDetailsTab ${this.activeTab === 1 ? 'Active' : ''}` }, translate('info', this.language)), h("div", { "data-index": "2", onClick: this.handleTabChange, class: `JackpotDetailsTab ${this.activeTab === 2 ? 'Active' : ''}` }, translate('games', this.language)));
|
|
317
|
-
}
|
|
318
|
-
getTabsContentTemplate() {
|
|
319
|
-
return this.activeTab === 1
|
|
320
|
-
? this.getJackpotInfoTemplate()
|
|
321
|
-
: this.getGamesTemplate();
|
|
322
|
-
}
|
|
323
|
-
getJackpotDetailsTemplate() {
|
|
324
|
-
return h("div", null, h("div", { class: "JackpotDetailsButton", onClick: this.toggleShowDetails }, h("div", { class: `Toggle ${this.showDetails ? 'Closed' : 'Open'}` }), h("span", null, translate('jackpotDetails', this.language))), this.showDetails && h("div", { class: "JackpotDetailsContent" }, this.jackpot.Description && h("p", { class: "JackpotDescription" }, this.jackpot.Description), this.jackpot.JackpotRulesUrl && h("a", { class: "TermsAndConditions", href: this.jackpot.JackpotRulesUrl, target: "_blank" }, translate('tc', this.jackpot.JackpotRulesUrl))));
|
|
325
|
-
}
|
|
326
|
-
getBetLimitsRange() {
|
|
327
|
-
var _a, _b, _c, _d;
|
|
328
|
-
if (this.jackpot.BetLimits) {
|
|
329
|
-
const playerCurrency = this.jackpot.Currency;
|
|
330
|
-
const betCurrencies = Object.keys(this.jackpot.BetLimits);
|
|
331
|
-
const matchedCurrency = betCurrencies.find(currency => currency === playerCurrency);
|
|
332
|
-
const betCurrency = matchedCurrency ? matchedCurrency : betCurrencies[0];
|
|
333
|
-
const showMinBet = this.jackpot.BetLimits && !!((_a = this.jackpot.BetLimits[betCurrency]) === null || _a === void 0 ? void 0 : _a.MinBet);
|
|
334
|
-
const showMaxBet = this.jackpot.BetLimits && !!((_b = this.jackpot.BetLimits[betCurrency]) === null || _b === void 0 ? void 0 : _b.MaxBet);
|
|
335
|
-
const formattedMinBet = formatBalance((_c = this.jackpot.BetLimits[betCurrency]) === null || _c === void 0 ? void 0 : _c.MinBet, betCurrency);
|
|
336
|
-
const formattedMaxBet = formatBalance((_d = this.jackpot.BetLimits[betCurrency]) === null || _d === void 0 ? void 0 : _d.MaxBet, betCurrency);
|
|
337
|
-
return h("div", null, showMinBet && h("div", { class: "JackpotInfoItem" }, translate('minBet', this.language), ":\u00A0", h("span", null, formattedMinBet)), showMaxBet && h("div", { class: "JackpotInfoItem" }, translate('maxBet', this.language), ":\u00A0", h("span", null, formattedMaxBet)));
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
getJackpotInfoTemplate() {
|
|
341
|
-
const showDetails = !!(this.jackpot.Description || this.jackpot.JackpotRulesUrl);
|
|
342
|
-
return h("div", { class: "JackpotInfoTabContent" }, showDetails && this.getJackpotDetailsTemplate(), h("div", { class: "JackpotInfo" }, h("div", { class: "JackpotInfoItem" }, translate('betContribution', this.language), ":\u00A0", h("span", null, +this.jackpot.ContributionPercent, "%")), h("div", { class: "JackpotInfoItem" }, translate('type', this.language), ":\u00A0", h("span", null, this.jackpot.JackpotTypePresentation)), h("div", { class: "JackpotInfoItem" }, translate('winningProbability', this.language), ":\u00A0", h("span", null, "1:", this.jackpot.Probability)), h("div", { class: "JackpotInfoItem" }, translate('operatorContribution', this.language), ":\u00A0", h("span", null, +this.jackpot.OperatorContributionPercent, "%"), h("button", { class: "JackpotContributionTooltipButton", onClick: this.toggleTooltip })), this.getBetLimitsRange()));
|
|
343
|
-
}
|
|
344
|
-
getGamesTemplate() {
|
|
345
|
-
const list = this.visibleGames.map((game) => {
|
|
346
|
-
return h("div", { onClick: this.onGameClick, class: `JackpotGamesListItem ${game.GameSlug === this.gameSlug ? 'Disabled' : ''}`, key: game.CasinoGameId, "data-slug": game.GameSlug, style: { background: `center / cover url(${game.GameIcon}) no-repeat` }, title: game.GameName });
|
|
347
|
-
});
|
|
348
|
-
return [
|
|
349
|
-
h("div", { class: "JackpotGamesListWrapper", ref: el => this.gamesListWrapperEl = el }, h("div", { class: "JackpotGamesList" }, list)),
|
|
350
|
-
this.visibleGames.length < this.jackpot.GamesInfo.length
|
|
351
|
-
? h("button", { class: "PopupButton Active JackpotGamesButton", onClick: this.handleLoadMore }, translate('loadMore', this.language))
|
|
352
|
-
: ''
|
|
353
|
-
];
|
|
354
|
-
}
|
|
355
|
-
getJackpotCountdown() {
|
|
356
|
-
const timerMessage = translate(this.disabledStatus, this.language) || this.timer;
|
|
357
|
-
return (h("div", { class: `JackpotCountdown ${this.disabledStatus ? 'Suspended' : ''}` }, timerMessage));
|
|
358
|
-
}
|
|
359
|
-
startCountdown() {
|
|
360
|
-
this.updateTimer();
|
|
361
|
-
this.interval = setInterval(() => {
|
|
362
|
-
this.updateTimer();
|
|
363
|
-
}, 1000);
|
|
364
|
-
}
|
|
365
|
-
updateTimer() {
|
|
366
|
-
const expirationTime = new Date(this.jackpotEndTime).getTime();
|
|
367
|
-
const now = new Date().getTime();
|
|
368
|
-
const distance = expirationTime - now;
|
|
369
|
-
if (distance < 1) {
|
|
370
|
-
this.clearInterval();
|
|
371
|
-
return;
|
|
372
|
-
}
|
|
373
|
-
const { days, hours, minutes, seconds } = {
|
|
374
|
-
days: String(Math.floor(distance / (1000 * 60 * 60 * 24))).padStart(2, '0'),
|
|
375
|
-
hours: String(Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))).padStart(2, '0'),
|
|
376
|
-
minutes: String(Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60))).padStart(2, '0'),
|
|
377
|
-
seconds: String(Math.floor((distance % (1000 * 60)) / 1000)).padStart(2, '0')
|
|
378
|
-
};
|
|
379
|
-
this.timer = days === '00'
|
|
380
|
-
? `${hours}h:${minutes}m:${seconds}s`
|
|
381
|
-
: `${days}d:${hours}h:${minutes}m`;
|
|
382
|
-
}
|
|
383
|
-
getPopupClasses() {
|
|
384
|
-
return {
|
|
385
|
-
JackpotDetailsPopup: true,
|
|
386
|
-
Disabled: !!this.disabledStatus || isBefore(new Date(this.jackpot.JackpotEndTime), new Date()),
|
|
387
|
-
[this.device]: true,
|
|
388
|
-
[this.jackpot.Type.charAt(0).toUpperCase() + this.jackpot.Type.slice(1)]: true
|
|
389
|
-
};
|
|
390
|
-
}
|
|
391
|
-
getTooltipTemplate() {
|
|
392
|
-
return (h("div", { class: "JackpotsTooltipBackdrop" }, h("div", { class: "JackpotsTooltip" }, h("button", { class: "JackpotsIconButton", onClick: this.toggleTooltip }, h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", alt: "Close tooltip" })), translate('contributionTooltip', this.language))));
|
|
393
|
-
}
|
|
394
|
-
render() {
|
|
395
|
-
return h("div", { class: this.getPopupClasses() }, this.getTopNavigationTemplate(), h("div", { class: "JackpotDetailsPopupContent" }, this.getJackpotDetailsHeaderTemplate(), this.getJackpotCountdown(), this.getTabsTemplate(), this.getTabsContentTemplate(), this.showTooltip && this.getTooltipTemplate()));
|
|
396
|
-
}
|
|
397
|
-
get host() { return this; }
|
|
398
|
-
static get watchers() { return {
|
|
399
|
-
"jackpot": ["handleJackpotUpdate"]
|
|
400
|
-
}; }
|
|
401
|
-
static get style() { return casinoEngagementSuiteJackpotDetailsCss; }
|
|
402
|
-
}, [1, "casino-engagement-suite-jackpot-details", {
|
|
403
|
-
"clientStyling": [513, "client-styling"],
|
|
404
|
-
"clientStylingUrl": [513, "client-styling-url"],
|
|
405
|
-
"jackpot": [16],
|
|
406
|
-
"jackpotChangeStatusRequest": [1040],
|
|
407
|
-
"language": [1],
|
|
408
|
-
"gameSlug": [1, "game-slug"],
|
|
409
|
-
"device": [1],
|
|
410
|
-
"limitStylingAppends": [32],
|
|
411
|
-
"timer": [32],
|
|
412
|
-
"disabledStatus": [32],
|
|
413
|
-
"activeTab": [32],
|
|
414
|
-
"visibleGames": [32],
|
|
415
|
-
"enabled": [32],
|
|
416
|
-
"balance": [32],
|
|
417
|
-
"winBalance": [32],
|
|
418
|
-
"showDetails": [32],
|
|
419
|
-
"jackpotEndTime": [32],
|
|
420
|
-
"showTooltip": [32]
|
|
421
|
-
}, [[8, "message", "handleEvent"], [9, "resize", "handleResize"]]]);
|
|
422
|
-
function defineCustomElement$1() {
|
|
423
|
-
if (typeof customElements === "undefined") {
|
|
424
|
-
return;
|
|
425
|
-
}
|
|
426
|
-
const components = ["casino-engagement-suite-jackpot-details"];
|
|
427
|
-
components.forEach(tagName => { switch (tagName) {
|
|
428
|
-
case "casino-engagement-suite-jackpot-details":
|
|
429
|
-
if (!customElements.get(tagName)) {
|
|
430
|
-
customElements.define(tagName, CasinoEngagementSuiteJackpotDetails$1);
|
|
431
|
-
}
|
|
432
|
-
break;
|
|
433
|
-
} });
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
const CasinoEngagementSuiteJackpotDetails = CasinoEngagementSuiteJackpotDetails$1;
|
|
437
|
-
const defineCustomElement = defineCustomElement$1;
|
|
438
|
-
|
|
439
|
-
export { CasinoEngagementSuiteJackpotDetails, defineCustomElement };
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
-
|
|
3
|
-
const casinoEngagementSuiteProgressBarCss = ":host{display:block;font-family:inherit}:host(.Desktop) .ProgressBarPercent{font-size:14px;line-height:14px}@keyframes indeterminate{0%{left:-200%;right:100%}60%{left:110%;right:-10%}to{left:110%;right:-10%}}.ProgressBarBackground{height:8px;background-color:var(--emw--color-background, #666178);border-radius:4px;position:relative;overflow:hidden}.ProgressBarLine{position:absolute;left:0;top:0;bottom:0;border-radius:4px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);transition:width ease-out 0.3s}.ProgressBarLine.Indeterminate{animation:indeterminate 1s linear infinite}.ProgressBarInfo{margin-bottom:8px;display:flex;justify-content:space-between;align-items:center}.ProgressBarPercent{font-weight:700;font-size:12px;line-height:12px}.HidePercent .ProgressBarPercent{display:none}.ProgressBar:not(.Disabled) .ProgressBarPercent{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.ProgressBar.Disabled .ProgressBarPercent{color:var(--emw--color-background, #666178)}.ProgressBar.Disabled .ProgressBarLine{background:var(--emw--color-background-secondary, #474668)}";
|
|
4
|
-
|
|
5
|
-
const CasinoEngagementSuiteProgressBar$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
-
constructor() {
|
|
7
|
-
super();
|
|
8
|
-
this.__registerHost();
|
|
9
|
-
this.__attachShadow();
|
|
10
|
-
/**
|
|
11
|
-
* Value for the widget
|
|
12
|
-
*/
|
|
13
|
-
this.value = 0;
|
|
14
|
-
/**
|
|
15
|
-
* Shows disabled styles
|
|
16
|
-
*/
|
|
17
|
-
this.disabled = false;
|
|
18
|
-
/**
|
|
19
|
-
* Hide percent value
|
|
20
|
-
*/
|
|
21
|
-
this.hidePercent = false;
|
|
22
|
-
/**
|
|
23
|
-
* Constantly animates
|
|
24
|
-
*/
|
|
25
|
-
this.indeterminate = false;
|
|
26
|
-
/**
|
|
27
|
-
* Client custom styling via string
|
|
28
|
-
*/
|
|
29
|
-
this.clientStyling = '';
|
|
30
|
-
/**
|
|
31
|
-
* Client custom styling via url
|
|
32
|
-
*/
|
|
33
|
-
this.clientStylingUrl = '';
|
|
34
|
-
this.limitStylingAppends = false;
|
|
35
|
-
this.setClientStyling = () => {
|
|
36
|
-
let sheet = document.createElement('style');
|
|
37
|
-
sheet.innerHTML = this.clientStyling;
|
|
38
|
-
this.host.prepend(sheet);
|
|
39
|
-
};
|
|
40
|
-
this.setClientStylingURL = () => {
|
|
41
|
-
let url = new URL(this.clientStylingUrl);
|
|
42
|
-
let cssFile = document.createElement('style');
|
|
43
|
-
fetch(url.href)
|
|
44
|
-
.then((res) => res.text())
|
|
45
|
-
.then((data) => {
|
|
46
|
-
cssFile.innerHTML = data;
|
|
47
|
-
setTimeout(() => { this.host.prepend(cssFile); }, 1);
|
|
48
|
-
})
|
|
49
|
-
.catch((err) => {
|
|
50
|
-
console.log('Error ', err);
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
componentDidRender() {
|
|
55
|
-
if (!this.limitStylingAppends && this.host) {
|
|
56
|
-
if (this.clientStyling)
|
|
57
|
-
this.setClientStyling();
|
|
58
|
-
if (this.clientStylingUrl)
|
|
59
|
-
this.setClientStylingURL();
|
|
60
|
-
this.limitStylingAppends = true;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
getProgressBarClasses() {
|
|
64
|
-
return {
|
|
65
|
-
ProgressBar: true,
|
|
66
|
-
Completed: this.value === 100,
|
|
67
|
-
Disabled: this.disabled,
|
|
68
|
-
HidePercent: this.hidePercent || this.indeterminate
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
getProgressBarLineTemplate() {
|
|
72
|
-
if (this.indeterminate) {
|
|
73
|
-
return h("div", { class: "ProgressBarLine Indeterminate", part: "ProgressBarLine Indeterminate" });
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
return h("div", { class: "ProgressBarLine", part: "ProgressBarLine", style: { width: this.value + '%' } });
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
render() {
|
|
80
|
-
return h("div", { class: this.getProgressBarClasses(), part: "ProgressBar" }, h("div", { class: "ProgressBarInfo", part: "ProgressBarInfo" }, h("slot", { name: "Title" }, h("div", null)), h("slot", { name: "Percent" }, h("div", { class: "ProgressBarPercent", part: "ProgressBarPercent" }, this.value, "%"))), h("div", { class: "ProgressBarBackground", part: "ProgressBarBackground" }, this.getProgressBarLineTemplate()));
|
|
81
|
-
}
|
|
82
|
-
get host() { return this; }
|
|
83
|
-
static get style() { return casinoEngagementSuiteProgressBarCss; }
|
|
84
|
-
}, [1, "casino-engagement-suite-progress-bar", {
|
|
85
|
-
"value": [2],
|
|
86
|
-
"disabled": [4],
|
|
87
|
-
"hidePercent": [4, "hide-percent"],
|
|
88
|
-
"indeterminate": [4],
|
|
89
|
-
"clientStyling": [513, "client-styling"],
|
|
90
|
-
"clientStylingUrl": [513, "client-styling-url"],
|
|
91
|
-
"limitStylingAppends": [32]
|
|
92
|
-
}]);
|
|
93
|
-
function defineCustomElement$1() {
|
|
94
|
-
if (typeof customElements === "undefined") {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
const components = ["casino-engagement-suite-progress-bar"];
|
|
98
|
-
components.forEach(tagName => { switch (tagName) {
|
|
99
|
-
case "casino-engagement-suite-progress-bar":
|
|
100
|
-
if (!customElements.get(tagName)) {
|
|
101
|
-
customElements.define(tagName, CasinoEngagementSuiteProgressBar$1);
|
|
102
|
-
}
|
|
103
|
-
break;
|
|
104
|
-
} });
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
const CasinoEngagementSuiteProgressBar = CasinoEngagementSuiteProgressBar$1;
|
|
108
|
-
const defineCustomElement = defineCustomElement$1;
|
|
109
|
-
|
|
110
|
-
export { CasinoEngagementSuiteProgressBar, defineCustomElement };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/* CasinoEngagementSuiteJackpotDetails custom elements */
|
|
2
|
-
|
|
3
|
-
import type { Components, JSX } from "../types/components";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Used to manually set the base path where assets can be found.
|
|
7
|
-
* If the script is used as "module", it's recommended to use "import.meta.url",
|
|
8
|
-
* such as "setAssetPath(import.meta.url)". Other options include
|
|
9
|
-
* "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
|
|
10
|
-
* dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
|
|
11
|
-
* But do note that this configuration depends on how your script is bundled, or lack of
|
|
12
|
-
* bundling, and where your assets can be loaded from. Additionally custom bundling
|
|
13
|
-
* will have to ensure the static assets are copied to its build directory.
|
|
14
|
-
*/
|
|
15
|
-
export declare const setAssetPath: (path: string) => void;
|
|
16
|
-
|
|
17
|
-
export interface SetPlatformOptions {
|
|
18
|
-
raf?: (c: FrameRequestCallback) => number;
|
|
19
|
-
ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
20
|
-
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
21
|
-
}
|
|
22
|
-
export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
|
|
23
|
-
|
|
24
|
-
export type { Components, JSX };
|
|
25
|
-
|
|
26
|
-
export * from '../types';
|
package/dist/components/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|