@everymatrix/casino-engagement-suite-tournament 1.40.0 → 1.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{p as n,b as t}from"./p-86ce7485.js";(()=>{const t=import.meta.url,e={};return""!==t&&(e.resourcesUrl=new URL(".",t).href),n(e)})().then((n=>t([["p-d9077cce",[[1,"casino-engagement-suite-tournament",{language:[1],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],leaderboardsInit:[16],tab:[32],locale:[32],tournamentItem:[32],tournamentList:[32],leaderboards:[32],isActionJoinPending:[32],isDialogOpen:[32],isShowInfo:[32],page:[32],tournamentInDialog:[32],dialog:[32],time:[32]},[[8,"message","handleEvent"]]],[1,"casino-engagement-suite-progress-bar",{value:[2],disabled:[4],hidePercent:[4,"hide-percent"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],limitStylingAppends:[32]}],[4,"general-styling-wrapper",{clientStyling:[1,"client-styling"],clientStylingUrl:[1,"client-styling-url"],translationUrl:[1,"translation-url"],targetTranslations:[16]}]]]],n)));
1
+ import{p as n,b as t}from"./p-86ce7485.js";(()=>{const t=import.meta.url,e={};return""!==t&&(e.resourcesUrl=new URL(".",t).href),n(e)})().then((n=>t([["p-023f3dc7",[[1,"casino-engagement-suite-tournament",{language:[1],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],leaderboardsInit:[16],tab:[32],locale:[32],tournamentItem:[32],tournamentList:[32],leaderboards:[32],isActionJoinPending:[32],isDialogOpen:[32],isShowInfo:[32],page:[32],tournamentInDialog:[32],dialog:[32],time:[32]},[[8,"message","handleEvent"]]],[1,"casino-engagement-suite-progress-bar",{value:[2],disabled:[4],hidePercent:[4,"hide-percent"],indeterminate:[4],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],limitStylingAppends:[32]}],[4,"general-styling-wrapper",{clientStyling:[1,"client-styling"],clientStylingUrl:[1,"client-styling-url"],translationUrl:[1,"translation-url"],targetTranslations:[16]}]]]],n)));
@@ -0,0 +1 @@
1
+ import{r as n,h as e,g as t,c as i,H as r,F as s}from"./p-86ce7485.js";const o=class{constructor(e){n(this,e),this.value=0,this.disabled=!1,this.hidePercent=!1,this.indeterminate=!1,this.clientStyling="",this.clientStylingUrl="",this.limitStylingAppends=!1,this.setClientStyling=()=>{let n=document.createElement("style");n.innerHTML=this.clientStyling,this.host.prepend(n)},this.setClientStylingURL=()=>{let n=new URL(this.clientStylingUrl),e=document.createElement("style");fetch(n.href).then((n=>n.text())).then((n=>{e.innerHTML=n,setTimeout((()=>{this.host.prepend(e)}),1)})).catch((n=>{console.log("Error ",n)}))}}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}getProgressBarClasses(){return{ProgressBar:!0,Completed:100===this.value,Disabled:this.disabled,HidePercent:this.hidePercent||this.indeterminate}}getProgressBarLineTemplate(){return e("div",this.indeterminate?{class:"ProgressBarLine Indeterminate",part:"ProgressBarLine Indeterminate"}:{class:"ProgressBarLine",part:"ProgressBarLine",style:{width:this.value+"%"}})}render(){return e("div",{class:this.getProgressBarClasses(),part:"ProgressBar"},e("div",{class:"ProgressBarInfo",part:"ProgressBarInfo"},e("slot",{name:"Title"},e("div",null)),e("slot",{name:"Percent"},e("div",{class:"ProgressBarPercent",part:"ProgressBarPercent"},this.value,"%"))),e("div",{class:"ProgressBarBackground",part:"ProgressBarBackground"},this.getProgressBarLineTemplate()))}get host(){return t(this)}};function a(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]])}return t}var l,d;o.style=":host{display:block;font-family:inherit}:host(.Desktop) .ProgressBarPercent{font-size:14px;line-height:14px}@keyframes indeterminate{0%{left:-200%;right:100%}60%{left:110%;right:-10%}to{left:110%;right:-10%}}.ProgressBarBackground{height:8px;background-color:var(--emw--color-background, #666178);border-radius:4px;position:relative;overflow:hidden}.ProgressBarLine{position:absolute;left:0;top:0;bottom:0;border-radius:4px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);transition:width ease-out 0.3s}.ProgressBarLine.Indeterminate{animation:indeterminate 1s linear infinite}.ProgressBarInfo{margin-bottom:8px;display:flex;justify-content:space-between;align-items:center}.ProgressBarPercent{font-weight:700;font-size:12px;line-height:12px}.HidePercent .ProgressBarPercent{display:none}.ProgressBar:not(.Disabled) .ProgressBarPercent{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.ProgressBar.Disabled .ProgressBarPercent{color:var(--emw--color-background, #666178)}.ProgressBar.Disabled .ProgressBarLine{background:var(--emw--color-background-secondary, #474668)}","function"==typeof SuppressedError&&SuppressedError,function(n){n.Info="Info",n.Leaderboard="Leaderboard",n.Games="Games"}(l||(l={})),function(n){n.Starts="Starts",n.Ends="Ends"}(d||(d={}));const c=(n,e)=>(Object.keys(e).map((t=>{n=n.replace(`{${t}}`,e[t])})),n),p=Object.assign(Object.assign(Object.assign({Join:"Join",Unjoin:"Unjoin"},l),d),{TC:"Terms & Conditions",ScoreCriteria:"Score Criteria",MinimumBetCriteria:"Minimum bet criteria",Place:"place",Prizes:"Rewards",LeaderboardDetails:"Leaderboard Details",UnjoinDialog:{Title:"Quit Leaderboard?",Description:"Any progress on the current Leaderboard won’t be kept and you can not rejoin the Leaderboard any more. <br /><br />Would you still like to quit?",ButtonYes:"Yes, I want to quit leaderboard",ButtonNo:"No, Stay on the leaderboard"},JoinDialog:{Tile:"Congratulations!",Description:"You have unlocked <span>{tournamentName}</span>! <br />Would you like to join?",ButtonYes:"Join",ButtonNo:"Not interested"},NoLeaderboards:"No Leaderboards yet",NoLeaderboardsTip:"Try winning tickets to Leaderboards as rewards or launching other booster games",Leaderboards:"Leaderboards",TipPrize:"You took <span>{place}</span> place and win <span>{prize}</span>",Tip:"Competition where your real money bets contribute towards the leaderboard score calculation to win the leaderboard reward."}),h=(...n)=>{let e=[];return n.map((n=>{switch(typeof n){case"string":e.push(n);break;case"object":Object.keys(n).map((t=>{n[t]&&e.push(t)}))}})),e.join(" ")};var u,g,m;!function(n){n.Confirm="Confirm",n.List="List",n.Item="Item"}(u||(u={})),function(n){n.Running="Running",n.Unstarted="Unstarted",n.Closed="Closed",n.Closing="Closing"}(g||(g={})),function(n){n.Unjoin="Unjoin",n.Tip="Tip"}(m||(m={}));const f=n=>{var{statedClasses:t,innerHTML:i}=n,r=a(n,["statedClasses","innerHTML"]);const{isHollow:s,isPending:o}=t;return e("button",Object.assign({},Object.assign({class:h("GradientRoundedButton","GradientRounded",{Hollow:s||!1,Pending:o||!1})},r)),e("span",null,i))},b=e("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg"}),x=e("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/help.svg"}),v=e("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/eye-open.svg"}),y=e("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/eye-closed.svg"}),w=e("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/back.svg"}),C=e("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/reward.svg"}),P=e("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/cup-congras.svg"}),k=n=>{const{left:t,middle:i,right:r}=n,s={left:t,middle:i,right:r};return e("div",{class:"WrapperBar"},Object.keys(s).map((n=>{return e("div",{class:"WrapperBar"+(t=n,t.split("").map(((n,e)=>0===e?n.toUpperCase():n)).join(""))},s[n]||"");var t})))};function T(n){return n.toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).replace(" at",",")}function L(n,e){return(100*((new Date).getTime()-n.getTime())/(e.getTime()-n.getTime())).toFixed(0)}const j=n=>{const e=["startTime","endTime","closeTime","exhibitionStartTime","exhibitionEndTime"],t={};return Object.keys(n).map((i=>{const r=n[i];switch(i){case"games":t[i]=r.items;break;default:t[i]=e.includes(i)?new Date(r):r}})),t};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self,function(n){n.exports=function(){function n(){}function e(n){return n()}function t(){return Object.create(null)}function i(n){n.forEach(e)}function r(n){return"function"==typeof n}function s(n,e){return n!=n?e==e:n!==e||n&&"object"==typeof n||"function"==typeof n}function o(n,e,t){n.insertBefore(e,t||null)}function a(n){n.parentNode&&n.parentNode.removeChild(n)}function l(n){const e={};for(const t of n)e[t.name]=t.value;return e}let d;function c(n){d=n}const p=[],h=[];let u=[];const g=[],m=Promise.resolve();let f=!1;function b(n){u.push(n)}const x=new Set;let v=0;function y(){if(0!==v)return;const n=d;do{try{for(;v<p.length;){const n=p[v];v++,c(n),w(n.$$)}}catch(n){throw p.length=0,v=0,n}for(c(null),p.length=0,v=0;h.length;)h.pop()();for(let n=0;n<u.length;n+=1){const e=u[n];x.has(e)||(x.add(e),e())}u.length=0}while(p.length);for(;g.length;)g.pop()();f=!1,x.clear(),c(n)}function w(n){if(null!==n.fragment){n.update(),i(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(b)}}const C=new Set;function P(n,e){-1===n.$$.dirty[0]&&(p.push(n),f||(f=!0,m.then(y)),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function k(s,o,l,p,h,u,g,m=[-1]){const f=d;c(s);const x=s.$$={fragment:null,ctx:[],props:u,update:n,not_equal:h,bound:t(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(o.context||(f?f.$$.context:[])),callbacks:t(),dirty:m,skip_bound:!1,root:o.target||f.$$.root};g&&g(x.root);let v=!1;if(x.ctx=l?l(s,o.props||{},((n,e,...t)=>{const i=t.length?t[0]:e;return x.ctx&&h(x.ctx[n],x.ctx[n]=i)&&(!x.skip_bound&&x.bound[n]&&x.bound[n](i),v&&P(s,n)),e})):[],x.update(),v=!0,i(x.before_update),x.fragment=!!p&&p(x.ctx),o.target){if(o.hydrate){const n=function(n){return Array.from(n.childNodes)}(o.target);x.fragment&&x.fragment.l(n),n.forEach(a)}else x.fragment&&x.fragment.c();o.intro&&(w=s.$$.fragment)&&w.i&&(C.delete(w),w.i(undefined)),function(n,t,s,o){const{fragment:a,after_update:l}=n.$$;a&&a.m(t,s),o||b((()=>{const t=n.$$.on_mount.map(e).filter(r);n.$$.on_destroy?n.$$.on_destroy.push(...t):i(t),n.$$.on_mount=[]})),l.forEach(b)}(s,o.target,o.anchor,o.customElement),y()}var w;c(f)}let T;function L(e){let t;return{c(){t=document.createElement("div"),t.innerHTML='<section class="LoaderContainer" part="LoaderContainer"><div class="lds-ellipsis"><div></div><div></div><div></div><div></div></div></section>',this.c=n},m(n,i){o(n,t,i),e[3](t)},p:n,i:n,o:n,d(n){n&&a(t),e[3](null)}}}function j(n,e,t){let i,{clientstyling:r=""}=e,{clientstylingurl:s=""}=e;return n.$$set=n=>{"clientstyling"in n&&t(1,r=n.clientstyling),"clientstylingurl"in n&&t(2,s=n.clientstylingurl)},n.$$.update=()=>{3&n.$$.dirty&&r&&i&&(()=>{let n=document.createElement("style");n.innerHTML=r,i.appendChild(n)})(),5&n.$$.dirty&&s&&i&&(()=>{let n=new URL(s),e=document.createElement("style");fetch(n.href).then((n=>n.text())).then((n=>{e.innerHTML=n,setTimeout((()=>{i.appendChild(e)}),1),setTimeout((()=>{}),500)}))})()},[i,r,s,function(n){h[n?"unshift":"push"]((()=>{i=n,t(0,i)}))}]}"function"==typeof HTMLElement&&(T=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:n}=this.$$;this.$$.on_disconnect=n.map(e).filter(r);for(const n in this.$$.slotted)this.appendChild(this.$$.slotted[n])}attributeChangedCallback(n,e,t){this[n]=t}disconnectedCallback(){i(this.$$.on_disconnect)}$destroy(){(function(n,e){const t=n.$$;null!==t.fragment&&(function(n){const e=[],t=[];u.forEach((i=>-1===n.indexOf(i)?e.push(i):t.push(i))),t.forEach((n=>n())),u=e}(t.after_update),i(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])})(this,1),this.$destroy=n}$on(e,t){if(!r(t))return n;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const n=i.indexOf(t);-1!==n&&i.splice(n,1)}}$set(n){this.$$set&&0!==Object.keys(n).length&&(this.$$.skip_bound=!0,this.$$set(n),this.$$.skip_bound=!1)}});class F extends T{constructor(n){super();const e=document.createElement("style");e.textContent=".LoaderContainer{display:flex;justify-content:center}.lds-ellipsis{display:inline-block;position:relative;width:80px;height:80px}.lds-ellipsis div{position:absolute;top:33px;width:13px;height:13px;border-radius:50%;background:#d1d1d1;animation-timing-function:cubic-bezier(0, 1, 1, 0)}.lds-ellipsis div:nth-child(1){left:8px;animation:lds-ellipsis1 0.6s infinite}.lds-ellipsis div:nth-child(2){left:8px;animation:lds-ellipsis2 0.6s infinite}.lds-ellipsis div:nth-child(3){left:32px;animation:lds-ellipsis2 0.6s infinite}.lds-ellipsis div:nth-child(4){left:56px;animation:lds-ellipsis3 0.6s infinite}@keyframes lds-ellipsis1{0%{transform:scale(0)}100%{transform:scale(1)}}@keyframes lds-ellipsis3{0%{transform:scale(1)}100%{transform:scale(0)}}@keyframes lds-ellipsis2{0%{transform:translate(0, 0)}100%{transform:translate(24px, 0)}}",this.shadowRoot.appendChild(e),k(this,{target:this.shadowRoot,props:l(this.attributes),customElement:!0},j,L,s,{clientstyling:1,clientstylingurl:2},null),n&&(n.target&&o(n.target,this,n.anchor),n.props&&(this.$set(n.props),y()))}static get observedAttributes(){return["clientstyling","clientstylingurl"]}get clientstyling(){return this.$$.ctx[1]}set clientstyling(n){this.$$set({clientstyling:n}),y()}get clientstylingurl(){return this.$$.ctx[2]}set clientstylingurl(n){this.$$set({clientstylingurl:n}),y()}}return!customElements.get("general-animation-loading")&&customElements.define("general-animation-loading",F),F}()}({path:undefined,exports:{},require:function(){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}});const F=class{constructor(e){n(this,e),this.close=i(this,"close",7),this.language="en",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.tab=l.Info,this.locale=p,this.tournamentItem=void 0,this.tournamentList=void 0,this.leaderboards=[],this.isActionJoinPending=!1,this.isDialogOpen=!1,this.isShowInfo=!1,this.page=u.List,this.tournamentInDialog=void 0,this.dialog={isOpen:!1,type:void 0,data:void 0},this.time=0,this.onClickConfirmJoin=()=>{this.actionJoin(this.tournamentItem),this.nextPage=u.List},this.onClickConfirmUnjoin=()=>{this.close.emit()},this.onClickDialogUnjoin=()=>{this.actionJoin(this.dialog.data),this.closeDialog()},this.onClickDialogJoin=()=>{this.closeDialog()},this.onClickBarInLayout=()=>{this.close.emit()},this.onClickBarInLayoutDialog=()=>{this.closeDialog()},this.onClickShowInfo=()=>{this.isShowInfo=!this.isShowInfo},this.onClickBarTip=()=>{this.openDialog(m.Tip)},this.onClickBarBack=()=>{this.setPage(u.List)}}setTimeInterval(){this.timeHolder=setInterval((()=>{this.tournamentList||this.tournamentItem?this.time+=1:this.time=0}),1e3)}updateTournamentListByItem(n){this.tournamentList=this.tournamentList.map((e=>e.id===n.id?j(n):e))}handleEvent(n){const e=n.data,{type:t}=e,i=a(e,["type"]);switch(t){case"ShowLeaderboardRewardModal":{const{tournament:n}=i;this.setPage(u.Confirm,{tournament:j(n)}),postMessage({type:"BarLeaderboardsClick"});break}case"UpdateTournamentsItemRes":{const n=j(i.data.item);this.tournamentItem=n,this.updateTournamentListByItem(n);break}case"UpdateLeaderboardsRes":this.leaderboards=(n=>{let{item:e,items:t}=n;return e?t.map((n=>e&&e.userID===n.userID?Object.assign(Object.assign({},n),{isMe:!0}):n)):t})(i.data);break;case"JoinTournamentRes":case"UnjoinTournamentRes":const{success:n}=i;if(n)switch(this.tournamentItem=Object.assign(Object.assign({},this.tournamentItem),{playerEnrolled:!this.tournamentItem.playerEnrolled}),this.page){case u.Item:break;case u.List:this.updateTournamentListByItem(this.tournamentItem)}this.nextPage&&(this.setPage(this.nextPage),this.nextPage=void 0),this.isActionJoinPending=!1}}get messageSender(){return{JoinTournamentReq:n=>{var e;return window.postMessage({type:"JoinTournamentReq",bonusCode:null===(e=n.wallets[0])||void 0===e?void 0:e.code})},UnjoinTournamentReq:n=>window.postMessage({type:"UnjoinTournamentReq",id:n.id}),UpdateTournamentsItemReq:n=>window.postMessage({type:"UpdateTournamentsItemReq",id:n.id}),UpdateLeaderboardsReq:n=>window.postMessage({type:"UpdateLeaderboardsReq",id:n.id})}}connectedCallback(){this.setTimeInterval()}disconnectedCallback(){clearInterval(this.timeHolder)}actionJoin(n){if(!this.isActionJoinPending){this.isActionJoinPending=!0;try{n.playerEnrolled?this.messageSender.UnjoinTournamentReq(n):this.messageSender.JoinTournamentReq(n)}catch(n){return void console.log("error",n)}}}isTournamentClosed(n){return[g.Closed,g.Closing].includes(n.state)}setPage(n,e){switch(n){case u.Confirm:case u.Item:this.tournamentItem=e.tournament,this.tournamentItem||this.messageSender.UpdateTournamentsItemReq(e.tournament),this.isTournamentClosed(this.tournamentItem)&&this.messageSender.UpdateLeaderboardsReq(this.tournamentItem)}this.tab=l.Info,this.page=n}renderPage(){switch(this.page){case u.Confirm:return this.renderPageConfirm();case u.Item:return this.renderPageLeaderboardItem();case u.List:return this.renderPageLeaderboardList()}}render(){return e(r,null,e("general-styling-wrapper",{clientStylingUrl:this.clientStylingUrl,clientStyling:this.clientStyling,targetTranslations:p,translationUrl:this.translationUrl}),this.renderPage())}onClickListItemChangePage(n){this.setPage(u.Item,{tournament:n})}onClickItemJoin(n,e){e.stopPropagation(),n.playerEnrolled?this.openDialog(m.Unjoin,n):(this.actionJoin(n),this.tournamentItem=n)}onClickTab(n){switch(this.tab=n,n){case l.Leaderboard:this.leaderboards=void 0,this.messageSender.UpdateLeaderboardsReq(this.tournamentItem);break;case l.Games:this.messageSender.UpdateTournamentsItemReq(this.tournamentItem)}}renderPageLeaderboardList(){var n;if(!this.tournamentList)return this.tournamentList=null===(n=this.leaderboardsInit)||void 0===n?void 0:n.map((n=>j(n))),e("general-animation-loading",null);const{locale:t}=this;return this.tournamentList.length?this.renderLeaderboardContainer(e(s,null,e("div",{class:"Leaderboards Row"},this.tournamentList.map((n=>e("div",{class:h("LeaderboardsItem",n.playerEnrolled?" GradientRounded Hollow":""),onClick:this.onClickListItemChangePage.bind(this,n)},e("div",{class:"LeaderboardsItemContainer"},this.renderTitleContainer(n),this.renderTimeBar(n)))))))):e("div",{class:"NoLeaderboards Row"},e("div",null,t.NoLeaderboards),e("div",null,t.NoLeaderboardsTip))}renderPageConfirm(){if(!this.tournamentItem)return e("general-animation-loading",null);const n=this.tournamentItem.nameOrTitle,{locale:t}=this;return e("div",{class:"PageConfirmContainer"},e("div",{class:"GradientRounded Hollow PageConfirm"},e("div",null,P),e("div",{class:"Title"},t.JoinDialog.Tile),e("div",{class:"Description",innerHTML:c(t.JoinDialog.Description,{tournamentName:n})}),e("div",{class:"PageConfirmButtonsGroup"},e(f,Object.assign({},{statedClasses:{isPending:this.isActionJoinPending},onClick:this.onClickConfirmJoin,innerHTML:t.JoinDialog.ButtonYes})),e(f,Object.assign({},{statedClasses:{isPending:this.isActionJoinPending,isHollow:!0},onClick:this.onClickConfirmUnjoin,innerHTML:t.JoinDialog.ButtonNo})))))}renderPageLeaderboardItem(){return this.tournamentItem?this.renderLeaderboardContainer(e(s,null,this.renderTitleContainer(this.tournamentItem),this.renderTabs(),this.renderTabbedContent())):e("general-animation-loading",null)}renderDialogContent(){switch(this.dialog.type){case m.Unjoin:return this.renderDialogContentUnjoin();case m.Tip:return e("div",{class:"Tip"},this.locale.Tip)}}renderDialogContentUnjoin(){const{locale:n}=this;return e("div",{class:"DialogContentUnjoin"},e("div",{class:"DialogContentUnjoinTitle"},n.UnjoinDialog.Title),e("div",{class:"DialogContentUnjoinDescription",innerHTML:n.UnjoinDialog.Description}),e(f,Object.assign({},{statedClasses:{isPending:this.isActionJoinPending},onClick:this.onClickDialogUnjoin,innerHTML:n.UnjoinDialog.ButtonYes})),e(f,Object.assign({},{statedClasses:{isHollow:!0,isPending:this.isActionJoinPending},onClick:this.onClickDialogJoin,innerHTML:n.UnjoinDialog.ButtonNo})))}renderTitleContainer(n){const{locale:t}=this;return e("div",{class:"TitleContainer"},e("div",{class:"Title"},n.nameOrTitle),n.state!==g.Closed&&e("div",null,e(f,Object.assign({},{statedClasses:{isHollow:n.playerEnrolled,isPending:this.isActionJoinPending},onClick:this.onClickItemJoin.bind(this,n),innerHTML:n.playerEnrolled?t.Unjoin:t.Join}))))}renderTabbedContent(){switch(this.tab){case l.Info:return this.renderInfo();case l.Leaderboard:return this.renderLeaderboard();case l.Games:return this.renderGames()}}renderGames(){var n;return e("div",{class:"Games"},null===(n=this.tournamentItem.games)||void 0===n?void 0:n.map((n=>e("div",null,e("img",{src:n.defaultThumbnail,alt:""})))))}renderLeaderboard(){return this.leaderboards?this.leaderboards.length?e("table",{class:"Leaderboards"},this.leaderboards.map((n=>e("tr",{class:h({isMe:n.isMe})},e("td",{class:"LeaderboardRank"},e("span",null,n.rank)),e("td",{class:"LeaderboardName"},n.shortName),e("td",{class:"LeaderboardScore"},n.score),e("td",{class:"LeaderboardPrize"},n.prizeName))))):"":e("general-animation-loading",null)}renderTabs(){const{locale:n,tab:t}=this;return e("div",{class:"TabsContainer"},e("div",{class:"Tabs"},Object.keys(l).map((i=>e("div",Object.assign({},{class:h({active:t===i}),onClick:this.onClickTab.bind(this,i)}),n[i])))))}renderTimeBar(n){return e("section",{class:"TimeContainer"},e("div",{class:"Time"},n.playerEnrolled?e(s,null,e("div",null,function(n,e){const t=Math.abs(e.getTime()-n.getTime()),i=Math.floor(t/864e5),r=Math.floor(t%864e5/36e5),s=Math.floor(t%36e5/6e4);return`${String(i).padStart(2,"0")}d:${String(r).padStart(2,"0")}h:${String(s).padStart(2,"0")}m`}(function(n,e){const t=new Date(n);return t.setSeconds(t.getSeconds()+e),t}(n.startTime,this.time),n.endTime)),e("div",null,e(f,{statedClasses:{isHollow:!0,isPendding:!1},innerHTML:`${L(n.startTime,n.endTime)}%`}))):e(s,null,e("div",null,T(n.startTime)),e("div",null,T(n.endTime)))),e("casino-engagement-suite-progress-bar",{value:Number(L(n.startTime,n.endTime)),"hide-percent":!0}))}renderInfo(){var n,t;const{locale:i,tournamentItem:r,isShowInfo:s}=this;return e("div",{class:"InfoContainer"},this.renderTimeBar(r),e("section",{class:"ShowInfo",onClick:this.onClickShowInfo},e("p",null,e("span",null,s?y:v),e("span",null,i.LeaderboardDetails))),s&&e("section",{class:"Info"},e("div",null,r.description),e("div",{class:"Criterias"},e("div",null,i.ScoreCriteria,": ",e("span",null,r.scoreCriteria)),e("div",null,i.MinimumBetCriteria,": ",e("span",null,r.minBetCount))),e("div",{class:"TC"},e("a",{href:r.termsUrl,target:"_blank"},i.TC))),this.isTournamentClosed(this.tournamentItem)&&(null===(n=this.leaderboards)||void 0===n?void 0:n.find((n=>n.isMe)))&&e("section",{class:"ResultPrize",innerHTML:c(i.TipPrize,this.getResultPrize(null===(t=this.leaderboards)||void 0===t?void 0:t.find((n=>n.isMe))))}),e("section",{class:"Prizes"},e("div",{class:"PrizesHeader"},C,e("span",{class:"PrizesText"},i.Prizes)),r.prizes.map(((n,t)=>e("div",{class:"Prize"},t+1," ",i.Place,": ",e("span",{class:"PrizeText"},n.name))))))}getResultPrize(n){return{prize:n.prizeName,place:n.rank}}renderCloseBarInLayout(){const{left:n,middle:t}=this.getWrapperBarData();return e(k,Object.assign({},{left:n,middle:t,right:e("span",Object.assign({},{onClick:this.onClickBarInLayout}),b)}))}renderCloseBarInLayoutDialog(){return e(k,Object.assign({},{right:e("span",Object.assign({},{onClick:this.onClickBarInLayoutDialog}),b)}))}renderLeaderboardContainer(n){const{dialog:{isOpen:t}}=this;return e("div",{class:"Wrapper"},e("div",{class:h("WrapperContent",{faded:t})},this.renderCloseBarInLayout(),e("div",{class:"Root"},e("div",{class:"Main"},n))),e("div",{class:"WrapperUtil"},e("dialog",{open:t},e("div",null,this.renderCloseBarInLayoutDialog(),t&&this.renderDialogContent()))))}getWrapperBarData(){const{page:n,locale:t}=this;switch(n){case u.List:return{left:e("span",{onClick:this.onClickBarTip},x),middle:t.Leaderboards};case u.Item:return{left:e("span",{onClick:this.onClickBarBack},w),middle:""}}}openDialog(n,e){this.dialog=Object.assign(Object.assign({},this.dialog),{isOpen:!0,type:n,data:e})}closeDialog(){this.dialog=Object.assign(Object.assign({},this.dialog),{isOpen:!1})}};F.style='.GradientRounded {\n display: block;\n background: linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);\n color: rgba(30, 22, 56, 1);\n \n position: relative;\n border-radius: 16px;\n\n &.Hollow {\n background: rgba(30, 22, 56, 1);\n color: #FFFFFF;\n &::before {\n content: "";\n position: absolute;\n inset: 0;\n border-radius: 15px;\n border: 1px solid transparent;\n background: linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%) border-box;\n -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);\n mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);\n -webkit-mask-composite: destination-out;\n mask-composite: exclude;\n }\n\n }\n}\n\n.GradientRoundedButton {\n border: none;\n padding: 7px;\n \n height: 32px;\n width: 100%;\n \n font-size: 14px;\n font-weight: 700;\n line-height: 17.07px;\n text-align: center;\n \n transition: .5s opacity;\n\n cursor: pointer;\n &.Pending {\n cursor: not-allowed;\n opacity: .3;\n }\n\n &.Hollow {\n \n span {\n background: -webkit-linear-gradient(98.25deg, rgb(255, 148, 0) 22.48%, rgb(254, 247, 70) 131.02%, rgb(255, 226, 74) 131.9%);\n -webkit-background-clip: text;\n -webkit-text-fill-color: transparent;\n }\n }\n}\n.Wrapper {\n height: 100%;\n position: relative;\n color: var(--emw--color-typography, #FFFFFF);\n display: flex;\n background-color: var(--emw--color-background, #1d1537);\n flex-direction: column;\n border-radius: 8px;\n overflow: hidden;\n}\n\n.WrapperContent {\n padding-bottom: 20px;\n transition: 0.5s filter;\n}\n.WrapperContent.faded {\n filter: brightness(53.3333333333%);\n}\n\n.WrapperBar {\n display: flex;\n width: 100%;\n padding: 12px 8px 8px;\n}\n\n.WrapperBarLeft, .WrapperBarRight {\n cursor: pointer;\n}\n\n.WrapperBarMiddle {\n flex-grow: 1;\n text-align: center;\n font-size: 16px;\n line-height: 16px;\n font-weight: 500;\n color: var(--emw--color-secondary, #bbb9c3);\n}\n\n:host {\n display: block;\n font-size: 12px;\n font-family: Inter;\n}\n\n.Row {\n margin: 24px 0;\n padding: 0 20px;\n}\n\n.LeaderboardsItem {\n margin: 10px 0;\n border: 1px solid #403956;\n border-radius: 16px;\n}\n.LeaderboardsItem.Hollow {\n border-color: transparent;\n}\n\n.LeaderboardsItemContainer {\n padding-top: 16px;\n}\n\n.Info {\n margin: 24px 0;\n padding: 0 20px;\n}\n\n.TimeContainer {\n margin: 24px 0;\n padding: 0 20px;\n}\n.TimeContainer .Time {\n display: flex;\n justify-content: space-between;\n font-size: 11px;\n align-items: center;\n color: var(--emw--color-secondary, #bbb9c3);\n}\n.TimeContainer .Time button {\n font-size: 12px;\n height: 20px;\n padding: 0;\n}\n.TimeContainer .Time button::before {\n inset: inherit;\n border: 0;\n}\n\n.ShowInfo {\n margin: 24px 0;\n padding: 0 20px;\n cursor: pointer;\n color: #666178;\n}\n.ShowInfo p {\n display: flex;\n gap: 4px;\n}\n\n.TitleContainer {\n display: flex;\n justify-content: space-between;\n margin: 24px 0;\n padding: 0 20px;\n margin-top: 0;\n gap: 10px;\n font-family: Montserrat;\n}\n.TitleContainer .GradientRoundedButton {\n width: 120px;\n}\n\n.TabsContainer {\n margin: 24px 0;\n padding: 0 20px;\n margin: 0 20px;\n padding: 0;\n border-bottom: 1px solid #575757;\n}\n\n.Tabs {\n display: flex;\n justify-content: space-between;\n justify-content: start;\n font-size: 12px;\n margin-bottom: -1px;\n}\n.Tabs > div {\n padding: 10px;\n color: #666178;\n cursor: pointer;\n}\n.Tabs > div.active {\n color: var(--emw--color-typography, #FFF);\n border-bottom: 2px solid var(--emw--color-typography, #FFF);\n}\n\n.Title {\n font-size: 16px;\n font-weight: 700;\n line-height: 19.5px;\n text-align: left;\n word-break: break-word;\n}\n\n.TC {\n margin-top: 12px;\n}\n.TC a {\n color: #59d1ff;\n}\n\n.Criterias {\n margin: 12px 0;\n}\n.Criterias span {\n color: var(--emw--color-primary, #ffd62f);\n font-weight: 400;\n}\n\n.ResultPrize {\n margin: 24px 0;\n padding: 0 20px;\n}\n.ResultPrize span {\n color: var(--emw--color-primary, #ffd62f);\n font-weight: 400;\n}\n\n.Prizes {\n margin: 24px 0;\n padding: 0 20px;\n}\n.Prizes .PrizesText {\n margin-left: 3px;\n font-weight: 600;\n}\n.Prizes .PrizesHeader {\n align-items: center;\n display: flex;\n}\n.Prizes .PrizesHeader img {\n width: 12px;\n}\n.Prizes .Prize {\n margin: 8px 0;\n}\n.Prizes .Prize .PrizeText {\n color: var(--emw--color-primary, #ffd62f);\n font-weight: 400;\n}\n\n* {\n box-sizing: border-box;\n}\n\n.Leaderboards {\n width: 100%;\n text-align: center;\n border-collapse: collapse;\n}\n.Leaderboards td {\n opacity: 0.6;\n padding: 20px 5px;\n}\n.Leaderboards td:first-child {\n padding-left: 20px;\n}\n.Leaderboards td:last-child {\n padding-right: 20px;\n}\n.Leaderboards .LeaderboardName {\n color: var(--emw--color-typography, #FFF);\n opacity: 1;\n}\n.Leaderboards tr.isMe {\n background: rgba(0, 0, 0, 0.2);\n}\n.Leaderboards tr.isMe .LeaderboardRank span {\n padding: 0px 3px;\n opacity: 1;\n border: 1px solid var(--emw--color-primary, #ffd62f);\n border-radius: 11px;\n}\n.Leaderboards tr.isMe td {\n color: var(--emw--color-primary, #ffd62f);\n}\n\n.Games {\n margin: 24px 0;\n padding: 0 20px;\n display: flex;\n flex-wrap: wrap;\n justify-content: space-evenly;\n gap: 4px 7.25px;\n}\n.Games img {\n width: 60px;\n}\n\ndialog {\n position: absolute;\n top: 30px;\n width: 100%;\n height: 100%;\n background: transparent;\n border: 0;\n padding: 0;\n color: var(--emw--color-typography, #FFFFFF);\n}\ndialog > div {\n margin: 32px;\n border-radius: 8px;\n background: var(--emw--color-background, #1d1537);\n border: 1px solid #403956;\n align-items: center;\n}\n\n.DialogContentUnjoin {\n padding: 32px;\n padding-top: 10px;\n display: flex;\n gap: 10px;\n flex-direction: column;\n}\n\n.DialogContentUnjoinTitle {\n font-family: Montserrat;\n font-size: 20px;\n font-weight: 600;\n line-height: 24.38px;\n text-align: center;\n}\n\n.DialogContentUnjoinDescription {\n color: var(--emw--color-secondary, #bbb9c3);\n margin-bottom: 30px;\n}\n\n.Tip {\n padding: 32px;\n padding-top: 10px;\n color: var(--emw--color-secondary, #bbb9c3);\n font-size: 14px;\n}\n\n.PageConfirmContainer {\n text-align: center;\n width: 80%;\n margin: 0 auto;\n}\n\n.PageConfirm {\n padding: 40px 32px;\n display: flex;\n flex-direction: column;\n gap: 20px;\n}\n.PageConfirm .Title {\n font-size: 20px;\n text-align: center;\n}\n.PageConfirm .Description {\n color: var(--emw--color-secondary, #bbb9c3);\n font-weight: 400;\n}\n.PageConfirm .Description span {\n color: var(--emw--color-typography, #FFF);\n font-weight: 600;\n}\n\n.PageConfirmButtonsGroup {\n width: 150px;\n margin: 0 auto;\n display: flex;\n flex-direction: column;\n gap: 10px;\n}';const B=class{constructor(e){n(this,e),this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.stylingAppends=!1,this.setClientStyling=()=>{let n=document.createElement("style");n.innerHTML=this.clientStyling,this.el.prepend(n)},this.setClientStylingURL=()=>{let n=new URL(this.clientStylingUrl),e=document.createElement("style");fetch(n.href).then((n=>n.text())).then((n=>{e.innerHTML=n,setTimeout((()=>{this.el.prepend(e)}),1)})).catch((n=>{console.log("error ",n)}))}}componentDidRender(){this.stylingAppends||(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.stylingAppends=!0)}async componentWillLoad(){const n=[];if(this.translationUrl){const i=(e=this.translationUrl,t=this.targetTranslations,new Promise((n=>{fetch(e).then((n=>n.json())).then((e=>{Object.keys(e).forEach((n=>{t[n]=t[n]?t[n]:{};for(let i in e[n])t[n][i]=e[n][i]})),n(!0)}))})));n.push(i)}var e,t;return await Promise.all(n)}render(){return e("div",{class:"StyleShell"},e("slot",{name:"mainContent"}))}get el(){return t(this)}};B.style=":host{display:block}";export{o as casino_engagement_suite_progress_bar,F as casino_engagement_suite_tournament,B as general_styling_wrapper}
@@ -21,6 +21,10 @@ const CasinoEngagementSuiteProgressBar = class {
21
21
  * Hide percent value
22
22
  */
23
23
  this.hidePercent = false;
24
+ /**
25
+ * Constantly animates
26
+ */
27
+ this.indeterminate = false;
24
28
  /**
25
29
  * Client custom styling via string
26
30
  */
@@ -63,11 +67,19 @@ const CasinoEngagementSuiteProgressBar = class {
63
67
  ProgressBar: true,
64
68
  Completed: this.value === 100,
65
69
  Disabled: this.disabled,
66
- HidePercent: this.hidePercent
70
+ HidePercent: this.hidePercent || this.indeterminate
67
71
  };
68
72
  }
