@everymatrix/casino-engagement-suite-jackpots-list 1.0.69

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 (46) hide show
  1. package/dist/casino-engagement-suite-jackpots-list/casino-engagement-suite-jackpots-list.esm.js +1 -0
  2. package/dist/casino-engagement-suite-jackpots-list/index.esm.js +0 -0
  3. package/dist/casino-engagement-suite-jackpots-list/p-b2346fe7.entry.js +1 -0
  4. package/dist/casino-engagement-suite-jackpots-list/p-d1d09602.js +2 -0
  5. package/dist/casino-engagement-suite-jackpots-list/p-e1255160.js +1 -0
  6. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  7. package/dist/cjs/casino-engagement-suite-jackpots-list.cjs.entry.js +301 -0
  8. package/dist/cjs/casino-engagement-suite-jackpots-list.cjs.js +25 -0
  9. package/dist/cjs/index-d6d19ec7.js +1221 -0
  10. package/dist/cjs/index.cjs.js +2 -0
  11. package/dist/cjs/loader.cjs.js +15 -0
  12. package/dist/collection/collection-manifest.json +12 -0
  13. package/dist/collection/components/casino-engagement-suite-jackpots-list/casino-engagement-suite-jackpots-list.css +295 -0
  14. package/dist/collection/components/casino-engagement-suite-jackpots-list/casino-engagement-suite-jackpots-list.js +325 -0
  15. package/dist/collection/components/casino-engagement-suite-jackpots-list/index.js +1 -0
  16. package/dist/collection/index.js +1 -0
  17. package/dist/collection/models/jackpot.js +1 -0
  18. package/dist/collection/utils/locale.utils.js +25 -0
  19. package/dist/collection/utils/utils.js +5 -0
  20. package/dist/esm/app-globals-0f993ce5.js +3 -0
  21. package/dist/esm/casino-engagement-suite-jackpots-list.entry.js +297 -0
  22. package/dist/esm/casino-engagement-suite-jackpots-list.js +20 -0
  23. package/dist/esm/index-b84e2464.js +1193 -0
  24. package/dist/esm/index.js +1 -0
  25. package/dist/esm/loader.js +11 -0
  26. package/dist/index.cjs.js +1 -0
  27. package/dist/index.js +1 -0
  28. package/dist/stencil.config.dev.js +17 -0
  29. package/dist/stencil.config.js +17 -0
  30. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/casino-engagement-suite-jackpots-list/.stencil/packages/stencil/casino-engagement-suite-jackpots-list/stencil.config.d.ts +2 -0
  31. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/casino-engagement-suite-jackpots-list/.stencil/packages/stencil/casino-engagement-suite-jackpots-list/stencil.config.dev.d.ts +2 -0
  32. package/dist/types/components/casino-engagement-suite-jackpots-list/casino-engagement-suite-jackpots-list.d.ts +56 -0
  33. package/dist/types/components/casino-engagement-suite-jackpots-list/index.d.ts +1 -0
  34. package/dist/types/components.d.ts +97 -0
  35. package/dist/types/index.d.ts +1 -0
  36. package/dist/types/models/jackpot.d.ts +39 -0
  37. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  38. package/dist/types/utils/locale.utils.d.ts +1 -0
  39. package/dist/types/utils/utils.d.ts +1 -0
  40. package/loader/cdn.js +1 -0
  41. package/loader/index.cjs.js +1 -0
  42. package/loader/index.d.ts +24 -0
  43. package/loader/index.es2017.js +1 -0
  44. package/loader/index.js +2 -0
  45. package/loader/package.json +11 -0
  46. package/package.json +26 -0
