@everymatrix/casino-engagement-suite-modal-container 1.36.0 → 1.36.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/casino-engagement-suite-modal-container/casino-engagement-suite-modal-container.esm.js +1 -1
- package/dist/casino-engagement-suite-modal-container/p-3cfb21d1.entry.js +1 -0
- package/dist/cjs/casino-engagement-suite-modal-container.cjs.js +1 -1
- package/dist/cjs/casino-engagement-suite-modal_2.cjs.entry.js +211 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/casino-engagement-suite-modal-container/casino-engagement-suite-modal-container.css +40 -0
- package/dist/collection/components/casino-engagement-suite-modal-container/casino-engagement-suite-modal-container.js +63 -20
- package/dist/collection/utils/locale.utils.js +6 -1
- package/dist/collection/utils/utils.js +3 -2
- package/dist/components/casino-engagement-suite-modal-container.js +42 -18
- package/dist/components/casino-engagement-suite-modal2.js +11 -9
- package/dist/esm/casino-engagement-suite-modal-container.js +1 -1
- package/dist/esm/casino-engagement-suite-modal_2.entry.js +206 -0
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/casino-engagement-suite-modal-container/casino-engagement-suite-modal-container.d.ts +11 -2
- package/dist/types/components.d.ts +8 -0
- package/dist/types/models/index.d.ts +7 -2
- package/dist/types/utils/utils.d.ts +1 -1
- package/package.json +1 -1
- package/dist/casino-engagement-suite-modal-container/p-0f126ad9.entry.js +0 -1
- package/dist/casino-engagement-suite-modal-container/p-8aa9bb7a.entry.js +0 -1
- package/dist/cjs/casino-engagement-suite-modal-container.cjs.entry.js +0 -127
- package/dist/cjs/casino-engagement-suite-modal.cjs.entry.js +0 -68
- package/dist/esm/casino-engagement-suite-modal-container.entry.js +0 -123
- package/dist/esm/casino-engagement-suite-modal.entry.js +0 -64
package/dist/casino-engagement-suite-modal-container/casino-engagement-suite-modal-container.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as n,b as
|
|
1
|
+
import{p as n,b as i}from"./p-b944b831.js";(()=>{const i=import.meta.url,e={};return""!==i&&(e.resourcesUrl=new URL(".",i).href),n(e)})().then((n=>i([["p-3cfb21d1",[[1,"casino-engagement-suite-modal-container",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[1],isJoiningToChallenge:[1028,"is-joining-to-challenge"],device:[1],limitStylingAppends:[32],openModals:[32],rewardMessage:[32],hasError:[32],confirmationData:[32],winAmount:[32]},[[16,"openModal","openModalHandler"],[16,"closeModal","closeModalHandler"]]],[1,"casino-engagement-suite-modal",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],isOpen:[4,"is-open"],isLoading:[1028,"is-loading"],header:[1],contentIcon:[1,"content-icon"],modalType:[1,"modal-type"],device:[1],showAnimation:[4,"show-animation"],limitStylingAppends:[32]}]]]],n)));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as o,h as e,g as i}from"./p-b944b831.js";const n=class{constructor(e){t(this,e),this.closeModal=o(this,"closeModal",7),this.clientStyling="",this.clientStylingUrl="",this.device="Mobile",this.showAnimation=!1,this.limitStylingAppends=!1,this.handleCloseClick=()=>{this.isLoading||this.closeModal.emit(this.modalType)},this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.host.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),o=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{o.innerHTML=t,setTimeout((()=>{this.host.prepend(o)}),1)})).catch((t=>{console.log("Error ",t)}))}}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){return e("div",{class:`ModalOverlay ${this.isOpen&&"Open"} ${this.device} ${this.showAnimation&&"ShowAnimation"}`},e("div",{class:"ModalWinAnimation"}),e("div",{class:"ModalContent GradientBorder"},e("div",{class:"IconCloseContainer"},e("button",{class:"IconCloseButton",onClick:this.handleCloseClick},e("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Сlose modal"}))),this.contentIcon?e("div",{class:"ModalIcon",style:{background:`url(${this.contentIcon}) no-repeat center, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%)`}}):null,e("div",{class:"ModalHeader"},e("h1",null,this.header)),e("div",{class:"ModalBody"},e("slot",{name:"body"})),e("div",{class:"ModalFooter"},e("slot",{name:"footer"}))))}get host(){return i(this)}};n.style=':host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.ModalOverlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.5);justify-content:center;align-items:center}.ModalOverlay.Open{display:flex}.IconCloseContainer{width:100%;display:flex;justify-content:end}.ModalContent{display:flex;flex-direction:column;align-items:center;font-family:"Montserrat", sans-serif;position:relative;color:var(--emw--color-typography, #FFFFFF);background-color:var(--emw--color-background, #1E1638);padding:12px;border-radius:8px;width:450px;max-width:100%;text-align:center}.GradientBorder::before{content:"";position:absolute;top:-1px;left:-1px;right:-1px;bottom:-1px;border-radius:9px;background:linear-gradient(143.2deg, #FF9401 -0.41%, #FFD32D 45.61%, #FF9401 82.77%);z-index:-1}.ModalHeader h1{font-weight:var(--emw--font-weight-semibold, 600);font-size:20px;margin-top:12px;padding:0 16px}.ModalIcon{width:44px;height:44px;border-radius:50%;background-size:cover;margin-top:12px}.ModalBody{margin-top:20px;font-size:16px;font-family:"Inter", sans-serif;font-weight:var(--emw--font-weight-normal, 400);color:var(--emw--color-gray-100, #BBB9C3);padding:0 16px}.ModalFooter{margin-top:40px;margin-bottom:28px;padding:0 16px;width:100%}@keyframes rotate{100%{transform:rotate(1turn)}}.ModalOverlay .ModalWinAnimation{display:none}.ModalOverlay.ShowAnimation .ModalWinAnimation{display:block;position:absolute;width:100%;height:100%;inset:0;background:center/550px url(https://static.everymatrix.com/gic/img/engagement-suite/light.svg) no-repeat, center/550px url(https://static.everymatrix.com/gic/img/engagement-suite/win.svg) no-repeat;animation:6s rotate linear infinite}.ModalOverlay.Mobile .ModalBody{font-size:14px}.ModalOverlay.Mobile .ModalContent{width:318px}.ModalOverlay.Mobile .ModalHeader h1{font-size:20px}.ModalOverlay.Mobile.ShowAnimation .ModalWinAnimation{background-size:400px}';const a=["en"],s={en:{joinHeader:"Choose another challenge?",desc:"Any progress on the current challenge will be kept and you can rejoin the challenge at any time.",joinQuestion:"Would you still like to join another challenge?",joinConfirm:"Yes, join another challenge",joinReject:"No, stay at the current challenge",unJoinHeader:"Quit Challenge?",unJoinQuestion:"Would you still like to quit the challenge?",unJoinConfirm:"Yes, I want to quit challenge",unJoinReject:"No, stay at challenge",join:"Unjoin",unJoin:"Unjoin",continue:"Continue",okContinue:"Ok, continue",won:"You won",supportInfo:"However, some rewards cannot be issued. Please, contact support.",noReward:"Reward cannot be issued",contactSupport:"Please contact support",noChallenges:"No Challenges yet",tryOtherGames:"Try winning Challenges as rewards or launching other booster games",tooltip:"Competition where your real money bets contribute towards the level progress to achieve the level reward",jackpotWin:"Total Jackpot Win!"}},r=(t,o)=>{const e=o;return s[void 0!==e&&a.includes(e)?e:"en"][t]},l=class{constructor(e){t(this,e),this.closeModal=o(this,"closeModal",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.device="Mobile",this.limitStylingAppends=!1,this.openModals=[],this.rewardMessage="",this.hasError=!1,this.confirmationData=null,this.winAmount={amount:0,currency:""},this.handleCloseClick=t=>{const o=t.currentTarget.getAttribute("data-type");this.closeModal.emit(o)},this.handleChallengeAttendance=()=>{window.postMessage({type:"ChallengeJoinRequest",data:this.confirmationData})},this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.host.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),o=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{o.innerHTML=t,setTimeout((()=>{this.host.prepend(o)}),1)})).catch((t=>{console.log("Error ",t)}))},this.isModalOpen=t=>Boolean(this.openModals.find((o=>o===t)))}openModalHandler(t){const{modalType:o,rewardMessage:e,hasError:i,confirmationData:n,winAmount:a}=t.detail;a&&(this.winAmount=this.isModalOpen("JACKPOT_REWARD_MODAL")?{amount:this.winAmount.amount+a.amount,currency:a.currency}:a),this.openModals=[...this.openModals,o],this.rewardMessage=e,this.hasError=i,n&&(this.confirmationData=n)}closeModalHandler(t){this.openModals=this.openModals.filter((o=>o!==t.detail))}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){const{ProgressToActivate:t}=this.confirmationData||{};return e("div",{class:`ModalContainer ${this.device}`},e("casino-engagement-suite-modal",{isOpen:this.isModalOpen("REWARD_MODAL"),header:"Congratulations!",contentIcon:"https://static.everymatrix.com/gic/img/engagement-suite/cup-reward.svg",modalType:"REWARD_MODAL","show-animation":!0,device:this.device},e("div",{slot:"body"},e("p",null,r("won",this.language)," ",e("span",{class:"ModalReward"},this.rewardMessage)),this.hasError&&e("p",{class:"SupportInfo"},r("supportInfo",this.language))),e("div",{slot:"footer"},e("button",{class:"ModalFooterButton",onClick:this.handleCloseClick,"data-type":"REWARD_MODAL"},r("continue",this.language)))),e("casino-engagement-suite-modal",{isOpen:this.isModalOpen("JACKPOT_REWARD_MODAL"),header:"Congratulations!",contentIcon:"https://static.everymatrix.com/gic/img/engagement-suite/cup-reward.svg","show-animation":!0,modalType:"JACKPOT_REWARD_MODAL",device:this.device},e("div",{slot:"body"},e("div",{class:"JackpotWinText"},r("jackpotWin",this.language)),e("div",{class:"JackpotWinAmount"},(o=this.winAmount.amount,`${this.winAmount.currency} ${new Intl.NumberFormat("en",{minimumFractionDigits:2,maximumFractionDigits:2}).format(o)}`))),e("div",{slot:"footer"},e("button",{class:"ModalFooterButton",onClick:this.handleCloseClick,"data-type":"JACKPOT_REWARD_MODAL"},r("continue",this.language)))),e("casino-engagement-suite-modal",{isOpen:this.isModalOpen("TARGET_MODAL"),header:r(t?"joinHeader":"unJoinHeader",this.language),modalType:"TARGET_MODAL",device:this.device,isLoading:this.isJoiningToChallenge},e("div",{slot:"body"},e("p",{class:"LeftAlign"},r("desc",this.language)),e("p",{class:"LeftAlign"},r(t?"joinQuestion":"unJoinQuestion",this.language))),e("div",{slot:"footer",class:"ManyActions"},e("button",{class:"ModalFooterButton "+(this.isJoiningToChallenge?"Disabled":""),onClick:this.handleChallengeAttendance},r(t?"joinConfirm":"unJoinConfirm",this.language)),e("button",{class:"ModalFooterButtonOutlined "+(this.isJoiningToChallenge?"Disabled":""),onClick:this.handleCloseClick,"data-type":"TARGET_MODAL"},e("div",{class:"GradientText"},r(t?"joinReject":"unJoinReject",this.language))))),e("casino-engagement-suite-modal",{isOpen:this.isModalOpen("SUPPORT_MODAL"),header:r("noReward",this.language),contentIcon:"https://static.everymatrix.com/gic/img/engagement-suite/alert.svg",modalType:"SUPPORT_MODAL",device:this.device},e("div",{slot:"body"},e("span",null,r("contactSupport",this.language))),e("div",{slot:"footer"},e("button",{class:"ModalFooterButton",onClick:this.handleCloseClick,"data-type":"SUPPORT_MODAL"},r("okContinue",this.language)))));var o}get host(){return i(this)}};l.style=':host{display:block;font-family:inherit}.ModalFooterButton,.ModalFooterButtonOutlined{transition:all 0.5s ease-out;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:140px;height:36px;font-size:14px;font-weight:var(--emw--font-weight-bold, 700);position:relative;font-family:"Montserrat", sans-serif;padding:0 16px;box-sizing:border-box;margin:auto;border:none;cursor:pointer}.ModalFooterButtonOutlined{background:linear-gradient(var(--emw--color-background, #1E1638) 0 0) padding-box, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%) border-box;border:2px solid transparent}.GradientText{background-image:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:transparent;background-clip:text}.ManyActions{display:flex;width:100%;flex-direction:column;align-items:stretch}.ManyActions .ModalFooterButton,.ManyActions .ModalFooterButtonOutlined{width:280px}.ManyActions button:first-child{margin-bottom:16px}.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.ModalReward{font-weight:var(--emw--font-weight-semibold, 600);color:var(--emw--color-typography, #FFFFFF)}.JackpotWinText{margin:0;font-weight:var(--emw--font-weight-bold, 600);font-size:16px;line-height:20px;color:var(--emw--color-typography, #FFF)}.JackpotWinAmount{margin-top:8px;box-shadow:-0.41px 0.41px 0px 0px #00000026, -0.41px 0.41px 2px 0px #00000080;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;font-weight:900;font-size:16px;line-height:16px}.SupportInfo{margin-top:20px}.ModalContainer.Mobile .ModalFooterButton{min-width:140px;height:32px}.ModalContainer.Mobile .ManyActions .ModalFooterButton,.ModalContainer.Mobile .ManyActions .ModalFooterButtonOutlined{width:100%;height:32px}.ModalContainer.Mobile .ManyActions button:first-child{margin-bottom:8px}.ModalContainer.Mobile .JackpotWinText{font-size:14px;line-height:16px}.ModalContainer.Mobile .JackpotWinAmount{font-size:14px;line-height:14px}.LeftAlign{text-align:left;line-height:1.2}';export{n as casino_engagement_suite_modal,l as casino_engagement_suite_modal_container}
|
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["casino-engagement-suite-
|
|
18
|
+
return index.bootstrapLazy([["casino-engagement-suite-modal_2.cjs",[[1,"casino-engagement-suite-modal-container",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[1],"isJoiningToChallenge":[1028,"is-joining-to-challenge"],"device":[1],"limitStylingAppends":[32],"openModals":[32],"rewardMessage":[32],"hasError":[32],"confirmationData":[32],"winAmount":[32]},[[16,"openModal","openModalHandler"],[16,"closeModal","closeModalHandler"]]],[1,"casino-engagement-suite-modal",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"isOpen":[4,"is-open"],"isLoading":[1028,"is-loading"],"header":[1],"contentIcon":[1,"content-icon"],"modalType":[1,"modal-type"],"device":[1],"showAnimation":[4,"show-animation"],"limitStylingAppends":[32]}]]]], options);
|
|
19
19
|
});
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-2394967b.js');
|
|
6
|
+
|
|
7
|
+
const casinoEngagementSuiteModalCss = ":host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.ModalOverlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.5);justify-content:center;align-items:center}.ModalOverlay.Open{display:flex}.IconCloseContainer{width:100%;display:flex;justify-content:end}.ModalContent{display:flex;flex-direction:column;align-items:center;font-family:\"Montserrat\", sans-serif;position:relative;color:var(--emw--color-typography, #FFFFFF);background-color:var(--emw--color-background, #1E1638);padding:12px;border-radius:8px;width:450px;max-width:100%;text-align:center}.GradientBorder::before{content:\"\";position:absolute;top:-1px;left:-1px;right:-1px;bottom:-1px;border-radius:9px;background:linear-gradient(143.2deg, #FF9401 -0.41%, #FFD32D 45.61%, #FF9401 82.77%);z-index:-1}.ModalHeader h1{font-weight:var(--emw--font-weight-semibold, 600);font-size:20px;margin-top:12px;padding:0 16px}.ModalIcon{width:44px;height:44px;border-radius:50%;background-size:cover;margin-top:12px}.ModalBody{margin-top:20px;font-size:16px;font-family:\"Inter\", sans-serif;font-weight:var(--emw--font-weight-normal, 400);color:var(--emw--color-gray-100, #BBB9C3);padding:0 16px}.ModalFooter{margin-top:40px;margin-bottom:28px;padding:0 16px;width:100%}@keyframes rotate{100%{transform:rotate(1turn)}}.ModalOverlay .ModalWinAnimation{display:none}.ModalOverlay.ShowAnimation .ModalWinAnimation{display:block;position:absolute;width:100%;height:100%;inset:0;background:center/550px url(https://static.everymatrix.com/gic/img/engagement-suite/light.svg) no-repeat, center/550px url(https://static.everymatrix.com/gic/img/engagement-suite/win.svg) no-repeat;animation:6s rotate linear infinite}.ModalOverlay.Mobile .ModalBody{font-size:14px}.ModalOverlay.Mobile .ModalContent{width:318px}.ModalOverlay.Mobile .ModalHeader h1{font-size:20px}.ModalOverlay.Mobile.ShowAnimation .ModalWinAnimation{background-size:400px}";
|
|
8
|
+
|
|
9
|
+
const CasinoEngagementSuiteModal = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.closeModal = index.createEvent(this, "closeModal", 7);
|
|
13
|
+
/**
|
|
14
|
+
* Client custom styling via string
|
|
15
|
+
*/
|
|
16
|
+
this.clientStyling = '';
|
|
17
|
+
/**
|
|
18
|
+
* Client custom styling via url
|
|
19
|
+
*/
|
|
20
|
+
this.clientStylingUrl = '';
|
|
21
|
+
this.device = 'Mobile';
|
|
22
|
+
/**
|
|
23
|
+
* Show win animation
|
|
24
|
+
*/
|
|
25
|
+
this.showAnimation = false;
|
|
26
|
+
this.limitStylingAppends = false;
|
|
27
|
+
this.handleCloseClick = () => {
|
|
28
|
+
if (this.isLoading)
|
|
29
|
+
return;
|
|
30
|
+
this.closeModal.emit(this.modalType);
|
|
31
|
+
};
|
|
32
|
+
this.setClientStyling = () => {
|
|
33
|
+
let sheet = document.createElement('style');
|
|
34
|
+
sheet.innerHTML = this.clientStyling;
|
|
35
|
+
this.host.prepend(sheet);
|
|
36
|
+
};
|
|
37
|
+
this.setClientStylingURL = () => {
|
|
38
|
+
let url = new URL(this.clientStylingUrl);
|
|
39
|
+
let cssFile = document.createElement('style');
|
|
40
|
+
fetch(url.href)
|
|
41
|
+
.then((res) => res.text())
|
|
42
|
+
.then((data) => {
|
|
43
|
+
cssFile.innerHTML = data;
|
|
44
|
+
setTimeout(() => { this.host.prepend(cssFile); }, 1);
|
|
45
|
+
})
|
|
46
|
+
.catch((err) => {
|
|
47
|
+
console.log('Error ', err);
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
componentDidRender() {
|
|
52
|
+
if (!this.limitStylingAppends && this.host) {
|
|
53
|
+
if (this.clientStyling)
|
|
54
|
+
this.setClientStyling();
|
|
55
|
+
if (this.clientStylingUrl)
|
|
56
|
+
this.setClientStylingURL();
|
|
57
|
+
this.limitStylingAppends = true;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
render() {
|
|
61
|
+
return (index.h("div", { class: `ModalOverlay ${this.isOpen && 'Open'} ${this.device} ${this.showAnimation && 'ShowAnimation'}` }, index.h("div", { class: "ModalWinAnimation" }), index.h("div", { class: "ModalContent GradientBorder" }, index.h("div", { class: 'IconCloseContainer' }, index.h("button", { class: "IconCloseButton", onClick: this.handleCloseClick }, index.h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", alt: "\u0421lose modal" }))), this.contentIcon ? (index.h("div", { class: "ModalIcon", style: {
|
|
62
|
+
background: `url(${this.contentIcon}) no-repeat center, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%)`
|
|
63
|
+
} })) : null, index.h("div", { class: "ModalHeader" }, index.h("h1", null, this.header)), index.h("div", { class: "ModalBody" }, index.h("slot", { name: "body" })), index.h("div", { class: "ModalFooter" }, index.h("slot", { name: "footer" })))));
|
|
64
|
+
}
|
|
65
|
+
get host() { return index.getElement(this); }
|
|
66
|
+
};
|
|
67
|
+
CasinoEngagementSuiteModal.style = casinoEngagementSuiteModalCss;
|
|
68
|
+
|
|
69
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
70
|
+
const SUPPORTED_LANGUAGES = ['en'];
|
|
71
|
+
const TRANSLATIONS = {
|
|
72
|
+
en: {
|
|
73
|
+
joinHeader: 'Choose another challenge?',
|
|
74
|
+
desc: 'Any progress on the current challenge will be kept and you can rejoin the challenge at any time.',
|
|
75
|
+
joinQuestion: 'Would you still like to join another challenge?',
|
|
76
|
+
joinConfirm: 'Yes, join another challenge',
|
|
77
|
+
joinReject: 'No, stay at the current challenge',
|
|
78
|
+
unJoinHeader: 'Quit Challenge?',
|
|
79
|
+
unJoinQuestion: 'Would you still like to quit the challenge?',
|
|
80
|
+
unJoinConfirm: 'Yes, I want to quit challenge',
|
|
81
|
+
unJoinReject: 'No, stay at challenge',
|
|
82
|
+
join: 'Unjoin',
|
|
83
|
+
unJoin: 'Unjoin',
|
|
84
|
+
continue: 'Continue',
|
|
85
|
+
okContinue: 'Ok, continue',
|
|
86
|
+
won: 'You won',
|
|
87
|
+
supportInfo: 'However, some rewards cannot be issued. Please, contact support.',
|
|
88
|
+
noReward: 'Reward cannot be issued',
|
|
89
|
+
contactSupport: 'Please contact support',
|
|
90
|
+
noChallenges: 'No Challenges yet',
|
|
91
|
+
tryOtherGames: 'Try winning Challenges as rewards or launching other booster games',
|
|
92
|
+
tooltip: 'Competition where your real money bets contribute towards the level progress to achieve the level reward',
|
|
93
|
+
jackpotWin: 'Total Jackpot Win!'
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
const translate = (key, customLang) => {
|
|
97
|
+
const lang = customLang;
|
|
98
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
function formatBalance(amount, currency) {
|
|
102
|
+
return `${currency} ${new Intl.NumberFormat('en', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
|
|
103
|
+
.format(amount)}`;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const casinoEngagementSuiteModalContainerCss = ":host{display:block;font-family:inherit}.ModalFooterButton,.ModalFooterButtonOutlined{transition:all 0.5s ease-out;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:140px;height:36px;font-size:14px;font-weight:var(--emw--font-weight-bold, 700);position:relative;font-family:\"Montserrat\", sans-serif;padding:0 16px;box-sizing:border-box;margin:auto;border:none;cursor:pointer}.ModalFooterButtonOutlined{background:linear-gradient(var(--emw--color-background, #1E1638) 0 0) padding-box, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%) border-box;border:2px solid transparent}.GradientText{background-image:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:transparent;background-clip:text}.ManyActions{display:flex;width:100%;flex-direction:column;align-items:stretch}.ManyActions .ModalFooterButton,.ManyActions .ModalFooterButtonOutlined{width:280px}.ManyActions button:first-child{margin-bottom:16px}.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.ModalReward{font-weight:var(--emw--font-weight-semibold, 600);color:var(--emw--color-typography, #FFFFFF)}.JackpotWinText{margin:0;font-weight:var(--emw--font-weight-bold, 600);font-size:16px;line-height:20px;color:var(--emw--color-typography, #FFF)}.JackpotWinAmount{margin-top:8px;box-shadow:-0.41px 0.41px 0px 0px #00000026, -0.41px 0.41px 2px 0px #00000080;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;font-weight:900;font-size:16px;line-height:16px}.SupportInfo{margin-top:20px}.ModalContainer.Mobile .ModalFooterButton{min-width:140px;height:32px}.ModalContainer.Mobile .ManyActions .ModalFooterButton,.ModalContainer.Mobile .ManyActions .ModalFooterButtonOutlined{width:100%;height:32px}.ModalContainer.Mobile .ManyActions button:first-child{margin-bottom:8px}.ModalContainer.Mobile .JackpotWinText{font-size:14px;line-height:16px}.ModalContainer.Mobile .JackpotWinAmount{font-size:14px;line-height:14px}.LeftAlign{text-align:left;line-height:1.2}";
|
|
107
|
+
|
|
108
|
+
const CasinoEngagementSuiteModalContainer = class {
|
|
109
|
+
constructor(hostRef) {
|
|
110
|
+
index.registerInstance(this, hostRef);
|
|
111
|
+
this.closeModal = index.createEvent(this, "closeModal", 7);
|
|
112
|
+
/**
|
|
113
|
+
* Client custom styling via string
|
|
114
|
+
*/
|
|
115
|
+
this.clientStyling = '';
|
|
116
|
+
/**
|
|
117
|
+
* Client custom styling via url
|
|
118
|
+
*/
|
|
119
|
+
this.clientStylingUrl = '';
|
|
120
|
+
/**
|
|
121
|
+
* Language of the widget
|
|
122
|
+
*/
|
|
123
|
+
this.language = 'en';
|
|
124
|
+
this.device = 'Mobile';
|
|
125
|
+
this.limitStylingAppends = false;
|
|
126
|
+
this.openModals = [];
|
|
127
|
+
this.rewardMessage = '';
|
|
128
|
+
this.hasError = false;
|
|
129
|
+
this.confirmationData = null;
|
|
130
|
+
this.winAmount = { amount: 0, currency: '' };
|
|
131
|
+
this.handleCloseClick = (e) => {
|
|
132
|
+
const type = e.currentTarget.getAttribute('data-type');
|
|
133
|
+
this.closeModal.emit(type);
|
|
134
|
+
};
|
|
135
|
+
this.handleChallengeAttendance = () => {
|
|
136
|
+
window.postMessage({
|
|
137
|
+
type: 'ChallengeJoinRequest',
|
|
138
|
+
data: this.confirmationData,
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
this.setClientStyling = () => {
|
|
142
|
+
let sheet = document.createElement('style');
|
|
143
|
+
sheet.innerHTML = this.clientStyling;
|
|
144
|
+
this.host.prepend(sheet);
|
|
145
|
+
};
|
|
146
|
+
this.setClientStylingURL = () => {
|
|
147
|
+
let url = new URL(this.clientStylingUrl);
|
|
148
|
+
let cssFile = document.createElement('style');
|
|
149
|
+
fetch(url.href)
|
|
150
|
+
.then((res) => res.text())
|
|
151
|
+
.then((data) => {
|
|
152
|
+
cssFile.innerHTML = data;
|
|
153
|
+
setTimeout(() => { this.host.prepend(cssFile); }, 1);
|
|
154
|
+
})
|
|
155
|
+
.catch((err) => {
|
|
156
|
+
console.log('Error ', err);
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
this.isModalOpen = (type) => {
|
|
160
|
+
return Boolean(this.openModals.find(el => el === type));
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
openModalHandler(event) {
|
|
164
|
+
const { modalType, rewardMessage, hasError, confirmationData, winAmount } = event.detail;
|
|
165
|
+
if (winAmount) {
|
|
166
|
+
// If jackpot win modal is already opened
|
|
167
|
+
// add won amount to the previous amount
|
|
168
|
+
if (this.isModalOpen('JACKPOT_REWARD_MODAL')) {
|
|
169
|
+
this.winAmount = { amount: this.winAmount.amount + winAmount.amount, currency: winAmount.currency };
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
this.winAmount = winAmount;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
this.openModals = [...this.openModals, modalType];
|
|
176
|
+
this.rewardMessage = rewardMessage;
|
|
177
|
+
this.hasError = hasError;
|
|
178
|
+
if (confirmationData) {
|
|
179
|
+
this.confirmationData = confirmationData;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
closeModalHandler(event) {
|
|
183
|
+
this.openModals = this.openModals.filter(el => el !== event.detail);
|
|
184
|
+
}
|
|
185
|
+
componentDidRender() {
|
|
186
|
+
if (!this.limitStylingAppends && this.host) {
|
|
187
|
+
if (this.clientStyling)
|
|
188
|
+
this.setClientStyling();
|
|
189
|
+
if (this.clientStylingUrl)
|
|
190
|
+
this.setClientStylingURL();
|
|
191
|
+
this.limitStylingAppends = true;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
render() {
|
|
195
|
+
const { ProgressToActivate } = this.confirmationData || {};
|
|
196
|
+
return (index.h("div", { class: `ModalContainer ${this.device}` }, index.h("casino-engagement-suite-modal", { isOpen: this.isModalOpen("REWARD_MODAL"), header: "Congratulations!", contentIcon: "https://static.everymatrix.com/gic/img/engagement-suite/cup-reward.svg", modalType: "REWARD_MODAL", "show-animation": true, device: this.device }, index.h("div", { slot: "body" }, index.h("p", null, translate('won', this.language), " ", index.h("span", { class: 'ModalReward' }, this.rewardMessage)), this.hasError && (index.h("p", { class: "SupportInfo" }, translate('supportInfo', this.language)))), index.h("div", { slot: "footer" }, index.h("button", { class: 'ModalFooterButton', onClick: this.handleCloseClick, "data-type": 'REWARD_MODAL' }, translate('continue', this.language)))), index.h("casino-engagement-suite-modal", { isOpen: this.isModalOpen("JACKPOT_REWARD_MODAL"), header: "Congratulations!", contentIcon: "https://static.everymatrix.com/gic/img/engagement-suite/cup-reward.svg", "show-animation": true, modalType: "JACKPOT_REWARD_MODAL", device: this.device }, index.h("div", { slot: "body" }, index.h("div", { class: "JackpotWinText" }, translate('jackpotWin', this.language)), index.h("div", { class: "JackpotWinAmount" }, formatBalance(this.winAmount.amount, this.winAmount.currency))), index.h("div", { slot: "footer" }, index.h("button", { class: 'ModalFooterButton', onClick: this.handleCloseClick, "data-type": 'JACKPOT_REWARD_MODAL' }, translate('continue', this.language)))), index.h("casino-engagement-suite-modal", { isOpen: this.isModalOpen("TARGET_MODAL"), header: ProgressToActivate ?
|
|
197
|
+
translate('joinHeader', this.language) :
|
|
198
|
+
translate('unJoinHeader', this.language), modalType: "TARGET_MODAL", device: this.device, isLoading: this.isJoiningToChallenge }, index.h("div", { slot: "body" }, index.h("p", { class: 'LeftAlign' }, translate('desc', this.language)), index.h("p", { class: 'LeftAlign' }, ProgressToActivate ?
|
|
199
|
+
translate('joinQuestion', this.language) :
|
|
200
|
+
translate('unJoinQuestion', this.language))), index.h("div", { slot: "footer", class: 'ManyActions' }, index.h("button", { class: `ModalFooterButton ${this.isJoiningToChallenge ? 'Disabled' : ''}`, onClick: this.handleChallengeAttendance }, ProgressToActivate ?
|
|
201
|
+
translate('joinConfirm', this.language) :
|
|
202
|
+
translate('unJoinConfirm', this.language)), index.h("button", { class: `ModalFooterButtonOutlined ${this.isJoiningToChallenge ? 'Disabled' : ''}`, onClick: this.handleCloseClick, "data-type": 'TARGET_MODAL' }, index.h("div", { class: 'GradientText' }, ProgressToActivate ?
|
|
203
|
+
translate('joinReject', this.language) :
|
|
204
|
+
translate('unJoinReject', this.language))))), index.h("casino-engagement-suite-modal", { isOpen: this.isModalOpen("SUPPORT_MODAL"), header: translate('noReward', this.language), contentIcon: "https://static.everymatrix.com/gic/img/engagement-suite/alert.svg", modalType: "SUPPORT_MODAL", device: this.device }, index.h("div", { slot: "body" }, index.h("span", null, translate('contactSupport', this.language))), index.h("div", { slot: "footer" }, index.h("button", { class: 'ModalFooterButton', onClick: this.handleCloseClick, "data-type": 'SUPPORT_MODAL' }, translate('okContinue', this.language))))));
|
|
205
|
+
}
|
|
206
|
+
get host() { return index.getElement(this); }
|
|
207
|
+
};
|
|
208
|
+
CasinoEngagementSuiteModalContainer.style = casinoEngagementSuiteModalContainerCss;
|
|
209
|
+
|
|
210
|
+
exports.casino_engagement_suite_modal = CasinoEngagementSuiteModal;
|
|
211
|
+
exports.casino_engagement_suite_modal_container = CasinoEngagementSuiteModalContainer;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["casino-engagement-suite-
|
|
17
|
+
return index.bootstrapLazy([["casino-engagement-suite-modal_2.cjs",[[1,"casino-engagement-suite-modal-container",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[1],"isJoiningToChallenge":[1028,"is-joining-to-challenge"],"device":[1],"limitStylingAppends":[32],"openModals":[32],"rewardMessage":[32],"hasError":[32],"confirmationData":[32],"winAmount":[32]},[[16,"openModal","openModalHandler"],[16,"closeModal","closeModalHandler"]]],[1,"casino-engagement-suite-modal",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"isOpen":[4,"is-open"],"isLoading":[1028,"is-loading"],"header":[1],"contentIcon":[1,"content-icon"],"modalType":[1,"modal-type"],"device":[1],"showAnimation":[4,"show-animation"],"limitStylingAppends":[32]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
display: block;
|
|
3
|
+
font-family: inherit;
|
|
3
4
|
}
|
|
4
5
|
|
|
5
6
|
.ModalFooterButton, .ModalFooterButtonOutlined {
|
|
@@ -44,11 +45,40 @@
|
|
|
44
45
|
margin-bottom: 16px;
|
|
45
46
|
}
|
|
46
47
|
|
|
48
|
+
.Disabled {
|
|
49
|
+
opacity: 0.5;
|
|
50
|
+
pointer-events: none;
|
|
51
|
+
cursor: auto;
|
|
52
|
+
}
|
|
53
|
+
|
|
47
54
|
.ModalReward {
|
|
48
55
|
font-weight: var(--emw--font-weight-semibold, 600);
|
|
49
56
|
color: var(--emw--color-typography, #FFFFFF);
|
|
50
57
|
}
|
|
51
58
|
|
|
59
|
+
.JackpotWinText {
|
|
60
|
+
margin: 0;
|
|
61
|
+
font-weight: var(--emw--font-weight-bold, 600);
|
|
62
|
+
font-size: 16px;
|
|
63
|
+
line-height: 20px;
|
|
64
|
+
color: var(--emw--color-typography, #FFF);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.JackpotWinAmount {
|
|
68
|
+
margin-top: 8px;
|
|
69
|
+
box-shadow: -0.41px 0.41px 0px 0px #00000026, -0.41px 0.41px 2px 0px #00000080;
|
|
70
|
+
background: linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);
|
|
71
|
+
-webkit-text-fill-color: transparent;
|
|
72
|
+
-webkit-background-clip: text;
|
|
73
|
+
font-weight: 900;
|
|
74
|
+
font-size: 16px;
|
|
75
|
+
line-height: 16px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.SupportInfo {
|
|
79
|
+
margin-top: 20px;
|
|
80
|
+
}
|
|
81
|
+
|
|
52
82
|
.ModalContainer.Mobile .ModalFooterButton,
|
|
53
83
|
.ModalContainer.Mobile .ModalFooterButton {
|
|
54
84
|
min-width: 140px;
|
|
@@ -64,6 +94,16 @@
|
|
|
64
94
|
.ModalContainer.Mobile .ManyActions button:first-child {
|
|
65
95
|
margin-bottom: 8px;
|
|
66
96
|
}
|
|
97
|
+
.ModalContainer.Mobile .JackpotWinText,
|
|
98
|
+
.ModalContainer.Mobile .JackpotWinText {
|
|
99
|
+
font-size: 14px;
|
|
100
|
+
line-height: 16px;
|
|
101
|
+
}
|
|
102
|
+
.ModalContainer.Mobile .JackpotWinAmount,
|
|
103
|
+
.ModalContainer.Mobile .JackpotWinAmount {
|
|
104
|
+
font-size: 14px;
|
|
105
|
+
line-height: 14px;
|
|
106
|
+
}
|
|
67
107
|
|
|
68
108
|
.LeftAlign {
|
|
69
109
|
text-align: left;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Component, h, Prop, State, Listen, Element, Event } from '@stencil/core';
|
|
2
2
|
import '@everymatrix/casino-engagement-suite-modal';
|
|
3
3
|
import { translate } from '../../utils/locale.utils';
|
|
4
|
+
import { formatBalance } from '../../utils/utils';
|
|
4
5
|
export class CasinoEngagementSuiteModalContainer {
|
|
5
6
|
constructor() {
|
|
6
7
|
/**
|
|
@@ -18,16 +19,18 @@ export class CasinoEngagementSuiteModalContainer {
|
|
|
18
19
|
this.device = 'Mobile';
|
|
19
20
|
this.limitStylingAppends = false;
|
|
20
21
|
this.openModals = [];
|
|
21
|
-
this.
|
|
22
|
+
this.rewardMessage = '';
|
|
23
|
+
this.hasError = false;
|
|
22
24
|
this.confirmationData = null;
|
|
25
|
+
this.winAmount = { amount: 0, currency: '' };
|
|
23
26
|
this.handleCloseClick = (e) => {
|
|
24
|
-
const type =
|
|
27
|
+
const type = e.currentTarget.getAttribute('data-type');
|
|
25
28
|
this.closeModal.emit(type);
|
|
26
29
|
};
|
|
27
30
|
this.handleChallengeAttendance = () => {
|
|
28
31
|
window.postMessage({
|
|
29
|
-
type: '
|
|
30
|
-
|
|
32
|
+
type: 'ChallengeJoinRequest',
|
|
33
|
+
data: this.confirmationData,
|
|
31
34
|
});
|
|
32
35
|
};
|
|
33
36
|
this.setClientStyling = () => {
|
|
@@ -53,11 +56,20 @@ export class CasinoEngagementSuiteModalContainer {
|
|
|
53
56
|
};
|
|
54
57
|
}
|
|
55
58
|
openModalHandler(event) {
|
|
56
|
-
const { modalType,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
const { modalType, rewardMessage, hasError, confirmationData, winAmount } = event.detail;
|
|
60
|
+
if (winAmount) {
|
|
61
|
+
// If jackpot win modal is already opened
|
|
62
|
+
// add won amount to the previous amount
|
|
63
|
+
if (this.isModalOpen('JACKPOT_REWARD_MODAL')) {
|
|
64
|
+
this.winAmount = { amount: this.winAmount.amount + winAmount.amount, currency: winAmount.currency };
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
this.winAmount = winAmount;
|
|
68
|
+
}
|
|
60
69
|
}
|
|
70
|
+
this.openModals = [...this.openModals, modalType];
|
|
71
|
+
this.rewardMessage = rewardMessage;
|
|
72
|
+
this.hasError = hasError;
|
|
61
73
|
if (confirmationData) {
|
|
62
74
|
this.confirmationData = confirmationData;
|
|
63
75
|
}
|
|
@@ -75,32 +87,44 @@ export class CasinoEngagementSuiteModalContainer {
|
|
|
75
87
|
}
|
|
76
88
|
}
|
|
77
89
|
render() {
|
|
78
|
-
const {
|
|
90
|
+
const { ProgressToActivate } = this.confirmationData || {};
|
|
79
91
|
return (h("div", { class: `ModalContainer ${this.device}` },
|
|
80
|
-
h("casino-engagement-suite-modal", { isOpen: this.isModalOpen("REWARD_MODAL"), header: "Congratulations!",
|
|
92
|
+
h("casino-engagement-suite-modal", { isOpen: this.isModalOpen("REWARD_MODAL"), header: "Congratulations!", contentIcon: "https://static.everymatrix.com/gic/img/engagement-suite/cup-reward.svg", modalType: "REWARD_MODAL", "show-animation": true, device: this.device },
|
|
81
93
|
h("div", { slot: "body" },
|
|
82
94
|
h("p", null,
|
|
83
95
|
translate('won', this.language),
|
|
84
96
|
" ",
|
|
85
|
-
h("span", { class: 'ModalReward' }, this.
|
|
97
|
+
h("span", { class: 'ModalReward' }, this.rewardMessage)),
|
|
98
|
+
this.hasError && (h("p", { class: "SupportInfo" }, translate('supportInfo', this.language)))),
|
|
86
99
|
h("div", { slot: "footer" },
|
|
87
100
|
h("button", { class: 'ModalFooterButton', onClick: this.handleCloseClick, "data-type": 'REWARD_MODAL' }, translate('continue', this.language)))),
|
|
88
|
-
h("casino-engagement-suite-modal", { isOpen: this.isModalOpen("
|
|
101
|
+
h("casino-engagement-suite-modal", { isOpen: this.isModalOpen("JACKPOT_REWARD_MODAL"), header: "Congratulations!", contentIcon: "https://static.everymatrix.com/gic/img/engagement-suite/cup-reward.svg", "show-animation": true, modalType: "JACKPOT_REWARD_MODAL", device: this.device },
|
|
102
|
+
h("div", { slot: "body" },
|
|
103
|
+
h("div", { class: "JackpotWinText" }, translate('jackpotWin', this.language)),
|
|
104
|
+
h("div", { class: "JackpotWinAmount" }, formatBalance(this.winAmount.amount, this.winAmount.currency))),
|
|
105
|
+
h("div", { slot: "footer" },
|
|
106
|
+
h("button", { class: 'ModalFooterButton', onClick: this.handleCloseClick, "data-type": 'JACKPOT_REWARD_MODAL' }, translate('continue', this.language)))),
|
|
107
|
+
h("casino-engagement-suite-modal", { isOpen: this.isModalOpen("TARGET_MODAL"), header: ProgressToActivate ?
|
|
89
108
|
translate('joinHeader', this.language) :
|
|
90
|
-
translate('unJoinHeader', this.language),
|
|
109
|
+
translate('unJoinHeader', this.language), modalType: "TARGET_MODAL", device: this.device, isLoading: this.isJoiningToChallenge },
|
|
91
110
|
h("div", { slot: "body" },
|
|
92
111
|
h("p", { class: 'LeftAlign' }, translate('desc', this.language)),
|
|
93
|
-
h("p", { class: 'LeftAlign' },
|
|
112
|
+
h("p", { class: 'LeftAlign' }, ProgressToActivate ?
|
|
94
113
|
translate('joinQuestion', this.language) :
|
|
95
114
|
translate('unJoinQuestion', this.language))),
|
|
96
115
|
h("div", { slot: "footer", class: 'ManyActions' },
|
|
97
|
-
h("button", { class:
|
|
116
|
+
h("button", { class: `ModalFooterButton ${this.isJoiningToChallenge ? 'Disabled' : ''}`, onClick: this.handleChallengeAttendance }, ProgressToActivate ?
|
|
98
117
|
translate('joinConfirm', this.language) :
|
|
99
118
|
translate('unJoinConfirm', this.language)),
|
|
100
|
-
h("button", { class:
|
|
101
|
-
h("div", { class: 'GradientText' },
|
|
119
|
+
h("button", { class: `ModalFooterButtonOutlined ${this.isJoiningToChallenge ? 'Disabled' : ''}`, onClick: this.handleCloseClick, "data-type": 'TARGET_MODAL' },
|
|
120
|
+
h("div", { class: 'GradientText' }, ProgressToActivate ?
|
|
102
121
|
translate('joinReject', this.language) :
|
|
103
|
-
translate('unJoinReject', this.language)))))
|
|
122
|
+
translate('unJoinReject', this.language))))),
|
|
123
|
+
h("casino-engagement-suite-modal", { isOpen: this.isModalOpen("SUPPORT_MODAL"), header: translate('noReward', this.language), contentIcon: "https://static.everymatrix.com/gic/img/engagement-suite/alert.svg", modalType: "SUPPORT_MODAL", device: this.device },
|
|
124
|
+
h("div", { slot: "body" },
|
|
125
|
+
h("span", null, translate('contactSupport', this.language))),
|
|
126
|
+
h("div", { slot: "footer" },
|
|
127
|
+
h("button", { class: 'ModalFooterButton', onClick: this.handleCloseClick, "data-type": 'SUPPORT_MODAL' }, translate('okContinue', this.language))))));
|
|
104
128
|
}
|
|
105
129
|
static get is() { return "casino-engagement-suite-modal-container"; }
|
|
106
130
|
static get encapsulation() { return "shadow"; }
|
|
@@ -165,6 +189,23 @@ export class CasinoEngagementSuiteModalContainer {
|
|
|
165
189
|
"reflect": false,
|
|
166
190
|
"defaultValue": "'en'"
|
|
167
191
|
},
|
|
192
|
+
"isJoiningToChallenge": {
|
|
193
|
+
"type": "boolean",
|
|
194
|
+
"mutable": true,
|
|
195
|
+
"complexType": {
|
|
196
|
+
"original": "boolean",
|
|
197
|
+
"resolved": "boolean",
|
|
198
|
+
"references": {}
|
|
199
|
+
},
|
|
200
|
+
"required": false,
|
|
201
|
+
"optional": false,
|
|
202
|
+
"docs": {
|
|
203
|
+
"tags": [],
|
|
204
|
+
"text": "Is joining to challenge"
|
|
205
|
+
},
|
|
206
|
+
"attribute": "is-joining-to-challenge",
|
|
207
|
+
"reflect": false
|
|
208
|
+
},
|
|
168
209
|
"device": {
|
|
169
210
|
"type": "string",
|
|
170
211
|
"mutable": false,
|
|
@@ -187,8 +228,10 @@ export class CasinoEngagementSuiteModalContainer {
|
|
|
187
228
|
static get states() { return {
|
|
188
229
|
"limitStylingAppends": {},
|
|
189
230
|
"openModals": {},
|
|
190
|
-
"
|
|
191
|
-
"
|
|
231
|
+
"rewardMessage": {},
|
|
232
|
+
"hasError": {},
|
|
233
|
+
"confirmationData": {},
|
|
234
|
+
"winAmount": {}
|
|
192
235
|
}; }
|
|
193
236
|
static get events() { return [{
|
|
194
237
|
"method": "closeModal",
|
|
@@ -14,10 +14,15 @@ const TRANSLATIONS = {
|
|
|
14
14
|
join: 'Unjoin',
|
|
15
15
|
unJoin: 'Unjoin',
|
|
16
16
|
continue: 'Continue',
|
|
17
|
+
okContinue: 'Ok, continue',
|
|
17
18
|
won: 'You won',
|
|
19
|
+
supportInfo: 'However, some rewards cannot be issued. Please, contact support.',
|
|
20
|
+
noReward: 'Reward cannot be issued',
|
|
21
|
+
contactSupport: 'Please contact support',
|
|
18
22
|
noChallenges: 'No Challenges yet',
|
|
19
23
|
tryOtherGames: 'Try winning Challenges as rewards or launching other booster games',
|
|
20
|
-
tooltip: 'Competition where your real money bets contribute towards the level progress to achieve the level reward'
|
|
24
|
+
tooltip: 'Competition where your real money bets contribute towards the level progress to achieve the level reward',
|
|
25
|
+
jackpotWin: 'Total Jackpot Win!'
|
|
21
26
|
}
|
|
22
27
|
};
|
|
23
28
|
export const translate = (key, customLang) => {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export function
|
|
2
|
-
return
|
|
1
|
+
export function formatBalance(amount, currency) {
|
|
2
|
+
return `${currency} ${new Intl.NumberFormat('en', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
|
|
3
|
+
.format(amount)}`;
|
|
3
4
|
}
|