@everymatrix/player-sms-verification 1.59.3 → 1.60.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 +22 -2
- package/dist/collection/components/player-sms-verification/player-sms-verification.js +4 -2
- package/dist/esm/player-sms-verification.entry.js +22 -2
- package/dist/player-sms-verification/{p-58804c28.entry.js → p-1eb3227b.entry.js} +1 -1
- package/dist/player-sms-verification/player-sms-verification.esm.js +1 -1
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/player-sms-verification/.stencil/packages/stencil/player-sms-verification/stencil.config.d.ts +2 -0
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/player-sms-verification/.stencil/packages/stencil/player-sms-verification/stencil.config.dev.d.ts +2 -0
- package/package.json +1 -1
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/player-sms-verification/.stencil/packages/stencil/player-sms-verification/stencil.config.d.ts +0 -2
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/player-sms-verification/.stencil/packages/stencil/player-sms-verification/stencil.config.dev.d.ts +0 -2
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/player-sms-verification/.stencil/libs/common/src/storybook/storybook-utils.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/player-sms-verification/.stencil/packages/stencil/player-sms-verification/storybook/main.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/player-sms-verification/.stencil/packages/stencil/player-sms-verification/storybook/preview.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/player-sms-verification/.stencil/tools/plugins/index.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/player-sms-verification/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/player-sms-verification/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/player-sms-verification/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
|
@@ -251,6 +251,25 @@ function setStreamStyling(stylingContainer, domain, subscription) {
|
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
+
/**
|
|
255
|
+
* @name dispatchCustomEvent
|
|
256
|
+
* @description dispatches the custom event CustomEventProcessor is listening for
|
|
257
|
+
* @param {string} type of the custom event
|
|
258
|
+
* @param {Object} data may contain additional information about the event, e.g. userId
|
|
259
|
+
*/
|
|
260
|
+
const dispatchCustomEvent = (type, data = {}) => {
|
|
261
|
+
const event = new CustomEvent('track-custom-event', {
|
|
262
|
+
detail: {
|
|
263
|
+
type,
|
|
264
|
+
data
|
|
265
|
+
},
|
|
266
|
+
bubbles: true,
|
|
267
|
+
composed: true
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
document.dispatchEvent(event);
|
|
271
|
+
};
|
|
272
|
+
|
|
254
273
|
const playerSmsVerificationCss = ":host{display:block}.PlayerSmsVerification{padding:30px;display:flex;align-items:center;flex-direction:column;background:var(--emw--registration-color-bg, var(--emw--color-gray-50, #F9F8F8))}.PlayerSmsVerificationTitleContainer{color:var(--emw--registration-contrast, var(--emw--color-gray-300, #58586B));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}.PlayerSmsVerificationSubtitle{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(--emw--button-typography, var(--emw--color-white, #FFFFFF));background:var(--emw--registration-color-primary, var(--emw--color-primary, #D0046C));border:1px solid var(--emw--registration-color-primary, var(--emw--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(--emw--color-gray-100, #E6E6E6);border:1px solid var(--emw--color-gray-150, #828282);cursor:not-allowed}.PlayerSmsVerificationInput{color:var(--emw--registration-contrast, var(--emw--color-gray-300, #58586B));display:flex;flex-direction:column;position:relative;width:100%}.PlayerSmsVerificationInput input{width:100%;height:44px;border:1px solid var(--emw--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(--emw--registration-contrast, var(--emw--color-gray-300, #58586B))}.PlayerSmsVerificationMsg.Hidden{display:none}.PlayerSmsVerificationErrMsg{font-size:12px;color:var(--emw--color-error, var(--emw--color-red, #ed0909))}.PlayerSMSErrorTextPlaceholder{padding:3px}";
|
|
255
274
|
const PlayerSmsVerificationStyle0 = playerSmsVerificationCss;
|
|
256
275
|
|
|
@@ -311,6 +330,7 @@ const PlayerSmsVerification = class {
|
|
|
311
330
|
if (this.tempBtnResendCount < 0) {
|
|
312
331
|
clearInterval(this.btnResendTimer);
|
|
313
332
|
this.isBtnSendAvailable = true;
|
|
333
|
+
dispatchCustomEvent('sms_code_resend', {});
|
|
314
334
|
}
|
|
315
335
|
}, 1000);
|
|
316
336
|
}
|
|
@@ -410,9 +430,9 @@ const PlayerSmsVerification = class {
|
|
|
410
430
|
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
411
431
|
}
|
|
412
432
|
render() {
|
|
413
|
-
return index.h("div", { key: '
|
|
433
|
+
return index.h("div", { key: '449bdf96de92603f0882bd37fff03fa6edbbb905', class: "PlayerSmsVerification", ref: el => this.stylingContainer = el }, index.h("div", { key: 'af4bc93419d2a2fb169d719a0a2245dfe73952bf', class: "PlayerSmsVerificationTitleContainer" }, index.h("h4", { key: '05bc166a71aaad15e135e33c26375848d5fa7896', class: "PlayerSmsVerificationTitle" }, translate('title', this.lang)), index.h("p", { key: '69e71af868c18a8c7658c447cd4faad8474404d8', class: "PlayerSmsVerificationSubtitle" }, translate('subtitle', this.lang))), index.h("div", { key: '379d4223df2bb70d077fe0a61ce625988d94a4db', class: "PlayerSmsVerificationContainer" }, index.h("p", { key: 'e1bc65f9059db1026cf8ccfbe6ed1be7260ea92a', class: "PlayerSmsVerificationMsg" + (this.msgEnterCode ? "" : " Hidden") }, translate(this.msgEnterCode, this.lang)), index.h("div", { key: '141b38acc8f8f2500327782990cad15955af3608', class: "PlayerSmsVerificationInput" }, index.h("input", { key: '3e68caa0da49cb710df3f317889d60ca8c22e5b1', type: "text", onInput: (event) => this.handleInput(event), value: this.code })), this.errMsg
|
|
414
434
|
? index.h("p", { class: "PlayerSmsVerificationErrMsg" }, translate(this.errMsg, this.lang))
|
|
415
|
-
: index.h("p", { class: "PlayerSmsVerificationMsg" + (!this.isBtnSendAvailable && this.isCodeSentOnce ? "" : " Hidden") }, translate('msgResendNotice', this.lang)), !this.errMsg && index.h("p", { key: '
|
|
435
|
+
: index.h("p", { class: "PlayerSmsVerificationMsg" + (!this.isBtnSendAvailable && this.isCodeSentOnce ? "" : " Hidden") }, translate('msgResendNotice', this.lang)), !this.errMsg && index.h("p", { key: 'db78c93955b31f9f0f612902c805efeb41574dff', class: "PlayerSMSErrorTextPlaceholder" })), index.h("div", { key: '88b6294ad365a63961641b17bca33e1ecdd22b3b', class: "PlayerSmsVerificationButtonContainer" }, index.h("button", { key: '5eab8b95b13af28c130a1d243e348fea411b134c', 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", { key: 'dbb64063224e6fe3f41838c21ce4b2711b3cd5f1', class: "PlayerSmsVerificationButton", onClick: this.debounce(this.handleCheckCode.bind(this), 850), disabled: !this.isCodeSentOnce || this.code === '' || this.code === undefined }, translate('btnActivate', this.lang))));
|
|
416
436
|
}
|
|
417
437
|
static get watchers() { return {
|
|
418
438
|
"clientStyling": ["handleClientStylingChange"],
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { getTranslations, translate } from "../../utils/utils";
|
|
3
3
|
import { setClientStyling, setClientStylingURL, setStreamStyling } from "../../../../../../../../libs/common/src/styling/index";
|
|
4
|
+
import { dispatchCustomEvent } from "../../../../../../../../libs/custom-events/src/index";
|
|
4
5
|
export class PlayerSmsVerification {
|
|
5
6
|
constructor() {
|
|
6
7
|
// Other variables
|
|
@@ -57,6 +58,7 @@ export class PlayerSmsVerification {
|
|
|
57
58
|
if (this.tempBtnResendCount < 0) {
|
|
58
59
|
clearInterval(this.btnResendTimer);
|
|
59
60
|
this.isBtnSendAvailable = true;
|
|
61
|
+
dispatchCustomEvent('sms_code_resend', {});
|
|
60
62
|
}
|
|
61
63
|
}, 1000);
|
|
62
64
|
}
|
|
@@ -156,9 +158,9 @@ export class PlayerSmsVerification {
|
|
|
156
158
|
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
157
159
|
}
|
|
158
160
|
render() {
|
|
159
|
-
return h("div", { key: '
|
|
161
|
+
return h("div", { key: '449bdf96de92603f0882bd37fff03fa6edbbb905', class: "PlayerSmsVerification", ref: el => this.stylingContainer = el }, h("div", { key: 'af4bc93419d2a2fb169d719a0a2245dfe73952bf', class: "PlayerSmsVerificationTitleContainer" }, h("h4", { key: '05bc166a71aaad15e135e33c26375848d5fa7896', class: "PlayerSmsVerificationTitle" }, translate('title', this.lang)), h("p", { key: '69e71af868c18a8c7658c447cd4faad8474404d8', class: "PlayerSmsVerificationSubtitle" }, translate('subtitle', this.lang))), h("div", { key: '379d4223df2bb70d077fe0a61ce625988d94a4db', class: "PlayerSmsVerificationContainer" }, h("p", { key: 'e1bc65f9059db1026cf8ccfbe6ed1be7260ea92a', class: "PlayerSmsVerificationMsg" + (this.msgEnterCode ? "" : " Hidden") }, translate(this.msgEnterCode, this.lang)), h("div", { key: '141b38acc8f8f2500327782990cad15955af3608', class: "PlayerSmsVerificationInput" }, h("input", { key: '3e68caa0da49cb710df3f317889d60ca8c22e5b1', type: "text", onInput: (event) => this.handleInput(event), value: this.code })), this.errMsg
|
|
160
162
|
? h("p", { class: "PlayerSmsVerificationErrMsg" }, translate(this.errMsg, this.lang))
|
|
161
|
-
: h("p", { class: "PlayerSmsVerificationMsg" + (!this.isBtnSendAvailable && this.isCodeSentOnce ? "" : " Hidden") }, translate('msgResendNotice', this.lang)), !this.errMsg && h("p", { key: '
|
|
163
|
+
: h("p", { class: "PlayerSmsVerificationMsg" + (!this.isBtnSendAvailable && this.isCodeSentOnce ? "" : " Hidden") }, translate('msgResendNotice', this.lang)), !this.errMsg && h("p", { key: 'db78c93955b31f9f0f612902c805efeb41574dff', class: "PlayerSMSErrorTextPlaceholder" })), h("div", { key: '88b6294ad365a63961641b17bca33e1ecdd22b3b', class: "PlayerSmsVerificationButtonContainer" }, h("button", { key: '5eab8b95b13af28c130a1d243e348fea411b134c', 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", { key: 'dbb64063224e6fe3f41838c21ce4b2711b3cd5f1', class: "PlayerSmsVerificationButton", onClick: this.debounce(this.handleCheckCode.bind(this), 850), disabled: !this.isCodeSentOnce || this.code === '' || this.code === undefined }, translate('btnActivate', this.lang))));
|
|
162
164
|
}
|
|
163
165
|
static get is() { return "player-sms-verification"; }
|
|
164
166
|
static get encapsulation() { return "shadow"; }
|
|
@@ -247,6 +247,25 @@ function setStreamStyling(stylingContainer, domain, subscription) {
|
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
+
/**
|
|
251
|
+
* @name dispatchCustomEvent
|
|
252
|
+
* @description dispatches the custom event CustomEventProcessor is listening for
|
|
253
|
+
* @param {string} type of the custom event
|
|
254
|
+
* @param {Object} data may contain additional information about the event, e.g. userId
|
|
255
|
+
*/
|
|
256
|
+
const dispatchCustomEvent = (type, data = {}) => {
|
|
257
|
+
const event = new CustomEvent('track-custom-event', {
|
|
258
|
+
detail: {
|
|
259
|
+
type,
|
|
260
|
+
data
|
|
261
|
+
},
|
|
262
|
+
bubbles: true,
|
|
263
|
+
composed: true
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
document.dispatchEvent(event);
|
|
267
|
+
};
|
|
268
|
+
|
|
250
269
|
const playerSmsVerificationCss = ":host{display:block}.PlayerSmsVerification{padding:30px;display:flex;align-items:center;flex-direction:column;background:var(--emw--registration-color-bg, var(--emw--color-gray-50, #F9F8F8))}.PlayerSmsVerificationTitleContainer{color:var(--emw--registration-contrast, var(--emw--color-gray-300, #58586B));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}.PlayerSmsVerificationSubtitle{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(--emw--button-typography, var(--emw--color-white, #FFFFFF));background:var(--emw--registration-color-primary, var(--emw--color-primary, #D0046C));border:1px solid var(--emw--registration-color-primary, var(--emw--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(--emw--color-gray-100, #E6E6E6);border:1px solid var(--emw--color-gray-150, #828282);cursor:not-allowed}.PlayerSmsVerificationInput{color:var(--emw--registration-contrast, var(--emw--color-gray-300, #58586B));display:flex;flex-direction:column;position:relative;width:100%}.PlayerSmsVerificationInput input{width:100%;height:44px;border:1px solid var(--emw--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(--emw--registration-contrast, var(--emw--color-gray-300, #58586B))}.PlayerSmsVerificationMsg.Hidden{display:none}.PlayerSmsVerificationErrMsg{font-size:12px;color:var(--emw--color-error, var(--emw--color-red, #ed0909))}.PlayerSMSErrorTextPlaceholder{padding:3px}";
|
|
251
270
|
const PlayerSmsVerificationStyle0 = playerSmsVerificationCss;
|
|
252
271
|
|
|
@@ -307,6 +326,7 @@ const PlayerSmsVerification = class {
|
|
|
307
326
|
if (this.tempBtnResendCount < 0) {
|
|
308
327
|
clearInterval(this.btnResendTimer);
|
|
309
328
|
this.isBtnSendAvailable = true;
|
|
329
|
+
dispatchCustomEvent('sms_code_resend', {});
|
|
310
330
|
}
|
|
311
331
|
}, 1000);
|
|
312
332
|
}
|
|
@@ -406,9 +426,9 @@ const PlayerSmsVerification = class {
|
|
|
406
426
|
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
407
427
|
}
|
|
408
428
|
render() {
|
|
409
|
-
return h("div", { key: '
|
|
429
|
+
return h("div", { key: '449bdf96de92603f0882bd37fff03fa6edbbb905', class: "PlayerSmsVerification", ref: el => this.stylingContainer = el }, h("div", { key: 'af4bc93419d2a2fb169d719a0a2245dfe73952bf', class: "PlayerSmsVerificationTitleContainer" }, h("h4", { key: '05bc166a71aaad15e135e33c26375848d5fa7896', class: "PlayerSmsVerificationTitle" }, translate('title', this.lang)), h("p", { key: '69e71af868c18a8c7658c447cd4faad8474404d8', class: "PlayerSmsVerificationSubtitle" }, translate('subtitle', this.lang))), h("div", { key: '379d4223df2bb70d077fe0a61ce625988d94a4db', class: "PlayerSmsVerificationContainer" }, h("p", { key: 'e1bc65f9059db1026cf8ccfbe6ed1be7260ea92a', class: "PlayerSmsVerificationMsg" + (this.msgEnterCode ? "" : " Hidden") }, translate(this.msgEnterCode, this.lang)), h("div", { key: '141b38acc8f8f2500327782990cad15955af3608', class: "PlayerSmsVerificationInput" }, h("input", { key: '3e68caa0da49cb710df3f317889d60ca8c22e5b1', type: "text", onInput: (event) => this.handleInput(event), value: this.code })), this.errMsg
|
|
410
430
|
? h("p", { class: "PlayerSmsVerificationErrMsg" }, translate(this.errMsg, this.lang))
|
|
411
|
-
: h("p", { class: "PlayerSmsVerificationMsg" + (!this.isBtnSendAvailable && this.isCodeSentOnce ? "" : " Hidden") }, translate('msgResendNotice', this.lang)), !this.errMsg && h("p", { key: '
|
|
431
|
+
: h("p", { class: "PlayerSmsVerificationMsg" + (!this.isBtnSendAvailable && this.isCodeSentOnce ? "" : " Hidden") }, translate('msgResendNotice', this.lang)), !this.errMsg && h("p", { key: 'db78c93955b31f9f0f612902c805efeb41574dff', class: "PlayerSMSErrorTextPlaceholder" })), h("div", { key: '88b6294ad365a63961641b17bca33e1ecdd22b3b', class: "PlayerSmsVerificationButtonContainer" }, h("button", { key: '5eab8b95b13af28c130a1d243e348fea411b134c', 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", { key: 'dbb64063224e6fe3f41838c21ce4b2711b3cd5f1', class: "PlayerSmsVerificationButton", onClick: this.debounce(this.handleCheckCode.bind(this), 850), disabled: !this.isCodeSentOnce || this.code === '' || this.code === undefined }, translate('btnActivate', this.lang))));
|
|
412
432
|
}
|
|
413
433
|
static get watchers() { return {
|
|
414
434
|
"clientStyling": ["handleClientStylingChange"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as i}from"./p-b187e9e6.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",errInvalidPhone:"The provided phone number is invalid"},ro:{title:"Verificare SMS necesară",subtitle:"Trebuie să vă verificați numărul de telefon",btnSend:"Trimite cod",btnResend:"Retrimite cod",btnActivate:"Activează",msgEnterCode:"Introduceți codul de verificare primit pe numărul dvs.",msgResendNotice:"Un nou cod de verificare a fost trimis pe numărul dvs. de telefon",errGenerateCode:"A apărut o eroare la generarea codului. Apăsați butonul de retrimitere pentru a genera un nou cod",errInvalidCode:"Codul este incorect",errExceededAttempts:"Prea multe încercări. Încercați din nou mai târziu",errExpiredToken:"Codul a expirat, retrimiteți codul",errInvalidPhone:"Numărul de telefon furnizat este invalid"},fr:{title:"Vérification SMS requise",subtitle:"Vous devez vérifier votre numéro de téléphone",btnSend:"Envoyer le code",btnResend:"Renvoyer le code",btnActivate:"Activer",msgEnterCode:"Veuillez entrer le code de vérification reçu sur votre numéro",msgResendNotice:"Un nouveau code de vérification a été envoyé à votre numéro de téléphone",errGenerateCode:"Une erreur est survenue lors de la génération de votre code. Cliquez sur le bouton renvoyer pour générer un nouveau code",errInvalidCode:"Le code est incorrect",errExceededAttempts:"Trop de tentatives. Réessayez plus tard",errExpiredToken:"Le code a expiré, renvoyez le code",errInvalidPhone:"Le numéro de téléphone fourni est invalide"},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",errInvalidPhone:"The provided phone number is invalid"},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",errInvalidPhone:"The provided phone number is invalid"},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",errInvalidPhone:"The provided phone number is invalid"},es:{title:"Verificación por SMS requerida",subtitle:"Debe verificar su número de teléfono",btnSend:"Enviar código",btnResend:"Reenviar código",btnActivate:"Activar",msgEnterCode:"Por favor, introduzca el código de verificación recibido en su número",msgResendNotice:"Se ha enviado un nuevo código de verificación a su número de teléfono",errGenerateCode:"Ocurrió un error al generar su código. Haga clic en el botón de reenviar para generar un nuevo código",errInvalidCode:"El código es incorrecto",errExceededAttempts:"Demasiados intentos. Inténtelo más tarde",errExpiredToken:"El código ha expirado, reenviar código",errInvalidPhone:"El número de teléfono proporcionado no es válido"},pt:{title:"Verificação SMS necessária",subtitle:"Você precisa verificar seu número de telefone",btnSend:"Enviar código",btnResend:"Reenviar código",btnActivate:"Ativar",msgEnterCode:"Por favor, insira o código de verificação recebido no seu número",msgResendNotice:"Um novo código de verificação foi enviado para o seu número de telefone",errGenerateCode:"Ocorreu um erro ao gerar seu código. Clique no botão reenviar para gerar um novo código",errInvalidCode:"O código está incorreto",errExceededAttempts:"Muitas tentativas. Tente novamente mais tarde",errExpiredToken:"O código expirou, reenviar código",errInvalidPhone:"O número de telefone fornecido é inválido"},hr:{title:"SMS verifikacija je potrebna",subtitle:"Potrebno je verificirati broj mobitela. Verifikacijski kod je poslan",btnSend:"Pošalji kod",btnResend:"Ponovno pošalji",btnActivate:"Aktiviraj",msgEnterCode:"Molimo unesite verifikacijski kod koji je poslan na broj mobitela",msgResendNotice:"Novi verifikacijski kod je poslan na broj mobitela",errGenerateCode:"Došlo je do pogreške prilikom generiranja Vašeg verifikacijskog koda. Molimo da odaberete Ponovno pošalji kako bismo poslali novi kod",errInvalidCode:"SMS kod nije ispravan",errExceededAttempts:"Previše pokušaja. Pokušajte ponovno kasnije",errExpiredToken:"Verifikacijski kod je istekao, ponovno zatražite kod",errInvalidPhone:"Navedeni telefonski broj je nevažeći"},de:{title:"SMS-Verifizierung erforderlich",subtitle:"Sie müssen Ihre Telefonnummer verifizieren",btnSend:"Code senden",btnResend:"Code erneut senden",btnActivate:"Aktivieren",msgEnterCode:"Bitte geben Sie den Verifizierungscode ein, den Sie auf Ihrer Nummer erhalten haben",msgResendNotice:"Ein neuer Verifizierungscode wurde an Ihre Telefonnummer gesendet",errGenerateCode:"Es ist ein Fehler bei der Generierung Ihres Codes aufgetreten. Klicken Sie auf die Schaltfläche zum erneuten Senden, um einen neuen Code zu generieren",errInvalidCode:"Der Code ist falsch",errExceededAttempts:"Zu viele Versuche. Bitte versuchen Sie es später erneut",errExpiredToken:"Der Code ist abgelaufen, bitte erneut senden",errInvalidPhone:"Die angegebene Telefonnummer ist ungültig"},"es-mx":{title:"Verificación por SMS requerida",subtitle:"Debe verificar su número de teléfono",btnSend:"Enviar código",btnResend:"Reenviar código",btnActivate:"Activar",msgEnterCode:"Por favor, introduzca el código de verificación recibido en su número",msgResendNotice:"Se ha enviado un nuevo código de verificación a su número de teléfono",errGenerateCode:"Ocurrió un error al generar su código. Haga clic en el botón de reenviar para generar un nuevo código",errInvalidCode:"El código es incorrecto",errExceededAttempts:"Demasiados intentos. Inténtelo más tarde",errExpiredToken:"El código ha expirado, reenviar código",errInvalidPhone:"El número de teléfono proporcionado no es válido"},"pt-br":{title:"Verificação SMS necessária",subtitle:"Você precisa verificar seu número de telefone",btnSend:"Enviar código",btnResend:"Reenviar código",btnActivate:"Ativar",msgEnterCode:"Por favor, insira o código de verificação recebido no seu número",msgResendNotice:"Um novo código de verificação foi enviado para o seu número de telefone",errGenerateCode:"Ocorreu um erro ao gerar seu código. Clique no botão reenviar para gerar um novo código",errInvalidCode:"O código está incorreto",errExceededAttempts:"Muitas tentativas. Tente novamente mais tarde",errExpiredToken:"O código expirou, reenviar código",errInvalidPhone:"O número de telefone fornecido é inválido"}},t=(e,i)=>r[void 0!==i?i:"en"][e];function o(e,i){if(e){const r=document.createElement("style");r.innerHTML=i,e.appendChild(r)}}function n(e,i){const r=new URL(i);fetch(r.href).then((e=>e.text())).then((i=>{const r=document.createElement("style");r.innerHTML=i,e&&e.appendChild(r)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}const a=class{constructor(i){e(this,i),this.btnResendCount=60,this.isCodeSentOnce=!1,this.isBtnSendAvailable=!0,this.endpoint=void 0,this.userId=void 0,this.lang="en",this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl="",this.tempBtnResendCount=void 0,this.code="",this.errMsg="",this.msgEnterCode=""}handleClientStylingChange(e,i){e!=i&&o(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(e,i){e!=i&&this.clientStylingUrl&&n(this.stylingContainer,this.clientStylingUrl)}componentWillLoad(){if(this.translationUrl)return e=this.translationUrl,new Promise((i=>{fetch(e).then((e=>e.json())).then((e=>{Object.keys(e).forEach((i=>{for(let t in e[i])r[i][t]=e[i][t]})),i(!0)}))}));var e}componentDidLoad(){this.stylingContainer&&(null!=window.emMessageBus?function(e,i){if(window.emMessageBus){const r=document.createElement("style");window.emMessageBus.subscribe(i,(i=>{r.innerHTML=i,e&&e.appendChild(r)}))}}(this.stylingContainer,`${this.mbSource}.Style`):(this.clientStyling&&o(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&n(this.stylingContainer,this.clientStylingUrl)))}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":"INVALID_PHONE_NUMBER"===e&&(this.errMsg="errInvalidPhone")}debounce(e,i){return function(...r){clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout((()=>{e.apply(this,r)}),i)}}handleSendCode(){this.errMsg="";let e=new URL(`${this.endpoint}/v1/player/legislation/generate2FACode`);const i={method:"POST",headers:{accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({userId:`${this.userId}`})};fetch(e.href,i).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:t(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}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}render(){return i("div",{key:"da8e1da7cf6a49519ff1c6cae3eb17ee288237f2",class:"PlayerSmsVerification",ref:e=>this.stylingContainer=e},i("div",{key:"f6d7f84527ec88f6027e2ba717bb2a92fe6175e9",class:"PlayerSmsVerificationTitleContainer"},i("h4",{key:"37f471083259e90b5b54e0a76f1fcff7bb40c14c",class:"PlayerSmsVerificationTitle"},t("title",this.lang)),i("p",{key:"545c12575aa056b7fc92e60f95db351c2938f85d",class:"PlayerSmsVerificationSubtitle"},t("subtitle",this.lang))),i("div",{key:"9277f7f1147b1f245393be66e66e81f1ae03f373",class:"PlayerSmsVerificationContainer"},i("p",{key:"a37c285eb9aade13bc80cc8d2fa48c3818f1316b",class:"PlayerSmsVerificationMsg"+(this.msgEnterCode?"":" Hidden")},t(this.msgEnterCode,this.lang)),i("div",{key:"57da383cbb9d70f9d5f656f7c9775d9311cdc923",class:"PlayerSmsVerificationInput"},i("input",{key:"cd34b784a81c9eab6b0c26dc03c5e7aafd917824",type:"text",onInput:e=>this.handleInput(e),value:this.code})),this.errMsg?i("p",{class:"PlayerSmsVerificationErrMsg"},t(this.errMsg,this.lang)):i("p",{class:"PlayerSmsVerificationMsg"+(!this.isBtnSendAvailable&&this.isCodeSentOnce?"":" Hidden")},t("msgResendNotice",this.lang)),!this.errMsg&&i("p",{key:"f85d75a75e8f604fa7f5f491f1ecdb9aa1d0526e",class:"PlayerSMSErrorTextPlaceholder"})),i("div",{key:"51fd4a63efdf720ef743148ca2126cf188b14d83",class:"PlayerSmsVerificationButtonContainer"},i("button",{key:"527ec723234d3479d120314a3bb09cea4d11224f",class:"PlayerSmsVerificationButton",onClick:this.debounce(this.handleSendCode.bind(this),850),disabled:!this.isBtnSendAvailable},this.isCodeSentOnce?this.isBtnSendAvailable?t("btnResend",this.lang):this.tempBtnResendCount:t("btnSend",this.lang)),i("button",{key:"ac5d61787dcca55870e80e0d1c5423622b9caaf8",class:"PlayerSmsVerificationButton",onClick:this.debounce(this.handleCheckCode.bind(this),850),disabled:!this.isCodeSentOnce||""===this.code||void 0===this.code},t("btnActivate",this.lang))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}}};a.style=":host{display:block}.PlayerSmsVerification{padding:30px;display:flex;align-items:center;flex-direction:column;background:var(--emw--registration-color-bg, var(--emw--color-gray-50, #F9F8F8))}.PlayerSmsVerificationTitleContainer{color:var(--emw--registration-contrast, var(--emw--color-gray-300, #58586B));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}.PlayerSmsVerificationSubtitle{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(--emw--button-typography, var(--emw--color-white, #FFFFFF));background:var(--emw--registration-color-primary, var(--emw--color-primary, #D0046C));border:1px solid var(--emw--registration-color-primary, var(--emw--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(--emw--color-gray-100, #E6E6E6);border:1px solid var(--emw--color-gray-150, #828282);cursor:not-allowed}.PlayerSmsVerificationInput{color:var(--emw--registration-contrast, var(--emw--color-gray-300, #58586B));display:flex;flex-direction:column;position:relative;width:100%}.PlayerSmsVerificationInput input{width:100%;height:44px;border:1px solid var(--emw--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(--emw--registration-contrast, var(--emw--color-gray-300, #58586B))}.PlayerSmsVerificationMsg.Hidden{display:none}.PlayerSmsVerificationErrMsg{font-size:12px;color:var(--emw--color-error, var(--emw--color-red, #ed0909))}.PlayerSMSErrorTextPlaceholder{padding:3px}";export{a as player_sms_verification}
|
|
1
|
+
import{r as e,h as i}from"./p-b187e9e6.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",errInvalidPhone:"The provided phone number is invalid"},ro:{title:"Verificare SMS necesară",subtitle:"Trebuie să vă verificați numărul de telefon",btnSend:"Trimite cod",btnResend:"Retrimite cod",btnActivate:"Activează",msgEnterCode:"Introduceți codul de verificare primit pe numărul dvs.",msgResendNotice:"Un nou cod de verificare a fost trimis pe numărul dvs. de telefon",errGenerateCode:"A apărut o eroare la generarea codului. Apăsați butonul de retrimitere pentru a genera un nou cod",errInvalidCode:"Codul este incorect",errExceededAttempts:"Prea multe încercări. Încercați din nou mai târziu",errExpiredToken:"Codul a expirat, retrimiteți codul",errInvalidPhone:"Numărul de telefon furnizat este invalid"},fr:{title:"Vérification SMS requise",subtitle:"Vous devez vérifier votre numéro de téléphone",btnSend:"Envoyer le code",btnResend:"Renvoyer le code",btnActivate:"Activer",msgEnterCode:"Veuillez entrer le code de vérification reçu sur votre numéro",msgResendNotice:"Un nouveau code de vérification a été envoyé à votre numéro de téléphone",errGenerateCode:"Une erreur est survenue lors de la génération de votre code. Cliquez sur le bouton renvoyer pour générer un nouveau code",errInvalidCode:"Le code est incorrect",errExceededAttempts:"Trop de tentatives. Réessayez plus tard",errExpiredToken:"Le code a expiré, renvoyez le code",errInvalidPhone:"Le numéro de téléphone fourni est invalide"},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",errInvalidPhone:"The provided phone number is invalid"},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",errInvalidPhone:"The provided phone number is invalid"},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",errInvalidPhone:"The provided phone number is invalid"},es:{title:"Verificación por SMS requerida",subtitle:"Debe verificar su número de teléfono",btnSend:"Enviar código",btnResend:"Reenviar código",btnActivate:"Activar",msgEnterCode:"Por favor, introduzca el código de verificación recibido en su número",msgResendNotice:"Se ha enviado un nuevo código de verificación a su número de teléfono",errGenerateCode:"Ocurrió un error al generar su código. Haga clic en el botón de reenviar para generar un nuevo código",errInvalidCode:"El código es incorrecto",errExceededAttempts:"Demasiados intentos. Inténtelo más tarde",errExpiredToken:"El código ha expirado, reenviar código",errInvalidPhone:"El número de teléfono proporcionado no es válido"},pt:{title:"Verificação SMS necessária",subtitle:"Você precisa verificar seu número de telefone",btnSend:"Enviar código",btnResend:"Reenviar código",btnActivate:"Ativar",msgEnterCode:"Por favor, insira o código de verificação recebido no seu número",msgResendNotice:"Um novo código de verificação foi enviado para o seu número de telefone",errGenerateCode:"Ocorreu um erro ao gerar seu código. Clique no botão reenviar para gerar um novo código",errInvalidCode:"O código está incorreto",errExceededAttempts:"Muitas tentativas. Tente novamente mais tarde",errExpiredToken:"O código expirou, reenviar código",errInvalidPhone:"O número de telefone fornecido é inválido"},hr:{title:"SMS verifikacija je potrebna",subtitle:"Potrebno je verificirati broj mobitela. Verifikacijski kod je poslan",btnSend:"Pošalji kod",btnResend:"Ponovno pošalji",btnActivate:"Aktiviraj",msgEnterCode:"Molimo unesite verifikacijski kod koji je poslan na broj mobitela",msgResendNotice:"Novi verifikacijski kod je poslan na broj mobitela",errGenerateCode:"Došlo je do pogreške prilikom generiranja Vašeg verifikacijskog koda. Molimo da odaberete Ponovno pošalji kako bismo poslali novi kod",errInvalidCode:"SMS kod nije ispravan",errExceededAttempts:"Previše pokušaja. Pokušajte ponovno kasnije",errExpiredToken:"Verifikacijski kod je istekao, ponovno zatražite kod",errInvalidPhone:"Navedeni telefonski broj je nevažeći"},de:{title:"SMS-Verifizierung erforderlich",subtitle:"Sie müssen Ihre Telefonnummer verifizieren",btnSend:"Code senden",btnResend:"Code erneut senden",btnActivate:"Aktivieren",msgEnterCode:"Bitte geben Sie den Verifizierungscode ein, den Sie auf Ihrer Nummer erhalten haben",msgResendNotice:"Ein neuer Verifizierungscode wurde an Ihre Telefonnummer gesendet",errGenerateCode:"Es ist ein Fehler bei der Generierung Ihres Codes aufgetreten. Klicken Sie auf die Schaltfläche zum erneuten Senden, um einen neuen Code zu generieren",errInvalidCode:"Der Code ist falsch",errExceededAttempts:"Zu viele Versuche. Bitte versuchen Sie es später erneut",errExpiredToken:"Der Code ist abgelaufen, bitte erneut senden",errInvalidPhone:"Die angegebene Telefonnummer ist ungültig"},"es-mx":{title:"Verificación por SMS requerida",subtitle:"Debe verificar su número de teléfono",btnSend:"Enviar código",btnResend:"Reenviar código",btnActivate:"Activar",msgEnterCode:"Por favor, introduzca el código de verificación recibido en su número",msgResendNotice:"Se ha enviado un nuevo código de verificación a su número de teléfono",errGenerateCode:"Ocurrió un error al generar su código. Haga clic en el botón de reenviar para generar un nuevo código",errInvalidCode:"El código es incorrecto",errExceededAttempts:"Demasiados intentos. Inténtelo más tarde",errExpiredToken:"El código ha expirado, reenviar código",errInvalidPhone:"El número de teléfono proporcionado no es válido"},"pt-br":{title:"Verificação SMS necessária",subtitle:"Você precisa verificar seu número de telefone",btnSend:"Enviar código",btnResend:"Reenviar código",btnActivate:"Ativar",msgEnterCode:"Por favor, insira o código de verificação recebido no seu número",msgResendNotice:"Um novo código de verificação foi enviado para o seu número de telefone",errGenerateCode:"Ocorreu um erro ao gerar seu código. Clique no botão reenviar para gerar um novo código",errInvalidCode:"O código está incorreto",errExceededAttempts:"Muitas tentativas. Tente novamente mais tarde",errExpiredToken:"O código expirou, reenviar código",errInvalidPhone:"O número de telefone fornecido é inválido"}},t=(e,i)=>r[void 0!==i?i:"en"][e];function o(e,i){if(e){const r=document.createElement("style");r.innerHTML=i,e.appendChild(r)}}function n(e,i){const r=new URL(i);fetch(r.href).then((e=>e.text())).then((i=>{const r=document.createElement("style");r.innerHTML=i,e&&e.appendChild(r)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}const a=class{constructor(i){e(this,i),this.btnResendCount=60,this.isCodeSentOnce=!1,this.isBtnSendAvailable=!0,this.endpoint=void 0,this.userId=void 0,this.lang="en",this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl="",this.tempBtnResendCount=void 0,this.code="",this.errMsg="",this.msgEnterCode=""}handleClientStylingChange(e,i){e!=i&&o(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(e,i){e!=i&&this.clientStylingUrl&&n(this.stylingContainer,this.clientStylingUrl)}componentWillLoad(){if(this.translationUrl)return e=this.translationUrl,new Promise((i=>{fetch(e).then((e=>e.json())).then((e=>{Object.keys(e).forEach((i=>{for(let t in e[i])r[i][t]=e[i][t]})),i(!0)}))}));var e}componentDidLoad(){this.stylingContainer&&(null!=window.emMessageBus?function(e,i){if(window.emMessageBus){const r=document.createElement("style");window.emMessageBus.subscribe(i,(i=>{r.innerHTML=i,e&&e.appendChild(r)}))}}(this.stylingContainer,`${this.mbSource}.Style`):(this.clientStyling&&o(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&n(this.stylingContainer,this.clientStylingUrl)))}startTimerBtnResendCode(){this.isBtnSendAvailable=!1,this.tempBtnResendCount=this.btnResendCount,this.btnResendTimer=setInterval((()=>{this.tempBtnResendCount--,this.tempBtnResendCount<0&&(clearInterval(this.btnResendTimer),this.isBtnSendAvailable=!0,((e,i={})=>{const r=new CustomEvent("track-custom-event",{detail:{type:"sms_code_resend",data:i},bubbles:!0,composed:!0});document.dispatchEvent(r)})(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":"INVALID_PHONE_NUMBER"===e&&(this.errMsg="errInvalidPhone")}debounce(e,i){return function(...r){clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout((()=>{e.apply(this,r)}),i)}}handleSendCode(){this.errMsg="";let e=new URL(`${this.endpoint}/v1/player/legislation/generate2FACode`);const i={method:"POST",headers:{accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({userId:`${this.userId}`})};fetch(e.href,i).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:t(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}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}render(){return i("div",{key:"449bdf96de92603f0882bd37fff03fa6edbbb905",class:"PlayerSmsVerification",ref:e=>this.stylingContainer=e},i("div",{key:"af4bc93419d2a2fb169d719a0a2245dfe73952bf",class:"PlayerSmsVerificationTitleContainer"},i("h4",{key:"05bc166a71aaad15e135e33c26375848d5fa7896",class:"PlayerSmsVerificationTitle"},t("title",this.lang)),i("p",{key:"69e71af868c18a8c7658c447cd4faad8474404d8",class:"PlayerSmsVerificationSubtitle"},t("subtitle",this.lang))),i("div",{key:"379d4223df2bb70d077fe0a61ce625988d94a4db",class:"PlayerSmsVerificationContainer"},i("p",{key:"e1bc65f9059db1026cf8ccfbe6ed1be7260ea92a",class:"PlayerSmsVerificationMsg"+(this.msgEnterCode?"":" Hidden")},t(this.msgEnterCode,this.lang)),i("div",{key:"141b38acc8f8f2500327782990cad15955af3608",class:"PlayerSmsVerificationInput"},i("input",{key:"3e68caa0da49cb710df3f317889d60ca8c22e5b1",type:"text",onInput:e=>this.handleInput(e),value:this.code})),this.errMsg?i("p",{class:"PlayerSmsVerificationErrMsg"},t(this.errMsg,this.lang)):i("p",{class:"PlayerSmsVerificationMsg"+(!this.isBtnSendAvailable&&this.isCodeSentOnce?"":" Hidden")},t("msgResendNotice",this.lang)),!this.errMsg&&i("p",{key:"db78c93955b31f9f0f612902c805efeb41574dff",class:"PlayerSMSErrorTextPlaceholder"})),i("div",{key:"88b6294ad365a63961641b17bca33e1ecdd22b3b",class:"PlayerSmsVerificationButtonContainer"},i("button",{key:"5eab8b95b13af28c130a1d243e348fea411b134c",class:"PlayerSmsVerificationButton",onClick:this.debounce(this.handleSendCode.bind(this),850),disabled:!this.isBtnSendAvailable},this.isCodeSentOnce?this.isBtnSendAvailable?t("btnResend",this.lang):this.tempBtnResendCount:t("btnSend",this.lang)),i("button",{key:"dbb64063224e6fe3f41838c21ce4b2711b3cd5f1",class:"PlayerSmsVerificationButton",onClick:this.debounce(this.handleCheckCode.bind(this),850),disabled:!this.isCodeSentOnce||""===this.code||void 0===this.code},t("btnActivate",this.lang))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}}};a.style=":host{display:block}.PlayerSmsVerification{padding:30px;display:flex;align-items:center;flex-direction:column;background:var(--emw--registration-color-bg, var(--emw--color-gray-50, #F9F8F8))}.PlayerSmsVerificationTitleContainer{color:var(--emw--registration-contrast, var(--emw--color-gray-300, #58586B));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}.PlayerSmsVerificationSubtitle{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(--emw--button-typography, var(--emw--color-white, #FFFFFF));background:var(--emw--registration-color-primary, var(--emw--color-primary, #D0046C));border:1px solid var(--emw--registration-color-primary, var(--emw--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(--emw--color-gray-100, #E6E6E6);border:1px solid var(--emw--color-gray-150, #828282);cursor:not-allowed}.PlayerSmsVerificationInput{color:var(--emw--registration-contrast, var(--emw--color-gray-300, #58586B));display:flex;flex-direction:column;position:relative;width:100%}.PlayerSmsVerificationInput input{width:100%;height:44px;border:1px solid var(--emw--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(--emw--registration-contrast, var(--emw--color-gray-300, #58586B))}.PlayerSmsVerificationMsg.Hidden{display:none}.PlayerSmsVerificationErrMsg{font-size:12px;color:var(--emw--color-error, var(--emw--color-red, #ed0909))}.PlayerSMSErrorTextPlaceholder{padding:3px}";export{a as player_sms_verification}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as
|
|
1
|
+
import{p as e,b as n}from"./p-b187e9e6.js";export{s as setNonce}from"./p-b187e9e6.js";import{g as t}from"./p-e1255160.js";(()=>{const n=import.meta.url,t={};return""!==n&&(t.resourcesUrl=new URL(".",n).href),e(t)})().then((async e=>(await t(),n([["p-1eb3227b",[[1,"player-sms-verification",{endpoint:[513],userId:[513,"user-id"],lang:[513],clientStyling:[1537,"client-styling"],clientStylingUrl:[513,"client-styling-url"],mbSource:[1,"mb-source"],translationUrl:[513,"translation-url"],tempBtnResendCount:[32],code:[32],errMsg:[32],msgEnterCode:[32]},null,{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}]]]],e))));
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|