@everymatrix/casino-engagement-suite-challenges-details 1.35.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-challenges-details/casino-engagement-suite-challenges-details.esm.js +1 -1
- package/dist/casino-engagement-suite-challenges-details/p-808a7dc5.js +1 -0
- package/dist/casino-engagement-suite-challenges-details/p-b3146c91.entry.js +1 -0
- package/dist/cjs/casino-engagement-suite-challenges-details.cjs.js +2 -2
- package/dist/cjs/casino-engagement-suite-challenges-details_2.cjs.entry.js +303 -0
- package/dist/cjs/{index-ec28d374.js → index-a0eb9215.js} +84 -3
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +8 -1
- package/dist/collection/components/casino-engagement-suite-challenges-details/casino-engagement-suite-challenges-details.css +18 -3
- package/dist/collection/components/casino-engagement-suite-challenges-details/casino-engagement-suite-challenges-details.js +119 -24
- package/dist/components/casino-engagement-suite-challenges-details.js +70 -19
- package/dist/components/casino-engagement-suite-progress-bar.js +6 -0
- package/dist/components/casino-engagement-suite-progress-bar2.js +94 -0
- package/dist/esm/casino-engagement-suite-challenges-details.js +2 -2
- package/dist/esm/casino-engagement-suite-challenges-details_2.entry.js +298 -0
- package/dist/esm/{index-13f457d0.js → index-c5abae48.js} +84 -3
- package/dist/esm/loader.js +2 -2
- package/dist/types/components/casino-engagement-suite-challenges-details/casino-engagement-suite-challenges-details.d.ts +18 -4
- package/dist/types/components.d.ts +17 -0
- package/dist/types/models/casino-challenges-details.d.ts +2 -0
- package/package.json +1 -1
- package/dist/casino-engagement-suite-challenges-details/p-27926b27.entry.js +0 -1
- package/dist/casino-engagement-suite-challenges-details/p-764c820d.js +0 -1
- package/dist/cjs/casino-engagement-suite-challenges-details.cjs.entry.js +0 -190
- package/dist/esm/casino-engagement-suite-challenges-details.entry.js +0 -186
|
@@ -1 +0,0 @@
|
|
|
1
|
-
let e,t,n=!1;const l="undefined"!=typeof window?window:{},s=l.document||{head:{}},o={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},c=e=>Promise.resolve(e),i=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),r=new WeakMap,u=e=>"sc-"+e.o,a={},f=e=>"object"==(e=typeof e)||"function"===e,d=(e,t,...n)=>{let l=null,s=!1,o=!1,c=[];const i=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?i(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!f(l))&&(l+=""),s&&o?c[c.length-1].i+=l:c.push(s?h(null,l):l),o=s)};if(i(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const r=h(e,null);return r.u=t,c.length>0&&(r.h=c),r},h=(e,t)=>({t:0,$:e,i:t,m:null,h:null,u:null}),$={},m=(e,t,n,s,c,i)=>{if(n!==s){let r=_(e,t),u=t.toLowerCase();if("class"===t){const t=e.classList,l=p(n),o=p(s);t.remove(...l.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!l.includes(e))))}else if(r||"o"!==t[0]||"n"!==t[1]){const l=f(s);if((r||l&&null!==s)&&!c)try{if(e.tagName.includes("-"))e[t]=s;else{let l=null==s?"":s;"list"===t?r=!1:null!=n&&e[t]==l||(e[t]=l)}}catch(e){}null==s||!1===s?!1===s&&""!==e.getAttribute(t)||e.removeAttribute(t):(!r||4&i||c)&&!l&&e.setAttribute(t,s=!0===s?"":s)}else t="-"===t[2]?t.slice(3):_(l,u)?u.slice(2):u[2]+t.slice(3),n&&o.rel(e,t,n,!1),s&&o.ael(e,t,s,!1)}},y=/\s/,p=e=>e?e.split(y):[],b=(e,t,n,l)=>{const s=11===t.m.nodeType&&t.m.host?t.m.host:t.m,o=e&&e.u||a,c=t.u||a;for(l in o)l in c||m(s,l,o[l],void 0,n,t.t);for(l in c)m(s,l,o[l],c[l],n,t.t)},w=(t,n,l)=>{let o,c,i=n.h[l],r=0;if(null!==i.i)o=i.m=s.createTextNode(i.i);else if(o=i.m=s.createElement(i.$),b(null,i,!1),null!=e&&o["s-si"]!==e&&o.classList.add(o["s-si"]=e),i.h)for(r=0;r<i.h.length;++r)c=w(t,i,r),c&&o.appendChild(c);return o},g=(e,n,l,s,o,c)=>{let i,r=e;for(r.shadowRoot&&r.tagName===t&&(r=r.shadowRoot);o<=c;++o)s[o]&&(i=w(null,l,o),i&&(s[o].m=i,r.insertBefore(i,n)))},S=(e,t,n,l)=>{for(;t<=n;++t)(l=e[t])&&l.m.remove()},j=(e,t)=>e.$===t.$,M=(e,t)=>{const n=t.m=e.m,l=e.h,s=t.h,o=t.i;null===o?(b(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o=0,c=0,i=t.length-1,r=t[0],u=t[i],a=l.length-1,f=l[0],d=l[a];for(;o<=i&&c<=a;)null==r?r=t[++o]:null==u?u=t[--i]:null==f?f=l[++c]:null==d?d=l[--a]:j(r,f)?(M(r,f),r=t[++o],f=l[++c]):j(u,d)?(M(u,d),u=t[--i],d=l[--a]):j(r,d)?(M(r,d),e.insertBefore(r.m,u.m.nextSibling),r=t[++o],d=l[--a]):j(u,f)?(M(u,f),e.insertBefore(u.m,r.m),u=t[--i],f=l[++c]):(s=w(t&&t[c],n,c),f=l[++c],s&&r.m.parentNode.insertBefore(s,r.m));o>i?g(e,null==l[a+1]?null:l[a+1].m,n,l,c,a):c>a&&S(t,o,i)})(n,l,t,s):null!==s?(null!==e.i&&(n.textContent=""),g(n,null,t,s,0,s.length-1)):null!==l&&S(l,0,l.length-1)):e.i!==o&&(n.data=o)},v=e=>F(e).p,k=(e,t,n)=>{const l=v(e);return{emit:e=>C(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},C=(e,t,n)=>{const l=o.ce(t,n);return e.dispatchEvent(l),l},O=(e,t)=>{t&&!e.g&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.g=t)))},P=(e,t)=>{if(e.t|=16,!(4&e.t))return O(e,e.S),ee((()=>x(e,t)));e.t|=512},x=(e,t)=>{const n=e.j;let l;return t&&(l=T(n,"componentWillLoad")),W(l,(()=>E(e,n,t)))},E=async(e,t,n)=>{const l=e.p,o=l["s-rc"];n&&(e=>{const t=e.M,n=e.p,l=t.t,o=((e,t)=>{let n=u(t),l=I.get(n);if(e=11===e.nodeType?e:s,l)if("string"==typeof l){let t,o=r.get(e=e.head||e);o||r.set(e,o=new Set),o.has(n)||(t=s.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),o&&o.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);L(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>N(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},L=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.p,o=n.M,c=n.v||h(null,null),i=(e=>e&&e.$===$)(l)?l:d(null,null,l);t=s.tagName,o.k&&(i.u=i.u||{},o.k.map((([e,t])=>i.u[t]=s[e]))),i.$=null,i.t|=4,n.v=i,i.m=c.m=s.shadowRoot||s,e=s["s-sc"],M(c,i)})(n,l)}catch(e){z(e,n.p)}return null},N=e=>{const t=e.p,n=e.S;T(e.j,"componentDidRender"),64&e.t||(e.t|=64,A(t),e.C(t),n||R()),e.g&&(e.g(),e.g=void 0),512&e.t&&Z((()=>P(e,!1))),e.t&=-517},R=()=>{A(s.documentElement),Z((()=>C(l,"appload",{detail:{namespace:"casino-engagement-suite-challenges-details"}})))},T=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){z(e)}},W=(e,t)=>e&&e.then?e.then(t):t(),A=e=>e.classList.add("hydrated"),U=(e,t,n)=>{if(t.O){e.watchers&&(t.P=e.watchers);const l=Object.entries(t.O),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>F(this).L.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=F(e),o=s.p,c=s.L.get(t),i=s.t,r=s.j;if(n=((e,t)=>null==e||f(e)?e:1&t?e+"":e)(n,l.O[t][0]),(!(8&i)||void 0===c)&&n!==c&&(!Number.isNaN(c)||!Number.isNaN(n))&&(s.L.set(t,n),r)){if(l.P&&128&i){const e=l.P[t];e&&e.map((e=>{try{r[e](n,c,t)}catch(e){z(e,o)}}))}2==(18&i)&&P(s,!1)}})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const n=new Map;s.attributeChangedCallback=function(e,t,l){o.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(s.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==l)return;this[t]=(null!==l||"boolean"!=typeof this[t])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,l])=>{const s=l[1]||e;return n.set(s,e),512&l[0]&&t.k.push([e,s]),s}))}}return e},q=(e,t={})=>{const n=[],c=t.exclude||[],r=l.customElements,a=s.head,f=a.querySelector("meta[charset]"),d=s.createElement("style"),h=[];let $,m=!0;Object.assign(o,t),o.l=new URL(t.resourcesUrl||"./",s.baseURI).href,e.map((e=>{e[1].map((t=>{const l={t:t[0],o:t[1],O:t[2],N:t[3]};l.O=t[2],l.k=[],l.P={};const s=l.o,a=class extends HTMLElement{constructor(e){super(e),V(e=this,l),1&l.t&&e.attachShadow({mode:"open"})}connectedCallback(){$&&(clearTimeout($),$=null),m?h.push(this):o.jmp((()=>(e=>{if(0==(1&o.t)){const t=F(e),n=t.M,l=()=>{};if(!(1&t.t)){t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){O(t,t.S=n);break}}n.O&&Object.entries(n.O).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=G(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(n.P=s.watchers,U(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){z(e)}t.t&=-9,t.t|=128,e()}if(s.style){let e=s.style;const t=u(n);if(!I.has(t)){const l=()=>{};((e,t,n)=>{let l=I.get(e);i&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,I.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.S,c=()=>P(t,!0);o&&o["s-rc"]?o["s-rc"].push(c):c()})(0,t,n)}l()}})(this)))}disconnectedCallback(){o.jmp((()=>{}))}componentOnReady(){return F(this).R}};l.T=e[0],c.includes(s)||r.get(s)||(n.push(s),r.define(s,U(a,l,1)))}))})),d.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",d.setAttribute("data-styles",""),a.insertBefore(d,f?f.nextSibling:a.firstChild),m=!1,h.length?h.map((e=>e.connectedCallback())):o.jmp((()=>$=setTimeout(R,30)))},D=new WeakMap,F=e=>D.get(e),H=(e,t)=>D.set(t.j=e,t),V=(e,t)=>{const n={t:0,p:e,M:t,L:new Map};return n.R=new Promise((e=>n.C=e)),e["s-p"]=[],e["s-rc"]=[],D.set(e,n)},_=(e,t)=>t in e,z=(e,t)=>(0,console.error)(e,t),B=new Map,G=e=>{const t=e.o.replace(/-/g,"_"),n=e.T,l=B.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(B.set(n,e),e[t])),z)},I=new Map,J=[],K=[],Q=(e,t)=>l=>{e.push(l),n||(n=!0,t&&4&o.t?Z(Y):o.raf(Y))},X=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){z(e)}e.length=0},Y=()=>{X(J),X(K),(n=J.length>0)&&o.raf(Y)},Z=e=>c().then(e),ee=Q(K,!0);export{q as b,k as c,v as g,d as h,c as p,H as r}
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-ec28d374.js');
|
|
6
|
-
|
|
7
|
-
const DEFAULT_LANGUAGE = 'en';
|
|
8
|
-
const SUPPORTED_LANGUAGES = ['en'];
|
|
9
|
-
const TRANSLATIONS = {
|
|
10
|
-
en: {
|
|
11
|
-
challenges: 'Challenges',
|
|
12
|
-
join: 'Join',
|
|
13
|
-
unjoin: 'Unjoin',
|
|
14
|
-
details: 'Challenge Details',
|
|
15
|
-
tc: 'Terms & Conditions',
|
|
16
|
-
level: 'Level',
|
|
17
|
-
place: 'Place',
|
|
18
|
-
bet: 'bet',
|
|
19
|
-
bets: 'bets',
|
|
20
|
-
win: 'Win'
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
const translate = (key, customLang) => {
|
|
24
|
-
const lang = customLang;
|
|
25
|
-
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
var ChallengeLevelProgressStatus;
|
|
29
|
-
(function (ChallengeLevelProgressStatus) {
|
|
30
|
-
ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["Closed"] = 0] = "Closed";
|
|
31
|
-
ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["InProgress"] = 1] = "InProgress";
|
|
32
|
-
ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["Fillup"] = 2] = "Fillup";
|
|
33
|
-
ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["Completed"] = 3] = "Completed";
|
|
34
|
-
})(ChallengeLevelProgressStatus || (ChallengeLevelProgressStatus = {}));
|
|
35
|
-
var ChallengeProgressStatus;
|
|
36
|
-
(function (ChallengeProgressStatus) {
|
|
37
|
-
ChallengeProgressStatus[ChallengeProgressStatus["Started"] = 0] = "Started";
|
|
38
|
-
ChallengeProgressStatus[ChallengeProgressStatus["InProgress"] = 1] = "InProgress";
|
|
39
|
-
ChallengeProgressStatus[ChallengeProgressStatus["PendingLevelReward"] = 2] = "PendingLevelReward";
|
|
40
|
-
ChallengeProgressStatus[ChallengeProgressStatus["Completed"] = 3] = "Completed";
|
|
41
|
-
ChallengeProgressStatus[ChallengeProgressStatus["Expired"] = 4] = "Expired";
|
|
42
|
-
})(ChallengeProgressStatus || (ChallengeProgressStatus = {}));
|
|
43
|
-
|
|
44
|
-
const casinoEngagementSuiteChallengesDetailsCss = "@import url(\"https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;900&display=swap\"); :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}.ChallengeDetailsPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative}.ChallengeActions{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.ChallengeActions .ChallengeIconButton{width:16px;height:16px;cursor:pointer}.ChallengeActions .ChallengePopupName{color:var(--emw--color-gray-100, #BBB9C3);font-size:16px;font-weight:500;line-height:16px}.ChallengeDetails{padding:0px 19px 10px;overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.ChallengeDetails::-webkit-scrollbar{display:none}.ChallengeDetailsHeader{display:flex;justify-content:space-between;gap:12px}.ChallengeDetailsHeader .ChallengeName{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}.ChallengeJoinButton.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}.ChallengeJoinButton{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:88px;height:32px;font-size:14px;font-weight:700;position:relative;font-family:\"Montserrat\", sans-serif}.ChallengeJoinButton.Joined{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}.ChallengeJoinButton.Joined::before{border-radius:99px}.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.ChallengeCountdown{font-weight:var(--emw--font-weight-normal, 400);font-size:var(--emw--font-size-x-small, 12px);line-height:12px;margin:12px 0 24px;color:var(--emw--color-gray-150, #BBB9C3)}.ChallengeCountdown.Expired{font-weight:var(--emw--font-weight-normal, 700);color:var(--emfe-w-color-white, #FFF)}.ChallengeCollapseButton{margin-bottom:14px;display:flex;flex-direction:row;align-items:center;color:var(--emw--color-primary-variant, #666178);cursor:pointer}.ChallengeCollapseButton .Toggle{width:16px;height:16px;display:block;margin-right:4px}.ChallengeCollapseButton .Closed{background:url(\"https://static.everymatrix.com/gic/img/engagement-suite/eye-closed.svg\") no-repeat center/contain}.ChallengeCollapseButton .Open{background:url(\"https://static.everymatrix.com/gic/img/engagement-suite/eye-open.svg\") no-repeat center/contain}.CollapseDetails{display:none;font-size:var(--emw--font-size-small, 14px);line-height:17px;font-weight:var(--emw--font-weight-normal, 400)}.CollapseDetails .ChallengeDescription{color:var(--emfe-w-color-white, #FFF);margin-bottom:12px}.CollapseDetails .TC{margin:12px 0 16px}.CollapseDetails .TC a{color:var(--emw--color-secondary, #59D1FF)}.CollapseDetails .ChallengeGames{width:100%;overflow-y:auto;display:flex;gap:4px}.CollapseDetails .ChallengeGames::-webkit-scrollbar{height:2px;background:none}.CollapseDetails .ChallengeGames::-webkit-scrollbar-thumb{border-radius:4px;background-color:var(--emw--color-background, #666178)}.CollapseDetails .ChallengeGames .Game img{width:96px;height:50px;border-radius:2px;cursor:pointer}.ShowDetails{display:block}.ChallengeLevels{display:flex;flex-direction:column;gap:16px;margin-top:24px;color:var(--emw--color-primary, #8F8B9C);font-size:var(--emw--font-size-small, 12px);font-weight:var(--emw--font-weight-normal, 400);line-height:12px}.ChallengeLevels .ChallengeLevelCard{border:1px solid var(--emw--button-border-color, #403956);padding:16px;border-radius:8px}.ChallengeLevels .ChallengeLevelCard .ChallengeRewardMessage{margin-top:10px;display:flex;flex-direction:row;align-items:center;gap:4px}.ChallengeLevels .ChallengeLevelCard .ChallengeRewardMessage .CustomRewardMessage{font-weight:var(--emw--font-weight-semibold, 600);line-height:15px;word-break:break-all}.ChallengeLevels .InProgress{position:relative;border:none}.ChallengeLevels .InProgress .ChallengeLevelTarget,.ChallengeLevels .InProgress .CustomRewardMessage{color:var(--emfe-w-color-white, #FFF)}.ChallengeLevels .InProgress::before{content:\"\";position:absolute;inset:0;border-radius:8px;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}.ChallengeDetailsPopup.Tablet .ChallengeIconButton,.ChallengeDetailsPopup.Desktop .ChallengeIconButton{width:24px;height:24px}.ChallengeDetailsPopup.Tablet .ChallengeDetails,.ChallengeDetailsPopup.Desktop .ChallengeDetails{padding:20px 24px}.ChallengeDetailsPopup.Tablet .ChallengeName,.ChallengeDetailsPopup.Desktop .ChallengeName{line-height:27px;font-size:22px}.ChallengeDetailsPopup.Tablet .ChallengeJoinButton,.ChallengeDetailsPopup.Desktop .ChallengeJoinButton{min-width:100px;height:36px;font-size:16px}.ChallengeDetailsPopup.Tablet .ChallengeCountdown,.ChallengeDetailsPopup.Tablet .ChallengeLevels,.ChallengeDetailsPopup.Desktop .ChallengeCountdown,.ChallengeDetailsPopup.Desktop .ChallengeLevels{font-size:var(--emw--font-size-small, 14px);line-height:14px}.ChallengeDetailsPopup.Tablet .ChallengeCollapseButton,.ChallengeDetailsPopup.Desktop .ChallengeCollapseButton{margin-bottom:12px}.ChallengeDetailsPopup.Tablet .ChallengeLevels .CustomRewardMessage,.ChallengeDetailsPopup.Desktop .ChallengeLevels .CustomRewardMessage{line-height:17px}";
|
|
45
|
-
|
|
46
|
-
const CasinoEngagementSuiteChallengesDetails = class {
|
|
47
|
-
constructor(hostRef) {
|
|
48
|
-
index.registerInstance(this, hostRef);
|
|
49
|
-
this.close = index.createEvent(this, "close", 7);
|
|
50
|
-
/**
|
|
51
|
-
* Client custom styling via string
|
|
52
|
-
*/
|
|
53
|
-
this.clientStyling = '';
|
|
54
|
-
/**
|
|
55
|
-
* Client custom styling via url
|
|
56
|
-
*/
|
|
57
|
-
this.clientStylingUrl = '';
|
|
58
|
-
/**
|
|
59
|
-
* Language of the widget
|
|
60
|
-
*/
|
|
61
|
-
this.language = 'en';
|
|
62
|
-
/**
|
|
63
|
-
* Current game slug
|
|
64
|
-
*/
|
|
65
|
-
this.gameSlug = '';
|
|
66
|
-
/**
|
|
67
|
-
* User's device type
|
|
68
|
-
*/
|
|
69
|
-
this.device = 'Mobile';
|
|
70
|
-
this.limitStylingAppends = false;
|
|
71
|
-
this.timer = '';
|
|
72
|
-
this.showDetails = false;
|
|
73
|
-
this.isExpiredChallenge = false;
|
|
74
|
-
this.setClientStyling = () => {
|
|
75
|
-
let sheet = document.createElement('style');
|
|
76
|
-
sheet.innerHTML = this.clientStyling;
|
|
77
|
-
this.host.prepend(sheet);
|
|
78
|
-
};
|
|
79
|
-
this.setClientStylingURL = () => {
|
|
80
|
-
let url = new URL(this.clientStylingUrl);
|
|
81
|
-
let cssFile = document.createElement('style');
|
|
82
|
-
fetch(url.href)
|
|
83
|
-
.then((res) => res.text())
|
|
84
|
-
.then((data) => {
|
|
85
|
-
cssFile.innerHTML = data;
|
|
86
|
-
setTimeout(() => { this.host.prepend(cssFile); }, 1);
|
|
87
|
-
})
|
|
88
|
-
.catch((err) => {
|
|
89
|
-
console.log('Error ', err);
|
|
90
|
-
});
|
|
91
|
-
};
|
|
92
|
-
this.handleCloseClick = () => {
|
|
93
|
-
this.close.emit();
|
|
94
|
-
clearInterval(this.interval);
|
|
95
|
-
this.isExpiredChallenge = false;
|
|
96
|
-
this.showDetails = false;
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
challengePropHandler() {
|
|
100
|
-
this.updateTimer();
|
|
101
|
-
this.startCountdown();
|
|
102
|
-
}
|
|
103
|
-
componentWillLoad() {
|
|
104
|
-
this.challengePropHandler();
|
|
105
|
-
}
|
|
106
|
-
componentDidRender() {
|
|
107
|
-
if (!this.limitStylingAppends && this.host) {
|
|
108
|
-
if (this.clientStyling)
|
|
109
|
-
this.setClientStyling();
|
|
110
|
-
if (this.clientStylingUrl)
|
|
111
|
-
this.setClientStylingURL();
|
|
112
|
-
this.limitStylingAppends = true;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
getActionsTemplate() {
|
|
116
|
-
return (index.h("header", { class: "ChallengeActions" }, index.h("button", { class: "ChallengeIconButton" }, index.h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/back.svg", alt: "back" })), this.device !== 'Mobile' && index.h("div", { class: "ChallengePopupName" }, translate('challenges', this.language)), index.h("button", { class: "ChallengeIconButton", onClick: this.handleCloseClick }, index.h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", alt: "close" }))));
|
|
117
|
-
}
|
|
118
|
-
getChallengeHeader() {
|
|
119
|
-
const presentationName = this.challenge.ChallengePresentation.PresentationName;
|
|
120
|
-
const inProgressChallenge = this.challenge.Status === ChallengeProgressStatus.InProgress;
|
|
121
|
-
return (index.h("div", { class: "ChallengeDetailsHeader" }, index.h("span", { class: "ChallengeName" }, presentationName), index.h("button", { class: `ChallengeJoinButton ${inProgressChallenge ? 'Joined' : ''}
|
|
122
|
-
${this.isExpiredChallenge ? 'Disabled' : ''}` }, inProgressChallenge
|
|
123
|
-
? translate('unjoin', this.language)
|
|
124
|
-
: translate('join', this.language))));
|
|
125
|
-
}
|
|
126
|
-
getChallengeCountdown() {
|
|
127
|
-
const timerMessage = this.isExpiredChallenge ? 'Expired' : this.timer;
|
|
128
|
-
return (index.h("div", { class: `ChallengeCountdown ${this.isExpiredChallenge ? 'Expired' : ''}` }, timerMessage));
|
|
129
|
-
}
|
|
130
|
-
getChallengeDetails() {
|
|
131
|
-
const description = this.challenge.ChallengePresentation.Description;
|
|
132
|
-
const url = this.challenge.ChallengePresentation.Url;
|
|
133
|
-
const games = this.challenge.Games;
|
|
134
|
-
return (index.h("div", { class: `CollapseDetails ${this.showDetails ? 'ShowDetails' : ''}` }, description && index.h("span", { class: "ChallengeDescription" }, description), url && (index.h("div", { class: "TC" }, index.h("a", { href: url, target: "_blank" }, translate('tc', this.language)))), (games === null || games === void 0 ? void 0 : games.length) && (index.h("div", { class: "ChallengeGames" }, games.map((game) => (index.h("div", { class: "Game" }, index.h("img", { src: game.GameIcon, alt: game.GameName, onClick: () => this.onGameClick(game.GameSlug), class: `${game.GameSlug === this.gameSlug ? 'Disabled' : ''}` }))))))));
|
|
135
|
-
}
|
|
136
|
-
onGameClick(gameSlug) {
|
|
137
|
-
window.postMessage({ type: 'GameClick', slug: gameSlug });
|
|
138
|
-
}
|
|
139
|
-
startCountdown() {
|
|
140
|
-
this.interval = setInterval(() => {
|
|
141
|
-
this.updateTimer();
|
|
142
|
-
}, 1000);
|
|
143
|
-
}
|
|
144
|
-
updateTimer() {
|
|
145
|
-
const expirationTime = new Date(this.challenge.ExpirationTime).getTime();
|
|
146
|
-
const now = new Date().getTime();
|
|
147
|
-
const distance = expirationTime - now;
|
|
148
|
-
if (distance < 1) {
|
|
149
|
-
clearInterval(this.interval);
|
|
150
|
-
this.timer = '';
|
|
151
|
-
this.isExpiredChallenge = true;
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
const { days, hours, minutes, seconds } = {
|
|
155
|
-
days: String(Math.floor(distance / (1000 * 60 * 60 * 24))).padStart(2, '0'),
|
|
156
|
-
hours: String(Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))).padStart(2, '0'),
|
|
157
|
-
minutes: String(Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60))).padStart(2, '0'),
|
|
158
|
-
seconds: String(Math.floor((distance % (1000 * 60)) / 1000)).padStart(2, '0')
|
|
159
|
-
};
|
|
160
|
-
this.timer = days === '00'
|
|
161
|
-
? `${hours}h:${minutes}m:${seconds}s`
|
|
162
|
-
: `${days}d:${hours}h:${minutes}m`;
|
|
163
|
-
}
|
|
164
|
-
getLevelTarget(level) {
|
|
165
|
-
let levelTarget = `${translate('place', this.language)} ${level.TargetTurnover}`;
|
|
166
|
-
if (level.LevelTargetType === 1) {
|
|
167
|
-
levelTarget += ` ${translate('bet', this.language)}`;
|
|
168
|
-
}
|
|
169
|
-
else if (level.LevelTargetType === 2) {
|
|
170
|
-
levelTarget += ` ${translate('bets', this.language)} X ${level.TargetBetCount}`;
|
|
171
|
-
}
|
|
172
|
-
return (index.h("span", { class: "ChallengeLevelTarget" }, levelTarget));
|
|
173
|
-
}
|
|
174
|
-
getChallengeLevels() {
|
|
175
|
-
return (index.h("div", { class: "ChallengeLevels" }, this.challenge.LevelProgresses.map((level, index$1) => (index.h("div", { class: `ChallengeLevelCard ${level.ProgressStatus === 1 ? 'InProgress' : ''}` }, index.h("div", { class: "ChallengeLevelHeader" }, index.h("span", null, "Level ", index$1 + 1, ": "), this.getLevelTarget(level)), index.h("div", { class: "ChallengeRewardMessage" }, index.h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/reward.svg", alt: "win" }), index.h("span", null, translate('win', this.language), ": "), index.h("span", { class: "CustomRewardMessage" }, level.CustomRewardMessage)))))));
|
|
176
|
-
}
|
|
177
|
-
getToggleButton() {
|
|
178
|
-
return (index.h("div", { class: "ChallengeCollapseButton", onClick: () => this.showDetails = !this.showDetails }, index.h("span", { class: `Toggle ${this.showDetails ? 'Closed' : 'Open'}` }), index.h("span", null, translate('details', this.language))));
|
|
179
|
-
}
|
|
180
|
-
render() {
|
|
181
|
-
return index.h("div", { class: `ChallengeDetailsPopup ${this.device}` }, this.getActionsTemplate(), index.h("div", { class: "ChallengeDetails" }, this.getChallengeHeader(), this.getChallengeCountdown(), this.getToggleButton(), this.getChallengeDetails(), this.getChallengeLevels()));
|
|
182
|
-
}
|
|
183
|
-
get host() { return index.getElement(this); }
|
|
184
|
-
static get watchers() { return {
|
|
185
|
-
"challenge": ["challengePropHandler"]
|
|
186
|
-
}; }
|
|
187
|
-
};
|
|
188
|
-
CasinoEngagementSuiteChallengesDetails.style = casinoEngagementSuiteChallengesDetailsCss;
|
|
189
|
-
|
|
190
|
-
exports.casino_engagement_suite_challenges_details = CasinoEngagementSuiteChallengesDetails;
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-13f457d0.js';
|
|
2
|
-
|
|
3
|
-
const DEFAULT_LANGUAGE = 'en';
|
|
4
|
-
const SUPPORTED_LANGUAGES = ['en'];
|
|
5
|
-
const TRANSLATIONS = {
|
|
6
|
-
en: {
|
|
7
|
-
challenges: 'Challenges',
|
|
8
|
-
join: 'Join',
|
|
9
|
-
unjoin: 'Unjoin',
|
|
10
|
-
details: 'Challenge Details',
|
|
11
|
-
tc: 'Terms & Conditions',
|
|
12
|
-
level: 'Level',
|
|
13
|
-
place: 'Place',
|
|
14
|
-
bet: 'bet',
|
|
15
|
-
bets: 'bets',
|
|
16
|
-
win: 'Win'
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
const translate = (key, customLang) => {
|
|
20
|
-
const lang = customLang;
|
|
21
|
-
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
var ChallengeLevelProgressStatus;
|
|
25
|
-
(function (ChallengeLevelProgressStatus) {
|
|
26
|
-
ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["Closed"] = 0] = "Closed";
|
|
27
|
-
ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["InProgress"] = 1] = "InProgress";
|
|
28
|
-
ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["Fillup"] = 2] = "Fillup";
|
|
29
|
-
ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["Completed"] = 3] = "Completed";
|
|
30
|
-
})(ChallengeLevelProgressStatus || (ChallengeLevelProgressStatus = {}));
|
|
31
|
-
var ChallengeProgressStatus;
|
|
32
|
-
(function (ChallengeProgressStatus) {
|
|
33
|
-
ChallengeProgressStatus[ChallengeProgressStatus["Started"] = 0] = "Started";
|
|
34
|
-
ChallengeProgressStatus[ChallengeProgressStatus["InProgress"] = 1] = "InProgress";
|
|
35
|
-
ChallengeProgressStatus[ChallengeProgressStatus["PendingLevelReward"] = 2] = "PendingLevelReward";
|
|
36
|
-
ChallengeProgressStatus[ChallengeProgressStatus["Completed"] = 3] = "Completed";
|
|
37
|
-
ChallengeProgressStatus[ChallengeProgressStatus["Expired"] = 4] = "Expired";
|
|
38
|
-
})(ChallengeProgressStatus || (ChallengeProgressStatus = {}));
|
|
39
|
-
|
|
40
|
-
const casinoEngagementSuiteChallengesDetailsCss = "@import url(\"https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;900&display=swap\"); :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}.ChallengeDetailsPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative}.ChallengeActions{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.ChallengeActions .ChallengeIconButton{width:16px;height:16px;cursor:pointer}.ChallengeActions .ChallengePopupName{color:var(--emw--color-gray-100, #BBB9C3);font-size:16px;font-weight:500;line-height:16px}.ChallengeDetails{padding:0px 19px 10px;overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.ChallengeDetails::-webkit-scrollbar{display:none}.ChallengeDetailsHeader{display:flex;justify-content:space-between;gap:12px}.ChallengeDetailsHeader .ChallengeName{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}.ChallengeJoinButton.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}.ChallengeJoinButton{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:88px;height:32px;font-size:14px;font-weight:700;position:relative;font-family:\"Montserrat\", sans-serif}.ChallengeJoinButton.Joined{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}.ChallengeJoinButton.Joined::before{border-radius:99px}.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.ChallengeCountdown{font-weight:var(--emw--font-weight-normal, 400);font-size:var(--emw--font-size-x-small, 12px);line-height:12px;margin:12px 0 24px;color:var(--emw--color-gray-150, #BBB9C3)}.ChallengeCountdown.Expired{font-weight:var(--emw--font-weight-normal, 700);color:var(--emfe-w-color-white, #FFF)}.ChallengeCollapseButton{margin-bottom:14px;display:flex;flex-direction:row;align-items:center;color:var(--emw--color-primary-variant, #666178);cursor:pointer}.ChallengeCollapseButton .Toggle{width:16px;height:16px;display:block;margin-right:4px}.ChallengeCollapseButton .Closed{background:url(\"https://static.everymatrix.com/gic/img/engagement-suite/eye-closed.svg\") no-repeat center/contain}.ChallengeCollapseButton .Open{background:url(\"https://static.everymatrix.com/gic/img/engagement-suite/eye-open.svg\") no-repeat center/contain}.CollapseDetails{display:none;font-size:var(--emw--font-size-small, 14px);line-height:17px;font-weight:var(--emw--font-weight-normal, 400)}.CollapseDetails .ChallengeDescription{color:var(--emfe-w-color-white, #FFF);margin-bottom:12px}.CollapseDetails .TC{margin:12px 0 16px}.CollapseDetails .TC a{color:var(--emw--color-secondary, #59D1FF)}.CollapseDetails .ChallengeGames{width:100%;overflow-y:auto;display:flex;gap:4px}.CollapseDetails .ChallengeGames::-webkit-scrollbar{height:2px;background:none}.CollapseDetails .ChallengeGames::-webkit-scrollbar-thumb{border-radius:4px;background-color:var(--emw--color-background, #666178)}.CollapseDetails .ChallengeGames .Game img{width:96px;height:50px;border-radius:2px;cursor:pointer}.ShowDetails{display:block}.ChallengeLevels{display:flex;flex-direction:column;gap:16px;margin-top:24px;color:var(--emw--color-primary, #8F8B9C);font-size:var(--emw--font-size-small, 12px);font-weight:var(--emw--font-weight-normal, 400);line-height:12px}.ChallengeLevels .ChallengeLevelCard{border:1px solid var(--emw--button-border-color, #403956);padding:16px;border-radius:8px}.ChallengeLevels .ChallengeLevelCard .ChallengeRewardMessage{margin-top:10px;display:flex;flex-direction:row;align-items:center;gap:4px}.ChallengeLevels .ChallengeLevelCard .ChallengeRewardMessage .CustomRewardMessage{font-weight:var(--emw--font-weight-semibold, 600);line-height:15px;word-break:break-all}.ChallengeLevels .InProgress{position:relative;border:none}.ChallengeLevels .InProgress .ChallengeLevelTarget,.ChallengeLevels .InProgress .CustomRewardMessage{color:var(--emfe-w-color-white, #FFF)}.ChallengeLevels .InProgress::before{content:\"\";position:absolute;inset:0;border-radius:8px;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}.ChallengeDetailsPopup.Tablet .ChallengeIconButton,.ChallengeDetailsPopup.Desktop .ChallengeIconButton{width:24px;height:24px}.ChallengeDetailsPopup.Tablet .ChallengeDetails,.ChallengeDetailsPopup.Desktop .ChallengeDetails{padding:20px 24px}.ChallengeDetailsPopup.Tablet .ChallengeName,.ChallengeDetailsPopup.Desktop .ChallengeName{line-height:27px;font-size:22px}.ChallengeDetailsPopup.Tablet .ChallengeJoinButton,.ChallengeDetailsPopup.Desktop .ChallengeJoinButton{min-width:100px;height:36px;font-size:16px}.ChallengeDetailsPopup.Tablet .ChallengeCountdown,.ChallengeDetailsPopup.Tablet .ChallengeLevels,.ChallengeDetailsPopup.Desktop .ChallengeCountdown,.ChallengeDetailsPopup.Desktop .ChallengeLevels{font-size:var(--emw--font-size-small, 14px);line-height:14px}.ChallengeDetailsPopup.Tablet .ChallengeCollapseButton,.ChallengeDetailsPopup.Desktop .ChallengeCollapseButton{margin-bottom:12px}.ChallengeDetailsPopup.Tablet .ChallengeLevels .CustomRewardMessage,.ChallengeDetailsPopup.Desktop .ChallengeLevels .CustomRewardMessage{line-height:17px}";
|
|
41
|
-
|
|
42
|
-
const CasinoEngagementSuiteChallengesDetails = class {
|
|
43
|
-
constructor(hostRef) {
|
|
44
|
-
registerInstance(this, hostRef);
|
|
45
|
-
this.close = createEvent(this, "close", 7);
|
|
46
|
-
/**
|
|
47
|
-
* Client custom styling via string
|
|
48
|
-
*/
|
|
49
|
-
this.clientStyling = '';
|
|
50
|
-
/**
|
|
51
|
-
* Client custom styling via url
|
|
52
|
-
*/
|
|
53
|
-
this.clientStylingUrl = '';
|
|
54
|
-
/**
|
|
55
|
-
* Language of the widget
|
|
56
|
-
*/
|
|
57
|
-
this.language = 'en';
|
|
58
|
-
/**
|
|
59
|
-
* Current game slug
|
|
60
|
-
*/
|
|
61
|
-
this.gameSlug = '';
|
|
62
|
-
/**
|
|
63
|
-
* User's device type
|
|
64
|
-
*/
|
|
65
|
-
this.device = 'Mobile';
|
|
66
|
-
this.limitStylingAppends = false;
|
|
67
|
-
this.timer = '';
|
|
68
|
-
this.showDetails = false;
|
|
69
|
-
this.isExpiredChallenge = false;
|
|
70
|
-
this.setClientStyling = () => {
|
|
71
|
-
let sheet = document.createElement('style');
|
|
72
|
-
sheet.innerHTML = this.clientStyling;
|
|
73
|
-
this.host.prepend(sheet);
|
|
74
|
-
};
|
|
75
|
-
this.setClientStylingURL = () => {
|
|
76
|
-
let url = new URL(this.clientStylingUrl);
|
|
77
|
-
let cssFile = document.createElement('style');
|
|
78
|
-
fetch(url.href)
|
|
79
|
-
.then((res) => res.text())
|
|
80
|
-
.then((data) => {
|
|
81
|
-
cssFile.innerHTML = data;
|
|
82
|
-
setTimeout(() => { this.host.prepend(cssFile); }, 1);
|
|
83
|
-
})
|
|
84
|
-
.catch((err) => {
|
|
85
|
-
console.log('Error ', err);
|
|
86
|
-
});
|
|
87
|
-
};
|
|
88
|
-
this.handleCloseClick = () => {
|
|
89
|
-
this.close.emit();
|
|
90
|
-
clearInterval(this.interval);
|
|
91
|
-
this.isExpiredChallenge = false;
|
|
92
|
-
this.showDetails = false;
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
challengePropHandler() {
|
|
96
|
-
this.updateTimer();
|
|
97
|
-
this.startCountdown();
|
|
98
|
-
}
|
|
99
|
-
componentWillLoad() {
|
|
100
|
-
this.challengePropHandler();
|
|
101
|
-
}
|
|
102
|
-
componentDidRender() {
|
|
103
|
-
if (!this.limitStylingAppends && this.host) {
|
|
104
|
-
if (this.clientStyling)
|
|
105
|
-
this.setClientStyling();
|
|
106
|
-
if (this.clientStylingUrl)
|
|
107
|
-
this.setClientStylingURL();
|
|
108
|
-
this.limitStylingAppends = true;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
getActionsTemplate() {
|
|
112
|
-
return (h("header", { class: "ChallengeActions" }, h("button", { class: "ChallengeIconButton" }, h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/back.svg", alt: "back" })), this.device !== 'Mobile' && h("div", { class: "ChallengePopupName" }, translate('challenges', this.language)), h("button", { class: "ChallengeIconButton", onClick: this.handleCloseClick }, h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", alt: "close" }))));
|
|
113
|
-
}
|
|
114
|
-
getChallengeHeader() {
|
|
115
|
-
const presentationName = this.challenge.ChallengePresentation.PresentationName;
|
|
116
|
-
const inProgressChallenge = this.challenge.Status === ChallengeProgressStatus.InProgress;
|
|
117
|
-
return (h("div", { class: "ChallengeDetailsHeader" }, h("span", { class: "ChallengeName" }, presentationName), h("button", { class: `ChallengeJoinButton ${inProgressChallenge ? 'Joined' : ''}
|
|
118
|
-
${this.isExpiredChallenge ? 'Disabled' : ''}` }, inProgressChallenge
|
|
119
|
-
? translate('unjoin', this.language)
|
|
120
|
-
: translate('join', this.language))));
|
|
121
|
-
}
|
|
122
|
-
getChallengeCountdown() {
|
|
123
|
-
const timerMessage = this.isExpiredChallenge ? 'Expired' : this.timer;
|
|
124
|
-
return (h("div", { class: `ChallengeCountdown ${this.isExpiredChallenge ? 'Expired' : ''}` }, timerMessage));
|
|
125
|
-
}
|
|
126
|
-
getChallengeDetails() {
|
|
127
|
-
const description = this.challenge.ChallengePresentation.Description;
|
|
128
|
-
const url = this.challenge.ChallengePresentation.Url;
|
|
129
|
-
const games = this.challenge.Games;
|
|
130
|
-
return (h("div", { class: `CollapseDetails ${this.showDetails ? 'ShowDetails' : ''}` }, description && h("span", { class: "ChallengeDescription" }, description), url && (h("div", { class: "TC" }, h("a", { href: url, target: "_blank" }, translate('tc', this.language)))), (games === null || games === void 0 ? void 0 : games.length) && (h("div", { class: "ChallengeGames" }, games.map((game) => (h("div", { class: "Game" }, h("img", { src: game.GameIcon, alt: game.GameName, onClick: () => this.onGameClick(game.GameSlug), class: `${game.GameSlug === this.gameSlug ? 'Disabled' : ''}` }))))))));
|
|
131
|
-
}
|
|
132
|
-
onGameClick(gameSlug) {
|
|
133
|
-
window.postMessage({ type: 'GameClick', slug: gameSlug });
|
|
134
|
-
}
|
|
135
|
-
startCountdown() {
|
|
136
|
-
this.interval = setInterval(() => {
|
|
137
|
-
this.updateTimer();
|
|
138
|
-
}, 1000);
|
|
139
|
-
}
|
|
140
|
-
updateTimer() {
|
|
141
|
-
const expirationTime = new Date(this.challenge.ExpirationTime).getTime();
|
|
142
|
-
const now = new Date().getTime();
|
|
143
|
-
const distance = expirationTime - now;
|
|
144
|
-
if (distance < 1) {
|
|
145
|
-
clearInterval(this.interval);
|
|
146
|
-
this.timer = '';
|
|
147
|
-
this.isExpiredChallenge = true;
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
const { days, hours, minutes, seconds } = {
|
|
151
|
-
days: String(Math.floor(distance / (1000 * 60 * 60 * 24))).padStart(2, '0'),
|
|
152
|
-
hours: String(Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))).padStart(2, '0'),
|
|
153
|
-
minutes: String(Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60))).padStart(2, '0'),
|
|
154
|
-
seconds: String(Math.floor((distance % (1000 * 60)) / 1000)).padStart(2, '0')
|
|
155
|
-
};
|
|
156
|
-
this.timer = days === '00'
|
|
157
|
-
? `${hours}h:${minutes}m:${seconds}s`
|
|
158
|
-
: `${days}d:${hours}h:${minutes}m`;
|
|
159
|
-
}
|
|
160
|
-
getLevelTarget(level) {
|
|
161
|
-
let levelTarget = `${translate('place', this.language)} ${level.TargetTurnover}`;
|
|
162
|
-
if (level.LevelTargetType === 1) {
|
|
163
|
-
levelTarget += ` ${translate('bet', this.language)}`;
|
|
164
|
-
}
|
|
165
|
-
else if (level.LevelTargetType === 2) {
|
|
166
|
-
levelTarget += ` ${translate('bets', this.language)} X ${level.TargetBetCount}`;
|
|
167
|
-
}
|
|
168
|
-
return (h("span", { class: "ChallengeLevelTarget" }, levelTarget));
|
|
169
|
-
}
|
|
170
|
-
getChallengeLevels() {
|
|
171
|
-
return (h("div", { class: "ChallengeLevels" }, this.challenge.LevelProgresses.map((level, index) => (h("div", { class: `ChallengeLevelCard ${level.ProgressStatus === 1 ? 'InProgress' : ''}` }, h("div", { class: "ChallengeLevelHeader" }, h("span", null, "Level ", index + 1, ": "), this.getLevelTarget(level)), h("div", { class: "ChallengeRewardMessage" }, h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/reward.svg", alt: "win" }), h("span", null, translate('win', this.language), ": "), h("span", { class: "CustomRewardMessage" }, level.CustomRewardMessage)))))));
|
|
172
|
-
}
|
|
173
|
-
getToggleButton() {
|
|
174
|
-
return (h("div", { class: "ChallengeCollapseButton", onClick: () => this.showDetails = !this.showDetails }, h("span", { class: `Toggle ${this.showDetails ? 'Closed' : 'Open'}` }), h("span", null, translate('details', this.language))));
|
|
175
|
-
}
|
|
176
|
-
render() {
|
|
177
|
-
return h("div", { class: `ChallengeDetailsPopup ${this.device}` }, this.getActionsTemplate(), h("div", { class: "ChallengeDetails" }, this.getChallengeHeader(), this.getChallengeCountdown(), this.getToggleButton(), this.getChallengeDetails(), this.getChallengeLevels()));
|
|
178
|
-
}
|
|
179
|
-
get host() { return getElement(this); }
|
|
180
|
-
static get watchers() { return {
|
|
181
|
-
"challenge": ["challengePropHandler"]
|
|
182
|
-
}; }
|
|
183
|
-
};
|
|
184
|
-
CasinoEngagementSuiteChallengesDetails.style = casinoEngagementSuiteChallengesDetailsCss;
|
|
185
|
-
|
|
186
|
-
export { CasinoEngagementSuiteChallengesDetails as casino_engagement_suite_challenges_details };
|