73
+ getProgressBarLineTemplate() {
74
+ if (this.indeterminate) {
75
+ return index.h("div", { class: "ProgressBarLine Indeterminate", part: "ProgressBarLine Indeterminate" });
76
+ }
77
+ else {
78
+ return index.h("div", { class: "ProgressBarLine", part: "ProgressBarLine", style: { width: this.value + '%' } });
79
+ }
80
+ }
69
81
  render() {
70
- return index.h("div", { class: this.getProgressBarClasses(), part: "ProgressBar" }, index.h("div", { class: "ProgressBarInfo", part: "ProgressBarInfo" }, index.h("slot", { name: "Title" }, index.h("div", null)), index.h("slot", { name: "Percent" }, index.h("div", { class: "ProgressBarPercent", part: "ProgressBarPercent" }, this.value, "%"))), index.h("div", { class: "ProgressBarBackground", part: "ProgressBarBackground" }, index.h("div", { class: "ProgressBarLine", part: "ProgressBarLine", style: { width: this.value + '%' } })));
82
+ return index.h("div", { class: this.getProgressBarClasses(), part: "ProgressBar" }, index.h("div", { class: "ProgressBarInfo", part: "ProgressBarInfo" }, index.h("slot", { name: "Title" }, index.h("div", null)), index.h("slot", { name: "Percent" }, index.h("div", { class: "ProgressBarPercent", part: "ProgressBarPercent" }, this.value, "%"))), index.h("div", { class: "ProgressBarBackground", part: "ProgressBarBackground" }, this.getProgressBarLineTemplate()));
71
83
  }
