@everymatrix/casino-tournament-slider 1.46.0 → 1.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{p as e,b as t}from"./p-c541e3cd.js";export{s as setNonce}from"./p-c541e3cd.js";import{g as i}from"./p-e1255160.js";(()=>{const t=import.meta.url,i={};return""!==t&&(i.resourcesUrl=new URL(".",t).href),e(i)})().then((async e=>(await i(),t([["p-01da553f",[[1,"casino-tournament-slider",{useEvent:[1,"use-event"],endpoint:[1],tournamentId:[1,"tournament-id"],session:[1],language:[1],gamesLimit:[2,"games-limit"],offset:[2],slideNumber:[2,"slide-number"],slideShow:[2,"slide-show"],clientStyling:[1,"client-styling"],clientStylingUrl:[1,"client-styling-url"],showTitle:[4,"show-title"],limitStylingAppends:[32],games:[32],hover:[32],hoverIndex:[32]},[[8,"getTournamentInfoCompleted","todoCompletedHandler"]]],[1,"general-slider",{slideNumber:[2,"slide-number"],slideShow:[2,"slide-show"],showArrow:[4,"show-arrow"],showButton:[4,"show-button"],autoSlide:[4,"auto-slide"],loopTime:[2,"loop-time"],autoItemHeight:[4,"auto-item-height"],clientStyling:[1,"client-styling"],clientStylingUrl:[1,"client-styling-url"],currentSlideNumber:[32],slidesCount:[32],limitStylingAppends:[32]}]]]],e))));
1
+ import{p as e,b as t}from"./p-c541e3cd.js";export{s as setNonce}from"./p-c541e3cd.js";import{g as i}from"./p-e1255160.js";(()=>{const t=import.meta.url,i={};return""!==t&&(i.resourcesUrl=new URL(".",t).href),e(i)})().then((async e=>(await i(),t([["p-74013ce2",[[1,"casino-tournament-slider",{useEvent:[1,"use-event"],endpoint:[1],tournamentId:[1,"tournament-id"],session:[1],language:[1],gamesLimit:[2,"games-limit"],offset:[2],slideNumber:[2,"slide-number"],slideShow:[2,"slide-show"],clientStyling:[1,"client-styling"],clientStylingUrl:[1,"client-styling-url"],showTitle:[4,"show-title"],limitStylingAppends:[32],games:[32],hover:[32],hoverIndex:[32]},[[8,"getTournamentInfoCompleted","todoCompletedHandler"]]],[1,"general-slider",{slideNumber:[2,"slide-number"],slideShow:[2,"slide-show"],showArrow:[4,"show-arrow"],showButton:[4,"show-button"],autoSlide:[4,"auto-slide"],loopTime:[2,"loop-time"],autoItemHeight:[4,"auto-item-height"],clientStyling:[1,"client-styling"],clientStylingUrl:[1,"client-styling-url"],currentPage:[2,"current-page"],currentSlideNumber:[32],slidesCount:[32],limitStylingAppends:[32]}]]]],e))));
@@ -0,0 +1 @@
1
+ import{r as t,h as i,g as s}from"./p-c541e3cd.js";const e={en:{playNow:"Play now",sliderTitle:"Participanting games"},"zh-hk":{playNow:"现在播放"},fr:{playNow:"Joue maintenant"},ro:{playNow:"Joaca acum"},hu:{playNow:"Játsszon most"},tr:{playNow:"Şimdi oyna"},el:{playNow:"Παίξε τώρα"},es:{playNow:"Jugar Ya"},pt:{playNow:"Jogue agora"},hr:{playNow:"IGRAJ SADA"}},h=(t,i)=>{var s,h;return(null===(s=e[i])||void 0===s?void 0:s[t])||(null===(h=e.en)||void 0===h?void 0:h[t])},o=class{constructor(i){t(this,i),this.enter=t=>{this.hover=!0,this.hoverIndex=t},this.leave=()=>{this.hover=!1,this.hoverIndex=-1},this.gameClicked=t=>{window.postMessage({type:"TournamentGameAction",gameId:t.id,name:t.name},window.location.href)},this.useEvent=void 0,this.endpoint=void 0,this.tournamentId=void 0,this.session=void 0,this.language=void 0,this.gamesLimit=30,this.offset=0,this.slideNumber=3,this.slideShow=3,this.clientStyling="",this.clientStylingUrl="",this.showTitle=!1,this.limitStylingAppends=!1,this.games=void 0,this.hover=void 0,this.hoverIndex=void 0}todoCompletedHandler(t){if(t.detail&&this.useEvent){if(!t.detail.games)return;this.games=t.detail.games.items}}getTournamentInfo(){let t=new URL(this.endpoint+`/v1/tournaments/${this.tournamentId}`),i=new Headers;t.searchParams.append("expand","games"),t.searchParams.append("language",this.language),t.searchParams.append("pagination",`games(limit=${this.gamesLimit},offset=${this.offset})`),t.searchParams.append("fields","games(id,name,thumbnail)"),this.session&&i.append("X-SessionId",this.session),fetch(t.href,{method:"GET",headers:i}).then((t=>t.json())).then((t=>{this.games=t.item.games.items}))}componentWillLoad(){!this.useEvent&&this.endpoint&&this.tournamentId&&this.getTournamentInfo()}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}setClientStyling(){const t=new CSSStyleSheet;t.replace(this.clientStyling),this.host.shadowRoot.adoptedStyleSheets=[...this.host.shadowRoot.adoptedStyleSheets,t]}setClientStylingURL(){let t=new URL(this.clientStylingUrl);fetch(t.href).then((t=>t.text())).then((t=>{const i=new CSSStyleSheet;i.replace(t),this.host.shadowRoot.adoptedStyleSheets=[...this.host.shadowRoot.adoptedStyleSheets,i]}))}render(){return i("div",{key:"f16db0fd04952457c6e637e34e3295de9f2ab00e",class:"TournamentSliderWrap"},i("div",{key:"246d6bae2b600ebc97e8cfbdf707ae284f0cef20",class:"TournamentSlider"},this.showTitle&&this.games&&i("div",{key:"d9760b0b053aa103a8bb1d24e860d83225aba17b",class:"SliderTitle"},i("svg",{key:"47e2a1441fa2eb68510eb9a775ff14e6b5221afd",xmlns:"http://www.w3.org/2000/svg",width:"21",height:"25",viewBox:"0 0 21 25",fill:"none"},i("path",{key:"566c04c19cbd24b79fba1c87f9872e28689178e3",d:"M6.1774 22.1728C6.36493 22.2725 6.56274 22.0566 6.44793 21.8779C5.82475 20.908 5.23463 19.2759 6.17483 17.174C7.74273 13.6689 8.6968 11.8535 8.6968 11.8535C8.6968 11.8535 9.20426 13.9721 10.5799 15.8558C11.9038 17.6687 12.6285 19.9488 11.4602 21.8482C11.3506 22.0265 11.5439 22.2368 11.7302 22.1415C13.1763 21.4017 14.7983 19.9179 14.9813 16.965C15.0488 16.0627 14.9476 14.7995 14.4416 13.2054C13.791 11.185 12.9911 10.2423 12.5283 9.83741C12.3899 9.71629 12.1746 9.82363 12.1859 10.0072C12.3208 12.1872 11.5007 12.7404 11.0339 11.4937C10.8474 10.9957 10.7387 10.1344 10.7387 9.08558C10.7387 7.3394 10.2321 5.54188 9.1152 4.0812C8.82475 3.70134 8.4849 3.3464 8.09498 3.04372C7.95382 2.93411 7.74919 3.04428 7.76212 3.22252C7.84788 4.40628 7.77018 7.79884 4.79383 11.8519C2.09515 15.6115 3.14088 18.4989 3.51195 19.281C4.2214 20.7791 5.21098 21.6589 6.1774 22.1728Z",fill:"white"})),i("span",{key:"6a6e5fc1e888de1ace0b0c577cc96b98c55a65bd",class:"Title"},h("sliderTitle",this.language))),i("div",{key:"0d18223f0d9603ba8e94a87725bfc52592f5a120",class:"Items"},this.games&&i("general-slider",{key:"d56409e9730aeae803bb2a54951d9ba0912dbf51","slide-number":this.slideNumber,"slide-show":this.slideShow},this.games&&this.games.map(((t,s)=>i("li",{class:"Item",onMouseEnter:()=>this.enter(s),onMouseLeave:()=>this.leave()},i("span",{class:"PlayNowButton "+(this.hoverIndex==s?"ItemHover":""),onClick:()=>{this.gameClicked(t)}},h("playNow",this.language)),i("img",{class:"Img",src:t.thumbnail,alt:t.name,title:t.name}))))))))}get host(){return s(this)}};o.style=":host{display:block}.Item{color:white;display:flex;justify-content:center;align-items:center;font-weight:bold;font-size:10rem;user-select:none;overflow:hidden}.Item .Img{width:100%;height:100%}.PlayNowButton{position:absolute;background:var(--emfe-w-color-green, #48952a);display:block;box-sizing:border-box;padding:0.8rem 0.5rem;color:var(--emfe-w-color-white, #FFFFFF);text-transform:uppercase;text-align:center;font-weight:600;font-size:0.7rem;cursor:pointer;transition:opacity 0.4s linear;opacity:0;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.ItemHover{opacity:1}.Items .Item:first-child{margin-left:0}.Items .Item:last-child{margin-right:0}.SliderTitle{display:flex;align-items:center;padding:6px 0;gap:11px}.Title{color:#fff;font-size:14px;font-weight:600}";const a=class{constructor(i){t(this,i),this.slides=null,this.slideWidth=0,this.controls={Prev:null,Next:null},this.xDown=null,this.yDown=null,this.slideNumber=3,this.slideShow=3,this.showArrow=!0,this.showButton=!1,this.autoSlide=!1,this.loopTime=1,this.autoItemHeight=!1,this.clientStyling="",this.clientStylingUrl="",this.currentPage=0,this.currentSlideNumber=0,this.slidesCount=0,this.limitStylingAppends=!1}slide(t){let i=0;i=t?this.currentSlideNumber+this.slideNumber:this.currentSlideNumber-this.slideNumber,i<0||i>=this.slidesCount||(this.currentSlideNumber=i,this.currentPage=this.currentSlideNumber/this.slideNumber,this.updateListStyle())}slideTo(t){this.currentSlideNumber=t*this.slideNumber,this.currentPage=t,this.updateListStyle()}updateControls(){this.switchControl("Prev",0!==this.currentSlideNumber),this.switchControl("Next",this.currentSlideNumber!==this.slidesCount-this.slideShow)}switchControl(t,i){this.controls[t]&&(this.controls[t].disabled=!i)}componentWillLoad(){this.slideNumber||(this.slideNumber=1),this.slideShow||(this.slideShow=1),0!==this.currentPage&&this.slideTo(this.currentPage)}componentDidLoad(){this.slides=this.slotEl.assignedElements(),this.slidesCount=this.slides.length;for(let t in this.controls)this.controls[t]=this.el.shadowRoot.querySelector(".Button"+t);this.autoSlide&&this.setSlideAutoInterval(),!this.limitStylingAppends&&this.el.shadowRoot&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}componentDidRender(){this.slides&&(this.slideWidth=this.slides[0].offsetWidth),this.el.addEventListener("touchstart",this.handleTouchStart.bind(this),{passive:!0}),this.el.addEventListener("touchmove",this.handleTouchMove.bind(this),{passive:!0}),this.updateListStyle(),!this.limitStylingAppends&&this.el.shadowRoot&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}updateListStyle(){this.autoItemHeight&&null!==this.slides&&this.slides.forEach(((t,i)=>{i>=this.currentPage*this.slideNumber&&i<(this.currentPage+1)*this.slideNumber?t.classList.remove("hide"):t.classList.add("hide")}))}disconnectedCallback(){this.el.removeEventListener("touchstart",this.handleTouchStart),this.el.removeEventListener("touchmove",this.handleTouchMove)}handleTouchStart(t){const i=this.getTouches(t)[0];this.xDown=i.clientX,this.yDown=i.clientY,clearInterval(this.sliderInterval)}getTouches(t){return t.touches||t.originalEvent.touches}handleTouchMove(t){if(!this.xDown||!this.yDown)return;let i=this.xDown-t.touches[0].clientX,s=this.yDown-t.touches[0].clientY;Math.abs(i)>Math.abs(s)&&this.slide(i>0),this.xDown=null,this.yDown=null,this.autoSlide&&this.setSlideAutoInterval()}setSlideAutoInterval(){0!=this.loopTime&&(clearInterval(this.sliderInterval),this.sliderInterval=setInterval((()=>{this.slideTo(this.currentPage+1<this.slidesCount/this.slideNumber?this.currentPage+1:0)}),1e3*Number(this.loopTime)))}componentDidUpdate(){this.sliderEl.style.transform=`translateX(${this.currentSlideNumber*this.slideWidth*-1}px)`,this.updateControls()}switchLoopStatus(t){this.autoSlide&&this.loopTime>0&&(t?clearInterval(this.sliderInterval):this.setSlideAutoInterval())}setClientStyling(){const t=new CSSStyleSheet;t.replace(this.clientStyling),this.el.shadowRoot.adoptedStyleSheets=[...this.el.shadowRoot.adoptedStyleSheets,t]}setClientStylingURL(){let t=new URL(this.clientStylingUrl);fetch(t.href).then((t=>t.text())).then((t=>{const i=new CSSStyleSheet;i.replace(t),this.el.shadowRoot.adoptedStyleSheets=[...this.el.shadowRoot.adoptedStyleSheets,i]}))}render(){return i("div",{key:"3a78acee0094c90ebb20c7e8435088b7b2019f9f",class:"GeneralSlider"},i("div",{key:"fbf26d5ab557a209fb9cacc5823f74690b211967",class:"Slider"},i("ul",{key:"8a4dd8156eff50ec96960026e43721db41b80628",class:`SliderList Col-${this.slideShow}`,part:"SliderList",onMouseEnter:this.switchLoopStatus.bind(this,!0),onMouseLeave:this.switchLoopStatus.bind(this,!1),ref:t=>this.sliderEl=t},i("slot",{key:"a8bf872b513d03fb0bf171c76183673cda291456",ref:t=>this.slotEl=t}))),this.showButton&&this.slidesCount>0&&i("div",{key:"9346a66e8b64d27a128707e20eb2a36fea43741c",class:"PageButtons",part:"PageButtons"},[...Array(this.slidesCount/this.slideNumber)].map(((t,s)=>i("div",{class:"PageButton "+(this.currentPage==s?"active":""),title:`page${s}`,onClick:this.slideTo.bind(this,s),onMouseEnter:this.switchLoopStatus.bind(this,!0),onMouseLeave:this.switchLoopStatus.bind(this,!1)}," ")))),this.showArrow&&i("div",{key:"559e1f4b1afd91f2290d5cf96e6a4ab2e3a4c3af",class:"ArrowButtons"},i("button",{key:"a2793999d32183b00de551ebe10e9a35480637ea",type:"button",class:"Button ButtonNext",onClick:this.slide.bind(this,!0),onMouseEnter:this.switchLoopStatus.bind(this,!0),onMouseLeave:this.switchLoopStatus.bind(this,!1)},">"),i("button",{key:"b362f458df805531cafb933e1418fc9edac883a3",type:"button",class:"Button ButtonPrev",onClick:this.slide.bind(this,!1),onMouseEnter:this.switchLoopStatus.bind(this,!0),onMouseLeave:this.switchLoopStatus.bind(this,!1)},"<")))}get el(){return s(this)}};a.style=":host{display:block}.GeneralSlider{position:relative}.Slider{position:relative;width:100%;margin:0 auto;overflow:hidden}.SliderList{display:flex;margin:0;padding:0;list-style:none;transition:transform 0.5s ease-in-out}::slotted(li){flex:1 0 auto;width:100%;margin:auto}::slotted(li.hide){visibility:hidden;height:0;transition-delay:500ms}.Col-2 ::slotted(li){flex:2 0 auto;width:50%}.Col-3 ::slotted(li){flex:3 0 auto;width:33.3333333333%}.Col-4 ::slotted(li){flex:4 0 auto;width:25%}.Col-5 ::slotted(li){flex:5 0 auto;width:20%}.Col-6 ::slotted(li){flex:6 0 auto;width:16.6666666667%}.Col-7 ::slotted(li){flex:7 0 auto;width:14.2857142857%}.Col-8 ::slotted(li){flex:8 0 auto;width:12.5%}.Col-9 ::slotted(li){flex:9 0 auto;width:11.1111111111%}.Col-10 ::slotted(li){flex:10 0 auto;width:10%}.Col-11 ::slotted(li){flex:11 0 auto;width:9.0909090909%}.Col-12 ::slotted(li){flex:12 0 auto;width:8.3333333333%}.Button{position:absolute;z-index:1;top:calc(50% - 32px);padding:20px;font-size:20px;line-height:20px;opacity:0.5;border:none;background:var(--emfe-w-color-contrast, #07072A);color:var(--emfe-w-color-white, #FFFFFF);cursor:pointer}.Button:hover{opacity:1;transition:opacity 0.5s ease-in-out}.Button[disabled],.Button[disabled]:hover{color:var(--emfe-w-color-gray-150, #828282);opacity:0.25}.Button.ButtonNext{right:0}.PageButtons{display:flex;gap:4px;margin-top:8px}.PageButton{width:15px;height:4px;border-radius:4px;background-color:var(--emfe-w-tournament-color-primary, #0072ed);opacity:0.2;cursor:pointer;float:right}.PageButton.active{width:45px;opacity:1}";export{o as casino_tournament_slider,a as general_slider}
@@ -19,7 +19,7 @@ var patchBrowser = () => {
19
19
 
20
20
  patchBrowser().then(async (options) => {
21
21
  await appGlobals.globalScripts();
22
- return index.bootstrapLazy([["casino-tournament-slider_2.cjs",[[1,"casino-tournament-slider",{"useEvent":[1,"use-event"],"endpoint":[1],"tournamentId":[1,"tournament-id"],"session":[1],"language":[1],"gamesLimit":[2,"games-limit"],"offset":[2],"slideNumber":[2,"slide-number"],"slideShow":[2,"slide-show"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"showTitle":[4,"show-title"],"limitStylingAppends":[32],"games":[32],"hover":[32],"hoverIndex":[32]},[[8,"getTournamentInfoCompleted","todoCompletedHandler"]]],[1,"general-slider",{"slideNumber":[2,"slide-number"],"slideShow":[2,"slide-show"],"showArrow":[4,"show-arrow"],"showButton":[4,"show-button"],"autoSlide":[4,"auto-slide"],"loopTime":[2,"loop-time"],"autoItemHeight":[4,"auto-item-height"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"currentSlideNumber":[32],"slidesCount":[32],"limitStylingAppends":[32]}]]]], options);
22
+ return index.bootstrapLazy([["casino-tournament-slider_2.cjs",[[1,"casino-tournament-slider",{"useEvent":[1,"use-event"],"endpoint":[1],"tournamentId":[1,"tournament-id"],"session":[1],"language":[1],"gamesLimit":[2,"games-limit"],"offset":[2],"slideNumber":[2,"slide-number"],"slideShow":[2,"slide-show"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"showTitle":[4,"show-title"],"limitStylingAppends":[32],"games":[32],"hover":[32],"hoverIndex":[32]},[[8,"getTournamentInfoCompleted","todoCompletedHandler"]]],[1,"general-slider",{"slideNumber":[2,"slide-number"],"slideShow":[2,"slide-show"],"showArrow":[4,"show-arrow"],"showButton":[4,"show-button"],"autoSlide":[4,"auto-slide"],"loopTime":[2,"loop-time"],"autoItemHeight":[4,"auto-item-height"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"currentPage":[2,"current-page"],"currentSlideNumber":[32],"slidesCount":[32],"limitStylingAppends":[32]}]]]], options);
23
23
  });
24
24
 
25
25
  exports.setNonce = index.setNonce;
@@ -156,7 +156,6 @@ const GeneralSlider = class {
156
156
  index.registerInstance(this, hostRef);
157
157
  this.slides = null;
158
158
  this.slideWidth = 0;
159
- this.currentPage = 0;
160
159
  this.controls = {
161
160
  Prev: null,
162
161
  Next: null
@@ -172,6 +171,7 @@ const GeneralSlider = class {
172
171
  this.autoItemHeight = false;
173
172
  this.clientStyling = '';
174
173
  this.clientStylingUrl = '';
174
+ this.currentPage = 0;
175
175
  this.currentSlideNumber = 0;
176
176
  this.slidesCount = 0;
177
177
  this.limitStylingAppends = false;
@@ -209,6 +209,9 @@ const GeneralSlider = class {
209
209
  this.slideNumber = 1;
210
210
  if (!this.slideShow)
211
211
  this.slideShow = 1;
212
+ if (this.currentPage !== 0) {
213
+ this.slideTo(this.currentPage);
214
+ }
212
215
  }
213
216
  componentDidLoad() {
214
217
  this.slides = this.slotEl.assignedElements();
@@ -340,9 +343,9 @@ const GeneralSlider = class {
340
343
  });
341
344
  }
342
345
  render() {
343
- return (index.h("div", { key: 'b8c30bef4c9ca004256c94cb642e8acb350afea4', class: "GeneralSlider" }, index.h("div", { key: '27d6869ae4f675f5e14d17fae20718ec24391e1b', class: "Slider" }, this.showArrow &&
344
- index.h("div", { key: '61acebc8e1a0ecf02ae6dad1ecc6f618424d05d5' }, index.h("button", { key: 'c593883f94b693d6dfe741b2b4ed08185db36ef2', type: "button", class: "Button ButtonNext", onClick: this.slide.bind(this, true), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, ">"), index.h("button", { key: '2bea5e3e9f36443e78bc25f0556dce2adb7111a0', type: "button", class: "Button ButtonPrev", onClick: this.slide.bind(this, false), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "<")), index.h("ul", { key: '6643c865256f26b5d06ec78044a2b595832ecb5e', class: `SliderList Col-${this.slideShow}`, part: "SliderList", onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false), ref: (el) => this.sliderEl = el }, index.h("slot", { key: '48f1ad37b771f32ecc27f3065d58bc7ef1a8a021', ref: (el) => this.slotEl = el }))), this.showButton && this.slidesCount > 0 &&
345
- index.h("div", { key: 'd125efa8c68a6e913664d01fb395ed6cada71f5b', class: "PageButtons", part: "PageButtons" }, [...Array(this.slidesCount / this.slideNumber)].map((_x, i) => index.h("div", { class: `PageButton ${this.currentPage == i ? 'active' : ''}`, title: `page${i}`, onClick: this.slideTo.bind(this, i), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "\u00A0")))));
346
+ return (index.h("div", { key: '3a78acee0094c90ebb20c7e8435088b7b2019f9f', class: "GeneralSlider" }, index.h("div", { key: 'fbf26d5ab557a209fb9cacc5823f74690b211967', class: "Slider" }, index.h("ul", { key: '8a4dd8156eff50ec96960026e43721db41b80628', class: `SliderList Col-${this.slideShow}`, part: "SliderList", onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false), ref: (el) => this.sliderEl = el }, index.h("slot", { key: 'a8bf872b513d03fb0bf171c76183673cda291456', ref: (el) => this.slotEl = el }))), this.showButton && this.slidesCount > 0 &&
347
+ index.h("div", { key: '9346a66e8b64d27a128707e20eb2a36fea43741c', class: "PageButtons", part: "PageButtons" }, [...Array(this.slidesCount / this.slideNumber)].map((_x, i) => index.h("div", { class: `PageButton ${this.currentPage == i ? 'active' : ''}`, title: `page${i}`, onClick: this.slideTo.bind(this, i), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "\u00A0"))), this.showArrow &&
348
+ index.h("div", { key: '559e1f4b1afd91f2290d5cf96e6a4ab2e3a4c3af', class: "ArrowButtons" }, index.h("button", { key: 'a2793999d32183b00de551ebe10e9a35480637ea', type: "button", class: "Button ButtonNext", onClick: this.slide.bind(this, true), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, ">"), index.h("button", { key: 'b362f458df805531cafb933e1418fc9edac883a3', type: "button", class: "Button ButtonPrev", onClick: this.slide.bind(this, false), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "<"))));
346
349
  }
347
350
  get el() { return index.getElement(this); }
348
351
  };
@@ -8,7 +8,7 @@ const appGlobals = require('./app-globals-3a1e7e63.js');
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-tournament-slider_2.cjs",[[1,"casino-tournament-slider",{"useEvent":[1,"use-event"],"endpoint":[1],"tournamentId":[1,"tournament-id"],"session":[1],"language":[1],"gamesLimit":[2,"games-limit"],"offset":[2],"slideNumber":[2,"slide-number"],"slideShow":[2,"slide-show"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"showTitle":[4,"show-title"],"limitStylingAppends":[32],"games":[32],"hover":[32],"hoverIndex":[32]},[[8,"getTournamentInfoCompleted","todoCompletedHandler"]]],[1,"general-slider",{"slideNumber":[2,"slide-number"],"slideShow":[2,"slide-show"],"showArrow":[4,"show-arrow"],"showButton":[4,"show-button"],"autoSlide":[4,"auto-slide"],"loopTime":[2,"loop-time"],"autoItemHeight":[4,"auto-item-height"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"currentSlideNumber":[32],"slidesCount":[32],"limitStylingAppends":[32]}]]]], options);
11
+ return index.bootstrapLazy([["casino-tournament-slider_2.cjs",[[1,"casino-tournament-slider",{"useEvent":[1,"use-event"],"endpoint":[1],"tournamentId":[1,"tournament-id"],"session":[1],"language":[1],"gamesLimit":[2,"games-limit"],"offset":[2],"slideNumber":[2,"slide-number"],"slideShow":[2,"slide-show"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"showTitle":[4,"show-title"],"limitStylingAppends":[32],"games":[32],"hover":[32],"hoverIndex":[32]},[[8,"getTournamentInfoCompleted","todoCompletedHandler"]]],[1,"general-slider",{"slideNumber":[2,"slide-number"],"slideShow":[2,"slide-show"],"showArrow":[4,"show-arrow"],"showButton":[4,"show-button"],"autoSlide":[4,"auto-slide"],"loopTime":[2,"loop-time"],"autoItemHeight":[4,"auto-item-height"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"currentPage":[2,"current-page"],"currentSlideNumber":[32],"slidesCount":[32],"limitStylingAppends":[32]}]]]], options);
12
12
  };
13
13
 
14
14
  exports.setNonce = index.setNonce;
@@ -16,5 +16,5 @@ var patchBrowser = () => {
16
16
 
17
17
  patchBrowser().then(async (options) => {
18
18
  await globalScripts();
19
- return bootstrapLazy([["casino-tournament-slider_2",[[1,"casino-tournament-slider",{"useEvent":[1,"use-event"],"endpoint":[1],"tournamentId":[1,"tournament-id"],"session":[1],"language":[1],"gamesLimit":[2,"games-limit"],"offset":[2],"slideNumber":[2,"slide-number"],"slideShow":[2,"slide-show"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"showTitle":[4,"show-title"],"limitStylingAppends":[32],"games":[32],"hover":[32],"hoverIndex":[32]},[[8,"getTournamentInfoCompleted","todoCompletedHandler"]]],[1,"general-slider",{"slideNumber":[2,"slide-number"],"slideShow":[2,"slide-show"],"showArrow":[4,"show-arrow"],"showButton":[4,"show-button"],"autoSlide":[4,"auto-slide"],"loopTime":[2,"loop-time"],"autoItemHeight":[4,"auto-item-height"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"currentSlideNumber":[32],"slidesCount":[32],"limitStylingAppends":[32]}]]]], options);
19
+ return bootstrapLazy([["casino-tournament-slider_2",[[1,"casino-tournament-slider",{"useEvent":[1,"use-event"],"endpoint":[1],"tournamentId":[1,"tournament-id"],"session":[1],"language":[1],"gamesLimit":[2,"games-limit"],"offset":[2],"slideNumber":[2,"slide-number"],"slideShow":[2,"slide-show"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"showTitle":[4,"show-title"],"limitStylingAppends":[32],"games":[32],"hover":[32],"hoverIndex":[32]},[[8,"getTournamentInfoCompleted","todoCompletedHandler"]]],[1,"general-slider",{"slideNumber":[2,"slide-number"],"slideShow":[2,"slide-show"],"showArrow":[4,"show-arrow"],"showButton":[4,"show-button"],"autoSlide":[4,"auto-slide"],"loopTime":[2,"loop-time"],"autoItemHeight":[4,"auto-item-height"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"currentPage":[2,"current-page"],"currentSlideNumber":[32],"slidesCount":[32],"limitStylingAppends":[32]}]]]], options);
20
20
  });
@@ -152,7 +152,6 @@ const GeneralSlider = class {
152
152
  registerInstance(this, hostRef);
153
153
  this.slides = null;
154
154
  this.slideWidth = 0;
155
- this.currentPage = 0;
156
155
  this.controls = {
157
156
  Prev: null,
158
157
  Next: null
@@ -168,6 +167,7 @@ const GeneralSlider = class {
168
167
  this.autoItemHeight = false;
169
168
  this.clientStyling = '';
170
169
  this.clientStylingUrl = '';
170
+ this.currentPage = 0;
171
171
  this.currentSlideNumber = 0;
172
172
  this.slidesCount = 0;
173
173
  this.limitStylingAppends = false;
@@ -205,6 +205,9 @@ const GeneralSlider = class {
205
205
  this.slideNumber = 1;
206
206
  if (!this.slideShow)
207
207
  this.slideShow = 1;
208
+ if (this.currentPage !== 0) {
209
+ this.slideTo(this.currentPage);
210
+ }
208
211
  }
209
212
  componentDidLoad() {
210
213
  this.slides = this.slotEl.assignedElements();
@@ -336,9 +339,9 @@ const GeneralSlider = class {
336
339
  });
337
340
  }
338
341
  render() {
339
- return (h("div", { key: 'b8c30bef4c9ca004256c94cb642e8acb350afea4', class: "GeneralSlider" }, h("div", { key: '27d6869ae4f675f5e14d17fae20718ec24391e1b', class: "Slider" }, this.showArrow &&
340
- h("div", { key: '61acebc8e1a0ecf02ae6dad1ecc6f618424d05d5' }, h("button", { key: 'c593883f94b693d6dfe741b2b4ed08185db36ef2', type: "button", class: "Button ButtonNext", onClick: this.slide.bind(this, true), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, ">"), h("button", { key: '2bea5e3e9f36443e78bc25f0556dce2adb7111a0', type: "button", class: "Button ButtonPrev", onClick: this.slide.bind(this, false), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "<")), h("ul", { key: '6643c865256f26b5d06ec78044a2b595832ecb5e', class: `SliderList Col-${this.slideShow}`, part: "SliderList", onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false), ref: (el) => this.sliderEl = el }, h("slot", { key: '48f1ad37b771f32ecc27f3065d58bc7ef1a8a021', ref: (el) => this.slotEl = el }))), this.showButton && this.slidesCount > 0 &&
341
- h("div", { key: 'd125efa8c68a6e913664d01fb395ed6cada71f5b', class: "PageButtons", part: "PageButtons" }, [...Array(this.slidesCount / this.slideNumber)].map((_x, i) => h("div", { class: `PageButton ${this.currentPage == i ? 'active' : ''}`, title: `page${i}`, onClick: this.slideTo.bind(this, i), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "\u00A0")))));
342
+ return (h("div", { key: '3a78acee0094c90ebb20c7e8435088b7b2019f9f', class: "GeneralSlider" }, h("div", { key: 'fbf26d5ab557a209fb9cacc5823f74690b211967', class: "Slider" }, h("ul", { key: '8a4dd8156eff50ec96960026e43721db41b80628', class: `SliderList Col-${this.slideShow}`, part: "SliderList", onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false), ref: (el) => this.sliderEl = el }, h("slot", { key: 'a8bf872b513d03fb0bf171c76183673cda291456', ref: (el) => this.slotEl = el }))), this.showButton && this.slidesCount > 0 &&
343
+ h("div", { key: '9346a66e8b64d27a128707e20eb2a36fea43741c', class: "PageButtons", part: "PageButtons" }, [...Array(this.slidesCount / this.slideNumber)].map((_x, i) => h("div", { class: `PageButton ${this.currentPage == i ? 'active' : ''}`, title: `page${i}`, onClick: this.slideTo.bind(this, i), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "\u00A0"))), this.showArrow &&
344
+ h("div", { key: '559e1f4b1afd91f2290d5cf96e6a4ab2e3a4c3af', class: "ArrowButtons" }, h("button", { key: 'a2793999d32183b00de551ebe10e9a35480637ea', type: "button", class: "Button ButtonNext", onClick: this.slide.bind(this, true), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, ">"), h("button", { key: 'b362f458df805531cafb933e1418fc9edac883a3', type: "button", class: "Button ButtonPrev", onClick: this.slide.bind(this, false), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "<"))));
342
345
  }
343
346
  get el() { return getElement(this); }
344
347
  };
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-0f993ce5.js';
5
5
  const defineCustomElements = async (win, options) => {
6
6
  if (typeof window === 'undefined') return undefined;
7
7
  await globalScripts();
8
- return bootstrapLazy([["casino-tournament-slider_2",[[1,"casino-tournament-slider",{"useEvent":[1,"use-event"],"endpoint":[1],"tournamentId":[1,"tournament-id"],"session":[1],"language":[1],"gamesLimit":[2,"games-limit"],"offset":[2],"slideNumber":[2,"slide-number"],"slideShow":[2,"slide-show"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"showTitle":[4,"show-title"],"limitStylingAppends":[32],"games":[32],"hover":[32],"hoverIndex":[32]},[[8,"getTournamentInfoCompleted","todoCompletedHandler"]]],[1,"general-slider",{"slideNumber":[2,"slide-number"],"slideShow":[2,"slide-show"],"showArrow":[4,"show-arrow"],"showButton":[4,"show-button"],"autoSlide":[4,"auto-slide"],"loopTime":[2,"loop-time"],"autoItemHeight":[4,"auto-item-height"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"currentSlideNumber":[32],"slidesCount":[32],"limitStylingAppends":[32]}]]]], options);
8
+ return bootstrapLazy([["casino-tournament-slider_2",[[1,"casino-tournament-slider",{"useEvent":[1,"use-event"],"endpoint":[1],"tournamentId":[1,"tournament-id"],"session":[1],"language":[1],"gamesLimit":[2,"games-limit"],"offset":[2],"slideNumber":[2,"slide-number"],"slideShow":[2,"slide-show"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"showTitle":[4,"show-title"],"limitStylingAppends":[32],"games":[32],"hover":[32],"hoverIndex":[32]},[[8,"getTournamentInfoCompleted","todoCompletedHandler"]]],[1,"general-slider",{"slideNumber":[2,"slide-number"],"slideShow":[2,"slide-show"],"showArrow":[4,"show-arrow"],"showButton":[4,"show-button"],"autoSlide":[4,"auto-slide"],"loopTime":[2,"loop-time"],"autoItemHeight":[4,"auto-item-height"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"currentPage":[2,"current-page"],"currentSlideNumber":[32],"slidesCount":[32],"limitStylingAppends":[32]}]]]], options);
9
9
  };
10
10
 
11
11
  export { defineCustomElements };
@@ -0,0 +1,2 @@
1
+ import { Config } from '../../../../../../../../../../../stencil-public-runtime';
2
+ export declare const config: Config;
@@ -0,0 +1,2 @@
1
+ import { Config } from '../../../../../../../../../../../stencil-public-runtime';
2
+ export declare const config: Config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/casino-tournament-slider",
3
- "version": "1.46.0",
3
+ "version": "1.47.0",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",
@@ -1 +0,0 @@
1
- import{r as t,h as i,g as e}from"./p-c541e3cd.js";const s={en:{playNow:"Play now",sliderTitle:"Participanting games"},"zh-hk":{playNow:"现在播放"},fr:{playNow:"Joue maintenant"},ro:{playNow:"Joaca acum"},hu:{playNow:"Játsszon most"},tr:{playNow:"Şimdi oyna"},el:{playNow:"Παίξε τώρα"},es:{playNow:"Jugar Ya"},pt:{playNow:"Jogue agora"},hr:{playNow:"IGRAJ SADA"}},h=(t,i)=>{var e,h;return(null===(e=s[i])||void 0===e?void 0:e[t])||(null===(h=s.en)||void 0===h?void 0:h[t])},o=class{constructor(i){t(this,i),this.enter=t=>{this.hover=!0,this.hoverIndex=t},this.leave=()=>{this.hover=!1,this.hoverIndex=-1},this.gameClicked=t=>{window.postMessage({type:"TournamentGameAction",gameId:t.id,name:t.name},window.location.href)},this.useEvent=void 0,this.endpoint=void 0,this.tournamentId=void 0,this.session=void 0,this.language=void 0,this.gamesLimit=30,this.offset=0,this.slideNumber=3,this.slideShow=3,this.clientStyling="",this.clientStylingUrl="",this.showTitle=!1,this.limitStylingAppends=!1,this.games=void 0,this.hover=void 0,this.hoverIndex=void 0}todoCompletedHandler(t){if(t.detail&&this.useEvent){if(!t.detail.games)return;this.games=t.detail.games.items}}getTournamentInfo(){let t=new URL(this.endpoint+`/v1/tournaments/${this.tournamentId}`),i=new Headers;t.searchParams.append("expand","games"),t.searchParams.append("language",this.language),t.searchParams.append("pagination",`games(limit=${this.gamesLimit},offset=${this.offset})`),t.searchParams.append("fields","games(id,name,thumbnail)"),this.session&&i.append("X-SessionId",this.session),fetch(t.href,{method:"GET",headers:i}).then((t=>t.json())).then((t=>{this.games=t.item.games.items}))}componentWillLoad(){!this.useEvent&&this.endpoint&&this.tournamentId&&this.getTournamentInfo()}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}setClientStyling(){const t=new CSSStyleSheet;t.replace(this.clientStyling),this.host.shadowRoot.adoptedStyleSheets=[...this.host.shadowRoot.adoptedStyleSheets,t]}setClientStylingURL(){let t=new URL(this.clientStylingUrl);fetch(t.href).then((t=>t.text())).then((t=>{const i=new CSSStyleSheet;i.replace(t),this.host.shadowRoot.adoptedStyleSheets=[...this.host.shadowRoot.adoptedStyleSheets,i]}))}render(){return i("div",{key:"f16db0fd04952457c6e637e34e3295de9f2ab00e",class:"TournamentSliderWrap"},i("div",{key:"246d6bae2b600ebc97e8cfbdf707ae284f0cef20",class:"TournamentSlider"},this.showTitle&&this.games&&i("div",{key:"d9760b0b053aa103a8bb1d24e860d83225aba17b",class:"SliderTitle"},i("svg",{key:"47e2a1441fa2eb68510eb9a775ff14e6b5221afd",xmlns:"http://www.w3.org/2000/svg",width:"21",height:"25",viewBox:"0 0 21 25",fill:"none"},i("path",{key:"566c04c19cbd24b79fba1c87f9872e28689178e3",d:"M6.1774 22.1728C6.36493 22.2725 6.56274 22.0566 6.44793 21.8779C5.82475 20.908 5.23463 19.2759 6.17483 17.174C7.74273 13.6689 8.6968 11.8535 8.6968 11.8535C8.6968 11.8535 9.20426 13.9721 10.5799 15.8558C11.9038 17.6687 12.6285 19.9488 11.4602 21.8482C11.3506 22.0265 11.5439 22.2368 11.7302 22.1415C13.1763 21.4017 14.7983 19.9179 14.9813 16.965C15.0488 16.0627 14.9476 14.7995 14.4416 13.2054C13.791 11.185 12.9911 10.2423 12.5283 9.83741C12.3899 9.71629 12.1746 9.82363 12.1859 10.0072C12.3208 12.1872 11.5007 12.7404 11.0339 11.4937C10.8474 10.9957 10.7387 10.1344 10.7387 9.08558C10.7387 7.3394 10.2321 5.54188 9.1152 4.0812C8.82475 3.70134 8.4849 3.3464 8.09498 3.04372C7.95382 2.93411 7.74919 3.04428 7.76212 3.22252C7.84788 4.40628 7.77018 7.79884 4.79383 11.8519C2.09515 15.6115 3.14088 18.4989 3.51195 19.281C4.2214 20.7791 5.21098 21.6589 6.1774 22.1728Z",fill:"white"})),i("span",{key:"6a6e5fc1e888de1ace0b0c577cc96b98c55a65bd",class:"Title"},h("sliderTitle",this.language))),i("div",{key:"0d18223f0d9603ba8e94a87725bfc52592f5a120",class:"Items"},this.games&&i("general-slider",{key:"d56409e9730aeae803bb2a54951d9ba0912dbf51","slide-number":this.slideNumber,"slide-show":this.slideShow},this.games&&this.games.map(((t,e)=>i("li",{class:"Item",onMouseEnter:()=>this.enter(e),onMouseLeave:()=>this.leave()},i("span",{class:"PlayNowButton "+(this.hoverIndex==e?"ItemHover":""),onClick:()=>{this.gameClicked(t)}},h("playNow",this.language)),i("img",{class:"Img",src:t.thumbnail,alt:t.name,title:t.name}))))))))}get host(){return e(this)}};o.style=":host{display:block}.Item{color:white;display:flex;justify-content:center;align-items:center;font-weight:bold;font-size:10rem;user-select:none;overflow:hidden}.Item .Img{width:100%;height:100%}.PlayNowButton{position:absolute;background:var(--emfe-w-color-green, #48952a);display:block;box-sizing:border-box;padding:0.8rem 0.5rem;color:var(--emfe-w-color-white, #FFFFFF);text-transform:uppercase;text-align:center;font-weight:600;font-size:0.7rem;cursor:pointer;transition:opacity 0.4s linear;opacity:0;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.ItemHover{opacity:1}.Items .Item:first-child{margin-left:0}.Items .Item:last-child{margin-right:0}.SliderTitle{display:flex;align-items:center;padding:6px 0;gap:11px}.Title{color:#fff;font-size:14px;font-weight:600}";const a=class{constructor(i){t(this,i),this.slides=null,this.slideWidth=0,this.currentPage=0,this.controls={Prev:null,Next:null},this.xDown=null,this.yDown=null,this.slideNumber=3,this.slideShow=3,this.showArrow=!0,this.showButton=!1,this.autoSlide=!1,this.loopTime=1,this.autoItemHeight=!1,this.clientStyling="",this.clientStylingUrl="",this.currentSlideNumber=0,this.slidesCount=0,this.limitStylingAppends=!1}slide(t){let i=0;i=t?this.currentSlideNumber+this.slideNumber:this.currentSlideNumber-this.slideNumber,i<0||i>=this.slidesCount||(this.currentSlideNumber=i,this.currentPage=this.currentSlideNumber/this.slideNumber,this.updateListStyle())}slideTo(t){this.currentSlideNumber=t*this.slideNumber,this.currentPage=t,this.updateListStyle()}updateControls(){this.switchControl("Prev",0!==this.currentSlideNumber),this.switchControl("Next",this.currentSlideNumber!==this.slidesCount-this.slideShow)}switchControl(t,i){this.controls[t]&&(this.controls[t].disabled=!i)}componentWillLoad(){this.slideNumber||(this.slideNumber=1),this.slideShow||(this.slideShow=1)}componentDidLoad(){this.slides=this.slotEl.assignedElements(),this.slidesCount=this.slides.length;for(let t in this.controls)this.controls[t]=this.el.shadowRoot.querySelector(".Button"+t);this.autoSlide&&this.setSlideAutoInterval(),!this.limitStylingAppends&&this.el.shadowRoot&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}componentDidRender(){this.slides&&(this.slideWidth=this.slides[0].offsetWidth),this.el.addEventListener("touchstart",this.handleTouchStart.bind(this),{passive:!0}),this.el.addEventListener("touchmove",this.handleTouchMove.bind(this),{passive:!0}),this.updateListStyle(),!this.limitStylingAppends&&this.el.shadowRoot&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}updateListStyle(){this.autoItemHeight&&null!==this.slides&&this.slides.forEach(((t,i)=>{i>=this.currentPage*this.slideNumber&&i<(this.currentPage+1)*this.slideNumber?t.classList.remove("hide"):t.classList.add("hide")}))}disconnectedCallback(){this.el.removeEventListener("touchstart",this.handleTouchStart),this.el.removeEventListener("touchmove",this.handleTouchMove)}handleTouchStart(t){const i=this.getTouches(t)[0];this.xDown=i.clientX,this.yDown=i.clientY,clearInterval(this.sliderInterval)}getTouches(t){return t.touches||t.originalEvent.touches}handleTouchMove(t){if(!this.xDown||!this.yDown)return;let i=this.xDown-t.touches[0].clientX,e=this.yDown-t.touches[0].clientY;Math.abs(i)>Math.abs(e)&&this.slide(i>0),this.xDown=null,this.yDown=null,this.autoSlide&&this.setSlideAutoInterval()}setSlideAutoInterval(){0!=this.loopTime&&(clearInterval(this.sliderInterval),this.sliderInterval=setInterval((()=>{this.slideTo(this.currentPage+1<this.slidesCount/this.slideNumber?this.currentPage+1:0)}),1e3*Number(this.loopTime)))}componentDidUpdate(){this.sliderEl.style.transform=`translateX(${this.currentSlideNumber*this.slideWidth*-1}px)`,this.updateControls()}switchLoopStatus(t){this.autoSlide&&this.loopTime>0&&(t?clearInterval(this.sliderInterval):this.setSlideAutoInterval())}setClientStyling(){const t=new CSSStyleSheet;t.replace(this.clientStyling),this.el.shadowRoot.adoptedStyleSheets=[...this.el.shadowRoot.adoptedStyleSheets,t]}setClientStylingURL(){let t=new URL(this.clientStylingUrl);fetch(t.href).then((t=>t.text())).then((t=>{const i=new CSSStyleSheet;i.replace(t),this.el.shadowRoot.adoptedStyleSheets=[...this.el.shadowRoot.adoptedStyleSheets,i]}))}render(){return i("div",{key:"b8c30bef4c9ca004256c94cb642e8acb350afea4",class:"GeneralSlider"},i("div",{key:"27d6869ae4f675f5e14d17fae20718ec24391e1b",class:"Slider"},this.showArrow&&i("div",{key:"61acebc8e1a0ecf02ae6dad1ecc6f618424d05d5"},i("button",{key:"c593883f94b693d6dfe741b2b4ed08185db36ef2",type:"button",class:"Button ButtonNext",onClick:this.slide.bind(this,!0),onMouseEnter:this.switchLoopStatus.bind(this,!0),onMouseLeave:this.switchLoopStatus.bind(this,!1)},">"),i("button",{key:"2bea5e3e9f36443e78bc25f0556dce2adb7111a0",type:"button",class:"Button ButtonPrev",onClick:this.slide.bind(this,!1),onMouseEnter:this.switchLoopStatus.bind(this,!0),onMouseLeave:this.switchLoopStatus.bind(this,!1)},"<")),i("ul",{key:"6643c865256f26b5d06ec78044a2b595832ecb5e",class:`SliderList Col-${this.slideShow}`,part:"SliderList",onMouseEnter:this.switchLoopStatus.bind(this,!0),onMouseLeave:this.switchLoopStatus.bind(this,!1),ref:t=>this.sliderEl=t},i("slot",{key:"48f1ad37b771f32ecc27f3065d58bc7ef1a8a021",ref:t=>this.slotEl=t}))),this.showButton&&this.slidesCount>0&&i("div",{key:"d125efa8c68a6e913664d01fb395ed6cada71f5b",class:"PageButtons",part:"PageButtons"},[...Array(this.slidesCount/this.slideNumber)].map(((t,e)=>i("div",{class:"PageButton "+(this.currentPage==e?"active":""),title:`page${e}`,onClick:this.slideTo.bind(this,e),onMouseEnter:this.switchLoopStatus.bind(this,!0),onMouseLeave:this.switchLoopStatus.bind(this,!1)}," ")))))}get el(){return e(this)}};a.style=":host{display:block}.GeneralSlider{position:relative}.Slider{position:relative;width:100%;margin:0 auto;overflow:hidden}.SliderList{display:flex;margin:0;padding:0;list-style:none;transition:transform 0.5s ease-in-out}::slotted(li){flex:1 0 auto;width:100%;margin:auto}::slotted(li.hide){visibility:hidden;height:0;transition-delay:500ms}.Col-2 ::slotted(li){flex:2 0 auto;width:50%}.Col-3 ::slotted(li){flex:3 0 auto;width:33.3333333333%}.Col-4 ::slotted(li){flex:4 0 auto;width:25%}.Col-5 ::slotted(li){flex:5 0 auto;width:20%}.Col-6 ::slotted(li){flex:6 0 auto;width:16.6666666667%}.Col-7 ::slotted(li){flex:7 0 auto;width:14.2857142857%}.Col-8 ::slotted(li){flex:8 0 auto;width:12.5%}.Col-9 ::slotted(li){flex:9 0 auto;width:11.1111111111%}.Col-10 ::slotted(li){flex:10 0 auto;width:10%}.Col-11 ::slotted(li){flex:11 0 auto;width:9.0909090909%}.Col-12 ::slotted(li){flex:12 0 auto;width:8.3333333333%}.Button{position:absolute;z-index:1;top:calc(50% - 32px);padding:20px;font-size:20px;line-height:20px;opacity:0.5;border:none;background:var(--emfe-w-color-contrast, #07072A);color:var(--emfe-w-color-white, #FFFFFF);cursor:pointer}.Button:hover{opacity:1;transition:opacity 0.5s ease-in-out}.Button[disabled],.Button[disabled]:hover{color:var(--emfe-w-color-gray-150, #828282);opacity:0.25}.Button.ButtonNext{right:0}.PageButtons{display:flex;gap:4px;margin-top:8px}.PageButton{width:15px;height:4px;border-radius:4px;background-color:var(--emfe-w-tournament-color-primary, #0072ed);opacity:0.2;cursor:pointer;float:right}.PageButton.active{width:45px;opacity:1}";export{o as casino_tournament_slider,a as general_slider}
@@ -1,2 +0,0 @@
1
- import { Config } from '../../../../../../../../../../../../stencil-public-runtime';
2
- export declare const config: Config;
@@ -1,2 +0,0 @@
1
- import { Config } from '../../../../../../../../../../../../stencil-public-runtime';
2
- export declare const config: Config;