@everymatrix/casino-play-random-game 1.31.2 → 1.32.4

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 (48) hide show
  1. package/LICENSE +21 -0
  2. package/package.json +3 -2
  3. package/dist/casino-play-random-game/casino-play-random-game.esm.js +0 -1
  4. package/dist/casino-play-random-game/index.esm.js +0 -0
  5. package/dist/casino-play-random-game/p-0f38b3f8.js +0 -1
  6. package/dist/casino-play-random-game/p-51fa7686.entry.js +0 -1
  7. package/dist/cjs/casino-play-random-game.cjs.entry.js +0 -360
  8. package/dist/cjs/casino-play-random-game.cjs.js +0 -19
  9. package/dist/cjs/index-8944e204.js +0 -1247
  10. package/dist/cjs/index.cjs.js +0 -2
  11. package/dist/cjs/loader.cjs.js +0 -21
  12. package/dist/collection/collection-manifest.json +0 -12
  13. package/dist/collection/components/casino-play-random-game/casino-play-random-game.css +0 -347
  14. package/dist/collection/components/casino-play-random-game/casino-play-random-game.js +0 -473
  15. package/dist/collection/index.js +0 -1
  16. package/dist/collection/utils/locale.utils.js +0 -73
  17. package/dist/collection/utils/utils.js +0 -27
  18. package/dist/components/casino-play-random-game.d.ts +0 -11
  19. package/dist/components/casino-play-random-game.js +0 -392
  20. package/dist/components/index.d.ts +0 -26
  21. package/dist/components/index.js +0 -1
  22. package/dist/esm/casino-play-random-game.entry.js +0 -356
  23. package/dist/esm/casino-play-random-game.js +0 -17
  24. package/dist/esm/index-58563736.js +0 -1221
  25. package/dist/esm/index.js +0 -1
  26. package/dist/esm/loader.js +0 -17
  27. package/dist/esm/polyfills/core-js.js +0 -11
  28. package/dist/esm/polyfills/css-shim.js +0 -1
  29. package/dist/esm/polyfills/dom.js +0 -79
  30. package/dist/esm/polyfills/es5-html-element.js +0 -1
  31. package/dist/esm/polyfills/index.js +0 -34
  32. package/dist/esm/polyfills/system.js +0 -6
  33. package/dist/index.cjs.js +0 -1
  34. package/dist/index.js +0 -1
  35. package/dist/stencil.config.js +0 -22
  36. package/dist/types/Users/dragos.bodea/Documents/everymatrix-prjs/emfe-widgets/widgets-stencil/packages/casino-play-random-game/.stencil/packages/casino-play-random-game/stencil.config.d.ts +0 -2
  37. package/dist/types/components/casino-play-random-game/casino-play-random-game.d.ts +0 -73
  38. package/dist/types/components.d.ts +0 -117
  39. package/dist/types/index.d.ts +0 -1
  40. package/dist/types/stencil-public-runtime.d.ts +0 -1565
  41. package/dist/types/utils/locale.utils.d.ts +0 -6
  42. package/dist/types/utils/utils.d.ts +0 -2
  43. package/loader/cdn.js +0 -3
  44. package/loader/index.cjs.js +0 -3
  45. package/loader/index.d.ts +0 -12
  46. package/loader/index.es2017.js +0 -3
  47. package/loader/index.js +0 -4
  48. package/loader/package.json +0 -10
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/casino-play-random-game",
3
- "version": "1.31.2",
3
+ "version": "1.32.4",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",
@@ -15,5 +15,6 @@
15
15
  ],
16
16
  "publishConfig": {
17
17
  "access": "public"
18
- }
18
+ },
19
+ "gitHead": "69a4e0bb1b0460c07baef352d283492a6e2dc4b0"
19
20
  }
