@everymatrix/lottery-game-details 1.87.25 → 1.87.27

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.
@@ -35,6 +35,8 @@ const getTranslations$1 = (data) => {
35
35
  });
36
36
  };
37
37
 
38
+ const StyleCacheKey = '__WIDGET_GLOBAL_STYLE_CACHE__';
39
+
38
40
  /**
39
41
  * @name setClientStyling
40
42
  * @description Method used to create and append to the passed element of the widget a style element with the content received
@@ -80,18 +82,75 @@ function setClientStylingURL(stylingContainer, clientStylingUrl) {
80
82
  * @param {HTMLElement} stylingContainer The highest element of the widget
81
83
  * @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
82
84
  * @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
85
+ * @param {boolean} useAdoptedStyleSheets A flag to gradually enable testing of adoptedStyleSheets
83
86
  */
84
- function setStreamStyling(stylingContainer, domain, subscription) {
85
- if (window.emMessageBus) {
86
- const sheet = document.createElement('style');
87
+ function setStreamStyling(stylingContainer, domain, subscription, useAdoptedStyleSheets = false) {
88
+ if (!window.emMessageBus) return;
87
89
 
88
- window.emMessageBus.subscribe(domain, (data) => {
89
- sheet.innerHTML = data;
90
- if (stylingContainer) {
91
- stylingContainer.appendChild(sheet);
92
- }
93
- });
90
+ const supportAdoptStyle = 'adoptedStyleSheets' in Document.prototype;
91
+
92
+ if (!supportAdoptStyle || !useAdoptedStyleSheets) {
93
+ subscription = getStyleTagSubscription(stylingContainer, domain);
94
+
95
+ return subscription;
96
+ }
97
+
98
+ if (!window[StyleCacheKey]) {
99
+ window[StyleCacheKey] = {};
94
100
  }
101
+ subscription = getAdoptStyleSubscription(stylingContainer, domain);
102
+
103
+ const originalUnsubscribe = subscription.unsubscribe.bind(subscription);
104
+ const wrappedUnsubscribe = () => {
105
+ if (window[StyleCacheKey][domain]) {
106
+ const cachedObject = window[StyleCacheKey][domain];
107
+ cachedObject.refCount > 1
108
+ ? (cachedObject.refCount = cachedObject.refCount - 1)
109
+ : delete window[StyleCacheKey][domain];
110
+ }
111
+
112
+ originalUnsubscribe();
113
+ };
114
+ subscription.unsubscribe = wrappedUnsubscribe;
115
+
116
+ return subscription;
117
+ }
118
+
119
+ function getStyleTagSubscription(stylingContainer, domain) {
120
+ const sheet = document.createElement('style');
121
+
122
+ return window.emMessageBus.subscribe(domain, (data) => {
123
+ if (stylingContainer) {
124
+ sheet.innerHTML = data;
125
+ stylingContainer.appendChild(sheet);
126
+ }
127
+ });
128
+ }
129
+
130
+ function getAdoptStyleSubscription(stylingContainer, domain) {
131
+ return window.emMessageBus.subscribe(domain, (data) => {
132
+ if (!stylingContainer) return;
133
+
134
+ const shadowRoot = stylingContainer.getRootNode();
135
+ const cacheStyleObject = window[StyleCacheKey];
136
+ let cachedStyle = cacheStyleObject[domain]?.sheet;
137
+
138
+ if (!cachedStyle) {
139
+ cachedStyle = new CSSStyleSheet();
140
+ cachedStyle.replaceSync(data);
141
+ cacheStyleObject[domain] = {
142
+ sheet: cachedStyle,
143
+ refCount: 1
144
+ };
145
+ } else {
146
+ cacheStyleObject[domain].refCount = cacheStyleObject[domain].refCount + 1;
147
+ }
148
+
149
+ const currentSheets = shadowRoot.adoptedStyleSheets || [];
150
+ if (!currentSheets.includes(cachedStyle)) {
151
+ shadowRoot.adoptedStyleSheets = [...currentSheets, cachedStyle];
152
+ }
153
+ });
95
154
  }
96
155
 
97
156
  const helperAccordionCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.Header{border-radius:5px;background:var(--emw--color-primary, #009993);display:flex;gap:30px;border:1px solid var(--emw--color-primary, #009993);padding:8px 10px;user-select:none;margin-bottom:1px;cursor:pointer}.Header:hover{background:var(--emw--color-secondary, #00aba4)}.Header .Title,.Header .Subtitle,.Header .Description{margin:0;font-size:14px;color:var(--emw--color-typography-inverse, rgb(255, 255, 255));text-transform:capitalize}.Header .Expand{margin-left:auto;color:var(--emw--color-typography-inverse, rgb(255, 255, 255));width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.HeaderTicketHistory{border-radius:4px;background:var(--emw--color-background, #fff);display:flex;gap:30px;border:1px solid var(--emw--color-primary, #009993);padding:8px 10px;user-select:none;margin-bottom:5px;cursor:pointer}.HeaderTicketHistory:hover{background:var(--emw--color-secondary, #00aba4)}.HeaderTicketHistory .Title,.HeaderTicketHistory .Subtitle,.HeaderTicketHistory .Description{margin:0;font-size:14px;color:var(--emw--color-typography, #000)}.HeaderTicketHistory .Expand{margin-left:auto;color:var(--emw--color-typography-inverse, rgb(255, 255, 255));width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.Content{border-radius:0 0 4px 4px;background:var(--emw--color-background, #fff);border:1px solid var(--emw--color-primary, #009993);padding:10px 15px;user-select:none;color:var(--emw--color-typography, #000);margin-bottom:10px}.ActionButton{cursor:pointer;display:inline-block;border-radius:var(--emw--button-border-radius, 4px);margin:20px 0 10px;text-transform:uppercase;font-size:12px;text-align:center;padding:8px 20px;min-width:80px;background:var(--emw--color-error, #ff3d00);border:1px solid var(--emw--color-error, #ff3d00);color:var(--emw--color-background, #fff)}.ActionButton:hover{background:var(--emw--color-secondary, #ff6536);border:1px solid var(--emw--color-error, #ff3d00)}";
@@ -130,13 +189,13 @@ const HelperAccordion = class {
130
189
  }
131
190
  handleMbSourceChange(newValue, oldValue) {
132
191
  if (newValue != oldValue) {
133
- setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
192
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
134
193
  }
135
194
  }
136
195
  componentDidLoad() {
137
196
  if (this.stylingContainer) {
138
197
  if (this.mbSource)
139
- setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
198
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
140
199
  if (this.clientStyling)
141
200
  setClientStyling(this.stylingContainer, this.clientStyling);
142
201
  if (this.clientStylingUrl)
@@ -280,7 +339,7 @@ const HelperTab = class {
280
339
  componentDidLoad() {
281
340
  if (this.stylingContainer) {
282
341
  if (window.emMessageBus != undefined) {
283
- setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
342
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
284
343
  }
285
344
  else {
286
345
  if (this.clientStyling)
@@ -366,7 +425,7 @@ const HelperTabs = class {
366
425
  componentDidLoad() {
367
426
  if (this.stylingContainer) {
368
427
  if (window.emMessageBus != undefined) {
369
- setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
428
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
370
429
  }
371
430
  else {
372
431
  if (this.clientStyling)
@@ -418,13 +477,13 @@ const LotteryGameDetails = class {
418
477
  }
419
478
  handleMbSourceChange(newValue, oldValue) {
420
479
  if (newValue != oldValue) {
421
- setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
480
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
422
481
  }
423
482
  }
424
483
  componentDidLoad() {
425
484
  if (this.stylingContainer) {
426
485
  if (this.mbSource)
427
- setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
486
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
428
487
  if (this.clientStyling)
429
488
  setClientStyling(this.stylingContainer, this.clientStyling);
430
489
  if (this.clientStylingUrl)
@@ -31,6 +31,8 @@ const getTranslations$1 = (data) => {
31
31
  });
32
32
  };
33
33
 
34
+ const StyleCacheKey = '__WIDGET_GLOBAL_STYLE_CACHE__';
35
+
34
36
  /**
35
37
  * @name setClientStyling
36
38
  * @description Method used to create and append to the passed element of the widget a style element with the content received
@@ -76,18 +78,75 @@ function setClientStylingURL(stylingContainer, clientStylingUrl) {
76
78
  * @param {HTMLElement} stylingContainer The highest element of the widget
77
79
  * @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
78
80
  * @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
81
+ * @param {boolean} useAdoptedStyleSheets A flag to gradually enable testing of adoptedStyleSheets
79
82
  */
80
- function setStreamStyling(stylingContainer, domain, subscription) {
81
- if (window.emMessageBus) {
82
- const sheet = document.createElement('style');
83
+ function setStreamStyling(stylingContainer, domain, subscription, useAdoptedStyleSheets = false) {
84
+ if (!window.emMessageBus) return;
83
85
 
84
- window.emMessageBus.subscribe(domain, (data) => {
85
- sheet.innerHTML = data;
86
- if (stylingContainer) {
87
- stylingContainer.appendChild(sheet);
88
- }
89
- });
86
+ const supportAdoptStyle = 'adoptedStyleSheets' in Document.prototype;
87
+
88
+ if (!supportAdoptStyle || !useAdoptedStyleSheets) {
89
+ subscription = getStyleTagSubscription(stylingContainer, domain);
90
+
91
+ return subscription;
92
+ }
93
+
94
+ if (!window[StyleCacheKey]) {
95
+ window[StyleCacheKey] = {};
90
96
  }
97
+ subscription = getAdoptStyleSubscription(stylingContainer, domain);
98
+
99
+ const originalUnsubscribe = subscription.unsubscribe.bind(subscription);
100
+ const wrappedUnsubscribe = () => {
101
+ if (window[StyleCacheKey][domain]) {
102
+ const cachedObject = window[StyleCacheKey][domain];
103
+ cachedObject.refCount > 1
104
+ ? (cachedObject.refCount = cachedObject.refCount - 1)
105
+ : delete window[StyleCacheKey][domain];
106
+ }
107
+
108
+ originalUnsubscribe();
109
+ };
110
+ subscription.unsubscribe = wrappedUnsubscribe;
111
+
112
+ return subscription;
113
+ }
114
+
115
+ function getStyleTagSubscription(stylingContainer, domain) {
116
+ const sheet = document.createElement('style');
117
+
118
+ return window.emMessageBus.subscribe(domain, (data) => {
119
+ if (stylingContainer) {
120
+ sheet.innerHTML = data;
121
+ stylingContainer.appendChild(sheet);
122
+ }
123
+ });
124
+ }
125
+
126
+ function getAdoptStyleSubscription(stylingContainer, domain) {
127
+ return window.emMessageBus.subscribe(domain, (data) => {
128
+ if (!stylingContainer) return;
129
+
130
+ const shadowRoot = stylingContainer.getRootNode();
131
+ const cacheStyleObject = window[StyleCacheKey];
132
+ let cachedStyle = cacheStyleObject[domain]?.sheet;
133
+
134
+ if (!cachedStyle) {
135
+ cachedStyle = new CSSStyleSheet();
136
+ cachedStyle.replaceSync(data);
137
+ cacheStyleObject[domain] = {
138
+ sheet: cachedStyle,
139
+ refCount: 1
140
+ };
141
+ } else {
142
+ cacheStyleObject[domain].refCount = cacheStyleObject[domain].refCount + 1;
143
+ }
144
+
145
+ const currentSheets = shadowRoot.adoptedStyleSheets || [];
146
+ if (!currentSheets.includes(cachedStyle)) {
147
+ shadowRoot.adoptedStyleSheets = [...currentSheets, cachedStyle];
148
+ }
149
+ });
91
150
  }
92
151
 
93
152
  const helperAccordionCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.Header{border-radius:5px;background:var(--emw--color-primary, #009993);display:flex;gap:30px;border:1px solid var(--emw--color-primary, #009993);padding:8px 10px;user-select:none;margin-bottom:1px;cursor:pointer}.Header:hover{background:var(--emw--color-secondary, #00aba4)}.Header .Title,.Header .Subtitle,.Header .Description{margin:0;font-size:14px;color:var(--emw--color-typography-inverse, rgb(255, 255, 255));text-transform:capitalize}.Header .Expand{margin-left:auto;color:var(--emw--color-typography-inverse, rgb(255, 255, 255));width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.HeaderTicketHistory{border-radius:4px;background:var(--emw--color-background, #fff);display:flex;gap:30px;border:1px solid var(--emw--color-primary, #009993);padding:8px 10px;user-select:none;margin-bottom:5px;cursor:pointer}.HeaderTicketHistory:hover{background:var(--emw--color-secondary, #00aba4)}.HeaderTicketHistory .Title,.HeaderTicketHistory .Subtitle,.HeaderTicketHistory .Description{margin:0;font-size:14px;color:var(--emw--color-typography, #000)}.HeaderTicketHistory .Expand{margin-left:auto;color:var(--emw--color-typography-inverse, rgb(255, 255, 255));width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.Content{border-radius:0 0 4px 4px;background:var(--emw--color-background, #fff);border:1px solid var(--emw--color-primary, #009993);padding:10px 15px;user-select:none;color:var(--emw--color-typography, #000);margin-bottom:10px}.ActionButton{cursor:pointer;display:inline-block;border-radius:var(--emw--button-border-radius, 4px);margin:20px 0 10px;text-transform:uppercase;font-size:12px;text-align:center;padding:8px 20px;min-width:80px;background:var(--emw--color-error, #ff3d00);border:1px solid var(--emw--color-error, #ff3d00);color:var(--emw--color-background, #fff)}.ActionButton:hover{background:var(--emw--color-secondary, #ff6536);border:1px solid var(--emw--color-error, #ff3d00)}";
@@ -126,13 +185,13 @@ const HelperAccordion = class {
126
185
  }
127
186
  handleMbSourceChange(newValue, oldValue) {
128
187
  if (newValue != oldValue) {
129
- setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
188
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
130
189
  }
131
190
  }
132
191
  componentDidLoad() {
133
192
  if (this.stylingContainer) {
134
193
  if (this.mbSource)
135
- setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
194
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
136
195
  if (this.clientStyling)
137
196
  setClientStyling(this.stylingContainer, this.clientStyling);
138
197
  if (this.clientStylingUrl)
@@ -276,7 +335,7 @@ const HelperTab = class {
276
335
  componentDidLoad() {
277
336
  if (this.stylingContainer) {
278
337
  if (window.emMessageBus != undefined) {
279
- setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
338
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
280
339
  }
281
340
  else {
282
341
  if (this.clientStyling)
@@ -362,7 +421,7 @@ const HelperTabs = class {
362
421
  componentDidLoad() {
363
422
  if (this.stylingContainer) {
364
423
  if (window.emMessageBus != undefined) {
365
- setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
424
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
366
425
  }
367
426
  else {
368
427
  if (this.clientStyling)
@@ -414,13 +473,13 @@ const LotteryGameDetails = class {
414
473
  }
415
474
  handleMbSourceChange(newValue, oldValue) {
416
475
  if (newValue != oldValue) {
417
- setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
476
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
418
477
  }
419
478
  }
420
479
  componentDidLoad() {
421
480
  if (this.stylingContainer) {
422
481
  if (this.mbSource)
423
- setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
482
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
424
483
  if (this.clientStyling)
425
484
  setClientStyling(this.stylingContainer, this.clientStyling);
426
485
  if (this.clientStylingUrl)
@@ -1 +1 @@
1
- import{r as e,c as t,h as i,g as o}from"./index-b674956f.js";const a=["ro","en","hr"],r={en:{deleteTicket:"Delete ticket"},ro:{deleteTicket:"Sterge biletul"},fr:{deleteTicket:"Supprimer le billet"},ar:{deleteTicket:"حذف التذكرة"},hr:{deleteTicket:"Izbriši listić"}};function n(e,t){if(e){const i=document.createElement("style");i.innerHTML=t,e.appendChild(i)}}function s(e,t){if(!e||!t)return;const i=new URL(t);fetch(i.href).then((e=>e.text())).then((t=>{const i=document.createElement("style");i.innerHTML=t,e&&e.appendChild(i)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}function c(e,t){if(window.emMessageBus){const i=document.createElement("style");window.emMessageBus.subscribe(t,(t=>{i.innerHTML=t,e&&e.appendChild(i)}))}}const l=class{constructor(i){e(this,i),this.accordionEvent=t(this,"helperAccordionAction",7),this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.ticketHistoryFlag=!1,this.headerTitle="",this.headerSubtitle="",this.description="",this.footer=!1,this.deleteTab=!1,this.postMessage=!1,this.eventName="helperAccordionAction",this.collapsed=!0,this.language="en",this.translationUrl=void 0,this.showContent=void 0}handleClientStylingChange(e,t){e!=t&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(e,t){e!=t&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(e,t){e!=t&&c(this.stylingContainer,`${this.mbSource}.Style`)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&c(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}connectedCallback(){this.showContent=!this.collapsed}componentWillLoad(){var e;this.translationUrl&&(e=JSON.parse(this.translationUrl),Object.keys(e).forEach((t=>{for(let i in e[t])r[t][i]=e[t][i]})))}toggleContent(){this.showContent=!this.showContent}deleteAction(){this.postMessage&&window.postMessage({type:this.eventName},window.location.href),this.accordionEvent.emit()}render(){return i("div",{key:"58cd507e7d1dc8de1e3b049936a2d6acb355e83d",class:"Wrapper",ref:e=>this.stylingContainer=e},i("div",{key:"70c6453ca4c4d40738edb1ae7e91f8954eebd3eb",class:!0===this.ticketHistoryFlag?"HeaderTicketHistory":"Header",onClick:()=>this.toggleContent()},i("p",{key:"cf543e01c0baa833bea27aa4effb19734e234ed1",class:"Title"},this.headerTitle),i("p",{key:"365a05cabda273796e9d9689e514566ecc2aadcc",class:"Subtitle"},this.headerSubtitle),i("p",{key:"f30680b6c9d2d65fdb607a7293d6ce4b56c6b20f",class:"Subtitle Description"},this.description),i("span",{key:"a47718e90743d53b31968f67b002a3e427e193bc",class:"Expand"},this.showContent?"<":">")),this.showContent&&i("div",{key:"bb34d51602f9397c427d79141a38aca7a64bf206"},i("div",{key:"64171a30185b88bbafaa4ea555aeb9e2e33c46d6",class:"Content"},i("slot",{key:"6def0d44f3881196255f3329184053fb3d5a3cfd",name:"accordionContent"}),this.footer&&this.showContent&&i("div",{key:"08bfb5b017055788ba55b149e3bee23964f11ccf"},this.deleteTab&&i("span",{key:"b7b03fc6329a37841a2cf2b6a34780349341a0d5",class:"ActionButton",onClick:()=>this.deleteAction()},(()=>{const e=this.language;return r[void 0!==e&&a.includes(e)?e:"en"].deleteTicket})())))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};l.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.Header{border-radius:5px;background:var(--emw--color-primary, #009993);display:flex;gap:30px;border:1px solid var(--emw--color-primary, #009993);padding:8px 10px;user-select:none;margin-bottom:1px;cursor:pointer}.Header:hover{background:var(--emw--color-secondary, #00aba4)}.Header .Title,.Header .Subtitle,.Header .Description{margin:0;font-size:14px;color:var(--emw--color-typography-inverse, rgb(255, 255, 255));text-transform:capitalize}.Header .Expand{margin-left:auto;color:var(--emw--color-typography-inverse, rgb(255, 255, 255));width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.HeaderTicketHistory{border-radius:4px;background:var(--emw--color-background, #fff);display:flex;gap:30px;border:1px solid var(--emw--color-primary, #009993);padding:8px 10px;user-select:none;margin-bottom:5px;cursor:pointer}.HeaderTicketHistory:hover{background:var(--emw--color-secondary, #00aba4)}.HeaderTicketHistory .Title,.HeaderTicketHistory .Subtitle,.HeaderTicketHistory .Description{margin:0;font-size:14px;color:var(--emw--color-typography, #000)}.HeaderTicketHistory .Expand{margin-left:auto;color:var(--emw--color-typography-inverse, rgb(255, 255, 255));width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.Content{border-radius:0 0 4px 4px;background:var(--emw--color-background, #fff);border:1px solid var(--emw--color-primary, #009993);padding:10px 15px;user-select:none;color:var(--emw--color-typography, #000);margin-bottom:10px}.ActionButton{cursor:pointer;display:inline-block;border-radius:var(--emw--button-border-radius, 4px);margin:20px 0 10px;text-transform:uppercase;font-size:12px;text-align:center;padding:8px 20px;min-width:80px;background:var(--emw--color-error, #ff3d00);border:1px solid var(--emw--color-error, #ff3d00);color:var(--emw--color-background, #fff)}.ActionButton:hover{background:var(--emw--color-secondary, #ff6536);border:1px solid var(--emw--color-error, #ff3d00)}';const d="en",h=["en"],u={en:{howToPlay:"Each play includes one set of numbers from ${lowNumber} to ${highNumber} with a selectable number of ${maxinumAllowed} and a minimum selection of ${minimumAllowed}. The winnings are automatically credited to your account.",register:"Register or Login",butTickets:'Buy tickets. Select "Buy Tickets" to pick your numbers. Want us to automatically generate random numbers for you? Choose “quick pick”.',reviewPurchase:"Review and Complete your purchase. Once you've chosen your total number of plays, and confirmed your number of selections, review your ticket details and complete your purchase!",odds:"What are my odds of winning?",winGame:"How can I find out if I’ve won a draw game?",claimPrize:"How do I claim my prize?"},ro:{howToPlay:"Each play includes one set of numbers from ${lowNumber} to ${highNumber} with a selectable number of ${maxinumAllowed} and a minimum selection of ${minimumAllowed}. The winnings are automatically credited to your account.",register:"Register or Login",butTickets:'Buy tickets. Select "Buy Tickets" to pick your numbers. Want us to automatically generate random numbers for you? Choose “quick pick”.',reviewPurchase:"Review and Complete your purchase. Once you've chosen your total number of plays, and confirmed your number of selections, review your ticket details and complete your purchase!",odds:"What are my odds of winning?",winGame:"How can I find out if I’ve won a draw game?",claimPrize:"How do I claim my prize?"},fr:{howToPlay:"Each play includes one set of numbers from ${lowNumber} to ${highNumber} with a selectable number of ${maxinumAllowed} and a minimum selection of ${minimumAllowed}. The winnings are automatically credited to your account.",register:"Register or Login",butTickets:'Buy tickets. Select "Buy Tickets" to pick your numbers. Want us to automatically generate random numbers for you? Choose “quick pick”.',reviewPurchase:"Review and Complete your purchase. Once you've chosen your total number of plays, and confirmed your number of selections, review your ticket details and complete your purchase!",odds:"What are my odds of winning?",winGame:"How can I find out if I’ve won a draw game?",claimPrize:"How do I claim my prize?"},ar:{howToPlay:"Each play includes one set of numbers from ${lowNumber} to ${highNumber} with a selectable number of ${maxinumAllowed} and a minimum selection of ${minimumAllowed}. The winnings are automatically credited to your account.",register:"Register or Login",butTickets:'Buy tickets. Select "Buy Tickets" to pick your numbers. Want us to automatically generate random numbers for you? Choose “quick pick”.',reviewPurchase:"Review and Complete your purchase. Once you've chosen your total number of plays, and confirmed your number of selections, review your ticket details and complete your purchase!",odds:"What are my odds of winning?",winGame:"How can I find out if I’ve won a draw game?",claimPrize:"How do I claim my prize?"},hr:{howToPlay:"Each play includes one set of numbers from ${lowNumber} to ${highNumber} with a selectable number of ${maxinumAllowed} and a minimum selection of ${minimumAllowed}. The winnings are automatically credited to your account.",register:"Register or Login",butTickets:'Buy tickets. Select "Buy Tickets" to pick your numbers. Want us to automatically generate random numbers for you? Choose “quick pick”.',reviewPurchase:"Review and Complete your purchase. Once you've chosen your total number of plays, and confirmed your number of selections, review your ticket details and complete your purchase!",odds:"What are my odds of winning?",winGame:"How can I find out if I’ve won a draw game?",claimPrize:"How do I claim my prize?"}},m=(e,t)=>{const i=t;return u[void 0!==i&&h.includes(i)?i:d][e]},b=class{constructor(t){e(this,t),this.selectedIndex=0,this.cmsEndpoint=void 0,this.mbSource=void 0,this.clientStyling="",this.clientStylingUrl="",this.lowNumber=void 0,this.highNumber=void 0,this.minimumAllowed=void 0,this.maxinumAllowed=void 0,this.language="en",this.translationUrl=void 0,this.tabContent=""}handleClientStylingChange(e,t){e!=t&&n(this.stylingContainer,this.clientStyling)}handleClientStylingChangeURL(e,t){e!=t&&this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl)}componentDidLoad(){this.stylingContainer&&(null!=window.emMessageBus?c(this.stylingContainer,`${this.mbSource}.Style`):(this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl)))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}componentWillLoad(){var e;this.translationUrl&&(e=JSON.parse(this.translationUrl),Object.keys(e).forEach((t=>{for(let i in e[t])u[t][i]=e[t][i]})))}getHowToPlay(){return this.lowNumber&&this.highNumber&&this.maxinumAllowed&&this.minimumAllowed?((e,t)=>{const i=t.lang;let o=u[void 0!==i&&h.includes(i)?i:d][e];return t?(Object.keys(t).forEach((e=>{o=o.replace(new RegExp("\\${"+e+"}","gm"),t[e])})),o):u[void 0!==i&&h.includes(i)?i:d][e]})("howToPlay",{lowNumber:this.lowNumber,highNumber:this.highNumber,maxinumAllowed:this.maxinumAllowed,minimumAllowed:this.minimumAllowed,lang:this.language}):""}render(){return this.tabContent=i("div",{key:"92877a17361066f68fce6299cb8f65901f6abc60",class:"TabContent",ref:e=>this.stylingContainer=e},this.getHowToPlay()),this.selectedIndex+1==2?this.tabContent=i("div",{key:"9876b9250371034ef40dab0f5fc3fe1a5631a370",class:"TabContent",ref:e=>this.stylingContainer=e},i("ol",{key:"ef2097eb54aeb640f06871277d8cafd2f4455109"},i("li",{key:"e9a0237e1fdead445abcd9240174276ffef81a67"},m("register",this.language)),i("li",{key:"2bdfaffdc9f1a7ae021913cb0ba346132140dcfd"},m("butTickets",this.language)),i("li",{key:"bff38eaeabeaece83dc8ed1697e5b052802753f6"},m("reviewPurchase",this.language)))):this.selectedIndex+1==3&&(this.tabContent=i("div",{key:"49a7fb3435fb50b54572ec38d1e632e2eacf56fb",class:"TabContent",ref:e=>this.stylingContainer=e},i("ul",{key:"7f642625f35a1ed1eae7655144c0b8b1bfe25f55"},i("li",{key:"037a5913be57dd1e2dcde5a061e9c64e70365e8d"},m("odds",this.language)),i("li",{key:"8775a1b2e8eda285e2c248b8d7235f06ac593fc6"},m("winGame",this.language)),i("li",{key:"5297fc5e757c29a1349049f1fe294e926255d518"},m("claimPrize",this.language))))),this.tabContent}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"]}}};b.style=":host{display:block}.TabContent{font-size:14px;color:var(--emw--color-typography, #000);font-weight:normal}";const f=class{constructor(t){e(this,t),this.disabled=!1,this.label=void 0,this.selected=!1,this.cmsEndpoint=void 0,this.selectedIndex=0,this.tabs=[{label:"How to Play"},{label:"About"},{label:"FAQs"}],this.clientStyling="",this.mbSource=void 0,this.clientStylingurl="",this.clientStylingUrl="",this.lowNumber=void 0,this.highNumber=void 0,this.minimumAllowed=void 0,this.maxinumAllowed=void 0,this.language="en",this.translationUrl=void 0}connectedCallback(){}handleClientStylingChange(e,t){e!=t&&n(this.stylingContainer,this.clientStyling)}handleClientStylingChangeURL(e,t){e!=t&&this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl)}componentDidLoad(){this.stylingContainer&&(null!=window.emMessageBus?c(this.stylingContainer,`${this.mbSource}.Style`):(this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl)))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}render(){return i("div",{key:"173c4774748482dc56fcffb4bac4e1666fa9170f",ref:e=>this.stylingContainer=e},i("div",{key:"680b65218e4b00f134b354f593c0c20fb5882dca",class:"Tabs"},this.tabs.map(((e,t)=>i("button",{class:"TabButton"+(this.selectedIndex==t?" Active":""),onClick:()=>this.selectedIndex=t},e.label)))),i("div",{key:"67aa26c92fb416c5d0934988fb071481f805685b"},i("helper-tab",{key:"63c8dfc253d4fc12b0310a2585a44b90807e1a9f","low-number":this.lowNumber,"high-number":this.highNumber,"minimum-allowed":this.minimumAllowed,"maxinum-allowed":this.maxinumAllowed,selectedIndex:this.selectedIndex,"client-styling":this.clientStyling,language:this.language,"translation-url":this.translationUrl,"client-stylingurl":this.clientStylingurl,"client-styling-url-content":this.clientStylingUrl,"mb-source":this.mbSource})))}get host(){return o(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"]}}};f.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.Tabs{display:flex;gap:10px;overflow-x:auto}.TabButton{cursor:pointer;width:auto;border-radius:var(--emw--button-border-radius, 4px);padding:8px 15px;margin:5px 0 10px;border:1px solid var(--emw--color-primary, #009993);background:var(--emw--color-background, #fff);color:var(--emw--color-typography, #000);font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0;white-space:nowrap}.TabButton:hover{background:var(--emw--color-background-secondary, #f5f5f5)}.TabButton.Active{background:var(--emw--color-primary, #009993);color:var(--emw--color-background, #fff)}';const y=class{constructor(t){e(this,t),this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.lowNumber=void 0,this.highNumber=void 0,this.minimumAllowed=void 0,this.maxinumAllowed=void 0,this.language="en",this.translationUrl=void 0}handleClientStylingChange(e,t){e!=t&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(e,t){e!=t&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(e,t){e!=t&&c(this.stylingContainer,`${this.mbSource}.Style`)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&c(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))}render(){return i("div",{key:"0bb2683f87461804914d26c708499902d92dc503",class:"GamePageDetailsContainer",ref:e=>this.stylingContainer=e},i("helper-accordion",{key:"2ba23b953a9519ccb36fd203c3ac98a366673822","header-title":"Game Details",collapsed:!1,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource},i("div",{key:"54c18e3a6fde25ff0953bb7b15b8a1200e237fd0",class:"AccordionContainer",slot:"accordionContent"},i("helper-tabs",{key:"0cb93435825bf7a42636848ffd5ff67a30369cfa","low-number":this.lowNumber,"high-number":this.highNumber,"minimum-allowed":this.minimumAllowed,"maxinum-allowed":this.maxinumAllowed,language:this.language,"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource}))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};y.style=":host{display:block}";export{l as helper_accordion,b as helper_tab,f as helper_tabs,y as lottery_game_details}
1
+ import{r as e,c as t,h as i,g as o}from"./index-b674956f.js";const a=["ro","en","hr"],r={en:{deleteTicket:"Delete ticket"},ro:{deleteTicket:"Sterge biletul"},fr:{deleteTicket:"Supprimer le billet"},ar:{deleteTicket:"حذف التذكرة"},hr:{deleteTicket:"Izbriši listić"}},n="__WIDGET_GLOBAL_STYLE_CACHE__";function s(e,t){if(e){const i=document.createElement("style");i.innerHTML=t,e.appendChild(i)}}function c(e,t){if(!e||!t)return;const i=new URL(t);fetch(i.href).then((e=>e.text())).then((t=>{const i=document.createElement("style");i.innerHTML=t,e&&e.appendChild(i)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}function l(e,t,i,o=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!o)return i=function(e,t){const i=document.createElement("style");return window.emMessageBus.subscribe(t,(t=>{e&&(i.innerHTML=t,e.appendChild(i))}))}(e,t),i;window[n]||(window[n]={}),i=function(e,t){return window.emMessageBus.subscribe(t,(i=>{if(!e)return;const o=e.getRootNode(),a=window[n];let r=a[t]?.sheet;r?a[t].refCount=a[t].refCount+1:(r=new CSSStyleSheet,r.replaceSync(i),a[t]={sheet:r,refCount:1});const s=o.adoptedStyleSheets||[];s.includes(r)||(o.adoptedStyleSheets=[...s,r])}))}(e,t);const a=i.unsubscribe.bind(i);return i.unsubscribe=()=>{if(window[n][t]){const e=window[n][t];e.refCount>1?e.refCount=e.refCount-1:delete window[n][t]}a()},i}const d=class{constructor(i){e(this,i),this.accordionEvent=t(this,"helperAccordionAction",7),this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.ticketHistoryFlag=!1,this.headerTitle="",this.headerSubtitle="",this.description="",this.footer=!1,this.deleteTab=!1,this.postMessage=!1,this.eventName="helperAccordionAction",this.collapsed=!0,this.language="en",this.translationUrl=void 0,this.showContent=void 0}handleClientStylingChange(e,t){e!=t&&s(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(e,t){e!=t&&c(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(e,t){e!=t&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&s(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&c(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}connectedCallback(){this.showContent=!this.collapsed}componentWillLoad(){var e;this.translationUrl&&(e=JSON.parse(this.translationUrl),Object.keys(e).forEach((t=>{for(let i in e[t])r[t][i]=e[t][i]})))}toggleContent(){this.showContent=!this.showContent}deleteAction(){this.postMessage&&window.postMessage({type:this.eventName},window.location.href),this.accordionEvent.emit()}render(){return i("div",{key:"58cd507e7d1dc8de1e3b049936a2d6acb355e83d",class:"Wrapper",ref:e=>this.stylingContainer=e},i("div",{key:"70c6453ca4c4d40738edb1ae7e91f8954eebd3eb",class:!0===this.ticketHistoryFlag?"HeaderTicketHistory":"Header",onClick:()=>this.toggleContent()},i("p",{key:"cf543e01c0baa833bea27aa4effb19734e234ed1",class:"Title"},this.headerTitle),i("p",{key:"365a05cabda273796e9d9689e514566ecc2aadcc",class:"Subtitle"},this.headerSubtitle),i("p",{key:"f30680b6c9d2d65fdb607a7293d6ce4b56c6b20f",class:"Subtitle Description"},this.description),i("span",{key:"a47718e90743d53b31968f67b002a3e427e193bc",class:"Expand"},this.showContent?"<":">")),this.showContent&&i("div",{key:"bb34d51602f9397c427d79141a38aca7a64bf206"},i("div",{key:"64171a30185b88bbafaa4ea555aeb9e2e33c46d6",class:"Content"},i("slot",{key:"6def0d44f3881196255f3329184053fb3d5a3cfd",name:"accordionContent"}),this.footer&&this.showContent&&i("div",{key:"08bfb5b017055788ba55b149e3bee23964f11ccf"},this.deleteTab&&i("span",{key:"b7b03fc6329a37841a2cf2b6a34780349341a0d5",class:"ActionButton",onClick:()=>this.deleteAction()},(()=>{const e=this.language;return r[void 0!==e&&a.includes(e)?e:"en"].deleteTicket})())))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};d.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.Header{border-radius:5px;background:var(--emw--color-primary, #009993);display:flex;gap:30px;border:1px solid var(--emw--color-primary, #009993);padding:8px 10px;user-select:none;margin-bottom:1px;cursor:pointer}.Header:hover{background:var(--emw--color-secondary, #00aba4)}.Header .Title,.Header .Subtitle,.Header .Description{margin:0;font-size:14px;color:var(--emw--color-typography-inverse, rgb(255, 255, 255));text-transform:capitalize}.Header .Expand{margin-left:auto;color:var(--emw--color-typography-inverse, rgb(255, 255, 255));width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.HeaderTicketHistory{border-radius:4px;background:var(--emw--color-background, #fff);display:flex;gap:30px;border:1px solid var(--emw--color-primary, #009993);padding:8px 10px;user-select:none;margin-bottom:5px;cursor:pointer}.HeaderTicketHistory:hover{background:var(--emw--color-secondary, #00aba4)}.HeaderTicketHistory .Title,.HeaderTicketHistory .Subtitle,.HeaderTicketHistory .Description{margin:0;font-size:14px;color:var(--emw--color-typography, #000)}.HeaderTicketHistory .Expand{margin-left:auto;color:var(--emw--color-typography-inverse, rgb(255, 255, 255));width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.Content{border-radius:0 0 4px 4px;background:var(--emw--color-background, #fff);border:1px solid var(--emw--color-primary, #009993);padding:10px 15px;user-select:none;color:var(--emw--color-typography, #000);margin-bottom:10px}.ActionButton{cursor:pointer;display:inline-block;border-radius:var(--emw--button-border-radius, 4px);margin:20px 0 10px;text-transform:uppercase;font-size:12px;text-align:center;padding:8px 20px;min-width:80px;background:var(--emw--color-error, #ff3d00);border:1px solid var(--emw--color-error, #ff3d00);color:var(--emw--color-background, #fff)}.ActionButton:hover{background:var(--emw--color-secondary, #ff6536);border:1px solid var(--emw--color-error, #ff3d00)}';const h="en",u=["en"],m={en:{howToPlay:"Each play includes one set of numbers from ${lowNumber} to ${highNumber} with a selectable number of ${maxinumAllowed} and a minimum selection of ${minimumAllowed}. The winnings are automatically credited to your account.",register:"Register or Login",butTickets:'Buy tickets. Select "Buy Tickets" to pick your numbers. Want us to automatically generate random numbers for you? Choose “quick pick”.',reviewPurchase:"Review and Complete your purchase. Once you've chosen your total number of plays, and confirmed your number of selections, review your ticket details and complete your purchase!",odds:"What are my odds of winning?",winGame:"How can I find out if I’ve won a draw game?",claimPrize:"How do I claim my prize?"},ro:{howToPlay:"Each play includes one set of numbers from ${lowNumber} to ${highNumber} with a selectable number of ${maxinumAllowed} and a minimum selection of ${minimumAllowed}. The winnings are automatically credited to your account.",register:"Register or Login",butTickets:'Buy tickets. Select "Buy Tickets" to pick your numbers. Want us to automatically generate random numbers for you? Choose “quick pick”.',reviewPurchase:"Review and Complete your purchase. Once you've chosen your total number of plays, and confirmed your number of selections, review your ticket details and complete your purchase!",odds:"What are my odds of winning?",winGame:"How can I find out if I’ve won a draw game?",claimPrize:"How do I claim my prize?"},fr:{howToPlay:"Each play includes one set of numbers from ${lowNumber} to ${highNumber} with a selectable number of ${maxinumAllowed} and a minimum selection of ${minimumAllowed}. The winnings are automatically credited to your account.",register:"Register or Login",butTickets:'Buy tickets. Select "Buy Tickets" to pick your numbers. Want us to automatically generate random numbers for you? Choose “quick pick”.',reviewPurchase:"Review and Complete your purchase. Once you've chosen your total number of plays, and confirmed your number of selections, review your ticket details and complete your purchase!",odds:"What are my odds of winning?",winGame:"How can I find out if I’ve won a draw game?",claimPrize:"How do I claim my prize?"},ar:{howToPlay:"Each play includes one set of numbers from ${lowNumber} to ${highNumber} with a selectable number of ${maxinumAllowed} and a minimum selection of ${minimumAllowed}. The winnings are automatically credited to your account.",register:"Register or Login",butTickets:'Buy tickets. Select "Buy Tickets" to pick your numbers. Want us to automatically generate random numbers for you? Choose “quick pick”.',reviewPurchase:"Review and Complete your purchase. Once you've chosen your total number of plays, and confirmed your number of selections, review your ticket details and complete your purchase!",odds:"What are my odds of winning?",winGame:"How can I find out if I’ve won a draw game?",claimPrize:"How do I claim my prize?"},hr:{howToPlay:"Each play includes one set of numbers from ${lowNumber} to ${highNumber} with a selectable number of ${maxinumAllowed} and a minimum selection of ${minimumAllowed}. The winnings are automatically credited to your account.",register:"Register or Login",butTickets:'Buy tickets. Select "Buy Tickets" to pick your numbers. Want us to automatically generate random numbers for you? Choose “quick pick”.',reviewPurchase:"Review and Complete your purchase. Once you've chosen your total number of plays, and confirmed your number of selections, review your ticket details and complete your purchase!",odds:"What are my odds of winning?",winGame:"How can I find out if I’ve won a draw game?",claimPrize:"How do I claim my prize?"}},b=(e,t)=>{const i=t;return m[void 0!==i&&u.includes(i)?i:h][e]},f=class{constructor(t){e(this,t),this.selectedIndex=0,this.cmsEndpoint=void 0,this.mbSource=void 0,this.clientStyling="",this.clientStylingUrl="",this.lowNumber=void 0,this.highNumber=void 0,this.minimumAllowed=void 0,this.maxinumAllowed=void 0,this.language="en",this.translationUrl=void 0,this.tabContent=""}handleClientStylingChange(e,t){e!=t&&s(this.stylingContainer,this.clientStyling)}handleClientStylingChangeURL(e,t){e!=t&&this.clientStylingUrl&&c(this.stylingContainer,this.clientStylingUrl)}componentDidLoad(){this.stylingContainer&&(null!=window.emMessageBus?l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription):(this.clientStyling&&s(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&c(this.stylingContainer,this.clientStylingUrl)))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}componentWillLoad(){var e;this.translationUrl&&(e=JSON.parse(this.translationUrl),Object.keys(e).forEach((t=>{for(let i in e[t])m[t][i]=e[t][i]})))}getHowToPlay(){return this.lowNumber&&this.highNumber&&this.maxinumAllowed&&this.minimumAllowed?((e,t)=>{const i=t.lang;let o=m[void 0!==i&&u.includes(i)?i:h][e];return t?(Object.keys(t).forEach((e=>{o=o.replace(new RegExp("\\${"+e+"}","gm"),t[e])})),o):m[void 0!==i&&u.includes(i)?i:h][e]})("howToPlay",{lowNumber:this.lowNumber,highNumber:this.highNumber,maxinumAllowed:this.maxinumAllowed,minimumAllowed:this.minimumAllowed,lang:this.language}):""}render(){return this.tabContent=i("div",{key:"92877a17361066f68fce6299cb8f65901f6abc60",class:"TabContent",ref:e=>this.stylingContainer=e},this.getHowToPlay()),this.selectedIndex+1==2?this.tabContent=i("div",{key:"9876b9250371034ef40dab0f5fc3fe1a5631a370",class:"TabContent",ref:e=>this.stylingContainer=e},i("ol",{key:"ef2097eb54aeb640f06871277d8cafd2f4455109"},i("li",{key:"e9a0237e1fdead445abcd9240174276ffef81a67"},b("register",this.language)),i("li",{key:"2bdfaffdc9f1a7ae021913cb0ba346132140dcfd"},b("butTickets",this.language)),i("li",{key:"bff38eaeabeaece83dc8ed1697e5b052802753f6"},b("reviewPurchase",this.language)))):this.selectedIndex+1==3&&(this.tabContent=i("div",{key:"49a7fb3435fb50b54572ec38d1e632e2eacf56fb",class:"TabContent",ref:e=>this.stylingContainer=e},i("ul",{key:"7f642625f35a1ed1eae7655144c0b8b1bfe25f55"},i("li",{key:"037a5913be57dd1e2dcde5a061e9c64e70365e8d"},b("odds",this.language)),i("li",{key:"8775a1b2e8eda285e2c248b8d7235f06ac593fc6"},b("winGame",this.language)),i("li",{key:"5297fc5e757c29a1349049f1fe294e926255d518"},b("claimPrize",this.language))))),this.tabContent}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"]}}};f.style=":host{display:block}.TabContent{font-size:14px;color:var(--emw--color-typography, #000);font-weight:normal}";const y=class{constructor(t){e(this,t),this.disabled=!1,this.label=void 0,this.selected=!1,this.cmsEndpoint=void 0,this.selectedIndex=0,this.tabs=[{label:"How to Play"},{label:"About"},{label:"FAQs"}],this.clientStyling="",this.mbSource=void 0,this.clientStylingurl="",this.clientStylingUrl="",this.lowNumber=void 0,this.highNumber=void 0,this.minimumAllowed=void 0,this.maxinumAllowed=void 0,this.language="en",this.translationUrl=void 0}connectedCallback(){}handleClientStylingChange(e,t){e!=t&&s(this.stylingContainer,this.clientStyling)}handleClientStylingChangeURL(e,t){e!=t&&this.clientStylingUrl&&c(this.stylingContainer,this.clientStylingUrl)}componentDidLoad(){this.stylingContainer&&(null!=window.emMessageBus?l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription):(this.clientStyling&&s(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&c(this.stylingContainer,this.clientStylingUrl)))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}render(){return i("div",{key:"173c4774748482dc56fcffb4bac4e1666fa9170f",ref:e=>this.stylingContainer=e},i("div",{key:"680b65218e4b00f134b354f593c0c20fb5882dca",class:"Tabs"},this.tabs.map(((e,t)=>i("button",{class:"TabButton"+(this.selectedIndex==t?" Active":""),onClick:()=>this.selectedIndex=t},e.label)))),i("div",{key:"67aa26c92fb416c5d0934988fb071481f805685b"},i("helper-tab",{key:"63c8dfc253d4fc12b0310a2585a44b90807e1a9f","low-number":this.lowNumber,"high-number":this.highNumber,"minimum-allowed":this.minimumAllowed,"maxinum-allowed":this.maxinumAllowed,selectedIndex:this.selectedIndex,"client-styling":this.clientStyling,language:this.language,"translation-url":this.translationUrl,"client-stylingurl":this.clientStylingurl,"client-styling-url-content":this.clientStylingUrl,"mb-source":this.mbSource})))}get host(){return o(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"]}}};y.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.Tabs{display:flex;gap:10px;overflow-x:auto}.TabButton{cursor:pointer;width:auto;border-radius:var(--emw--button-border-radius, 4px);padding:8px 15px;margin:5px 0 10px;border:1px solid var(--emw--color-primary, #009993);background:var(--emw--color-background, #fff);color:var(--emw--color-typography, #000);font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0;white-space:nowrap}.TabButton:hover{background:var(--emw--color-background-secondary, #f5f5f5)}.TabButton.Active{background:var(--emw--color-primary, #009993);color:var(--emw--color-background, #fff)}';const p=class{constructor(t){e(this,t),this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.lowNumber=void 0,this.highNumber=void 0,this.minimumAllowed=void 0,this.maxinumAllowed=void 0,this.language="en",this.translationUrl=void 0}handleClientStylingChange(e,t){e!=t&&s(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(e,t){e!=t&&c(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(e,t){e!=t&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&s(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&c(this.stylingContainer,this.clientStylingUrl))}render(){return i("div",{key:"0bb2683f87461804914d26c708499902d92dc503",class:"GamePageDetailsContainer",ref:e=>this.stylingContainer=e},i("helper-accordion",{key:"2ba23b953a9519ccb36fd203c3ac98a366673822","header-title":"Game Details",collapsed:!1,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource},i("div",{key:"54c18e3a6fde25ff0953bb7b15b8a1200e237fd0",class:"AccordionContainer",slot:"accordionContent"},i("helper-tabs",{key:"0cb93435825bf7a42636848ffd5ff67a30369cfa","low-number":this.lowNumber,"high-number":this.highNumber,"minimum-allowed":this.minimumAllowed,"maxinum-allowed":this.maxinumAllowed,language:this.language,"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource}))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};p.style=":host{display:block}";export{d as helper_accordion,f as helper_tab,y as helper_tabs,p as lottery_game_details}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/lottery-game-details",
3
- "version": "1.87.25",
3
+ "version": "1.87.27",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",