72
84
  get host() { return index.getElement(this); }
73
85
  };
@@ -15,5 +15,5 @@ const patchBrowser = () => {
15
15
  };
16
16
 
17
17
  patchBrowser().then(options => {
18
- return index.bootstrapLazy([["casino-engagement-suite-progress-bar_3.cjs",[[1,"casino-engagement-suite-tournament",{"language":[1],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"leaderboardsInit":[16],"tab":[32],"locale":[32],"tournamentItem":[32],"tournamentList":[32],"leaderboards":[32],"isActionJoinPending":[32],"isDialogOpen":[32],"isShowInfo":[32],"page":[32],"tournamentInDialog":[32],"dialog":[32],"time":[32]},[[8,"message","handleEvent"]]],[1,"casino-engagement-suite-progress-bar",{"value":[2],"disabled":[4],"hidePercent":[4,"hide-percent"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"limitStylingAppends":[32]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]}]]]], options);
18
+ return index.bootstrapLazy([["casino-engagement-suite-progress-bar_3.cjs",[[1,"casino-engagement-suite-tournament",{"language":[1],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"leaderboardsInit":[16],"tab":[32],"locale":[32],"tournamentItem":[32],"tournamentList":[32],"leaderboards":[32],"isActionJoinPending":[32],"isDialogOpen":[32],"isShowInfo":[32],"page":[32],"tournamentInDialog":[32],"dialog":[32],"time":[32]},[[8,"message","handleEvent"]]],[1,"casino-engagement-suite-progress-bar",{"value":[2],"disabled":[4],"hidePercent":[4,"hide-percent"],"indeterminate":[4],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"limitStylingAppends":[32]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]}]]]], options);
19
19
  });
