@everymatrix/casino-tournaments-ingame-table 0.0.3 → 0.0.5

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 (25) hide show
  1. package/dist/casino-tournaments-ingame-table/casino-tournaments-ingame-table-aac2043e.js +7 -0
  2. package/dist/casino-tournaments-ingame-table/casino-tournaments-ingame-table.entry.js +1 -1
  3. package/dist/casino-tournaments-ingame-table/casino-tournaments-ingame-table.esm.js +1 -1
  4. package/dist/casino-tournaments-ingame-table/index-448538d5.js +2 -0
  5. package/dist/casino-tournaments-ingame-table/index.esm.js +1 -1
  6. package/dist/cjs/{casino-tournaments-ingame-table-58ce40fc.js → casino-tournaments-ingame-table-5897b13b.js} +63 -13
  7. package/dist/cjs/casino-tournaments-ingame-table.cjs.entry.js +2 -2
  8. package/dist/cjs/casino-tournaments-ingame-table.cjs.js +2 -2
  9. package/dist/cjs/{index-3f69085c.js → index-666544d1.js} +7 -1
  10. package/dist/cjs/index.cjs.js +2 -2
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/collection/components/casino-tournaments-ingame-table/casino-tournaments-ingame-table.css +6 -1
  13. package/dist/collection/components/casino-tournaments-ingame-table/casino-tournaments-ingame-table.js +66 -12
  14. package/dist/esm/{casino-tournaments-ingame-table-cea9e05e.js → casino-tournaments-ingame-table-aac2043e.js} +63 -13
  15. package/dist/esm/casino-tournaments-ingame-table.entry.js +2 -2
  16. package/dist/esm/casino-tournaments-ingame-table.js +3 -3
  17. package/dist/esm/{index-7421f3cc.js → index-448538d5.js} +7 -1
  18. package/dist/esm/index.js +2 -2
  19. package/dist/esm/loader.js +3 -3
  20. package/dist/types/components/casino-tournaments-ingame-table/casino-tournaments-ingame-table.d.ts +11 -1
  21. package/dist/types/components.d.ts +8 -0
  22. package/dist/types/utils/leaderboard.d.ts +1 -0
  23. package/package.json +1 -1
  24. package/dist/casino-tournaments-ingame-table/casino-tournaments-ingame-table-cea9e05e.js +0 -7
  25. package/dist/casino-tournaments-ingame-table/index-7421f3cc.js +0 -2
