@everymatrix/casino-engagement-suite-challenges-details 1.35.0 → 1.36.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/dist/casino-engagement-suite-challenges-details/casino-engagement-suite-challenges-details.esm.js +1 -1
  2. package/dist/casino-engagement-suite-challenges-details/p-808a7dc5.js +1 -0
  3. package/dist/casino-engagement-suite-challenges-details/p-b3146c91.entry.js +1 -0
  4. package/dist/cjs/casino-engagement-suite-challenges-details.cjs.js +2 -2
  5. package/dist/cjs/casino-engagement-suite-challenges-details_2.cjs.entry.js +303 -0
  6. package/dist/cjs/{index-ec28d374.js → index-a0eb9215.js} +84 -3
  7. package/dist/cjs/loader.cjs.js +2 -2
  8. package/dist/collection/collection-manifest.json +8 -1
  9. package/dist/collection/components/casino-engagement-suite-challenges-details/casino-engagement-suite-challenges-details.css +18 -3
  10. package/dist/collection/components/casino-engagement-suite-challenges-details/casino-engagement-suite-challenges-details.js +119 -24
  11. package/dist/components/casino-engagement-suite-challenges-details.js +70 -19
  12. package/dist/components/casino-engagement-suite-progress-bar.js +6 -0
  13. package/dist/components/casino-engagement-suite-progress-bar2.js +94 -0
  14. package/dist/esm/casino-engagement-suite-challenges-details.js +2 -2
  15. package/dist/esm/casino-engagement-suite-challenges-details_2.entry.js +298 -0
  16. package/dist/esm/{index-13f457d0.js → index-c5abae48.js} +84 -3
  17. package/dist/esm/loader.js +2 -2
  18. package/dist/types/components/casino-engagement-suite-challenges-details/casino-engagement-suite-challenges-details.d.ts +18 -4
  19. package/dist/types/components.d.ts +17 -0
  20. package/dist/types/models/casino-challenges-details.d.ts +2 -0
  21. package/package.json +1 -1
  22. package/dist/casino-engagement-suite-challenges-details/p-27926b27.entry.js +0 -1
  23. package/dist/casino-engagement-suite-challenges-details/p-764c820d.js +0 -1
  24. package/dist/cjs/casino-engagement-suite-challenges-details.cjs.entry.js +0 -190
  25. package/dist/esm/casino-engagement-suite-challenges-details.entry.js +0 -186
