@everymatrix/casino-engagement-suite-container 1.37.8 → 1.37.10

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.
@@ -1 +1 @@
1
- import{p as e,b as n}from"./p-ae874bf6.js";(()=>{const n=import.meta.url,i={};return""!==n&&(i.resourcesUrl=new URL(".",n).href),e(i)})().then((e=>n([["p-b595a20a",[[1,"casino-engagement-suite-container",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[1],orientation:[32],device:[32],showChallengesList:[32],showFreeSpinsList:[32],showJackpotsList:[32],showChallengeDetails:[32],showFreeSpinsDetails:[32],showJackpotDetails:[32],challengePercent:[32],limitStylingAppends:[32],activeWidget:[32],challenges:[32],inProgressChallenges:[32],jackpots:[32],freeSpins:[32],gameSlug:[32],pausedChallengeIds:[32],isChallengeLabel:[32],isJoiningToChallenge:[32],selectedChallenge:[32],selectedJackpot:[32],selectedSpin:[32],selectedSpinId:[32],selectedChallengeId:[32],selectedJackpotId:[32],init:[64]},[[8,"message","handleEvent"]]],[1,"casino-engagement-suite-challenges-details",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],challenge:[16],inProgressChallenges:[16],language:[1],gameSlug:[1,"game-slug"],device:[1],isJoiningToChallenge:[1028,"is-joining-to-challenge"],pausedChallengeIds:[16],limitStylingAppends:[32],timer:[32],showDetails:[32],isExpiredChallenge:[32]}],[1,"casino-engagement-suite-challenges-list",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[1],device:[1],challenges:[1040],isJoiningToChallenge:[1028,"is-joining-to-challenge"],inProgressChallenges:[1040],pausedChallengeIds:[16],tooltip:[32],timers:[32],limitStylingAppends:[32],newChallengeIds:[32]},[[8,"message","handleEvent"]]],[1,"casino-engagement-suite-modal-container",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[1],isJoiningToChallenge:[1028,"is-joining-to-challenge"],device:[1],limitStylingAppends:[32],openModals:[32],rewardMessage:[32],hasError:[32],confirmationData:[32],winAmount:[32]},[[16,"openModal","openModalHandler"],[16,"closeModal","closeModalHandler"]]],[1,"casino-engagement-suite-bar",{activeWidget:[1537,"active-widget"],challengePercent:[1,"challenge-percent"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],orientation:[1],device:[1],isChallengeLabel:[4,"is-challenge-label"],language:[1],jackpots:[16],freeSpins:[16],limitStylingAppends:[32],activeJackpot:[32]}],[1,"casino-engagement-suite-free-spins-details",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],spin:[1040],inProgressChallenges:[16],language:[1],gameSlug:[1,"game-slug"],device:[1],isJoiningToChallenge:[1028,"is-joining-to-challenge"],limitStylingAppends:[32],timer:[32],showDetails:[32],isExpiredChallenge:[32],activeTab:[32],visibleGames:[32]}],[1,"casino-engagement-suite-free-spins-list",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[1],device:[1],freeSpins:[1040],tooltip:[32],timers:[32],limitStylingAppends:[32],newSpinIds:[32]}],[1,"casino-engagement-suite-jackpot-details",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],jackpot:[16],language:[1],gameSlug:[1,"game-slug"],device:[1],limitStylingAppends:[32],timer:[32],disabledStatus:[32],activeTab:[32],visibleGames:[32],loading:[32],enabled:[32],balance:[32],winBalance:[32],showDetails:[32]},[[8,"message","handleEvent"],[9,"resize","handleResize"]]],[1,"casino-engagement-suite-jackpots-list",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[1],device:[1],jackpots:[1040],buttonsLoadingStates:[1040],tooltip:[32],timers:[32],limitStylingAppends:[32]},[[8,"message","handleEvent"]]],[1,"casino-engagement-suite-modal",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],isOpen:[4,"is-open"],isLoading:[1028,"is-loading"],header:[1],contentIcon:[1,"content-icon"],modalType:[1,"modal-type"],device:[1],showAnimation:[4,"show-animation"],limitStylingAppends:[32]}],[1,"casino-engagement-suite-progress-bar",{value:[2],disabled:[4],hidePercent:[4,"hide-percent"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],limitStylingAppends:[32]}]]]],e)));
1
+ import{p as e,b as n}from"./p-ae874bf6.js";(()=>{const n=import.meta.url,i={};return""!==n&&(i.resourcesUrl=new URL(".",n).href),e(i)})().then((e=>n([["p-38f8acbb",[[1,"casino-engagement-suite-container",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[1],orientation:[32],device:[32],showChallengesList:[32],showFreeSpinsList:[32],showJackpotsList:[32],showChallengeDetails:[32],showFreeSpinsDetails:[32],showJackpotDetails:[32],challengePercent:[32],limitStylingAppends:[32],activeWidget:[32],challenges:[32],inProgressChallenges:[32],jackpots:[32],freeSpins:[32],gameSlug:[32],pausedChallengeIds:[32],isChallengeLabel:[32],isJoiningToChallenge:[32],selectedChallenge:[32],selectedJackpot:[32],selectedSpin:[32],selectedSpinId:[32],selectedChallengeId:[32],selectedJackpotId:[32],init:[64]},[[8,"message","handleEvent"]]],[1,"casino-engagement-suite-challenges-details",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],challenge:[16],inProgressChallenges:[16],language:[1],gameSlug:[1,"game-slug"],device:[1],isJoiningToChallenge:[1028,"is-joining-to-challenge"],pausedChallengeIds:[16],limitStylingAppends:[32],timer:[32],showDetails:[32],isExpiredChallenge:[32]}],[1,"casino-engagement-suite-challenges-list",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[1],device:[1],challenges:[1040],isJoiningToChallenge:[1028,"is-joining-to-challenge"],inProgressChallenges:[1040],pausedChallengeIds:[16],tooltip:[32],timers:[32],limitStylingAppends:[32],newChallengeIds:[32]},[[8,"message","handleEvent"]]],[1,"casino-engagement-suite-modal-container",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[1],isJoiningToChallenge:[1028,"is-joining-to-challenge"],device:[1],limitStylingAppends:[32],openModals:[32],rewardMessage:[32],hasError:[32],confirmationData:[32],winAmount:[32]},[[16,"openModal","openModalHandler"],[16,"closeModal","closeModalHandler"]]],[1,"casino-engagement-suite-bar",{activeWidget:[1537,"active-widget"],challengePercent:[1,"challenge-percent"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],orientation:[1],device:[1],isChallengeLabel:[4,"is-challenge-label"],language:[1],jackpots:[16],freeSpins:[16],limitStylingAppends:[32],activeJackpot:[32]}],[1,"casino-engagement-suite-free-spins-details",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],spin:[1040],inProgressChallenges:[16],language:[1],gameSlug:[1,"game-slug"],device:[1],isJoiningToChallenge:[1028,"is-joining-to-challenge"],limitStylingAppends:[32],timer:[32],showDetails:[32],isExpiredChallenge:[32],activeTab:[32],visibleGames:[32]}],[1,"casino-engagement-suite-free-spins-list",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[1],device:[1],freeSpins:[1040],tooltip:[32],timers:[32],limitStylingAppends:[32],newSpinIds:[32]}],[1,"casino-engagement-suite-jackpot-details",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],jackpot:[16],language:[1],gameSlug:[1,"game-slug"],device:[1],limitStylingAppends:[32],timer:[32],disabledStatus:[32],activeTab:[32],visibleGames:[32],loading:[32],enabled:[32],balance:[32],winBalance:[32],showDetails:[32]},[[8,"message","handleEvent"],[9,"resize","handleResize"]]],[1,"casino-engagement-suite-jackpots-list",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[1],device:[1],jackpots:[1040],buttonsLoadingStates:[1040],tooltip:[32],timers:[32],limitStylingAppends:[32]},[[8,"message","handleEvent"]]],[1,"casino-engagement-suite-modal",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],isOpen:[4,"is-open"],isLoading:[1028,"is-loading"],header:[1],contentIcon:[1,"content-icon"],modalType:[1,"modal-type"],device:[1],showAnimation:[4,"show-animation"],limitStylingAppends:[32]}],[1,"casino-engagement-suite-progress-bar",{value:[2],disabled:[4],hidePercent:[4,"hide-percent"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],limitStylingAppends:[32]}]]]],e)));
@@ -0,0 +1 @@
1
+ import{r as e,h as t,c as i,g as s}from"./p-ae874bf6.js";const o=["en"],a={en:{new:"new"}},n=class{constructor(t){e(this,t),this.clientStyling="",this.clientStylingUrl="",this.orientation="Landscape",this.device="Mobile",this.isChallengeLabel=!1,this.language="en",this.jackpots=[],this.freeSpins={},this.limitStylingAppends=!1,this.activeJackpot="",this.handleTileClick=e=>{const t=e.target.getAttribute("data-app");window.postMessage({type:`Bar${t}Click`}),this.activeWidget=t,"Jackpots"===t&&(this.activeJackpot=e.target.getAttribute("data-type"))},this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.engagementSuiteBar.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.engagementSuiteBar.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))}}componentDidRender(){!this.limitStylingAppends&&this.engagementSuiteBar&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}getChallengeTile(){return t("button",{class:"Tile Reward Challenges "+("Challenges"===this.activeWidget?"Active":""),"data-app":"Challenges",onClick:this.handleTileClick},t("div",{class:"RewardIcon"}),t("span",null,this.challengePercent),t("div",{class:"ChallengeLabel "+(this.isChallengeLabel?"ShowChallengeLabel":"")},t("span",null,(()=>{const e=this.language;return a[void 0!==e&&o.includes(e)?e:"en"].new})())))}getFreeSpinsTile(){const{TotalNumberOfFreeSpins:e,TotalNumberOfUsedFreeSpins:i}=this.freeSpins,s=e-i;return t("button",{class:"Tile Reward FreeSpins "+("FreeSpins"===this.activeWidget?"Active":""),"data-app":"FreeSpins",onClick:this.handleTileClick},t("div",{class:"RewardIcon"}),t("span",null,"number"!=typeof s||s<0?"":s))}getJackpotClasses(e){return{Tile:!0,Jackpot:!0,Enabled:e.Enabled,Active:"Jackpots"===this.activeWidget&&this.activeJackpot===e.Type,[e.Type.charAt(0).toUpperCase()+e.Type.slice(1)]:!0}}getJackpotsTemplate(){return this.jackpots.map((e=>{const i=function(e,t,i=99999999){return e=Math.min(e,i),`${t} ${new Intl.NumberFormat("en",{minimumFractionDigits:2,maximumFractionDigits:2}).format(e)}`}(e.WinBalance||e.Balance,e.Currency);return t("div",{class:this.getJackpotClasses(e),"data-app":"Jackpots","data-type":e.Type,onClick:this.handleTileClick},t("div",{class:"JackpotType"},e.Type),t("span",{class:"JackpotBalance"},i))}))}render(){return t("div",{class:`CasinoEngagementSuiteBar ${this.orientation} ${this.device}`,ref:e=>this.engagementSuiteBar=e},t("div",{class:"EngagementSuiteContainer"},!!this.jackpots.length&&this.getJackpotsTemplate(),this.challengePercent&&this.getChallengeTile(),this.freeSpins&&this.getFreeSpinsTile()))}};n.style=':host{display:block}*{box-sizing:border-box}.CasinoEngagementSuiteBar{height:100vh;background-color:var(--emw--color-background, #1E1638);color:var(--emw--color-typography, #FFF);display:flex;justify-content:center;position:relative;z-index:1}.CasinoEngagementSuiteBar .EngagementSuiteContainer{display:flex;align-items:center;gap:4px;scrollbar-gutter:stable;overflow-x:auto;padding:0 9px;width:100%}.CasinoEngagementSuiteBar .EngagementSuiteContainer::-webkit-scrollbar{width:3px;background:none}.CasinoEngagementSuiteBar .EngagementSuiteContainer::-webkit-scrollbar-thumb{border-radius:4px;background:var(--emw--color-gray-transparency-30, rgba(255, 255, 255, 0.3))}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Tile{cursor:pointer;background-color:var(--emw--color-primary, #251D3E);border-radius:var(--emw--border-radius-medium, 4px);display:flex;flex-direction:row;align-items:center;justify-content:center;position:relative;font-weight:var(--emw--font-weight-semibold, 600);font-size:var(--emw--font-size-x-small, 12px);font-family:"Montserrat", sans-serif;color:var(--emw--color-typography, #FFF)}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Tile.Active::before{background:linear-gradient(143.2deg, #FF9401 -0.41%, #FFD32D 45.61%, #2D2545 82.77%)}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Tile::before{content:"";position:absolute;inset:0;border-radius:var(--emw--border-radius-medium, 4px);padding:1px;background:linear-gradient(0deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.1) 100%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Jackpot{padding:14px 8px;flex-direction:column}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Jackpot .JackpotType{display:none}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Jackpot .JackpotBalance{font-weight:var(--emw--font-weight-semibold, 600);line-height:12px;font-size:12px;color:var(--emw--color-typography, #fff)}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Jackpot.Enabled.Mega .JackpotBalance{background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);-webkit-text-fill-color:transparent;-webkit-background-clip:text}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Jackpot.Enabled.Major .JackpotBalance{background:linear-gradient(180deg, #A19FA0 5.36%, #E1DBDB 28.86%, #FEFFFF 36.86%, #E1DBDB 44.36%, #5E5B5F 91.86%);-webkit-text-fill-color:transparent;-webkit-background-clip:text}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Jackpot.Enabled.Minor .JackpotBalance{background:linear-gradient(180deg, #A0522C 5.36%, #FFAB8C 28.86%, #FFEEDF 36.86%, #FFAB8C 44.36%, #6A3A21 91.86%);-webkit-text-fill-color:transparent;-webkit-background-clip:text}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Jackpot.Enabled .JackpotBalance{font-weight:var(--emw--font-weight-bold, 800)}.CasinoEngagementSuiteBar .EngagementSuiteContainer .Reward{justify-content:space-between;padding:8px;border:none}.CasinoEngagementSuiteBar .EngagementSuiteContainer .RewardIcon{width:24px;height:24px;background-size:100%;background-position:center}.Tile.Leaderboard .RewardIcon{background:center/contain url("https://static.everymatrix.com/gic/img/engagement-suite/bar/leaderboard.svg")}.Tile.Leaderboard.Active .RewardIcon{background-image:url("https://static.everymatrix.com/gic/img/engagement-suite/bar/leaderboard-pressed.svg")}.Tile.Challenges .RewardIcon{background:center/contain url("https://static.everymatrix.com/gic/img/engagement-suite/bar/challenge.svg")}.Tile.Challenges.Active .RewardIcon{background-image:url("https://static.everymatrix.com/gic/img/engagement-suite/bar/challenge-pressed.svg")}.Tile.Luckywheel .RewardIcon{background:center/contain url("https://static.everymatrix.com/gic/img/engagement-suite/bar/luckywheel.svg")}.Tile.Luckywheel.Active .RewardIcon{background-image:url("https://static.everymatrix.com/gic/img/engagement-suite/bar/luckywheel-pressed.svg")}.Tile.FreeSpins .RewardIcon{background:center/contain url("https://static.everymatrix.com/gic/img/engagement-suite/bar/freespins.svg")}.Tile.FreeSpins.Active .RewardIcon{background-image:url("https://static.everymatrix.com/gic/img/engagement-suite/bar/freespins-pressed.svg")}.ChallengeLabel{min-width:23px;height:11px;background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);border-radius:2px;display:none;position:absolute;top:-4px;right:4px;padding:0 2px;align-items:center;justify-content:center}.ChallengeLabel span{display:inline-block;text-transform:uppercase;font-size:7px;line-height:7px;font-weight:700;font-family:"Montserrat", sans-serif;color:var(--emw--color-typography, #1E1638)}.ShowChallengeLabel{display:inline-flex}.Landscape.CasinoEngagementSuiteBar{width:152px;padding-top:16px;box-shadow:0 4px 4px 0 #00000040, 8px 0 10px 0 #0000004D}.Landscape.CasinoEngagementSuiteBar .EngagementSuiteContainer{flex-direction:column}.Landscape.CasinoEngagementSuiteBar .EngagementSuiteContainer .Tile{width:120px;height:40px}.Portrait.CasinoEngagementSuiteBar{border-radius:0 0 var(--emw--border-radius-medium, 4px) var(--emw--border-radius-medium, 4px);height:auto;padding:10px;box-shadow:0 4px 4px 0 #00000040, 8px 0 10px 0 #0000004D}.Portrait.CasinoEngagementSuiteBar .EngagementSuiteContainer{gap:8px;flex-wrap:wrap}.Portrait.CasinoEngagementSuiteBar .EngagementSuiteContainer .Tile{flex:1 1 0px;height:32px}.Portrait.CasinoEngagementSuiteBar .EngagementSuiteContainer .Jackpot{min-width:30%;padding:10px 8px}.Portrait.CasinoEngagementSuiteBar .EngagementSuiteContainer .Reward{min-width:20%;padding:4px 8px}.CasinoEngagementSuiteBar.Desktop.Landscape{width:252px}.CasinoEngagementSuiteBar.Desktop.Landscape .EngagementSuiteContainer{gap:12px}.CasinoEngagementSuiteBar.Desktop.Landscape .Reward{padding:8px 20px;height:64px;font-size:var(--emw--font-size-medium, 16px)}.CasinoEngagementSuiteBar.Desktop.Landscape .Reward .RewardIcon{width:48px;height:48px}.CasinoEngagementSuiteBar.Desktop.Landscape .Tile{width:212px}.CasinoEngagementSuiteBar.Desktop.Landscape .Jackpot{padding-top:35px;min-height:133px;background:center/contain url("https://static.everymatrix.com/gic/img/engagement-suite/bar/jackpot-bg-stars.svg")}.CasinoEngagementSuiteBar.Desktop.Landscape .Jackpot .JackpotType{display:block;font-weight:var(--emw--font-weight-bold, 800);margin-bottom:12px;text-transform:uppercase}.CasinoEngagementSuiteBar.Desktop.Landscape .Jackpot .JackpotType,.CasinoEngagementSuiteBar.Desktop.Landscape .Jackpot .JackpotBalance{font-size:var(--emw--size-large, 24px);line-height:24px}';const r=["en"],l={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"}},p=(e,t)=>{const i=t;return l[void 0!==i&&r.includes(i)?i:"en"][e]};var c,h;function d(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"}(c||(c={})),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"}(h||(h={}));const g=class{constructor(t){e(this,t),this.close=i(this,"close",7),this.back=i(this,"back",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.gameSlug="",this.device="Mobile",this.pausedChallengeIds=[],this.limitStylingAppends=!1,this.timer="",this.showDetails=!1,this.isExpiredChallenge=!1,this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))},this.handleCloseClick=()=>{this.close.emit()},this.handleBackClick=()=>{this.back.emit()},this.onGameClick=e=>{const t=e.currentTarget.getAttribute("data-slug");t&&window.postMessage({type:"EngagementSuiteGameRedirect",data:{Slug:t}})},this.changeChallengeStatus=e=>{var t,i;const s=e.currentTarget.getAttribute("data-id");(null===(t=this.inProgressChallenges)||void 0===t?void 0:t.includes(s))?window.postMessage({type:"ShowConfirmationModal",ProgressToDeactivate:s}):(null===(i=this.inProgressChallenges)||void 0===i?void 0:i.length)>0?window.postMessage({type:"ShowConfirmationModal",ProgressToActivate:s,ProgressToDeactivate:this.inProgressChallenges[0]}):window.postMessage({type:"ChallengeJoinRequest",data:{ProgressToActivate:s}})},this.toggle=()=>{this.showDetails=!this.showDetails}}challengePropHandler(e){!this.interval&&e&&(this.updateTimer(),this.startCountdown()),this.interval&&!e&&clearInterval(this.interval)}componentWillLoad(){this.challengePropHandler(this.challenge)}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}disconnectedCallback(){this.interval&&clearInterval(this.interval)}getActionsTemplate(){return t("header",{class:"ChallengeActions"},t("button",{class:"ChallengeIconButton",onClick:this.handleBackClick},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/back.svg",alt:"back"})),"Mobile"!==this.device&&t("div",{class:"ChallengePopupName"},p("challenges",this.language)),t("button",{class:"ChallengeIconButton",onClick:this.handleCloseClick},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"close"})))}getChallengeHeader(){const e=this.challenge.Status===h.InProgress||this.challenge.Status===h.PendingLevelReward;return t("div",{class:"ChallengeDetailsHeader"},t("span",{class:"ChallengeName"},this.challenge.ChallengePresentation.PresentationName),t("button",{onClick:this.changeChallengeStatus,class:`ChallengeJoinButton ${e?"Joined":""}\n ${this.isExpiredChallenge||this.isJoiningToChallenge?"Disabled":""}`,"data-id":this.challenge.Id},p(e?"unjoin":"join",this.language)))}getChallengeCountdown(){return t("div",{class:"ChallengeCountdown "+(this.isExpiredChallenge?"Expired":"")},this.isExpiredChallenge?"Expired":this.timer)}getChallengeDetails(){const e=this.challenge.ChallengePresentation.Description,i=this.challenge.ChallengePresentation.Url,s=this.challenge.Games;return t("div",{class:"CollapseDetails "+(this.showDetails?"ShowDetails":"")},e&&t("div",{class:"ChallengeDescription"},e),i&&t("div",{class:"TC"},t("a",{href:i,target:"_blank"},p("tc",this.language))),(null==s?void 0:s.length)&&t("div",{class:"ChallengeGames"},s.map((e=>t("div",{class:"Game",key:e.CasinoGameId},t("img",{src:e.GameIcon,alt:e.GameName,onClick:this.onGameClick,class:e.GameSlug===this.gameSlug?"Disabled":"","data-slug":e.GameSlug}))))))}startCountdown(){this.interval=setInterval((()=>{this.updateTimer()}),1e3)}updateTimer(){const e=new Date(this.challenge.ExpirationTime).getTime()-(new Date).getTime();if(e<1)return clearInterval(this.interval),this.timer="",void(this.isExpiredChallenge=!0);const{days:t,hours:i,minutes:s,seconds:o}={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?`${i}h:${s}m:${o}s`:`${t}d:${i}h:${s}m`}getLevelTarget(e){const i=d(e.DisplayCurrencyTargetTurnover,this.challenge.CurrencySymbol);let s=`${p("place",this.language)} ${i}`;return 1===e.LevelTargetType?s+=` ${p("bet",this.language)}`:2===e.LevelTargetType&&(s+=` ${p("bets",this.language)} X ${e.TargetBetCount}`),t("span",{class:"ChallengeLevelTarget"},s)}getLevelBetRangesDetails(e){var i,s,o,a;if(0===e.LevelTargetType){const n=d(null===(i=e.BetRange)||void 0===i?void 0:i.MinBet,this.challenge.CurrencySymbol),r=d(null===(s=e.BetRange)||void 0===s?void 0:s.MaxBet,this.challenge.CurrencySymbol),l=e.LevelContributionPercent+"%",c=!!(null===(o=e.BetRange)||void 0===o?void 0:o.MinBet),h=!!(null===(a=e.BetRange)||void 0===a?void 0:a.MaxBet),g=100!==e.LevelContributionPercent;if(c||h||g)return t("div",{class:"ChallengeLevelBetDetails"},c&&t("div",{class:"ChallengeLevelBetDetail"},t("span",null,p("minBet",this.language),": "),t("span",{class:"ChallengeLevelBetRange"},n)),h&&t("div",{class:"ChallengeLevelBetDetail"},t("span",null,p("maxBet",this.language),": "),t("span",{class:"ChallengeLevelBetRange"},r)),g&&t("div",{class:"ChallengeLevelBetDetail"},t("span",null,p("contribution",this.language),": "),t("span",{class:"ChallengeLevelBetContribution"},l)))}}getChallengeLevels(){const e=this.challenge.Status===h.Started&&this.challenge.LevelProgresses[0].ProgressPercentage>0||this.pausedChallengeIds.includes(this.challenge.ChallengeId),i=t=>"ChallengeLevelCard "+(1!==t.ProgressStatus||this.isExpiredChallenge||e?"":"InProgress");return t("div",{class:"ChallengeLevels"},this.challenge.LevelProgresses.map(((s,o)=>t("div",{class:i(s)},t("casino-engagement-suite-progress-bar",{class:this.device,value:s.ProgressPercentage,"hide-percent":0===s.ProgressPercentage||100===s.ProgressPercentage,disabled:this.isExpiredChallenge||e},t("span",{slot:"Title",class:"ChallengeLevelTitle"},t("span",null,"Level ",o+1,": "),this.getLevelTarget(s))),t("div",{class:"ChallengeRewardMessage"},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/reward.svg",alt:"win"}),t("span",null,p("win",this.language),": "),t("span",{class:"CustomRewardMessage"},s.CustomRewardMessage)),this.getLevelBetRangesDetails(s)))))}getToggleButton(){return t("div",{class:"ChallengeCollapseButton",onClick:this.toggle},t("span",{class:"Toggle "+(this.showDetails?"Closed":"Open")}),t("span",null,p("details",this.language)))}render(){return t("div",{class:`ChallengeDetailsPopup ${this.device}`},this.getActionsTemplate(),t("div",{class:"ChallengeDetails"},this.getChallengeHeader(),this.getChallengeCountdown(),this.getToggleButton(),this.getChallengeDetails(),this.getChallengeLevels()))}get host(){return s(this)}static get watchers(){return{challenge:["challengePropHandler"]}}};var u,m;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}',function(e){e[e.Closed=0]="Closed",e[e.InProgress=1]="InProgress",e[e.Fillup=2]="Fillup",e[e.Completed=3]="Completed"}(u||(u={})),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"}(m||(m={}));const b=["en"],x={en:{challenges:"Challenges",join:"Join",unjoin:"Unjoin",new:"new",noChallenges:"No Challenges yet",tryOtherGames:"Try winning Challenges as rewards or launching other booster games",tooltip:"Competition where your real money bets contribute towards the level progress to achieve the level reward"}},k=(e,t)=>{const i=t;return x[void 0!==i&&b.includes(i)?i:"en"][e]};function w(e){return(w="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 f(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function F(e){f(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===w(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 v(e,t){return f(2,arguments),F(e).getTime()-F(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 y(e){return e?C[e]:C.trunc}function D(e,t,i){f(2,arguments);var s=v(e,t)/1e3;return y(null==i?void 0:i.roundingMethod)(s)}const J=class{constructor(t){e(this,t),this.close=i(this,"close",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.device="Mobile",this.challenges=[],this.pausedChallengeIds=[],this.tooltip=!1,this.timers={},this.limitStylingAppends=!1,this.newChallengeIds=[],this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))},this.handleCloseClick=()=>{this.close.emit(),this.tooltip=!1,this.newChallengeIds=[]},this.handleChallengeClick=e=>{const t=e.currentTarget.getAttribute("data-id");window.postMessage({type:"ChallengeClick",id:t}),this.newChallengeIds=this.newChallengeIds.filter((e=>e!==t))},this.showTooltip=()=>{this.tooltip=!0},this.hideTooltip=()=>{this.tooltip=!1},this.changeChallengeStatus=e=>{var t,i;e.stopPropagation();const s=e.currentTarget.getAttribute("data-id");(null===(t=this.inProgressChallenges)||void 0===t?void 0:t.includes(s))?window.postMessage({type:"ShowConfirmationModal",ProgressToDeactivate:s}):(null===(i=this.inProgressChallenges)||void 0===i?void 0:i.length)>0?window.postMessage({type:"ShowConfirmationModal",ProgressToActivate:s,ProgressToDeactivate:this.inProgressChallenges[0]}):window.postMessage({type:"ChallengeJoinRequest",data:{ProgressToActivate:s}})}}challengesPropHandler(e){!this.interval&&e.length&&(this.updateTimers(),this.startCountdown()),this.interval&&!e.length&&clearInterval(this.interval)}handleEvent(e){switch(e.data.type){case"ChallengeGrant":{const t=e.data.data.challengeProgressData[0],i=this.challenges.findIndex((e=>D(new Date(e.ExpirationTime),new Date(t.ExpirationTime))>0));i>-1?this.challenges.splice(i,0,t):this.challenges.push(t),this.challenges=[...this.challenges],this.newChallengeIds.push(t.Id),window.postMessage({type:"UpdateChallenges"});break}}}componentWillLoad(){var e;this.challengesPropHandler(this.challenges),(null===(e=this.challenges)||void 0===e?void 0:e.length)&&(this.newChallengeIds=this.challenges.filter((e=>e.IsNew)).map((e=>e.Id)))}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}disconnectedCallback(){this.interval&&clearInterval(this.interval)}startCountdown(){this.interval=setInterval((()=>{this.updateTimers()}),1e3)}updateTimers(){const e=(new Date).getTime();this.timers=this.challenges.filter((e=>e.Status!==m.Expired)).reduce(((t,i)=>{const s=new Date(i.ExpirationTime).getTime()-e;let o="00h:00m:00s";if(s<1)this.removeChallenge(i.Id);else{const{days:e,hours:t,minutes:i,seconds:a}={days:String(Math.floor(s/864e5)).padStart(2,"0"),hours:String(Math.floor(s%864e5/36e5)).padStart(2,"0"),minutes:String(Math.floor(s%36e5/6e4)).padStart(2,"0"),seconds:String(Math.floor(s%6e4/1e3)).padStart(2,"0")};o="00"===e?`${t}h:${i}m:${a}s`:`${e}d:${t}h:${i}m`}return Object.assign(Object.assign({},t),{[i.Id]:o})}),{})}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===m.InProgress&&!this.pausedChallengeIds.includes(e.ChallengeId),Completed:this.isChallengeCompleted(e),Paused:this.isChallengePaused(e)}}isChallengePaused(e){return e.Status===m.Started&&e.LevelProgresses[0].ProgressPercentage>0||this.pausedChallengeIds.includes(e.ChallengeId)}isChallengeCompleted(e){return e.Status===m.Completed||e.Status===m.PendingLevelReward&&e.LevelProgresses.every((e=>100===e.ProgressPercentage))}getChallengeProgress(e){if(e.Status===m.Completed)return 100;if(this.isChallengePaused(e)||e.Status===m.PendingLevelReward||e.Status===m.InProgress){const t=e.LevelProgresses.find((e=>e.ProgressStatus===u.InProgress));return t?t.ProgressPercentage:0}return-1}getChallengeHeaderTemplate(e){const{Id:i}=e,s=e.Status===m.InProgress||e.Status===m.PendingLevelReward;return t("div",{class:"ChallengeCardHeader"},t("div",{class:"ChallengeName"},e.ChallengePresentation.PresentationName),t("button",{class:`${s?"ChallengeJoinButton Joined":"ChallengeJoinButton"} ${this.isJoiningToChallenge?"Disabled":""}`,onClick:this.changeChallengeStatus,"data-id":i},k(s?"unjoin":"join",this.language)))}getChallengeTemplate(e){const i=this.getChallengeProgress(e),s=this.timers[e.Id],o=this.newChallengeIds.includes(e.Id),a=i>-1?t("casino-engagement-suite-progress-bar",{class:this.device,value:i,disabled:this.isChallengePaused(e)},t("span",{slot:"Title",class:"ChallengeCountdown"},s)):t("span",{class:"ChallengeCountdown"},s);return t("div",{class:this.getChallengeClasses(e),onClick:this.handleChallengeClick,key:e.Id,"data-id":e.Id},this.getChallengeHeaderTemplate(e),a,t("div",{class:"ChallengeLabel "+(o?"ShowChallengeLabel":"")},t("span",null,k("new",this.language))))}getHeaderTemplate(){return t("header",{class:"ChallengesListPopupHeader"},t("button",{onClick:this.showTooltip,class:"ChallengesIconButton"},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/help.svg",alt:"Show tooltip"})),t("div",{class:"ChallengesListPopupHeaderName"},k("challenges",this.language)),t("button",{class:"ChallengesIconButton",onClick:this.handleCloseClick},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Close challenges list"})))}getListTemplate(){return this.challenges.length?t("div",{class:"ChallengesListWrapper"},t("div",{class:"ChallengesList"},this.challenges.map((e=>this.getChallengeTemplate(e))))):t("div",{class:"ChallengesListEmpty"},t("h2",null,k("noChallenges",this.language)),t("p",null,k("tryOtherGames",this.language)))}getTooltipTemplate(){return t("div",{class:"ChallengesTooltipBackdrop"},t("div",{class:"ChallengesTooltip"},t("button",{class:"ChallengesIconButton",onClick:this.hideTooltip},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Close tooltip"})),k("tooltip",this.language)))}render(){return t("div",{class:`ChallengesListPopup ${this.device}`},this.getHeaderTemplate(),this.getListTemplate(),this.tooltip&&this.getTooltipTemplate())}get host(){return s(this)}static get watchers(){return{challenges:["challengesPropHandler"]}}};var S,B;function P(){return window.screen.orientation.type.includes("portrait")?"Portrait":"Landscape"}J.style='@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@600&display=swap");:host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.ChallengesListPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative;padding-bottom:20px}.ChallengesListPopupHeader{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.ChallengesIconButton{width:16px;height:16px;cursor:pointer}.ChallengesListPopupHeaderName{color:var(--emw--color-gray-100, #BBB9C3);font-size:14px;font-weight:500;line-height:14px}.ChallengesListWrapper{overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.ChallengesListWrapper::-webkit-scrollbar{display:none}.ChallengesList{display:flex;flex-direction:column;row-gap:12px;padding:8px 19px 0}.ChallengeCard{padding:15px 15px 19px;border:1px solid var(--emw--button-border-color, #403956);border-radius:6px;position:relative;cursor:pointer}.ChallengeJoinButton.Joined::before,.ChallengeCard.InProgress::before{content:"";position:absolute;inset:0;border-radius:var(--emw--button-border-radius, 4px);padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.ChallengeCardHeader{display:flex;justify-content:space-between;gap:24px;margin-bottom:12px}.ChallengeName{color:var(--emw--color-typography, #FFFFFF);font-family:"Montserrat", sans-serif;line-height:22px;font-weight:700;font-size:18px;word-break:break-word}.ChallengeJoinButton{transition:all 0.5s ease-out;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:var(--emw--color-typography, #1E1638);border-radius:99px;min-width:88px;height:32px;font-size:14px;font-weight:700;position:relative;font-family:"Montserrat", sans-serif}.ChallengeJoinButton.Joined{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.ChallengeJoinButton.Joined::before{border-radius:99px}.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.ChallengesListEmpty{padding:20px 32px}.ChallengesListEmpty h2{margin:0 0 16px 0;text-align:center;font-weight:600;font-size:20px;line-height:24px;font-family:"Montserrat", sans-serif;color:var(--emw--color-typography, #FFFFFF)}.ChallengesListEmpty p{font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3)}.ChallengeCountdown{color:var(--emw--color-gray-100, #BBB9C3);font-size:12px;line-height:12px}.ChallengeLabel{min-width:35px;height:18px;background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);border-radius:2px;display:none;position:absolute;top:-11px;right:11px;padding:0 2px;align-items:center;justify-content:center}.ChallengeLabel span{display:inline-block;text-transform:uppercase;font-size:10px;line-height:10px;font-weight:700;font-family:"Montserrat", sans-serif;color:var(--emw--color-typography, #1E1638)}.ShowChallengeLabel{display:inline-flex}.ChallengesTooltipBackdrop{padding:48px 30px 0;position:absolute;width:100%;height:100%;inset:0;background-color:rgba(0, 0, 0, 0.5)}.ChallengesTooltipBackdrop .ChallengesTooltip{border:1px solid var(--emw--button-border-color, #403956);background-color:var(--emw--color-background, #1E1638);border-radius:8px;padding:32px;font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3);position:relative}.ChallengesTooltipBackdrop .ChallengesTooltip .ChallengesIconButton{top:12px;right:6px;position:absolute}.ChallengesListPopup.Tablet .ChallengesListPopupHeader,.ChallengesListPopup.Desktop .ChallengesListPopupHeader{padding-top:16px}.ChallengesListPopup.Tablet .ChallengesListPopupHeaderName,.ChallengesListPopup.Desktop .ChallengesListPopupHeaderName{font-size:16px;line-height:16px}.ChallengesListPopup.Tablet .ChallengesIconButton,.ChallengesListPopup.Desktop .ChallengesIconButton{width:24px;height:24px}.ChallengesListPopup.Tablet .ChallengesList,.ChallengesListPopup.Desktop .ChallengesList{padding:20px 24px 0;row-gap:20px}.ChallengesListPopup.Tablet .ChallengeCardHeader,.ChallengesListPopup.Desktop .ChallengeCardHeader{margin-bottom:16px}.ChallengesListPopup.Tablet .ChallengeName,.ChallengesListPopup.Desktop .ChallengeName{line-height:27px;font-size:22px}.ChallengesListPopup.Tablet .ChallengeJoinButton,.ChallengesListPopup.Desktop .ChallengeJoinButton{min-width:100px;height:36px;font-size:16px}.ChallengesListPopup.Tablet .ChallengeCountdown,.ChallengesListPopup.Desktop .ChallengeCountdown{font-size:14px;line-height:14px}.ChallengesListPopup.Tablet .ChallengesTooltip,.ChallengesListPopup.Desktop .ChallengesTooltip{padding:60px 65px;font-size:16px;line-height:20px}.ChallengesListPopup.Tablet .ChallengesTooltip .ChallengesIconButton,.ChallengesListPopup.Desktop .ChallengesTooltip .ChallengesIconButton{top:24px;right:24px}',"function"==typeof SuppressedError&&SuppressedError,function(e){e[e.Closed=0]="Closed",e[e.InProgress=1]="InProgress",e[e.Fillup=2]="Fillup",e[e.Completed=3]="Completed"}(S||(S={})),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"}(B||(B={}));const L=class{constructor(t){e(this,t),this.openModal=i(this,"openModal",7),this.closeModal=i(this,"closeModal",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.orientation="Landscape",this.device="Mobile",this.showChallengesList=!1,this.showFreeSpinsList=!1,this.showJackpotsList=!1,this.showChallengeDetails=!1,this.showFreeSpinsDetails=!1,this.showJackpotDetails=!1,this.limitStylingAppends=!1,this.jackpots=[],this.gameSlug="",this.pausedChallengeIds=[],this.isChallengeLabel=!1,this.isJoiningToChallenge=!1,this.handlePopupClose=(e,t)=>()=>{this[e]=!1,this[t]=!1,this.activeWidget=""},this.handleJackpotsPopupClose=()=>{this.showJackpotsList=!1,this.showJackpotDetails=!1,this.activeWidget=""},this.handleChallengePopupBack=()=>{this.showChallengeDetails=!1,this.showChallengesList=!0},this.handleJackpotPopupBack=()=>{this.showJackpotDetails=!1,this.showJackpotsList=!0},this.barHeight=0,this.orientationChangeHandler=()=>{this.orientation=P()},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)}))}}handleEvent(e){const t=null==e?void 0:e.data,{type:i}=t,s=function(e,t){var i={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(s=Object.getOwnPropertySymbols(e);o<s.length;o++)t.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(e,s[o])&&(i[s[o]]=e[s[o]])}return i}(t,["type"]);switch(i){case"ChallengeGrant":{const t=e.data.data.challengeProgressData[0],i=this.challenges.findIndex((e=>D(new Date(e.ExpirationTime),new Date(t.ExpirationTime))>0));i>-1?this.challenges.splice(i,0,t):this.challenges.push(t),this.challenges=[...this.challenges],this.setChallengeLabel();break}case"ChallengeHasExpired":this.setChallengePercent();break;case"BarChallengesClick":this.showChallengesList=!0,this.showFreeSpinsList=!1,this.showJackpotsList=!1,this.showChallengeDetails=!1,this.showJackpotDetails=!1,this.showFreeSpinsDetails=!1,this.activeWidget="Challenges",this.isChallengeLabel=!1;break;case"BarFreeSpinsClick":this.showFreeSpinsList=!0,this.showChallengesList=!1,this.showJackpotsList=!1,this.showChallengeDetails=!1,this.showJackpotDetails=!1,this.showFreeSpinsDetails=!1,this.activeWidget="FreeSpins";break;case"BarJackpotsClick":this.showJackpotsList=!0,this.showFreeSpinsList=!1,this.showChallengesList=!1,this.showChallengeDetails=!1,this.showJackpotDetails=!1,this.showFreeSpinsDetails=!1,this.activeWidget="Jackpots";break;case"ChallengeClick":this.selectedChallengeId=e.data.id,this.selectedChallenge=this.challenges.find((e=>e.Id===this.selectedChallengeId)),this.showChallengesList=!1,this.showChallengeDetails=!0;break;case"FreeSpinClick":this.selectedSpinId=e.data.id,this.selectedSpin=this.freeSpins.VendorFreeSpins.find((e=>e.Id===this.selectedSpinId)),this.showFreeSpinsList=!1,this.showFreeSpinsDetails=!0;break;case"JackpotClick":this.selectedJackpotId=e.data.id,this.selectedJackpot=this.jackpots.find((e=>e.JackpotId===this.selectedJackpotId)),this.showJackpotsList=!1,this.showJackpotDetails=!0;break;case"UpdateChallengeProgress":this.updateChallengeProgress(e.data.data);break;case"ChallengeChangeStatusNotification":{const{IsEnabled:t,ChallengeId:i}=e.data.data;this.pausedChallengeIds=t?this.pausedChallengeIds.filter((e=>e!==i)):[...this.pausedChallengeIds,i];break}case"ShowChallengeRewardModal":{const{ChallengeId:e,LevelId:t,HasError:i,ProcessedRewards:o}=s.data,a={modalType:(null==o?void 0:o.length)?"REWARD_MODAL":"SUPPORT_MODAL",rewardMessage:this.getRewardMessage(e,t),hasError:i};this.openModal.emit(a);break}case"ShowConfirmationModal":this.openModal.emit({modalType:"TARGET_MODAL",confirmationData:s});break;case"ChallengeJoinRequest":this.isJoiningToChallenge=!0;break;case"JoinChallengeResult":{const{Success:t,JoinId:i,UnjoinId:s}=e.data.data;t&&(i&&this.updateChallengeStatus(i,1,!0),s&&this.updateChallengeStatus(s,0,!1),this.challenges=[...this.challenges]),this.isJoiningToChallenge=!1,this.closeModal.emit("TARGET_MODAL");break}case"ShowJackpotRewardModal":{const{Amount:t,Currency:i}=e.data.data;this.openModal.emit({modalType:"JACKPOT_REWARD_MODAL",winAmount:{amount:t,currency:i}});break}case"UpdateJackpotBalance":this.updateJackpotBalance(e.data.data)}}componentDidLoad(){this.orientation=P(),this.device=function(){const e=navigator.userAgent.toLowerCase(),t=screen.availWidth,i=screen.availHeight;if(e.includes("iphone"))return"Mobile";if(e.includes("ipad"))return"Tablet";if(e.includes("android")){if(i>t&&t<800)return"Mobile";if(t>i&&i<800)return"Tablet"}return"Desktop"}(),window.screen.orientation.addEventListener("change",this.orientationChangeHandler)}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0),this.barHeight=this.barWrapperEl.offsetHeight}disconnectedCallback(){window.screen.orientation.removeEventListener("change",this.orientationChangeHandler)}async init(e){var t;this.challenges=e.challenges,this.inProgressChallenges=null===(t=e.challenges)||void 0===t?void 0:t.filter((e=>e.Status===B.InProgress||e.Status===B.PendingLevelReward)).map((e=>e.Id)),this.jackpots=e.jackpots||[],this.freeSpins=e.freeSpins||{},this.gameSlug=e.slug,this.setChallengePercent(),this.setChallengeLabel()}setChallengeLabel(){this.challenges&&(this.isChallengeLabel=!!this.challenges.filter((e=>e.IsNew)).length)}setChallengePercent(){if(!this.challenges)return;const e=this.challenges.find((e=>e.Status===B.InProgress));if(e){const t=e.LevelProgresses.find((e=>e.ProgressStatus===S.InProgress));this.challengePercent=t?`${t.ProgressPercentage}%`:"0%"}else this.challengePercent="—"}updateChallengeProgress(e){var t;const i=null===(t=this.challenges)||void 0===t?void 0:t.find((t=>t.ChallengeId===e.ChallengeId));if(i&&(i.LevelProgresses=i.LevelProgresses.map((t=>{var i;const s=null===(i=e.Levels)||void 0===i?void 0:i.find((e=>e.LevelId===t.LevelId));return s?Object.assign(Object.assign({},t),{ProgressPercentage:s.ProgressPercentage,ProgressStatus:s.ProgressStatus}):t})),this.challenges=[...this.challenges]),this.showChallengeDetails){const e=this.challenges.find((e=>e.Id===this.selectedChallengeId));e&&(this.selectedChallenge=Object.assign({},e))}this.setChallengePercent()}updateChallengeStatus(e,t,i){var s;const o=null===(s=this.challenges)||void 0===s?void 0:s.find((t=>t.Id===e));o&&(o.Status=t,this.inProgressChallenges=i?[...this.inProgressChallenges,o.Id]:this.inProgressChallenges.filter((e=>e!==o.Id)))}updateJackpotBalance(e){if(this.jackpots=this.jackpots.map((t=>{const i=e.find((e=>e.JackpotId===t.JackpotId));return i?Object.assign(Object.assign({},t),{Balance:i.Balance,WinBalance:i.WinBalance}):t})),this.showJackpotDetails){const e=this.jackpots.find((e=>e.JackpotId===this.selectedJackpotId));e&&(this.selectedJackpot=Object.assign({},e))}}getChallengesWidgets(){return t("div",null,t("div",{class:this.showChallengesList?"Backdrop Opened":"Backdrop"},t("casino-engagement-suite-challenges-list",{device:this.device,class:"CasinoEngagementSuiteDialog",onClose:this.handlePopupClose("showChallengesList","showChallengeDetails"),challenges:this.challenges,inProgressChallenges:this.inProgressChallenges,isJoiningToChallenge:this.isJoiningToChallenge,pausedChallengeIds:this.pausedChallengeIds})),t("div",{class:this.showChallengeDetails?"Backdrop Opened":"Backdrop"},this.showChallengeDetails&&t("casino-engagement-suite-challenges-details",{device:this.device,class:"CasinoEngagementSuiteDialog",onBack:this.handleChallengePopupBack,onClose:this.handlePopupClose("showChallengesList","showChallengeDetails"),"game-slug":this.gameSlug,challenge:this.selectedChallenge,inProgressChallenges:this.inProgressChallenges,isJoiningToChallenge:this.isJoiningToChallenge,pausedChallengeIds:this.pausedChallengeIds})))}getFreeSpinWidgets(){return t("div",null,t("div",{class:this.showFreeSpinsList?"Backdrop Opened":"Backdrop"},t("casino-engagement-suite-free-spins-list",{device:this.device,class:"CasinoEngagementSuiteDialog",onClose:this.handlePopupClose("showFreeSpinsList","showFreeSpinsDetails"),freeSpins:this.freeSpins.VendorFreeSpins})),t("div",{class:this.showFreeSpinsDetails?"Backdrop Opened":"Backdrop"},this.showFreeSpinsDetails&&t("casino-engagement-suite-free-spins-details",{device:this.device,class:"CasinoEngagementSuiteDialog",onBack:this.handleChallengePopupBack,onClose:this.handlePopupClose("showFreeSpinsList","showFreeSpinsDetails"),"game-slug":this.gameSlug,spin:this.selectedSpin})))}getJackpotsWidgets(){return t("div",null,t("div",{class:this.showJackpotsList?"Backdrop Opened":"Backdrop"},t("casino-engagement-suite-jackpots-list",{device:this.device,class:"CasinoEngagementSuiteDialog",onClose:this.handleJackpotsPopupClose,jackpots:this.jackpots})),this.showJackpotDetails&&t("div",{class:"Backdrop Opened"},t("casino-engagement-suite-jackpot-details",{device:this.device,class:"CasinoEngagementSuiteDialog",onBack:this.handleJackpotPopupBack,onClose:this.handleJackpotsPopupClose,"game-slug":this.gameSlug,jackpot:this.selectedJackpot})))}getRewardMessage(e,t){var i,s,o,a;return(null===(a=null===(o=null===(s=null===(i=this.challenges)||void 0===i?void 0:i.find((t=>t.Id===e)))||void 0===s?void 0:s.LevelProgresses)||void 0===o?void 0:o.find((e=>e.LevelId===t)))||void 0===a?void 0:a.CustomRewardMessage)||""}render(){return t("div",{class:`CasinoEngagementSuiteContainer ${this.device} ${this.orientation}`,style:{"--barHeight":`${this.barHeight}px`}},t("div",{class:"barWrapper",ref:e=>this.barWrapperEl=e},t("casino-engagement-suite-bar",{orientation:this.orientation,device:this.device,"active-widget":this.activeWidget,"is-challenge-label":this.isChallengeLabel,jackpots:this.jackpots,freeSpins:this.freeSpins,"challenge-percent":this.challengePercent})),this.challenges&&this.getChallengesWidgets(),this.freeSpins&&this.getFreeSpinWidgets(),!!this.jackpots.length&&this.getJackpotsWidgets(),t("casino-engagement-suite-modal-container",{device:this.device,isJoiningToChallenge:this.isJoiningToChallenge}))}get host(){return s(this)}};L.style=":host{display:inline-block;font-family:inherit}.Backdrop{padding:20px 20px 20px 172px;display:none;position:fixed;inset:0;height:100dvh;width:100vw}.Backdrop.Opened{display:block}.Backdrop .CasinoEngagementSuiteDialog{height:calc(100dvh - 40px);max-width:600px}.CasinoEngagementSuiteContainer.Portrait{width:100vw}.CasinoEngagementSuiteContainer.Portrait .Backdrop{padding:calc(var(--barHeight) + 12px) 0 20px}.CasinoEngagementSuiteContainer.Portrait .Backdrop .CasinoEngagementSuiteDialog{max-width:initial;padding:0 4px;margin:0 auto;height:calc(100dvh - (var(--barHeight) + 20px))}.CasinoEngagementSuiteContainer.Landscape.Mobile .CasinoEngagementSuiteDialog{max-width:366px}.CasinoEngagementSuiteContainer.Landscape.Desktop .Backdrop{padding-left:272px}";const T=["en"],E={en:{freeSpins:"Free Spins",details:"Free Spins Details",tc:"Terms & Conditions",quantityGranted:"Quantity Granted",quantityLeft:"Quantity Left",valueGranted:"Value Granted",valueLeft:"Value Left",info:"Info",games:"Games",loadMore:"Load More"}},M=(e,t)=>{const i=t;return E[void 0!==i&&T.includes(i)?i:"en"][e]},I=class{constructor(t){e(this,t),this.close=i(this,"close",7),this.back=i(this,"back",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.gameSlug="",this.device="Mobile",this.limitStylingAppends=!1,this.timer="",this.showDetails=!1,this.isExpiredChallenge=!1,this.activeTab=1,this.visibleGames=[],this.maxVisibleGames=0,this.handleTabChange=e=>{this.activeTab=+e.target.getAttribute("data-index"),this.visibleGames=[],this.maxVisibleGames=0},this.handleLoadMore=()=>{this.visibleGames=this.spin.GamesInfo.slice(0,this.visibleGames.length+this.maxVisibleGames)},this.toggleShowDetails=()=>{this.showDetails=!this.showDetails},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.onGameClick=e=>{const t=e.currentTarget.getAttribute("data-slug");t&&window.postMessage({type:"EngagementSuiteGameRedirect",data:{Slug:t}})},this.handleCloseClick=()=>{this.close.emit()},this.handleBackClick=()=>{this.back.emit()}}componentWillLoad(){this.startCountdown()}componentDidRender(){if(!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0),2===this.activeTab&&!this.maxVisibleGames){const e="Mobile"===this.device?10:12,t="Mobile"===this.device?4:5;this.maxVisibleGames=Math.floor(this.gamesListWrapperEl.offsetHeight/((this.gamesListWrapperEl.offsetWidth-e*(t-1))/t/74*40+e))*t,this.visibleGames=this.spin.GamesInfo.slice(0,this.maxVisibleGames)}}disconnectedCallback(){clearInterval()}clearInterval(){this.interval&&(clearInterval(this.interval),this.interval=null)}getActionsTemplate(){return t("header",{class:"FreeSpinsActions"},t("button",{class:"FreeSpinsIconButton",onClick:this.handleBackClick},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/back.svg",alt:"back"})),"Mobile"!==this.device&&t("div",{class:"FreeSpinsPopupName"},M("freeSpins",this.language)),t("button",{class:"FreeSpinsIconButton",onClick:this.handleCloseClick},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"close"})))}getFreeSpinsHeader(){const{VendorName:e,NumberOfFreeSpins:i,NumberOfUsedFreeSpins:s}=this.spin;return t("div",{class:"FreeSpinsDetailsHeader"},t("span",{class:"FreeSpinsName"},e),t("div",{class:"FreeSpinsCounter"},t("div",{class:"FreeSpinsHighlightedCounter"},s),"/",i))}getFreeSpinsCountdown(){const e=this.isExpiredChallenge?"Expired":this.timer,{VendorFreeSpinsCost:i,VendorFreeSpinsRemainingCost:s,CurrencySymbol:o}=this.spin;return t("div",{class:"FreeSpinsCountdown "+(this.isExpiredChallenge?"Expired":"")},e,t("div",{class:"FreeSpinsBalCounter"},t("div",{class:"FreeSpinsRemainCounter"},o,s),"/",o,i))}getTabsTemplate(){return t("div",{class:"FreeSpinsDetailsTabs"},t("div",{"data-index":"1",onClick:this.handleTabChange,class:"FreeSpinsDetailsTab "+(1===this.activeTab?"Active":"")},M("info",this.language)),t("div",{"data-index":"2",onClick:this.handleTabChange,class:"FreeSpinsDetailsTab "+(2===this.activeTab?"Active":"")},M("games",this.language)))}getTabsContentTemplate(){return 1===this.activeTab?this.getSpinInfoTemplate():this.getGamesTemplate()}getSpinsDetailsTemplate(){return t("div",null,t("div",{class:"FreeSpinsDetailsButton",onClick:this.toggleShowDetails},t("div",{class:"Toggle "+(this.showDetails?"Closed":"Open")}),t("span",null,M("details",this.language))),this.showDetails&&t("p",{class:"FreeSpinsDescription"},this.spin.FreeSpinCampaignPresentation.Description))}getSpinInfoTemplate(){const{NumberOfFreeSpins:e,NumberOfUsedFreeSpins:i,VendorFreeSpinsCost:s,CurrencySymbol:o,VendorFreeSpinsRemainingCost:a}=this.spin;return t("div",null,this.spin.FreeSpinCampaignPresentation.Description&&this.getSpinsDetailsTemplate(),t("div",{class:"FreeSpinsInfo"},t("div",{class:"FreeSpinsInfoItem"},M("quantityGranted",this.language),": ",t("span",null,e)),t("div",{class:"FreeSpinsInfoItem"},M("quantityLeft",this.language),": ",t("span",null,i)),t("div",{class:"FreeSpinsInfoItem"},M("valueGranted",this.language),": ",t("span",null,o,s)),t("div",{class:"FreeSpinsInfoItem"},M("valueGranted",this.language),": ",t("span",null,o,a)),this.spin.FreeSpinCampaignPresentation.Url&&t("div",{class:"FreeSpinsInfoItem"},t("a",{class:"tc",href:this.spin.FreeSpinCampaignPresentation.Url,target:"_blank"},M("tc",this.language)))))}getGamesTemplate(){const e=this.visibleGames.map((e=>t("div",{onClick:this.onGameClick,class:"FreeSpinsGamesListItem "+(e.GameSlug===this.gameSlug?"Disabled":""),key:e.CasinoGameId,"data-slug":e.GameSlug,style:{background:`center / cover url(${e.GameIcon}) no-repeat`},title:e.GameName})));return[t("div",{class:"FreeSpinsGamesListWrapper",ref:e=>this.gamesListWrapperEl=e},t("div",{class:"FreeSpinsGamesList"},e)),this.visibleGames.length<this.spin.GamesInfo.length?t("button",{class:"PopupButton Active FreeSpinsGamesButton",onClick:this.handleLoadMore},M("loadMore",this.language)):""]}startCountdown(){this.interval=setInterval((()=>{this.updateTimer()}),1e3)}updateTimer(){const e=new Date(this.spin.ExpiryDate).getTime()-(new Date).getTime();if(e<1)return void this.clearInterval();const{days:t,hours:i,minutes:s,seconds:o}={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?`${i}h:${s}m:${o}s`:`${t}d:${i}h:${s}m`}render(){return t("div",{class:`FreeSpinsDetailsPopup ${this.device}`},this.getActionsTemplate(),t("div",{class:"FreeSpinsDetails"},this.getFreeSpinsHeader(),this.getFreeSpinsCountdown(),this.getTabsTemplate(),this.getTabsContentTemplate()))}get host(){return s(this)}};I.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}.FreeSpinsDetailsPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative}.FreeSpinsDetailsPopup.Disabled .FreeSpinsDetailsHeader{opacity:0.5}.FreeSpinsDetailsPopup.Disabled .FreeSpinsDetailsTabs{cursor:default;pointer-events:none}.FreeSpinsDetailsPopup.Disabled .FreeSpinsInfoItem{color:var(--emw--color-primary, #8F8B9C)}.FreeSpinsDetails{overflow:hidden;height:100%;display:flex;flex-direction:column}.FreeSpinsActions{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.FreeSpinsActions .FreeSpinsIconButton{width:16px;height:16px;cursor:pointer}.FreeSpinsActions .FreeSpinsPopupName{color:var(--emw--color-gray-100, #BBB9C3);font-size:var(--emw--font-size-small-plus, 16px);font-weight:500;line-height:16px}.FreeSpinsDetails{padding:0px 19px 10px;overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.FreeSpinsDetails::-webkit-scrollbar{display:none}.FreeSpinsDetailsHeader{display:flex;justify-content:space-between;gap:12px;min-width:0;align-items:flex-end}.FreeSpinsDetailsHeader .FreeSpinsName{font-family:"Montserrat", sans-serif;font-size:var(--emw--font-size-medium, 18px);font-weight:var(--emw--font-weight-bold, 700);line-height:22px;color:var(--emfe-w-color-white, #FFF);word-break:break-all;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.PopupButton{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;min-height:32px;font-size:var(--emw--font-size-small, 14px);font-weight:700;position:relative;font-family:"Montserrat", sans-serif}.PopupButton.Active{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}.PopupButton.Active::before{content:"";position:absolute;inset:0;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;border-radius:99px}.PopupButton.Loading{opacity:0.5;pointer-events:none}.FreeSpinsGamesLoadMore::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}.FreeSpinsCountdown{display:flex;justify-content:space-between;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)}.FreeSpinsHighlightedCounter{background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;font-size:var(--emw--font-size-medium, 18px);font-weight:800;margin-right:4px}.FreeSpinsCounter{display:flex;color:var(--emw--color-gray-100, #BBB9C3);font-size:var(--emw--font-size-x-small, 12px);align-items:flex-end}.FreeSpinsBalCounter{display:flex;align-items:flex-end;color:var(--emw--color-gray-100, #BBB9C3);font-size:var(--emw--font-size-x-small, 12px)}.FreeSpinsRemainCounter{color:var(--emw--color-typography, #FFFFFF);font-weight:700;margin-right:4px}.FreeSpinsCountdown.Expired{font-weight:var(--emw--font-weight-normal, 700);color:var(--emfe-w-color-white, #FFF)}.FreeSpinsDetailsTabs{margin:20px 0 12px;display:flex;position:relative}.FreeSpinsDetailsTabs .FreeSpinsDetailsTab{padding:9px 16px 7px;font-weight:500;font-size:var(--emw--font-size-x-small, 12px);line-height:15px;color:var(--emw--color-background, #666178);border-bottom:2px solid transparent;cursor:pointer}.FreeSpinsDetailsTabs .FreeSpinsDetailsTab.Active{color:var(--emw--color-typography, #FFF);border-color:var(--emw--color-typography, #FFF)}.FreeSpinsDetailsTabs::after{content:"";position:absolute;bottom:0;left:0;width:100%;height:1px;background-color:var(--emw--color-typography, #FFF);opacity:0.1}.FreeSpinsInfoItem{margin-bottom:8px;color:var(--emw--color-typography, #FFF);font-size:var(--emw--font-size-small, 14px);line-height:17px}.FreeSpinsInfoItem span{font-weight:var(--emw--font-weight-bold, 700)}.FreeSpinsInfoItem .tc{color:var(--emw--color-primary, #59D1FF)}.FreeSpinsDetailsButton{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}.FreeSpinsDetailsButton .Toggle{width:16px;height:16px;display:block;margin-right:4px}.FreeSpinsDetailsButton .Closed{background:url("https://static.everymatrix.com/gic/img/engagement-suite/eye-closed.svg") no-repeat center/contain}.FreeSpinsDetailsButton .Open{background:url("https://static.everymatrix.com/gic/img/engagement-suite/eye-open.svg") no-repeat center/contain}.FreeSpinsDescription{margin-bottom:20px;color:var(--emw--color-typography, #FFF);font-size:var(--emw--font-size-small, 14px);line-height:17px}.FreeSpinsGamesListWrapper{overflow:auto;flex-grow:1}.FreeSpinsGamesList{display:flex;gap:10px;flex-wrap:wrap}.FreeSpinsGamesList .FreeSpinsGamesListItem{width:calc(25% - 8px);aspect-ratio:74/40;cursor:pointer}.FreeSpinsGamesList .FreeSpinsGamesListItem.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.ShowDetails{display:block}.FreeSpinsGamesButton{margin-top:12px;align-self:center;min-width:140px}.FreeSpinsDetailsPopup.Tablet .FreeSpinsActions,.FreeSpinsDetailsPopup.Desktop .FreeSpinsActions{padding-top:16px}.FreeSpinsDetailsPopup.Tablet .FreeSpinsIconButton,.FreeSpinsDetailsPopup.Desktop .FreeSpinsIconButton{width:24px;height:24px}.FreeSpinsDetailsPopup.Tablet .FreeSpinsDetails,.FreeSpinsDetailsPopup.Desktop .FreeSpinsDetails{padding:20px 24px}.FreeSpinsDetailsPopup.Tablet .FreeSpinsName,.FreeSpinsDetailsPopup.Desktop .FreeSpinsName{line-height:27px;font-size:var(--emw--font-size-large, 22px)}.FreeSpinsDetailsPopup.Tablet .FreeSpinsCountdown,.FreeSpinsDetailsPopup.Desktop .FreeSpinsCountdown{font-size:var(--emw--font-size-small, 14px);line-height:14px}.FreeSpinsDetailsPopup.Tablet .FreeSpinsCollapseButton,.FreeSpinsDetailsPopup.Desktop .FreeSpinsCollapseButton{margin-bottom:12px}.FreeSpinsDetailsPopup.Tablet .PopupButton,.FreeSpinsDetailsPopup.Desktop .PopupButton{min-height:36px;font-size:var(--emw--font-size-small-plus, 16px)}';const z=["en"],A={en:{freeSpins:"Free Spins",tooltip:"Spin the game reels without using your own money",noSpins:"No FreeSpins yet\n",tryOtherGames:"Try winning FreeSpins as rewards or playing other booster games",new:"new"}},j=(e,t)=>{const i=t;return A[void 0!==i&&z.includes(i)?i:"en"][e]},R=class{constructor(t){e(this,t),this.close=i(this,"close",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.device="Mobile",this.freeSpins=[],this.tooltip=!1,this.timers={},this.limitStylingAppends=!1,this.newSpinIds=[],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.newSpinIds=[]},this.handleSpinClick=e=>{const t=e.currentTarget.getAttribute("data-id");window.postMessage({type:"FreeSpinClick",id:t}),this.newSpinIds=this.newSpinIds.filter((e=>e!==t))},this.showTooltip=()=>{this.tooltip=!0},this.hideTooltip=()=>{this.tooltip=!1}}spinsPropHandler(e){!this.interval&&e.length&&(this.updateTimers(),this.startCountdown()),this.interval&&!e.length&&clearInterval(this.interval)}componentWillLoad(){this.spinsPropHandler(this.freeSpins)}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.freeSpins.reduce(((t,i)=>{const s=new Date(i.ExpiryDate).getTime()-e;let o="00h:00m:00s";if(s<1)this.removeFreeSpin(i.Id);else{const{days:e,hours:t,minutes:i,seconds:a}={days:String(Math.floor(s/864e5)).padStart(2,"0"),hours:String(Math.floor(s%864e5/36e5)).padStart(2,"0"),minutes:String(Math.floor(s%36e5/6e4)).padStart(2,"0"),seconds:String(Math.floor(s%6e4/1e3)).padStart(2,"0")};o="00"===e?`${t}h:${i}m:${a}s`:`${e}d:${t}h:${i}m`}return Object.assign(Object.assign({},t),{[i.Id]:o})}),{})}removeFreeSpin(e){const t=this.freeSpins.findIndex((t=>t.Id===e));t>-1&&(this.freeSpins.splice(t,1),window.postMessage({type:"FreeSpinHasExpired",id:e}))}getFreeSpinClasses(){return{FreeSpinsCard:!0}}getChallengeHeaderTemplate(e){const{VendorName:i,NumberOfUsedFreeSpins:s,NumberOfFreeSpins:o}=e;return t("div",{class:"FreeSpinsCardHeader"},t("div",{class:"FreeSpinsName"},i),t("div",{class:"FreeSpinsCounter"},t("div",{class:"FreeSpinsHighlightedCounter"},s)," /",o))}getFreeSpinTemplate(e){const i=this.timers[e.Id],{VendorFreeSpinsRemainingCost:s,VendorFreeSpinsCost:o,CurrencySymbol:a}=e,n=this.newSpinIds.includes(e.Id);return t("div",{class:this.getFreeSpinClasses(),onClick:this.handleSpinClick,key:e.Id,"data-id":e.Id},t("div",{class:"SpinLabel "+(n?"ShowSpinLabel":"")},t("span",null,j("new",this.language))),this.getChallengeHeaderTemplate(e),t("div",{class:"FreeSpinsCountdownWrapper"},t("span",{class:"FreeSpinsCountdown"},i),";",t("div",{class:"FreeSpinsBalCounter"},t("div",{class:"FreeSpinsRemainCounter"},a,s),"/",a,o)))}getHeaderTemplate(){return t("header",{class:"FreeSpinsListPopupHeader"},t("button",{onClick:this.showTooltip,class:"FreeSpinsIconButton"},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/help.svg",alt:"Show tooltip"})),t("div",{class:"FreeSpinsListPopupHeaderName"},j("freeSpins",this.language)),t("button",{class:"FreeSpinsIconButton",onClick:this.handleCloseClick},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Close challenges list"})))}getListTemplate(){return this.freeSpins.length?t("div",{class:"FreeSpinsListWrapper"},t("div",{class:"FreeSpinsList"},this.freeSpins.map((e=>this.getFreeSpinTemplate(e))))):t("div",{class:"FreeSpinsListEmpty"},t("h2",null,j("noSpins",this.language)),t("p",null,j("tryOtherGames",this.language)))}getTooltipTemplate(){return this.tooltip?t("div",{class:"FreeSpinsTooltipBackdrop"},t("div",{class:"FreeSpinsTooltip"},t("button",{class:"FreeSpinsIconButton",onClick:this.hideTooltip},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Close tooltip"})),j("tooltip",this.language))):""}render(){return t("div",{class:`FreeSpinsListPopup ${this.device}`},this.getHeaderTemplate(),this.getListTemplate(),this.getTooltipTemplate())}get host(){return s(this)}static get watchers(){return{freeSpins:["spinsPropHandler"]}}};R.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}.FreeSpinsListPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative;padding-bottom:20px}.FreeSpinsListPopupHeader{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.FreeSpinsIconButton{width:16px;height:16px;cursor:pointer}.FreeSpinsListPopupHeaderName{color:var(--emw--color-gray-100, #BBB9C3);font-size:14px;font-weight:500;line-height:14px}.FreeSpinsListWrapper{overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.FreeSpinsListWrapper::-webkit-scrollbar{display:none}.FreeSpinsList{display:flex;flex-direction:column;row-gap:12px;padding:8px 19px 0}.FreeSpinsRowWrapper{display:flex;justify-content:space-between;min-width:0}.FreeSpinsCard{padding:15px 15px 19px;border:1px solid var(--emw--button-border-color, #403956);border-radius:6px;position:relative;cursor:pointer}.FreeSpinsCardHeader{display:flex;justify-content:space-between;gap:24px;margin-bottom:12px;flex:1;min-width:0;align-items:flex-end}.FreeSpinsName{color:var(--emw--color-typography, #FFFFFF);font-family:"Montserrat", sans-serif;line-height:22px;font-weight:700;font-size:18px;word-break:break-word;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.FreeSpinsCounter{display:flex;color:var(--emw--color-gray-100, #BBB9C3);font-size:var(--emw--font-size-x-small, 12px);align-items:flex-end}.FreeSpinsHighlightedCounter{background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;font-size:var(--emw--font-size-medium, 18px);font-weight:800;margin-right:4px}.FreeSpinsListEmpty{padding:20px 32px}.FreeSpinsListEmpty h2{margin:0 0 16px 0;text-align:center;font-weight:600;font-size:var(--emw--font-size-large, 20px);line-height:24px;font-family:"Montserrat", sans-serif;color:var(--emw--color-typography, #FFFFFF)}.FreeSpinsListEmpty p{font-size:var(--emw--font-size-small, 14px);line-height:17px;color:var(--emw--color-gray-100, #BBB9C3)}.FreeSpinsCountdownWrapper{display:flex;justify-content:space-between;align-items:flex-start}.FreeSpinsCountdown{color:var(--emw--color-gray-100, #BBB9C3);font-size:var(--emw--font-size-x-small, 12px);line-height:12px}.FreeSpinsBalCounter{display:flex;align-items:flex-end;color:var(--emw--color-gray-100, #BBB9C3);font-size:var(--emw--font-size-x-small, 12px)}.FreeSpinsRemainCounter{color:var(--emw--color-typography, #FFFFFF);font-weight:700;margin-right:4px}.SpinLabel{min-width:35px;height:18px;background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);border-radius:2px;display:none;position:absolute;top:-11px;right:11px;padding:0 2px;align-items:center;justify-content:center}.SpinLabel span{display:inline-block;text-transform:uppercase;font-size:var(--emw--font-size-x-small, 10px);line-height:10px;font-weight:700;font-family:"Montserrat", sans-serif;color:var(--emw--color-typography, #1E1638)}.ShowSpinLabel{display:inline-flex}.FreeSpinsTooltipBackdrop{padding:48px 30px 0;position:absolute;width:100%;height:100%;inset:0;background-color:rgba(0, 0, 0, 0.5)}.FreeSpinsTooltipBackdrop .FreeSpinsTooltip{border:1px solid var(--emw--button-border-color, #403956);background-color:var(--emw--color-background, #1E1638);border-radius:8px;padding:32px;font-size:var(--emw--font-size-small, 14px);line-height:17px;color:var(--emw--color-gray-100, #BBB9C3);position:relative}.FreeSpinsTooltipBackdrop .FreeSpinsTooltip .FreeSpinsIconButton{top:12px;right:6px;position:absolute}.FreeSpinsListPopup.Tablet .FreeSpinsListPopupHeader,.FreeSpinsListPopup.Desktop .FreeSpinsListPopupHeader{padding-top:16px}.FreeSpinsListPopup.Tablet .FreeSpinsListPopupHeaderName,.FreeSpinsListPopup.Desktop .FreeSpinsListPopupHeaderName{font-size:var(--emw--font-size-small-plus, 16px);line-height:16px}.FreeSpinsListPopup.Tablet .FreeSpinsIconButton,.FreeSpinsListPopup.Desktop .FreeSpinsIconButton{width:24px;height:24px}.FreeSpinsListPopup.Tablet .FreeSpinsList,.FreeSpinsListPopup.Desktop .FreeSpinsList{padding:20px 24px 0;row-gap:20px}.FreeSpinsListPopup.Tablet .ChallengeCardHeader,.FreeSpinsListPopup.Desktop .ChallengeCardHeader{margin-bottom:16px}.FreeSpinsListPopup.Tablet .FreeSpinsName,.FreeSpinsListPopup.Desktop .FreeSpinsName{line-height:27px;font-size:var(--emw--font-size-large, 22px)}.FreeSpinsListPopup.Tablet .FreeSpinsCountdown,.FreeSpinsListPopup.Desktop .FreeSpinsCountdown{font-size:var(--emw--font-size-small, 14px);line-height:14px}.FreeSpinsListPopup.Tablet .FreeSpinsTooltip,.FreeSpinsListPopup.Desktop .FreeSpinsTooltip{padding:60px 65px;font-size:var(--emw--font-size-small-plus, 16px);line-height:20px}.FreeSpinsListPopup.Tablet .FreeSpinsTooltip .FreeSpinsIconButton,.FreeSpinsListPopup.Desktop .FreeSpinsTooltip .FreeSpinsIconButton{top:24px;right:24px}';const O=["en"],H={en:{jackpots:"Jackpots",join:"Join",unjoin:"Unjoin",info:"Info",games:"Games",operatorContribution:"Operator Contribution",type:"Type",winningProbability:"Winning Probability",tc:"Terms & Conditions",jackpotIsWon:"Jackpot’s won!",loadMore:"Load More",jackpotDetails:"Jackpot Details",minBet:"Min Bet",maxBet:"Max Bet"}},$=(e,t)=>{const i=t;return H[void 0!==i&&O.includes(i)?i:"en"][e]};function G(e,t,i=99999999){return e=Math.min(e,i),`${t} ${new Intl.NumberFormat("en",{minimumFractionDigits:2,maximumFractionDigits:2}).format(e)}`}const W=class{constructor(t){e(this,t),this.close=i(this,"close",7),this.back=i(this,"back",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.gameSlug="",this.device="Mobile",this.limitStylingAppends=!1,this.timer="",this.disabledStatus="",this.activeTab=1,this.visibleGames=[],this.loading=!1,this.enabled=!1,this.showDetails=!1,this.maxVisibleGames=0,this.handleTabChange=e=>{this.activeTab=+e.target.getAttribute("data-index"),this.visibleGames=[],this.maxVisibleGames=0},this.handleLoadMore=()=>{this.visibleGames=this.jackpot.GamesInfo.slice(0,this.visibleGames.length+this.maxVisibleGames)},this.toggleShowDetails=()=>{this.showDetails=!this.showDetails},this.changeJackpotStatus=e=>{e.stopPropagation(),window.postMessage({type:"JackpotChangeStatusRequest",data:{[this.jackpot.JackpotId]:!this.jackpot.Enabled}}),this.loading=!0},this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))},this.handleCloseClick=()=>{this.close.emit()},this.handleBackClick=()=>{this.back.emit()},this.onGameClick=e=>{const t=e.currentTarget.getAttribute("data-slug");t&&window.postMessage({type:"EngagementSuiteGameRedirect",data:{Slug:t}})}}handleEvent(e){const{type:t,data:i}=null==e?void 0:e.data;switch(t){case"UpdateJackpotStatus":this.updateJackpotStatus(e.data.data);break;case"JoinJackpotResult":{const e=i;e.Success&&this.jackpot.JackpotId in e.JackpotIds&&(this.enabled=this.jackpot.Enabled=e.JackpotIds[this.jackpot.JackpotId]),this.loading=!1;break}}}handleJackpotUpdate(){this.balance=this.jackpot.Balance,this.winBalance=this.jackpot.WinBalance}handleResize(){2===this.activeTab&&this.setVisibleGames()}componentWillLoad(){this.startCountdown(),this.enabled=this.jackpot.Enabled,this.balance=this.jackpot.Balance,this.winBalance=this.jackpot.WinBalance}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0),2!==this.activeTab||this.maxVisibleGames||this.setVisibleGames()}disconnectedCallback(){this.clearInterval()}clearInterval(){this.interval&&(clearInterval(this.interval),this.interval=null)}setVisibleGames(){const e="Mobile"===this.device?10:12,t="Mobile"===this.device?4:5;this.maxVisibleGames=Math.floor(this.gamesListWrapperEl.offsetHeight/((this.gamesListWrapperEl.offsetWidth-e*(t-1))/t/74*40+e))*t,this.visibleGames=this.jackpot.GamesInfo.slice(0,this.maxVisibleGames)}updateJackpotStatus(e){e.IsClosed?(this.clearInterval(),this.disabledStatus=e.Reason,this.activeTab=1):(this.disabledStatus="",this.jackpot.JackpotEndTime=e.JackpotEndTime,this.startCountdown())}getTopNavigationTemplate(){return t("div",{class:"JackpotDetailsNavigation"},t("button",{class:"JackpotIconButton",onClick:this.handleBackClick},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/back.svg",alt:"back"})),t("div",{class:"JackpotPopupName"},$("jackpots",this.language)),t("button",{class:"JackpotIconButton",onClick:this.handleCloseClick},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"close"})))}getJackpotBalance(){return G(this.winBalance||this.balance,this.jackpot.Currency)}getJoinButtonClasses(){return{PopupButton:!0,Active:this.enabled,Loading:this.loading}}getJackpotDetailsHeaderTemplate(){return t("div",{class:"JackpotDetailsHeader"},t("div",null,t("div",{class:"JackpotType"},this.jackpot.Type),t("div",{class:"JackpotBalance"},this.getJackpotBalance())),t("div",{class:"JackpotDetailsHeaderSecondCol"},t("button",{disabled:!!this.disabledStatus,onClick:this.changeJackpotStatus,class:this.getJoinButtonClasses()},$(this.enabled?"unjoin":"join",this.language)),!!this.winBalance&&t("div",{class:"JackpotIsWon"},$("jackpotIsWon",this.language))))}getTabsTemplate(){return t("div",{class:"JackpotDetailsTabs"},t("div",{"data-index":"1",onClick:this.handleTabChange,class:"JackpotDetailsTab "+(1===this.activeTab?"Active":"")},$("info",this.language)),t("div",{"data-index":"2",onClick:this.handleTabChange,class:"JackpotDetailsTab "+(2===this.activeTab?"Active":"")},$("games",this.language)))}getTabsContentTemplate(){return 1===this.activeTab?this.getJackpotInfoTemplate():this.getGamesTemplate()}getJackpotDetailsTemplate(){return t("div",null,t("div",{class:"JackpotDetailsButton",onClick:this.toggleShowDetails},t("div",{class:"Toggle "+(this.showDetails?"Closed":"Open")}),t("span",null,$("jackpotDetails",this.language))),this.showDetails&&t("p",{class:"JackpotDescription"},this.jackpot.Description))}getBetLimitsRange(){var e,i,s,o;if(this.jackpot.BetLimits){const a=this.jackpot.Currency,n=Object.keys(this.jackpot.BetLimits),r=n.find((e=>e===a))||n[0],l=this.jackpot.BetLimits&&(null===(e=this.jackpot.BetLimits[r])||void 0===e?void 0:e.MinBet),p=this.jackpot.BetLimits&&(null===(i=this.jackpot.BetLimits[r])||void 0===i?void 0:i.MaxBet),c=G(null===(s=this.jackpot.BetLimits[r])||void 0===s?void 0:s.MinBet,r),h=G(null===(o=this.jackpot.BetLimits[r])||void 0===o?void 0:o.MaxBet,r);return t("div",null,l&&t("div",{class:"JackpotInfoItem"},$("minBet",this.language),": ",t("span",null,c)),p&&t("div",{class:"JackpotInfoItem"},$("maxBet",this.language),": ",t("span",null,h)))}}getJackpotInfoTemplate(){return t("div",{class:"JackpotInfoTabContent"},this.jackpot.Description&&this.getJackpotDetailsTemplate(),t("div",{class:"JackpotInfo"},t("div",{class:"JackpotInfoItem"},$("operatorContribution",this.language),": ",t("span",null,this.jackpot.OperatorContributionPercent,"%")),t("div",{class:"JackpotInfoItem"},$("type",this.language),": ",t("span",null,this.jackpot.JackpotTypePresentation)),t("div",{class:"JackpotInfoItem"},$("winningProbability",this.language),": ",t("span",null,"1:",this.jackpot.Probability)),this.getBetLimitsRange(),this.jackpot.JackpotRulesUrl&&t("div",{class:"JackpotInfoItem"},t("a",{class:"tc",href:this.jackpot.JackpotRulesUrl,target:"_blank"},$("tc",this.jackpot.JackpotRulesUrl)))))}getGamesTemplate(){const e=this.visibleGames.map((e=>t("div",{onClick:this.onGameClick,class:"JackpotGamesListItem "+(e.GameSlug===this.gameSlug?"Disabled":""),key:e.CasinoGameId,"data-slug":e.GameSlug,style:{background:`center / cover url(${e.GameIcon}) no-repeat`},title:e.GameName})));return[t("div",{class:"JackpotGamesListWrapper",ref:e=>this.gamesListWrapperEl=e},t("div",{class:"JackpotGamesList"},e)),this.visibleGames.length<this.jackpot.GamesInfo.length?t("button",{class:"PopupButton Active JackpotGamesButton",onClick:this.handleLoadMore},$("loadMore",this.language)):""]}getJackpotCountdown(){return t("div",{class:"JackpotCountdown "+(this.disabledStatus?"Suspended":"")},this.disabledStatus||this.timer)}startCountdown(){this.updateTimer(),this.interval=setInterval((()=>{this.updateTimer()}),1e3)}updateTimer(){const e=new Date(this.jackpot.JackpotEndTime).getTime()-(new Date).getTime();if(e<1)return void this.clearInterval();const{days:t,hours:i,minutes:s,seconds:o}={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?`${i}h:${s}m:${o}s`:`${t}d:${i}h:${s}m`}getPopupClasses(){return{JackpotDetailsPopup:!0,Disabled:!!this.disabledStatus,[this.device]:!0,[this.jackpot.Type.charAt(0).toUpperCase()+this.jackpot.Type.slice(1)]:!0}}render(){return t("div",{class:this.getPopupClasses()},this.getTopNavigationTemplate(),t("div",{class:"JackpotDetailsPopupContent"},this.getJackpotDetailsHeaderTemplate(),this.getJackpotCountdown(),this.getTabsTemplate(),this.getTabsContentTemplate()))}get host(){return s(this)}static get watchers(){return{jackpot:["handleJackpotUpdate"]}}};function _(e,t){f(2,arguments);var i=F(e),s=F(t);return i.getTime()<s.getTime()}W.style=':host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none}button:focus{outline:none}button:not(:disabled){cursor:pointer}.PopupButton{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;min-height:32px;font-size:14px;font-weight:700;position:relative;font-family:"Montserrat", sans-serif}.PopupButton.Active{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}.PopupButton.Active::before{content:"";position:absolute;inset:0;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;border-radius:99px}.PopupButton.Loading{opacity:0.5;pointer-events:none}.JackpotDetailsPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative}.JackpotDetailsPopup.Disabled .JackpotDetailsHeader{opacity:0.5}.JackpotDetailsPopup.Disabled .JackpotDetailsTabs{cursor:default;pointer-events:none}.JackpotDetailsPopup.Disabled .JackpotInfoItem{color:var(--emw--color-primary, #8F8B9C)}.JackpotGamesListWrapper,.JackpotInfoTabContent{overflow-x:auto;scrollbar-gutter:stable}.JackpotGamesListWrapper::-webkit-scrollbar,.JackpotInfoTabContent::-webkit-scrollbar{width:3px;background:none}.JackpotGamesListWrapper::-webkit-scrollbar-thumb,.JackpotInfoTabContent::-webkit-scrollbar-thumb{border-radius:4px;background:var(--emw--color-gray-transparency-30, rgba(255, 255, 255, 0.3))}.JackpotDetailsNavigation{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.JackpotDetailsNavigation .JackpotIconButton{width:16px;height:16px;cursor:pointer;display:flex;justify-content:center;align-items:center}.JackpotDetailsNavigation .JackpotPopupName{color:var(--emw--color-gray-100, #BBB9C3);font-size:16px;font-weight:500;line-height:16px;display:none}.JackpotDetailsPopupContent{padding:8px 18px 18px;overflow:hidden;height:100%;display:flex;flex-direction:column}.JackpotDetailsHeader{display:flex;justify-content:space-between;align-items:center;gap:12px}.JackpotDetailsHeader .JackpotDetailsHeaderSecondCol{text-align:right}.JackpotDetailsHeader .JackpotType{text-transform:uppercase;font-family:"Montserrat", sans-serif;font-size:var(--emw--font-size-medium, 18px);font-weight:var(--emw--font-weight-bold, 700);line-height:22px;color:var(--emfe-w-color-white, #FFF);word-break:break-all}.JackpotDetailsHeader .JackpotBalance{margin-top:8px;font-family:Montserrat, sans-serif;font-size:18px;font-weight:var(--emw--font-weight-bold, 800);line-height:18px}.JackpotDetailsHeader .JackpotIsWon{margin-top:8px;font-family:Montserrat, sans-serif;font-weight:var(--emw--font-weight-bold, 700);font-size:12px;line-height:15px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-text-fill-color:transparent;-webkit-background-clip:text}.JackpotDetailsPopup.Mega .JackpotBalance{background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);-webkit-text-fill-color:transparent;-webkit-background-clip:text}.JackpotDetailsPopup.Major .JackpotBalance{background:linear-gradient(180deg, #A19FA0 5.36%, #E1DBDB 28.86%, #FEFFFF 36.86%, #E1DBDB 44.36%, #5E5B5F 91.86%);-webkit-text-fill-color:transparent;-webkit-background-clip:text}.JackpotDetailsPopup.Minor .JackpotBalance{background:linear-gradient(180deg, #A0522C 5.36%, #FFAB8C 28.86%, #FFEEDF 36.86%, #FFAB8C 44.36%, #6A3A21 91.86%);-webkit-text-fill-color:transparent;-webkit-background-clip:text}.JackpotGamesLoadMore::before,.JackpotJoinButton.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}.JackpotGamesButton{margin-top:12px;align-self:center;min-width:140px}.JackpotCountdown{font-size:var(--emw--font-size-x-small, 12px);line-height:12px;margin-top:12px;color:var(--emw--color-gray-150, #BBB9C3)}.JackpotCountdown.Suspended{font-weight:var(--emw--font-weight-bold, 700);color:var(--emfe-w-color-white, #FFF);text-transform:capitalize}.JackpotDetailsTabsWrapper{display:flex;flex-direction:column}.JackpotDetailsTabs{margin:20px 0 12px;display:flex;position:relative}.JackpotDetailsTabs .JackpotDetailsTab{padding:9px 16px 7px;font-weight:500;font-size:12px;line-height:15px;color:var(--emw--color-background, #666178);border-bottom:2px solid transparent;cursor:pointer}.JackpotDetailsTabs .JackpotDetailsTab.Active{color:var(--emw--color-typography, #FFF);border-color:var(--emw--color-typography, #FFF)}.JackpotDetailsTabs::after{content:"";position:absolute;bottom:0;left:0;width:100%;height:1px;background-color:var(--emw--color-typography, #FFF);opacity:0.1}.JackpotInfoItem{margin-bottom:8px;color:var(--emw--color-typography, #FFF);font-size:14px;line-height:17px}.JackpotInfoItem span{font-weight:var(--emw--font-weight-bold, 700)}.JackpotInfoItem .tc{color:var(--emw--color-primary, #59D1FF)}.JackpotGamesListWrapper{overflow:auto;flex-grow:1}.JackpotGamesList{display:flex;gap:10px;flex-wrap:wrap}.JackpotGamesList .JackpotGamesListItem{width:calc(25% - 8px);aspect-ratio:74/40;cursor:pointer}.JackpotGamesList .JackpotGamesListItem.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.JackpotDetailsButton{margin-bottom:12px;display:flex;align-items:center;font-size:var(--emw--font-size-x-small, 12px);line-height:12px;color:var(--emw--color-primary-variant, #666178);cursor:pointer}.JackpotDetailsButton .Toggle{width:16px;height:16px;margin-right:4px}.JackpotDetailsButton .Closed{background:center/100% url("https://static.everymatrix.com/gic/img/engagement-suite/eye-closed.svg")}.JackpotDetailsButton .Open{background:center/100% url("https://static.everymatrix.com/gic/img/engagement-suite/eye-open.svg")}.JackpotDescription{margin-bottom:20px;color:var(--emw--color-typography, #FFF);font-size:var(--emw--font-size-small, 14px);line-height:17px}.JackpotDetailsPopup.Tablet .JackpotDetailsButton,.JackpotDetailsPopup.Desktop .JackpotDetailsButton{margin-bottom:20px}.JackpotDetailsPopup.Tablet .JackpotDescription,.JackpotDetailsPopup.Desktop .JackpotDescription{font-size:var(--emw--font-size-medium, 16px);line-height:22px}.JackpotDetailsPopup.Tablet .JackpotPopupName,.JackpotDetailsPopup.Desktop .JackpotPopupName{display:block}.JackpotDetailsPopup.Tablet .JackpotDetailsNavigation,.JackpotDetailsPopup.Desktop .JackpotDetailsNavigation{padding-top:16px}.JackpotDetailsPopup.Tablet .JackpotIconButton,.JackpotDetailsPopup.Desktop .JackpotIconButton{width:24px;height:24px}.JackpotDetailsPopup.Tablet .JackpotDetailsPopupContent,.JackpotDetailsPopup.Desktop .JackpotDetailsPopupContent{padding:20px 24px 30px}.JackpotDetailsPopup.Tablet .JackpotBalance,.JackpotDetailsPopup.Tablet .JackpotType,.JackpotDetailsPopup.Desktop .JackpotBalance,.JackpotDetailsPopup.Desktop .JackpotType{line-height:27px;font-size:22px}.JackpotDetailsPopup.Tablet .JackpotBalance,.JackpotDetailsPopup.Desktop .JackpotBalance{font-weight:var(--emw--font-weight-bold, 700)}.JackpotDetailsPopup.Tablet .PopupButton,.JackpotDetailsPopup.Desktop .PopupButton{min-height:36px;font-size:16px}.JackpotDetailsPopup.Tablet .JackpotCountdown,.JackpotDetailsPopup.Desktop .JackpotCountdown{font-size:var(--emw--font-size-small, 14px);line-height:14px}.JackpotDetailsPopup.Tablet .JackpotDetailsTabs,.JackpotDetailsPopup.Desktop .JackpotDetailsTabs{margin-bottom:20px}.JackpotDetailsPopup.Tablet .JackpotInfoItem,.JackpotDetailsPopup.Desktop .JackpotInfoItem{font-size:16px;line-height:20px}.JackpotDetailsPopup.Tablet .JackpotIsWon,.JackpotDetailsPopup.Desktop .JackpotIsWon{font-size:14px;line-height:17px}.JackpotDetailsPopup.Tablet .JackpotGamesList,.JackpotDetailsPopup.Desktop .JackpotGamesList{gap:12px}.JackpotDetailsPopup.Tablet .JackpotGamesList .JackpotGamesListItem,.JackpotDetailsPopup.Desktop .JackpotGamesList .JackpotGamesListItem{width:calc(20% - 10px)}.JackpotDetailsPopup.Tablet .JackpotDetailsTabs .JackpotDetailsTab,.JackpotDetailsPopup.Desktop .JackpotDetailsTabs .JackpotDetailsTab{font-size:16px;line-height:20px}';const N=["en"],U={en:{jackpots:"Jackpots",join:"Join",unjoin:"Unjoin",tooltip:"A payout that increases each time the game is played but the jackpot is not won",mega:"Mega",major:"Major",minor:"Minor",suspended:"Suspended Jackpot",allJackpotsSuspended:"Unfortunately, there are no available jackpots to join. Please, try again later.",jackpotIsWon:"Jackpot is Won",termsAndConditions:"Terms and Conditions",winingProbability:"Winning Probability",type:"Type",operatorContribution:"Operator Contribution",outdatedJackpotCountdown:"We are going to remove this Jackpot in 30 days"}},q=(e,t)=>{const i=t;return U[void 0!==i&&N.includes(i)?i:"en"][e]},V=class{constructor(t){e(this,t),this.close=i(this,"close",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.device="Mobile",this.jackpots=[],this.buttonsLoadingStates={},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.showTooltip=()=>{this.tooltip=!0},this.hideTooltip=()=>{this.tooltip=!1},this.changeJackpotStatus=e=>{e.stopPropagation();const t=+e.currentTarget.getAttribute("data-id"),i=e.currentTarget.hasAttribute("data-joined");window.postMessage({type:"JackpotChangeStatusRequest",data:{[t]:!i}}),this.buttonsLoadingStates=Object.assign(Object.assign({},this.buttonsLoadingStates),{[t]:!0})},this.handleJackpotClick=e=>{const t=+e.currentTarget.getAttribute("data-id");window.postMessage({type:"JackpotClick",id:t})}}jackpotsPropHandler(e){!this.interval&&e.length&&this.startCountdown(),this.interval&&!e.length&&clearInterval(this.interval)}handleEvent(e){const{type:t,data:i}=e.data;switch(t){case"UpdateJackpotStatus":const e=i;this.jackpots=this.jackpots.map((t=>t.JackpotId===e.JackpotId?Object.assign(Object.assign({},t),{IsClosed:e.IsClosed,JackpotEndTime:t.JackpotEndTime}):t));break;case"JoinJackpotResult":const t=i,s=Object.keys(t.JackpotIds);t.Success&&s.length>0&&(this.jackpots=this.jackpots.map((e=>{const i=s.find((t=>String(t)===String(e.JackpotId)));return i?Object.assign(Object.assign({},e),{Enabled:t.JackpotIds[i]}):e}))),this.buttonsLoadingStates=Object.fromEntries(Object.entries(this.buttonsLoadingStates).filter((([e])=>!s.includes(e))))}}startCountdown(){this.updateTimers(),this.interval=setInterval((()=>{this.updateTimers()}),1e3)}updateTimers(){const e=(new Date).getTime();this.timers=this.jackpots.reduce(((t,i)=>{const s=new Date(i.JackpotEndTime).getTime()-e;let o="00h:00m:00s";const{days:a,hours:n,minutes:r,seconds:l}={days:String(Math.floor(s/864e5)).padStart(2,"0"),hours:String(Math.floor(s%864e5/36e5)).padStart(2,"0"),minutes:String(Math.floor(s%36e5/6e4)).padStart(2,"0"),seconds:String(Math.floor(s%6e4/1e3)).padStart(2,"0")};return o="00"===a?`${n}h:${r}m:${l}s`:`${a}d:${n}h:${r}m`,Object.assign(Object.assign({},t),{[i.JackpotId]:o})}),{})}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}disconnectedCallback(){this.interval&&clearInterval(this.interval)}getJackpotClasses(e){return{JackpotCard:!0,JackpotCardSuspended:e.IsClosed,InProgress:e.Enabled&&!e.IsClosed}}getJackpotHeaderTemplate(e){const i=!!e.WinBalance,s=i?e.WinBalance:e.Balance,o=q(e.Type,this.language),a=q("suspended",this.language),n=(null==e?void 0:e.IsClosed)?a:o,r=`JackpotBalance Jackpot${q(e.Type,this.language)}`,l=e.Enabled&&!(null==e?void 0:e.IsClosed)?"JackpotJoinButton Joined":"JackpotJoinButton",p=q(e.Enabled&&!(null==e?void 0:e.IsClosed)?"unjoin":"join",this.language),c=!!this.buttonsLoadingStates[e.JackpotId]||(null==e?void 0:e.IsClosed)||_(new Date(e.JackpotEndTime),new Date);return t("div",{class:"JackpotCardHeader"},t("div",{class:"JackpotTitle"},t("span",{class:"JackpotName"},n),t("span",{class:r},function(e,t,i=99999999){return e=Math.min(e,i),`${t} ${new Intl.NumberFormat("en",{minimumFractionDigits:2,maximumFractionDigits:2}).format(e)}`}(s,e.Currency))),i?t("span",{class:"JackpotWon"},q("jackpotIsWon",this.language)):t("button",{class:l,onClick:this.changeJackpotStatus,"data-id":e.JackpotId,"data-joined":e.Enabled,disabled:c},p))}getJackpotDescriptionTemplate(e){const i=e.OperatorContributionPercent?e.OperatorContributionPercent+"%":"",s=e.Probability?e.Probability+"%":"",o=_(new Date(e.JackpotEndTime),new Date)?q("outdatedJackpotCountdown",this.language):this.timers[e.JackpotId],a=q("operatorContribution",this.language),n=q("type",this.language),r=q("winingProbability",this.language);return t("div",{class:"JackpotCardDescription"},t("span",{class:"JackpotCountdown"},o),t("div",{class:"JackpotCardDescriptionBlock"},t("div",{class:"JackpotCardDescriptionColumn"},i&&this.renderDesciptionRowInfo(`${a}:`,i),this.renderDesciptionRowInfo(`${n}:`,e.JackpotTypePresentation)),t("div",{class:"JackpotCardDescriptionColumn"},s&&this.renderDesciptionRowInfo(`${r}:`,s),t("a",{href:e.JackpotRulesUrl,target:"_blank"},q("termsAndConditions",this.language)))))}renderDesciptionRowInfo(e,i){return t("div",{class:"JackpotCardDescriptionRow"},t("span",null,e),t("span",{class:"JackpotDescriptionValue"},i))}getJackpotTemplate(e){const i=!(null==e?void 0:e.WinBalance);return t("div",{class:this.getJackpotClasses(e),onClick:this.handleJackpotClick,key:e.JackpotId,"data-id":e.JackpotId},this.getJackpotHeaderTemplate(e),i&&this.getJackpotDescriptionTemplate(e))}getHeaderTemplate(){return t("header",{class:"JackpotsListPopupHeader"},t("button",{onClick:this.showTooltip,class:"JackpotsIconButton"},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/help.svg",alt:"Show tooltip"})),t("div",{class:"JackpotsListPopupHeaderName"},q("jackpots",this.language)),t("button",{class:"JackpotsIconButton",onClick:this.handleCloseClick},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Close jackpots list"})))}getListTemplate(){const e=this.jackpots.every((e=>e.IsClosed));return this.jackpots.length?t("div",{class:"JackpotsListWrapper"},e&&t("div",{class:"JackpotsListSuspended"},t("h2",null,q("allJackpotsSuspended",this.language))),t("div",{class:"JackpotsList"},this.jackpots.map((e=>this.getJackpotTemplate(e))))):t("div",{class:"JackpotsListSuspended"},t("h2",null,q("allJackpotsSuspended",this.language)))}getTooltipTemplate(){return this.tooltip?t("div",{class:"JackpotsTooltipBackdrop"},t("div",{class:"JackpotsTooltip"},t("button",{class:"JackpotsIconButton",onClick:this.hideTooltip},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Close tooltip"})),q("tooltip",this.language))):""}render(){return t("div",{class:`JackpotsListPopup ${this.device}`},this.getHeaderTemplate(),this.getListTemplate(),this.getTooltipTemplate())}get host(){return s(this)}static get watchers(){return{jackpots:["jackpotsPropHandler"]}}};V.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}body{margin:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.JackpotsListPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:var(--emw--border-radius-medium, 8px);overflow:hidden;flex-direction:column;position:relative;padding-bottom:20px}.JackpotsListPopupHeader{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.JackpotsIconButton{width:16px;height:16px;cursor:pointer}.JackpotsListPopupHeaderName{color:var(--emw--color-gray-100, #BBB9C3);font-size:14px;font-weight:500;line-height:14px}.JackpotsListWrapper{overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.JackpotsListWrapper::-webkit-scrollbar{display:none}.JackpotsList{display:flex;flex-direction:column;row-gap:12px;padding:8px 19px 0}.JackpotCard{padding:15px 15px 19px;border:1px solid var(--emw--button-border-color, #403956);border-radius:var(--emw--border-radius-small, 6px);position:relative;cursor:pointer}.JackpotJoinButton:not([disabled]).Joined::before,.JackpotCard.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}.JackpotCard.JackpotCardSuspended *{color:var(--emw--color-primary, #8F8B9C)}.JackpotCard.JackpotCardSuspended .JackpotBalance,.JackpotCard.JackpotCardSuspended .JackpotWon{-webkit-text-fill-color:var(--emw--color-primary, #8F8B9C)}.JackpotCardHeader{display:flex;justify-content:space-between;gap:24px}.JackpotTitle{display:flex;flex-direction:column;justify-content:space-between}.JackpotName{color:var(--emw--color-typography, #FFFFFF);font-family:"Montserrat", sans-serif;line-height:22px;font-weight:700;font-size:18px;word-break:break-word;margin-bottom:4px}.JackpotMega,.JackpotWon{background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%)}.JackpotMajor{background:linear-gradient(180deg, #A19FA0 5.36%, #E1DBDB 28.86%, #FEFFFF 36.86%, #E1DBDB 44.36%, #5E5B5F 91.86%)}.JackpotMinor{background:linear-gradient(180deg, #A0522C 5.36%, #FFAB8C 28.86%, #FFEEDF 36.86%, #FFAB8C 44.36%, #6A3A21 91.86%)}.JackpotBalance,.JackpotWon{font-weight:bold;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent}.JackpotCardDescription{display:flex;flex-direction:column;margin-top:12px}.JackpotCardDescriptionRow{display:flex;align-items:center;color:var(--emw--color-primary, #8F8B9C);font-size:12px;line-height:12px}.JackpotCardDescriptionRow .JackpotDescriptionValue{font-weight:600;margin-left:2px}.JackpotCardDescriptionColumn{display:flex;flex-direction:column;row-gap:4px}.JackpotCardDescriptionBlock{display:flex;justify-content:space-between;column-gap:14px}.JackpotCardDescriptionBlock a{color:var(--emw--color-secondary, #59D1FF);text-underline-offset:3px;font-size:11px}.JackpotJoinButton{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}.JackpotJoinButton.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}.JackpotJoinButton.Joined:not([disabled])::before{border-radius:99px}.JackpotJoinButton[disabled]{opacity:0.5;pointer-events:none;cursor:auto}.JackpotsListSuspended{padding:20px 19px}.JackpotsListSuspended h2{font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3);font-weight:400}.JackpotCountdown{color:var(--emw--color-gray-100, #BBB9C3);font-size:12px;line-height:12px;margin-bottom:12px}.JackpotsTooltipBackdrop{padding:48px 30px 0;position:absolute;width:100%;height:100%;inset:0;background-color:rgba(0, 0, 0, 0.5)}.JackpotsTooltipBackdrop .JackpotsTooltip{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}.JackpotsTooltipBackdrop .JackpotsTooltip .JackpotsIconButton{top:12px;right:6px;position:absolute}.JackpotsListPopup.Tablet .JackpotsListPopupHeader,.JackpotsListPopup.Desktop .JackpotsListPopupHeader{padding-top:16px}.JackpotsListPopup.Tablet .JackpotsListPopupHeaderName,.JackpotsListPopup.Desktop .JackpotsListPopupHeaderName{font-size:16px;line-height:16px}.JackpotsListPopup.Tablet .JackpotsIconButton,.JackpotsListPopup.Desktop .JackpotsIconButton{width:24px;height:24px}.JackpotsListPopup.Tablet .JackpotsList,.JackpotsListPopup.Desktop .JackpotsList{padding:20px 24px 0;row-gap:20px}.JackpotsListPopup.Tablet .JackpotCardHeader,.JackpotsListPopup.Desktop .JackpotCardHeader{margin-bottom:16px}.JackpotsListPopup.Tablet .JackpotName,.JackpotsListPopup.Desktop .JackpotName{line-height:27px;font-size:22px}.JackpotsListPopup.Tablet .JackpotJoinButton,.JackpotsListPopup.Desktop .JackpotJoinButton{min-width:100px;height:36px;font-size:16px}.JackpotsListPopup.Tablet .JackpotCountdown,.JackpotsListPopup.Desktop .JackpotCountdown{font-size:14px;line-height:14px}.JackpotsListPopup.Tablet .JackpotTooltip,.JackpotsListPopup.Desktop .JackpotTooltip{padding:60px 65px;font-size:16px;line-height:20px}.JackpotsListPopup.Tablet .JackpotTooltip .JackpotsIconButton,.JackpotsListPopup.Desktop .JackpotTooltip .JackpotsIconButton{top:24px;right:24px}';const Q=class{constructor(t){e(this,t),this.closeModal=i(this,"closeModal",7),this.clientStyling="",this.clientStylingUrl="",this.device="Mobile",this.showAnimation=!1,this.limitStylingAppends=!1,this.handleCloseClick=()=>{this.isLoading||this.closeModal.emit(this.modalType)},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)}render(){return t("div",{class:`ModalOverlay ${this.isOpen&&"Open"} ${this.device} ${this.showAnimation&&"ShowAnimation"}`},t("div",{class:"ModalWinAnimation"}),t("div",{class:"ModalContent GradientBorder"},t("div",{class:"IconCloseContainer"},t("button",{class:"IconCloseButton",onClick:this.handleCloseClick},t("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Сlose modal"}))),this.contentIcon?t("div",{class:"ModalIcon",style:{background:`url(${this.contentIcon}) no-repeat center, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%)`}}):null,t("div",{class:"ModalHeader"},t("h1",null,this.header)),t("div",{class:"ModalBody"},t("slot",{name:"body"})),t("div",{class:"ModalFooter"},t("slot",{name:"footer"}))))}get host(){return s(this)}};Q.style=':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}.ModalOverlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.5);justify-content:center;align-items:center}.ModalOverlay.Open{display:flex}.IconCloseContainer{width:100%;display:flex;justify-content:end}.IconCloseButton img{width:24px;height:24px}.ModalContent{display:flex;flex-direction:column;align-items:center;font-family:"Montserrat", sans-serif;position:relative;color:var(--emw--color-typography, #FFFFFF);background-color:var(--emw--color-background, #1E1638);padding:24px;border-radius:8px;width:450px;max-width:100%;text-align:center}.GradientBorder::before{content:"";position:absolute;top:-1px;left:-1px;right:-1px;bottom:-1px;border-radius:9px;background:linear-gradient(143.2deg, #FF9401 -0.41%, #FFD32D 45.61%, #FF9401 82.77%);z-index:-1}.ModalHeader h1{font-weight:var(--emw--font-weight-semibold, 600);font-size:var(--emw--font-size-large, 24px);margin-top:12px;padding:0 16px}.ModalIcon{width:44px;height:44px;border-radius:50%;background-size:cover;margin-top:12px}.ModalBody{margin-top:20px;font-size:16px;font-family:"Inter", sans-serif;font-weight:var(--emw--font-weight-normal, 400);color:var(--emw--color-gray-100, #BBB9C3);padding:0 16px}.ModalFooter{margin-top:40px;margin-bottom:28px;padding:0 16px;width:100%}@keyframes rotate{100%{transform:rotate(1turn)}}.ModalOverlay .ModalWinAnimation{display:none}.ModalOverlay.ShowAnimation .ModalWinAnimation{display:block;position:absolute;width:100%;height:100%;inset:0;background:center/550px url(https://static.everymatrix.com/gic/img/engagement-suite/light.svg) no-repeat, center/550px url(https://static.everymatrix.com/gic/img/engagement-suite/win.svg) no-repeat;animation:6s rotate linear infinite}.ModalOverlay.Mobile .IconCloseButton img{width:16px;height:16px}.ModalOverlay.Mobile .ModalBody{font-size:14px}.ModalOverlay.Mobile .ModalContent{width:318px;padding:12px}.ModalOverlay.Mobile .ModalHeader h1{font-size:20px}.ModalOverlay.Mobile.ShowAnimation .ModalWinAnimation{background-size:400px}';const K=["en"],Y={en:{joinHeader:"Choose another challenge?",desc:"Any progress on the current challenge will be kept and you can rejoin the challenge at any time.",joinQuestion:"Would you still like to join another challenge?",joinConfirm:"Yes, join another challenge",joinReject:"No, stay at current challenge",unJoinHeader:"Quit Challenge?",unJoinQuestion:"Would you still like to quit the challenge?",unJoinConfirm:"Yes, I want to quit challenge",unJoinReject:"No, stay at challenge",join:"Unjoin",unJoin:"Unjoin",continue:"Continue",okContinue:"Ok, continue",won:"You won",supportInfo:"However, some rewards cannot be issued. Please, contact support.",noReward:"Reward cannot be issued",contactSupport:"Please contact support",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",jackpotWin:"Total Jackpot Win!"}},X=(e,t)=>{const i=t;return Y[void 0!==i&&K.includes(i)?i:"en"][e]},Z=class{constructor(t){e(this,t),this.closeModal=i(this,"closeModal",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.device="Mobile",this.limitStylingAppends=!1,this.openModals=[],this.rewardMessage="",this.hasError=!1,this.confirmationData=null,this.winAmount={amount:0,currency:""},this.handleCloseClick=e=>{const t=e.currentTarget.getAttribute("data-type");this.closeModal.emit(t)},this.handleChallengeAttendance=()=>{window.postMessage({type:"ChallengeJoinRequest",data:this.confirmationData})},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.isModalOpen=e=>Boolean(this.openModals.find((t=>t===e)))}openModalHandler(e){const{modalType:t,rewardMessage:i,hasError:s,confirmationData:o,winAmount:a}=e.detail;a&&(this.winAmount=this.isModalOpen("JACKPOT_REWARD_MODAL")?{amount:this.winAmount.amount+a.amount,currency:a.currency}:a),this.openModals=[...this.openModals,t],this.rewardMessage=i,this.hasError=s,o&&(this.confirmationData=o)}closeModalHandler(e){this.openModals=this.openModals.filter((t=>t!==e.detail))}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){const{ProgressToActivate:e}=this.confirmationData||{};return t("div",{class:`ModalContainer ${this.device}`},t("casino-engagement-suite-modal",{isOpen:this.isModalOpen("REWARD_MODAL"),header:"Congratulations!",contentIcon:"https://static.everymatrix.com/gic/img/engagement-suite/cup-reward.svg",modalType:"REWARD_MODAL","show-animation":!0,device:this.device},t("div",{slot:"body"},t("p",null,X("won",this.language)," ",t("span",{class:"ModalReward"},this.rewardMessage)),this.hasError&&t("p",{class:"SupportInfo"},X("supportInfo",this.language))),t("div",{slot:"footer"},t("button",{class:"ModalFooterButton",onClick:this.handleCloseClick,"data-type":"REWARD_MODAL"},X("continue",this.language)))),t("casino-engagement-suite-modal",{isOpen:this.isModalOpen("JACKPOT_REWARD_MODAL"),header:"Congratulations!",contentIcon:"https://static.everymatrix.com/gic/img/engagement-suite/cup-reward.svg","show-animation":!0,modalType:"JACKPOT_REWARD_MODAL",device:this.device},t("div",{slot:"body"},t("div",{class:"JackpotWinText"},X("jackpotWin",this.language)),t("div",{class:"JackpotWinAmount"},(i=this.winAmount.amount,`${this.winAmount.currency} ${new Intl.NumberFormat("en",{minimumFractionDigits:2,maximumFractionDigits:2}).format(i)}`))),t("div",{slot:"footer"},t("button",{class:"ModalFooterButton",onClick:this.handleCloseClick,"data-type":"JACKPOT_REWARD_MODAL"},X("continue",this.language)))),t("casino-engagement-suite-modal",{isOpen:this.isModalOpen("TARGET_MODAL"),header:X(e?"joinHeader":"unJoinHeader",this.language),modalType:"TARGET_MODAL",device:this.device,isLoading:this.isJoiningToChallenge},t("div",{slot:"body"},t("p",{class:"LeftAlign"},X("desc",this.language)),t("p",{class:"LeftAlign"},X(e?"joinQuestion":"unJoinQuestion",this.language))),t("div",{slot:"footer",class:"ManyActions"},t("button",{class:"ModalFooterButton "+(this.isJoiningToChallenge?"Disabled":""),onClick:this.handleChallengeAttendance},X(e?"joinConfirm":"unJoinConfirm",this.language)),t("button",{class:"ModalFooterButtonOutlined "+(this.isJoiningToChallenge?"Disabled":""),onClick:this.handleCloseClick,"data-type":"TARGET_MODAL"},t("div",{class:"GradientText"},X(e?"joinReject":"unJoinReject",this.language))))),t("casino-engagement-suite-modal",{isOpen:this.isModalOpen("SUPPORT_MODAL"),header:X("noReward",this.language),contentIcon:"https://static.everymatrix.com/gic/img/engagement-suite/alert.svg",modalType:"SUPPORT_MODAL",device:this.device},t("div",{slot:"body"},t("span",null,X("contactSupport",this.language))),t("div",{slot:"footer"},t("button",{class:"ModalFooterButton",onClick:this.handleCloseClick,"data-type":"SUPPORT_MODAL"},X("okContinue",this.language)))));var i}get host(){return s(this)}};Z.style=':host{display:block;font-family:inherit}.ModalFooterButton,.ModalFooterButtonOutlined{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:160px;height:36px;font-size:var(--emw--font-size-small-plus, 16px);font-weight:var(--emw--font-weight-bold, 700);position:relative;font-family:"Montserrat", sans-serif;padding:0 16px;box-sizing:border-box;margin:auto;border:none;cursor:pointer}.ModalFooterButtonOutlined{background:linear-gradient(var(--emw--color-background, #1E1638) 0 0) padding-box, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%) border-box;border:2px solid transparent}.GradientText{background-image:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:transparent;background-clip:text}.ManyActions{display:flex;width:100%;flex-direction:column;align-items:stretch}.ManyActions .ModalFooterButton,.ManyActions .ModalFooterButtonOutlined{width:280px}.ManyActions button:first-child{margin-bottom:16px}.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.ModalReward{font-weight:var(--emw--font-weight-semibold, 600);color:var(--emw--color-typography, #FFFFFF);word-break:break-word}.JackpotWinText{margin:0;font-weight:var(--emw--font-weight-bold, 600);font-size:16px;line-height:20px;color:var(--emw--color-typography, #FFF)}.JackpotWinAmount{margin-top:8px;box-shadow:-0.41px 0.41px 0px 0px #00000026, -0.41px 0.41px 2px 0px #00000080;background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);-webkit-text-fill-color:transparent;-webkit-background-clip:text;font-weight:900;font-size:16px;line-height:16px}.SupportInfo{margin-top:20px}.ModalContainer.Mobile .ModalFooterButton,.ModalContainer.Mobile .ModalFooterButtonOutlined{font-size:var(--emw--font-size-small, 14px);min-width:140px;height:32px}.ModalContainer.Mobile .ManyActions .ModalFooterButton,.ModalContainer.Mobile .ManyActions .ModalFooterButtonOutlined{width:100%;height:32px}.ModalContainer.Mobile .ManyActions button:first-child{margin-bottom:8px}.ModalContainer.Mobile .JackpotWinText{font-size:14px;line-height:16px}.ModalContainer.Mobile .JackpotWinAmount{font-size:14px;line-height:14px}.LeftAlign{text-align:left;line-height:1.2}';const ee=class{constructor(t){e(this,t),this.value=0,this.disabled=!1,this.hidePercent=!1,this.clientStyling="",this.clientStylingUrl="",this.limitStylingAppends=!1,this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))}}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}getProgressBarClasses(){return{ProgressBar:!0,Completed:100===this.value,Disabled:this.disabled,HidePercent:this.hidePercent}}render(){return t("div",{class:this.getProgressBarClasses(),part:"ProgressBar"},t("div",{class:"ProgressBarInfo",part:"ProgressBarInfo"},t("slot",{name:"Title"},t("div",null)),t("slot",{name:"Percent"},t("div",{class:"ProgressBarPercent",part:"ProgressBarPercent"},this.value,"%"))),t("div",{class:"ProgressBarBackground",part:"ProgressBarBackground"},t("div",{class:"ProgressBarLine",part:"ProgressBarLine",style:{width:this.value+"%"}})))}get host(){return s(this)}};ee.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{n as casino_engagement_suite_bar,g as casino_engagement_suite_challenges_details,J as casino_engagement_suite_challenges_list,L as casino_engagement_suite_container,I as casino_engagement_suite_free_spins_details,R as casino_engagement_suite_free_spins_list,W as casino_engagement_suite_jackpot_details,V as casino_engagement_suite_jackpots_list,Q as casino_engagement_suite_modal,Z as casino_engagement_suite_modal_container,ee as casino_engagement_suite_progress_bar}
@@ -166,12 +166,6 @@ function formatBalance$3(amount, currency) {
166
166
  return `${currency}${new Intl.NumberFormat('en', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
167
167
  .format(amount)}`;
168
168
  }
169
- function formatBetRange(amount, currency) {
170
- return `${currency}${new Intl.NumberFormat('en-US', {
171
- minimumFractionDigits: 0,
172
- maximumFractionDigits: 0,
173
- }).format(amount).replace(/,/g, ' ')}`;
174
- }
175
169
 
176
170
  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}";
177
171
 
@@ -358,11 +352,11 @@ const CasinoEngagementSuiteChallengesDetails = class {
358
352
  var _a, _b, _c, _d;
359
353
  const isAccumulativeLevelType = level.LevelTargetType === 0;
360
354
  if (isAccumulativeLevelType) {
361
- const formattedMinBet = formatBetRange((_a = level.BetRange) === null || _a === void 0 ? void 0 : _a.MinBet, this.challenge.CurrencySymbol);
362
- const formattedMaxBet = formatBetRange((_b = level.BetRange) === null || _b === void 0 ? void 0 : _b.MaxBet, this.challenge.CurrencySymbol);
355
+ const formattedMinBet = formatBalance$3((_a = level.BetRange) === null || _a === void 0 ? void 0 : _a.MinBet, this.challenge.CurrencySymbol);
356
+ const formattedMaxBet = formatBalance$3((_b = level.BetRange) === null || _b === void 0 ? void 0 : _b.MaxBet, this.challenge.CurrencySymbol);
363
357
  const formattedContributionPercentage = level.LevelContributionPercent + '%';
364
- const showMinBet = typeof ((_c = level.BetRange) === null || _c === void 0 ? void 0 : _c.MinBet) === 'number';
365
- const showMaxBet = typeof ((_d = level.BetRange) === null || _d === void 0 ? void 0 : _d.MaxBet) === 'number';
358
+ const showMinBet = !!((_c = level.BetRange) === null || _c === void 0 ? void 0 : _c.MinBet);
359
+ const showMaxBet = !!((_d = level.BetRange) === null || _d === void 0 ? void 0 : _d.MaxBet);
366
360
  const showContributionPercentage = level.LevelContributionPercent !== 100;
367
361
  if (showMinBet || showMaxBet || showContributionPercentage) {
368
362
  return (index.h("div", { class: 'ChallengeLevelBetDetails' }, showMinBet &&
@@ -680,7 +674,7 @@ const CasinoEngagementSuiteChallengesList = class {
680
674
  this.challenges.splice(index, 0, newChallenge);
681
675
  }
682
676
  else {
683
- this.challenges.unshift(newChallenge);
677
+ this.challenges.push(newChallenge);
684
678
  }
685
679
  this.challenges = [...this.challenges];
686
680
  this.newChallengeIds.push(newChallenge.Id);
@@ -981,6 +975,19 @@ const CasinoEngagementSuiteContainer = class {
981
975
  handleEvent(e) {
982
976
  const _a = e === null || e === void 0 ? void 0 : e.data, { type } = _a, rest = __rest(_a, ["type"]);
983
977
  switch (type) {
978
+ case 'ChallengeGrant': {
979
+ const newChallenge = e.data.data.challengeProgressData[0];
980
+ const index = this.challenges.findIndex(challenge => differenceInSeconds(new Date(challenge.ExpirationTime), new Date(newChallenge.ExpirationTime)) > 0);
981
+ if (index > -1) {
982
+ this.challenges.splice(index, 0, newChallenge);
983
+ }
984
+ else {
985
+ this.challenges.push(newChallenge);
986
+ }
987
+ this.challenges = [...this.challenges];
988
+ this.setChallengeLabel();
989
+ break;
990
+ }
984
991
  case 'ChallengeHasExpired': {
985
992
  this.setChallengePercent();
986
993
  break;
@@ -1037,10 +1044,6 @@ const CasinoEngagementSuiteContainer = class {
1037
1044
  this.showJackpotDetails = true;
1038
1045
  break;
1039
1046
  }
1040
- case 'UpdateChallenges': {
1041
- this.setChallengeLabel();
1042
- break;
1043
- }
1044
1047
  case 'UpdateChallengeProgress': {
1045
1048
  this.updateChallengeProgress(e.data.data);
1046
1049
  break;
@@ -1171,7 +1174,8 @@ const CasinoEngagementSuiteContainer = class {
1171
1174
  challenge.LevelProgresses = challenge.LevelProgresses.map(level => {
1172
1175
  var _a;
1173
1176
  const updatedLevel = (_a = data.Levels) === null || _a === void 0 ? void 0 : _a.find(l => l.LevelId === level.LevelId);
1174
- return updatedLevel ? Object.assign(Object.assign({}, level), updatedLevel) : level;
1177
+ return updatedLevel
1178
+ ? Object.assign(Object.assign({}, level), { ProgressPercentage: updatedLevel.ProgressPercentage, ProgressStatus: updatedLevel.ProgressStatus }) : level;
1175
1179
  });
1176
1180
  this.challenges = [...this.challenges];
1177
1181
  }
@@ -1626,6 +1630,8 @@ const TRANSLATIONS$2 = {
1626
1630
  jackpotIsWon: 'Jackpot’s won!',
1627
1631
  loadMore: 'Load More',
1628
1632
  jackpotDetails: 'Jackpot Details',
1633
+ minBet: 'Min Bet',
1634
+ maxBet: 'Max Bet'
1629
1635
  }
1630
1636
  };
1631
1637
  const translate$2 = (key, customLang) => {
@@ -1833,8 +1839,22 @@ const CasinoEngagementSuiteJackpotDetails = class {
1833
1839
  getJackpotDetailsTemplate() {
1834
1840
  return index.h("div", null, index.h("div", { class: "JackpotDetailsButton", onClick: this.toggleShowDetails }, index.h("div", { class: `Toggle ${this.showDetails ? 'Closed' : 'Open'}` }), index.h("span", null, translate$2('jackpotDetails', this.language))), this.showDetails && index.h("p", { class: "JackpotDescription" }, this.jackpot.Description));
1835
1841
  }
1842
+ getBetLimitsRange() {
1843
+ var _a, _b, _c, _d;
1844
+ if (this.jackpot.BetLimits) {
1845
+ const playerCurrency = this.jackpot.Currency;
1846
+ const betCurrencies = Object.keys(this.jackpot.BetLimits);
1847
+ const matchedCurrency = betCurrencies.find(currency => currency === playerCurrency);
1848
+ const betCurrency = matchedCurrency ? matchedCurrency : betCurrencies[0];
1849
+ const showMinBet = this.jackpot.BetLimits && ((_a = this.jackpot.BetLimits[betCurrency]) === null || _a === void 0 ? void 0 : _a.MinBet);
1850
+ const showMaxBet = this.jackpot.BetLimits && ((_b = this.jackpot.BetLimits[betCurrency]) === null || _b === void 0 ? void 0 : _b.MaxBet);
1851
+ const formattedMinBet = formatBalance$2((_c = this.jackpot.BetLimits[betCurrency]) === null || _c === void 0 ? void 0 : _c.MinBet, betCurrency);
1852
+ const formattedMaxBet = formatBalance$2((_d = this.jackpot.BetLimits[betCurrency]) === null || _d === void 0 ? void 0 : _d.MaxBet, betCurrency);
1853
+ return index.h("div", null, showMinBet && index.h("div", { class: "JackpotInfoItem" }, translate$2('minBet', this.language), ":\u00A0", index.h("span", null, formattedMinBet)), showMaxBet && index.h("div", { class: "JackpotInfoItem" }, translate$2('maxBet', this.language), ":\u00A0", index.h("span", null, formattedMaxBet)));
1854
+ }
1855
+ }
1836
1856
  getJackpotInfoTemplate() {
1837
- return index.h("div", { class: "JackpotInfoTabContent" }, this.jackpot.Description && this.getJackpotDetailsTemplate(), index.h("div", { class: "JackpotInfo" }, index.h("div", { class: "JackpotInfoItem" }, translate$2('operatorContribution', this.language), ":\u00A0", index.h("span", null, this.jackpot.OperatorContributionPercent, "%")), index.h("div", { class: "JackpotInfoItem" }, translate$2('type', this.language), ":\u00A0", index.h("span", null, this.jackpot.JackpotTypePresentation)), index.h("div", { class: "JackpotInfoItem" }, translate$2('winningProbability', this.language), ":\u00A0", index.h("span", null, "1:", this.jackpot.Probability)), this.jackpot.JackpotRulesUrl && index.h("div", { class: "JackpotInfoItem" }, index.h("a", { class: "tc", href: this.jackpot.JackpotRulesUrl, target: "_blank" }, translate$2('tc', this.jackpot.JackpotRulesUrl)))));
1857
+ return index.h("div", { class: "JackpotInfoTabContent" }, this.jackpot.Description && this.getJackpotDetailsTemplate(), index.h("div", { class: "JackpotInfo" }, index.h("div", { class: "JackpotInfoItem" }, translate$2('operatorContribution', this.language), ":\u00A0", index.h("span", null, this.jackpot.OperatorContributionPercent, "%")), index.h("div", { class: "JackpotInfoItem" }, translate$2('type', this.language), ":\u00A0", index.h("span", null, this.jackpot.JackpotTypePresentation)), index.h("div", { class: "JackpotInfoItem" }, translate$2('winningProbability', this.language), ":\u00A0", index.h("span", null, "1:", this.jackpot.Probability)), this.getBetLimitsRange(), this.jackpot.JackpotRulesUrl && index.h("div", { class: "JackpotInfoItem" }, index.h("a", { class: "tc", href: this.jackpot.JackpotRulesUrl, target: "_blank" }, translate$2('tc', this.jackpot.JackpotRulesUrl)))));
1838
1858
  }
1839
1859
  getGamesTemplate() {
1840
1860
  const list = this.visibleGames.map((game) => {
@@ -2173,7 +2193,7 @@ const CasinoEngagementSuiteJackpotsList = class {
2173
2193
  };
2174
2194
  CasinoEngagementSuiteJackpotsList.style = casinoEngagementSuiteJackpotsListCss;
2175
2195
 
2176
- const casinoEngagementSuiteModalCss = ":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}.ModalOverlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.5);justify-content:center;align-items:center}.ModalOverlay.Open{display:flex}.IconCloseContainer{width:100%;display:flex;justify-content:end}.ModalContent{display:flex;flex-direction:column;align-items:center;font-family:\"Montserrat\", sans-serif;position:relative;color:var(--emw--color-typography, #FFFFFF);background-color:var(--emw--color-background, #1E1638);padding:12px;border-radius:8px;width:450px;max-width:100%;text-align:center}.GradientBorder::before{content:\"\";position:absolute;top:-1px;left:-1px;right:-1px;bottom:-1px;border-radius:9px;background:linear-gradient(143.2deg, #FF9401 -0.41%, #FFD32D 45.61%, #FF9401 82.77%);z-index:-1}.ModalHeader h1{font-weight:var(--emw--font-weight-semibold, 600);font-size:20px;margin-top:12px;padding:0 16px}.ModalIcon{width:44px;height:44px;border-radius:50%;background-size:cover;margin-top:12px}.ModalBody{margin-top:20px;font-size:16px;font-family:\"Inter\", sans-serif;font-weight:var(--emw--font-weight-normal, 400);color:var(--emw--color-gray-100, #BBB9C3);padding:0 16px}.ModalFooter{margin-top:40px;margin-bottom:28px;padding:0 16px;width:100%}@keyframes rotate{100%{transform:rotate(1turn)}}.ModalOverlay .ModalWinAnimation{display:none}.ModalOverlay.ShowAnimation .ModalWinAnimation{display:block;position:absolute;width:100%;height:100%;inset:0;background:center/550px url(https://static.everymatrix.com/gic/img/engagement-suite/light.svg) no-repeat, center/550px url(https://static.everymatrix.com/gic/img/engagement-suite/win.svg) no-repeat;animation:6s rotate linear infinite}.ModalOverlay.Mobile .ModalBody{font-size:14px}.ModalOverlay.Mobile .ModalContent{width:318px}.ModalOverlay.Mobile .ModalHeader h1{font-size:20px}.ModalOverlay.Mobile.ShowAnimation .ModalWinAnimation{background-size:400px}";
2196
+ const casinoEngagementSuiteModalCss = ":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}.ModalOverlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.5);justify-content:center;align-items:center}.ModalOverlay.Open{display:flex}.IconCloseContainer{width:100%;display:flex;justify-content:end}.IconCloseButton img{width:24px;height:24px}.ModalContent{display:flex;flex-direction:column;align-items:center;font-family:\"Montserrat\", sans-serif;position:relative;color:var(--emw--color-typography, #FFFFFF);background-color:var(--emw--color-background, #1E1638);padding:24px;border-radius:8px;width:450px;max-width:100%;text-align:center}.GradientBorder::before{content:\"\";position:absolute;top:-1px;left:-1px;right:-1px;bottom:-1px;border-radius:9px;background:linear-gradient(143.2deg, #FF9401 -0.41%, #FFD32D 45.61%, #FF9401 82.77%);z-index:-1}.ModalHeader h1{font-weight:var(--emw--font-weight-semibold, 600);font-size:var(--emw--font-size-large, 24px);margin-top:12px;padding:0 16px}.ModalIcon{width:44px;height:44px;border-radius:50%;background-size:cover;margin-top:12px}.ModalBody{margin-top:20px;font-size:16px;font-family:\"Inter\", sans-serif;font-weight:var(--emw--font-weight-normal, 400);color:var(--emw--color-gray-100, #BBB9C3);padding:0 16px}.ModalFooter{margin-top:40px;margin-bottom:28px;padding:0 16px;width:100%}@keyframes rotate{100%{transform:rotate(1turn)}}.ModalOverlay .ModalWinAnimation{display:none}.ModalOverlay.ShowAnimation .ModalWinAnimation{display:block;position:absolute;width:100%;height:100%;inset:0;background:center/550px url(https://static.everymatrix.com/gic/img/engagement-suite/light.svg) no-repeat, center/550px url(https://static.everymatrix.com/gic/img/engagement-suite/win.svg) no-repeat;animation:6s rotate linear infinite}.ModalOverlay.Mobile .IconCloseButton img{width:16px;height:16px}.ModalOverlay.Mobile .ModalBody{font-size:14px}.ModalOverlay.Mobile .ModalContent{width:318px;padding:12px}.ModalOverlay.Mobile .ModalHeader h1{font-size:20px}.ModalOverlay.Mobile.ShowAnimation .ModalWinAnimation{background-size:400px}";
2177
2197
 
2178
2198
  const CasinoEngagementSuiteModal = class {
2179
2199
  constructor(hostRef) {
@@ -2243,7 +2263,7 @@ const TRANSLATIONS = {
2243
2263
  desc: 'Any progress on the current challenge will be kept and you can rejoin the challenge at any time.',
2244
2264
  joinQuestion: 'Would you still like to join another challenge?',
2245
2265
  joinConfirm: 'Yes, join another challenge',
2246
- joinReject: 'No, stay at the current challenge',
2266
+ joinReject: 'No, stay at current challenge',
2247
2267
  unJoinHeader: 'Quit Challenge?',
2248
2268
  unJoinQuestion: 'Would you still like to quit the challenge?',
2249
2269
  unJoinConfirm: 'Yes, I want to quit challenge',
@@ -2272,7 +2292,7 @@ function formatBalance(amount, currency) {
2272
2292
  .format(amount)}`;
2273
2293
  }
2274
2294
 
2275
- const casinoEngagementSuiteModalContainerCss = ":host{display:block;font-family:inherit}.ModalFooterButton,.ModalFooterButtonOutlined{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:140px;height:36px;font-size:14px;font-weight:var(--emw--font-weight-bold, 700);position:relative;font-family:\"Montserrat\", sans-serif;padding:0 16px;box-sizing:border-box;margin:auto;border:none;cursor:pointer}.ModalFooterButtonOutlined{background:linear-gradient(var(--emw--color-background, #1E1638) 0 0) padding-box, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%) border-box;border:2px solid transparent}.GradientText{background-image:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:transparent;background-clip:text}.ManyActions{display:flex;width:100%;flex-direction:column;align-items:stretch}.ManyActions .ModalFooterButton,.ManyActions .ModalFooterButtonOutlined{width:280px}.ManyActions button:first-child{margin-bottom:16px}.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.ModalReward{font-weight:var(--emw--font-weight-semibold, 600);color:var(--emw--color-typography, #FFFFFF)}.JackpotWinText{margin:0;font-weight:var(--emw--font-weight-bold, 600);font-size:16px;line-height:20px;color:var(--emw--color-typography, #FFF)}.JackpotWinAmount{margin-top:8px;box-shadow:-0.41px 0.41px 0px 0px #00000026, -0.41px 0.41px 2px 0px #00000080;background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);-webkit-text-fill-color:transparent;-webkit-background-clip:text;font-weight:900;font-size:16px;line-height:16px}.SupportInfo{margin-top:20px}.ModalContainer.Mobile .ModalFooterButton{min-width:140px;height:32px}.ModalContainer.Mobile .ManyActions .ModalFooterButton,.ModalContainer.Mobile .ManyActions .ModalFooterButtonOutlined{width:100%;height:32px}.ModalContainer.Mobile .ManyActions button:first-child{margin-bottom:8px}.ModalContainer.Mobile .JackpotWinText{font-size:14px;line-height:16px}.ModalContainer.Mobile .JackpotWinAmount{font-size:14px;line-height:14px}.LeftAlign{text-align:left;line-height:1.2}";
2295
+ const casinoEngagementSuiteModalContainerCss = ":host{display:block;font-family:inherit}.ModalFooterButton,.ModalFooterButtonOutlined{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:160px;height:36px;font-size:var(--emw--font-size-small-plus, 16px);font-weight:var(--emw--font-weight-bold, 700);position:relative;font-family:\"Montserrat\", sans-serif;padding:0 16px;box-sizing:border-box;margin:auto;border:none;cursor:pointer}.ModalFooterButtonOutlined{background:linear-gradient(var(--emw--color-background, #1E1638) 0 0) padding-box, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%) border-box;border:2px solid transparent}.GradientText{background-image:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:transparent;background-clip:text}.ManyActions{display:flex;width:100%;flex-direction:column;align-items:stretch}.ManyActions .ModalFooterButton,.ManyActions .ModalFooterButtonOutlined{width:280px}.ManyActions button:first-child{margin-bottom:16px}.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.ModalReward{font-weight:var(--emw--font-weight-semibold, 600);color:var(--emw--color-typography, #FFFFFF);word-break:break-word}.JackpotWinText{margin:0;font-weight:var(--emw--font-weight-bold, 600);font-size:16px;line-height:20px;color:var(--emw--color-typography, #FFF)}.JackpotWinAmount{margin-top:8px;box-shadow:-0.41px 0.41px 0px 0px #00000026, -0.41px 0.41px 2px 0px #00000080;background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);-webkit-text-fill-color:transparent;-webkit-background-clip:text;font-weight:900;font-size:16px;line-height:16px}.SupportInfo{margin-top:20px}.ModalContainer.Mobile .ModalFooterButton,.ModalContainer.Mobile .ModalFooterButtonOutlined{font-size:var(--emw--font-size-small, 14px);min-width:140px;height:32px}.ModalContainer.Mobile .ManyActions .ModalFooterButton,.ModalContainer.Mobile .ManyActions .ModalFooterButtonOutlined{width:100%;height:32px}.ModalContainer.Mobile .ManyActions button:first-child{margin-bottom:8px}.ModalContainer.Mobile .JackpotWinText{font-size:14px;line-height:16px}.ModalContainer.Mobile .JackpotWinAmount{font-size:14px;line-height:14px}.LeftAlign{text-align:left;line-height:1.2}";
2276
2296
 
2277
2297
  const CasinoEngagementSuiteModalContainer = class {
2278
2298
  constructor(hostRef) {
@@ -11,6 +11,7 @@ import '@everymatrix/casino-engagement-suite-modal-container';
11
11
  import { ChallengeLevelProgressStatus, ChallengeProgressStatus } from '../../models/casino-engagement-suite-config';
12
12
  import { getDeviceType, getScreenOrientation } from '../../utils/utils';
13
13
  import { MODAL_TYPES } from '../../utils/constants';
14
+ import differenceInSeconds from 'date-fns/differenceInSeconds';
14
15
  export class CasinoEngagementSuiteContainer {
15
16
  constructor() {
16
17
  /**
@@ -83,6 +84,19 @@ export class CasinoEngagementSuiteContainer {
83
84
  handleEvent(e) {
84
85
  const _a = e === null || e === void 0 ? void 0 : e.data, { type } = _a, rest = __rest(_a, ["type"]);
85
86
  switch (type) {
87
+ case 'ChallengeGrant': {
88
+ const newChallenge = e.data.data.challengeProgressData[0];
89
+ const index = this.challenges.findIndex(challenge => differenceInSeconds(new Date(challenge.ExpirationTime), new Date(newChallenge.ExpirationTime)) > 0);
90
+ if (index > -1) {
91
+ this.challenges.splice(index, 0, newChallenge);
92
+ }
93
+ else {
94
+ this.challenges.push(newChallenge);
95
+ }
96
+ this.challenges = [...this.challenges];
97
+ this.setChallengeLabel();
98
+ break;
99
+ }
86
100
  case 'ChallengeHasExpired': {
87
101
  this.setChallengePercent();
88
102
  break;
@@ -139,10 +153,6 @@ export class CasinoEngagementSuiteContainer {
139
153
  this.showJackpotDetails = true;
140
154
  break;
141
155
  }
142
- case 'UpdateChallenges': {
143
- this.setChallengeLabel();
144
- break;
145
- }
146
156
  case 'UpdateChallengeProgress': {
147
157
  this.updateChallengeProgress(e.data.data);
148
158
  break;
@@ -273,7 +283,8 @@ export class CasinoEngagementSuiteContainer {
273
283
  challenge.LevelProgresses = challenge.LevelProgresses.map(level => {
274
284
  var _a;
275
285
  const updatedLevel = (_a = data.Levels) === null || _a === void 0 ? void 0 : _a.find(l => l.LevelId === level.LevelId);
276
- return updatedLevel ? Object.assign(Object.assign({}, level), updatedLevel) : level;
286
+ return updatedLevel
287
+ ? Object.assign(Object.assign({}, level), { ProgressPercentage: updatedLevel.ProgressPercentage, ProgressStatus: updatedLevel.ProgressStatus }) : level;
277
288
  });
278
289
  this.challenges = [...this.challenges];
279
290
  }
@@ -45,12 +45,6 @@ function formatBalance(amount, currency) {
45
45
  return `${currency}${new Intl.NumberFormat('en', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
46
46
  .format(amount)}`;
47
47
  }
48
- function formatBetRange(amount, currency) {
49
- return `${currency}${new Intl.NumberFormat('en-US', {
50
- minimumFractionDigits: 0,
51
- maximumFractionDigits: 0,
52
- }).format(amount).replace(/,/g, ' ')}`;
53
- }
54
48
 
55
49
  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}";
56
50
 
@@ -239,11 +233,11 @@ const CasinoEngagementSuiteChallengesDetails = /*@__PURE__*/ proxyCustomElement(
239
233
  var _a, _b, _c, _d;
240
234
  const isAccumulativeLevelType = level.LevelTargetType === 0;
241
235
  if (isAccumulativeLevelType) {
242
- const formattedMinBet = formatBetRange((_a = level.BetRange) === null || _a === void 0 ? void 0 : _a.MinBet, this.challenge.CurrencySymbol);
243
- const formattedMaxBet = formatBetRange((_b = level.BetRange) === null || _b === void 0 ? void 0 : _b.MaxBet, this.challenge.CurrencySymbol);
236
+ const formattedMinBet = formatBalance((_a = level.BetRange) === null || _a === void 0 ? void 0 : _a.MinBet, this.challenge.CurrencySymbol);
237
+ const formattedMaxBet = formatBalance((_b = level.BetRange) === null || _b === void 0 ? void 0 : _b.MaxBet, this.challenge.CurrencySymbol);
244
238
  const formattedContributionPercentage = level.LevelContributionPercent + '%';
245
- const showMinBet = typeof ((_c = level.BetRange) === null || _c === void 0 ? void 0 : _c.MinBet) === 'number';
246
- const showMaxBet = typeof ((_d = level.BetRange) === null || _d === void 0 ? void 0 : _d.MaxBet) === 'number';
239
+ const showMinBet = !!((_c = level.BetRange) === null || _c === void 0 ? void 0 : _c.MinBet);
240
+ const showMaxBet = !!((_d = level.BetRange) === null || _d === void 0 ? void 0 : _d.MaxBet);
247
241
  const showContributionPercentage = level.LevelContributionPercent !== 100;
248
242
  if (showMinBet || showMaxBet || showContributionPercentage) {
249
243
  return (h("div", { class: 'ChallengeLevelBetDetails' }, showMinBet &&