@everymatrix/pam-logout 1.87.26 → 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/index.cjs.js +1 -1
- package/dist/cjs/{pam-logout-00dae1d5.js → pam-logout-ae1d3392.js} +70 -11
- package/dist/cjs/pam-logout.cjs.entry.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/{pam-logout-a6f6b541.js → pam-logout-539ff4bc.js} +70 -11
- package/dist/esm/pam-logout.entry.js +1 -1
- package/dist/pam-logout/index.esm.js +1 -1
- package/dist/pam-logout/pam-logout-539ff4bc.js +1 -0
- package/dist/pam-logout/pam-logout.entry.js +1 -1
- package/package.json +1 -1
- package/dist/pam-logout/pam-logout-a6f6b541.js +0 -1
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
const index = require('./index-e376310b.js');
|
|
4
4
|
|
|
5
|
+
const StyleCacheKey = '__WIDGET_GLOBAL_STYLE_CACHE__';
|
|
6
|
+
|
|
5
7
|
/**
|
|
6
8
|
* @name setClientStyling
|
|
7
9
|
* @description Method used to create and append to the passed element of the widget a style element with the content received
|
|
@@ -47,18 +49,75 @@ function setClientStylingURL(stylingContainer, clientStylingUrl) {
|
|
|
47
49
|
* @param {HTMLElement} stylingContainer The highest element of the widget
|
|
48
50
|
* @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
|
|
49
51
|
* @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
|
|
52
|
+
* @param {boolean} useAdoptedStyleSheets A flag to gradually enable testing of adoptedStyleSheets
|
|
50
53
|
*/
|
|
51
|
-
function setStreamStyling(stylingContainer, domain, subscription) {
|
|
52
|
-
if (window.emMessageBus)
|
|
53
|
-
const sheet = document.createElement('style');
|
|
54
|
+
function setStreamStyling(stylingContainer, domain, subscription, useAdoptedStyleSheets = false) {
|
|
55
|
+
if (!window.emMessageBus) return;
|
|
54
56
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
const supportAdoptStyle = 'adoptedStyleSheets' in Document.prototype;
|
|
58
|
+
|
|
59
|
+
if (!supportAdoptStyle || !useAdoptedStyleSheets) {
|
|
60
|
+
subscription = getStyleTagSubscription(stylingContainer, domain);
|
|
61
|
+
|
|
62
|
+
return subscription;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (!window[StyleCacheKey]) {
|
|
66
|
+
window[StyleCacheKey] = {};
|
|
61
67
|
}
|
|
68
|
+
subscription = getAdoptStyleSubscription(stylingContainer, domain);
|
|
69
|
+
|
|
70
|
+
const originalUnsubscribe = subscription.unsubscribe.bind(subscription);
|
|
71
|
+
const wrappedUnsubscribe = () => {
|
|
72
|
+
if (window[StyleCacheKey][domain]) {
|
|
73
|
+
const cachedObject = window[StyleCacheKey][domain];
|
|
74
|
+
cachedObject.refCount > 1
|
|
75
|
+
? (cachedObject.refCount = cachedObject.refCount - 1)
|
|
76
|
+
: delete window[StyleCacheKey][domain];
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
originalUnsubscribe();
|
|
80
|
+
};
|
|
81
|
+
subscription.unsubscribe = wrappedUnsubscribe;
|
|
82
|
+
|
|
83
|
+
return subscription;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function getStyleTagSubscription(stylingContainer, domain) {
|
|
87
|
+
const sheet = document.createElement('style');
|
|
88
|
+
|
|
89
|
+
return window.emMessageBus.subscribe(domain, (data) => {
|
|
90
|
+
if (stylingContainer) {
|
|
91
|
+
sheet.innerHTML = data;
|
|
92
|
+
stylingContainer.appendChild(sheet);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function getAdoptStyleSubscription(stylingContainer, domain) {
|
|
98
|
+
return window.emMessageBus.subscribe(domain, (data) => {
|
|
99
|
+
if (!stylingContainer) return;
|
|
100
|
+
|
|
101
|
+
const shadowRoot = stylingContainer.getRootNode();
|
|
102
|
+
const cacheStyleObject = window[StyleCacheKey];
|
|
103
|
+
let cachedStyle = cacheStyleObject[domain]?.sheet;
|
|
104
|
+
|
|
105
|
+
if (!cachedStyle) {
|
|
106
|
+
cachedStyle = new CSSStyleSheet();
|
|
107
|
+
cachedStyle.replaceSync(data);
|
|
108
|
+
cacheStyleObject[domain] = {
|
|
109
|
+
sheet: cachedStyle,
|
|
110
|
+
refCount: 1
|
|
111
|
+
};
|
|
112
|
+
} else {
|
|
113
|
+
cacheStyleObject[domain].refCount = cacheStyleObject[domain].refCount + 1;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const currentSheets = shadowRoot.adoptedStyleSheets || [];
|
|
117
|
+
if (!currentSheets.includes(cachedStyle)) {
|
|
118
|
+
shadowRoot.adoptedStyleSheets = [...currentSheets, cachedStyle];
|
|
119
|
+
}
|
|
120
|
+
});
|
|
62
121
|
}
|
|
63
122
|
|
|
64
123
|
/**
|
|
@@ -212,7 +271,7 @@ const PamLogout = class {
|
|
|
212
271
|
}
|
|
213
272
|
handleMbSourceChange(newValue, oldValue) {
|
|
214
273
|
if (newValue !== oldValue && this.stylingContainer) {
|
|
215
|
-
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
274
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
216
275
|
}
|
|
217
276
|
}
|
|
218
277
|
async componentWillLoad() {
|
|
@@ -226,7 +285,7 @@ const PamLogout = class {
|
|
|
226
285
|
componentDidLoad() {
|
|
227
286
|
if (this.stylingContainer) {
|
|
228
287
|
if (this.mbSource) {
|
|
229
|
-
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
288
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
230
289
|
}
|
|
231
290
|
if (this.clientStyling) {
|
|
232
291
|
setClientStyling(this.stylingContainer, this.clientStyling);
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { P as PamLogout } from './pam-logout-
|
|
1
|
+
export { P as PamLogout } from './pam-logout-539ff4bc.js';
|
|
2
2
|
import './index-1abc369e.js';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, h } from './index-1abc369e.js';
|
|
2
2
|
|
|
3
|
+
const StyleCacheKey = '__WIDGET_GLOBAL_STYLE_CACHE__';
|
|
4
|
+
|
|
3
5
|
/**
|
|
4
6
|
* @name setClientStyling
|
|
5
7
|
* @description Method used to create and append to the passed element of the widget a style element with the content received
|
|
@@ -45,18 +47,75 @@ function setClientStylingURL(stylingContainer, clientStylingUrl) {
|
|
|
45
47
|
* @param {HTMLElement} stylingContainer The highest element of the widget
|
|
46
48
|
* @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
|
|
47
49
|
* @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
|
|
50
|
+
* @param {boolean} useAdoptedStyleSheets A flag to gradually enable testing of adoptedStyleSheets
|
|
48
51
|
*/
|
|
49
|
-
function setStreamStyling(stylingContainer, domain, subscription) {
|
|
50
|
-
if (window.emMessageBus)
|
|
51
|
-
const sheet = document.createElement('style');
|
|
52
|
+
function setStreamStyling(stylingContainer, domain, subscription, useAdoptedStyleSheets = false) {
|
|
53
|
+
if (!window.emMessageBus) return;
|
|
52
54
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
const supportAdoptStyle = 'adoptedStyleSheets' in Document.prototype;
|
|
56
|
+
|
|
57
|
+
if (!supportAdoptStyle || !useAdoptedStyleSheets) {
|
|
58
|
+
subscription = getStyleTagSubscription(stylingContainer, domain);
|
|
59
|
+
|
|
60
|
+
return subscription;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (!window[StyleCacheKey]) {
|
|
64
|
+
window[StyleCacheKey] = {};
|
|
59
65
|
}
|
|
66
|
+
subscription = getAdoptStyleSubscription(stylingContainer, domain);
|
|
67
|
+
|
|
68
|
+
const originalUnsubscribe = subscription.unsubscribe.bind(subscription);
|
|
69
|
+
const wrappedUnsubscribe = () => {
|
|
70
|
+
if (window[StyleCacheKey][domain]) {
|
|
71
|
+
const cachedObject = window[StyleCacheKey][domain];
|
|
72
|
+
cachedObject.refCount > 1
|
|
73
|
+
? (cachedObject.refCount = cachedObject.refCount - 1)
|
|
74
|
+
: delete window[StyleCacheKey][domain];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
originalUnsubscribe();
|
|
78
|
+
};
|
|
79
|
+
subscription.unsubscribe = wrappedUnsubscribe;
|
|
80
|
+
|
|
81
|
+
return subscription;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function getStyleTagSubscription(stylingContainer, domain) {
|
|
85
|
+
const sheet = document.createElement('style');
|
|
86
|
+
|
|
87
|
+
return window.emMessageBus.subscribe(domain, (data) => {
|
|
88
|
+
if (stylingContainer) {
|
|
89
|
+
sheet.innerHTML = data;
|
|
90
|
+
stylingContainer.appendChild(sheet);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function getAdoptStyleSubscription(stylingContainer, domain) {
|
|
96
|
+
return window.emMessageBus.subscribe(domain, (data) => {
|
|
97
|
+
if (!stylingContainer) return;
|
|
98
|
+
|
|
99
|
+
const shadowRoot = stylingContainer.getRootNode();
|
|
100
|
+
const cacheStyleObject = window[StyleCacheKey];
|
|
101
|
+
let cachedStyle = cacheStyleObject[domain]?.sheet;
|
|
102
|
+
|
|
103
|
+
if (!cachedStyle) {
|
|
104
|
+
cachedStyle = new CSSStyleSheet();
|
|
105
|
+
cachedStyle.replaceSync(data);
|
|
106
|
+
cacheStyleObject[domain] = {
|
|
107
|
+
sheet: cachedStyle,
|
|
108
|
+
refCount: 1
|
|
109
|
+
};
|
|
110
|
+
} else {
|
|
111
|
+
cacheStyleObject[domain].refCount = cacheStyleObject[domain].refCount + 1;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const currentSheets = shadowRoot.adoptedStyleSheets || [];
|
|
115
|
+
if (!currentSheets.includes(cachedStyle)) {
|
|
116
|
+
shadowRoot.adoptedStyleSheets = [...currentSheets, cachedStyle];
|
|
117
|
+
}
|
|
118
|
+
});
|
|
60
119
|
}
|
|
61
120
|
|
|
62
121
|
/**
|
|
@@ -210,7 +269,7 @@ const PamLogout = class {
|
|
|
210
269
|
}
|
|
211
270
|
handleMbSourceChange(newValue, oldValue) {
|
|
212
271
|
if (newValue !== oldValue && this.stylingContainer) {
|
|
213
|
-
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
272
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
214
273
|
}
|
|
215
274
|
}
|
|
216
275
|
async componentWillLoad() {
|
|
@@ -224,7 +283,7 @@ const PamLogout = class {
|
|
|
224
283
|
componentDidLoad() {
|
|
225
284
|
if (this.stylingContainer) {
|
|
226
285
|
if (this.mbSource) {
|
|
227
|
-
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style
|
|
286
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
228
287
|
}
|
|
229
288
|
if (this.clientStyling) {
|
|
230
289
|
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { P as pam_logout } from './pam-logout-
|
|
1
|
+
export { P as pam_logout } from './pam-logout-539ff4bc.js';
|
|
2
2
|
import './index-1abc369e.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{P as PamLogout}from"./pam-logout-
|
|
1
|
+
export{P as PamLogout}from"./pam-logout-539ff4bc.js";import"./index-1abc369e.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as e}from"./index-1abc369e.js";const o="__WIDGET_GLOBAL_STYLE_CACHE__";function n(t,e){if(t){const o=document.createElement("style");o.innerHTML=e,t.appendChild(o)}}function i(t,e){if(!t||!e)return;const o=new URL(e);fetch(o.href).then((t=>t.text())).then((e=>{const o=document.createElement("style");o.innerHTML=e,t&&t.appendChild(o)})).catch((t=>{console.error("There was an error while trying to load client styling from URL",t)}))}function a(t,e,n,i=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!i)return n=function(t,e){const o=document.createElement("style");return window.emMessageBus.subscribe(e,(e=>{t&&(o.innerHTML=e,t.appendChild(o))}))}(t,e),n;window[o]||(window[o]={}),n=function(t,e){return window.emMessageBus.subscribe(e,(n=>{if(!t)return;const i=t.getRootNode(),a=window[o];let s=a[e]?.sheet;s?a[e].refCount=a[e].refCount+1:(s=new CSSStyleSheet,s.replaceSync(n),a[e]={sheet:s,refCount:1});const l=i.adoptedStyleSheets||[];l.includes(s)||(i.adoptedStyleSheets=[...l,s])}))}(t,e);const a=n.unsubscribe.bind(n);return n.unsubscribe=()=>{if(window[o][e]){const t=window[o][e];t.refCount>1?t.refCount=t.refCount-1:delete window[o][e]}a()},n}const s={en:{logoutButton:"Logout"},hu:{logoutButton:"Logout"},ro:{logoutButton:"Logout"},fr:{logoutButton:"Déconnexion"},tr:{logoutButton:"Çıkış Yap"},hr:{logoutButton:"Logout"},"pt-br":{logoutButton:"Logout"},"es-mx":{logoutButton:"Logout"}},l=class{constructor(e){t(this,e),this.device=function(){const t=navigator.userAgent.toLowerCase(),e=screen.availWidth,o=screen.availHeight;if(t.includes("iphone"))return"mobile";if(t.includes("android")){if(o>e&&e<800)return"mobile";if(e>o&&o<800)return"tablet"}return"desktop"}(),this.handleLogout=async()=>{var t,e;try{const o=new Headers;o.append("accept","text/plain"),o.append("X-SessionId",this.session);const n={method:"POST",headers:o},i=await fetch(`${this.endpoint}/api/pam/v1/logout`,n);if(!i.ok)throw new Error(`Logout failed with status: ${i.status}`);{let o=await i.json();"LOGGEDOFF"===(null===(e=null===(t=null==o?void 0:o.session)||void 0===t?void 0:t.details)||void 0===e?void 0:e.exitReason)&&(window.postMessage({type:"LogoutSuccessfull"},window.location.href),((t,e={})=>{const o=new CustomEvent("track-custom-event",{detail:{type:"logged_out",data:e},bubbles:!0,composed:!0});document.dispatchEvent(o)})(0,{}))}}catch(t){console.error("Logout error:",t),window.postMessage({type:"LogoutFailed"},window.location.href)}},this.endpoint=void 0,this.session=void 0,this.language="en",this.mbSource=void 0,this.clientStyling="",this.clientStylingUrl="",this.translationUrl=""}handleClientStylingChange(t,e){t!==e&&this.stylingContainer&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!==e&&this.stylingContainer&&i(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!==e&&this.stylingContainer&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}async componentWillLoad(){if(!this.endpoint||!this.session)throw new Error("endpoint and session props are required");var t;this.translationUrl&&this.translationUrl.length>2&&await(t=this.translationUrl,new Promise((e=>{fetch(t).then((t=>t.json())).then((t=>{Object.keys(t).forEach((e=>{for(let o in t[e])s[e][o]=t[e][o]})),e(!0)}))})))}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&i(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}render(){return e("div",{key:"ebbb1f2c1c2950f00444fb899235a42c1fbcb10e",class:"LogoutContainer",ref:t=>this.stylingContainer=t},e("p",{key:"891bd35bc62a23c4b3668faacd1015364a252fb5",class:{PlayerAccountMenuItemBox:!0,PlayerAccountMenuItemBoxMobile:"mobile"===this.device,PlayerAccountMenuItemBoxTablet:"tablet"===this.device},onClick:this.handleLogout},e("span",{key:"93e18c0751156d5f4e5085229dc9b68a946ec35a",style:{width:"tablet"===this.device?"24px":"20px"}},e("svg",{key:"d77c42b64be06052f72da3867f84dd8408fc8f3b",id:"bbfaf345-72af-4296-bf4b-2fd41fc03d5d","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 150 150",width:"100%",height:"100%"},e("path",{key:"771a1db24255b9817c462a034550f04bb0754e57",class:"icon-path",d:"M147.16,67.69,115.42,36a9.6,9.6,0,1,0-13.58,13.58l15.32,15.31H49.58a9.63,9.63,0,1,0,0,19.26h67.58L101.84,99.42a9.64,9.64,0,0,0,6.79,16.43,9.41,9.41,0,0,0,6.79-2.85l31.74-31.73a9.53,9.53,0,0,0,0-13.58Z"}),e("path",{key:"5e0592b92da57312febec43af1b8360f5f76abdb",class:"icon-path",d:"M45.16,122.16H19.26V26.79H45.32a9.63,9.63,0,1,0,0-19.26H9.63A9.56,9.56,0,0,0,0,17.16V131.63a9.57,9.57,0,0,0,9.63,9.64H45.32A9.57,9.57,0,0,0,55,131.63a9.78,9.78,0,0,0-9.79-9.47Z"}))),"mobile"!==this.device&&e("span",{key:"eb1d8a4430b07418db8de665f98b3e8a9d9def75",class:"PlayerLogoutText"},((t,e)=>{let o=s[void 0!==e?e:"en"].logoutButton;return o})(0,this.language))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};l.style=":host{display:block}:host *,:host *::before,:host *::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box}.PlayerAccountMenuItemBox{padding:20px;font-size:16px;display:inline-flex;width:100%;box-sizing:border-box;align-items:center;cursor:pointer}.PlayerAccountMenuItemBox .PlayerLogoutText{margin-left:20px}.PlayerAccountMenuItemBox svg{display:block;width:100%;height:100%}.PlayerAccountMenuItemBox svg .logout-icon-path{fill:var(--emw--pam-typography-color-nav-bg, var(--emw--color-white, #FFFFFF))}.PlayerAccountMenuItemBoxMobile.PlayerAccountMenuItemBox{height:auto;justify-content:center;position:relative;display:flex;width:unset;padding:0}.PlayerAccountMenuItemBoxMobile.PlayerAccountMenuItemBox svg .logout-icon-path{fill:var(--emw--pam-typography-color-nav-bg, var(--emw--color-white, #FFFFFF))}";export{l as P}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{P as pam_logout}from"./pam-logout-
|
|
1
|
+
export{P as pam_logout}from"./pam-logout-539ff4bc.js";import"./index-1abc369e.js";
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as e}from"./index-1abc369e.js";function o(t,e){if(t){const o=document.createElement("style");o.innerHTML=e,t.appendChild(o)}}function n(t,e){if(!t||!e)return;const o=new URL(e);fetch(o.href).then((t=>t.text())).then((e=>{const o=document.createElement("style");o.innerHTML=e,t&&t.appendChild(o)})).catch((t=>{console.error("There was an error while trying to load client styling from URL",t)}))}function i(t,e){if(window.emMessageBus){const o=document.createElement("style");window.emMessageBus.subscribe(e,(e=>{o.innerHTML=e,t&&t.appendChild(o)}))}}const a={en:{logoutButton:"Logout"},hu:{logoutButton:"Logout"},ro:{logoutButton:"Logout"},fr:{logoutButton:"Déconnexion"},tr:{logoutButton:"Çıkış Yap"},hr:{logoutButton:"Logout"},"pt-br":{logoutButton:"Logout"},"es-mx":{logoutButton:"Logout"}},s=class{constructor(e){t(this,e),this.device=function(){const t=navigator.userAgent.toLowerCase(),e=screen.availWidth,o=screen.availHeight;if(t.includes("iphone"))return"mobile";if(t.includes("android")){if(o>e&&e<800)return"mobile";if(e>o&&o<800)return"tablet"}return"desktop"}(),this.handleLogout=async()=>{var t,e;try{const o=new Headers;o.append("accept","text/plain"),o.append("X-SessionId",this.session);const n={method:"POST",headers:o},i=await fetch(`${this.endpoint}/api/pam/v1/logout`,n);if(!i.ok)throw new Error(`Logout failed with status: ${i.status}`);{let o=await i.json();"LOGGEDOFF"===(null===(e=null===(t=null==o?void 0:o.session)||void 0===t?void 0:t.details)||void 0===e?void 0:e.exitReason)&&(window.postMessage({type:"LogoutSuccessfull"},window.location.href),((t,e={})=>{const o=new CustomEvent("track-custom-event",{detail:{type:"logged_out",data:e},bubbles:!0,composed:!0});document.dispatchEvent(o)})(0,{}))}}catch(t){console.error("Logout error:",t),window.postMessage({type:"LogoutFailed"},window.location.href)}},this.endpoint=void 0,this.session=void 0,this.language="en",this.mbSource=void 0,this.clientStyling="",this.clientStylingUrl="",this.translationUrl=""}handleClientStylingChange(t,e){t!==e&&this.stylingContainer&&o(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!==e&&this.stylingContainer&&n(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!==e&&this.stylingContainer&&i(this.stylingContainer,`${this.mbSource}.Style`)}async componentWillLoad(){if(!this.endpoint||!this.session)throw new Error("endpoint and session props are required");var t;this.translationUrl&&this.translationUrl.length>2&&await(t=this.translationUrl,new Promise((e=>{fetch(t).then((t=>t.json())).then((t=>{Object.keys(t).forEach((e=>{for(let o in t[e])a[e][o]=t[e][o]})),e(!0)}))})))}componentDidLoad(){this.stylingContainer&&(this.mbSource&&i(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&o(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&n(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}render(){return e("div",{key:"ebbb1f2c1c2950f00444fb899235a42c1fbcb10e",class:"LogoutContainer",ref:t=>this.stylingContainer=t},e("p",{key:"891bd35bc62a23c4b3668faacd1015364a252fb5",class:{PlayerAccountMenuItemBox:!0,PlayerAccountMenuItemBoxMobile:"mobile"===this.device,PlayerAccountMenuItemBoxTablet:"tablet"===this.device},onClick:this.handleLogout},e("span",{key:"93e18c0751156d5f4e5085229dc9b68a946ec35a",style:{width:"tablet"===this.device?"24px":"20px"}},e("svg",{key:"d77c42b64be06052f72da3867f84dd8408fc8f3b",id:"bbfaf345-72af-4296-bf4b-2fd41fc03d5d","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 150 150",width:"100%",height:"100%"},e("path",{key:"771a1db24255b9817c462a034550f04bb0754e57",class:"icon-path",d:"M147.16,67.69,115.42,36a9.6,9.6,0,1,0-13.58,13.58l15.32,15.31H49.58a9.63,9.63,0,1,0,0,19.26h67.58L101.84,99.42a9.64,9.64,0,0,0,6.79,16.43,9.41,9.41,0,0,0,6.79-2.85l31.74-31.73a9.53,9.53,0,0,0,0-13.58Z"}),e("path",{key:"5e0592b92da57312febec43af1b8360f5f76abdb",class:"icon-path",d:"M45.16,122.16H19.26V26.79H45.32a9.63,9.63,0,1,0,0-19.26H9.63A9.56,9.56,0,0,0,0,17.16V131.63a9.57,9.57,0,0,0,9.63,9.64H45.32A9.57,9.57,0,0,0,55,131.63a9.78,9.78,0,0,0-9.79-9.47Z"}))),"mobile"!==this.device&&e("span",{key:"eb1d8a4430b07418db8de665f98b3e8a9d9def75",class:"PlayerLogoutText"},((t,e)=>{let o=a[void 0!==e?e:"en"].logoutButton;return o})(0,this.language))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};s.style=":host{display:block}:host *,:host *::before,:host *::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box}.PlayerAccountMenuItemBox{padding:20px;font-size:16px;display:inline-flex;width:100%;box-sizing:border-box;align-items:center;cursor:pointer}.PlayerAccountMenuItemBox .PlayerLogoutText{margin-left:20px}.PlayerAccountMenuItemBox svg{display:block;width:100%;height:100%}.PlayerAccountMenuItemBox svg .logout-icon-path{fill:var(--emw--pam-typography-color-nav-bg, var(--emw--color-white, #FFFFFF))}.PlayerAccountMenuItemBoxMobile.PlayerAccountMenuItemBox{height:auto;justify-content:center;position:relative;display:flex;width:unset;padding:0}.PlayerAccountMenuItemBoxMobile.PlayerAccountMenuItemBox svg .logout-icon-path{fill:var(--emw--pam-typography-color-nav-bg, var(--emw--color-white, #FFFFFF))}";export{s as P}
|