@everymatrix/user-deposit-withdrawal 1.44.0 → 1.45.2

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 (49) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/index-faa382a8.js +1265 -0
  3. package/dist/cjs/loader.cjs.js +7 -13
  4. package/dist/cjs/user-deposit-withdrawal.cjs.entry.js +226 -223
  5. package/dist/cjs/user-deposit-withdrawal.cjs.js +17 -11
  6. package/dist/collection/collection-manifest.json +3 -3
  7. package/dist/collection/components/user-deposit-withdrawal/index.js +1 -0
  8. package/dist/collection/components/user-deposit-withdrawal/user-deposit-withdrawal.js +581 -578
  9. package/dist/collection/utils/locale.utils.js +38 -38
  10. package/dist/collection/utils/utils.js +17 -17
  11. package/dist/esm/app-globals-0f993ce5.js +3 -0
  12. package/dist/esm/index-04d3e726.js +1238 -0
  13. package/dist/esm/loader.js +7 -13
  14. package/dist/esm/user-deposit-withdrawal.entry.js +226 -223
  15. package/dist/esm/user-deposit-withdrawal.js +14 -11
  16. package/dist/stencil.config.dev.js +17 -0
  17. package/dist/stencil.config.js +14 -19
  18. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/user-deposit-withdrawal/.stencil/packages/stencil/user-deposit-withdrawal/stencil.config.d.ts +2 -0
  19. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/user-deposit-withdrawal/.stencil/packages/stencil/user-deposit-withdrawal/stencil.config.dev.d.ts +2 -0
  20. package/dist/types/components/user-deposit-withdrawal/index.d.ts +1 -0
  21. package/dist/types/components/user-deposit-withdrawal/user-deposit-withdrawal.d.ts +65 -65
  22. package/dist/types/components.d.ts +1 -0
  23. package/dist/types/stencil-public-runtime.d.ts +142 -33
  24. package/dist/user-deposit-withdrawal/p-53a8ad89.js +2 -0
  25. package/dist/user-deposit-withdrawal/p-96b03b5e.entry.js +1 -0
  26. package/dist/user-deposit-withdrawal/p-e1255160.js +1 -0
  27. package/dist/user-deposit-withdrawal/user-deposit-withdrawal.esm.js +1 -1
  28. package/loader/cdn.js +1 -3
  29. package/loader/index.cjs.js +1 -3
  30. package/loader/index.d.ts +13 -1
  31. package/loader/index.es2017.js +1 -3
  32. package/loader/index.js +1 -3
  33. package/loader/package.json +1 -0
  34. package/package.json +8 -1
  35. package/dist/cjs/index-efde0a55.js +0 -1264
  36. package/dist/components/index.d.ts +0 -26
  37. package/dist/components/index.js +0 -1
  38. package/dist/components/user-deposit-withdrawal.d.ts +0 -11
  39. package/dist/components/user-deposit-withdrawal.js +0 -304
  40. package/dist/esm/index-767966f2.js +0 -1238
  41. package/dist/esm/polyfills/core-js.js +0 -11
  42. package/dist/esm/polyfills/css-shim.js +0 -1
  43. package/dist/esm/polyfills/dom.js +0 -79
  44. package/dist/esm/polyfills/es5-html-element.js +0 -1
  45. package/dist/esm/polyfills/index.js +0 -34
  46. package/dist/esm/polyfills/system.js +0 -6
  47. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/user-deposit-withdrawal/.stencil/packages/user-deposit-withdrawal/stencil.config.d.ts +0 -2
  48. package/dist/user-deposit-withdrawal/p-4c4319e6.js +0 -1
  49. package/dist/user-deposit-withdrawal/p-518ce9fb.entry.js +0 -1
@@ -2,20 +2,14 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-efde0a55.js');
5
+ const index = require('./index-faa382a8.js');
6
+ const appGlobals = require('./app-globals-3a1e7e63.js');
6
7
 
