@everymatrix/lottery-tipping-dialog 1.87.26 → 1.87.28

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const lotteryTippingDialog = require('./lottery-tipping-dialog-a529778c.js');
5
+ const lotteryTippingDialog = require('./lottery-tipping-dialog-66ecf364.js');
6
6
  require('./index-8fa36c42.js');
7
7
 
8
8
 
@@ -53,6 +53,8 @@ const resolveTranslationUrl = async (translationUrl) => {
53
53
  }
54
54
  };
55
55
 
56
+ const StyleCacheKey = '__WIDGET_GLOBAL_STYLE_CACHE__';
57
+
56
58
  /**
57
59
  * @name setClientStyling
58
60
  * @description Method used to create and append to the passed element of the widget a style element with the content received
@@ -98,21 +100,78 @@ function setClientStylingURL(stylingContainer, clientStylingUrl) {
98
100
  * @param {HTMLElement} stylingContainer The highest element of the widget
99
101
  * @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
100
102
  * @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
103
+ * @param {boolean} useAdoptedStyleSheets A flag to gradually enable testing of adoptedStyleSheets
101
104
  */
102
- function setStreamStyling(stylingContainer, domain, subscription) {
103
- if (window.emMessageBus) {
104
- const sheet = document.createElement('style');
105
+ function setStreamStyling(stylingContainer, domain, subscription, useAdoptedStyleSheets = false) {
106
+ if (!window.emMessageBus) return;
105
107
 
106
- window.emMessageBus.subscribe(domain, (data) => {
107
- sheet.innerHTML = data;
108
- if (stylingContainer) {
109
- stylingContainer.appendChild(sheet);
110
- }
111
- });
108
+ const supportAdoptStyle = 'adoptedStyleSheets' in Document.prototype;
109
+
110
+ if (!supportAdoptStyle || !useAdoptedStyleSheets) {
111
+ subscription = getStyleTagSubscription(stylingContainer, domain);
112
+
113
+ return subscription;
114
+ }
115
+
116
+ if (!window[StyleCacheKey]) {
117
+ window[StyleCacheKey] = {};
112
118
  }
119
+ subscription = getAdoptStyleSubscription(stylingContainer, domain);
120
+
121
+ const originalUnsubscribe = subscription.unsubscribe.bind(subscription);
122
+ const wrappedUnsubscribe = () => {
123
+ if (window[StyleCacheKey][domain]) {
124
+ const cachedObject = window[StyleCacheKey][domain];
125
+ cachedObject.refCount > 1
126
+ ? (cachedObject.refCount = cachedObject.refCount - 1)
127
+ : delete window[StyleCacheKey][domain];
128
+ }
129
+
130
+ originalUnsubscribe();
131
+ };
132
+ subscription.unsubscribe = wrappedUnsubscribe;
133
+
134
+ return subscription;
135
+ }
136
+
137
+ function getStyleTagSubscription(stylingContainer, domain) {
138
+ const sheet = document.createElement('style');
139
+
140
+ return window.emMessageBus.subscribe(domain, (data) => {
141
+ if (stylingContainer) {
142
+ sheet.innerHTML = data;
143
+ stylingContainer.appendChild(sheet);
144
+ }
145
+ });
146
+ }
147
+
148
+ function getAdoptStyleSubscription(stylingContainer, domain) {
149
+ return window.emMessageBus.subscribe(domain, (data) => {
150
+ if (!stylingContainer) return;
151
+
152
+ const shadowRoot = stylingContainer.getRootNode();
153
+ const cacheStyleObject = window[StyleCacheKey];
154
+ let cachedStyle = cacheStyleObject[domain]?.sheet;
155
+
156
+ if (!cachedStyle) {
157
+ cachedStyle = new CSSStyleSheet();
158
+ cachedStyle.replaceSync(data);
159
+ cacheStyleObject[domain] = {
160
+ sheet: cachedStyle,
161
+ refCount: 1
162
+ };
163
+ } else {
164
+ cacheStyleObject[domain].refCount = cacheStyleObject[domain].refCount + 1;
165
+ }
166
+
167
+ const currentSheets = shadowRoot.adoptedStyleSheets || [];
168
+ if (!currentSheets.includes(cachedStyle)) {
169
+ shadowRoot.adoptedStyleSheets = [...currentSheets, cachedStyle];
170
+ }
171
+ });
113
172
  }
114
173
 
115
- const lotteryTippingDialogCss = ".dialog-wrapper{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;visibility:hidden;opacity:1;z-index:199}.dialog-wrapper-visible{visibility:visible}.mask{position:fixed;inset:0;background-color:rgba(0, 0, 0, 0.5);opacity:0;z-index:1000;transition:opacity var(--duration) linear}.mask-enter{opacity:1}.mask-leave{opacity:0}.dialog{position:relative;background:var(--emw--color-background, #fff);border-radius:12px;box-shadow:0 4px 32px rgba(0, 0, 0, 0.15);opacity:0;transform:scale(0.9);transition:all var(--duration) linear;width:100%;max-width:100vw;overflow:hidden;z-index:1000}.dialog-enter{opacity:1;transform:scale(1)}.dialog-leave{opacity:0}.dialog.fullscreen{width:100vw !important;height:100vh;overflow:auto;max-height:none;border-radius:0;overflow:hidden}.dialog-header{padding:16px 16px 0 16px;display:flex;justify-content:space-between;align-items:center}.dialog-header .dialog-title{margin:0;font-size:1.25rem;font-weight:500;color:var(--emw--color-typography, #000)}.dialog-header .close-btn{background:transparent;border:none;font-size:1.5rem;width:2rem;height:2rem;color:var(--emw--color-gray-150, #6f6f6f);cursor:pointer;border-radius:4px}.dialog-header .close-btn:hover{background:var(--emw--color-gray-50, #f5f5f5);color:var(--emw--color-gray-300, #333)}.dialog-content{padding:24px;font-size:0.95rem;line-height:1.6;color:var(--emw--color-dialog-typography, #000);flex:1;overflow-y:auto;max-height:calc(100vh - 200px)}.dialog.fullscreen .dialog-content{max-height:none}.dialog-footer{padding:0 16px 16px 16px;display:flex;justify-content:center;gap:12px}.dialog-footer .cancel-btn,.dialog-footer .confirm-btn{padding:10px 24px;border-radius:6px;font-size:0.9rem;cursor:pointer;transition:all 0.3s linear}.dialog-footer .cancel-btn{border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));background-color:var(--emw--color-background, #fff);color:var(--emw--color-typography, #000)}.dialog-footer .cancel-btn:hover{background-color:var(--emw--color-background-tertiary, #ccc)}.dialog-footer .confirm-btn{border:none;color:var(--emw--color-typography-normalized, #ffffff);background:var(--emw--color-primary, #009993)}.dialog-footer .confirm-btn:hover{background:var(--emw--color-primary-variant, #004d4a)}@media screen and (max-width: 480px){.dialog.fullscreen .dialog-content{padding:12px}}.Loading{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.Loading svg{animation:spin 1s linear infinite;transform-origin:center}@keyframes spin{100%{transform:rotate(360deg)}}";
174
+ const lotteryTippingDialogCss = ".dialog-wrapper{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;visibility:hidden;opacity:1;z-index:199}.dialog-wrapper-visible{visibility:visible}.mask{position:fixed;inset:0;background:var(--emw--color-mask-dialog-background, rgba(0, 0, 0, 0.5));opacity:0;z-index:1000;transition:opacity var(--duration) linear}.mask-enter{opacity:1}.mask-leave{opacity:0}.dialog{position:relative;background:var(--emw--color-background, #fff);border-radius:12px;box-shadow:0 4px 32px var(--emw--button-box-shadow-color-secondary, rgba(0, 0, 0, 0.15));opacity:0;transform:scale(0.9);transition:all var(--duration) linear;width:100%;max-width:100vw;overflow:hidden;z-index:1000}.dialog-enter{opacity:1;transform:scale(1)}.dialog-leave{opacity:0}.dialog.fullscreen{width:100vw !important;height:100vh;overflow:auto;max-height:none;border-radius:0;overflow:hidden}.dialog-header{padding:16px 16px 0 16px;display:flex;justify-content:space-between;align-items:center}.dialog-header .dialog-title{margin:0;font-size:1.25rem;font-weight:500;color:var(--emw--color-typography, #000)}.dialog-header .close-btn{background:transparent;border:none;font-size:1.5rem;width:2rem;height:2rem;color:var(--emw--color-gray-150, #6f6f6f);cursor:pointer;border-radius:4px}.dialog-header .close-btn:hover{background:var(--emw--color-gray-50, #f5f5f5);color:var(--emw--color-gray-300, #333)}.dialog-content{padding:24px;font-size:0.95rem;line-height:1.6;color:var(--emw--color-dialog-typography, #000);flex:1;overflow-y:auto;max-height:calc(100vh - 200px)}.dialog.fullscreen .dialog-content{max-height:none}.dialog-footer{padding:0 16px 16px 16px;display:flex;justify-content:center;gap:12px}.dialog-footer .cancel-btn,.dialog-footer .confirm-btn{padding:10px 24px;border-radius:6px;font-size:0.9rem;cursor:pointer;transition:all 0.3s linear}.dialog-footer .cancel-btn{border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));background-color:var(--emw--color-background, #fff);color:var(--emw--color-typography, #000)}.dialog-footer .cancel-btn:hover{background-color:var(--emw--color-background-tertiary, #ccc)}.dialog-footer .confirm-btn{border:none;color:var(--emw--color-typography-normalized, #ffffff);background:var(--emw--color-primary, #009993)}.dialog-footer .confirm-btn:hover{background:var(--emw--color-primary-variant, #004d4a)}@media screen and (max-width: 480px){.dialog.fullscreen .dialog-content{padding:12px}}.Loading{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.Loading svg{animation:spin 1s linear infinite;transform-origin:center}@keyframes spin{100%{transform:rotate(360deg)}}";
116
175
  const LotteryTippingDialogStyle0 = lotteryTippingDialogCss;
117
176
 
118
177
  const LotteryTippingDialog = class {
@@ -153,7 +212,7 @@ const LotteryTippingDialog = class {
153
212
  }
154
213
  handleMbSourceChange(newValue, oldValue) {
155
214
  if (newValue != oldValue) {
156
- setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
215
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
157
216
  }
158
217
  }
159
218
  componentWillLoad() {
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const lotteryTippingDialog = require('./lottery-tipping-dialog-a529778c.js');
5
+ const lotteryTippingDialog = require('./lottery-tipping-dialog-66ecf364.js');
6
6
  require('./index-8fa36c42.js');
7
7
 
8
8
 
@@ -16,7 +16,7 @@
16
16
  .mask {
17
17
  position: fixed;
18
18
  inset: 0;
19
- background-color: rgba(0, 0, 0, 0.5);
19
+ background: var(--emw--color-mask-dialog-background, rgba(0, 0, 0, 0.5));
20
20
  opacity: 0;
21
21
  z-index: 1000;
22
22
  transition: opacity var(--duration) linear;
@@ -32,7 +32,7 @@
32
32
  position: relative;
33
33
  background: var(--emw--color-background, #fff);
34
34
  border-radius: 12px;
35
- box-shadow: 0 4px 32px rgba(0, 0, 0, 0.15);
35
+ box-shadow: 0 4px 32px var(--emw--button-box-shadow-color-secondary, rgba(0, 0, 0, 0.15));
36
36
  opacity: 0;
37
37
  transform: scale(0.9);
38
38
  transition: all var(--duration) linear;
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { L as LotteryTippingDialog } from './lottery-tipping-dialog-d948d5a0.js';
1
+ export { L as LotteryTippingDialog } from './lottery-tipping-dialog-cf6b2617.js';
2
2
  import './index-9dba6e0e.js';
@@ -51,6 +51,8 @@ const resolveTranslationUrl = async (translationUrl) => {
51
51
  }
52
52
  };
53
53
 
54
+ const StyleCacheKey = '__WIDGET_GLOBAL_STYLE_CACHE__';
55
+
54
56
  /**
55
57
  * @name setClientStyling
56
58
  * @description Method used to create and append to the passed element of the widget a style element with the content received
@@ -96,21 +98,78 @@ function setClientStylingURL(stylingContainer, clientStylingUrl) {
96
98
  * @param {HTMLElement} stylingContainer The highest element of the widget
97
99
  * @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
98
100
  * @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
101
+ * @param {boolean} useAdoptedStyleSheets A flag to gradually enable testing of adoptedStyleSheets
99
102
  */
100
- function setStreamStyling(stylingContainer, domain, subscription) {
101
- if (window.emMessageBus) {
102
- const sheet = document.createElement('style');
103
+ function setStreamStyling(stylingContainer, domain, subscription, useAdoptedStyleSheets = false) {
104
+ if (!window.emMessageBus) return;
103
105
 
104
- window.emMessageBus.subscribe(domain, (data) => {
105
- sheet.innerHTML = data;
106
- if (stylingContainer) {
107
- stylingContainer.appendChild(sheet);
108
- }
109
- });
106
+ const supportAdoptStyle = 'adoptedStyleSheets' in Document.prototype;
107
+
108
+ if (!supportAdoptStyle || !useAdoptedStyleSheets) {
109
+ subscription = getStyleTagSubscription(stylingContainer, domain);
110
+
111
+ return subscription;
112
+ }
113
+
114
+ if (!window[StyleCacheKey]) {
115
+ window[StyleCacheKey] = {};
110
116
  }
117
+ subscription = getAdoptStyleSubscription(stylingContainer, domain);
118
+
119
+ const originalUnsubscribe = subscription.unsubscribe.bind(subscription);
120
+ const wrappedUnsubscribe = () => {
121
+ if (window[StyleCacheKey][domain]) {
122
+ const cachedObject = window[StyleCacheKey][domain];
123
+ cachedObject.refCount > 1
124
+ ? (cachedObject.refCount = cachedObject.refCount - 1)
125
+ : delete window[StyleCacheKey][domain];
126
+ }
127
+
128
+ originalUnsubscribe();
129
+ };
130
+ subscription.unsubscribe = wrappedUnsubscribe;
131
+
132
+ return subscription;
133
+ }
134
+
135
+ function getStyleTagSubscription(stylingContainer, domain) {
136
+ const sheet = document.createElement('style');
137
+
138
+ return window.emMessageBus.subscribe(domain, (data) => {
139
+ if (stylingContainer) {
140
+ sheet.innerHTML = data;
141
+ stylingContainer.appendChild(sheet);
142
+ }
143
+ });
144
+ }
145
+
146
+ function getAdoptStyleSubscription(stylingContainer, domain) {
147
+ return window.emMessageBus.subscribe(domain, (data) => {
148
+ if (!stylingContainer) return;
149
+
150
+ const shadowRoot = stylingContainer.getRootNode();
151
+ const cacheStyleObject = window[StyleCacheKey];
152
+ let cachedStyle = cacheStyleObject[domain]?.sheet;
153
+
154
+ if (!cachedStyle) {
155
+ cachedStyle = new CSSStyleSheet();
156
+ cachedStyle.replaceSync(data);
157
+ cacheStyleObject[domain] = {
158
+ sheet: cachedStyle,
159
+ refCount: 1
160
+ };
161
+ } else {
162
+ cacheStyleObject[domain].refCount = cacheStyleObject[domain].refCount + 1;
163
+ }
164
+
165
+ const currentSheets = shadowRoot.adoptedStyleSheets || [];
166
+ if (!currentSheets.includes(cachedStyle)) {
167
+ shadowRoot.adoptedStyleSheets = [...currentSheets, cachedStyle];
168
+ }
169
+ });
111
170
  }
112
171
 
113
- const lotteryTippingDialogCss = ".dialog-wrapper{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;visibility:hidden;opacity:1;z-index:199}.dialog-wrapper-visible{visibility:visible}.mask{position:fixed;inset:0;background-color:rgba(0, 0, 0, 0.5);opacity:0;z-index:1000;transition:opacity var(--duration) linear}.mask-enter{opacity:1}.mask-leave{opacity:0}.dialog{position:relative;background:var(--emw--color-background, #fff);border-radius:12px;box-shadow:0 4px 32px rgba(0, 0, 0, 0.15);opacity:0;transform:scale(0.9);transition:all var(--duration) linear;width:100%;max-width:100vw;overflow:hidden;z-index:1000}.dialog-enter{opacity:1;transform:scale(1)}.dialog-leave{opacity:0}.dialog.fullscreen{width:100vw !important;height:100vh;overflow:auto;max-height:none;border-radius:0;overflow:hidden}.dialog-header{padding:16px 16px 0 16px;display:flex;justify-content:space-between;align-items:center}.dialog-header .dialog-title{margin:0;font-size:1.25rem;font-weight:500;color:var(--emw--color-typography, #000)}.dialog-header .close-btn{background:transparent;border:none;font-size:1.5rem;width:2rem;height:2rem;color:var(--emw--color-gray-150, #6f6f6f);cursor:pointer;border-radius:4px}.dialog-header .close-btn:hover{background:var(--emw--color-gray-50, #f5f5f5);color:var(--emw--color-gray-300, #333)}.dialog-content{padding:24px;font-size:0.95rem;line-height:1.6;color:var(--emw--color-dialog-typography, #000);flex:1;overflow-y:auto;max-height:calc(100vh - 200px)}.dialog.fullscreen .dialog-content{max-height:none}.dialog-footer{padding:0 16px 16px 16px;display:flex;justify-content:center;gap:12px}.dialog-footer .cancel-btn,.dialog-footer .confirm-btn{padding:10px 24px;border-radius:6px;font-size:0.9rem;cursor:pointer;transition:all 0.3s linear}.dialog-footer .cancel-btn{border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));background-color:var(--emw--color-background, #fff);color:var(--emw--color-typography, #000)}.dialog-footer .cancel-btn:hover{background-color:var(--emw--color-background-tertiary, #ccc)}.dialog-footer .confirm-btn{border:none;color:var(--emw--color-typography-normalized, #ffffff);background:var(--emw--color-primary, #009993)}.dialog-footer .confirm-btn:hover{background:var(--emw--color-primary-variant, #004d4a)}@media screen and (max-width: 480px){.dialog.fullscreen .dialog-content{padding:12px}}.Loading{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.Loading svg{animation:spin 1s linear infinite;transform-origin:center}@keyframes spin{100%{transform:rotate(360deg)}}";
172
+ const lotteryTippingDialogCss = ".dialog-wrapper{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;visibility:hidden;opacity:1;z-index:199}.dialog-wrapper-visible{visibility:visible}.mask{position:fixed;inset:0;background:var(--emw--color-mask-dialog-background, rgba(0, 0, 0, 0.5));opacity:0;z-index:1000;transition:opacity var(--duration) linear}.mask-enter{opacity:1}.mask-leave{opacity:0}.dialog{position:relative;background:var(--emw--color-background, #fff);border-radius:12px;box-shadow:0 4px 32px var(--emw--button-box-shadow-color-secondary, rgba(0, 0, 0, 0.15));opacity:0;transform:scale(0.9);transition:all var(--duration) linear;width:100%;max-width:100vw;overflow:hidden;z-index:1000}.dialog-enter{opacity:1;transform:scale(1)}.dialog-leave{opacity:0}.dialog.fullscreen{width:100vw !important;height:100vh;overflow:auto;max-height:none;border-radius:0;overflow:hidden}.dialog-header{padding:16px 16px 0 16px;display:flex;justify-content:space-between;align-items:center}.dialog-header .dialog-title{margin:0;font-size:1.25rem;font-weight:500;color:var(--emw--color-typography, #000)}.dialog-header .close-btn{background:transparent;border:none;font-size:1.5rem;width:2rem;height:2rem;color:var(--emw--color-gray-150, #6f6f6f);cursor:pointer;border-radius:4px}.dialog-header .close-btn:hover{background:var(--emw--color-gray-50, #f5f5f5);color:var(--emw--color-gray-300, #333)}.dialog-content{padding:24px;font-size:0.95rem;line-height:1.6;color:var(--emw--color-dialog-typography, #000);flex:1;overflow-y:auto;max-height:calc(100vh - 200px)}.dialog.fullscreen .dialog-content{max-height:none}.dialog-footer{padding:0 16px 16px 16px;display:flex;justify-content:center;gap:12px}.dialog-footer .cancel-btn,.dialog-footer .confirm-btn{padding:10px 24px;border-radius:6px;font-size:0.9rem;cursor:pointer;transition:all 0.3s linear}.dialog-footer .cancel-btn{border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));background-color:var(--emw--color-background, #fff);color:var(--emw--color-typography, #000)}.dialog-footer .cancel-btn:hover{background-color:var(--emw--color-background-tertiary, #ccc)}.dialog-footer .confirm-btn{border:none;color:var(--emw--color-typography-normalized, #ffffff);background:var(--emw--color-primary, #009993)}.dialog-footer .confirm-btn:hover{background:var(--emw--color-primary-variant, #004d4a)}@media screen and (max-width: 480px){.dialog.fullscreen .dialog-content{padding:12px}}.Loading{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.Loading svg{animation:spin 1s linear infinite;transform-origin:center}@keyframes spin{100%{transform:rotate(360deg)}}";
114
173
  const LotteryTippingDialogStyle0 = lotteryTippingDialogCss;
115
174
 
116
175
  const LotteryTippingDialog = class {
@@ -151,7 +210,7 @@ const LotteryTippingDialog = class {
151
210
  }
152
211
  handleMbSourceChange(newValue, oldValue) {
153
212
  if (newValue != oldValue) {
154
- setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
213
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
155
214
  }
156
215
  }
157
216
  componentWillLoad() {
@@ -1,2 +1,2 @@
1
- export { L as lottery_tipping_dialog } from './lottery-tipping-dialog-d948d5a0.js';
1
+ export { L as lottery_tipping_dialog } from './lottery-tipping-dialog-cf6b2617.js';
2
2
  import './index-9dba6e0e.js';
@@ -1 +1 @@
1
- export{L as LotteryTippingDialog}from"./lottery-tipping-dialog-d948d5a0.js";import"./index-9dba6e0e.js";
1
+ export{L as LotteryTippingDialog}from"./lottery-tipping-dialog-cf6b2617.js";import"./index-9dba6e0e.js";
@@ -0,0 +1 @@
1
+ import{r as e,c as i,h as t,g as o}from"./index-9dba6e0e.js";const a=["ro","en","fr","ar","hr"],n={en:{cancel:"Cancel",confirm:"Confirm"},ro:{cancel:"Anulează",confirm:"Confirmă"},fr:{cancel:"Annuler",confirm:"Confirmer"},ar:{cancel:"إلغاء",confirm:"تأكيد"},hr:{cancel:"Odustani",confirm:"Potvrdi"}},r=(e,i)=>{const t=i;return n[void 0!==t&&a.includes(t)?t:"en"][e]},c="__WIDGET_GLOBAL_STYLE_CACHE__";const s=class{constructor(t){e(this,t),this.open=i(this,"open",7),this.close=i(this,"close",7),this.confirm=i(this,"confirm",7),this.cancel=i(this,"cancel",7),this.wasVisible=!1,this.mbSource=void 0,this.clientStyling="",this.clientStylingUrl="",this.visible=void 0,this.dialogTitle="",this.width="520px",this.closable=!0,this.mask=!0,this.maskClosable=!0,this.animationDuration=300,this.fullscreen=!1,this.showFooter=!0,this.showCancelBtn=!0,this.language="en",this.translationUrl=void 0,this.dialogClass=void 0,this.dialogStyle=void 0}handleClientStylingChange(e,i){e!=i&&function(e,i){if(e){const t=document.createElement("style");t.innerHTML=i,e.appendChild(t)}}(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(e,i){e!=i&&function(e,i){if(!e||!i)return;const t=new URL(i);fetch(t.href).then((e=>e.text())).then((i=>{const t=document.createElement("style");t.innerHTML=i,e&&e.appendChild(t)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(e,i){e!=i&&function(e,i,t,o=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!o)return function(e,i){const t=document.createElement("style");return window.emMessageBus.subscribe(i,(i=>{e&&(t.innerHTML=i,e.appendChild(t))}))}(e,i);window[c]||(window[c]={});const a=(t=function(e,i){return window.emMessageBus.subscribe(i,(t=>{if(!e)return;const o=e.getRootNode(),a=window[c];let n=a[i]?.sheet;n?a[i].refCount=a[i].refCount+1:(n=new CSSStyleSheet,n.replaceSync(t),a[i]={sheet:n,refCount:1});const r=o.adoptedStyleSheets||[];r.includes(n)||(o.adoptedStyleSheets=[...r,n])}))}(e,i)).unsubscribe.bind(t);t.unsubscribe=()=>{if(window[c][i]){const e=window[c][i];e.refCount>1?e.refCount=e.refCount-1:delete window[c][i]}a()}}(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentWillLoad(){this.translationUrl&&(async e=>{if(e)try{const t=await fetch(e);if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);const o=await t.json();i=o,Object.keys(i).forEach((e=>{for(let t in i[e])n[e][t]=i[e][t]}))}catch(e){console.error("Failed to fetch or parse translations from URL:",e)}var i})(this.translationUrl)}componentWillUpdate(){this.visible&&!this.wasVisible?this.disableBodyScroll():!this.visible&&this.wasVisible&&this.enableBodyScroll(),this.wasVisible=this.visible}disconnectedCallback(){this.enableBodyScroll(),this.stylingSubscription&&this.stylingSubscription.unsubscribe()}disableBodyScroll(){document.body.style.overflow="hidden"}enableBodyScroll(){document.body.style.overflow=""}handleClose(){this.cancel.emit()}handleMaskClick(){this.maskClosable&&this.cancel.emit()}handleConfirm(){this.confirm.emit()}render(){const e=Object.assign({width:"number"==typeof this.width?`${this.width}px`:this.width,"--duration":`${this.animationDuration}ms`},this.dialogStyle||{}),i=["dialog-wrapper",this.visible?"dialog-wrapper-visible":""],o=["mask",this.visible?"mask-enter":"mask-leave"],a=["dialog",this.visible?"dialog-enter":"dialog-leave",this.fullscreen?"fullscreen":"",this.dialogClass].filter(Boolean).join(" ");return t("div",{key:"306683c5190fa6dca57dcf75e52eca575c0215e7",class:i.join(" "),ref:e=>this.stylingContainer=e},t("div",{key:"8be097f3a86fcd9ad4e18c6ac56cafdcf249049b",class:o.join(" "),onClick:this.handleMaskClick.bind(this)}),t("div",{key:"87d2206d3e3d75fe0e0ef8a6afd8de5c20892ae6",part:"dialog",class:a,style:e,role:"dialog","aria-modal":"true","aria-labelledby":"dialog-title"},(this.dialogTitle||this.closable)&&t("div",{key:"04d54878aa24e0d9eb98bc921ea3edfacd6de3af",class:"dialog-header"},t("h2",{key:"f6f6c279de47e49cde86d0c907b9b40a115926b3",id:"dialog-title",class:"dialog-title"},this.dialogTitle),this.closable&&t("button",{key:"e1625473e5460cd667961923bf678c9a91b69c82",class:"close-btn",onClick:this.handleClose.bind(this)},"x")),t("div",{key:"fb0db8dd765832cf1d8e8b682131e4c97a93ac22",class:"dialog-content",style:{maxHeight:"calc(100vh - 62px)",overflowY:"auto"}},t("slot",{key:"75336f59c2a8fe6775fc12ed4e2e26ff6bb6b508"})),this.showFooter&&t("div",{key:"a305086a2830265317abb0fd6f59b4a053fd54a9",class:"dialog-footer"},t("slot",{key:"cb330ea63908002f4f8b4b8139d5843c2570302e",name:"footer"},this.showCancelBtn&&t("button",{key:"c3d2c15195e56efd6d388265e9ccb87030627b7b",class:"cancel-btn",onClick:this.handleClose.bind(this)},r("cancel",this.language)),t("button",{key:"af9c96b4e1ce82f9ecb73e2b9f4e93cba0382d76",class:"confirm-btn",onClick:this.handleConfirm.bind(this)},r("confirm",this.language))))))}get el(){return o(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};s.style=".dialog-wrapper{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;visibility:hidden;opacity:1;z-index:199}.dialog-wrapper-visible{visibility:visible}.mask{position:fixed;inset:0;background:var(--emw--color-mask-dialog-background, rgba(0, 0, 0, 0.5));opacity:0;z-index:1000;transition:opacity var(--duration) linear}.mask-enter{opacity:1}.mask-leave{opacity:0}.dialog{position:relative;background:var(--emw--color-background, #fff);border-radius:12px;box-shadow:0 4px 32px var(--emw--button-box-shadow-color-secondary, rgba(0, 0, 0, 0.15));opacity:0;transform:scale(0.9);transition:all var(--duration) linear;width:100%;max-width:100vw;overflow:hidden;z-index:1000}.dialog-enter{opacity:1;transform:scale(1)}.dialog-leave{opacity:0}.dialog.fullscreen{width:100vw !important;height:100vh;overflow:auto;max-height:none;border-radius:0;overflow:hidden}.dialog-header{padding:16px 16px 0 16px;display:flex;justify-content:space-between;align-items:center}.dialog-header .dialog-title{margin:0;font-size:1.25rem;font-weight:500;color:var(--emw--color-typography, #000)}.dialog-header .close-btn{background:transparent;border:none;font-size:1.5rem;width:2rem;height:2rem;color:var(--emw--color-gray-150, #6f6f6f);cursor:pointer;border-radius:4px}.dialog-header .close-btn:hover{background:var(--emw--color-gray-50, #f5f5f5);color:var(--emw--color-gray-300, #333)}.dialog-content{padding:24px;font-size:0.95rem;line-height:1.6;color:var(--emw--color-dialog-typography, #000);flex:1;overflow-y:auto;max-height:calc(100vh - 200px)}.dialog.fullscreen .dialog-content{max-height:none}.dialog-footer{padding:0 16px 16px 16px;display:flex;justify-content:center;gap:12px}.dialog-footer .cancel-btn,.dialog-footer .confirm-btn{padding:10px 24px;border-radius:6px;font-size:0.9rem;cursor:pointer;transition:all 0.3s linear}.dialog-footer .cancel-btn{border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));background-color:var(--emw--color-background, #fff);color:var(--emw--color-typography, #000)}.dialog-footer .cancel-btn:hover{background-color:var(--emw--color-background-tertiary, #ccc)}.dialog-footer .confirm-btn{border:none;color:var(--emw--color-typography-normalized, #ffffff);background:var(--emw--color-primary, #009993)}.dialog-footer .confirm-btn:hover{background:var(--emw--color-primary-variant, #004d4a)}@media screen and (max-width: 480px){.dialog.fullscreen .dialog-content{padding:12px}}.Loading{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.Loading svg{animation:spin 1s linear infinite;transform-origin:center}@keyframes spin{100%{transform:rotate(360deg)}}";export{s as L}
@@ -1 +1 @@
1
- export{L as lottery_tipping_dialog}from"./lottery-tipping-dialog-d948d5a0.js";import"./index-9dba6e0e.js";
1
+ export{L as lottery_tipping_dialog}from"./lottery-tipping-dialog-cf6b2617.js";import"./index-9dba6e0e.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/lottery-tipping-dialog",
3
- "version": "1.87.26",
3
+ "version": "1.87.28",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",
@@ -1 +0,0 @@
1
- import{r as e,c as i,h as t,g as o}from"./index-9dba6e0e.js";const a=["ro","en","fr","ar","hr"],r={en:{cancel:"Cancel",confirm:"Confirm"},ro:{cancel:"Anulează",confirm:"Confirmă"},fr:{cancel:"Annuler",confirm:"Confirmer"},ar:{cancel:"إلغاء",confirm:"تأكيد"},hr:{cancel:"Odustani",confirm:"Potvrdi"}},n=(e,i)=>{const t=i;return r[void 0!==t&&a.includes(t)?t:"en"][e]},l=class{constructor(t){e(this,t),this.open=i(this,"open",7),this.close=i(this,"close",7),this.confirm=i(this,"confirm",7),this.cancel=i(this,"cancel",7),this.wasVisible=!1,this.mbSource=void 0,this.clientStyling="",this.clientStylingUrl="",this.visible=void 0,this.dialogTitle="",this.width="520px",this.closable=!0,this.mask=!0,this.maskClosable=!0,this.animationDuration=300,this.fullscreen=!1,this.showFooter=!0,this.showCancelBtn=!0,this.language="en",this.translationUrl=void 0,this.dialogClass=void 0,this.dialogStyle=void 0}handleClientStylingChange(e,i){e!=i&&function(e,i){if(e){const t=document.createElement("style");t.innerHTML=i,e.appendChild(t)}}(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(e,i){e!=i&&function(e,i){if(!e||!i)return;const t=new URL(i);fetch(t.href).then((e=>e.text())).then((i=>{const t=document.createElement("style");t.innerHTML=i,e&&e.appendChild(t)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(e,i){e!=i&&function(e,i){if(window.emMessageBus){const t=document.createElement("style");window.emMessageBus.subscribe(i,(i=>{t.innerHTML=i,e&&e.appendChild(t)}))}}(this.stylingContainer,`${this.mbSource}.Style`)}componentWillLoad(){this.translationUrl&&(async e=>{if(e)try{const t=await fetch(e);if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);const o=await t.json();i=o,Object.keys(i).forEach((e=>{for(let t in i[e])r[e][t]=i[e][t]}))}catch(e){console.error("Failed to fetch or parse translations from URL:",e)}var i})(this.translationUrl)}componentWillUpdate(){this.visible&&!this.wasVisible?this.disableBodyScroll():!this.visible&&this.wasVisible&&this.enableBodyScroll(),this.wasVisible=this.visible}disconnectedCallback(){this.enableBodyScroll(),this.stylingSubscription&&this.stylingSubscription.unsubscribe()}disableBodyScroll(){document.body.style.overflow="hidden"}enableBodyScroll(){document.body.style.overflow=""}handleClose(){this.cancel.emit()}handleMaskClick(){this.maskClosable&&this.cancel.emit()}handleConfirm(){this.confirm.emit()}render(){const e=Object.assign({width:"number"==typeof this.width?`${this.width}px`:this.width,"--duration":`${this.animationDuration}ms`},this.dialogStyle||{}),i=["dialog-wrapper",this.visible?"dialog-wrapper-visible":""],o=["mask",this.visible?"mask-enter":"mask-leave"],a=["dialog",this.visible?"dialog-enter":"dialog-leave",this.fullscreen?"fullscreen":"",this.dialogClass].filter(Boolean).join(" ");return t("div",{key:"306683c5190fa6dca57dcf75e52eca575c0215e7",class:i.join(" "),ref:e=>this.stylingContainer=e},t("div",{key:"8be097f3a86fcd9ad4e18c6ac56cafdcf249049b",class:o.join(" "),onClick:this.handleMaskClick.bind(this)}),t("div",{key:"87d2206d3e3d75fe0e0ef8a6afd8de5c20892ae6",part:"dialog",class:a,style:e,role:"dialog","aria-modal":"true","aria-labelledby":"dialog-title"},(this.dialogTitle||this.closable)&&t("div",{key:"04d54878aa24e0d9eb98bc921ea3edfacd6de3af",class:"dialog-header"},t("h2",{key:"f6f6c279de47e49cde86d0c907b9b40a115926b3",id:"dialog-title",class:"dialog-title"},this.dialogTitle),this.closable&&t("button",{key:"e1625473e5460cd667961923bf678c9a91b69c82",class:"close-btn",onClick:this.handleClose.bind(this)},"x")),t("div",{key:"fb0db8dd765832cf1d8e8b682131e4c97a93ac22",class:"dialog-content",style:{maxHeight:"calc(100vh - 62px)",overflowY:"auto"}},t("slot",{key:"75336f59c2a8fe6775fc12ed4e2e26ff6bb6b508"})),this.showFooter&&t("div",{key:"a305086a2830265317abb0fd6f59b4a053fd54a9",class:"dialog-footer"},t("slot",{key:"cb330ea63908002f4f8b4b8139d5843c2570302e",name:"footer"},this.showCancelBtn&&t("button",{key:"c3d2c15195e56efd6d388265e9ccb87030627b7b",class:"cancel-btn",onClick:this.handleClose.bind(this)},n("cancel",this.language)),t("button",{key:"af9c96b4e1ce82f9ecb73e2b9f4e93cba0382d76",class:"confirm-btn",onClick:this.handleConfirm.bind(this)},n("confirm",this.language))))))}get el(){return o(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};l.style=".dialog-wrapper{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;visibility:hidden;opacity:1;z-index:199}.dialog-wrapper-visible{visibility:visible}.mask{position:fixed;inset:0;background-color:rgba(0, 0, 0, 0.5);opacity:0;z-index:1000;transition:opacity var(--duration) linear}.mask-enter{opacity:1}.mask-leave{opacity:0}.dialog{position:relative;background:var(--emw--color-background, #fff);border-radius:12px;box-shadow:0 4px 32px rgba(0, 0, 0, 0.15);opacity:0;transform:scale(0.9);transition:all var(--duration) linear;width:100%;max-width:100vw;overflow:hidden;z-index:1000}.dialog-enter{opacity:1;transform:scale(1)}.dialog-leave{opacity:0}.dialog.fullscreen{width:100vw !important;height:100vh;overflow:auto;max-height:none;border-radius:0;overflow:hidden}.dialog-header{padding:16px 16px 0 16px;display:flex;justify-content:space-between;align-items:center}.dialog-header .dialog-title{margin:0;font-size:1.25rem;font-weight:500;color:var(--emw--color-typography, #000)}.dialog-header .close-btn{background:transparent;border:none;font-size:1.5rem;width:2rem;height:2rem;color:var(--emw--color-gray-150, #6f6f6f);cursor:pointer;border-radius:4px}.dialog-header .close-btn:hover{background:var(--emw--color-gray-50, #f5f5f5);color:var(--emw--color-gray-300, #333)}.dialog-content{padding:24px;font-size:0.95rem;line-height:1.6;color:var(--emw--color-dialog-typography, #000);flex:1;overflow-y:auto;max-height:calc(100vh - 200px)}.dialog.fullscreen .dialog-content{max-height:none}.dialog-footer{padding:0 16px 16px 16px;display:flex;justify-content:center;gap:12px}.dialog-footer .cancel-btn,.dialog-footer .confirm-btn{padding:10px 24px;border-radius:6px;font-size:0.9rem;cursor:pointer;transition:all 0.3s linear}.dialog-footer .cancel-btn{border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));background-color:var(--emw--color-background, #fff);color:var(--emw--color-typography, #000)}.dialog-footer .cancel-btn:hover{background-color:var(--emw--color-background-tertiary, #ccc)}.dialog-footer .confirm-btn{border:none;color:var(--emw--color-typography-normalized, #ffffff);background:var(--emw--color-primary, #009993)}.dialog-footer .confirm-btn:hover{background:var(--emw--color-primary-variant, #004d4a)}@media screen and (max-width: 480px){.dialog.fullscreen .dialog-content{padding:12px}}.Loading{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.Loading svg{animation:spin 1s linear infinite;transform-origin:center}@keyframes spin{100%{transform:rotate(360deg)}}";export{l as L}