@everymatrix/casino-engagement-suite-tournament 1.45.14 → 1.46.1

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.
Files changed (54) hide show
  1. package/dist/casino-engagement-suite-tournament/casino-engagement-suite-tournament.esm.js +1 -1
  2. package/dist/casino-engagement-suite-tournament/index.esm.js +1 -1
  3. package/dist/casino-engagement-suite-tournament/p-2dc46ff5.js +2 -0
  4. package/dist/casino-engagement-suite-tournament/{p-0f4e94ab.entry.js → p-e969a6a6.entry.js} +1 -1
  5. package/dist/casino-engagement-suite-tournament/p-ecf7465a.js +1 -0
  6. package/dist/cjs/casino-engagement-suite-progress-bar_3.cjs.entry.js +2 -2
  7. package/dist/cjs/casino-engagement-suite-tournament-81cbca40.js +733 -0
  8. package/dist/cjs/casino-engagement-suite-tournament.cjs.js +2 -2
  9. package/dist/cjs/{index-16d5d7c3.js → index-6f030cde.js} +28 -43
  10. package/dist/cjs/index.cjs.js +2 -2
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/collection/components/casino-engagement-suite-tournament/casino-engagement-suite-tournament.css +101 -68
  13. package/dist/collection/components/casino-engagement-suite-tournament/casino-engagement-suite-tournament.js +168 -313
  14. package/dist/collection/shared/GradientRoundedButton.js +1 -1
  15. package/dist/collection/shared/renderBar.js +2 -2
  16. package/dist/collection/shared/renders.dialog.js +49 -0
  17. package/dist/collection/shared/renders.js +8 -0
  18. package/dist/collection/shared/renders.page.js +117 -0
  19. package/dist/collection/shared/renders.tab.js +30 -0
  20. package/dist/collection/shared/renders.util.js +18 -0
  21. package/dist/collection/utils/api.apdater.js +2 -2
  22. package/dist/collection/utils/bussiness.js +38 -0
  23. package/dist/collection/utils/message.js +63 -0
  24. package/dist/collection/utils/translations.js +8 -9
  25. package/dist/collection/utils/types.js +5 -5
  26. package/dist/collection/utils/util.date.js +1 -1
  27. package/dist/collection/utils/utils.js +6 -2
  28. package/dist/esm/casino-engagement-suite-progress-bar_3.entry.js +2 -2
  29. package/dist/esm/casino-engagement-suite-tournament-65c77450.js +731 -0
  30. package/dist/esm/casino-engagement-suite-tournament.js +3 -3
  31. package/dist/esm/{index-3962add4.js → index-224e880a.js} +29 -43
  32. package/dist/esm/index.js +2 -2
  33. package/dist/esm/loader.js +3 -3
  34. package/dist/stencil.config.dev.js +2 -0
  35. package/dist/types/components/casino-engagement-suite-tournament/casino-engagement-suite-tournament.d.ts +27 -52
  36. package/dist/types/components.d.ts +16 -0
  37. package/dist/types/shared/GradientRoundedButton.d.ts +1 -1
  38. package/dist/types/shared/renderBar.d.ts +1 -1
  39. package/dist/types/shared/renders.d.ts +6 -0
  40. package/dist/types/shared/renders.dialog.d.ts +2 -0
  41. package/dist/types/shared/renders.page.d.ts +2 -0
  42. package/dist/types/shared/renders.tab.d.ts +3 -0
  43. package/dist/types/shared/renders.util.d.ts +2 -0
  44. package/dist/types/utils/api.apdater.d.ts +1 -1
  45. package/dist/types/utils/bussiness.d.ts +32 -0
  46. package/dist/types/utils/message.d.ts +17 -0
  47. package/dist/types/utils/translations.d.ts +8 -9
  48. package/dist/types/utils/types.d.ts +14 -5
  49. package/dist/types/utils/utils.d.ts +1 -0
  50. package/package.json +1 -1
  51. package/dist/casino-engagement-suite-tournament/p-1bf11325.js +0 -2
  52. package/dist/casino-engagement-suite-tournament/p-5df3ac81.js +0 -1
  53. package/dist/cjs/casino-engagement-suite-tournament-1b738bb2.js +0 -560
  54. package/dist/esm/casino-engagement-suite-tournament-d8471680.js +0 -558
