@everymatrix/player-sms-verification 1.29.9 → 1.30.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.
- package/dist/cjs/player-sms-verification.cjs.entry.js +31 -13
- package/dist/collection/components/player-sms-verification/player-sms-verification.css +22 -1
- package/dist/collection/components/player-sms-verification/player-sms-verification.js +6 -3
- package/dist/collection/utils/utils.js +27 -9
- package/dist/components/player-sms-verification.js +31 -13
- package/dist/esm/player-sms-verification.entry.js +31 -13
- package/dist/player-sms-verification/p-7554f89f.entry.js +1 -0
- package/dist/player-sms-verification/player-sms-verification.esm.js +1 -1
- package/package.json +1 -1
- package/dist/player-sms-verification/p-3bfbf014.entry.js +0 -1
|
@@ -7,6 +7,8 @@ const index = require('./index-64b46357.js');
|
|
|
7
7
|
const DEFAULT_LANGUAGE = 'en';
|
|
8
8
|
const TRANSLATIONS = {
|
|
9
9
|
en: {
|
|
10
|
+
title: 'SMS Verification required',
|
|
11
|
+
subtitle: 'You need to verify your phone number',
|
|
10
12
|
btnSend: 'Send Code',
|
|
11
13
|
btnResend: 'Resend Code',
|
|
12
14
|
btnActivate: 'Activate',
|
|
@@ -14,10 +16,12 @@ const TRANSLATIONS = {
|
|
|
14
16
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
15
17
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
16
18
|
errInvalidCode: 'The code is incorrect',
|
|
17
|
-
errExceededAttempts: '
|
|
19
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
18
20
|
errExpiredToken: 'The code expired, resend code'
|
|
19
21
|
},
|
|
20
22
|
ro: {
|
|
23
|
+
title: 'SMS Verification required',
|
|
24
|
+
subtitle: 'You need to verify your phone number',
|
|
21
25
|
btnSend: 'Send Code',
|
|
22
26
|
btnResend: 'Resend Code',
|
|
23
27
|
btnActivate: 'Activate',
|
|
@@ -25,10 +29,12 @@ const TRANSLATIONS = {
|
|
|
25
29
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
26
30
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
27
31
|
errInvalidCode: 'The code is incorrect',
|
|
28
|
-
errExceededAttempts: '
|
|
32
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
29
33
|
errExpiredToken: 'The code expired, resend code'
|
|
30
34
|
},
|
|
31
35
|
fr: {
|
|
36
|
+
title: 'SMS Verification required',
|
|
37
|
+
subtitle: 'You need to verify your phone number',
|
|
32
38
|
btnSend: 'Send Code',
|
|
33
39
|
btnResend: 'Resend Code',
|
|
34
40
|
btnActivate: 'Activate',
|
|
@@ -36,10 +42,12 @@ const TRANSLATIONS = {
|
|
|
36
42
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
37
43
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
38
44
|
errInvalidCode: 'The code is incorrect',
|
|
39
|
-
errExceededAttempts: '
|
|
45
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
40
46
|
errExpiredToken: 'The code expired, resend code'
|
|
41
47
|
},
|
|
42
48
|
hu: {
|
|
49
|
+
title: 'SMS Verification required',
|
|
50
|
+
subtitle: 'You need to verify your phone number',
|
|
43
51
|
btnSend: 'Send Code',
|
|
44
52
|
btnResend: 'Resend Code',
|
|
45
53
|
btnActivate: 'Activate',
|
|
@@ -47,10 +55,12 @@ const TRANSLATIONS = {
|
|
|
47
55
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
48
56
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
49
57
|
errInvalidCode: 'The code is incorrect',
|
|
50
|
-
errExceededAttempts: '
|
|
58
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
51
59
|
errExpiredToken: 'The code expired, resend code'
|
|
52
60
|
},
|
|
53
61
|
tr: {
|
|
62
|
+
title: 'SMS Verification required',
|
|
63
|
+
subtitle: 'You need to verify your phone number',
|
|
54
64
|
btnSend: 'Send Code',
|
|
55
65
|
btnResend: 'Resend Code',
|
|
56
66
|
btnActivate: 'Activate',
|
|
@@ -58,10 +68,12 @@ const TRANSLATIONS = {
|
|
|
58
68
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
59
69
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
60
70
|
errInvalidCode: 'The code is incorrect',
|
|
61
|
-
errExceededAttempts: '
|
|
71
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
62
72
|
errExpiredToken: 'The code expired, resend code'
|
|
63
73
|
},
|
|
64
74
|
el: {
|
|
75
|
+
title: 'SMS Verification required',
|
|
76
|
+
subtitle: 'You need to verify your phone number',
|
|
65
77
|
btnSend: 'Send Code',
|
|
66
78
|
btnResend: 'Resend Code',
|
|
67
79
|
btnActivate: 'Activate',
|
|
@@ -69,10 +81,12 @@ const TRANSLATIONS = {
|
|
|
69
81
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
70
82
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
71
83
|
errInvalidCode: 'The code is incorrect',
|
|
72
|
-
errExceededAttempts: '
|
|
84
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
73
85
|
errExpiredToken: 'The code expired, resend code'
|
|
74
86
|
},
|
|
75
87
|
es: {
|
|
88
|
+
title: 'SMS Verification required',
|
|
89
|
+
subtitle: 'You need to verify your phone number',
|
|
76
90
|
btnSend: 'Send Code',
|
|
77
91
|
btnResend: 'Resend Code',
|
|
78
92
|
btnActivate: 'Activate',
|
|
@@ -80,10 +94,12 @@ const TRANSLATIONS = {
|
|
|
80
94
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
81
95
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
82
96
|
errInvalidCode: 'The code is incorrect',
|
|
83
|
-
errExceededAttempts: '
|
|
97
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
84
98
|
errExpiredToken: 'The code expired, resend code'
|
|
85
99
|
},
|
|
86
100
|
pt: {
|
|
101
|
+
title: 'SMS Verification required',
|
|
102
|
+
subtitle: 'You need to verify your phone number',
|
|
87
103
|
btnSend: 'Send Code',
|
|
88
104
|
btnResend: 'Resend Code',
|
|
89
105
|
btnActivate: 'Activate',
|
|
@@ -91,10 +107,12 @@ const TRANSLATIONS = {
|
|
|
91
107
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
92
108
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
93
109
|
errInvalidCode: 'The code is incorrect',
|
|
94
|
-
errExceededAttempts: '
|
|
110
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
95
111
|
errExpiredToken: 'The code expired, resend code'
|
|
96
112
|
},
|
|
97
113
|
hr: {
|
|
114
|
+
title: 'SMS Verification required',
|
|
115
|
+
subtitle: 'You need to verify your phone number',
|
|
98
116
|
btnSend: 'Send Code',
|
|
99
117
|
btnResend: 'Resend Code',
|
|
100
118
|
btnActivate: 'Activate',
|
|
@@ -102,7 +120,7 @@ const TRANSLATIONS = {
|
|
|
102
120
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
103
121
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
104
122
|
errInvalidCode: 'The code is incorrect',
|
|
105
|
-
errExceededAttempts: '
|
|
123
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
106
124
|
errExpiredToken: 'The code expired, resend code'
|
|
107
125
|
},
|
|
108
126
|
};
|
|
@@ -125,7 +143,7 @@ const translate = (key, customLang) => {
|
|
|
125
143
|
return TRANSLATIONS[lang !== undefined ? lang : DEFAULT_LANGUAGE][key];
|
|
126
144
|
};
|
|
127
145
|
|
|
128
|
-
const playerSmsVerificationCss = ":host{display:block}.PlayerSmsVerification{padding:30px;display:flex;align-items:center;flex-direction:column;background:var(--emfe-w-registration-color-bg, var(--emfe-w-color-gray-50, #F9F8F8))}.PlayerSmsVerificationContainer{position:relative;width:100%;display:flex;flex-direction:column;margin-bottom:
|
|
146
|
+
const playerSmsVerificationCss = ":host{display:block}.PlayerSmsVerification{padding:30px;display:flex;align-items:center;flex-direction:column;background:var(--emfe-w-registration-color-bg, var(--emfe-w-color-gray-50, #F9F8F8))}.PlayerSmsVerificationTitleContainer{position:relative;display:flex;flex-direction:column;width:100%;margin-bottom:60px}.PlayerSmsVerificationTitle{font-size:20px;font-weight:300;text-transform:uppercase;padding:0;margin:0}.PlayerSmsVerificationSubitle{font-size:14px}.PlayerSmsVerificationContainer{position:relative;width:100%;display:flex;flex-direction:column;margin-bottom:75px}.PlayerSmsVerificationButtonContainer{position:relative;width:100%;display:flex;flex-direction:column;gap:25px}.PlayerSmsVerificationButton{color:var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));background:var(--emfe-w-registration-color-primary, var(--emfe-w-color-primary, #D0046C));border:1px solid var(--emfe-w-registration-color-primary, var(--emfe-w-color-primary, #D0046C));border-radius:5px;width:100%;height:60px;padding:0;text-transform:uppercase;font-size:18px;cursor:pointer;font-family:inherit}.PlayerSmsVerificationButton:disabled{background:var(--emfe-w-color-gray-100, #E6E6E6);border:1px solid var(--emfe-w-color-gray-150, #828282);cursor:not-allowed}.PlayerSmsVerificationInput{color:var(--emfe-w-registration-contrast, var(--emfe-w-color-gray-300, #58586B));display:flex;flex-direction:column;position:relative;width:100%}.PlayerSmsVerificationInput input{width:100%;height:44px;border:1px solid var(--emfe-w-color-gray-100, #E6E6E6);border-radius:5px;box-sizing:border-box;padding:5px 15px;font-size:16px;text-align:center;line-height:18px;font-family:inherit}.PlayerSmsVerificationInput.Hidden{display:none}.PlayerSmsVerificationMsg{font-size:12px;color:var(--emfe-w-registration-contrast, var(--emfe-w-color-gray-300, #58586B))}.PlayerSmsVerificationMsg.Hidden{display:none}.PlayerSmsVerificationErrMsg{font-size:12px;color:var(--emfe-w-color-error, var(--emfe-w-color-red, #ed0909))}";
|
|
129
147
|
|
|
130
148
|
const PlayerSmsVerification = class {
|
|
131
149
|
constructor(hostRef) {
|
|
@@ -270,7 +288,7 @@ const PlayerSmsVerification = class {
|
|
|
270
288
|
else if (res.thirdPartyResponse) {
|
|
271
289
|
this.setErrMsg(res.thirdPartyResponse.message);
|
|
272
290
|
if (this.errMsg === 'errExceededAttempts') {
|
|
273
|
-
window.postMessage({ type: 'SmsVerificationErrExceededAttempts' }, window.location.href);
|
|
291
|
+
window.postMessage({ type: 'SmsVerificationErrExceededAttempts', data: translate(this.errMsg) }, window.location.href);
|
|
274
292
|
}
|
|
275
293
|
}
|
|
276
294
|
})
|
|
@@ -288,9 +306,9 @@ const PlayerSmsVerification = class {
|
|
|
288
306
|
this.code = event.target.value;
|
|
289
307
|
}
|
|
290
308
|
render() {
|
|
291
|
-
return index.h("div", { class: "PlayerSmsVerification", ref: el => this.stylingContainer = el }, index.h("div", { class: "PlayerSmsVerificationContainer" }, index.h("p", { class: "PlayerSmsVerificationMsg" + (this.msgEnterCode ? "" : "
|
|
309
|
+
return index.h("div", { class: "PlayerSmsVerification", ref: el => this.stylingContainer = el }, index.h("div", { class: "PlayerSmsVerificationTitleContainer" }, index.h("h4", { class: "PlayerSmsVerificationTitle" }, translate('title', this.lang)), index.h("p", { class: "PlayerSmsVerificationSubtitle" }, translate('subtitle', this.lang))), index.h("div", { class: "PlayerSmsVerificationContainer" }, index.h("p", { class: "PlayerSmsVerificationMsg" + (this.msgEnterCode ? "" : " Hidden") }, translate(this.msgEnterCode, this.lang)), index.h("div", { class: "PlayerSmsVerificationInput" }, index.h("input", { type: "text", onInput: (event) => this.handleInput(event), value: this.code })), this.errMsg
|
|
292
310
|
? index.h("p", { class: "PlayerSmsVerificationErrMsg" }, translate(this.errMsg, this.lang))
|
|
293
|
-
: index.h("p", { class: "PlayerSmsVerificationMsg" + (!this.isBtnSendAvailable && this.isCodeSentOnce ? "" : "
|
|
311
|
+
: index.h("p", { class: "PlayerSmsVerificationMsg" + (!this.isBtnSendAvailable && this.isCodeSentOnce ? "" : " Hidden") }, translate('msgResendNotice', this.lang))), index.h("div", { class: "PlayerSmsVerificationButtonContainer" }, index.h("button", { class: "PlayerSmsVerificationButton", onClick: this.debounce(this.handleSendCode.bind(this), 850), disabled: !this.isBtnSendAvailable }, this.isCodeSentOnce ? this.isBtnSendAvailable ? translate('btnResend', this.lang) : this.tempBtnResendCount : translate('btnSend', this.lang)), index.h("button", { class: "PlayerSmsVerificationButton", onClick: this.debounce(this.handleCheckCode.bind(this), 850), disabled: !this.isCodeSentOnce || this.code === '' || this.code === undefined }, translate('btnActivate', this.lang))));
|
|
294
312
|
}
|
|
295
313
|
static get watchers() { return {
|
|
296
314
|
"clientStyling": ["updateClientStyling"],
|
|
@@ -10,15 +10,36 @@
|
|
|
10
10
|
background: var(--emfe-w-registration-color-bg, var(--emfe-w-color-gray-50, #F9F8F8));
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
.PlayerSmsVerificationTitleContainer {
|
|
14
|
+
position: relative;
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
width: 100%;
|
|
18
|
+
margin-bottom: 60px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.PlayerSmsVerificationTitle {
|
|
22
|
+
font-size: 20px;
|
|
23
|
+
font-weight: 300;
|
|
24
|
+
text-transform: uppercase;
|
|
25
|
+
padding: 0;
|
|
26
|
+
margin: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.PlayerSmsVerificationSubitle {
|
|
30
|
+
font-size: 14px;
|
|
31
|
+
}
|
|
32
|
+
|
|
13
33
|
.PlayerSmsVerificationContainer {
|
|
14
34
|
position: relative;
|
|
15
35
|
width: 100%;
|
|
16
36
|
display: flex;
|
|
17
37
|
flex-direction: column;
|
|
18
|
-
margin-bottom:
|
|
38
|
+
margin-bottom: 75px;
|
|
19
39
|
}
|
|
20
40
|
|
|
21
41
|
.PlayerSmsVerificationButtonContainer {
|
|
42
|
+
position: relative;
|
|
22
43
|
width: 100%;
|
|
23
44
|
display: flex;
|
|
24
45
|
flex-direction: column;
|
|
@@ -142,7 +142,7 @@ export class PlayerSmsVerification {
|
|
|
142
142
|
else if (res.thirdPartyResponse) {
|
|
143
143
|
this.setErrMsg(res.thirdPartyResponse.message);
|
|
144
144
|
if (this.errMsg === 'errExceededAttempts') {
|
|
145
|
-
window.postMessage({ type: 'SmsVerificationErrExceededAttempts' }, window.location.href);
|
|
145
|
+
window.postMessage({ type: 'SmsVerificationErrExceededAttempts', data: translate(this.errMsg) }, window.location.href);
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
})
|
|
@@ -161,13 +161,16 @@ export class PlayerSmsVerification {
|
|
|
161
161
|
}
|
|
162
162
|
render() {
|
|
163
163
|
return h("div", { class: "PlayerSmsVerification", ref: el => this.stylingContainer = el },
|
|
164
|
+
h("div", { class: "PlayerSmsVerificationTitleContainer" },
|
|
165
|
+
h("h4", { class: "PlayerSmsVerificationTitle" }, translate('title', this.lang)),
|
|
166
|
+
h("p", { class: "PlayerSmsVerificationSubtitle" }, translate('subtitle', this.lang))),
|
|
164
167
|
h("div", { class: "PlayerSmsVerificationContainer" },
|
|
165
|
-
h("p", { class: "PlayerSmsVerificationMsg" + (this.msgEnterCode ? "" : "
|
|
168
|
+
h("p", { class: "PlayerSmsVerificationMsg" + (this.msgEnterCode ? "" : " Hidden") }, translate(this.msgEnterCode, this.lang)),
|
|
166
169
|
h("div", { class: "PlayerSmsVerificationInput" },
|
|
167
170
|
h("input", { type: "text", onInput: (event) => this.handleInput(event), value: this.code })),
|
|
168
171
|
this.errMsg
|
|
169
172
|
? h("p", { class: "PlayerSmsVerificationErrMsg" }, translate(this.errMsg, this.lang))
|
|
170
|
-
: h("p", { class: "PlayerSmsVerificationMsg" + (!this.isBtnSendAvailable && this.isCodeSentOnce ? "" : "
|
|
173
|
+
: h("p", { class: "PlayerSmsVerificationMsg" + (!this.isBtnSendAvailable && this.isCodeSentOnce ? "" : " Hidden") }, translate('msgResendNotice', this.lang))),
|
|
171
174
|
h("div", { class: "PlayerSmsVerificationButtonContainer" },
|
|
172
175
|
h("button", { class: "PlayerSmsVerificationButton", onClick: this.debounce(this.handleSendCode.bind(this), 850), disabled: !this.isBtnSendAvailable }, this.isCodeSentOnce ? this.isBtnSendAvailable ? translate('btnResend', this.lang) : this.tempBtnResendCount : translate('btnSend', this.lang)),
|
|
173
176
|
h("button", { class: "PlayerSmsVerificationButton", onClick: this.debounce(this.handleCheckCode.bind(this), 850), disabled: !this.isCodeSentOnce || this.code === '' || this.code === undefined }, translate('btnActivate', this.lang))));
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
const DEFAULT_LANGUAGE = 'en';
|
|
2
2
|
const TRANSLATIONS = {
|
|
3
3
|
en: {
|
|
4
|
+
title: 'SMS Verification required',
|
|
5
|
+
subtitle: 'You need to verify your phone number',
|
|
4
6
|
btnSend: 'Send Code',
|
|
5
7
|
btnResend: 'Resend Code',
|
|
6
8
|
btnActivate: 'Activate',
|
|
@@ -8,10 +10,12 @@ const TRANSLATIONS = {
|
|
|
8
10
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
9
11
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
10
12
|
errInvalidCode: 'The code is incorrect',
|
|
11
|
-
errExceededAttempts: '
|
|
13
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
12
14
|
errExpiredToken: 'The code expired, resend code'
|
|
13
15
|
},
|
|
14
16
|
ro: {
|
|
17
|
+
title: 'SMS Verification required',
|
|
18
|
+
subtitle: 'You need to verify your phone number',
|
|
15
19
|
btnSend: 'Send Code',
|
|
16
20
|
btnResend: 'Resend Code',
|
|
17
21
|
btnActivate: 'Activate',
|
|
@@ -19,10 +23,12 @@ const TRANSLATIONS = {
|
|
|
19
23
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
20
24
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
21
25
|
errInvalidCode: 'The code is incorrect',
|
|
22
|
-
errExceededAttempts: '
|
|
26
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
23
27
|
errExpiredToken: 'The code expired, resend code'
|
|
24
28
|
},
|
|
25
29
|
fr: {
|
|
30
|
+
title: 'SMS Verification required',
|
|
31
|
+
subtitle: 'You need to verify your phone number',
|
|
26
32
|
btnSend: 'Send Code',
|
|
27
33
|
btnResend: 'Resend Code',
|
|
28
34
|
btnActivate: 'Activate',
|
|
@@ -30,10 +36,12 @@ const TRANSLATIONS = {
|
|
|
30
36
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
31
37
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
32
38
|
errInvalidCode: 'The code is incorrect',
|
|
33
|
-
errExceededAttempts: '
|
|
39
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
34
40
|
errExpiredToken: 'The code expired, resend code'
|
|
35
41
|
},
|
|
36
42
|
hu: {
|
|
43
|
+
title: 'SMS Verification required',
|
|
44
|
+
subtitle: 'You need to verify your phone number',
|
|
37
45
|
btnSend: 'Send Code',
|
|
38
46
|
btnResend: 'Resend Code',
|
|
39
47
|
btnActivate: 'Activate',
|
|
@@ -41,10 +49,12 @@ const TRANSLATIONS = {
|
|
|
41
49
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
42
50
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
43
51
|
errInvalidCode: 'The code is incorrect',
|
|
44
|
-
errExceededAttempts: '
|
|
52
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
45
53
|
errExpiredToken: 'The code expired, resend code'
|
|
46
54
|
},
|
|
47
55
|
tr: {
|
|
56
|
+
title: 'SMS Verification required',
|
|
57
|
+
subtitle: 'You need to verify your phone number',
|
|
48
58
|
btnSend: 'Send Code',
|
|
49
59
|
btnResend: 'Resend Code',
|
|
50
60
|
btnActivate: 'Activate',
|
|
@@ -52,10 +62,12 @@ const TRANSLATIONS = {
|
|
|
52
62
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
53
63
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
54
64
|
errInvalidCode: 'The code is incorrect',
|
|
55
|
-
errExceededAttempts: '
|
|
65
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
56
66
|
errExpiredToken: 'The code expired, resend code'
|
|
57
67
|
},
|
|
58
68
|
el: {
|
|
69
|
+
title: 'SMS Verification required',
|
|
70
|
+
subtitle: 'You need to verify your phone number',
|
|
59
71
|
btnSend: 'Send Code',
|
|
60
72
|
btnResend: 'Resend Code',
|
|
61
73
|
btnActivate: 'Activate',
|
|
@@ -63,10 +75,12 @@ const TRANSLATIONS = {
|
|
|
63
75
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
64
76
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
65
77
|
errInvalidCode: 'The code is incorrect',
|
|
66
|
-
errExceededAttempts: '
|
|
78
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
67
79
|
errExpiredToken: 'The code expired, resend code'
|
|
68
80
|
},
|
|
69
81
|
es: {
|
|
82
|
+
title: 'SMS Verification required',
|
|
83
|
+
subtitle: 'You need to verify your phone number',
|
|
70
84
|
btnSend: 'Send Code',
|
|
71
85
|
btnResend: 'Resend Code',
|
|
72
86
|
btnActivate: 'Activate',
|
|
@@ -74,10 +88,12 @@ const TRANSLATIONS = {
|
|
|
74
88
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
75
89
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
76
90
|
errInvalidCode: 'The code is incorrect',
|
|
77
|
-
errExceededAttempts: '
|
|
91
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
78
92
|
errExpiredToken: 'The code expired, resend code'
|
|
79
93
|
},
|
|
80
94
|
pt: {
|
|
95
|
+
title: 'SMS Verification required',
|
|
96
|
+
subtitle: 'You need to verify your phone number',
|
|
81
97
|
btnSend: 'Send Code',
|
|
82
98
|
btnResend: 'Resend Code',
|
|
83
99
|
btnActivate: 'Activate',
|
|
@@ -85,10 +101,12 @@ const TRANSLATIONS = {
|
|
|
85
101
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
86
102
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
87
103
|
errInvalidCode: 'The code is incorrect',
|
|
88
|
-
errExceededAttempts: '
|
|
104
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
89
105
|
errExpiredToken: 'The code expired, resend code'
|
|
90
106
|
},
|
|
91
107
|
hr: {
|
|
108
|
+
title: 'SMS Verification required',
|
|
109
|
+
subtitle: 'You need to verify your phone number',
|
|
92
110
|
btnSend: 'Send Code',
|
|
93
111
|
btnResend: 'Resend Code',
|
|
94
112
|
btnActivate: 'Activate',
|
|
@@ -96,7 +114,7 @@ const TRANSLATIONS = {
|
|
|
96
114
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
97
115
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
98
116
|
errInvalidCode: 'The code is incorrect',
|
|
99
|
-
errExceededAttempts: '
|
|
117
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
100
118
|
errExpiredToken: 'The code expired, resend code'
|
|
101
119
|
},
|
|
102
120
|
};
|
|
@@ -3,6 +3,8 @@ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/clien
|
|
|
3
3
|
const DEFAULT_LANGUAGE = 'en';
|
|
4
4
|
const TRANSLATIONS = {
|
|
5
5
|
en: {
|
|
6
|
+
title: 'SMS Verification required',
|
|
7
|
+
subtitle: 'You need to verify your phone number',
|
|
6
8
|
btnSend: 'Send Code',
|
|
7
9
|
btnResend: 'Resend Code',
|
|
8
10
|
btnActivate: 'Activate',
|
|
@@ -10,10 +12,12 @@ const TRANSLATIONS = {
|
|
|
10
12
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
11
13
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
12
14
|
errInvalidCode: 'The code is incorrect',
|
|
13
|
-
errExceededAttempts: '
|
|
15
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
14
16
|
errExpiredToken: 'The code expired, resend code'
|
|
15
17
|
},
|
|
16
18
|
ro: {
|
|
19
|
+
title: 'SMS Verification required',
|
|
20
|
+
subtitle: 'You need to verify your phone number',
|
|
17
21
|
btnSend: 'Send Code',
|
|
18
22
|
btnResend: 'Resend Code',
|
|
19
23
|
btnActivate: 'Activate',
|
|
@@ -21,10 +25,12 @@ const TRANSLATIONS = {
|
|
|
21
25
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
22
26
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
23
27
|
errInvalidCode: 'The code is incorrect',
|
|
24
|
-
errExceededAttempts: '
|
|
28
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
25
29
|
errExpiredToken: 'The code expired, resend code'
|
|
26
30
|
},
|
|
27
31
|
fr: {
|
|
32
|
+
title: 'SMS Verification required',
|
|
33
|
+
subtitle: 'You need to verify your phone number',
|
|
28
34
|
btnSend: 'Send Code',
|
|
29
35
|
btnResend: 'Resend Code',
|
|
30
36
|
btnActivate: 'Activate',
|
|
@@ -32,10 +38,12 @@ const TRANSLATIONS = {
|
|
|
32
38
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
33
39
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
34
40
|
errInvalidCode: 'The code is incorrect',
|
|
35
|
-
errExceededAttempts: '
|
|
41
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
36
42
|
errExpiredToken: 'The code expired, resend code'
|
|
37
43
|
},
|
|
38
44
|
hu: {
|
|
45
|
+
title: 'SMS Verification required',
|
|
46
|
+
subtitle: 'You need to verify your phone number',
|
|
39
47
|
btnSend: 'Send Code',
|
|
40
48
|
btnResend: 'Resend Code',
|
|
41
49
|
btnActivate: 'Activate',
|
|
@@ -43,10 +51,12 @@ const TRANSLATIONS = {
|
|
|
43
51
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
44
52
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
45
53
|
errInvalidCode: 'The code is incorrect',
|
|
46
|
-
errExceededAttempts: '
|
|
54
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
47
55
|
errExpiredToken: 'The code expired, resend code'
|
|
48
56
|
},
|
|
49
57
|
tr: {
|
|
58
|
+
title: 'SMS Verification required',
|
|
59
|
+
subtitle: 'You need to verify your phone number',
|
|
50
60
|
btnSend: 'Send Code',
|
|
51
61
|
btnResend: 'Resend Code',
|
|
52
62
|
btnActivate: 'Activate',
|
|
@@ -54,10 +64,12 @@ const TRANSLATIONS = {
|
|
|
54
64
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
55
65
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
56
66
|
errInvalidCode: 'The code is incorrect',
|
|
57
|
-
errExceededAttempts: '
|
|
67
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
58
68
|
errExpiredToken: 'The code expired, resend code'
|
|
59
69
|
},
|
|
60
70
|
el: {
|
|
71
|
+
title: 'SMS Verification required',
|
|
72
|
+
subtitle: 'You need to verify your phone number',
|
|
61
73
|
btnSend: 'Send Code',
|
|
62
74
|
btnResend: 'Resend Code',
|
|
63
75
|
btnActivate: 'Activate',
|
|
@@ -65,10 +77,12 @@ const TRANSLATIONS = {
|
|
|
65
77
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
66
78
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
67
79
|
errInvalidCode: 'The code is incorrect',
|
|
68
|
-
errExceededAttempts: '
|
|
80
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
69
81
|
errExpiredToken: 'The code expired, resend code'
|
|
70
82
|
},
|
|
71
83
|
es: {
|
|
84
|
+
title: 'SMS Verification required',
|
|
85
|
+
subtitle: 'You need to verify your phone number',
|
|
72
86
|
btnSend: 'Send Code',
|
|
73
87
|
btnResend: 'Resend Code',
|
|
74
88
|
btnActivate: 'Activate',
|
|
@@ -76,10 +90,12 @@ const TRANSLATIONS = {
|
|
|
76
90
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
77
91
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
78
92
|
errInvalidCode: 'The code is incorrect',
|
|
79
|
-
errExceededAttempts: '
|
|
93
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
80
94
|
errExpiredToken: 'The code expired, resend code'
|
|
81
95
|
},
|
|
82
96
|
pt: {
|
|
97
|
+
title: 'SMS Verification required',
|
|
98
|
+
subtitle: 'You need to verify your phone number',
|
|
83
99
|
btnSend: 'Send Code',
|
|
84
100
|
btnResend: 'Resend Code',
|
|
85
101
|
btnActivate: 'Activate',
|
|
@@ -87,10 +103,12 @@ const TRANSLATIONS = {
|
|
|
87
103
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
88
104
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
89
105
|
errInvalidCode: 'The code is incorrect',
|
|
90
|
-
errExceededAttempts: '
|
|
106
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
91
107
|
errExpiredToken: 'The code expired, resend code'
|
|
92
108
|
},
|
|
93
109
|
hr: {
|
|
110
|
+
title: 'SMS Verification required',
|
|
111
|
+
subtitle: 'You need to verify your phone number',
|
|
94
112
|
btnSend: 'Send Code',
|
|
95
113
|
btnResend: 'Resend Code',
|
|
96
114
|
btnActivate: 'Activate',
|
|
@@ -98,7 +116,7 @@ const TRANSLATIONS = {
|
|
|
98
116
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
99
117
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
100
118
|
errInvalidCode: 'The code is incorrect',
|
|
101
|
-
errExceededAttempts: '
|
|
119
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
102
120
|
errExpiredToken: 'The code expired, resend code'
|
|
103
121
|
},
|
|
104
122
|
};
|
|
@@ -121,7 +139,7 @@ const translate = (key, customLang) => {
|
|
|
121
139
|
return TRANSLATIONS[lang !== undefined ? lang : DEFAULT_LANGUAGE][key];
|
|
122
140
|
};
|
|
123
141
|
|
|
124
|
-
const playerSmsVerificationCss = ":host{display:block}.PlayerSmsVerification{padding:30px;display:flex;align-items:center;flex-direction:column;background:var(--emfe-w-registration-color-bg, var(--emfe-w-color-gray-50, #F9F8F8))}.PlayerSmsVerificationContainer{position:relative;width:100%;display:flex;flex-direction:column;margin-bottom:
|
|
142
|
+
const playerSmsVerificationCss = ":host{display:block}.PlayerSmsVerification{padding:30px;display:flex;align-items:center;flex-direction:column;background:var(--emfe-w-registration-color-bg, var(--emfe-w-color-gray-50, #F9F8F8))}.PlayerSmsVerificationTitleContainer{position:relative;display:flex;flex-direction:column;width:100%;margin-bottom:60px}.PlayerSmsVerificationTitle{font-size:20px;font-weight:300;text-transform:uppercase;padding:0;margin:0}.PlayerSmsVerificationSubitle{font-size:14px}.PlayerSmsVerificationContainer{position:relative;width:100%;display:flex;flex-direction:column;margin-bottom:75px}.PlayerSmsVerificationButtonContainer{position:relative;width:100%;display:flex;flex-direction:column;gap:25px}.PlayerSmsVerificationButton{color:var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));background:var(--emfe-w-registration-color-primary, var(--emfe-w-color-primary, #D0046C));border:1px solid var(--emfe-w-registration-color-primary, var(--emfe-w-color-primary, #D0046C));border-radius:5px;width:100%;height:60px;padding:0;text-transform:uppercase;font-size:18px;cursor:pointer;font-family:inherit}.PlayerSmsVerificationButton:disabled{background:var(--emfe-w-color-gray-100, #E6E6E6);border:1px solid var(--emfe-w-color-gray-150, #828282);cursor:not-allowed}.PlayerSmsVerificationInput{color:var(--emfe-w-registration-contrast, var(--emfe-w-color-gray-300, #58586B));display:flex;flex-direction:column;position:relative;width:100%}.PlayerSmsVerificationInput input{width:100%;height:44px;border:1px solid var(--emfe-w-color-gray-100, #E6E6E6);border-radius:5px;box-sizing:border-box;padding:5px 15px;font-size:16px;text-align:center;line-height:18px;font-family:inherit}.PlayerSmsVerificationInput.Hidden{display:none}.PlayerSmsVerificationMsg{font-size:12px;color:var(--emfe-w-registration-contrast, var(--emfe-w-color-gray-300, #58586B))}.PlayerSmsVerificationMsg.Hidden{display:none}.PlayerSmsVerificationErrMsg{font-size:12px;color:var(--emfe-w-color-error, var(--emfe-w-color-red, #ed0909))}";
|
|
125
143
|
|
|
126
144
|
const PlayerSmsVerification$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
127
145
|
constructor() {
|
|
@@ -268,7 +286,7 @@ const PlayerSmsVerification$1 = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
268
286
|
else if (res.thirdPartyResponse) {
|
|
269
287
|
this.setErrMsg(res.thirdPartyResponse.message);
|
|
270
288
|
if (this.errMsg === 'errExceededAttempts') {
|
|
271
|
-
window.postMessage({ type: 'SmsVerificationErrExceededAttempts' }, window.location.href);
|
|
289
|
+
window.postMessage({ type: 'SmsVerificationErrExceededAttempts', data: translate(this.errMsg) }, window.location.href);
|
|
272
290
|
}
|
|
273
291
|
}
|
|
274
292
|
})
|
|
@@ -286,9 +304,9 @@ const PlayerSmsVerification$1 = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
286
304
|
this.code = event.target.value;
|
|
287
305
|
}
|
|
288
306
|
render() {
|
|
289
|
-
return h("div", { class: "PlayerSmsVerification", ref: el => this.stylingContainer = el }, h("div", { class: "PlayerSmsVerificationContainer" }, h("p", { class: "PlayerSmsVerificationMsg" + (this.msgEnterCode ? "" : "
|
|
307
|
+
return h("div", { class: "PlayerSmsVerification", ref: el => this.stylingContainer = el }, h("div", { class: "PlayerSmsVerificationTitleContainer" }, h("h4", { class: "PlayerSmsVerificationTitle" }, translate('title', this.lang)), h("p", { class: "PlayerSmsVerificationSubtitle" }, translate('subtitle', this.lang))), h("div", { class: "PlayerSmsVerificationContainer" }, h("p", { class: "PlayerSmsVerificationMsg" + (this.msgEnterCode ? "" : " Hidden") }, translate(this.msgEnterCode, this.lang)), h("div", { class: "PlayerSmsVerificationInput" }, h("input", { type: "text", onInput: (event) => this.handleInput(event), value: this.code })), this.errMsg
|
|
290
308
|
? h("p", { class: "PlayerSmsVerificationErrMsg" }, translate(this.errMsg, this.lang))
|
|
291
|
-
: h("p", { class: "PlayerSmsVerificationMsg" + (!this.isBtnSendAvailable && this.isCodeSentOnce ? "" : "
|
|
309
|
+
: h("p", { class: "PlayerSmsVerificationMsg" + (!this.isBtnSendAvailable && this.isCodeSentOnce ? "" : " Hidden") }, translate('msgResendNotice', this.lang))), h("div", { class: "PlayerSmsVerificationButtonContainer" }, h("button", { class: "PlayerSmsVerificationButton", onClick: this.debounce(this.handleSendCode.bind(this), 850), disabled: !this.isBtnSendAvailable }, this.isCodeSentOnce ? this.isBtnSendAvailable ? translate('btnResend', this.lang) : this.tempBtnResendCount : translate('btnSend', this.lang)), h("button", { class: "PlayerSmsVerificationButton", onClick: this.debounce(this.handleCheckCode.bind(this), 850), disabled: !this.isCodeSentOnce || this.code === '' || this.code === undefined }, translate('btnActivate', this.lang))));
|
|
292
310
|
}
|
|
293
311
|
static get watchers() { return {
|
|
294
312
|
"clientStyling": ["updateClientStyling"],
|
|
@@ -3,6 +3,8 @@ import { r as registerInstance, h } from './index-87b20f11.js';
|
|
|
3
3
|
const DEFAULT_LANGUAGE = 'en';
|
|
4
4
|
const TRANSLATIONS = {
|
|
5
5
|
en: {
|
|
6
|
+
title: 'SMS Verification required',
|
|
7
|
+
subtitle: 'You need to verify your phone number',
|
|
6
8
|
btnSend: 'Send Code',
|
|
7
9
|
btnResend: 'Resend Code',
|
|
8
10
|
btnActivate: 'Activate',
|
|
@@ -10,10 +12,12 @@ const TRANSLATIONS = {
|
|
|
10
12
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
11
13
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
12
14
|
errInvalidCode: 'The code is incorrect',
|
|
13
|
-
errExceededAttempts: '
|
|
15
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
14
16
|
errExpiredToken: 'The code expired, resend code'
|
|
15
17
|
},
|
|
16
18
|
ro: {
|
|
19
|
+
title: 'SMS Verification required',
|
|
20
|
+
subtitle: 'You need to verify your phone number',
|
|
17
21
|
btnSend: 'Send Code',
|
|
18
22
|
btnResend: 'Resend Code',
|
|
19
23
|
btnActivate: 'Activate',
|
|
@@ -21,10 +25,12 @@ const TRANSLATIONS = {
|
|
|
21
25
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
22
26
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
23
27
|
errInvalidCode: 'The code is incorrect',
|
|
24
|
-
errExceededAttempts: '
|
|
28
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
25
29
|
errExpiredToken: 'The code expired, resend code'
|
|
26
30
|
},
|
|
27
31
|
fr: {
|
|
32
|
+
title: 'SMS Verification required',
|
|
33
|
+
subtitle: 'You need to verify your phone number',
|
|
28
34
|
btnSend: 'Send Code',
|
|
29
35
|
btnResend: 'Resend Code',
|
|
30
36
|
btnActivate: 'Activate',
|
|
@@ -32,10 +38,12 @@ const TRANSLATIONS = {
|
|
|
32
38
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
33
39
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
34
40
|
errInvalidCode: 'The code is incorrect',
|
|
35
|
-
errExceededAttempts: '
|
|
41
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
36
42
|
errExpiredToken: 'The code expired, resend code'
|
|
37
43
|
},
|
|
38
44
|
hu: {
|
|
45
|
+
title: 'SMS Verification required',
|
|
46
|
+
subtitle: 'You need to verify your phone number',
|
|
39
47
|
btnSend: 'Send Code',
|
|
40
48
|
btnResend: 'Resend Code',
|
|
41
49
|
btnActivate: 'Activate',
|
|
@@ -43,10 +51,12 @@ const TRANSLATIONS = {
|
|
|
43
51
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
44
52
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
45
53
|
errInvalidCode: 'The code is incorrect',
|
|
46
|
-
errExceededAttempts: '
|
|
54
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
47
55
|
errExpiredToken: 'The code expired, resend code'
|
|
48
56
|
},
|
|
49
57
|
tr: {
|
|
58
|
+
title: 'SMS Verification required',
|
|
59
|
+
subtitle: 'You need to verify your phone number',
|
|
50
60
|
btnSend: 'Send Code',
|
|
51
61
|
btnResend: 'Resend Code',
|
|
52
62
|
btnActivate: 'Activate',
|
|
@@ -54,10 +64,12 @@ const TRANSLATIONS = {
|
|
|
54
64
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
55
65
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
56
66
|
errInvalidCode: 'The code is incorrect',
|
|
57
|
-
errExceededAttempts: '
|
|
67
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
58
68
|
errExpiredToken: 'The code expired, resend code'
|
|
59
69
|
},
|
|
60
70
|
el: {
|
|
71
|
+
title: 'SMS Verification required',
|
|
72
|
+
subtitle: 'You need to verify your phone number',
|
|
61
73
|
btnSend: 'Send Code',
|
|
62
74
|
btnResend: 'Resend Code',
|
|
63
75
|
btnActivate: 'Activate',
|
|
@@ -65,10 +77,12 @@ const TRANSLATIONS = {
|
|
|
65
77
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
66
78
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
67
79
|
errInvalidCode: 'The code is incorrect',
|
|
68
|
-
errExceededAttempts: '
|
|
80
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
69
81
|
errExpiredToken: 'The code expired, resend code'
|
|
70
82
|
},
|
|
71
83
|
es: {
|
|
84
|
+
title: 'SMS Verification required',
|
|
85
|
+
subtitle: 'You need to verify your phone number',
|
|
72
86
|
btnSend: 'Send Code',
|
|
73
87
|
btnResend: 'Resend Code',
|
|
74
88
|
btnActivate: 'Activate',
|
|
@@ -76,10 +90,12 @@ const TRANSLATIONS = {
|
|
|
76
90
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
77
91
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
78
92
|
errInvalidCode: 'The code is incorrect',
|
|
79
|
-
errExceededAttempts: '
|
|
93
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
80
94
|
errExpiredToken: 'The code expired, resend code'
|
|
81
95
|
},
|
|
82
96
|
pt: {
|
|
97
|
+
title: 'SMS Verification required',
|
|
98
|
+
subtitle: 'You need to verify your phone number',
|
|
83
99
|
btnSend: 'Send Code',
|
|
84
100
|
btnResend: 'Resend Code',
|
|
85
101
|
btnActivate: 'Activate',
|
|
@@ -87,10 +103,12 @@ const TRANSLATIONS = {
|
|
|
87
103
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
88
104
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
89
105
|
errInvalidCode: 'The code is incorrect',
|
|
90
|
-
errExceededAttempts: '
|
|
106
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
91
107
|
errExpiredToken: 'The code expired, resend code'
|
|
92
108
|
},
|
|
93
109
|
hr: {
|
|
110
|
+
title: 'SMS Verification required',
|
|
111
|
+
subtitle: 'You need to verify your phone number',
|
|
94
112
|
btnSend: 'Send Code',
|
|
95
113
|
btnResend: 'Resend Code',
|
|
96
114
|
btnActivate: 'Activate',
|
|
@@ -98,7 +116,7 @@ const TRANSLATIONS = {
|
|
|
98
116
|
msgResendNotice: 'A new verification code has been sent to your phone number',
|
|
99
117
|
errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
|
|
100
118
|
errInvalidCode: 'The code is incorrect',
|
|
101
|
-
errExceededAttempts: '
|
|
119
|
+
errExceededAttempts: 'Too many attempts. Try again later',
|
|
102
120
|
errExpiredToken: 'The code expired, resend code'
|
|
103
121
|
},
|
|
104
122
|
};
|
|
@@ -121,7 +139,7 @@ const translate = (key, customLang) => {
|
|
|
121
139
|
return TRANSLATIONS[lang !== undefined ? lang : DEFAULT_LANGUAGE][key];
|
|
122
140
|
};
|
|
123
141
|
|
|
124
|
-
const playerSmsVerificationCss = ":host{display:block}.PlayerSmsVerification{padding:30px;display:flex;align-items:center;flex-direction:column;background:var(--emfe-w-registration-color-bg, var(--emfe-w-color-gray-50, #F9F8F8))}.PlayerSmsVerificationContainer{position:relative;width:100%;display:flex;flex-direction:column;margin-bottom:
|
|
142
|
+
const playerSmsVerificationCss = ":host{display:block}.PlayerSmsVerification{padding:30px;display:flex;align-items:center;flex-direction:column;background:var(--emfe-w-registration-color-bg, var(--emfe-w-color-gray-50, #F9F8F8))}.PlayerSmsVerificationTitleContainer{position:relative;display:flex;flex-direction:column;width:100%;margin-bottom:60px}.PlayerSmsVerificationTitle{font-size:20px;font-weight:300;text-transform:uppercase;padding:0;margin:0}.PlayerSmsVerificationSubitle{font-size:14px}.PlayerSmsVerificationContainer{position:relative;width:100%;display:flex;flex-direction:column;margin-bottom:75px}.PlayerSmsVerificationButtonContainer{position:relative;width:100%;display:flex;flex-direction:column;gap:25px}.PlayerSmsVerificationButton{color:var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));background:var(--emfe-w-registration-color-primary, var(--emfe-w-color-primary, #D0046C));border:1px solid var(--emfe-w-registration-color-primary, var(--emfe-w-color-primary, #D0046C));border-radius:5px;width:100%;height:60px;padding:0;text-transform:uppercase;font-size:18px;cursor:pointer;font-family:inherit}.PlayerSmsVerificationButton:disabled{background:var(--emfe-w-color-gray-100, #E6E6E6);border:1px solid var(--emfe-w-color-gray-150, #828282);cursor:not-allowed}.PlayerSmsVerificationInput{color:var(--emfe-w-registration-contrast, var(--emfe-w-color-gray-300, #58586B));display:flex;flex-direction:column;position:relative;width:100%}.PlayerSmsVerificationInput input{width:100%;height:44px;border:1px solid var(--emfe-w-color-gray-100, #E6E6E6);border-radius:5px;box-sizing:border-box;padding:5px 15px;font-size:16px;text-align:center;line-height:18px;font-family:inherit}.PlayerSmsVerificationInput.Hidden{display:none}.PlayerSmsVerificationMsg{font-size:12px;color:var(--emfe-w-registration-contrast, var(--emfe-w-color-gray-300, #58586B))}.PlayerSmsVerificationMsg.Hidden{display:none}.PlayerSmsVerificationErrMsg{font-size:12px;color:var(--emfe-w-color-error, var(--emfe-w-color-red, #ed0909))}";
|
|
125
143
|
|
|
126
144
|
const PlayerSmsVerification = class {
|
|
127
145
|
constructor(hostRef) {
|
|
@@ -266,7 +284,7 @@ const PlayerSmsVerification = class {
|
|
|
266
284
|
else if (res.thirdPartyResponse) {
|
|
267
285
|
this.setErrMsg(res.thirdPartyResponse.message);
|
|
268
286
|
if (this.errMsg === 'errExceededAttempts') {
|
|
269
|
-
window.postMessage({ type: 'SmsVerificationErrExceededAttempts' }, window.location.href);
|
|
287
|
+
window.postMessage({ type: 'SmsVerificationErrExceededAttempts', data: translate(this.errMsg) }, window.location.href);
|
|
270
288
|
}
|
|
271
289
|
}
|
|
272
290
|
})
|
|
@@ -284,9 +302,9 @@ const PlayerSmsVerification = class {
|
|
|
284
302
|
this.code = event.target.value;
|
|
285
303
|
}
|
|
286
304
|
render() {
|
|
287
|
-
return h("div", { class: "PlayerSmsVerification", ref: el => this.stylingContainer = el }, h("div", { class: "PlayerSmsVerificationContainer" }, h("p", { class: "PlayerSmsVerificationMsg" + (this.msgEnterCode ? "" : "
|
|
305
|
+
return h("div", { class: "PlayerSmsVerification", ref: el => this.stylingContainer = el }, h("div", { class: "PlayerSmsVerificationTitleContainer" }, h("h4", { class: "PlayerSmsVerificationTitle" }, translate('title', this.lang)), h("p", { class: "PlayerSmsVerificationSubtitle" }, translate('subtitle', this.lang))), h("div", { class: "PlayerSmsVerificationContainer" }, h("p", { class: "PlayerSmsVerificationMsg" + (this.msgEnterCode ? "" : " Hidden") }, translate(this.msgEnterCode, this.lang)), h("div", { class: "PlayerSmsVerificationInput" }, h("input", { type: "text", onInput: (event) => this.handleInput(event), value: this.code })), this.errMsg
|
|
288
306
|
? h("p", { class: "PlayerSmsVerificationErrMsg" }, translate(this.errMsg, this.lang))
|
|
289
|
-
: h("p", { class: "PlayerSmsVerificationMsg" + (!this.isBtnSendAvailable && this.isCodeSentOnce ? "" : "
|
|
307
|
+
: h("p", { class: "PlayerSmsVerificationMsg" + (!this.isBtnSendAvailable && this.isCodeSentOnce ? "" : " Hidden") }, translate('msgResendNotice', this.lang))), h("div", { class: "PlayerSmsVerificationButtonContainer" }, h("button", { class: "PlayerSmsVerificationButton", onClick: this.debounce(this.handleSendCode.bind(this), 850), disabled: !this.isBtnSendAvailable }, this.isCodeSentOnce ? this.isBtnSendAvailable ? translate('btnResend', this.lang) : this.tempBtnResendCount : translate('btnSend', this.lang)), h("button", { class: "PlayerSmsVerificationButton", onClick: this.debounce(this.handleCheckCode.bind(this), 850), disabled: !this.isCodeSentOnce || this.code === '' || this.code === undefined }, translate('btnActivate', this.lang))));
|
|
290
308
|
}
|
|
291
309
|
static get watchers() { return {
|
|
292
310
|
"clientStyling": ["updateClientStyling"],
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,h as t}from"./p-616d438d.js";const r={en:{title:"SMS Verification required",subtitle:"You need to verify your phone number",btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"Too many attempts. Try again later",errExpiredToken:"The code expired, resend code"},ro:{title:"SMS Verification required",subtitle:"You need to verify your phone number",btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"Too many attempts. Try again later",errExpiredToken:"The code expired, resend code"},fr:{title:"SMS Verification required",subtitle:"You need to verify your phone number",btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"Too many attempts. Try again later",errExpiredToken:"The code expired, resend code"},hu:{title:"SMS Verification required",subtitle:"You need to verify your phone number",btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"Too many attempts. Try again later",errExpiredToken:"The code expired, resend code"},tr:{title:"SMS Verification required",subtitle:"You need to verify your phone number",btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"Too many attempts. Try again later",errExpiredToken:"The code expired, resend code"},el:{title:"SMS Verification required",subtitle:"You need to verify your phone number",btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"Too many attempts. Try again later",errExpiredToken:"The code expired, resend code"},es:{title:"SMS Verification required",subtitle:"You need to verify your phone number",btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"Too many attempts. Try again later",errExpiredToken:"The code expired, resend code"},pt:{title:"SMS Verification required",subtitle:"You need to verify your phone number",btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"Too many attempts. Try again later",errExpiredToken:"The code expired, resend code"},hr:{title:"SMS Verification required",subtitle:"You need to verify your phone number",btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"Too many attempts. Try again later",errExpiredToken:"The code expired, resend code"}},i=(e,t)=>r[void 0!==t?t:"en"][e],n=class{constructor(t){e(this,t),this.lang="en",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.code="",this.errMsg="",this.msgEnterCode="",this.btnResendCount=60,this.isCodeSentOnce=!1,this.isBtnSendAvailable=!0,this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.stylingContainer.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.stylingContainer.prepend(t)}),1)})).catch((e=>{console.log("error ",e)}))}}updateClientStyling(){this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL()}componentWillLoad(){if(this.translationUrl)return e=this.translationUrl,new Promise((t=>{fetch(e).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{for(let i in e[t])r[t][i]=e[t][i]})),t(!0)}))}));var e;this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL()}startTimerBtnResendCode(){this.isBtnSendAvailable=!1,this.tempBtnResendCount=this.btnResendCount,this.btnResendTimer=setInterval((()=>{this.tempBtnResendCount--,this.tempBtnResendCount<0&&(clearInterval(this.btnResendTimer),this.isBtnSendAvailable=!0)}),1e3)}setErrMsg(e){"INVALID_CODE"===e?this.errMsg="errInvalidCode":"BLOCK_USER_INCORRECT_CODE"===e?this.errMsg="errExceededAttempts":"ExpiredToken"===e?this.errMsg="errExpiredToken":"errGenerateCode"===e&&(this.errMsg="errGenerateCode")}debounce(e,t){return function(...r){clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout((()=>{e.apply(this,r)}),t)}}handleSendCode(){this.errMsg="";let e=new URL(`${this.endpoint}/v1/player/legislation/generate2FACode`);const t={method:"POST",headers:{accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({userId:`${this.userId}`})};fetch(e.href,t).then((()=>{this.msgEnterCode="msgEnterCode",this.isCodeSentOnce&&this.startTimerBtnResendCode(),this.isCodeSentOnce=!0})).catch((e=>{this.setErrMsg("errGenerateCode"),window.postMessage({type:"WidgetNotification",data:{type:"error",message:e}},window.location.href)}))}handleCheckCode(){let e=new URL(`${this.endpoint}/v1/player/legislation/generate2FACode`);e.searchParams.append("userId",this.userId),e.searchParams.append("code",this.code),fetch(e.href,{method:"GET",headers:{accept:"application/json"}}).then((e=>e.json())).then((e=>{200===e.httpStatusCode?(this.errMsg="",window.postMessage({type:"SmsVerificationSuccess"},window.location.href)):e.thirdPartyResponse&&(this.setErrMsg(e.thirdPartyResponse.message),"errExceededAttempts"===this.errMsg&&window.postMessage({type:"SmsVerificationErrExceededAttempts",data:i(this.errMsg)},window.location.href))})).catch((e=>{window.postMessage({type:"WidgetNotification",data:{type:"error",message:e}},window.location.href)})).finally((()=>{this.code=""}))}handleInput(e){this.code=e.target.value}render(){return t("div",{class:"PlayerSmsVerification",ref:e=>this.stylingContainer=e},t("div",{class:"PlayerSmsVerificationTitleContainer"},t("h4",{class:"PlayerSmsVerificationTitle"},i("title",this.lang)),t("p",{class:"PlayerSmsVerificationSubtitle"},i("subtitle",this.lang))),t("div",{class:"PlayerSmsVerificationContainer"},t("p",{class:"PlayerSmsVerificationMsg"+(this.msgEnterCode?"":" Hidden")},i(this.msgEnterCode,this.lang)),t("div",{class:"PlayerSmsVerificationInput"},t("input",{type:"text",onInput:e=>this.handleInput(e),value:this.code})),this.errMsg?t("p",{class:"PlayerSmsVerificationErrMsg"},i(this.errMsg,this.lang)):t("p",{class:"PlayerSmsVerificationMsg"+(!this.isBtnSendAvailable&&this.isCodeSentOnce?"":" Hidden")},i("msgResendNotice",this.lang))),t("div",{class:"PlayerSmsVerificationButtonContainer"},t("button",{class:"PlayerSmsVerificationButton",onClick:this.debounce(this.handleSendCode.bind(this),850),disabled:!this.isBtnSendAvailable},this.isCodeSentOnce?this.isBtnSendAvailable?i("btnResend",this.lang):this.tempBtnResendCount:i("btnSend",this.lang)),t("button",{class:"PlayerSmsVerificationButton",onClick:this.debounce(this.handleCheckCode.bind(this),850),disabled:!this.isCodeSentOnce||""===this.code||void 0===this.code},i("btnActivate",this.lang))))}static get watchers(){return{clientStyling:["updateClientStyling"],clientStylingUrl:["updateClientStyling"]}}};n.style=":host{display:block}.PlayerSmsVerification{padding:30px;display:flex;align-items:center;flex-direction:column;background:var(--emfe-w-registration-color-bg, var(--emfe-w-color-gray-50, #F9F8F8))}.PlayerSmsVerificationTitleContainer{position:relative;display:flex;flex-direction:column;width:100%;margin-bottom:60px}.PlayerSmsVerificationTitle{font-size:20px;font-weight:300;text-transform:uppercase;padding:0;margin:0}.PlayerSmsVerificationSubitle{font-size:14px}.PlayerSmsVerificationContainer{position:relative;width:100%;display:flex;flex-direction:column;margin-bottom:75px}.PlayerSmsVerificationButtonContainer{position:relative;width:100%;display:flex;flex-direction:column;gap:25px}.PlayerSmsVerificationButton{color:var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));background:var(--emfe-w-registration-color-primary, var(--emfe-w-color-primary, #D0046C));border:1px solid var(--emfe-w-registration-color-primary, var(--emfe-w-color-primary, #D0046C));border-radius:5px;width:100%;height:60px;padding:0;text-transform:uppercase;font-size:18px;cursor:pointer;font-family:inherit}.PlayerSmsVerificationButton:disabled{background:var(--emfe-w-color-gray-100, #E6E6E6);border:1px solid var(--emfe-w-color-gray-150, #828282);cursor:not-allowed}.PlayerSmsVerificationInput{color:var(--emfe-w-registration-contrast, var(--emfe-w-color-gray-300, #58586B));display:flex;flex-direction:column;position:relative;width:100%}.PlayerSmsVerificationInput input{width:100%;height:44px;border:1px solid var(--emfe-w-color-gray-100, #E6E6E6);border-radius:5px;box-sizing:border-box;padding:5px 15px;font-size:16px;text-align:center;line-height:18px;font-family:inherit}.PlayerSmsVerificationInput.Hidden{display:none}.PlayerSmsVerificationMsg{font-size:12px;color:var(--emfe-w-registration-contrast, var(--emfe-w-color-gray-300, #58586B))}.PlayerSmsVerificationMsg.Hidden{display:none}.PlayerSmsVerificationErrMsg{font-size:12px;color:var(--emfe-w-color-error, var(--emfe-w-color-red, #ed0909))}";export{n as player_sms_verification}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as n,b as t}from"./p-616d438d.js";(()=>{const t=import.meta.url,e={};return""!==t&&(e.resourcesUrl=new URL(".",t).href),n(e)})().then((n=>t([["p-
|
|
1
|
+
import{p as n,b as t}from"./p-616d438d.js";(()=>{const t=import.meta.url,e={};return""!==t&&(e.resourcesUrl=new URL(".",t).href),n(e)})().then((n=>t([["p-7554f89f",[[1,"player-sms-verification",{endpoint:[513],userId:[513,"user-id"],lang:[513],clientStyling:[1537,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],tempBtnResendCount:[32],code:[32],errMsg:[32],msgEnterCode:[32]}]]]],n)));
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,h as t}from"./p-616d438d.js";const r={en:{btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"You have exceeded the maximum number of tries. Please try again later",errExpiredToken:"The code expired, resend code"},ro:{btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"You have exceeded the maximum number of tries. Please try again later",errExpiredToken:"The code expired, resend code"},fr:{btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"You have exceeded the maximum number of tries. Please try again later",errExpiredToken:"The code expired, resend code"},hu:{btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"You have exceeded the maximum number of tries. Please try again later",errExpiredToken:"The code expired, resend code"},tr:{btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"You have exceeded the maximum number of tries. Please try again later",errExpiredToken:"The code expired, resend code"},el:{btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"You have exceeded the maximum number of tries. Please try again later",errExpiredToken:"The code expired, resend code"},es:{btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"You have exceeded the maximum number of tries. Please try again later",errExpiredToken:"The code expired, resend code"},pt:{btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"You have exceeded the maximum number of tries. Please try again later",errExpiredToken:"The code expired, resend code"},hr:{btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"You have exceeded the maximum number of tries. Please try again later",errExpiredToken:"The code expired, resend code"}},i=(e,t)=>r[void 0!==t?t:"en"][e],n=class{constructor(t){e(this,t),this.lang="en",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.code="",this.errMsg="",this.msgEnterCode="",this.btnResendCount=60,this.isCodeSentOnce=!1,this.isBtnSendAvailable=!0,this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.stylingContainer.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.stylingContainer.prepend(t)}),1)})).catch((e=>{console.log("error ",e)}))}}updateClientStyling(){this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL()}componentWillLoad(){if(this.translationUrl)return e=this.translationUrl,new Promise((t=>{fetch(e).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{for(let i in e[t])r[t][i]=e[t][i]})),t(!0)}))}));var e;this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL()}startTimerBtnResendCode(){this.isBtnSendAvailable=!1,this.tempBtnResendCount=this.btnResendCount,this.btnResendTimer=setInterval((()=>{this.tempBtnResendCount--,this.tempBtnResendCount<0&&(clearInterval(this.btnResendTimer),this.isBtnSendAvailable=!0)}),1e3)}setErrMsg(e){"INVALID_CODE"===e?this.errMsg="errInvalidCode":"BLOCK_USER_INCORRECT_CODE"===e?this.errMsg="errExceededAttempts":"ExpiredToken"===e?this.errMsg="errExpiredToken":"errGenerateCode"===e&&(this.errMsg="errGenerateCode")}debounce(e,t){return function(...r){clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout((()=>{e.apply(this,r)}),t)}}handleSendCode(){this.errMsg="";let e=new URL(`${this.endpoint}/v1/player/legislation/generate2FACode`);const t={method:"POST",headers:{accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({userId:`${this.userId}`})};fetch(e.href,t).then((()=>{this.msgEnterCode="msgEnterCode",this.isCodeSentOnce&&this.startTimerBtnResendCode(),this.isCodeSentOnce=!0})).catch((e=>{this.setErrMsg("errGenerateCode"),window.postMessage({type:"WidgetNotification",data:{type:"error",message:e}},window.location.href)}))}handleCheckCode(){let e=new URL(`${this.endpoint}/v1/player/legislation/generate2FACode`);e.searchParams.append("userId",this.userId),e.searchParams.append("code",this.code),fetch(e.href,{method:"GET",headers:{accept:"application/json"}}).then((e=>e.json())).then((e=>{200===e.httpStatusCode?(this.errMsg="",window.postMessage({type:"SmsVerificationSuccess"},window.location.href)):e.thirdPartyResponse&&(this.setErrMsg(e.thirdPartyResponse.message),"errExceededAttempts"===this.errMsg&&window.postMessage({type:"SmsVerificationErrExceededAttempts"},window.location.href))})).catch((e=>{window.postMessage({type:"WidgetNotification",data:{type:"error",message:e}},window.location.href)})).finally((()=>{this.code=""}))}handleInput(e){this.code=e.target.value}render(){return t("div",{class:"PlayerSmsVerification",ref:e=>this.stylingContainer=e},t("div",{class:"PlayerSmsVerificationContainer"},t("p",{class:"PlayerSmsVerificationMsg"+(this.msgEnterCode?"":" Hidden")},i(this.msgEnterCode,this.lang)),t("div",{class:"PlayerSmsVerificationInput"},t("input",{type:"text",onInput:e=>this.handleInput(e),value:this.code})),this.errMsg?t("p",{class:"PlayerSmsVerificationErrMsg"},i(this.errMsg,this.lang)):t("p",{class:"PlayerSmsVerificationMsg"+(!this.isBtnSendAvailable&&this.isCodeSentOnce?"":" Hidden")},i("msgResendNotice",this.lang))),t("div",{class:"PlayerSmsVerificationButtonContainer"},t("button",{class:"PlayerSmsVerificationButton",onClick:this.debounce(this.handleSendCode.bind(this),850),disabled:!this.isBtnSendAvailable},this.isCodeSentOnce?this.isBtnSendAvailable?i("btnResend",this.lang):this.tempBtnResendCount:i("btnSend",this.lang)),t("button",{class:"PlayerSmsVerificationButton",onClick:this.debounce(this.handleCheckCode.bind(this),850),disabled:!this.isCodeSentOnce||""===this.code||void 0===this.code},i("btnActivate",this.lang))))}static get watchers(){return{clientStyling:["updateClientStyling"],clientStylingUrl:["updateClientStyling"]}}};n.style=":host{display:block}.PlayerSmsVerification{padding:30px;display:flex;align-items:center;flex-direction:column;background:var(--emfe-w-registration-color-bg, var(--emfe-w-color-gray-50, #F9F8F8))}.PlayerSmsVerificationContainer{position:relative;width:100%;display:flex;flex-direction:column;margin-bottom:30px}.PlayerSmsVerificationButtonContainer{width:100%;display:flex;flex-direction:column;gap:25px}.PlayerSmsVerificationButton{color:var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));background:var(--emfe-w-registration-color-primary, var(--emfe-w-color-primary, #D0046C));border:1px solid var(--emfe-w-registration-color-primary, var(--emfe-w-color-primary, #D0046C));border-radius:5px;width:100%;height:60px;padding:0;text-transform:uppercase;font-size:18px;cursor:pointer;font-family:inherit}.PlayerSmsVerificationButton:disabled{background:var(--emfe-w-color-gray-100, #E6E6E6);border:1px solid var(--emfe-w-color-gray-150, #828282);cursor:not-allowed}.PlayerSmsVerificationInput{color:var(--emfe-w-registration-contrast, var(--emfe-w-color-gray-300, #58586B));display:flex;flex-direction:column;position:relative;width:100%}.PlayerSmsVerificationInput input{width:100%;height:44px;border:1px solid var(--emfe-w-color-gray-100, #E6E6E6);border-radius:5px;box-sizing:border-box;padding:5px 15px;font-size:16px;text-align:center;line-height:18px;font-family:inherit}.PlayerSmsVerificationInput.Hidden{display:none}.PlayerSmsVerificationMsg{font-size:12px;color:var(--emfe-w-registration-contrast, var(--emfe-w-color-gray-300, #58586B))}.PlayerSmsVerificationMsg.Hidden{display:none}.PlayerSmsVerificationErrMsg{font-size:12px;color:var(--emfe-w-color-error, var(--emfe-w-color-red, #ed0909))}";export{n as player_sms_verification}
|