@@ -0,0 +1,7 @@
1
+ import{r as t,c as i,h as e}from"./index-448538d5.js";const n="__WIDGET_GLOBAL_STYLE_CACHE__";function s(t,i){if(t){const e=document.createElement("style");e.innerHTML=i,t.appendChild(e)}}function r(t,i){if(!t||!i)return;const e=new URL(i);fetch(e.href).then((t=>t.text())).then((i=>{const e=document.createElement("style");e.innerHTML=i,t&&t.appendChild(e)})).catch((t=>{console.error("There was an error while trying to load client styling from URL",t)}))}function o(t,i,e,s=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!s)return e=function(t,i){const e=document.createElement("style");return window.emMessageBus.subscribe(i,(i=>{t&&(e.innerHTML=i,t.appendChild(e))}))}(t,i),e;window[n]||(window[n]={}),e=function(t,i){return window.emMessageBus.subscribe(i,(e=>{if(!t)return;const s=t.getRootNode(),r=window[n];let o=r[i]&&r[i].sheet;o?r[i].refCount=r[i].refCount+1:(o=new CSSStyleSheet,o.replaceSync(e),r[i]={sheet:o,refCount:1});const a=s.adoptedStyleSheets||[];a.includes(o)||(s.adoptedStyleSheets=[...a,o])}))}(t,i);const r=e.unsubscribe.bind(e);return e.unsubscribe=()=>{if(window[n][i]){const t=window[n][i];t.refCount>1?t.refCount=t.refCount-1:delete window[n][i]}r()},e}const a={en:{you:"You",loading:"Loading, please wait ...",leaderboard:"Leaderboard",nowinners:"No winners for the time being. Be one of them!",noLeaderboard:"No Leaderboard yet",positionsWillShow:"Player positions will appear here once scores are recorded."}},h=t=>new Promise((i=>{fetch(t).then((t=>t.json())).then((t=>{Object.keys(t).forEach((i=>{a[i]||(a[i]={});for(let e in t[i])a[i][e]=t[i][e]})),i(!0)}))})),l=(t,i,e)=>{let n=a[void 0!==i&&i in a?i:"en"][t];if(void 0!==e)for(const[t,i]of Object.entries(e.values)){const e=new RegExp(`{${t}}`,"g");n=n.replace(e,i)}return n},d=()=>{let t=window.navigator.userAgent;return t.toLowerCase().match(/android/i)?"Android":t.toLowerCase().match(/iphone/i)?"iPhone":t.toLowerCase().match(/ipad|ipod/i)?"iPad":"PC"};var c,u,f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},v={exports:{}};
2
+ /** @license
3
+ * eventsource.js
4
+ * Available under MIT License (MIT)
5
+ * https://github.com/Yaffle/EventSource/
6
+ */
7
+ c=v,u=v.exports,function(t){var i=t.setTimeout,e=t.clearTimeout,n=t.XMLHttpRequest,s=t.XDomainRequest,r=t.ActiveXObject,o=t.EventSource,a=t.document,h=t.Promise,l=t.fetch,d=t.Response,f=t.TextDecoder,v=t.TextEncoder,p=t.AbortController;if("undefined"==typeof window||void 0===a||"readyState"in a||null!=a.body||(a.readyState="loading",window.addEventListener("load",(function(){a.readyState="complete"}),!1)),null==n&&null!=r&&(n=function(){return new r("Microsoft.XMLHTTP")}),null==Object.create&&(Object.create=function(t){function i(){}return i.prototype=t,new i}),Date.now||(Date.now=function(){return(new Date).getTime()}),null==p){var g=l;l=function(t,i){var e=i.signal;return g(t,{headers:i.headers,credentials:i.credentials,cache:i.cache}).then((function(t){var i=t.body.getReader();return e._reader=i,e._aborted&&e._reader.cancel(),{status:t.status,statusText:t.statusText,headers:t.headers,body:{getReader:function(){return i}}}}))},p=function(){this.signal={_reader:null,_aborted:!1},this.abort=function(){null!=this.signal._reader&&this.signal._reader.cancel(),this.signal._aborted=!0}}}function b(){this.bitsNeeded=0,this.codePoint=0}b.prototype.decode=function(t){function i(t,i,e){if(1===e)return t>=128>>i&&t<<i<=2047;if(2===e)return t>=2048>>i&&t<<i<=55295||t>=57344>>i&&t<<i<=65535;if(3===e)return t>=65536>>i&&t<<i<=1114111;throw new Error}function e(t,i){if(6===t)return i>>6>15?3:i>31?2:1;if(12===t)return i>15?3:2;if(18===t)return 3;throw new Error}for(var n=65533,s="",r=this.bitsNeeded,o=this.codePoint,a=0;a<t.length;a+=1){var h=t[a];0!==r&&(h<128||h>191||!i(o<<6|63&h,r-6,e(r,o)))&&(r=0,o=n,s+=String.fromCharCode(o)),0===r?(h>=0&&h<=127?(r=0,o=h):h>=192&&h<=223?(r=6,o=31&h):h>=224&&h<=239?(r=12,o=15&h):h>=240&&h<=247?(r=18,o=7&h):(r=0,o=n),0===r||i(o,r,e(r,o))||(r=0,o=n)):(r-=6,o=o<<6|63&h),0===r&&(o<=65535?s+=String.fromCharCode(o):(s+=String.fromCharCode(55296+(o-65535-1>>10)),s+=String.fromCharCode(56320+(o-65535-1&1023))))}return this.bitsNeeded=r,this.codePoint=o,s},null!=f&&null!=v&&function(){try{return"test"===(new f).decode((new v).encode("test"),{stream:!0})}catch(t){console.debug("TextDecoder does not support streaming option. Using polyfill instead: "+t)}return!1}()||(f=b);var w=function(){};function m(t){this.withCredentials=!1,this.readyState=0,this.status=0,this.statusText="",this.responseText="",this.onprogress=w,this.onload=w,this.onerror=w,this.onreadystatechange=w,this._contentType="",this._xhr=t,this._sendTimeout=0,this._abort=w}function y(t){return t.replace(/[A-Z]/g,(function(t){return String.fromCharCode(t.charCodeAt(0)+32)}))}function L(t){for(var i=Object.create(null),e=t.split("\r\n"),n=0;n<e.length;n+=1){var s=e[n].split(": "),r=s.shift(),o=s.join(": ");i[y(r)]=o}this._map=i}function S(){}function k(t){this._headers=t}function x(){}function T(){this._listeners=Object.create(null)}function C(t){i((function(){throw t}),0)}function R(t){this.type=t,this.target=void 0}function W(t,i){R.call(this,t),this.data=i.data,this.lastEventId=i.lastEventId}function P(t,i){R.call(this,t),this.status=i.status,this.statusText=i.statusText,this.headers=i.headers}function A(t,i){R.call(this,t),this.error=i.error}m.prototype.open=function(t,s){this._abort(!0);var r=this,o=this._xhr,a=1,h=0;this._abort=function(t){0!==r._sendTimeout&&(e(r._sendTimeout),r._sendTimeout=0),1!==a&&2!==a&&3!==a||(a=4,o.onload=w,o.onerror=w,o.onabort=w,o.onprogress=w,o.onreadystatechange=w,o.abort(),0!==h&&(e(h),h=0),t||(r.readyState=4,r.onabort(null),r.onreadystatechange())),a=0};var l=function(){if(1===a){var t=0,i="",e=void 0;if("contentType"in o)t=200,i="OK",e=o.contentType;else try{t=o.status,i=o.statusText,e=o.getResponseHeader("Content-Type")}catch(n){t=0,i="",e=void 0}0!==t&&(a=2,r.readyState=2,r.status=t,r.statusText=i,r._contentType=e,r.onreadystatechange())}},d=function(){if(l(),2===a||3===a){a=3;var t="";try{t=o.responseText}catch(t){}r.readyState=3,r.responseText=t,r.onprogress()}},c=function(t,i){if(null!=i&&null!=i.preventDefault||(i={preventDefault:w}),d(),1===a||2===a||3===a){if(a=4,0!==h&&(e(h),h=0),r.readyState=4,"load"===t)r.onload(i);else if("error"===t)r.onerror(i);else{if("abort"!==t)throw new TypeError;r.onabort(i)}r.onreadystatechange()}},u=function(){h=i((function(){u()}),500),3===o.readyState&&d()};"onload"in o&&(o.onload=function(t){c("load",t)}),"onerror"in o&&(o.onerror=function(t){c("error",t)}),"onabort"in o&&(o.onabort=function(t){c("abort",t)}),"onprogress"in o&&(o.onprogress=d),"onreadystatechange"in o&&(o.onreadystatechange=function(t){!function(t){null!=o&&(4===o.readyState?"onload"in o&&"onerror"in o&&"onabort"in o||c(""===o.responseText?"error":"load",t):3===o.readyState?"onprogress"in o||d():2===o.readyState&&l())}(t)}),!("contentType"in o)&&"ontimeout"in n.prototype||(s+=(-1===s.indexOf("?")?"?":"&")+"padding=true"),o.open(t,s,!0),"readyState"in o&&(h=i((function(){u()}),0))},m.prototype.abort=function(){this._abort(!1)},m.prototype.getResponseHeader=function(){return this._contentType},m.prototype.setRequestHeader=function(t,i){var e=this._xhr;"setRequestHeader"in e&&e.setRequestHeader(t,i)},m.prototype.getAllResponseHeaders=function(){return null!=this._xhr.getAllResponseHeaders&&this._xhr.getAllResponseHeaders()||""},m.prototype.send=function(){if("ontimeout"in n.prototype&&("sendAsBinary"in n.prototype||"mozAnon"in n.prototype)||null==a||null==a.readyState||"complete"===a.readyState){var t=this._xhr;"withCredentials"in t&&(t.withCredentials=this.withCredentials);try{t.send(void 0)}catch(t){throw t}}else{var e=this;e._sendTimeout=i((function(){e._sendTimeout=0,e.send()}),4)}},L.prototype.get=function(t){return this._map[y(t)]},null!=n&&null==n.HEADERS_RECEIVED&&(n.HEADERS_RECEIVED=2),S.prototype.open=function(t,i,e,s,r,o,a){t.open("GET",r);var h=0;for(var l in t.onprogress=function(){var i=t.responseText.slice(h);h+=i.length,e(i)},t.onerror=function(t){t.preventDefault(),s(new Error("NetworkError"))},t.onload=function(){s(null)},t.onabort=function(){s(null)},t.onreadystatechange=function(){if(t.readyState===n.HEADERS_RECEIVED){var e=t.status,s=t.statusText,r=t.getResponseHeader("Content-Type"),o=t.getAllResponseHeaders();i(e,s,r,new L(o))}},t.withCredentials=o,a)Object.prototype.hasOwnProperty.call(a,l)&&t.setRequestHeader(l,a[l]);return t.send(),t},k.prototype.get=function(t){return this._headers.get(t)},x.prototype.open=function(t,i,e,n,s,r,o){var a=null,d=new p,c=d.signal,u=new f;return l(s,{headers:o,credentials:r?"include":"same-origin",signal:c,cache:"no-store"}).then((function(t){return a=t.body.getReader(),i(t.status,t.statusText,t.headers.get("Content-Type"),new k(t.headers)),new h((function(t,i){var n=function(){a.read().then((function(i){if(i.done)t(void 0);else{var s=u.decode(i.value,{stream:!0});e(s),n()}})).catch((function(t){i(t)}))};n()}))})).catch((function(t){return"AbortError"===t.name?void 0:t})).then((function(t){n(t)})),{abort:function(){null!=a&&a.cancel(),d.abort()}}},T.prototype.dispatchEvent=function(t){t.target=this;var i=this._listeners[t.type];if(null!=i)for(var e=i.length,n=0;n<e;n+=1){var s=i[n];try{"function"==typeof s.handleEvent?s.handleEvent(t):s.call(this,t)}catch(t){C(t)}}},T.prototype.addEventListener=function(t,i){t=String(t);var e=this._listeners,n=e[t];null==n&&(e[t]=n=[]);for(var s=!1,r=0;r<n.length;r+=1)n[r]===i&&(s=!0);s||n.push(i)},T.prototype.removeEventListener=function(t,i){t=String(t);var e=this._listeners,n=e[t];if(null!=n){for(var s=[],r=0;r<n.length;r+=1)n[r]!==i&&s.push(n[r]);0===s.length?delete e[t]:e[t]=s}},W.prototype=Object.create(R.prototype),P.prototype=Object.create(R.prototype),A.prototype=Object.create(R.prototype);var E=/^text\/event\-stream(;.*)?$/i,O=function(t,i){var e=null==t?i:parseInt(t,10);return e!=e&&(e=i),I(e)},I=function(t){return Math.min(Math.max(t,1e3),18e6)},N=function(t,i,e){try{"function"==typeof i&&i.call(t,e)}catch(t){C(t)}};function $(t,r){T.call(this),r=r||{},this.onopen=void 0,this.onmessage=void 0,this.onerror=void 0,this.url=void 0,this.readyState=void 0,this.withCredentials=void 0,this.headers=void 0,this._close=void 0,function(t,r,o){r=String(r);var a=Boolean(o.withCredentials),h=o.lastEventIdQueryParameterName||"lastEventId",l=I(1e3),d=O(o.heartbeatTimeout,45e3),c="",u=l,f=!1,v=0,p=o.headers||{},g=o.Transport,b=D&&null==g?void 0:new m(null!=g?new g:null!=n&&"withCredentials"in n.prototype||null==s?new n:new s),w=null!=g&&"string"!=typeof g?new g:null==b?new x:new S,y=void 0,L=0,k=-1,T="",C="",R="",$="",M=0,U=0,j=0,_=function(i,e,n,s){if(0===k)if(200===i&&null!=n&&E.test(n)){k=1,f=Date.now(),u=l,t.readyState=1;var r=new P("open",{status:i,statusText:e,headers:s});t.dispatchEvent(r),N(t,t.onopen,r)}else{var o="";200!==i?(e&&(e=e.replace(/\s+/g," ")),o="EventSource's response has a status "+i+" "+e+" that is not 200. Aborting the connection."):o="EventSource's response has a Content-Type specifying an unsupported type: "+(null==n?"-":n.replace(/\s+/g," "))+". Aborting the connection.",F(),r=new P("error",{status:i,statusText:e,headers:s}),t.dispatchEvent(r),N(t,t.onerror,r),console.error(o)}},B=function(n){if(1===k){for(var s=-1,r=0;r<n.length;r+=1)(h=n.charCodeAt(r))!=="\n".charCodeAt(0)&&h!=="\r".charCodeAt(0)||(s=r);var o=(-1!==s?$:"")+n.slice(0,s+1);$=(-1===s?$:"")+n.slice(s+1),""!==n&&(f=Date.now(),v+=n.length);for(var a=0;a<o.length;a+=1){var h=o.charCodeAt(a);if(-1===M&&h==="\n".charCodeAt(0))M=0;else if(-1===M&&(M=0),h==="\r".charCodeAt(0)||h==="\n".charCodeAt(0)){if(0!==M){1===M&&(j=a+1);var p=o.slice(U,j-1),g=o.slice(j+(j<a&&o.charCodeAt(j)===" ".charCodeAt(0)?1:0),a);"data"===p?(T+="\n",T+=g):"id"===p?C=g:"event"===p?R=g:"retry"===p?(l=O(g,l),u=l):"heartbeatTimeout"===p&&(d=O(g,d),0!==L&&(e(L),L=i((function(){H()}),d)))}if(0===M){if(""!==T){c=C,""===R&&(R="message");var b=new W(R,{data:T.slice(1),lastEventId:C});if(t.dispatchEvent(b),"open"===R?N(t,t.onopen,b):"message"===R?N(t,t.onmessage,b):"error"===R&&N(t,t.onerror,b),2===k)return}T="",R=""}M=h==="\r".charCodeAt(0)?-1:0}else 0===M&&(U=a,M=1),1===M?h===":".charCodeAt(0)&&(j=a+1,M=2):2===M&&(M=3)}}},z=function(n){if(1===k||0===k){k=-1,0!==L&&(e(L),L=0),L=i((function(){H()}),u),u=I(Math.min(16*l,2*u)),t.readyState=0;var s=new A("error",{error:n});t.dispatchEvent(s),N(t,t.onerror,s),null!=n&&console.error(n)}},F=function(){k=2,null!=y&&(y.abort(),y=void 0),0!==L&&(e(L),L=0),t.readyState=2},H=function(){if(L=0,-1===k){f=!1,v=0,L=i((function(){H()}),d),k=0,T="",R="",C=c,$="",U=0,j=0,M=0;var e=r;if("data:"!==r.slice(0,5)&&"blob:"!==r.slice(0,5)&&""!==c){var n=r.indexOf("?");e=-1===n?r:r.slice(0,n+1)+r.slice(n+1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g,(function(t,i){return i===h?"":t})),e+=(-1===r.indexOf("?")?"?":"&")+h+"="+encodeURIComponent(c)}var s=t.withCredentials,o={Accept:"text/event-stream"},a=t.headers;if(null!=a)for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(o[l]=a[l]);try{y=w.open(b,_,B,z,e,s,o)}catch(t){throw F(),t}}else if(f||null==y){var u=Math.max((f||Date.now())+d-Date.now(),1);f=!1,L=i((function(){H()}),u)}else z(new Error("No activity within "+d+" milliseconds. "+(0===k?"No response received.":v+" chars received.")+" Reconnecting.")),null!=y&&(y.abort(),y=void 0)};t.url=r,t.readyState=0,t.withCredentials=a,t.headers=p,t._close=F,H()}(this,t,r)}var D=null!=l&&null!=d&&"body"in d.prototype;($.prototype=Object.create(T.prototype)).CONNECTING=0,$.prototype.OPEN=1,$.prototype.CLOSED=2,$.prototype.close=function(){this._close()},$.CONNECTING=0,$.OPEN=1,$.CLOSED=2,$.prototype.withCredentials=void 0;var M,U=o;null==n||null!=o&&"withCredentials"in o.prototype||(U=$),M=function(t){t.EventSourcePolyfill=$,t.NativeEventSource=o,t.EventSource=U}(u),void 0!==M&&(c.exports=M)}("undefined"==typeof globalThis?"undefined"!=typeof window?window:"undefined"!=typeof self?self:f:globalThis);const p=class{constructor(e){t(this,e),this.leaderboardLoaded=i(this,"leaderboardLoaded",7),this.isCurrentOnTop=!1,this.isCurrentPlayerRanked=!1,this.timeOrder1=500,this.timeOrder2=1e3,this.isMobile=!1,this.abortController=null,this.autoLocateCurrent=!1,this.keepOnBottom=!0,this.isPageRendering=!1,this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.translationUrl="",this.tournamentId=void 0,this.endpoint=void 0,this.session=void 0,this.language="en",this.limit=40,this.theme="Dark",this.state=void 0,this.offset=0,this.currentUserData=void 0,this.leaderboard=[],this.isLeaderboardLoading=!0,this.isLoadingMore=!1,this.isCurrentPlayerInview=!0,this.isLoadingPrevious=!1,this.scorefractiondigit=2}mergeSortedArrays(t,i,e){if(!(null==t?void 0:t.length))return i;if(!(null==i?void 0:i.length))return t;const n=new Map;t.forEach(((t,i)=>{n.set(t[e],i)}));let s=[...t];const r=[];return i.forEach((t=>{const i=t[e];n.has(i)?s[n.get(i)]=t:r.push(t)})),r.length?(s=[],s=r[r.length-1][e]<t[0][e]?[...r,...t]:[...t,...r],s):t}onLeaderboardScroll(t){t.stopPropagation(),(this.isLoadingPrevious||this.isLoadingMore||this.isPageRendering)&&t.preventDefault()}formatScore(t){const i=Number(this.scorefractiondigit)||2;return t.toLocaleString("en-US",{minimumFractionDigits:i,maximumFractionDigits:i})}async loadLeaderboardById(){if(this.abortController&&this.abortController.abort(),this.isLoadingMore)return;this.abortController=new AbortController,this.isLoadingMore=!0;let t=new URL(`${this.endpoint}/v1/tournaments/${this.tournamentId}/leaderboard?language=${this.language}`);t.searchParams.set("filter","includeUnqualifiedPlayer=true"),t.searchParams.set("pagination",`offset=${this.offset},limit=${this.limit}`),t.searchParams.set("platform",d());let i={headers:{"Content-Type":"application/json","x-SessionId":this.session},method:"GET",signal:this.abortController.signal};await fetch(t,i).then((t=>t.json())).then((i=>{var e;const{item:n,items:s,total:r}=i;if(this.isCurrentPlayerRanked=!!n,this.isCurrentPlayerRanked){if(this.currentUserData=n,this.currentUserData.formattedScore=this.formatScore(this.currentUserData.score),this.isLeaderboardLoading){if(this.offset>0)this.scrollCurrentPlayerToMiddle();else if(0===this.offset&&this.autoLocateCurrent&&this.currentUserData.rank>this.limit)return this.offset=this.currentUserData.rank-this.limit/2||0,this.leaderboardLoaded.emit({item:this.currentUserData,leaderboardOffset:this.offset,isRanked:!0,totalRank:r}),void this.loadLeaderboardById().catch(console.error)}else this.isLoadingPrevious&&this.resetScrollTop();setTimeout((()=>{this.tableListEle&&this.tableListEle.querySelectorAll(".Active").length?this.startActivePlayerObserver():this.isCurrentPlayerInview=!1}),this.timeOrder2)}this.total=r,this.leaderboardLoaded.emit({item:this.currentUserData,leaderboardOffset:this.offset,isRanked:this.isCurrentPlayerRanked,totalRank:r}),this.leaderboard=this.mergeSortedArrays(this.leaderboard,s,"rank"),null===(e=this.leaderboard)||void 0===e||e.forEach((t=>t.formattedScore=this.formatScore(t.score))),this.startScrollObersever(),this.reStartUpSSEUpdater(t),this.isLeaderboardLoading=!1}),(t=>{this.isLeaderboardLoading=!1,"AbortError"===t.name?console.log("Request aborted because a new one started or component unmounted."):console.error("Network error",t)})).finally((()=>{this.isLoadingMore=!1}))}startScrollObersever(){this.topLastTimer&&clearTimeout(this.topLastTimer),this.topLastTimer=setTimeout((()=>{this.total<=this.limit||(1!==this.leaderboard[0].rank&&this.startTopRankObserver(),this.leaderboard[this.leaderboard.length-1].rank<this.total&&this.startLastRankObserver())}),this.timeOrder2)}scrollCurrentPlayerToMiddle(){setTimeout((()=>{if(!this.tableListEle||!this.tableListEle.querySelectorAll(".Active").length)return;const t=this.tableListEle.querySelectorAll(".Active")[0],i=this.stylingContainer.getBoundingClientRect(),e=window.innerHeight||document.documentElement.clientHeight;let n=Math.min((e-i.top)/2-t.clientHeight,4*t.clientHeight);n=Math.max(n,t.clientHeight),this.tableListEle.scrollTo({top:t.offsetTop-n,behavior:"smooth"})}),this.timeOrder1)}onStateChanged(){switch(this.state){case"Closed":case"Closing":this.leaderboardUpdater&&(this.leaderboardUpdater.close(),this.leaderboardUpdater.removeEventListener("message",this.updateMessageHandler),this.leaderboardUpdater=null)}}reStartUpSSEUpdater(t){var i;if(this.leaderboardUpdater&&(this.leaderboardUpdater.close(),this.leaderboardUpdater.removeEventListener("message",this.updateMessageHandler)),"Running"!==this.state)return;t.searchParams.set("pagination",`offset=${this.leaderboard.length?this.leaderboard[0].rank-1:0},limit=${(null===(i=this.leaderboard)||void 0===i?void 0:i.length)>this.limit?this.leaderboard.length:this.limit}`);let e=new URL(`${this.endpoint}/v1/tournaments/${this.tournamentId}/leaderboard/updates?${t.searchParams.toString()}`);this.leaderboardUpdater=new v.exports.EventSourcePolyfill(e,{headers:{accept:"text/event-stream","X-SessionId":this.session}}),this.leaderboardUpdater.addEventListener("message",this.updateMessageHandler.bind(this))}updateMessageHandler(t){if(!t.data)return;const i=JSON.parse(t.data);if("LeaderBoardUpdate"===i.messageType){const{item:t,items:e,total:n}=i;(t||this.currentUserData)&&(this.currentUserData=t||this.currentUserData,this.currentUserData.formattedScore=this.formatScore(this.currentUserData.score)),this.leaderboardLoaded.emit({item:this.currentUserData?this.currentUserData:null,isRanked:!!t,totalRank:n}),e.forEach((t=>{const i=this.leaderboard.findIndex((i=>i.rank===t.rank));i>=0&&(this.leaderboard[i]=t),t.formattedScore=this.formatScore(t.score),i<0?this.leaderboard.push(t):this.leaderboard[i]=t})),this.leaderboard=[...this.leaderboard]}}startActivePlayerObserver(){this.activePlayerObserver&&this.activePlayerEle&&this.activePlayerObserver.unobserve(this.activePlayerEle),this.activePlayerObserver=new IntersectionObserver((t=>{t.forEach((t=>{if(this.isCurrentPlayerInview=t.isIntersecting,!t.isIntersecting){const t=this.activePlayerEle.getBoundingClientRect();this.keepOnBottom||(this.isCurrentOnTop=t.top<this.stylingContainer.offsetTop)}}))})),this.activePlayerEle=this.tableListEle.querySelectorAll(".Active")[0],this.activePlayerObserver.observe(this.activePlayerEle)}startTopRankObserver(){this.topRankToObserved&&(this.topMoreObserver.unobserve(this.topRankToObserved),this.topRankToObserved=null),this.topMoreObserver||(this.topMoreObserver=new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(this.loadPreMore(),this.topMoreObserver.unobserve(t.target))}))}))),setTimeout((()=>{var t;this.topRankToObserved=null===(t=this.tableListEle)||void 0===t?void 0:t.querySelector("#Rank_1"),this.topRankToObserved&&this.topMoreObserver.observe(this.topRankToObserved)}),this.timeOrder2)}startLastRankObserver(){var t;this.lastRankToObserved&&(this.loadMoreObserver.unobserve(this.lastRankToObserved),this.lastRankToObserved=null),this.loadMoreObserver||(this.loadMoreObserver=new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(this.loadMore(),this.loadMoreObserver.unobserve(t.target))}))}))),this.lastRankToObserved=null===(t=this.tableListEle)||void 0===t?void 0:t.querySelector("#Rank_"+(this.leaderboard.length-1)),this.lastRankToObserved&&this.loadMoreObserver.observe(this.lastRankToObserved)}resetScrollTop(){this.isLoadingPrevious=!1,setTimeout((()=>{const t=this.tableListEle;t.scrollTop=this.previousScrollTop+(t.scrollHeight-this.previousScrollHeight)}),100)}loadPreMore(){var t;if((null===(t=this.leaderboard)||void 0===t?void 0:t.length)&&1===this.leaderboard[0].rank||this.isLoadingPrevious)return;this.offset=this.leaderboard[0].rank-1-this.limit||0;const i=this.tableListEle;this.previousScrollHeight=i.scrollHeight,this.previousScrollTop=i.scrollTop,this.isLoadingPrevious=!0,this.preTopRank=this.leaderboard[0].rank,this.loadLeaderboardById().catch(console.error)}goToCurrentPlayerPage(){this.leaderboard.findIndex((t=>t.id===this.currentUserData.id))>=0?this.scrollCurrentPlayerToMiddle():(this.offset=this.currentUserData.rank-this.limit/2||0,this.leaderboard=[],this.isLeaderboardLoading=!0,this.loadLeaderboardById().catch(console.error),this.isCurrentPlayerInview=!0)}loadMore(){var t;(null===(t=this.leaderboard)||void 0===t?void 0:t.length)>=this.total||(this.offset+=this.limit,this.offset=this.offset>this.total?this.total:this.offset,this.loadLeaderboardById().catch(console.error))}handleTableListScroll(){this.isCurrentPlayerInview=this.isElementInViewport()}isElementInViewport(){const t=this.tableListEle.querySelector(".Active");if(!t)return!1;const i=t.getBoundingClientRect();return this.isCurrentOnTop=i.top<this.stylingContainer.offsetTop,i.top>=0&&i.top>this.stylingContainer.offsetTop&&i.bottom<=this.stylingContainer.offsetTop+this.stylingContainer.offsetHeight&&i.bottom<=(window.innerHeight||document.documentElement.clientHeight)}onTournamentIdChanged(){this.disconnectedCallback(),this.endpoint&&this.session&&!(this.session.length<10)&&this.tournamentId&&(this.isLeaderboardLoading=!0,this.resetLeaderboardStatus(),this.loadLeaderboardById().catch(console.error))}resetLeaderboardStatus(){this.offset=0,this.leaderboard=[]}async componentWillLoad(){switch(this.state){case"Running":this.loadLeaderboardById().catch(console.error);break;case"Unstarted":this.isLeaderboardLoading=!1,this.resetLeaderboardStatus()}this.translationUrl.length>2&&await h(this.translationUrl)}render(){var t;return e("div",{key:"26150cc5aa004ca610b2c849e2549a3f584a8d60",class:`LeaderboardWrapper ${this.theme} ${this.isMobile?"Mobile":""}`,ref:t=>this.stylingContainer=t},this.isLeaderboardLoading?e("div",{class:"Loading"}," ",l("loading",this.language)," "):[e("div",null,!this.isCurrentPlayerInview&&this.isCurrentOnTop&&this.currentUserData&&e("div",{class:"PlayerRank Active"},e("div",{class:"Rank"},0===this.currentUserData.rank?"--":this.currentUserData.rank),e("div",{class:"Name"},l("you",this.language)),e("div",{class:"Score"},this.currentUserData.formattedScore),e("div",{class:"Prize"},this.currentUserData.prizeName))),this.isLoadingPrevious&&e("div",null,"Loading"),e("div",{class:"Leaderboard",onScroll:this.onLeaderboardScroll.bind(this),onTouchMove:this.onLeaderboardScroll.bind(this),ref:t=>this.tableListEle=t},(null===(t=this.leaderboard)||void 0===t?void 0:t.length)?this.leaderboard.map(((t,i)=>{var n,s;return e("div",{id:`Rank_${i}`,class:`PlayerRank ${this.isLoadingPrevious&&t.rank<this.preTopRank?"Hidden":""} ${(null===(n=this.currentUserData)||void 0===n?void 0:n.id)===t.id?"Active":""}`},e("div",{class:"Rank"},0===t.rank?"":t.rank),e("div",{class:"Name"},(null===(s=this.currentUserData)||void 0===s?void 0:s.id)===t.id?l("you",this.language):t.shortName),e("div",{class:"Score"},t.formattedScore),e("div",{class:"Prize"},t.prizeName))})):e("div",{class:"NoWinners"},e("div",{class:"Title"}," ",l("noLeaderboard",this.language)," "),e("div",{class:"Info"}," ",l("positionsWillShow",this.language)," "))),this.isLoadingMore&&!this.isLoadingPrevious&&e("div",null,"Loading"),!this.isCurrentPlayerInview&&e("div",{class:this.isCurrentOnTop?"":"Bottom"},!this.isCurrentOnTop&&this.currentUserData&&e("div",{class:"PlayerRank Active",onClick:this.goToCurrentPlayerPage.bind(this)},e("div",{class:"Rank"},0===this.currentUserData.rank?"--":this.currentUserData.rank),e("div",{class:"Name"},l("you",this.language)),e("div",{class:"Score"},this.currentUserData.formattedScore),e("div",{class:"Prize"},this.currentUserData.prizeName)))])}handleClientStylingChange(t,i){t!=i&&s(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,i){t!=i&&r(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,i){t!=i&&o(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentWillRender(){this.isPageRendering=!0}componentDidRender(){this.isPageRendering=!1}handleNewTranslations(){h(this.translationUrl)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&o(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&s(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&r(this.stylingContainer,this.clientStylingUrl)),this.isMobile="PC"!==d(),this.stylingContainer.addEventListener("touchmove",(t=>{t.stopPropagation(),t.preventDefault()}),{passive:!1})}disconnectedCallback(){this.abortController&&this.abortController.abort("Disconnected callback"),this.stylingSubscription&&this.stylingSubscription.unsubscribe(),this.leaderboardUpdater&&(this.leaderboardUpdater.close(),this.leaderboardUpdater.removeEventListener("message",this.updateMessageHandler)),this.loadMoreObserver&&this.loadMoreObserver.disconnect(),this.topMoreObserver&&this.topMoreObserver.disconnect(),this.activePlayerObserver&&this.activePlayerObserver.disconnect(),this.tableListEle&&this.tableListEle.removeEventListener("scroll",this.handleTableListScroll.bind(this))}static get watchers(){return{state:["onStateChanged"],tournamentId:["onTournamentIdChanged"],endpoint:["onTournamentIdChanged"],session:["onTournamentIdChanged"],language:["onTournamentIdChanged"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"],translationUrl:["handleNewTranslations"]}}};p.style=":host{display:block;height:100%}.Dark{color:var(--emw--ingame-color-text, #f5f8f6)}.Light{color:var(--emw--ingame-color-black, #0A0A17)}.Mobile.LeaderboardWrapper .Bottom .PlayerRank.Active{padding:2px 8px}.LeaderboardWrapper{height:100%;position:relative;overflow:hidden}.LeaderboardWrapper .Loading,.LeaderboardWrapper .Leaderboard,.LeaderboardWrapper .Bottom{width:calc(100% - 30px);padding:0 15px;scrollbar-width:thin}.LeaderboardWrapper .Loading,.LeaderboardWrapper .Leaderboard{padding-bottom:0}.LeaderboardWrapper .Bottom{position:absolute;bottom:0;background:linear-gradient(90deg, var(--emw--ingame-color-gray-purple50, rgba(35, 41, 119, 0.4980392157)) 0%, var(--emw--ingame-color-dark-purple50, rgba(59, 28, 117, 0.4980392157)) 100%);border-top:1px solid;border-image-source:linear-gradient(94.32deg, var(--emw--ingame-color-pth-primary1, #9500FF) 4.41%, var(--emw--ingame-color-pth-primary2, #232EC4) 113.86%);border-image-slice:1;backdrop-filter:blur(20px);opacity:0.91}.LeaderboardWrapper .Bottom .PlayerRank.Active{border-width:0;cursor:pointer;padding-right:18px;background:transparent}.LeaderboardWrapper .PlayerRank{overflow-anchor:auto;font-weight:bold;align-items:center;height:26px;gap:16px;padding:2px 8px;display:flex}.LeaderboardWrapper .PlayerRank.Hidden{display:none !important}.LeaderboardWrapper .PlayerRank.Active{background-clip:padding-box, border-box;background-origin:padding-box, border-box;border:1px solid transparent;border-radius:10px;background-image:linear-gradient(91deg, var(--emw--ingame-color-pth-primary4, #11153E) 4.41%, var(--emw--ingame-color-pth-primary4, #11153E) 113.86%), linear-gradient(91deg, var(--emw--ingame-color-pth-primary1, #9500FF) 4.41%, var(--emw--ingame-color-pth-primary2, #232EC4) 113.86%)}.LeaderboardWrapper .PlayerRank div{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.LeaderboardWrapper .PlayerRank .Rank{flex:1}.LeaderboardWrapper .PlayerRank .Name{flex:2;text-align:left}.LeaderboardWrapper .PlayerRank .Score{flex:1;font-weight:normal;text-align:right;overflow:visible;min-width:50px}.LeaderboardWrapper .PlayerRank .Prize{flex:4;overflow:hidden}.LeaderboardWrapper .Leaderboard{height:calc(100% - 2px) !important;overflow-y:auto;overflow-anchor:auto;touch-action:pan-y}.LeaderboardWrapper .Leaderboard .NoWinners{margin:30px auto;display:flex;flex-direction:column;gap:15px}.LeaderboardWrapper .Leaderboard .NoWinners .Title{font-weight:bold;font-size:medium}.LeaderboardWrapper .Leaderboard .NoWinners .Title,.LeaderboardWrapper .Leaderboard .NoWinners .Info{display:flex;align-items:center;flex-direction:column}";export{p as C}
@@ -1 +1 @@
1
- export{C as casino_tournaments_ingame_table}from"./casino-tournaments-ingame-table-cea9e05e.js";import"./index-7421f3cc.js";
1
+ export{C as casino_tournaments_ingame_table}from"./casino-tournaments-ingame-table-aac2043e.js";import"./index-448538d5.js";
@@ -1 +1 @@
1
- import{p as n,b as e}from"./index-7421f3cc.js";export{s as setNonce}from"./index-7421f3cc.js";import{g as t}from"./app-globals-0f993ce5.js";(()=>{const e=import.meta.url,t={};return""!==e&&(t.resourcesUrl=new URL(".",e).href),n(t)})().then((async n=>(await t(),e([["casino-tournaments-ingame-table",[[1,"casino-tournaments-ingame-table",{mbSource:[513,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],tournamentId:[513,"tournament-id"],endpoint:[513],session:[513],language:[513],limit:[514],theme:[513],state:[513],offset:[32],currentUserData:[32],leaderboard:[32],isLeaderboardLoading:[32],isLoadingMore:[32],isCurrentPlayerInview:[32],isLoadingPrevious:[32]},null,{state:["onStateChanged"],tournamentId:["onTournamentIdChanged"],endpoint:["onTournamentIdChanged"],session:["onTournamentIdChanged"],language:["onTournamentIdChanged"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}]]]],n))));
1
+ import{p as n,b as e}from"./index-448538d5.js";export{s as setNonce}from"./index-448538d5.js";import{g as t}from"./app-globals-0f993ce5.js";(()=>{const e=import.meta.url,t={};return""!==e&&(t.resourcesUrl=new URL(".",e).href),n(t)})().then((async n=>(await t(),e([["casino-tournaments-ingame-table",[[1,"casino-tournaments-ingame-table",{mbSource:[513,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],tournamentId:[513,"tournament-id"],endpoint:[513],session:[513],language:[513],limit:[514],theme:[513],state:[513],offset:[32],currentUserData:[32],leaderboard:[32],isLeaderboardLoading:[32],isLoadingMore:[32],isCurrentPlayerInview:[32],isLoadingPrevious:[32],scorefractiondigit:[32]},null,{state:["onStateChanged"],tournamentId:["onTournamentIdChanged"],endpoint:["onTournamentIdChanged"],session:["onTournamentIdChanged"],language:["onTournamentIdChanged"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"],translationUrl:["handleNewTranslations"]}]]]],n))));
@@ -0,0 +1,2 @@
1
+ var e=Object.defineProperty,t=new WeakMap,n=e=>t.get(e),l=(e,n)=>t.set(n.t=e,n),o=(e,t)=>t in e,s=(e,t)=>(0,console.error)(e,t),r=new Map,i=new Map,c="slot-fb{display:contents}slot-fb[hidden]{display:none}",u="undefined"!=typeof window?window:{},a=u.document||{head:{}},f={l:0,o:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},h=e=>Promise.resolve(e),d=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),m=!1,p=[],y=[],$=(e,t)=>n=>{e.push(n),m||(m=!0,t&&4&f.l?v(w):f.raf(w))},b=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){s(e)}e.length=0},w=()=>{b(p),b(y),(m=p.length>0)&&f.raf(w)},v=e=>h().then(e),g=$(y,!0),S={},j=e=>"object"==(e=typeof e)||"function"===e;function k(e){var t,n,l;return null!=(l=null==(n=null==(t=e.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?l:void 0}((t,n)=>{for(var l in n)e(t,l,{get:n[l],enumerable:!0})})({},{err:()=>E,map:()=>C,ok:()=>O,unwrap:()=>P,unwrapErr:()=>R});var O=e=>({isOk:!0,isErr:!1,value:e}),E=e=>({isOk:!1,isErr:!0,value:e});function C(e,t){if(e.isOk){const n=t(e.value);return n instanceof Promise?n.then((e=>O(e))):O(n)}if(e.isErr)return E(e.value);throw"should never get here"}var M,x,P=e=>{if(e.isOk)return e.value;throw e.value},R=e=>{if(e.isErr)return e.value;throw e.value},L=(e,t,...n)=>{let l=null,o=null,s=!1,r=!1;const i=[],c=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!j(l))&&(l+=""),s&&r?i[i.length-1].i+=l:i.push(s?T(null,l):l),r=s)};if(c(n),t){t.key&&(o=t.key);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}const u=T(e,null);return u.u=t,i.length>0&&(u.h=i),u.m=o,u},T=(e,t)=>({l:0,p:e,i:t,$:null,h:null,u:null,m:null}),W={},A=(e,t,l)=>{const o=(e=>n(e).$hostElement$)(e);return{emit:e=>D(o,t,{bubbles:!!(4&l),composed:!!(2&l),cancelable:!!(1&l),detail:e})}},D=(e,t,n)=>{const l=f.ce(t,n);return e.dispatchEvent(l),l},F=new WeakMap,N=e=>"sc-"+e.v,U=(e,t,n,l,s,r)=>{if(n!==l){let i=o(e,t),c=t.toLowerCase();if("class"===t){const t=e.classList,o=q(n),s=q(l);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("key"===t);else if("ref"===t)l&&l(e);else if(i||"o"!==t[0]||"n"!==t[1]){const o=j(l);if((i||o&&null!==l)&&!s)try{if(e.tagName.includes("-"))e[t]=l;else{const o=null==l?"":l;"list"===t?i=!1:null!=n&&e[t]==o||(e[t]=o)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&r||s)&&!o&&e.setAttribute(t,l=!0===l?"":l)}else if(t="-"===t[2]?t.slice(3):o(u,c)?c.slice(2):c[2]+t.slice(3),n||l){const o=t.endsWith(G);t=t.replace(V,""),n&&f.rel(e,t,n,o),l&&f.ael(e,t,l,o)}}},H=/\s/,q=e=>e?e.split(H):[],G="Capture",V=RegExp(G+"$"),_=(e,t,n)=>{const l=11===t.$.nodeType&&t.$.host?t.$.host:t.$,o=e&&e.u||S,s=t.u||S;for(const e of z(Object.keys(o)))e in s||U(l,e,o[e],void 0,n,t.l);for(const e of z(Object.keys(s)))U(l,e,o[e],s[e],n,t.l)};function z(e){return e.includes("ref")?[...e.filter((e=>"ref"!==e)),"ref"]:e}var B=!1,I=(e,t,n)=>{const l=t.h[n];let o,s,r=0;if(null!==l.i)o=l.$=a.createTextNode(l.i);else if(o=l.$=a.createElement(l.p),_(null,l,B),null!=M&&o["s-si"]!==M&&o.classList.add(o["s-si"]=M),l.h)for(r=0;r<l.h.length;++r)s=I(e,l,r),s&&o.appendChild(s);return o["s-hn"]=x,o},J=(e,t,n,l,o,s)=>{let r,i=e;for(i.shadowRoot&&i.tagName===x&&(i=i.shadowRoot);o<=s;++o)l[o]&&(r=I(null,n,o),r&&(l[o].$=r,Z(i,r,t)))},K=(e,t,n)=>{for(let l=t;l<=n;++l){const t=e[l];if(t){const e=t.$;Y(t),e&&e.remove()}}},Q=(e,t,n=!1)=>e.p===t.p&&(!!n||e.m===t.m),X=(e,t,n=!1)=>{const l=t.$=e.$,o=e.h,s=t.h,r=t.i;null===r?(_(e,t,B),null!==o&&null!==s?((e,t,n,l,o=!1)=>{let s,r,i=0,c=0,u=0,a=0,f=t.length-1,h=t[0],d=t[f],m=l.length-1,p=l[0],y=l[m];for(;i<=f&&c<=m;)if(null==h)h=t[++i];else if(null==d)d=t[--f];else if(null==p)p=l[++c];else if(null==y)y=l[--m];else if(Q(h,p,o))X(h,p,o),h=t[++i],p=l[++c];else if(Q(d,y,o))X(d,y,o),d=t[--f],y=l[--m];else if(Q(h,y,o))X(h,y,o),Z(e,h.$,d.$.nextSibling),h=t[++i],y=l[--m];else if(Q(d,p,o))X(d,p,o),Z(e,d.$,h.$),d=t[--f],p=l[++c];else{for(u=-1,a=i;a<=f;++a)if(t[a]&&null!==t[a].m&&t[a].m===p.m){u=a;break}u>=0?(r=t[u],r.p!==p.p?s=I(t&&t[c],n,u):(X(r,p,o),t[u]=void 0,s=r.$),p=l[++c]):(s=I(t&&t[c],n,c),p=l[++c]),s&&Z(h.$.parentNode,s,h.$)}i>f?J(e,null==l[m+1]?null:l[m+1].$,n,l,c,m):c>m&&K(t,i,f)})(l,o,t,s,n):null!==s?(null!==e.i&&(l.textContent=""),J(l,null,t,s,0,s.length-1)):null!==o&&K(o,0,o.length-1)):e.i!==r&&(l.data=r)},Y=e=>{e.u&&e.u.ref&&e.u.ref(null),e.h&&e.h.map(Y)},Z=(e,t,n)=>null==e?void 0:e.insertBefore(t,n),ee=(e,t)=>{t&&!e.S&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.S=t)))},te=(e,t)=>{if(e.l|=16,!(4&e.l))return ee(e,e.j),g((()=>ne(e,t)));e.l|=512},ne=(e,t)=>{const n=e.t;if(!n)throw Error(`Can't render component <${e.$hostElement$.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let l;return t&&(l=ue(n,"componentWillLoad")),l=le(l,(()=>ue(n,"componentWillRender"))),le(l,(()=>se(e,n,t)))},le=(e,t)=>oe(e)?e.then(t).catch((e=>{console.error(e),t()})):t(),oe=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,se=async(e,t,n)=>{var l;const o=e.$hostElement$,s=o["s-rc"];n&&(e=>{const t=e.k,n=e.$hostElement$,l=t.l,o=((e,t)=>{var n;const l=N(t),o=i.get(l);if(e=11===e.nodeType?e:a,o)if("string"==typeof o){let s,r=F.get(e=e.head||e);if(r||F.set(e,r=new Set),!r.has(l)){{s=a.createElement("style"),s.innerHTML=o;const t=null!=(n=f.O)?n:k(a);null!=t&&s.setAttribute("nonce",t),e.insertBefore(s,e.querySelector("link"))}4&t.l&&(s.innerHTML+=c),r&&r.add(l)}}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o]);return l})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);re(e,t,o,n),s&&(s.map((e=>e())),o["s-rc"]=void 0);{const t=null!=(l=o["s-p"])?l:[],n=()=>ie(e);0===t.length?n():(Promise.all(t).then(n),e.l|=4,t.length=0)}},re=(e,t,n,l)=>{try{t=t.render(),e.l&=-17,e.l|=2,((e,t,n=!1)=>{const l=e.$hostElement$,o=e.k,s=e.C||T(null,null),r=(e=>e&&e.p===W)(t)?t:L(null,null,t);if(x=l.tagName,o.M&&(r.u=r.u||{},o.M.map((([e,t])=>r.u[t]=l[e]))),n&&r.u)for(const e of Object.keys(r.u))l.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(r.u[e]=l[e]);r.p=null,r.l|=4,e.C=r,r.$=s.$=l.shadowRoot||l,M=l["s-sc"],X(s,r,n)})(e,t,l)}catch(t){s(t,e.$hostElement$)}return null},ie=e=>{const t=e.$hostElement$,n=e.t,l=e.j;ue(n,"componentDidRender"),64&e.l||(e.l|=64,ae(t),ue(n,"componentDidLoad"),e.P(t),l||ce()),e.S&&(e.S(),e.S=void 0),512&e.l&&v((()=>te(e,!1))),e.l&=-517},ce=()=>{ae(a.documentElement),v((()=>D(u,"appload",{detail:{namespace:"casino-tournaments-ingame-table"}})))},ue=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){s(e)}},ae=e=>e.classList.add("hydrated"),fe=(e,t,l)=>{var o,r;const i=e.prototype;if(t.R||t.L||e.watchers){e.watchers&&!t.L&&(t.L=e.watchers);const c=Object.entries(null!=(o=t.R)?o:{});if(c.map((([e,[o]])=>{(31&o||2&l&&32&o)&&Object.defineProperty(i,e,{get(){return((e,t)=>n(this).T.get(t))(0,e)},set(l){((e,t,l,o)=>{const r=n(e);if(!r)throw Error(`Couldn't find host element for "${o.v}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`);const i=r.$hostElement$,c=r.T.get(t),u=r.l,a=r.t;if(l=((e,t)=>null==e||j(e)?e:2&t?parseFloat(e):1&t?e+"":e)(l,o.R[t][0]),(!(8&u)||void 0===c)&&l!==c&&(!Number.isNaN(c)||!Number.isNaN(l))&&(r.T.set(t,l),a)){if(o.L&&128&u){const e=o.L[t];e&&e.map((e=>{try{a[e](l,c,t)}catch(e){s(e,i)}}))}2==(18&u)&&te(r,!1)}})(this,e,l,t)},configurable:!0,enumerable:!0})})),1&l){const l=new Map;i.attributeChangedCallback=function(e,o,s){f.jmp((()=>{var r;const c=l.get(e);if(this.hasOwnProperty(c))s=this[c],delete this[c];else{if(i.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==s)return;if(null==c){const l=n(this),i=null==l?void 0:l.l;if(i&&!(8&i)&&128&i&&s!==o){const n=l.t,i=null==(r=t.L)?void 0:r[e];null==i||i.forEach((t=>{null!=n[t]&&n[t].call(n,s,o,e)}))}return}}this[c]=(null!==s||"boolean"!=typeof this[c])&&s}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(r=t.L)?r:{}),...c.filter((([e,t])=>15&t[0])).map((([e,n])=>{var o;const s=n[1]||e;return l.set(s,e),512&n[0]&&(null==(o=t.M)||o.push([e,s])),s}))]))}}return e},he=e=>{ue(e,"disconnectedCallback")},de=(e,l={})=>{var o;const h=[],m=l.exclude||[],p=u.customElements,y=a.head,$=y.querySelector("meta[charset]"),b=a.createElement("style"),w=[];let v,g=!0;Object.assign(f,l),f.o=new URL(l.resourcesUrl||"./",a.baseURI).href;let S=!1;if(e.map((e=>{e[1].map((l=>{var o;const c={l:l[0],v:l[1],R:l[2],W:l[3]};4&c.l&&(S=!0),c.R=l[2],c.M=[],c.L=null!=(o=l[4])?o:{};const u=c.v,a=class extends HTMLElement{constructor(e){if(super(e),this.hasRegisteredEventListeners=!1,((e,n)=>{const l={l:0,$hostElement$:e,k:n,T:new Map};l.A=new Promise((e=>l.P=e)),e["s-p"]=[],e["s-rc"]=[],t.set(e,l)})(e=this,c),1&c.l)if(e.shadowRoot){if("open"!==e.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${c.v}! Mode is set to ${e.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else e.attachShadow({mode:"open"})}connectedCallback(){this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),v&&(clearTimeout(v),v=null),g?w.push(this):f.jmp((()=>(e=>{if(!(1&f.l)){const t=n(e),l=t.k,o=()=>{};if(1&t.l)(null==t?void 0:t.t)||(null==t?void 0:t.A)&&t.A.then((()=>{}));else{t.l|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){ee(t,t.j=n);break}}l.R&&Object.entries(l.R).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n)=>{let l;if(!(32&t.l)){if(t.l|=32,n.D){const e=(e=>{const t=e.v.replace(/-/g,"_"),n=e.D;if(!n)return;const l=r.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(r.set(n,e),e[t])),s)
2
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n);if(e&&"then"in e){const t=()=>{};l=await e,t()}else l=e;if(!l)throw Error(`Constructor for "${n.v}#${t.F}" was not found`);l.isProxied||(n.L=l.watchers,fe(l,n,2),l.isProxied=!0);const o=()=>{};t.l|=8;try{new l(t)}catch(e){s(e)}t.l&=-9,t.l|=128,o()}else l=e.constructor,customElements.whenDefined(e.localName).then((()=>t.l|=128));if(l&&l.style){let e;"string"==typeof l.style&&(e=l.style);const t=N(n);if(!i.has(t)){const l=()=>{};((e,t,n)=>{let l=i.get(e);d&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,i.set(e,l)})(t,e,!!(1&n.l)),l()}}}const o=t.j,c=()=>te(t,!0);o&&o["s-rc"]?o["s-rc"].push(c):c()})(e,t,l)}o()}})(this)))}disconnectedCallback(){f.jmp((()=>(async()=>{if(!(1&f.l)){const e=n(this);(null==e?void 0:e.t)?he(e.t):(null==e?void 0:e.A)&&e.A.then((()=>he(e.t)))}})()))}componentOnReady(){return n(this).A}};c.D=e[0],m.includes(u)||p.get(u)||(h.push(u),p.define(u,fe(a,c,1)))}))})),h.length>0&&(S&&(b.textContent+=c),b.textContent+=h.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",b.innerHTML.length)){b.setAttribute("data-styles","");const e=null!=(o=f.O)?o:k(a);null!=e&&b.setAttribute("nonce",e),y.insertBefore(b,$?$.nextSibling:y.firstChild)}g=!1,w.length?w.map((e=>e.connectedCallback())):f.jmp((()=>v=setTimeout(ce,30)))},me=e=>f.O=e;export{de as b,A as c,L as h,h as p,l as r,me as s}
@@ -1 +1 @@
1
- export{C as CasinoTournamentsIngameTable}from"./casino-tournaments-ingame-table-cea9e05e.js";import"./index-7421f3cc.js";
1
+ export{C as CasinoTournamentsIngameTable}from"./casino-tournaments-ingame-table-aac2043e.js";import"./index-448538d5.js";
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-3f69085c.js');
3
+ const index = require('./index-666544d1.js');
4
4
 
5
5
  const StyleCacheKey = '__WIDGET_GLOBAL_STYLE_CACHE__';
6
6
 
@@ -131,6 +131,23 @@ const TRANSLATIONS = {
131
131
  positionsWillShow: 'Player positions will appear here once scores are recorded.',
132
132
  }
133
133
  };
