@everymatrix/pam-logout 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/index-e376310b.js +1241 -0
  3. package/dist/cjs/index.cjs.js +10 -0
  4. package/dist/cjs/loader.cjs.js +15 -0
  5. package/dist/cjs/pam-logout-f179c4f1.js +263 -0
  6. package/dist/cjs/pam-logout.cjs.entry.js +10 -0
  7. package/dist/cjs/pam-logout.cjs.js +25 -0
  8. package/dist/collection/collection-manifest.json +12 -0
  9. package/dist/collection/components/pam_logout/index.js +1 -0
  10. package/dist/collection/components/pam_logout/pam-logout.css +47 -0
  11. package/dist/collection/components/pam_logout/pam-logout.js +249 -0
  12. package/dist/collection/index.js +1 -0
  13. package/dist/collection/utils/locale.utils.js +53 -0
  14. package/dist/collection/utils/utils.js +56 -0
  15. package/dist/esm/app-globals-0f993ce5.js +3 -0
  16. package/dist/esm/index-1abc369e.js +1215 -0
  17. package/dist/esm/index.js +2 -0
  18. package/dist/esm/loader.js +11 -0
  19. package/dist/esm/pam-logout-b28be36e.js +261 -0
  20. package/dist/esm/pam-logout.entry.js +2 -0
  21. package/dist/esm/pam-logout.js +20 -0
  22. package/dist/index.cjs.js +1 -0
  23. package/dist/index.js +1 -0
  24. package/dist/pam-logout/app-globals-0f993ce5.js +1 -0
  25. package/dist/pam-logout/index-1abc369e.js +2 -0
  26. package/dist/pam-logout/index.esm.js +1 -0
  27. package/dist/pam-logout/pam-logout-b28be36e.js +1 -0
  28. package/dist/pam-logout/pam-logout.entry.js +1 -0
  29. package/dist/pam-logout/pam-logout.esm.js +1 -0
  30. package/dist/stencil.config.dev.js +19 -0
  31. package/dist/stencil.config.js +19 -0
  32. package/dist/storybook/main.js +43 -0
  33. package/dist/storybook/preview.js +9 -0
  34. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/pam-logout/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
  35. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/pam-logout/.stencil/packages/stencil/pam-logout/stencil.config.d.ts +2 -0
  36. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/pam-logout/.stencil/packages/stencil/pam-logout/stencil.config.dev.d.ts +2 -0
  37. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/pam-logout/.stencil/packages/stencil/pam-logout/storybook/main.d.ts +3 -0
  38. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/pam-logout/.stencil/packages/stencil/pam-logout/storybook/preview.d.ts +70 -0
  39. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/pam-logout/.stencil/tools/plugins/index.d.ts +4 -0
  40. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/pam-logout/.stencil/tools/plugins/lazy-load-chunk-plugin.d.ts +12 -0
  41. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/pam-logout/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
  42. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/pam-logout/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
  43. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/pam-logout/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
  44. package/dist/types/components/pam_logout/index.d.ts +1 -0
  45. package/dist/types/components/pam_logout/pam-logout.d.ts +27 -0
  46. package/dist/types/components.d.ts +93 -0
  47. package/dist/types/index.d.ts +1 -0
  48. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  49. package/dist/types/utils/locale.utils.d.ts +6 -0
  50. package/dist/types/utils/utils.d.ts +10 -0
  51. package/loader/cdn.js +1 -0
  52. package/loader/index.cjs.js +1 -0
  53. package/loader/index.d.ts +24 -0
  54. package/loader/index.es2017.js +1 -0
  55. package/loader/index.js +2 -0
  56. package/loader/package.json +11 -0
  57. package/package.json +27 -0
