@everymatrix/player-sms-verification 1.66.1 → 1.66.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ import{r as e,h as i}from"./index-99e378bb.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, #22B04E));border:1px solid var(--emw--registration-color-primary, var(--emw--color-primary, #22B04E));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 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-6e398b2d",[[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))));
1
+ import{p as n,b as e}from"./index-99e378bb.js";export{s as setNonce}from"./index-99e378bb.js";import{g as t}from"./app-globals-0f993ce5.js";(()=>{const e=import.meta.url,t={};return""!==e&&(t.resourcesUrl=new URL(".",e).href),n(t)})().then((async n=>(await t(),e([["player-sms-verification",[[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"]}]]]],n))));
@@ -5,6 +5,7 @@ export const config = {
5
5
  taskQueue: 'async',
6
6
  sourceMap: false,
7
7
  minifyJs: true,
8
+ hashFileNames: false,
8
9
  extras: {
9
10
  experimentalImportInjection: true
10
11
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/player-sms-verification",
3
- "version": "1.66.1",
3
+ "version": "1.66.2",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",
@@ -1 +0,0 @@
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, #22B04E));border:1px solid var(--emw--registration-color-primary, var(--emw--color-primary, #22B04E));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}