@everymatrix/player-deposit 0.0.367 → 0.0.368
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/README.md +30 -30
- package/dist/player-deposit.js.map +1 -1
- package/index.html +21 -21
- package/index.js +1 -1
- package/package.json +2 -2
- package/public/reset.css +47 -47
- package/rollup.config.js +67 -67
- package/src/PlayerDeposit.svelte +178 -178
- package/src/i18n.js +27 -27
- package/src/index.ts +4 -4
- package/src/translations.js +38 -38
- package/stories/PlayerDeposit.stories.js +13 -13
- package/tsconfig.json +6 -6
package/index.html
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset='utf-8'>
|
|
5
|
-
<meta name='viewport' content='width=device-width,initial-scale=1'>
|
|
6
|
-
|
|
7
|
-
<title>
|
|
8
|
-
player-deposit
|
|
9
|
-
</title>
|
|
10
|
-
<link rel="stylesheet" href="public/reset.css">
|
|
11
|
-
<script src='dist/player-deposit.js'></script>
|
|
12
|
-
</head>
|
|
13
|
-
|
|
14
|
-
<body>
|
|
15
|
-
|
|
16
|
-
<div class="webcomponent">
|
|
17
|
-
<player-deposit></player-deposit>
|
|
18
|
-
</div>
|
|
19
|
-
|
|
20
|
-
</body>
|
|
21
|
-
</html>
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset='utf-8'>
|
|
5
|
+
<meta name='viewport' content='width=device-width,initial-scale=1'>
|
|
6
|
+
|
|
7
|
+
<title>
|
|
8
|
+
player-deposit
|
|
9
|
+
</title>
|
|
10
|
+
<link rel="stylesheet" href="public/reset.css">
|
|
11
|
+
<script src='dist/player-deposit.js'></script>
|
|
12
|
+
</head>
|
|
13
|
+
|
|
14
|
+
<body>
|
|
15
|
+
|
|
16
|
+
<div class="webcomponent">
|
|
17
|
+
<player-deposit></player-deposit>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
</body>
|
|
21
|
+
</html>
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import './dist/player-deposit.js';
|
|
1
|
+
import './dist/player-deposit.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everymatrix/player-deposit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.368",
|
|
4
4
|
"main": "dist/player-deposit",
|
|
5
5
|
"svelte": "src/index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "8de3cc787cc97aec99916dfedb01ec69ac55ba98"
|
|
40
40
|
}
|
package/public/reset.css
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
/* http://meyerweb.com/eric/tools/css/reset/
|
|
2
|
-
v2.0 | 20110126
|
|
3
|
-
License: none (public domain)
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
html, body, div, span, applet, object, iframe,
|
|
7
|
-
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
|
8
|
-
a, abbr, acronym, address, big, cite, code,
|
|
9
|
-
del, dfn, em, img, ins, kbd, q, s, samp,
|
|
10
|
-
small, strike, strong, sub, sup, tt, var,
|
|
11
|
-
b, u, i, center,
|
|
12
|
-
dl, dt, dd, ol, ul, li,
|
|
13
|
-
fieldset, form, label, legend,
|
|
14
|
-
table, caption, tbody, tfoot, thead, tr, th, td,
|
|
15
|
-
article, aside, canvas, details, embed,
|
|
16
|
-
figure, figcaption, footer, header, hgroup,
|
|
17
|
-
menu, nav, output, ruby, section, summary,
|
|
18
|
-
time, mark, audio, video {
|
|
19
|
-
margin: 0;
|
|
20
|
-
padding: 0;
|
|
21
|
-
border: 0;
|
|
22
|
-
font-size: 100%;
|
|
23
|
-
font: inherit;
|
|
24
|
-
vertical-align: baseline;
|
|
25
|
-
}
|
|
26
|
-
/* HTML5 display-role reset for older browsers */
|
|
27
|
-
article, aside, details, figcaption, figure,
|
|
28
|
-
footer, header, hgroup, menu, nav, section {
|
|
29
|
-
display: block;
|
|
30
|
-
}
|
|
31
|
-
body {
|
|
32
|
-
line-height: 1;
|
|
33
|
-
}
|
|
34
|
-
ol, ul {
|
|
35
|
-
list-style: none;
|
|
36
|
-
}
|
|
37
|
-
blockquote, q {
|
|
38
|
-
quotes: none;
|
|
39
|
-
}
|
|
40
|
-
blockquote:before, blockquote:after,
|
|
41
|
-
q:before, q:after {
|
|
42
|
-
content: '';
|
|
43
|
-
content: none;
|
|
44
|
-
}
|
|
45
|
-
table {
|
|
46
|
-
border-collapse: collapse;
|
|
47
|
-
border-spacing: 0;
|
|
1
|
+
/* http://meyerweb.com/eric/tools/css/reset/
|
|
2
|
+
v2.0 | 20110126
|
|
3
|
+
License: none (public domain)
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
html, body, div, span, applet, object, iframe,
|
|
7
|
+
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
|
8
|
+
a, abbr, acronym, address, big, cite, code,
|
|
9
|
+
del, dfn, em, img, ins, kbd, q, s, samp,
|
|
10
|
+
small, strike, strong, sub, sup, tt, var,
|
|
11
|
+
b, u, i, center,
|
|
12
|
+
dl, dt, dd, ol, ul, li,
|
|
13
|
+
fieldset, form, label, legend,
|
|
14
|
+
table, caption, tbody, tfoot, thead, tr, th, td,
|
|
15
|
+
article, aside, canvas, details, embed,
|
|
16
|
+
figure, figcaption, footer, header, hgroup,
|
|
17
|
+
menu, nav, output, ruby, section, summary,
|
|
18
|
+
time, mark, audio, video {
|
|
19
|
+
margin: 0;
|
|
20
|
+
padding: 0;
|
|
21
|
+
border: 0;
|
|
22
|
+
font-size: 100%;
|
|
23
|
+
font: inherit;
|
|
24
|
+
vertical-align: baseline;
|
|
25
|
+
}
|
|
26
|
+
/* HTML5 display-role reset for older browsers */
|
|
27
|
+
article, aside, details, figcaption, figure,
|
|
28
|
+
footer, header, hgroup, menu, nav, section {
|
|
29
|
+
display: block;
|
|
30
|
+
}
|
|
31
|
+
body {
|
|
32
|
+
line-height: 1;
|
|
33
|
+
}
|
|
34
|
+
ol, ul {
|
|
35
|
+
list-style: none;
|
|
36
|
+
}
|
|
37
|
+
blockquote, q {
|
|
38
|
+
quotes: none;
|
|
39
|
+
}
|
|
40
|
+
blockquote:before, blockquote:after,
|
|
41
|
+
q:before, q:after {
|
|
42
|
+
content: '';
|
|
43
|
+
content: none;
|
|
44
|
+
}
|
|
45
|
+
table {
|
|
46
|
+
border-collapse: collapse;
|
|
47
|
+
border-spacing: 0;
|
|
48
48
|
}
|
package/rollup.config.js
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
import svelte from 'rollup-plugin-svelte';
|
|
2
|
-
import commonjs from '@rollup/plugin-commonjs';
|
|
3
|
-
import resolve from '@rollup/plugin-node-resolve';
|
|
4
|
-
import serve from 'rollup-plugin-dev-server';
|
|
5
|
-
import livereload from 'rollup-plugin-livereload';
|
|
6
|
-
import { terser } from 'rollup-plugin-terser';
|
|
7
|
-
import sveltePreprocess from 'svelte-preprocess';
|
|
8
|
-
import typescript from '@rollup/plugin-typescript';
|
|
9
|
-
import uglify from 'rollup-plugin-uglify';
|
|
10
|
-
import image from '@rollup/plugin-image';
|
|
11
|
-
|
|
12
|
-
const production = process.env.NODE_ENV == 'production';
|
|
13
|
-
const dev = process.env.NODE_ENV == 'development';
|
|
14
|
-
|
|
15
|
-
export default {
|
|
16
|
-
input: 'src/index.ts',
|
|
17
|
-
output: {
|
|
18
|
-
sourcemap: true,
|
|
19
|
-
format: 'umd',
|
|
20
|
-
name: 'app',
|
|
21
|
-
file: 'dist/player-deposit.js',
|
|
22
|
-
},
|
|
23
|
-
plugins: [
|
|
24
|
-
svelte({
|
|
25
|
-
preprocess: sveltePreprocess(),
|
|
26
|
-
compilerOptions: {
|
|
27
|
-
// @TODO check generate and hydratable
|
|
28
|
-
// generate: 'ssr',
|
|
29
|
-
// hydratable: true,
|
|
30
|
-
// enable run-time checks when not in production
|
|
31
|
-
customElement: true,
|
|
32
|
-
dev: !production
|
|
33
|
-
}
|
|
34
|
-
}),
|
|
35
|
-
image(),
|
|
36
|
-
commonjs(),
|
|
37
|
-
resolve({
|
|
38
|
-
browser: true,
|
|
39
|
-
dedupe: ['svelte']
|
|
40
|
-
}),
|
|
41
|
-
dev && serve({
|
|
42
|
-
open: true,
|
|
43
|
-
verbose: true,
|
|
44
|
-
allowCrossOrigin: true,
|
|
45
|
-
historyApiFallback: false,
|
|
46
|
-
host: 'localhost',
|
|
47
|
-
port: 5050,
|
|
48
|
-
}),
|
|
49
|
-
dev && livereload({ watch: ['', 'dist'] }),
|
|
50
|
-
typescript({
|
|
51
|
-
sourceMap: !production,
|
|
52
|
-
inlineSources: !production,
|
|
53
|
-
}),
|
|
54
|
-
// If we're building for production (npm run build
|
|
55
|
-
// instead of npm run dev), minify
|
|
56
|
-
production &&
|
|
57
|
-
terser({
|
|
58
|
-
output: {
|
|
59
|
-
comments: "all"
|
|
60
|
-
},
|
|
61
|
-
}),
|
|
62
|
-
production && uglify.uglify()
|
|
63
|
-
],
|
|
64
|
-
watch: {
|
|
65
|
-
clearScreen: false
|
|
66
|
-
}
|
|
67
|
-
};
|
|
1
|
+
import svelte from 'rollup-plugin-svelte';
|
|
2
|
+
import commonjs from '@rollup/plugin-commonjs';
|
|
3
|
+
import resolve from '@rollup/plugin-node-resolve';
|
|
4
|
+
import serve from 'rollup-plugin-dev-server';
|
|
5
|
+
import livereload from 'rollup-plugin-livereload';
|
|
6
|
+
import { terser } from 'rollup-plugin-terser';
|
|
7
|
+
import sveltePreprocess from 'svelte-preprocess';
|
|
8
|
+
import typescript from '@rollup/plugin-typescript';
|
|
9
|
+
import uglify from 'rollup-plugin-uglify';
|
|
10
|
+
import image from '@rollup/plugin-image';
|
|
11
|
+
|
|
12
|
+
const production = process.env.NODE_ENV == 'production';
|
|
13
|
+
const dev = process.env.NODE_ENV == 'development';
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
input: 'src/index.ts',
|
|
17
|
+
output: {
|
|
18
|
+
sourcemap: true,
|
|
19
|
+
format: 'umd',
|
|
20
|
+
name: 'app',
|
|
21
|
+
file: 'dist/player-deposit.js',
|
|
22
|
+
},
|
|
23
|
+
plugins: [
|
|
24
|
+
svelte({
|
|
25
|
+
preprocess: sveltePreprocess(),
|
|
26
|
+
compilerOptions: {
|
|
27
|
+
// @TODO check generate and hydratable
|
|
28
|
+
// generate: 'ssr',
|
|
29
|
+
// hydratable: true,
|
|
30
|
+
// enable run-time checks when not in production
|
|
31
|
+
customElement: true,
|
|
32
|
+
dev: !production
|
|
33
|
+
}
|
|
34
|
+
}),
|
|
35
|
+
image(),
|
|
36
|
+
commonjs(),
|
|
37
|
+
resolve({
|
|
38
|
+
browser: true,
|
|
39
|
+
dedupe: ['svelte']
|
|
40
|
+
}),
|
|
41
|
+
dev && serve({
|
|
42
|
+
open: true,
|
|
43
|
+
verbose: true,
|
|
44
|
+
allowCrossOrigin: true,
|
|
45
|
+
historyApiFallback: false,
|
|
46
|
+
host: 'localhost',
|
|
47
|
+
port: 5050,
|
|
48
|
+
}),
|
|
49
|
+
dev && livereload({ watch: ['', 'dist'] }),
|
|
50
|
+
typescript({
|
|
51
|
+
sourceMap: !production,
|
|
52
|
+
inlineSources: !production,
|
|
53
|
+
}),
|
|
54
|
+
// If we're building for production (npm run build
|
|
55
|
+
// instead of npm run dev), minify
|
|
56
|
+
production &&
|
|
57
|
+
terser({
|
|
58
|
+
output: {
|
|
59
|
+
comments: "all"
|
|
60
|
+
},
|
|
61
|
+
}),
|
|
62
|
+
production && uglify.uglify()
|
|
63
|
+
],
|
|
64
|
+
watch: {
|
|
65
|
+
clearScreen: false
|
|
66
|
+
}
|
|
67
|
+
};
|
package/src/PlayerDeposit.svelte
CHANGED
|
@@ -1,178 +1,178 @@
|
|
|
1
|
-
<svelte:options tag={null} />
|
|
2
|
-
<script lang="ts">
|
|
3
|
-
import { onMount } from 'svelte';
|
|
4
|
-
import { getDevice } from 'rvhelper';
|
|
5
|
-
import { _, addNewMessages, setLocale } from './i18n';
|
|
6
|
-
import { PlayerDepositTranslations } from './translations';
|
|
7
|
-
|
|
8
|
-
export let endpoint:string = '';
|
|
9
|
-
export let session:string = '';
|
|
10
|
-
export let playerid:string = '';
|
|
11
|
-
export let lang:string = 'en';
|
|
12
|
-
|
|
13
|
-
let userAgent:string = window.navigator.userAgent;
|
|
14
|
-
let isMobile:boolean = (getDevice(userAgent) === 'PC') ? false : true;
|
|
15
|
-
let isLoading:boolean = true;
|
|
16
|
-
|
|
17
|
-
let currency:string = '';
|
|
18
|
-
let amount:number = 0;
|
|
19
|
-
let iframeUrl:string = '';
|
|
20
|
-
|
|
21
|
-
Object.keys(PlayerDepositTranslations).forEach((item:any) => {
|
|
22
|
-
addNewMessages(item, PlayerDepositTranslations[item]);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const goToPreviousRoute = ():void => {
|
|
27
|
-
window.postMessage({ type: 'GoToPreviousRoute' }, window.location.href);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const messageHandler = (e:any):void => {
|
|
31
|
-
if (e.data) {
|
|
32
|
-
switch(e.data.type) {
|
|
33
|
-
case 'ProfileDetailsData':
|
|
34
|
-
currency = e.data.profileDetails.currency;
|
|
35
|
-
break;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
switch(e.data.redirect) {
|
|
39
|
-
case 'mm-hc-casino':
|
|
40
|
-
window.postMessage({ type: 'GoToCasino' }, window.location.href);
|
|
41
|
-
break;
|
|
42
|
-
|
|
43
|
-
case 'mm-hc-sports':
|
|
44
|
-
window.postMessage({ type: 'GoToSports' }, window.location.href);
|
|
45
|
-
break;
|
|
46
|
-
|
|
47
|
-
case 'mm-hc-contact':
|
|
48
|
-
window.postMessage({ type: 'GoToCustomerSupport' }, window.location.href);
|
|
49
|
-
break;
|
|
50
|
-
|
|
51
|
-
case 'mm-hc-back-to-merchant':
|
|
52
|
-
window.postMessage({ type: 'GoToHomepage' }, window.location.href);
|
|
53
|
-
break;
|
|
54
|
-
|
|
55
|
-
case 'mm-wm-hc-init-deposit':
|
|
56
|
-
window.postMessage({ type: 'GoToDeposit' }, window.location.href);
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const getDepositIframe = ():void => {
|
|
63
|
-
let url:URL = new URL(`${endpoint}/player/${playerid}/hostedcashier/initializedeposit`);
|
|
64
|
-
|
|
65
|
-
let options:any = {
|
|
66
|
-
method: "POST",
|
|
67
|
-
headers: {
|
|
68
|
-
'X-SessionId': session,
|
|
69
|
-
currency: currency || 'EUR',
|
|
70
|
-
amount,
|
|
71
|
-
cashierMode: 'Default',
|
|
72
|
-
IsShortCashier: false,
|
|
73
|
-
accept: 'application/json',
|
|
74
|
-
},
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
fetch(url.href, options)
|
|
78
|
-
.then((res:any) => res.json())
|
|
79
|
-
.then((data:any) => {
|
|
80
|
-
|
|
81
|
-
isLoading = false;
|
|
82
|
-
|
|
83
|
-
iframeUrl = data.CashierUrl;
|
|
84
|
-
|
|
85
|
-
}, (err:any) => {
|
|
86
|
-
console.error(err);
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const setActiveLanguage = ():void => {
|
|
91
|
-
setLocale(lang);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
onMount(() => {
|
|
95
|
-
window.addEventListener('message', messageHandler, false);
|
|
96
|
-
|
|
97
|
-
return () => {
|
|
98
|
-
window.removeEventListener('message', messageHandler);
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
$: lang && setActiveLanguage();
|
|
103
|
-
$: session && playerid && endpoint && getDepositIframe();
|
|
104
|
-
</script>
|
|
105
|
-
|
|
106
|
-
<div class="DepositWrapper {isMobile ? 'DepositWrapperMobile' : ''}" part="DepositWrapper {isMobile ? 'DepositWrapperMobile' : ''}">
|
|
107
|
-
{#if isMobile}
|
|
108
|
-
<div class="MenuReturnButton" part="MenuReturnButton" on:click={() => goToPreviousRoute()}>
|
|
109
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15"><defs><style>.aaa{fill:var(--emfe-w-color-primary, #D0046C);}</style></defs><g transform="translate(-20 -158)">
|
|
110
|
-
<g transform="translate(20 158)">
|
|
111
|
-
<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)"/>
|
|
112
|
-
</g></g>
|
|
113
|
-
</svg>
|
|
114
|
-
<h2 class="DepositTitleMobile" part="DepositTitleMobile">{$_('deposit.title')}</h2>
|
|
115
|
-
</div>
|
|
116
|
-
{/if}
|
|
117
|
-
<h2 class="DepositTitle {isMobile ? 'DepositTitleNone' : ''}" part="DepositTitle {isMobile ? 'DepositTitleNone' : ''}">{$_('deposit.title')}</h2>
|
|
118
|
-
{#if isLoading}
|
|
119
|
-
<p>{$_('deposit.loading')}</p>
|
|
120
|
-
{:else}
|
|
121
|
-
<div class="DepositIframeWrapper" part="DepositIframeWrapper">
|
|
122
|
-
<iframe src={iframeUrl} title="Deposit Iframe"></iframe>
|
|
123
|
-
</div>
|
|
124
|
-
{/if}
|
|
125
|
-
</div>
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
<style lang="scss">
|
|
129
|
-
|
|
130
|
-
:host {
|
|
131
|
-
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.DepositWrapper {
|
|
135
|
-
color: var(--emfe-w-color-contrast, #07072A);
|
|
136
|
-
padding: 50px 50px 30px 50px;
|
|
137
|
-
max-width: 100%;
|
|
138
|
-
|
|
139
|
-
&.DepositWrapperMobile {
|
|
140
|
-
padding: 20px 15px;
|
|
141
|
-
max-width: unset;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.MenuReturnButton{
|
|
146
|
-
color: var(--emfe-w-color-primary, #D0046C);
|
|
147
|
-
display: inline-flex;
|
|
148
|
-
align-items: center;
|
|
149
|
-
column-gap: 10px;
|
|
150
|
-
margin-bottom: 10px;
|
|
151
|
-
& svg {
|
|
152
|
-
fill: var(--emfe-w-color-primary, #D0046C);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.DepositTitle {
|
|
157
|
-
font-size: 26px;
|
|
158
|
-
color: var(--emfe-w-color-primary, #D0046C);
|
|
159
|
-
font-weight: 400;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.DepositTitleMobile {
|
|
163
|
-
font-size: 16px;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.DepositTitleNone {
|
|
167
|
-
display: none;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
.DepositIframeWrapper {
|
|
171
|
-
iframe {
|
|
172
|
-
border: none;
|
|
173
|
-
width: 100%;
|
|
174
|
-
height: 85vh;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
</style>
|
|
1
|
+
<svelte:options tag={null} />
|
|
2
|
+
<script lang="ts">
|
|
3
|
+
import { onMount } from 'svelte';
|
|
4
|
+
import { getDevice } from 'rvhelper';
|
|
5
|
+
import { _, addNewMessages, setLocale } from './i18n';
|
|
6
|
+
import { PlayerDepositTranslations } from './translations';
|
|
7
|
+
|
|
8
|
+
export let endpoint:string = '';
|
|
9
|
+
export let session:string = '';
|
|
10
|
+
export let playerid:string = '';
|
|
11
|
+
export let lang:string = 'en';
|
|
12
|
+
|
|
13
|
+
let userAgent:string = window.navigator.userAgent;
|
|
14
|
+
let isMobile:boolean = (getDevice(userAgent) === 'PC') ? false : true;
|
|
15
|
+
let isLoading:boolean = true;
|
|
16
|
+
|
|
17
|
+
let currency:string = '';
|
|
18
|
+
let amount:number = 0;
|
|
19
|
+
let iframeUrl:string = '';
|
|
20
|
+
|
|
21
|
+
Object.keys(PlayerDepositTranslations).forEach((item:any) => {
|
|
22
|
+
addNewMessages(item, PlayerDepositTranslations[item]);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
const goToPreviousRoute = ():void => {
|
|
27
|
+
window.postMessage({ type: 'GoToPreviousRoute' }, window.location.href);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const messageHandler = (e:any):void => {
|
|
31
|
+
if (e.data) {
|
|
32
|
+
switch(e.data.type) {
|
|
33
|
+
case 'ProfileDetailsData':
|
|
34
|
+
currency = e.data.profileDetails.currency;
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
switch(e.data.redirect) {
|
|
39
|
+
case 'mm-hc-casino':
|
|
40
|
+
window.postMessage({ type: 'GoToCasino' }, window.location.href);
|
|
41
|
+
break;
|
|
42
|
+
|
|
43
|
+
case 'mm-hc-sports':
|
|
44
|
+
window.postMessage({ type: 'GoToSports' }, window.location.href);
|
|
45
|
+
break;
|
|
46
|
+
|
|
47
|
+
case 'mm-hc-contact':
|
|
48
|
+
window.postMessage({ type: 'GoToCustomerSupport' }, window.location.href);
|
|
49
|
+
break;
|
|
50
|
+
|
|
51
|
+
case 'mm-hc-back-to-merchant':
|
|
52
|
+
window.postMessage({ type: 'GoToHomepage' }, window.location.href);
|
|
53
|
+
break;
|
|
54
|
+
|
|
55
|
+
case 'mm-wm-hc-init-deposit':
|
|
56
|
+
window.postMessage({ type: 'GoToDeposit' }, window.location.href);
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const getDepositIframe = ():void => {
|
|
63
|
+
let url:URL = new URL(`${endpoint}/player/${playerid}/hostedcashier/initializedeposit`);
|
|
64
|
+
|
|
65
|
+
let options:any = {
|
|
66
|
+
method: "POST",
|
|
67
|
+
headers: {
|
|
68
|
+
'X-SessionId': session,
|
|
69
|
+
currency: currency || 'EUR',
|
|
70
|
+
amount,
|
|
71
|
+
cashierMode: 'Default',
|
|
72
|
+
IsShortCashier: false,
|
|
73
|
+
accept: 'application/json',
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
fetch(url.href, options)
|
|
78
|
+
.then((res:any) => res.json())
|
|
79
|
+
.then((data:any) => {
|
|
80
|
+
|
|
81
|
+
isLoading = false;
|
|
82
|
+
|
|
83
|
+
iframeUrl = data.CashierUrl;
|
|
84
|
+
|
|
85
|
+
}, (err:any) => {
|
|
86
|
+
console.error(err);
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const setActiveLanguage = ():void => {
|
|
91
|
+
setLocale(lang);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
onMount(() => {
|
|
95
|
+
window.addEventListener('message', messageHandler, false);
|
|
96
|
+
|
|
97
|
+
return () => {
|
|
98
|
+
window.removeEventListener('message', messageHandler);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
$: lang && setActiveLanguage();
|
|
103
|
+
$: session && playerid && endpoint && getDepositIframe();
|
|
104
|
+
</script>
|
|
105
|
+
|
|
106
|
+
<div class="DepositWrapper {isMobile ? 'DepositWrapperMobile' : ''}" part="DepositWrapper {isMobile ? 'DepositWrapperMobile' : ''}">
|
|
107
|
+
{#if isMobile}
|
|
108
|
+
<div class="MenuReturnButton" part="MenuReturnButton" on:click={() => goToPreviousRoute()}>
|
|
109
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15"><defs><style>.aaa{fill:var(--emfe-w-color-primary, #D0046C);}</style></defs><g transform="translate(-20 -158)">
|
|
110
|
+
<g transform="translate(20 158)">
|
|
111
|
+
<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)"/>
|
|
112
|
+
</g></g>
|
|
113
|
+
</svg>
|
|
114
|
+
<h2 class="DepositTitleMobile" part="DepositTitleMobile">{$_('deposit.title')}</h2>
|
|
115
|
+
</div>
|
|
116
|
+
{/if}
|
|
117
|
+
<h2 class="DepositTitle {isMobile ? 'DepositTitleNone' : ''}" part="DepositTitle {isMobile ? 'DepositTitleNone' : ''}">{$_('deposit.title')}</h2>
|
|
118
|
+
{#if isLoading}
|
|
119
|
+
<p>{$_('deposit.loading')}</p>
|
|
120
|
+
{:else}
|
|
121
|
+
<div class="DepositIframeWrapper" part="DepositIframeWrapper">
|
|
122
|
+
<iframe src={iframeUrl} title="Deposit Iframe"></iframe>
|
|
123
|
+
</div>
|
|
124
|
+
{/if}
|
|
125
|
+
</div>
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
<style lang="scss">
|
|
129
|
+
|
|
130
|
+
:host {
|
|
131
|
+
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.DepositWrapper {
|
|
135
|
+
color: var(--emfe-w-color-contrast, #07072A);
|
|
136
|
+
padding: 50px 50px 30px 50px;
|
|
137
|
+
max-width: 100%;
|
|
138
|
+
|
|
139
|
+
&.DepositWrapperMobile {
|
|
140
|
+
padding: 20px 15px;
|
|
141
|
+
max-width: unset;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.MenuReturnButton{
|
|
146
|
+
color: var(--emfe-w-color-primary, #D0046C);
|
|
147
|
+
display: inline-flex;
|
|
148
|
+
align-items: center;
|
|
149
|
+
column-gap: 10px;
|
|
150
|
+
margin-bottom: 10px;
|
|
151
|
+
& svg {
|
|
152
|
+
fill: var(--emfe-w-color-primary, #D0046C);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.DepositTitle {
|
|
157
|
+
font-size: 26px;
|
|
158
|
+
color: var(--emfe-w-color-primary, #D0046C);
|
|
159
|
+
font-weight: 400;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.DepositTitleMobile {
|
|
163
|
+
font-size: 16px;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.DepositTitleNone {
|
|
167
|
+
display: none;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.DepositIframeWrapper {
|
|
171
|
+
iframe {
|
|
172
|
+
border: none;
|
|
173
|
+
width: 100%;
|
|
174
|
+
height: 85vh;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
</style>
|