@@ -0,0 +1,2 @@
1
+ export { P as PamLogout } from './pam-logout-b28be36e.js';
2
+ import './index-1abc369e.js';
@@ -0,0 +1,11 @@
1
+ import { b as bootstrapLazy } from './index-1abc369e.js';
2
+ export { s as setNonce } from './index-1abc369e.js';
3
+ import { g as globalScripts } from './app-globals-0f993ce5.js';
4
+
5
+ const defineCustomElements = async (win, options) => {
6
+ if (typeof window === 'undefined') return undefined;
7
+ await globalScripts();
8
+ return bootstrapLazy([["pam-logout",[[1,"pam-logout",{"endpoint":[513],"session":[513],"language":[1537],"mbSource":[513,"mb-source"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
9
+ };
10
+
11
+ export { defineCustomElements };
@@ -0,0 +1,261 @@
1
+ import { r as registerInstance, h } from './index-1abc369e.js';
2
+
3
+ /**
4
+ * @name setClientStyling
5
+ * @description Method used to create and append to the passed element of the widget a style element with the content received
6
+ * @param {HTMLElement} stylingContainer The reference element of the widget
7
+ * @param {string} clientStyling The style content
8
+ */
9
+ function setClientStyling(stylingContainer, clientStyling) {
10
+ if (stylingContainer) {
11
+ const sheet = document.createElement('style');
12
+ sheet.innerHTML = clientStyling;
13
+ stylingContainer.appendChild(sheet);
14
+ }
15
+ }
16
+
17
+ /**
18
+ * @name setClientStylingURL
19
+ * @description Method used to create and append to the passed element of the widget a style element with the content fetched from a given URL
20
+ * @param {HTMLElement} stylingContainer The reference element of the widget
21
+ * @param {string} clientStylingUrl The URL of the style content
22
+ */
23
+ function setClientStylingURL(stylingContainer, clientStylingUrl) {
24
+ const url = new URL(clientStylingUrl);
25
+
26
+ fetch(url.href)
27
+ .then((res) => res.text())
28
+ .then((data) => {
29
+ const cssFile = document.createElement('style');
30
+ cssFile.innerHTML = data;
31
+ if (stylingContainer) {
32
+ stylingContainer.appendChild(cssFile);
33
+ }
34
+ })
35
+ .catch((err) => {
36
+ console.error('There was an error while trying to load client styling from URL', err);
37
+ });
38
+ }
39
+
40
+ /**
41
+ * @name setStreamLibrary
42
+ * @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
43
+ * @param {HTMLElement} stylingContainer The highest element of the widget
44
+ * @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
45
+ * @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
46
+ */
47
+ function setStreamStyling(stylingContainer, domain, subscription) {
48
+ if (window.emMessageBus) {
49
+ const sheet = document.createElement('style');
50
+
51
+ window.emMessageBus.subscribe(domain, (data) => {
52
+ sheet.innerHTML = data;
53
+ if (stylingContainer) {
54
+ stylingContainer.appendChild(sheet);
55
+ }
56
+ });
57
+ }
58
+ }
59
+
60
+ /**
61
+ * @name dispatchCustomEvent
62
+ * @description dispatches the custom event CustomEventProcessor is listening for
63
+ * @param {string} type of the custom event
64
+ * @param {Object} data may contain additional information about the event, e.g. userId
65
+ */
66
+ const dispatchCustomEvent = (type, data = {}) => {
67
+ const event = new CustomEvent('track-custom-event', {
68
+ detail: {
69
+ type,
70
+ data
71
+ },
72
+ bubbles: true,
73
+ composed: true
74
+ });
75
+
76
+ document.dispatchEvent(event);
77
+ };
78
+
79
+ const DEFAULT_LANGUAGE = 'en';
80
+ const TRANSLATIONS = {
81
+ en: {
82
+ logoutButton: 'Logout'
83
+ },
84
+ hu: {
85
+ logoutButton: 'Logout'
86
+ },
87
+ ro: {
88
+ logoutButton: 'Logout'
89
+ },
90
+ fr: {
91
+ logoutButton: 'Déconnexion'
92
+ },
93
+ tr: {
94
+ logoutButton: 'Çıkış Yap'
95
+ },
96
+ hr: {
97
+ logoutButton: 'Logout'
98
+ },
99
+ 'pt-br': {
100
+ logoutButton: 'Logout'
101
+ },
102
+ 'es-mx': {
103
+ logoutButton: 'Logout'
104
+ }
105
+ };
106
+ const translate = (key, customLang, values) => {
107
+ const lang = customLang;
108
+ let translation = TRANSLATIONS[lang !== undefined ? lang : DEFAULT_LANGUAGE][key];
109
+ if (values !== undefined) {
110
+ for (const [key, value] of Object.entries(values.values)) {
111
+ const regex = new RegExp(`{${key}}`, 'g');
112
+ translation = translation.replace(regex, value);
113
+ }
114
+ }
115
+ return translation;
116
+ };
117
+ const getTranslations = (url) => {
118
+ // fetch url, get the data, replace the TRANSLATIONS content
119
+ return new Promise((resolve) => {
120
+ fetch(url)
121
+ .then((res) => res.json())
122
+ .then((data) => {
123
+ Object.keys(data).forEach((item) => {
124
+ for (let key in data[item]) {
125
+ TRANSLATIONS[item][key] = data[item][key];
126
+ }
127
+ });
128
+ resolve(true);
129
+ });
130
+ });
131
+ };
132
+
133
+ /**
134
+ * @name isMobile
135
+ * @description A method that returns if the browser used to access the app is from a mobile device or not
136
+ * @param {String} userAgent window.navigator.userAgent
137
+ * @returns {Boolean} true or false
138
+ */
139
+ function checkDeviceType() {
140
+ const userAgent = navigator.userAgent.toLowerCase();
141
+ const width = screen.availWidth;
142
+ const height = screen.availHeight;
143
+ if (userAgent.includes('iphone')) {
144
+ return 'mobile';
145
+ }
146
+ if (userAgent.includes('android')) {
147
+ if (height > width && width < 800) {
148
+ return 'mobile';
149
+ }
150
+ if (width > height && height < 800) {
151
+ return 'tablet';
152
+ }
153
+ }
154
+ return 'desktop';
155
+ }
156
+
157
+ const pamLogoutCss = ":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))}";
158
+ const PamLogoutStyle0 = pamLogoutCss;
159
+
160
+ const PamLogout = class {
161
+ constructor(hostRef) {
162
+ registerInstance(this, hostRef);
163
+ this.device = checkDeviceType();
164
+ this.handleLogout = async () => {
165
+ try {
166
+ const headers = new Headers();
167
+ headers.append('accept', 'text/plain');
168
+ headers.append('X-SessionId', this.session);
169
+ const options = {
170
+ method: 'POST',
171
+ headers: headers
172
+ };
173
+ const response = await fetch(`${this.endpoint}/api/v2/gm/sav2/sessions/terminate`, options);
174
+ if (response.ok) {
175
+ let data = await response.json();
176
+ if (data.details.exitReason === 'LOGGEDOFF') {
177
+ window.postMessage({ type: 'LogoutSuccessfull' }, window.location.href);
178
+ dispatchCustomEvent('logged_out', {});
179
+ }
180
+ }
181
+ else {
182
+ throw new Error(`Logout failed with status: ${response.status}`);
183
+ }
184
+ }
185
+ catch (error) {
186
+ console.error('Logout error:', error);
187
+ window.postMessage({
188
+ type: 'WidgetNotification',
189
+ data: {
190
+ type: 'error',
191
+ message: 'Logout failed. Please try again.',
192
+ error
193
+ }
194
+ }, window.location.href);
195
+ }
196
+ };
197
+ this.endpoint = undefined;
198
+ this.session = undefined;
199
+ this.language = 'en';
200
+ this.mbSource = undefined;
201
+ this.clientStyling = '';
202
+ this.clientStylingUrl = '';
203
+ this.translationUrl = '';
204
+ }
205
+ handleClientStylingChange(newValue, oldValue) {
206
+ if (newValue !== oldValue && this.stylingContainer) {
207
+ setClientStyling(this.stylingContainer, this.clientStyling);
208
+ }
209
+ }
210
+ handleClientStylingUrlChange(newValue, oldValue) {
211
+ if (newValue !== oldValue && this.stylingContainer) {
212
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
213
+ }
214
+ }
215
+ handleMbSourceChange(newValue, oldValue) {
216
+ if (newValue !== oldValue && this.stylingContainer) {
217
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
218
+ }
219
+ }
220
+ async componentWillLoad() {
221
+ if (!this.endpoint || !this.session) {
222
+ throw new Error('endpoint and session props are required');
223
+ }
224
+ if (this.translationUrl && this.translationUrl.length > 2) {
225
+ await getTranslations(this.translationUrl);
226
+ }
227
+ }
228
+ componentDidLoad() {
229
+ if (this.stylingContainer) {
230
+ if (this.mbSource) {
231
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
232
+ }
233
+ if (this.clientStyling) {
234
+ setClientStyling(this.stylingContainer, this.clientStyling);
235
+ }
236
+ if (this.clientStylingUrl) {
237
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
238
+ }
239
+ }
240
+ }
241
+ disconnectedCallback() {
242
+ if (this.stylingSubscription) {
243
+ this.stylingSubscription.unsubscribe();
244
+ }
245
+ }
246
+ render() {
247
+ return (h("div", { key: 'fd28f2abf2ac49d499193091ead03c6770bc2610', class: "LogoutContainer", ref: el => this.stylingContainer = el }, h("p", { key: '0c0fe4e0a6e1928215d2dc607412d419c33ae319', class: {
248
+ 'PlayerAccountMenuItemBox': true,
249
+ 'PlayerAccountMenuItemBoxMobile': this.device === 'mobile',
250
+ 'PlayerAccountMenuItemBoxTablet': this.device === 'tablet'
251
+ }, onClick: this.handleLogout }, h("span", { key: '602622ac17b77524716c2acffc1939b2926c3436', style: { width: this.device === 'tablet' ? '24px' : '20px' } }, h("svg", { key: 'ee293dcd05d15d60db596e82975ee0aaea1764f0', 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%" }, h("path", { key: 'eda0097f7b1ea557e30b459581b733295fd02480', 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" }), h("path", { key: 'cfc27c506086165b71de92fc2064ebd7c7d9eb21', 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" }))), this.device !== 'mobile' && (h("span", { key: '0c65abb764174563c9e87fbadf3eef7cfb5339ea', class: "PlayerLogoutText" }, translate('logoutButton', this.language))))));
252
+ }
253
+ static get watchers() { return {
254
+ "clientStyling": ["handleClientStylingChange"],
255
+ "clientStylingUrl": ["handleClientStylingUrlChange"],
256
+ "mbSource": ["handleMbSourceChange"]
257
+ }; }
258
+ };
259
+ PamLogout.style = PamLogoutStyle0;
260
+
261
+ export { PamLogout as P };
@@ -0,0 +1,2 @@
1
+ export { P as pam_logout } from './pam-logout-b28be36e.js';
2
+ import './index-1abc369e.js';
@@ -0,0 +1,20 @@
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-1abc369e.js';
2
+ export { s as setNonce } from './index-1abc369e.js';
3
+ import { g as globalScripts } from './app-globals-0f993ce5.js';
4
+
5
+ /*
6
+ Stencil Client Patch Browser v4.19.2 | MIT Licensed | https://stenciljs.com
7
+ */
8
+ var patchBrowser = () => {
9
+ const importMeta = import.meta.url;
10
+ const opts = {};
11
+ if (importMeta !== "") {
12
+ opts.resourcesUrl = new URL(".", importMeta).href;
13
+ }
14
+ return promiseResolve(opts);
15
+ };
16
+
17
+ patchBrowser().then(async (options) => {
18
+ await globalScripts();
19
+ return bootstrapLazy([["pam-logout",[[1,"pam-logout",{"endpoint":[513],"session":[513],"language":[1537],"mbSource":[513,"mb-source"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
20
+ });
@@ -0,0 +1 @@
1
+ module.exports = require('./cjs/index.cjs.js');
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from './esm/index.js';
@@ -0,0 +1 @@
1
+ const o=()=>{};export{o as g}
@@ -0,0 +1,2 @@
1
+ var e=Object.defineProperty,t=new WeakMap,n=e=>t.get(e),l=(e,n)=>t.set(n.t=e,n),o=(e,t)=>t in e,s=(e,t)=>(0,console.error)(e,t),r=new Map,i=new Map,c="slot-fb{display:contents}slot-fb[hidden]{display:none}",u="undefined"!=typeof window?window:{},a=u.document||{head:{}},f={l:0,o:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},h=e=>Promise.resolve(e),p=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),m=!1,d=[],y=[],w=(e,t)=>n=>{e.push(n),m||(m=!0,t&&4&f.l?b(v):f.raf(v))},$=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){s(e)}e.length=0},v=()=>{$(d),$(y),(m=d.length>0)&&f.raf(v)},b=e=>h().then(e),g=w(y,!0),S={},j=e=>"object"==(e=typeof e)||"function"===e;function k(e){var t,n,l;return null!=(l=null==(n=null==(t=e.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?l:void 0}((t,n)=>{for(var l in n)e(t,l,{get:n[l],enumerable:!0})})({},{err:()=>E,map:()=>C,ok:()=>O,unwrap:()=>P,unwrapErr:()=>L});var O=e=>({isOk:!0,isErr:!1,value:e}),E=e=>({isOk:!1,isErr:!0,value:e});function C(e,t){if(e.isOk){const n=t(e.value);return n instanceof Promise?n.then((e=>O(e))):O(n)}if(e.isErr)return E(e.value);throw"should never get here"}var M,x,P=e=>{if(e.isOk)return e.value;throw e.value},L=e=>{if(e.isErr)return e.value;throw e.value},R=(e,t,...n)=>{let l=null,o=null,s=!1,r=!1;const i=[],c=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!j(l))&&(l+=""),s&&r?i[i.length-1].i+=l:i.push(s?T(null,l):l),r=s)};if(c(n),t){t.key&&(o=t.key);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}const u=T(e,null);return u.u=t,i.length>0&&(u.h=i),u.p=o,u},T=(e,t)=>({l:0,m:e,i:t,$:null,h:null,u:null,p:null}),A={},N=new WeakMap,U=e=>"sc-"+e.v,W=(e,t,n,l,s,r)=>{if(n!==l){let i=o(e,t),c=t.toLowerCase();if("class"===t){const t=e.classList,o=F(n),s=F(l);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("style"===t){for(const t in n)l&&null!=l[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in l)n&&l[t]===n[t]||(t.includes("-")?e.style.setProperty(t,l[t]):e.style[t]=l[t])}else if("key"===t);else if("ref"===t)l&&l(e);else if(i||"o"!==t[0]||"n"!==t[1]){const o=j(l);if((i||o&&null!==l)&&!s)try{if(e.tagName.includes("-"))e[t]=l;else{const o=null==l?"":l;"list"===t?i=!1:null!=n&&e[t]==o||(e[t]=o)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&r||s)&&!o&&e.setAttribute(t,l=!0===l?"":l)}else if(t="-"===t[2]?t.slice(3):o(u,c)?c.slice(2):c[2]+t.slice(3),n||l){const o=t.endsWith(H);t=t.replace(q,""),n&&f.rel(e,t,n,o),l&&f.ael(e,t,l,o)}}},D=/\s/,F=e=>e?e.split(D):[],H="Capture",q=RegExp(H+"$"),G=(e,t,n)=>{const l=11===t.$.nodeType&&t.$.host?t.$.host:t.$,o=e&&e.u||S,s=t.u||S;for(const e of V(Object.keys(o)))e in s||W(l,e,o[e],void 0,n,t.l);for(const e of V(Object.keys(s)))W(l,e,o[e],s[e],n,t.l)};function V(e){return e.includes("ref")?[...e.filter((e=>"ref"!==e)),"ref"]:e}var _=!1,z=(e,t,n)=>{const l=t.h[n];let o,s,r=0;if(null!==l.i)o=l.$=a.createTextNode(l.i);else{if(_||(_="svg"===l.m),o=l.$=a.createElementNS(_?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",l.m),_&&"foreignObject"===l.m&&(_=!1),G(null,l,_),null!=M&&o["s-si"]!==M&&o.classList.add(o["s-si"]=M),l.h)for(r=0;r<l.h.length;++r)s=z(e,l,r),s&&o.appendChild(s);"svg"===l.m?_=!1:"foreignObject"===o.tagName&&(_=!0)}return o["s-hn"]=x,o},B=(e,t,n,l,o,s)=>{let r,i=e;for(i.shadowRoot&&i.tagName===x&&(i=i.shadowRoot);o<=s;++o)l[o]&&(r=z(null,n,o),r&&(l[o].$=r,X(i,r,t)))},I=(e,t,n)=>{for(let l=t;l<=n;++l){const t=e[l];if(t){const e=t.$;Q(t),e&&e.remove()}}},J=(e,t,n=!1)=>e.m===t.m&&(!!n||e.p===t.p),K=(e,t,n=!1)=>{const l=t.$=e.$,o=e.h,s=t.h,r=t.m,i=t.i;null===i?(G(e,t,_="svg"===r||"foreignObject"!==r&&_),null!==o&&null!==s?((e,t,n,l,o=!1)=>{let s,r,i=0,c=0,u=0,a=0,f=t.length-1,h=t[0],p=t[f],m=l.length-1,d=l[0],y=l[m];for(;i<=f&&c<=m;)if(null==h)h=t[++i];else if(null==p)p=t[--f];else if(null==d)d=l[++c];else if(null==y)y=l[--m];else if(J(h,d,o))K(h,d,o),h=t[++i],d=l[++c];else if(J(p,y,o))K(p,y,o),p=t[--f],y=l[--m];else if(J(h,y,o))K(h,y,o),X(e,h.$,p.$.nextSibling),h=t[++i],y=l[--m];else if(J(p,d,o))K(p,d,o),X(e,p.$,h.$),p=t[--f],d=l[++c];else{for(u=-1,a=i;a<=f;++a)if(t[a]&&null!==t[a].p&&t[a].p===d.p){u=a;break}u>=0?(r=t[u],r.m!==d.m?s=z(t&&t[c],n,u):(K(r,d,o),t[u]=void 0,s=r.$),d=l[++c]):(s=z(t&&t[c],n,c),d=l[++c]),s&&X(h.$.parentNode,s,h.$)}i>f?B(e,null==l[m+1]?null:l[m+1].$,n,l,c,m):c>m&&I(t,i,f)})(l,o,t,s,n):null!==s?(null!==e.i&&(l.textContent=""),B(l,null,t,s,0,s.length-1)):null!==o&&I(o,0,o.length-1),_&&"svg"===r&&(_=!1)):e.i!==i&&(l.data=i)},Q=e=>{e.u&&e.u.ref&&e.u.ref(null),e.h&&e.h.map(Q)},X=(e,t,n)=>null==e?void 0:e.insertBefore(t,n),Y=(e,t)=>{t&&!e.S&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.S=t)))},Z=(e,t)=>{if(e.l|=16,!(4&e.l))return Y(e,e.j),g((()=>ee(e,t)));e.l|=512},ee=(e,t)=>{const n=e.t;if(!n)throw Error(`Can't render component <${e.$hostElement$.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let l;return t&&(l=ie(n,"componentWillLoad")),te(l,(()=>le(e,n,t)))},te=(e,t)=>ne(e)?e.then(t).catch((e=>{console.error(e),t()})):t(),ne=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,le=async(e,t,n)=>{var l;const o=e.$hostElement$,s=o["s-rc"];n&&(e=>{const t=e.k,n=e.$hostElement$,l=t.l,o=((e,t)=>{var n;const l=U(t),o=i.get(l);if(e=11===e.nodeType?e:a,o)if("string"==typeof o){let s,r=N.get(e=e.head||e);if(r||N.set(e,r=new Set),!r.has(l)){{s=a.createElement("style"),s.innerHTML=o;const t=null!=(n=f.O)?n:k(a);null!=t&&s.setAttribute("nonce",t),e.insertBefore(s,e.querySelector("link"))}4&t.l&&(s.innerHTML+=c),r&&r.add(l)}}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o]);return l})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);oe(e,t,o,n),s&&(s.map((e=>e())),o["s-rc"]=void 0);{const t=null!=(l=o["s-p"])?l:[],n=()=>se(e);0===t.length?n():(Promise.all(t).then(n),e.l|=4,t.length=0)}},oe=(e,t,n,l)=>{try{t=t.render(),e.l&=-17,e.l|=2,((e,t,n=!1)=>{const l=e.$hostElement$,o=e.k,s=e.C||T(null,null),r=(e=>e&&e.m===A)(t)?t:R(null,null,t);if(x=l.tagName,o.M&&(r.u=r.u||{},o.M.map((([e,t])=>r.u[t]=l[e]))),n&&r.u)for(const e of Object.keys(r.u))l.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(r.u[e]=l[e]);r.m=null,r.l|=4,e.C=r,r.$=s.$=l.shadowRoot||l,M=l["s-sc"],K(s,r,n)})(e,t,l)}catch(t){s(t,e.$hostElement$)}return null},se=e=>{const t=e.$hostElement$,n=e.t,l=e.j;64&e.l||(e.l|=64,ce(t),ie(n,"componentDidLoad"),e.P(t),l||re()),e.S&&(e.S(),e.S=void 0),512&e.l&&b((()=>Z(e,!1))),e.l&=-517},re=()=>{ce(a.documentElement),b((()=>(e=>{const t=f.ce("appload",{detail:{namespace:"pam-logout"}});return e.dispatchEvent(t),t})(u)))},ie=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){s(e)}},ce=e=>e.classList.add("hydrated"),ue=(e,t,l)=>{var o,r;const i=e.prototype;if(t.L||t.R||e.watchers){e.watchers&&!t.R&&(t.R=e.watchers);const c=Object.entries(null!=(o=t.L)?o:{});if(c.map((([e,[o]])=>{(31&o||2&l&&32&o)&&Object.defineProperty(i,e,{get(){return((e,t)=>n(this).T.get(t))(0,e)},set(l){((e,t,l,o)=>{const r=n(e);if(!r)throw Error(`Couldn't find host element for "${o.v}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`);const i=r.$hostElement$,c=r.T.get(t),u=r.l,a=r.t;if(l=((e,t)=>null==e||j(e)?e:1&t?e+"":e)(l,o.L[t][0]),(!(8&u)||void 0===c)&&l!==c&&(!Number.isNaN(c)||!Number.isNaN(l))&&(r.T.set(t,l),a)){if(o.R&&128&u){const e=o.R[t];e&&e.map((e=>{try{a[e](l,c,t)}catch(e){s(e,i)}}))}2==(18&u)&&Z(r,!1)}})(this,e,l,t)},configurable:!0,enumerable:!0})})),1&l){const l=new Map;i.attributeChangedCallback=function(e,o,s){f.jmp((()=>{var r;const c=l.get(e);if(this.hasOwnProperty(c))s=this[c],delete this[c];else{if(i.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==s)return;if(null==c){const l=n(this),i=null==l?void 0:l.l;if(i&&!(8&i)&&128&i&&s!==o){const n=l.t,i=null==(r=t.R)?void 0:r[e];null==i||i.forEach((t=>{null!=n[t]&&n[t].call(n,s,o,e)}))}return}}this[c]=(null!==s||"boolean"!=typeof this[c])&&s}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(r=t.R)?r:{}),...c.filter((([e,t])=>15&t[0])).map((([e,n])=>{var o;const s=n[1]||e;return l.set(s,e),512&n[0]&&(null==(o=t.M)||o.push([e,s])),s}))]))}}return e},ae=e=>{ie(e,"disconnectedCallback")},fe=(e,l={})=>{var o;const h=[],m=l.exclude||[],d=u.customElements,y=a.head,w=y.querySelector("meta[charset]"),$=a.createElement("style"),v=[];let b,g=!0;Object.assign(f,l),f.o=new URL(l.resourcesUrl||"./",a.baseURI).href;let S=!1;if(e.map((e=>{e[1].map((l=>{var o;const c={l:l[0],v:l[1],L:l[2],A:l[3]};4&c.l&&(S=!0),c.L=l[2],c.M=[],c.R=null!=(o=l[4])?o:{};const u=c.v,a=class extends HTMLElement{constructor(e){if(super(e),this.hasRegisteredEventListeners=!1,((e,n)=>{const l={l:0,$hostElement$:e,k:n,T:new Map};l.N=new Promise((e=>l.P=e)),e["s-p"]=[],e["s-rc"]=[],t.set(e,l)})(e=this,c),1&c.l)if(e.shadowRoot){if("open"!==e.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${c.v}! Mode is set to ${e.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else e.attachShadow({mode:"open"})}connectedCallback(){this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),b&&(clearTimeout(b),b=null),g?v.push(this):f.jmp((()=>(e=>{if(!(1&f.l)){const t=n(e),l=t.k,o=()=>{};if(1&t.l)(null==t?void 0:t.t)||(null==t?void 0:t.N)&&t.N.then((()=>{}));else{t.l|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){Y(t,t.j=n);break}}l.L&&Object.entries(l.L).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n)=>{let l;if(!(32&t.l)){if(t.l|=32,n.U){const e=(e=>{const t=e.v.replace(/-/g,"_"),n=e.U;if(!n)return;const l=r.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(r.set(n,e),e[t])),s)
2
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n);if(e&&"then"in e){const t=()=>{};l=await e,t()}else l=e;if(!l)throw Error(`Constructor for "${n.v}#${t.W}" was not found`);l.isProxied||(n.R=l.watchers,ue(l,n,2),l.isProxied=!0);const o=()=>{};t.l|=8;try{new l(t)}catch(e){s(e)}t.l&=-9,t.l|=128,o()}else l=e.constructor,customElements.whenDefined(e.localName).then((()=>t.l|=128));if(l&&l.style){let e;"string"==typeof l.style&&(e=l.style);const t=U(n);if(!i.has(t)){const l=()=>{};((e,t,n)=>{let l=i.get(e);p&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,i.set(e,l)})(t,e,!!(1&n.l)),l()}}}const o=t.j,c=()=>Z(t,!0);o&&o["s-rc"]?o["s-rc"].push(c):c()})(e,t,l)}o()}})(this)))}disconnectedCallback(){f.jmp((()=>(async()=>{if(!(1&f.l)){const e=n(this);(null==e?void 0:e.t)?ae(e.t):(null==e?void 0:e.N)&&e.N.then((()=>ae(e.t)))}})()))}componentOnReady(){return n(this).N}};c.U=e[0],m.includes(u)||d.get(u)||(h.push(u),d.define(u,ue(a,c,1)))}))})),h.length>0&&(S&&($.textContent+=c),$.textContent+=h.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",$.innerHTML.length)){$.setAttribute("data-styles","");const e=null!=(o=f.O)?o:k(a);null!=e&&$.setAttribute("nonce",e),y.insertBefore($,w?w.nextSibling:y.firstChild)}g=!1,v.length?v.map((e=>e.connectedCallback())):f.jmp((()=>b=setTimeout(re,30)))},he=e=>f.O=e;export{fe as b,R as h,h as p,l as r,he as s}
@@ -0,0 +1 @@
1
+ export{P as PamLogout}from"./pam-logout-b28be36e.js";import"./index-1abc369e.js";
@@ -0,0 +1 @@
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){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()=>{try{const t=new Headers;t.append("accept","text/plain"),t.append("X-SessionId",this.session);const e={method:"POST",headers:t},o=await fetch(`${this.endpoint}/api/v2/gm/sav2/sessions/terminate`,e);if(!o.ok)throw new Error(`Logout failed with status: ${o.status}`);"LOGGEDOFF"===(await o.json()).details.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:"WidgetNotification",data:{type:"error",message:"Logout failed. Please try again.",error:t}},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:"fd28f2abf2ac49d499193091ead03c6770bc2610",class:"LogoutContainer",ref:t=>this.stylingContainer=t},e("p",{key:"0c0fe4e0a6e1928215d2dc607412d419c33ae319",class:{PlayerAccountMenuItemBox:!0,PlayerAccountMenuItemBoxMobile:"mobile"===this.device,PlayerAccountMenuItemBoxTablet:"tablet"===this.device},onClick:this.handleLogout},e("span",{key:"602622ac17b77524716c2acffc1939b2926c3436",style:{width:"tablet"===this.device?"24px":"20px"}},e("svg",{key:"ee293dcd05d15d60db596e82975ee0aaea1764f0",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:"eda0097f7b1ea557e30b459581b733295fd02480",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:"cfc27c506086165b71de92fc2064ebd7c7d9eb21",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:"0c65abb764174563c9e87fbadf3eef7cfb5339ea",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}
@@ -0,0 +1 @@
1
+ export{P as pam_logout}from"./pam-logout-b28be36e.js";import"./index-1abc369e.js";
@@ -0,0 +1 @@
1
+ import{p as n,b as l}from"./index-1abc369e.js";export{s as setNonce}from"./index-1abc369e.js";import{g as e}from"./app-globals-0f993ce5.js";(()=>{const l=import.meta.url,e={};return""!==l&&(e.resourcesUrl=new URL(".",l).href),n(e)})().then((async n=>(await e(),l([["pam-logout",[[1,"pam-logout",{endpoint:[513],session:[513],language:[1537],mbSource:[513,"mb-source"],clientStyling:[1537,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"]},null,{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}]]]],n))));
@@ -0,0 +1,19 @@
1
+ import { sass } from "@stencil/sass";
2
+ export const config = {
3
+ namespace: 'pam-logout',
4
+ taskQueue: 'async',
5
+ sourceMap: false,
6
+ minifyJs: true,
7
+ extras: {
8
+ experimentalImportInjection: true
9
+ },
10
+ plugins: [sass()],
11
+ outputTargets: [
12
+ {
13
+ type: 'www'
14
+ },
15
+ {
16
+ type: 'docs-readme'
17
+ }
18
+ ]
19
+ };
@@ -0,0 +1,19 @@
1
+ import { cleanPackageJsonStencil } from "../../../tools/plugins";
2
+ import { sass } from "@stencil/sass";
3
+ export const config = {
4
+ namespace: 'pam-logout',
5
+ taskQueue: 'async',
6
+ sourceMap: false,
7
+ minifyJs: true,
8
+ hashFileNames: false,
9
+ extras: {
10
+ experimentalImportInjection: true
11
+ },
12
+ plugins: [cleanPackageJsonStencil(), sass()],
13
+ outputTargets: [
14
+ {
15
+ type: 'dist',
16
+ esmLoaderPath: '../loader'
17
+ }
18
+ ]
19
+ };
@@ -0,0 +1,43 @@
1
+ import path from "path";
2
+ import { getStoryFiles, detectUsedPackages, parseTsConfig, exec, filterParsedPathsByUsedPackages } from "../../../../libs/common/src/storybook/storybook-utils";
3
+ const config = {
4
+ stories: ['../**/*.@(mdx|stories.@(js|ts|tsx))'],
5
+ addons: ['@storybook/addon-essentials', '@storybook/addon-interactions', 'storybook-dark-mode'],
6
+ docs: {
7
+ defaultName: 'Documentation',
8
+ autodocs: 'tag'
9
+ },
10
+ framework: {
11
+ name: '@storybook/web-components-vite',
12
+ options: {}
13
+ },
14
+ // Async viteFinal to build dependent packages before finalizing configuration.
15
+ viteFinal: async (config) => {
16
+ const storyFiles = getStoryFiles(path.resolve(__dirname, '../'));
17
+ const usedPackages = detectUsedPackages(storyFiles);
18
+ const buildPromises = usedPackages.map(async (pkg) => {
19
+ try {
20
+ console.log(`Building package ${pkg}...`);
21
+ const { stdout, stderr } = await exec(`nx run ${pkg}:build`);
22
+ console.log(`Built package ${pkg}: ${stdout}`);
23
+ if (stderr) {
24
+ console.error(`Build warning/error for package ${pkg}: ${stderr}`);
25
+ }
26
+ }
27
+ catch (error) {
28
+ console.error(`Error building package ${pkg}:`, error);
29
+ }
30
+ });
31
+ await Promise.all(buildPromises);
32
+ const parsedPaths = parseTsConfig() || {};
33
+ const filteredParsedPaths = filterParsedPathsByUsedPackages(parsedPaths, usedPackages);
34
+ return Object.assign(Object.assign({}, config), { resolve: {
35
+ alias: Object.assign({}, filteredParsedPaths)
36
+ }, define: {
37
+ process: {
38
+ env: {}
39
+ }
40
+ } });
41
+ }
42
+ };
43
+ export default config;
@@ -0,0 +1,9 @@
1
+ import { themes } from "@storybook/theming";
2
+ export const parameters = {
3
+ darkMode: {
4
+ dark: Object.assign(Object.assign({}, themes.dark), { appBg: 'black' }),
5
+ light: Object.assign(Object.assign({}, themes.normal), { appBg: 'green' }),
6
+ current: 'light',
7
+ stylePreview: true
8
+ }
9
+ };
@@ -0,0 +1,39 @@
1
+ /// <reference types="node" />
2
+ import { exec as execCallback } from 'child_process';
3
+ export declare const exec: typeof execCallback.__promisify__;
4
+ /**
5
+ * Recursively retrieves all story files (.stories.ts/.stories.tsx) in a directory.
6
+ * @param dir The directory to search.
7
+ * @returns Array of story file paths.
8
+ */
9
+ export declare const getStoryFiles: (dir: string) => string[];
10
+ /**
11
+ * Detects which internal packages are used in the provided story files.
12
+ * It looks at every import that starts with the given package alias prefix,
13
+ * then extracts the package name (the segment immediately following the prefix).
14
+ *
15
+ * @param stories Array of story file paths.
16
+ * @returns Array of unique package names (e.g. ['foo', 'bar']).
17
+ */
18
+ export declare const detectUsedPackages: (stories: string[]) => string[];
19
+ /**
20
+ * Extracts all import paths from a file using the TypeScript compiler API.
21
+ * @param filePath The file path to parse.
22
+ * @returns Array of import strings.
23
+ */
24
+ export declare const extractImports: (filePath: string) => string[];
25
+ /**
26
+ * Parses the tsconfig paths and resolves them to absolute paths.
27
+ * @param tsconfigPath The path to the tsconfig file.
28
+ * @returns An object mapping alias keys to absolute paths.
29
+ */
30
+ export declare const parseTsConfig: () => Record<string, string> | null;
31
+ /**
32
+ * Filters the parsed tsconfig alias mapping to only include keys that correspond
33
+ * to the used packages.
34
+ *
35
+ * @param parsedPaths The full alias mapping from tsconfig.
36
+ * @param usedPackages Array of package names that are used (e.g. ['foo', 'bar']).
37
+ * @returns Filtered alias mapping.
38
+ */
39
+ export declare const filterParsedPathsByUsedPackages: (parsedPaths: Record<string, string>, usedPackages: string[]) => Record<string, string>;
@@ -0,0 +1,2 @@
1
+ import { Config } from '../../../../../../../../../../stencil-public-runtime';
2
+ export declare const config: Config;
@@ -0,0 +1,2 @@
1
+ import { Config } from '../../../../../../../../../../stencil-public-runtime';
2
+ export declare const config: Config;
@@ -0,0 +1,3 @@
1
+ import type { StorybookConfig } from '@storybook/web-components-vite';
2
+ declare const config: StorybookConfig;
3
+ export default config;
@@ -0,0 +1,70 @@
1
+ export declare const parameters: {
2
+ darkMode: {
3
+ dark: {
4
+ appBg: string;
5
+ base: "light" | "dark";
6
+ colorPrimary: string;
7
+ colorSecondary: string;
8
+ appContentBg: string;
9
+ appPreviewBg: string;
10
+ appBorderColor: string;
11
+ appBorderRadius: number;
12
+ fontBase: string;
13
+ fontCode: string;
14
+ textColor: string;
15
+ textInverseColor: string;
16
+ textMutedColor: string;
17
+ barTextColor: string;
18
+ barHoverColor: string;
19
+ barSelectedColor: string;
20
+ barBg: string;
21
+ buttonBg: string;
22
+ buttonBorder: string;
23
+ booleanBg: string;
24
+ booleanSelectedBg: string;
25
+ inputBg: string;
26
+ inputBorder: string;
27
+ inputTextColor: string;
28
+ inputBorderRadius: number;
29
+ brandTitle?: string;
30
+ brandUrl?: string;
31
+ brandImage?: string;
32
+ brandTarget?: string;
33
+ gridCellSize?: number;
34
+ };
35
+ light: {
36
+ appBg: string;
37
+ base: "light" | "dark";
38
+ colorPrimary: string;
39
+ colorSecondary: string;
40
+ appContentBg: string;
41
+ appPreviewBg: string;
42
+ appBorderColor: string;
43
+ appBorderRadius: number;
44
+ fontBase: string;
45
+ fontCode: string;
46
+ textColor: string;
47
+ textInverseColor: string;
48
+ textMutedColor: string;
49
+ barTextColor: string;
50
+ barHoverColor: string;
51
+ barSelectedColor: string;
52
+ barBg: string;
53
+ buttonBg: string;
54
+ buttonBorder: string;
55
+ booleanBg: string;
56
+ booleanSelectedBg: string;
57
+ inputBg: string;
58
+ inputBorder: string;
59
+ inputTextColor: string;
60
+ inputBorderRadius: number;
61
+ brandTitle?: string;
62
+ brandUrl?: string;
63
+ brandImage?: string;
64
+ brandTarget?: string;
65
+ gridCellSize?: number;
66
+ };
67
+ current: string;
68
+ stylePreview: boolean;
69
+ };
70
+ };
@@ -0,0 +1,4 @@
1
+ export * from "./vite-chunk-plugin";
2
+ export * from "./stencil-clean-deps-plugin";
3
+ export * from "./vite-clean-deps-plugin";
4
+ export * from "./lazy-load-chunk-plugin";
@@ -0,0 +1,12 @@
1
+ export declare const lazyLoadChunkPlugin: () => {
2
+ name: string;
3
+ config(config: any): {
4
+ build: {
5
+ rollupOptions: {
6
+ output: {
7
+ manualChunks(id: any): any;
8
+ };
9
+ };
10
+ };
11
+ };
12
+ };
@@ -0,0 +1,5 @@
1
+ export declare function cleanPackageJsonStencil(): {
2
+ name: string;
3
+ apply: string;
4
+ buildEnd(): void;
5
+ };
@@ -0,0 +1,6 @@
1
+ export declare function viteChunkPlugin(): {
2
+ name: string;
3
+ config(config: any, { command }: {
4
+ command: any;
5
+ }): void;
6
+ };
@@ -0,0 +1,4 @@
1
+ export declare function cleanPackageJsonVite(widgetName: any): {
2
+ name: string;
3
+ closeBundle(): void;
4
+ };
@@ -0,0 +1 @@
1
+ export { PamLogout } from './pam-logout';