@everymatrix/casino-engagement-suite-challenges-details 1.0.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/casino-engagement-suite-challenges-details/casino-engagement-suite-challenges-details.esm.js +1 -0
- package/dist/casino-engagement-suite-challenges-details/index.esm.js +0 -0
- package/dist/casino-engagement-suite-challenges-details/p-11d8b487.js +2 -0
- package/dist/casino-engagement-suite-challenges-details/p-d908af25.entry.js +1 -0
- package/dist/casino-engagement-suite-challenges-details/p-e1255160.js +1 -0
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/casino-engagement-suite-challenges-details.cjs.js +25 -0
- package/dist/cjs/casino-engagement-suite-challenges-details_2.cjs.entry.js +334 -0
- package/dist/cjs/index-a758ba24.js +1249 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/collection/collection-manifest.json +19 -0
- package/dist/collection/components/casino-engagement-suite-challenges-details/casino-engagement-suite-challenges-details.css +302 -0
- package/dist/collection/components/casino-engagement-suite-challenges-details/casino-engagement-suite-challenges-details.js +451 -0
- package/dist/collection/components/casino-engagement-suite-challenges-details/index.js +1 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/models/casino-challenges-details.js +16 -0
- package/dist/collection/utils/index.js +10 -0
- package/dist/collection/utils/locale.utils.js +23 -0
- package/dist/collection/utils/utils.js +3 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/casino-engagement-suite-challenges-details.js +20 -0
- package/dist/esm/casino-engagement-suite-challenges-details_2.entry.js +329 -0
- package/dist/esm/index-c193b756.js +1221 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +11 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/stencil.config.dev.js +17 -0
- package/dist/stencil.config.js +17 -0
- package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/casino-engagement-suite-challenges-details/.stencil/packages/stencil/casino-engagement-suite-challenges-details/stencil.config.d.ts +2 -0
- package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/casino-engagement-suite-challenges-details/.stencil/packages/stencil/casino-engagement-suite-challenges-details/stencil.config.dev.d.ts +2 -0
- package/dist/types/components/casino-engagement-suite-challenges-details/casino-engagement-suite-challenges-details.d.ts +74 -0
- package/dist/types/components/casino-engagement-suite-challenges-details/index.d.ts +1 -0
- package/dist/types/components.d.ts +131 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/models/casino-challenges-details.d.ts +62 -0
- package/dist/types/stencil-public-runtime.d.ts +1674 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/utils/locale.utils.d.ts +1 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/loader/package.json +11 -0
- package/package.json +29 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,b as l}from"./p-11d8b487.js";export{s as setNonce}from"./p-11d8b487.js";import{g as n}from"./p-e1255160.js";(()=>{const l=import.meta.url,n={};return""!==l&&(n.resourcesUrl=new URL(".",l).href),e(n)})().then((async e=>(await n(),l([["p-d908af25",[[1,"casino-engagement-suite-challenges-details",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],challenge:[1040],inProgressChallenges:[1040],language:[1],gameSlug:[1,"game-slug"],device:[1],isJoiningToChallenge:[1028,"is-joining-to-challenge"],pausedChallengeIds:[1040],limitStylingAppends:[32],timer:[32],showDetails:[32],isExpiredChallenge:[32]},null,{challenge:["challengePropHandler"]}],[1,"casino-engagement-suite-progress-bar",{value:[2],disabled:[4],hidePercent:[4,"hide-percent"],indeterminate:[4],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],limitStylingAppends:[32]}]]]],e))));
|
|
File without changes
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=Object.defineProperty,t=new WeakMap,n=e=>t.get(e),l=(e,n)=>t.set(n.t=e,n),o=(e,t)=>t in e,s=(e,t)=>(0,console.error)(e,t),r=new Map,i=new Map,c="slot-fb{display:contents}slot-fb[hidden]{display:none}",a="undefined"!=typeof window?window:{},u=a.document||{head:{}},f={l:0,o:"",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)},h=e=>Promise.resolve(e),d=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),m=!1,p=[],y=[],$=(e,t)=>n=>{e.push(n),m||(m=!0,t&&4&f.l?v(w):f.raf(w))},b=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){s(e)}e.length=0},w=()=>{b(p),b(y),(m=p.length>0)&&f.raf(w)},v=e=>h().then(e),g=$(y,!0),S={},j=e=>"object"==(e=typeof e)||"function"===e;function k(e){var t,n,l;return null!=(l=null==(n=null==(t=e.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?l:void 0}((t,n)=>{for(var l in n)e(t,l,{get:n[l],enumerable:!0})})({},{err:()=>O,map:()=>C,ok:()=>E,unwrap:()=>x,unwrapErr:()=>P});var E=e=>({isOk:!0,isErr:!1,value:e}),O=e=>({isOk:!1,isErr:!0,value:e});function C(e,t){if(e.isOk){const n=t(e.value);return n instanceof Promise?n.then((e=>E(e))):E(n)}if(e.isErr)return O(e.value);throw"should never get here"}var M,x=e=>{if(e.isOk)return e.value;throw e.value},P=e=>{if(e.isErr)return e.value;throw e.value},R=(e,t,...n)=>{let l=null,o=null,s=!1,r=!1;const i=[],c=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!j(l))&&(l+=""),s&&r?i[i.length-1].i+=l:i.push(s?A(null,l):l),r=s)};if(c(n),t){t.key&&(o=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=A(e,null);return a.u=t,i.length>0&&(a.h=i),a.m=o,a},A=(e,t)=>({l:0,p:e,i:t,$:null,h:null,u:null,m:null}),T={},D=e=>n(e).$hostElement$,F=(e,t,n)=>{const l=D(e);return{emit:e=>H(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},H=(e,t,n)=>{const l=f.ce(t,n);return e.dispatchEvent(l),l},L=new WeakMap,N=e=>"sc-"+e.v,U=(e,t,n,l,s,r)=>{if(n!==l){let i=o(e,t),c=t.toLowerCase();if("class"===t){const t=e.classList,o=q(n),s=q(l);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("style"===t){for(const t in n)l&&null!=l[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in l)n&&l[t]===n[t]||(t.includes("-")?e.style.setProperty(t,l[t]):e.style[t]=l[t])}else if("key"===t);else if(i||"o"!==t[0]||"n"!==t[1]){const o=j(l);if((i||o&&null!==l)&&!s)try{if(e.tagName.includes("-"))e[t]=l;else{const o=null==l?"":l;"list"===t?i=!1:null!=n&&e[t]==o||(e[t]=o)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&r||s)&&!o&&e.setAttribute(t,l=!0===l?"":l)}else if(t="-"===t[2]?t.slice(3):o(a,c)?c.slice(2):c[2]+t.slice(3),n||l){const o=t.endsWith(G);t=t.replace(V,""),n&&f.rel(e,t,n,o),l&&f.ael(e,t,l,o)}}},W=/\s/,q=e=>e?e.split(W):[],G="Capture",V=RegExp(G+"$"),_=(e,t,n)=>{const l=11===t.$.nodeType&&t.$.host?t.$.host:t.$,o=e&&e.u||S,s=t.u||S;for(const e of z(Object.keys(o)))e in s||U(l,e,o[e],void 0,n,t.l);for(const e of z(Object.keys(s)))U(l,e,o[e],s[e],n,t.l)};function z(e){return e.includes("ref")?[...e.filter((e=>"ref"!==e)),"ref"]:e}var B=!1,I=!1,J=(e,t,n)=>{const l=t.h[n];let o,s,r=0;if(null!==l.i)o=l.$=u.createTextNode(l.i);else if(o=l.$=u.createElement(l.p),_(null,l,I),o.getRootNode().querySelector("body"),l.h)for(r=0;r<l.h.length;++r)s=J(e,l,r),s&&o.appendChild(s);return o["s-hn"]=M,o},K=(e,t,n,l,o,s)=>{let r,i=e;for(i.shadowRoot&&i.tagName===M&&(i=i.shadowRoot);o<=s;++o)l[o]&&(r=J(null,n,o),r&&(l[o].$=r,Z(i,r,t)))},Q=(e,t,n)=>{for(let l=t;l<=n;++l){const t=e[l];if(t){const e=t.$;e&&e.remove()}}},X=(e,t,n=!1)=>e.p===t.p&&(!!n||e.m===t.m),Y=(e,t,n=!1)=>{const l=t.$=e.$,o=e.h,s=t.h,r=t.i;null===r?(("slot"!==t.p||B)&&_(e,t,I),null!==o&&null!==s?((e,t,n,l,o=!1)=>{let s,r,i=0,c=0,a=0,u=0,f=t.length-1,h=t[0],d=t[f],m=l.length-1,p=l[0],y=l[m];for(;i<=f&&c<=m;)if(null==h)h=t[++i];else if(null==d)d=t[--f];else if(null==p)p=l[++c];else if(null==y)y=l[--m];else if(X(h,p,o))Y(h,p,o),h=t[++i],p=l[++c];else if(X(d,y,o))Y(d,y,o),d=t[--f],y=l[--m];else if(X(h,y,o))Y(h,y,o),Z(e,h.$,d.$.nextSibling),h=t[++i],y=l[--m];else if(X(d,p,o))Y(d,p,o),Z(e,d.$,h.$),d=t[--f],p=l[++c];else{for(a=-1,u=i;u<=f;++u)if(t[u]&&null!==t[u].m&&t[u].m===p.m){a=u;break}a>=0?(r=t[a],r.p!==p.p?s=J(t&&t[c],n,a):(Y(r,p,o),t[a]=void 0,s=r.$),p=l[++c]):(s=J(t&&t[c],n,c),p=l[++c]),s&&Z(h.$.parentNode,s,h.$)}i>f?K(e,null==l[m+1]?null:l[m+1].$,n,l,c,m):c>m&&Q(t,i,f)})(l,o,t,s,n):null!==s?(null!==e.i&&(l.textContent=""),K(l,null,t,s,0,s.length-1)):!n&&null!==o&&Q(o,0,o.length-1)):e.i!==r&&(l.data=r)},Z=(e,t,n)=>null==e?void 0:e.insertBefore(t,n),ee=(e,t)=>{t&&!e.S&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.S=t)))},te=(e,t)=>{if(e.l|=16,!(4&e.l))return ee(e,e.j),g((()=>ne(e,t)));e.l|=512},ne=(e,t)=>{const n=e.t;if(!n)throw Error(`Can't render component <${e.$hostElement$.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let l;return t&&(l=ae(n,"componentWillLoad")),le(l,(()=>se(e,n,t)))},le=(e,t)=>oe(e)?e.then(t).catch((e=>{console.error(e),t()})):t(),oe=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,se=async(e,t,n)=>{var l;const o=e.$hostElement$,s=o["s-rc"];n&&(e=>{const t=e.k,n=e.$hostElement$,l=t.l,o=((e,t)=>{var n;const l=N(t),o=i.get(l);if(e=11===e.nodeType?e:u,o)if("string"==typeof o){let s,r=L.get(e=e.head||e);if(r||L.set(e,r=new Set),!r.has(l)){{s=u.createElement("style"),s.innerHTML=o;const l=null!=(n=f.O)?n:k(u);null!=l&&s.setAttribute("nonce",l),(!(1&t.l)||1&t.l&&"HEAD"!==e.nodeName)&&e.insertBefore(s,e.querySelector("link"))}4&t.l&&(s.innerHTML+=c),r&&r.add(l)}}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o]);return l})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&2&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);re(e,t,o,n),s&&(s.map((e=>e())),o["s-rc"]=void 0);{const t=null!=(l=o["s-p"])?l:[],n=()=>ie(e);0===t.length?n():(Promise.all(t).then(n),e.l|=4,t.length=0)}},re=(e,t,n,l)=>{try{t=t.render(),e.l&=-17,e.l|=2,((e,t,n=!1)=>{const l=e.$hostElement$,o=e.k,s=e.C||A(null,null),r=(e=>e&&e.p===T)(t)?t:R(null,null,t);if(M=l.tagName,o.M&&(r.u=r.u||{},o.M.map((([e,t])=>r.u[t]=l[e]))),n&&r.u)for(const e of Object.keys(r.u))l.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(r.u[e]=l[e]);r.p=null,r.l|=4,e.C=r,r.$=s.$=l.shadowRoot||l,B=!!(1&o.l),Y(s,r,n)})(e,t,l)}catch(t){s(t,e.$hostElement$)}return null},ie=e=>{const t=e.$hostElement$,n=e.j;ae(e.t,"componentDidRender"),64&e.l||(e.l|=64,ue(t),e.P(t),n||ce()),e.S&&(e.S(),e.S=void 0),512&e.l&&v((()=>te(e,!1))),e.l&=-517},ce=()=>{ue(u.documentElement),v((()=>H(a,"appload",{detail:{namespace:"casino-engagement-suite-challenges-details"}})))},ae=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){s(e)}},ue=e=>e.classList.add("hydrated"),fe=(e,t,l)=>{var o,r;const i=e.prototype;if(t.R||t.A||e.watchers){e.watchers&&!t.A&&(t.A=e.watchers);const c=Object.entries(null!=(o=t.R)?o:{});if(c.map((([e,[o]])=>{(31&o||2&l&&32&o)&&Object.defineProperty(i,e,{get(){return((e,t)=>n(this).T.get(t))(0,e)},set(l){((e,t,l,o)=>{const r=n(e);if(!r)throw Error(`Couldn't find host element for "${o.v}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`);const i=r.$hostElement$,c=r.T.get(t),a=r.l,u=r.t;if(l=((e,t)=>null==e||j(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(l,o.R[t][0]),(!(8&a)||void 0===c)&&l!==c&&(!Number.isNaN(c)||!Number.isNaN(l))&&(r.T.set(t,l),u)){if(o.A&&128&a){const e=o.A[t];e&&e.map((e=>{try{u[e](l,c,t)}catch(e){s(e,i)}}))}2==(18&a)&&te(r,!1)}})(this,e,l,t)},configurable:!0,enumerable:!0})})),1&l){const l=new Map;i.attributeChangedCallback=function(e,o,s){f.jmp((()=>{var r;const c=l.get(e);if(this.hasOwnProperty(c))s=this[c],delete this[c];else{if(i.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==s)return;if(null==c){const l=n(this),i=null==l?void 0:l.l;if(i&&!(8&i)&&128&i&&s!==o){const n=l.t,i=null==(r=t.A)?void 0:r[e];null==i||i.forEach((t=>{null!=n[t]&&n[t].call(n,s,o,e)}))}return}}this[c]=(null!==s||"boolean"!=typeof this[c])&&s}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(r=t.A)?r:{}),...c.filter((([e,t])=>15&t[0])).map((([e,n])=>{var o;const s=n[1]||e;return l.set(s,e),512&n[0]&&(null==(o=t.M)||o.push([e,s])),s}))]))}}return e},he=e=>{ae(e,"disconnectedCallback")},de=(e,l={})=>{var o;const h=[],m=l.exclude||[],p=a.customElements,y=u.head,$=y.querySelector("meta[charset]"),b=u.createElement("style"),w=[];let v,g=!0;Object.assign(f,l),f.o=new URL(l.resourcesUrl||"./",u.baseURI).href;let S=!1;if(e.map((e=>{e[1].map((l=>{var o;const c={l:l[0],v:l[1],R:l[2],D:l[3]};4&c.l&&(S=!0),c.R=l[2],c.M=[],c.A=null!=(o=l[4])?o:{};const a=c.v,u=class extends HTMLElement{constructor(e){if(super(e),this.hasRegisteredEventListeners=!1,((e,n)=>{const l={l:0,$hostElement$:e,k:n,T:new Map};l.F=new Promise((e=>l.P=e)),e["s-p"]=[],e["s-rc"]=[],t.set(e,l)})(e=this,c),1&c.l)if(e.shadowRoot){if("open"!==e.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${c.v}! Mode is set to ${e.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else e.attachShadow({mode:"open"})}connectedCallback(){this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),v&&(clearTimeout(v),v=null),g?w.push(this):f.jmp((()=>(e=>{if(!(1&f.l)){const t=n(e),l=t.k,o=()=>{};if(1&t.l)(null==t?void 0:t.t)||(null==t?void 0:t.F)&&t.F.then((()=>{}));else{t.l|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){ee(t,t.j=n);break}}l.R&&Object.entries(l.R).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n)=>{let l;if(!(32&t.l)){if(t.l|=32,n.H){const e=(e=>{const t=e.v.replace(/-/g,"_"),n=e.H;if(!n)return;const l=r.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(r.set(n,e),e[t])),s)
|
|
2
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n);if(e&&"then"in e){const t=()=>{};l=await e,t()}else l=e;if(!l)throw Error(`Constructor for "${n.v}#${t.L}" was not found`);l.isProxied||(n.A=l.watchers,fe(l,n,2),l.isProxied=!0);const o=()=>{};t.l|=8;try{new l(t)}catch(e){s(e)}t.l&=-9,t.l|=128,o()}else l=e.constructor,customElements.whenDefined(e.localName).then((()=>t.l|=128));if(l&&l.style){let e;"string"==typeof l.style&&(e=l.style);const t=N(n);if(!i.has(t)){const l=()=>{};((e,t,n)=>{let l=i.get(e);d&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,i.set(e,l)})(t,e,!!(1&n.l)),l()}}}const o=t.j,c=()=>te(t,!0);o&&o["s-rc"]?o["s-rc"].push(c):c()})(e,t,l)}o()}})(this)))}disconnectedCallback(){f.jmp((()=>(async()=>{if(!(1&f.l)){const e=n(this);(null==e?void 0:e.t)?he(e.t):(null==e?void 0:e.F)&&e.F.then((()=>he(e.t)))}})()))}componentOnReady(){return n(this).F}};c.H=e[0],m.includes(a)||p.get(a)||(h.push(a),p.define(a,fe(u,c,1)))}))})),h.length>0&&(S&&(b.textContent+=c),b.textContent+=h.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",b.innerHTML.length)){b.setAttribute("data-styles","");const e=null!=(o=f.O)?o:k(u);null!=e&&b.setAttribute("nonce",e),y.insertBefore(b,$?$.nextSibling:y.firstChild)}g=!1,w.length?w.map((e=>e.connectedCallback())):f.jmp((()=>v=setTimeout(ce,30)))},me=e=>f.O=e;export{de as b,F as c,D as g,R as h,h as p,l as r,me as s}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as t,h as l,g as a}from"./p-11d8b487.js";const s=["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",minBet:"Min Bet",maxBet:"Max Bet",contribution:"Contribution"}},n=(e,t)=>{const l=t;return i[void 0!==l&&s.includes(l)?l:"en"][e]};var o,r;function h(e,t){return`${t}${new Intl.NumberFormat("en",{minimumFractionDigits:2,maximumFractionDigits:2}).format(e)}`}!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",e[e.Forfeited=5]="Forfeited"}(r||(r={}));const g=class{constructor(l){e(this,l),this.close=t(this,"close",7),this.back=t(this,"back",7),this.resetNewChallengeLabel=t(this,"resetNewChallengeLabel",7),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.resetNewLabel(),this.close.emit()},this.handleBackClick=()=>{this.resetNewLabel(),this.back.emit()},this.onGameClick=e=>{const t=e.currentTarget.getAttribute("data-slug");t&&window.postMessage({type:"EngagementSuiteGameRedirect",data:{Slug:t}})},this.changeChallengeStatus=e=>{var t,l;const a=e.currentTarget.getAttribute("data-id");(null===(t=this.inProgressChallenges)||void 0===t?void 0:t.includes(a))?window.postMessage({type:"ShowConfirmationModal",ProgressToDeactivate:a}):(null===(l=this.inProgressChallenges)||void 0===l?void 0:l.length)>0?window.postMessage({type:"ShowConfirmationModal",ProgressToActivate:a,ProgressToDeactivate:this.inProgressChallenges[0]}):window.postMessage({type:"ChallengeJoinRequest",data:{ProgressToActivate:a}})},this.toggle=()=>{this.showDetails=!this.showDetails},this.clientStyling="",this.clientStylingUrl="",this.challenge=void 0,this.inProgressChallenges=void 0,this.language="en",this.gameSlug="",this.device="Mobile",this.isJoiningToChallenge=void 0,this.pausedChallengeIds=[],this.limitStylingAppends=!1,this.timer="",this.showDetails=!1,this.isExpiredChallenge=!1}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"})),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.ChallengePresentation.PresentationName,t=this.challenge.Status===r.InProgress||this.challenge.Status===r.PendingLevelReward,a=this.isExpiredChallenge||this.isJoiningToChallenge||this.pausedChallengeIds.includes(this.challenge.ChallengeId),s=![r.Completed,r.Forfeited].includes(this.challenge.Status);return l("div",{class:"ChallengeDetailsHeader"},l("span",{class:"ChallengeName"},e),s?l("button",{onClick:this.changeChallengeStatus,class:`ChallengeJoinButton ${t?"Joined":""}\n ${a?"Disabled":""}`,"data-id":this.challenge.Id},n(t?"unjoin":"join",this.language)):null,l("div",{class:"ChallengeLabel "+(this.challenge.IsNew?"ShowChallengeLabel":"")},l("span",null,n("new",this.language))))}getChallengeCountdown(){return this.challenge.Status!==r.Forfeited?l("div",{class:"ChallengeCountdown "+(this.isExpiredChallenge?"Expired":"")},this.isExpiredChallenge?"Expired":this.timer):null}getChallengeDetails(){const e=this.challenge.ChallengePresentation.Description,t=this.challenge.ChallengePresentation.Url,a=this.challenge.Games;return l("div",{class:"CollapseDetails "+(this.showDetails?"ShowDetails":"")},e&&l("div",{class:"ChallengeDescription"},e),t&&l("div",{class:"TC"},l("a",{href:t,target:"_blank"},n("tc",this.language))),(null==a?void 0:a.length)&&l("div",{class:"ChallengeGames"},a.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}))))))}resetNewLabel(){this.resetNewChallengeLabel.emit(this.challenge.Id)}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:a,seconds:s}={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:${a}m:${s}s`:`${t}d:${l}h:${a}m`}getLevelTarget(e){const t=h(e.DisplayCurrencyTargetTurnover,this.challenge.CurrencySymbol);let a=`${n("place",this.language)} ${t}`;return 1===e.LevelTargetType?a+=` ${n("bet",this.language)}`:2===e.LevelTargetType&&(a+=` ${n("bets",this.language)} X ${e.TargetBetCount}`),l("span",{class:"ChallengeLevelTarget"},a)}getLevelBetRangesDetails(e){var t,a,s,i;if(0===e.LevelTargetType){const o=h(null===(t=e.BetRange)||void 0===t?void 0:t.MinBet,this.challenge.CurrencySymbol),r=h(null===(a=e.BetRange)||void 0===a?void 0:a.MaxBet,this.challenge.CurrencySymbol),g=e.LevelContributionPercent+"%",d=!!(null===(s=e.BetRange)||void 0===s?void 0:s.MinBet),p=!!(null===(i=e.BetRange)||void 0===i?void 0:i.MaxBet),c=100!==e.LevelContributionPercent;if(d||p||c)return l("div",{class:"ChallengeLevelBetDetails"},d&&l("div",{class:"ChallengeLevelBetDetail"},l("span",null,n("minBet",this.language),": "),l("span",{class:"ChallengeLevelBetRange"},o)),p&&l("div",{class:"ChallengeLevelBetDetail"},l("span",null,n("maxBet",this.language),": "),l("span",{class:"ChallengeLevelBetRange"},r)),c&&l("div",{class:"ChallengeLevelBetDetail"},l("span",null,n("contribution",this.language),": "),l("span",{class:"ChallengeLevelBetContribution"},g)))}}getChallengeLevels(){const e=this.pausedChallengeIds.includes(this.challenge.ChallengeId),t=t=>1===t.ProgressStatus&&!this.isExpiredChallenge&&!e;return l("div",{class:"ChallengeLevels"},this.challenge.LevelProgresses.map(((a,s)=>l("div",{class:"ChallengeLevelCard "+(t(a)?"InProgress":"")},l("casino-engagement-suite-progress-bar",{class:this.device,value:a.ProgressPercentage,"hide-percent":0===a.ProgressPercentage&&!t(a)||100===a.ProgressPercentage,disabled:this.isExpiredChallenge||e},l("span",{slot:"Title",class:"ChallengeLevelTitle"},l("span",null,"Level ",s+1,": "),this.getLevelTarget(a))),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"},a.CustomRewardMessage)),this.getLevelBetRangesDetails(a)))))}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",{key:"413a8354c03545a336b044a26f33275423548ee2",class:`ChallengeDetailsPopup ${this.device}`},this.getActionsTemplate(),l("div",{key:"e58aac0709effc8ed9df011c07b52ee6a0c4fa66",class:"ChallengeDetails "+(this.challenge.IsNew?"IsNewChallenge":"")},this.getChallengeHeader(),this.getChallengeCountdown(),this.getToggleButton(),this.getChallengeDetails(),this.getChallengeLevels()))}get host(){return a(this)}static get watchers(){return{challenge:["challengePropHandler"]}}};g.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-word}.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:12px 0}.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 .ChallengeLevelBetDetails{margin-top:25px;display:flex;flex-wrap:wrap;gap:8px}.ChallengeLevels .ChallengeLevelCard .ChallengeLevelBetDetail:not(:last-of-type){margin-right:8px}.ChallengeLevels .ChallengeLevelCard .ChallengeLevelBetRange,.ChallengeLevels .ChallengeLevelCard .ChallengeLevelBetContribution{font-weight:var(--emw--font-weight-semibold, 600)}.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-word}.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 .CollapseDetails .ChallengeDescription,.ChallengeDetailsPopup.Desktop .CollapseDetails .ChallengeDescription{font-size:var(--emw--font-size-medium, 16px);line-height:19px}.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 d=class{constructor(t){e(this,t),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.value=0,this.disabled=!1,this.hidePercent=!1,this.indeterminate=!1,this.clientStyling="",this.clientStylingUrl="",this.limitStylingAppends=!1}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||this.indeterminate}}getProgressBarLineTemplate(){return l("div",this.indeterminate?{class:"ProgressBarLine Indeterminate",part:"ProgressBarLine Indeterminate"}:{class:"ProgressBarLine",part:"ProgressBarLine",style:{width:this.value+"%"}})}render(){return l("div",{key:"ecce3a26a92d2e090c1db84bdc1bdbeb505080ed",class:this.getProgressBarClasses(),part:"ProgressBar"},l("div",{key:"649fe1103d222200f2a1ad3b5967e37da1f1ab3d",class:"ProgressBarInfo",part:"ProgressBarInfo"},l("slot",{key:"49dc180eedd823f0027f75099813fb9d91bcd938",name:"Title"},l("div",{key:"e6e59da3fe7bbcb37e118e7fd23a8ff35587aca5"})),l("slot",{key:"3dc8e5fd1dbc8c268b9c76e393b751cb53605e7e",name:"Percent"},l("div",{key:"6a9e880f3ee3c4f26e8577c69be5db5f8e2d10ad",class:"ProgressBarPercent",part:"ProgressBarPercent"},this.value,"%"))),l("div",{key:"141106e77caad7b04bb199f911e87c0c6f0adc2d",class:"ProgressBarBackground",part:"ProgressBarBackground"},this.getProgressBarLineTemplate()))}get host(){return a(this)}};d.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{g as casino_engagement_suite_challenges_details,d as casino_engagement_suite_progress_bar}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o=()=>{};export{o as g}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-a758ba24.js');
|
|
6
|
+
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
Stencil Client Patch Browser v4.20.0 | MIT Licensed | https://stenciljs.com
|
|
10
|
+
*/
|
|
11
|
+
var patchBrowser = () => {
|
|
12
|
+
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('casino-engagement-suite-challenges-details.cjs.js', document.baseURI).href));
|
|
13
|
+
const opts = {};
|
|
14
|
+
if (importMeta !== "") {
|
|
15
|
+
opts.resourcesUrl = new URL(".", importMeta).href;
|
|
16
|
+
}
|
|
17
|
+
return index.promiseResolve(opts);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
patchBrowser().then(async (options) => {
|
|
21
|
+
await appGlobals.globalScripts();
|
|
22
|
+
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":[1040],"inProgressChallenges":[1040],"language":[1],"gameSlug":[1,"game-slug"],"device":[1],"isJoiningToChallenge":[1028,"is-joining-to-challenge"],"pausedChallengeIds":[1040],"limitStylingAppends":[32],"timer":[32],"showDetails":[32],"isExpiredChallenge":[32]},null,{"challenge":["challengePropHandler"]}],[1,"casino-engagement-suite-progress-bar",{"value":[2],"disabled":[4],"hidePercent":[4,"hide-percent"],"indeterminate":[4],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"limitStylingAppends":[32]}]]]], options);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
exports.setNonce = index.setNonce;
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-a758ba24.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
|
+
minBet: 'Min Bet',
|
|
22
|
+
maxBet: 'Max Bet',
|
|
23
|
+
contribution: 'Contribution'
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const translate = (key, customLang) => {
|
|
27
|
+
const lang = customLang;
|
|
28
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
var ChallengeLevelProgressStatus;
|
|
32
|
+
(function (ChallengeLevelProgressStatus) {
|
|
33
|
+
ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["Closed"] = 0] = "Closed";
|
|
34
|
+
ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["InProgress"] = 1] = "InProgress";
|
|
35
|
+
ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["Fillup"] = 2] = "Fillup";
|
|
36
|
+
ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["Completed"] = 3] = "Completed";
|
|
37
|
+
})(ChallengeLevelProgressStatus || (ChallengeLevelProgressStatus = {}));
|
|
38
|
+
var ChallengeProgressStatus;
|
|
39
|
+
(function (ChallengeProgressStatus) {
|
|
40
|
+
ChallengeProgressStatus[ChallengeProgressStatus["Started"] = 0] = "Started";
|
|
41
|
+
ChallengeProgressStatus[ChallengeProgressStatus["InProgress"] = 1] = "InProgress";
|
|
42
|
+
ChallengeProgressStatus[ChallengeProgressStatus["PendingLevelReward"] = 2] = "PendingLevelReward";
|
|
43
|
+
ChallengeProgressStatus[ChallengeProgressStatus["Completed"] = 3] = "Completed";
|
|
44
|
+
ChallengeProgressStatus[ChallengeProgressStatus["Expired"] = 4] = "Expired";
|
|
45
|
+
ChallengeProgressStatus[ChallengeProgressStatus["Forfeited"] = 5] = "Forfeited";
|
|
46
|
+
})(ChallengeProgressStatus || (ChallengeProgressStatus = {}));
|
|
47
|
+
|
|
48
|
+
function formatBalance(amount, currency) {
|
|
49
|
+
return `${currency}${new Intl.NumberFormat('en', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
|
|
50
|
+
.format(amount)}`;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
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-word}.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:12px 0}.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 .ChallengeLevelBetDetails{margin-top:25px;display:flex;flex-wrap:wrap;gap:8px}.ChallengeLevels .ChallengeLevelCard .ChallengeLevelBetDetail:not(:last-of-type){margin-right:8px}.ChallengeLevels .ChallengeLevelCard .ChallengeLevelBetRange,.ChallengeLevels .ChallengeLevelCard .ChallengeLevelBetContribution{font-weight:var(--emw--font-weight-semibold, 600)}.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-word}.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 .CollapseDetails .ChallengeDescription,.ChallengeDetailsPopup.Desktop .CollapseDetails .ChallengeDescription{font-size:var(--emw--font-size-medium, 16px);line-height:19px}.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}";
|
|
54
|
+
const CasinoEngagementSuiteChallengesDetailsStyle0 = casinoEngagementSuiteChallengesDetailsCss;
|
|
55
|
+
|
|
56
|
+
const CasinoEngagementSuiteChallengesDetails = class {
|
|
57
|
+
constructor(hostRef) {
|
|
58
|
+
index.registerInstance(this, hostRef);
|
|
59
|
+
this.close = index.createEvent(this, "close", 7);
|
|
60
|
+
this.back = index.createEvent(this, "back", 7);
|
|
61
|
+
this.resetNewChallengeLabel = index.createEvent(this, "resetNewChallengeLabel", 7);
|
|
62
|
+
this.setClientStyling = () => {
|
|
63
|
+
let sheet = document.createElement('style');
|
|
64
|
+
sheet.innerHTML = this.clientStyling;
|
|
65
|
+
this.host.prepend(sheet);
|
|
66
|
+
};
|
|
67
|
+
this.setClientStylingURL = () => {
|
|
68
|
+
let url = new URL(this.clientStylingUrl);
|
|
69
|
+
let cssFile = document.createElement('style');
|
|
70
|
+
fetch(url.href)
|
|
71
|
+
.then((res) => res.text())
|
|
72
|
+
.then((data) => {
|
|
73
|
+
cssFile.innerHTML = data;
|
|
74
|
+
setTimeout(() => { this.host.prepend(cssFile); }, 1);
|
|
75
|
+
})
|
|
76
|
+
.catch((err) => {
|
|
77
|
+
console.log('Error ', err);
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
this.handleCloseClick = () => {
|
|
81
|
+
this.resetNewLabel();
|
|
82
|
+
this.close.emit();
|
|
83
|
+
};
|
|
84
|
+
this.handleBackClick = () => {
|
|
85
|
+
this.resetNewLabel();
|
|
86
|
+
this.back.emit();
|
|
87
|
+
};
|
|
88
|
+
this.onGameClick = (ev) => {
|
|
89
|
+
const slug = ev.currentTarget.getAttribute('data-slug');
|
|
90
|
+
if (slug) {
|
|
91
|
+
window.postMessage({
|
|
92
|
+
type: 'EngagementSuiteGameRedirect',
|
|
93
|
+
data: {
|
|
94
|
+
Slug: slug
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
this.changeChallengeStatus = (e) => {
|
|
100
|
+
var _a, _b;
|
|
101
|
+
const id = e.currentTarget.getAttribute('data-id');
|
|
102
|
+
if ((_a = this.inProgressChallenges) === null || _a === void 0 ? void 0 : _a.includes(id)) {
|
|
103
|
+
window.postMessage({
|
|
104
|
+
type: 'ShowConfirmationModal',
|
|
105
|
+
ProgressToDeactivate: id,
|
|
106
|
+
});
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
if (((_b = this.inProgressChallenges) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
110
|
+
window.postMessage({
|
|
111
|
+
type: 'ShowConfirmationModal',
|
|
112
|
+
ProgressToActivate: id,
|
|
113
|
+
ProgressToDeactivate: this.inProgressChallenges[0],
|
|
114
|
+
});
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
window.postMessage({
|
|
118
|
+
type: 'ChallengeJoinRequest',
|
|
119
|
+
data: {
|
|
120
|
+
ProgressToActivate: id,
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
this.toggle = () => {
|
|
125
|
+
this.showDetails = !this.showDetails;
|
|
126
|
+
};
|
|
127
|
+
this.clientStyling = '';
|
|
128
|
+
this.clientStylingUrl = '';
|
|
129
|
+
this.challenge = undefined;
|
|
130
|
+
this.inProgressChallenges = undefined;
|
|
131
|
+
this.language = 'en';
|
|
132
|
+
this.gameSlug = '';
|
|
133
|
+
this.device = 'Mobile';
|
|
134
|
+
this.isJoiningToChallenge = undefined;
|
|
135
|
+
this.pausedChallengeIds = [];
|
|
136
|
+
this.limitStylingAppends = false;
|
|
137
|
+
this.timer = '';
|
|
138
|
+
this.showDetails = false;
|
|
139
|
+
this.isExpiredChallenge = false;
|
|
140
|
+
}
|
|
141
|
+
challengePropHandler(value) {
|
|
142
|
+
if (!this.interval && value) {
|
|
143
|
+
this.updateTimer();
|
|
144
|
+
this.startCountdown();
|
|
145
|
+
}
|
|
146
|
+
if (this.interval && !value) {
|
|
147
|
+
clearInterval(this.interval);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
componentWillLoad() {
|
|
151
|
+
this.challengePropHandler(this.challenge);
|
|
152
|
+
}
|
|
153
|
+
componentDidRender() {
|
|
154
|
+
if (!this.limitStylingAppends && this.host) {
|
|
155
|
+
if (this.clientStyling)
|
|
156
|
+
this.setClientStyling();
|
|
157
|
+
if (this.clientStylingUrl)
|
|
158
|
+
this.setClientStylingURL();
|
|
159
|
+
this.limitStylingAppends = true;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
disconnectedCallback() {
|
|
163
|
+
this.interval && clearInterval(this.interval);
|
|
164
|
+
}
|
|
165
|
+
getActionsTemplate() {
|
|
166
|
+
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" })), index.h("button", { class: "ChallengeIconButton", onClick: this.handleCloseClick }, index.h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", alt: "close" }))));
|
|
167
|
+
}
|
|
168
|
+
getChallengeHeader() {
|
|
169
|
+
const presentationName = this.challenge.ChallengePresentation.PresentationName;
|
|
170
|
+
const inProgressChallenge = this.challenge.Status === ChallengeProgressStatus.InProgress
|
|
171
|
+
|| this.challenge.Status === ChallengeProgressStatus.PendingLevelReward;
|
|
172
|
+
const isDisabledButton = this.isExpiredChallenge || this.isJoiningToChallenge ||
|
|
173
|
+
this.pausedChallengeIds.includes(this.challenge.ChallengeId);
|
|
174
|
+
const showJoinButton = ![ChallengeProgressStatus.Completed, ChallengeProgressStatus.Forfeited]
|
|
175
|
+
.includes(this.challenge.Status);
|
|
176
|
+
return (index.h("div", { class: "ChallengeDetailsHeader" }, index.h("span", { class: "ChallengeName" }, presentationName), showJoinButton ? (index.h("button", { onClick: this.changeChallengeStatus, class: `ChallengeJoinButton ${inProgressChallenge ? 'Joined' : ''}
|
|
177
|
+
${isDisabledButton ? 'Disabled' : ''}`, "data-id": this.challenge.Id }, inProgressChallenge
|
|
178
|
+
? translate('unjoin', this.language)
|
|
179
|
+
: translate('join', this.language))) : null, index.h("div", { class: `ChallengeLabel ${this.challenge.IsNew ? 'ShowChallengeLabel' : ''}` }, index.h("span", null, translate('new', this.language)))));
|
|
180
|
+
}
|
|
181
|
+
getChallengeCountdown() {
|
|
182
|
+
const timerMessage = this.isExpiredChallenge ? 'Expired' : this.timer;
|
|
183
|
+
const showChallengeCountdown = this.challenge.Status !== ChallengeProgressStatus.Forfeited;
|
|
184
|
+
return (showChallengeCountdown ? (index.h("div", { class: `ChallengeCountdown ${this.isExpiredChallenge ? 'Expired' : ''}` }, timerMessage)) : null);
|
|
185
|
+
}
|
|
186
|
+
getChallengeDetails() {
|
|
187
|
+
const description = this.challenge.ChallengePresentation.Description;
|
|
188
|
+
const url = this.challenge.ChallengePresentation.Url;
|
|
189
|
+
const games = this.challenge.Games;
|
|
190
|
+
return (index.h("div", { class: `CollapseDetails ${this.showDetails ? 'ShowDetails' : ''}` }, description && index.h("div", { 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 }))))))));
|
|
191
|
+
}
|
|
192
|
+
resetNewLabel() {
|
|
193
|
+
this.resetNewChallengeLabel.emit(this.challenge.Id);
|
|
194
|
+
}
|
|
195
|
+
startCountdown() {
|
|
196
|
+
this.interval = setInterval(() => {
|
|
197
|
+
this.updateTimer();
|
|
198
|
+
}, 1000);
|
|
199
|
+
}
|
|
200
|
+
updateTimer() {
|
|
201
|
+
const expirationTime = new Date(this.challenge.ExpirationTime).getTime();
|
|
202
|
+
const now = new Date().getTime();
|
|
203
|
+
const distance = expirationTime - now;
|
|
204
|
+
if (distance < 1) {
|
|
205
|
+
clearInterval(this.interval);
|
|
206
|
+
this.timer = '';
|
|
207
|
+
this.isExpiredChallenge = true;
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
const { days, hours, minutes, seconds } = {
|
|
211
|
+
days: String(Math.floor(distance / (1000 * 60 * 60 * 24))).padStart(2, '0'),
|
|
212
|
+
hours: String(Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))).padStart(2, '0'),
|
|
213
|
+
minutes: String(Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60))).padStart(2, '0'),
|
|
214
|
+
seconds: String(Math.floor((distance % (1000 * 60)) / 1000)).padStart(2, '0')
|
|
215
|
+
};
|
|
216
|
+
this.timer = days === '00'
|
|
217
|
+
? `${hours}h:${minutes}m:${seconds}s`
|
|
218
|
+
: `${days}d:${hours}h:${minutes}m`;
|
|
219
|
+
}
|
|
220
|
+
getLevelTarget(level) {
|
|
221
|
+
const targetTurnover = formatBalance(level.DisplayCurrencyTargetTurnover, this.challenge.CurrencySymbol);
|
|
222
|
+
let levelTarget = `${translate('place', this.language)} ${targetTurnover}`;
|
|
223
|
+
if (level.LevelTargetType === 1) {
|
|
224
|
+
levelTarget += ` ${translate('bet', this.language)}`;
|
|
225
|
+
}
|
|
226
|
+
else if (level.LevelTargetType === 2) {
|
|
227
|
+
levelTarget += ` ${translate('bets', this.language)} X ${level.TargetBetCount}`;
|
|
228
|
+
}
|
|
229
|
+
return (index.h("span", { class: "ChallengeLevelTarget" }, levelTarget));
|
|
230
|
+
}
|
|
231
|
+
getLevelBetRangesDetails(level) {
|
|
232
|
+
var _a, _b, _c, _d;
|
|
233
|
+
const isAccumulativeLevelType = level.LevelTargetType === 0;
|
|
234
|
+
if (isAccumulativeLevelType) {
|
|
235
|
+
const formattedMinBet = formatBalance((_a = level.BetRange) === null || _a === void 0 ? void 0 : _a.MinBet, this.challenge.CurrencySymbol);
|
|
236
|
+
const formattedMaxBet = formatBalance((_b = level.BetRange) === null || _b === void 0 ? void 0 : _b.MaxBet, this.challenge.CurrencySymbol);
|
|
237
|
+
const formattedContributionPercentage = level.LevelContributionPercent + '%';
|
|
238
|
+
const showMinBet = !!((_c = level.BetRange) === null || _c === void 0 ? void 0 : _c.MinBet);
|
|
239
|
+
const showMaxBet = !!((_d = level.BetRange) === null || _d === void 0 ? void 0 : _d.MaxBet);
|
|
240
|
+
const showContributionPercentage = level.LevelContributionPercent !== 100;
|
|
241
|
+
if (showMinBet || showMaxBet || showContributionPercentage) {
|
|
242
|
+
return (index.h("div", { class: 'ChallengeLevelBetDetails' }, showMinBet &&
|
|
243
|
+
index.h("div", { class: 'ChallengeLevelBetDetail' }, index.h("span", null, translate('minBet', this.language), ": "), index.h("span", { class: 'ChallengeLevelBetRange' }, formattedMinBet)), showMaxBet &&
|
|
244
|
+
index.h("div", { class: 'ChallengeLevelBetDetail' }, index.h("span", null, translate('maxBet', this.language), ": "), index.h("span", { class: 'ChallengeLevelBetRange' }, formattedMaxBet)), showContributionPercentage &&
|
|
245
|
+
index.h("div", { class: 'ChallengeLevelBetDetail' }, index.h("span", null, translate('contribution', this.language), ": "), index.h("span", { class: 'ChallengeLevelBetContribution' }, formattedContributionPercentage))));
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
getChallengeLevels() {
|
|
250
|
+
const isChallengePaused = this.pausedChallengeIds.includes(this.challenge.ChallengeId);
|
|
251
|
+
const InProgressLevel = (level) => {
|
|
252
|
+
return level.ProgressStatus === 1 && !this.isExpiredChallenge && !isChallengePaused;
|
|
253
|
+
};
|
|
254
|
+
return (index.h("div", { class: "ChallengeLevels" }, this.challenge.LevelProgresses.map((level, index$1) => (index.h("div", { class: `ChallengeLevelCard ${InProgressLevel(level) ? 'InProgress' : ''}` }, index.h("casino-engagement-suite-progress-bar", { class: this.device, value: level.ProgressPercentage, "hide-percent": (level.ProgressPercentage === 0 && !InProgressLevel(level)) || 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)), this.getLevelBetRangesDetails(level))))));
|
|
255
|
+
}
|
|
256
|
+
getToggleButton() {
|
|
257
|
+
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))));
|
|
258
|
+
}
|
|
259
|
+
render() {
|
|
260
|
+
return index.h("div", { key: '413a8354c03545a336b044a26f33275423548ee2', class: `ChallengeDetailsPopup ${this.device}` }, this.getActionsTemplate(), index.h("div", { key: 'e58aac0709effc8ed9df011c07b52ee6a0c4fa66', class: `ChallengeDetails ${this.challenge.IsNew ? 'IsNewChallenge' : ''}` }, this.getChallengeHeader(), this.getChallengeCountdown(), this.getToggleButton(), this.getChallengeDetails(), this.getChallengeLevels()));
|
|
261
|
+
}
|
|
262
|
+
get host() { return index.getElement(this); }
|
|
263
|
+
static get watchers() { return {
|
|
264
|
+
"challenge": ["challengePropHandler"]
|
|
265
|
+
}; }
|
|
266
|
+
};
|
|
267
|
+
CasinoEngagementSuiteChallengesDetails.style = CasinoEngagementSuiteChallengesDetailsStyle0;
|
|
268
|
+
|
|
269
|
+
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)}";
|
|
270
|
+
const CasinoEngagementSuiteProgressBarStyle0 = casinoEngagementSuiteProgressBarCss;
|
|
271
|
+
|
|
272
|
+
const CasinoEngagementSuiteProgressBar = class {
|
|
273
|
+
constructor(hostRef) {
|
|
274
|
+
index.registerInstance(this, hostRef);
|
|
275
|
+
this.setClientStyling = () => {
|
|
276
|
+
let sheet = document.createElement('style');
|
|
277
|
+
sheet.innerHTML = this.clientStyling;
|
|
278
|
+
this.host.prepend(sheet);
|
|
279
|
+
};
|
|
280
|
+
this.setClientStylingURL = () => {
|
|
281
|
+
let url = new URL(this.clientStylingUrl);
|
|
282
|
+
let cssFile = document.createElement('style');
|
|
283
|
+
fetch(url.href)
|
|
284
|
+
.then((res) => res.text())
|
|
285
|
+
.then((data) => {
|
|
286
|
+
cssFile.innerHTML = data;
|
|
287
|
+
setTimeout(() => { this.host.prepend(cssFile); }, 1);
|
|
288
|
+
})
|
|
289
|
+
.catch((err) => {
|
|
290
|
+
console.log('Error ', err);
|
|
291
|
+
});
|
|
292
|
+
};
|
|
293
|
+
this.value = 0;
|
|
294
|
+
this.disabled = false;
|
|
295
|
+
this.hidePercent = false;
|
|
296
|
+
this.indeterminate = false;
|
|
297
|
+
this.clientStyling = '';
|
|
298
|
+
this.clientStylingUrl = '';
|
|
299
|
+
this.limitStylingAppends = false;
|
|
300
|
+
}
|
|
301
|
+
componentDidRender() {
|
|
302
|
+
if (!this.limitStylingAppends && this.host) {
|
|
303
|
+
if (this.clientStyling)
|
|
304
|
+
this.setClientStyling();
|
|
305
|
+
if (this.clientStylingUrl)
|
|
306
|
+
this.setClientStylingURL();
|
|
307
|
+
this.limitStylingAppends = true;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
getProgressBarClasses() {
|
|
311
|
+
return {
|
|
312
|
+
ProgressBar: true,
|
|
313
|
+
Completed: this.value === 100,
|
|
314
|
+
Disabled: this.disabled,
|
|
315
|
+
HidePercent: this.hidePercent || this.indeterminate
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
getProgressBarLineTemplate() {
|
|
319
|
+
if (this.indeterminate) {
|
|
320
|
+
return index.h("div", { class: "ProgressBarLine Indeterminate", part: "ProgressBarLine Indeterminate" });
|
|
321
|
+
}
|
|
322
|
+
else {
|
|
323
|
+
return index.h("div", { class: "ProgressBarLine", part: "ProgressBarLine", style: { width: this.value + '%' } });
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
render() {
|
|
327
|
+
return index.h("div", { key: 'ecce3a26a92d2e090c1db84bdc1bdbeb505080ed', class: this.getProgressBarClasses(), part: "ProgressBar" }, index.h("div", { key: '649fe1103d222200f2a1ad3b5967e37da1f1ab3d', class: "ProgressBarInfo", part: "ProgressBarInfo" }, index.h("slot", { key: '49dc180eedd823f0027f75099813fb9d91bcd938', name: "Title" }, index.h("div", { key: 'e6e59da3fe7bbcb37e118e7fd23a8ff35587aca5' })), index.h("slot", { key: '3dc8e5fd1dbc8c268b9c76e393b751cb53605e7e', name: "Percent" }, index.h("div", { key: '6a9e880f3ee3c4f26e8577c69be5db5f8e2d10ad', class: "ProgressBarPercent", part: "ProgressBarPercent" }, this.value, "%"))), index.h("div", { key: '141106e77caad7b04bb199f911e87c0c6f0adc2d', class: "ProgressBarBackground", part: "ProgressBarBackground" }, this.getProgressBarLineTemplate()));
|
|
328
|
+
}
|
|
329
|
+
get host() { return index.getElement(this); }
|
|
330
|
+
};
|
|
331
|
+
CasinoEngagementSuiteProgressBar.style = CasinoEngagementSuiteProgressBarStyle0;
|
|
332
|
+
|
|
333
|
+
exports.casino_engagement_suite_challenges_details = CasinoEngagementSuiteChallengesDetails;
|
|
334
|
+
exports.casino_engagement_suite_progress_bar = CasinoEngagementSuiteProgressBar;
|