@@ -14,7 +14,7 @@ const patchEsm = () => {
14
14
  const defineCustomElements = (win, options) => {
15
15
  if (typeof window === 'undefined') return Promise.resolve();
16
16
  return patchEsm().then(() => {
17
- return index.bootstrapLazy([["casino-engagement-suite-progress-bar_3.cjs",[[1,"casino-engagement-suite-tournament",{"language":[1],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"leaderboardsInit":[16],"tab":[32],"locale":[32],"tournamentItem":[32],"tournamentList":[32],"leaderboards":[32],"isActionJoinPending":[32],"isDialogOpen":[32],"isShowInfo":[32],"page":[32],"tournamentInDialog":[32],"dialog":[32],"time":[32]},[[8,"message","handleEvent"]]],[1,"casino-engagement-suite-progress-bar",{"value":[2],"disabled":[4],"hidePercent":[4,"hide-percent"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"limitStylingAppends":[32]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]}]]]], options);
17
+ return index.bootstrapLazy([["casino-engagement-suite-progress-bar_3.cjs",[[1,"casino-engagement-suite-tournament",{"language":[1],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"leaderboardsInit":[16],"tab":[32],"locale":[32],"tournamentItem":[32],"tournamentList":[32],"leaderboards":[32],"isActionJoinPending":[32],"isDialogOpen":[32],"isShowInfo":[32],"page":[32],"tournamentInDialog":[32],"dialog":[32],"time":[32]},[[8,"message","handleEvent"]]],[1,"casino-engagement-suite-progress-bar",{"value":[2],"disabled":[4],"hidePercent":[4,"hide-percent"],"indeterminate":[4],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"limitStylingAppends":[32]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]}]]]], options);
18
18
  });
19
19
  };
20
20
 