134
+ const getTranslations = (url) => {
135
+ return new Promise((resolve) => {
136
+ fetch(url)
137
+ .then((res) => res.json())
138
+ .then((data) => {
139
+ Object.keys(data).forEach((lang) => {
140
+ if (!TRANSLATIONS[lang]) {
141
+ TRANSLATIONS[lang] = {};
142
+ }
143
+ for (let key in data[lang]) {
144
+ TRANSLATIONS[lang][key] = data[lang][key];
145
+ }
146
+ });
147
+ resolve(true);
148
+ });
149
+ });
150
+ };
134
151
  const translate = (key, customLang, values) => {
135
152
  const lang = customLang;
136
153
  let translation = TRANSLATIONS[(lang !== undefined) && (lang in TRANSLATIONS) ? lang : DEFAULT_LANGUAGE][key];
@@ -1205,7 +1222,7 @@ var eventsource = {exports: {}};
1205
1222
  }(typeof globalThis === 'undefined' ? (typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : commonjsGlobal) : globalThis));
1206
1223
  }(eventsource, eventsource.exports));
1207
1224
 
1208
- const casinoTournamentsIngameTableCss = ":host{display:block;height:100%}.Dark{color:var(--emw--ingame-color-text, #f5f8f6)}.Light{color:var(--emw--ingame-color-black, #0A0A17)}.Mobile.LeaderboardWrapper .Bottom .PlayerRank.Active{padding:2px 8px}.LeaderboardWrapper{height:100%;position:relative;overflow:hidden}.LeaderboardWrapper .Loading,.LeaderboardWrapper .Leaderboard,.LeaderboardWrapper .Bottom{width:calc(100% - 30px);padding:0 15px;scrollbar-width:thin}.LeaderboardWrapper .Loading,.LeaderboardWrapper .Leaderboard{padding-bottom:0}.LeaderboardWrapper .Bottom{position:absolute;bottom:0;background:linear-gradient(90deg, var(--emw--ingame-color-gray-purple50, rgba(35, 41, 119, 0.4980392157)) 0%, var(--emw--ingame-color-dark-purple50, rgba(59, 28, 117, 0.4980392157)) 100%);border-top:1px solid;border-image-source:linear-gradient(94.32deg, var(--emw--ingame-color-pth-primary1, #9500FF) 4.41%, var(--emw--ingame-color-pth-primary2, #232EC4) 113.86%);border-image-slice:1;backdrop-filter:blur(20px);opacity:0.91}.LeaderboardWrapper .Bottom .PlayerRank.Active{border-width:0;cursor:pointer;padding-right:18px;background:transparent}.LeaderboardWrapper .PlayerRank{overflow-anchor:auto;font-weight:bold;align-items:center;height:26px;gap:16px;padding:2px 8px;display:flex}.LeaderboardWrapper .PlayerRank.Hidden{display:none !important}.LeaderboardWrapper .PlayerRank.Active{background-clip:padding-box, border-box;background-origin:padding-box, border-box;border:1px solid transparent;border-radius:10px;background-image:linear-gradient(91deg, var(--emw--ingame-color-pth-primary4, #11153E) 4.41%, var(--emw--ingame-color-pth-primary4, #11153E) 113.86%), linear-gradient(91deg, var(--emw--ingame-color-pth-primary1, #9500FF) 4.41%, var(--emw--ingame-color-pth-primary2, #232EC4) 113.86%)}.LeaderboardWrapper .PlayerRank div{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.LeaderboardWrapper .PlayerRank .Rank{flex:1}.LeaderboardWrapper .PlayerRank .Name{flex:2;text-align:left}.LeaderboardWrapper .PlayerRank .Score{flex:1;font-weight:normal}.LeaderboardWrapper .PlayerRank .Prize{flex:4}.LeaderboardWrapper .Leaderboard{height:calc(99% - 25px) !important;overflow-y:auto;overflow-anchor:auto}.LeaderboardWrapper .Leaderboard .NoWinners{margin:30px auto;display:flex;flex-direction:column;gap:15px}.LeaderboardWrapper .Leaderboard .NoWinners .Title{font-weight:bold;font-size:medium}.LeaderboardWrapper .Leaderboard .NoWinners .Title,.LeaderboardWrapper .Leaderboard .NoWinners .Info{display:flex;align-items:center;flex-direction:column}";
1225
+ const casinoTournamentsIngameTableCss = ":host{display:block;height:100%}.Dark{color:var(--emw--ingame-color-text, #f5f8f6)}.Light{color:var(--emw--ingame-color-black, #0A0A17)}.Mobile.LeaderboardWrapper .Bottom .PlayerRank.Active{padding:2px 8px}.LeaderboardWrapper{height:100%;position:relative;overflow:hidden}.LeaderboardWrapper .Loading,.LeaderboardWrapper .Leaderboard,.LeaderboardWrapper .Bottom{width:calc(100% - 30px);padding:0 15px;scrollbar-width:thin}.LeaderboardWrapper .Loading,.LeaderboardWrapper .Leaderboard{padding-bottom:0}.LeaderboardWrapper .Bottom{position:absolute;bottom:0;background:linear-gradient(90deg, var(--emw--ingame-color-gray-purple50, rgba(35, 41, 119, 0.4980392157)) 0%, var(--emw--ingame-color-dark-purple50, rgba(59, 28, 117, 0.4980392157)) 100%);border-top:1px solid;border-image-source:linear-gradient(94.32deg, var(--emw--ingame-color-pth-primary1, #9500FF) 4.41%, var(--emw--ingame-color-pth-primary2, #232EC4) 113.86%);border-image-slice:1;backdrop-filter:blur(20px);opacity:0.91}.LeaderboardWrapper .Bottom .PlayerRank.Active{border-width:0;cursor:pointer;padding-right:18px;background:transparent}.LeaderboardWrapper .PlayerRank{overflow-anchor:auto;font-weight:bold;align-items:center;height:26px;gap:16px;padding:2px 8px;display:flex}.LeaderboardWrapper .PlayerRank.Hidden{display:none !important}.LeaderboardWrapper .PlayerRank.Active{background-clip:padding-box, border-box;background-origin:padding-box, border-box;border:1px solid transparent;border-radius:10px;background-image:linear-gradient(91deg, var(--emw--ingame-color-pth-primary4, #11153E) 4.41%, var(--emw--ingame-color-pth-primary4, #11153E) 113.86%), linear-gradient(91deg, var(--emw--ingame-color-pth-primary1, #9500FF) 4.41%, var(--emw--ingame-color-pth-primary2, #232EC4) 113.86%)}.LeaderboardWrapper .PlayerRank div{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.LeaderboardWrapper .PlayerRank .Rank{flex:1}.LeaderboardWrapper .PlayerRank .Name{flex:2;text-align:left}.LeaderboardWrapper .PlayerRank .Score{flex:1;font-weight:normal;text-align:right;overflow:visible;min-width:50px}.LeaderboardWrapper .PlayerRank .Prize{flex:4;overflow:hidden}.LeaderboardWrapper .Leaderboard{height:calc(100% - 2px) !important;overflow-y:auto;overflow-anchor:auto;touch-action:pan-y}.LeaderboardWrapper .Leaderboard .NoWinners{margin:30px auto;display:flex;flex-direction:column;gap:15px}.LeaderboardWrapper .Leaderboard .NoWinners .Title{font-weight:bold;font-size:medium}.LeaderboardWrapper .Leaderboard .NoWinners .Title,.LeaderboardWrapper .Leaderboard .NoWinners .Info{display:flex;align-items:center;flex-direction:column}";
1209
1226
  const CasinoTournamentsIngameTableStyle0 = casinoTournamentsIngameTableCss;