7
- /*
8
- Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
9
- */
10
- const patchEsm = () => {
11
- return index.promiseResolve();
12
- };
13
-
14
- const defineCustomElements = (win, options) => {
15
- if (typeof window === 'undefined') return Promise.resolve();
16
- return patchEsm().then(() => {
17
- return index.bootstrapLazy([["user-deposit-withdrawal.cjs",[[1,"user-deposit-withdrawal",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"endpoint":[513],"type":[513],"channel":[513],"language":[513],"productType":[513,"product-type"],"userId":[513,"user-id"],"session":[513],"successUrl":[513,"success-url"],"cancelUrl":[513,"cancel-url"],"failUrl":[513,"fail-url"],"sportsUrl":[513,"sports-url"],"casinoUrl":[513,"casino-url"],"contactUrl":[513,"contact-url"],"depositUrl":[513,"deposit-url"],"currency":[513],"showBonusSelectionInput":[513,"show-bonus-selection-input"],"isShortCashier":[516,"is-short-cashier"],"homeUrl":[513,"home-url"],"beforeRedirect":[16],"limitStylingAppends":[32],"dynamicHeight":[32],"cashierInfoUrl":[32]}]]]], options);
18
- });
8
+ const defineCustomElements = async (win, options) => {
9
+ if (typeof window === 'undefined') return undefined;
10
+ await appGlobals.globalScripts();
11
+ return index.bootstrapLazy([["user-deposit-withdrawal.cjs",[[1,"user-deposit-withdrawal",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"endpoint":[513],"type":[513],"channel":[513],"language":[513],"productType":[513,"product-type"],"userId":[513,"user-id"],"session":[513],"successUrl":[513,"success-url"],"cancelUrl":[513,"cancel-url"],"failUrl":[513,"fail-url"],"sportsUrl":[513,"sports-url"],"casinoUrl":[513,"casino-url"],"contactUrl":[513,"contact-url"],"depositUrl":[513,"deposit-url"],"currency":[513],"showBonusSelectionInput":[513,"show-bonus-selection-input"],"isShortCashier":[516,"is-short-cashier"],"homeUrl":[513,"home-url"],"beforeRedirect":[16],"limitStylingAppends":[32],"dynamicHeight":[32],"cashierInfoUrl":[32]},null,{"session":["watchLoadWidget"],"userId":["watchLoadWidget"],"isShortCashier":["watchLoadWidget"],"currency":["watchLoadWidget"],"showBonusSelectionInput":["watchLoadWidget"]}]]]], options);
19
12
  };
20
13
 
14
+ exports.setNonce = index.setNonce;
21
15
  exports.defineCustomElements = defineCustomElements;
@@ -2,51 +2,51 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-efde0a55.js');
5
+ const index = require('./index-faa382a8.js');
6
6
 
7
7
  const DEFAULT_LANGUAGE = 'en';
8
8
  const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'hr'];
9
9
  const TRANSLATIONS = {
10
- en: {
11
- Deposit: 'Deposit',
12
- Withdraw: 'Withdraw',
13
- denyDeposit: 'Please be informed that currently you are not allowed to initiate depost transactions.',
14
- denyWithdrawal: 'Please be informed that currently you are not allowed to initiate withdrawal transactions.',
15
- notFoundErrorCode: 'Not found error code',
16
- errorCode21122: 'Dear player! Please be informed that currently you are not allowed to initiate withdrawal transaction from your player account. Error Code: 21122',
17
- errorCode21123: 'Dear player! Please be informed that currently you are not allowed to make a deposit to your player account. Error Code:21123'
18
- },
19
- ro: {
20
- Deposit: 'Depozit',
21
- Withdraw: 'Retragere',
22
- denyDeposit: 'Vă informăm că în prezent nu aveți permisiunea de a iniția tranzacții de depunere.',
23
- denyWithdrawal: 'Vă informăm că în prezent nu aveți permisiunea de a iniția tranzacții de retragere.',
24
- notFoundErrorCode: 'Not found error code',
25
- errorCode21122: 'Dear player! Please be informed that currently you are not allowed to initiate withdrawal transaction from your player account. Error Code: 21122',
26
- errorCode21123: 'Dear player! Please be informed that currently you are not allowed to make a deposit to your player account. Error Code:21123'
27
- },
28
- fr: {
29
- Deposit: 'Deposit',
30
- Withdraw: 'Withdraw',
31
- denyDeposit: 'Veuillez être informé que vous n\'êtes actuellement pas autorisé à initier des transactions de dépôt.',
32
- denyWithdrawal: 'Veuillez être informé que vous n\'êtes actuellement pas autorisé à initier des transactions de retrait.',
33
- notFoundErrorCode: 'Not found error code',
34
- errorCode21122: 'Dear player! Please be informed that currently you are not allowed to initiate withdrawal transaction from your player account. Error Code: 21122',
35
- errorCode21123: 'Dear player! Please be informed that currently you are not allowed to make a deposit to your player account. Error Code:21123'
36
- },
37
- hr: {
38
- Deposit: 'Uplata',
39
- Withdraw: 'Isplata',
40
- denyDeposit: 'Obavještavamo Vas da trenutno nemate mogućnost uplata.',
41
- denyWithdrawal: 'Obavještavamo vas da trenutno niste ovlašteni za pokretanje transakcija isplate.',
42
- notFoundErrorCode: 'Not found error code',
43
- errorCode21122: 'Poštovani, trenutno nije moguće izvršiti isplatu sa Vašeg računa. Error Code: 21122',
44
- errorCode21123: 'Poštovani, trenutno nije moguće izvršiti uplatu na Vaš račun. Error Code:21123'
45
- }
10
+ en: {
11
+ Deposit: 'Deposit',
12
+ Withdraw: 'Withdraw',
13
+ denyDeposit: 'Please be informed that currently you are not allowed to initiate depost transactions.',
14
+ denyWithdrawal: 'Please be informed that currently you are not allowed to initiate withdrawal transactions.',
15
+ notFoundErrorCode: 'Not found error code',
16
+ errorCode21122: 'Dear player! Please be informed that currently you are not allowed to initiate withdrawal transaction from your player account. Error Code: 21122',
17
+ errorCode21123: 'Dear player! Please be informed that currently you are not allowed to make a deposit to your player account. Error Code:21123'
18
+ },
19
+ ro: {
20
+ Deposit: 'Depozit',
21
+ Withdraw: 'Retragere',
22
+ denyDeposit: 'Vă informăm că în prezent nu aveți permisiunea de a iniția tranzacții de depunere.',
23
+ denyWithdrawal: 'Vă informăm că în prezent nu aveți permisiunea de a iniția tranzacții de retragere.',
24
+ notFoundErrorCode: 'Not found error code',
25
+ errorCode21122: 'Dear player! Please be informed that currently you are not allowed to initiate withdrawal transaction from your player account. Error Code: 21122',
26
+ errorCode21123: 'Dear player! Please be informed that currently you are not allowed to make a deposit to your player account. Error Code:21123'
27
+ },
28
+ fr: {
29
+ Deposit: 'Deposit',
30
+ Withdraw: 'Withdraw',
31
+ denyDeposit: 'Veuillez être informé que vous n\'êtes actuellement pas autorisé à initier des transactions de dépôt.',
32
+ denyWithdrawal: 'Veuillez être informé que vous n\'êtes actuellement pas autorisé à initier des transactions de retrait.',
33
+ notFoundErrorCode: 'Not found error code',
34
+ errorCode21122: 'Dear player! Please be informed that currently you are not allowed to initiate withdrawal transaction from your player account. Error Code: 21122',
35
+ errorCode21123: 'Dear player! Please be informed that currently you are not allowed to make a deposit to your player account. Error Code:21123'
36
+ },
37
+ hr: {
38
+ Deposit: 'Uplata',
39
+ Withdraw: 'Isplata',
40
+ denyDeposit: 'Obavještavamo Vas da trenutno nemate mogućnost uplata.',
41
+ denyWithdrawal: 'Obavještavamo vas da trenutno niste ovlašteni za pokretanje transakcija isplate.',
42
+ notFoundErrorCode: 'Not found error code',
43
+ errorCode21122: 'Poštovani, trenutno nije moguće izvršiti isplatu sa Vašeg računa. Error Code: 21122',
44
+ errorCode21123: 'Poštovani, trenutno nije moguće izvršiti uplatu na Vaš račun. Error Code:21123'
45
+ }
46
46
  };