@@ -1 +0,0 @@
1
- import{p as i,b as n}from"./p-0f38b3f8.js";(()=>{const n=import.meta.url,a={};return""!==n&&(a.resourcesUrl=new URL(".",n).href),i(a)})().then((i=>n([["p-51fa7686",[[1,"casino-play-random-game",{endpoint:[513],datasource:[513],language:[513],specificCategory:[513,"specific-category"],iconVisible:[513,"icon-visible"],iconVisibleOnAnim:[513,"icon-visible-on-anim"],launchByGameCard:[513,"launch-by-game-card"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],hasErrors:[32],limitStylingAppends:[32],isLoading:[32],gamesToShow:[32],selectedGame:[32],animationDone:[32],animationStarted:[32]}]]]],i)));
File without changes
@@ -1 +0,0 @@
1
- let e,t,n=!1;const l="undefined"!=typeof window?window:{},s=l.document||{head:{}},o={t:0,l:"",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)},i=e=>Promise.resolve(e),r=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),c=new WeakMap,u=e=>"sc-"+e.o,a={},f=e=>"object"==(e=typeof e)||"function"===e,$=(e,t,...n)=>{let l=null,s=null,o=!1,i=!1,r=[];const c=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof e&&!f(l))&&(l+=""),o&&i?r[r.length-1].i+=l:r.push(o?y(null,l):l),i=o)};if(c(n),t){t.key&&(s=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=y(e,null);return u.u=t,r.length>0&&(u.$=r),u.h=s,u},y=(e,t)=>({t:0,m:e,i:t,p:null,$:null,u:null,h:null}),d={},h=(e,t,n,s,i,r)=>{if(n!==s){let c=_(e,t),u=t.toLowerCase();if("class"===t){const t=e.classList,l=p(n),o=p(s);t.remove(...l.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!l.includes(e))))}else if("key"===t);else if("ref"===t)s&&s(e);else if(c||"o"!==t[0]||"n"!==t[1]){const l=f(s);if((c||l&&null!==s)&&!i)try{if(e.tagName.includes("-"))e[t]=s;else{let l=null==s?"":s;"list"===t?c=!1:null!=n&&e[t]==l||(e[t]=l)}}catch(e){}null==s||!1===s?!1===s&&""!==e.getAttribute(t)||e.removeAttribute(t):(!c||4&r||i)&&!l&&e.setAttribute(t,s=!0===s?"":s)}else t="-"===t[2]?t.slice(3):_(l,u)?u.slice(2):u[2]+t.slice(3),n&&o.rel(e,t,n,!1),s&&o.ael(e,t,s,!1)}},m=/\s/,p=e=>e?e.split(m):[],b=(e,t,n,l)=>{const s=11===t.p.nodeType&&t.p.host?t.p.host:t.p,o=e&&e.u||a,i=t.u||a;for(l in o)l in i||h(s,l,o[l],void 0,n,t.t);for(l in i)h(s,l,o[l],i[l],n,t.t)},w=(t,n,l)=>{let o,i,r=n.$[l],c=0;if(null!==r.i)o=r.p=s.createTextNode(r.i);else if(o=r.p=s.createElement(r.m),b(null,r,!1),null!=e&&o["s-si"]!==e&&o.classList.add(o["s-si"]=e),r.$)for(c=0;c<r.$.length;++c)i=w(t,r,c),i&&o.appendChild(i);return o},S=(e,n,l,s,o,i)=>{let r,c=e;for(c.shadowRoot&&c.tagName===t&&(c=c.shadowRoot);o<=i;++o)s[o]&&(r=w(null,l,o),r&&(s[o].p=r,c.insertBefore(r,n)))},g=(e,t,n,l,s)=>{for(;t<=n;++t)(l=e[t])&&(s=l.p,v(l),s.remove())},k=(e,t)=>e.m===t.m&&e.h===t.h,j=(e,t)=>{const n=t.p=e.p,l=e.$,s=t.$,o=t.i;null===o?(b(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o,i=0,r=0,c=0,u=0,a=t.length-1,f=t[0],$=t[a],y=l.length-1,d=l[0],h=l[y];for(;i<=a&&r<=y;)if(null==f)f=t[++i];else if(null==$)$=t[--a];else if(null==d)d=l[++r];else if(null==h)h=l[--y];else if(k(f,d))j(f,d),f=t[++i],d=l[++r];else if(k($,h))j($,h),$=t[--a],h=l[--y];else if(k(f,h))j(f,h),e.insertBefore(f.p,$.p.nextSibling),f=t[++i],h=l[--y];else if(k($,d))j($,d),e.insertBefore($.p,f.p),$=t[--a],d=l[++r];else{for(c=-1,u=i;u<=a;++u)if(t[u]&&null!==t[u].h&&t[u].h===d.h){c=u;break}c>=0?(o=t[c],o.m!==d.m?s=w(t&&t[r],n,c):(j(o,d),t[c]=void 0,s=o.p),d=l[++r]):(s=w(t&&t[r],n,r),d=l[++r]),s&&f.p.parentNode.insertBefore(s,f.p)}i>a?S(e,null==l[y+1]?null:l[y+1].p,n,l,r,y):r>y&&g(t,i,a)})(n,l,t,s):null!==s?(null!==e.i&&(n.textContent=""),S(n,null,t,s,0,s.length-1)):null!==l&&g(l,0,l.length-1)):e.i!==o&&(n.data=o)},v=e=>{e.u&&e.u.ref&&e.u.ref(null),e.$&&e.$.map(v)},M=e=>F(e).S,C=(e,t)=>{t&&!e.g&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.g=t)))},O=(e,t)=>{if(e.t|=16,!(4&e.t))return C(e,e.k),ee((()=>L(e,t)));e.t|=512},L=(e,t)=>{const n=e.j;let l;return t&&(l=T(n,"componentWillLoad")),W(l,(()=>P(e,n,t)))},P=async(e,t,n)=>{const l=e.S,o=l["s-rc"];n&&(e=>{const t=e.v,n=e.S,l=t.t,o=((e,t)=>{let n=u(t),l=I.get(n);if(e=11===e.nodeType?e:s,l)if("string"==typeof l){let t,o=c.get(e=e.head||e);o||c.set(e,o=new Set),o.has(n)||(t=s.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),o&&o.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);x(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>E(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},x=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.S,o=n.v,i=n.M||y(null,null),r=(e=>e&&e.m===d)(l)?l:$(null,null,l);t=s.tagName,o.C&&(r.u=r.u||{},o.C.map((([e,t])=>r.u[t]=s[e]))),r.m=null,r.t|=4,n.M=r,r.p=i.p=s.shadowRoot||s,e=s["s-sc"],j(i,r)})(n,l)}catch(e){z(e,n.S)}return null},E=e=>{const t=e.S,n=e.j,l=e.k;64&e.t||(e.t|=64,A(t),T(n,"componentDidLoad"),e.O(t),l||N()),e.g&&(e.g(),e.g=void 0),512&e.t&&Z((()=>O(e,!1))),e.t&=-517},N=()=>{A(s.documentElement),Z((()=>(e=>{const t=o.ce("appload",{detail:{namespace:"casino-play-random-game"}});return e.dispatchEvent(t),t})(l)))},T=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){z(e)}},W=(e,t)=>e&&e.then?e.then(t):t(),A=e=>e.classList.add("hydrated"),R=(e,t,n)=>{if(t.L){e.watchers&&(t.P=e.watchers);const l=Object.entries(t.L),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>F(this).N.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=F(e),o=s.S,i=s.N.get(t),r=s.t,c=s.j;if(n=((e,t)=>null==e||f(e)?e:1&t?e+"":e)(n,l.L[t][0]),(!(8&r)||void 0===i)&&n!==i&&(!Number.isNaN(i)||!Number.isNaN(n))&&(s.N.set(t,n),c)){if(l.P&&128&r){const e=l.P[t];e&&e.map((e=>{try{c[e](n,i,t)}catch(e){z(e,o)}}))}2==(18&r)&&O(s,!1)}})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const n=new Map;s.attributeChangedCallback=function(e,t,l){o.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(s.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==l)return;this[t]=(null!==l||"boolean"!=typeof this[t])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,l])=>{const s=l[1]||e;return n.set(s,e),512&l[0]&&t.C.push([e,s]),s}))}}return e},U=e=>{T(e,"connectedCallback")},q=(e,t={})=>{const n=[],i=t.exclude||[],c=l.customElements,a=s.head,f=a.querySelector("meta[charset]"),$=s.createElement("style"),y=[];let d,h=!0;Object.assign(o,t),o.l=new URL(t.resourcesUrl||"./",s.baseURI).href,e.map((e=>{e[1].map((t=>{const l={t:t[0],o:t[1],L:t[2],T:t[3]};l.L=t[2],l.C=[],l.P={};const s=l.o,a=class extends HTMLElement{constructor(e){super(e),V(e=this,l),1&l.t&&e.attachShadow({mode:"open"})}connectedCallback(){d&&(clearTimeout(d),d=null),h?y.push(this):o.jmp((()=>(e=>{if(0==(1&o.t)){const t=F(e),n=t.v,l=()=>{};if(1&t.t)U(t.j);else{t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){C(t,t.k=n);break}}n.L&&Object.entries(n.L).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=G(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(n.P=s.watchers,R(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){z(e)}t.t&=-9,t.t|=128,e(),U(t.j)}if(s.style){let e=s.style;const t=u(n);if(!I.has(t)){const l=()=>{};((e,t,n)=>{let l=I.get(e);r&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,I.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.k,i=()=>O(t,!0);o&&o["s-rc"]?o["s-rc"].push(i):i()})(0,t,n)}l()}})(this)))}disconnectedCallback(){o.jmp((()=>{}))}componentOnReady(){return F(this).W}};l.A=e[0],i.includes(s)||c.get(s)||(n.push(s),c.define(s,R(a,l,1)))}))})),$.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",$.setAttribute("data-styles",""),a.insertBefore($,f?f.nextSibling:a.firstChild),h=!1,y.length?y.map((e=>e.connectedCallback())):o.jmp((()=>d=setTimeout(N,30)))},D=new WeakMap,F=e=>D.get(e),H=(e,t)=>D.set(t.j=e,t),V=(e,t)=>{const n={t:0,S:e,v:t,N:new Map};return n.W=new Promise((e=>n.O=e)),e["s-p"]=[],e["s-rc"]=[],D.set(e,n)},_=(e,t)=>t in e,z=(e,t)=>(0,console.error)(e,t),B=new Map,G=e=>{const t=e.o.replace(/-/g,"_"),n=e.A,l=B.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(B.set(n,e),e[t])),z)},I=new Map,J=[],K=[],Q=(e,t)=>l=>{e.push(l),n||(n=!0,t&&4&o.t?Z(Y):o.raf(Y))},X=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){z(e)}e.length=0},Y=()=>{X(J),X(K),(n=J.length>0)&&o.raf(Y)},Z=e=>i().then(e),ee=Q(K,!0);export{q as b,M as g,$ as h,i as p,H as r}
@@ -1 +0,0 @@
1
- import{r as n,h as a,g as e}from"./p-0f38b3f8.js";const t={en:{error:"Error",randomGameLoading:"Loading ...",playRandomGame:"Play a random game",playNowRandomGame:"Play now",spinRandomGame:"Spin"},ro:{error:"Error",randomGameLoading:"Loading ...",playRandomGame:"Play a random game",playNowRandomGame:"Play now",spinRandomGame:"Spin"},fr:{error:"Error",randomGameLoading:"Loading ...",playRandomGame:"Play a random game",playNowRandomGame:"Play now",spinRandomGame:"Spin"},hr:{error:"Error",randomGameLoading:"Loading ...",playRandomGame:"Play a random game",playNowRandomGame:"Play now",spinRandomGame:"Spin"},hu:{error:"Error",randomGameLoading:"Loading ...",playRandomGame:"Play a random game",playNowRandomGame:"Play now",spinRandomGame:"Spin"},tr:{error:"Hata",randomGameLoading:"Yükleniyor...",playRandomGame:"Rasgele bir oyun oyna",playNowRandomGame:"Şimdi Oyna",spinRandomGame:"DEĞİŞTİR"}},o=n=>new Promise((a=>{fetch(n).then((n=>n.json())).then((n=>{Object.keys(n).forEach((a=>{a in t||(t[a]={});for(let e in n[a])t[a][e]=n[a][e]})),a(!0)}))})),i=(n,a,e)=>{let o=t[void 0!==a?a:"en"][n];if(void 0!==e)for(const[n,a]of Object.entries(e.values)){const e=new RegExp(`{${n}}`,"g");o=o.replace(e,a)}return o},r=class{constructor(a){n(this,a),this.language="en",this.specificCategory="",this.iconVisible="",this.iconVisibleOnAnim="",this.launchByGameCard="",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.hasErrors=!1,this.limitStylingAppends=!1,this.isLoading=!0,this.selectedGame=null,this.animationDone=!1,this.animationStarted=!1,this.animation=null,this.selectedGameIndex=null,this.selectedGameEl=null,this.iconVisibility=null,this.shuffle=n=>{let a,e=n.length;for(;0!==e;)a=Math.floor(Math.random()*e),e--,[n[e],n[a]]=[n[a],n[e]];return n},this.setClientStyling=()=>{let n=document.createElement("style");n.innerHTML=this.clientStyling,this.host.shadowRoot.prepend(n)},this.setClientStylingURL=()=>{let n=new URL(this.clientStylingUrl),a=document.createElement("style");fetch(n.href).then((n=>n.text())).then((n=>{a.innerHTML=n,this.clientStyling=n,setTimeout((()=>{this.host.shadowRoot.prepend(a)}),1)}))}}watchEndpoint(n,a){n&&n!=a&&this.endpoint&&this.fetchGameList()}handleNewTranslations(){this.isLoading=!0,o(this.translationUrl).then((()=>{this.isLoading=!1}))}connectedCallback(){this.iconVisibility="true"===this.iconVisible}componentWillLoad(){if(this.translationUrl.length>2&&o(this.translationUrl),this.endpoint&&this.language&&this.datasource)return this.fetchGameList()}componentDidLoad(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}fetchGameList(){let n=new URL(`${this.endpoint}/v1/casino/games`);return n.searchParams.append("device",(()=>{const n=(()=>{let n=window.navigator.userAgent;return n.toLowerCase().match(/android/i)?"Android":n.toLowerCase().match(/iphone/i)?"iPhone":n.toLowerCase().match(/ipad|ipod/i)?"iPad":"PC"})();if(n)return"PC"===n?"dk":"mtWeb"})()),n.searchParams.append("datasource",this.datasource),n.searchParams.append("fields","gId,id,href,thumbnail,name,vendor,launchUrl,subVendor"),n.searchParams.append("expand","vendor"),n.searchParams.append("pagination","offset=0,limit=423"),n.searchParams.append("language",this.language),this.specificCategory&&n.searchParams.append("filter",`categories(id=${this.specificCategory})`),new Promise(((a,e)=>{this.isLoading=!0,fetch(n.href).then((n=>n.json())).then((n=>{this.gamesToShow=this.setUpGames(null==n?void 0:n.items),a(!0)})).catch((n=>{console.error(n),this.hasErrors=!0,e(n)})).finally((()=>{this.isLoading=!1}))}))}setUpGames(n){const a=this.shuffle(n).slice(0,40);return a.concat(a)}selectRandomGame(){const n=this.gamesToShow.length/2;this.selectedGameIndex=Math.floor(Math.random()*(n-3)),this.selectedGameIndex+=n,this.selectedGameEl=this.gameContainer.children[this.selectedGameIndex]}playRandomGame(){this.animateGames(),"function"==typeof gtag&&gtag("event","PlayRandomGame",{context:"CasinoPlayRandomGame"})}respin(){this.animateGames(),"function"==typeof gtag&&gtag("event","RespinRandomGame",{context:"CasinoPlayRandomGame"})}animateGames(){this.iconVisibility="true"===this.iconVisibleOnAnim,this.animationStarted=!0,this.animationDone=!1,this.animation&&this.animation.cancel(),this.selectedGameEl&&(this.selectedGameEl.classList.remove("TheRandomGame"),this.selectedGame=null,this.selectedGameIndex=null),this.selectRandomGame();const n=window.getComputedStyle(this.gameContainer).getPropertyValue("gap"),a=parseInt(n,10),e=this.selectedGameEl.offsetWidth;this.animation=this.gameContainer.animate([{transform:"translateX(0px)",scale:1},{scale:.75},{transform:`translateX(-${(e+a)*this.selectedGameIndex+e/2-this.gameContainer.offsetWidth/2}px)`,scale:1}],{duration:3e3,easing:"cubic-bezier(0.5, 0, 0.5, 1.2)",fill:"forwards"}),this.animation.onfinish=()=>{this.animationDone=!0,this.selectedGameEl.classList.add("TheRandomGame"),this.selectedGame=this.gamesToShow[this.selectedGameIndex]}}playGame(){this.selectedGame&&(window.postMessage({type:"PlayRandomGame",gameId:this.selectedGame.id,launchUrl:this.selectedGame.launchUrl,gameName:this.selectedGame.name,subVendor:this.selectedGame.subVendor},window.location.href),"function"==typeof gtag&&gtag("event","OpenRandomGame",{context:"CasinoPlayRandomGame"}))}showGameInfo(){window.postMessage({type:"InfoRandomGame",gameId:this.selectedGame.id,launchUrl:this.selectedGame.launchUrl,gameName:this.selectedGame.name,subVendor:this.selectedGame.subVendor},window.location.href),"function"==typeof gtag&&gtag("event","OpenRandomGameInfo",{context:"CasinoPlayRandomGame"})}renderGameDetails(){return a("div",{class:"RandomButtonsWrapper"},a("div",{class:"RandomGameDetails"},a("span",{class:"RandomGameTitle"},this.selectedGame.name),a("span",{class:"RandomGameInfo",onClick:()=>this.showGameInfo()},"i")),a("div",{class:"RandomButtons"},a("button",{class:"RandomButton On",onClick:()=>this.respin()},i("spinRandomGame",this.language)),!this.launchByGameCard&&a("button",{class:"RandomButton On",onClick:()=>this.playGame()},i("playNowRandomGame",this.language))))}render(){return this.hasErrors?a("div",{class:"RandomGameError"},a("div",{class:"Title"},i("error",this.language))):this.isLoading?a("div",{class:"RandomGameLoading"},a("div",{class:"Title"},i("randomGameLoading",this.language))):this.isLoading?void 0:a("div",{class:"RandomGameWrapper"},a("div",{class:"GameContainerGradient"}),a("div",{class:"GamesContainer",ref:n=>this.gameContainer=n},this.gamesToShow&&this.gamesToShow.map(((n,e)=>a("div",{class:"RandomGameCard",key:e,onClick:"true"===this.launchByGameCard?()=>this.playGame():null},a("div",{class:"RandomGameVendor"},n.vendor.name),a("img",{class:"RandomGameImage",src:n.thumbnail,alt:n.name,title:n.name}),this.selectedGame&&this.selectedGameIndex===e&&this.renderGameDetails())))),a("div",{class:"ButtonWrapper "+(this.animationDone?"HideAnimation":"")},a("div",{class:"ButtonContainer"},this.iconVisibility&&a("div",{class:"ButtonIcon "+(this.animationStarted?"Flip":"")},a("div",{class:"QustionMark "+(this.animationStarted?"Flip":"")},"?"),a("div",{class:"HexagonMark"},a("div",{class:"HexagonMarkBorder"}))),!this.animationStarted&&a("div",{class:"RandomButton "+(this.animationStarted?"HideAnimation":""),onClick:()=>this.playRandomGame()},i("playRandomGame",this.language)))))}get host(){return e(this)}static get watchers(){return{endpoint:["watchEndpoint"],datasource:["watchEndpoint"],language:["watchEndpoint"],translationUrl:["handleNewTranslations"]}}};r.style=":host {\n display: block;\n font-family: inherit;\n}\n\n.RandomGameWrapper {\n width: 100%;\n overflow: hidden;\n background: transparent;\n position: relative;\n}\n\n.GameContainerGradient {\n position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100%;\n background: linear-gradient(90deg, var(--emfe-w-casino-color-bg, var(--emfe-w-color-background, #07072A)) 0%, rgba(7, 7, 42, 0.5) 25%, rgba(7, 7, 42, 0) 50%, rgba(7, 7, 42, 0.5) 75%, var(--emfe-w-casino-color-bg, var(--emfe-w-color-background, #07072A)) 100%);\n pointer-events: none;\n z-index: 1;\n}\n\n.GamesContainer {\n display: flex;\n height: 330px;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n align-content: flex-start;\n gap: 20px;\n}\n\n.RandomGameCard {\n position: relative;\n width: 256px;\n height: 170px;\n border-radius: 5px;\n filter: blur(5px);\n}\n.RandomGameCard .RandomGameVendor {\n position: absolute;\n font-size: 12px;\n bottom: 10px;\n left: 10px;\n color: var(--emfe-w-color-white, #FFFFFF);\n}\n\n.TheRandomGame {\n animation-name: ZoomFadeIn;\n animation-duration: 0.5s;\n animation-fill-mode: forwards;\n -webkit-animation-name: ZoomFadeIn;\n -webkit-animation-duration: 0.5s;\n -webkit-animation-fill-mode: forwards;\n opacity: 1;\n cursor: pointer;\n filter: blur(0);\n}\n\n.RandomGameImage {\n width: 256px;\n height: 170px;\n}\n\n.RandomGameDetails {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n color: var(--emfe-w-casino-typography, var(--emfe-w-color-white, #FFFFFF));\n font-size: 14px;\n width: 100%;\n}\n.RandomGameDetails .RandomGameTitle {\n line-height: 18px;\n}\n.RandomGameDetails .RandomGameInfo {\n border-radius: 50%;\n width: 16px;\n height: 16px;\n font-size: 12px;\n font-weight: 400;\n border: solid 1px var(--emfe-w-casino-typography, var(--emfe-w-color-white, #FFFFFF));\n text-align: center;\n margin: 4px 0;\n line-height: 14px;\n cursor: pointer;\n}\n.RandomGameDetails .RandomGamePlay {\n background: var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C));\n color: var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));\n border: none;\n border-radius: 5px;\n width: 200px;\n height: 40px;\n font-size: 14px;\n cursor: pointer;\n}\n\n.ButtonWrapper {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n\n.ButtonContainer {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 10px;\n width: 100%;\n}\n\n.ButtonIcon {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 5px;\n}\n\n.QustionMark {\n position: relative;\n font-size: 80px;\n font-weight: 700;\n color: var(--emfe-w-color-white, #FFFFFF);\n z-index: 5;\n bottom: 20px;\n text-shadow: 0px 4px 0px var(--emfe-w-color-black, #000000);\n}\n\n.HexagonMark {\n position: absolute;\n width: 70px;\n height: 85px;\n background: linear-gradient(90deg, var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C)) 0%, var(--emfe-w-categories-color-secondary, var(--emfe-w-color-secondary, #FD2839)) 100%);\n clip-path: polygon(50% 0, 100% 30%, 100% 70%, 50% 100%, 0% 70%, 0% 30%);\n}\n\n.HexagonMarkBorder {\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n top: 5px;\n left: 5px;\n width: 60px;\n height: 75px;\n background: linear-gradient(180deg, var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C)) 0%, var(--emfe-w-categories-color-secondary, var(--emfe-w-color-secondary, #FD2839)) 100%);\n clip-path: polygon(50% 0, 100% 30%, 100% 70%, 50% 100%, 0% 70%, 0% 30%);\n}\n\n.RandomButtons {\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n gap: 5px;\n width: 100%;\n}\n\n.RandomButton {\n font-size: 18px;\n text-transform: uppercase;\n width: max-content;\n border-radius: 5px;\n padding: 5px 25px;\n border: solid 3px var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C));\n color: var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));\n opacity: 1;\n text-shadow: 1px 1px 2px var(--emfe-w-color-black, #000000);\n animation: ButtonEffect 3s linear infinite;\n background-image: linear-gradient(to right, var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C)), var(--emfe-w-categories-color-secondary, var(--emfe-w-color-secondary, #FD2839)), var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C)));\n background-size: 300% 100%;\n cursor: pointer;\n}\n.RandomButton:hover {\n opacity: 0.8;\n}\n\n.HideAnimation {\n filter: blur(5px);\n animation: AnimateButton 0.2s forwards;\n}\n\n.Flip {\n animation-name: Flip, Blur;\n animation-duration: 0.75s, 3s;\n animation-iteration-count: infinite, 1;\n -webkit-animation-name: Flip, Blur;\n -webkit-animation-duration: 0.75s, 3s;\n -webkit-animation-iteration-count: infinite, 1;\n}\n\n@keyframes ButtonEffect {\n 0% {\n background-position: 0% 50%;\n }\n 33% {\n background-position: 100% 50%;\n }\n 66% {\n background-position: 200% 50%;\n }\n 100% {\n background-position: 300% 50%;\n }\n}\n@keyframes ZoomFadeIn {\n 0% {\n transform: scale(0.2) translateY(0);\n filter: blur(5px);\n opacity: 0.3;\n }\n 50% {\n transform: scale(1.1) translateY(-30px);\n filter: blur(2px);\n opacity: 0.7;\n }\n 100% {\n transform: scale(1) translateY(-30px);\n filter: blur(0px);\n opacity: 1;\n }\n}\n@keyframes AnimateButton {\n 0% {\n opacity: 0.7;\n }\n 50% {\n opacity: 0.4;\n }\n 100% {\n opacity: 0;\n display: none;\n }\n}\n@keyframes Flip {\n 0% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(180deg);\n }\n 100% {\n transform: rotateY(360deg);\n }\n}\n@keyframes Blur {\n 0% {\n filter: blur(0);\n }\n 50% {\n filter: blur(1px);\n }\n 100% {\n filter: blur(3px);\n }\n}\n@container (max-width: 475px) {\n .GameContainerGradient {\n position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100%;\n background: linear-gradient(90deg, var(--emfe-w-casino-color-bg, var(--emfe-w-color-background, #07072A)) 0%, rgba(7, 7, 42, 0.2) 25%, rgba(7, 7, 42, 0) 50%, rgba(7, 7, 42, 0.2) 75%, var(--emfe-w-casino-color-bg, var(--emfe-w-color-background, #07072A)) 100%);\n pointer-events: none;\n z-index: 1;\n }\n\n .RandomGameCard {\n width: 102px;\n height: 146px;\n border-radius: 5px;\n filter: blur(5px);\n }\n\n .RandomGameImage {\n width: 102px;\n height: 146px;\n }\n\n .RandomGameDetails {\n font-size: 14px;\n width: 100%;\n }\n .RandomGameDetails .RandomGameTitle {\n line-height: 18px;\n width: 75%;\n }\n .RandomGameDetails .RandomGameInfo {\n border-radius: 50%;\n width: 16px;\n height: 16px;\n font-size: 12px;\n line-height: 14px;\n }\n .RandomGameDetails .RandomGamePlay {\n background: var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C));\n color: var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));\n border: none;\n border-radius: 5px;\n width: 200px;\n height: 40px;\n font-size: 14px;\n cursor: pointer;\n }\n\n .RandomGameCard .RandomGameVendor {\n font-size: 12px;\n bottom: 5px;\n right: 5px;\n }\n\n .RandomButtons {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 5px;\n width: 100%;\n }\n\n .RandomButton {\n font-size: 18px;\n text-transform: uppercase;\n width: max-content;\n border-radius: 5px;\n padding: 5px 25px;\n border: solid 3px var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C));\n color: var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));\n opacity: 1;\n text-shadow: 1px 1px 2px var(--emfe-w-color-black, #000000);\n animation: ButtonEffect 3s linear infinite;\n background-image: linear-gradient(to right, var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C)), var(--emfe-w-categories-color-secondary, var(--emfe-w-color-secondary, #FD2839)), var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C)));\n background-size: 300% 100%;\n cursor: pointer;\n }\n .RandomButton:hover {\n opacity: 0.8;\n }\n}";export{r as casino_play_random_game}
@@ -1,360 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-8944e204.js');
6
-
7
- const getDevice = () => {
8
- let userAgent = window.navigator.userAgent;
9
- if (userAgent.toLowerCase().match(/android/i)) {
10
- return 'Android';
11
- }
12
- if (userAgent.toLowerCase().match(/iphone/i)) {
13
- return 'iPhone';
14
- }
15
- if (userAgent.toLowerCase().match(/ipad|ipod/i)) {
16
- return 'iPad';
17
- }
18
- return 'PC';
19
- };
20
- const getDevicePlatform = () => {
21
- const device = getDevice();
22
- if (device) {
23
- if (device === 'PC') {
24
- return 'dk';
25
- }
26
- else if (device === 'iPad' || device === 'iPhone') {
27
- return 'mtWeb';
28
- }
29
- else {
30
- return 'mtWeb';
31
- }
32
- }
33
- };
34
-
35
- const DEFAULT_LANGUAGE = 'en';
36
- const TRANSLATIONS = {
37
- en: {
38
- error: 'Error',
39
- randomGameLoading: 'Loading ...',
40
- playRandomGame: 'Play a random game',
41
- playNowRandomGame: 'Play now',
42
- spinRandomGame: 'Spin'
43
- },
44
- ro: {
45
- error: 'Error',
46
- randomGameLoading: 'Loading ...',
47
- playRandomGame: 'Play a random game',
48
- playNowRandomGame: 'Play now',
49
- spinRandomGame: 'Spin'
50
- },
51
- fr: {
52
- error: 'Error',
53
- randomGameLoading: 'Loading ...',
54
- playRandomGame: 'Play a random game',
55
- playNowRandomGame: 'Play now',
56
- spinRandomGame: 'Spin'
57
- },
58
- hr: {
59
- error: 'Error',
60
- randomGameLoading: 'Loading ...',
61
- playRandomGame: 'Play a random game',
62
- playNowRandomGame: 'Play now',
63
- spinRandomGame: 'Spin'
64
- },
65
- hu: {
66
- error: 'Error',
67
- randomGameLoading: 'Loading ...',
68
- playRandomGame: 'Play a random game',
69
- playNowRandomGame: 'Play now',
70
- spinRandomGame: 'Spin'
71
- },
72
- tr: {
73
- error: "Hata",
74
- randomGameLoading: "Yükleniyor...",
75
- playRandomGame: "Rasgele bir oyun oyna",
76
- playNowRandomGame: "Şimdi Oyna",
77
- spinRandomGame: "DEĞİŞTİR"
78
- }
79
- };
80
- const getTranslations = (url) => {
81
- return new Promise((resolve) => {
82
- fetch(url)
83
- .then((res) => res.json())
84
- .then((data) => {
85
- Object.keys(data).forEach((item) => {
86
- if (!(item in TRANSLATIONS)) {
87
- TRANSLATIONS[item] = {};
88
- }
89
- for (let key in data[item]) {
90
- TRANSLATIONS[item][key] = data[item][key];
91
- }
92
- });
93
- resolve(true);
94
- });
95
- });
96
- };
97
- const translate = (key, customLang, values) => {
98
- const lang = customLang;
99
- let translation = TRANSLATIONS[lang !== undefined ? lang : DEFAULT_LANGUAGE][key];
100
- if (values !== undefined) {
101
- for (const [key, value] of Object.entries(values.values)) {
102
- const regex = new RegExp(`{${key}}`, 'g');
103
- translation = translation.replace(regex, value);
104
- }
105
- }
106
- return translation;
107
- };
108
-
109
- const casinoPlayRandomGameCss = ":host {\n display: block;\n font-family: inherit;\n}\n\n.RandomGameWrapper {\n width: 100%;\n overflow: hidden;\n background: transparent;\n position: relative;\n}\n\n.GameContainerGradient {\n position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100%;\n background: linear-gradient(90deg, var(--emfe-w-casino-color-bg, var(--emfe-w-color-background, #07072A)) 0%, rgba(7, 7, 42, 0.5) 25%, rgba(7, 7, 42, 0) 50%, rgba(7, 7, 42, 0.5) 75%, var(--emfe-w-casino-color-bg, var(--emfe-w-color-background, #07072A)) 100%);\n pointer-events: none;\n z-index: 1;\n}\n\n.GamesContainer {\n display: flex;\n height: 330px;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n align-content: flex-start;\n gap: 20px;\n}\n\n.RandomGameCard {\n position: relative;\n width: 256px;\n height: 170px;\n border-radius: 5px;\n filter: blur(5px);\n}\n.RandomGameCard .RandomGameVendor {\n position: absolute;\n font-size: 12px;\n bottom: 10px;\n left: 10px;\n color: var(--emfe-w-color-white, #FFFFFF);\n}\n\n.TheRandomGame {\n animation-name: ZoomFadeIn;\n animation-duration: 0.5s;\n animation-fill-mode: forwards;\n -webkit-animation-name: ZoomFadeIn;\n -webkit-animation-duration: 0.5s;\n -webkit-animation-fill-mode: forwards;\n opacity: 1;\n cursor: pointer;\n filter: blur(0);\n}\n\n.RandomGameImage {\n width: 256px;\n height: 170px;\n}\n\n.RandomGameDetails {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n color: var(--emfe-w-casino-typography, var(--emfe-w-color-white, #FFFFFF));\n font-size: 14px;\n width: 100%;\n}\n.RandomGameDetails .RandomGameTitle {\n line-height: 18px;\n}\n.RandomGameDetails .RandomGameInfo {\n border-radius: 50%;\n width: 16px;\n height: 16px;\n font-size: 12px;\n font-weight: 400;\n border: solid 1px var(--emfe-w-casino-typography, var(--emfe-w-color-white, #FFFFFF));\n text-align: center;\n margin: 4px 0;\n line-height: 14px;\n cursor: pointer;\n}\n.RandomGameDetails .RandomGamePlay {\n background: var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C));\n color: var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));\n border: none;\n border-radius: 5px;\n width: 200px;\n height: 40px;\n font-size: 14px;\n cursor: pointer;\n}\n\n.ButtonWrapper {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n\n.ButtonContainer {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 10px;\n width: 100%;\n}\n\n.ButtonIcon {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 5px;\n}\n\n.QustionMark {\n position: relative;\n font-size: 80px;\n font-weight: 700;\n color: var(--emfe-w-color-white, #FFFFFF);\n z-index: 5;\n bottom: 20px;\n text-shadow: 0px 4px 0px var(--emfe-w-color-black, #000000);\n}\n\n.HexagonMark {\n position: absolute;\n width: 70px;\n height: 85px;\n background: linear-gradient(90deg, var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C)) 0%, var(--emfe-w-categories-color-secondary, var(--emfe-w-color-secondary, #FD2839)) 100%);\n clip-path: polygon(50% 0, 100% 30%, 100% 70%, 50% 100%, 0% 70%, 0% 30%);\n}\n\n.HexagonMarkBorder {\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n top: 5px;\n left: 5px;\n width: 60px;\n height: 75px;\n background: linear-gradient(180deg, var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C)) 0%, var(--emfe-w-categories-color-secondary, var(--emfe-w-color-secondary, #FD2839)) 100%);\n clip-path: polygon(50% 0, 100% 30%, 100% 70%, 50% 100%, 0% 70%, 0% 30%);\n}\n\n.RandomButtons {\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n gap: 5px;\n width: 100%;\n}\n\n.RandomButton {\n font-size: 18px;\n text-transform: uppercase;\n width: max-content;\n border-radius: 5px;\n padding: 5px 25px;\n border: solid 3px var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C));\n color: var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));\n opacity: 1;\n text-shadow: 1px 1px 2px var(--emfe-w-color-black, #000000);\n animation: ButtonEffect 3s linear infinite;\n background-image: linear-gradient(to right, var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C)), var(--emfe-w-categories-color-secondary, var(--emfe-w-color-secondary, #FD2839)), var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C)));\n background-size: 300% 100%;\n cursor: pointer;\n}\n.RandomButton:hover {\n opacity: 0.8;\n}\n\n.HideAnimation {\n filter: blur(5px);\n animation: AnimateButton 0.2s forwards;\n}\n\n.Flip {\n animation-name: Flip, Blur;\n animation-duration: 0.75s, 3s;\n animation-iteration-count: infinite, 1;\n -webkit-animation-name: Flip, Blur;\n -webkit-animation-duration: 0.75s, 3s;\n -webkit-animation-iteration-count: infinite, 1;\n}\n\n@keyframes ButtonEffect {\n 0% {\n background-position: 0% 50%;\n }\n 33% {\n background-position: 100% 50%;\n }\n 66% {\n background-position: 200% 50%;\n }\n 100% {\n background-position: 300% 50%;\n }\n}\n@keyframes ZoomFadeIn {\n 0% {\n transform: scale(0.2) translateY(0);\n filter: blur(5px);\n opacity: 0.3;\n }\n 50% {\n transform: scale(1.1) translateY(-30px);\n filter: blur(2px);\n opacity: 0.7;\n }\n 100% {\n transform: scale(1) translateY(-30px);\n filter: blur(0px);\n opacity: 1;\n }\n}\n@keyframes AnimateButton {\n 0% {\n opacity: 0.7;\n }\n 50% {\n opacity: 0.4;\n }\n 100% {\n opacity: 0;\n display: none;\n }\n}\n@keyframes Flip {\n 0% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(180deg);\n }\n 100% {\n transform: rotateY(360deg);\n }\n}\n@keyframes Blur {\n 0% {\n filter: blur(0);\n }\n 50% {\n filter: blur(1px);\n }\n 100% {\n filter: blur(3px);\n }\n}\n@container (max-width: 475px) {\n .GameContainerGradient {\n position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100%;\n background: linear-gradient(90deg, var(--emfe-w-casino-color-bg, var(--emfe-w-color-background, #07072A)) 0%, rgba(7, 7, 42, 0.2) 25%, rgba(7, 7, 42, 0) 50%, rgba(7, 7, 42, 0.2) 75%, var(--emfe-w-casino-color-bg, var(--emfe-w-color-background, #07072A)) 100%);\n pointer-events: none;\n z-index: 1;\n }\n\n .RandomGameCard {\n width: 102px;\n height: 146px;\n border-radius: 5px;\n filter: blur(5px);\n }\n\n .RandomGameImage {\n width: 102px;\n height: 146px;\n }\n\n .RandomGameDetails {\n font-size: 14px;\n width: 100%;\n }\n .RandomGameDetails .RandomGameTitle {\n line-height: 18px;\n width: 75%;\n }\n .RandomGameDetails .RandomGameInfo {\n border-radius: 50%;\n width: 16px;\n height: 16px;\n font-size: 12px;\n line-height: 14px;\n }\n .RandomGameDetails .RandomGamePlay {\n background: var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C));\n color: var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));\n border: none;\n border-radius: 5px;\n width: 200px;\n height: 40px;\n font-size: 14px;\n cursor: pointer;\n }\n\n .RandomGameCard .RandomGameVendor {\n font-size: 12px;\n bottom: 5px;\n right: 5px;\n }\n\n .RandomButtons {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 5px;\n width: 100%;\n }\n\n .RandomButton {\n font-size: 18px;\n text-transform: uppercase;\n width: max-content;\n border-radius: 5px;\n padding: 5px 25px;\n border: solid 3px var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C));\n color: var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));\n opacity: 1;\n text-shadow: 1px 1px 2px var(--emfe-w-color-black, #000000);\n animation: ButtonEffect 3s linear infinite;\n background-image: linear-gradient(to right, var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C)), var(--emfe-w-categories-color-secondary, var(--emfe-w-color-secondary, #FD2839)), var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C)));\n background-size: 300% 100%;\n cursor: pointer;\n }\n .RandomButton:hover {\n opacity: 0.8;\n }\n}";
110
-
111
- const CasinoPlayRandomGame = class {
112
- constructor(hostRef) {
113
- index.registerInstance(this, hostRef);
114
- /**
115
- * Language of the widget
116
- */
117
- this.language = 'en';
118
- /**
119
- * Configure a specific category for randomising the games.
120
- */
121
- this.specificCategory = '';
122
- /**
123
- * Icon visible initially
124
- */
125
- this.iconVisible = '';
126
- /**
127
- * Icon visible while rolling
128
- */
129
- this.iconVisibleOnAnim = '';
130
- /**
131
- * Open event on the game card.
132
- */
133
- this.launchByGameCard = '';
134
- /**
135
- * Client custom styling via string
136
- */
137
- this.clientStyling = '';
138
- /**
139
- * Client custom styling via url
140
- */
141
- this.clientStylingUrl = '';
142
- /**
143
- * Translations via URL
144
- */
145
- this.translationUrl = '';
146
- this.hasErrors = false;
147
- this.limitStylingAppends = false;
148
- this.isLoading = true;
149
- this.selectedGame = null;
150
- this.animationDone = false;
151
- this.animationStarted = false;
152
- this.animation = null;
153
- this.selectedGameIndex = null;
154
- this.selectedGameEl = null;
155
- this.iconVisibility = null;
156
- this.shuffle = (array) => {
157
- let currentIndex = array.length;
158
- let randomIndex;
159
- while (currentIndex !== 0) {
160
- randomIndex = Math.floor(Math.random() * currentIndex);
161
- currentIndex--;
162
- [array[currentIndex], array[randomIndex]] = [array[randomIndex], array[currentIndex]];
163
- }
164
- return array;
165
- };
166
- this.setClientStyling = () => {
167
- let sheet = document.createElement('style');
168
- sheet.innerHTML = this.clientStyling;
169
- this.host.shadowRoot.prepend(sheet);
170
- };
171
- this.setClientStylingURL = () => {
172
- let url = new URL(this.clientStylingUrl);
173
- let cssFile = document.createElement('style');
174
- fetch(url.href)
175
- .then((res) => res.text())
176
- .then((data) => {
177
- cssFile.innerHTML = data;
178
- this.clientStyling = data;
179
- setTimeout(() => { this.host.shadowRoot.prepend(cssFile); }, 1);
180
- });
181
- };
182
- }
183
- watchEndpoint(newValue, oldValue) {
184
- if (newValue && newValue != oldValue && this.endpoint) {
185
- this.fetchGameList();
186
- }
187
- }
188
- handleNewTranslations() {
189
- this.isLoading = true;
190
- getTranslations(this.translationUrl).then(() => {
191
- this.isLoading = false;
192
- });
193
- }
194
- connectedCallback() {
195
- this.iconVisibility = this.iconVisible === 'true' ? true : false;
196
- }
197
- componentWillLoad() {
198
- if (this.translationUrl.length > 2) {
199
- getTranslations(this.translationUrl);
200
- }
201
- if (this.endpoint && this.language && this.datasource) {
202
- return this.fetchGameList();
203
- }
204
- }
205
- componentDidLoad() {
206
- if (!this.limitStylingAppends && this.host) {
207
- if (this.clientStyling)
208
- this.setClientStyling();
209
- if (this.clientStylingUrl)
210
- this.setClientStylingURL();
211
- this.limitStylingAppends = true;
212
- }
213
- }
214
- fetchGameList() {
215
- let url = new URL(`${this.endpoint}/v1/casino/games`);
216
- url.searchParams.append('device', getDevicePlatform());
217
- url.searchParams.append('datasource', this.datasource);
218
- url.searchParams.append('fields', 'gId,id,href,thumbnail,name,vendor,launchUrl,subVendor');
219
- url.searchParams.append('expand', 'vendor');
220
- // Number of games chosen
221
- url.searchParams.append('pagination', 'offset=0,limit=423');
222
- url.searchParams.append('language', this.language);
223
- if (this.specificCategory) {
224
- url.searchParams.append('filter', `categories(id=${this.specificCategory})`);
225
- }
226
- return new Promise((resolve, reject) => {
227
- this.isLoading = true;
228
- fetch(url.href)
229
- .then((res) => res.json())
230
- .then((data) => {
231
- this.gamesToShow = this.setUpGames(data === null || data === void 0 ? void 0 : data.items);
232
- resolve(true);
233
- }).catch((err) => {
234
- console.error(err);
235
- this.hasErrors = true;
236
- reject(err);
237
- }).finally(() => {
238
- this.isLoading = false;
239
- });
240
- });
241
- }
242
- setUpGames(games) {
243
- // Only 40 games will be selected at a time; the random game will be selected from these.
244
- const shuffledGames = this.shuffle(games).slice(0, 40);
245
- // Clone the games
246
- return shuffledGames.concat(shuffledGames);
247
- }
248
- selectRandomGame() {
249
- const originalGamesLength = this.gamesToShow.length / 2;
250
- // Substract 3 to ensure there are always at least 5 cards after the selected one
251
- this.selectedGameIndex = Math.floor(Math.random() * (originalGamesLength - 3));
252
- // Offset by the length of the original to select from the cloned part
253
- this.selectedGameIndex += originalGamesLength;
254
- this.selectedGameEl = this.gameContainer.children[this.selectedGameIndex];
255
- }
256
- playRandomGame() {
257
- this.animateGames();
258
- //@ts-ignore
259
- if (typeof gtag == 'function') {
260
- //@ts-ignore
261
- gtag('event', 'PlayRandomGame', {
262
- 'context': 'CasinoPlayRandomGame'
263
- });
264
- }
265
- }
266
- respin() {
267
- this.animateGames();
268
- //@ts-ignore
269
- if (typeof gtag == 'function') {
270
- //@ts-ignore
271
- gtag('event', 'RespinRandomGame', {
272
- 'context': 'CasinoPlayRandomGame'
273
- });
274
- }
275
- }
276
- animateGames() {
277
- this.iconVisibility = this.iconVisibleOnAnim === 'true' ? true : false;
278
- this.animationStarted = true;
279
- this.animationDone = false;
280
- if (this.animation)
281
- this.animation.cancel();
282
- if (this.selectedGameEl) {
283
- this.selectedGameEl.classList.remove('TheRandomGame');
284
- this.selectedGame = null;
285
- this.selectedGameIndex = null;
286
- }
287
- this.selectRandomGame();
288
- const gapStyle = window.getComputedStyle(this.gameContainer).getPropertyValue('gap');
289
- const gap = parseInt(gapStyle, 10);
290
- const cardWidth = this.selectedGameEl.offsetWidth;
291
- const gameContainerWidth = this.gameContainer.offsetWidth;
292
- const translation = ((cardWidth + gap) * this.selectedGameIndex) + // Width of game cards up to the selected
293
- (cardWidth / 2) - // Additional half card width to center to the selected game
294
- (gameContainerWidth / 2); // Minus half the container width to center the card
295
- const containerRolling = [
296
- { transform: `translateX(0px)`, scale: 1 },
297
- { scale: 0.75 },
298
- { transform: `translateX(-${translation}px)`, scale: 1 }
299
- ];
300
- const containerTiming = {
301
- duration: 3000,
302
- easing: 'cubic-bezier(0.5, 0, 0.5, 1.2)',
303
- fill: 'forwards'
304
- };
305
- this.animation = this.gameContainer.animate(containerRolling, containerTiming);
306
- this.animation.onfinish = () => {
307
- this.animationDone = true;
308
- this.selectedGameEl.classList.add('TheRandomGame');
309
- this.selectedGame = this.gamesToShow[this.selectedGameIndex];
310
- };
311
- }
312
- playGame() {
313
- if (!this.selectedGame)
314
- return;
315
- window.postMessage({ type: 'PlayRandomGame', gameId: this.selectedGame.id, launchUrl: this.selectedGame.launchUrl, gameName: this.selectedGame.name, subVendor: this.selectedGame.subVendor }, window.location.href);
316
- //@ts-ignore
317
- if (typeof gtag == 'function') {
318
- //@ts-ignore
319
- gtag('event', 'OpenRandomGame', {
320
- 'context': 'CasinoPlayRandomGame'
321
- });
322
- }
323
- }
324
- ;
325
- showGameInfo() {
326
- window.postMessage({ type: 'InfoRandomGame', gameId: this.selectedGame.id, launchUrl: this.selectedGame.launchUrl, gameName: this.selectedGame.name, subVendor: this.selectedGame.subVendor }, window.location.href);
327
- //@ts-ignore
328
- if (typeof gtag == 'function') {
329
- //@ts-ignore
330
- gtag('event', 'OpenRandomGameInfo', {
331
- 'context': 'CasinoPlayRandomGame'
332
- });
333
- }
334
- }
335
- renderGameDetails() {
336
- return index.h("div", { class: "RandomButtonsWrapper" }, index.h("div", { class: "RandomGameDetails" }, index.h("span", { class: "RandomGameTitle" }, this.selectedGame.name), index.h("span", { class: "RandomGameInfo", onClick: () => this.showGameInfo() }, "i")), index.h("div", { class: "RandomButtons" }, index.h("button", { class: "RandomButton On", onClick: () => this.respin() }, translate('spinRandomGame', this.language)), !this.launchByGameCard &&
337
- index.h("button", { class: "RandomButton On", onClick: () => this.playGame() }, translate('playNowRandomGame', this.language))));
338
- }
339
- render() {
340
- if (this.hasErrors) {
341
- return (index.h("div", { class: "RandomGameError" }, index.h("div", { class: "Title" }, translate('error', this.language))));
342
- }
343
- if (this.isLoading) {
344
- return (index.h("div", { class: "RandomGameLoading" }, index.h("div", { class: "Title" }, translate('randomGameLoading', this.language))));
345
- }
346
- if (!this.isLoading) {
347
- return index.h("div", { class: "RandomGameWrapper" }, index.h("div", { class: 'GameContainerGradient' }), index.h("div", { class: 'GamesContainer', ref: (el) => this.gameContainer = el }, this.gamesToShow && this.gamesToShow.map((game, index$1) => (index.h("div", { class: 'RandomGameCard', key: index$1, onClick: this.launchByGameCard === 'true' ? () => this.playGame() : null }, index.h("div", { class: "RandomGameVendor" }, game.vendor.name), index.h("img", { class: 'RandomGameImage', src: game.thumbnail, alt: game.name, title: game.name }), this.selectedGame && this.selectedGameIndex === index$1 && this.renderGameDetails())))), index.h("div", { class: `ButtonWrapper ${this.animationDone ? 'HideAnimation' : ''}` }, index.h("div", { class: "ButtonContainer" }, this.iconVisibility && index.h("div", { class: `ButtonIcon ${this.animationStarted ? 'Flip' : ''}` }, index.h("div", { class: `QustionMark ${this.animationStarted ? 'Flip' : ''}` }, "?"), index.h("div", { class: "HexagonMark" }, index.h("div", { class: "HexagonMarkBorder" }))), !this.animationStarted && index.h("div", { class: `RandomButton ${this.animationStarted ? 'HideAnimation' : ''}`, onClick: () => this.playRandomGame() }, translate('playRandomGame', this.language)))));
348
- }
349
- }
350
- get host() { return index.getElement(this); }
351
- static get watchers() { return {
352
- "endpoint": ["watchEndpoint"],
353
- "datasource": ["watchEndpoint"],
354
- "language": ["watchEndpoint"],
355
- "translationUrl": ["handleNewTranslations"]
356
- }; }
357
- };
358
- CasinoPlayRandomGame.style = casinoPlayRandomGameCss;
359
-
360
- exports.casino_play_random_game = CasinoPlayRandomGame;
@@ -1,19 +0,0 @@
1
- 'use strict';
2
-
3
- const index = require('./index-8944e204.js');
4
-
5
- /*
6
- Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
7
- */
8
- const patchBrowser = () => {
9
- const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('casino-play-random-game.cjs.js', document.baseURI).href));
10
- const opts = {};
11
- if (importMeta !== '') {
12
- opts.resourcesUrl = new URL('.', importMeta).href;
13
- }
14
- return index.promiseResolve(opts);
15
- };
16
-
17
- patchBrowser().then(options => {
18
- return index.bootstrapLazy([["casino-play-random-game.cjs",[[1,"casino-play-random-game",{"endpoint":[513],"datasource":[513],"language":[513],"specificCategory":[513,"specific-category"],"iconVisible":[513,"icon-visible"],"iconVisibleOnAnim":[513,"icon-visible-on-anim"],"launchByGameCard":[513,"launch-by-game-card"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"hasErrors":[32],"limitStylingAppends":[32],"isLoading":[32],"gamesToShow":[32],"selectedGame":[32],"animationDone":[32],"animationStarted":[32]}]]]], options);
19
- });