1210
1227
 
1211
1228
  const CasinoTournamentsIngameTable = class {
@@ -1222,9 +1239,11 @@ const CasinoTournamentsIngameTable = class {
1222
1239
  this.autoLocateCurrent = false;
1223
1240
  //Current player will not change the position when scroll current player up
1224
1241
  this.keepOnBottom = true;
1242
+ this.isPageRendering = false;
1225
1243
  this.mbSource = undefined;
1226
1244
  this.clientStyling = undefined;
1227
1245
  this.clientStylingUrl = undefined;
1246
+ this.translationUrl = '';
1228
1247
  this.tournamentId = undefined;
1229
1248
  this.endpoint = undefined;
1230
1249
  this.session = undefined;
@@ -1239,6 +1258,7 @@ const CasinoTournamentsIngameTable = class {
1239
1258
  this.isLoadingMore = false;
1240
1259
  this.isCurrentPlayerInview = true;
1241
1260
  this.isLoadingPrevious = false;
1261
+ this.scorefractiondigit = 2;
1242
1262
  }
1243
1263
  /**
1244
1264
  * oriArr:
@@ -1296,10 +1316,18 @@ const CasinoTournamentsIngameTable = class {
1296
1316
  return result;
1297
1317
  }
1298
1318
  onLeaderboardScroll(event) {
1299
- if (this.isLoadingPrevious || this.isLoadingMore) {
1319
+ event.stopPropagation();
1320
+ if (this.isLoadingPrevious || this.isLoadingMore || this.isPageRendering) {
1300
1321
  event.preventDefault();
1301
1322
  }
1302
1323
  }
1324
+ formatScore(score) {
1325
+ const _fractiondigit = Number(this.scorefractiondigit) || 2;
1326
+ return score.toLocaleString('en-US', {
1327
+ minimumFractionDigits: _fractiondigit,
1328
+ maximumFractionDigits: _fractiondigit
1329
+ });
1330
+ }
1303
1331
  async loadLeaderboardById() {
1304
1332
  if (this.abortController) {
1305
1333
  this.abortController.abort();
@@ -1322,10 +1350,12 @@ const CasinoTournamentsIngameTable = class {
1322
1350
  signal: this.abortController.signal
1323
1351
  };
1324
1352
  await fetch(url, options).then(res => res.json()).then(data => {
1353
+ var _a;
1325
1354
  const { item, items, total } = data;
1326
1355
  this.isCurrentPlayerRanked = !!item;
1327
1356
  if (this.isCurrentPlayerRanked) {
1328
1357
  this.currentUserData = item;
1358
+ this.currentUserData.formattedScore = this.formatScore(this.currentUserData.score);
1329
1359
  if (this.isLeaderboardLoading) {
1330
1360
  if (this.offset > 0) { //First load for current player
1331
1361
  this.scrollCurrentPlayerToMiddle();
@@ -1354,6 +1384,7 @@ const CasinoTournamentsIngameTable = class {
1354
1384
  this.total = total;
1355
1385
  this.leaderboardLoaded.emit({ item: this.currentUserData, leaderboardOffset: this.offset, isRanked: this.isCurrentPlayerRanked, totalRank: total });
1356
1386
  this.leaderboard = this.mergeSortedArrays(this.leaderboard, items, 'rank');
1387
+ (_a = this.leaderboard) === null || _a === void 0 ? void 0 : _a.forEach(i => i.formattedScore = this.formatScore(i.score));
1357
1388
  //Setup the observer for loadMore when scroll to top or bottom
1358
1389
  this.startScrollObersever();
1359
1390
  this.reStartUpSSEUpdater(url);
@@ -1414,6 +1445,7 @@ const CasinoTournamentsIngameTable = class {
1414
1445
  }
1415
1446
  }
1416
1447
  reStartUpSSEUpdater(url) {
1448
+ var _a;
1417
1449
  if (this.leaderboardUpdater) {
1418
1450
  this.leaderboardUpdater.close();
1419
1451
  this.leaderboardUpdater.removeEventListener('message', this.updateMessageHandler);
@@ -1421,7 +1453,7 @@ const CasinoTournamentsIngameTable = class {
1421
1453
  if (this.state !== 'Running') {
1422
1454
  return;
1423
1455
  }
1424
- url.searchParams.set("pagination", `offset=${this.leaderboard.length ? this.leaderboard[0].rank - 1 : 0},limit=${this.leaderboard.length || this.limit}`);
1456
+ url.searchParams.set("pagination", `offset=${this.leaderboard.length ? this.leaderboard[0].rank - 1 : 0},limit=${((_a = this.leaderboard) === null || _a === void 0 ? void 0 : _a.length) > this.limit ? this.leaderboard.length : this.limit}`);
1425
1457
  let endpointUrl = new URL(`${this.endpoint}/v1/tournaments/${this.tournamentId}/leaderboard/updates?${url.searchParams.toString()}`);
1426
1458
  const options = { headers: { 'accept': 'text/event-stream', 'X-SessionId': this.session } };
1427
1459
  this.leaderboardUpdater = new eventsource.exports.EventSourcePolyfill(endpointUrl, options);
@@ -1436,11 +1468,13 @@ const CasinoTournamentsIngameTable = class {
1436
1468
  const { item, items, total } = data;
1437
1469
  if (item || this.currentUserData) {
1438
1470
  this.currentUserData = item ? item : this.currentUserData;
1439
- this.leaderboardLoaded.emit({ item, isRanked: !!item, totalRank: total });
1471
+ this.currentUserData.formattedScore = this.formatScore(this.currentUserData.score);
1440
1472
  }
1473
+ this.leaderboardLoaded.emit({ item: this.currentUserData ? this.currentUserData : null, isRanked: !!item, totalRank: total });
1441
1474
  items.forEach(e => {
1442
1475
  const rankIdx = this.leaderboard.findIndex(rank => rank.rank === e.rank);
1443
1476
  rankIdx >= 0 && (this.leaderboard[rankIdx] = e);
1477
+ e.formattedScore = this.formatScore(e.score);
1444
1478
  if (rankIdx < 0) {
1445
1479
  this.leaderboard.push(e);
1446
1480
  }
@@ -1486,7 +1520,7 @@ const CasinoTournamentsIngameTable = class {
1486
1520
  }
1487
1521
  setTimeout(() => {
1488
1522
  var _a;
1489
- this.topRankToObserved = (_a = this.tableListEle) === null || _a === void 0 ? void 0 : _a.querySelector(`#Rank_0`);
1523
+ this.topRankToObserved = (_a = this.tableListEle) === null || _a === void 0 ? void 0 : _a.querySelector(`#Rank_1`);
1490
1524
  this.topRankToObserved && this.topMoreObserver.observe(this.topRankToObserved);
1491
1525
  }, this.timeOrder2); //2000
1492
1526
  }
@@ -1578,7 +1612,7 @@ const CasinoTournamentsIngameTable = class {
1578
1612
  this.offset = 0;
1579
1613
  this.leaderboard = [];
1580
1614
  }
1581
- componentWillLoad() {
1615
+ async componentWillLoad() {
1582
1616
  switch (this.state) {
1583
1617
  case 'Running':
1584
1618
  this.loadLeaderboardById().catch(console.error);
@@ -1588,24 +1622,27 @@ const CasinoTournamentsIngameTable = class {
1588
1622
  this.resetLeaderboardStatus();
1589
1623
  break;
1590
1624
  }
1625
+ if (this.translationUrl.length > 2) {
1626
+ await getTranslations(this.translationUrl);
1627
+ }
1591
1628
  }
1592
1629
  render() {
1593
1630
  var _a;
1594
- return index.h("div", { key: '0ea2213099af1f2e39cf38e636a181ae0b8111df', class: `LeaderboardWrapper ${this.theme} ${this.isMobile ? 'Mobile' : ''}`, ref: (el) => (this.stylingContainer = el) }, this.isLeaderboardLoading ? index.h("div", { class: 'Loading' }, " ", translate('loading', this.language), " ") :
1631
+ return index.h("div", { key: '26150cc5aa004ca610b2c849e2549a3f584a8d60', class: `LeaderboardWrapper ${this.theme} ${this.isMobile ? 'Mobile' : ''}`, ref: (el) => (this.stylingContainer = el) }, this.isLeaderboardLoading ? index.h("div", { class: 'Loading' }, " ", translate('loading', this.language), " ") :
1595
1632
  [
1596
1633
  index.h("div", null, (!this.isCurrentPlayerInview && this.isCurrentOnTop) && this.currentUserData &&
1597
- index.h("div", { class: `PlayerRank Active` }, index.h("div", { class: 'Rank' }, this.currentUserData.rank === 0 ? '--' : this.currentUserData.rank), index.h("div", { class: 'Name' }, translate('you', this.language)), index.h("div", { class: 'Score' }, this.currentUserData.score), index.h("div", { class: 'Prize' }, this.currentUserData.prizeName))),
1634
+ index.h("div", { class: `PlayerRank Active` }, index.h("div", { class: 'Rank' }, this.currentUserData.rank === 0 ? '--' : this.currentUserData.rank), index.h("div", { class: 'Name' }, translate('you', this.language)), index.h("div", { class: 'Score' }, this.currentUserData.formattedScore), index.h("div", { class: 'Prize' }, this.currentUserData.prizeName))),
1598
1635
  this.isLoadingPrevious && index.h("div", null, "Loading"),
1599
1636
  index.h("div", { class: 'Leaderboard', onScroll: this.onLeaderboardScroll.bind(this), onTouchMove: this.onLeaderboardScroll.bind(this), ref: (el) => (this.tableListEle = el) }, !((_a = this.leaderboard) === null || _a === void 0 ? void 0 : _a.length)
1600
1637
  ? index.h("div", { class: 'NoWinners' }, index.h("div", { class: 'Title' }, " ", translate('noLeaderboard', this.language), " "), index.h("div", { class: 'Info' }, " ", translate('positionsWillShow', this.language), " "))
1601
1638
  : this.leaderboard.map((item, idx) => {
1602
1639
  var _a, _b;
1603
- return index.h("div", { id: `Rank_${idx}`, class: `PlayerRank ${this.isLoadingPrevious && item.rank < this.preTopRank ? 'Hidden' : ''} ${((_a = this.currentUserData) === null || _a === void 0 ? void 0 : _a.id) === item.id ? 'Active' : ''}` }, index.h("div", { class: 'Rank' }, item.rank === 0 ? '' : item.rank), index.h("div", { class: 'Name' }, (((_b = this.currentUserData) === null || _b === void 0 ? void 0 : _b.id) === item.id) ? translate('you', this.language) : item.shortName), index.h("div", { class: 'Score' }, item.score), index.h("div", { class: 'Prize' }, item.prizeName));
1640
+ return index.h("div", { id: `Rank_${idx}`, class: `PlayerRank ${this.isLoadingPrevious && item.rank < this.preTopRank ? 'Hidden' : ''} ${((_a = this.currentUserData) === null || _a === void 0 ? void 0 : _a.id) === item.id ? 'Active' : ''}` }, index.h("div", { class: 'Rank' }, item.rank === 0 ? '' : item.rank), index.h("div", { class: 'Name' }, (((_b = this.currentUserData) === null || _b === void 0 ? void 0 : _b.id) === item.id) ? translate('you', this.language) : item.shortName), index.h("div", { class: 'Score' }, item.formattedScore), index.h("div", { class: 'Prize' }, item.prizeName));
1604
1641
  })),
1605
1642
  this.isLoadingMore && !this.isLoadingPrevious && index.h("div", null, "Loading"),
1606
1643
  !this.isCurrentPlayerInview &&
1607
1644
  index.h("div", { class: !this.isCurrentOnTop ? 'Bottom' : '' }, !this.isCurrentOnTop && this.currentUserData &&
1608
- index.h("div", { class: `PlayerRank Active`, onClick: this.goToCurrentPlayerPage.bind(this) }, index.h("div", { class: 'Rank' }, this.currentUserData.rank === 0 ? '--' : this.currentUserData.rank), index.h("div", { class: 'Name' }, translate('you', this.language)), index.h("div", { class: 'Score' }, this.currentUserData.score), index.h("div", { class: 'Prize' }, this.currentUserData.prizeName)))
1645
+ index.h("div", { class: `PlayerRank Active`, onClick: this.goToCurrentPlayerPage.bind(this) }, index.h("div", { class: 'Rank' }, this.currentUserData.rank === 0 ? '--' : this.currentUserData.rank), index.h("div", { class: 'Name' }, translate('you', this.language)), index.h("div", { class: 'Score' }, this.currentUserData.formattedScore), index.h("div", { class: 'Prize' }, this.currentUserData.prizeName)))
1609
1646
  ]);
1610
1647
  }
1611
1648
  handleClientStylingChange(newValue, oldValue) {
@@ -1623,6 +1660,15 @@ const CasinoTournamentsIngameTable = class {
1623
1660
  setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
1624
1661
  }
1625
1662
  }
1663
+ componentWillRender() {
1664
+ this.isPageRendering = true;
1665
+ }
1666
+ componentDidRender() {
1667
+ this.isPageRendering = false;
1668
+ }
1669
+ handleNewTranslations() {
1670
+ getTranslations(this.translationUrl);
1671
+ }
1626
1672
  componentDidLoad() {
1627
1673
  if (this.stylingContainer) {
1628
1674
  if (this.mbSource)
@@ -1633,13 +1679,16 @@ const CasinoTournamentsIngameTable = class {
1633
1679
  setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
1634
1680
  }
1635
1681
  this.isMobile = getDevice() !== 'PC';
1682
+ this.stylingContainer.addEventListener('touchmove', (e) => {
1683
+ e.stopPropagation();
1684
+ e.preventDefault();
1685
+ }, { passive: false });
1636
1686
  }
1637
1687
  disconnectedCallback() {
1638
1688
  if (this.abortController) {
1639
1689
  this.abortController.abort('Disconnected callback');
1640
1690
  }
1641
1691
  this.stylingSubscription && this.stylingSubscription.unsubscribe();
1642
- this.leaderboardUpdater && this.leaderboardUpdater.close();
1643
1692
  if (this.leaderboardUpdater) {
1644
1693
  this.leaderboardUpdater.close();
1645
1694
  this.leaderboardUpdater.removeEventListener('message', this.updateMessageHandler);
@@ -1659,7 +1708,8 @@ const CasinoTournamentsIngameTable = class {
1659
1708
  "language": ["onTournamentIdChanged"],
1660
1709
  "clientStyling": ["handleClientStylingChange"],
1661
1710
  "clientStylingUrl": ["handleClientStylingUrlChange"],
1662
- "mbSource": ["handleMbSourceChange"]
1711
+ "mbSource": ["handleMbSourceChange"],
1712
+ "translationUrl": ["handleNewTranslations"]
1663
1713
  }; }
1664
1714
  };
1665
1715
  CasinoTournamentsIngameTable.style = CasinoTournamentsIngameTableStyle0;
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const casinoTournamentsIngameTable = require('./casino-tournaments-ingame-table-58ce40fc.js');
6
- require('./index-3f69085c.js');
5
+ const casinoTournamentsIngameTable = require('./casino-tournaments-ingame-table-5897b13b.js');
6
+ require('./index-666544d1.js');
7
7
 
8
8
 
9
9
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-3f69085c.js');
5
+ const index = require('./index-666544d1.js');
6
6
  const appGlobals = require('./app-globals-3a1e7e63.js');
7
7
 
8
8
  /*
@@ -19,7 +19,7 @@ var patchBrowser = () => {
19
19
 
20
20
  patchBrowser().then(async (options) => {
21
21
  await appGlobals.globalScripts();
22
- return index.bootstrapLazy([["casino-tournaments-ingame-table.cjs",[[1,"casino-tournaments-ingame-table",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"tournamentId":[513,"tournament-id"],"endpoint":[513],"session":[513],"language":[513],"limit":[514],"theme":[513],"state":[513],"offset":[32],"currentUserData":[32],"leaderboard":[32],"isLeaderboardLoading":[32],"isLoadingMore":[32],"isCurrentPlayerInview":[32],"isLoadingPrevious":[32]},null,{"state":["onStateChanged"],"tournamentId":["onTournamentIdChanged"],"endpoint":["onTournamentIdChanged"],"session":["onTournamentIdChanged"],"language":["onTournamentIdChanged"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
22
+ return index.bootstrapLazy([["casino-tournaments-ingame-table.cjs",[[1,"casino-tournaments-ingame-table",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"tournamentId":[513,"tournament-id"],"endpoint":[513],"session":[513],"language":[513],"limit":[514],"theme":[513],"state":[513],"offset":[32],"currentUserData":[32],"leaderboard":[32],"isLeaderboardLoading":[32],"isLoadingMore":[32],"isCurrentPlayerInview":[32],"isLoadingPrevious":[32],"scorefractiondigit":[32]},null,{"state":["onStateChanged"],"tournamentId":["onTournamentIdChanged"],"endpoint":["onTournamentIdChanged"],"session":["onTournamentIdChanged"],"language":["onTournamentIdChanged"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"translationUrl":["handleNewTranslations"]}]]]], options);
23
23
  });
24
24
 
25
25
  exports.setNonce = index.setNonce;
@@ -21,7 +21,7 @@ function _interopNamespace(e) {
21
21
  }
22
22
 
23
23
  const NAMESPACE = 'casino-tournaments-ingame-table';
24
- const BUILD = /* casino-tournaments-ingame-table */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: false, propMutable: false, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: true };
24
+ const BUILD = /* casino-tournaments-ingame-table */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: true, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: false, propMutable: false, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: true };
25
25
 