@@ -1 +0,0 @@
1
- import{h as n,r as t,c as e,H as i,F as s}from"./p-1bf11325.js";function r(n,t){var e={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&t.indexOf(i)<0&&(e[i]=n[i]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(n);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(n,i[s])&&(e[i[s]]=n[i[s]])}return e}var o,a;"function"==typeof SuppressedError&&SuppressedError,function(n){n.Info="Info",n.Leaderboard="Leaderboard",n.Games="Games"}(o||(o={})),function(n){n.Starts="Starts",n.Ends="Ends"}(a||(a={}));const l=(n,t)=>(Object.keys(t).map((e=>{n=n.replace(`{${e}}`,t[e])})),n),d=Object.assign(Object.assign(Object.assign({Join:"Join",Unjoin:"Unjoin"},o),a),{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."}),c=(...n)=>{let t=[];return n.map((n=>{switch(typeof n){case"string":t.push(n);break;case"object":Object.keys(n).map((e=>{n[e]&&t.push(e)}))}})),t.join(" ")};var h,u,p;!function(n){n.Confirm="Confirm",n.List="List",n.Item="Item"}(h||(h={})),function(n){n.Running="Running",n.Unstarted="Unstarted",n.Closed="Closed",n.Closing="Closing"}(u||(u={})),function(n){n.Unjoin="Unjoin",n.Tip="Tip"}(p||(p={}));const g=t=>{var{statedClasses:e,innerHTML:i}=t,s=r(t,["statedClasses","innerHTML"]);const{isHollow:o,isPending:a}=e;return n("button",Object.assign({class:c("GradientRoundedButton","GradientRounded",{Hollow:o||!1,Pending:a||!1})},s),n("span",null,i))},m=n("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg"}),f=n("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/help.svg"}),b=n("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/eye-open.svg"}),v=n("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/eye-closed.svg"}),x=n("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/back.svg"}),y=n("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/reward.svg"}),w=n("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/cup-congras.svg"}),C=t=>{const{left:e,middle:i,right:s}=t,r={left:e,middle:i,right:s};return n("div",{class:"WrapperBar"},Object.keys(r).map((t=>{return n("div",{class:"WrapperBar"+(e=t,e.split("").map(((n,t)=>0===t?n.toUpperCase():n)).join(""))},r[t]||"");var e})))};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 k(n,t){return(100*((new Date).getTime()-n.getTime())/(t.getTime()-n.getTime())).toFixed(0)}const L=n=>{const t=["startTime","endTime","closeTime","exhibitionStartTime","exhibitionEndTime"],e={};return Object.keys(n).map((i=>{const s=n[i];e[i]="games"===i?s.items:t.includes(i)?new Date(s):s})),e};var j,P={};(function(n){var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,a=(n,e,i)=>e in n?t(n,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[e]=i,l=(n,t)=>{for(var e in t||(t={}))r.call(t,e)&&a(n,e,t[e]);if(s)for(var e of s(t))o.call(t,e)&&a(n,e,t[e]);return n},d=(n,t)=>e(n,i(t)),c=(n,t,e)=>a(n,"symbol"!=typeof t?t+"":t,e);function h(){}function u(n){return n()}function p(){return Object.create(null)}function g(n){n.forEach(u)}function m(n){return"function"==typeof n}function f(n,t){return n!=n?t==t:n!==t||n&&"object"==typeof n||"function"==typeof n}function b(n,t,e){n.insertBefore(t,e||null)}function v(n){n.parentNode&&n.parentNode.removeChild(n)}function x(n){return document.createElement(n)}let y;function w(n){y=n}Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});const C=[],T=[];let k=[];const L=[],j=Promise.resolve();let P=!1;function O(n){k.push(n)}const F=new Set;let z=0;function $(){if(0!==z)return;const n=y;do{try{for(;z<C.length;){const n=C[z];z++,w(n),M(n.$$)}}catch(n){throw C.length=0,z=0,n}for(w(null),C.length=0,z=0;T.length;)T.pop()();for(let n=0;n<k.length;n+=1){const t=k[n];F.has(t)||(F.add(t),t())}k.length=0}while(C.length);for(;L.length;)L.pop()();P=!1,F.clear(),w(n)}function M(n){if(null!==n.fragment){n.update(),g(n.before_update);const t=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,t),n.after_update.forEach(O)}}const R=new Set;function I(n,t,e,i,s,r,o=null,a=[-1]){const l=y;w(n);const d=n.$$={fragment:null,ctx:[],props:r,update:h,not_equal:s,bound:p(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(l?l.$$.context:[])),callbacks:p(),dirty:a,skip_bound:!1,root:t.target||l.$$.root};o&&o(d.root);let c=!1;if(d.ctx=e?e(n,t.props||{},((t,e,...i)=>{const r=i.length?i[0]:e;return d.ctx&&s(d.ctx[t],d.ctx[t]=r)&&(!d.skip_bound&&d.bound[t]&&d.bound[t](r),c&&function(n,t){-1===n.$$.dirty[0]&&(C.push(n),P||(P=!0,j.then($)),n.$$.dirty.fill(0)),n.$$.dirty[t/31|0]|=1<<t%31}(n,t)),e})):[],d.update(),c=!0,g(d.before_update),d.fragment=!!i&&i(d.ctx),t.target){if(t.hydrate){const n=function(n){return Array.from(n.childNodes)}(t.target);d.fragment&&d.fragment.l(n),n.forEach(v)}else d.fragment&&d.fragment.c();t.intro&&function(n){n&&n.i&&(R.delete(n),n.i(void 0))}(n.$$.fragment),function(n,t,e){const{fragment:i,after_update:s}=n.$$;i&&i.m(t,e),O((()=>{const t=n.$$.on_mount.map(u).filter(m);n.$$.on_destroy?n.$$.on_destroy.push(...t):g(t),n.$$.on_mount=[]})),s.forEach(O)}(n,t.target,t.anchor),$()}w(l)}let H;function D(n,t,e,i){var s;const r=null==(s=e[n])?void 0:s.type;if(t="Boolean"===r&&"boolean"!=typeof t?null!=t:t,!i||!e[n])return t;if("toAttribute"===i)switch(r){case"Object":case"Array":return null==t?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return null==t?null:t;default:return t}else switch(r){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":default:return t;case"Number":return null!=t?+t:t}}"function"==typeof HTMLElement&&(H=class extends HTMLElement{constructor(n,t,e){super(),c(this,"$$ctor"),c(this,"$$s"),c(this,"$$c"),c(this,"$$cn",!1),c(this,"$$d",{}),c(this,"$$r",!1),c(this,"$$p_d",{}),c(this,"$$l",{}),c(this,"$$l_u",new Map),this.$$ctor=n,this.$$s=t,e&&this.attachShadow({mode:"open"})}addEventListener(n,t,e){if(this.$$l[n]=this.$$l[n]||[],this.$$l[n].push(t),this.$$c){const e=this.$$c.$on(n,t);this.$$l_u.set(t,e)}super.addEventListener(n,t,e)}removeEventListener(n,t,e){if(super.removeEventListener(n,t,e),this.$$c){const n=this.$$l_u.get(t);n&&(n(),this.$$l_u.delete(t))}}connectedCallback(){return n=this,t=function*(){if(this.$$cn=!0,!this.$$c){let n=function(n){return()=>{let t;return{c:function(){t=x("slot"),"default"!==n&&function(n,t,e){null==e?n.removeAttribute(t):n.getAttribute(t)!==e&&n.setAttribute(t,e)}(t,"name",n)},m:function(n,e){b(n,t,e)},d:function(n){n&&v(t)}}}};if(yield Promise.resolve(),!this.$$cn||this.$$c)return;const t={},e=function(n){const t={};return n.childNodes.forEach((n=>{t[n.slot||"default"]=!0})),t}(this);for(const i of this.$$s)i in e&&(t[i]=[n(i)]);for(const n of this.attributes){const t=this.$$g_p(n.name);t in this.$$d||(this.$$d[t]=D(t,n.value,this.$$p_d,"toProp"))}for(const n in this.$$p_d)!(n in this.$$d)&&void 0!==this[n]&&(this.$$d[n]=this[n],delete this[n]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:d(l({},this.$$d),{$$slots:t,$$scope:{ctx:[]}})});const i=()=>{this.$$r=!0;for(const n in this.$$p_d)if(this.$$d[n]=this.$$c.$$.ctx[this.$$c.$$.props[n]],this.$$p_d[n].reflect){const t=D(n,this.$$d[n],this.$$p_d,"toAttribute");null==t?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,t)}this.$$r=!1};this.$$c.$$.after_update.push(i),i();for(const n in this.$$l)for(const t of this.$$l[n]){const e=this.$$c.$on(n,t);this.$$l_u.set(t,e)}this.$$l={}}},new Promise(((e,i)=>{var s=n=>{try{o(t.next(n))}catch(n){i(n)}},r=n=>{try{o(t.throw(n))}catch(n){i(n)}},o=n=>n.done?e(n.value):Promise.resolve(n.value).then(s,r);o((t=t.apply(n,null)).next())}));var n,t}attributeChangedCallback(n,t,e){var i;this.$$r||(n=this.$$g_p(n),this.$$d[n]=D(n,e,this.$$p_d,"toProp"),null==(i=this.$$c)||i.$set({[n]:this.$$d[n]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then((()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0)}))}$$g_p(n){return Object.keys(this.$$p_d).find((t=>this.$$p_d[t].attribute===n||!this.$$p_d[t].attribute&&t.toLowerCase()===n))||n}});class S{constructor(){c(this,"$$"),c(this,"$$set")}$destroy(){(function(n,t){const e=n.$$;null!==e.fragment&&(function(n){const t=[],e=[];k.forEach((i=>-1===n.indexOf(i)?t.push(i):e.push(i))),e.forEach((n=>n())),k=t}(e.after_update),g(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])})(this,1),this.$destroy=h}$on(n,t){if(!m(t))return h;const e=this.$$.callbacks[n]||(this.$$.callbacks[n]=[]);return e.push(t),()=>{const n=e.indexOf(t);-1!==n&&e.splice(n,1)}}$set(n){this.$$set&&0!==Object.keys(n).length&&(this.$$.skip_bound=!0,this.$$set(n),this.$$.skip_bound=!1)}}function U(n){!function(n,t,e){const i=function(n){if(!n)return document;const t=n.getRootNode?n.getRootNode():n.ownerDocument;return t&&t.host?t:n.ownerDocument}(n);if(!i.getElementById(t)){const n=x("style");n.id=t,n.textContent=e,function(n,t){!function(n,t){n.appendChild(t)}(n.head||n,t)}(i,n)}}(n,"svelte-gnt082",".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)}}")}function B(n){let t;return{c(){t=x("div"),t.innerHTML='<section class="LoaderContainer" part="LoaderContainer"><div class="lds-ellipsis"><div></div><div></div><div></div><div></div></div></section>'},m(e,i){b(e,t,i),n[3](t)},p:h,i:h,o:h,d(e){e&&v(t),n[3](null)}}}function E(n,t,e){let i,{clientstyling:s=""}=t,{clientstylingurl:r=""}=t;return n.$$set=n=>{"clientstyling"in n&&e(1,s=n.clientstyling),"clientstylingurl"in n&&e(2,r=n.clientstylingurl)},n.$$.update=()=>{3&n.$$.dirty&&s&&i&&(()=>{let n=document.createElement("style");n.innerHTML=s,i.appendChild(n)})(),5&n.$$.dirty&&r&&i&&(()=>{let n=new URL(r),t=document.createElement("style");fetch(n.href).then((n=>n.text())).then((n=>{t.innerHTML=n,setTimeout((()=>{i.appendChild(t)}),1),setTimeout((()=>{}),500)}))})()},[i,s,r,function(n){T[n?"unshift":"push"]((()=>{i=n,e(0,i)}))}]}"undefined"!=typeof window&&(window.__svelte||(window.__svelte={v:new Set})).v.add("4");class N extends S{constructor(n){super(),I(this,n,E,B,f,{clientstyling:1,clientstylingurl:2},U)}get clientstyling(){return this.$$.ctx[1]}set clientstyling(n){this.$$set({clientstyling:n}),$()}get clientstylingurl(){return this.$$.ctx[2]}set clientstylingurl(n){this.$$set({clientstylingurl:n}),$()}}!function(n,t,e){let i=class extends H{constructor(){super(n,e,true),this.$$p_d=t}static get observedAttributes(){return Object.keys(t).map((n=>(t[n].attribute||n).toLowerCase()))}};Object.keys(t).forEach((n=>{Object.defineProperty(i.prototype,n,{get(){return this.$$c&&n in this.$$c?this.$$c[n]:this.$$d[n]},set(e){var i;e=D(n,e,t),this.$$d[n]=e,null==(i=this.$$c)||i.$set({[n]:e})}})})),[].forEach((n=>{Object.defineProperty(i.prototype,n,{get(){var t;return null==(t=this.$$c)?void 0:t[n]}})})),n.element=i}(N,{clientstyling:{},clientstylingurl:{}},[]),n.default=N})(P),"undefined"!=typeof window&&(customElements.define=(j=customElements.define,function(...n){try{return j.apply(this,n)}catch(n){if(n instanceof DOMException&&n.message.includes("has already been used with this registry")||n.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw n}}),Promise.resolve().then((()=>P)).then((({default:n})=>{!customElements.get("general-animation-loading")&&customElements.define("general-animation-loading",n.element)})));const O=class{constructor(n){t(this,n),this.close=e(this,"close",7),this.onClickConfirmJoin=()=>{this.actionJoin(this.tournamentItem),this.nextPage=h.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(p.Tip)},this.onClickBarBack=()=>{this.setPage(h.List)},this.language="en",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.leaderboardsInit=void 0,this.tab=o.Info,this.locale=d,this.tournamentItem=void 0,this.tournamentList=void 0,this.leaderboards=[],this.isActionJoinPending=!1,this.isDialogOpen=!1,this.isShowInfo=!1,this.page=h.List,this.tournamentInDialog=void 0,this.dialog={isOpen:!1,type:void 0,data:void 0},this.time=0}setTimeInterval(){this.timeHolder=setInterval((()=>{this.tournamentList||this.tournamentItem?this.time+=1:this.time=0}),1e3)}updateTournamentListByItem(n){this.tournamentList=this.tournamentList.map((t=>t.id===n.id?L(n):t))}handleEvent(n){const t=n.data,{type:e}=t,i=r(t,["type"]);switch(e){case"ShowLeaderboardRewardModal":{const{tournament:n}=i;this.setPage(h.Confirm,{tournament:L(n)}),postMessage({type:"BarLeaderboardsClick"});break}case"UpdateTournamentsItemRes":{const n=L(i.data.item);this.tournamentItem=n,this.updateTournamentListByItem(n);break}case"UpdateLeaderboardsRes":this.leaderboards=(n=>{let{item:t,items:e}=n;return t?e.map((n=>t&&t.userID===n.userID?Object.assign(Object.assign({},n),{isMe:!0}):n)):e})(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 h.Item:break;case h.List:this.updateTournamentListByItem(this.tournamentItem)}this.nextPage&&(this.setPage(this.nextPage),this.nextPage=void 0),this.isActionJoinPending=!1}}get messageSender(){return{JoinTournamentReq:n=>{var t;return window.postMessage({type:"JoinTournamentReq",bonusCode:null===(t=n.wallets[0])||void 0===t?void 0:t.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[u.Closed,u.Closing].includes(n.state)}setPage(n,t){switch(n){case h.Confirm:case h.Item:this.tournamentItem=t.tournament,this.tournamentItem||this.messageSender.UpdateTournamentsItemReq(t.tournament),this.isTournamentClosed(this.tournamentItem)&&this.messageSender.UpdateLeaderboardsReq(this.tournamentItem)}this.tab=o.Info,this.page=n}renderPage(){switch(this.page){case h.Confirm:return this.renderPageConfirm();case h.Item:return this.renderPageLeaderboardItem();case h.List:return this.renderPageLeaderboardList()}}render(){return n(i,{key:"07ebdb6c71a03be84b430e18a80417323a9cd3cc"},n("general-styling-wrapper",{key:"ac0134009a6bfcdb4b79816138ea441a8415b953",clientStylingUrl:this.clientStylingUrl,clientStyling:this.clientStyling,targetTranslations:d,translationUrl:this.translationUrl}),this.renderPage())}onClickListItemChangePage(n){this.setPage(h.Item,{tournament:n})}onClickItemJoin(n,t){t.stopPropagation(),n.playerEnrolled?this.openDialog(p.Unjoin,n):(this.actionJoin(n),this.tournamentItem=n)}onClickTab(n){switch(this.tab=n,n){case o.Leaderboard:this.leaderboards=void 0,this.messageSender.UpdateLeaderboardsReq(this.tournamentItem);break;case o.Games:this.messageSender.UpdateTournamentsItemReq(this.tournamentItem)}}renderPageLeaderboardList(){var t;if(!this.tournamentList)return this.tournamentList=null===(t=this.leaderboardsInit)||void 0===t?void 0:t.map((n=>L(n))),n("general-animation-loading",null);const{locale:e}=this;return this.tournamentList.length?this.renderLeaderboardContainer(n(s,null,n("div",{class:"Leaderboards Row"},this.tournamentList.map((t=>n("div",{class:c("LeaderboardsItem",t.playerEnrolled?" GradientRounded Hollow":""),onClick:this.onClickListItemChangePage.bind(this,t)},n("div",{class:"LeaderboardsItemContainer"},this.renderTitleContainer(t),this.renderTimeBar(t)))))))):n("div",{class:"NoLeaderboards Row"},n("div",null,e.NoLeaderboards),n("div",null,e.NoLeaderboardsTip))}renderPageConfirm(){if(!this.tournamentItem)return n("general-animation-loading",null);const t=this.tournamentItem.nameOrTitle,{locale:e}=this;return n("div",{class:"PageConfirmContainer"},n("div",{class:"GradientRounded Hollow PageConfirm"},n("div",null,w),n("div",{class:"Title"},e.JoinDialog.Tile),n("div",{class:"Description",innerHTML:l(e.JoinDialog.Description,{tournamentName:t})}),n("div",{class:"PageConfirmButtonsGroup"},n(g,{statedClasses:{isPending:this.isActionJoinPending},onClick:this.onClickConfirmJoin,innerHTML:e.JoinDialog.ButtonYes}),n(g,{statedClasses:{isPending:this.isActionJoinPending,isHollow:!0},onClick:this.onClickConfirmUnjoin,innerHTML:e.JoinDialog.ButtonNo}))))}renderPageLeaderboardItem(){return this.tournamentItem?this.renderLeaderboardContainer(n(s,null,this.renderTitleContainer(this.tournamentItem),this.renderTabs(),this.renderTabbedContent())):n("general-animation-loading",null)}renderDialogContent(){switch(this.dialog.type){case p.Unjoin:return this.renderDialogContentUnjoin();case p.Tip:return n("div",{class:"Tip"},this.locale.Tip)}}renderDialogContentUnjoin(){const{locale:t}=this;return n("div",{class:"DialogContentUnjoin"},n("div",{class:"DialogContentUnjoinTitle"},t.UnjoinDialog.Title),n("div",{class:"DialogContentUnjoinDescription",innerHTML:t.UnjoinDialog.Description}),n(g,{statedClasses:{isPending:this.isActionJoinPending},onClick:this.onClickDialogUnjoin,innerHTML:t.UnjoinDialog.ButtonYes}),n(g,{statedClasses:{isHollow:!0,isPending:this.isActionJoinPending},onClick:this.onClickDialogJoin,innerHTML:t.UnjoinDialog.ButtonNo}))}renderTitleContainer(t){const{locale:e}=this;return n("div",{class:"TitleContainer"},n("div",{class:"Title"},t.nameOrTitle),t.state!==u.Closed&&n("div",null,n(g,{statedClasses:{isHollow:t.playerEnrolled,isPending:this.isActionJoinPending},onClick:this.onClickItemJoin.bind(this,t),innerHTML:t.playerEnrolled?e.Unjoin:e.Join})))}renderTabbedContent(){switch(this.tab){case o.Info:return this.renderInfo();case o.Leaderboard:return this.renderLeaderboard();case o.Games:return this.renderGames()}}renderGames(){var t;return n("div",{class:"Games"},null===(t=this.tournamentItem.games)||void 0===t?void 0:t.map((t=>n("div",null,n("img",{src:t.defaultThumbnail,alt:""})))))}renderLeaderboard(){return this.leaderboards?this.leaderboards.length?n("table",{class:"Leaderboards"},this.leaderboards.map((t=>n("tr",{class:c({isMe:t.isMe})},n("td",{class:"LeaderboardRank"},n("span",null,t.rank)),n("td",{class:"LeaderboardName"},t.shortName),n("td",{class:"LeaderboardScore"},t.score),n("td",{class:"LeaderboardPrize"},t.prizeName))))):"":n("general-animation-loading",null)}renderTabs(){const{locale:t,tab:e}=this;return n("div",{class:"TabsContainer"},n("div",{class:"Tabs"},Object.keys(o).map((i=>n("div",{class:c({active:e===i}),onClick:this.onClickTab.bind(this,i)},t[i])))))}renderTimeBar(t){return n("section",{class:"TimeContainer"},n("div",{class:"Time"},t.playerEnrolled?n(s,null,n("div",null,function(n,t){const e=Math.abs(t.getTime()-n.getTime()),i=Math.floor(e/864e5),s=Math.floor(e%864e5/36e5),r=Math.floor(e%36e5/6e4);return`${String(i).padStart(2,"0")}d:${String(s).padStart(2,"0")}h:${String(r).padStart(2,"0")}m`}(function(n,t){const e=new Date(n);return e.setSeconds(e.getSeconds()+t),e}(t.startTime,this.time),t.endTime)),n("div",null,n(g,{statedClasses:{isHollow:!0,isPendding:!1},innerHTML:`${k(t.startTime,t.endTime)}%`}))):n(s,null,n("div",null,T(t.startTime)),n("div",null,T(t.endTime)))),n("casino-engagement-suite-progress-bar",{value:Number(k(t.startTime,t.endTime)),"hide-percent":!0}))}renderInfo(){var t,e;const{locale:i,tournamentItem:s,isShowInfo:r}=this;return n("div",{class:"InfoContainer"},this.renderTimeBar(s),n("section",{class:"ShowInfo",onClick:this.onClickShowInfo},n("p",null,n("span",null,r?v:b),n("span",null,i.LeaderboardDetails))),r&&n("section",{class:"Info"},n("div",null,s.description),n("div",{class:"Criterias"},n("div",null,i.ScoreCriteria,": ",n("span",null,s.scoreCriteria)),n("div",null,i.MinimumBetCriteria,": ",n("span",null,s.minBetCount))),n("div",{class:"TC"},n("a",{href:s.termsUrl,target:"_blank"},i.TC))),this.isTournamentClosed(this.tournamentItem)&&(null===(t=this.leaderboards)||void 0===t?void 0:t.find((n=>n.isMe)))&&n("section",{class:"ResultPrize",innerHTML:l(i.TipPrize,this.getResultPrize(null===(e=this.leaderboards)||void 0===e?void 0:e.find((n=>n.isMe))))}),n("section",{class:"Prizes"},n("div",{class:"PrizesHeader"},y,n("span",{class:"PrizesText"},i.Prizes)),s.prizes.map(((t,e)=>n("div",{class:"Prize"},e+1," ",i.Place,": ",n("span",{class:"PrizeText"},t.name))))))}getResultPrize(n){return{prize:n.prizeName,place:n.rank}}renderCloseBarInLayout(){const{left:t,middle:e}=this.getWrapperBarData();return n(C,{left:t,middle:e,right:n("span",{onClick:this.onClickBarInLayout},m)})}renderCloseBarInLayoutDialog(){return n(C,{right:n("span",{onClick:this.onClickBarInLayoutDialog},m)})}renderLeaderboardContainer(t){const{dialog:{isOpen:e}}=this;return n("div",{class:"Wrapper"},n("div",{class:c("WrapperContent",{faded:e})},this.renderCloseBarInLayout(),n("div",{class:"Root"},n("div",{class:"Main"},t))),n("div",{class:"WrapperUtil"},n("dialog",{open:e},n("div",null,this.renderCloseBarInLayoutDialog(),e&&this.renderDialogContent()))))}getWrapperBarData(){const{page:t,locale:e}=this;switch(t){case h.List:return{left:n("span",{onClick:this.onClickBarTip},f),middle:e.Leaderboards};case h.Item:return{left:n("span",{onClick:this.onClickBarBack},x),middle:""}}}openDialog(n,t){this.dialog=Object.assign(Object.assign({},this.dialog),{isOpen:!0,type:n,data:t})}closeDialog(){this.dialog=Object.assign(Object.assign({},this.dialog),{isOpen:!1})}};O.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, hsl(254, 44%, 15%));\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, rgb(187, 185, 195));\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 rgb(64, 57, 86);\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, rgb(187, 185, 195));\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: rgb(102, 97, 120);\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: rgb(102, 97, 120);\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: rgb(89, 209, 255);\n}\n\n.Criterias {\n margin: 12px 0;\n}\n.Criterias span {\n color: var(--emw--color-primary, rgb(255, 214, 47));\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, rgb(255, 214, 47));\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, rgb(255, 214, 47));\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, rgb(255, 214, 47));\n border-radius: 11px;\n}\n.Leaderboards tr.isMe td {\n color: var(--emw--color-primary, rgb(255, 214, 47));\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, hsl(254, 44%, 15%));\n border: 1px solid hsl(254, 20%, 28%);\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, rgb(187, 185, 195));\n margin-bottom: 30px;\n}\n\n.Tip {\n padding: 32px;\n padding-top: 10px;\n color: var(--emw--color-secondary, rgb(187, 185, 195));\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, rgb(187, 185, 195));\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}';export{O as C}