47
47
  const translate = (key, customLang) => {
48
- const lang = customLang;
49
- return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
48
+ const lang = customLang;
49
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
50
50
  };
51
51
 
52
52
  /**
@@ -56,210 +56,213 @@ const translate = (key, customLang) => {
56
56
  * @returns {Boolean} true or false
57
57
  */
58
58
  const isMobile = (userAgent) => {
59
- return !!(userAgent.toLowerCase().match(/android/i) ||
60
- userAgent.toLowerCase().match(/blackberry|bb/i) ||
61
- userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
62
- userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
59
+ return !!(userAgent.toLowerCase().match(/android/i) ||
60
+ userAgent.toLowerCase().match(/blackberry|bb/i) ||
61
+ userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
62
+ userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
63
63
  };
64
64
 
65
65
  const userDepositWithdrawalCss = ":host {\n font: inherit;\n display: block;\n height: 100%;\n overflow: hidden;\n}\n\n.CategoryTitle {\n font-size: var(--emw--font-size-x-large, 26px);\n color: var(--emfe-w-pam-color-primary, var(--emfe-w-color-primary, #D0046C));\n}\n\n.MenuReturnButton {\n font: inherit;\n color: var(--emfe-w-color-gray-300, #58586B);\n display: inline-flex;\n align-items: center;\n column-gap: 10px;\n margin-bottom: 10px;\n}\n.MenuReturnButton svg {\n fill: var(--emfe-w-pam-color-primary, var(--emfe-w-color-primary, #D0046C));\n}\n.MenuReturnButton h2.CategoryTitleMobile {\n font-size: 16px;\n color: var(--emfe-w-pam-color-primary, var(--emfe-w-color-primary, #D0046C));\n}\n\n.ErrorMessage {\n color: var(--emfe-w-pam-color-typography, var(--emfe-w-color-typography, #FFFFFF));\n}\n\n.DepositWithdrawalWrapper {\n width: 100%;\n padding: 0;\n margin: 0;\n height: 100vh;\n}\n\n@container (max-width: 475px) {\n .DepositWithdrawalWrapper {\n height: 100vh;\n }\n}\n.ShortCashier.DepositWithdrawalWrapper {\n height: 500px;\n}\n.ShortCashier.CategoryTitle.CategoryTitle {\n margin-right: 20px;\n padding-top: 20px;\n color: ar(--emfe-w-color-black, #000000);\n}\n.ShortCashier .ErrorMessage {\n margin: auto;\n width: 90%;\n margin-top: 70px;\n text-align: center;\n color: var(--emfe-w-color-black, #000000);\n}";
66
+ const UserDepositWithdrawalStyle0 = userDepositWithdrawalCss;
66
67
 
67
68
  const emptyFunction = () => { };
68
69
  const UserDepositWithdrawal = class {
69
- constructor(hostRef) {
70
- index.registerInstance(this, hostRef);
71
- /**
72
- * Client custom styling via inline style
73
- */
74
- this.clientStyling = '';
75
- /**
76
- * Client custom styling via url
77
- */
78
- this.clientStylingUrl = '';
79
- /*
80
- * Operator selected currency
81
- */
82
- this.currency = '';
83
- /*
84
- * Display bonus dropdown
85
- */
86
- this.showBonusSelectionInput = 'true';
87
- /*
88
- * State of deposit - short cashier enabled or not
89
- */
90
- this.isShortCashier = false;
91
- this.beforeRedirect = emptyFunction;
92
- this.limitStylingAppends = false;
93
- this.bindedHandler = this.handleMessage.bind(this);
94
- this.userAgent = window.navigator.userAgent;
95
- this.isMobile = isMobile(this.userAgent);
96
- this.errorCodes = ["21123", "21122"];
97
- this.setClientStyling = () => {
98
- let sheet = document.createElement('style');
99
- sheet.innerHTML = this.clientStyling;
100
- this.stylingContainer.prepend(sheet);
101
- };
102
- this.setClientStylingURL = () => {
103
- let url = new URL(this.clientStylingUrl);
104
- let cssFile = document.createElement('style');
105
- fetch(url.href)
106
- .then((res) => res.text())
107
- .then((data) => {
108
- cssFile.innerHTML = data;
109
- setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
110
- })
111
- .catch((err) => {
112
- console.log('error ', err);
113
- });
114
- };
115
- }
116
- get typeParameter() {
117
- if (this.type === 'deposit') {
118
- return 'Deposit';
119
- }
120
- if (this.type === 'withdraw') {
121
- return 'Withdraw';
122
- }
123
- }
124
- watchLoadWidget() {
125
- this.loadWidget();
126
- }
127
- async componentWillLoad() {
128
- await this.loadWidget();
129
- }
130
- toggleScreen(isMobile) {
131
- window.postMessage({ type: 'PlayerAccountMenuActive', isMobile }, window.location.href);
132
- }
133
- componentDidLoad() {
134
- window.addEventListener('message', this.bindedHandler, false);
135
- }
136
- disconnectedCallback() {
137
- window.removeEventListener('message', this.bindedHandler, false);
138
- }
139
- componentDidRender() {
140
- // start custom styling area
141
- if (!this.limitStylingAppends && this.stylingContainer) {
142
- if (this.clientStyling)
143
- this.setClientStyling();
144
- if (this.clientStylingUrl)
145
- this.setClientStylingURL();
146
- this.limitStylingAppends = true;
70
+ constructor(hostRef) {
71
+ index.registerInstance(this, hostRef);
72
+ this.bindedHandler = this.handleMessage.bind(this);
73
+ this.userAgent = window.navigator.userAgent;
74
+ this.isMobile = isMobile(this.userAgent);
75
+ this.errorCodes = ["21123", "21122"];
76
+ this.setClientStyling = () => {
77
+ let sheet = document.createElement('style');
78
+ sheet.innerHTML = this.clientStyling;
79
+ this.stylingContainer.prepend(sheet);
80
+ };
81
+ this.setClientStylingURL = () => {
82
+ let url = new URL(this.clientStylingUrl);
83
+ let cssFile = document.createElement('style');
84
+ fetch(url.href)
85
+ .then((res) => res.text())
86
+ .then((data) => {
87
+ cssFile.innerHTML = data;
88
+ setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
89
+ })
90
+ .catch((err) => {
91
+ console.log('error ', err);
92
+ });
93
+ };
94
+ this.clientStyling = '';
95
+ this.clientStylingUrl = '';
96
+ this.endpoint = undefined;
97
+ this.type = undefined;
98
+ this.channel = undefined;
99
+ this.language = undefined;
100
+ this.productType = undefined;
101
+ this.userId = undefined;
102
+ this.session = undefined;
103
+ this.successUrl = undefined;
104
+ this.cancelUrl = undefined;
105
+ this.failUrl = undefined;
106
+ this.sportsUrl = undefined;
107
+ this.casinoUrl = undefined;
108
+ this.contactUrl = undefined;
109
+ this.depositUrl = undefined;
110
+ this.currency = '';
111
+ this.showBonusSelectionInput = 'true';
112
+ this.isShortCashier = false;
113
+ this.homeUrl = undefined;
114
+ this.beforeRedirect = emptyFunction;
115
+ this.limitStylingAppends = false;
116
+ this.dynamicHeight = undefined;
117
+ this.cashierInfoUrl = undefined;
147
118
  }
148
- // end custom styling area
149
- }
150
- render() {
151
- return (index.h(index.Host, null, index.h("div", { ref: el => this.stylingContainer = el }, (!(this.isMobile && !this.isShortCashier) && (index.h("h2", { class: "CategoryTitle" }, translate(this.typeParameter === 'Withdraw' ? 'Withdraw' : 'Deposit', this.language)))), index.h("div", { class: `DepositWithdrawalWrapper ${this.isShortCashier ? 'ShortCashier' : ''}`, style: { height: this.dynamicHeight, marginTop: this.isShortCashier ? '30px' : '0' } }, index.h("div", null, (this.isMobile && !this.isShortCashier ?
152
- index.h("div", { class: "MenuReturnButton", onClick: () => this.toggleScreen(this.isMobile) }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "15", viewBox: "0 0 15 15" }, index.h("defs", null), index.h("g", { transform: "translate(-20 -158)" }, index.h("g", { transform: "translate(20 158)" }, index.h("path", { class: "aaa", d: "M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z", transform: "translate(15 15) rotate(180)" })))), index.h("h2", { class: "CategoryTitleMobile" }, translate(this.typeParameter === 'Withdraw' ? 'Withdraw' : 'Deposit', this.language)))
153
- : null)), this.cashierInfoUrl ? index.h("iframe", { width: "100%", height: "100%", src: this.cashierInfoUrl }) : index.h("h3", { class: "ErrorMessage" }, this.type === 'deposit' ? translate('denyDeposit', this.language) : translate('denyWithdrawal', this.language))))));
154
- }
155
- async loadWidget() {
156
- const requestObject = {
157
- Channel: this.channel,
158
- Type: this.typeParameter,
159
- SuccessUrl: this.successUrl,
160
- CancelUrl: this.cancelUrl,
161
- FailUrl: this.failUrl,
162
- Language: this.language,
163
- productType: this.productType,
164
- isShortCashier: this.isShortCashier,
165
- currency: this.currency,
166
- showBonusSelectionInput: this.showBonusSelectionInput
167
- };
168
- try {
169
- const url = `${this.endpoint}/v1/player/${this.userId}/payment/GetPaymentSession`;
170
- const response = await fetch(url, {
171
- method: 'POST',
172
- headers: {
173
- 'X-Sessionid': this.session,
174
- 'Content-Type': 'application/json',
175
- },
176
- body: JSON.stringify(requestObject)
177
- });
178
- if (!response.ok) {
179
- const err = await response.text();
180
- throw new Error(err);
181
- }
182
- const data = await response.json();
183
- if (data.CashierInfo) {
184
- this.cashierInfoUrl = data.CashierInfo.Url;
185
- }
186
- else {
187
- let apiMessage;
188
- if (data.ResponseMessage) {
189
- let foundErrorCode = this.errorCodes.find(code => data.ResponseMessage.includes(code)) || null;
190
- if (foundErrorCode) {
191
- apiMessage = translate(`errorCode${foundErrorCode}`, this.language);
192
- }
193
- else {
194
- apiMessage = translate('notFoundErrorCode', this.language);
195
- }
119
+ get typeParameter() {
120
+ if (this.type === 'deposit') {
121
+ return 'Deposit';
196
122
  }
197
- else {
198
- apiMessage = this.type === 'deposit'
199
- ? translate('denyDeposit', this.language)
200
- : translate('denyWithdrawal', this.language);
123
+ if (this.type === 'withdraw') {
124
+ return 'Withdraw';
201
125
  }
202
- const messageOBj = { type: 'error', message: apiMessage };
203
- window.postMessage({ type: 'DenyDepositOrWithdrawal', data: messageOBj }, window.location.href);
204
- }
205
- }
206
- catch (ex) {
207
- console.error(ex);
208
- }
209
- }
210
- handleMessage(message) {
211
- var _a, _b, _c, _d, _e, _f, _g, _h;
212
- if (message.data['MMFE:openFullCashier'] === 'true') {
213
- window.postMessage({ type: 'GoToDeposit' }, window.location.href);
214
- window.postMessage({ type: 'CloseShortCashier' }, window.location.href);
215
126
  }
216
- if (message.data["MMFE:setQuickDepositHeight"] && this.isShortCashier) {
217
- this.dynamicHeight = message.data["MMFE:setQuickDepositHeight"].toString() + 'px';
127
+ watchLoadWidget() {
128
+ this.loadWidget();
218
129
  }
219
- if (message.data["MMFE:setIFrameHeight"] && this.isShortCashier) {
220
- this.dynamicHeight = message.data["MMFE:setIFrameHeight"].toString() + 'px';
130
+ async componentWillLoad() {
131
+ await this.loadWidget();
221
132
  }
222
- if (((_a = message.data) === null || _a === void 0 ? void 0 : _a.type) === 'mm-hcback-to-merchant') {
223
- this.doRedirect(message.data.type, this.homeUrl);
133
+ toggleScreen(isMobile) {
134
+ window.postMessage({ type: 'PlayerAccountMenuActive', isMobile }, window.location.href);
224
135
  }
225
- if (((_b = message.data) === null || _b === void 0 ? void 0 : _b.redirect) === 'mm-hc-back-tomerchant') {
226
- this.doRedirect(message.data.redirect, this.homeUrl);
136
+ componentDidLoad() {
137
+ window.addEventListener('message', this.bindedHandler, false);
227
138
  }
228
- if (((_c = message.data) === null || _c === void 0 ? void 0 : _c.redirect) === 'mm-hc-sports') {
229
- this.doRedirect((_d = message.data) === null || _d === void 0 ? void 0 : _d.redirect, this.sportsUrl);
139
+ disconnectedCallback() {
140
+ window.removeEventListener('message', this.bindedHandler, false);
230
141
  }
231
- if (((_e = message.data) === null || _e === void 0 ? void 0 : _e.redirect) === 'mm-hc-casino') {
232
- this.doRedirect(window.location.href, this.casinoUrl);
142
+ componentDidRender() {
143
+ // start custom styling area
144
+ if (!this.limitStylingAppends && this.stylingContainer) {
145
+ if (this.clientStyling)
146
+ this.setClientStyling();
147
+ if (this.clientStylingUrl)
148
+ this.setClientStylingURL();
149
+ this.limitStylingAppends = true;
150
+ }
151
+ // end custom styling area
233
152
  }
234
- if (((_f = message.data) === null || _f === void 0 ? void 0 : _f.redirect) === 'mm-hc-contact') {
235
- window.postMessage({ type: 'CloseShortCashier' }, window.location.href);
236
- this.doRedirect(window.location.href, this.contactUrl);
153
+ render() {
154
+ return (index.h(index.Host, { key: 'ccdd9243da65080f4ac854a4bc6ed4006f0c9f5e' }, index.h("div", { key: 'e39b500a56740d0f7e23f92e2f73ea386a3bbb5c', ref: el => this.stylingContainer = el }, (!(this.isMobile && !this.isShortCashier) && (index.h("h2", { key: '3e2e8bf8a07a4249674f4dae7df7a76da6435fa3', class: "CategoryTitle" }, translate(this.typeParameter === 'Withdraw' ? 'Withdraw' : 'Deposit', this.language)))), index.h("div", { key: '886bedf58fac20d2f620d4600b6588089d0e502c', class: `DepositWithdrawalWrapper ${this.isShortCashier ? 'ShortCashier' : ''}`, style: { height: this.dynamicHeight, marginTop: this.isShortCashier ? '30px' : '0' } }, index.h("div", { key: 'fa038bb3d599cbd894ba6a14ead4c03bbfa425fd' }, (this.isMobile && !this.isShortCashier ?
155
+ index.h("div", { class: "MenuReturnButton", onClick: () => this.toggleScreen(this.isMobile) }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "15", viewBox: "0 0 15 15" }, index.h("defs", null), index.h("g", { transform: "translate(-20 -158)" }, index.h("g", { transform: "translate(20 158)" }, index.h("path", { class: "aaa", d: "M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z", transform: "translate(15 15) rotate(180)" })))), index.h("h2", { class: "CategoryTitleMobile" }, translate(this.typeParameter === 'Withdraw' ? 'Withdraw' : 'Deposit', this.language)))
156
+ : null)), this.cashierInfoUrl ? index.h("iframe", { width: "100%", height: "100%", src: this.cashierInfoUrl }) : index.h("h3", { class: "ErrorMessage" }, this.type === 'deposit' ? translate('denyDeposit', this.language) : translate('denyWithdrawal', this.language))))));
237
157
  }
238
- if (((_g = message.data) === null || _g === void 0 ? void 0 : _g.redirect) === 'mm-wm-hc-init-deposit' || ((_h = message.data) === null || _h === void 0 ? void 0 : _h.redirect) === 'mm-wm-hc-init-deposit-quick') {
239
- window.postMessage({ type: 'CloseShortCashier' }, window.location.href);
240
- this.doRedirect(window.location.href, this.depositUrl);
158
+ async loadWidget() {
159
+ const requestObject = {
160
+ Channel: this.channel,
161
+ Type: this.typeParameter,
162
+ SuccessUrl: this.successUrl,
163
+ CancelUrl: this.cancelUrl,
164
+ FailUrl: this.failUrl,
165
+ Language: this.language,
166
+ productType: this.productType,
167
+ isShortCashier: this.isShortCashier,
168
+ currency: this.currency,
169
+ showBonusSelectionInput: this.showBonusSelectionInput
170
+ };
171
+ try {
172
+ const url = `${this.endpoint}/v1/player/${this.userId}/payment/GetPaymentSession`;
173
+ const response = await fetch(url, {
174
+ method: 'POST',
175
+ headers: {
176
+ 'X-Sessionid': this.session,
177
+ 'Content-Type': 'application/json',
178
+ },
179
+ body: JSON.stringify(requestObject)
180
+ });
181
+ if (!response.ok) {
182
+ const err = await response.text();
183
+ throw new Error(err);
184
+ }
185
+ const data = await response.json();
186
+ if (data.CashierInfo) {
187
+ this.cashierInfoUrl = data.CashierInfo.Url;
188
+ }
189
+ else {
190
+ let apiMessage;
191
+ if (data.ResponseMessage) {
192
+ let foundErrorCode = this.errorCodes.find(code => data.ResponseMessage.includes(code)) || null;
193
+ if (foundErrorCode) {
194
+ apiMessage = translate(`errorCode${foundErrorCode}`, this.language);
195
+ }
196
+ else {
197
+ apiMessage = translate('notFoundErrorCode', this.language);
198
+ }
199
+ }
200
+ else {
201
+ apiMessage = this.type === 'deposit'
202
+ ? translate('denyDeposit', this.language)
203
+ : translate('denyWithdrawal', this.language);
204
+ }
205
+ const messageOBj = { type: 'error', message: apiMessage };
206
+ window.postMessage({ type: 'DenyDepositOrWithdrawal', data: messageOBj }, window.location.href);
207
+ }
208
+ }
209
+ catch (ex) {
210
+ console.error(ex);
211
+ }
241
212
  }
242
- }
243
- doRedirect(reason, url) {
244
- const redirectArgs = { reason, url, cancel: false };
245
- this.beforeRedirect(redirectArgs);
246
- if (redirectArgs.cancel) {
247
- return;
213
+ handleMessage(message) {
214
+ var _a, _b, _c, _d, _e, _f, _g, _h;
215
+ if (message.data['MMFE:openFullCashier'] === 'true') {
216
+ window.postMessage({ type: 'GoToDeposit' }, window.location.href);
217
+ window.postMessage({ type: 'CloseShortCashier' }, window.location.href);
218
+ }
219
+ if (message.data["MMFE:setQuickDepositHeight"] && this.isShortCashier) {
220
+ this.dynamicHeight = message.data["MMFE:setQuickDepositHeight"].toString() + 'px';
221
+ }
222
+ if (message.data["MMFE:setIFrameHeight"] && this.isShortCashier) {
223
+ this.dynamicHeight = message.data["MMFE:setIFrameHeight"].toString() + 'px';
224
+ }
225
+ if (((_a = message.data) === null || _a === void 0 ? void 0 : _a.type) === 'mm-hcback-to-merchant') {
226
+ this.doRedirect(message.data.type, this.homeUrl);
227
+ }
228
+ if (((_b = message.data) === null || _b === void 0 ? void 0 : _b.redirect) === 'mm-hc-back-tomerchant') {
229
+ this.doRedirect(message.data.redirect, this.homeUrl);
230
+ }
231
+ if (((_c = message.data) === null || _c === void 0 ? void 0 : _c.redirect) === 'mm-hc-sports') {
232
+ this.doRedirect((_d = message.data) === null || _d === void 0 ? void 0 : _d.redirect, this.sportsUrl);
233
+ }
234
+ if (((_e = message.data) === null || _e === void 0 ? void 0 : _e.redirect) === 'mm-hc-casino') {
235
+ this.doRedirect(window.location.href, this.casinoUrl);
236
+ }
237
+ if (((_f = message.data) === null || _f === void 0 ? void 0 : _f.redirect) === 'mm-hc-contact') {
238
+ window.postMessage({ type: 'CloseShortCashier' }, window.location.href);
239
+ this.doRedirect(window.location.href, this.contactUrl);
240
+ }
241
+ if (((_g = message.data) === null || _g === void 0 ? void 0 : _g.redirect) === 'mm-wm-hc-init-deposit' || ((_h = message.data) === null || _h === void 0 ? void 0 : _h.redirect) === 'mm-wm-hc-init-deposit-quick') {
242
+ window.postMessage({ type: 'CloseShortCashier' }, window.location.href);
243
+ this.doRedirect(window.location.href, this.depositUrl);
244
+ }
248
245
  }
249
- if (!redirectArgs.url) {
250
- window.location.href = '/';
251
- return;
246
+ doRedirect(reason, url) {
247
+ const redirectArgs = { reason, url, cancel: false };
248
+ this.beforeRedirect(redirectArgs);
249
+ if (redirectArgs.cancel) {
250
+ return;
251
+ }
252
+ if (!redirectArgs.url) {
253
+ window.location.href = '/';
254
+ return;
255
+ }
256
+ window.location.href = redirectArgs.url;
252
257
  }
253
- window.location.href = redirectArgs.url;
254
- }
255
- static get watchers() { return {
256
- "session": ["watchLoadWidget"],
257
- "userId": ["watchLoadWidget"],
258
- "isShortCashier": ["watchLoadWidget"],
259
- "currency": ["watchLoadWidget"],
260
- "showBonusSelectionInput": ["watchLoadWidget"]
261
- }; }
258
+ static get watchers() { return {
259
+ "session": ["watchLoadWidget"],
260
+ "userId": ["watchLoadWidget"],
261
+ "isShortCashier": ["watchLoadWidget"],
262
+ "currency": ["watchLoadWidget"],
263
+ "showBonusSelectionInput": ["watchLoadWidget"]
264
+ }; }
262
265
  };
263
- UserDepositWithdrawal.style = userDepositWithdrawalCss;
266
+ UserDepositWithdrawal.style = UserDepositWithdrawalStyle0;
264
267
 
265
268
  exports.user_deposit_withdrawal = UserDepositWithdrawal;
@@ -1,19 +1,25 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-efde0a55.js');
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-faa382a8.js');
6
+ const appGlobals = require('./app-globals-3a1e7e63.js');
4
7
 
5
8
  /*
6
- Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
9
+ Stencil Client Patch Browser v4.20.0 | MIT Licensed | https://stenciljs.com
7
10
  */
8
- const patchBrowser = () => {
9
- const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('user-deposit-withdrawal.cjs.js', document.baseURI).href));
10
- const opts = {};
11
- if (importMeta !== '') {
12
- opts.resourcesUrl = new URL('.', importMeta).href;
13
- }
14
- return index.promiseResolve(opts);
11
+ var patchBrowser = () => {
12
+ const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('user-deposit-withdrawal.cjs.js', document.baseURI).href));
13
+ const opts = {};
14
+ if (importMeta !== "") {
15
+ opts.resourcesUrl = new URL(".", importMeta).href;
16
+ }
17
+ return index.promiseResolve(opts);
15
18
  };
16
19
 
17
- patchBrowser().then(options => {
18
- return index.bootstrapLazy([["user-deposit-withdrawal.cjs",[[1,"user-deposit-withdrawal",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"endpoint":[513],"type":[513],"channel":[513],"language":[513],"productType":[513,"product-type"],"userId":[513,"user-id"],"session":[513],"successUrl":[513,"success-url"],"cancelUrl":[513,"cancel-url"],"failUrl":[513,"fail-url"],"sportsUrl":[513,"sports-url"],"casinoUrl":[513,"casino-url"],"contactUrl":[513,"contact-url"],"depositUrl":[513,"deposit-url"],"currency":[513],"showBonusSelectionInput":[513,"show-bonus-selection-input"],"isShortCashier":[516,"is-short-cashier"],"homeUrl":[513,"home-url"],"beforeRedirect":[16],"limitStylingAppends":[32],"dynamicHeight":[32],"cashierInfoUrl":[32]}]]]], options);
20
+ patchBrowser().then(async (options) => {
21
+ await appGlobals.globalScripts();
22
+ return index.bootstrapLazy([["user-deposit-withdrawal.cjs",[[1,"user-deposit-withdrawal",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"endpoint":[513],"type":[513],"channel":[513],"language":[513],"productType":[513,"product-type"],"userId":[513,"user-id"],"session":[513],"successUrl":[513,"success-url"],"cancelUrl":[513,"cancel-url"],"failUrl":[513,"fail-url"],"sportsUrl":[513,"sports-url"],"casinoUrl":[513,"casino-url"],"contactUrl":[513,"contact-url"],"depositUrl":[513,"deposit-url"],"currency":[513],"showBonusSelectionInput":[513,"show-bonus-selection-input"],"isShortCashier":[516,"is-short-cashier"],"homeUrl":[513,"home-url"],"beforeRedirect":[16],"limitStylingAppends":[32],"dynamicHeight":[32],"cashierInfoUrl":[32]},null,{"session":["watchLoadWidget"],"userId":["watchLoadWidget"],"isShortCashier":["watchLoadWidget"],"currency":["watchLoadWidget"],"showBonusSelectionInput":["watchLoadWidget"]}]]]], options);
19
23
  });
24
+
25
+ exports.setNonce = index.setNonce;
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "entries": [
3
- "./components/user-deposit-withdrawal/user-deposit-withdrawal.js"
3
+ "components/user-deposit-withdrawal/user-deposit-withdrawal.js"
4
4
  ],
5
5
  "compiler": {
6
6
  "name": "@stencil/core",
7
- "version": "2.15.2",
8
- "typescriptVersion": "4.5.4"
7
+ "version": "4.20.0",
8
+ "typescriptVersion": "5.5.3"
9
9
  },
10
10
  "collections": [],
11
11
  "bundles": []
@@ -0,0 +1 @@
1
+ export { UserDepositWithdrawal } from './user-deposit-withdrawal';