@everymatrix/casino-challenges-overlay-drawer 0.5.29 → 0.5.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/casino-challenges-overlay-drawer/casino-challenge-details-events_21.entry.js +1 -1
- package/dist/casino-challenges-overlay-drawer/casino-challenges-overlay-drawer-b213ea71.js +1 -0
- package/dist/casino-challenges-overlay-drawer/index.esm.js +1 -1
- package/dist/cjs/casino-challenge-details-events_21.cjs.entry.js +14 -12
- package/dist/cjs/{casino-challenges-overlay-drawer-4a7b7ebd.js → casino-challenges-overlay-drawer-d7a92fc6.js} +2 -2
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/collection/components/casino-challenges-overlay-drawer/casino-challenges-overlay-drawer.js +2 -2
- package/dist/collection/components/components/casino-challenges-overlay-drawer-history/components/casino-challenge-drawer-history-item/casino-challenge-drawer-history-item.js +3 -3
- package/dist/esm/casino-challenge-details-events_21.entry.js +15 -13
- package/dist/esm/{casino-challenges-overlay-drawer-f0d4fe54.js → casino-challenges-overlay-drawer-b213ea71.js} +2 -2
- package/dist/esm/index.js +1 -1
- package/package.json +1 -1
- package/dist/casino-challenges-overlay-drawer/casino-challenges-overlay-drawer-f0d4fe54.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,h as i}from"./index-25fd45d2.js";const t="__WIDGET_GLOBAL_STYLE_CACHE__";function n(e,i){if(e){const t=document.createElement("style");t.innerHTML=i,e.appendChild(t)}}function s(e,i){if(!e||!i)return;const t=new URL(i);fetch(t.href).then((e=>e.text())).then((i=>{const t=document.createElement("style");t.innerHTML=i,e&&e.appendChild(t)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}function a(e,i,n,s=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!s)return n=function(e,i){const t=document.createElement("style");return window.emMessageBus.subscribe(i,(i=>{e&&(t.innerHTML=i,e.appendChild(t))}))}(e,i),n;window[t]||(window[t]={}),n=function(e,i){return window.emMessageBus.subscribe(i,(n=>{if(!e)return;const s=e.getRootNode(),a=window[t];let o=a[i]&&a[i].sheet;o?a[i].refCount=a[i].refCount+1:(o=new CSSStyleSheet,o.replaceSync(n),a[i]={sheet:o,refCount:1});const l=s.adoptedStyleSheets||[];l.includes(o)||(s.adoptedStyleSheets=[...l,o])}))}(e,i);const a=n.unsubscribe.bind(n);return n.unsubscribe=()=>{if(window[t][i]){const e=window[t][i];e.refCount>1?e.refCount=e.refCount-1:delete window[t][i]}a()},n}const o={en:{title:"Challenges",promo:"Promo",active:"Active",pendingTab:"Pending",finishedTab:"Finished",level:"Level",codeTab:"Code",endsIn:"Ends In",expired:"Expired",placeBetsOf:"Place bets of",place:"Place",bet:"bet",bets:"bets",minBet:"min bet",forfeited:"Forfeited",finished:"Finished",suspended:"Suspended",completed:"Completed",unavailable:"Unavailable",optOutModalTitle:"Opt out of challenge?",optOutModalDescription:"Current progress will be lost, but you will keep earned rewards. You will not be able to opt in for this challenge again.",optOutModalConfirm:"Opt Out",optOutModalCancel:"Cancel",optOutSuccessMessage:"You’ve opted out of the challenge.",deposit:"Deposit",depositAmountDescription:"to unlock the Challenge",noDepositAmountDescription:"Deposit any amount to unlock the Challenge",terms:"Terms & Conditions",time:"time",times:"times",winStakeRatio:"Win/Stake Ratio",promoTabEmptyHeader:"Nothing here - yet!",promoTabEmptyDescription:"No challenges at the moment. Try exploring events or keep playing to unlock new ones.",activeTabEmptyHeader:"No active challenges yet",activeTabEmptyDescription:"Check Promo tab to find available offers",pendingTabEmptyHeader:"No pending challenges yet",pendingTabEmptyDescription:"Check Promo tab to find available offers",finishedTabEmptyHeader:"No finished challenges yet",finishedTabEmptyDescription:"Check Promo tab to find available offers",claimCodeTitle:"Enter the secret code to unlock hidden quests and rewards.",claimCodeSuccessMessage:"The code was successfully applied.",claimCodeInputLabel:"3–30 characters, no spaces",claimCodeBtnText:"Apply Code",claimCodeError:"Invalid format. Use Latin letters, numbers, or symbols.",claimCodeDescription:"Enter code to unlock the challenge",status:"Status",grantClaimByButtonSuccessMessage:"Challenge has been triggered successfully and is now available on the Active tab"}},l=(e,i)=>o[void 0!==i&&i in o?i:"en"][e],r=async e=>{if(e)try{const t=await fetch(e);if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);const n=await t.json();i=n,Object.keys(i).forEach((e=>{o[e]||(o[e]={});for(let t in i[e])o[e][t]=i[e][t]}))}catch(e){console.error("Failed to fetch or parse translations from URL:",e)}var i};var h,c,d,g,M,u,p,b,m,z,w,v,y,f,x,C;!function(e){e[e.Accumulative=0]="Accumulative",e[e.SingleBet=1]="SingleBet",e[e.MultipleOneBetSize=2]="MultipleOneBetSize",e[e.BetMultiplier=3]="BetMultiplier"}(h||(h={})),function(e){e[e.Single=0]="Single",e[e.Daily=1]="Daily",e[e.Weekly=2]="Weekly",e[e.Monthly=3]="Monthly"}(c||(c={})),function(e){e[e.FreeSpins=0]="FreeSpins",e[e.LuckyWheel=1]="LuckyWheel",e[e.Leaderboard=2]="Leaderboard",e[e.Challenge=3]="Challenge",e[e.Custom=4]="Custom"}(d||(d={})),function(e){e[e.Closed=0]="Closed",e[e.InProgress=1]="InProgress",e[e.Fillup=2]="Fillup",e[e.Completed=3]="Completed"}(g||(g={})),function(e){e[e.Started=0]="Started",e[e.InProgress=1]="InProgress",e[e.PendingLevelReward=2]="PendingLevelReward",e[e.Completed=3]="Completed",e[e.Expired=4]="Expired",e[e.Forfeited=5]="Forfeited",e[e.Awaiting=6]="Awaiting",e[e.Paused=7]="Paused",e[e.Unavailable=8]="Unavailable"}(M||(M={})),function(e){e[e.Draft=0]="Draft",e[e.Enabled=1]="Enabled",e[e.Paused=2]="Paused",e[e.Closed=3]="Closed",e[e.Deleted=4]="Deleted"}(u||(u={})),function(e){e[e.GameLaunch=0]="GameLaunch",e[e.Reward=1]="Reward",e[e.Manual=2]="Manual",e[e.Claim=3]="Claim",e[e.Event=4]="Event",e[e.Deposit=5]="Deposit",e[e.ClaimByButton=6]="ClaimByButton"}(p||(p={})),function(e){e[e.Period=0]="Period",e[e.Date=1]="Date"}(b||(b={})),function(e){e[e.Casino=0]="Casino",e[e.Any=1]="Any",e[e.Sportsbook=2]="Sportsbook"}(m||(m={})),function(e){e[e.Any=0]="Any",e[e.Live=1]="Live",e[e.PreLive=2]="PreLive"}(z||(z={})),function(e){e[e.Single=0]="Single",e[e.Multiple=1]="Multiple",e[e.System=2]="System"}(w||(w={})),function(e){e[e.Any=0]="Any",e[e.BankerOnly=1]="BankerOnly",e[e.NotBankerOnly=2]="NotBankerOnly"}(v||(v={})),function(e){e[e.Any=0]="Any",e[e.BetBuilderOnly=1]="BetBuilderOnly",e[e.NotBetBuilderOnly=2]="NotBetBuilderOnly"}(y||(y={})),function(e){e[e.RealCash=0]="RealCash",e[e.BonusMoney=1]="BonusMoney",e[e.Mixed=2]="Mixed"}(f||(f={})),function(e){e[e.Promo=0]="Promo",e[e.Active=1]="Active",e[e.Pending=2]="Pending",e[e.Finished=3]="Finished",e[e.Code=4]="Code"}(x||(x={})),function(e){e[e.Levels=0]="Levels",e[e.Games=1]="Games",e[e.Events=2]="Events",e[e.Rules=3]="Rules"}(C||(C={}));const N=["Completed","Expired","Forfeited"];var j,D,I,_;!function(e){e[e.Completed=0]="Completed",e[e.Expired=1]="Expired",e[e.Forfeited=2]="Forfeited"}(j||(j={})),function(e){e.ChallengesHistory="ChallengesHistoryRequest",e.ChallengePromoTab="ChallengePromoTabRequest",e.ClaimChallengeByCode="ClaimChallengeByCodeRequest",e.ChallengeJoin="ChallengeJoinRequest",e.RedirectToDepositPage="RedirectToDepositPage",e.ClaimChallengeByButton="ClaimChallengeByButtonRequest",e.GetChallengeGames="GetChallengeGamesRequest",e.ChallengeIsNew="ChallengeIsNewRequest",e.ChallengeInGameRedirect="ChallengeInGameRedirect",e.ForfeitChallenge="ForfeitChallengeRequest"}(D||(D={})),function(e){e.ChallengesHistory="ChallengesHistoryResponse",e.ChallengePromoTab="ChallengePromoTabResponse",e.ClaimChallengeByCode="ClaimChallengeByCodeResponse",e.ChallengeJoin="ChallengeJoinResponse",e.ClaimChallengeByButton="ClaimChallengeByButtonResponse",e.GetChallengeGames="GetChallengeGamesResponse",e.ChallengeIsNew="ChallengeIsNewResponse",e.ForfeitChallenge="ForfeitChallengeResponse",e.ChangeChallengeProgressStatus="ChangeChallengeProgressStatus",e.ChallengeChangeStatusNotification="ChallengeChangeStatusNotification",e.ChallengeForfeitNotification="ChallengeForfeitNotification",e.UpdateChallengeProgress="UpdateChallengeProgress",e.NewChallengeProgressGranted="NewChallengeProgressGranted"}(I||(I={})),function(e){e.PromoTab="promo",e.PendingTab="pending",e.FinishedTab="finished",e.CodeTab="code"}(_||(_={}));const A=class{constructor(t){e(this,t),this.EMPTY_STATE_PAGE_DESCRIPTION_MAP={[x.Promo]:{header:"promoTabEmptyHeader",description:"promoTabEmptyDescription"},[x.Active]:{header:"activeTabEmptyHeader",description:"activeTabEmptyDescription"},[x.Pending]:{header:"pendingTabEmptyHeader",description:"pendingTabEmptyDescription"},[x.Finished]:{header:"finishedTabEmptyHeader",description:"finishedTabEmptyDescription"}},this.onActiveChallengeChange=e=>{var i,t,n;(null==e?void 0:e.detail)&&(this.removeOptedOutChallenge(),this.updateActiveChallenge(this.activeTabIndex===x.Active?null===(i=this.activeChallenges)||void 0===i?void 0:i.find((i=>(null==i?void 0:i.Id)===e.detail)):this.activeTabIndex===x.Pending?null===(t=this.pendingChallenges)||void 0===t?void 0:t.find((i=>(null==i?void 0:i.Id)===e.detail)):null===(n=this.promoChallenges)||void 0===n?void 0:n.find((i=>(null==i?void 0:i.Id)===e.detail))))},this.onSeeMoreClick=e=>{this.detailsSubPageInfo={open:e.detail.open,tab:e.detail.tab}},this.onLoadMorePlayerHistory=e=>{window.postMessage({type:D.ChallengesHistory,data:e.detail})},this.isInactiveChallenge=e=>[M.Awaiting,M.Forfeited,M.Completed,M.Expired].includes(e.Status)||e.ChallengeStatus===u.Paused,this.updateActiveChallenge=e=>{var i;this.activeChallenge=e,this.activeProgressId=null===(i=this.activeChallenge)||void 0===i?void 0:i.Id},this.removeOptedOutChallenge=()=>{var e;this.isOptedOut&&(this.isOptedOut=!1,this.activeChallenges=null===(e=this.activeChallenges)||void 0===e?void 0:e.filter((e=>{var i;return(null==e?void 0:e.Id)!==(null===(i=this.activeChallenge)||void 0===i?void 0:i.Id)})),this.activeChallenge=null)},this.handleTabClick=e=>{e.detail!==this.activeTabIndex&&(this.removeOptedOutChallenge(),this.activeTabIndex=e.detail,this.activeTabIndex===x.Promo&&window.postMessage({type:D.ChallengePromoTab,data:{}}),this.activeTabIndex===x.Active&&this.updateActiveChallenge(this.activeChallenges[0]),this.activeTabIndex===x.Pending&&this.updateActiveChallenge(this.pendingChallenges[0]),this.activeTabIndex===x.Finished&&window.postMessage({type:D.ChallengesHistory,data:{PageSize:20,PageNumber:0}}),e.detail!==x.Code&&(this.emptyState=this.EMPTY_STATE_PAGE_DESCRIPTION_MAP[e.detail]))},this.openNotification=e=>{this.notification=e,setTimeout((()=>this.notification=null),1e4)},this.renderNotification=()=>{var e,t,n,s,a,o;return i("div",{class:"notification "+((null===(e=this.notification)||void 0===e?void 0:e.errored)?"errored":"")},i("div",{class:"row"},i("img",{src:(null===(t=this.notification)||void 0===t?void 0:t.errored)?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUiIGhlaWdodD0iMTUiIHZpZXdCb3g9IjAgMCAxNSAxNSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03LjMzMzMzIDEuMzMzMzNDNC4wMTk2MiAxLjMzMzMzIDEuMzMzMzMgNC4wMTk2MiAxLjMzMzMzIDcuMzMzMzNDMS4zMzMzMyAxMC42NDcgNC4wMTk2MiAxMy4zMzMzIDcuMzMzMzMgMTMuMzMzM0MxMC42NDcgMTMuMzMzMyAxMy4zMzMzIDEwLjY0NyAxMy4zMzMzIDcuMzMzMzNDMTMuMzMzMyA0LjAxOTYyIDEwLjY0NyAxLjMzMzMzIDcuMzMzMzMgMS4zMzMzM1pNMCA3LjMzMzMzQzAgMy4yODMyNSAzLjI4MzI1IDAgNy4zMzMzMyAwQzExLjM4MzQgMCAxNC42NjY3IDMuMjgzMjUgMTQuNjY2NyA3LjMzMzMzQzE0LjY2NjcgMTEuMzgzNCAxMS4zODM0IDE0LjY2NjcgNy4zMzMzMyAxNC42NjY3QzMuMjgzMjUgMTQuNjY2NyAwIDExLjM4MzQgMCA3LjMzMzMzWk03LjMzMzMzIDRDNy43MDE1MiA0IDggNC4yOTg0OCA4IDQuNjY2NjdWNy4zMzMzM0M4IDcuNzAxNTIgNy43MDE1MiA4IDcuMzMzMzMgOEM2Ljk2NTE0IDggNi42NjY2NyA3LjcwMTUyIDYuNjY2NjcgNy4zMzMzM1Y0LjY2NjY3QzYuNjY2NjcgNC4yOTg0OCA2Ljk2NTE0IDQgNy4zMzMzMyA0Wk02LjY2NjY3IDEwQzYuNjY2NjcgOS42MzE4MSA2Ljk2NTE0IDkuMzMzMzMgNy4zMzMzMyA5LjMzMzMzSDcuMzRDNy43MDgxOSA5LjMzMzMzIDguMDA2NjcgOS42MzE4MSA4LjAwNjY3IDEwQzguMDA2NjcgMTAuMzY4MiA3LjcwODE5IDEwLjY2NjcgNy4zNCAxMC42NjY3SDcuMzMzMzNDNi45NjUxNCAxMC42NjY3IDYuNjY2NjcgMTAuMzY4MiA2LjY2NjY3IDEwWiIgZmlsbD0iI0ZGNEQ0RiIvPgo8L3N2Zz4K":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUiIGhlaWdodD0iMTUiIHZpZXdCb3g9IjAgMCAxNSAxNSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03LjMzMzMzIDEuMzMzMzNDNC4wMTk2MiAxLjMzMzMzIDEuMzMzMzMgNC4wMTk2MiAxLjMzMzMzIDcuMzMzMzNDMS4zMzMzMyAxMC42NDcgNC4wMTk2MiAxMy4zMzMzIDcuMzMzMzMgMTMuMzMzM0MxMC42NDcgMTMuMzMzMyAxMy4zMzMzIDEwLjY0NyAxMy4zMzMzIDcuMzMzMzNDMTMuMzMzMyA0LjAxOTYyIDEwLjY0NyAxLjMzMzMzIDcuMzMzMzMgMS4zMzMzM1pNMCA3LjMzMzMzQzAgMy4yODMyNSAzLjI4MzI1IDAgNy4zMzMzMyAwQzExLjM4MzQgMCAxNC42NjY3IDMuMjgzMjUgMTQuNjY2NyA3LjMzMzMzQzE0LjY2NjcgMTEuMzgzNCAxMS4zODM0IDE0LjY2NjcgNy4zMzMzMyAxNC42NjY3QzMuMjgzMjUgMTQuNjY2NyAwIDExLjM4MzQgMCA3LjMzMzMzWk0xMC44MDQ3IDQuODYxOTNDMTEuMDY1MSA1LjEyMjI4IDExLjA2NTEgNS41NDQzOSAxMC44MDQ3IDUuODA0NzRMNi44MDQ3NCA5LjgwNDc0QzYuNTQ0MzkgMTAuMDY1MSA2LjEyMjI4IDEwLjA2NTEgNS44NjE5MyA5LjgwNDc0TDMuODYxOTMgNy44MDQ3NEMzLjYwMTU4IDcuNTQ0MzkgMy42MDE1OCA3LjEyMjI4IDMuODYxOTMgNi44NjE5M0M0LjEyMjI4IDYuNjAxNTggNC41NDQzOSA2LjYwMTU4IDQuODA0NzQgNi44NjE5M0w2LjMzMzMzIDguMzkwNTJMOS44NjE5MyA0Ljg2MTkzQzEwLjEyMjMgNC42MDE1OCAxMC41NDQ0IDQuNjAxNTggMTAuODA0NyA0Ljg2MTkzWiIgZmlsbD0iIzAwRkE1QSIvPgo8L3N2Zz4K",class:"notification__icon",alt:""}),i("p",{class:"notification__message"},null!==(a=l(null!==(s=null===(n=this.notification)||void 0===n?void 0:n.message)&&void 0!==s?s:"",this.language))&&void 0!==a?a:null===(o=this.notification)||void 0===o?void 0:o.message)))},this.renderHeader=e=>i("div",null,i("h1",{class:"challenges__drawer__title"},i("span",null,l("title",this.language)),i("button",{class:"challenges__drawer__close",onClick:this.onCloseClick},i("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTIuNSAxNy41TDE3LjUgMi41IiBzdHJva2U9IndoaXRlIiBzdHJva2Utd2lkdGg9IjEuMDA0NTkiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+CjxwYXRoIGQ9Ik0yLjUgMi41TDE3LjUgMTcuNSIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIxLjAwNDU5IiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K",alt:""}))),this.enabledWidgetTabs.length>0&&i("casino-challenges-overlay-tabs",{onTabClick:this.handleTabClick,activeTabIndex:this.activeTabIndex,activeTabHasNotification:!1,pendingTabHasNotification:!1,language:this.language,"is-mobile":e,enabledWidgetTabs:this.enabledWidgetTabs})),this.isEmptyState=()=>{if(!this.loading&&this.activeTabIndex!==x.Code){if(this.activeTabIndex===x.Active&&!this.activeChallenges.length)return!0;if(this.activeTabIndex===x.Pending&&!this.pendingChallenges.length)return!0;if(this.activeTabIndex===x.Promo&&!this.promoChallenges.length)return!0;if(this.activeTabIndex===x.Finished&&!this.playerHistory.length)return!0}return!1},this.renderEmptyState=e=>{var t,n;return i("div",null,this.renderHeader(e),i("casino-challenges-empty-state",{header:l(null===(t=this.emptyState)||void 0===t?void 0:t.header,this.language),description:l(null===(n=this.emptyState)||void 0===n?void 0:n.description,this.language),"is-mobile":e}))},this.renderFinishedTab=e=>i("div",null,this.renderHeader(e),i("casino-challenges-overlay-drawer-history",{mbSource:this.mbSource,clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,translationUrl:this.translationUrl,language:this.language,isMobile:e,historyItems:this.playerHistory,hasMore:this.hasMorePlayerHistory,onLoadMore:this.onLoadMorePlayerHistory,loading:this.loading})),this.renderCodeTab=e=>i("div",null,this.renderHeader(e),i("casino-challenges-claim-code",{"is-mobile":e,translationUrl:this.translationUrl,language:this.language})),this.renderChallengeDetails=(e,t=!1)=>i("casino-challenges-overlay-drawer-details",{translationUrl:this.translationUrl,language:this.language,challenge:this.activeChallenge,swipped:this.swipped,progress:this.progress,"is-mobile":e,"is-unique":t,"is-opted-out":this.isOptedOut,"active-challenges-tab-index":this.activeTabIndex,onSeeMoreClick:this.onSeeMoreClick,detailsSubPageInfo:this.detailsSubPageInfo,challengeGames:this.challengeGames,onCloseClick:this.onCloseClick}),this.renderChallengesTabs=e=>{const t=this.activeTabIndex===x.Active?this.activeChallenges:this.activeTabIndex===x.Pending?this.pendingChallenges:this.promoChallenges,n=1===t.length;return i("swipe-up",{onSwippedUp:e=>{this.swipped=e.detail.swipped,this.progress=e.detail.progress},isMobile:e,isOneSlider:n},i("div",{class:"content-header",slot:"header"},this.renderHeader(e),i("div",{class:{"content-spacer":this.swipped||!e,"one-slide":n&&this.swipped}},i("casino-challenges-overlay-slider",{mbSource:this.mbSource,clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,translationUrl:this.translationUrl,language:this.language,challenges:t,isMobile:e,onActiveChallengeChange:this.onActiveChallengeChange,initialProgressId:this.activeProgressId,activeTabIndex:this.activeTabIndex}))),i("div",{class:"content-details",slot:"details",style:{overflow:this.swipped?"auto":"hidden"}},this.renderChallengeDetails(e,n)))},this.onCloseClick=()=>{var e,i;this.pendingChallenges=null===(e=this.pendingChallenges)||void 0===e?void 0:e.filter((e=>e.Status===M.Awaiting)),this.activeChallenges=null===(i=this.activeChallenges)||void 0===i?void 0:i.filter((e=>!this.isInactiveChallenge(e))),this.detailsSubPageInfo={open:!1,tab:null},this.loading=!1,this.isOptedOut=!1,this.handleClose()},this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.translationUrl="",this.language="en",this.isOpen=!1,this.handleClose=()=>{},this.challenges=[],this.initialProgressId="",this.enabledWidgetTabs=void 0,this.activeChallenge=null,this.activeProgressId="",this.activeTabIndex=x.Active,this.error="",this.hasError=!1,this.swipped=!1,this.detailsSubPageInfo=void 0,this.progress=0,this.loading=!1,this.notification=null,this.optOutModaIsOpen=!1,this.isOptedOut=!1,this.prevUpdateEvent=void 0,this.challengeGames=[],this.activeChallenges=[],this.pendingChallenges=[],this.promoChallenges=[],this.playerHistory=[],this.hasMorePlayerHistory=!1,this.emptyState={header:"activeTabEmptyHeader",description:"activeTabEmptyDescription"}}handleClientStylingChange(e,i){e!=i&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(e,i){e!=i&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(e,i){e!=i&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}handleIsOpenChange(e){var i;if(e)if(this.initialProgressId&&this.challenges.length||!this.enabledWidgetTabs.includes(_.PromoTab)){this.activeTabIndex=x.Active,this.activeProgressId=this.initialProgressId;const e=(null===(i=this.activeChallenges)||void 0===i?void 0:i.find((e=>e.Id===this.activeProgressId)))||this.activeChallenges[0];this.updateActiveChallenge(e||null)}else this.activeTabIndex=x.Promo,window.postMessage({type:D.ChallengePromoTab,data:{}})}onActiveChallengeChanged(){this.challengeGames=[]}onOpenOptOut(){this.optOutModaIsOpen=!0}onCloseOptOut(){this.optOutModaIsOpen=!1}onConfirmOptOut(){window.postMessage({type:D.ForfeitChallenge,data:{ChallengeId:this.activeChallenge.ChallengeId}})}onChallengeExpired(e){if(null==e?void 0:e.detail)switch(this.activeTabIndex){case x.Active:this.activeChallenges=this.updateChallenge(this.activeChallenges,e.detail,{Status:M.Expired});break;case x.Pending:this.pendingChallenges=this.updateChallenge(this.pendingChallenges,e.detail,{Status:M.Expired});break;case x.Promo:this.promoChallenges=this.updateChallenge(this.promoChallenges,e.detail,{Status:M.Expired})}}handleEvent(e){var i,t,n,s;const{type:a,data:o,success:r,errorMessage:h}=null==e?void 0:e.data;switch(console.log("\nReceived event: ",null==e?void 0:e.data.type),console.log(e),a){case I.ChallengePromoTab:r?(this.promoChallenges=o||[],this.updateActiveChallenge(this.promoChallenges[0])):(this.promoChallenges=[],this.updateActiveChallenge(null),this.openNotification({message:h,errored:!0})),this.loading=!1;break;case I.ChallengesHistory:r?(this.playerHistory=this.playerHistory.length<(null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.totalItem)?[...this.playerHistory,...o]:o,this.hasMorePlayerHistory=(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.totalItem)>this.playerHistory.length):this.openNotification({message:h,errored:!0}),this.loading=!1;break;case I.ClaimChallengeByCode:r?(this.openNotification({message:l("claimCodeSuccessMessage",this.language)}),this.activeChallenges=[...this.activeChallenges,o]):this.openNotification({message:h,errored:!0}),this.loading=!1;break;case I.ChallengeJoin:if(r){const e=[M.Paused,M.Started].includes(null===(n=this.activeChallenge)||void 0===n?void 0:n.Status);this.activeChallenges=this.updateChallenge(this.activeChallenges,e?null==o?void 0:o.joinId:null==o?void 0:o.unjoinId,{Status:e?M.InProgress:M.Paused})}else this.openNotification({message:h,errored:!0});this.loading=!1;break;case I.ChallengeIsNew:r?this.updateChallengeByProgressId(null==o?void 0:o.challengeProgressId,{IsNew:!1}):this.openNotification({message:h,errored:!0});break;case I.GetChallengeGames:r?this.challengeGames=o:this.openNotification({message:h,errored:!0}),this.loading=!1;break;case I.ClaimChallengeByButton:if(r){const e=Array.isArray(o)?o[0]:o;e&&(e.IsNew=!1,this.activeChallenges=[...this.activeChallenges,e],this.updateActiveChallenge(e),this.activeTabIndex=x.Active,this.openNotification({message:l("grantClaimByButtonSuccessMessage",this.language)}))}else this.openNotification({message:h,errored:!0});this.loading=!1;break;case I.ForfeitChallenge:this.optOutModaIsOpen=!1,r?(this.openNotification({message:l("optOutSuccessMessage",this.language)}),this.detailsSubPageInfo={open:!1,tab:null},this.isOptedOut=!0):this.openNotification({message:h,errored:!0}),this.loading=!1;break;case I.ChangeChallengeProgressStatus:this.updateChallengeByProgressId(null==o?void 0:o.ChallengeProgressId,{Status:null==o?void 0:o.ChallengeProgressStatus});break;case I.ChallengeChangeStatusNotification:this.updateChallengeById(null==o?void 0:o.ChallengeId,{ChallengeStatus:(null==o?void 0:o.IsEnabled)?u.Enabled:u.Paused});break;case I.ChallengeForfeitNotification:this.updateChallengeById(null==o?void 0:o.ChallengeId,{Status:M.Forfeited});break;case I.UpdateChallengeProgress:{const e=o;if(!((e,i)=>{if(!e)return!0;if(e.ProgressId!==i.ProgressId)return!0;if(e.Levels.length!==i.Levels.length)return!0;for(let t=0;t<i.Levels.length;t++){const n=e.Levels[t],s=i.Levels[t];if(n.LevelId!==s.LevelId||n.ProgressStatus!==s.ProgressStatus||n.ProgressPercentage!==s.ProgressPercentage)return!0}return!1})(this.prevUpdateEvent,e))return;this.prevUpdateEvent=e,this.activeChallenges=null===(s=this.activeChallenges)||void 0===s?void 0:s.map((i=>{if(i.Id!==(null==e?void 0:e.ProgressId))return i;const t=i.LevelProgresses.map((i=>{const t=null==e?void 0:e.Levels.find((e=>e.LevelId===i.LevelId));return t?Object.assign(Object.assign({},i),{ProgressStatus:t.ProgressStatus,ProgressPercentage:t.ProgressPercentage}):i}));return Object.assign(Object.assign({},i),{Status:null==e?void 0:e.Status,LevelProgresses:t})}));break}case I.NewChallengeProgressGranted:const a=(null==o?void 0:o.Status)===M.Awaiting,c=a?this.pendingChallenges:this.activeChallenges;if(null==c?void 0:c.some((e=>e.Id===(null==o?void 0:o.Id))))break;a?(this.pendingChallenges=[...c,o],this.activeTabIndex===x.Pending&&1===this.pendingChallenges.length&&this.updateActiveChallenge(o)):(this.activeChallenges=[...c,o],this.activeTabIndex===x.Active&&1===this.activeChallenges.length&&this.updateActiveChallenge(o));break;case D.ChallengeJoin:case D.GetChallengeGames:case D.ClaimChallengeByButton:case D.RedirectToDepositPage:case D.ChallengeInGameRedirect:case D.ChallengesHistory:case D.ChallengePromoTab:case D.ClaimChallengeByCode:case D.ForfeitChallenge:this.loading=!0}}componentWillLoad(){var e;if(this.translationUrl&&r(this.translationUrl),null===(e=this.challenges)||void 0===e?void 0:e.length){const e=[...this.challenges];this.pendingChallenges=e.filter((e=>e.Status===M.Awaiting)),this.activeChallenges=e.filter((e=>!this.isInactiveChallenge(e)))}}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}updateChallenge(e,i,t){var n;return(null===(n=this.activeChallenge)||void 0===n?void 0:n.Id)===i&&(this.activeChallenge=Object.assign(Object.assign({},this.activeChallenge),t)),e.map((e=>e.Id===i?Object.assign(Object.assign({},e),t):e))}updateChallengeList(e,i,t){let n=!1;const s=e.map((e=>e.ChallengeId===i?(n=!0,Object.assign(Object.assign({},e),t)):e));return n?s:e}updateChallengeById(e,i){var t;(null===(t=this.activeChallenge)||void 0===t?void 0:t.ChallengeId)===e&&(this.activeChallenge=Object.assign(Object.assign({},this.activeChallenge),i)),this.activeChallenges=this.updateChallengeList(this.activeChallenges,e,i),this.pendingChallenges=this.updateChallengeList(this.pendingChallenges,e,i),this.promoChallenges=this.updateChallengeList(this.promoChallenges,e,i)}updateChallengeByProgressId(e,i){var t;(null===(t=this.activeChallenge)||void 0===t?void 0:t.Id)===e&&(this.activeChallenge=Object.assign(Object.assign({},this.activeChallenge),i)),this.activeChallenges.find((i=>i.Id===e))?this.activeChallenges=this.activeChallenges.map((t=>t.Id===e?Object.assign(Object.assign({},t),i):t)):this.pendingChallenges.find((i=>i.Id===e))?this.pendingChallenges=this.pendingChallenges.map((t=>t.Id===e?Object.assign(Object.assign({},t),i):t)):this.promoChallenges=this.promoChallenges.map((t=>t.Id===e?Object.assign(Object.assign({},t),i):t))}renderContent(e,t){var n;if(t)return this.renderEmptyState(e);if(null===(n=this.detailsSubPageInfo)||void 0===n?void 0:n.open)return i("div",{class:"content-sub-page",slot:"details"},this.renderChallengeDetails(e));switch(this.activeTabIndex){case x.Promo:case x.Active:case x.Pending:return this.renderChallengesTabs(e);case x.Code:return this.renderCodeTab(e);case x.Finished:return this.renderFinishedTab(e);default:return}}render(){if(!this.isOpen)return;const e=(()=>{let e=window.navigator.userAgent;return!!(e.toLowerCase().match(/android/i)||e.toLowerCase().match(/blackberry|bb/i)||e.toLowerCase().match(/iphone|ipad|ipod/i)||e.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i))})()||window.innerWidth<=768,t=this.isEmptyState();return i("div",{ref:e=>this.stylingContainer=e,class:{container:!0,open:this.isOpen,mobile:e}},i("div",{class:"challenges__backdrop",onClick:this.onCloseClick}),i("div",{class:"challenges__drawer"},i("casino-challenge-overlay-background",{empty:t}),i("div",{class:"challenges__drawer__content"},this.renderContent(e,t)),this.loading&&i("casino-challenges-overlay-loader",{"full-size":!0,"is-mobile":e}),i("casino-challenge-opt-out-modal",{open:this.optOutModaIsOpen,"is-mobile":e,language:this.language})),this.notification&&this.renderNotification())}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"],isOpen:["handleIsOpenChange"],activeChallenge:["onActiveChallengeChanged"]}}};A.style='@import url("https://fonts.googleapis.com/css2?family=Teachers:ital,wght@0,400..800;1,400..800&display=swap");\n.container {\n z-index: 301;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n pointer-events: none;\n container-name: challenges-game-page;\n container-type: size;\n}\n.container.open {\n pointer-events: auto;\n}\n\n.mobile .challenges__drawer {\n width: 100%;\n height: 100%;\n left: 0;\n bottom: 0;\n border-radius: 0;\n backdrop-filter: blur(16px);\n border: none;\n max-width: none;\n min-width: initial;\n}\n.mobile .challenges__drawer .content-spacer {\n margin-bottom: 32px;\n}\n.mobile .challenges__drawer .content-spacer.one-slide {\n margin-bottom: 38px;\n}\n.mobile .challenges__drawer__content {\n padding: 16px 0 0;\n}\n.mobile .challenges__drawer__content .content-details {\n height: calc(100% - 30px);\n}\n.mobile .challenges__drawer__title {\n height: 26px;\n font-size: var(--emw--font-size-large, 18px);\n}\n.mobile .challenges__drawer__close {\n right: 16px;\n width: 26px;\n height: 26px;\n}\n.mobile .challenges__drawer__close img {\n width: 14px;\n}\n.mobile .challenges__backdrop {\n display: none;\n}\n.mobile .notification {\n padding: 8px 16px;\n gap: 8px;\n}\n.mobile .notification .row {\n margin: 15px 0 14px 0;\n}\n.mobile .notification__icon {\n width: 16px;\n height: 16px;\n}\n.mobile .notification__message {\n font-size: var(--emw--font-size-small, 14px);\n}\n\n.challenges__drawer {\n z-index: 302;\n position: fixed;\n left: 62px;\n bottom: 76px;\n border: 1px solid var(--emw--color-container-border, rgba(255, 255, 255, 0.0705882353));\n background: var(--emw--color-Overlay-Background, rgba(9, 9, 9, 0.8));\n backdrop-filter: blur(11px);\n box-sizing: border-box;\n width: 35%;\n min-width: 400px;\n max-width: 600px;\n height: calc(100% - 20px - 76px);\n border-radius: 30px;\n opacity: 1;\n font-family: var(--emw--font-family-primary, "Teachers"), sans-serif;\n container-name: challenges-drawer;\n container-type: size;\n}\n.challenges__drawer__title {\n height: 36px;\n color: var(--emw--color-title, #edeff2);\n text-align: center;\n font-size: var(--emw--font-size-large-xl, 22px);\n font-weight: var(--emw--font-weight-semibold, 600);\n margin: 0;\n position: relative;\n z-index: 1;\n align-content: center;\n}\n.challenges__drawer__close {\n outline: none;\n background: transparent;\n border-radius: 20px;\n border: 1.5px solid var(--emw--color-container-border, rgba(255, 255, 255, 0.0705882353));\n background: var(--emw--color-container-background, rgba(9, 9, 9, 0.5019607843));\n backdrop-filter: blur(6.882352829px);\n cursor: pointer;\n width: 36px;\n height: 36px;\n min-width: 36px;\n min-height: 36px;\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: 0;\n right: 24px;\n}\n.challenges__drawer__content {\n height: 100%;\n position: relative;\n z-index: 2;\n padding: 24px 0 0;\n box-sizing: border-box;\n}\n.challenges__drawer__content .content-header {\n width: 100%;\n flex-shrink: 0;\n}\n.challenges__drawer__content .content-details {\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n}\n.challenges__drawer__content .content-sub-page {\n display: flex;\n height: 100%;\n}\n.challenges__drawer .content-spacer {\n margin-bottom: 24px;\n}\n.challenges__drawer, .challenges__drawer * {\n scrollbar-width: thin;\n scrollbar-color: var(--emw--color-gray-250, rgba(255, 255, 255, 0.3)) transparent;\n}\n.challenges__drawer::-webkit-scrollbar, .challenges__drawer *::-webkit-scrollbar {\n width: 3px;\n}\n.challenges__drawer::-webkit-scrollbar-track, .challenges__drawer *::-webkit-scrollbar-track {\n background: transparent;\n}\n.challenges__drawer::-webkit-scrollbar-thumb, .challenges__drawer *::-webkit-scrollbar-thumb {\n background: var(--emw--color-gray-250, rgba(255, 255, 255, 0.3));\n opacity: 0.3;\n border-radius: 999px;\n transition: none;\n width: 3px;\n}\n.challenges__drawer::-webkit-scrollbar-thumb:hover, .challenges__drawer *::-webkit-scrollbar-thumb:hover {\n background: var(--emw--color-gray-250, rgba(255, 255, 255, 0.3));\n opacity: 0.3;\n width: 3px;\n}\n.challenges__drawer::-webkit-scrollbar-button, .challenges__drawer *::-webkit-scrollbar-button {\n display: none;\n}\n.challenges__backdrop {\n border: none;\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: var(--emw--color-gray-backdrop, rgba(0, 0, 0, 0.6));\n box-shadow: -5px 0 0 0 var(--emw--color-gray-backdrop, rgba(0, 0, 0, 0.6));\n z-index: 301;\n opacity: 1;\n}\n\n.notification {\n display: flex;\n position: fixed;\n z-index: 400;\n align-items: center;\n bottom: 76px;\n right: 0;\n padding: 24px;\n gap: 12px;\n max-width: 445px;\n box-sizing: border-box;\n border-radius: 20px 0 0 20px;\n border-top: 1px solid var(--emw--status-badge-success-color, #d6fff0);\n border-bottom: 1px solid var(--emw--status-badge-success-color, #d6fff0);\n border-left: 1px solid var(--emw--status-badge-success-color, #d6fff0);\n background: var(--emw--background-success-notification, linear-gradient(112deg, rgba(74, 255, 135, 0.2) 0%, rgba(74, 255, 135, 0) 100%));\n backdrop-filter: blur(16px);\n color: var(--emw--color-white, #ffffff);\n font-family: var(--emw--font-family-primary, "Teachers"), sans-serif;\n}\n.notification.errored {\n border-top: 1px solid var(--emw--status-badge-red-bg, #d63d1e);\n border-bottom: 1px solid var(--emw--status-badge-red-bg, #d63d1e);\n border-left: 1px solid var(--emw--status-badge-red-bg, #d63d1e);\n background: var(--emw--background-error-notification, rgba(9, 9, 9, 0.4));\n}\n.notification .row {\n display: flex;\n align-items: flex-start;\n}\n.notification__icon {\n width: 18px;\n height: 18px;\n margin-right: 12px;\n}\n.notification__message {\n margin: 0;\n font-size: var(--emw--font-size-medium, 16px);\n font-weight: var(--emw--font-weight-medium, 500);\n}\n.notification__message .active-tab {\n color: var(--emw--border-success-color, #00b74f);\n text-decoration-line: underline;\n cursor: pointer;\n}\n\ncasino-challenges-overlay-drawer-details {\n flex: 1;\n}\n\n@container challenges-game-page (width <= 1430px) {\n .challenges__drawer {\n width: 40%;\n left: 45px;\n }\n}\n@container challenges-game-page (width <= 1250px) {\n .challenges__drawer {\n width: 45%;\n }\n}\n@container challenges-game-page (width <= 1000px) {\n .challenges__drawer {\n width: 50%;\n left: 25px;\n }\n}\n@container challenges-game-page (width <= 800px) {\n .challenges__drawer__content {\n padding: 20px 0 0;\n }\n}\n@container challenges-game-page (height <= 850px) {\n .challenges__drawer {\n bottom: 36px;\n height: calc(100% - 20px - 36px);\n }\n .challenges__drawer .content-spacer {\n margin-bottom: 18px;\n }\n}\n@container challenges-drawer (height <= 760px) {\n .challenges__drawer .content-spacer {\n margin-bottom: 12px;\n }\n}';export{A as C,j as E,N as H,D as a,s as b,a as c,x as d,_ as e,r,n as s,l as t}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{C as CasinoChallengesOverlayDrawer}from"./casino-challenges-overlay-drawer-
|
|
1
|
+
export{C as CasinoChallengesOverlayDrawer}from"./casino-challenges-overlay-drawer-b213ea71.js";import"./index-25fd45d2.js";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d2288c94.js');
|
|
6
|
-
const casinoChallengesOverlayDrawer = require('./casino-challenges-overlay-drawer-
|
|
6
|
+
const casinoChallengesOverlayDrawer = require('./casino-challenges-overlay-drawer-d7a92fc6.js');
|
|
7
7
|
|
|
8
8
|
function _typeof(o) {
|
|
9
9
|
"@babel/helpers - typeof";
|
|
@@ -2204,6 +2204,7 @@ function cleanEscapedString(input) {
|
|
|
2204
2204
|
const DEFAULT_LANGUAGE$1 = 'en';
|
|
2205
2205
|
const TRANSLATIONS$1 = {
|
|
2206
2206
|
en: {
|
|
2207
|
+
level: 'Level',
|
|
2207
2208
|
levels: 'Levels',
|
|
2208
2209
|
seeAll: 'See All',
|
|
2209
2210
|
games: 'Games',
|
|
@@ -2638,7 +2639,7 @@ const CasinoChallengeDetailsLevels = class {
|
|
|
2638
2639
|
}
|
|
2639
2640
|
render() {
|
|
2640
2641
|
var _a, _b;
|
|
2641
|
-
return (index.h(index.Host, { key: '
|
|
2642
|
+
return (index.h(index.Host, { key: '38d0f55c09671b1e45d72d1f563325b0c8d726ac' }, index.h("div", { key: 'd18394482ac2ec1a2fc52d08dd5660f5ecef7ad2', class: { Mobile: this.isMobile, 'levels-tab tab': true, visible: this.open }, ref: (el) => (this.scrollContainerRef = el) }, (_b = (_a = this.challenge) === null || _a === void 0 ? void 0 : _a.LevelProgresses) === null || _b === void 0 ? void 0 : _b.map((level, index$1) => {
|
|
2642
2643
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2643
2644
|
const activeChallenge = [0, 1, 2, 3].includes((_a = this === null || this === void 0 ? void 0 : this.challenge) === null || _a === void 0 ? void 0 : _a.Status) && !this.isChallengePaused;
|
|
2644
2645
|
const isGrayed = ((_b = this.challenge) === null || _b === void 0 ? void 0 : _b.Status) === EChallengeProgressStatus$1.Forfeited ||
|
|
@@ -2659,7 +2660,7 @@ const CasinoChallengeDetailsLevels = class {
|
|
|
2659
2660
|
completed: activeChallenge && level.ProgressStatus === EChallengeProgressLevelStatus$1.Completed
|
|
2660
2661
|
}, ref: isActiveMatch ? (el) => (this.activeEntityRef = el) : undefined, key: level.LevelId }, index.h("div", { class: {
|
|
2661
2662
|
level__title: true
|
|
2662
|
-
} }, index.h("span", null, "
|
|
2663
|
+
} }, index.h("span", null, translate$1('level', this.language), " ", index$1 + 1), getLevelStatus((_g = this.challenge) === null || _g === void 0 ? void 0 : _g.Status, level, activeChallenge, this.language, true)), level.ProgressStatus === EChallengeProgressLevelStatus$1.InProgress && (index.h("div", { class: "level__progress" }, index.h("casino-challenge-level-progress-bar", { height: "8px", value: level.ProgressPercentage, active: activeChallenge }))), index.h("casino-challenge-expandable-paragraph", { "max-height": "42", active: level.ProgressStatus === EChallengeProgressLevelStatus$1.InProgress && activeChallenge, style: { width: '100%' } }, index.h("div", { class: {
|
|
2663
2664
|
level__bonus: true
|
|
2664
2665
|
} }, index.h("span", { class: "level__icon" }, index.h("img", { class: {
|
|
2665
2666
|
grayed: isGrayed
|
|
@@ -2860,15 +2861,16 @@ const CasinoChallengeDetailsRules = class {
|
|
|
2860
2861
|
return `${(_a = range.Min) !== null && _a !== void 0 ? _a : fallbackMin} - ${(_b = range.Max) !== null && _b !== void 0 ? _b : this.maxSelections}`;
|
|
2861
2862
|
}
|
|
2862
2863
|
render() {
|
|
2863
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
2864
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
|
|
2864
2865
|
const contributionType = this.getContributionType((_a = this.challenge) === null || _a === void 0 ? void 0 : _a.ContributedBy);
|
|
2865
2866
|
const contributionRule = this.getContributionRule((_b = this.challenge) === null || _b === void 0 ? void 0 : _b.IsContributeToOne);
|
|
2866
2867
|
const isSportsbook = ((_c = this.challenge) === null || _c === void 0 ? void 0 : _c.ContributedFrom) === EContributedFrom.Sportsbook;
|
|
2867
2868
|
const challengeStatusIsAllowedToOptOut = !(((_d = this.challenge) === null || _d === void 0 ? void 0 : _d.Status) === EChallengeProgressStatus$1.Started ||
|
|
2868
|
-
((_e = this.challenge) === null || _e === void 0 ? void 0 : _e.Status) === EChallengeProgressStatus$1.Awaiting
|
|
2869
|
+
((_e = this.challenge) === null || _e === void 0 ? void 0 : _e.Status) === EChallengeProgressStatus$1.Awaiting ||
|
|
2870
|
+
((_f = this.challenge) === null || _f === void 0 ? void 0 : _f.Status) === EChallengeProgressStatus$1.Expired);
|
|
2869
2871
|
const showOptOutBlock = this.challenge && challengeStatusIsAllowedToOptOut && !this.isOptedOut;
|
|
2870
|
-
return (index.h(index.Host, { key: '
|
|
2871
|
-
((
|
|
2872
|
+
return (index.h(index.Host, { key: '999dc6255c4f961131ec75ef02a6e96bccb69e5c' }, index.h("div", { key: 'fd6e0582802c7712d005059ec429557926227b90', class: { Mobile: this.isMobile, 'rules-tab tab': true, visible: this.open } }, ((_h = (_g = this.challenge) === null || _g === void 0 ? void 0 : _g.ChallengePresentation) === null || _h === void 0 ? void 0 : _h.Description) && (index.h("div", { key: '65ebd8166dbfd7478da75d2578498c34977882d9', class: "rule" }, (_k = (_j = this.challenge) === null || _j === void 0 ? void 0 : _j.ChallengePresentation) === null || _k === void 0 ? void 0 : _k.Description)), (((_m = (_l = this.challenge) === null || _l === void 0 ? void 0 : _l.ChallengePresentation) === null || _m === void 0 ? void 0 : _m.RulesDescription) || ((_p = (_o = this.challenge) === null || _o === void 0 ? void 0 : _o.ChallengePresentation) === null || _p === void 0 ? void 0 : _p.Url)) && (index.h("div", { key: 'a3aca038f5841561c291aa51b42cb1f62ec03b93' }, index.h("div", { key: 'e9ead5a1c6297460cf0748ebe5d63fb25cf0098e', class: "contribution" }, index.h("span", { key: '1a19a8535929be02070c05fe1451ac81658dc72a', class: "contribution__label" }, translate$1('terms', this.language))), ((_r = (_q = this.challenge) === null || _q === void 0 ? void 0 : _q.ChallengePresentation) === null || _r === void 0 ? void 0 : _r.RulesDescription) && (index.h("span", { key: '2e92b57ed1eefcfc7befae426d01406d6d6f73bf', class: "contribution__value" }, (_t = (_s = this.challenge) === null || _s === void 0 ? void 0 : _s.ChallengePresentation) === null || _t === void 0 ? void 0 : _t.RulesDescription)), ((_v = (_u = this.challenge) === null || _u === void 0 ? void 0 : _u.ChallengePresentation) === null || _v === void 0 ? void 0 : _v.RulesDescription) &&
|
|
2873
|
+
((_x = (_w = this.challenge) === null || _w === void 0 ? void 0 : _w.ChallengePresentation) === null || _x === void 0 ? void 0 : _x.Url) && index.h("br", { key: '0367fbdedc6dcc9a8511af9570e5ea96f212e3c2' }), ((_z = (_y = this.challenge) === null || _y === void 0 ? void 0 : _y.ChallengePresentation) === null || _z === void 0 ? void 0 : _z.Url) && (index.h("a", { key: 'e23882b0aa1ed9e6a10d002d910bdd3283123f66', class: "link", href: (_1 = (_0 = this.challenge) === null || _0 === void 0 ? void 0 : _0.ChallengePresentation) === null || _1 === void 0 ? void 0 : _1.Url, target: "_blank" }, translate$1('readFullTerms', this.language), index.h("img", { key: '6b63c9ec6e15409cd10955f722e78005b0ed1a68', class: "icon", src: termAndConditionSvg$1 }))))), showOptOutBlock && (index.h("div", { key: 'c5e0ea8674bdb2e55cfff1dbbda1e055ddecc415' }, index.h("span", { key: 'c41478c3a0f552e2e6cd306ade61b7b14e3cc755', class: "contribution__value" }, translate$1('optOutLeavingText', this.language)), index.h("button", { key: '05c58b4be1c252410dd1657ac6de3b93ad0c8ed7', class: "opt-out-button", onClick: this.handleOpenOptOutModal }, translate$1('optOutLeavingActionText', this.language), index.h("img", { key: 'a9c6ee80398b27616661a739f8b7544ff8a7eb1d', class: "icon", src: optOutSvg$1 })))), !isSportsbook && contributionType && (index.h("div", { key: 'dbe7d00f854991603c8bd85f7b3b5dfb3ffdb358' }, index.h("div", { key: 'd15492372af6650fa525b97c6ecab55de630808d', class: "contribution" }, index.h("span", { key: 'c787dd700d182bec7071b58adca2d94af8abe0d8', class: "contribution__label" }, translate$1('contributionType', this.language))), index.h("span", { key: 'b54db077b10ce9945087274fb7e32952a0809abe', class: "contribution__value" }, contributionType))), !isSportsbook && contributionRule && (index.h("div", { key: '098703502cb74608fcbafcf08c34d21d20549324' }, index.h("div", { key: '7a095076bcc9dc5471efc0e7a82d53e1544b344f', class: "contribution" }, index.h("span", { key: '314dddbea5c85f3085c3eb8dcf1f22c369f47285', class: "contribution__label" }, translate$1('contributionTo', this.language))), index.h("span", { key: '8107dbe7bc6ff330ab2690329869c640a7c9a208', class: "contribution__value" }, contributionRule))), isSportsbook && this.renderSportsbookRules())));
|
|
2872
2874
|
}
|
|
2873
2875
|
};
|
|
2874
2876
|
CasinoChallengeDetailsRules.style = CasinoChallengeDetailsRulesStyle0;
|
|
@@ -2896,16 +2898,16 @@ const CasinoChallengeDrawerHistoryItem = class {
|
|
|
2896
2898
|
this.toggle = undefined;
|
|
2897
2899
|
}
|
|
2898
2900
|
renderLevel(level) {
|
|
2899
|
-
return (index.h("div", { class: "level-container" }, index.h("div", { class: "row" }, index.h("span", { class: "col-1" }, `${casinoChallengesOverlayDrawer.translate('level', this.language)} ${level.OrderNumber + 1}`), index.h("span", { class: `col-1 ${level.Status === casinoChallengesOverlayDrawer.EHistoryItemLevelStatus.Forfeited ? 'errored' : ''}` }, casinoChallengesOverlayDrawer.HistoryItemLevelStatusDictionary[level.Status]), index.h("span", { class: "col-2" }, format(new Date(level.Time), 'dd/MM/yy HH:mm'))), (level === null || level === void 0 ? void 0 : level.CustomRewardMessage) && (index.h("p", { class: {
|
|
2901
|
+
return (index.h("div", { class: "level-container" }, index.h("div", { class: "row" }, index.h("span", { class: "col-1" }, `${casinoChallengesOverlayDrawer.translate('level', this.language)} ${level.OrderNumber + 1}`), index.h("span", { class: `col-1 ${level.Status === casinoChallengesOverlayDrawer.EHistoryItemLevelStatus.Forfeited ? 'errored' : ''}` }, casinoChallengesOverlayDrawer.translate(casinoChallengesOverlayDrawer.HistoryItemLevelStatusDictionary[level.Status].toLowerCase(), this.language)), index.h("span", { class: "col-2" }, format(new Date(level.Time), 'dd/MM/yy HH:mm'))), (level === null || level === void 0 ? void 0 : level.CustomRewardMessage) && (index.h("p", { class: {
|
|
2900
2902
|
reward: true,
|
|
2901
2903
|
grayed: level.Status !== casinoChallengesOverlayDrawer.EHistoryItemLevelStatus.Completed
|
|
2902
2904
|
} }, index.h("img", { src: giftSvg }), level.CustomRewardMessage))));
|
|
2903
2905
|
}
|
|
2904
2906
|
render() {
|
|
2905
|
-
return (index.h(index.Host, { key: '
|
|
2907
|
+
return (index.h(index.Host, { key: 'e0a9787fe6ca7f813371ed8d313c88ee0f414403' }, index.h("div", { key: '95cc16f9f9079f92e23193355c3b66b172e36049', class: {
|
|
2906
2908
|
Mobile: this.isMobile,
|
|
2907
2909
|
item: true
|
|
2908
|
-
}, ref: this.itemRef }, index.h("div", { key: '
|
|
2910
|
+
}, ref: this.itemRef }, index.h("div", { key: '291a11ae81b58d63f5929ef05bbff14beb49e3ad', class: "header", onClick: () => this.toggle(this.index) }, index.h("div", { key: '0446ba59379bfc1e52d3d047d79cba0c8131c266' }, index.h("img", { key: '996a0b1220a369f1938a0718fc53ad11c99ed90b', class: "banner", src: this.historyItem.BannerUrl }), index.h("span", { key: 'b6156328db55a18fa03841c3a1e30e86e2c6cfc1' }, this.historyItem.Name)), index.h("div", { key: '8c6eb3ed86c4d1e76409c3d77965345552c1ec1d', class: "arrow" }, index.h("img", { key: '92088c8b52a720acd1ba6a2a381d7ed1daba35ab', src: this.isOpen ? arrowUpSvg : arrowDownSvg }))), index.h("div", { key: '32c777a82327bf1baa6291680524173051453ad1', class: { open: this.isOpen, content: true } }, this.historyItem.TermsAndConditionsUrl && (index.h("a", { key: '3076334cd66fc1807622653512b7efd8d8452161', class: "terms", href: this.historyItem.TermsAndConditionsUrl, target: "_blank" }, casinoChallengesOverlayDrawer.translate('terms', this.language), index.h("img", { key: 'e627075d67ff1541b70eaf7c106cb1c58d1f6f92', class: "icon", src: termAndConditionSvg }))), index.h("div", { key: 'd0f6546aef8b70b455658d2eda20ca65379255fd', class: "row list-header" }, index.h("span", { key: 'ebd7cf3409c7962b9484d6dd6113505063ed8dc5', class: "col-1" }, casinoChallengesOverlayDrawer.translate('level', this.language)), index.h("span", { key: '6813ef88b6615d02c8b6fa0b7d1870a3eb814189', class: "col-1" }, casinoChallengesOverlayDrawer.translate('status', this.language)), index.h("span", { key: '7a516c198c5579c942f57af8a883736022f58813', class: "col-2" }, casinoChallengesOverlayDrawer.translate('time', this.language))), this.historyItem.Levels.map((level) => this.renderLevel(level))))));
|
|
2909
2911
|
}
|
|
2910
2912
|
};
|
|
2911
2913
|
CasinoChallengeDrawerHistoryItem.style = CasinoChallengeDrawerHistoryItemStyle0;
|
|
@@ -3853,7 +3855,7 @@ const CasinoChallengesOverlayDrawerDetails = class {
|
|
|
3853
3855
|
}, ref: isActiveMatch ? (el) => (this.activeEntityRef = el) : undefined, key: level.LevelId }, index.h("div", { class: {
|
|
3854
3856
|
level__title: true,
|
|
3855
3857
|
grayed: isGrayed
|
|
3856
|
-
} }, index.h("span", null, "
|
|
3858
|
+
} }, index.h("span", null, translate$1('level', this.language), " ", index$1 + 1), getLevelStatus((_g = this.challenge) === null || _g === void 0 ? void 0 : _g.Status, level, activeChallenge, this.language)), index.h("div", { class: {
|
|
3857
3859
|
level__bonus: true
|
|
3858
3860
|
} }, index.h("span", { class: "level__icon" }, index.h("img", { class: {
|
|
3859
3861
|
grayed: isGrayed
|
|
@@ -3936,7 +3938,7 @@ const CasinoChallengesOverlayDrawerDetails = class {
|
|
|
3936
3938
|
var _a, _b;
|
|
3937
3939
|
const fullScreen = (this.swipping && this.progress > 0) || ((_a = this.detailsSubPageInfo) === null || _a === void 0 ? void 0 : _a.open);
|
|
3938
3940
|
const footerIsVisible = !this.isMobile || (this.isMobile && fullScreen);
|
|
3939
|
-
return (index.h("div", { key: '
|
|
3941
|
+
return (index.h("div", { key: '4f93fbbfc5748b9ddd3d394636735aa20996eff9', class: {
|
|
3940
3942
|
Mobile: this.isMobile,
|
|
3941
3943
|
swipped: (this.isMobile && this.swipping && this.progress > 0) || !this.isMobile,
|
|
3942
3944
|
moved: this.progress > 0,
|
|
@@ -495,8 +495,8 @@ const CasinoChallengesOverlayDrawer = class {
|
|
|
495
495
|
setTimeout(() => (this.notification = null), 10000);
|
|
496
496
|
};
|
|
497
497
|
this.renderNotification = () => {
|
|
498
|
-
var _a, _b, _c;
|
|
499
|
-
return (index.h("div", { class: `notification ${((_a = this.notification) === null || _a === void 0 ? void 0 : _a.errored) ? 'errored' : ''}` }, index.h("div", { class: "row" }, index.h("img", { src: ((_b = this.notification) === null || _b === void 0 ? void 0 : _b.errored) ? errorSvg : checkSvg, class: "notification__icon", alt: "" }), index.h("p", { class: "notification__message" }, (_c = this.notification) === null || _c === void 0 ? void 0 : _c.message))));
|
|
498
|
+
var _a, _b, _c, _d, _e, _f;
|
|
499
|
+
return (index.h("div", { class: `notification ${((_a = this.notification) === null || _a === void 0 ? void 0 : _a.errored) ? 'errored' : ''}` }, index.h("div", { class: "row" }, index.h("img", { src: ((_b = this.notification) === null || _b === void 0 ? void 0 : _b.errored) ? errorSvg : checkSvg, class: "notification__icon", alt: "" }), index.h("p", { class: "notification__message" }, (_e = translate((_d = (_c = this.notification) === null || _c === void 0 ? void 0 : _c.message) !== null && _d !== void 0 ? _d : '', this.language)) !== null && _e !== void 0 ? _e : (_f = this.notification) === null || _f === void 0 ? void 0 : _f.message))));
|
|
500
500
|
};
|
|
501
501
|
this.renderHeader = (isMobile) => {
|
|
502
502
|
return (index.h("div", null, index.h("h1", { class: "challenges__drawer__title" }, index.h("span", null, translate('title', this.language)), index.h("button", { class: "challenges__drawer__close", onClick: this.onCloseClick }, index.h("img", { src: crossSvg, alt: "" }))), this.enabledWidgetTabs.length > 0 && (index.h("casino-challenges-overlay-tabs", { onTabClick: this.handleTabClick, activeTabIndex: this.activeTabIndex, activeTabHasNotification: false, pendingTabHasNotification: false, language: this.language, "is-mobile": isMobile, enabledWidgetTabs: this.enabledWidgetTabs }))));
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const casinoChallengesOverlayDrawer = require('./casino-challenges-overlay-drawer-
|
|
5
|
+
const casinoChallengesOverlayDrawer = require('./casino-challenges-overlay-drawer-d7a92fc6.js');
|
|
6
6
|
require('./index-d2288c94.js');
|
|
7
7
|
|
|
8
8
|
|
|
@@ -107,8 +107,8 @@ export class CasinoChallengesOverlayDrawer {
|
|
|
107
107
|
setTimeout(() => (this.notification = null), 10000);
|
|
108
108
|
};
|
|
109
109
|
this.renderNotification = () => {
|
|
110
|
-
var _a, _b, _c;
|
|
111
|
-
return (h("div", { class: `notification ${((_a = this.notification) === null || _a === void 0 ? void 0 : _a.errored) ? 'errored' : ''}` }, h("div", { class: "row" }, h("img", { src: ((_b = this.notification) === null || _b === void 0 ? void 0 : _b.errored) ? errorIcon : checkIcon, class: "notification__icon", alt: "" }), h("p", { class: "notification__message" }, (_c = this.notification) === null || _c === void 0 ? void 0 : _c.message))));
|
|
110
|
+
var _a, _b, _c, _d, _e, _f;
|
|
111
|
+
return (h("div", { class: `notification ${((_a = this.notification) === null || _a === void 0 ? void 0 : _a.errored) ? 'errored' : ''}` }, h("div", { class: "row" }, h("img", { src: ((_b = this.notification) === null || _b === void 0 ? void 0 : _b.errored) ? errorIcon : checkIcon, class: "notification__icon", alt: "" }), h("p", { class: "notification__message" }, (_e = translate((_d = (_c = this.notification) === null || _c === void 0 ? void 0 : _c.message) !== null && _d !== void 0 ? _d : '', this.language)) !== null && _e !== void 0 ? _e : (_f = this.notification) === null || _f === void 0 ? void 0 : _f.message))));
|
|
112
112
|
};
|
|
113
113
|
this.renderHeader = (isMobile) => {
|
|
114
114
|
return (h("div", null, h("h1", { class: "challenges__drawer__title" }, h("span", null, translate('title', this.language)), h("button", { class: "challenges__drawer__close", onClick: this.onCloseClick }, h("img", { src: crossSvg, alt: "" }))), this.enabledWidgetTabs.length > 0 && (h("casino-challenges-overlay-tabs", { onTabClick: this.handleTabClick, activeTabIndex: this.activeTabIndex, activeTabHasNotification: false, pendingTabHasNotification: false, language: this.language, "is-mobile": isMobile, enabledWidgetTabs: this.enabledWidgetTabs }))));
|
|
@@ -17,16 +17,16 @@ export class CasinoChallengeDrawerHistoryItem {
|
|
|
17
17
|
this.toggle = undefined;
|
|
18
18
|
}
|
|
19
19
|
renderLevel(level) {
|
|
20
|
-
return (h("div", { class: "level-container" }, h("div", { class: "row" }, h("span", { class: "col-1" }, `${translate('level', this.language)} ${level.OrderNumber + 1}`), h("span", { class: `col-1 ${level.Status === EHistoryItemLevelStatus.Forfeited ? 'errored' : ''}` }, HistoryItemLevelStatusDictionary[level.Status]), h("span", { class: "col-2" }, format(new Date(level.Time), 'dd/MM/yy HH:mm'))), (level === null || level === void 0 ? void 0 : level.CustomRewardMessage) && (h("p", { class: {
|
|
20
|
+
return (h("div", { class: "level-container" }, h("div", { class: "row" }, h("span", { class: "col-1" }, `${translate('level', this.language)} ${level.OrderNumber + 1}`), h("span", { class: `col-1 ${level.Status === EHistoryItemLevelStatus.Forfeited ? 'errored' : ''}` }, translate(HistoryItemLevelStatusDictionary[level.Status].toLowerCase(), this.language)), h("span", { class: "col-2" }, format(new Date(level.Time), 'dd/MM/yy HH:mm'))), (level === null || level === void 0 ? void 0 : level.CustomRewardMessage) && (h("p", { class: {
|
|
21
21
|
reward: true,
|
|
22
22
|
grayed: level.Status !== EHistoryItemLevelStatus.Completed
|
|
23
23
|
} }, h("img", { src: giftIcon }), level.CustomRewardMessage))));
|
|
24
24
|
}
|
|
25
25
|
render() {
|
|
26
|
-
return (h(Host, { key: '
|
|
26
|
+
return (h(Host, { key: 'e0a9787fe6ca7f813371ed8d313c88ee0f414403' }, h("div", { key: '95cc16f9f9079f92e23193355c3b66b172e36049', class: {
|
|
27
27
|
Mobile: this.isMobile,
|
|
28
28
|
item: true
|
|
29
|
-
}, ref: this.itemRef }, h("div", { key: '
|
|
29
|
+
}, ref: this.itemRef }, h("div", { key: '291a11ae81b58d63f5929ef05bbff14beb49e3ad', class: "header", onClick: () => this.toggle(this.index) }, h("div", { key: '0446ba59379bfc1e52d3d047d79cba0c8131c266' }, h("img", { key: '996a0b1220a369f1938a0718fc53ad11c99ed90b', class: "banner", src: this.historyItem.BannerUrl }), h("span", { key: 'b6156328db55a18fa03841c3a1e30e86e2c6cfc1' }, this.historyItem.Name)), h("div", { key: '8c6eb3ed86c4d1e76409c3d77965345552c1ec1d', class: "arrow" }, h("img", { key: '92088c8b52a720acd1ba6a2a381d7ed1daba35ab', src: this.isOpen ? arrowUpIcon : arrowDownIcon }))), h("div", { key: '32c777a82327bf1baa6291680524173051453ad1', class: { open: this.isOpen, content: true } }, this.historyItem.TermsAndConditionsUrl && (h("a", { key: '3076334cd66fc1807622653512b7efd8d8452161', class: "terms", href: this.historyItem.TermsAndConditionsUrl, target: "_blank" }, translate('terms', this.language), h("img", { key: 'e627075d67ff1541b70eaf7c106cb1c58d1f6f92', class: "icon", src: termAndCondition }))), h("div", { key: 'd0f6546aef8b70b455658d2eda20ca65379255fd', class: "row list-header" }, h("span", { key: 'ebd7cf3409c7962b9484d6dd6113505063ed8dc5', class: "col-1" }, translate('level', this.language)), h("span", { key: '6813ef88b6615d02c8b6fa0b7d1870a3eb814189', class: "col-1" }, translate('status', this.language)), h("span", { key: '7a516c198c5579c942f57af8a883736022f58813', class: "col-2" }, translate('time', this.language))), this.historyItem.Levels.map((level) => this.renderLevel(level))))));
|
|
30
30
|
}
|
|
31
31
|
static get is() { return "casino-challenge-drawer-history-item"; }
|
|
32
32
|
static get originalStyleUrls() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, c as createEvent, g as getElement } from './index-25fd45d2.js';
|
|
2
|
-
import { E as EHistoryItemLevelStatus$1, t as translate$2, H as HistoryItemLevelStatusDictionary, a as EPostMessageRequestType$1, s as setClientStyling, b as setClientStylingURL, c as setStreamStyling, r as resolveTranslationUrl$2, d as EChallengesTabs$1, e as EFeatureFlags } from './casino-challenges-overlay-drawer-
|
|
3
|
-
export { C as casino_challenges_overlay_drawer } from './casino-challenges-overlay-drawer-
|
|
2
|
+
import { E as EHistoryItemLevelStatus$1, t as translate$2, H as HistoryItemLevelStatusDictionary, a as EPostMessageRequestType$1, s as setClientStyling, b as setClientStylingURL, c as setStreamStyling, r as resolveTranslationUrl$2, d as EChallengesTabs$1, e as EFeatureFlags } from './casino-challenges-overlay-drawer-b213ea71.js';
|
|
3
|
+
export { C as casino_challenges_overlay_drawer } from './casino-challenges-overlay-drawer-b213ea71.js';
|
|
4
4
|
|
|
5
5
|
function _typeof(o) {
|
|
6
6
|
"@babel/helpers - typeof";
|
|
@@ -2201,6 +2201,7 @@ function cleanEscapedString(input) {
|
|
|
2201
2201
|
const DEFAULT_LANGUAGE$1 = 'en';
|
|
2202
2202
|
const TRANSLATIONS$1 = {
|
|
2203
2203
|
en: {
|
|
2204
|
+
level: 'Level',
|
|
2204
2205
|
levels: 'Levels',
|
|
2205
2206
|
seeAll: 'See All',
|
|
2206
2207
|
games: 'Games',
|
|
@@ -2635,7 +2636,7 @@ const CasinoChallengeDetailsLevels = class {
|
|
|
2635
2636
|
}
|
|
2636
2637
|
render() {
|
|
2637
2638
|
var _a, _b;
|
|
2638
|
-
return (h(Host, { key: '
|
|
2639
|
+
return (h(Host, { key: '38d0f55c09671b1e45d72d1f563325b0c8d726ac' }, h("div", { key: 'd18394482ac2ec1a2fc52d08dd5660f5ecef7ad2', class: { Mobile: this.isMobile, 'levels-tab tab': true, visible: this.open }, ref: (el) => (this.scrollContainerRef = el) }, (_b = (_a = this.challenge) === null || _a === void 0 ? void 0 : _a.LevelProgresses) === null || _b === void 0 ? void 0 : _b.map((level, index) => {
|
|
2639
2640
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2640
2641
|
const activeChallenge = [0, 1, 2, 3].includes((_a = this === null || this === void 0 ? void 0 : this.challenge) === null || _a === void 0 ? void 0 : _a.Status) && !this.isChallengePaused;
|
|
2641
2642
|
const isGrayed = ((_b = this.challenge) === null || _b === void 0 ? void 0 : _b.Status) === EChallengeProgressStatus$1.Forfeited ||
|
|
@@ -2656,7 +2657,7 @@ const CasinoChallengeDetailsLevels = class {
|
|
|
2656
2657
|
completed: activeChallenge && level.ProgressStatus === EChallengeProgressLevelStatus$1.Completed
|
|
2657
2658
|
}, ref: isActiveMatch ? (el) => (this.activeEntityRef = el) : undefined, key: level.LevelId }, h("div", { class: {
|
|
2658
2659
|
level__title: true
|
|
2659
|
-
} }, h("span", null, "
|
|
2660
|
+
} }, h("span", null, translate$1('level', this.language), " ", index + 1), getLevelStatus((_g = this.challenge) === null || _g === void 0 ? void 0 : _g.Status, level, activeChallenge, this.language, true)), level.ProgressStatus === EChallengeProgressLevelStatus$1.InProgress && (h("div", { class: "level__progress" }, h("casino-challenge-level-progress-bar", { height: "8px", value: level.ProgressPercentage, active: activeChallenge }))), h("casino-challenge-expandable-paragraph", { "max-height": "42", active: level.ProgressStatus === EChallengeProgressLevelStatus$1.InProgress && activeChallenge, style: { width: '100%' } }, h("div", { class: {
|
|
2660
2661
|
level__bonus: true
|
|
2661
2662
|
} }, h("span", { class: "level__icon" }, h("img", { class: {
|
|
2662
2663
|
grayed: isGrayed
|
|
@@ -2857,15 +2858,16 @@ const CasinoChallengeDetailsRules = class {
|
|
|
2857
2858
|
return `${(_a = range.Min) !== null && _a !== void 0 ? _a : fallbackMin} - ${(_b = range.Max) !== null && _b !== void 0 ? _b : this.maxSelections}`;
|
|
2858
2859
|
}
|
|
2859
2860
|
render() {
|
|
2860
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
2861
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
|
|
2861
2862
|
const contributionType = this.getContributionType((_a = this.challenge) === null || _a === void 0 ? void 0 : _a.ContributedBy);
|
|
2862
2863
|
const contributionRule = this.getContributionRule((_b = this.challenge) === null || _b === void 0 ? void 0 : _b.IsContributeToOne);
|
|
2863
2864
|
const isSportsbook = ((_c = this.challenge) === null || _c === void 0 ? void 0 : _c.ContributedFrom) === EContributedFrom.Sportsbook;
|
|
2864
2865
|
const challengeStatusIsAllowedToOptOut = !(((_d = this.challenge) === null || _d === void 0 ? void 0 : _d.Status) === EChallengeProgressStatus$1.Started ||
|
|
2865
|
-
((_e = this.challenge) === null || _e === void 0 ? void 0 : _e.Status) === EChallengeProgressStatus$1.Awaiting
|
|
2866
|
+
((_e = this.challenge) === null || _e === void 0 ? void 0 : _e.Status) === EChallengeProgressStatus$1.Awaiting ||
|
|
2867
|
+
((_f = this.challenge) === null || _f === void 0 ? void 0 : _f.Status) === EChallengeProgressStatus$1.Expired);
|
|
2866
2868
|
const showOptOutBlock = this.challenge && challengeStatusIsAllowedToOptOut && !this.isOptedOut;
|
|
2867
|
-
return (h(Host, { key: '
|
|
2868
|
-
((
|
|
2869
|
+
return (h(Host, { key: '999dc6255c4f961131ec75ef02a6e96bccb69e5c' }, h("div", { key: 'fd6e0582802c7712d005059ec429557926227b90', class: { Mobile: this.isMobile, 'rules-tab tab': true, visible: this.open } }, ((_h = (_g = this.challenge) === null || _g === void 0 ? void 0 : _g.ChallengePresentation) === null || _h === void 0 ? void 0 : _h.Description) && (h("div", { key: '65ebd8166dbfd7478da75d2578498c34977882d9', class: "rule" }, (_k = (_j = this.challenge) === null || _j === void 0 ? void 0 : _j.ChallengePresentation) === null || _k === void 0 ? void 0 : _k.Description)), (((_m = (_l = this.challenge) === null || _l === void 0 ? void 0 : _l.ChallengePresentation) === null || _m === void 0 ? void 0 : _m.RulesDescription) || ((_p = (_o = this.challenge) === null || _o === void 0 ? void 0 : _o.ChallengePresentation) === null || _p === void 0 ? void 0 : _p.Url)) && (h("div", { key: 'a3aca038f5841561c291aa51b42cb1f62ec03b93' }, h("div", { key: 'e9ead5a1c6297460cf0748ebe5d63fb25cf0098e', class: "contribution" }, h("span", { key: '1a19a8535929be02070c05fe1451ac81658dc72a', class: "contribution__label" }, translate$1('terms', this.language))), ((_r = (_q = this.challenge) === null || _q === void 0 ? void 0 : _q.ChallengePresentation) === null || _r === void 0 ? void 0 : _r.RulesDescription) && (h("span", { key: '2e92b57ed1eefcfc7befae426d01406d6d6f73bf', class: "contribution__value" }, (_t = (_s = this.challenge) === null || _s === void 0 ? void 0 : _s.ChallengePresentation) === null || _t === void 0 ? void 0 : _t.RulesDescription)), ((_v = (_u = this.challenge) === null || _u === void 0 ? void 0 : _u.ChallengePresentation) === null || _v === void 0 ? void 0 : _v.RulesDescription) &&
|
|
2870
|
+
((_x = (_w = this.challenge) === null || _w === void 0 ? void 0 : _w.ChallengePresentation) === null || _x === void 0 ? void 0 : _x.Url) && h("br", { key: '0367fbdedc6dcc9a8511af9570e5ea96f212e3c2' }), ((_z = (_y = this.challenge) === null || _y === void 0 ? void 0 : _y.ChallengePresentation) === null || _z === void 0 ? void 0 : _z.Url) && (h("a", { key: 'e23882b0aa1ed9e6a10d002d910bdd3283123f66', class: "link", href: (_1 = (_0 = this.challenge) === null || _0 === void 0 ? void 0 : _0.ChallengePresentation) === null || _1 === void 0 ? void 0 : _1.Url, target: "_blank" }, translate$1('readFullTerms', this.language), h("img", { key: '6b63c9ec6e15409cd10955f722e78005b0ed1a68', class: "icon", src: termAndConditionSvg$1 }))))), showOptOutBlock && (h("div", { key: 'c5e0ea8674bdb2e55cfff1dbbda1e055ddecc415' }, h("span", { key: 'c41478c3a0f552e2e6cd306ade61b7b14e3cc755', class: "contribution__value" }, translate$1('optOutLeavingText', this.language)), h("button", { key: '05c58b4be1c252410dd1657ac6de3b93ad0c8ed7', class: "opt-out-button", onClick: this.handleOpenOptOutModal }, translate$1('optOutLeavingActionText', this.language), h("img", { key: 'a9c6ee80398b27616661a739f8b7544ff8a7eb1d', class: "icon", src: optOutSvg$1 })))), !isSportsbook && contributionType && (h("div", { key: 'dbe7d00f854991603c8bd85f7b3b5dfb3ffdb358' }, h("div", { key: 'd15492372af6650fa525b97c6ecab55de630808d', class: "contribution" }, h("span", { key: 'c787dd700d182bec7071b58adca2d94af8abe0d8', class: "contribution__label" }, translate$1('contributionType', this.language))), h("span", { key: 'b54db077b10ce9945087274fb7e32952a0809abe', class: "contribution__value" }, contributionType))), !isSportsbook && contributionRule && (h("div", { key: '098703502cb74608fcbafcf08c34d21d20549324' }, h("div", { key: '7a095076bcc9dc5471efc0e7a82d53e1544b344f', class: "contribution" }, h("span", { key: '314dddbea5c85f3085c3eb8dcf1f22c369f47285', class: "contribution__label" }, translate$1('contributionTo', this.language))), h("span", { key: '8107dbe7bc6ff330ab2690329869c640a7c9a208', class: "contribution__value" }, contributionRule))), isSportsbook && this.renderSportsbookRules())));
|
|
2869
2871
|
}
|
|
2870
2872
|
};
|
|
2871
2873
|
CasinoChallengeDetailsRules.style = CasinoChallengeDetailsRulesStyle0;
|
|
@@ -2893,16 +2895,16 @@ const CasinoChallengeDrawerHistoryItem = class {
|
|
|
2893
2895
|
this.toggle = undefined;
|
|
2894
2896
|
}
|
|
2895
2897
|
renderLevel(level) {
|
|
2896
|
-
return (h("div", { class: "level-container" }, h("div", { class: "row" }, h("span", { class: "col-1" }, `${translate$2('level', this.language)} ${level.OrderNumber + 1}`), h("span", { class: `col-1 ${level.Status === EHistoryItemLevelStatus$1.Forfeited ? 'errored' : ''}` }, HistoryItemLevelStatusDictionary[level.Status]), h("span", { class: "col-2" }, format(new Date(level.Time), 'dd/MM/yy HH:mm'))), (level === null || level === void 0 ? void 0 : level.CustomRewardMessage) && (h("p", { class: {
|
|
2898
|
+
return (h("div", { class: "level-container" }, h("div", { class: "row" }, h("span", { class: "col-1" }, `${translate$2('level', this.language)} ${level.OrderNumber + 1}`), h("span", { class: `col-1 ${level.Status === EHistoryItemLevelStatus$1.Forfeited ? 'errored' : ''}` }, translate$2(HistoryItemLevelStatusDictionary[level.Status].toLowerCase(), this.language)), h("span", { class: "col-2" }, format(new Date(level.Time), 'dd/MM/yy HH:mm'))), (level === null || level === void 0 ? void 0 : level.CustomRewardMessage) && (h("p", { class: {
|
|
2897
2899
|
reward: true,
|
|
2898
2900
|
grayed: level.Status !== EHistoryItemLevelStatus$1.Completed
|
|
2899
2901
|
} }, h("img", { src: giftSvg }), level.CustomRewardMessage))));
|
|
2900
2902
|
}
|
|
2901
2903
|
render() {
|
|
2902
|
-
return (h(Host, { key: '
|
|
2904
|
+
return (h(Host, { key: 'e0a9787fe6ca7f813371ed8d313c88ee0f414403' }, h("div", { key: '95cc16f9f9079f92e23193355c3b66b172e36049', class: {
|
|
2903
2905
|
Mobile: this.isMobile,
|
|
2904
2906
|
item: true
|
|
2905
|
-
}, ref: this.itemRef }, h("div", { key: '
|
|
2907
|
+
}, ref: this.itemRef }, h("div", { key: '291a11ae81b58d63f5929ef05bbff14beb49e3ad', class: "header", onClick: () => this.toggle(this.index) }, h("div", { key: '0446ba59379bfc1e52d3d047d79cba0c8131c266' }, h("img", { key: '996a0b1220a369f1938a0718fc53ad11c99ed90b', class: "banner", src: this.historyItem.BannerUrl }), h("span", { key: 'b6156328db55a18fa03841c3a1e30e86e2c6cfc1' }, this.historyItem.Name)), h("div", { key: '8c6eb3ed86c4d1e76409c3d77965345552c1ec1d', class: "arrow" }, h("img", { key: '92088c8b52a720acd1ba6a2a381d7ed1daba35ab', src: this.isOpen ? arrowUpSvg : arrowDownSvg }))), h("div", { key: '32c777a82327bf1baa6291680524173051453ad1', class: { open: this.isOpen, content: true } }, this.historyItem.TermsAndConditionsUrl && (h("a", { key: '3076334cd66fc1807622653512b7efd8d8452161', class: "terms", href: this.historyItem.TermsAndConditionsUrl, target: "_blank" }, translate$2('terms', this.language), h("img", { key: 'e627075d67ff1541b70eaf7c106cb1c58d1f6f92', class: "icon", src: termAndConditionSvg }))), h("div", { key: 'd0f6546aef8b70b455658d2eda20ca65379255fd', class: "row list-header" }, h("span", { key: 'ebd7cf3409c7962b9484d6dd6113505063ed8dc5', class: "col-1" }, translate$2('level', this.language)), h("span", { key: '6813ef88b6615d02c8b6fa0b7d1870a3eb814189', class: "col-1" }, translate$2('status', this.language)), h("span", { key: '7a516c198c5579c942f57af8a883736022f58813', class: "col-2" }, translate$2('time', this.language))), this.historyItem.Levels.map((level) => this.renderLevel(level))))));
|
|
2906
2908
|
}
|
|
2907
2909
|
};
|
|
2908
2910
|
CasinoChallengeDrawerHistoryItem.style = CasinoChallengeDrawerHistoryItemStyle0;
|
|
@@ -3850,7 +3852,7 @@ const CasinoChallengesOverlayDrawerDetails = class {
|
|
|
3850
3852
|
}, ref: isActiveMatch ? (el) => (this.activeEntityRef = el) : undefined, key: level.LevelId }, h("div", { class: {
|
|
3851
3853
|
level__title: true,
|
|
3852
3854
|
grayed: isGrayed
|
|
3853
|
-
} }, h("span", null, "
|
|
3855
|
+
} }, h("span", null, translate$1('level', this.language), " ", index + 1), getLevelStatus((_g = this.challenge) === null || _g === void 0 ? void 0 : _g.Status, level, activeChallenge, this.language)), h("div", { class: {
|
|
3854
3856
|
level__bonus: true
|
|
3855
3857
|
} }, h("span", { class: "level__icon" }, h("img", { class: {
|
|
3856
3858
|
grayed: isGrayed
|
|
@@ -3933,7 +3935,7 @@ const CasinoChallengesOverlayDrawerDetails = class {
|
|
|
3933
3935
|
var _a, _b;
|
|
3934
3936
|
const fullScreen = (this.swipping && this.progress > 0) || ((_a = this.detailsSubPageInfo) === null || _a === void 0 ? void 0 : _a.open);
|
|
3935
3937
|
const footerIsVisible = !this.isMobile || (this.isMobile && fullScreen);
|
|
3936
|
-
return (h("div", { key: '
|
|
3938
|
+
return (h("div", { key: '4f93fbbfc5748b9ddd3d394636735aa20996eff9', class: {
|
|
3937
3939
|
Mobile: this.isMobile,
|
|
3938
3940
|
swipped: (this.isMobile && this.swipping && this.progress > 0) || !this.isMobile,
|
|
3939
3941
|
moved: this.progress > 0,
|
|
@@ -493,8 +493,8 @@ const CasinoChallengesOverlayDrawer = class {
|
|
|
493
493
|
setTimeout(() => (this.notification = null), 10000);
|
|
494
494
|
};
|
|
495
495
|
this.renderNotification = () => {
|
|
496
|
-
var _a, _b, _c;
|
|
497
|
-
return (h("div", { class: `notification ${((_a = this.notification) === null || _a === void 0 ? void 0 : _a.errored) ? 'errored' : ''}` }, h("div", { class: "row" }, h("img", { src: ((_b = this.notification) === null || _b === void 0 ? void 0 : _b.errored) ? errorSvg : checkSvg, class: "notification__icon", alt: "" }), h("p", { class: "notification__message" }, (_c = this.notification) === null || _c === void 0 ? void 0 : _c.message))));
|
|
496
|
+
var _a, _b, _c, _d, _e, _f;
|
|
497
|
+
return (h("div", { class: `notification ${((_a = this.notification) === null || _a === void 0 ? void 0 : _a.errored) ? 'errored' : ''}` }, h("div", { class: "row" }, h("img", { src: ((_b = this.notification) === null || _b === void 0 ? void 0 : _b.errored) ? errorSvg : checkSvg, class: "notification__icon", alt: "" }), h("p", { class: "notification__message" }, (_e = translate((_d = (_c = this.notification) === null || _c === void 0 ? void 0 : _c.message) !== null && _d !== void 0 ? _d : '', this.language)) !== null && _e !== void 0 ? _e : (_f = this.notification) === null || _f === void 0 ? void 0 : _f.message))));
|
|
498
498
|
};
|
|
499
499
|
this.renderHeader = (isMobile) => {
|
|
500
500
|
return (h("div", null, h("h1", { class: "challenges__drawer__title" }, h("span", null, translate('title', this.language)), h("button", { class: "challenges__drawer__close", onClick: this.onCloseClick }, h("img", { src: crossSvg, alt: "" }))), this.enabledWidgetTabs.length > 0 && (h("casino-challenges-overlay-tabs", { onTabClick: this.handleTabClick, activeTabIndex: this.activeTabIndex, activeTabHasNotification: false, pendingTabHasNotification: false, language: this.language, "is-mobile": isMobile, enabledWidgetTabs: this.enabledWidgetTabs }))));
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { C as CasinoChallengesOverlayDrawer } from './casino-challenges-overlay-drawer-
|
|
1
|
+
export { C as CasinoChallengesOverlayDrawer } from './casino-challenges-overlay-drawer-b213ea71.js';
|
|
2
2
|
import './index-25fd45d2.js';
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,h as i}from"./index-25fd45d2.js";const t="__WIDGET_GLOBAL_STYLE_CACHE__";function n(e,i){if(e){const t=document.createElement("style");t.innerHTML=i,e.appendChild(t)}}function s(e,i){if(!e||!i)return;const t=new URL(i);fetch(t.href).then((e=>e.text())).then((i=>{const t=document.createElement("style");t.innerHTML=i,e&&e.appendChild(t)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}function a(e,i,n,s=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!s)return n=function(e,i){const t=document.createElement("style");return window.emMessageBus.subscribe(i,(i=>{e&&(t.innerHTML=i,e.appendChild(t))}))}(e,i),n;window[t]||(window[t]={}),n=function(e,i){return window.emMessageBus.subscribe(i,(n=>{if(!e)return;const s=e.getRootNode(),a=window[t];let o=a[i]&&a[i].sheet;o?a[i].refCount=a[i].refCount+1:(o=new CSSStyleSheet,o.replaceSync(n),a[i]={sheet:o,refCount:1});const l=s.adoptedStyleSheets||[];l.includes(o)||(s.adoptedStyleSheets=[...l,o])}))}(e,i);const a=n.unsubscribe.bind(n);return n.unsubscribe=()=>{if(window[t][i]){const e=window[t][i];e.refCount>1?e.refCount=e.refCount-1:delete window[t][i]}a()},n}const o={en:{title:"Challenges",promo:"Promo",active:"Active",pendingTab:"Pending",finishedTab:"Finished",level:"Level",codeTab:"Code",endsIn:"Ends In",expired:"Expired",placeBetsOf:"Place bets of",place:"Place",bet:"bet",bets:"bets",minBet:"min bet",forfeited:"Forfeited",finished:"Finished",suspended:"Suspended",completed:"Completed",unavailable:"Unavailable",optOutModalTitle:"Opt out of challenge?",optOutModalDescription:"Current progress will be lost, but you will keep earned rewards. You will not be able to opt in for this challenge again.",optOutModalConfirm:"Opt Out",optOutModalCancel:"Cancel",optOutSuccessMessage:"You’ve opted out of the challenge.",deposit:"Deposit",depositAmountDescription:"to unlock the Challenge",noDepositAmountDescription:"Deposit any amount to unlock the Challenge",terms:"Terms & Conditions",time:"time",times:"times",winStakeRatio:"Win/Stake Ratio",promoTabEmptyHeader:"Nothing here - yet!",promoTabEmptyDescription:"No challenges at the moment. Try exploring events or keep playing to unlock new ones.",activeTabEmptyHeader:"No active challenges yet",activeTabEmptyDescription:"Check Promo tab to find available offers",pendingTabEmptyHeader:"No pending challenges yet",pendingTabEmptyDescription:"Check Promo tab to find available offers",finishedTabEmptyHeader:"No finished challenges yet",finishedTabEmptyDescription:"Check Promo tab to find available offers",claimCodeTitle:"Enter the secret code to unlock hidden quests and rewards.",claimCodeSuccessMessage:"The code was successfully applied.",claimCodeInputLabel:"3–30 characters, no spaces",claimCodeBtnText:"Apply Code",claimCodeError:"Invalid format. Use Latin letters, numbers, or symbols.",claimCodeDescription:"Enter code to unlock the challenge",status:"Status",grantClaimByButtonSuccessMessage:"Challenge has been triggered successfully and is now available on the Active tab"}},l=(e,i)=>o[void 0!==i&&i in o?i:"en"][e],r=async e=>{if(e)try{const t=await fetch(e);if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);const n=await t.json();i=n,Object.keys(i).forEach((e=>{o[e]||(o[e]={});for(let t in i[e])o[e][t]=i[e][t]}))}catch(e){console.error("Failed to fetch or parse translations from URL:",e)}var i};var h,c,d,g,M,u,p,b,m,z,w,v,y,f,x,C;!function(e){e[e.Accumulative=0]="Accumulative",e[e.SingleBet=1]="SingleBet",e[e.MultipleOneBetSize=2]="MultipleOneBetSize",e[e.BetMultiplier=3]="BetMultiplier"}(h||(h={})),function(e){e[e.Single=0]="Single",e[e.Daily=1]="Daily",e[e.Weekly=2]="Weekly",e[e.Monthly=3]="Monthly"}(c||(c={})),function(e){e[e.FreeSpins=0]="FreeSpins",e[e.LuckyWheel=1]="LuckyWheel",e[e.Leaderboard=2]="Leaderboard",e[e.Challenge=3]="Challenge",e[e.Custom=4]="Custom"}(d||(d={})),function(e){e[e.Closed=0]="Closed",e[e.InProgress=1]="InProgress",e[e.Fillup=2]="Fillup",e[e.Completed=3]="Completed"}(g||(g={})),function(e){e[e.Started=0]="Started",e[e.InProgress=1]="InProgress",e[e.PendingLevelReward=2]="PendingLevelReward",e[e.Completed=3]="Completed",e[e.Expired=4]="Expired",e[e.Forfeited=5]="Forfeited",e[e.Awaiting=6]="Awaiting",e[e.Paused=7]="Paused",e[e.Unavailable=8]="Unavailable"}(M||(M={})),function(e){e[e.Draft=0]="Draft",e[e.Enabled=1]="Enabled",e[e.Paused=2]="Paused",e[e.Closed=3]="Closed",e[e.Deleted=4]="Deleted"}(u||(u={})),function(e){e[e.GameLaunch=0]="GameLaunch",e[e.Reward=1]="Reward",e[e.Manual=2]="Manual",e[e.Claim=3]="Claim",e[e.Event=4]="Event",e[e.Deposit=5]="Deposit",e[e.ClaimByButton=6]="ClaimByButton"}(p||(p={})),function(e){e[e.Period=0]="Period",e[e.Date=1]="Date"}(b||(b={})),function(e){e[e.Casino=0]="Casino",e[e.Any=1]="Any",e[e.Sportsbook=2]="Sportsbook"}(m||(m={})),function(e){e[e.Any=0]="Any",e[e.Live=1]="Live",e[e.PreLive=2]="PreLive"}(z||(z={})),function(e){e[e.Single=0]="Single",e[e.Multiple=1]="Multiple",e[e.System=2]="System"}(w||(w={})),function(e){e[e.Any=0]="Any",e[e.BankerOnly=1]="BankerOnly",e[e.NotBankerOnly=2]="NotBankerOnly"}(v||(v={})),function(e){e[e.Any=0]="Any",e[e.BetBuilderOnly=1]="BetBuilderOnly",e[e.NotBetBuilderOnly=2]="NotBetBuilderOnly"}(y||(y={})),function(e){e[e.RealCash=0]="RealCash",e[e.BonusMoney=1]="BonusMoney",e[e.Mixed=2]="Mixed"}(f||(f={})),function(e){e[e.Promo=0]="Promo",e[e.Active=1]="Active",e[e.Pending=2]="Pending",e[e.Finished=3]="Finished",e[e.Code=4]="Code"}(x||(x={})),function(e){e[e.Levels=0]="Levels",e[e.Games=1]="Games",e[e.Events=2]="Events",e[e.Rules=3]="Rules"}(C||(C={}));const N=["Completed","Expired","Forfeited"];var j,D,I,_;!function(e){e[e.Completed=0]="Completed",e[e.Expired=1]="Expired",e[e.Forfeited=2]="Forfeited"}(j||(j={})),function(e){e.ChallengesHistory="ChallengesHistoryRequest",e.ChallengePromoTab="ChallengePromoTabRequest",e.ClaimChallengeByCode="ClaimChallengeByCodeRequest",e.ChallengeJoin="ChallengeJoinRequest",e.RedirectToDepositPage="RedirectToDepositPage",e.ClaimChallengeByButton="ClaimChallengeByButtonRequest",e.GetChallengeGames="GetChallengeGamesRequest",e.ChallengeIsNew="ChallengeIsNewRequest",e.ChallengeInGameRedirect="ChallengeInGameRedirect",e.ForfeitChallenge="ForfeitChallengeRequest"}(D||(D={})),function(e){e.ChallengesHistory="ChallengesHistoryResponse",e.ChallengePromoTab="ChallengePromoTabResponse",e.ClaimChallengeByCode="ClaimChallengeByCodeResponse",e.ChallengeJoin="ChallengeJoinResponse",e.ClaimChallengeByButton="ClaimChallengeByButtonResponse",e.GetChallengeGames="GetChallengeGamesResponse",e.ChallengeIsNew="ChallengeIsNewResponse",e.ForfeitChallenge="ForfeitChallengeResponse",e.ChangeChallengeProgressStatus="ChangeChallengeProgressStatus",e.ChallengeChangeStatusNotification="ChallengeChangeStatusNotification",e.ChallengeForfeitNotification="ChallengeForfeitNotification",e.UpdateChallengeProgress="UpdateChallengeProgress",e.NewChallengeProgressGranted="NewChallengeProgressGranted"}(I||(I={})),function(e){e.PromoTab="promo",e.PendingTab="pending",e.FinishedTab="finished",e.CodeTab="code"}(_||(_={}));const A=class{constructor(t){e(this,t),this.EMPTY_STATE_PAGE_DESCRIPTION_MAP={[x.Promo]:{header:"promoTabEmptyHeader",description:"promoTabEmptyDescription"},[x.Active]:{header:"activeTabEmptyHeader",description:"activeTabEmptyDescription"},[x.Pending]:{header:"pendingTabEmptyHeader",description:"pendingTabEmptyDescription"},[x.Finished]:{header:"finishedTabEmptyHeader",description:"finishedTabEmptyDescription"}},this.onActiveChallengeChange=e=>{var i,t,n;(null==e?void 0:e.detail)&&(this.removeOptedOutChallenge(),this.updateActiveChallenge(this.activeTabIndex===x.Active?null===(i=this.activeChallenges)||void 0===i?void 0:i.find((i=>(null==i?void 0:i.Id)===e.detail)):this.activeTabIndex===x.Pending?null===(t=this.pendingChallenges)||void 0===t?void 0:t.find((i=>(null==i?void 0:i.Id)===e.detail)):null===(n=this.promoChallenges)||void 0===n?void 0:n.find((i=>(null==i?void 0:i.Id)===e.detail))))},this.onSeeMoreClick=e=>{this.detailsSubPageInfo={open:e.detail.open,tab:e.detail.tab}},this.onLoadMorePlayerHistory=e=>{window.postMessage({type:D.ChallengesHistory,data:e.detail})},this.isInactiveChallenge=e=>[M.Awaiting,M.Forfeited,M.Completed,M.Expired].includes(e.Status)||e.ChallengeStatus===u.Paused,this.updateActiveChallenge=e=>{var i;this.activeChallenge=e,this.activeProgressId=null===(i=this.activeChallenge)||void 0===i?void 0:i.Id},this.removeOptedOutChallenge=()=>{var e;this.isOptedOut&&(this.isOptedOut=!1,this.activeChallenges=null===(e=this.activeChallenges)||void 0===e?void 0:e.filter((e=>{var i;return(null==e?void 0:e.Id)!==(null===(i=this.activeChallenge)||void 0===i?void 0:i.Id)})),this.activeChallenge=null)},this.handleTabClick=e=>{e.detail!==this.activeTabIndex&&(this.removeOptedOutChallenge(),this.activeTabIndex=e.detail,this.activeTabIndex===x.Promo&&window.postMessage({type:D.ChallengePromoTab,data:{}}),this.activeTabIndex===x.Active&&this.updateActiveChallenge(this.activeChallenges[0]),this.activeTabIndex===x.Pending&&this.updateActiveChallenge(this.pendingChallenges[0]),this.activeTabIndex===x.Finished&&window.postMessage({type:D.ChallengesHistory,data:{PageSize:20,PageNumber:0}}),e.detail!==x.Code&&(this.emptyState=this.EMPTY_STATE_PAGE_DESCRIPTION_MAP[e.detail]))},this.openNotification=e=>{this.notification=e,setTimeout((()=>this.notification=null),1e4)},this.renderNotification=()=>{var e,t,n;return i("div",{class:"notification "+((null===(e=this.notification)||void 0===e?void 0:e.errored)?"errored":"")},i("div",{class:"row"},i("img",{src:(null===(t=this.notification)||void 0===t?void 0:t.errored)?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUiIGhlaWdodD0iMTUiIHZpZXdCb3g9IjAgMCAxNSAxNSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03LjMzMzMzIDEuMzMzMzNDNC4wMTk2MiAxLjMzMzMzIDEuMzMzMzMgNC4wMTk2MiAxLjMzMzMzIDcuMzMzMzNDMS4zMzMzMyAxMC42NDcgNC4wMTk2MiAxMy4zMzMzIDcuMzMzMzMgMTMuMzMzM0MxMC42NDcgMTMuMzMzMyAxMy4zMzMzIDEwLjY0NyAxMy4zMzMzIDcuMzMzMzNDMTMuMzMzMyA0LjAxOTYyIDEwLjY0NyAxLjMzMzMzIDcuMzMzMzMgMS4zMzMzM1pNMCA3LjMzMzMzQzAgMy4yODMyNSAzLjI4MzI1IDAgNy4zMzMzMyAwQzExLjM4MzQgMCAxNC42NjY3IDMuMjgzMjUgMTQuNjY2NyA3LjMzMzMzQzE0LjY2NjcgMTEuMzgzNCAxMS4zODM0IDE0LjY2NjcgNy4zMzMzMyAxNC42NjY3QzMuMjgzMjUgMTQuNjY2NyAwIDExLjM4MzQgMCA3LjMzMzMzWk03LjMzMzMzIDRDNy43MDE1MiA0IDggNC4yOTg0OCA4IDQuNjY2NjdWNy4zMzMzM0M4IDcuNzAxNTIgNy43MDE1MiA4IDcuMzMzMzMgOEM2Ljk2NTE0IDggNi42NjY2NyA3LjcwMTUyIDYuNjY2NjcgNy4zMzMzM1Y0LjY2NjY3QzYuNjY2NjcgNC4yOTg0OCA2Ljk2NTE0IDQgNy4zMzMzMyA0Wk02LjY2NjY3IDEwQzYuNjY2NjcgOS42MzE4MSA2Ljk2NTE0IDkuMzMzMzMgNy4zMzMzMyA5LjMzMzMzSDcuMzRDNy43MDgxOSA5LjMzMzMzIDguMDA2NjcgOS42MzE4MSA4LjAwNjY3IDEwQzguMDA2NjcgMTAuMzY4MiA3LjcwODE5IDEwLjY2NjcgNy4zNCAxMC42NjY3SDcuMzMzMzNDNi45NjUxNCAxMC42NjY3IDYuNjY2NjcgMTAuMzY4MiA2LjY2NjY3IDEwWiIgZmlsbD0iI0ZGNEQ0RiIvPgo8L3N2Zz4K":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUiIGhlaWdodD0iMTUiIHZpZXdCb3g9IjAgMCAxNSAxNSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03LjMzMzMzIDEuMzMzMzNDNC4wMTk2MiAxLjMzMzMzIDEuMzMzMzMgNC4wMTk2MiAxLjMzMzMzIDcuMzMzMzNDMS4zMzMzMyAxMC42NDcgNC4wMTk2MiAxMy4zMzMzIDcuMzMzMzMgMTMuMzMzM0MxMC42NDcgMTMuMzMzMyAxMy4zMzMzIDEwLjY0NyAxMy4zMzMzIDcuMzMzMzNDMTMuMzMzMyA0LjAxOTYyIDEwLjY0NyAxLjMzMzMzIDcuMzMzMzMgMS4zMzMzM1pNMCA3LjMzMzMzQzAgMy4yODMyNSAzLjI4MzI1IDAgNy4zMzMzMyAwQzExLjM4MzQgMCAxNC42NjY3IDMuMjgzMjUgMTQuNjY2NyA3LjMzMzMzQzE0LjY2NjcgMTEuMzgzNCAxMS4zODM0IDE0LjY2NjcgNy4zMzMzMyAxNC42NjY3QzMuMjgzMjUgMTQuNjY2NyAwIDExLjM4MzQgMCA3LjMzMzMzWk0xMC44MDQ3IDQuODYxOTNDMTEuMDY1MSA1LjEyMjI4IDExLjA2NTEgNS41NDQzOSAxMC44MDQ3IDUuODA0NzRMNi44MDQ3NCA5LjgwNDc0QzYuNTQ0MzkgMTAuMDY1MSA2LjEyMjI4IDEwLjA2NTEgNS44NjE5MyA5LjgwNDc0TDMuODYxOTMgNy44MDQ3NEMzLjYwMTU4IDcuNTQ0MzkgMy42MDE1OCA3LjEyMjI4IDMuODYxOTMgNi44NjE5M0M0LjEyMjI4IDYuNjAxNTggNC41NDQzOSA2LjYwMTU4IDQuODA0NzQgNi44NjE5M0w2LjMzMzMzIDguMzkwNTJMOS44NjE5MyA0Ljg2MTkzQzEwLjEyMjMgNC42MDE1OCAxMC41NDQ0IDQuNjAxNTggMTAuODA0NyA0Ljg2MTkzWiIgZmlsbD0iIzAwRkE1QSIvPgo8L3N2Zz4K",class:"notification__icon",alt:""}),i("p",{class:"notification__message"},null===(n=this.notification)||void 0===n?void 0:n.message)))},this.renderHeader=e=>i("div",null,i("h1",{class:"challenges__drawer__title"},i("span",null,l("title",this.language)),i("button",{class:"challenges__drawer__close",onClick:this.onCloseClick},i("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTIuNSAxNy41TDE3LjUgMi41IiBzdHJva2U9IndoaXRlIiBzdHJva2Utd2lkdGg9IjEuMDA0NTkiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+CjxwYXRoIGQ9Ik0yLjUgMi41TDE3LjUgMTcuNSIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIxLjAwNDU5IiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K",alt:""}))),this.enabledWidgetTabs.length>0&&i("casino-challenges-overlay-tabs",{onTabClick:this.handleTabClick,activeTabIndex:this.activeTabIndex,activeTabHasNotification:!1,pendingTabHasNotification:!1,language:this.language,"is-mobile":e,enabledWidgetTabs:this.enabledWidgetTabs})),this.isEmptyState=()=>{if(!this.loading&&this.activeTabIndex!==x.Code){if(this.activeTabIndex===x.Active&&!this.activeChallenges.length)return!0;if(this.activeTabIndex===x.Pending&&!this.pendingChallenges.length)return!0;if(this.activeTabIndex===x.Promo&&!this.promoChallenges.length)return!0;if(this.activeTabIndex===x.Finished&&!this.playerHistory.length)return!0}return!1},this.renderEmptyState=e=>{var t,n;return i("div",null,this.renderHeader(e),i("casino-challenges-empty-state",{header:l(null===(t=this.emptyState)||void 0===t?void 0:t.header,this.language),description:l(null===(n=this.emptyState)||void 0===n?void 0:n.description,this.language),"is-mobile":e}))},this.renderFinishedTab=e=>i("div",null,this.renderHeader(e),i("casino-challenges-overlay-drawer-history",{mbSource:this.mbSource,clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,translationUrl:this.translationUrl,language:this.language,isMobile:e,historyItems:this.playerHistory,hasMore:this.hasMorePlayerHistory,onLoadMore:this.onLoadMorePlayerHistory,loading:this.loading})),this.renderCodeTab=e=>i("div",null,this.renderHeader(e),i("casino-challenges-claim-code",{"is-mobile":e,translationUrl:this.translationUrl,language:this.language})),this.renderChallengeDetails=(e,t=!1)=>i("casino-challenges-overlay-drawer-details",{translationUrl:this.translationUrl,language:this.language,challenge:this.activeChallenge,swipped:this.swipped,progress:this.progress,"is-mobile":e,"is-unique":t,"is-opted-out":this.isOptedOut,"active-challenges-tab-index":this.activeTabIndex,onSeeMoreClick:this.onSeeMoreClick,detailsSubPageInfo:this.detailsSubPageInfo,challengeGames:this.challengeGames,onCloseClick:this.onCloseClick}),this.renderChallengesTabs=e=>{const t=this.activeTabIndex===x.Active?this.activeChallenges:this.activeTabIndex===x.Pending?this.pendingChallenges:this.promoChallenges,n=1===t.length;return i("swipe-up",{onSwippedUp:e=>{this.swipped=e.detail.swipped,this.progress=e.detail.progress},isMobile:e,isOneSlider:n},i("div",{class:"content-header",slot:"header"},this.renderHeader(e),i("div",{class:{"content-spacer":this.swipped||!e,"one-slide":n&&this.swipped}},i("casino-challenges-overlay-slider",{mbSource:this.mbSource,clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,translationUrl:this.translationUrl,language:this.language,challenges:t,isMobile:e,onActiveChallengeChange:this.onActiveChallengeChange,initialProgressId:this.activeProgressId,activeTabIndex:this.activeTabIndex}))),i("div",{class:"content-details",slot:"details",style:{overflow:this.swipped?"auto":"hidden"}},this.renderChallengeDetails(e,n)))},this.onCloseClick=()=>{var e,i;this.pendingChallenges=null===(e=this.pendingChallenges)||void 0===e?void 0:e.filter((e=>e.Status===M.Awaiting)),this.activeChallenges=null===(i=this.activeChallenges)||void 0===i?void 0:i.filter((e=>!this.isInactiveChallenge(e))),this.detailsSubPageInfo={open:!1,tab:null},this.loading=!1,this.isOptedOut=!1,this.handleClose()},this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.translationUrl="",this.language="en",this.isOpen=!1,this.handleClose=()=>{},this.challenges=[],this.initialProgressId="",this.enabledWidgetTabs=void 0,this.activeChallenge=null,this.activeProgressId="",this.activeTabIndex=x.Active,this.error="",this.hasError=!1,this.swipped=!1,this.detailsSubPageInfo=void 0,this.progress=0,this.loading=!1,this.notification=null,this.optOutModaIsOpen=!1,this.isOptedOut=!1,this.prevUpdateEvent=void 0,this.challengeGames=[],this.activeChallenges=[],this.pendingChallenges=[],this.promoChallenges=[],this.playerHistory=[],this.hasMorePlayerHistory=!1,this.emptyState={header:"activeTabEmptyHeader",description:"activeTabEmptyDescription"}}handleClientStylingChange(e,i){e!=i&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(e,i){e!=i&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(e,i){e!=i&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}handleIsOpenChange(e){var i;if(e)if(this.initialProgressId&&this.challenges.length||!this.enabledWidgetTabs.includes(_.PromoTab)){this.activeTabIndex=x.Active,this.activeProgressId=this.initialProgressId;const e=(null===(i=this.activeChallenges)||void 0===i?void 0:i.find((e=>e.Id===this.activeProgressId)))||this.activeChallenges[0];this.updateActiveChallenge(e||null)}else this.activeTabIndex=x.Promo,window.postMessage({type:D.ChallengePromoTab,data:{}})}onActiveChallengeChanged(){this.challengeGames=[]}onOpenOptOut(){this.optOutModaIsOpen=!0}onCloseOptOut(){this.optOutModaIsOpen=!1}onConfirmOptOut(){window.postMessage({type:D.ForfeitChallenge,data:{ChallengeId:this.activeChallenge.ChallengeId}})}onChallengeExpired(e){if(null==e?void 0:e.detail)switch(this.activeTabIndex){case x.Active:this.activeChallenges=this.updateChallenge(this.activeChallenges,e.detail,{Status:M.Expired});break;case x.Pending:this.pendingChallenges=this.updateChallenge(this.pendingChallenges,e.detail,{Status:M.Expired});break;case x.Promo:this.promoChallenges=this.updateChallenge(this.promoChallenges,e.detail,{Status:M.Expired})}}handleEvent(e){var i,t,n,s;const{type:a,data:o,success:r,errorMessage:h}=null==e?void 0:e.data;switch(console.log("\nReceived event: ",null==e?void 0:e.data.type),console.log(e),a){case I.ChallengePromoTab:r?(this.promoChallenges=o||[],this.updateActiveChallenge(this.promoChallenges[0])):(this.promoChallenges=[],this.updateActiveChallenge(null),this.openNotification({message:h,errored:!0})),this.loading=!1;break;case I.ChallengesHistory:r?(this.playerHistory=this.playerHistory.length<(null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.totalItem)?[...this.playerHistory,...o]:o,this.hasMorePlayerHistory=(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.totalItem)>this.playerHistory.length):this.openNotification({message:h,errored:!0}),this.loading=!1;break;case I.ClaimChallengeByCode:r?(this.openNotification({message:l("claimCodeSuccessMessage",this.language)}),this.activeChallenges=[...this.activeChallenges,o]):this.openNotification({message:h,errored:!0}),this.loading=!1;break;case I.ChallengeJoin:if(r){const e=[M.Paused,M.Started].includes(null===(n=this.activeChallenge)||void 0===n?void 0:n.Status);this.activeChallenges=this.updateChallenge(this.activeChallenges,e?null==o?void 0:o.joinId:null==o?void 0:o.unjoinId,{Status:e?M.InProgress:M.Paused})}else this.openNotification({message:h,errored:!0});this.loading=!1;break;case I.ChallengeIsNew:r?this.updateChallengeByProgressId(null==o?void 0:o.challengeProgressId,{IsNew:!1}):this.openNotification({message:h,errored:!0});break;case I.GetChallengeGames:r?this.challengeGames=o:this.openNotification({message:h,errored:!0}),this.loading=!1;break;case I.ClaimChallengeByButton:if(r){const e=Array.isArray(o)?o[0]:o;e&&(e.IsNew=!1,this.activeChallenges=[...this.activeChallenges,e],this.updateActiveChallenge(e),this.activeTabIndex=x.Active,this.openNotification({message:l("grantClaimByButtonSuccessMessage",this.language)}))}else this.openNotification({message:h,errored:!0});this.loading=!1;break;case I.ForfeitChallenge:this.optOutModaIsOpen=!1,r?(this.openNotification({message:l("optOutSuccessMessage",this.language)}),this.detailsSubPageInfo={open:!1,tab:null},this.isOptedOut=!0):this.openNotification({message:h,errored:!0}),this.loading=!1;break;case I.ChangeChallengeProgressStatus:this.updateChallengeByProgressId(null==o?void 0:o.ChallengeProgressId,{Status:null==o?void 0:o.ChallengeProgressStatus});break;case I.ChallengeChangeStatusNotification:this.updateChallengeById(null==o?void 0:o.ChallengeId,{ChallengeStatus:(null==o?void 0:o.IsEnabled)?u.Enabled:u.Paused});break;case I.ChallengeForfeitNotification:this.updateChallengeById(null==o?void 0:o.ChallengeId,{Status:M.Forfeited});break;case I.UpdateChallengeProgress:{const e=o;if(!((e,i)=>{if(!e)return!0;if(e.ProgressId!==i.ProgressId)return!0;if(e.Levels.length!==i.Levels.length)return!0;for(let t=0;t<i.Levels.length;t++){const n=e.Levels[t],s=i.Levels[t];if(n.LevelId!==s.LevelId||n.ProgressStatus!==s.ProgressStatus||n.ProgressPercentage!==s.ProgressPercentage)return!0}return!1})(this.prevUpdateEvent,e))return;this.prevUpdateEvent=e,this.activeChallenges=null===(s=this.activeChallenges)||void 0===s?void 0:s.map((i=>{if(i.Id!==(null==e?void 0:e.ProgressId))return i;const t=i.LevelProgresses.map((i=>{const t=null==e?void 0:e.Levels.find((e=>e.LevelId===i.LevelId));return t?Object.assign(Object.assign({},i),{ProgressStatus:t.ProgressStatus,ProgressPercentage:t.ProgressPercentage}):i}));return Object.assign(Object.assign({},i),{Status:null==e?void 0:e.Status,LevelProgresses:t})}));break}case I.NewChallengeProgressGranted:const a=(null==o?void 0:o.Status)===M.Awaiting,c=a?this.pendingChallenges:this.activeChallenges;if(null==c?void 0:c.some((e=>e.Id===(null==o?void 0:o.Id))))break;a?(this.pendingChallenges=[...c,o],this.activeTabIndex===x.Pending&&1===this.pendingChallenges.length&&this.updateActiveChallenge(o)):(this.activeChallenges=[...c,o],this.activeTabIndex===x.Active&&1===this.activeChallenges.length&&this.updateActiveChallenge(o));break;case D.ChallengeJoin:case D.GetChallengeGames:case D.ClaimChallengeByButton:case D.RedirectToDepositPage:case D.ChallengeInGameRedirect:case D.ChallengesHistory:case D.ChallengePromoTab:case D.ClaimChallengeByCode:case D.ForfeitChallenge:this.loading=!0}}componentWillLoad(){var e;if(this.translationUrl&&r(this.translationUrl),null===(e=this.challenges)||void 0===e?void 0:e.length){const e=[...this.challenges];this.pendingChallenges=e.filter((e=>e.Status===M.Awaiting)),this.activeChallenges=e.filter((e=>!this.isInactiveChallenge(e)))}}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}updateChallenge(e,i,t){var n;return(null===(n=this.activeChallenge)||void 0===n?void 0:n.Id)===i&&(this.activeChallenge=Object.assign(Object.assign({},this.activeChallenge),t)),e.map((e=>e.Id===i?Object.assign(Object.assign({},e),t):e))}updateChallengeList(e,i,t){let n=!1;const s=e.map((e=>e.ChallengeId===i?(n=!0,Object.assign(Object.assign({},e),t)):e));return n?s:e}updateChallengeById(e,i){var t;(null===(t=this.activeChallenge)||void 0===t?void 0:t.ChallengeId)===e&&(this.activeChallenge=Object.assign(Object.assign({},this.activeChallenge),i)),this.activeChallenges=this.updateChallengeList(this.activeChallenges,e,i),this.pendingChallenges=this.updateChallengeList(this.pendingChallenges,e,i),this.promoChallenges=this.updateChallengeList(this.promoChallenges,e,i)}updateChallengeByProgressId(e,i){var t;(null===(t=this.activeChallenge)||void 0===t?void 0:t.Id)===e&&(this.activeChallenge=Object.assign(Object.assign({},this.activeChallenge),i)),this.activeChallenges.find((i=>i.Id===e))?this.activeChallenges=this.activeChallenges.map((t=>t.Id===e?Object.assign(Object.assign({},t),i):t)):this.pendingChallenges.find((i=>i.Id===e))?this.pendingChallenges=this.pendingChallenges.map((t=>t.Id===e?Object.assign(Object.assign({},t),i):t)):this.promoChallenges=this.promoChallenges.map((t=>t.Id===e?Object.assign(Object.assign({},t),i):t))}renderContent(e,t){var n;if(t)return this.renderEmptyState(e);if(null===(n=this.detailsSubPageInfo)||void 0===n?void 0:n.open)return i("div",{class:"content-sub-page",slot:"details"},this.renderChallengeDetails(e));switch(this.activeTabIndex){case x.Promo:case x.Active:case x.Pending:return this.renderChallengesTabs(e);case x.Code:return this.renderCodeTab(e);case x.Finished:return this.renderFinishedTab(e);default:return}}render(){if(!this.isOpen)return;const e=(()=>{let e=window.navigator.userAgent;return!!(e.toLowerCase().match(/android/i)||e.toLowerCase().match(/blackberry|bb/i)||e.toLowerCase().match(/iphone|ipad|ipod/i)||e.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i))})()||window.innerWidth<=768,t=this.isEmptyState();return i("div",{ref:e=>this.stylingContainer=e,class:{container:!0,open:this.isOpen,mobile:e}},i("div",{class:"challenges__backdrop",onClick:this.onCloseClick}),i("div",{class:"challenges__drawer"},i("casino-challenge-overlay-background",{empty:t}),i("div",{class:"challenges__drawer__content"},this.renderContent(e,t)),this.loading&&i("casino-challenges-overlay-loader",{"full-size":!0,"is-mobile":e}),i("casino-challenge-opt-out-modal",{open:this.optOutModaIsOpen,"is-mobile":e,language:this.language})),this.notification&&this.renderNotification())}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"],isOpen:["handleIsOpenChange"],activeChallenge:["onActiveChallengeChanged"]}}};A.style='@import url("https://fonts.googleapis.com/css2?family=Teachers:ital,wght@0,400..800;1,400..800&display=swap");\n.container {\n z-index: 301;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n pointer-events: none;\n container-name: challenges-game-page;\n container-type: size;\n}\n.container.open {\n pointer-events: auto;\n}\n\n.mobile .challenges__drawer {\n width: 100%;\n height: 100%;\n left: 0;\n bottom: 0;\n border-radius: 0;\n backdrop-filter: blur(16px);\n border: none;\n max-width: none;\n min-width: initial;\n}\n.mobile .challenges__drawer .content-spacer {\n margin-bottom: 32px;\n}\n.mobile .challenges__drawer .content-spacer.one-slide {\n margin-bottom: 38px;\n}\n.mobile .challenges__drawer__content {\n padding: 16px 0 0;\n}\n.mobile .challenges__drawer__content .content-details {\n height: calc(100% - 30px);\n}\n.mobile .challenges__drawer__title {\n height: 26px;\n font-size: var(--emw--font-size-large, 18px);\n}\n.mobile .challenges__drawer__close {\n right: 16px;\n width: 26px;\n height: 26px;\n}\n.mobile .challenges__drawer__close img {\n width: 14px;\n}\n.mobile .challenges__backdrop {\n display: none;\n}\n.mobile .notification {\n padding: 8px 16px;\n gap: 8px;\n}\n.mobile .notification .row {\n margin: 15px 0 14px 0;\n}\n.mobile .notification__icon {\n width: 16px;\n height: 16px;\n}\n.mobile .notification__message {\n font-size: var(--emw--font-size-small, 14px);\n}\n\n.challenges__drawer {\n z-index: 302;\n position: fixed;\n left: 62px;\n bottom: 76px;\n border: 1px solid var(--emw--color-container-border, rgba(255, 255, 255, 0.0705882353));\n background: var(--emw--color-Overlay-Background, rgba(9, 9, 9, 0.8));\n backdrop-filter: blur(11px);\n box-sizing: border-box;\n width: 35%;\n min-width: 400px;\n max-width: 600px;\n height: calc(100% - 20px - 76px);\n border-radius: 30px;\n opacity: 1;\n font-family: var(--emw--font-family-primary, "Teachers"), sans-serif;\n container-name: challenges-drawer;\n container-type: size;\n}\n.challenges__drawer__title {\n height: 36px;\n color: var(--emw--color-title, #edeff2);\n text-align: center;\n font-size: var(--emw--font-size-large-xl, 22px);\n font-weight: var(--emw--font-weight-semibold, 600);\n margin: 0;\n position: relative;\n z-index: 1;\n align-content: center;\n}\n.challenges__drawer__close {\n outline: none;\n background: transparent;\n border-radius: 20px;\n border: 1.5px solid var(--emw--color-container-border, rgba(255, 255, 255, 0.0705882353));\n background: var(--emw--color-container-background, rgba(9, 9, 9, 0.5019607843));\n backdrop-filter: blur(6.882352829px);\n cursor: pointer;\n width: 36px;\n height: 36px;\n min-width: 36px;\n min-height: 36px;\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: 0;\n right: 24px;\n}\n.challenges__drawer__content {\n height: 100%;\n position: relative;\n z-index: 2;\n padding: 24px 0 0;\n box-sizing: border-box;\n}\n.challenges__drawer__content .content-header {\n width: 100%;\n flex-shrink: 0;\n}\n.challenges__drawer__content .content-details {\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n}\n.challenges__drawer__content .content-sub-page {\n display: flex;\n height: 100%;\n}\n.challenges__drawer .content-spacer {\n margin-bottom: 24px;\n}\n.challenges__drawer, .challenges__drawer * {\n scrollbar-width: thin;\n scrollbar-color: var(--emw--color-gray-250, rgba(255, 255, 255, 0.3)) transparent;\n}\n.challenges__drawer::-webkit-scrollbar, .challenges__drawer *::-webkit-scrollbar {\n width: 3px;\n}\n.challenges__drawer::-webkit-scrollbar-track, .challenges__drawer *::-webkit-scrollbar-track {\n background: transparent;\n}\n.challenges__drawer::-webkit-scrollbar-thumb, .challenges__drawer *::-webkit-scrollbar-thumb {\n background: var(--emw--color-gray-250, rgba(255, 255, 255, 0.3));\n opacity: 0.3;\n border-radius: 999px;\n transition: none;\n width: 3px;\n}\n.challenges__drawer::-webkit-scrollbar-thumb:hover, .challenges__drawer *::-webkit-scrollbar-thumb:hover {\n background: var(--emw--color-gray-250, rgba(255, 255, 255, 0.3));\n opacity: 0.3;\n width: 3px;\n}\n.challenges__drawer::-webkit-scrollbar-button, .challenges__drawer *::-webkit-scrollbar-button {\n display: none;\n}\n.challenges__backdrop {\n border: none;\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: var(--emw--color-gray-backdrop, rgba(0, 0, 0, 0.6));\n box-shadow: -5px 0 0 0 var(--emw--color-gray-backdrop, rgba(0, 0, 0, 0.6));\n z-index: 301;\n opacity: 1;\n}\n\n.notification {\n display: flex;\n position: fixed;\n z-index: 400;\n align-items: center;\n bottom: 76px;\n right: 0;\n padding: 24px;\n gap: 12px;\n max-width: 445px;\n box-sizing: border-box;\n border-radius: 20px 0 0 20px;\n border-top: 1px solid var(--emw--status-badge-success-color, #d6fff0);\n border-bottom: 1px solid var(--emw--status-badge-success-color, #d6fff0);\n border-left: 1px solid var(--emw--status-badge-success-color, #d6fff0);\n background: var(--emw--background-success-notification, linear-gradient(112deg, rgba(74, 255, 135, 0.2) 0%, rgba(74, 255, 135, 0) 100%));\n backdrop-filter: blur(16px);\n color: var(--emw--color-white, #ffffff);\n font-family: var(--emw--font-family-primary, "Teachers"), sans-serif;\n}\n.notification.errored {\n border-top: 1px solid var(--emw--status-badge-red-bg, #d63d1e);\n border-bottom: 1px solid var(--emw--status-badge-red-bg, #d63d1e);\n border-left: 1px solid var(--emw--status-badge-red-bg, #d63d1e);\n background: var(--emw--background-error-notification, rgba(9, 9, 9, 0.4));\n}\n.notification .row {\n display: flex;\n align-items: flex-start;\n}\n.notification__icon {\n width: 18px;\n height: 18px;\n margin-right: 12px;\n}\n.notification__message {\n margin: 0;\n font-size: var(--emw--font-size-medium, 16px);\n font-weight: var(--emw--font-weight-medium, 500);\n}\n.notification__message .active-tab {\n color: var(--emw--border-success-color, #00b74f);\n text-decoration-line: underline;\n cursor: pointer;\n}\n\ncasino-challenges-overlay-drawer-details {\n flex: 1;\n}\n\n@container challenges-game-page (width <= 1430px) {\n .challenges__drawer {\n width: 40%;\n left: 45px;\n }\n}\n@container challenges-game-page (width <= 1250px) {\n .challenges__drawer {\n width: 45%;\n }\n}\n@container challenges-game-page (width <= 1000px) {\n .challenges__drawer {\n width: 50%;\n left: 25px;\n }\n}\n@container challenges-game-page (width <= 800px) {\n .challenges__drawer__content {\n padding: 20px 0 0;\n }\n}\n@container challenges-game-page (height <= 850px) {\n .challenges__drawer {\n bottom: 36px;\n height: calc(100% - 20px - 36px);\n }\n .challenges__drawer .content-spacer {\n margin-bottom: 18px;\n }\n}\n@container challenges-drawer (height <= 760px) {\n .challenges__drawer .content-spacer {\n margin-bottom: 12px;\n }\n}';export{A as C,j as E,N as H,D as a,s as b,a as c,x as d,_ as e,r,n as s,l as t}
|