@@ -0,0 +1 @@
1
+ import{p as t,b as e}from"./p-d1d09602.js";export{s as setNonce}from"./p-d1d09602.js";import{g as n}from"./p-e1255160.js";(()=>{const e=import.meta.url,s={};return""!==e&&(s.resourcesUrl=new URL(".",e).href),t(s)})().then((async t=>(await n(),e([["p-b2346fe7",[[1,"casino-engagement-suite-jackpots-list",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[1],device:[1],jackpots:[1040],jackpotChangeStatusRequest:[1040],tooltip:[32],timers:[32],limitStylingAppends:[32]},null,{jackpots:["jackpotsPropHandler"]}]]]],t))));
@@ -0,0 +1 @@
1
+ import{r as t,c as o,h as e,g as a}from"./p-d1d09602.js";function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function s(t,o){if(o.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+o.length+" present")}function n(t){s(1,arguments);var o=Object.prototype.toString.call(t);return t instanceof Date||"object"===i(t)&&"[object Date]"===o?new Date(t.getTime()):"number"==typeof t||"[object Number]"===o?new Date(t):("string"!=typeof t&&"[object String]"!==o||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function p(t,o){s(2,arguments);var e=n(t),a=n(o);return e.getTime()<a.getTime()}const r=["en"],c={en:{jackpots:"Jackpots",join:"Join",unjoin:"Unjoin",tooltip:"A payout that increases each time the game is played but the jackpot is not won",mega:"Mega",major:"Major",minor:"Minor",suspended:"Suspended Jackpot",allJackpotsSuspended:"Unfortunately, there are no available jackpots to join. Please, try again later.",jackpotIsWon:"Jackpot is Won",termsAndConditions:"Terms and Conditions",winingProbability:"Winning Probability",type:"Type",operatorContribution:"Operator Contribution",outdatedJackpotCountdown:"We are going to remove this Jackpot in 30 days"}},l=(t,o)=>{const e=o;return c[void 0!==e&&r.includes(e)?e:"en"][t]},d=class{constructor(e){t(this,e),this.close=o(this,"close",7),this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.host.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),o=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{o.innerHTML=t,setTimeout((()=>{this.host.prepend(o)}),1)})).catch((t=>{console.log("Error ",t)}))},this.handleCloseClick=()=>{this.close.emit(),this.tooltip=null},this.toggleTooltip=t=>{t.stopPropagation(),this.tooltip=this.tooltip?null:l(t.currentTarget.getAttribute("data-tooltip"),this.language)},this.stopPropagation=t=>{t.stopPropagation()},this.handleJackpotClick=t=>{const o=+t.currentTarget.getAttribute("data-id");window.postMessage({type:"JackpotClick",id:o})},this.clientStyling="",this.clientStylingUrl="",this.language="en",this.device="Mobile",this.jackpots=[],this.jackpotChangeStatusRequest=void 0,this.tooltip=null,this.timers={},this.limitStylingAppends=!1}jackpotsPropHandler(t){!this.interval&&t.length&&this.startCountdown(),this.interval&&!t.length&&clearInterval(this.interval)}componentWillLoad(){this.jackpotsPropHandler(this.jackpots)}startCountdown(){this.updateTimers(),this.interval=setInterval((()=>{this.updateTimers()}),1e3)}updateTimers(){const t=(new Date).getTime();this.timers=this.jackpots.reduce(((o,e)=>{const a=new Date(e.JackpotEndTime).getTime()-t;let i="00h:00m:00s";const{days:s,hours:n,minutes:p,seconds:r}={days:String(Math.floor(a/864e5)).padStart(2,"0"),hours:String(Math.floor(a%864e5/36e5)).padStart(2,"0"),minutes:String(Math.floor(a%36e5/6e4)).padStart(2,"0"),seconds:String(Math.floor(a%6e4/1e3)).padStart(2,"0")};return i="00"===s?`${n}h:${p}m:${r}s`:`${s}d:${n}h:${p}m`,Object.assign(Object.assign({},o),{[e.JackpotId]:i})}),{})}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}disconnectedCallback(){this.interval&&clearInterval(this.interval)}getJackpotClasses(t){return{JackpotCard:!0,JackpotCardClosed:t.IsClosed||p(new Date(t.JackpotEndTime),new Date),InProgress:t.Enabled&&!t.IsClosed}}getJackpotHeaderTemplate(t){const o=!!t.WinBalance,a=l(t.Type,this.language),i=l(t.Reason,this.language),s=(null==t?void 0:t.IsClosed)?i:a,n=`JackpotBalance Jackpot${l(t.Type,this.language)}`,r=t.Enabled?"JackpotJoinButton Joined":"JackpotJoinButton",c=l(t.Enabled?"unjoin":"join",this.language),d=t.Pending||(null==t?void 0:t.IsClosed)||p(new Date(t.JackpotEndTime),new Date);return e("div",{class:"JackpotCardHeader"},e("div",{class:"JackpotTitle"},e("span",{class:"JackpotName"},s),e("span",{class:n},function(t,o,e=99999999){return t=Math.min(t,e),`${o} ${new Intl.NumberFormat("en",{minimumFractionDigits:2,maximumFractionDigits:2}).format(t)}`}(t.Balance,t.Currency))),e("div",{class:"JackpotActions"},e("button",{class:r,onClick:this.jackpotChangeStatusRequest,"data-id":t.JackpotId,disabled:d},c)),o&&e("span",{class:"JackpotWon"},l("jackpotIsWon",this.language)))}getJackpotDescriptionTemplate(t){const o=+t.OperatorContributionPercent+"%",a=`1:${t.Probability}`,i=p(new Date(t.JackpotEndTime),new Date)?l("outdatedJackpotCountdown",this.language):this.timers[t.JackpotId],s=l("operatorContribution",this.language),n=l("type",this.language),r=l("winningProbability",this.language);return e("div",{class:"JackpotCardDescription"},!t.IsClosed&&e("span",{class:"JackpotCountdown"},i),e("div",{class:"JackpotCardDescriptionBlock"},e("div",{class:"JackpotCardDescriptionRow"},e("span",null,s,":"),e("span",{class:"JackpotDescriptionValue"},o,e("button",{class:"JackpotContributionTooltipButton","data-tooltip":"contributionTooltip",onClick:this.toggleTooltip}))),this.renderDescriptionRowInfo(`${r}:`,a),this.renderDescriptionRowInfo(`${n}:`,t.JackpotTypePresentation),e("a",{href:t.JackpotRulesUrl,target:"_blank",onClick:this.stopPropagation},l("termsAndConditions",this.language))))}renderDescriptionRowInfo(t,o){return e("div",{class:"JackpotCardDescriptionRow"},e("span",null,t),e("span",{class:"JackpotDescriptionValue"},o))}getJackpotTemplate(t){return e("div",{class:this.getJackpotClasses(t),onClick:this.handleJackpotClick,key:t.JackpotId,"data-id":t.JackpotId},this.getJackpotHeaderTemplate(t),this.getJackpotDescriptionTemplate(t))}getHeaderTemplate(){return e("header",{class:"JackpotsListPopupHeader"},e("button",{onClick:this.toggleTooltip,"data-tooltip":"tooltip",class:"JackpotsIconButton"},e("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/help.svg",alt:"Show tooltip"})),e("div",{class:"JackpotsListPopupHeaderName"},l("jackpots",this.language)),e("button",{class:"JackpotsIconButton",onClick:this.handleCloseClick},e("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Close jackpots list"})))}getListTemplate(){const t=this.jackpots.every((t=>t.IsClosed));return this.jackpots.length?e("div",{class:"JackpotsListWrapper"},t&&e("div",{class:"JackpotsListClosed"},e("h2",null,l("allJackpotsClosed",this.language))),e("div",{class:"JackpotsList"},this.jackpots.map((t=>this.getJackpotTemplate(t))))):e("div",{class:"JackpotsListClosed"},e("h2",null,l("allJackpotsClosed",this.language)))}getTooltipTemplate(){return e("div",{class:"JackpotsTooltipBackdrop"},e("div",{class:"JackpotsTooltip"},e("button",{class:"JackpotsIconButton",onClick:this.toggleTooltip},e("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Close tooltip"})),this.tooltip))}render(){return e("div",{key:"6023f09563b6f9161bbcf8426610cf17233cdc4d",class:`JackpotsListPopup ${this.device}`},this.getHeaderTemplate(),this.getListTemplate(),this.tooltip&&this.getTooltipTemplate())}get host(){return a(this)}static get watchers(){return{jackpots:["jackpotsPropHandler"]}}};d.style='@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@600&display=swap");:host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}body{margin:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.JackpotsListPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:var(--emw--border-radius-medium, 8px);overflow:hidden;flex-direction:column;position:relative;padding-bottom:20px}.JackpotsListPopupHeader{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.JackpotsIconButton{width:16px;height:16px;cursor:pointer}.JackpotsListPopupHeaderName{color:var(--emw--color-gray-100, #BBB9C3);font-size:14px;font-weight:500;line-height:14px}.JackpotsListWrapper{overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.JackpotsListWrapper::-webkit-scrollbar{display:none}.JackpotsList{display:flex;flex-direction:column;row-gap:12px;padding:8px 19px 0}.JackpotCard{padding:15px 15px 19px;border:1px solid var(--emw--button-border-color, #403956);border-radius:var(--emw--border-radius-small, 6px);position:relative;cursor:pointer}.JackpotJoinButton:not([disabled]).Joined::before,.JackpotCard.InProgress::before{content:"";position:absolute;inset:0;border-radius:var(--emw--button-border-radius, 4px);padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.JackpotCard.JackpotCardSuspended *{color:var(--emw--color-primary, #8F8B9C)}.JackpotCard.JackpotCardSuspended .JackpotBalance,.JackpotCard.JackpotCardSuspended .JackpotWon{-webkit-text-fill-color:var(--emw--color-primary, #8F8B9C)}.JackpotCardHeader{display:flex;justify-content:space-between;gap:24px}.JackpotTitle{display:flex;flex-direction:column;justify-content:space-between}.JackpotName{color:var(--emw--color-typography, #FFFFFF);font-family:"Montserrat", sans-serif;line-height:22px;font-weight:700;font-size:18px;word-break:break-word;margin-bottom:4px}.JackpotMega,.JackpotWon{background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%)}.JackpotMajor{background:linear-gradient(180deg, #A19FA0 5.36%, #E1DBDB 28.86%, #FEFFFF 36.86%, #E1DBDB 44.36%, #5E5B5F 91.86%)}.JackpotMinor{background:linear-gradient(180deg, #A0522C 5.36%, #FFAB8C 28.86%, #FFEEDF 36.86%, #FFAB8C 44.36%, #6A3A21 91.86%)}.JackpotBalance,.JackpotWon{font-weight:bold;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent}.JackpotCardDescription{display:flex;flex-direction:column;margin-top:12px}.JackpotCardDescriptionRow{display:flex;align-items:center;color:var(--emw--color-primary, #8F8B9C);font-size:12px;line-height:12px}.JackpotCardDescriptionRow .JackpotDescriptionValue{font-weight:600;margin-left:2px}.JackpotCardDescriptionColumn{display:flex;flex-direction:column;row-gap:4px}.JackpotCardDescriptionBlock{display:flex;justify-content:space-between;column-gap:14px}.JackpotCardDescriptionBlock a{color:var(--emw--color-secondary, #59D1FF);text-underline-offset:3px;font-size:11px}.JackpotJoinButton{transition:all 0.5s ease-out;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:var(--emw--color-typography, #1E1638);border-radius:99px;min-width:88px;height:32px;font-size:14px;font-weight:700;position:relative;font-family:"Montserrat", sans-serif}.JackpotJoinButton.Joined{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.JackpotJoinButton.Joined:not([disabled])::before{border-radius:99px}.JackpotJoinButton[disabled]{opacity:0.5;pointer-events:none;cursor:auto}.JackpotsListSuspended{padding:20px 19px}.JackpotsListSuspended h2{font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3);font-weight:400}.JackpotCountdown{color:var(--emw--color-gray-100, #BBB9C3);font-size:12px;line-height:12px;margin-bottom:12px}.JackpotsTooltipBackdrop{padding:48px 30px 0;position:absolute;width:100%;height:100%;inset:0;background-color:rgba(0, 0, 0, 0.5)}.JackpotsTooltipBackdrop .JackpotsTooltip{border:1px solid var(--emw--button-border-color, #403956);background-color:var(--emw--color-background, #1E1638);border-radius:8px;padding:32px;font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3);position:relative}.JackpotsTooltipBackdrop .JackpotsTooltip .JackpotsIconButton{top:12px;right:6px;position:absolute}.JackpotsListPopup.Tablet .JackpotsListPopupHeader,.JackpotsListPopup.Desktop .JackpotsListPopupHeader{padding-top:16px}.JackpotsListPopup.Tablet .JackpotsListPopupHeaderName,.JackpotsListPopup.Desktop .JackpotsListPopupHeaderName{font-size:16px;line-height:16px}.JackpotsListPopup.Tablet .JackpotsIconButton,.JackpotsListPopup.Desktop .JackpotsIconButton{width:24px;height:24px}.JackpotsListPopup.Tablet .JackpotsList,.JackpotsListPopup.Desktop .JackpotsList{padding:20px 24px 0;row-gap:20px}.JackpotsListPopup.Tablet .JackpotCardHeader,.JackpotsListPopup.Desktop .JackpotCardHeader{margin-bottom:16px}.JackpotsListPopup.Tablet .JackpotName,.JackpotsListPopup.Desktop .JackpotName{line-height:27px;font-size:22px}.JackpotsListPopup.Tablet .JackpotJoinButton,.JackpotsListPopup.Desktop .JackpotJoinButton{min-width:100px;height:36px;font-size:16px}.JackpotsListPopup.Tablet .JackpotCountdown,.JackpotsListPopup.Desktop .JackpotCountdown{font-size:14px;line-height:14px}.JackpotsListPopup.Tablet .JackpotTooltip,.JackpotsListPopup.Desktop .JackpotTooltip{padding:60px 65px;font-size:16px;line-height:20px}.JackpotsListPopup.Tablet .JackpotTooltip .JackpotsIconButton,.JackpotsListPopup.Desktop .JackpotTooltip .JackpotsIconButton{top:24px;right:24px}';export{d as casino_engagement_suite_jackpots_list}
@@ -0,0 +1,2 @@
1
+ var e=Object.defineProperty,t=new WeakMap,n=e=>t.get(e),l=(e,n)=>t.set(n.t=e,n),o=(e,t)=>t in e,s=(e,t)=>(0,console.error)(e,t),r=new Map,i=new Map,c="slot-fb{display:contents}slot-fb[hidden]{display:none}",u="undefined"!=typeof window?window:{},a=u.document||{head:{}},f={l:0,o:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},h=e=>Promise.resolve(e),d=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),m=!1,p=[],y=[],$=(e,t)=>n=>{e.push(n),m||(m=!0,t&&4&f.l?v(w):f.raf(w))},b=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){s(e)}e.length=0},w=()=>{b(p),b(y),(m=p.length>0)&&f.raf(w)},v=e=>h().then(e),g=$(y,!0),S={},j=e=>"object"==(e=typeof e)||"function"===e;function k(e){var t,n,l;return null!=(l=null==(n=null==(t=e.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?l:void 0}((t,n)=>{for(var l in n)e(t,l,{get:n[l],enumerable:!0})})({},{err:()=>O,map:()=>C,ok:()=>E,unwrap:()=>x,unwrapErr:()=>P});var E=e=>({isOk:!0,isErr:!1,value:e}),O=e=>({isOk:!1,isErr:!0,value:e});function C(e,t){if(e.isOk){const n=t(e.value);return n instanceof Promise?n.then((e=>E(e))):E(n)}if(e.isErr)return O(e.value);throw"should never get here"}var M,x=e=>{if(e.isOk)return e.value;throw e.value},P=e=>{if(e.isErr)return e.value;throw e.value},R=(e,t,...n)=>{let l=null,o=null,s=!1,r=!1;const i=[],c=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!j(l))&&(l+=""),s&&r?i[i.length-1].i+=l:i.push(s?A(null,l):l),r=s)};if(c(n),t){t.key&&(o=t.key);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}const u=A(e,null);return u.u=t,i.length>0&&(u.h=i),u.m=o,u},A=(e,t)=>({l:0,p:e,i:t,$:null,h:null,u:null,m:null}),T={},D=e=>n(e).$hostElement$,H=(e,t,n)=>{const l=D(e);return{emit:e=>L(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},L=(e,t,n)=>{const l=f.ce(t,n);return e.dispatchEvent(l),l},N=new WeakMap,U=e=>"sc-"+e.v,W=(e,t,n,l,s,r)=>{if(n!==l){let i=o(e,t),c=t.toLowerCase();if("class"===t){const t=e.classList,o=q(n),s=q(l);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("key"===t);else if(i||"o"!==t[0]||"n"!==t[1]){const o=j(l);if((i||o&&null!==l)&&!s)try{if(e.tagName.includes("-"))e[t]=l;else{const o=null==l?"":l;"list"===t?i=!1:null!=n&&e[t]==o||(e[t]=o)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&r||s)&&!o&&e.setAttribute(t,l=!0===l?"":l)}else if(t="-"===t[2]?t.slice(3):o(u,c)?c.slice(2):c[2]+t.slice(3),n||l){const o=t.endsWith(G);t=t.replace(V,""),n&&f.rel(e,t,n,o),l&&f.ael(e,t,l,o)}}},F=/\s/,q=e=>e?e.split(F):[],G="Capture",V=RegExp(G+"$"),_=(e,t,n)=>{const l=11===t.$.nodeType&&t.$.host?t.$.host:t.$,o=e&&e.u||S,s=t.u||S;for(const e of z(Object.keys(o)))e in s||W(l,e,o[e],void 0,n,t.l);for(const e of z(Object.keys(s)))W(l,e,o[e],s[e],n,t.l)};function z(e){return e.includes("ref")?[...e.filter((e=>"ref"!==e)),"ref"]:e}var B=!1,I=(e,t,n)=>{const l=t.h[n];let o,s,r=0;if(null!==l.i)o=l.$=a.createTextNode(l.i);else if(o=l.$=a.createElement(l.p),_(null,l,B),o.getRootNode().querySelector("body"),l.h)for(r=0;r<l.h.length;++r)s=I(e,l,r),s&&o.appendChild(s);return o["s-hn"]=M,o},J=(e,t,n,l,o,s)=>{let r,i=e;for(i.shadowRoot&&i.tagName===M&&(i=i.shadowRoot);o<=s;++o)l[o]&&(r=I(null,n,o),r&&(l[o].$=r,Y(i,r,t)))},K=(e,t,n)=>{for(let l=t;l<=n;++l){const t=e[l];if(t){const e=t.$;e&&e.remove()}}},Q=(e,t,n=!1)=>e.p===t.p&&(!!n||e.m===t.m),X=(e,t,n=!1)=>{const l=t.$=e.$,o=e.h,s=t.h,r=t.i;null===r?(_(e,t,B),null!==o&&null!==s?((e,t,n,l,o=!1)=>{let s,r,i=0,c=0,u=0,a=0,f=t.length-1,h=t[0],d=t[f],m=l.length-1,p=l[0],y=l[m];for(;i<=f&&c<=m;)if(null==h)h=t[++i];else if(null==d)d=t[--f];else if(null==p)p=l[++c];else if(null==y)y=l[--m];else if(Q(h,p,o))X(h,p,o),h=t[++i],p=l[++c];else if(Q(d,y,o))X(d,y,o),d=t[--f],y=l[--m];else if(Q(h,y,o))X(h,y,o),Y(e,h.$,d.$.nextSibling),h=t[++i],y=l[--m];else if(Q(d,p,o))X(d,p,o),Y(e,d.$,h.$),d=t[--f],p=l[++c];else{for(u=-1,a=i;a<=f;++a)if(t[a]&&null!==t[a].m&&t[a].m===p.m){u=a;break}u>=0?(r=t[u],r.p!==p.p?s=I(t&&t[c],n,u):(X(r,p,o),t[u]=void 0,s=r.$),p=l[++c]):(s=I(t&&t[c],n,c),p=l[++c]),s&&Y(h.$.parentNode,s,h.$)}i>f?J(e,null==l[m+1]?null:l[m+1].$,n,l,c,m):c>m&&K(t,i,f)})(l,o,t,s,n):null!==s?(null!==e.i&&(l.textContent=""),J(l,null,t,s,0,s.length-1)):!n&&null!==o&&K(o,0,o.length-1)):e.i!==r&&(l.data=r)},Y=(e,t,n)=>null==e?void 0:e.insertBefore(t,n),Z=(e,t)=>{t&&!e.S&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.S=t)))},ee=(e,t)=>{if(e.l|=16,!(4&e.l))return Z(e,e.j),g((()=>te(e,t)));e.l|=512},te=(e,t)=>{const n=e.t;if(!n)throw Error(`Can't render component <${e.$hostElement$.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let l;return t&&(l=ce(n,"componentWillLoad")),ne(l,(()=>oe(e,n,t)))},ne=(e,t)=>le(e)?e.then(t).catch((e=>{console.error(e),t()})):t(),le=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,oe=async(e,t,n)=>{var l;const o=e.$hostElement$,s=o["s-rc"];n&&(e=>{const t=e.k,n=e.$hostElement$,l=t.l,o=((e,t)=>{var n;const l=U(t),o=i.get(l);if(e=11===e.nodeType?e:a,o)if("string"==typeof o){let s,r=N.get(e=e.head||e);if(r||N.set(e,r=new Set),!r.has(l)){{s=a.createElement("style"),s.innerHTML=o;const l=null!=(n=f.O)?n:k(a);null!=l&&s.setAttribute("nonce",l),(!(1&t.l)||1&t.l&&"HEAD"!==e.nodeName)&&e.insertBefore(s,e.querySelector("link"))}4&t.l&&(s.innerHTML+=c),r&&r.add(l)}}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o]);return l})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&2&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);se(e,t,o,n),s&&(s.map((e=>e())),o["s-rc"]=void 0);{const t=null!=(l=o["s-p"])?l:[],n=()=>re(e);0===t.length?n():(Promise.all(t).then(n),e.l|=4,t.length=0)}},se=(e,t,n,l)=>{try{t=t.render(),e.l&=-17,e.l|=2,((e,t,n=!1)=>{const l=e.$hostElement$,o=e.k,s=e.C||A(null,null),r=(e=>e&&e.p===T)(t)?t:R(null,null,t);if(M=l.tagName,o.M&&(r.u=r.u||{},o.M.map((([e,t])=>r.u[t]=l[e]))),n&&r.u)for(const e of Object.keys(r.u))l.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(r.u[e]=l[e]);r.p=null,r.l|=4,e.C=r,r.$=s.$=l.shadowRoot||l,X(s,r,n)})(e,t,l)}catch(t){s(t,e.$hostElement$)}return null},re=e=>{const t=e.$hostElement$,n=e.j;ce(e.t,"componentDidRender"),64&e.l||(e.l|=64,ue(t),e.P(t),n||ie()),e.S&&(e.S(),e.S=void 0),512&e.l&&v((()=>ee(e,!1))),e.l&=-517},ie=()=>{ue(a.documentElement),v((()=>L(u,"appload",{detail:{namespace:"casino-engagement-suite-jackpots-list"}})))},ce=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){s(e)}},ue=e=>e.classList.add("hydrated"),ae=(e,t,l)=>{var o,r;const i=e.prototype;if(t.R||t.A||e.watchers){e.watchers&&!t.A&&(t.A=e.watchers);const c=Object.entries(null!=(o=t.R)?o:{});if(c.map((([e,[o]])=>{(31&o||2&l&&32&o)&&Object.defineProperty(i,e,{get(){return((e,t)=>n(this).T.get(t))(0,e)},set(l){((e,t,l,o)=>{const r=n(e);if(!r)throw Error(`Couldn't find host element for "${o.v}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`);const i=r.$hostElement$,c=r.T.get(t),u=r.l,a=r.t;if(l=((e,t)=>null==e||j(e)?e:1&t?e+"":e)(l,o.R[t][0]),(!(8&u)||void 0===c)&&l!==c&&(!Number.isNaN(c)||!Number.isNaN(l))&&(r.T.set(t,l),a)){if(o.A&&128&u){const e=o.A[t];e&&e.map((e=>{try{a[e](l,c,t)}catch(e){s(e,i)}}))}2==(18&u)&&ee(r,!1)}})(this,e,l,t)},configurable:!0,enumerable:!0})})),1&l){const l=new Map;i.attributeChangedCallback=function(e,o,s){f.jmp((()=>{var r;const c=l.get(e);if(this.hasOwnProperty(c))s=this[c],delete this[c];else{if(i.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==s)return;if(null==c){const l=n(this),i=null==l?void 0:l.l;if(i&&!(8&i)&&128&i&&s!==o){const n=l.t,i=null==(r=t.A)?void 0:r[e];null==i||i.forEach((t=>{null!=n[t]&&n[t].call(n,s,o,e)}))}return}}this[c]=(null!==s||"boolean"!=typeof this[c])&&s}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(r=t.A)?r:{}),...c.filter((([e,t])=>15&t[0])).map((([e,n])=>{var o;const s=n[1]||e;return l.set(s,e),512&n[0]&&(null==(o=t.M)||o.push([e,s])),s}))]))}}return e},fe=e=>{ce(e,"disconnectedCallback")},he=(e,l={})=>{var o;const h=[],m=l.exclude||[],p=u.customElements,y=a.head,$=y.querySelector("meta[charset]"),b=a.createElement("style"),w=[];let v,g=!0;Object.assign(f,l),f.o=new URL(l.resourcesUrl||"./",a.baseURI).href;let S=!1;if(e.map((e=>{e[1].map((l=>{var o;const c={l:l[0],v:l[1],R:l[2],D:l[3]};4&c.l&&(S=!0),c.R=l[2],c.M=[],c.A=null!=(o=l[4])?o:{};const u=c.v,a=class extends HTMLElement{constructor(e){if(super(e),this.hasRegisteredEventListeners=!1,((e,n)=>{const l={l:0,$hostElement$:e,k:n,T:new Map};l.H=new Promise((e=>l.P=e)),e["s-p"]=[],e["s-rc"]=[],t.set(e,l)})(e=this,c),1&c.l)if(e.shadowRoot){if("open"!==e.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${c.v}! Mode is set to ${e.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else e.attachShadow({mode:"open"})}connectedCallback(){this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),v&&(clearTimeout(v),v=null),g?w.push(this):f.jmp((()=>(e=>{if(!(1&f.l)){const t=n(e),l=t.k,o=()=>{};if(1&t.l)(null==t?void 0:t.t)||(null==t?void 0:t.H)&&t.H.then((()=>{}));else{t.l|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){Z(t,t.j=n);break}}l.R&&Object.entries(l.R).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n)=>{let l;if(!(32&t.l)){if(t.l|=32,n.L){const e=(e=>{const t=e.v.replace(/-/g,"_"),n=e.L;if(!n)return;const l=r.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(r.set(n,e),e[t])),s)
2
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n);if(e&&"then"in e){const t=()=>{};l=await e,t()}else l=e;if(!l)throw Error(`Constructor for "${n.v}#${t.N}" was not found`);l.isProxied||(n.A=l.watchers,ae(l,n,2),l.isProxied=!0);const o=()=>{};t.l|=8;try{new l(t)}catch(e){s(e)}t.l&=-9,t.l|=128,o()}else l=e.constructor,customElements.whenDefined(e.localName).then((()=>t.l|=128));if(l&&l.style){let e;"string"==typeof l.style&&(e=l.style);const t=U(n);if(!i.has(t)){const l=()=>{};((e,t,n)=>{let l=i.get(e);d&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,i.set(e,l)})(t,e,!!(1&n.l)),l()}}}const o=t.j,c=()=>ee(t,!0);o&&o["s-rc"]?o["s-rc"].push(c):c()})(e,t,l)}o()}})(this)))}disconnectedCallback(){f.jmp((()=>(async()=>{if(!(1&f.l)){const e=n(this);(null==e?void 0:e.t)?fe(e.t):(null==e?void 0:e.H)&&e.H.then((()=>fe(e.t)))}})()))}componentOnReady(){return n(this).H}};c.L=e[0],m.includes(u)||p.get(u)||(h.push(u),p.define(u,ae(a,c,1)))}))})),h.length>0&&(S&&(b.textContent+=c),b.textContent+=h.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",b.innerHTML.length)){b.setAttribute("data-styles","");const e=null!=(o=f.O)?o:k(a);null!=e&&b.setAttribute("nonce",e),y.insertBefore(b,$?$.nextSibling:y.firstChild)}g=!1,w.length?w.map((e=>e.connectedCallback())):f.jmp((()=>v=setTimeout(ie,30)))},de=e=>f.O=e;export{he as b,H as c,D as g,R as h,h as p,l as r,de as s}
@@ -0,0 +1 @@
1
+ const o=()=>{};export{o as g}
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ const globalScripts = () => {};
4
+
5
+ exports.globalScripts = globalScripts;
@@ -0,0 +1,301 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-d6d19ec7.js');
6
+
7
+ function _typeof(o) {
8
+ "@babel/helpers - typeof";
9
+
10
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
11
+ return typeof o;
12
+ } : function (o) {
13
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
14
+ }, _typeof(o);
15
+ }
16
+
17
+ function requiredArgs(required, args) {
18
+ if (args.length < required) {
19
+ throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
20
+ }
21
+ }
22
+
23
+ /**
24
+ * @name toDate
25
+ * @category Common Helpers
26
+ * @summary Convert the given argument to an instance of Date.
27
+ *
28
+ * @description
29
+ * Convert the given argument to an instance of Date.
30
+ *
31
+ * If the argument is an instance of Date, the function returns its clone.
32
+ *
33
+ * If the argument is a number, it is treated as a timestamp.
34
+ *
35
+ * If the argument is none of the above, the function returns Invalid Date.
36
+ *
37
+ * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
38
+ *
39
+ * @param {Date|Number} argument - the value to convert
40
+ * @returns {Date} the parsed date in the local time zone
41
+ * @throws {TypeError} 1 argument required
42
+ *
43
+ * @example
44
+ * // Clone the date:
45
+ * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
46
+ * //=> Tue Feb 11 2014 11:30:30
47
+ *
48
+ * @example
49
+ * // Convert the timestamp to date:
50
+ * const result = toDate(1392098430000)
51
+ * //=> Tue Feb 11 2014 11:30:30
52
+ */
53
+ function toDate(argument) {
54
+ requiredArgs(1, arguments);
55
+ var argStr = Object.prototype.toString.call(argument);
56
+
57
+ // Clone the date
58
+ if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
59
+ // Prevent the date to lose the milliseconds when passed to new Date() in IE10
60
+ return new Date(argument.getTime());
61
+ } else if (typeof argument === 'number' || argStr === '[object Number]') {
62
+ return new Date(argument);
63
+ } else {
64
+ if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
65
+ // eslint-disable-next-line no-console
66
+ console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
67
+ // eslint-disable-next-line no-console
68
+ console.warn(new Error().stack);
69
+ }
70
+ return new Date(NaN);
71
+ }
72
+ }
73
+
74
+ /**
75
+ * @name isBefore
76
+ * @category Common Helpers
77
+ * @summary Is the first date before the second one?
78
+ *
79
+ * @description
80
+ * Is the first date before the second one?
81
+ *
82
+ * @param {Date|Number} date - the date that should be before the other one to return true
83
+ * @param {Date|Number} dateToCompare - the date to compare with
84
+ * @returns {Boolean} the first date is before the second date
85
+ * @throws {TypeError} 2 arguments required
86
+ *
87
+ * @example
88
+ * // Is 10 July 1989 before 11 February 1987?
89
+ * const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))
90
+ * //=> false
91
+ */
92
+ function isBefore(dirtyDate, dirtyDateToCompare) {
93
+ requiredArgs(2, arguments);
94
+ var date = toDate(dirtyDate);
95
+ var dateToCompare = toDate(dirtyDateToCompare);
96
+ return date.getTime() < dateToCompare.getTime();
97
+ }
98
+
99
+ const DEFAULT_LANGUAGE = 'en';
100
+ const SUPPORTED_LANGUAGES = ['en'];
101
+ const TRANSLATIONS = {
102
+ en: {
103
+ jackpots: 'Jackpots',
104
+ join: 'Join',
105
+ unjoin: 'Unjoin',
106
+ tooltip: 'A payout that increases each time the game is played but the jackpot is not won',
107
+ mega: 'Mega',
108
+ major: 'Major',
109
+ minor: 'Minor',
110
+ suspended: 'Suspended Jackpot',
111
+ allJackpotsSuspended: 'Unfortunately, there are no available jackpots to join. Please, try again later.',
112
+ jackpotIsWon: 'Jackpot is Won',
113
+ termsAndConditions: 'Terms and Conditions',
114
+ winingProbability: 'Winning Probability',
115
+ type: 'Type',
116
+ operatorContribution: 'Operator Contribution',
117
+ outdatedJackpotCountdown: 'We are going to remove this Jackpot in 30 days'
118
+ }
119
+ };
120
+ const translate = (key, customLang) => {
121
+ const lang = customLang;
122
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
123
+ };
124
+
125
+ function formatBalance(amount, currency, maxAmount = 99999999) {
126
+ amount = Math.min(amount, maxAmount);
127
+ return `${currency} ${new Intl.NumberFormat('en', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
128
+ .format(amount)}`;
129
+ }
130
+
131
+ const casinoEngagementSuiteJackpotsListCss = "@import url(\"https://fonts.googleapis.com/css2?family=Montserrat:wght@600&display=swap\");:host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}body{margin:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.JackpotsListPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:var(--emw--border-radius-medium, 8px);overflow:hidden;flex-direction:column;position:relative;padding-bottom:20px}.JackpotsListPopupHeader{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.JackpotsIconButton{width:16px;height:16px;cursor:pointer}.JackpotsListPopupHeaderName{color:var(--emw--color-gray-100, #BBB9C3);font-size:14px;font-weight:500;line-height:14px}.JackpotsListWrapper{overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.JackpotsListWrapper::-webkit-scrollbar{display:none}.JackpotsList{display:flex;flex-direction:column;row-gap:12px;padding:8px 19px 0}.JackpotCard{padding:15px 15px 19px;border:1px solid var(--emw--button-border-color, #403956);border-radius:var(--emw--border-radius-small, 6px);position:relative;cursor:pointer}.JackpotJoinButton:not([disabled]).Joined::before,.JackpotCard.InProgress::before{content:\"\";position:absolute;inset:0;border-radius:var(--emw--button-border-radius, 4px);padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.JackpotCard.JackpotCardSuspended *{color:var(--emw--color-primary, #8F8B9C)}.JackpotCard.JackpotCardSuspended .JackpotBalance,.JackpotCard.JackpotCardSuspended .JackpotWon{-webkit-text-fill-color:var(--emw--color-primary, #8F8B9C)}.JackpotCardHeader{display:flex;justify-content:space-between;gap:24px}.JackpotTitle{display:flex;flex-direction:column;justify-content:space-between}.JackpotName{color:var(--emw--color-typography, #FFFFFF);font-family:\"Montserrat\", sans-serif;line-height:22px;font-weight:700;font-size:18px;word-break:break-word;margin-bottom:4px}.JackpotMega,.JackpotWon{background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%)}.JackpotMajor{background:linear-gradient(180deg, #A19FA0 5.36%, #E1DBDB 28.86%, #FEFFFF 36.86%, #E1DBDB 44.36%, #5E5B5F 91.86%)}.JackpotMinor{background:linear-gradient(180deg, #A0522C 5.36%, #FFAB8C 28.86%, #FFEEDF 36.86%, #FFAB8C 44.36%, #6A3A21 91.86%)}.JackpotBalance,.JackpotWon{font-weight:bold;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent}.JackpotCardDescription{display:flex;flex-direction:column;margin-top:12px}.JackpotCardDescriptionRow{display:flex;align-items:center;color:var(--emw--color-primary, #8F8B9C);font-size:12px;line-height:12px}.JackpotCardDescriptionRow .JackpotDescriptionValue{font-weight:600;margin-left:2px}.JackpotCardDescriptionColumn{display:flex;flex-direction:column;row-gap:4px}.JackpotCardDescriptionBlock{display:flex;justify-content:space-between;column-gap:14px}.JackpotCardDescriptionBlock a{color:var(--emw--color-secondary, #59D1FF);text-underline-offset:3px;font-size:11px}.JackpotJoinButton{transition:all 0.5s ease-out;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:var(--emw--color-typography, #1E1638);border-radius:99px;min-width:88px;height:32px;font-size:14px;font-weight:700;position:relative;font-family:\"Montserrat\", sans-serif}.JackpotJoinButton.Joined{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.JackpotJoinButton.Joined:not([disabled])::before{border-radius:99px}.JackpotJoinButton[disabled]{opacity:0.5;pointer-events:none;cursor:auto}.JackpotsListSuspended{padding:20px 19px}.JackpotsListSuspended h2{font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3);font-weight:400}.JackpotCountdown{color:var(--emw--color-gray-100, #BBB9C3);font-size:12px;line-height:12px;margin-bottom:12px}.JackpotsTooltipBackdrop{padding:48px 30px 0;position:absolute;width:100%;height:100%;inset:0;background-color:rgba(0, 0, 0, 0.5)}.JackpotsTooltipBackdrop .JackpotsTooltip{border:1px solid var(--emw--button-border-color, #403956);background-color:var(--emw--color-background, #1E1638);border-radius:8px;padding:32px;font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3);position:relative}.JackpotsTooltipBackdrop .JackpotsTooltip .JackpotsIconButton{top:12px;right:6px;position:absolute}.JackpotsListPopup.Tablet .JackpotsListPopupHeader,.JackpotsListPopup.Desktop .JackpotsListPopupHeader{padding-top:16px}.JackpotsListPopup.Tablet .JackpotsListPopupHeaderName,.JackpotsListPopup.Desktop .JackpotsListPopupHeaderName{font-size:16px;line-height:16px}.JackpotsListPopup.Tablet .JackpotsIconButton,.JackpotsListPopup.Desktop .JackpotsIconButton{width:24px;height:24px}.JackpotsListPopup.Tablet .JackpotsList,.JackpotsListPopup.Desktop .JackpotsList{padding:20px 24px 0;row-gap:20px}.JackpotsListPopup.Tablet .JackpotCardHeader,.JackpotsListPopup.Desktop .JackpotCardHeader{margin-bottom:16px}.JackpotsListPopup.Tablet .JackpotName,.JackpotsListPopup.Desktop .JackpotName{line-height:27px;font-size:22px}.JackpotsListPopup.Tablet .JackpotJoinButton,.JackpotsListPopup.Desktop .JackpotJoinButton{min-width:100px;height:36px;font-size:16px}.JackpotsListPopup.Tablet .JackpotCountdown,.JackpotsListPopup.Desktop .JackpotCountdown{font-size:14px;line-height:14px}.JackpotsListPopup.Tablet .JackpotTooltip,.JackpotsListPopup.Desktop .JackpotTooltip{padding:60px 65px;font-size:16px;line-height:20px}.JackpotsListPopup.Tablet .JackpotTooltip .JackpotsIconButton,.JackpotsListPopup.Desktop .JackpotTooltip .JackpotsIconButton{top:24px;right:24px}";
132
+ const CasinoEngagementSuiteJackpotsListStyle0 = casinoEngagementSuiteJackpotsListCss;
133
+
134
+ const CasinoEngagementSuiteJackpotsList = class {
135
+ constructor(hostRef) {
136
+ index.registerInstance(this, hostRef);
137
+ this.close = index.createEvent(this, "close", 7);
138
+ this.setClientStyling = () => {
139
+ let sheet = document.createElement('style');
140
+ sheet.innerHTML = this.clientStyling;
141
+ this.host.prepend(sheet);
142
+ };
143
+ this.setClientStylingURL = () => {
144
+ let url = new URL(this.clientStylingUrl);
145
+ let cssFile = document.createElement('style');
146
+ fetch(url.href)
147
+ .then((res) => res.text())
148
+ .then((data) => {
149
+ cssFile.innerHTML = data;
150
+ setTimeout(() => {
151
+ this.host.prepend(cssFile);
152
+ }, 1);
153
+ })
154
+ .catch((err) => {
155
+ console.log('Error ', err);
156
+ });
157
+ };
158
+ this.handleCloseClick = () => {
159
+ this.close.emit();
160
+ this.tooltip = null;
161
+ };
162
+ this.toggleTooltip = (ev) => {
163
+ ev.stopPropagation();
164
+ if (this.tooltip) {
165
+ this.tooltip = null;
166
+ }
167
+ else {
168
+ const el = ev.currentTarget;
169
+ this.tooltip = translate(el.getAttribute('data-tooltip'), this.language);
170
+ }
171
+ };
172
+ this.stopPropagation = (ev) => {
173
+ ev.stopPropagation();
174
+ };
175
+ this.handleJackpotClick = (ev) => {
176
+ const id = +ev.currentTarget.getAttribute('data-id');
177
+ window.postMessage({ type: 'JackpotClick', id });
178
+ };
179
+ this.clientStyling = '';
180
+ this.clientStylingUrl = '';
181
+ this.language = 'en';
182
+ this.device = 'Mobile';
183
+ this.jackpots = [];
184
+ this.jackpotChangeStatusRequest = undefined;
185
+ this.tooltip = null;
186
+ this.timers = {};
187
+ this.limitStylingAppends = false;
188
+ }
189
+ jackpotsPropHandler(value) {
190
+ if (!this.interval && value.length) {
191
+ this.startCountdown();
192
+ }
193
+ if (this.interval && !value.length) {
194
+ clearInterval(this.interval);
195
+ }
196
+ }
197
+ componentWillLoad() {
198
+ this.jackpotsPropHandler(this.jackpots);
199
+ }
200
+ startCountdown() {
201
+ this.updateTimers();
202
+ this.interval = setInterval(() => {
203
+ this.updateTimers();
204
+ }, 1000);
205
+ }
206
+ updateTimers() {
207
+ const now = new Date().getTime();
208
+ this.timers = this.jackpots.reduce((acc, jackpot) => {
209
+ const expirationDate = new Date(jackpot.JackpotEndTime).getTime();
210
+ const diff = expirationDate - now;
211
+ let countdown = '00h:00m:00s';
212
+ const { days, hours, minutes, seconds } = {
213
+ days: String(Math.floor(diff / (1000 * 60 * 60 * 24))).padStart(2, '0'),
214
+ hours: String(Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))).padStart(2, '0'),
215
+ minutes: String(Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60))).padStart(2, '0'),
216
+ seconds: String(Math.floor((diff % (1000 * 60)) / 1000)).padStart(2, '0'),
217
+ };
218
+ countdown =
219
+ days === '00'
220
+ ? `${hours}h:${minutes}m:${seconds}s`
221
+ : `${days}d:${hours}h:${minutes}m`;
222
+ return Object.assign(Object.assign({}, acc), { [jackpot.JackpotId]: countdown });
223
+ }, {});
224
+ }
225
+ componentDidRender() {
226
+ if (!this.limitStylingAppends && this.host) {
227
+ if (this.clientStyling)
228
+ this.setClientStyling();
229
+ if (this.clientStylingUrl)
230
+ this.setClientStylingURL();
231
+ this.limitStylingAppends = true;
232
+ }
233
+ }
234
+ disconnectedCallback() {
235
+ this.interval && clearInterval(this.interval);
236
+ }
237
+ getJackpotClasses(jackpot) {
238
+ return {
239
+ JackpotCard: true,
240
+ JackpotCardClosed: jackpot.IsClosed || isBefore(new Date(jackpot.JackpotEndTime), new Date()),
241
+ InProgress: jackpot.Enabled && !jackpot.IsClosed,
242
+ };
243
+ }
244
+ getJackpotHeaderTemplate(jackpot) {
245
+ const jackpotIsWon = !!jackpot.WinBalance;
246
+ const jackpotTypeLabel = translate(jackpot.Type, this.language);
247
+ const jackpotClosedLabel = translate(jackpot.Reason, this.language);
248
+ const jackpotLabel = (jackpot === null || jackpot === void 0 ? void 0 : jackpot.IsClosed) ? jackpotClosedLabel : jackpotTypeLabel;
249
+ const jackpotClasses = `JackpotBalance Jackpot${translate(jackpot.Type, this.language)}`;
250
+ const buttonClass = jackpot.Enabled
251
+ ? 'JackpotJoinButton Joined'
252
+ : 'JackpotJoinButton';
253
+ const buttonText = jackpot.Enabled
254
+ ? translate('unjoin', this.language)
255
+ : translate('join', this.language);
256
+ const actionButtonIsDisabled = jackpot.Pending || (jackpot === null || jackpot === void 0 ? void 0 : jackpot.IsClosed) || isBefore(new Date(jackpot.JackpotEndTime), new Date());
257
+ return (index.h("div", { class: "JackpotCardHeader" }, index.h("div", { class: "JackpotTitle" }, index.h("span", { class: "JackpotName" }, jackpotLabel), index.h("span", { class: jackpotClasses }, formatBalance(jackpot.Balance, jackpot.Currency))), index.h("div", { class: "JackpotActions" }, index.h("button", { class: buttonClass, onClick: this.jackpotChangeStatusRequest, "data-id": jackpot.JackpotId, disabled: actionButtonIsDisabled }, buttonText)), jackpotIsWon && (index.h("span", { class: "JackpotWon" }, translate('jackpotIsWon', this.language)))));
258
+ }
259
+ getJackpotDescriptionTemplate(jackpot) {
260
+ const operatorContributionPercent = `${+jackpot.OperatorContributionPercent}%`;
261
+ const winingProbabilityPercent = `1:${jackpot.Probability}`;
262
+ const countdownValue = isBefore(new Date(jackpot.JackpotEndTime), new Date())
263
+ ? translate('outdatedJackpotCountdown', this.language)
264
+ : this.timers[jackpot.JackpotId];
265
+ const operatorContributionLabel = translate('operatorContribution', this.language);
266
+ const typeLabel = translate('type', this.language);
267
+ const winningProbabilityLabel = translate('winningProbability', this.language);
268
+ return (index.h("div", { class: "JackpotCardDescription" }, !jackpot.IsClosed && index.h("span", { class: "JackpotCountdown" }, countdownValue), index.h("div", { class: "JackpotCardDescriptionBlock" }, index.h("div", { class: "JackpotCardDescriptionRow" }, index.h("span", null, operatorContributionLabel, ":"), index.h("span", { class: "JackpotDescriptionValue" }, operatorContributionPercent, index.h("button", { class: "JackpotContributionTooltipButton", "data-tooltip": "contributionTooltip", onClick: this.toggleTooltip }))), this.renderDescriptionRowInfo(`${winningProbabilityLabel}:`, winingProbabilityPercent), this.renderDescriptionRowInfo(`${typeLabel}:`, jackpot.JackpotTypePresentation), index.h("a", { href: jackpot.JackpotRulesUrl, target: "_blank", onClick: this.stopPropagation }, translate('termsAndConditions', this.language)))));
269
+ }
270
+ renderDescriptionRowInfo(title, value) {
271
+ return (index.h("div", { class: "JackpotCardDescriptionRow" }, index.h("span", null, title), index.h("span", { class: "JackpotDescriptionValue" }, value)));
272
+ }
273
+ getJackpotTemplate(jackpot) {
274
+ return (index.h("div", { class: this.getJackpotClasses(jackpot), onClick: this.handleJackpotClick, key: jackpot.JackpotId, "data-id": jackpot.JackpotId }, this.getJackpotHeaderTemplate(jackpot), this.getJackpotDescriptionTemplate(jackpot)));
275
+ }
276
+ getHeaderTemplate() {
277
+ return (index.h("header", { class: "JackpotsListPopupHeader" }, index.h("button", { onClick: this.toggleTooltip, "data-tooltip": "tooltip", class: "JackpotsIconButton" }, index.h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/help.svg", alt: "Show tooltip" })), index.h("div", { class: "JackpotsListPopupHeaderName" }, translate('jackpots', this.language)), index.h("button", { class: "JackpotsIconButton", onClick: this.handleCloseClick }, index.h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", alt: "Close jackpots list" }))));
278
+ }
279
+ getListTemplate() {
280
+ const areAllJackpotsClosed = this.jackpots.every((item) => item.IsClosed);
281
+ if (this.jackpots.length) {
282
+ return (index.h("div", { class: "JackpotsListWrapper" }, areAllJackpotsClosed && (index.h("div", { class: "JackpotsListClosed" }, index.h("h2", null, translate('allJackpotsClosed', this.language)))), index.h("div", { class: "JackpotsList" }, this.jackpots.map((jackpot) => this.getJackpotTemplate(jackpot)))));
283
+ }
284
+ else {
285
+ return (index.h("div", { class: "JackpotsListClosed" }, index.h("h2", null, translate('allJackpotsClosed', this.language))));
286
+ }
287
+ }
288
+ getTooltipTemplate() {
289
+ return (index.h("div", { class: "JackpotsTooltipBackdrop" }, index.h("div", { class: "JackpotsTooltip" }, index.h("button", { class: "JackpotsIconButton", onClick: this.toggleTooltip }, index.h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", alt: "Close tooltip" })), this.tooltip)));
290
+ }
291
+ render() {
292
+ return (index.h("div", { key: '6023f09563b6f9161bbcf8426610cf17233cdc4d', class: `JackpotsListPopup ${this.device}` }, this.getHeaderTemplate(), this.getListTemplate(), this.tooltip && this.getTooltipTemplate()));
293
+ }
294
+ get host() { return index.getElement(this); }
295
+ static get watchers() { return {
296
+ "jackpots": ["jackpotsPropHandler"]
297
+ }; }
298
+ };
299
+ CasinoEngagementSuiteJackpotsList.style = CasinoEngagementSuiteJackpotsListStyle0;
300
+
301
+ exports.casino_engagement_suite_jackpots_list = CasinoEngagementSuiteJackpotsList;
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-d6d19ec7.js');
6
+ const appGlobals = require('./app-globals-3a1e7e63.js');
7
+
8
+ /*
9
+ Stencil Client Patch Browser v4.20.0 | MIT Licensed | https://stenciljs.com
10
+ */
11
+ var patchBrowser = () => {
12
+ const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('casino-engagement-suite-jackpots-list.cjs.js', document.baseURI).href));
13
+ const opts = {};
14
+ if (importMeta !== "") {
15
+ opts.resourcesUrl = new URL(".", importMeta).href;
16
+ }
17
+ return index.promiseResolve(opts);
18
+ };
19
+
20
+ patchBrowser().then(async (options) => {
21
+ await appGlobals.globalScripts();
22
+ return index.bootstrapLazy([["casino-engagement-suite-jackpots-list.cjs",[[1,"casino-engagement-suite-jackpots-list",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[1],"device":[1],"jackpots":[1040],"jackpotChangeStatusRequest":[1040],"tooltip":[32],"timers":[32],"limitStylingAppends":[32]},null,{"jackpots":["jackpotsPropHandler"]}]]]], options);
23
+ });
24
+
25
+ exports.setNonce = index.setNonce;