@everymatrix/lottery-tipping-ticket-controller 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.
- package/dist/cjs/general-tooltip_7.cjs.entry.js +13 -13
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/{lottery-tipping-ticket-controller-59ee8536.js → lottery-tipping-ticket-controller-38883843.js} +70 -11
- package/dist/esm/general-tooltip_7.entry.js +14 -14
- package/dist/esm/index.js +1 -1
- package/dist/esm/{lottery-tipping-ticket-controller-f0d23f7a.js → lottery-tipping-ticket-controller-7714da55.js} +70 -11
- package/dist/lottery-tipping-ticket-controller/general-tooltip_7.entry.js +1 -1
- package/dist/lottery-tipping-ticket-controller/index.esm.js +1 -1
- package/dist/lottery-tipping-ticket-controller/{lottery-tipping-ticket-controller-f0d23f7a.js → lottery-tipping-ticket-controller-7714da55.js} +59 -59
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-3e1fe885.js');
|
|
6
|
-
const lotteryTippingTicketController = require('./lottery-tipping-ticket-controller-
|
|
6
|
+
const lotteryTippingTicketController = require('./lottery-tipping-ticket-controller-38883843.js');
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @name startOfDay
|
|
@@ -117,7 +117,7 @@ const GeneralTooltip = class {
|
|
|
117
117
|
}
|
|
118
118
|
handleMbSourceChange(newValue, oldValue) {
|
|
119
119
|
if (newValue != oldValue) {
|
|
120
|
-
lotteryTippingTicketController.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
120
|
+
lotteryTippingTicketController.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
componentWillLoad() {
|
|
@@ -126,7 +126,7 @@ const GeneralTooltip = class {
|
|
|
126
126
|
componentDidLoad() {
|
|
127
127
|
if (this.stylingContainer) {
|
|
128
128
|
if (this.mbSource)
|
|
129
|
-
lotteryTippingTicketController.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
129
|
+
lotteryTippingTicketController.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
130
130
|
if (this.clientStyling)
|
|
131
131
|
lotteryTippingTicketController.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
132
132
|
if (this.clientStylingUrl)
|
|
@@ -271,7 +271,7 @@ const LotteryButton = class {
|
|
|
271
271
|
}
|
|
272
272
|
handleMbSourceChange(newValue, oldValue) {
|
|
273
273
|
if (newValue != oldValue) {
|
|
274
|
-
lotteryTippingTicketController.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
274
|
+
lotteryTippingTicketController.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
277
|
disconnectedCallback() {
|
|
@@ -280,7 +280,7 @@ const LotteryButton = class {
|
|
|
280
280
|
componentDidLoad() {
|
|
281
281
|
if (this.stylingContainer) {
|
|
282
282
|
if (this.mbSource)
|
|
283
|
-
lotteryTippingTicketController.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
283
|
+
lotteryTippingTicketController.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
284
284
|
if (this.clientStyling)
|
|
285
285
|
lotteryTippingTicketController.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
286
286
|
if (this.clientStylingUrl)
|
|
@@ -373,13 +373,13 @@ const LotteryTippingBullet = class {
|
|
|
373
373
|
}
|
|
374
374
|
handleMbSourceChange(newValue, oldValue) {
|
|
375
375
|
if (newValue != oldValue) {
|
|
376
|
-
lotteryTippingTicketController.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
376
|
+
lotteryTippingTicketController.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
379
|
componentDidLoad() {
|
|
380
380
|
if (this.stylingContainer) {
|
|
381
381
|
if (this.mbSource)
|
|
382
|
-
lotteryTippingTicketController.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
382
|
+
lotteryTippingTicketController.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
383
383
|
if (this.clientStyling)
|
|
384
384
|
lotteryTippingTicketController.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
385
385
|
if (this.clientStylingUrl)
|
|
@@ -465,13 +465,13 @@ const LotteryTippingBulletGroup = class {
|
|
|
465
465
|
}
|
|
466
466
|
handleMbSourceChange(newValue, oldValue) {
|
|
467
467
|
if (newValue != oldValue) {
|
|
468
|
-
lotteryTippingTicketController.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
468
|
+
lotteryTippingTicketController.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
471
|
componentDidLoad() {
|
|
472
472
|
if (this.stylingContainer) {
|
|
473
473
|
if (this.mbSource)
|
|
474
|
-
lotteryTippingTicketController.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
474
|
+
lotteryTippingTicketController.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
475
475
|
if (this.clientStyling)
|
|
476
476
|
lotteryTippingTicketController.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
477
477
|
if (this.clientStylingUrl)
|
|
@@ -591,7 +591,7 @@ const LotteryTippingTicketBanner = class {
|
|
|
591
591
|
}
|
|
592
592
|
handleMbSourceChange(newValue, oldValue) {
|
|
593
593
|
if (newValue != oldValue) {
|
|
594
|
-
lotteryTippingTicketController.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
594
|
+
lotteryTippingTicketController.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
595
595
|
}
|
|
596
596
|
}
|
|
597
597
|
async componentWillLoad() {
|
|
@@ -602,7 +602,7 @@ const LotteryTippingTicketBanner = class {
|
|
|
602
602
|
componentDidLoad() {
|
|
603
603
|
if (this.stylingContainer) {
|
|
604
604
|
if (this.mbSource)
|
|
605
|
-
lotteryTippingTicketController.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
605
|
+
lotteryTippingTicketController.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
606
606
|
if (this.clientStyling)
|
|
607
607
|
lotteryTippingTicketController.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
608
608
|
if (this.clientStylingUrl)
|
|
@@ -906,7 +906,7 @@ const LotteryTippingTicketBet = class {
|
|
|
906
906
|
}
|
|
907
907
|
handleMbSourceChange(newValue, oldValue) {
|
|
908
908
|
if (newValue != oldValue) {
|
|
909
|
-
lotteryTippingTicketController.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
909
|
+
lotteryTippingTicketController.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
910
910
|
}
|
|
911
911
|
}
|
|
912
912
|
disconnectedCallback() {
|
|
@@ -920,7 +920,7 @@ const LotteryTippingTicketBet = class {
|
|
|
920
920
|
componentDidLoad() {
|
|
921
921
|
if (this.stylingContainer) {
|
|
922
922
|
if (this.mbSource)
|
|
923
|
-
lotteryTippingTicketController.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
923
|
+
lotteryTippingTicketController.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
924
924
|
if (this.clientStyling)
|
|
925
925
|
lotteryTippingTicketController.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
926
926
|
if (this.clientStylingUrl)
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const lotteryTippingTicketController = require('./lottery-tipping-ticket-controller-
|
|
5
|
+
const lotteryTippingTicketController = require('./lottery-tipping-ticket-controller-38883843.js');
|
|
6
6
|
require('./index-3e1fe885.js');
|
|
7
7
|
|
|
8
8
|
|
|
@@ -6662,6 +6662,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|
|
6662
6662
|
<div on-click="_scrollForward" part="forward-button" aria-hidden="true"></div>
|
|
6663
6663
|
`}static get is(){return "vaadin-tabs"}}v(vh);
|
|
6664
6664
|
|
|
6665
|
+
const StyleCacheKey = '__WIDGET_GLOBAL_STYLE_CACHE__';
|
|
6666
|
+
|
|
6665
6667
|
/**
|
|
6666
6668
|
* @name setClientStyling
|
|
6667
6669
|
* @description Method used to create and append to the passed element of the widget a style element with the content received
|
|
@@ -6707,18 +6709,75 @@ function setClientStylingURL(stylingContainer, clientStylingUrl) {
|
|
|
6707
6709
|
* @param {HTMLElement} stylingContainer The highest element of the widget
|
|
6708
6710
|
* @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
|
|
6709
6711
|
* @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
|
|
6712
|
+
* @param {boolean} useAdoptedStyleSheets A flag to gradually enable testing of adoptedStyleSheets
|
|
6710
6713
|
*/
|
|
6711
|
-
function setStreamStyling(stylingContainer, domain, subscription) {
|
|
6712
|
-
if (window.emMessageBus)
|
|
6713
|
-
const sheet = document.createElement('style');
|
|
6714
|
+
function setStreamStyling(stylingContainer, domain, subscription, useAdoptedStyleSheets = false) {
|
|
6715
|
+
if (!window.emMessageBus) return;
|
|
6714
6716
|
|
|
6715
|
-
|
|
6716
|
-
|
|
6717
|
-
|
|
6718
|
-
|
|
6719
|
-
|
|
6720
|
-
|
|
6717
|
+
const supportAdoptStyle = 'adoptedStyleSheets' in Document.prototype;
|
|
6718
|
+
|
|
6719
|
+
if (!supportAdoptStyle || !useAdoptedStyleSheets) {
|
|
6720
|
+
subscription = getStyleTagSubscription(stylingContainer, domain);
|
|
6721
|
+
|
|
6722
|
+
return subscription;
|
|
6721
6723
|
}
|
|
6724
|
+
|
|
6725
|
+
if (!window[StyleCacheKey]) {
|
|
6726
|
+
window[StyleCacheKey] = {};
|
|
6727
|
+
}
|
|
6728
|
+
subscription = getAdoptStyleSubscription(stylingContainer, domain);
|
|
6729
|
+
|
|
6730
|
+
const originalUnsubscribe = subscription.unsubscribe.bind(subscription);
|
|
6731
|
+
const wrappedUnsubscribe = () => {
|
|
6732
|
+
if (window[StyleCacheKey][domain]) {
|
|
6733
|
+
const cachedObject = window[StyleCacheKey][domain];
|
|
6734
|
+
cachedObject.refCount > 1
|
|
6735
|
+
? (cachedObject.refCount = cachedObject.refCount - 1)
|
|
6736
|
+
: delete window[StyleCacheKey][domain];
|
|
6737
|
+
}
|
|
6738
|
+
|
|
6739
|
+
originalUnsubscribe();
|
|
6740
|
+
};
|
|
6741
|
+
subscription.unsubscribe = wrappedUnsubscribe;
|
|
6742
|
+
|
|
6743
|
+
return subscription;
|
|
6744
|
+
}
|
|
6745
|
+
|
|
6746
|
+
function getStyleTagSubscription(stylingContainer, domain) {
|
|
6747
|
+
const sheet = document.createElement('style');
|
|
6748
|
+
|
|
6749
|
+
return window.emMessageBus.subscribe(domain, (data) => {
|
|
6750
|
+
if (stylingContainer) {
|
|
6751
|
+
sheet.innerHTML = data;
|
|
6752
|
+
stylingContainer.appendChild(sheet);
|
|
6753
|
+
}
|
|
6754
|
+
});
|
|
6755
|
+
}
|
|
6756
|
+
|
|
6757
|
+
function getAdoptStyleSubscription(stylingContainer, domain) {
|
|
6758
|
+
return window.emMessageBus.subscribe(domain, (data) => {
|
|
6759
|
+
if (!stylingContainer) return;
|
|
6760
|
+
|
|
6761
|
+
const shadowRoot = stylingContainer.getRootNode();
|
|
6762
|
+
const cacheStyleObject = window[StyleCacheKey];
|
|
6763
|
+
let cachedStyle = cacheStyleObject[domain]?.sheet;
|
|
6764
|
+
|
|
6765
|
+
if (!cachedStyle) {
|
|
6766
|
+
cachedStyle = new CSSStyleSheet();
|
|
6767
|
+
cachedStyle.replaceSync(data);
|
|
6768
|
+
cacheStyleObject[domain] = {
|
|
6769
|
+
sheet: cachedStyle,
|
|
6770
|
+
refCount: 1
|
|
6771
|
+
};
|
|
6772
|
+
} else {
|
|
6773
|
+
cacheStyleObject[domain].refCount = cacheStyleObject[domain].refCount + 1;
|
|
6774
|
+
}
|
|
6775
|
+
|
|
6776
|
+
const currentSheets = shadowRoot.adoptedStyleSheets || [];
|
|
6777
|
+
if (!currentSheets.includes(cachedStyle)) {
|
|
6778
|
+
shadowRoot.adoptedStyleSheets = [...currentSheets, cachedStyle];
|
|
6779
|
+
}
|
|
6780
|
+
});
|
|
6722
6781
|
}
|
|
6723
6782
|
|
|
6724
6783
|
var PlayModeEnum;
|
|
@@ -9681,7 +9740,7 @@ const LotteryTippingTicketController = class {
|
|
|
9681
9740
|
}
|
|
9682
9741
|
handleMbSourceChange(newValue, oldValue) {
|
|
9683
9742
|
if (newValue != oldValue) {
|
|
9684
|
-
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
9743
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
9685
9744
|
}
|
|
9686
9745
|
}
|
|
9687
9746
|
componentWillLoad() {
|
|
@@ -9692,7 +9751,7 @@ const LotteryTippingTicketController = class {
|
|
|
9692
9751
|
componentDidLoad() {
|
|
9693
9752
|
if (this.stylingContainer) {
|
|
9694
9753
|
if (this.mbSource)
|
|
9695
|
-
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
9754
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
9696
9755
|
if (this.clientStyling)
|
|
9697
9756
|
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
9698
9757
|
if (this.clientStylingUrl)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, g as getElement, c as createEvent } from './index-e3ec645c.js';
|
|
2
|
-
import { r as requiredArgs, t as toDate, s as setClientStyling, a as setClientStylingURL, b as setStreamStyling, f as formatDate$1, c as resolveTranslationUrl$1, p as parseISO, d as format } from './lottery-tipping-ticket-controller-
|
|
3
|
-
export { L as lottery_tipping_ticket_controller } from './lottery-tipping-ticket-controller-
|
|
2
|
+
import { r as requiredArgs, t as toDate, s as setClientStyling, a as setClientStylingURL, b as setStreamStyling, f as formatDate$1, c as resolveTranslationUrl$1, p as parseISO, d as format } from './lottery-tipping-ticket-controller-7714da55.js';
|
|
3
|
+
export { L as lottery_tipping_ticket_controller } from './lottery-tipping-ticket-controller-7714da55.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @name startOfDay
|
|
@@ -114,7 +114,7 @@ const GeneralTooltip = class {
|
|
|
114
114
|
}
|
|
115
115
|
handleMbSourceChange(newValue, oldValue) {
|
|
116
116
|
if (newValue != oldValue) {
|
|
117
|
-
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
117
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
componentWillLoad() {
|
|
@@ -123,7 +123,7 @@ const GeneralTooltip = class {
|
|
|
123
123
|
componentDidLoad() {
|
|
124
124
|
if (this.stylingContainer) {
|
|
125
125
|
if (this.mbSource)
|
|
126
|
-
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
126
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
127
127
|
if (this.clientStyling)
|
|
128
128
|
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
129
129
|
if (this.clientStylingUrl)
|
|
@@ -268,7 +268,7 @@ const LotteryButton = class {
|
|
|
268
268
|
}
|
|
269
269
|
handleMbSourceChange(newValue, oldValue) {
|
|
270
270
|
if (newValue != oldValue) {
|
|
271
|
-
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
271
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
disconnectedCallback() {
|
|
@@ -277,7 +277,7 @@ const LotteryButton = class {
|
|
|
277
277
|
componentDidLoad() {
|
|
278
278
|
if (this.stylingContainer) {
|
|
279
279
|
if (this.mbSource)
|
|
280
|
-
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
280
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
281
281
|
if (this.clientStyling)
|
|
282
282
|
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
283
283
|
if (this.clientStylingUrl)
|
|
@@ -370,13 +370,13 @@ const LotteryTippingBullet = class {
|
|
|
370
370
|
}
|
|
371
371
|
handleMbSourceChange(newValue, oldValue) {
|
|
372
372
|
if (newValue != oldValue) {
|
|
373
|
-
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
373
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
376
|
componentDidLoad() {
|
|
377
377
|
if (this.stylingContainer) {
|
|
378
378
|
if (this.mbSource)
|
|
379
|
-
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
379
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
380
380
|
if (this.clientStyling)
|
|
381
381
|
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
382
382
|
if (this.clientStylingUrl)
|
|
@@ -462,13 +462,13 @@ const LotteryTippingBulletGroup = class {
|
|
|
462
462
|
}
|
|
463
463
|
handleMbSourceChange(newValue, oldValue) {
|
|
464
464
|
if (newValue != oldValue) {
|
|
465
|
-
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
465
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
466
466
|
}
|
|
467
467
|
}
|
|
468
468
|
componentDidLoad() {
|
|
469
469
|
if (this.stylingContainer) {
|
|
470
470
|
if (this.mbSource)
|
|
471
|
-
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
471
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
472
472
|
if (this.clientStyling)
|
|
473
473
|
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
474
474
|
if (this.clientStylingUrl)
|
|
@@ -588,7 +588,7 @@ const LotteryTippingTicketBanner = class {
|
|
|
588
588
|
}
|
|
589
589
|
handleMbSourceChange(newValue, oldValue) {
|
|
590
590
|
if (newValue != oldValue) {
|
|
591
|
-
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
591
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
592
592
|
}
|
|
593
593
|
}
|
|
594
594
|
async componentWillLoad() {
|
|
@@ -599,7 +599,7 @@ const LotteryTippingTicketBanner = class {
|
|
|
599
599
|
componentDidLoad() {
|
|
600
600
|
if (this.stylingContainer) {
|
|
601
601
|
if (this.mbSource)
|
|
602
|
-
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
602
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
603
603
|
if (this.clientStyling)
|
|
604
604
|
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
605
605
|
if (this.clientStylingUrl)
|
|
@@ -903,7 +903,7 @@ const LotteryTippingTicketBet = class {
|
|
|
903
903
|
}
|
|
904
904
|
handleMbSourceChange(newValue, oldValue) {
|
|
905
905
|
if (newValue != oldValue) {
|
|
906
|
-
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
906
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
907
907
|
}
|
|
908
908
|
}
|
|
909
909
|
disconnectedCallback() {
|
|
@@ -917,7 +917,7 @@ const LotteryTippingTicketBet = class {
|
|
|
917
917
|
componentDidLoad() {
|
|
918
918
|
if (this.stylingContainer) {
|
|
919
919
|
if (this.mbSource)
|
|
920
|
-
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
920
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
921
921
|
if (this.clientStyling)
|
|
922
922
|
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
923
923
|
if (this.clientStylingUrl)
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { L as LotteryTippingTicketController } from './lottery-tipping-ticket-controller-
|
|
1
|
+
export { L as LotteryTippingTicketController } from './lottery-tipping-ticket-controller-7714da55.js';
|
|
2
2
|
import './index-e3ec645c.js';
|
|
@@ -6660,6 +6660,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|
|
6660
6660
|
<div on-click="_scrollForward" part="forward-button" aria-hidden="true"></div>
|
|
6661
6661
|
`}static get is(){return "vaadin-tabs"}}v(vh);
|
|
6662
6662
|
|
|
6663
|
+
const StyleCacheKey = '__WIDGET_GLOBAL_STYLE_CACHE__';
|
|
6664
|
+
|
|
6663
6665
|
/**
|
|
6664
6666
|
* @name setClientStyling
|
|
6665
6667
|
* @description Method used to create and append to the passed element of the widget a style element with the content received
|
|
@@ -6705,18 +6707,75 @@ function setClientStylingURL(stylingContainer, clientStylingUrl) {
|
|
|
6705
6707
|
* @param {HTMLElement} stylingContainer The highest element of the widget
|
|
6706
6708
|
* @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
|
|
6707
6709
|
* @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
|
|
6710
|
+
* @param {boolean} useAdoptedStyleSheets A flag to gradually enable testing of adoptedStyleSheets
|
|
6708
6711
|
*/
|
|
6709
|
-
function setStreamStyling(stylingContainer, domain, subscription) {
|
|
6710
|
-
if (window.emMessageBus)
|
|
6711
|
-
const sheet = document.createElement('style');
|
|
6712
|
+
function setStreamStyling(stylingContainer, domain, subscription, useAdoptedStyleSheets = false) {
|
|
6713
|
+
if (!window.emMessageBus) return;
|
|
6712
6714
|
|
|
6713
|
-
|
|
6714
|
-
|
|
6715
|
-
|
|
6716
|
-
|
|
6717
|
-
|
|
6718
|
-
|
|
6715
|
+
const supportAdoptStyle = 'adoptedStyleSheets' in Document.prototype;
|
|
6716
|
+
|
|
6717
|
+
if (!supportAdoptStyle || !useAdoptedStyleSheets) {
|
|
6718
|
+
subscription = getStyleTagSubscription(stylingContainer, domain);
|
|
6719
|
+
|
|
6720
|
+
return subscription;
|
|
6719
6721
|
}
|
|
6722
|
+
|
|
6723
|
+
if (!window[StyleCacheKey]) {
|
|
6724
|
+
window[StyleCacheKey] = {};
|
|
6725
|
+
}
|
|
6726
|
+
subscription = getAdoptStyleSubscription(stylingContainer, domain);
|
|
6727
|
+
|
|
6728
|
+
const originalUnsubscribe = subscription.unsubscribe.bind(subscription);
|
|
6729
|
+
const wrappedUnsubscribe = () => {
|
|
6730
|
+
if (window[StyleCacheKey][domain]) {
|
|
6731
|
+
const cachedObject = window[StyleCacheKey][domain];
|
|
6732
|
+
cachedObject.refCount > 1
|
|
6733
|
+
? (cachedObject.refCount = cachedObject.refCount - 1)
|
|
6734
|
+
: delete window[StyleCacheKey][domain];
|
|
6735
|
+
}
|
|
6736
|
+
|
|
6737
|
+
originalUnsubscribe();
|
|
6738
|
+
};
|
|
6739
|
+
subscription.unsubscribe = wrappedUnsubscribe;
|
|
6740
|
+
|
|
6741
|
+
return subscription;
|
|
6742
|
+
}
|
|
6743
|
+
|
|
6744
|
+
function getStyleTagSubscription(stylingContainer, domain) {
|
|
6745
|
+
const sheet = document.createElement('style');
|
|
6746
|
+
|
|
6747
|
+
return window.emMessageBus.subscribe(domain, (data) => {
|
|
6748
|
+
if (stylingContainer) {
|
|
6749
|
+
sheet.innerHTML = data;
|
|
6750
|
+
stylingContainer.appendChild(sheet);
|
|
6751
|
+
}
|
|
6752
|
+
});
|
|
6753
|
+
}
|
|
6754
|
+
|
|
6755
|
+
function getAdoptStyleSubscription(stylingContainer, domain) {
|
|
6756
|
+
return window.emMessageBus.subscribe(domain, (data) => {
|
|
6757
|
+
if (!stylingContainer) return;
|
|
6758
|
+
|
|
6759
|
+
const shadowRoot = stylingContainer.getRootNode();
|
|
6760
|
+
const cacheStyleObject = window[StyleCacheKey];
|
|
6761
|
+
let cachedStyle = cacheStyleObject[domain]?.sheet;
|
|
6762
|
+
|
|
6763
|
+
if (!cachedStyle) {
|
|
6764
|
+
cachedStyle = new CSSStyleSheet();
|
|
6765
|
+
cachedStyle.replaceSync(data);
|
|
6766
|
+
cacheStyleObject[domain] = {
|
|
6767
|
+
sheet: cachedStyle,
|
|
6768
|
+
refCount: 1
|
|
6769
|
+
};
|
|
6770
|
+
} else {
|
|
6771
|
+
cacheStyleObject[domain].refCount = cacheStyleObject[domain].refCount + 1;
|
|
6772
|
+
}
|
|
6773
|
+
|
|
6774
|
+
const currentSheets = shadowRoot.adoptedStyleSheets || [];
|
|
6775
|
+
if (!currentSheets.includes(cachedStyle)) {
|
|
6776
|
+
shadowRoot.adoptedStyleSheets = [...currentSheets, cachedStyle];
|
|
6777
|
+
}
|
|
6778
|
+
});
|
|
6720
6779
|
}
|
|
6721
6780
|
|
|
6722
6781
|
var PlayModeEnum;
|
|
@@ -9679,7 +9738,7 @@ const LotteryTippingTicketController = class {
|
|
|
9679
9738
|
}
|
|
9680
9739
|
handleMbSourceChange(newValue, oldValue) {
|
|
9681
9740
|
if (newValue != oldValue) {
|
|
9682
|
-
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
9741
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
9683
9742
|
}
|
|
9684
9743
|
}
|
|
9685
9744
|
componentWillLoad() {
|
|
@@ -9690,7 +9749,7 @@ const LotteryTippingTicketController = class {
|
|
|
9690
9749
|
componentDidLoad() {
|
|
9691
9750
|
if (this.stylingContainer) {
|
|
9692
9751
|
if (this.mbSource)
|
|
9693
|
-
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
9752
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
9694
9753
|
if (this.clientStyling)
|
|
9695
9754
|
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
9696
9755
|
if (this.clientStylingUrl)
|