@everymatrix/casino-engagement-suite-challenges-list 1.37.11 → 1.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/casino-engagement-suite-challenges-list/casino-engagement-suite-challenges-list.esm.js +1 -1
- package/dist/casino-engagement-suite-challenges-list/p-349891dd.js +1 -0
- package/dist/casino-engagement-suite-challenges-list/p-707aa4d8.entry.js +1 -0
- package/dist/cjs/casino-engagement-suite-challenges-list.cjs.js +2 -2
- package/dist/cjs/casino-engagement-suite-challenges-list_2.cjs.entry.js +14 -25
- package/dist/cjs/{index-0a011384.js → index-1216b764.js} +0 -57
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/casino-engagement-suite-challenges-list/casino-engagement-suite-challenges-list.css +21 -2
- package/dist/collection/components/casino-engagement-suite-challenges-list/casino-engagement-suite-challenges-list.js +28 -33
- package/dist/components/casino-engagement-suite-challenges-list.js +15 -27
- package/dist/esm/casino-engagement-suite-challenges-list.js +2 -2
- package/dist/esm/casino-engagement-suite-challenges-list_2.entry.js +14 -25
- package/dist/esm/{index-ddf7e990.js → index-ae2f8404.js} +0 -57
- package/dist/esm/loader.js +2 -2
- package/dist/types/components/casino-engagement-suite-challenges-list/casino-engagement-suite-challenges-list.d.ts +1 -2
- package/dist/types/components.d.ts +1 -0
- package/dist/types/models/challenge.d.ts +0 -4
- package/package.json +1 -1
- package/dist/casino-engagement-suite-challenges-list/p-3dd721f8.entry.js +0 -1
- package/dist/casino-engagement-suite-challenges-list/p-fad4589e.js +0 -1
package/dist/casino-engagement-suite-challenges-list/casino-engagement-suite-challenges-list.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as n}from"./p-
|
|
1
|
+
import{p as e,b as n}from"./p-349891dd.js";(()=>{const n=import.meta.url,i={};return""!==n&&(i.resourcesUrl=new URL(".",n).href),e(i)})().then((e=>n([["p-707aa4d8",[[1,"casino-engagement-suite-challenges-list",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[1],device:[1],challenges:[1040],isJoiningToChallenge:[1028,"is-joining-to-challenge"],inProgressChallenges:[1040],pausedChallengeIds:[16],tooltip:[32],timers:[32],limitStylingAppends:[32]}],[1,"casino-engagement-suite-progress-bar",{value:[2],disabled:[4],hidePercent:[4,"hide-percent"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],limitStylingAppends:[32]}]]]],e)));
|
|
@@ -0,0 +1 @@
|
|
|
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)},i=e=>Promise.resolve(e),c=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),r=new WeakMap,a=e=>"sc-"+e.o,u={},f=e=>"object"==(e=typeof e)||"function"===e,d=(e,t,...n)=>{let l=null,s=null,o=!1,i=!1,c=[];const r=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?r(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof e&&!f(l))&&(l+=""),o&&i?c[c.length-1].i+=l:c.push(o?$(null,l):l),i=o)};if(r(n),t){t.key&&(s=t.key);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}const a=$(e,null);return a.u=t,c.length>0&&(a.$=c),a.h=s,a},$=(e,t)=>({t:0,m:e,i:t,p:null,$:null,u:null,h:null}),h={},y=(e,t,n,s,i,c)=>{if(n!==s){let r=_(e,t),a=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("style"===t){for(const t in n)s&&null!=s[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in s)n&&s[t]===n[t]||(t.includes("-")?e.style.setProperty(t,s[t]):e.style[t]=s[t])}else if("key"===t);else if(r||"o"!==t[0]||"n"!==t[1]){const l=f(s);if((r||l&&null!==s)&&!i)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&c||i)&&!l&&e.setAttribute(t,s=!0===s?"":s)}else t="-"===t[2]?t.slice(3):_(l,a)?a.slice(2):a[2]+t.slice(3),n&&o.rel(e,t,n,!1),s&&o.ael(e,t,s,!1)}},m=/\s/,p=e=>e?e.split(m):[],b=(e,t,n,l)=>{const s=11===t.p.nodeType&&t.p.host?t.p.host:t.p,o=e&&e.u||u,i=t.u||u;for(l in o)l in i||y(s,l,o[l],void 0,n,t.t);for(l in i)y(s,l,o[l],i[l],n,t.t)},w=(t,n,l)=>{let o,i,c=n.$[l],r=0;if(null!==c.i)o=c.p=s.createTextNode(c.i);else if(o=c.p=s.createElement(c.m),b(null,c,!1),null!=e&&o["s-si"]!==e&&o.classList.add(o["s-si"]=e),c.$)for(r=0;r<c.$.length;++r)i=w(t,c,r),i&&o.appendChild(i);return o},g=(e,n,l,s,o,i)=>{let c,r=e;for(r.shadowRoot&&r.tagName===t&&(r=r.shadowRoot);o<=i;++o)s[o]&&(c=w(null,l,o),c&&(s[o].p=c,r.insertBefore(c,n)))},S=(e,t,n,l)=>{for(;t<=n;++t)(l=e[t])&&l.p.remove()},k=(e,t)=>e.m===t.m&&e.h===t.h,j=(e,t)=>{const n=t.p=e.p,l=e.$,s=t.$,o=t.i;null===o?("slot"===t.m||b(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o,i=0,c=0,r=0,a=0,u=t.length-1,f=t[0],d=t[u],$=l.length-1,h=l[0],y=l[$];for(;i<=u&&c<=$;)if(null==f)f=t[++i];else if(null==d)d=t[--u];else if(null==h)h=l[++c];else if(null==y)y=l[--$];else if(k(f,h))j(f,h),f=t[++i],h=l[++c];else if(k(d,y))j(d,y),d=t[--u],y=l[--$];else if(k(f,y))j(f,y),e.insertBefore(f.p,d.p.nextSibling),f=t[++i],y=l[--$];else if(k(d,h))j(d,h),e.insertBefore(d.p,f.p),d=t[--u],h=l[++c];else{for(r=-1,a=i;a<=u;++a)if(t[a]&&null!==t[a].h&&t[a].h===h.h){r=a;break}r>=0?(o=t[r],o.m!==h.m?s=w(t&&t[c],n,r):(j(o,h),t[r]=void 0,s=o.p),h=l[++c]):(s=w(t&&t[c],n,c),h=l[++c]),s&&f.p.parentNode.insertBefore(s,f.p)}i>u?g(e,null==l[$+1]?null:l[$+1].p,n,l,c,$):c>$&&S(t,i,u)})(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=>D(e).g,M=(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.S&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.S=t)))},P=(e,t)=>{if(e.t|=16,!(4&e.t))return O(e,e.k),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.g,o=l["s-rc"];n&&(e=>{const t=e.v,n=e.g,l=t.t,o=((e,t)=>{let n=a(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.g,o=n.v,i=n.M||$(null,null),c=(e=>e&&e.m===h)(l)?l:d(null,null,l);t=s.tagName,o.C&&(c.u=c.u||{},o.C.map((([e,t])=>c.u[t]=s[e]))),c.m=null,c.t|=4,n.M=c,c.p=i.p=s.shadowRoot||s,e=s["s-sc"],j(i,c)})(n,l)}catch(e){z(e,n.g)}return null},N=e=>{const t=e.g,n=e.k;T(e.j,"componentDidRender"),64&e.t||(e.t|=64,A(t),e.O(t),n||R()),e.S&&(e.S(),e.S=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-list"}})))},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"),F=(e,t,n)=>{if(t.P){e.watchers&&(t.L=e.watchers);const l=Object.entries(t.P),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>D(this).N.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=D(e),o=s.g,i=s.N.get(t),c=s.t,r=s.j;if(n=((e,t)=>null==e||f(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(n,l.P[t][0]),(!(8&c)||void 0===i)&&n!==i&&(!Number.isNaN(i)||!Number.isNaN(n))&&(s.N.set(t,n),r)){if(l.L&&128&c){const e=l.L[t];e&&e.map((e=>{try{r[e](n,i,t)}catch(e){z(e,o)}}))}2==(18&c)&&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.C.push([e,s]),s}))}}return e},U=(e,t={})=>{const n=[],i=t.exclude||[],r=l.customElements,u=s.head,f=u.querySelector("meta[charset]"),d=s.createElement("style"),$=[];let h,y=!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],P:t[2],R:t[3]};l.P=t[2],l.C=[],l.L={};const s=l.o,u=class extends HTMLElement{constructor(e){super(e),V(e=this,l),1&l.t&&e.attachShadow({mode:"open"})}connectedCallback(){h&&(clearTimeout(h),h=null),y?$.push(this):o.jmp((()=>(e=>{if(0==(1&o.t)){const t=D(e),n=t.v,l=()=>{};if(!(1&t.t)){t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){O(t,t.k=n);break}}n.P&&Object.entries(n.P).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.L=s.watchers,F(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=a(n);if(!I.has(t)){const l=()=>{};((e,t,n)=>{let l=I.get(e);c&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,I.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.k,i=()=>P(t,!0);o&&o["s-rc"]?o["s-rc"].push(i):i()})(0,t,n)}l()}})(this)))}disconnectedCallback(){o.jmp((()=>(()=>{0==(1&o.t)&&T(D(this).j,"disconnectedCallback")})()))}componentOnReady(){return D(this).T}};l.W=e[0],i.includes(s)||r.get(s)||(n.push(s),r.define(s,F(u,l,1)))}))})),d.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",d.setAttribute("data-styles",""),u.insertBefore(d,f?f.nextSibling:u.firstChild),y=!1,$.length?$.map((e=>e.connectedCallback())):o.jmp((()=>h=setTimeout(R,30)))},q=new WeakMap,D=e=>q.get(e),H=(e,t)=>q.set(t.j=e,t),V=(e,t)=>{const n={t:0,g:e,v:t,N:new Map};return n.T=new Promise((e=>n.O=e)),e["s-p"]=[],e["s-rc"]=[],q.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.W,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=>i().then(e),ee=Q(K,!0);export{U as b,M as c,v as g,d as h,i as p,H as r}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as t,h as s,g as o}from"./p-349891dd.js";var i,n;!function(e){e[e.Closed=0]="Closed",e[e.InProgress=1]="InProgress",e[e.Fillup=2]="Fillup",e[e.Completed=3]="Completed"}(i||(i={})),function(e){e[e.Started=0]="Started",e[e.InProgress=1]="InProgress",e[e.PendingLevelReward=2]="PendingLevelReward",e[e.Completed=3]="Completed",e[e.Expired=4]="Expired"}(n||(n={}));const l=["en"],a={en:{challenges:"Challenges",join:"Join",unjoin:"Unjoin",new:"new",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"}},r=(e,t)=>{const s=t;return a[void 0!==s&&l.includes(s)?s:"en"][e]},h=class{constructor(s){e(this,s),this.close=t(this,"close",7),this.resetNewChallengeLabel=t(this,"resetNewChallengeLabel",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.device="Mobile",this.challenges=[],this.pausedChallengeIds=[],this.tooltip=!1,this.timers={},this.limitStylingAppends=!1,this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))},this.handleCloseClick=()=>{this.close.emit(),this.tooltip=!1,this.resetNewChallengeLabel.emit("list")},this.handleChallengeClick=e=>{const t=e.currentTarget.getAttribute("data-id");window.postMessage({type:"ChallengeClick",id:t})},this.showTooltip=()=>{this.tooltip=!0},this.hideTooltip=()=>{this.tooltip=!1},this.changeChallengeStatus=e=>{var t,s;e.stopPropagation();const o=e.currentTarget.getAttribute("data-id");(null===(t=this.inProgressChallenges)||void 0===t?void 0:t.includes(o))?window.postMessage({type:"ShowConfirmationModal",ProgressToDeactivate:o}):(null===(s=this.inProgressChallenges)||void 0===s?void 0:s.length)>0?window.postMessage({type:"ShowConfirmationModal",ProgressToActivate:o,ProgressToDeactivate:this.inProgressChallenges[0]}):window.postMessage({type:"ChallengeJoinRequest",data:{ProgressToActivate:o}})}}challengesPropHandler(e){!this.interval&&e.length&&(this.updateTimers(),this.startCountdown()),this.interval&&!e.length&&clearInterval(this.interval)}componentWillLoad(){this.challengesPropHandler(this.challenges)}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}disconnectedCallback(){this.interval&&clearInterval(this.interval)}startCountdown(){this.interval=setInterval((()=>{this.updateTimers()}),1e3)}updateTimers(){const e=(new Date).getTime();this.timers=this.challenges.filter((e=>e.Status!==n.Expired)).reduce(((t,s)=>{const o=new Date(s.ExpirationTime).getTime()-e;let i="00h:00m:00s";if(o<1)this.removeChallenge(s.Id);else{const{days:e,hours:t,minutes:s,seconds:n}={days:String(Math.floor(o/864e5)).padStart(2,"0"),hours:String(Math.floor(o%864e5/36e5)).padStart(2,"0"),minutes:String(Math.floor(o%36e5/6e4)).padStart(2,"0"),seconds:String(Math.floor(o%6e4/1e3)).padStart(2,"0")};i="00"===e?`${t}h:${s}m:${n}s`:`${e}d:${t}h:${s}m`}return Object.assign(Object.assign({},t),{[s.Id]:i})}),{})}removeChallenge(e){const t=this.challenges.findIndex((t=>t.Id===e));t>-1&&(this.challenges.splice(t,1),window.postMessage({type:"ChallengeHasExpired",id:e}))}getChallengeClasses(e){return{ChallengeCard:!0,InProgress:e.Status===n.InProgress&&!this.pausedChallengeIds.includes(e.ChallengeId),Completed:this.isChallengeCompleted(e),Paused:this.isChallengePaused(e)}}isChallengePaused(e){return e.Status===n.Started&&e.LevelProgresses[0].ProgressPercentage>0||this.pausedChallengeIds.includes(e.ChallengeId)}isChallengeCompleted(e){return e.Status===n.Completed||e.Status===n.PendingLevelReward&&e.LevelProgresses.every((e=>100===e.ProgressPercentage))}getChallengeProgress(e){if(e.Status===n.Completed)return 100;if(this.isChallengePaused(e)||e.Status===n.PendingLevelReward||e.Status===n.InProgress){const t=e.LevelProgresses.find((e=>e.ProgressStatus===i.InProgress)),s=e.LevelProgresses.filter((e=>e.ProgressStatus===i.Fillup||e.ProgressStatus===i.Completed)).slice(-1)[0];return t?t.ProgressPercentage:s?s.ProgressPercentage:0}return-1}getChallengeHeaderTemplate(e){const{Id:t}=e,o=e.Status===n.InProgress||e.Status===n.PendingLevelReward;return s("div",{class:"ChallengeCardHeader"},s("div",{class:"ChallengeName"},e.ChallengePresentation.PresentationName),s("button",{class:`${o?"ChallengeJoinButton Joined":"ChallengeJoinButton"} ${this.isJoiningToChallenge||e.Status===n.Completed||this.isChallengePaused(e)?"Disabled":""}`,onClick:this.changeChallengeStatus,"data-id":t},r(o?"unjoin":"join",this.language)))}getChallengeTemplate(e){const t=this.getChallengeProgress(e),o=this.timers[e.Id],i=t>-1?s("casino-engagement-suite-progress-bar",{class:this.device,value:t,disabled:this.isChallengePaused(e)},s("span",{slot:"Title",class:"ChallengeCountdown"},o)):s("span",{class:"ChallengeCountdown"},o);return s("div",{class:this.getChallengeClasses(e),onClick:this.handleChallengeClick,key:e.Id,"data-id":e.Id},this.getChallengeHeaderTemplate(e),i,s("div",{class:"ChallengeLabel "+(e.IsNew?"ShowChallengeLabel":"")},s("span",null,r("new",this.language))))}getHeaderTemplate(){return s("header",{class:"ChallengesListPopupHeader"},s("button",{onClick:this.showTooltip,class:"ChallengesIconButton"},s("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/help.svg",alt:"Show tooltip"})),s("div",{class:"ChallengesListPopupHeaderName"},r("challenges",this.language)),s("button",{class:"ChallengesIconButton",onClick:this.handleCloseClick},s("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Close challenges list"})))}getListTemplate(){return this.challenges.length?s("div",{class:"ChallengesListWrapper"},s("div",{class:"ChallengesList"},this.challenges.map((e=>this.getChallengeTemplate(e))))):s("div",{class:"ChallengesListEmpty"},s("h2",null,r("noChallenges",this.language)),s("p",null,r("tryOtherGames",this.language)))}getTooltipTemplate(){return s("div",{class:"ChallengesTooltipBackdrop"},s("div",{class:"ChallengesTooltip"},s("button",{class:"ChallengesIconButton",onClick:this.hideTooltip},s("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Close tooltip"})),r("tooltip",this.language)))}render(){return s("div",{class:`ChallengesListPopup ${this.device}`},this.getHeaderTemplate(),this.getListTemplate(),this.tooltip&&this.getTooltipTemplate())}get host(){return o(this)}static get watchers(){return{challenges:["challengesPropHandler"]}}};h.style='@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@600&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}.ChallengesListPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative;padding-bottom:20px}.ChallengesListPopupHeader{display:flex;justify-content:space-between;align-items:center;padding:8px}.ChallengesIconButton{width:16px;height:16px;cursor:pointer}.ChallengesIconButton img{width:100%;height:100%}.ChallengesListPopupHeaderName{color:var(--emw--color-gray-100, #BBB9C3);font-size:14px;font-weight:500;line-height:14px}.ChallengesListWrapper{overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.ChallengesListWrapper::-webkit-scrollbar{display:none}.ChallengesList{display:flex;flex-direction:column;row-gap:12px;padding:12px 19px 0}.ChallengeCard{padding:15px 15px 19px;border:1px solid var(--emw--button-border-color, #403956);border-radius:6px;position:relative;cursor:pointer}.ChallengeJoinButton.Joined::before,.ChallengeCard.InProgress::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}.ChallengeCardHeader{display:flex;justify-content:space-between;gap:24px;margin-bottom:12px}.ChallengeName{color:var(--emw--color-typography, #FFFFFF);font-family:"Montserrat", sans-serif;line-height:22px;font-weight:700;font-size:18px;word-break:break-word}.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}.ChallengesListEmpty{padding:20px 32px}.ChallengesListEmpty h2{margin:0 0 16px 0;text-align:center;font-weight:600;font-size:20px;line-height:24px;font-family:"Montserrat", sans-serif;color:var(--emw--color-typography, #FFFFFF)}.ChallengesListEmpty p{font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3)}.ChallengeCountdown{color:var(--emw--color-gray-100, #BBB9C3);font-size:12px;line-height:12px}.ChallengeLabel{min-width:35px;height:18px;background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);border-radius:2px;display:none;position:absolute;top:-11px;right:11px;padding:0 2px;align-items:center;justify-content:center}.ChallengeLabel span{display:inline-block;text-transform:uppercase;font-size:10px;line-height:10px;font-weight:700;font-family:"Montserrat", sans-serif;color:var(--emw--color-typography, #1E1638)}.ShowChallengeLabel{display:inline-flex}.ChallengesTooltipBackdrop{padding:48px 30px 0;position:absolute;width:100%;height:100%;inset:0;background-color:rgba(0, 0, 0, 0.5)}.ChallengesTooltipBackdrop .ChallengesTooltip{border:1px solid var(--emw--button-border-color, #403956);background-color:var(--emw--color-background, #1E1638);border-radius:8px;padding:32px;font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3);position:relative}.ChallengesTooltipBackdrop .ChallengesTooltip .ChallengesIconButton{top:12px;right:6px;position:absolute}.ChallengesListPopup.Tablet .ChallengesListPopupHeader,.ChallengesListPopup.Desktop .ChallengesListPopupHeader{padding-top:16px}.ChallengesListPopup.Tablet .ChallengesListPopupHeaderName,.ChallengesListPopup.Desktop .ChallengesListPopupHeaderName{font-size:16px;line-height:16px}.ChallengesListPopup.Tablet .ChallengesIconButton,.ChallengesListPopup.Desktop .ChallengesIconButton{width:24px;height:24px}.ChallengesListPopup.Tablet .ChallengesList,.ChallengesListPopup.Desktop .ChallengesList{padding:20px 24px 0;row-gap:20px}.ChallengesListPopup.Tablet .ChallengesListEmpty,.ChallengesListPopup.Desktop .ChallengesListEmpty{padding:40px 65px}.ChallengesListPopup.Tablet .ChallengesListEmpty h2,.ChallengesListPopup.Desktop .ChallengesListEmpty h2{margin-bottom:32px;font-size:var(--emw--size-large, 24px);line-height:29px}.ChallengesListPopup.Tablet .ChallengesListEmpty p,.ChallengesListPopup.Desktop .ChallengesListEmpty p{font-size:var(--emw--font-size-small, 16px);line-height:20px}.ChallengesListPopup.Tablet .ChallengeCardHeader,.ChallengesListPopup.Desktop .ChallengeCardHeader{margin-bottom:16px}.ChallengesListPopup.Tablet .ChallengeName,.ChallengesListPopup.Desktop .ChallengeName{line-height:27px;font-size:22px}.ChallengesListPopup.Tablet .ChallengeJoinButton,.ChallengesListPopup.Desktop .ChallengeJoinButton{min-width:100px;height:36px;font-size:16px}.ChallengesListPopup.Tablet .ChallengeCountdown,.ChallengesListPopup.Desktop .ChallengeCountdown{font-size:14px;line-height:14px}.ChallengesListPopup.Tablet .ChallengesTooltip,.ChallengesListPopup.Desktop .ChallengesTooltip{padding:60px 65px;font-size:16px;line-height:20px}.ChallengesListPopup.Tablet .ChallengesTooltip .ChallengesIconButton,.ChallengesListPopup.Desktop .ChallengesTooltip .ChallengesIconButton{top:24px;right:24px}';const p=class{constructor(t){e(this,t),this.value=0,this.disabled=!1,this.hidePercent=!1,this.clientStyling="",this.clientStylingUrl="",this.limitStylingAppends=!1,this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))}}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}getProgressBarClasses(){return{ProgressBar:!0,Completed:100===this.value,Disabled:this.disabled,HidePercent:this.hidePercent}}render(){return s("div",{class:this.getProgressBarClasses(),part:"ProgressBar"},s("div",{class:"ProgressBarInfo",part:"ProgressBarInfo"},s("slot",{name:"Title"},s("div",null)),s("slot",{name:"Percent"},s("div",{class:"ProgressBarPercent",part:"ProgressBarPercent"},this.value,"%"))),s("div",{class:"ProgressBarBackground",part:"ProgressBarBackground"},s("div",{class:"ProgressBarLine",part:"ProgressBarLine",style:{width:this.value+"%"}})))}get host(){return o(this)}};p.style=":host{display:block;font-family:inherit}:host(.Desktop) .ProgressBarPercent{font-size:14px;line-height:14px}.ProgressBarBackground{height:8px;background-color:var(--emw--color-background, #666178);border-radius:4px;position:relative}.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}.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)}";export{h as casino_engagement_suite_challenges_list,p as casino_engagement_suite_progress_bar}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-1216b764.js');
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["casino-engagement-suite-challenges-list_2.cjs",[[1,"casino-engagement-suite-challenges-list",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[1],"device":[1],"challenges":[1040],"isJoiningToChallenge":[1028,"is-joining-to-challenge"],"inProgressChallenges":[1040],"pausedChallengeIds":[16],"tooltip":[32],"timers":[32],"limitStylingAppends":[32]
|
|
18
|
+
return index.bootstrapLazy([["casino-engagement-suite-challenges-list_2.cjs",[[1,"casino-engagement-suite-challenges-list",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[1],"device":[1],"challenges":[1040],"isJoiningToChallenge":[1028,"is-joining-to-challenge"],"inProgressChallenges":[1040],"pausedChallengeIds":[16],"tooltip":[32],"timers":[32],"limitStylingAppends":[32]}],[1,"casino-engagement-suite-progress-bar",{"value":[2],"disabled":[4],"hidePercent":[4,"hide-percent"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"limitStylingAppends":[32]}]]]], options);
|
|
19
19
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-1216b764.js');
|
|
6
6
|
|
|
7
7
|
var ChallengeLevelProgressStatus;
|
|
8
8
|
(function (ChallengeLevelProgressStatus) {
|
|
@@ -38,12 +38,13 @@ const translate = (key, customLang) => {
|
|
|
38
38
|
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
const casinoEngagementSuiteChallengesListCss = "@import url(\"https://fonts.googleapis.com/css2?family=Montserrat:wght@600&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}.ChallengesListPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative;padding-bottom:20px}.ChallengesListPopupHeader{display:flex;justify-content:space-between;align-items:center;padding:
|
|
41
|
+
const casinoEngagementSuiteChallengesListCss = "@import url(\"https://fonts.googleapis.com/css2?family=Montserrat:wght@600&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}.ChallengesListPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative;padding-bottom:20px}.ChallengesListPopupHeader{display:flex;justify-content:space-between;align-items:center;padding:8px}.ChallengesIconButton{width:16px;height:16px;cursor:pointer}.ChallengesIconButton img{width:100%;height:100%}.ChallengesListPopupHeaderName{color:var(--emw--color-gray-100, #BBB9C3);font-size:14px;font-weight:500;line-height:14px}.ChallengesListWrapper{overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.ChallengesListWrapper::-webkit-scrollbar{display:none}.ChallengesList{display:flex;flex-direction:column;row-gap:12px;padding:12px 19px 0}.ChallengeCard{padding:15px 15px 19px;border:1px solid var(--emw--button-border-color, #403956);border-radius:6px;position:relative;cursor:pointer}.ChallengeJoinButton.Joined::before,.ChallengeCard.InProgress::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}.ChallengeCardHeader{display:flex;justify-content:space-between;gap:24px;margin-bottom:12px}.ChallengeName{color:var(--emw--color-typography, #FFFFFF);font-family:\"Montserrat\", sans-serif;line-height:22px;font-weight:700;font-size:18px;word-break:break-word}.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}.ChallengesListEmpty{padding:20px 32px}.ChallengesListEmpty h2{margin:0 0 16px 0;text-align:center;font-weight:600;font-size:20px;line-height:24px;font-family:\"Montserrat\", sans-serif;color:var(--emw--color-typography, #FFFFFF)}.ChallengesListEmpty p{font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3)}.ChallengeCountdown{color:var(--emw--color-gray-100, #BBB9C3);font-size:12px;line-height:12px}.ChallengeLabel{min-width:35px;height:18px;background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);border-radius:2px;display:none;position:absolute;top:-11px;right:11px;padding:0 2px;align-items:center;justify-content:center}.ChallengeLabel span{display:inline-block;text-transform:uppercase;font-size:10px;line-height:10px;font-weight:700;font-family:\"Montserrat\", sans-serif;color:var(--emw--color-typography, #1E1638)}.ShowChallengeLabel{display:inline-flex}.ChallengesTooltipBackdrop{padding:48px 30px 0;position:absolute;width:100%;height:100%;inset:0;background-color:rgba(0, 0, 0, 0.5)}.ChallengesTooltipBackdrop .ChallengesTooltip{border:1px solid var(--emw--button-border-color, #403956);background-color:var(--emw--color-background, #1E1638);border-radius:8px;padding:32px;font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3);position:relative}.ChallengesTooltipBackdrop .ChallengesTooltip .ChallengesIconButton{top:12px;right:6px;position:absolute}.ChallengesListPopup.Tablet .ChallengesListPopupHeader,.ChallengesListPopup.Desktop .ChallengesListPopupHeader{padding-top:16px}.ChallengesListPopup.Tablet .ChallengesListPopupHeaderName,.ChallengesListPopup.Desktop .ChallengesListPopupHeaderName{font-size:16px;line-height:16px}.ChallengesListPopup.Tablet .ChallengesIconButton,.ChallengesListPopup.Desktop .ChallengesIconButton{width:24px;height:24px}.ChallengesListPopup.Tablet .ChallengesList,.ChallengesListPopup.Desktop .ChallengesList{padding:20px 24px 0;row-gap:20px}.ChallengesListPopup.Tablet .ChallengesListEmpty,.ChallengesListPopup.Desktop .ChallengesListEmpty{padding:40px 65px}.ChallengesListPopup.Tablet .ChallengesListEmpty h2,.ChallengesListPopup.Desktop .ChallengesListEmpty h2{margin-bottom:32px;font-size:var(--emw--size-large, 24px);line-height:29px}.ChallengesListPopup.Tablet .ChallengesListEmpty p,.ChallengesListPopup.Desktop .ChallengesListEmpty p{font-size:var(--emw--font-size-small, 16px);line-height:20px}.ChallengesListPopup.Tablet .ChallengeCardHeader,.ChallengesListPopup.Desktop .ChallengeCardHeader{margin-bottom:16px}.ChallengesListPopup.Tablet .ChallengeName,.ChallengesListPopup.Desktop .ChallengeName{line-height:27px;font-size:22px}.ChallengesListPopup.Tablet .ChallengeJoinButton,.ChallengesListPopup.Desktop .ChallengeJoinButton{min-width:100px;height:36px;font-size:16px}.ChallengesListPopup.Tablet .ChallengeCountdown,.ChallengesListPopup.Desktop .ChallengeCountdown{font-size:14px;line-height:14px}.ChallengesListPopup.Tablet .ChallengesTooltip,.ChallengesListPopup.Desktop .ChallengesTooltip{padding:60px 65px;font-size:16px;line-height:20px}.ChallengesListPopup.Tablet .ChallengesTooltip .ChallengesIconButton,.ChallengesListPopup.Desktop .ChallengesTooltip .ChallengesIconButton{top:24px;right:24px}";
|
|
42
42
|
|
|
43
43
|
const CasinoEngagementSuiteChallengesList = class {
|
|
44
44
|
constructor(hostRef) {
|
|
45
45
|
index.registerInstance(this, hostRef);
|
|
46
46
|
this.close = index.createEvent(this, "close", 7);
|
|
47
|
+
this.resetNewChallengeLabel = index.createEvent(this, "resetNewChallengeLabel", 7);
|
|
47
48
|
/**
|
|
48
49
|
* Client custom styling via string
|
|
49
50
|
*/
|
|
@@ -71,7 +72,6 @@ const CasinoEngagementSuiteChallengesList = class {
|
|
|
71
72
|
this.tooltip = false;
|
|
72
73
|
this.timers = {};
|
|
73
74
|
this.limitStylingAppends = false;
|
|
74
|
-
this.newChallengeIds = [];
|
|
75
75
|
this.setClientStyling = () => {
|
|
76
76
|
let sheet = document.createElement('style');
|
|
77
77
|
sheet.innerHTML = this.clientStyling;
|
|
@@ -93,12 +93,11 @@ const CasinoEngagementSuiteChallengesList = class {
|
|
|
93
93
|
this.handleCloseClick = () => {
|
|
94
94
|
this.close.emit();
|
|
95
95
|
this.tooltip = false;
|
|
96
|
-
this.
|
|
96
|
+
this.resetNewChallengeLabel.emit('list');
|
|
97
97
|
};
|
|
98
98
|
this.handleChallengeClick = (ev) => {
|
|
99
99
|
const id = ev.currentTarget.getAttribute('data-id');
|
|
100
100
|
window.postMessage({ type: 'ChallengeClick', id });
|
|
101
|
-
this.newChallengeIds = this.newChallengeIds.filter(item => item !== id);
|
|
102
101
|
};
|
|
103
102
|
this.showTooltip = () => {
|
|
104
103
|
this.tooltip = true;
|
|
@@ -142,23 +141,8 @@ const CasinoEngagementSuiteChallengesList = class {
|
|
|
142
141
|
clearInterval(this.interval);
|
|
143
142
|
}
|
|
144
143
|
}
|
|
145
|
-
handleEvent(e) {
|
|
146
|
-
const type = e.data.type;
|
|
147
|
-
switch (type) {
|
|
148
|
-
case 'ChallengeGrant': {
|
|
149
|
-
const newChallenge = e.data.data.challengeProgressData[0];
|
|
150
|
-
this.newChallengeIds.push(newChallenge.Id);
|
|
151
|
-
break;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
144
|
componentWillLoad() {
|
|
156
|
-
var _a;
|
|
157
145
|
this.challengesPropHandler(this.challenges);
|
|
158
|
-
if ((_a = this.challenges) === null || _a === void 0 ? void 0 : _a.length) {
|
|
159
|
-
this.newChallengeIds = this.challenges.filter(challenge => challenge.IsNew)
|
|
160
|
-
.map(challenge => challenge.Id);
|
|
161
|
-
}
|
|
162
146
|
}
|
|
163
147
|
componentDidRender() {
|
|
164
148
|
if (!this.limitStylingAppends && this.host) {
|
|
@@ -235,13 +219,17 @@ const CasinoEngagementSuiteChallengesList = class {
|
|
|
235
219
|
|| challenge.Status === ChallengeProgressStatus.InProgress) {
|
|
236
220
|
const activeLevel = challenge.LevelProgresses
|
|
237
221
|
.find(level => level.ProgressStatus === ChallengeLevelProgressStatus.InProgress);
|
|
222
|
+
const completedLevel = challenge.LevelProgresses
|
|
223
|
+
.filter(level => level.ProgressStatus === ChallengeLevelProgressStatus.Fillup ||
|
|
224
|
+
level.ProgressStatus === ChallengeLevelProgressStatus.Completed).slice(-1)[0];
|
|
238
225
|
/**
|
|
239
226
|
* It is possible that Paused/InProgress challenge
|
|
240
|
-
* doesn't have InProgress level
|
|
227
|
+
* doesn't have InProgress, Fillup or Completed level
|
|
241
228
|
* because level becomes InProgress after user's bet.
|
|
242
229
|
* In this case should be displayed progress of the next level (0%)
|
|
243
230
|
*/
|
|
244
|
-
return activeLevel ? activeLevel.ProgressPercentage
|
|
231
|
+
return activeLevel ? activeLevel.ProgressPercentage
|
|
232
|
+
: (completedLevel ? completedLevel.ProgressPercentage : 0);
|
|
245
233
|
}
|
|
246
234
|
return -1;
|
|
247
235
|
}
|
|
@@ -250,18 +238,19 @@ const CasinoEngagementSuiteChallengesList = class {
|
|
|
250
238
|
const inProgressChallenge = challenge.Status === ChallengeProgressStatus.InProgress
|
|
251
239
|
|| challenge.Status === ChallengeProgressStatus.PendingLevelReward;
|
|
252
240
|
return index.h("div", { class: "ChallengeCardHeader" }, index.h("div", { class: "ChallengeName" }, challenge.ChallengePresentation.PresentationName), index.h("button", { class: `${inProgressChallenge ?
|
|
253
|
-
'ChallengeJoinButton Joined' : 'ChallengeJoinButton'} ${this.isJoiningToChallenge
|
|
241
|
+
'ChallengeJoinButton Joined' : 'ChallengeJoinButton'} ${this.isJoiningToChallenge ||
|
|
242
|
+
challenge.Status === ChallengeProgressStatus.Completed ||
|
|
243
|
+
this.isChallengePaused(challenge) ? 'Disabled' : ''}`, onClick: this.changeChallengeStatus, "data-id": Id }, inProgressChallenge
|
|
254
244
|
? translate('unjoin', this.language)
|
|
255
245
|
: translate('join', this.language)));
|
|
256
246
|
}
|
|
257
247
|
getChallengeTemplate(challenge) {
|
|
258
248
|
const challengeProgress = this.getChallengeProgress(challenge);
|
|
259
249
|
const countdown = this.timers[challenge.Id];
|
|
260
|
-
const isNewChallenge = this.newChallengeIds.includes(challenge.Id);
|
|
261
250
|
const progressTemplate = challengeProgress > -1
|
|
262
251
|
? index.h("casino-engagement-suite-progress-bar", { class: this.device, value: challengeProgress, disabled: this.isChallengePaused(challenge) }, index.h("span", { slot: "Title", class: "ChallengeCountdown" }, countdown))
|
|
263
252
|
: index.h("span", { class: "ChallengeCountdown" }, countdown);
|
|
264
|
-
return (index.h("div", { class: this.getChallengeClasses(challenge), onClick: this.handleChallengeClick, key: challenge.Id, "data-id": challenge.Id }, this.getChallengeHeaderTemplate(challenge), progressTemplate, index.h("div", { class: `ChallengeLabel ${
|
|
253
|
+
return (index.h("div", { class: this.getChallengeClasses(challenge), onClick: this.handleChallengeClick, key: challenge.Id, "data-id": challenge.Id }, this.getChallengeHeaderTemplate(challenge), progressTemplate, index.h("div", { class: `ChallengeLabel ${challenge.IsNew ? 'ShowChallengeLabel' : ''}` }, index.h("span", null, translate('new', this.language)))));
|
|
265
254
|
}
|
|
266
255
|
getHeaderTemplate() {
|
|
267
256
|
return index.h("header", { class: "ChallengesListPopupHeader" }, index.h("button", { onClick: this.showTooltip, class: "ChallengesIconButton" }, index.h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/help.svg", alt: "Show tooltip" })), index.h("div", { class: "ChallengesListPopupHeaderName" }, translate('challenges', this.language)), index.h("button", { class: "ChallengesIconButton", onClick: this.handleCloseClick }, index.h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", alt: "Close challenges list" })));
|
|
@@ -47,40 +47,6 @@ const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
|
|
|
47
47
|
return false;
|
|
48
48
|
})()
|
|
49
49
|
;
|
|
50
|
-
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
51
|
-
if (listeners) {
|
|
52
|
-
listeners.map(([flags, name, method]) => {
|
|
53
|
-
const target = getHostListenerTarget(elm, flags) ;
|
|
54
|
-
const handler = hostListenerProxy(hostRef, method);
|
|
55
|
-
const opts = hostListenerOpts(flags);
|
|
56
|
-
plt.ael(target, name, handler, opts);
|
|
57
|
-
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
62
|
-
try {
|
|
63
|
-
{
|
|
64
|
-
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
65
|
-
// instance is ready, let's call it's member method for this event
|
|
66
|
-
hostRef.$lazyInstance$[methodName](ev);
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
catch (e) {
|
|
74
|
-
consoleError(e);
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
const getHostListenerTarget = (elm, flags) => {
|
|
78
|
-
if (flags & 8 /* TargetWindow */)
|
|
79
|
-
return win;
|
|
80
|
-
return elm;
|
|
81
|
-
};
|
|
82
|
-
// prettier-ignore
|
|
83
|
-
const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
|
|
84
50
|
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
85
51
|
const createTime = (fnName, tagName = '') => {
|
|
86
52
|
{
|
|
@@ -681,13 +647,6 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
681
647
|
const instance = hostRef.$lazyInstance$ ;
|
|
682
648
|
let promise;
|
|
683
649
|
if (isInitialLoad) {
|
|
684
|
-
{
|
|
685
|
-
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
686
|
-
if (hostRef.$queuedListeners$) {
|
|
687
|
-
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
688
|
-
hostRef.$queuedListeners$ = null;
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
650
|
{
|
|
692
651
|
promise = safeCall(instance, 'componentWillLoad');
|
|
693
652
|
}
|
|
@@ -1122,12 +1081,6 @@ const connectedCallback = (elm) => {
|
|
|
1122
1081
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
1123
1082
|
}
|
|
1124
1083
|
}
|
|
1125
|
-
else {
|
|
1126
|
-
// not the first time this has connected
|
|
1127
|
-
// reattach any event listeners to the host
|
|
1128
|
-
// since they would have been removed when disconnected
|
|
1129
|
-
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1130
|
-
}
|
|
1131
1084
|
endConnected();
|
|
1132
1085
|
}
|
|
1133
1086
|
};
|
|
@@ -1135,12 +1088,6 @@ const disconnectedCallback = (elm) => {
|
|
|
1135
1088
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1136
1089
|
const hostRef = getHostRef(elm);
|
|
1137
1090
|
const instance = hostRef.$lazyInstance$ ;
|
|
1138
|
-
{
|
|
1139
|
-
if (hostRef.$rmListeners$) {
|
|
1140
|
-
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
1141
|
-
hostRef.$rmListeners$ = undefined;
|
|
1142
|
-
}
|
|
1143
|
-
}
|
|
1144
1091
|
{
|
|
1145
1092
|
safeCall(instance, 'disconnectedCallback');
|
|
1146
1093
|
}
|
|
@@ -1170,9 +1117,6 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1170
1117
|
{
|
|
1171
1118
|
cmpMeta.$members$ = compactMeta[2];
|
|
1172
1119
|
}
|
|
1173
|
-
{
|
|
1174
|
-
cmpMeta.$listeners$ = compactMeta[3];
|
|
1175
|
-
}
|
|
1176
1120
|
{
|
|
1177
1121
|
cmpMeta.$attrsToReflect$ = [];
|
|
1178
1122
|
}
|
|
@@ -1259,7 +1203,6 @@ const registerHost = (elm, cmpMeta) => {
|
|
|
1259
1203
|
elm['s-p'] = [];
|
|
1260
1204
|
elm['s-rc'] = [];
|
|
1261
1205
|
}
|
|
1262
|
-
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1263
1206
|
return hostRefs.set(elm, hostRef);
|
|
1264
1207
|
};
|
|
1265
1208
|
const isMemberInElement = (elm, memberName) => memberName in elm;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-1216b764.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -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-challenges-list_2.cjs",[[1,"casino-engagement-suite-challenges-list",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[1],"device":[1],"challenges":[1040],"isJoiningToChallenge":[1028,"is-joining-to-challenge"],"inProgressChallenges":[1040],"pausedChallengeIds":[16],"tooltip":[32],"timers":[32],"limitStylingAppends":[32]
|
|
17
|
+
return index.bootstrapLazy([["casino-engagement-suite-challenges-list_2.cjs",[[1,"casino-engagement-suite-challenges-list",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[1],"device":[1],"challenges":[1040],"isJoiningToChallenge":[1028,"is-joining-to-challenge"],"inProgressChallenges":[1040],"pausedChallengeIds":[16],"tooltip":[32],"timers":[32],"limitStylingAppends":[32]}],[1,"casino-engagement-suite-progress-bar",{"value":[2],"disabled":[4],"hidePercent":[4,"hide-percent"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"limitStylingAppends":[32]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -34,7 +34,7 @@ button:focus {
|
|
|
34
34
|
display: flex;
|
|
35
35
|
justify-content: space-between;
|
|
36
36
|
align-items: center;
|
|
37
|
-
padding:
|
|
37
|
+
padding: 8px;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
.ChallengesIconButton {
|
|
@@ -42,6 +42,10 @@ button:focus {
|
|
|
42
42
|
height: 16px;
|
|
43
43
|
cursor: pointer;
|
|
44
44
|
}
|
|
45
|
+
.ChallengesIconButton img {
|
|
46
|
+
width: 100%;
|
|
47
|
+
height: 100%;
|
|
48
|
+
}
|
|
45
49
|
|
|
46
50
|
.ChallengesListPopupHeaderName {
|
|
47
51
|
color: var(--emw--color-gray-100, #BBB9C3);
|
|
@@ -63,7 +67,7 @@ button:focus {
|
|
|
63
67
|
display: flex;
|
|
64
68
|
flex-direction: column;
|
|
65
69
|
row-gap: 12px;
|
|
66
|
-
padding:
|
|
70
|
+
padding: 12px 19px 0;
|
|
67
71
|
}
|
|
68
72
|
|
|
69
73
|
.ChallengeCard {
|
|
@@ -227,6 +231,21 @@ button:focus {
|
|
|
227
231
|
padding: 20px 24px 0;
|
|
228
232
|
row-gap: 20px;
|
|
229
233
|
}
|
|
234
|
+
.ChallengesListPopup.Tablet .ChallengesListEmpty,
|
|
235
|
+
.ChallengesListPopup.Desktop .ChallengesListEmpty {
|
|
236
|
+
padding: 40px 65px;
|
|
237
|
+
}
|
|
238
|
+
.ChallengesListPopup.Tablet .ChallengesListEmpty h2,
|
|
239
|
+
.ChallengesListPopup.Desktop .ChallengesListEmpty h2 {
|
|
240
|
+
margin-bottom: 32px;
|
|
241
|
+
font-size: var(--emw--size-large, 24px);
|
|
242
|
+
line-height: 29px;
|
|
243
|
+
}
|
|
244
|
+
.ChallengesListPopup.Tablet .ChallengesListEmpty p,
|
|
245
|
+
.ChallengesListPopup.Desktop .ChallengesListEmpty p {
|
|
246
|
+
font-size: var(--emw--font-size-small, 16px);
|
|
247
|
+
line-height: 20px;
|
|
248
|
+
}
|
|
230
249
|
.ChallengesListPopup.Tablet .ChallengeCardHeader,
|
|
231
250
|
.ChallengesListPopup.Desktop .ChallengeCardHeader {
|
|
232
251
|
margin-bottom: 16px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Element, Event, h,
|
|
1
|
+
import { Component, Element, Event, h, Prop, State, Watch } from '@stencil/core';
|
|
2
2
|
import { ChallengeLevelProgressStatus, ChallengeProgressStatus } from '../../models/challenge';
|
|
3
3
|
import { translate } from '../../utils/locale.utils';
|
|
4
4
|
import '@everymatrix/casino-engagement-suite-progress-bar';
|
|
@@ -31,7 +31,6 @@ export class CasinoEngagementSuiteChallengesList {
|
|
|
31
31
|
this.tooltip = false;
|
|
32
32
|
this.timers = {};
|
|
33
33
|
this.limitStylingAppends = false;
|
|
34
|
-
this.newChallengeIds = [];
|
|
35
34
|
this.setClientStyling = () => {
|
|
36
35
|
let sheet = document.createElement('style');
|
|
37
36
|
sheet.innerHTML = this.clientStyling;
|
|
@@ -53,12 +52,11 @@ export class CasinoEngagementSuiteChallengesList {
|
|
|
53
52
|
this.handleCloseClick = () => {
|
|
54
53
|
this.close.emit();
|
|
55
54
|
this.tooltip = false;
|
|
56
|
-
this.
|
|
55
|
+
this.resetNewChallengeLabel.emit('list');
|
|
57
56
|
};
|
|
58
57
|
this.handleChallengeClick = (ev) => {
|
|
59
58
|
const id = ev.currentTarget.getAttribute('data-id');
|
|
60
59
|
window.postMessage({ type: 'ChallengeClick', id });
|
|
61
|
-
this.newChallengeIds = this.newChallengeIds.filter(item => item !== id);
|
|
62
60
|
};
|
|
63
61
|
this.showTooltip = () => {
|
|
64
62
|
this.tooltip = true;
|
|
@@ -102,23 +100,8 @@ export class CasinoEngagementSuiteChallengesList {
|
|
|
102
100
|
clearInterval(this.interval);
|
|
103
101
|
}
|
|
104
102
|
}
|
|
105
|
-
handleEvent(e) {
|
|
106
|
-
const type = e.data.type;
|
|
107
|
-
switch (type) {
|
|
108
|
-
case 'ChallengeGrant': {
|
|
109
|
-
const newChallenge = e.data.data.challengeProgressData[0];
|
|
110
|
-
this.newChallengeIds.push(newChallenge.Id);
|
|
111
|
-
break;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
103
|
componentWillLoad() {
|
|
116
|
-
var _a;
|
|
117
104
|
this.challengesPropHandler(this.challenges);
|
|
118
|
-
if ((_a = this.challenges) === null || _a === void 0 ? void 0 : _a.length) {
|
|
119
|
-
this.newChallengeIds = this.challenges.filter(challenge => challenge.IsNew)
|
|
120
|
-
.map(challenge => challenge.Id);
|
|
121
|
-
}
|
|
122
105
|
}
|
|
123
106
|
componentDidRender() {
|
|
124
107
|
if (!this.limitStylingAppends && this.host) {
|
|
@@ -195,13 +178,17 @@ export class CasinoEngagementSuiteChallengesList {
|
|
|
195
178
|
|| challenge.Status === ChallengeProgressStatus.InProgress) {
|
|
196
179
|
const activeLevel = challenge.LevelProgresses
|
|
197
180
|
.find(level => level.ProgressStatus === ChallengeLevelProgressStatus.InProgress);
|
|
181
|
+
const completedLevel = challenge.LevelProgresses
|
|
182
|
+
.filter(level => level.ProgressStatus === ChallengeLevelProgressStatus.Fillup ||
|
|
183
|
+
level.ProgressStatus === ChallengeLevelProgressStatus.Completed).slice(-1)[0];
|
|
198
184
|
/**
|
|
199
185
|
* It is possible that Paused/InProgress challenge
|
|
200
|
-
* doesn't have InProgress level
|
|
186
|
+
* doesn't have InProgress, Fillup or Completed level
|
|
201
187
|
* because level becomes InProgress after user's bet.
|
|
202
188
|
* In this case should be displayed progress of the next level (0%)
|
|
203
189
|
*/
|
|
204
|
-
return activeLevel ? activeLevel.ProgressPercentage
|
|
190
|
+
return activeLevel ? activeLevel.ProgressPercentage
|
|
191
|
+
: (completedLevel ? completedLevel.ProgressPercentage : 0);
|
|
205
192
|
}
|
|
206
193
|
return -1;
|
|
207
194
|
}
|
|
@@ -212,14 +199,15 @@ export class CasinoEngagementSuiteChallengesList {
|
|
|
212
199
|
return h("div", { class: "ChallengeCardHeader" },
|
|
213
200
|
h("div", { class: "ChallengeName" }, challenge.ChallengePresentation.PresentationName),
|
|
214
201
|
h("button", { class: `${inProgressChallenge ?
|
|
215
|
-
'ChallengeJoinButton Joined' : 'ChallengeJoinButton'} ${this.isJoiningToChallenge
|
|
202
|
+
'ChallengeJoinButton Joined' : 'ChallengeJoinButton'} ${this.isJoiningToChallenge ||
|
|
203
|
+
challenge.Status === ChallengeProgressStatus.Completed ||
|
|
204
|
+
this.isChallengePaused(challenge) ? 'Disabled' : ''}`, onClick: this.changeChallengeStatus, "data-id": Id }, inProgressChallenge
|
|
216
205
|
? translate('unjoin', this.language)
|
|
217
206
|
: translate('join', this.language)));
|
|
218
207
|
}
|
|
219
208
|
getChallengeTemplate(challenge) {
|
|
220
209
|
const challengeProgress = this.getChallengeProgress(challenge);
|
|
221
210
|
const countdown = this.timers[challenge.Id];
|
|
222
|
-
const isNewChallenge = this.newChallengeIds.includes(challenge.Id);
|
|
223
211
|
const progressTemplate = challengeProgress > -1
|
|
224
212
|
? h("casino-engagement-suite-progress-bar", { class: this.device, value: challengeProgress, disabled: this.isChallengePaused(challenge) },
|
|
225
213
|
h("span", { slot: "Title", class: "ChallengeCountdown" }, countdown))
|
|
@@ -227,7 +215,7 @@ export class CasinoEngagementSuiteChallengesList {
|
|
|
227
215
|
return (h("div", { class: this.getChallengeClasses(challenge), onClick: this.handleChallengeClick, key: challenge.Id, "data-id": challenge.Id },
|
|
228
216
|
this.getChallengeHeaderTemplate(challenge),
|
|
229
217
|
progressTemplate,
|
|
230
|
-
h("div", { class: `ChallengeLabel ${
|
|
218
|
+
h("div", { class: `ChallengeLabel ${challenge.IsNew ? 'ShowChallengeLabel' : ''}` },
|
|
231
219
|
h("span", null, translate('new', this.language)))));
|
|
232
220
|
}
|
|
233
221
|
getHeaderTemplate() {
|
|
@@ -427,8 +415,7 @@ export class CasinoEngagementSuiteChallengesList {
|
|
|
427
415
|
static get states() { return {
|
|
428
416
|
"tooltip": {},
|
|
429
417
|
"timers": {},
|
|
430
|
-
"limitStylingAppends": {}
|
|
431
|
-
"newChallengeIds": {}
|
|
418
|
+
"limitStylingAppends": {}
|
|
432
419
|
}; }
|
|
433
420
|
static get events() { return [{
|
|
434
421
|
"method": "close",
|
|
@@ -445,17 +432,25 @@ export class CasinoEngagementSuiteChallengesList {
|
|
|
445
432
|
"resolved": "void",
|
|
446
433
|
"references": {}
|
|
447
434
|
}
|
|
435
|
+
}, {
|
|
436
|
+
"method": "resetNewChallengeLabel",
|
|
437
|
+
"name": "resetNewChallengeLabel",
|
|
438
|
+
"bubbles": true,
|
|
439
|
+
"cancelable": true,
|
|
440
|
+
"composed": true,
|
|
441
|
+
"docs": {
|
|
442
|
+
"tags": [],
|
|
443
|
+
"text": ""
|
|
444
|
+
},
|
|
445
|
+
"complexType": {
|
|
446
|
+
"original": "string",
|
|
447
|
+
"resolved": "string",
|
|
448
|
+
"references": {}
|
|
449
|
+
}
|
|
448
450
|
}]; }
|
|
449
451
|
static get elementRef() { return "host"; }
|
|
450
452
|
static get watchers() { return [{
|
|
451
453
|
"propName": "challenges",
|
|
452
454
|
"methodName": "challengesPropHandler"
|
|
453
455
|
}]; }
|
|
454
|
-
static get listeners() { return [{
|
|
455
|
-
"name": "message",
|
|
456
|
-
"method": "handleEvent",
|
|
457
|
-
"target": "window",
|
|
458
|
-
"capture": false,
|
|
459
|
-
"passive": false
|
|
460
|
-
}]; }
|
|
461
456
|
}
|
|
@@ -35,7 +35,7 @@ const translate = (key, customLang) => {
|
|
|
35
35
|
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
const casinoEngagementSuiteChallengesListCss = "@import url(\"https://fonts.googleapis.com/css2?family=Montserrat:wght@600&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}.ChallengesListPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative;padding-bottom:20px}.ChallengesListPopupHeader{display:flex;justify-content:space-between;align-items:center;padding:
|
|
38
|
+
const casinoEngagementSuiteChallengesListCss = "@import url(\"https://fonts.googleapis.com/css2?family=Montserrat:wght@600&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}.ChallengesListPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative;padding-bottom:20px}.ChallengesListPopupHeader{display:flex;justify-content:space-between;align-items:center;padding:8px}.ChallengesIconButton{width:16px;height:16px;cursor:pointer}.ChallengesIconButton img{width:100%;height:100%}.ChallengesListPopupHeaderName{color:var(--emw--color-gray-100, #BBB9C3);font-size:14px;font-weight:500;line-height:14px}.ChallengesListWrapper{overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.ChallengesListWrapper::-webkit-scrollbar{display:none}.ChallengesList{display:flex;flex-direction:column;row-gap:12px;padding:12px 19px 0}.ChallengeCard{padding:15px 15px 19px;border:1px solid var(--emw--button-border-color, #403956);border-radius:6px;position:relative;cursor:pointer}.ChallengeJoinButton.Joined::before,.ChallengeCard.InProgress::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}.ChallengeCardHeader{display:flex;justify-content:space-between;gap:24px;margin-bottom:12px}.ChallengeName{color:var(--emw--color-typography, #FFFFFF);font-family:\"Montserrat\", sans-serif;line-height:22px;font-weight:700;font-size:18px;word-break:break-word}.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}.ChallengesListEmpty{padding:20px 32px}.ChallengesListEmpty h2{margin:0 0 16px 0;text-align:center;font-weight:600;font-size:20px;line-height:24px;font-family:\"Montserrat\", sans-serif;color:var(--emw--color-typography, #FFFFFF)}.ChallengesListEmpty p{font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3)}.ChallengeCountdown{color:var(--emw--color-gray-100, #BBB9C3);font-size:12px;line-height:12px}.ChallengeLabel{min-width:35px;height:18px;background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);border-radius:2px;display:none;position:absolute;top:-11px;right:11px;padding:0 2px;align-items:center;justify-content:center}.ChallengeLabel span{display:inline-block;text-transform:uppercase;font-size:10px;line-height:10px;font-weight:700;font-family:\"Montserrat\", sans-serif;color:var(--emw--color-typography, #1E1638)}.ShowChallengeLabel{display:inline-flex}.ChallengesTooltipBackdrop{padding:48px 30px 0;position:absolute;width:100%;height:100%;inset:0;background-color:rgba(0, 0, 0, 0.5)}.ChallengesTooltipBackdrop .ChallengesTooltip{border:1px solid var(--emw--button-border-color, #403956);background-color:var(--emw--color-background, #1E1638);border-radius:8px;padding:32px;font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3);position:relative}.ChallengesTooltipBackdrop .ChallengesTooltip .ChallengesIconButton{top:12px;right:6px;position:absolute}.ChallengesListPopup.Tablet .ChallengesListPopupHeader,.ChallengesListPopup.Desktop .ChallengesListPopupHeader{padding-top:16px}.ChallengesListPopup.Tablet .ChallengesListPopupHeaderName,.ChallengesListPopup.Desktop .ChallengesListPopupHeaderName{font-size:16px;line-height:16px}.ChallengesListPopup.Tablet .ChallengesIconButton,.ChallengesListPopup.Desktop .ChallengesIconButton{width:24px;height:24px}.ChallengesListPopup.Tablet .ChallengesList,.ChallengesListPopup.Desktop .ChallengesList{padding:20px 24px 0;row-gap:20px}.ChallengesListPopup.Tablet .ChallengesListEmpty,.ChallengesListPopup.Desktop .ChallengesListEmpty{padding:40px 65px}.ChallengesListPopup.Tablet .ChallengesListEmpty h2,.ChallengesListPopup.Desktop .ChallengesListEmpty h2{margin-bottom:32px;font-size:var(--emw--size-large, 24px);line-height:29px}.ChallengesListPopup.Tablet .ChallengesListEmpty p,.ChallengesListPopup.Desktop .ChallengesListEmpty p{font-size:var(--emw--font-size-small, 16px);line-height:20px}.ChallengesListPopup.Tablet .ChallengeCardHeader,.ChallengesListPopup.Desktop .ChallengeCardHeader{margin-bottom:16px}.ChallengesListPopup.Tablet .ChallengeName,.ChallengesListPopup.Desktop .ChallengeName{line-height:27px;font-size:22px}.ChallengesListPopup.Tablet .ChallengeJoinButton,.ChallengesListPopup.Desktop .ChallengeJoinButton{min-width:100px;height:36px;font-size:16px}.ChallengesListPopup.Tablet .ChallengeCountdown,.ChallengesListPopup.Desktop .ChallengeCountdown{font-size:14px;line-height:14px}.ChallengesListPopup.Tablet .ChallengesTooltip,.ChallengesListPopup.Desktop .ChallengesTooltip{padding:60px 65px;font-size:16px;line-height:20px}.ChallengesListPopup.Tablet .ChallengesTooltip .ChallengesIconButton,.ChallengesListPopup.Desktop .ChallengesTooltip .ChallengesIconButton{top:24px;right:24px}";
|
|
39
39
|
|
|
40
40
|
const CasinoEngagementSuiteChallengesList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
41
41
|
constructor() {
|
|
@@ -43,6 +43,7 @@ const CasinoEngagementSuiteChallengesList$1 = /*@__PURE__*/ proxyCustomElement(c
|
|
|
43
43
|
this.__registerHost();
|
|
44
44
|
this.__attachShadow();
|
|
45
45
|
this.close = createEvent(this, "close", 7);
|
|
46
|
+
this.resetNewChallengeLabel = createEvent(this, "resetNewChallengeLabel", 7);
|
|
46
47
|
/**
|
|
47
48
|
* Client custom styling via string
|
|
48
49
|
*/
|
|
@@ -70,7 +71,6 @@ const CasinoEngagementSuiteChallengesList$1 = /*@__PURE__*/ proxyCustomElement(c
|
|
|
70
71
|
this.tooltip = false;
|
|
71
72
|
this.timers = {};
|
|
72
73
|
this.limitStylingAppends = false;
|
|
73
|
-
this.newChallengeIds = [];
|
|
74
74
|
this.setClientStyling = () => {
|
|
75
75
|
let sheet = document.createElement('style');
|
|
76
76
|
sheet.innerHTML = this.clientStyling;
|
|
@@ -92,12 +92,11 @@ const CasinoEngagementSuiteChallengesList$1 = /*@__PURE__*/ proxyCustomElement(c
|
|
|
92
92
|
this.handleCloseClick = () => {
|
|
93
93
|
this.close.emit();
|
|
94
94
|
this.tooltip = false;
|
|
95
|
-
this.
|
|
95
|
+
this.resetNewChallengeLabel.emit('list');
|
|
96
96
|
};
|
|
97
97
|
this.handleChallengeClick = (ev) => {
|
|
98
98
|
const id = ev.currentTarget.getAttribute('data-id');
|
|
99
99
|
window.postMessage({ type: 'ChallengeClick', id });
|
|
100
|
-
this.newChallengeIds = this.newChallengeIds.filter(item => item !== id);
|
|
101
100
|
};
|
|
102
101
|
this.showTooltip = () => {
|
|
103
102
|
this.tooltip = true;
|
|
@@ -141,23 +140,8 @@ const CasinoEngagementSuiteChallengesList$1 = /*@__PURE__*/ proxyCustomElement(c
|
|
|
141
140
|
clearInterval(this.interval);
|
|
142
141
|
}
|
|
143
142
|
}
|
|
144
|
-
handleEvent(e) {
|
|
145
|
-
const type = e.data.type;
|
|
146
|
-
switch (type) {
|
|
147
|
-
case 'ChallengeGrant': {
|
|
148
|
-
const newChallenge = e.data.data.challengeProgressData[0];
|
|
149
|
-
this.newChallengeIds.push(newChallenge.Id);
|
|
150
|
-
break;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
143
|
componentWillLoad() {
|
|
155
|
-
var _a;
|
|
156
144
|
this.challengesPropHandler(this.challenges);
|
|
157
|
-
if ((_a = this.challenges) === null || _a === void 0 ? void 0 : _a.length) {
|
|
158
|
-
this.newChallengeIds = this.challenges.filter(challenge => challenge.IsNew)
|
|
159
|
-
.map(challenge => challenge.Id);
|
|
160
|
-
}
|
|
161
145
|
}
|
|
162
146
|
componentDidRender() {
|
|
163
147
|
if (!this.limitStylingAppends && this.host) {
|
|
@@ -234,13 +218,17 @@ const CasinoEngagementSuiteChallengesList$1 = /*@__PURE__*/ proxyCustomElement(c
|
|
|
234
218
|
|| challenge.Status === ChallengeProgressStatus.InProgress) {
|
|
235
219
|
const activeLevel = challenge.LevelProgresses
|
|
236
220
|
.find(level => level.ProgressStatus === ChallengeLevelProgressStatus.InProgress);
|
|
221
|
+
const completedLevel = challenge.LevelProgresses
|
|
222
|
+
.filter(level => level.ProgressStatus === ChallengeLevelProgressStatus.Fillup ||
|
|
223
|
+
level.ProgressStatus === ChallengeLevelProgressStatus.Completed).slice(-1)[0];
|
|
237
224
|
/**
|
|
238
225
|
* It is possible that Paused/InProgress challenge
|
|
239
|
-
* doesn't have InProgress level
|
|
226
|
+
* doesn't have InProgress, Fillup or Completed level
|
|
240
227
|
* because level becomes InProgress after user's bet.
|
|
241
228
|
* In this case should be displayed progress of the next level (0%)
|
|
242
229
|
*/
|
|
243
|
-
return activeLevel ? activeLevel.ProgressPercentage
|
|
230
|
+
return activeLevel ? activeLevel.ProgressPercentage
|
|
231
|
+
: (completedLevel ? completedLevel.ProgressPercentage : 0);
|
|
244
232
|
}
|
|
245
233
|
return -1;
|
|
246
234
|
}
|
|
@@ -249,18 +237,19 @@ const CasinoEngagementSuiteChallengesList$1 = /*@__PURE__*/ proxyCustomElement(c
|
|
|
249
237
|
const inProgressChallenge = challenge.Status === ChallengeProgressStatus.InProgress
|
|
250
238
|
|| challenge.Status === ChallengeProgressStatus.PendingLevelReward;
|
|
251
239
|
return h("div", { class: "ChallengeCardHeader" }, h("div", { class: "ChallengeName" }, challenge.ChallengePresentation.PresentationName), h("button", { class: `${inProgressChallenge ?
|
|
252
|
-
'ChallengeJoinButton Joined' : 'ChallengeJoinButton'} ${this.isJoiningToChallenge
|
|
240
|
+
'ChallengeJoinButton Joined' : 'ChallengeJoinButton'} ${this.isJoiningToChallenge ||
|
|
241
|
+
challenge.Status === ChallengeProgressStatus.Completed ||
|
|
242
|
+
this.isChallengePaused(challenge) ? 'Disabled' : ''}`, onClick: this.changeChallengeStatus, "data-id": Id }, inProgressChallenge
|
|
253
243
|
? translate('unjoin', this.language)
|
|
254
244
|
: translate('join', this.language)));
|
|
255
245
|
}
|
|
256
246
|
getChallengeTemplate(challenge) {
|
|
257
247
|
const challengeProgress = this.getChallengeProgress(challenge);
|
|
258
248
|
const countdown = this.timers[challenge.Id];
|
|
259
|
-
const isNewChallenge = this.newChallengeIds.includes(challenge.Id);
|
|
260
249
|
const progressTemplate = challengeProgress > -1
|
|
261
250
|
? h("casino-engagement-suite-progress-bar", { class: this.device, value: challengeProgress, disabled: this.isChallengePaused(challenge) }, h("span", { slot: "Title", class: "ChallengeCountdown" }, countdown))
|
|
262
251
|
: h("span", { class: "ChallengeCountdown" }, countdown);
|
|
263
|
-
return (h("div", { class: this.getChallengeClasses(challenge), onClick: this.handleChallengeClick, key: challenge.Id, "data-id": challenge.Id }, this.getChallengeHeaderTemplate(challenge), progressTemplate, h("div", { class: `ChallengeLabel ${
|
|
252
|
+
return (h("div", { class: this.getChallengeClasses(challenge), onClick: this.handleChallengeClick, key: challenge.Id, "data-id": challenge.Id }, this.getChallengeHeaderTemplate(challenge), progressTemplate, h("div", { class: `ChallengeLabel ${challenge.IsNew ? 'ShowChallengeLabel' : ''}` }, h("span", null, translate('new', this.language)))));
|
|
264
253
|
}
|
|
265
254
|
getHeaderTemplate() {
|
|
266
255
|
return h("header", { class: "ChallengesListPopupHeader" }, h("button", { onClick: this.showTooltip, class: "ChallengesIconButton" }, h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/help.svg", alt: "Show tooltip" })), h("div", { class: "ChallengesListPopupHeaderName" }, translate('challenges', this.language)), h("button", { class: "ChallengesIconButton", onClick: this.handleCloseClick }, h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", alt: "Close challenges list" })));
|
|
@@ -295,9 +284,8 @@ const CasinoEngagementSuiteChallengesList$1 = /*@__PURE__*/ proxyCustomElement(c
|
|
|
295
284
|
"pausedChallengeIds": [16],
|
|
296
285
|
"tooltip": [32],
|
|
297
286
|
"timers": [32],
|
|
298
|
-
"limitStylingAppends": [32]
|
|
299
|
-
|
|
300
|
-
}, [[8, "message", "handleEvent"]]]);
|
|
287
|
+
"limitStylingAppends": [32]
|
|
288
|
+
}]);
|
|
301
289
|
function defineCustomElement$1() {
|
|
302
290
|
if (typeof customElements === "undefined") {
|
|
303
291
|
return;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-ae2f8404.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -13,5 +13,5 @@ const patchBrowser = () => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
patchBrowser().then(options => {
|
|
16
|
-
return bootstrapLazy([["casino-engagement-suite-challenges-list_2",[[1,"casino-engagement-suite-challenges-list",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[1],"device":[1],"challenges":[1040],"isJoiningToChallenge":[1028,"is-joining-to-challenge"],"inProgressChallenges":[1040],"pausedChallengeIds":[16],"tooltip":[32],"timers":[32],"limitStylingAppends":[32]
|
|
16
|
+
return bootstrapLazy([["casino-engagement-suite-challenges-list_2",[[1,"casino-engagement-suite-challenges-list",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[1],"device":[1],"challenges":[1040],"isJoiningToChallenge":[1028,"is-joining-to-challenge"],"inProgressChallenges":[1040],"pausedChallengeIds":[16],"tooltip":[32],"timers":[32],"limitStylingAppends":[32]}],[1,"casino-engagement-suite-progress-bar",{"value":[2],"disabled":[4],"hidePercent":[4,"hide-percent"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"limitStylingAppends":[32]}]]]], options);
|
|
17
17
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-ae2f8404.js';
|
|
2
2
|
|
|
3
3
|
var ChallengeLevelProgressStatus;
|
|
4
4
|
(function (ChallengeLevelProgressStatus) {
|
|
@@ -34,12 +34,13 @@ const translate = (key, customLang) => {
|
|
|
34
34
|
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
const casinoEngagementSuiteChallengesListCss = "@import url(\"https://fonts.googleapis.com/css2?family=Montserrat:wght@600&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}.ChallengesListPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative;padding-bottom:20px}.ChallengesListPopupHeader{display:flex;justify-content:space-between;align-items:center;padding:
|
|
37
|
+
const casinoEngagementSuiteChallengesListCss = "@import url(\"https://fonts.googleapis.com/css2?family=Montserrat:wght@600&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}.ChallengesListPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative;padding-bottom:20px}.ChallengesListPopupHeader{display:flex;justify-content:space-between;align-items:center;padding:8px}.ChallengesIconButton{width:16px;height:16px;cursor:pointer}.ChallengesIconButton img{width:100%;height:100%}.ChallengesListPopupHeaderName{color:var(--emw--color-gray-100, #BBB9C3);font-size:14px;font-weight:500;line-height:14px}.ChallengesListWrapper{overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.ChallengesListWrapper::-webkit-scrollbar{display:none}.ChallengesList{display:flex;flex-direction:column;row-gap:12px;padding:12px 19px 0}.ChallengeCard{padding:15px 15px 19px;border:1px solid var(--emw--button-border-color, #403956);border-radius:6px;position:relative;cursor:pointer}.ChallengeJoinButton.Joined::before,.ChallengeCard.InProgress::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}.ChallengeCardHeader{display:flex;justify-content:space-between;gap:24px;margin-bottom:12px}.ChallengeName{color:var(--emw--color-typography, #FFFFFF);font-family:\"Montserrat\", sans-serif;line-height:22px;font-weight:700;font-size:18px;word-break:break-word}.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}.ChallengesListEmpty{padding:20px 32px}.ChallengesListEmpty h2{margin:0 0 16px 0;text-align:center;font-weight:600;font-size:20px;line-height:24px;font-family:\"Montserrat\", sans-serif;color:var(--emw--color-typography, #FFFFFF)}.ChallengesListEmpty p{font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3)}.ChallengeCountdown{color:var(--emw--color-gray-100, #BBB9C3);font-size:12px;line-height:12px}.ChallengeLabel{min-width:35px;height:18px;background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);border-radius:2px;display:none;position:absolute;top:-11px;right:11px;padding:0 2px;align-items:center;justify-content:center}.ChallengeLabel span{display:inline-block;text-transform:uppercase;font-size:10px;line-height:10px;font-weight:700;font-family:\"Montserrat\", sans-serif;color:var(--emw--color-typography, #1E1638)}.ShowChallengeLabel{display:inline-flex}.ChallengesTooltipBackdrop{padding:48px 30px 0;position:absolute;width:100%;height:100%;inset:0;background-color:rgba(0, 0, 0, 0.5)}.ChallengesTooltipBackdrop .ChallengesTooltip{border:1px solid var(--emw--button-border-color, #403956);background-color:var(--emw--color-background, #1E1638);border-radius:8px;padding:32px;font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3);position:relative}.ChallengesTooltipBackdrop .ChallengesTooltip .ChallengesIconButton{top:12px;right:6px;position:absolute}.ChallengesListPopup.Tablet .ChallengesListPopupHeader,.ChallengesListPopup.Desktop .ChallengesListPopupHeader{padding-top:16px}.ChallengesListPopup.Tablet .ChallengesListPopupHeaderName,.ChallengesListPopup.Desktop .ChallengesListPopupHeaderName{font-size:16px;line-height:16px}.ChallengesListPopup.Tablet .ChallengesIconButton,.ChallengesListPopup.Desktop .ChallengesIconButton{width:24px;height:24px}.ChallengesListPopup.Tablet .ChallengesList,.ChallengesListPopup.Desktop .ChallengesList{padding:20px 24px 0;row-gap:20px}.ChallengesListPopup.Tablet .ChallengesListEmpty,.ChallengesListPopup.Desktop .ChallengesListEmpty{padding:40px 65px}.ChallengesListPopup.Tablet .ChallengesListEmpty h2,.ChallengesListPopup.Desktop .ChallengesListEmpty h2{margin-bottom:32px;font-size:var(--emw--size-large, 24px);line-height:29px}.ChallengesListPopup.Tablet .ChallengesListEmpty p,.ChallengesListPopup.Desktop .ChallengesListEmpty p{font-size:var(--emw--font-size-small, 16px);line-height:20px}.ChallengesListPopup.Tablet .ChallengeCardHeader,.ChallengesListPopup.Desktop .ChallengeCardHeader{margin-bottom:16px}.ChallengesListPopup.Tablet .ChallengeName,.ChallengesListPopup.Desktop .ChallengeName{line-height:27px;font-size:22px}.ChallengesListPopup.Tablet .ChallengeJoinButton,.ChallengesListPopup.Desktop .ChallengeJoinButton{min-width:100px;height:36px;font-size:16px}.ChallengesListPopup.Tablet .ChallengeCountdown,.ChallengesListPopup.Desktop .ChallengeCountdown{font-size:14px;line-height:14px}.ChallengesListPopup.Tablet .ChallengesTooltip,.ChallengesListPopup.Desktop .ChallengesTooltip{padding:60px 65px;font-size:16px;line-height:20px}.ChallengesListPopup.Tablet .ChallengesTooltip .ChallengesIconButton,.ChallengesListPopup.Desktop .ChallengesTooltip .ChallengesIconButton{top:24px;right:24px}";
|
|
38
38
|
|
|
39
39
|
const CasinoEngagementSuiteChallengesList = class {
|
|
40
40
|
constructor(hostRef) {
|
|
41
41
|
registerInstance(this, hostRef);
|
|
42
42
|
this.close = createEvent(this, "close", 7);
|
|
43
|
+
this.resetNewChallengeLabel = createEvent(this, "resetNewChallengeLabel", 7);
|
|
43
44
|
/**
|
|
44
45
|
* Client custom styling via string
|
|
45
46
|
*/
|
|
@@ -67,7 +68,6 @@ const CasinoEngagementSuiteChallengesList = class {
|
|
|
67
68
|
this.tooltip = false;
|
|
68
69
|
this.timers = {};
|
|
69
70
|
this.limitStylingAppends = false;
|
|
70
|
-
this.newChallengeIds = [];
|
|
71
71
|
this.setClientStyling = () => {
|
|
72
72
|
let sheet = document.createElement('style');
|
|
73
73
|
sheet.innerHTML = this.clientStyling;
|
|
@@ -89,12 +89,11 @@ const CasinoEngagementSuiteChallengesList = class {
|
|
|
89
89
|
this.handleCloseClick = () => {
|
|
90
90
|
this.close.emit();
|
|
91
91
|
this.tooltip = false;
|
|
92
|
-
this.
|
|
92
|
+
this.resetNewChallengeLabel.emit('list');
|
|
93
93
|
};
|
|
94
94
|
this.handleChallengeClick = (ev) => {
|
|
95
95
|
const id = ev.currentTarget.getAttribute('data-id');
|
|
96
96
|
window.postMessage({ type: 'ChallengeClick', id });
|
|
97
|
-
this.newChallengeIds = this.newChallengeIds.filter(item => item !== id);
|
|
98
97
|
};
|
|
99
98
|
this.showTooltip = () => {
|
|
100
99
|
this.tooltip = true;
|
|
@@ -138,23 +137,8 @@ const CasinoEngagementSuiteChallengesList = class {
|
|
|
138
137
|
clearInterval(this.interval);
|
|
139
138
|
}
|
|
140
139
|
}
|
|
141
|
-
handleEvent(e) {
|
|
142
|
-
const type = e.data.type;
|
|
143
|
-
switch (type) {
|
|
144
|
-
case 'ChallengeGrant': {
|
|
145
|
-
const newChallenge = e.data.data.challengeProgressData[0];
|
|
146
|
-
this.newChallengeIds.push(newChallenge.Id);
|
|
147
|
-
break;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
140
|
componentWillLoad() {
|
|
152
|
-
var _a;
|
|
153
141
|
this.challengesPropHandler(this.challenges);
|
|
154
|
-
if ((_a = this.challenges) === null || _a === void 0 ? void 0 : _a.length) {
|
|
155
|
-
this.newChallengeIds = this.challenges.filter(challenge => challenge.IsNew)
|
|
156
|
-
.map(challenge => challenge.Id);
|
|
157
|
-
}
|
|
158
142
|
}
|
|
159
143
|
componentDidRender() {
|
|
160
144
|
if (!this.limitStylingAppends && this.host) {
|
|
@@ -231,13 +215,17 @@ const CasinoEngagementSuiteChallengesList = class {
|
|
|
231
215
|
|| challenge.Status === ChallengeProgressStatus.InProgress) {
|
|
232
216
|
const activeLevel = challenge.LevelProgresses
|
|
233
217
|
.find(level => level.ProgressStatus === ChallengeLevelProgressStatus.InProgress);
|
|
218
|
+
const completedLevel = challenge.LevelProgresses
|
|
219
|
+
.filter(level => level.ProgressStatus === ChallengeLevelProgressStatus.Fillup ||
|
|
220
|
+
level.ProgressStatus === ChallengeLevelProgressStatus.Completed).slice(-1)[0];
|
|
234
221
|
/**
|
|
235
222
|
* It is possible that Paused/InProgress challenge
|
|
236
|
-
* doesn't have InProgress level
|
|
223
|
+
* doesn't have InProgress, Fillup or Completed level
|
|
237
224
|
* because level becomes InProgress after user's bet.
|
|
238
225
|
* In this case should be displayed progress of the next level (0%)
|
|
239
226
|
*/
|
|
240
|
-
return activeLevel ? activeLevel.ProgressPercentage
|
|
227
|
+
return activeLevel ? activeLevel.ProgressPercentage
|
|
228
|
+
: (completedLevel ? completedLevel.ProgressPercentage : 0);
|
|
241
229
|
}
|
|
242
230
|
return -1;
|
|
243
231
|
}
|
|
@@ -246,18 +234,19 @@ const CasinoEngagementSuiteChallengesList = class {
|
|
|
246
234
|
const inProgressChallenge = challenge.Status === ChallengeProgressStatus.InProgress
|
|
247
235
|
|| challenge.Status === ChallengeProgressStatus.PendingLevelReward;
|
|
248
236
|
return h("div", { class: "ChallengeCardHeader" }, h("div", { class: "ChallengeName" }, challenge.ChallengePresentation.PresentationName), h("button", { class: `${inProgressChallenge ?
|
|
249
|
-
'ChallengeJoinButton Joined' : 'ChallengeJoinButton'} ${this.isJoiningToChallenge
|
|
237
|
+
'ChallengeJoinButton Joined' : 'ChallengeJoinButton'} ${this.isJoiningToChallenge ||
|
|
238
|
+
challenge.Status === ChallengeProgressStatus.Completed ||
|
|
239
|
+
this.isChallengePaused(challenge) ? 'Disabled' : ''}`, onClick: this.changeChallengeStatus, "data-id": Id }, inProgressChallenge
|
|
250
240
|
? translate('unjoin', this.language)
|
|
251
241
|
: translate('join', this.language)));
|
|
252
242
|
}
|
|
253
243
|
getChallengeTemplate(challenge) {
|
|
254
244
|
const challengeProgress = this.getChallengeProgress(challenge);
|
|
255
245
|
const countdown = this.timers[challenge.Id];
|
|
256
|
-
const isNewChallenge = this.newChallengeIds.includes(challenge.Id);
|
|
257
246
|
const progressTemplate = challengeProgress > -1
|
|
258
247
|
? h("casino-engagement-suite-progress-bar", { class: this.device, value: challengeProgress, disabled: this.isChallengePaused(challenge) }, h("span", { slot: "Title", class: "ChallengeCountdown" }, countdown))
|
|
259
248
|
: h("span", { class: "ChallengeCountdown" }, countdown);
|
|
260
|
-
return (h("div", { class: this.getChallengeClasses(challenge), onClick: this.handleChallengeClick, key: challenge.Id, "data-id": challenge.Id }, this.getChallengeHeaderTemplate(challenge), progressTemplate, h("div", { class: `ChallengeLabel ${
|
|
249
|
+
return (h("div", { class: this.getChallengeClasses(challenge), onClick: this.handleChallengeClick, key: challenge.Id, "data-id": challenge.Id }, this.getChallengeHeaderTemplate(challenge), progressTemplate, h("div", { class: `ChallengeLabel ${challenge.IsNew ? 'ShowChallengeLabel' : ''}` }, h("span", null, translate('new', this.language)))));
|
|
261
250
|
}
|
|
262
251
|
getHeaderTemplate() {
|
|
263
252
|
return h("header", { class: "ChallengesListPopupHeader" }, h("button", { onClick: this.showTooltip, class: "ChallengesIconButton" }, h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/help.svg", alt: "Show tooltip" })), h("div", { class: "ChallengesListPopupHeaderName" }, translate('challenges', this.language)), h("button", { class: "ChallengesIconButton", onClick: this.handleCloseClick }, h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", alt: "Close challenges list" })));
|
|
@@ -25,40 +25,6 @@ const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
|
|
|
25
25
|
return false;
|
|
26
26
|
})()
|
|
27
27
|
;
|
|
28
|
-
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
29
|
-
if (listeners) {
|
|
30
|
-
listeners.map(([flags, name, method]) => {
|
|
31
|
-
const target = getHostListenerTarget(elm, flags) ;
|
|
32
|
-
const handler = hostListenerProxy(hostRef, method);
|
|
33
|
-
const opts = hostListenerOpts(flags);
|
|
34
|
-
plt.ael(target, name, handler, opts);
|
|
35
|
-
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
40
|
-
try {
|
|
41
|
-
{
|
|
42
|
-
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
43
|
-
// instance is ready, let's call it's member method for this event
|
|
44
|
-
hostRef.$lazyInstance$[methodName](ev);
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
catch (e) {
|
|
52
|
-
consoleError(e);
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
const getHostListenerTarget = (elm, flags) => {
|
|
56
|
-
if (flags & 8 /* TargetWindow */)
|
|
57
|
-
return win;
|
|
58
|
-
return elm;
|
|
59
|
-
};
|
|
60
|
-
// prettier-ignore
|
|
61
|
-
const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
|
|
62
28
|
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
63
29
|
const createTime = (fnName, tagName = '') => {
|
|
64
30
|
{
|
|
@@ -659,13 +625,6 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
659
625
|
const instance = hostRef.$lazyInstance$ ;
|
|
660
626
|
let promise;
|
|
661
627
|
if (isInitialLoad) {
|
|
662
|
-
{
|
|
663
|
-
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
664
|
-
if (hostRef.$queuedListeners$) {
|
|
665
|
-
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
666
|
-
hostRef.$queuedListeners$ = null;
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
628
|
{
|
|
670
629
|
promise = safeCall(instance, 'componentWillLoad');
|
|
671
630
|
}
|
|
@@ -1100,12 +1059,6 @@ const connectedCallback = (elm) => {
|
|
|
1100
1059
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
1101
1060
|
}
|
|
1102
1061
|
}
|
|
1103
|
-
else {
|
|
1104
|
-
// not the first time this has connected
|
|
1105
|
-
// reattach any event listeners to the host
|
|
1106
|
-
// since they would have been removed when disconnected
|
|
1107
|
-
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1108
|
-
}
|
|
1109
1062
|
endConnected();
|
|
1110
1063
|
}
|
|
1111
1064
|
};
|
|
@@ -1113,12 +1066,6 @@ const disconnectedCallback = (elm) => {
|
|
|
1113
1066
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1114
1067
|
const hostRef = getHostRef(elm);
|
|
1115
1068
|
const instance = hostRef.$lazyInstance$ ;
|
|
1116
|
-
{
|
|
1117
|
-
if (hostRef.$rmListeners$) {
|
|
1118
|
-
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
1119
|
-
hostRef.$rmListeners$ = undefined;
|
|
1120
|
-
}
|
|
1121
|
-
}
|
|
1122
1069
|
{
|
|
1123
1070
|
safeCall(instance, 'disconnectedCallback');
|
|
1124
1071
|
}
|
|
@@ -1148,9 +1095,6 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1148
1095
|
{
|
|
1149
1096
|
cmpMeta.$members$ = compactMeta[2];
|
|
1150
1097
|
}
|
|
1151
|
-
{
|
|
1152
|
-
cmpMeta.$listeners$ = compactMeta[3];
|
|
1153
|
-
}
|
|
1154
1098
|
{
|
|
1155
1099
|
cmpMeta.$attrsToReflect$ = [];
|
|
1156
1100
|
}
|
|
@@ -1237,7 +1181,6 @@ const registerHost = (elm, cmpMeta) => {
|
|
|
1237
1181
|
elm['s-p'] = [];
|
|
1238
1182
|
elm['s-rc'] = [];
|
|
1239
1183
|
}
|
|
1240
|
-
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1241
1184
|
return hostRefs.set(elm, hostRef);
|
|
1242
1185
|
};
|
|
1243
1186
|
const isMemberInElement = (elm, memberName) => memberName in elm;
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-ae2f8404.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -10,7 +10,7 @@ const patchEsm = () => {
|
|
|
10
10
|
const defineCustomElements = (win, options) => {
|
|
11
11
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
12
12
|
return patchEsm().then(() => {
|
|
13
|
-
return bootstrapLazy([["casino-engagement-suite-challenges-list_2",[[1,"casino-engagement-suite-challenges-list",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[1],"device":[1],"challenges":[1040],"isJoiningToChallenge":[1028,"is-joining-to-challenge"],"inProgressChallenges":[1040],"pausedChallengeIds":[16],"tooltip":[32],"timers":[32],"limitStylingAppends":[32]
|
|
13
|
+
return bootstrapLazy([["casino-engagement-suite-challenges-list_2",[[1,"casino-engagement-suite-challenges-list",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[1],"device":[1],"challenges":[1040],"isJoiningToChallenge":[1028,"is-joining-to-challenge"],"inProgressChallenges":[1040],"pausedChallengeIds":[16],"tooltip":[32],"timers":[32],"limitStylingAppends":[32]}],[1,"casino-engagement-suite-progress-bar",{"value":[2],"disabled":[4],"hidePercent":[4,"hide-percent"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"limitStylingAppends":[32]}]]]], options);
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -35,13 +35,12 @@ export declare class CasinoEngagementSuiteChallengesList {
|
|
|
35
35
|
*/
|
|
36
36
|
pausedChallengeIds: string[];
|
|
37
37
|
close: EventEmitter<void>;
|
|
38
|
+
resetNewChallengeLabel: EventEmitter<string>;
|
|
38
39
|
tooltip: boolean;
|
|
39
40
|
timers: Record<string, string>;
|
|
40
41
|
private limitStylingAppends;
|
|
41
|
-
newChallengeIds: string[];
|
|
42
42
|
host: HTMLElement;
|
|
43
43
|
challengesPropHandler(value: Array<Challenge>): void;
|
|
44
|
-
handleEvent(e: any): void;
|
|
45
44
|
interval: any;
|
|
46
45
|
componentWillLoad(): void;
|
|
47
46
|
componentDidRender(): void;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as t,h as s,g as o}from"./p-fad4589e.js";var i,n;!function(e){e[e.Closed=0]="Closed",e[e.InProgress=1]="InProgress",e[e.Fillup=2]="Fillup",e[e.Completed=3]="Completed"}(i||(i={})),function(e){e[e.Started=0]="Started",e[e.InProgress=1]="InProgress",e[e.PendingLevelReward=2]="PendingLevelReward",e[e.Completed=3]="Completed",e[e.Expired=4]="Expired"}(n||(n={}));const l=["en"],a={en:{challenges:"Challenges",join:"Join",unjoin:"Unjoin",new:"new",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"}},r=(e,t)=>{const s=t;return a[void 0!==s&&l.includes(s)?s:"en"][e]},h=class{constructor(s){e(this,s),this.close=t(this,"close",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.device="Mobile",this.challenges=[],this.pausedChallengeIds=[],this.tooltip=!1,this.timers={},this.limitStylingAppends=!1,this.newChallengeIds=[],this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))},this.handleCloseClick=()=>{this.close.emit(),this.tooltip=!1,this.newChallengeIds=[]},this.handleChallengeClick=e=>{const t=e.currentTarget.getAttribute("data-id");window.postMessage({type:"ChallengeClick",id:t}),this.newChallengeIds=this.newChallengeIds.filter((e=>e!==t))},this.showTooltip=()=>{this.tooltip=!0},this.hideTooltip=()=>{this.tooltip=!1},this.changeChallengeStatus=e=>{var t,s;e.stopPropagation();const o=e.currentTarget.getAttribute("data-id");(null===(t=this.inProgressChallenges)||void 0===t?void 0:t.includes(o))?window.postMessage({type:"ShowConfirmationModal",ProgressToDeactivate:o}):(null===(s=this.inProgressChallenges)||void 0===s?void 0:s.length)>0?window.postMessage({type:"ShowConfirmationModal",ProgressToActivate:o,ProgressToDeactivate:this.inProgressChallenges[0]}):window.postMessage({type:"ChallengeJoinRequest",data:{ProgressToActivate:o}})}}challengesPropHandler(e){!this.interval&&e.length&&(this.updateTimers(),this.startCountdown()),this.interval&&!e.length&&clearInterval(this.interval)}handleEvent(e){switch(e.data.type){case"ChallengeGrant":this.newChallengeIds.push(e.data.data.challengeProgressData[0].Id)}}componentWillLoad(){var e;this.challengesPropHandler(this.challenges),(null===(e=this.challenges)||void 0===e?void 0:e.length)&&(this.newChallengeIds=this.challenges.filter((e=>e.IsNew)).map((e=>e.Id)))}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}disconnectedCallback(){this.interval&&clearInterval(this.interval)}startCountdown(){this.interval=setInterval((()=>{this.updateTimers()}),1e3)}updateTimers(){const e=(new Date).getTime();this.timers=this.challenges.filter((e=>e.Status!==n.Expired)).reduce(((t,s)=>{const o=new Date(s.ExpirationTime).getTime()-e;let i="00h:00m:00s";if(o<1)this.removeChallenge(s.Id);else{const{days:e,hours:t,minutes:s,seconds:n}={days:String(Math.floor(o/864e5)).padStart(2,"0"),hours:String(Math.floor(o%864e5/36e5)).padStart(2,"0"),minutes:String(Math.floor(o%36e5/6e4)).padStart(2,"0"),seconds:String(Math.floor(o%6e4/1e3)).padStart(2,"0")};i="00"===e?`${t}h:${s}m:${n}s`:`${e}d:${t}h:${s}m`}return Object.assign(Object.assign({},t),{[s.Id]:i})}),{})}removeChallenge(e){const t=this.challenges.findIndex((t=>t.Id===e));t>-1&&(this.challenges.splice(t,1),window.postMessage({type:"ChallengeHasExpired",id:e}))}getChallengeClasses(e){return{ChallengeCard:!0,InProgress:e.Status===n.InProgress&&!this.pausedChallengeIds.includes(e.ChallengeId),Completed:this.isChallengeCompleted(e),Paused:this.isChallengePaused(e)}}isChallengePaused(e){return e.Status===n.Started&&e.LevelProgresses[0].ProgressPercentage>0||this.pausedChallengeIds.includes(e.ChallengeId)}isChallengeCompleted(e){return e.Status===n.Completed||e.Status===n.PendingLevelReward&&e.LevelProgresses.every((e=>100===e.ProgressPercentage))}getChallengeProgress(e){if(e.Status===n.Completed)return 100;if(this.isChallengePaused(e)||e.Status===n.PendingLevelReward||e.Status===n.InProgress){const t=e.LevelProgresses.find((e=>e.ProgressStatus===i.InProgress));return t?t.ProgressPercentage:0}return-1}getChallengeHeaderTemplate(e){const{Id:t}=e,o=e.Status===n.InProgress||e.Status===n.PendingLevelReward;return s("div",{class:"ChallengeCardHeader"},s("div",{class:"ChallengeName"},e.ChallengePresentation.PresentationName),s("button",{class:`${o?"ChallengeJoinButton Joined":"ChallengeJoinButton"} ${this.isJoiningToChallenge?"Disabled":""}`,onClick:this.changeChallengeStatus,"data-id":t},r(o?"unjoin":"join",this.language)))}getChallengeTemplate(e){const t=this.getChallengeProgress(e),o=this.timers[e.Id],i=this.newChallengeIds.includes(e.Id),n=t>-1?s("casino-engagement-suite-progress-bar",{class:this.device,value:t,disabled:this.isChallengePaused(e)},s("span",{slot:"Title",class:"ChallengeCountdown"},o)):s("span",{class:"ChallengeCountdown"},o);return s("div",{class:this.getChallengeClasses(e),onClick:this.handleChallengeClick,key:e.Id,"data-id":e.Id},this.getChallengeHeaderTemplate(e),n,s("div",{class:"ChallengeLabel "+(i?"ShowChallengeLabel":"")},s("span",null,r("new",this.language))))}getHeaderTemplate(){return s("header",{class:"ChallengesListPopupHeader"},s("button",{onClick:this.showTooltip,class:"ChallengesIconButton"},s("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/help.svg",alt:"Show tooltip"})),s("div",{class:"ChallengesListPopupHeaderName"},r("challenges",this.language)),s("button",{class:"ChallengesIconButton",onClick:this.handleCloseClick},s("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Close challenges list"})))}getListTemplate(){return this.challenges.length?s("div",{class:"ChallengesListWrapper"},s("div",{class:"ChallengesList"},this.challenges.map((e=>this.getChallengeTemplate(e))))):s("div",{class:"ChallengesListEmpty"},s("h2",null,r("noChallenges",this.language)),s("p",null,r("tryOtherGames",this.language)))}getTooltipTemplate(){return s("div",{class:"ChallengesTooltipBackdrop"},s("div",{class:"ChallengesTooltip"},s("button",{class:"ChallengesIconButton",onClick:this.hideTooltip},s("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Close tooltip"})),r("tooltip",this.language)))}render(){return s("div",{class:`ChallengesListPopup ${this.device}`},this.getHeaderTemplate(),this.getListTemplate(),this.tooltip&&this.getTooltipTemplate())}get host(){return o(this)}static get watchers(){return{challenges:["challengesPropHandler"]}}};h.style='@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@600&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}.ChallengesListPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative;padding-bottom:20px}.ChallengesListPopupHeader{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.ChallengesIconButton{width:16px;height:16px;cursor:pointer}.ChallengesListPopupHeaderName{color:var(--emw--color-gray-100, #BBB9C3);font-size:14px;font-weight:500;line-height:14px}.ChallengesListWrapper{overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.ChallengesListWrapper::-webkit-scrollbar{display:none}.ChallengesList{display:flex;flex-direction:column;row-gap:12px;padding:8px 19px 0}.ChallengeCard{padding:15px 15px 19px;border:1px solid var(--emw--button-border-color, #403956);border-radius:6px;position:relative;cursor:pointer}.ChallengeJoinButton.Joined::before,.ChallengeCard.InProgress::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}.ChallengeCardHeader{display:flex;justify-content:space-between;gap:24px;margin-bottom:12px}.ChallengeName{color:var(--emw--color-typography, #FFFFFF);font-family:"Montserrat", sans-serif;line-height:22px;font-weight:700;font-size:18px;word-break:break-word}.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}.ChallengesListEmpty{padding:20px 32px}.ChallengesListEmpty h2{margin:0 0 16px 0;text-align:center;font-weight:600;font-size:20px;line-height:24px;font-family:"Montserrat", sans-serif;color:var(--emw--color-typography, #FFFFFF)}.ChallengesListEmpty p{font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3)}.ChallengeCountdown{color:var(--emw--color-gray-100, #BBB9C3);font-size:12px;line-height:12px}.ChallengeLabel{min-width:35px;height:18px;background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);border-radius:2px;display:none;position:absolute;top:-11px;right:11px;padding:0 2px;align-items:center;justify-content:center}.ChallengeLabel span{display:inline-block;text-transform:uppercase;font-size:10px;line-height:10px;font-weight:700;font-family:"Montserrat", sans-serif;color:var(--emw--color-typography, #1E1638)}.ShowChallengeLabel{display:inline-flex}.ChallengesTooltipBackdrop{padding:48px 30px 0;position:absolute;width:100%;height:100%;inset:0;background-color:rgba(0, 0, 0, 0.5)}.ChallengesTooltipBackdrop .ChallengesTooltip{border:1px solid var(--emw--button-border-color, #403956);background-color:var(--emw--color-background, #1E1638);border-radius:8px;padding:32px;font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3);position:relative}.ChallengesTooltipBackdrop .ChallengesTooltip .ChallengesIconButton{top:12px;right:6px;position:absolute}.ChallengesListPopup.Tablet .ChallengesListPopupHeader,.ChallengesListPopup.Desktop .ChallengesListPopupHeader{padding-top:16px}.ChallengesListPopup.Tablet .ChallengesListPopupHeaderName,.ChallengesListPopup.Desktop .ChallengesListPopupHeaderName{font-size:16px;line-height:16px}.ChallengesListPopup.Tablet .ChallengesIconButton,.ChallengesListPopup.Desktop .ChallengesIconButton{width:24px;height:24px}.ChallengesListPopup.Tablet .ChallengesList,.ChallengesListPopup.Desktop .ChallengesList{padding:20px 24px 0;row-gap:20px}.ChallengesListPopup.Tablet .ChallengeCardHeader,.ChallengesListPopup.Desktop .ChallengeCardHeader{margin-bottom:16px}.ChallengesListPopup.Tablet .ChallengeName,.ChallengesListPopup.Desktop .ChallengeName{line-height:27px;font-size:22px}.ChallengesListPopup.Tablet .ChallengeJoinButton,.ChallengesListPopup.Desktop .ChallengeJoinButton{min-width:100px;height:36px;font-size:16px}.ChallengesListPopup.Tablet .ChallengeCountdown,.ChallengesListPopup.Desktop .ChallengeCountdown{font-size:14px;line-height:14px}.ChallengesListPopup.Tablet .ChallengesTooltip,.ChallengesListPopup.Desktop .ChallengesTooltip{padding:60px 65px;font-size:16px;line-height:20px}.ChallengesListPopup.Tablet .ChallengesTooltip .ChallengesIconButton,.ChallengesListPopup.Desktop .ChallengesTooltip .ChallengesIconButton{top:24px;right:24px}';const p=class{constructor(t){e(this,t),this.value=0,this.disabled=!1,this.hidePercent=!1,this.clientStyling="",this.clientStylingUrl="",this.limitStylingAppends=!1,this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))}}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}getProgressBarClasses(){return{ProgressBar:!0,Completed:100===this.value,Disabled:this.disabled,HidePercent:this.hidePercent}}render(){return s("div",{class:this.getProgressBarClasses(),part:"ProgressBar"},s("div",{class:"ProgressBarInfo",part:"ProgressBarInfo"},s("slot",{name:"Title"},s("div",null)),s("slot",{name:"Percent"},s("div",{class:"ProgressBarPercent",part:"ProgressBarPercent"},this.value,"%"))),s("div",{class:"ProgressBarBackground",part:"ProgressBarBackground"},s("div",{class:"ProgressBarLine",part:"ProgressBarLine",style:{width:this.value+"%"}})))}get host(){return o(this)}};p.style=":host{display:block;font-family:inherit}:host(.Desktop) .ProgressBarPercent{font-size:14px;line-height:14px}.ProgressBarBackground{height:8px;background-color:var(--emw--color-background, #666178);border-radius:4px;position:relative}.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}.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)}";export{h as casino_engagement_suite_challenges_list,p as casino_engagement_suite_progress_bar}
|
|
@@ -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)},i=e=>Promise.resolve(e),c=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),r=(e,t,n)=>{n&&n.map((([n,l,s])=>{const i=u(e,n),c=a(t,s),r=f(n);o.ael(i,l,c,r),(t.o=t.o||[]).push((()=>o.rel(i,l,c,r)))}))},a=(e,t)=>n=>{try{256&e.t?e.i[t](n):(e.u=e.u||[]).push([t,n])}catch(e){J(e)}},u=(e,t)=>8&t?l:e,f=e=>0!=(2&e),d=new WeakMap,h=e=>"sc-"+e.h,y={},$=e=>"object"==(e=typeof e)||"function"===e,m=(e,t,...n)=>{let l=null,s=null,o=!1,i=!1,c=[];const r=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?r(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof e&&!$(l))&&(l+=""),o&&i?c[c.length-1].$+=l:c.push(o?p(null,l):l),i=o)};if(r(n),t){t.key&&(s=t.key);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}const a=p(e,null);return a.m=t,c.length>0&&(a.p=c),a.g=s,a},p=(e,t)=>({t:0,S:e,$:t,k:null,p:null,m:null,g:null}),b={},w=(e,t,n,s,i,c)=>{if(n!==s){let r=I(e,t),a=t.toLowerCase();if("class"===t){const t=e.classList,l=S(n),o=S(s);t.remove(...l.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!l.includes(e))))}else if("style"===t){for(const t in n)s&&null!=s[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in s)n&&s[t]===n[t]||(t.includes("-")?e.style.setProperty(t,s[t]):e.style[t]=s[t])}else if("key"===t);else if(r||"o"!==t[0]||"n"!==t[1]){const l=$(s);if((r||l&&null!==s)&&!i)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&c||i)&&!l&&e.setAttribute(t,s=!0===s?"":s)}else t="-"===t[2]?t.slice(3):I(l,a)?a.slice(2):a[2]+t.slice(3),n&&o.rel(e,t,n,!1),s&&o.ael(e,t,s,!1)}},g=/\s/,S=e=>e?e.split(g):[],k=(e,t,n,l)=>{const s=11===t.k.nodeType&&t.k.host?t.k.host:t.k,o=e&&e.m||y,i=t.m||y;for(l in o)l in i||w(s,l,o[l],void 0,n,t.t);for(l in i)w(s,l,o[l],i[l],n,t.t)},j=(t,n,l)=>{let o,i,c=n.p[l],r=0;if(null!==c.$)o=c.k=s.createTextNode(c.$);else if(o=c.k=s.createElement(c.S),k(null,c,!1),null!=e&&o["s-si"]!==e&&o.classList.add(o["s-si"]=e),c.p)for(r=0;r<c.p.length;++r)i=j(t,c,r),i&&o.appendChild(i);return o},v=(e,n,l,s,o,i)=>{let c,r=e;for(r.shadowRoot&&r.tagName===t&&(r=r.shadowRoot);o<=i;++o)s[o]&&(c=j(null,l,o),c&&(s[o].k=c,r.insertBefore(c,n)))},M=(e,t,n,l)=>{for(;t<=n;++t)(l=e[t])&&l.k.remove()},C=(e,t)=>e.S===t.S&&e.g===t.g,O=(e,t)=>{const n=t.k=e.k,l=e.p,s=t.p,o=t.$;null===o?("slot"===t.S||k(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o,i=0,c=0,r=0,a=0,u=t.length-1,f=t[0],d=t[u],h=l.length-1,y=l[0],$=l[h];for(;i<=u&&c<=h;)if(null==f)f=t[++i];else if(null==d)d=t[--u];else if(null==y)y=l[++c];else if(null==$)$=l[--h];else if(C(f,y))O(f,y),f=t[++i],y=l[++c];else if(C(d,$))O(d,$),d=t[--u],$=l[--h];else if(C(f,$))O(f,$),e.insertBefore(f.k,d.k.nextSibling),f=t[++i],$=l[--h];else if(C(d,y))O(d,y),e.insertBefore(d.k,f.k),d=t[--u],y=l[++c];else{for(r=-1,a=i;a<=u;++a)if(t[a]&&null!==t[a].g&&t[a].g===y.g){r=a;break}r>=0?(o=t[r],o.S!==y.S?s=j(t&&t[c],n,r):(O(o,y),t[r]=void 0,s=o.k),y=l[++c]):(s=j(t&&t[c],n,c),y=l[++c]),s&&f.k.parentNode.insertBefore(s,f.k)}i>u?v(e,null==l[h+1]?null:l[h+1].k,n,l,c,h):c>h&&M(t,i,u)})(n,l,t,s):null!==s?(null!==e.$&&(n.textContent=""),v(n,null,t,s,0,s.length-1)):null!==l&&M(l,0,l.length-1)):e.$!==o&&(n.data=o)},P=e=>z(e).j,x=(e,t,n)=>{const l=P(e);return{emit:e=>E(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},E=(e,t,n)=>{const l=o.ce(t,n);return e.dispatchEvent(l),l},L=(e,t)=>{t&&!e.v&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.v=t)))},N=(e,t)=>{if(e.t|=16,!(4&e.t))return L(e,e.M),se((()=>R(e,t)));e.t|=512},R=(e,t)=>{const n=e.i;let l;return t&&(e.t|=256,e.u&&(e.u.map((([e,t])=>U(n,e,t))),e.u=null),l=U(n,"componentWillLoad")),q(l,(()=>T(e,n,t)))},T=async(e,t,n)=>{const l=e.j,o=l["s-rc"];n&&(e=>{const t=e.C,n=e.j,l=t.t,o=((e,t)=>{let n=h(t),l=X.get(n);if(e=11===e.nodeType?e:s,l)if("string"==typeof l){let t,o=d.get(e=e.head||e);o||d.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);W(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>A(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},W=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.j,o=n.C,i=n.O||p(null,null),c=(e=>e&&e.S===b)(l)?l:m(null,null,l);t=s.tagName,o.P&&(c.m=c.m||{},o.P.map((([e,t])=>c.m[t]=s[e]))),c.S=null,c.t|=4,n.O=c,c.k=i.k=s.shadowRoot||s,e=s["s-sc"],O(i,c)})(n,l)}catch(e){J(e,n.j)}return null},A=e=>{const t=e.j,n=e.M;U(e.i,"componentDidRender"),64&e.t||(e.t|=64,D(t),e.L(t),n||F()),e.v&&(e.v(),e.v=void 0),512&e.t&&le((()=>N(e,!1))),e.t&=-517},F=()=>{D(s.documentElement),le((()=>E(l,"appload",{detail:{namespace:"casino-engagement-suite-challenges-list"}})))},U=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){J(e)}},q=(e,t)=>e&&e.then?e.then(t):t(),D=e=>e.classList.add("hydrated"),H=(e,t,n)=>{if(t.N){e.watchers&&(t.R=e.watchers);const l=Object.entries(t.N),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>z(this).T.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=z(e),o=s.j,i=s.T.get(t),c=s.t,r=s.i;if(n=((e,t)=>null==e||$(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(n,l.N[t][0]),(!(8&c)||void 0===i)&&n!==i&&(!Number.isNaN(i)||!Number.isNaN(n))&&(s.T.set(t,n),r)){if(l.R&&128&c){const e=l.R[t];e&&e.map((e=>{try{r[e](n,i,t)}catch(e){J(e,o)}}))}2==(18&c)&&N(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.P.push([e,s]),s}))}}return e},V=(e,t={})=>{const n=[],i=t.exclude||[],a=l.customElements,u=s.head,f=u.querySelector("meta[charset]"),d=s.createElement("style"),y=[];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],h:t[1],N:t[2],W:t[3]};l.N=t[2],l.W=t[3],l.P=[],l.R={};const s=l.h,u=class extends HTMLElement{constructor(e){super(e),G(e=this,l),1&l.t&&e.attachShadow({mode:"open"})}connectedCallback(){$&&(clearTimeout($),$=null),m?y.push(this):o.jmp((()=>(e=>{if(0==(1&o.t)){const t=z(e),n=t.C,l=()=>{};if(1&t.t)r(e,t,n.W);else{t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){L(t,t.M=n);break}}n.N&&Object.entries(n.N).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=Q(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(n.R=s.watchers,H(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){J(e)}t.t&=-9,t.t|=128,e()}if(s.style){let e=s.style;const t=h(n);if(!X.has(t)){const l=()=>{};((e,t,n)=>{let l=X.get(e);c&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,X.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.M,i=()=>N(t,!0);o&&o["s-rc"]?o["s-rc"].push(i):i()})(0,t,n)}l()}})(this)))}disconnectedCallback(){o.jmp((()=>(()=>{if(0==(1&o.t)){const e=z(this),t=e.i;e.o&&(e.o.map((e=>e())),e.o=void 0),U(t,"disconnectedCallback")}})()))}componentOnReady(){return z(this).A}};l.F=e[0],i.includes(s)||a.get(s)||(n.push(s),a.define(s,H(u,l,1)))}))})),d.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",d.setAttribute("data-styles",""),u.insertBefore(d,f?f.nextSibling:u.firstChild),m=!1,y.length?y.map((e=>e.connectedCallback())):o.jmp((()=>$=setTimeout(F,30)))},_=new WeakMap,z=e=>_.get(e),B=(e,t)=>_.set(t.i=e,t),G=(e,t)=>{const n={t:0,j:e,C:t,T:new Map};return n.A=new Promise((e=>n.L=e)),e["s-p"]=[],e["s-rc"]=[],r(e,n,t.W),_.set(e,n)},I=(e,t)=>t in e,J=(e,t)=>(0,console.error)(e,t),K=new Map,Q=e=>{const t=e.h.replace(/-/g,"_"),n=e.F,l=K.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(K.set(n,e),e[t])),J)},X=new Map,Y=[],Z=[],ee=(e,t)=>l=>{e.push(l),n||(n=!0,t&&4&o.t?le(ne):o.raf(ne))},te=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){J(e)}e.length=0},ne=()=>{te(Y),te(Z),(n=Y.length>0)&&o.raf(ne)},le=e=>i().then(e),se=ee(Z,!0);export{V as b,x as c,P as g,m as h,i as p,B as r}
|