@@ -19,6 +19,10 @@ const CasinoEngagementSuiteProgressBar = /*@__PURE__*/ proxyCustomElement(class
19
19
  * Hide percent value
20
20
  */
21
21
  this.hidePercent = false;
22
+ /**
23
+ * Constantly animates
24
+ */
25
+ this.indeterminate = false;
22
26
  /**
23
27
  * Client custom styling via string
24
28
  */
@@ -61,11 +65,19 @@ const CasinoEngagementSuiteProgressBar = /*@__PURE__*/ proxyCustomElement(class
61
65
  ProgressBar: true,
62
66
  Completed: this.value === 100,
63
67
  Disabled: this.disabled,
64
- HidePercent: this.hidePercent
68
+ HidePercent: this.hidePercent || this.indeterminate
65
69
  };
66
70
  }
71
+ getProgressBarLineTemplate() {
72
+ if (this.indeterminate) {
73
+ return h("div", { class: "ProgressBarLine Indeterminate", part: "ProgressBarLine Indeterminate" });
74
+ }
75
+ else {
76
+ return h("div", { class: "ProgressBarLine", part: "ProgressBarLine", style: { width: this.value + '%' } });
77
+ }
78
+ }
67
79
  render() {
68
- return h("div", { class: this.getProgressBarClasses(), part: "ProgressBar" }, h("div", { class: "ProgressBarInfo", part: "ProgressBarInfo" }, h("slot", { name: "Title" }, h("div", null)), h("slot", { name: "Percent" }, h("div", { class: "ProgressBarPercent", part: "ProgressBarPercent" }, this.value, "%"))), h("div", { class: "ProgressBarBackground", part: "ProgressBarBackground" }, h("div", { class: "ProgressBarLine", part: "ProgressBarLine", style: { width: this.value + '%' } })));
80
+ return h("div", { class: this.getProgressBarClasses(), part: "ProgressBar" }, h("div", { class: "ProgressBarInfo", part: "ProgressBarInfo" }, h("slot", { name: "Title" }, h("div", null)), h("slot", { name: "Percent" }, h("div", { class: "ProgressBarPercent", part: "ProgressBarPercent" }, this.value, "%"))), h("div", { class: "ProgressBarBackground", part: "ProgressBarBackground" }, this.getProgressBarLineTemplate()));
69
81
  }
70
82
  get host() { return this; }
71
83
  static get style() { return casinoEngagementSuiteProgressBarCss; }
@@ -73,6 +85,7 @@ const CasinoEngagementSuiteProgressBar = /*@__PURE__*/ proxyCustomElement(class
73
85
  "value": [2],
74
86
  "disabled": [4],
75
87
  "hidePercent": [4, "hide-percent"],
88
+ "indeterminate": [4],
76
89
  "clientStyling": [513, "client-styling"],
77
90
  "clientStylingUrl": [513, "client-styling-url"],
78
91
  "limitStylingAppends": [32]
@@ -17,6 +17,10 @@ const CasinoEngagementSuiteProgressBar = class {
17
17
  * Hide percent value
18
18
  */
19
19
  this.hidePercent = false;
20
+ /**
21
+ * Constantly animates
22
+ */
23
+ this.indeterminate = false;
20
24
  /**
21
25
  * Client custom styling via string
22
26
  */
@@ -59,11 +63,19 @@ const CasinoEngagementSuiteProgressBar = class {
59
63
  ProgressBar: true,
60
64
  Completed: this.value === 100,
61
65
  Disabled: this.disabled,
62
- HidePercent: this.hidePercent
66
+ HidePercent: this.hidePercent || this.indeterminate
63
67
  };
64
68
  }
69
+ getProgressBarLineTemplate() {
70
+ if (this.indeterminate) {
71
+ return h("div", { class: "ProgressBarLine Indeterminate", part: "ProgressBarLine Indeterminate" });
72
+ }
73
+ else {
74
+ return h("div", { class: "ProgressBarLine", part: "ProgressBarLine", style: { width: this.value + '%' } });
75
+ }
76
+ }
65
77
  render() {
66
- return h("div", { class: this.getProgressBarClasses(), part: "ProgressBar" }, h("div", { class: "ProgressBarInfo", part: "ProgressBarInfo" }, h("slot", { name: "Title" }, h("div", null)), h("slot", { name: "Percent" }, h("div", { class: "ProgressBarPercent", part: "ProgressBarPercent" }, this.value, "%"))), h("div", { class: "ProgressBarBackground", part: "ProgressBarBackground" }, h("div", { class: "ProgressBarLine", part: "ProgressBarLine", style: { width: this.value + '%' } })));
78
+ return h("div", { class: this.getProgressBarClasses(), part: "ProgressBar" }, h("div", { class: "ProgressBarInfo", part: "ProgressBarInfo" }, h("slot", { name: "Title" }, h("div", null)), h("slot", { name: "Percent" }, h("div", { class: "ProgressBarPercent", part: "ProgressBarPercent" }, this.value, "%"))), h("div", { class: "ProgressBarBackground", part: "ProgressBarBackground" }, this.getProgressBarLineTemplate()));
67
79
  }
68
80
  get host() { return getElement(this); }
69
81
  };
@@ -13,5 +13,5 @@ const patchBrowser = () => {
13
13
  };
14
14
 
15
15
  patchBrowser().then(options => {
16
- return bootstrapLazy([["casino-engagement-suite-progress-bar_3",[[1,"casino-engagement-suite-tournament",{"language":[1],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"leaderboardsInit":[16],"tab":[32],"locale":[32],"tournamentItem":[32],"tournamentList":[32],"leaderboards":[32],"isActionJoinPending":[32],"isDialogOpen":[32],"isShowInfo":[32],"page":[32],"tournamentInDialog":[32],"dialog":[32],"time":[32]},[[8,"message","handleEvent"]]],[1,"casino-engagement-suite-progress-bar",{"value":[2],"disabled":[4],"hidePercent":[4,"hide-percent"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"limitStylingAppends":[32]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]}]]]], options);
16
+ return bootstrapLazy([["casino-engagement-suite-progress-bar_3",[[1,"casino-engagement-suite-tournament",{"language":[1],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"leaderboardsInit":[16],"tab":[32],"locale":[32],"tournamentItem":[32],"tournamentList":[32],"leaderboards":[32],"isActionJoinPending":[32],"isDialogOpen":[32],"isShowInfo":[32],"page":[32],"tournamentInDialog":[32],"dialog":[32],"time":[32]},[[8,"message","handleEvent"]]],[1,"casino-engagement-suite-progress-bar",{"value":[2],"disabled":[4],"hidePercent":[4,"hide-percent"],"indeterminate":[4],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"limitStylingAppends":[32]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]}]]]], options);
17
17
  });
@@ -10,7 +10,7 @@ const patchEsm = () => {
10
10
  const defineCustomElements = (win, options) => {
11
11
  if (typeof window === 'undefined') return Promise.resolve();
12
12
  return patchEsm().then(() => {
13
- return bootstrapLazy([["casino-engagement-suite-progress-bar_3",[[1,"casino-engagement-suite-tournament",{"language":[1],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"leaderboardsInit":[16],"tab":[32],"locale":[32],"tournamentItem":[32],"tournamentList":[32],"leaderboards":[32],"isActionJoinPending":[32],"isDialogOpen":[32],"isShowInfo":[32],"page":[32],"tournamentInDialog":[32],"dialog":[32],"time":[32]},[[8,"message","handleEvent"]]],[1,"casino-engagement-suite-progress-bar",{"value":[2],"disabled":[4],"hidePercent":[4,"hide-percent"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"limitStylingAppends":[32]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]}]]]], options);
13
+ return bootstrapLazy([["casino-engagement-suite-progress-bar_3",[[1,"casino-engagement-suite-tournament",{"language":[1],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"leaderboardsInit":[16],"tab":[32],"locale":[32],"tournamentItem":[32],"tournamentList":[32],"leaderboards":[32],"isActionJoinPending":[32],"isDialogOpen":[32],"isShowInfo":[32],"page":[32],"tournamentInDialog":[32],"dialog":[32],"time":[32]},[[8,"message","handleEvent"]]],[1,"casino-engagement-suite-progress-bar",{"value":[2],"disabled":[4],"hidePercent":[4,"hide-percent"],"indeterminate":[4],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"limitStylingAppends":[32]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]}]]]], options);
14
14
  });
15
15
  };