@@ -1 +1 @@
1
- import{p as e,b as l}from"./p-764c820d.js";(()=>{const l=import.meta.url,i={};return""!==l&&(i.resourcesUrl=new URL(".",l).href),e(i)})().then((e=>l([["p-27926b27",[[1,"casino-engagement-suite-challenges-details",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],challenge:[16],language:[1],gameSlug:[1,"game-slug"],device:[1],limitStylingAppends:[32],timer:[32],showDetails:[32],isExpiredChallenge:[32]}]]]],e)));
1
+ import{p as e,b as i}from"./p-808a7dc5.js";(()=>{const i=import.meta.url,l={};return""!==i&&(l.resourcesUrl=new URL(".",i).href),e(l)})().then((e=>i([["p-b3146c91",[[1,"casino-engagement-suite-challenges-details",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],challenge:[16],inProgressChallenges:[16],language:[1],gameSlug:[1,"game-slug"],device:[1],isJoiningToChallenge:[1028,"is-joining-to-challenge"],limitStylingAppends:[32],timer:[32],showDetails:[32],isExpiredChallenge:[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-details"}})))},T=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){z(e)}},W=(e,t)=>e&&e.then?e.then(t):t(),A=e=>e.classList.add("hydrated"),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 l,g as s}from"./p-808a7dc5.js";const a=["en"],i={en:{challenges:"Challenges",join:"Join",unjoin:"Unjoin",details:"Challenge Details",tc:"Terms & Conditions",level:"Level",place:"Place",bet:"bet",bets:"bets",win:"Win"}},n=(e,t)=>{const l=t;return i[void 0!==l&&a.includes(l)?l:"en"][e]};var o,r;!function(e){e[e.Closed=0]="Closed",e[e.InProgress=1]="InProgress",e[e.Fillup=2]="Fillup",e[e.Completed=3]="Completed"}(o||(o={})),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"}(r||(r={}));const h=class{constructor(l){e(this,l),this.close=t(this,"close",7),this.back=t(this,"back",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.gameSlug="",this.device="Mobile",this.limitStylingAppends=!1,this.timer="",this.showDetails=!1,this.isExpiredChallenge=!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.handleBackClick=()=>{this.back.emit()},this.onGameClick=e=>{const t=e.currentTarget.getAttribute("data-slug");window.postMessage({type:"EngagementSuiteGameRedirect",Slug:t})},this.changeChallengeStatus=e=>{var t,l;const s=+e.currentTarget.getAttribute("data-id");(null===(t=this.inProgressChallenges)||void 0===t?void 0:t.includes(s))?window.postMessage({type:"ShowConfirmationModal",ProgressToDeactivate:s}):(null===(l=this.inProgressChallenges)||void 0===l?void 0:l.length)>0?window.postMessage({type:"ShowConfirmationModal",ProgressToActivate:s,ProgressToDeactivate:this.inProgressChallenges[0]}):window.postMessage({type:"ChallengeJoinRequest",data:{ProgressToActivate:s}})},this.toggle=()=>{this.showDetails=!this.showDetails}}challengePropHandler(e){!this.interval&&e&&(this.updateTimer(),this.startCountdown()),this.interval&&!e&&clearInterval(this.interval)}componentWillLoad(){this.challengePropHandler(this.challenge)}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}disconnectedCallback(){this.interval&&clearInterval(this.interval)}getActionsTemplate(){return l("header",{class:"ChallengeActions"},l("button",{class:"ChallengeIconButton",onClick:this.handleBackClick},l("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/back.svg",alt:"back"})),"Mobile"!==this.device&&l("div",{class:"ChallengePopupName"},n("challenges",this.language)),l("button",{class:"ChallengeIconButton",onClick:this.handleCloseClick},l("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"close"})))}getChallengeHeader(){const e=this.challenge.Status===r.InProgress;return l("div",{class:"ChallengeDetailsHeader"},l("span",{class:"ChallengeName"},this.challenge.ChallengePresentation.PresentationName),l("button",{onClick:this.changeChallengeStatus,class:`ChallengeJoinButton ${e?"Joined":""}\n ${this.isExpiredChallenge||this.isJoiningToChallenge?"Disabled":""}`,"data-id":this.challenge.Id},n(e?"unjoin":"join",this.language)))}getChallengeCountdown(){return l("div",{class:"ChallengeCountdown "+(this.isExpiredChallenge?"Expired":"")},this.isExpiredChallenge?"Expired":this.timer)}getChallengeDetails(){const e=this.challenge.ChallengePresentation.Description,t=this.challenge.ChallengePresentation.Url,s=this.challenge.Games;return l("div",{class:"CollapseDetails "+(this.showDetails?"ShowDetails":"")},e&&l("span",{class:"ChallengeDescription"},e),t&&l("div",{class:"TC"},l("a",{href:t,target:"_blank"},n("tc",this.language))),(null==s?void 0:s.length)&&l("div",{class:"ChallengeGames"},s.map((e=>l("div",{class:"Game",key:e.CasinoGameId},l("img",{src:e.GameIcon,alt:e.GameName,onClick:this.onGameClick,class:e.GameSlug===this.gameSlug?"Disabled":"","data-slug":e.GameSlug}))))))}startCountdown(){this.interval=setInterval((()=>{this.updateTimer()}),1e3)}updateTimer(){const e=new Date(this.challenge.ExpirationTime).getTime()-(new Date).getTime();if(e<1)return clearInterval(this.interval),this.timer="",void(this.isExpiredChallenge=!0);const{days:t,hours:l,minutes:s,seconds:a}={days:String(Math.floor(e/864e5)).padStart(2,"0"),hours:String(Math.floor(e%864e5/36e5)).padStart(2,"0"),minutes:String(Math.floor(e%36e5/6e4)).padStart(2,"0"),seconds:String(Math.floor(e%6e4/1e3)).padStart(2,"0")};this.timer="00"===t?`${l}h:${s}m:${a}s`:`${t}d:${l}h:${s}m`}getLevelTarget(e){let t=`${n("place",this.language)} ${e.DisplayCurrencyTargetTurnover}`;return 1===e.LevelTargetType?t+=` ${n("bet",this.language)}`:2===e.LevelTargetType&&(t+=` ${n("bets",this.language)} X ${e.TargetBetCount}`),l("span",{class:"ChallengeLevelTarget"},t)}getChallengeLevels(){const e=this.challenge.Status===r.Started&&this.challenge.LevelProgresses[0].ProgressPercentage>0,t=t=>"ChallengeLevelCard "+(1!==t.ProgressStatus||this.isExpiredChallenge||e?"":"InProgress");return l("div",{class:"ChallengeLevels"},this.challenge.LevelProgresses.map(((s,a)=>l("div",{class:t(s)},l("casino-engagement-suite-progress-bar",{class:this.device,value:s.ProgressPercentage,"hide-percent":0===s.ProgressPercentage||100===s.ProgressPercentage,disabled:this.isExpiredChallenge||e},l("span",{slot:"Title",class:"ChallengeLevelTitle"},l("span",null,"Level ",a+1,": "),this.getLevelTarget(s))),l("div",{class:"ChallengeRewardMessage"},l("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/reward.svg",alt:"win"}),l("span",null,n("win",this.language),": "),l("span",{class:"CustomRewardMessage"},s.CustomRewardMessage))))))}getToggleButton(){return l("div",{class:"ChallengeCollapseButton",onClick:this.toggle},l("span",{class:"Toggle "+(this.showDetails?"Closed":"Open")}),l("span",null,n("details",this.language)))}render(){return l("div",{class:`ChallengeDetailsPopup ${this.device}`},this.getActionsTemplate(),l("div",{class:"ChallengeDetails"},this.getChallengeHeader(),this.getChallengeCountdown(),this.getToggleButton(),this.getChallengeDetails(),this.getChallengeLevels()))}get host(){return s(this)}static get watchers(){return{challenge:["challengePropHandler"]}}};h.style='@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;900&display=swap"); :host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.ChallengeDetailsPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative}.ChallengeActions{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.ChallengeActions .ChallengeIconButton{width:16px;height:16px;cursor:pointer}.ChallengeActions .ChallengePopupName{color:var(--emw--color-gray-100, #BBB9C3);font-size:16px;font-weight:500;line-height:16px}.ChallengeDetails{padding:0px 19px 10px;overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.ChallengeDetails::-webkit-scrollbar{display:none}.ChallengeDetailsHeader{display:flex;justify-content:space-between;gap:12px}.ChallengeDetailsHeader .ChallengeName{font-family:"Montserrat", sans-serif;font-size:var(--emw--font-size-medium, 18px);font-weight:var(--emw--font-weight-bold, 700);line-height:22px;color:var(--emfe-w-color-white, #FFF);word-break:break-all}.ChallengeJoinButton.Joined::before{content:"";position:absolute;inset:0;border-radius:var(--emw--button-border-radius, 4px);padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.ChallengeJoinButton{transition:all 0.5s ease-out;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:var(--emw--color-typography, #1E1638);border-radius:99px;min-width:88px;height:32px;font-size:14px;font-weight:700;position:relative;font-family:"Montserrat", sans-serif}.ChallengeJoinButton.Joined{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.ChallengeJoinButton.Joined::before{border-radius:99px}.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.ChallengeCountdown{font-weight:var(--emw--font-weight-normal, 400);font-size:var(--emw--font-size-x-small, 12px);line-height:12px;margin:12px 0 24px;color:var(--emw--color-gray-150, #BBB9C3)}.ChallengeCountdown.Expired{font-weight:var(--emw--font-weight-normal, 700);color:var(--emfe-w-color-white, #FFF)}.ChallengeCollapseButton{margin-bottom:14px;display:flex;flex-direction:row;align-items:center;font-size:var(--emw--font-size-x-small, 12px);line-height:12px;color:var(--emw--color-primary-variant, #666178);cursor:pointer}.ChallengeCollapseButton .Toggle{width:16px;height:16px;display:block;margin-right:4px}.ChallengeCollapseButton .Closed{background:url("https://static.everymatrix.com/gic/img/engagement-suite/eye-closed.svg") no-repeat center/contain}.ChallengeCollapseButton .Open{background:url("https://static.everymatrix.com/gic/img/engagement-suite/eye-open.svg") no-repeat center/contain}.CollapseDetails{display:none;font-size:var(--emw--font-size-small, 14px);line-height:17px;font-weight:var(--emw--font-weight-normal, 400)}.CollapseDetails .ChallengeDescription{color:var(--emfe-w-color-white, #FFF);margin-bottom:12px}.CollapseDetails .TC{margin:12px 0 16px}.CollapseDetails .TC a{color:var(--emw--color-secondary, #59D1FF);text-underline-offset:3px}.CollapseDetails .ChallengeGames{width:100%;overflow-y:auto;display:flex;gap:4px}.CollapseDetails .ChallengeGames::-webkit-scrollbar{height:2px;background:none}.CollapseDetails .ChallengeGames::-webkit-scrollbar-thumb{border-radius:4px;background-color:var(--emw--color-background, #666178)}.CollapseDetails .ChallengeGames .Game img{width:96px;height:50px;border-radius:2px;cursor:pointer}.ShowDetails{display:block}.ChallengeLevels{display:flex;flex-direction:column;gap:16px;margin-top:24px;color:var(--emw--color-primary, #8F8B9C);font-size:var(--emw--font-size-small, 12px);font-weight:var(--emw--font-weight-normal, 400);line-height:12px}.ChallengeLevels .ChallengeLevelCard{border:1px solid var(--emw--button-border-color, #403956);padding:16px;border-radius:8px}.ChallengeLevels .ChallengeLevelCard .ChallengeLevelTitle{margin-bottom:2px}.ChallengeLevels .ChallengeLevelCard .ChallengeRewardMessage{margin-top:10px;line-height:15px;display:flex;flex-direction:row;align-items:center;gap:4px}.ChallengeLevels .ChallengeLevelCard .ChallengeRewardMessage .CustomRewardMessage{font-weight:var(--emw--font-weight-semibold, 600);word-break:break-all}.ChallengeLevels .InProgress{position:relative;border:none}.ChallengeLevels .InProgress .ChallengeLevelTarget,.ChallengeLevels .InProgress .CustomRewardMessage{color:var(--emfe-w-color-white, #FFF)}.ChallengeLevels .InProgress::before{content:"";position:absolute;inset:0;border-radius:8px;padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.ChallengeDetailsPopup.Tablet .ChallengeActions,.ChallengeDetailsPopup.Desktop .ChallengeActions{padding-top:16px}.ChallengeDetailsPopup.Tablet .ChallengeIconButton,.ChallengeDetailsPopup.Desktop .ChallengeIconButton{width:24px;height:24px}.ChallengeDetailsPopup.Tablet .ChallengeDetails,.ChallengeDetailsPopup.Desktop .ChallengeDetails{padding:20px 24px}.ChallengeDetailsPopup.Tablet .ChallengeName,.ChallengeDetailsPopup.Desktop .ChallengeName{line-height:27px;font-size:22px}.ChallengeDetailsPopup.Tablet .ChallengeJoinButton,.ChallengeDetailsPopup.Desktop .ChallengeJoinButton{min-width:100px;height:36px;font-size:16px}.ChallengeDetailsPopup.Tablet .ChallengeCountdown,.ChallengeDetailsPopup.Tablet .ChallengeLevels,.ChallengeDetailsPopup.Desktop .ChallengeCountdown,.ChallengeDetailsPopup.Desktop .ChallengeLevels{font-size:var(--emw--font-size-small, 14px);line-height:14px}.ChallengeDetailsPopup.Tablet .ChallengeCollapseButton,.ChallengeDetailsPopup.Desktop .ChallengeCollapseButton{margin-bottom:12px}.ChallengeDetailsPopup.Tablet .ChallengeLevels .ChallengeLevelTitle,.ChallengeDetailsPopup.Desktop .ChallengeLevels .ChallengeLevelTitle{margin-bottom:4px}.ChallengeDetailsPopup.Tablet .ChallengeLevels .ChallengeRewardMessage,.ChallengeDetailsPopup.Desktop .ChallengeLevels .ChallengeRewardMessage{margin-top:12px;line-height:17px}';const g=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 l("div",{class:this.getProgressBarClasses(),part:"ProgressBar"},l("div",{class:"ProgressBarInfo",part:"ProgressBarInfo"},l("slot",{name:"Title"},l("div",null)),l("slot",{name:"Percent"},l("div",{class:"ProgressBarPercent",part:"ProgressBarPercent"},this.value,"%"))),l("div",{class:"ProgressBarBackground",part:"ProgressBarBackground"},l("div",{class:"ProgressBarLine",part:"ProgressBarLine",style:{width:this.value+"%"}})))}get host(){return s(this)}};g.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_details,g as casino_engagement_suite_progress_bar}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-ec28d374.js');
3
+ const index = require('./index-a0eb9215.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-details.cjs",[[1,"casino-engagement-suite-challenges-details",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"challenge":[16],"language":[1],"gameSlug":[1,"game-slug"],"device":[1],"limitStylingAppends":[32],"timer":[32],"showDetails":[32],"isExpiredChallenge":[32]}]]]], options);
18
+ return index.bootstrapLazy([["casino-engagement-suite-challenges-details_2.cjs",[[1,"casino-engagement-suite-challenges-details",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"challenge":[16],"inProgressChallenges":[16],"language":[1],"gameSlug":[1,"game-slug"],"device":[1],"isJoiningToChallenge":[1028,"is-joining-to-challenge"],"limitStylingAppends":[32],"timer":[32],"showDetails":[32],"isExpiredChallenge":[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
  });
@@ -0,0 +1,303 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-a0eb9215.js');
6
+
7
+ const DEFAULT_LANGUAGE = 'en';
8
+ const SUPPORTED_LANGUAGES = ['en'];
9
+ const TRANSLATIONS = {
10
+ en: {
11
+ challenges: 'Challenges',
12
+ join: 'Join',
13
+ unjoin: 'Unjoin',
14
+ details: 'Challenge Details',
15
+ tc: 'Terms & Conditions',
16
+ level: 'Level',
17
+ place: 'Place',
18
+ bet: 'bet',
19
+ bets: 'bets',
20
+ win: 'Win'
21
+ }
22
+ };
23
+ const translate = (key, customLang) => {
24
+ const lang = customLang;
25
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
26
+ };
27
+
28
+ var ChallengeLevelProgressStatus;
29
+ (function (ChallengeLevelProgressStatus) {
30
+ ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["Closed"] = 0] = "Closed";
31
+ ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["InProgress"] = 1] = "InProgress";
32
+ ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["Fillup"] = 2] = "Fillup";
33
+ ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["Completed"] = 3] = "Completed";
34
+ })(ChallengeLevelProgressStatus || (ChallengeLevelProgressStatus = {}));
35
+ var ChallengeProgressStatus;
36
+ (function (ChallengeProgressStatus) {
37
+ ChallengeProgressStatus[ChallengeProgressStatus["Started"] = 0] = "Started";
38
+ ChallengeProgressStatus[ChallengeProgressStatus["InProgress"] = 1] = "InProgress";
39
+ ChallengeProgressStatus[ChallengeProgressStatus["PendingLevelReward"] = 2] = "PendingLevelReward";
40
+ ChallengeProgressStatus[ChallengeProgressStatus["Completed"] = 3] = "Completed";
41
+ ChallengeProgressStatus[ChallengeProgressStatus["Expired"] = 4] = "Expired";
42
+ })(ChallengeProgressStatus || (ChallengeProgressStatus = {}));
43
+
44
+ const casinoEngagementSuiteChallengesDetailsCss = "@import url(\"https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;900&display=swap\"); :host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.ChallengeDetailsPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative}.ChallengeActions{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.ChallengeActions .ChallengeIconButton{width:16px;height:16px;cursor:pointer}.ChallengeActions .ChallengePopupName{color:var(--emw--color-gray-100, #BBB9C3);font-size:16px;font-weight:500;line-height:16px}.ChallengeDetails{padding:0px 19px 10px;overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.ChallengeDetails::-webkit-scrollbar{display:none}.ChallengeDetailsHeader{display:flex;justify-content:space-between;gap:12px}.ChallengeDetailsHeader .ChallengeName{font-family:\"Montserrat\", sans-serif;font-size:var(--emw--font-size-medium, 18px);font-weight:var(--emw--font-weight-bold, 700);line-height:22px;color:var(--emfe-w-color-white, #FFF);word-break:break-all}.ChallengeJoinButton.Joined::before{content:\"\";position:absolute;inset:0;border-radius:var(--emw--button-border-radius, 4px);padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.ChallengeJoinButton{transition:all 0.5s ease-out;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:var(--emw--color-typography, #1E1638);border-radius:99px;min-width:88px;height:32px;font-size:14px;font-weight:700;position:relative;font-family:\"Montserrat\", sans-serif}.ChallengeJoinButton.Joined{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.ChallengeJoinButton.Joined::before{border-radius:99px}.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.ChallengeCountdown{font-weight:var(--emw--font-weight-normal, 400);font-size:var(--emw--font-size-x-small, 12px);line-height:12px;margin:12px 0 24px;color:var(--emw--color-gray-150, #BBB9C3)}.ChallengeCountdown.Expired{font-weight:var(--emw--font-weight-normal, 700);color:var(--emfe-w-color-white, #FFF)}.ChallengeCollapseButton{margin-bottom:14px;display:flex;flex-direction:row;align-items:center;font-size:var(--emw--font-size-x-small, 12px);line-height:12px;color:var(--emw--color-primary-variant, #666178);cursor:pointer}.ChallengeCollapseButton .Toggle{width:16px;height:16px;display:block;margin-right:4px}.ChallengeCollapseButton .Closed{background:url(\"https://static.everymatrix.com/gic/img/engagement-suite/eye-closed.svg\") no-repeat center/contain}.ChallengeCollapseButton .Open{background:url(\"https://static.everymatrix.com/gic/img/engagement-suite/eye-open.svg\") no-repeat center/contain}.CollapseDetails{display:none;font-size:var(--emw--font-size-small, 14px);line-height:17px;font-weight:var(--emw--font-weight-normal, 400)}.CollapseDetails .ChallengeDescription{color:var(--emfe-w-color-white, #FFF);margin-bottom:12px}.CollapseDetails .TC{margin:12px 0 16px}.CollapseDetails .TC a{color:var(--emw--color-secondary, #59D1FF);text-underline-offset:3px}.CollapseDetails .ChallengeGames{width:100%;overflow-y:auto;display:flex;gap:4px}.CollapseDetails .ChallengeGames::-webkit-scrollbar{height:2px;background:none}.CollapseDetails .ChallengeGames::-webkit-scrollbar-thumb{border-radius:4px;background-color:var(--emw--color-background, #666178)}.CollapseDetails .ChallengeGames .Game img{width:96px;height:50px;border-radius:2px;cursor:pointer}.ShowDetails{display:block}.ChallengeLevels{display:flex;flex-direction:column;gap:16px;margin-top:24px;color:var(--emw--color-primary, #8F8B9C);font-size:var(--emw--font-size-small, 12px);font-weight:var(--emw--font-weight-normal, 400);line-height:12px}.ChallengeLevels .ChallengeLevelCard{border:1px solid var(--emw--button-border-color, #403956);padding:16px;border-radius:8px}.ChallengeLevels .ChallengeLevelCard .ChallengeLevelTitle{margin-bottom:2px}.ChallengeLevels .ChallengeLevelCard .ChallengeRewardMessage{margin-top:10px;line-height:15px;display:flex;flex-direction:row;align-items:center;gap:4px}.ChallengeLevels .ChallengeLevelCard .ChallengeRewardMessage .CustomRewardMessage{font-weight:var(--emw--font-weight-semibold, 600);word-break:break-all}.ChallengeLevels .InProgress{position:relative;border:none}.ChallengeLevels .InProgress .ChallengeLevelTarget,.ChallengeLevels .InProgress .CustomRewardMessage{color:var(--emfe-w-color-white, #FFF)}.ChallengeLevels .InProgress::before{content:\"\";position:absolute;inset:0;border-radius:8px;padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.ChallengeDetailsPopup.Tablet .ChallengeActions,.ChallengeDetailsPopup.Desktop .ChallengeActions{padding-top:16px}.ChallengeDetailsPopup.Tablet .ChallengeIconButton,.ChallengeDetailsPopup.Desktop .ChallengeIconButton{width:24px;height:24px}.ChallengeDetailsPopup.Tablet .ChallengeDetails,.ChallengeDetailsPopup.Desktop .ChallengeDetails{padding:20px 24px}.ChallengeDetailsPopup.Tablet .ChallengeName,.ChallengeDetailsPopup.Desktop .ChallengeName{line-height:27px;font-size:22px}.ChallengeDetailsPopup.Tablet .ChallengeJoinButton,.ChallengeDetailsPopup.Desktop .ChallengeJoinButton{min-width:100px;height:36px;font-size:16px}.ChallengeDetailsPopup.Tablet .ChallengeCountdown,.ChallengeDetailsPopup.Tablet .ChallengeLevels,.ChallengeDetailsPopup.Desktop .ChallengeCountdown,.ChallengeDetailsPopup.Desktop .ChallengeLevels{font-size:var(--emw--font-size-small, 14px);line-height:14px}.ChallengeDetailsPopup.Tablet .ChallengeCollapseButton,.ChallengeDetailsPopup.Desktop .ChallengeCollapseButton{margin-bottom:12px}.ChallengeDetailsPopup.Tablet .ChallengeLevels .ChallengeLevelTitle,.ChallengeDetailsPopup.Desktop .ChallengeLevels .ChallengeLevelTitle{margin-bottom:4px}.ChallengeDetailsPopup.Tablet .ChallengeLevels .ChallengeRewardMessage,.ChallengeDetailsPopup.Desktop .ChallengeLevels .ChallengeRewardMessage{margin-top:12px;line-height:17px}";
45
+
46
+ const CasinoEngagementSuiteChallengesDetails = class {
47
+ constructor(hostRef) {
48
+ index.registerInstance(this, hostRef);
49
+ this.close = index.createEvent(this, "close", 7);
50
+ this.back = index.createEvent(this, "back", 7);
51
+ /**
52
+ * Client custom styling via string
53
+ */
54
+ this.clientStyling = '';
55
+ /**
56
+ * Client custom styling via url
57
+ */
58
+ this.clientStylingUrl = '';
59
+ /**
60
+ * Language of the widget
61
+ */
62
+ this.language = 'en';
63
+ /**
64
+ * Current game slug
65
+ */
66
+ this.gameSlug = '';
67
+ /**
68
+ * User's device type
69
+ */
70
+ this.device = 'Mobile';
71
+ this.limitStylingAppends = false;
72
+ this.timer = '';
73
+ this.showDetails = false;
74
+ this.isExpiredChallenge = false;
75
+ this.setClientStyling = () => {
76
+ let sheet = document.createElement('style');
77
+ sheet.innerHTML = this.clientStyling;
78
+ this.host.prepend(sheet);
79
+ };
80
+ this.setClientStylingURL = () => {
81
+ let url = new URL(this.clientStylingUrl);
82
+ let cssFile = document.createElement('style');
83
+ fetch(url.href)
84
+ .then((res) => res.text())
85
+ .then((data) => {
86
+ cssFile.innerHTML = data;
87
+ setTimeout(() => { this.host.prepend(cssFile); }, 1);
88
+ })
89
+ .catch((err) => {
90
+ console.log('Error ', err);
91
+ });
92
+ };
93
+ this.handleCloseClick = () => {
94
+ this.close.emit();
95
+ };
96
+ this.handleBackClick = () => {
97
+ this.back.emit();
98
+ };
99
+ this.onGameClick = (ev) => {
100
+ const gameSlug = ev.currentTarget.getAttribute('data-slug');
101
+ window.postMessage({ type: 'EngagementSuiteGameRedirect', Slug: gameSlug });
102
+ };
103
+ this.changeChallengeStatus = (e) => {
104
+ var _a, _b;
105
+ const id = +e.currentTarget.getAttribute('data-id');
106
+ if ((_a = this.inProgressChallenges) === null || _a === void 0 ? void 0 : _a.includes(id)) {
107
+ window.postMessage({
108
+ type: 'ShowConfirmationModal',
109
+ ProgressToDeactivate: id,
110
+ });
111
+ return;
112
+ }
113
+ if (((_b = this.inProgressChallenges) === null || _b === void 0 ? void 0 : _b.length) > 0) {
114
+ window.postMessage({
115
+ type: 'ShowConfirmationModal',
116
+ ProgressToActivate: id,
117
+ ProgressToDeactivate: this.inProgressChallenges[0],
118
+ });
119
+ return;
120
+ }
121
+ window.postMessage({
122
+ type: 'ChallengeJoinRequest',
123
+ data: {
124
+ ProgressToActivate: id,
125
+ },
126
+ });
127
+ };
128
+ this.toggle = () => {
129
+ this.showDetails = !this.showDetails;
130
+ };
131
+ }
132
+ challengePropHandler(value) {
133
+ if (!this.interval && value) {
134
+ this.updateTimer();
135
+ this.startCountdown();
136
+ }
137
+ if (this.interval && !value) {
138
+ clearInterval(this.interval);
139
+ }
140
+ }
141
+ componentWillLoad() {
142
+ this.challengePropHandler(this.challenge);
143
+ }
144
+ componentDidRender() {
145
+ if (!this.limitStylingAppends && this.host) {
146
+ if (this.clientStyling)
147
+ this.setClientStyling();
148
+ if (this.clientStylingUrl)
149
+ this.setClientStylingURL();
150
+ this.limitStylingAppends = true;
151
+ }
152
+ }
153
+ disconnectedCallback() {
154
+ this.interval && clearInterval(this.interval);
155
+ }
156
+ getActionsTemplate() {
157
+ return (index.h("header", { class: "ChallengeActions" }, index.h("button", { class: "ChallengeIconButton", onClick: this.handleBackClick }, index.h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/back.svg", alt: "back" })), this.device !== 'Mobile' && index.h("div", { class: "ChallengePopupName" }, translate('challenges', this.language)), index.h("button", { class: "ChallengeIconButton", onClick: this.handleCloseClick }, index.h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", alt: "close" }))));
158
+ }
159
+ getChallengeHeader() {
160
+ const presentationName = this.challenge.ChallengePresentation.PresentationName;
161
+ const inProgressChallenge = this.challenge.Status === ChallengeProgressStatus.InProgress;
162
+ return (index.h("div", { class: "ChallengeDetailsHeader" }, index.h("span", { class: "ChallengeName" }, presentationName), index.h("button", { onClick: this.changeChallengeStatus, class: `ChallengeJoinButton ${inProgressChallenge ? 'Joined' : ''}
163
+ ${this.isExpiredChallenge || this.isJoiningToChallenge ? 'Disabled' : ''}`, "data-id": this.challenge.Id }, inProgressChallenge
164
+ ? translate('unjoin', this.language)
165
+ : translate('join', this.language))));
166
+ }
167
+ getChallengeCountdown() {
168
+ const timerMessage = this.isExpiredChallenge ? 'Expired' : this.timer;
169
+ return (index.h("div", { class: `ChallengeCountdown ${this.isExpiredChallenge ? 'Expired' : ''}` }, timerMessage));
170
+ }
171
+ getChallengeDetails() {
172
+ const description = this.challenge.ChallengePresentation.Description;
173
+ const url = this.challenge.ChallengePresentation.Url;
174
+ const games = this.challenge.Games;
175
+ return (index.h("div", { class: `CollapseDetails ${this.showDetails ? 'ShowDetails' : ''}` }, description && index.h("span", { class: "ChallengeDescription" }, description), url && (index.h("div", { class: "TC" }, index.h("a", { href: url, target: "_blank" }, translate('tc', this.language)))), (games === null || games === void 0 ? void 0 : games.length) && (index.h("div", { class: "ChallengeGames" }, games.map((game) => (index.h("div", { class: "Game", key: game.CasinoGameId }, index.h("img", { src: game.GameIcon, alt: game.GameName, onClick: this.onGameClick, class: `${game.GameSlug === this.gameSlug ? 'Disabled' : ''}`, "data-slug": game.GameSlug }))))))));
176
+ }
177
+ startCountdown() {
178
+ this.interval = setInterval(() => {
179
+ this.updateTimer();
180
+ }, 1000);
181
+ }
182
+ updateTimer() {
183
+ const expirationTime = new Date(this.challenge.ExpirationTime).getTime();
184
+ const now = new Date().getTime();
185
+ const distance = expirationTime - now;
186
+ if (distance < 1) {
187
+ clearInterval(this.interval);
188
+ this.timer = '';
189
+ this.isExpiredChallenge = true;
190
+ return;
191
+ }
192
+ const { days, hours, minutes, seconds } = {
193
+ days: String(Math.floor(distance / (1000 * 60 * 60 * 24))).padStart(2, '0'),
194
+ hours: String(Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))).padStart(2, '0'),
195
+ minutes: String(Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60))).padStart(2, '0'),
196
+ seconds: String(Math.floor((distance % (1000 * 60)) / 1000)).padStart(2, '0')
197
+ };
198
+ this.timer = days === '00'
199
+ ? `${hours}h:${minutes}m:${seconds}s`
200
+ : `${days}d:${hours}h:${minutes}m`;
201
+ }
202
+ getLevelTarget(level) {
203
+ let levelTarget = `${translate('place', this.language)} ${level.DisplayCurrencyTargetTurnover}`;
204
+ if (level.LevelTargetType === 1) {
205
+ levelTarget += ` ${translate('bet', this.language)}`;
206
+ }
207
+ else if (level.LevelTargetType === 2) {
208
+ levelTarget += ` ${translate('bets', this.language)} X ${level.TargetBetCount}`;
209
+ }
210
+ return (index.h("span", { class: "ChallengeLevelTarget" }, levelTarget));
211
+ }
212
+ getChallengeLevels() {
213
+ const isChallengePaused = this.challenge.Status === ChallengeProgressStatus.Started
214
+ && this.challenge.LevelProgresses[0].ProgressPercentage > 0;
215
+ const getClass = (level) => {
216
+ return `ChallengeLevelCard ${(level.ProgressStatus === 1 && !this.isExpiredChallenge && !isChallengePaused) ? 'InProgress' : ''}`;
217
+ };
218
+ return (index.h("div", { class: "ChallengeLevels" }, this.challenge.LevelProgresses.map((level, index$1) => (index.h("div", { class: getClass(level) }, index.h("casino-engagement-suite-progress-bar", { class: this.device, value: level.ProgressPercentage, "hide-percent": level.ProgressPercentage === 0 || level.ProgressPercentage === 100, disabled: this.isExpiredChallenge || isChallengePaused }, index.h("span", { slot: "Title", class: "ChallengeLevelTitle" }, index.h("span", null, "Level ", index$1 + 1, ": "), this.getLevelTarget(level))), index.h("div", { class: "ChallengeRewardMessage" }, index.h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/reward.svg", alt: "win" }), index.h("span", null, translate('win', this.language), ": "), index.h("span", { class: "CustomRewardMessage" }, level.CustomRewardMessage)))))));
219
+ }
220
+ getToggleButton() {
221
+ return (index.h("div", { class: "ChallengeCollapseButton", onClick: this.toggle }, index.h("span", { class: `Toggle ${this.showDetails ? 'Closed' : 'Open'}` }), index.h("span", null, translate('details', this.language))));
222
+ }
223
+ render() {
224
+ return index.h("div", { class: `ChallengeDetailsPopup ${this.device}` }, this.getActionsTemplate(), index.h("div", { class: "ChallengeDetails" }, this.getChallengeHeader(), this.getChallengeCountdown(), this.getToggleButton(), this.getChallengeDetails(), this.getChallengeLevels()));
225
+ }
226
+ get host() { return index.getElement(this); }
227
+ static get watchers() { return {
228
+ "challenge": ["challengePropHandler"]
229
+ }; }
230
+ };
231
+ CasinoEngagementSuiteChallengesDetails.style = casinoEngagementSuiteChallengesDetailsCss;
232
+
233
+ const casinoEngagementSuiteProgressBarCss = ":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)}";
234
+
235
+ const CasinoEngagementSuiteProgressBar = class {
236
+ constructor(hostRef) {
237
+ index.registerInstance(this, hostRef);
238
+ /**
239
+ * Value for the widget
240
+ */
241
+ this.value = 0;
242
+ /**
243
+ * Shows disabled styles
244
+ */
245
+ this.disabled = false;
246
+ /**
247
+ * Hide percent value
248
+ */
249
+ this.hidePercent = false;
250
+ /**
251
+ * Client custom styling via string
252
+ */
253
+ this.clientStyling = '';
254
+ /**
255
+ * Client custom styling via url
256
+ */
257
+ this.clientStylingUrl = '';
258
+ this.limitStylingAppends = false;
259
+ this.setClientStyling = () => {
260
+ let sheet = document.createElement('style');
261
+ sheet.innerHTML = this.clientStyling;
262
+ this.host.prepend(sheet);
263
+ };
264
+ this.setClientStylingURL = () => {
265
+ let url = new URL(this.clientStylingUrl);
266
+ let cssFile = document.createElement('style');
267
+ fetch(url.href)
268
+ .then((res) => res.text())
269
+ .then((data) => {
270
+ cssFile.innerHTML = data;
271
+ setTimeout(() => { this.host.prepend(cssFile); }, 1);
272
+ })
273
+ .catch((err) => {
274
+ console.log('Error ', err);
275
+ });
276
+ };
277
+ }
278
+ componentDidRender() {
279
+ if (!this.limitStylingAppends && this.host) {
280
+ if (this.clientStyling)
281
+ this.setClientStyling();
282
+ if (this.clientStylingUrl)
283
+ this.setClientStylingURL();
284
+ this.limitStylingAppends = true;
285
+ }
286
+ }
287
+ getProgressBarClasses() {
288
+ return {
289
+ ProgressBar: true,
290
+ Completed: this.value === 100,
291
+ Disabled: this.disabled,
292
+ HidePercent: this.hidePercent
293
+ };
294
+ }
295
+ render() {
296
+ return index.h("div", { class: this.getProgressBarClasses(), part: "ProgressBar" }, index.h("div", { class: "ProgressBarInfo", part: "ProgressBarInfo" }, index.h("slot", { name: "Title" }, index.h("div", null)), index.h("slot", { name: "Percent" }, index.h("div", { class: "ProgressBarPercent", part: "ProgressBarPercent" }, this.value, "%"))), index.h("div", { class: "ProgressBarBackground", part: "ProgressBarBackground" }, index.h("div", { class: "ProgressBarLine", part: "ProgressBarLine", style: { width: this.value + '%' } })));
297
+ }
298
+ get host() { return index.getElement(this); }
299
+ };
300
+ CasinoEngagementSuiteProgressBar.style = casinoEngagementSuiteProgressBarCss;
301
+
302
+ exports.casino_engagement_suite_challenges_details = CasinoEngagementSuiteChallengesDetails;
303
+ exports.casino_engagement_suite_progress_bar = CasinoEngagementSuiteProgressBar;
@@ -154,6 +154,7 @@ const isComplexType = (o) => {
154
154
  // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
155
155
  const h = (nodeName, vnodeData, ...children) => {
156
156
  let child = null;
157
+ let key = null;
157
158
  let simple = false;
158
159
  let lastSimple = false;
159
160
  let vNodeChildren = [];
@@ -181,6 +182,10 @@ const h = (nodeName, vnodeData, ...children) => {
181
182
  };
182
183
  walk(children);
183
184
  if (vnodeData) {
185
+ // normalize class / classname attributes
186
+ if (vnodeData.key) {
187
+ key = vnodeData.key;
188
+ }
184
189
  {
185
190
  const classData = vnodeData.className || vnodeData.class;
186
191
  if (classData) {
@@ -198,6 +203,9 @@ const h = (nodeName, vnodeData, ...children) => {
198
203
  if (vNodeChildren.length > 0) {
199
204
  vnode.$children$ = vNodeChildren;
200
205
  }
206
+ {
207
+ vnode.$key$ = key;
208
+ }
201
209
  return vnode;
202
210
  };
203
211
  const newVNode = (tag, text) => {
@@ -211,6 +219,9 @@ const newVNode = (tag, text) => {
211
219
  {
212
220
  vnode.$attrs$ = null;
213
221
  }
222
+ {
223
+ vnode.$key$ = null;
224
+ }
214
225
  return vnode;
215
226
  };
216
227
  const Host = {};
@@ -234,6 +245,33 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
234
245
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
235
246
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
236
247
  }
248
+ else if (memberName === 'style') {
249
+ // update style attribute, css properties and values
250
+ {
251
+ for (const prop in oldValue) {
252
+ if (!newValue || newValue[prop] == null) {
253
+ if (prop.includes('-')) {
254
+ elm.style.removeProperty(prop);
255
+ }
256
+ else {
257
+ elm.style[prop] = '';
258
+ }
259
+ }
260
+ }
261
+ }
262
+ for (const prop in newValue) {
263
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
264
+ if (prop.includes('-')) {
265
+ elm.style.setProperty(prop, newValue[prop]);
266
+ }
267
+ else {
268
+ elm.style[prop] = newValue[prop];
269
+ }
270
+ }
271
+ }
272
+ }
273
+ else if (memberName === 'key')
274
+ ;
237
275
  else if ((!isProp ) &&
238
276
  memberName[0] === 'o' &&
239
277
  memberName[1] === 'n') {
@@ -398,6 +436,8 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
398
436
  const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
399
437
  let oldStartIdx = 0;
400
438
  let newStartIdx = 0;
439
+ let idxInOld = 0;
440
+ let i = 0;
401
441
  let oldEndIdx = oldCh.length - 1;
402
442
  let oldStartVnode = oldCh[0];
403
443
  let oldEndVnode = oldCh[oldEndIdx];
@@ -405,6 +445,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
405
445
  let newStartVnode = newCh[0];
406
446
  let newEndVnode = newCh[newEndIdx];
407
447
  let node;
448
+ let elmToMove;
408
449
  while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
409
450
  if (oldStartVnode == null) {
410
451
  // Vnode might have been moved left
@@ -442,7 +483,29 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
442
483
  newStartVnode = newCh[++newStartIdx];
443
484
  }
444
485
  else {
486
+ // createKeyToOldIdx
487
+ idxInOld = -1;
445
488
  {
489
+ for (i = oldStartIdx; i <= oldEndIdx; ++i) {
490
+ if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
491
+ idxInOld = i;
492
+ break;
493
+ }
494
+ }
495
+ }
496
+ if (idxInOld >= 0) {
497
+ elmToMove = oldCh[idxInOld];
498
+ if (elmToMove.$tag$ !== newStartVnode.$tag$) {
499
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
500
+ }
501
+ else {
502
+ patch(elmToMove, newStartVnode);
503
+ oldCh[idxInOld] = undefined;
504
+ node = elmToMove.$elm$;
505
+ }
506
+ newStartVnode = newCh[++newStartIdx];
507
+ }
508
+ else {
446
509
  // new element
447
510
  node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
448
511
  newStartVnode = newCh[++newStartIdx];
@@ -465,7 +528,9 @@ const isSameVnode = (vnode1, vnode2) => {
465
528
  // compare if two vnode to see if they're "technically" the same
466
529
  // need to have the same element tag, and same key to be the same
467
530
  if (vnode1.$tag$ === vnode2.$tag$) {
468
- return true;
531
+ {
532
+ return vnode1.$key$ === vnode2.$key$;
533
+ }
469
534
  }
470
535
  return false;
471
536
  };
@@ -473,11 +538,14 @@ const patch = (oldVNode, newVNode) => {
473
538
  const elm = (newVNode.$elm$ = oldVNode.$elm$);
474
539
  const oldChildren = oldVNode.$children$;
475
540
  const newChildren = newVNode.$children$;
541
+ const tag = newVNode.$tag$;
476
542
  const text = newVNode.$text$;
477
543
  if (text === null) {
478
544
  // element node
479
545
  {
480
- {
546
+ if (tag === 'slot')
547
+ ;
548
+ else {
481
549
  // either this is the first render of an element OR it's an update
482
550
  // AND we already know it's possible it could have changed
483
551
  // this updates the element's css classes, attrs, props, listeners, etc.
@@ -738,6 +806,15 @@ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
738
806
  const parsePropertyValue = (propValue, propType) => {
739
807
  // ensure this value is of the correct prop type
740
808
  if (propValue != null && !isComplexType(propValue)) {
809
+ if (propType & 4 /* Boolean */) {
810
+ // per the HTML spec, any string value means it is a boolean true value
811
+ // but we'll cheat here and say that the string "false" is the boolean false
812
+ return propValue === 'false' ? false : propValue === '' || !!propValue;
813
+ }
814
+ if (propType & 2 /* Number */) {
815
+ // force it to be a number
816
+ return parseFloat(propValue);
817
+ }
741
818
  if (propType & 1 /* String */) {
742
819
  // could have been passed as a number or boolean
743
820
  // but we still want it as a string
@@ -1009,7 +1086,11 @@ const connectedCallback = (elm) => {
1009
1086
  };
1010
1087
  const disconnectedCallback = (elm) => {
1011
1088
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1012
- getHostRef(elm);
1089
+ const hostRef = getHostRef(elm);
1090
+ const instance = hostRef.$lazyInstance$ ;
1091
+ {
1092
+ safeCall(instance, 'disconnectedCallback');
1093
+ }
1013
1094
  }
1014
1095
  };
1015
1096
  const bootstrapLazy = (lazyBundles, options = {}) => {
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-ec28d374.js');
5
+ const index = require('./index-a0eb9215.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-details.cjs",[[1,"casino-engagement-suite-challenges-details",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"challenge":[16],"language":[1],"gameSlug":[1,"game-slug"],"device":[1],"limitStylingAppends":[32],"timer":[32],"showDetails":[32],"isExpiredChallenge":[32]}]]]], options);
17
+ return index.bootstrapLazy([["casino-engagement-suite-challenges-details_2.cjs",[[1,"casino-engagement-suite-challenges-details",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"challenge":[16],"inProgressChallenges":[16],"language":[1],"gameSlug":[1,"game-slug"],"device":[1],"isJoiningToChallenge":[1028,"is-joining-to-challenge"],"limitStylingAppends":[32],"timer":[32],"showDetails":[32],"isExpiredChallenge":[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
 
@@ -7,6 +7,13 @@
7
7
  "version": "2.15.2",
8
8
  "typescriptVersion": "4.5.4"
9
9
  },
10
- "collections": [],
10
+ "collections": [
11
+ {
12
+ "name": "@everymatrix/casino-engagement-suite-progress-bar",
13
+ "tags": [
14
+ "casino-engagement-suite-progress-bar"
15
+ ]
16
+ }
17
+ ],
11
18
  "bundles": []
12
19
  }