26
26
  /*
27
27
  Stencil Client Platform v4.19.2 | MIT Licensed | https://stenciljs.com
@@ -740,6 +740,9 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
740
740
  maybePromise = safeCall(instance, "componentWillLoad");
741
741
  }
742
742
  }
743
+ {
744
+ maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender"));
745
+ }
743
746
  endSchedule();
744
747
  return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
745
748
  };
@@ -805,6 +808,9 @@ var postUpdateComponent = (hostRef) => {
805
808
  const endPostUpdate = createTime("postUpdate", tagName);
806
809
  const instance = hostRef.$lazyInstance$ ;
807
810
  const ancestorComponent = hostRef.$ancestorComponent$;
811
+ {
812
+ safeCall(instance, "componentDidRender");
813
+ }
808
814
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
809
815
  hostRef.$flags$ |= 64 /* hasLoadedComponent */;
810
816
  {
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const casinoTournamentsIngameTable = require('./casino-tournaments-ingame-table-58ce40fc.js');
6
- require('./index-3f69085c.js');
5
+ const casinoTournamentsIngameTable = require('./casino-tournaments-ingame-table-5897b13b.js');
6
+ require('./index-666544d1.js');
7
7
 
8
8
 
9
9
 
@@ -2,13 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-3f69085c.js');
5
+ const index = require('./index-666544d1.js');
6
6
  const appGlobals = require('./app-globals-3a1e7e63.js');
7
7
 
8
8
  const defineCustomElements = async (win, options) => {
9
9
  if (typeof window === 'undefined') return undefined;
10
10
  await appGlobals.globalScripts();
11
- return index.bootstrapLazy([["casino-tournaments-ingame-table.cjs",[[1,"casino-tournaments-ingame-table",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"tournamentId":[513,"tournament-id"],"endpoint":[513],"session":[513],"language":[513],"limit":[514],"theme":[513],"state":[513],"offset":[32],"currentUserData":[32],"leaderboard":[32],"isLeaderboardLoading":[32],"isLoadingMore":[32],"isCurrentPlayerInview":[32],"isLoadingPrevious":[32]},null,{"state":["onStateChanged"],"tournamentId":["onTournamentIdChanged"],"endpoint":["onTournamentIdChanged"],"session":["onTournamentIdChanged"],"language":["onTournamentIdChanged"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
11
+ return index.bootstrapLazy([["casino-tournaments-ingame-table.cjs",[[1,"casino-tournaments-ingame-table",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"tournamentId":[513,"tournament-id"],"endpoint":[513],"session":[513],"language":[513],"limit":[514],"theme":[513],"state":[513],"offset":[32],"currentUserData":[32],"leaderboard":[32],"isLeaderboardLoading":[32],"isLoadingMore":[32],"isCurrentPlayerInview":[32],"isLoadingPrevious":[32],"scorefractiondigit":[32]},null,{"state":["onStateChanged"],"tournamentId":["onTournamentIdChanged"],"endpoint":["onTournamentIdChanged"],"session":["onTournamentIdChanged"],"language":["onTournamentIdChanged"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"translationUrl":["handleNewTranslations"]}]]]], options);
12
12
  };
13
13
 
14
14
  exports.setNonce = index.setNonce;
@@ -78,14 +78,19 @@
78
78
  .LeaderboardWrapper .PlayerRank .Score {
79
79
  flex: 1;
80
80
  font-weight: normal;
81
+ text-align: right;
82
+ overflow: visible;
83
+ min-width: 50px;
81
84
  }
82
85
  .LeaderboardWrapper .PlayerRank .Prize {
83
86
  flex: 4;
87
+ overflow: hidden;
84
88
  }
85
89
  .LeaderboardWrapper .Leaderboard {
86
- height: calc(99% - 25px) !important;
90
+ height: calc(100% - 2px) !important;
87
91
  overflow-y: auto;
88
92
  overflow-anchor: auto;
93
+ touch-action: pan-y;
89
94
  }
90
95
  .LeaderboardWrapper .Leaderboard .NoWinners {
91
96
  margin: 30px auto;