16
16
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/casino-engagement-suite-tournament",
3
- "version": "1.40.0",
3
+ "version": "1.41.0",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",
@@ -1 +0,0 @@
1
- import{r as n,h as e,g as t,c as i,H as r,F as s}from"./p-86ce7485.js";const o=class{constructor(e){n(this,e),this.value=0,this.disabled=!1,this.hidePercent=!1,this.clientStyling="",this.clientStylingUrl="",this.limitStylingAppends=!1,this.setClientStyling=()=>{let n=document.createElement("style");n.innerHTML=this.clientStyling,this.host.prepend(n)},this.setClientStylingURL=()=>{let n=new URL(this.clientStylingUrl),e=document.createElement("style");fetch(n.href).then((n=>n.text())).then((n=>{e.innerHTML=n,setTimeout((()=>{this.host.prepend(e)}),1)})).catch((n=>{console.log("Error ",n)}))}}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}getProgressBarClasses(){return{ProgressBar:!0,Completed:100===this.value,Disabled:this.disabled,HidePercent:this.hidePercent}}render(){return e("div",{class:this.getProgressBarClasses(),part:"ProgressBar"},e("div",{class:"ProgressBarInfo",part:"ProgressBarInfo"},e("slot",{name:"Title"},e("div",null)),e("slot",{name:"Percent"},e("div",{class:"ProgressBarPercent",part:"ProgressBarPercent"},this.value,"%"))),e("div",{class:"ProgressBarBackground",part:"ProgressBarBackground"},e("div",{class:"ProgressBarLine",part:"ProgressBarLine",style:{width:this.value+"%"}})))}get host(){return t(this)}};function a(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]])}return t}var l,d;o.style=":host{display:block;font-family:inherit}:host(.Desktop) .ProgressBarPercent{font-size:14px;line-height:14px}@keyframes indeterminate{0%{left:-200%;right:100%}60%{left:110%;right:-10%}to{left:110%;right:-10%}}.ProgressBarBackground{height:8px;background-color:var(--emw--color-background, #666178);border-radius:4px;position:relative;overflow:hidden}.ProgressBarLine{position:absolute;left:0;top:0;bottom:0;border-radius:4px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);transition:width ease-out 0.3s}.ProgressBarLine.Indeterminate{animation:indeterminate 1s linear infinite}.ProgressBarInfo{margin-bottom:8px;display:flex;justify-content:space-between;align-items:center}.ProgressBarPercent{font-weight:700;font-size:12px;line-height:12px}.HidePercent .ProgressBarPercent{display:none}.ProgressBar:not(.Disabled) .ProgressBarPercent{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.ProgressBar.Disabled .ProgressBarPercent{color:var(--emw--color-background, #666178)}.ProgressBar.Disabled .ProgressBarLine{background:var(--emw--color-background-secondary, #474668)}","function"==typeof SuppressedError&&SuppressedError,function(n){n.Info="Info",n.Leaderboard="Leaderboard",n.Games="Games"}(l||(l={})),function(n){n.Starts="Starts",n.Ends="Ends"}(d||(d={}));const c=(n,e)=>(Object.keys(e).map((t=>{n=n.replace(`{${t}}`,e[t])})),n),p=Object.assign(Object.assign(Object.assign({Join:"Join",Unjoin:"Unjoin"},l),d),{TC:"Terms & Conditions",ScoreCriteria:"Score Criteria",MinimumBetCriteria:"Minimum bet criteria",Place:"place",Prizes:"Rewards",LeaderboardDetails:"Leaderboard Details",UnjoinDialog:{Title:"Quit Leaderboard?",Description:"Any progress on the current Leaderboard won’t be kept and you can not rejoin the Leaderboard any more. <br /><br />Would you still like to quit?",ButtonYes:"Yes, I want to quit leaderboard",ButtonNo:"No, Stay on the leaderboard"},JoinDialog:{Tile:"Congratulations!",Description:"You have unlocked <span>{tournamentName}</span>! <br />Would you like to join?",ButtonYes:"Join",ButtonNo:"Not interested"},NoLeaderboards:"No Leaderboards yet",NoLeaderboardsTip:"Try winning tickets to Leaderboards as rewards or launching other booster games",Leaderboards:"Leaderboards",TipPrize:"You took <span>{place}</span> place and win <span>{prize}</span>",Tip:"Competition where your real money bets contribute towards the leaderboard score calculation to win the leaderboard reward."}),h=(...n)=>{let e=[];return n.map((n=>{switch(typeof n){case"string":e.push(n);break;case"object":Object.keys(n).map((t=>{n[t]&&e.push(t)}))}})),e.join(" ")};var u,g,m;!function(n){n.Confirm="Confirm",n.List="List",n.Item="Item"}(u||(u={})),function(n){n.Running="Running",n.Unstarted="Unstarted",n.Closed="Closed",n.Closing="Closing"}(g||(g={})),function(n){n.Unjoin="Unjoin",n.Tip="Tip"}(m||(m={}));const f=n=>{var{statedClasses:t,innerHTML:i}=n,r=a(n,["statedClasses","innerHTML"]);const{isHollow:s,isPending:o}=t;return e("button",Object.assign({},Object.assign({class:h("GradientRoundedButton","GradientRounded",{Hollow:s||!1,Pending:o||!1})},r)),e("span",null,i))},b=e("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg"}),x=e("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/help.svg"}),v=e("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/eye-open.svg"}),y=e("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/eye-closed.svg"}),w=e("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/back.svg"}),C=e("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/reward.svg"}),k=e("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/cup-congras.svg"}),P=n=>{const{left:t,middle:i,right:r}=n,s={left:t,middle:i,right:r};return e("div",{class:"WrapperBar"},Object.keys(s).map((n=>{return e("div",{class:"WrapperBar"+(t=n,t.split("").map(((n,e)=>0===e?n.toUpperCase():n)).join(""))},s[n]||"");var t})))};function T(n){return n.toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).replace(" at",",")}function L(n,e){return(100*((new Date).getTime()-n.getTime())/(e.getTime()-n.getTime())).toFixed(0)}const j=n=>{const e=["startTime","endTime","closeTime","exhibitionStartTime","exhibitionEndTime"],t={};return Object.keys(n).map((i=>{const r=n[i];switch(i){case"games":t[i]=r.items;break;default:t[i]=e.includes(i)?new Date(r):r}})),t};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self,function(n){n.exports=function(){function n(){}function e(n){return n()}function t(){return Object.create(null)}function i(n){n.forEach(e)}function r(n){return"function"==typeof n}function s(n,e){return n!=n?e==e:n!==e||n&&"object"==typeof n||"function"==typeof n}function o(n,e,t){n.insertBefore(e,t||null)}function a(n){n.parentNode&&n.parentNode.removeChild(n)}function l(n){const e={};for(const t of n)e[t.name]=t.value;return e}let d;function c(n){d=n}const p=[],h=[];let u=[];const g=[],m=Promise.resolve();let f=!1;function b(n){u.push(n)}const x=new Set;let v=0;function y(){if(0!==v)return;const n=d;do{try{for(;v<p.length;){const n=p[v];v++,c(n),w(n.$$)}}catch(n){throw p.length=0,v=0,n}for(c(null),p.length=0,v=0;h.length;)h.pop()();for(let n=0;n<u.length;n+=1){const e=u[n];x.has(e)||(x.add(e),e())}u.length=0}while(p.length);for(;g.length;)g.pop()();f=!1,x.clear(),c(n)}function w(n){if(null!==n.fragment){n.update(),i(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(b)}}const C=new Set;function k(n,e){-1===n.$$.dirty[0]&&(p.push(n),f||(f=!0,m.then(y)),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function P(s,o,l,p,h,u,g,m=[-1]){const f=d;c(s);const x=s.$$={fragment:null,ctx:[],props:u,update:n,not_equal:h,bound:t(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(o.context||(f?f.$$.context:[])),callbacks:t(),dirty:m,skip_bound:!1,root:o.target||f.$$.root};g&&g(x.root);let v=!1;if(x.ctx=l?l(s,o.props||{},((n,e,...t)=>{const i=t.length?t[0]:e;return x.ctx&&h(x.ctx[n],x.ctx[n]=i)&&(!x.skip_bound&&x.bound[n]&&x.bound[n](i),v&&k(s,n)),e})):[],x.update(),v=!0,i(x.before_update),x.fragment=!!p&&p(x.ctx),o.target){if(o.hydrate){const n=function(n){return Array.from(n.childNodes)}(o.target);x.fragment&&x.fragment.l(n),n.forEach(a)}else x.fragment&&x.fragment.c();o.intro&&(w=s.$$.fragment)&&w.i&&(C.delete(w),w.i(undefined)),function(n,t,s,o){const{fragment:a,after_update:l}=n.$$;a&&a.m(t,s),o||b((()=>{const t=n.$$.on_mount.map(e).filter(r);n.$$.on_destroy?n.$$.on_destroy.push(...t):i(t),n.$$.on_mount=[]})),l.forEach(b)}(s,o.target,o.anchor,o.customElement),y()}var w;c(f)}let T;function L(e){let t;return{c(){t=document.createElement("div"),t.innerHTML='<section class="LoaderContainer" part="LoaderContainer"><div class="lds-ellipsis"><div></div><div></div><div></div><div></div></div></section>',this.c=n},m(n,i){o(n,t,i),e[3](t)},p:n,i:n,o:n,d(n){n&&a(t),e[3](null)}}}function j(n,e,t){let i,{clientstyling:r=""}=e,{clientstylingurl:s=""}=e;return n.$$set=n=>{"clientstyling"in n&&t(1,r=n.clientstyling),"clientstylingurl"in n&&t(2,s=n.clientstylingurl)},n.$$.update=()=>{3&n.$$.dirty&&r&&i&&(()=>{let n=document.createElement("style");n.innerHTML=r,i.appendChild(n)})(),5&n.$$.dirty&&s&&i&&(()=>{let n=new URL(s),e=document.createElement("style");fetch(n.href).then((n=>n.text())).then((n=>{e.innerHTML=n,setTimeout((()=>{i.appendChild(e)}),1),setTimeout((()=>{}),500)}))})()},[i,r,s,function(n){h[n?"unshift":"push"]((()=>{i=n,t(0,i)}))}]}"function"==typeof HTMLElement&&(T=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:n}=this.$$;this.$$.on_disconnect=n.map(e).filter(r);for(const n in this.$$.slotted)this.appendChild(this.$$.slotted[n])}attributeChangedCallback(n,e,t){this[n]=t}disconnectedCallback(){i(this.$$.on_disconnect)}$destroy(){(function(n,e){const t=n.$$;null!==t.fragment&&(function(n){const e=[],t=[];u.forEach((i=>-1===n.indexOf(i)?e.push(i):t.push(i))),t.forEach((n=>n())),u=e}(t.after_update),i(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])})(this,1),this.$destroy=n}$on(e,t){if(!r(t))return n;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const n=i.indexOf(t);-1!==n&&i.splice(n,1)}}$set(n){this.$$set&&0!==Object.keys(n).length&&(this.$$.skip_bound=!0,this.$$set(n),this.$$.skip_bound=!1)}});class F extends T{constructor(n){super();const e=document.createElement("style");e.textContent=".LoaderContainer{display:flex;justify-content:center}.lds-ellipsis{display:inline-block;position:relative;width:80px;height:80px}.lds-ellipsis div{position:absolute;top:33px;width:13px;height:13px;border-radius:50%;background:#d1d1d1;animation-timing-function:cubic-bezier(0, 1, 1, 0)}.lds-ellipsis div:nth-child(1){left:8px;animation:lds-ellipsis1 0.6s infinite}.lds-ellipsis div:nth-child(2){left:8px;animation:lds-ellipsis2 0.6s infinite}.lds-ellipsis div:nth-child(3){left:32px;animation:lds-ellipsis2 0.6s infinite}.lds-ellipsis div:nth-child(4){left:56px;animation:lds-ellipsis3 0.6s infinite}@keyframes lds-ellipsis1{0%{transform:scale(0)}100%{transform:scale(1)}}@keyframes lds-ellipsis3{0%{transform:scale(1)}100%{transform:scale(0)}}@keyframes lds-ellipsis2{0%{transform:translate(0, 0)}100%{transform:translate(24px, 0)}}",this.shadowRoot.appendChild(e),P(this,{target:this.shadowRoot,props:l(this.attributes),customElement:!0},j,L,s,{clientstyling:1,clientstylingurl:2},null),n&&(n.target&&o(n.target,this,n.anchor),n.props&&(this.$set(n.props),y()))}static get observedAttributes(){return["clientstyling","clientstylingurl"]}get clientstyling(){return this.$$.ctx[1]}set clientstyling(n){this.$$set({clientstyling:n}),y()}get clientstylingurl(){return this.$$.ctx[2]}set clientstylingurl(n){this.$$set({clientstylingurl:n}),y()}}return!customElements.get("general-animation-loading")&&customElements.define("general-animation-loading",F),F}()}({path:undefined,exports:{},require:function(){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}});const F=class{constructor(e){n(this,e),this.close=i(this,"close",7),this.language="en",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.tab=l.Info,this.locale=p,this.tournamentItem=void 0,this.tournamentList=void 0,this.leaderboards=[],this.isActionJoinPending=!1,this.isDialogOpen=!1,this.isShowInfo=!1,this.page=u.List,this.tournamentInDialog=void 0,this.dialog={isOpen:!1,type:void 0,data:void 0},this.time=0,this.onClickConfirmJoin=()=>{this.actionJoin(this.tournamentItem),this.nextPage=u.List},this.onClickConfirmUnjoin=()=>{this.close.emit()},this.onClickDialogUnjoin=()=>{this.actionJoin(this.dialog.data),this.closeDialog()},this.onClickDialogJoin=()=>{this.closeDialog()},this.onClickBarInLayout=()=>{this.close.emit()},this.onClickBarInLayoutDialog=()=>{this.closeDialog()},this.onClickShowInfo=()=>{this.isShowInfo=!this.isShowInfo},this.onClickBarTip=()=>{this.openDialog(m.Tip)},this.onClickBarBack=()=>{this.setPage(u.List)}}setTimeInterval(){this.timeHolder=setInterval((()=>{this.tournamentList||this.tournamentItem?this.time+=1:this.time=0}),1e3)}updateTournamentListByItem(n){this.tournamentList=this.tournamentList.map((e=>e.id===n.id?j(n):e))}handleEvent(n){const e=n.data,{type:t}=e,i=a(e,["type"]);switch(t){case"ShowLeaderboardRewardModal":{const{tournament:n}=i;this.setPage(u.Confirm,{tournament:j(n)}),postMessage({type:"BarLeaderboardsClick"});break}case"UpdateTournamentsItemRes":{const n=j(i.data.item);this.tournamentItem=n,this.updateTournamentListByItem(n);break}case"UpdateLeaderboardsRes":this.leaderboards=(n=>{let{item:e,items:t}=n;return e?t.map((n=>e&&e.userID===n.userID?Object.assign(Object.assign({},n),{isMe:!0}):n)):t})(i.data);break;case"JoinTournamentRes":case"UnjoinTournamentRes":const{success:n}=i;if(n)switch(this.tournamentItem=Object.assign(Object.assign({},this.tournamentItem),{playerEnrolled:!this.tournamentItem.playerEnrolled}),this.page){case u.Item:break;case u.List:this.updateTournamentListByItem(this.tournamentItem)}this.nextPage&&(this.setPage(this.nextPage),this.nextPage=void 0),this.isActionJoinPending=!1}}get messageSender(){return{JoinTournamentReq:n=>{var e;return window.postMessage({type:"JoinTournamentReq",bonusCode:null===(e=n.wallets[0])||void 0===e?void 0:e.code})},UnjoinTournamentReq:n=>window.postMessage({type:"UnjoinTournamentReq",id:n.id}),UpdateTournamentsItemReq:n=>window.postMessage({type:"UpdateTournamentsItemReq",id:n.id}),UpdateLeaderboardsReq:n=>window.postMessage({type:"UpdateLeaderboardsReq",id:n.id})}}connectedCallback(){this.setTimeInterval()}disconnectedCallback(){clearInterval(this.timeHolder)}actionJoin(n){if(!this.isActionJoinPending){this.isActionJoinPending=!0;try{n.playerEnrolled?this.messageSender.UnjoinTournamentReq(n):this.messageSender.JoinTournamentReq(n)}catch(n){return void console.log("error",n)}}}isTournamentClosed(n){return[g.Closed,g.Closing].includes(n.state)}setPage(n,e){switch(n){case u.Confirm:case u.Item:this.tournamentItem=e.tournament,this.tournamentItem||this.messageSender.UpdateTournamentsItemReq(e.tournament),this.isTournamentClosed(this.tournamentItem)&&this.messageSender.UpdateLeaderboardsReq(this.tournamentItem)}this.tab=l.Info,this.page=n}renderPage(){switch(this.page){case u.Confirm:return this.renderPageConfirm();case u.Item:return this.renderPageLeaderboardItem();case u.List:return this.renderPageLeaderboardList()}}render(){return e(r,null,e("general-styling-wrapper",{clientStylingUrl:this.clientStylingUrl,clientStyling:this.clientStyling,targetTranslations:p,translationUrl:this.translationUrl}),this.renderPage())}onClickListItemChangePage(n){this.setPage(u.Item,{tournament:n})}onClickItemJoin(n,e){e.stopPropagation(),n.playerEnrolled?this.openDialog(m.Unjoin,n):(this.actionJoin(n),this.tournamentItem=n)}onClickTab(n){switch(this.tab=n,n){case l.Leaderboard:this.leaderboards=void 0,this.messageSender.UpdateLeaderboardsReq(this.tournamentItem);break;case l.Games:this.messageSender.UpdateTournamentsItemReq(this.tournamentItem)}}renderPageLeaderboardList(){var n;if(!this.tournamentList)return this.tournamentList=null===(n=this.leaderboardsInit)||void 0===n?void 0:n.map((n=>j(n))),e("general-animation-loading",null);const{locale:t}=this;return this.tournamentList.length?this.renderLeaderboardContainer(e(s,null,e("div",{class:"Leaderboards Row"},this.tournamentList.map((n=>e("div",{class:h("LeaderboardsItem",n.playerEnrolled?" GradientRounded Hollow":""),onClick:this.onClickListItemChangePage.bind(this,n)},e("div",{class:"LeaderboardsItemContainer"},this.renderTitleContainer(n),this.renderTimeBar(n)))))))):e("div",{class:"NoLeaderboards Row"},e("div",null,t.NoLeaderboards),e("div",null,t.NoLeaderboardsTip))}renderPageConfirm(){if(!this.tournamentItem)return e("general-animation-loading",null);const n=this.tournamentItem.nameOrTitle,{locale:t}=this;return e("div",{class:"PageConfirmContainer"},e("div",{class:"GradientRounded Hollow PageConfirm"},e("div",null,k),e("div",{class:"Title"},t.JoinDialog.Tile),e("div",{class:"Description",innerHTML:c(t.JoinDialog.Description,{tournamentName:n})}),e("div",{class:"PageConfirmButtonsGroup"},e(f,Object.assign({},{statedClasses:{isPending:this.isActionJoinPending},onClick:this.onClickConfirmJoin,innerHTML:t.JoinDialog.ButtonYes})),e(f,Object.assign({},{statedClasses:{isPending:this.isActionJoinPending,isHollow:!0},onClick:this.onClickConfirmUnjoin,innerHTML:t.JoinDialog.ButtonNo})))))}renderPageLeaderboardItem(){return this.tournamentItem?this.renderLeaderboardContainer(e(s,null,this.renderTitleContainer(this.tournamentItem),this.renderTabs(),this.renderTabbedContent())):e("general-animation-loading",null)}renderDialogContent(){switch(this.dialog.type){case m.Unjoin:return this.renderDialogContentUnjoin();case m.Tip:return e("div",{class:"Tip"},this.locale.Tip)}}renderDialogContentUnjoin(){const{locale:n}=this;return e("div",{class:"DialogContentUnjoin"},e("div",{class:"DialogContentUnjoinTitle"},n.UnjoinDialog.Title),e("div",{class:"DialogContentUnjoinDescription",innerHTML:n.UnjoinDialog.Description}),e(f,Object.assign({},{statedClasses:{isPending:this.isActionJoinPending},onClick:this.onClickDialogUnjoin,innerHTML:n.UnjoinDialog.ButtonYes})),e(f,Object.assign({},{statedClasses:{isHollow:!0,isPending:this.isActionJoinPending},onClick:this.onClickDialogJoin,innerHTML:n.UnjoinDialog.ButtonNo})))}renderTitleContainer(n){const{locale:t}=this;return e("div",{class:"TitleContainer"},e("div",{class:"Title"},n.nameOrTitle),n.state!==g.Closed&&e("div",null,e(f,Object.assign({},{statedClasses:{isHollow:n.playerEnrolled,isPending:this.isActionJoinPending},onClick:this.onClickItemJoin.bind(this,n),innerHTML:n.playerEnrolled?t.Unjoin:t.Join}))))}renderTabbedContent(){switch(this.tab){case l.Info:return this.renderInfo();case l.Leaderboard:return this.renderLeaderboard();case l.Games:return this.renderGames()}}renderGames(){var n;return e("div",{class:"Games"},null===(n=this.tournamentItem.games)||void 0===n?void 0:n.map((n=>e("div",null,e("img",{src:n.defaultThumbnail,alt:""})))))}renderLeaderboard(){return this.leaderboards?this.leaderboards.length?e("table",{class:"Leaderboards"},this.leaderboards.map((n=>e("tr",{class:h({isMe:n.isMe})},e("td",{class:"LeaderboardRank"},e("span",null,n.rank)),e("td",{class:"LeaderboardName"},n.shortName),e("td",{class:"LeaderboardScore"},n.score),e("td",{class:"LeaderboardPrize"},n.prizeName))))):"":e("general-animation-loading",null)}renderTabs(){const{locale:n,tab:t}=this;return e("div",{class:"TabsContainer"},e("div",{class:"Tabs"},Object.keys(l).map((i=>e("div",Object.assign({},{class:h({active:t===i}),onClick:this.onClickTab.bind(this,i)}),n[i])))))}renderTimeBar(n){return e("section",{class:"TimeContainer"},e("div",{class:"Time"},n.playerEnrolled?e(s,null,e("div",null,function(n,e){const t=Math.abs(e.getTime()-n.getTime()),i=Math.floor(t/864e5),r=Math.floor(t%864e5/36e5),s=Math.floor(t%36e5/6e4);return`${String(i).padStart(2,"0")}d:${String(r).padStart(2,"0")}h:${String(s).padStart(2,"0")}m`}(function(n,e){const t=new Date(n);return t.setSeconds(t.getSeconds()+e),t}(n.startTime,this.time),n.endTime)),e("div",null,e(f,{statedClasses:{isHollow:!0,isPendding:!1},innerHTML:`${L(n.startTime,n.endTime)}%`}))):e(s,null,e("div",null,T(n.startTime)),e("div",null,T(n.endTime)))),e("casino-engagement-suite-progress-bar",{value:Number(L(n.startTime,n.endTime)),"hide-percent":!0}))}renderInfo(){var n,t;const{locale:i,tournamentItem:r,isShowInfo:s}=this;return e("div",{class:"InfoContainer"},this.renderTimeBar(r),e("section",{class:"ShowInfo",onClick:this.onClickShowInfo},e("p",null,e("span",null,s?y:v),e("span",null,i.LeaderboardDetails))),s&&e("section",{class:"Info"},e("div",null,r.description),e("div",{class:"Criterias"},e("div",null,i.ScoreCriteria,": ",e("span",null,r.scoreCriteria)),e("div",null,i.MinimumBetCriteria,": ",e("span",null,r.minBetCount))),e("div",{class:"TC"},e("a",{href:r.termsUrl,target:"_blank"},i.TC))),this.isTournamentClosed(this.tournamentItem)&&(null===(n=this.leaderboards)||void 0===n?void 0:n.find((n=>n.isMe)))&&e("section",{class:"ResultPrize",innerHTML:c(i.TipPrize,this.getResultPrize(null===(t=this.leaderboards)||void 0===t?void 0:t.find((n=>n.isMe))))}),e("section",{class:"Prizes"},e("div",{class:"PrizesHeader"},C,e("span",{class:"PrizesText"},i.Prizes)),r.prizes.map(((n,t)=>e("div",{class:"Prize"},t+1," ",i.Place,": ",e("span",{class:"PrizeText"},n.name))))))}getResultPrize(n){return{prize:n.prizeName,place:n.rank}}renderCloseBarInLayout(){const{left:n,middle:t}=this.getWrapperBarData();return e(P,Object.assign({},{left:n,middle:t,right:e("span",Object.assign({},{onClick:this.onClickBarInLayout}),b)}))}renderCloseBarInLayoutDialog(){return e(P,Object.assign({},{right:e("span",Object.assign({},{onClick:this.onClickBarInLayoutDialog}),b)}))}renderLeaderboardContainer(n){const{dialog:{isOpen:t}}=this;return e("div",{class:"Wrapper"},e("div",{class:h("WrapperContent",{faded:t})},this.renderCloseBarInLayout(),e("div",{class:"Root"},e("div",{class:"Main"},n))),e("div",{class:"WrapperUtil"},e("dialog",{open:t},e("div",null,this.renderCloseBarInLayoutDialog(),t&&this.renderDialogContent()))))}getWrapperBarData(){const{page:n,locale:t}=this;switch(n){case u.List:return{left:e("span",{onClick:this.onClickBarTip},x),middle:t.Leaderboards};case u.Item:return{left:e("span",{onClick:this.onClickBarBack},w),middle:""}}}openDialog(n,e){this.dialog=Object.assign(Object.assign({},this.dialog),{isOpen:!0,type:n,data:e})}closeDialog(){this.dialog=Object.assign(Object.assign({},this.dialog),{isOpen:!1})}};F.style='.GradientRounded {\n display: block;\n background: linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);\n color: rgba(30, 22, 56, 1);\n \n position: relative;\n border-radius: 16px;\n\n &.Hollow {\n background: rgba(30, 22, 56, 1);\n color: #FFFFFF;\n &::before {\n content: "";\n position: absolute;\n inset: 0;\n border-radius: 15px;\n border: 1px solid transparent;\n background: linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%) border-box;\n -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);\n mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);\n -webkit-mask-composite: destination-out;\n mask-composite: exclude;\n }\n\n }\n}\n\n.GradientRoundedButton {\n border: none;\n padding: 7px;\n \n height: 32px;\n width: 100%;\n \n font-size: 14px;\n font-weight: 700;\n line-height: 17.07px;\n text-align: center;\n \n transition: .5s opacity;\n\n cursor: pointer;\n &.Pending {\n cursor: not-allowed;\n opacity: .3;\n }\n\n &.Hollow {\n \n span {\n background: -webkit-linear-gradient(98.25deg, rgb(255, 148, 0) 22.48%, rgb(254, 247, 70) 131.02%, rgb(255, 226, 74) 131.9%);\n -webkit-background-clip: text;\n -webkit-text-fill-color: transparent;\n }\n }\n}\n.Wrapper {\n height: 100%;\n position: relative;\n color: var(--emw--color-typography, #FFFFFF);\n display: flex;\n background-color: var(--emw--color-background, #1d1537);\n flex-direction: column;\n border-radius: 8px;\n overflow: hidden;\n}\n\n.WrapperContent {\n padding-bottom: 20px;\n transition: 0.5s filter;\n}\n.WrapperContent.faded {\n filter: brightness(53.3333333333%);\n}\n\n.WrapperBar {\n display: flex;\n width: 100%;\n padding: 12px 8px 8px;\n}\n\n.WrapperBarLeft, .WrapperBarRight {\n cursor: pointer;\n}\n\n.WrapperBarMiddle {\n flex-grow: 1;\n text-align: center;\n font-size: 16px;\n line-height: 16px;\n font-weight: 500;\n color: var(--emw--color-secondary, #bbb9c3);\n}\n\n:host {\n display: block;\n font-size: 12px;\n font-family: Inter;\n}\n\n.Row {\n margin: 24px 0;\n padding: 0 20px;\n}\n\n.LeaderboardsItem {\n margin: 10px 0;\n border: 1px solid #403956;\n border-radius: 16px;\n}\n.LeaderboardsItem.Hollow {\n border-color: transparent;\n}\n\n.LeaderboardsItemContainer {\n padding-top: 16px;\n}\n\n.Info {\n margin: 24px 0;\n padding: 0 20px;\n}\n\n.TimeContainer {\n margin: 24px 0;\n padding: 0 20px;\n}\n.TimeContainer .Time {\n display: flex;\n justify-content: space-between;\n font-size: 11px;\n align-items: center;\n color: var(--emw--color-secondary, #bbb9c3);\n}\n.TimeContainer .Time button {\n font-size: 12px;\n height: 20px;\n padding: 0;\n}\n.TimeContainer .Time button::before {\n inset: inherit;\n border: 0;\n}\n\n.ShowInfo {\n margin: 24px 0;\n padding: 0 20px;\n cursor: pointer;\n color: #666178;\n}\n.ShowInfo p {\n display: flex;\n gap: 4px;\n}\n\n.TitleContainer {\n display: flex;\n justify-content: space-between;\n margin: 24px 0;\n padding: 0 20px;\n margin-top: 0;\n gap: 10px;\n font-family: Montserrat;\n}\n.TitleContainer .GradientRoundedButton {\n width: 120px;\n}\n\n.TabsContainer {\n margin: 24px 0;\n padding: 0 20px;\n margin: 0 20px;\n padding: 0;\n border-bottom: 1px solid #575757;\n}\n\n.Tabs {\n display: flex;\n justify-content: space-between;\n justify-content: start;\n font-size: 12px;\n margin-bottom: -1px;\n}\n.Tabs > div {\n padding: 10px;\n color: #666178;\n cursor: pointer;\n}\n.Tabs > div.active {\n color: var(--emw--color-typography, #FFF);\n border-bottom: 2px solid var(--emw--color-typography, #FFF);\n}\n\n.Title {\n font-size: 16px;\n font-weight: 700;\n line-height: 19.5px;\n text-align: left;\n word-break: break-word;\n}\n\n.TC {\n margin-top: 12px;\n}\n.TC a {\n color: #59d1ff;\n}\n\n.Criterias {\n margin: 12px 0;\n}\n.Criterias span {\n color: var(--emw--color-primary, #ffd62f);\n font-weight: 400;\n}\n\n.ResultPrize {\n margin: 24px 0;\n padding: 0 20px;\n}\n.ResultPrize span {\n color: var(--emw--color-primary, #ffd62f);\n font-weight: 400;\n}\n\n.Prizes {\n margin: 24px 0;\n padding: 0 20px;\n}\n.Prizes .PrizesText {\n margin-left: 3px;\n font-weight: 600;\n}\n.Prizes .PrizesHeader {\n align-items: center;\n display: flex;\n}\n.Prizes .PrizesHeader img {\n width: 12px;\n}\n.Prizes .Prize {\n margin: 8px 0;\n}\n.Prizes .Prize .PrizeText {\n color: var(--emw--color-primary, #ffd62f);\n font-weight: 400;\n}\n\n* {\n box-sizing: border-box;\n}\n\n.Leaderboards {\n width: 100%;\n text-align: center;\n border-collapse: collapse;\n}\n.Leaderboards td {\n opacity: 0.6;\n padding: 20px 5px;\n}\n.Leaderboards td:first-child {\n padding-left: 20px;\n}\n.Leaderboards td:last-child {\n padding-right: 20px;\n}\n.Leaderboards .LeaderboardName {\n color: var(--emw--color-typography, #FFF);\n opacity: 1;\n}\n.Leaderboards tr.isMe {\n background: rgba(0, 0, 0, 0.2);\n}\n.Leaderboards tr.isMe .LeaderboardRank span {\n padding: 0px 3px;\n opacity: 1;\n border: 1px solid var(--emw--color-primary, #ffd62f);\n border-radius: 11px;\n}\n.Leaderboards tr.isMe td {\n color: var(--emw--color-primary, #ffd62f);\n}\n\n.Games {\n margin: 24px 0;\n padding: 0 20px;\n display: flex;\n flex-wrap: wrap;\n justify-content: space-evenly;\n gap: 4px 7.25px;\n}\n.Games img {\n width: 60px;\n}\n\ndialog {\n position: absolute;\n top: 30px;\n width: 100%;\n height: 100%;\n background: transparent;\n border: 0;\n padding: 0;\n color: var(--emw--color-typography, #FFFFFF);\n}\ndialog > div {\n margin: 32px;\n border-radius: 8px;\n background: var(--emw--color-background, #1d1537);\n border: 1px solid #403956;\n align-items: center;\n}\n\n.DialogContentUnjoin {\n padding: 32px;\n padding-top: 10px;\n display: flex;\n gap: 10px;\n flex-direction: column;\n}\n\n.DialogContentUnjoinTitle {\n font-family: Montserrat;\n font-size: 20px;\n font-weight: 600;\n line-height: 24.38px;\n text-align: center;\n}\n\n.DialogContentUnjoinDescription {\n color: var(--emw--color-secondary, #bbb9c3);\n margin-bottom: 30px;\n}\n\n.Tip {\n padding: 32px;\n padding-top: 10px;\n color: var(--emw--color-secondary, #bbb9c3);\n font-size: 14px;\n}\n\n.PageConfirmContainer {\n text-align: center;\n width: 80%;\n margin: 0 auto;\n}\n\n.PageConfirm {\n padding: 40px 32px;\n display: flex;\n flex-direction: column;\n gap: 20px;\n}\n.PageConfirm .Title {\n font-size: 20px;\n text-align: center;\n}\n.PageConfirm .Description {\n color: var(--emw--color-secondary, #bbb9c3);\n font-weight: 400;\n}\n.PageConfirm .Description span {\n color: var(--emw--color-typography, #FFF);\n font-weight: 600;\n}\n\n.PageConfirmButtonsGroup {\n width: 150px;\n margin: 0 auto;\n display: flex;\n flex-direction: column;\n gap: 10px;\n}';const B=class{constructor(e){n(this,e),this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.stylingAppends=!1,this.setClientStyling=()=>{let n=document.createElement("style");n.innerHTML=this.clientStyling,this.el.prepend(n)},this.setClientStylingURL=()=>{let n=new URL(this.clientStylingUrl),e=document.createElement("style");fetch(n.href).then((n=>n.text())).then((n=>{e.innerHTML=n,setTimeout((()=>{this.el.prepend(e)}),1)})).catch((n=>{console.log("error ",n)}))}}componentDidRender(){this.stylingAppends||(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.stylingAppends=!0)}async componentWillLoad(){const n=[];if(this.translationUrl){const i=(e=this.translationUrl,t=this.targetTranslations,new Promise((n=>{fetch(e).then((n=>n.json())).then((e=>{Object.keys(e).forEach((n=>{t[n]=t[n]?t[n]:{};for(let i in e[n])t[n][i]=e[n][i]})),n(!0)}))})));n.push(i)}var e,t;return await Promise.all(n)}render(){return e("div",{class:"StyleShell"},e("slot",{name:"mainContent"}))}get el(){return t(this)}};B.style=":host{display:block}";export{o as casino_engagement_suite_progress_bar,F as casino_engagement_suite_tournament,B as general_styling_wrapper}