@everymatrix/casino-engagement-suite-challenges-list 1.35.0 → 1.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/casino-engagement-suite-challenges-list/casino-engagement-suite-challenges-list.esm.js +1 -1
- package/dist/casino-engagement-suite-challenges-list/p-a9f41c83.entry.js +1 -0
- package/dist/casino-engagement-suite-challenges-list/p-fad4589e.js +1 -0
- package/dist/cjs/casino-engagement-suite-challenges-list.cjs.js +2 -2
- package/dist/cjs/casino-engagement-suite-challenges-list_2.cjs.entry.js +484 -0
- package/dist/cjs/{index-79c88755.js → index-0a011384.js} +38 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +8 -1
- package/dist/collection/components/casino-engagement-suite-challenges-list/casino-engagement-suite-challenges-list.css +1 -0
- package/dist/collection/components/casino-engagement-suite-challenges-list/casino-engagement-suite-challenges-list.js +43 -16
- package/dist/components/casino-engagement-suite-challenges-list.js +51 -773
- package/dist/components/casino-engagement-suite-progress-bar.js +6 -0
- package/dist/components/casino-engagement-suite-progress-bar2.js +88 -0
- package/dist/esm/casino-engagement-suite-challenges-list.js +2 -2
- package/dist/esm/casino-engagement-suite-challenges-list_2.entry.js +479 -0
- package/dist/esm/{index-70e47fe0.js → index-ddf7e990.js} +38 -1
- package/dist/esm/loader.js +2 -2
- package/dist/types/components/casino-engagement-suite-challenges-list/casino-engagement-suite-challenges-list.d.ts +1 -0
- package/dist/types/models/challenge.d.ts +1 -0
- package/package.json +1 -1
- package/dist/casino-engagement-suite-challenges-list/p-7e171791.js +0 -1
- package/dist/casino-engagement-suite-challenges-list/p-eb36cbe7.entry.js +0 -1
- package/dist/cjs/casino-engagement-suite-challenges-list.cjs.entry.js +0 -1147
- package/dist/esm/casino-engagement-suite-challenges-list.entry.js +0 -1143
package/dist/casino-engagement-suite-challenges-list/casino-engagement-suite-challenges-list.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as
|
|
1
|
+
import{p as e,b as l}from"./p-fad4589e.js";(()=>{const l=import.meta.url,n={};return""!==l&&(n.resourcesUrl=new URL(".",l).href),e(n)})().then((e=>l([["p-a9f41c83",[[1,"casino-engagement-suite-challenges-list",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[1],device:[1],challenges:[1040],tooltip:[32],timers:[32],limitStylingAppends:[32]},[[8,"message","handleEvent"]]],[1,"casino-engagement-suite-progress-bar",{value:[2],disabled:[4],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],limitStylingAppends:[32]}]]]],e)));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as t,h as s,g as o}from"./p-fad4589e.js";var n,i;!function(e){e[e.Closed=0]="Closed",e[e.InProgress=1]="InProgress",e[e.Fillup=2]="Fillup",e[e.Completed=3]="Completed"}(n||(n={})),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"}(i||(i={}));const a=["en"],l={en:{challenges:"Challenges",join:"Join",unjoin:"Unjoin",noChallenges:"No Challenges yet",tryOtherGames:"Try winning Challenges as rewards or launching other booster games",tooltip:"Competition where your real money bets contribute towards the level progress to achieve the level reward"}},r=(e,t)=>{const s=t;return l[void 0!==s&&a.includes(s)?s:"en"][e]};function h(e){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function g(e){p(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===h(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function d(e,t){return p(2,arguments),g(e).getTime()-g(t).getTime()}var c={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}};function u(e){return e?c[e]:c.trunc}const C=class{constructor(s){e(this,s),this.close=t(this,"close",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.device="Mobile",this.challenges=[],this.tooltip=!1,this.timers={},this.limitStylingAppends=!1,this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))},this.handleCloseClick=()=>{this.close.emit(),this.tooltip=!1},this.handleChallengeClick=e=>{const t=+e.currentTarget.getAttribute("data-id");window.postMessage({type:"ChallengeClick",id:t})},this.showTooltip=()=>{this.tooltip=!0},this.hideTooltip=()=>{this.tooltip=!1},this.changeChallengeStatus=e=>{e.stopPropagation();const t=+e.currentTarget.getAttribute("data-id"),s=this.challenges.filter((e=>e.Status===i.InProgress)).map((e=>e.Id));s.includes(t)?window.postMessage({type:"ShowConfirmationModal",action:"unjoin",id:t}):(null==s?void 0:s.length)>0?window.postMessage({type:"ShowConfirmationModal",action:"join",prevId:s[0],id:t}):window.postMessage({type:"ChallengeAttendance",confirmationData:{action:"join",id:t}})}}challengesPropHandler(e){!this.interval&&e.length&&(this.updateTimers(),this.startCountdown()),this.interval&&!e.length&&clearInterval(this.interval)}handleEvent(e){const t=e.data.data;if("ChallengeGrant"===e.data.type){const e=this.challenges.findIndex((e=>function(e,t,s){p(2,arguments);var o=d(e,t)/1e3;return u(null==s?void 0:s.roundingMethod)(o)}(new Date(e.ExpirationTime),new Date(t.ExpirationTime))>0));e>-1?this.challenges.splice(e,0,t):this.challenges.unshift(t)}}componentWillLoad(){this.challengesPropHandler(this.challenges)}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}disconnectedCallback(){this.interval&&clearInterval(this.interval)}startCountdown(){this.interval=setInterval((()=>{this.updateTimers()}),1e3)}updateTimers(){const e=(new Date).getTime();this.timers=this.challenges.filter((e=>e.Status!==i.Expired)).reduce(((t,s)=>{const o=new Date(s.ExpirationTime).getTime()-e;let n="00h:00m:00s";if(o<1)this.removeChallenge(s.Id);else{const{days:e,hours:t,minutes:s,seconds:i}={days:String(Math.floor(o/864e5)).padStart(2,"0"),hours:String(Math.floor(o%864e5/36e5)).padStart(2,"0"),minutes:String(Math.floor(o%36e5/6e4)).padStart(2,"0"),seconds:String(Math.floor(o%6e4/1e3)).padStart(2,"0")};n="00"===e?`${t}h:${s}m:${i}s`:`${e}d:${t}h:${s}m`}return Object.assign(Object.assign({},t),{[s.Id]:n})}),{})}removeChallenge(e){const t=this.challenges.findIndex((t=>t.Id===e));t>-1&&(this.challenges.splice(t,1),window.postMessage({type:"ChallengeHasExpired",id:e}))}getChallengeClasses(e){return{ChallengeCard:!0,InProgress:e.Status===i.InProgress,Completed:this.isChallengeCompleted(e),Paused:this.isChallengePaused(e)}}isChallengePaused(e){return e.Status===i.Started&&e.LevelProgresses[0].ProgressPercentage>0}isChallengeCompleted(e){return e.Status===i.Completed||e.Status===i.PendingLevelReward&&e.LevelProgresses.every((e=>100===e.ProgressPercentage))}getChallengeProgress(e){if(e.Status===i.Completed)return 100;if(this.isChallengePaused(e)||e.Status===i.PendingLevelReward||e.Status===i.InProgress){const t=e.LevelProgresses.find((e=>e.ProgressStatus===n.InProgress));return t?t.ProgressPercentage:0}return-1}getChallengeHeaderTemplate(e){const{Id:t}=e;return s("div",{class:"ChallengeCardHeader"},s("div",{class:"ChallengeName"},e.ChallengePresentation.PresentationName),s("button",{class:e.Status===i.InProgress?"ChallengeJoinButton Joined":"ChallengeJoinButton",onClick:this.changeChallengeStatus,"data-id":t},r(e.Status===i.InProgress?"unjoin":"join",this.language)))}getChallengeTemplate(e){const t=this.getChallengeProgress(e),o=this.timers[e.Id],n=t>-1?s("casino-engagement-suite-progress-bar",{class:this.device,value:t,disabled:this.isChallengePaused(e)},s("span",{slot:"Title",class:"ChallengeCountdown"},o)):s("span",{class:"ChallengeCountdown"},o);return s("div",{class:this.getChallengeClasses(e),onClick:this.handleChallengeClick,key:e.Id,"data-id":e.Id},this.getChallengeHeaderTemplate(e),n)}getHeaderTemplate(){return s("header",{class:"ChallengesListPopupHeader"},s("button",{onClick:this.showTooltip,class:"ChallengesIconButton"},s("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/help.svg",alt:"Show tooltip"})),s("div",{class:"ChallengesListPopupHeaderName"},r("challenges",this.language)),s("button",{class:"ChallengesIconButton",onClick:this.handleCloseClick},s("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Close challenges list"})))}getListTemplate(){return this.challenges.length?s("div",{class:"ChallengesListWrapper"},s("div",{class:"ChallengesList"},this.challenges.map((e=>this.getChallengeTemplate(e))))):s("div",{class:"ChallengesListEmpty"},s("h2",null,r("noChallenges",this.language)),s("p",null,r("tryOtherGames",this.language)))}getTooltipTemplate(){return this.tooltip?s("div",{class:"ChallengesTooltipBackdrop"},s("div",{class:"ChallengesTooltip"},s("button",{class:"ChallengesIconButton",onClick:this.hideTooltip},s("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Close tooltip"})),r("tooltip",this.language))):""}render(){return s("div",{class:`ChallengesListPopup ${this.device}`},this.getHeaderTemplate(),this.getListTemplate(),this.getTooltipTemplate())}get host(){return o(this)}static get watchers(){return{challenges:["challengesPropHandler"]}}};C.style='@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@600&display=swap");:host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.ChallengesListPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative}.ChallengesListPopupHeader{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.ChallengesIconButton{width:16px;height:16px;cursor:pointer}.ChallengesListPopupHeaderName{color:var(--emw--color-gray-100, #BBB9C3);font-size:14px;font-weight:500;line-height:14px}.ChallengesListWrapper{overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.ChallengesListWrapper::-webkit-scrollbar{display:none}.ChallengesList{display:flex;flex-direction:column;row-gap:12px;padding:8px 19px 0}.ChallengeCard{padding:15px 15px 19px;border:1px solid var(--emw--button-border-color, #403956);border-radius:6px;position:relative;cursor:pointer}.ChallengeJoinButton.Joined::before,.ChallengeCard.InProgress::before{content:"";position:absolute;inset:0;border-radius:var(--emw--button-border-radius, 4px);padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.ChallengeCardHeader{display:flex;justify-content:space-between;gap:24px;margin-bottom:12px}.ChallengeName{color:var(--emw--color-typography, #FFFFFF);font-family:"Montserrat", sans-serif;line-height:22px;font-weight:700;font-size:18px;word-break:break-word}.ChallengeJoinButton{transition:all 0.5s ease-out;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:var(--emw--color-typography, #1E1638);border-radius:99px;min-width:88px;height:32px;font-size:14px;font-weight:700;position:relative;font-family:"Montserrat", sans-serif}.ChallengeJoinButton.Joined{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.ChallengeJoinButton.Joined::before{border-radius:99px}.ChallengesListEmpty{padding:20px 32px}.ChallengesListEmpty h2{margin:0 0 16px 0;text-align:center;font-weight:600;font-size:20px;line-height:24px;font-family:"Montserrat", sans-serif;color:var(--emw--color-typography, #FFFFFF)}.ChallengesListEmpty p{font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3)}.ChallengeCountdown{color:var(--emw--color-gray-100, #BBB9C3);font-size:12px;line-height:12px}.ChallengesTooltipBackdrop{padding:48px 30px 0;position:absolute;width:100%;height:100%;inset:0;background-color:rgba(0, 0, 0, 0.5)}.ChallengesTooltipBackdrop .ChallengesTooltip{border:1px solid var(--emw--button-border-color, #403956);background-color:var(--emw--color-background, #1E1638);border-radius:8px;padding:32px;font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3);position:relative}.ChallengesTooltipBackdrop .ChallengesTooltip .ChallengesIconButton{top:12px;right:6px;position:absolute}.ChallengesListPopup.Tablet .ChallengesListPopupHeader,.ChallengesListPopup.Desktop .ChallengesListPopupHeader{padding-top:16px}.ChallengesListPopup.Tablet .ChallengesListPopupHeaderName,.ChallengesListPopup.Desktop .ChallengesListPopupHeaderName{font-size:16px;line-height:16px}.ChallengesListPopup.Tablet .ChallengesIconButton,.ChallengesListPopup.Desktop .ChallengesIconButton{width:24px;height:24px}.ChallengesListPopup.Tablet .ChallengesList,.ChallengesListPopup.Desktop .ChallengesList{padding:20px 24px 0;row-gap:20px}.ChallengesListPopup.Tablet .ChallengeCardHeader,.ChallengesListPopup.Desktop .ChallengeCardHeader{margin-bottom:16px}.ChallengesListPopup.Tablet .ChallengeName,.ChallengesListPopup.Desktop .ChallengeName{line-height:27px;font-size:22px}.ChallengesListPopup.Tablet .ChallengeJoinButton,.ChallengesListPopup.Desktop .ChallengeJoinButton{min-width:100px;height:36px;font-size:16px}.ChallengesListPopup.Tablet .ChallengeCountdown,.ChallengesListPopup.Desktop .ChallengeCountdown{font-size:14px;line-height:14px}.ChallengesListPopup.Tablet .ChallengesTooltip,.ChallengesListPopup.Desktop .ChallengesTooltip{padding:60px 65px;font-size:16px;line-height:20px}.ChallengesListPopup.Tablet .ChallengesTooltip .ChallengesIconButton,.ChallengesListPopup.Desktop .ChallengesTooltip .ChallengesIconButton{top:24px;right:24px}';const m=class{constructor(t){e(this,t),this.value=0,this.disabled=!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}}render(){return s("div",{class:this.getProgressBarClasses(),part:"ProgressBar"},s("div",{class:"ProgressBarInfo",part:"ProgressBarInfo"},s("slot",{name:"Title"},s("div",null)),s("slot",{name:"Percent"},s("div",{class:"ProgressBarPercent",part:"ProgressBarPercent"},this.value,"%"))),s("div",{class:"ProgressBarBackground",part:"ProgressBarBackground"},s("div",{class:"ProgressBarLine",part:"ProgressBarLine",style:{width:this.value+"%"}})))}get host(){return o(this)}};m.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}.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{C as casino_engagement_suite_challenges_list,m as casino_engagement_suite_progress_bar}
|
|
@@ -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=(e,t,n)=>{n&&n.map((([n,l,s])=>{const i=u(e,n),c=a(t,s),r=f(n);o.ael(i,l,c,r),(t.o=t.o||[]).push((()=>o.rel(i,l,c,r)))}))},a=(e,t)=>n=>{try{256&e.t?e.i[t](n):(e.u=e.u||[]).push([t,n])}catch(e){J(e)}},u=(e,t)=>8&t?l:e,f=e=>0!=(2&e),d=new WeakMap,h=e=>"sc-"+e.h,y={},$=e=>"object"==(e=typeof e)||"function"===e,m=(e,t,...n)=>{let l=null,s=null,o=!1,i=!1,c=[];const r=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?r(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof e&&!$(l))&&(l+=""),o&&i?c[c.length-1].$+=l:c.push(o?p(null,l):l),i=o)};if(r(n),t){t.key&&(s=t.key);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}const a=p(e,null);return a.m=t,c.length>0&&(a.p=c),a.g=s,a},p=(e,t)=>({t:0,S:e,$:t,k:null,p:null,m:null,g:null}),b={},w=(e,t,n,s,i,c)=>{if(n!==s){let r=I(e,t),a=t.toLowerCase();if("class"===t){const t=e.classList,l=S(n),o=S(s);t.remove(...l.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!l.includes(e))))}else if("style"===t){for(const t in n)s&&null!=s[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in s)n&&s[t]===n[t]||(t.includes("-")?e.style.setProperty(t,s[t]):e.style[t]=s[t])}else if("key"===t);else if(r||"o"!==t[0]||"n"!==t[1]){const l=$(s);if((r||l&&null!==s)&&!i)try{if(e.tagName.includes("-"))e[t]=s;else{let l=null==s?"":s;"list"===t?r=!1:null!=n&&e[t]==l||(e[t]=l)}}catch(e){}null==s||!1===s?!1===s&&""!==e.getAttribute(t)||e.removeAttribute(t):(!r||4&c||i)&&!l&&e.setAttribute(t,s=!0===s?"":s)}else t="-"===t[2]?t.slice(3):I(l,a)?a.slice(2):a[2]+t.slice(3),n&&o.rel(e,t,n,!1),s&&o.ael(e,t,s,!1)}},g=/\s/,S=e=>e?e.split(g):[],k=(e,t,n,l)=>{const s=11===t.k.nodeType&&t.k.host?t.k.host:t.k,o=e&&e.m||y,i=t.m||y;for(l in o)l in i||w(s,l,o[l],void 0,n,t.t);for(l in i)w(s,l,o[l],i[l],n,t.t)},j=(t,n,l)=>{let o,i,c=n.p[l],r=0;if(null!==c.$)o=c.k=s.createTextNode(c.$);else if(o=c.k=s.createElement(c.S),k(null,c,!1),null!=e&&o["s-si"]!==e&&o.classList.add(o["s-si"]=e),c.p)for(r=0;r<c.p.length;++r)i=j(t,c,r),i&&o.appendChild(i);return o},v=(e,n,l,s,o,i)=>{let c,r=e;for(r.shadowRoot&&r.tagName===t&&(r=r.shadowRoot);o<=i;++o)s[o]&&(c=j(null,l,o),c&&(s[o].k=c,r.insertBefore(c,n)))},M=(e,t,n,l)=>{for(;t<=n;++t)(l=e[t])&&l.k.remove()},C=(e,t)=>e.S===t.S&&e.g===t.g,O=(e,t)=>{const n=t.k=e.k,l=e.p,s=t.p,o=t.$;null===o?("slot"===t.S||k(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o,i=0,c=0,r=0,a=0,u=t.length-1,f=t[0],d=t[u],h=l.length-1,y=l[0],$=l[h];for(;i<=u&&c<=h;)if(null==f)f=t[++i];else if(null==d)d=t[--u];else if(null==y)y=l[++c];else if(null==$)$=l[--h];else if(C(f,y))O(f,y),f=t[++i],y=l[++c];else if(C(d,$))O(d,$),d=t[--u],$=l[--h];else if(C(f,$))O(f,$),e.insertBefore(f.k,d.k.nextSibling),f=t[++i],$=l[--h];else if(C(d,y))O(d,y),e.insertBefore(d.k,f.k),d=t[--u],y=l[++c];else{for(r=-1,a=i;a<=u;++a)if(t[a]&&null!==t[a].g&&t[a].g===y.g){r=a;break}r>=0?(o=t[r],o.S!==y.S?s=j(t&&t[c],n,r):(O(o,y),t[r]=void 0,s=o.k),y=l[++c]):(s=j(t&&t[c],n,c),y=l[++c]),s&&f.k.parentNode.insertBefore(s,f.k)}i>u?v(e,null==l[h+1]?null:l[h+1].k,n,l,c,h):c>h&&M(t,i,u)})(n,l,t,s):null!==s?(null!==e.$&&(n.textContent=""),v(n,null,t,s,0,s.length-1)):null!==l&&M(l,0,l.length-1)):e.$!==o&&(n.data=o)},P=e=>z(e).j,x=(e,t,n)=>{const l=P(e);return{emit:e=>E(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},E=(e,t,n)=>{const l=o.ce(t,n);return e.dispatchEvent(l),l},L=(e,t)=>{t&&!e.v&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.v=t)))},N=(e,t)=>{if(e.t|=16,!(4&e.t))return L(e,e.M),se((()=>R(e,t)));e.t|=512},R=(e,t)=>{const n=e.i;let l;return t&&(e.t|=256,e.u&&(e.u.map((([e,t])=>U(n,e,t))),e.u=null),l=U(n,"componentWillLoad")),q(l,(()=>T(e,n,t)))},T=async(e,t,n)=>{const l=e.j,o=l["s-rc"];n&&(e=>{const t=e.C,n=e.j,l=t.t,o=((e,t)=>{let n=h(t),l=X.get(n);if(e=11===e.nodeType?e:s,l)if("string"==typeof l){let t,o=d.get(e=e.head||e);o||d.set(e,o=new Set),o.has(n)||(t=s.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),o&&o.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);W(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>A(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},W=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.j,o=n.C,i=n.O||p(null,null),c=(e=>e&&e.S===b)(l)?l:m(null,null,l);t=s.tagName,o.P&&(c.m=c.m||{},o.P.map((([e,t])=>c.m[t]=s[e]))),c.S=null,c.t|=4,n.O=c,c.k=i.k=s.shadowRoot||s,e=s["s-sc"],O(i,c)})(n,l)}catch(e){J(e,n.j)}return null},A=e=>{const t=e.j,n=e.M;U(e.i,"componentDidRender"),64&e.t||(e.t|=64,D(t),e.L(t),n||F()),e.v&&(e.v(),e.v=void 0),512&e.t&&le((()=>N(e,!1))),e.t&=-517},F=()=>{D(s.documentElement),le((()=>E(l,"appload",{detail:{namespace:"casino-engagement-suite-challenges-list"}})))},U=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){J(e)}},q=(e,t)=>e&&e.then?e.then(t):t(),D=e=>e.classList.add("hydrated"),H=(e,t,n)=>{if(t.N){e.watchers&&(t.R=e.watchers);const l=Object.entries(t.N),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>z(this).T.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=z(e),o=s.j,i=s.T.get(t),c=s.t,r=s.i;if(n=((e,t)=>null==e||$(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(n,l.N[t][0]),(!(8&c)||void 0===i)&&n!==i&&(!Number.isNaN(i)||!Number.isNaN(n))&&(s.T.set(t,n),r)){if(l.R&&128&c){const e=l.R[t];e&&e.map((e=>{try{r[e](n,i,t)}catch(e){J(e,o)}}))}2==(18&c)&&N(s,!1)}})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const n=new Map;s.attributeChangedCallback=function(e,t,l){o.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(s.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==l)return;this[t]=(null!==l||"boolean"!=typeof this[t])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,l])=>{const s=l[1]||e;return n.set(s,e),512&l[0]&&t.P.push([e,s]),s}))}}return e},V=(e,t={})=>{const n=[],i=t.exclude||[],a=l.customElements,u=s.head,f=u.querySelector("meta[charset]"),d=s.createElement("style"),y=[];let $,m=!0;Object.assign(o,t),o.l=new URL(t.resourcesUrl||"./",s.baseURI).href,e.map((e=>{e[1].map((t=>{const l={t:t[0],h:t[1],N:t[2],W:t[3]};l.N=t[2],l.W=t[3],l.P=[],l.R={};const s=l.h,u=class extends HTMLElement{constructor(e){super(e),G(e=this,l),1&l.t&&e.attachShadow({mode:"open"})}connectedCallback(){$&&(clearTimeout($),$=null),m?y.push(this):o.jmp((()=>(e=>{if(0==(1&o.t)){const t=z(e),n=t.C,l=()=>{};if(1&t.t)r(e,t,n.W);else{t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){L(t,t.M=n);break}}n.N&&Object.entries(n.N).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=Q(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(n.R=s.watchers,H(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){J(e)}t.t&=-9,t.t|=128,e()}if(s.style){let e=s.style;const t=h(n);if(!X.has(t)){const l=()=>{};((e,t,n)=>{let l=X.get(e);c&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,X.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.M,i=()=>N(t,!0);o&&o["s-rc"]?o["s-rc"].push(i):i()})(0,t,n)}l()}})(this)))}disconnectedCallback(){o.jmp((()=>(()=>{if(0==(1&o.t)){const e=z(this),t=e.i;e.o&&(e.o.map((e=>e())),e.o=void 0),U(t,"disconnectedCallback")}})()))}componentOnReady(){return z(this).A}};l.F=e[0],i.includes(s)||a.get(s)||(n.push(s),a.define(s,H(u,l,1)))}))})),d.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",d.setAttribute("data-styles",""),u.insertBefore(d,f?f.nextSibling:u.firstChild),m=!1,y.length?y.map((e=>e.connectedCallback())):o.jmp((()=>$=setTimeout(F,30)))},_=new WeakMap,z=e=>_.get(e),B=(e,t)=>_.set(t.i=e,t),G=(e,t)=>{const n={t:0,j:e,C:t,T:new Map};return n.A=new Promise((e=>n.L=e)),e["s-p"]=[],e["s-rc"]=[],r(e,n,t.W),_.set(e,n)},I=(e,t)=>t in e,J=(e,t)=>(0,console.error)(e,t),K=new Map,Q=e=>{const t=e.h.replace(/-/g,"_"),n=e.F,l=K.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(K.set(n,e),e[t])),J)},X=new Map,Y=[],Z=[],ee=(e,t)=>l=>{e.push(l),n||(n=!0,t&&4&o.t?le(ne):o.raf(ne))},te=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){J(e)}e.length=0},ne=()=>{te(Y),te(Z),(n=Y.length>0)&&o.raf(ne)},le=e=>i().then(e),se=ee(Z,!0);export{V as b,x as c,P as g,m as h,i as p,B as r}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-0a011384.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-
|
|
18
|
+
return index.bootstrapLazy([["casino-engagement-suite-challenges-list_2.cjs",[[1,"casino-engagement-suite-challenges-list",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[1],"device":[1],"challenges":[1040],"tooltip":[32],"timers":[32],"limitStylingAppends":[32]},[[8,"message","handleEvent"]]],[1,"casino-engagement-suite-progress-bar",{"value":[2],"disabled":[4],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"limitStylingAppends":[32]}]]]], options);
|
|
19
19
|
});
|
|
@@ -0,0 +1,484 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-0a011384.js');
|
|
6
|
+
|
|
7
|
+
var ChallengeLevelProgressStatus;
|
|
8
|
+
(function (ChallengeLevelProgressStatus) {
|
|
9
|
+
ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["Closed"] = 0] = "Closed";
|
|
10
|
+
ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["InProgress"] = 1] = "InProgress";
|
|
11
|
+
ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["Fillup"] = 2] = "Fillup";
|
|
12
|
+
ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["Completed"] = 3] = "Completed";
|
|
13
|
+
})(ChallengeLevelProgressStatus || (ChallengeLevelProgressStatus = {}));
|
|
14
|
+
var ChallengeProgressStatus;
|
|
15
|
+
(function (ChallengeProgressStatus) {
|
|
16
|
+
ChallengeProgressStatus[ChallengeProgressStatus["Started"] = 0] = "Started";
|
|
17
|
+
ChallengeProgressStatus[ChallengeProgressStatus["InProgress"] = 1] = "InProgress";
|
|
18
|
+
ChallengeProgressStatus[ChallengeProgressStatus["PendingLevelReward"] = 2] = "PendingLevelReward";
|
|
19
|
+
ChallengeProgressStatus[ChallengeProgressStatus["Completed"] = 3] = "Completed";
|
|
20
|
+
ChallengeProgressStatus[ChallengeProgressStatus["Expired"] = 4] = "Expired";
|
|
21
|
+
})(ChallengeProgressStatus || (ChallengeProgressStatus = {}));
|
|
22
|
+
|
|
23
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
24
|
+
const SUPPORTED_LANGUAGES = ['en'];
|
|
25
|
+
const TRANSLATIONS = {
|
|
26
|
+
en: {
|
|
27
|
+
challenges: 'Challenges',
|
|
28
|
+
join: 'Join',
|
|
29
|
+
unjoin: 'Unjoin',
|
|
30
|
+
noChallenges: 'No Challenges yet',
|
|
31
|
+
tryOtherGames: 'Try winning Challenges as rewards or launching other booster games',
|
|
32
|
+
tooltip: 'Competition where your real money bets contribute towards the level progress to achieve the level reward'
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const translate = (key, customLang) => {
|
|
36
|
+
const lang = customLang;
|
|
37
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
function _typeof(o) {
|
|
41
|
+
"@babel/helpers - typeof";
|
|
42
|
+
|
|
43
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
44
|
+
return typeof o;
|
|
45
|
+
} : function (o) {
|
|
46
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
47
|
+
}, _typeof(o);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function requiredArgs(required, args) {
|
|
51
|
+
if (args.length < required) {
|
|
52
|
+
throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @name toDate
|
|
58
|
+
* @category Common Helpers
|
|
59
|
+
* @summary Convert the given argument to an instance of Date.
|
|
60
|
+
*
|
|
61
|
+
* @description
|
|
62
|
+
* Convert the given argument to an instance of Date.
|
|
63
|
+
*
|
|
64
|
+
* If the argument is an instance of Date, the function returns its clone.
|
|
65
|
+
*
|
|
66
|
+
* If the argument is a number, it is treated as a timestamp.
|
|
67
|
+
*
|
|
68
|
+
* If the argument is none of the above, the function returns Invalid Date.
|
|
69
|
+
*
|
|
70
|
+
* **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
|
|
71
|
+
*
|
|
72
|
+
* @param {Date|Number} argument - the value to convert
|
|
73
|
+
* @returns {Date} the parsed date in the local time zone
|
|
74
|
+
* @throws {TypeError} 1 argument required
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* // Clone the date:
|
|
78
|
+
* const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
|
|
79
|
+
* //=> Tue Feb 11 2014 11:30:30
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* // Convert the timestamp to date:
|
|
83
|
+
* const result = toDate(1392098430000)
|
|
84
|
+
* //=> Tue Feb 11 2014 11:30:30
|
|
85
|
+
*/
|
|
86
|
+
function toDate(argument) {
|
|
87
|
+
requiredArgs(1, arguments);
|
|
88
|
+
var argStr = Object.prototype.toString.call(argument);
|
|
89
|
+
|
|
90
|
+
// Clone the date
|
|
91
|
+
if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
|
|
92
|
+
// Prevent the date to lose the milliseconds when passed to new Date() in IE10
|
|
93
|
+
return new Date(argument.getTime());
|
|
94
|
+
} else if (typeof argument === 'number' || argStr === '[object Number]') {
|
|
95
|
+
return new Date(argument);
|
|
96
|
+
} else {
|
|
97
|
+
if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
|
|
98
|
+
// eslint-disable-next-line no-console
|
|
99
|
+
console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
|
|
100
|
+
// eslint-disable-next-line no-console
|
|
101
|
+
console.warn(new Error().stack);
|
|
102
|
+
}
|
|
103
|
+
return new Date(NaN);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* @name differenceInMilliseconds
|
|
109
|
+
* @category Millisecond Helpers
|
|
110
|
+
* @summary Get the number of milliseconds between the given dates.
|
|
111
|
+
*
|
|
112
|
+
* @description
|
|
113
|
+
* Get the number of milliseconds between the given dates.
|
|
114
|
+
*
|
|
115
|
+
* @param {Date|Number} dateLeft - the later date
|
|
116
|
+
* @param {Date|Number} dateRight - the earlier date
|
|
117
|
+
* @returns {Number} the number of milliseconds
|
|
118
|
+
* @throws {TypeError} 2 arguments required
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* // How many milliseconds are between
|
|
122
|
+
* // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?
|
|
123
|
+
* const result = differenceInMilliseconds(
|
|
124
|
+
* new Date(2014, 6, 2, 12, 30, 21, 700),
|
|
125
|
+
* new Date(2014, 6, 2, 12, 30, 20, 600)
|
|
126
|
+
* )
|
|
127
|
+
* //=> 1100
|
|
128
|
+
*/
|
|
129
|
+
function differenceInMilliseconds(dateLeft, dateRight) {
|
|
130
|
+
requiredArgs(2, arguments);
|
|
131
|
+
return toDate(dateLeft).getTime() - toDate(dateRight).getTime();
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
var roundingMap = {
|
|
135
|
+
ceil: Math.ceil,
|
|
136
|
+
round: Math.round,
|
|
137
|
+
floor: Math.floor,
|
|
138
|
+
trunc: function trunc(value) {
|
|
139
|
+
return value < 0 ? Math.ceil(value) : Math.floor(value);
|
|
140
|
+
} // Math.trunc is not supported by IE
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
var defaultRoundingMethod = 'trunc';
|
|
144
|
+
function getRoundingMethod(method) {
|
|
145
|
+
return method ? roundingMap[method] : roundingMap[defaultRoundingMethod];
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* @name differenceInSeconds
|
|
150
|
+
* @category Second Helpers
|
|
151
|
+
* @summary Get the number of seconds between the given dates.
|
|
152
|
+
*
|
|
153
|
+
* @description
|
|
154
|
+
* Get the number of seconds between the given dates.
|
|
155
|
+
*
|
|
156
|
+
* @param {Date|Number} dateLeft - the later date
|
|
157
|
+
* @param {Date|Number} dateRight - the earlier date
|
|
158
|
+
* @param {Object} [options] - an object with options.
|
|
159
|
+
* @param {String} [options.roundingMethod='trunc'] - a rounding method (`ceil`, `floor`, `round` or `trunc`)
|
|
160
|
+
* @returns {Number} the number of seconds
|
|
161
|
+
* @throws {TypeError} 2 arguments required
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* // How many seconds are between
|
|
165
|
+
* // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000?
|
|
166
|
+
* const result = differenceInSeconds(
|
|
167
|
+
* new Date(2014, 6, 2, 12, 30, 20, 0),
|
|
168
|
+
* new Date(2014, 6, 2, 12, 30, 7, 999)
|
|
169
|
+
* )
|
|
170
|
+
* //=> 12
|
|
171
|
+
*/
|
|
172
|
+
function differenceInSeconds(dateLeft, dateRight, options) {
|
|
173
|
+
requiredArgs(2, arguments);
|
|
174
|
+
var diff = differenceInMilliseconds(dateLeft, dateRight) / 1000;
|
|
175
|
+
return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
const casinoEngagementSuiteChallengesListCss = "@import url(\"https://fonts.googleapis.com/css2?family=Montserrat:wght@600&display=swap\");:host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.ChallengesListPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative}.ChallengesListPopupHeader{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.ChallengesIconButton{width:16px;height:16px;cursor:pointer}.ChallengesListPopupHeaderName{color:var(--emw--color-gray-100, #BBB9C3);font-size:14px;font-weight:500;line-height:14px}.ChallengesListWrapper{overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.ChallengesListWrapper::-webkit-scrollbar{display:none}.ChallengesList{display:flex;flex-direction:column;row-gap:12px;padding:8px 19px 0}.ChallengeCard{padding:15px 15px 19px;border:1px solid var(--emw--button-border-color, #403956);border-radius:6px;position:relative;cursor:pointer}.ChallengeJoinButton.Joined::before,.ChallengeCard.InProgress::before{content:\"\";position:absolute;inset:0;border-radius:var(--emw--button-border-radius, 4px);padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.ChallengeCardHeader{display:flex;justify-content:space-between;gap:24px;margin-bottom:12px}.ChallengeName{color:var(--emw--color-typography, #FFFFFF);font-family:\"Montserrat\", sans-serif;line-height:22px;font-weight:700;font-size:18px;word-break:break-word}.ChallengeJoinButton{transition:all 0.5s ease-out;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:var(--emw--color-typography, #1E1638);border-radius:99px;min-width:88px;height:32px;font-size:14px;font-weight:700;position:relative;font-family:\"Montserrat\", sans-serif}.ChallengeJoinButton.Joined{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.ChallengeJoinButton.Joined::before{border-radius:99px}.ChallengesListEmpty{padding:20px 32px}.ChallengesListEmpty h2{margin:0 0 16px 0;text-align:center;font-weight:600;font-size:20px;line-height:24px;font-family:\"Montserrat\", sans-serif;color:var(--emw--color-typography, #FFFFFF)}.ChallengesListEmpty p{font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3)}.ChallengeCountdown{color:var(--emw--color-gray-100, #BBB9C3);font-size:12px;line-height:12px}.ChallengesTooltipBackdrop{padding:48px 30px 0;position:absolute;width:100%;height:100%;inset:0;background-color:rgba(0, 0, 0, 0.5)}.ChallengesTooltipBackdrop .ChallengesTooltip{border:1px solid var(--emw--button-border-color, #403956);background-color:var(--emw--color-background, #1E1638);border-radius:8px;padding:32px;font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3);position:relative}.ChallengesTooltipBackdrop .ChallengesTooltip .ChallengesIconButton{top:12px;right:6px;position:absolute}.ChallengesListPopup.Tablet .ChallengesListPopupHeader,.ChallengesListPopup.Desktop .ChallengesListPopupHeader{padding-top:16px}.ChallengesListPopup.Tablet .ChallengesListPopupHeaderName,.ChallengesListPopup.Desktop .ChallengesListPopupHeaderName{font-size:16px;line-height:16px}.ChallengesListPopup.Tablet .ChallengesIconButton,.ChallengesListPopup.Desktop .ChallengesIconButton{width:24px;height:24px}.ChallengesListPopup.Tablet .ChallengesList,.ChallengesListPopup.Desktop .ChallengesList{padding:20px 24px 0;row-gap:20px}.ChallengesListPopup.Tablet .ChallengeCardHeader,.ChallengesListPopup.Desktop .ChallengeCardHeader{margin-bottom:16px}.ChallengesListPopup.Tablet .ChallengeName,.ChallengesListPopup.Desktop .ChallengeName{line-height:27px;font-size:22px}.ChallengesListPopup.Tablet .ChallengeJoinButton,.ChallengesListPopup.Desktop .ChallengeJoinButton{min-width:100px;height:36px;font-size:16px}.ChallengesListPopup.Tablet .ChallengeCountdown,.ChallengesListPopup.Desktop .ChallengeCountdown{font-size:14px;line-height:14px}.ChallengesListPopup.Tablet .ChallengesTooltip,.ChallengesListPopup.Desktop .ChallengesTooltip{padding:60px 65px;font-size:16px;line-height:20px}.ChallengesListPopup.Tablet .ChallengesTooltip .ChallengesIconButton,.ChallengesListPopup.Desktop .ChallengesTooltip .ChallengesIconButton{top:24px;right:24px}";
|
|
179
|
+
|
|
180
|
+
const CasinoEngagementSuiteChallengesList = class {
|
|
181
|
+
constructor(hostRef) {
|
|
182
|
+
index.registerInstance(this, hostRef);
|
|
183
|
+
this.close = index.createEvent(this, "close", 7);
|
|
184
|
+
/**
|
|
185
|
+
* Client custom styling via string
|
|
186
|
+
*/
|
|
187
|
+
this.clientStyling = '';
|
|
188
|
+
/**
|
|
189
|
+
* Client custom styling via url
|
|
190
|
+
*/
|
|
191
|
+
this.clientStylingUrl = '';
|
|
192
|
+
/**
|
|
193
|
+
* Language of the widget
|
|
194
|
+
*/
|
|
195
|
+
this.language = 'en';
|
|
196
|
+
/**
|
|
197
|
+
* User's device type
|
|
198
|
+
*/
|
|
199
|
+
this.device = 'Mobile';
|
|
200
|
+
/**
|
|
201
|
+
* List of challenges
|
|
202
|
+
*/
|
|
203
|
+
this.challenges = [];
|
|
204
|
+
this.tooltip = false;
|
|
205
|
+
this.timers = {};
|
|
206
|
+
this.limitStylingAppends = false;
|
|
207
|
+
this.setClientStyling = () => {
|
|
208
|
+
let sheet = document.createElement('style');
|
|
209
|
+
sheet.innerHTML = this.clientStyling;
|
|
210
|
+
this.host.prepend(sheet);
|
|
211
|
+
};
|
|
212
|
+
this.setClientStylingURL = () => {
|
|
213
|
+
let url = new URL(this.clientStylingUrl);
|
|
214
|
+
let cssFile = document.createElement('style');
|
|
215
|
+
fetch(url.href)
|
|
216
|
+
.then((res) => res.text())
|
|
217
|
+
.then((data) => {
|
|
218
|
+
cssFile.innerHTML = data;
|
|
219
|
+
setTimeout(() => { this.host.prepend(cssFile); }, 1);
|
|
220
|
+
})
|
|
221
|
+
.catch((err) => {
|
|
222
|
+
console.log('Error ', err);
|
|
223
|
+
});
|
|
224
|
+
};
|
|
225
|
+
this.handleCloseClick = () => {
|
|
226
|
+
this.close.emit();
|
|
227
|
+
this.tooltip = false;
|
|
228
|
+
};
|
|
229
|
+
this.handleChallengeClick = (ev) => {
|
|
230
|
+
const id = +ev.currentTarget.getAttribute('data-id');
|
|
231
|
+
window.postMessage({ type: 'ChallengeClick', id });
|
|
232
|
+
};
|
|
233
|
+
this.showTooltip = () => {
|
|
234
|
+
this.tooltip = true;
|
|
235
|
+
};
|
|
236
|
+
this.hideTooltip = () => {
|
|
237
|
+
this.tooltip = false;
|
|
238
|
+
};
|
|
239
|
+
this.changeChallengeStatus = (e) => {
|
|
240
|
+
e.stopPropagation();
|
|
241
|
+
const id = +e.currentTarget.getAttribute('data-id');
|
|
242
|
+
const inProgressChallenges = this.challenges.filter(c => c.Status === ChallengeProgressStatus.InProgress).map(c => c.Id);
|
|
243
|
+
if (inProgressChallenges.includes(id)) {
|
|
244
|
+
window.postMessage({
|
|
245
|
+
type: 'ShowConfirmationModal',
|
|
246
|
+
action: 'unjoin',
|
|
247
|
+
id,
|
|
248
|
+
});
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
if ((inProgressChallenges === null || inProgressChallenges === void 0 ? void 0 : inProgressChallenges.length) > 0) {
|
|
252
|
+
window.postMessage({
|
|
253
|
+
type: 'ShowConfirmationModal',
|
|
254
|
+
action: 'join',
|
|
255
|
+
prevId: inProgressChallenges[0],
|
|
256
|
+
id,
|
|
257
|
+
});
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
window.postMessage({
|
|
261
|
+
type: 'ChallengeAttendance',
|
|
262
|
+
confirmationData: {
|
|
263
|
+
action: 'join',
|
|
264
|
+
id,
|
|
265
|
+
},
|
|
266
|
+
});
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
challengesPropHandler(value) {
|
|
270
|
+
if (!this.interval && value.length) {
|
|
271
|
+
this.updateTimers();
|
|
272
|
+
this.startCountdown();
|
|
273
|
+
}
|
|
274
|
+
if (this.interval && !value.length) {
|
|
275
|
+
clearInterval(this.interval);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
handleEvent(e) {
|
|
279
|
+
const newChallenge = e.data.data;
|
|
280
|
+
if (e.data.type === 'ChallengeGrant') {
|
|
281
|
+
const index = this.challenges.findIndex(challenge => differenceInSeconds(new Date(challenge.ExpirationTime), new Date(newChallenge.ExpirationTime)) > 0);
|
|
282
|
+
if (index > -1) {
|
|
283
|
+
this.challenges.splice(index, 0, newChallenge);
|
|
284
|
+
}
|
|
285
|
+
else {
|
|
286
|
+
this.challenges.unshift(newChallenge);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
componentWillLoad() {
|
|
291
|
+
this.challengesPropHandler(this.challenges);
|
|
292
|
+
}
|
|
293
|
+
componentDidRender() {
|
|
294
|
+
if (!this.limitStylingAppends && this.host) {
|
|
295
|
+
if (this.clientStyling)
|
|
296
|
+
this.setClientStyling();
|
|
297
|
+
if (this.clientStylingUrl)
|
|
298
|
+
this.setClientStylingURL();
|
|
299
|
+
this.limitStylingAppends = true;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
disconnectedCallback() {
|
|
303
|
+
this.interval && clearInterval(this.interval);
|
|
304
|
+
}
|
|
305
|
+
startCountdown() {
|
|
306
|
+
this.interval = setInterval(() => {
|
|
307
|
+
this.updateTimers();
|
|
308
|
+
}, 1000);
|
|
309
|
+
}
|
|
310
|
+
updateTimers() {
|
|
311
|
+
const now = new Date().getTime();
|
|
312
|
+
this.timers = this.challenges.filter(challenge => challenge.Status !== ChallengeProgressStatus.Expired).reduce((acc, challenge) => {
|
|
313
|
+
const expirationDate = new Date(challenge.ExpirationTime).getTime();
|
|
314
|
+
const diff = expirationDate - now;
|
|
315
|
+
let countdown = '00h:00m:00s';
|
|
316
|
+
if (diff < 1) {
|
|
317
|
+
this.removeChallenge(challenge.Id);
|
|
318
|
+
}
|
|
319
|
+
else {
|
|
320
|
+
const { days, hours, minutes, seconds } = {
|
|
321
|
+
days: String(Math.floor(diff / (1000 * 60 * 60 * 24))).padStart(2, '0'),
|
|
322
|
+
hours: String(Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))).padStart(2, '0'),
|
|
323
|
+
minutes: String(Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60))).padStart(2, '0'),
|
|
324
|
+
seconds: String(Math.floor((diff % (1000 * 60)) / 1000)).padStart(2, '0')
|
|
325
|
+
};
|
|
326
|
+
countdown = days === '00'
|
|
327
|
+
? `${hours}h:${minutes}m:${seconds}s`
|
|
328
|
+
: `${days}d:${hours}h:${minutes}m`;
|
|
329
|
+
}
|
|
330
|
+
return Object.assign(Object.assign({}, acc), { [challenge.Id]: countdown });
|
|
331
|
+
}, {});
|
|
332
|
+
}
|
|
333
|
+
removeChallenge(id) {
|
|
334
|
+
const index = this.challenges.findIndex(challenge => challenge.Id === id);
|
|
335
|
+
if (index > -1) {
|
|
336
|
+
this.challenges.splice(index, 1);
|
|
337
|
+
window.postMessage({ type: 'ChallengeHasExpired', id });
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
getChallengeClasses(challenge) {
|
|
341
|
+
return {
|
|
342
|
+
ChallengeCard: true,
|
|
343
|
+
InProgress: challenge.Status === ChallengeProgressStatus.InProgress,
|
|
344
|
+
Completed: this.isChallengeCompleted(challenge),
|
|
345
|
+
Paused: this.isChallengePaused(challenge)
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
isChallengePaused(challenge) {
|
|
349
|
+
return challenge.Status === ChallengeProgressStatus.Started
|
|
350
|
+
&& challenge.LevelProgresses[0].ProgressPercentage > 0;
|
|
351
|
+
}
|
|
352
|
+
isChallengeCompleted(challenge) {
|
|
353
|
+
return challenge.Status === ChallengeProgressStatus.Completed
|
|
354
|
+
|| (challenge.Status === ChallengeProgressStatus.PendingLevelReward
|
|
355
|
+
&& challenge.LevelProgresses.every(progress => progress.ProgressPercentage === 100));
|
|
356
|
+
}
|
|
357
|
+
getChallengeProgress(challenge) {
|
|
358
|
+
if (challenge.Status === ChallengeProgressStatus.Completed) {
|
|
359
|
+
return 100;
|
|
360
|
+
}
|
|
361
|
+
if (this.isChallengePaused(challenge)
|
|
362
|
+
|| challenge.Status === ChallengeProgressStatus.PendingLevelReward
|
|
363
|
+
|| challenge.Status === ChallengeProgressStatus.InProgress) {
|
|
364
|
+
const activeLevel = challenge.LevelProgresses
|
|
365
|
+
.find(level => level.ProgressStatus === ChallengeLevelProgressStatus.InProgress);
|
|
366
|
+
/**
|
|
367
|
+
* It is possible that Paused/InProgress challenge
|
|
368
|
+
* doesn't have InProgress level
|
|
369
|
+
* because level becomes InProgress after user's bet.
|
|
370
|
+
* In this case should be displayed progress of the next level (0%)
|
|
371
|
+
*/
|
|
372
|
+
return activeLevel ? activeLevel.ProgressPercentage : 0;
|
|
373
|
+
}
|
|
374
|
+
return -1;
|
|
375
|
+
}
|
|
376
|
+
getChallengeHeaderTemplate(challenge) {
|
|
377
|
+
const { Id } = challenge;
|
|
378
|
+
return index.h("div", { class: "ChallengeCardHeader" }, index.h("div", { class: "ChallengeName" }, challenge.ChallengePresentation.PresentationName), index.h("button", { class: challenge.Status === ChallengeProgressStatus.InProgress ? 'ChallengeJoinButton Joined' : 'ChallengeJoinButton', onClick: this.changeChallengeStatus, "data-id": Id }, challenge.Status === ChallengeProgressStatus.InProgress
|
|
379
|
+
? translate('unjoin', this.language)
|
|
380
|
+
: translate('join', this.language)));
|
|
381
|
+
}
|
|
382
|
+
getChallengeTemplate(challenge) {
|
|
383
|
+
const challengeProgress = this.getChallengeProgress(challenge);
|
|
384
|
+
const countdown = this.timers[challenge.Id];
|
|
385
|
+
const progressTemplate = challengeProgress > -1
|
|
386
|
+
? index.h("casino-engagement-suite-progress-bar", { class: this.device, value: challengeProgress, disabled: this.isChallengePaused(challenge) }, index.h("span", { slot: "Title", class: "ChallengeCountdown" }, countdown))
|
|
387
|
+
: index.h("span", { class: "ChallengeCountdown" }, countdown);
|
|
388
|
+
return (index.h("div", { class: this.getChallengeClasses(challenge), onClick: this.handleChallengeClick, key: challenge.Id, "data-id": challenge.Id }, this.getChallengeHeaderTemplate(challenge), progressTemplate));
|
|
389
|
+
}
|
|
390
|
+
getHeaderTemplate() {
|
|
391
|
+
return index.h("header", { class: "ChallengesListPopupHeader" }, index.h("button", { onClick: this.showTooltip, class: "ChallengesIconButton" }, index.h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/help.svg", alt: "Show tooltip" })), index.h("div", { class: "ChallengesListPopupHeaderName" }, translate('challenges', this.language)), index.h("button", { class: "ChallengesIconButton", onClick: this.handleCloseClick }, index.h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", alt: "Close challenges list" })));
|
|
392
|
+
}
|
|
393
|
+
getListTemplate() {
|
|
394
|
+
if (this.challenges.length) {
|
|
395
|
+
return index.h("div", { class: "ChallengesListWrapper" }, index.h("div", { class: "ChallengesList" }, this.challenges.map(challenge => this.getChallengeTemplate(challenge))));
|
|
396
|
+
}
|
|
397
|
+
else {
|
|
398
|
+
return index.h("div", { class: "ChallengesListEmpty" }, index.h("h2", null, translate('noChallenges', this.language)), index.h("p", null, translate('tryOtherGames', this.language)));
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
getTooltipTemplate() {
|
|
402
|
+
if (this.tooltip) {
|
|
403
|
+
return index.h("div", { class: "ChallengesTooltipBackdrop" }, index.h("div", { class: "ChallengesTooltip" }, index.h("button", { class: "ChallengesIconButton", onClick: this.hideTooltip }, index.h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", alt: "Close tooltip" })), translate('tooltip', this.language)));
|
|
404
|
+
}
|
|
405
|
+
else {
|
|
406
|
+
return '';
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
render() {
|
|
410
|
+
return index.h("div", { class: `ChallengesListPopup ${this.device}` }, this.getHeaderTemplate(), this.getListTemplate(), this.getTooltipTemplate());
|
|
411
|
+
}
|
|
412
|
+
get host() { return index.getElement(this); }
|
|
413
|
+
static get watchers() { return {
|
|
414
|
+
"challenges": ["challengesPropHandler"]
|
|
415
|
+
}; }
|
|
416
|
+
};
|
|
417
|
+
CasinoEngagementSuiteChallengesList.style = casinoEngagementSuiteChallengesListCss;
|
|
418
|
+
|
|
419
|
+
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}.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)}";
|
|
420
|
+
|
|
421
|
+
const CasinoEngagementSuiteProgressBar = class {
|
|
422
|
+
constructor(hostRef) {
|
|
423
|
+
index.registerInstance(this, hostRef);
|
|
424
|
+
/**
|
|
425
|
+
* Value for the widget
|
|
426
|
+
*/
|
|
427
|
+
this.value = 0;
|
|
428
|
+
/**
|
|
429
|
+
* Shows disabled styles
|
|
430
|
+
*/
|
|
431
|
+
this.disabled = false;
|
|
432
|
+
/**
|
|
433
|
+
* Client custom styling via string
|
|
434
|
+
*/
|
|
435
|
+
this.clientStyling = '';
|
|
436
|
+
/**
|
|
437
|
+
* Client custom styling via url
|
|
438
|
+
*/
|
|
439
|
+
this.clientStylingUrl = '';
|
|
440
|
+
this.limitStylingAppends = false;
|
|
441
|
+
this.setClientStyling = () => {
|
|
442
|
+
let sheet = document.createElement('style');
|
|
443
|
+
sheet.innerHTML = this.clientStyling;
|
|
444
|
+
this.host.prepend(sheet);
|
|
445
|
+
};
|
|
446
|
+
this.setClientStylingURL = () => {
|
|
447
|
+
let url = new URL(this.clientStylingUrl);
|
|
448
|
+
let cssFile = document.createElement('style');
|
|
449
|
+
fetch(url.href)
|
|
450
|
+
.then((res) => res.text())
|
|
451
|
+
.then((data) => {
|
|
452
|
+
cssFile.innerHTML = data;
|
|
453
|
+
setTimeout(() => { this.host.prepend(cssFile); }, 1);
|
|
454
|
+
})
|
|
455
|
+
.catch((err) => {
|
|
456
|
+
console.log('Error ', err);
|
|
457
|
+
});
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
componentDidRender() {
|
|
461
|
+
if (!this.limitStylingAppends && this.host) {
|
|
462
|
+
if (this.clientStyling)
|
|
463
|
+
this.setClientStyling();
|
|
464
|
+
if (this.clientStylingUrl)
|
|
465
|
+
this.setClientStylingURL();
|
|
466
|
+
this.limitStylingAppends = true;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
getProgressBarClasses() {
|
|
470
|
+
return {
|
|
471
|
+
ProgressBar: true,
|
|
472
|
+
Completed: this.value === 100,
|
|
473
|
+
Disabled: this.disabled
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
render() {
|
|
477
|
+
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 + '%' } })));
|
|
478
|
+
}
|
|
479
|
+
get host() { return index.getElement(this); }
|
|
480
|
+
};
|
|
481
|
+
CasinoEngagementSuiteProgressBar.style = casinoEngagementSuiteProgressBarCss;
|
|
482
|
+
|
|
483
|
+
exports.casino_engagement_suite_challenges_list = CasinoEngagementSuiteChallengesList;
|
|
484
|
+
exports.casino_engagement_suite_progress_bar = CasinoEngagementSuiteProgressBar;
|
|
@@ -279,6 +279,31 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
279
279
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
280
280
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
281
281
|
}
|
|
282
|
+
else if (memberName === 'style') {
|
|
283
|
+
// update style attribute, css properties and values
|
|
284
|
+
{
|
|
285
|
+
for (const prop in oldValue) {
|
|
286
|
+
if (!newValue || newValue[prop] == null) {
|
|
287
|
+
if (prop.includes('-')) {
|
|
288
|
+
elm.style.removeProperty(prop);
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
elm.style[prop] = '';
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
for (const prop in newValue) {
|
|
297
|
+
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
298
|
+
if (prop.includes('-')) {
|
|
299
|
+
elm.style.setProperty(prop, newValue[prop]);
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
elm.style[prop] = newValue[prop];
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
282
307
|
else if (memberName === 'key')
|
|
283
308
|
;
|
|
284
309
|
else if ((!isProp ) &&
|
|
@@ -547,11 +572,14 @@ const patch = (oldVNode, newVNode) => {
|
|
|
547
572
|
const elm = (newVNode.$elm$ = oldVNode.$elm$);
|
|
548
573
|
const oldChildren = oldVNode.$children$;
|
|
549
574
|
const newChildren = newVNode.$children$;
|
|
575
|
+
const tag = newVNode.$tag$;
|
|
550
576
|
const text = newVNode.$text$;
|
|
551
577
|
if (text === null) {
|
|
552
578
|
// element node
|
|
553
579
|
{
|
|
554
|
-
|
|
580
|
+
if (tag === 'slot')
|
|
581
|
+
;
|
|
582
|
+
else {
|
|
555
583
|
// either this is the first render of an element OR it's an update
|
|
556
584
|
// AND we already know it's possible it could have changed
|
|
557
585
|
// this updates the element's css classes, attrs, props, listeners, etc.
|
|
@@ -819,6 +847,15 @@ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
|
|
|
819
847
|
const parsePropertyValue = (propValue, propType) => {
|
|
820
848
|
// ensure this value is of the correct prop type
|
|
821
849
|
if (propValue != null && !isComplexType(propValue)) {
|
|
850
|
+
if (propType & 4 /* Boolean */) {
|
|
851
|
+
// per the HTML spec, any string value means it is a boolean true value
|
|
852
|
+
// but we'll cheat here and say that the string "false" is the boolean false
|
|
853
|
+
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
854
|
+
}
|
|
855
|
+
if (propType & 2 /* Number */) {
|
|
856
|
+
// force it to be a number
|
|
857
|
+
return parseFloat(propValue);
|
|
858
|
+
}
|
|
822
859
|
if (propType & 1 /* String */) {
|
|
823
860
|
// could have been passed as a number or boolean
|
|
824
861
|
// but we still want it as a string
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-0a011384.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-
|
|
17
|
+
return index.bootstrapLazy([["casino-engagement-suite-challenges-list_2.cjs",[[1,"casino-engagement-suite-challenges-list",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[1],"device":[1],"challenges":[1040],"tooltip":[32],"timers":[32],"limitStylingAppends":[32]},[[8,"message","handleEvent"]]],[1,"casino-engagement-suite-progress-bar",{"value":[2],"disabled":[4],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"limitStylingAppends":[32]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|