@everymatrix/player-step-up-auth 1.70.0 → 1.70.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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const playerStepUpAuth = require('./player-step-up-auth-01cbec8a.js');
5
+ const playerStepUpAuth = require('./player-step-up-auth-cdfb27c4.js');
6
6
  require('./index-bf4d774c.js');
7
7
 
8
8
 
@@ -8,7 +8,7 @@ const appGlobals = require('./app-globals-3a1e7e63.js');
8
8
  const defineCustomElements = async (win, options) => {
9
9
  if (typeof window === 'undefined') return undefined;
10
10
  await appGlobals.globalScripts();
11
- return index.bootstrapLazy([["player-step-up-auth.cjs",[[1,"player-step-up-auth",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"endpoint":[513],"userSession":[513,"user-session"],"translationUrl":[513,"translation-url"],"showPopup":[32],"otp":[32],"isLoading":[32],"config":[32],"timeLeft":[32],"expirationTime":[32],"serverTime":[32],"hasErrors":[32],"hasConfigErrors":[32],"errorMessage":[32],"token":[32],"flow":[32],"showResendOtp":[32]},[[8,"stepUpAuthRequired","handleStepUpAuthEvent"],[8,"closePopup","handleCloseWidget"]],{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
11
+ return index.bootstrapLazy([["player-step-up-auth.cjs",[[1,"player-step-up-auth",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"endpoint":[513],"userSession":[513,"user-session"],"translationUrl":[513,"translation-url"],"showPopup":[32],"otp":[32],"isLoading":[32],"config":[32],"timeLeft":[32],"expirationTime":[32],"serverTime":[32],"hasErrors":[32],"hasConfigErrors":[32],"errorMessage":[32],"token":[32],"flow":[32],"showResendOtp":[32],"isLastWarning":[32]},[[8,"stepUpAuthRequired","handleStepUpAuthEvent"],[8,"closePopup","handleCloseWidget"]],{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
12
12
  };
13
13
 
14
14
  exports.setNonce = index.setNonce;
@@ -63,6 +63,7 @@ const DEFAULT_LANGUAGE = 'en';
63
63
  const TRANSLATIONS = {
64
64
  en: {
65
65
  popupMessage: 'Please enter the security code received on your email address to perform the update.',
66
+ popupMessageLastWarning: 'If the next validation attempt is failed, you will be logged out and blocked temporarily.',
66
67
  minutes: 'minutes',
67
68
  errorHeader: 'Error',
68
69
  configError: 'Unable to load OTP data. Please try again later.',
@@ -76,6 +77,7 @@ const TRANSLATIONS = {
76
77
  },
77
78
  ro: {
78
79
  popupMessage: 'Introduceți codul de securitate primit pe adresa dvs. de e-mail pentru a efectua actualizarea.',
80
+ popupMessageLastWarning: 'Dacă următoarea încercare de validare eșuează, veți fi delogat și blocat temporar.',
79
81
  minutes: 'minute',
80
82
  errorHeader: 'Eroare',
81
83
  configError: 'Nu s-a putut încărca datele OTP. Vă rugăm să încercați din nou mai târziu.',
@@ -89,6 +91,7 @@ const TRANSLATIONS = {
89
91
  },
90
92
  fr: {
91
93
  popupMessage: 'Veuillez entrer le code de sécurité reçu sur votre adresse e-mail pour effectuer la mise à jour.',
94
+ popupMessageLastWarning: 'Si la prochaine tentative de validation échoue, vous serez déconnecté et temporairement bloqué.',
92
95
  minutes: 'minutes',
93
96
  errorHeader: 'Erreur',
94
97
  configError: 'Impossible de charger les données OTP. Veuillez réessayer plus tard.',
@@ -102,6 +105,7 @@ const TRANSLATIONS = {
102
105
  },
103
106
  hu: {
104
107
  popupMessage: 'Kérjük, adja meg az e-mail címére küldött biztonsági kódot a frissítés végrehajtásához.',
108
+ popupMessageLastWarning: 'Ha a következő érvényesítési kísérlet sikertelen, ki lesz jelentkeztetve és ideiglenesen letiltva.',
105
109
  minutes: 'perc',
106
110
  errorHeader: 'Hiba',
107
111
  configError: 'Nem sikerült betölteni az OTP adatokat. Kérjük, próbálja újra később.',
@@ -115,6 +119,7 @@ const TRANSLATIONS = {
115
119
  },
116
120
  tr: {
117
121
  popupMessage: 'Güncellemeyi gerçekleştirmek için e-posta adresinize gelen güvenlik kodunu girin.',
122
+ popupMessageLastWarning: 'Bir sonraki doğrulama girişimi başarısız olursa, oturumunuz kapatılacak ve geçici olarak engelleneceksiniz.',
118
123
  minutes: 'dakika',
119
124
  errorHeader: 'Hata',
120
125
  configError: 'OTP verisi yüklenemedi. Lütfen daha sonra tekrar deneyin.',
@@ -128,6 +133,7 @@ const TRANSLATIONS = {
128
133
  },
129
134
  el: {
130
135
  popupMessage: 'Παρακαλώ εισάγετε τον κωδικό ασφαλείας που λάβατε στο email σας για να ολοκληρώσετε την ενημέρωση.',
136
+ popupMessageLastWarning: 'Αν η επόμενη προσπάθεια επικύρωσης αποτύχει, θα αποσυνδεθείτε και θα αποκλειστείτε προσωρινά.',
131
137
  minutes: 'λεπτά',
132
138
  errorHeader: 'Σφάλμα',
133
139
  configError: 'Δεν ήταν δυνατή η φόρτωση των δεδομένων OTP. Παρακαλούμε προσπαθήστε ξανά αργότερα.',
@@ -141,6 +147,7 @@ const TRANSLATIONS = {
141
147
  },
142
148
  es: {
143
149
  popupMessage: 'Por favor, introduzca el código de seguridad recibido en su correo electrónico para realizar la actualización.',
150
+ popupMessageLastWarning: 'Si el siguiente intento de validación falla, se cerrará tu sesión y serás bloqueado temporalmente.',
144
151
  minutes: 'minutos',
145
152
  errorHeader: 'Error',
146
153
  configError: 'No se pudo cargar los datos del OTP. Por favor, inténtelo de nuevo más tarde.',
@@ -154,6 +161,7 @@ const TRANSLATIONS = {
154
161
  },
155
162
  pt: {
156
163
  popupMessage: 'Por favor, insira o código de segurança recebido no seu e-mail para realizar a atualização.',
164
+ popupMessageLastWarning: 'Se a próxima tentativa de validação falhar, será desconectado e temporariamente bloqueado.',
157
165
  minutes: 'minutos',
158
166
  errorHeader: 'Erro',
159
167
  configError: 'Não foi possível carregar os dados do OTP. Tente novamente mais tarde.',
@@ -167,6 +175,7 @@ const TRANSLATIONS = {
167
175
  },
168
176
  hr: {
169
177
  popupMessage: 'Unesite sigurnosni kod primljen na vašu e-mail adresu kako biste izvršili ažuriranje.',
178
+ popupMessageLastWarning: 'Ako sljedeći pokušaj provjere ne uspije, bit ćete odjavljeni i privremeno blokirani.',
170
179
  minutes: 'minute',
171
180
  errorHeader: 'Greška',
172
181
  configError: 'Nije moguće učitati OTP podatke. Pokušajte ponovno kasnije.',
@@ -180,6 +189,7 @@ const TRANSLATIONS = {
180
189
  },
181
190
  de: {
182
191
  popupMessage: 'Bitte geben Sie den Sicherheitscode ein, den Sie an Ihre E-Mail-Adresse erhalten haben, um das Update durchzuführen.',
192
+ popupMessageLastWarning: 'Wenn der nächste Validierungsversuch fehlschlägt, werden Sie abgemeldet und vorübergehend gesperrt.',
183
193
  minutes: 'Minuten',
184
194
  errorHeader: 'Fehler',
185
195
  configError: 'OTP-Daten konnten nicht geladen werden. Bitte versuchen Sie es später erneut.',
@@ -193,6 +203,7 @@ const TRANSLATIONS = {
193
203
  },
194
204
  'es-mx': {
195
205
  popupMessage: 'Por favor, ingrese el código de seguridad recibido en su correo electrónico para realizar la actualización.',
206
+ popupMessageLastWarning: 'Si el siguiente intento de validación falla, se cerrará tu sesión y serás bloqueado temporalmente.',
196
207
  minutes: 'minutos',
197
208
  errorHeader: 'Error',
198
209
  configError: 'No se pudieron cargar los datos del OTP. Inténtelo de nuevo más tarde.',
@@ -206,6 +217,7 @@ const TRANSLATIONS = {
206
217
  },
207
218
  'pt-br': {
208
219
  popupMessage: 'Por favor, digite o código de segurança recebido no seu e-mail para realizar a atualização.',
220
+ popupMessageLastWarning: 'Se a próxima tentativa de validação falhar, você será desconectado e bloqueado temporariamente.',
209
221
  minutes: 'minutos',
210
222
  errorHeader: 'Erro',
211
223
  configError: 'Não foi possível carregar os dados do OTP. Tente novamente mais tarde.',
@@ -339,7 +351,7 @@ const PlayerStepUpAuth = class {
339
351
  this.token = '';
340
352
  this.flow = '';
341
353
  this.showResendOtp = false;
342
- this.closePopup = this.closePopup.bind(this);
354
+ this.isLastWarning = false;
343
355
  this.handleResendOtp = this.handleResendOtp.bind(this);
344
356
  this.submitOtp = this.submitOtp.bind(this);
345
357
  this.setOtpContainerRef = this.setOtpContainerRef.bind(this);
@@ -571,16 +583,11 @@ const PlayerStepUpAuth = class {
571
583
  }
572
584
  catch (error) {
573
585
  if (error.message === 'gm.multifactorauthentication.challenge') {
586
+ if (this.config.numberOfValidateAttempts === (this.config.maxValidationAttempts - 2)) {
587
+ this.isLastWarning = true;
588
+ }
574
589
  if (this.config.numberOfValidateAttempts === (this.config.maxValidationAttempts - 1)) {
575
- //Set timeout for 1h
576
- const serverTime = new Date(this.serverTime);
577
- serverTime.setHours(serverTime.getHours() + 1);
578
- const timeoutExpiryDate = serverTime.toISOString().slice(0, 16).replace('T', ' ');
579
- window.postMessage({
580
- type: 'SetPlayerAccountTimeout',
581
- timeoutSelected: 'CoolOffUntilSelectedDate',
582
- timeoutExpiryDate
583
- }, window.location.href);
590
+ window.dispatchEvent(new CustomEvent('otpSetTimeout'));
584
591
  //Trigger notification
585
592
  window.postMessage({
586
593
  type: 'WidgetNotification',
@@ -589,7 +596,7 @@ const PlayerStepUpAuth = class {
589
596
  message: translate('accountBlocked', this.language)
590
597
  }
591
598
  }, window.location.href);
592
- this.closePopup();
599
+ this.handleCloseWidget();
593
600
  return;
594
601
  }
595
602
  this.hasErrors = true;
@@ -613,13 +620,7 @@ const PlayerStepUpAuth = class {
613
620
  window.dispatchEvent(new CustomEvent('otpSuccess', {
614
621
  detail: { message: 'User successfully authenticated' }
615
622
  }));
616
- this.closePopup();
617
- }
618
- /**
619
- * Emits an event to close the popup.
620
- */
621
- closePopup() {
622
- window.dispatchEvent(new CustomEvent('closePopup'));
623
+ this.handleCloseWidget();
623
624
  }
624
625
  /**
625
626
  * Emits an event when the close button is pressed.
@@ -667,7 +668,7 @@ const PlayerStepUpAuth = class {
667
668
  * Displays the OTP popup, input fields, timer, and action buttons.
668
669
  */
669
670
  render() {
670
- return (index.h("div", { key: '40c38bf36879053a8d1ec1757f9f1139cde8409f', ref: el => this.stylingContainer = el }, this.showPopup && (index.h("div", { key: '06723ab7b14e3ca2ac4fbc9d012fabf953406f6b', class: "OtpPopupOverlay" }, index.h("div", { key: 'c1a3d48e4c96049306b045ae4dcbc013f8fcf124', class: "OtpPopupContent" }, this.isLoading ? (index.h("div", { class: "OtpLoaderContainer" }, index.h("span", { class: "OtpLoader" }))) : (this.hasConfigErrors ? (index.h("div", { class: "OtpError" }, index.h("div", { class: "OtpErrorHeader" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, index.h("path", { d: "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z" })), index.h("h2", null, translate('errorHeader', this.language))), index.h("p", null, this.errorMessage), index.h("button", { class: "OtpButton error", onClick: this.manualClosePopup }, translate('close', this.language)))) : (index.h(index.Fragment, null, index.h("div", { class: "otp-description" }, index.h("p", null, translate('popupMessage', this.language)), this.hasErrors && index.h("p", { class: "OtpErrorMessage" }, this.errorMessage)), index.h("div", { class: "OtpFieldWrapper" }, index.h("h2", null, translate('otpHeading', this.language)), index.h("div", { class: "OtpField", ref: this.setOtpContainerRef }, this.otp.map((char, index$1) => {
671
+ return (index.h("div", { key: 'b069d0d6602230ca0810d6db4cbfec95cb358759', ref: el => this.stylingContainer = el }, this.showPopup && (index.h("div", { key: '9571d50a06540d69f204579d9f6e07dc394dd8d6', class: "OtpPopupOverlay" }, index.h("div", { key: '27378e80e17f51aa0492b01cd6562abb8065a67d', class: "OtpPopupContent" }, this.isLoading ? (index.h("div", { class: "OtpLoaderContainer" }, index.h("span", { class: "OtpLoader" }))) : (this.hasConfigErrors ? (index.h("div", { class: "OtpError" }, index.h("div", { class: "OtpErrorHeader" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, index.h("path", { d: "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z" })), index.h("h2", null, translate('errorHeader', this.language))), index.h("p", null, this.errorMessage), index.h("button", { class: "OtpButton error", onClick: this.manualClosePopup }, translate('close', this.language)))) : (index.h(index.Fragment, null, index.h("div", { class: "otp-description" }, index.h("p", { class: this.isLastWarning ? 'LastWarningMessage' : '' }, translate(this.isLastWarning ? 'popupMessageLastWarning' : 'popupMessage', this.language)), this.hasErrors && index.h("p", { class: "OtpErrorMessage" }, this.errorMessage)), index.h("div", { class: "OtpFieldWrapper" }, index.h("h2", null, translate('otpHeading', this.language)), index.h("div", { class: "OtpField", ref: this.setOtpContainerRef }, this.otp.map((char, index$1) => {
671
672
  const isHalfway = this.config.inputLength % 2 === 0 && index$1 === (this.config.inputLength / 2) - 1;
672
673
  return (index.h("input", { key: index$1, ref: el => this.setOtpInputRef(el, index$1), id: `otp-input-${index$1}`, type: "text", class: `otp-box ${isHalfway ? 'space' : ''}`, maxLength: 1, value: char, onInput: (event) => this.handleOtpInput(event, index$1), onKeyDown: (event) => this.handleKeyDown(event, index$1), onPaste: (event) => this.handleOnPasteOtp(event), disabled: this.timeLeft <= 0 }));
673
674
  })), index.h("div", { class: "otp-timer" }, this.formatTime(this.timeLeft), " ", translate('minutes', this.language))), index.h("div", { class: "OtpActionButtons" }, this.showResendOtp ? (index.h("button", { class: "OtpButton", onClick: this.handleResendOtp }, translate('resendOtp', this.language))) : (index.h("button", { class: "OtpButton", onClick: this.submitOtp, disabled: this.otp.join('').length !== this.config.inputLength }, translate('submit', this.language))), index.h("button", { class: "OtpButton", onClick: this.manualClosePopup }, translate('close', this.language)))))))))));
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const playerStepUpAuth = require('./player-step-up-auth-01cbec8a.js');
5
+ const playerStepUpAuth = require('./player-step-up-auth-cdfb27c4.js');
6
6
  require('./index-bf4d774c.js');
7
7
 
8
8
 
@@ -19,7 +19,7 @@ var patchBrowser = () => {
19
19
 
20
20
  patchBrowser().then(async (options) => {
21
21
  await appGlobals.globalScripts();
22
- return index.bootstrapLazy([["player-step-up-auth.cjs",[[1,"player-step-up-auth",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"endpoint":[513],"userSession":[513,"user-session"],"translationUrl":[513,"translation-url"],"showPopup":[32],"otp":[32],"isLoading":[32],"config":[32],"timeLeft":[32],"expirationTime":[32],"serverTime":[32],"hasErrors":[32],"hasConfigErrors":[32],"errorMessage":[32],"token":[32],"flow":[32],"showResendOtp":[32]},[[8,"stepUpAuthRequired","handleStepUpAuthEvent"],[8,"closePopup","handleCloseWidget"]],{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
22
+ return index.bootstrapLazy([["player-step-up-auth.cjs",[[1,"player-step-up-auth",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"endpoint":[513],"userSession":[513,"user-session"],"translationUrl":[513,"translation-url"],"showPopup":[32],"otp":[32],"isLoading":[32],"config":[32],"timeLeft":[32],"expirationTime":[32],"serverTime":[32],"hasErrors":[32],"hasConfigErrors":[32],"errorMessage":[32],"token":[32],"flow":[32],"showResendOtp":[32],"isLastWarning":[32]},[[8,"stepUpAuthRequired","handleStepUpAuthEvent"],[8,"closePopup","handleCloseWidget"]],{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
23
23
  });
24
24
 
25
25
  exports.setNonce = index.setNonce;
@@ -99,7 +99,7 @@ export class PlayerStepUpAuth {
99
99
  this.token = '';
100
100
  this.flow = '';
101
101
  this.showResendOtp = false;
102
- this.closePopup = this.closePopup.bind(this);
102
+ this.isLastWarning = false;
103
103
  this.handleResendOtp = this.handleResendOtp.bind(this);
104
104
  this.submitOtp = this.submitOtp.bind(this);
105
105
  this.setOtpContainerRef = this.setOtpContainerRef.bind(this);
@@ -331,16 +331,11 @@ export class PlayerStepUpAuth {
331
331
  }
332
332
  catch (error) {
333
333
  if (error.message === 'gm.multifactorauthentication.challenge') {
334
+ if (this.config.numberOfValidateAttempts === (this.config.maxValidationAttempts - 2)) {
335
+ this.isLastWarning = true;
336
+ }
334
337
  if (this.config.numberOfValidateAttempts === (this.config.maxValidationAttempts - 1)) {
335
- //Set timeout for 1h
336
- const serverTime = new Date(this.serverTime);
337
- serverTime.setHours(serverTime.getHours() + 1);
338
- const timeoutExpiryDate = serverTime.toISOString().slice(0, 16).replace('T', ' ');
339
- window.postMessage({
340
- type: 'SetPlayerAccountTimeout',
341
- timeoutSelected: 'CoolOffUntilSelectedDate',
342
- timeoutExpiryDate
343
- }, window.location.href);
338
+ window.dispatchEvent(new CustomEvent('otpSetTimeout'));
344
339
  //Trigger notification
345
340
  window.postMessage({
346
341
  type: 'WidgetNotification',
@@ -349,7 +344,7 @@ export class PlayerStepUpAuth {
349
344
  message: translate('accountBlocked', this.language)
350
345
  }
351
346
  }, window.location.href);
352
- this.closePopup();
347
+ this.handleCloseWidget();
353
348
  return;
354
349
  }
355
350
  this.hasErrors = true;
@@ -373,13 +368,7 @@ export class PlayerStepUpAuth {
373
368
  window.dispatchEvent(new CustomEvent('otpSuccess', {
374
369
  detail: { message: 'User successfully authenticated' }
375
370
  }));
376
- this.closePopup();
377
- }
378
- /**
379
- * Emits an event to close the popup.
380
- */
381
- closePopup() {
382
- window.dispatchEvent(new CustomEvent('closePopup'));
371
+ this.handleCloseWidget();
383
372
  }
384
373
  /**
385
374
  * Emits an event when the close button is pressed.
@@ -427,7 +416,7 @@ export class PlayerStepUpAuth {
427
416
  * Displays the OTP popup, input fields, timer, and action buttons.
428
417
  */
429
418
  render() {
430
- return (h("div", { key: '40c38bf36879053a8d1ec1757f9f1139cde8409f', ref: el => this.stylingContainer = el }, this.showPopup && (h("div", { key: '06723ab7b14e3ca2ac4fbc9d012fabf953406f6b', class: "OtpPopupOverlay" }, h("div", { key: 'c1a3d48e4c96049306b045ae4dcbc013f8fcf124', class: "OtpPopupContent" }, this.isLoading ? (h("div", { class: "OtpLoaderContainer" }, h("span", { class: "OtpLoader" }))) : (this.hasConfigErrors ? (h("div", { class: "OtpError" }, h("div", { class: "OtpErrorHeader" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, h("path", { d: "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z" })), h("h2", null, translate('errorHeader', this.language))), h("p", null, this.errorMessage), h("button", { class: "OtpButton error", onClick: this.manualClosePopup }, translate('close', this.language)))) : (h(Fragment, null, h("div", { class: "otp-description" }, h("p", null, translate('popupMessage', this.language)), this.hasErrors && h("p", { class: "OtpErrorMessage" }, this.errorMessage)), h("div", { class: "OtpFieldWrapper" }, h("h2", null, translate('otpHeading', this.language)), h("div", { class: "OtpField", ref: this.setOtpContainerRef }, this.otp.map((char, index) => {
419
+ return (h("div", { key: 'b069d0d6602230ca0810d6db4cbfec95cb358759', ref: el => this.stylingContainer = el }, this.showPopup && (h("div", { key: '9571d50a06540d69f204579d9f6e07dc394dd8d6', class: "OtpPopupOverlay" }, h("div", { key: '27378e80e17f51aa0492b01cd6562abb8065a67d', class: "OtpPopupContent" }, this.isLoading ? (h("div", { class: "OtpLoaderContainer" }, h("span", { class: "OtpLoader" }))) : (this.hasConfigErrors ? (h("div", { class: "OtpError" }, h("div", { class: "OtpErrorHeader" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, h("path", { d: "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z" })), h("h2", null, translate('errorHeader', this.language))), h("p", null, this.errorMessage), h("button", { class: "OtpButton error", onClick: this.manualClosePopup }, translate('close', this.language)))) : (h(Fragment, null, h("div", { class: "otp-description" }, h("p", { class: this.isLastWarning ? 'LastWarningMessage' : '' }, translate(this.isLastWarning ? 'popupMessageLastWarning' : 'popupMessage', this.language)), this.hasErrors && h("p", { class: "OtpErrorMessage" }, this.errorMessage)), h("div", { class: "OtpFieldWrapper" }, h("h2", null, translate('otpHeading', this.language)), h("div", { class: "OtpField", ref: this.setOtpContainerRef }, this.otp.map((char, index) => {
431
420
  const isHalfway = this.config.inputLength % 2 === 0 && index === (this.config.inputLength / 2) - 1;
432
421
  return (h("input", { key: index, ref: el => this.setOtpInputRef(el, index), id: `otp-input-${index}`, type: "text", class: `otp-box ${isHalfway ? 'space' : ''}`, maxLength: 1, value: char, onInput: (event) => this.handleOtpInput(event, index), onKeyDown: (event) => this.handleKeyDown(event, index), onPaste: (event) => this.handleOnPasteOtp(event), disabled: this.timeLeft <= 0 }));
433
422
  })), h("div", { class: "otp-timer" }, this.formatTime(this.timeLeft), " ", translate('minutes', this.language))), h("div", { class: "OtpActionButtons" }, this.showResendOtp ? (h("button", { class: "OtpButton", onClick: this.handleResendOtp }, translate('resendOtp', this.language))) : (h("button", { class: "OtpButton", onClick: this.submitOtp, disabled: this.otp.join('').length !== this.config.inputLength }, translate('submit', this.language))), h("button", { class: "OtpButton", onClick: this.manualClosePopup }, translate('close', this.language)))))))))));
@@ -583,7 +572,8 @@ export class PlayerStepUpAuth {
583
572
  "errorMessage": {},
584
573
  "token": {},
585
574
  "flow": {},
586
- "showResendOtp": {}
575
+ "showResendOtp": {},
576
+ "isLastWarning": {}
587
577
  };
588
578
  }
589
579
  static get elementRef() { return "el"; }
@@ -2,6 +2,7 @@ const DEFAULT_LANGUAGE = 'en';
2
2
  const TRANSLATIONS = {
3
3
  en: {
4
4
  popupMessage: 'Please enter the security code received on your email address to perform the update.',
5
+ popupMessageLastWarning: 'If the next validation attempt is failed, you will be logged out and blocked temporarily.',
5
6
  minutes: 'minutes',
6
7
  errorHeader: 'Error',
7
8
  configError: 'Unable to load OTP data. Please try again later.',
@@ -15,6 +16,7 @@ const TRANSLATIONS = {
15
16
  },
16
17
  ro: {
17
18
  popupMessage: 'Introduceți codul de securitate primit pe adresa dvs. de e-mail pentru a efectua actualizarea.',
19
+ popupMessageLastWarning: 'Dacă următoarea încercare de validare eșuează, veți fi delogat și blocat temporar.',
18
20
  minutes: 'minute',
19
21
  errorHeader: 'Eroare',
20
22
  configError: 'Nu s-a putut încărca datele OTP. Vă rugăm să încercați din nou mai târziu.',
@@ -28,6 +30,7 @@ const TRANSLATIONS = {
28
30
  },
29
31
  fr: {
30
32
  popupMessage: 'Veuillez entrer le code de sécurité reçu sur votre adresse e-mail pour effectuer la mise à jour.',
33
+ popupMessageLastWarning: 'Si la prochaine tentative de validation échoue, vous serez déconnecté et temporairement bloqué.',
31
34
  minutes: 'minutes',
32
35
  errorHeader: 'Erreur',
33
36
  configError: 'Impossible de charger les données OTP. Veuillez réessayer plus tard.',
@@ -41,6 +44,7 @@ const TRANSLATIONS = {
41
44
  },
42
45
  hu: {
43
46
  popupMessage: 'Kérjük, adja meg az e-mail címére küldött biztonsági kódot a frissítés végrehajtásához.',
47
+ popupMessageLastWarning: 'Ha a következő érvényesítési kísérlet sikertelen, ki lesz jelentkeztetve és ideiglenesen letiltva.',
44
48
  minutes: 'perc',
45
49
  errorHeader: 'Hiba',
46
50
  configError: 'Nem sikerült betölteni az OTP adatokat. Kérjük, próbálja újra később.',
@@ -54,6 +58,7 @@ const TRANSLATIONS = {
54
58
  },
55
59
  tr: {
56
60
  popupMessage: 'Güncellemeyi gerçekleştirmek için e-posta adresinize gelen güvenlik kodunu girin.',
61
+ popupMessageLastWarning: 'Bir sonraki doğrulama girişimi başarısız olursa, oturumunuz kapatılacak ve geçici olarak engelleneceksiniz.',
57
62
  minutes: 'dakika',
58
63
  errorHeader: 'Hata',
59
64
  configError: 'OTP verisi yüklenemedi. Lütfen daha sonra tekrar deneyin.',
@@ -67,6 +72,7 @@ const TRANSLATIONS = {
67
72
  },
68
73
  el: {
69
74
  popupMessage: 'Παρακαλώ εισάγετε τον κωδικό ασφαλείας που λάβατε στο email σας για να ολοκληρώσετε την ενημέρωση.',
75
+ popupMessageLastWarning: 'Αν η επόμενη προσπάθεια επικύρωσης αποτύχει, θα αποσυνδεθείτε και θα αποκλειστείτε προσωρινά.',
70
76
  minutes: 'λεπτά',
71
77
  errorHeader: 'Σφάλμα',
72
78
  configError: 'Δεν ήταν δυνατή η φόρτωση των δεδομένων OTP. Παρακαλούμε προσπαθήστε ξανά αργότερα.',
@@ -80,6 +86,7 @@ const TRANSLATIONS = {
80
86
  },
81
87
  es: {
82
88
  popupMessage: 'Por favor, introduzca el código de seguridad recibido en su correo electrónico para realizar la actualización.',
89
+ popupMessageLastWarning: 'Si el siguiente intento de validación falla, se cerrará tu sesión y serás bloqueado temporalmente.',
83
90
  minutes: 'minutos',
84
91
  errorHeader: 'Error',
85
92
  configError: 'No se pudo cargar los datos del OTP. Por favor, inténtelo de nuevo más tarde.',
@@ -93,6 +100,7 @@ const TRANSLATIONS = {
93
100
  },
94
101
  pt: {
95
102
  popupMessage: 'Por favor, insira o código de segurança recebido no seu e-mail para realizar a atualização.',
103
+ popupMessageLastWarning: 'Se a próxima tentativa de validação falhar, será desconectado e temporariamente bloqueado.',
96
104
  minutes: 'minutos',
97
105
  errorHeader: 'Erro',
98
106
  configError: 'Não foi possível carregar os dados do OTP. Tente novamente mais tarde.',
@@ -106,6 +114,7 @@ const TRANSLATIONS = {
106
114
  },
107
115
  hr: {
108
116
  popupMessage: 'Unesite sigurnosni kod primljen na vašu e-mail adresu kako biste izvršili ažuriranje.',
117
+ popupMessageLastWarning: 'Ako sljedeći pokušaj provjere ne uspije, bit ćete odjavljeni i privremeno blokirani.',
109
118
  minutes: 'minute',
110
119
  errorHeader: 'Greška',
111
120
  configError: 'Nije moguće učitati OTP podatke. Pokušajte ponovno kasnije.',
@@ -119,6 +128,7 @@ const TRANSLATIONS = {
119
128
  },
120
129
  de: {
121
130
  popupMessage: 'Bitte geben Sie den Sicherheitscode ein, den Sie an Ihre E-Mail-Adresse erhalten haben, um das Update durchzuführen.',
131
+ popupMessageLastWarning: 'Wenn der nächste Validierungsversuch fehlschlägt, werden Sie abgemeldet und vorübergehend gesperrt.',
122
132
  minutes: 'Minuten',
123
133
  errorHeader: 'Fehler',
124
134
  configError: 'OTP-Daten konnten nicht geladen werden. Bitte versuchen Sie es später erneut.',
@@ -132,6 +142,7 @@ const TRANSLATIONS = {
132
142
  },
133
143
  'es-mx': {
134
144
  popupMessage: 'Por favor, ingrese el código de seguridad recibido en su correo electrónico para realizar la actualización.',
145
+ popupMessageLastWarning: 'Si el siguiente intento de validación falla, se cerrará tu sesión y serás bloqueado temporalmente.',
135
146
  minutes: 'minutos',
136
147
  errorHeader: 'Error',
137
148
  configError: 'No se pudieron cargar los datos del OTP. Inténtelo de nuevo más tarde.',
@@ -145,6 +156,7 @@ const TRANSLATIONS = {
145
156
  },
146
157
  'pt-br': {
147
158
  popupMessage: 'Por favor, digite o código de segurança recebido no seu e-mail para realizar a atualização.',
159
+ popupMessageLastWarning: 'Se a próxima tentativa de validação falhar, você será desconectado e bloqueado temporariamente.',
148
160
  minutes: 'minutos',
149
161
  errorHeader: 'Erro',
150
162
  configError: 'Não foi possível carregar os dados do OTP. Tente novamente mais tarde.',
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { P as PlayerStepUpAuth } from './player-step-up-auth-8b1b654c.js';
1
+ export { P as PlayerStepUpAuth } from './player-step-up-auth-8479f64b.js';
2
2
  import './index-c6eee6d8.js';
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-0f993ce5.js';
5
5
  const defineCustomElements = async (win, options) => {
6
6
  if (typeof window === 'undefined') return undefined;
7
7
  await globalScripts();
8
- return bootstrapLazy([["player-step-up-auth",[[1,"player-step-up-auth",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"endpoint":[513],"userSession":[513,"user-session"],"translationUrl":[513,"translation-url"],"showPopup":[32],"otp":[32],"isLoading":[32],"config":[32],"timeLeft":[32],"expirationTime":[32],"serverTime":[32],"hasErrors":[32],"hasConfigErrors":[32],"errorMessage":[32],"token":[32],"flow":[32],"showResendOtp":[32]},[[8,"stepUpAuthRequired","handleStepUpAuthEvent"],[8,"closePopup","handleCloseWidget"]],{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
8
+ return bootstrapLazy([["player-step-up-auth",[[1,"player-step-up-auth",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"endpoint":[513],"userSession":[513,"user-session"],"translationUrl":[513,"translation-url"],"showPopup":[32],"otp":[32],"isLoading":[32],"config":[32],"timeLeft":[32],"expirationTime":[32],"serverTime":[32],"hasErrors":[32],"hasConfigErrors":[32],"errorMessage":[32],"token":[32],"flow":[32],"showResendOtp":[32],"isLastWarning":[32]},[[8,"stepUpAuthRequired","handleStepUpAuthEvent"],[8,"closePopup","handleCloseWidget"]],{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
9
9
  };
10
10
 
11
11
  export { defineCustomElements };
@@ -61,6 +61,7 @@ const DEFAULT_LANGUAGE = 'en';
61
61
  const TRANSLATIONS = {
62
62
  en: {
63
63
  popupMessage: 'Please enter the security code received on your email address to perform the update.',
64
+ popupMessageLastWarning: 'If the next validation attempt is failed, you will be logged out and blocked temporarily.',
64
65
  minutes: 'minutes',
65
66
  errorHeader: 'Error',
66
67
  configError: 'Unable to load OTP data. Please try again later.',
@@ -74,6 +75,7 @@ const TRANSLATIONS = {
74
75
  },
75
76
  ro: {
76
77
  popupMessage: 'Introduceți codul de securitate primit pe adresa dvs. de e-mail pentru a efectua actualizarea.',
78
+ popupMessageLastWarning: 'Dacă următoarea încercare de validare eșuează, veți fi delogat și blocat temporar.',
77
79
  minutes: 'minute',
78
80
  errorHeader: 'Eroare',
79
81
  configError: 'Nu s-a putut încărca datele OTP. Vă rugăm să încercați din nou mai târziu.',
@@ -87,6 +89,7 @@ const TRANSLATIONS = {
87
89
  },
88
90
  fr: {
89
91
  popupMessage: 'Veuillez entrer le code de sécurité reçu sur votre adresse e-mail pour effectuer la mise à jour.',
92
+ popupMessageLastWarning: 'Si la prochaine tentative de validation échoue, vous serez déconnecté et temporairement bloqué.',
90
93
  minutes: 'minutes',
91
94
  errorHeader: 'Erreur',
92
95
  configError: 'Impossible de charger les données OTP. Veuillez réessayer plus tard.',
@@ -100,6 +103,7 @@ const TRANSLATIONS = {
100
103
  },
101
104
  hu: {
102
105
  popupMessage: 'Kérjük, adja meg az e-mail címére küldött biztonsági kódot a frissítés végrehajtásához.',
106
+ popupMessageLastWarning: 'Ha a következő érvényesítési kísérlet sikertelen, ki lesz jelentkeztetve és ideiglenesen letiltva.',
103
107
  minutes: 'perc',
104
108
  errorHeader: 'Hiba',
105
109
  configError: 'Nem sikerült betölteni az OTP adatokat. Kérjük, próbálja újra később.',
@@ -113,6 +117,7 @@ const TRANSLATIONS = {
113
117
  },
114
118
  tr: {
115
119
  popupMessage: 'Güncellemeyi gerçekleştirmek için e-posta adresinize gelen güvenlik kodunu girin.',
120
+ popupMessageLastWarning: 'Bir sonraki doğrulama girişimi başarısız olursa, oturumunuz kapatılacak ve geçici olarak engelleneceksiniz.',
116
121
  minutes: 'dakika',
117
122
  errorHeader: 'Hata',
118
123
  configError: 'OTP verisi yüklenemedi. Lütfen daha sonra tekrar deneyin.',
@@ -126,6 +131,7 @@ const TRANSLATIONS = {
126
131
  },
127
132
  el: {
128
133
  popupMessage: 'Παρακαλώ εισάγετε τον κωδικό ασφαλείας που λάβατε στο email σας για να ολοκληρώσετε την ενημέρωση.',
134
+ popupMessageLastWarning: 'Αν η επόμενη προσπάθεια επικύρωσης αποτύχει, θα αποσυνδεθείτε και θα αποκλειστείτε προσωρινά.',
129
135
  minutes: 'λεπτά',
130
136
  errorHeader: 'Σφάλμα',
131
137
  configError: 'Δεν ήταν δυνατή η φόρτωση των δεδομένων OTP. Παρακαλούμε προσπαθήστε ξανά αργότερα.',
@@ -139,6 +145,7 @@ const TRANSLATIONS = {
139
145
  },
140
146
  es: {
141
147
  popupMessage: 'Por favor, introduzca el código de seguridad recibido en su correo electrónico para realizar la actualización.',
148
+ popupMessageLastWarning: 'Si el siguiente intento de validación falla, se cerrará tu sesión y serás bloqueado temporalmente.',
142
149
  minutes: 'minutos',
143
150
  errorHeader: 'Error',
144
151
  configError: 'No se pudo cargar los datos del OTP. Por favor, inténtelo de nuevo más tarde.',
@@ -152,6 +159,7 @@ const TRANSLATIONS = {
152
159
  },
153
160
  pt: {
154
161
  popupMessage: 'Por favor, insira o código de segurança recebido no seu e-mail para realizar a atualização.',
162
+ popupMessageLastWarning: 'Se a próxima tentativa de validação falhar, será desconectado e temporariamente bloqueado.',
155
163
  minutes: 'minutos',
156
164
  errorHeader: 'Erro',
157
165
  configError: 'Não foi possível carregar os dados do OTP. Tente novamente mais tarde.',
@@ -165,6 +173,7 @@ const TRANSLATIONS = {
165
173
  },
166
174
  hr: {
167
175
  popupMessage: 'Unesite sigurnosni kod primljen na vašu e-mail adresu kako biste izvršili ažuriranje.',
176
+ popupMessageLastWarning: 'Ako sljedeći pokušaj provjere ne uspije, bit ćete odjavljeni i privremeno blokirani.',
168
177
  minutes: 'minute',
169
178
  errorHeader: 'Greška',
170
179
  configError: 'Nije moguće učitati OTP podatke. Pokušajte ponovno kasnije.',
@@ -178,6 +187,7 @@ const TRANSLATIONS = {
178
187
  },
179
188
  de: {
180
189
  popupMessage: 'Bitte geben Sie den Sicherheitscode ein, den Sie an Ihre E-Mail-Adresse erhalten haben, um das Update durchzuführen.',
190
+ popupMessageLastWarning: 'Wenn der nächste Validierungsversuch fehlschlägt, werden Sie abgemeldet und vorübergehend gesperrt.',
181
191
  minutes: 'Minuten',
182
192
  errorHeader: 'Fehler',
183
193
  configError: 'OTP-Daten konnten nicht geladen werden. Bitte versuchen Sie es später erneut.',
@@ -191,6 +201,7 @@ const TRANSLATIONS = {
191
201
  },
192
202
  'es-mx': {
193
203
  popupMessage: 'Por favor, ingrese el código de seguridad recibido en su correo electrónico para realizar la actualización.',
204
+ popupMessageLastWarning: 'Si el siguiente intento de validación falla, se cerrará tu sesión y serás bloqueado temporalmente.',
194
205
  minutes: 'minutos',
195
206
  errorHeader: 'Error',
196
207
  configError: 'No se pudieron cargar los datos del OTP. Inténtelo de nuevo más tarde.',
@@ -204,6 +215,7 @@ const TRANSLATIONS = {
204
215
  },
205
216
  'pt-br': {
206
217
  popupMessage: 'Por favor, digite o código de segurança recebido no seu e-mail para realizar a atualização.',
218
+ popupMessageLastWarning: 'Se a próxima tentativa de validação falhar, você será desconectado e bloqueado temporariamente.',
207
219
  minutes: 'minutos',
208
220
  errorHeader: 'Erro',
209
221
  configError: 'Não foi possível carregar os dados do OTP. Tente novamente mais tarde.',
@@ -337,7 +349,7 @@ const PlayerStepUpAuth = class {
337
349
  this.token = '';
338
350
  this.flow = '';
339
351
  this.showResendOtp = false;
340
- this.closePopup = this.closePopup.bind(this);
352
+ this.isLastWarning = false;
341
353
  this.handleResendOtp = this.handleResendOtp.bind(this);
342
354
  this.submitOtp = this.submitOtp.bind(this);
343
355
  this.setOtpContainerRef = this.setOtpContainerRef.bind(this);
@@ -569,16 +581,11 @@ const PlayerStepUpAuth = class {
569
581
  }
570
582
  catch (error) {
571
583
  if (error.message === 'gm.multifactorauthentication.challenge') {
584
+ if (this.config.numberOfValidateAttempts === (this.config.maxValidationAttempts - 2)) {
585
+ this.isLastWarning = true;
586
+ }
572
587
  if (this.config.numberOfValidateAttempts === (this.config.maxValidationAttempts - 1)) {
573
- //Set timeout for 1h
574
- const serverTime = new Date(this.serverTime);
575
- serverTime.setHours(serverTime.getHours() + 1);
576
- const timeoutExpiryDate = serverTime.toISOString().slice(0, 16).replace('T', ' ');
577
- window.postMessage({
578
- type: 'SetPlayerAccountTimeout',
579
- timeoutSelected: 'CoolOffUntilSelectedDate',
580
- timeoutExpiryDate
581
- }, window.location.href);
588
+ window.dispatchEvent(new CustomEvent('otpSetTimeout'));
582
589
  //Trigger notification
583
590
  window.postMessage({
584
591
  type: 'WidgetNotification',
@@ -587,7 +594,7 @@ const PlayerStepUpAuth = class {
587
594
  message: translate('accountBlocked', this.language)
588
595
  }
589
596
  }, window.location.href);
590
- this.closePopup();
597
+ this.handleCloseWidget();
591
598
  return;
592
599
  }
593
600
  this.hasErrors = true;
@@ -611,13 +618,7 @@ const PlayerStepUpAuth = class {
611
618
  window.dispatchEvent(new CustomEvent('otpSuccess', {
612
619
  detail: { message: 'User successfully authenticated' }
613
620
  }));
614
- this.closePopup();
615
- }
616
- /**
617
- * Emits an event to close the popup.
618
- */
619
- closePopup() {
620
- window.dispatchEvent(new CustomEvent('closePopup'));
621
+ this.handleCloseWidget();
621
622
  }
622
623
  /**
623
624
  * Emits an event when the close button is pressed.
@@ -665,7 +666,7 @@ const PlayerStepUpAuth = class {
665
666
  * Displays the OTP popup, input fields, timer, and action buttons.
666
667
  */
667
668
  render() {
668
- return (h("div", { key: '40c38bf36879053a8d1ec1757f9f1139cde8409f', ref: el => this.stylingContainer = el }, this.showPopup && (h("div", { key: '06723ab7b14e3ca2ac4fbc9d012fabf953406f6b', class: "OtpPopupOverlay" }, h("div", { key: 'c1a3d48e4c96049306b045ae4dcbc013f8fcf124', class: "OtpPopupContent" }, this.isLoading ? (h("div", { class: "OtpLoaderContainer" }, h("span", { class: "OtpLoader" }))) : (this.hasConfigErrors ? (h("div", { class: "OtpError" }, h("div", { class: "OtpErrorHeader" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, h("path", { d: "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z" })), h("h2", null, translate('errorHeader', this.language))), h("p", null, this.errorMessage), h("button", { class: "OtpButton error", onClick: this.manualClosePopup }, translate('close', this.language)))) : (h(Fragment, null, h("div", { class: "otp-description" }, h("p", null, translate('popupMessage', this.language)), this.hasErrors && h("p", { class: "OtpErrorMessage" }, this.errorMessage)), h("div", { class: "OtpFieldWrapper" }, h("h2", null, translate('otpHeading', this.language)), h("div", { class: "OtpField", ref: this.setOtpContainerRef }, this.otp.map((char, index) => {
669
+ return (h("div", { key: 'b069d0d6602230ca0810d6db4cbfec95cb358759', ref: el => this.stylingContainer = el }, this.showPopup && (h("div", { key: '9571d50a06540d69f204579d9f6e07dc394dd8d6', class: "OtpPopupOverlay" }, h("div", { key: '27378e80e17f51aa0492b01cd6562abb8065a67d', class: "OtpPopupContent" }, this.isLoading ? (h("div", { class: "OtpLoaderContainer" }, h("span", { class: "OtpLoader" }))) : (this.hasConfigErrors ? (h("div", { class: "OtpError" }, h("div", { class: "OtpErrorHeader" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, h("path", { d: "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z" })), h("h2", null, translate('errorHeader', this.language))), h("p", null, this.errorMessage), h("button", { class: "OtpButton error", onClick: this.manualClosePopup }, translate('close', this.language)))) : (h(Fragment, null, h("div", { class: "otp-description" }, h("p", { class: this.isLastWarning ? 'LastWarningMessage' : '' }, translate(this.isLastWarning ? 'popupMessageLastWarning' : 'popupMessage', this.language)), this.hasErrors && h("p", { class: "OtpErrorMessage" }, this.errorMessage)), h("div", { class: "OtpFieldWrapper" }, h("h2", null, translate('otpHeading', this.language)), h("div", { class: "OtpField", ref: this.setOtpContainerRef }, this.otp.map((char, index) => {
669
670
  const isHalfway = this.config.inputLength % 2 === 0 && index === (this.config.inputLength / 2) - 1;
670
671
  return (h("input", { key: index, ref: el => this.setOtpInputRef(el, index), id: `otp-input-${index}`, type: "text", class: `otp-box ${isHalfway ? 'space' : ''}`, maxLength: 1, value: char, onInput: (event) => this.handleOtpInput(event, index), onKeyDown: (event) => this.handleKeyDown(event, index), onPaste: (event) => this.handleOnPasteOtp(event), disabled: this.timeLeft <= 0 }));
671
672
  })), h("div", { class: "otp-timer" }, this.formatTime(this.timeLeft), " ", translate('minutes', this.language))), h("div", { class: "OtpActionButtons" }, this.showResendOtp ? (h("button", { class: "OtpButton", onClick: this.handleResendOtp }, translate('resendOtp', this.language))) : (h("button", { class: "OtpButton", onClick: this.submitOtp, disabled: this.otp.join('').length !== this.config.inputLength }, translate('submit', this.language))), h("button", { class: "OtpButton", onClick: this.manualClosePopup }, translate('close', this.language)))))))))));
@@ -1,2 +1,2 @@
1
- export { P as player_step_up_auth } from './player-step-up-auth-8b1b654c.js';
1
+ export { P as player_step_up_auth } from './player-step-up-auth-8479f64b.js';
2
2
  import './index-c6eee6d8.js';
@@ -16,5 +16,5 @@ var patchBrowser = () => {
16
16
 
17
17
  patchBrowser().then(async (options) => {
18
18
  await globalScripts();
19
- return bootstrapLazy([["player-step-up-auth",[[1,"player-step-up-auth",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"endpoint":[513],"userSession":[513,"user-session"],"translationUrl":[513,"translation-url"],"showPopup":[32],"otp":[32],"isLoading":[32],"config":[32],"timeLeft":[32],"expirationTime":[32],"serverTime":[32],"hasErrors":[32],"hasConfigErrors":[32],"errorMessage":[32],"token":[32],"flow":[32],"showResendOtp":[32]},[[8,"stepUpAuthRequired","handleStepUpAuthEvent"],[8,"closePopup","handleCloseWidget"]],{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
19
+ return bootstrapLazy([["player-step-up-auth",[[1,"player-step-up-auth",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"endpoint":[513],"userSession":[513,"user-session"],"translationUrl":[513,"translation-url"],"showPopup":[32],"otp":[32],"isLoading":[32],"config":[32],"timeLeft":[32],"expirationTime":[32],"serverTime":[32],"hasErrors":[32],"hasConfigErrors":[32],"errorMessage":[32],"token":[32],"flow":[32],"showResendOtp":[32],"isLastWarning":[32]},[[8,"stepUpAuthRequired","handleStepUpAuthEvent"],[8,"closePopup","handleCloseWidget"]],{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
20
20
  });
@@ -1 +1 @@
1
- export{P as PlayerStepUpAuth}from"./player-step-up-auth-8b1b654c.js";import"./index-c6eee6d8.js";
1
+ export{P as PlayerStepUpAuth}from"./player-step-up-auth-8479f64b.js";import"./index-c6eee6d8.js";
@@ -0,0 +1 @@
1
+ import{r as e,h as t,F as i,g as r}from"./index-c6eee6d8.js";function o(e,t){if(e){const i=document.createElement("style");i.innerHTML=t,e.appendChild(i)}}function s(e,t){const i=new URL(t);fetch(i.href).then((e=>e.text())).then((t=>{const i=document.createElement("style");i.innerHTML=t,e&&e.appendChild(i)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}const a={en:{popupMessage:"Please enter the security code received on your email address to perform the update.",popupMessageLastWarning:"If the next validation attempt is failed, you will be logged out and blocked temporarily.",minutes:"minutes",errorHeader:"Error",configError:"Unable to load OTP data. Please try again later.",otpHeading:"Enter OTP",resendOtp:"Resent OTP",submit:"Submit",close:"Close",invalidOtp:"The code you've sent is not valid. Please try again.",accountBlocked:"Too many attempts for OTP. Your account has been blocked for one hour.",submissionError:"Something went wrong. Please try again."},ro:{popupMessage:"Introduceți codul de securitate primit pe adresa dvs. de e-mail pentru a efectua actualizarea.",popupMessageLastWarning:"Dacă următoarea încercare de validare eșuează, veți fi delogat și blocat temporar.",minutes:"minute",errorHeader:"Eroare",configError:"Nu s-a putut încărca datele OTP. Vă rugăm să încercați din nou mai târziu.",otpHeading:"Introduceți OTP",resendOtp:"Retrimitere OTP",submit:"Trimite",close:"Închide",invalidOtp:"Codul introdus nu este valid. Vă rugăm să încercați din nou.",accountBlocked:"Prea multe încercări de OTP. Contul dvs. a fost blocat timp de o oră.",submissionError:"Ceva a mers prost. Vă rugăm să încercați din nou."},fr:{popupMessage:"Veuillez entrer le code de sécurité reçu sur votre adresse e-mail pour effectuer la mise à jour.",popupMessageLastWarning:"Si la prochaine tentative de validation échoue, vous serez déconnecté et temporairement bloqué.",minutes:"minutes",errorHeader:"Erreur",configError:"Impossible de charger les données OTP. Veuillez réessayer plus tard.",otpHeading:"Entrez OTP",resendOtp:"Renvoyer OTP",submit:"Soumettre",close:"Fermer",invalidOtp:"Le code que vous avez saisi n’est pas valide. Veuillez réessayer.",accountBlocked:"Trop de tentatives OTP. Votre compte a été bloqué pendant une heure.",submissionError:"Quelque chose s'est mal passé. Veuillez réessayer."},hu:{popupMessage:"Kérjük, adja meg az e-mail címére küldött biztonsági kódot a frissítés végrehajtásához.",popupMessageLastWarning:"Ha a következő érvényesítési kísérlet sikertelen, ki lesz jelentkeztetve és ideiglenesen letiltva.",minutes:"perc",errorHeader:"Hiba",configError:"Nem sikerült betölteni az OTP adatokat. Kérjük, próbálja újra később.",otpHeading:"OTP megadása",resendOtp:"Újraküldés",submit:"Beküldés",close:"Bezárás",invalidOtp:"A megadott kód érvénytelen. Kérjük, próbálja újra.",accountBlocked:"Túl sok OTP próbálkozás. A fiókja egy órára zárolva lett.",submissionError:"Valami hiba történt. Kérjük, próbálja újra."},tr:{popupMessage:"Güncellemeyi gerçekleştirmek için e-posta adresinize gelen güvenlik kodunu girin.",popupMessageLastWarning:"Bir sonraki doğrulama girişimi başarısız olursa, oturumunuz kapatılacak ve geçici olarak engelleneceksiniz.",minutes:"dakika",errorHeader:"Hata",configError:"OTP verisi yüklenemedi. Lütfen daha sonra tekrar deneyin.",otpHeading:"OTP Girin",resendOtp:"OTP'yi Yeniden Gönder",submit:"Gönder",close:"Kapat",invalidOtp:"Gönderdiğiniz kod geçersiz. Lütfen tekrar deneyin.",accountBlocked:"Çok fazla OTP denemesi yapıldı. Hesabınız bir saat boyunca kilitlendi.",submissionError:"Bir şeyler yanlış gitti. Lütfen tekrar deneyin."},el:{popupMessage:"Παρακαλώ εισάγετε τον κωδικό ασφαλείας που λάβατε στο email σας για να ολοκληρώσετε την ενημέρωση.",popupMessageLastWarning:"Αν η επόμενη προσπάθεια επικύρωσης αποτύχει, θα αποσυνδεθείτε και θα αποκλειστείτε προσωρινά.",minutes:"λεπτά",errorHeader:"Σφάλμα",configError:"Δεν ήταν δυνατή η φόρτωση των δεδομένων OTP. Παρακαλούμε προσπαθήστε ξανά αργότερα.",otpHeading:"Εισαγωγή OTP",resendOtp:"Αποστολή ξανά OTP",submit:"Υποβολή",close:"Κλείσιμο",invalidOtp:"Ο κωδικός που εισαγάγατε δεν είναι έγκυρος. Παρακαλώ προσπαθήστε ξανά.",accountBlocked:"Πάρα πολλές προσπάθειες OTP. Ο λογαριασμός σας έχει αποκλειστεί για μία ώρα.",submissionError:"Κάτι πήγε στραβά. Παρακαλώ προσπαθήστε ξανά."},es:{popupMessage:"Por favor, introduzca el código de seguridad recibido en su correo electrónico para realizar la actualización.",popupMessageLastWarning:"Si el siguiente intento de validación falla, se cerrará tu sesión y serás bloqueado temporalmente.",minutes:"minutos",errorHeader:"Error",configError:"No se pudo cargar los datos del OTP. Por favor, inténtelo de nuevo más tarde.",otpHeading:"Introducir OTP",resendOtp:"Reenviar OTP",submit:"Enviar",close:"Cerrar",invalidOtp:"El código que ingresaste no es válido. Por favor, inténtalo de nuevo.",accountBlocked:"Demasiados intentos de OTP. Su cuenta ha sido bloqueada por una hora.",submissionError:"Algo salió mal. Por favor, inténtelo de nuevo."},pt:{popupMessage:"Por favor, insira o código de segurança recebido no seu e-mail para realizar a atualização.",popupMessageLastWarning:"Se a próxima tentativa de validação falhar, será desconectado e temporariamente bloqueado.",minutes:"minutos",errorHeader:"Erro",configError:"Não foi possível carregar os dados do OTP. Tente novamente mais tarde.",otpHeading:"Insira o OTP",resendOtp:"Reenviar OTP",submit:"Enviar",close:"Fechar",invalidOtp:"O código inserido não é válido. Por favor, tente novamente.",accountBlocked:"Muitas tentativas de OTP. Sua conta foi bloqueada por uma hora.",submissionError:"Algo deu errado. Por favor, tente novamente."},hr:{popupMessage:"Unesite sigurnosni kod primljen na vašu e-mail adresu kako biste izvršili ažuriranje.",popupMessageLastWarning:"Ako sljedeći pokušaj provjere ne uspije, bit ćete odjavljeni i privremeno blokirani.",minutes:"minute",errorHeader:"Greška",configError:"Nije moguće učitati OTP podatke. Pokušajte ponovno kasnije.",otpHeading:"Unesite OTP",resendOtp:"Ponovno pošalji OTP",submit:"Pošalji",close:"Zatvori",invalidOtp:"Uneseni kod nije valjan. Molimo pokušajte ponovo.",accountBlocked:"Previše pokušaja unosa OTP-a. Vaš račun je blokiran na jedan sat.",submissionError:"Nešto je pošlo po zlu. Molimo pokušajte ponovo."},de:{popupMessage:"Bitte geben Sie den Sicherheitscode ein, den Sie an Ihre E-Mail-Adresse erhalten haben, um das Update durchzuführen.",popupMessageLastWarning:"Wenn der nächste Validierungsversuch fehlschlägt, werden Sie abgemeldet und vorübergehend gesperrt.",minutes:"Minuten",errorHeader:"Fehler",configError:"OTP-Daten konnten nicht geladen werden. Bitte versuchen Sie es später erneut.",otpHeading:"OTP eingeben",resendOtp:"OTP erneut senden",submit:"Absenden",close:"Schließen",invalidOtp:"Der eingegebene Code ist ungültig. Bitte versuchen Sie es erneut.",accountBlocked:"Zu viele OTP-Versuche. Ihr Konto wurde für eine Stunde gesperrt.",submissionError:"Etwas ist schiefgelaufen. Bitte versuchen Sie es erneut."},"es-mx":{popupMessage:"Por favor, ingrese el código de seguridad recibido en su correo electrónico para realizar la actualización.",popupMessageLastWarning:"Si el siguiente intento de validación falla, se cerrará tu sesión y serás bloqueado temporalmente.",minutes:"minutos",errorHeader:"Error",configError:"No se pudieron cargar los datos del OTP. Inténtelo de nuevo más tarde.",otpHeading:"Ingrese OTP",resendOtp:"Reenviar OTP",submit:"Enviar",close:"Cerrar",invalidOtp:"El código que ingresó no es válido. Inténtelo de nuevo.",accountBlocked:"Demasiados intentos de OTP. Su cuenta ha sido bloqueada por una hora.",submissionError:"Algo salió mal. Por favor, inténtelo de nuevo."},"pt-br":{popupMessage:"Por favor, digite o código de segurança recebido no seu e-mail para realizar a atualização.",popupMessageLastWarning:"Se a próxima tentativa de validação falhar, você será desconectado e bloqueado temporariamente.",minutes:"minutos",errorHeader:"Erro",configError:"Não foi possível carregar os dados do OTP. Tente novamente mais tarde.",otpHeading:"Digite o OTP",resendOtp:"Reenviar OTP",submit:"Enviar",close:"Fechar",invalidOtp:"O código informado não é válido. Tente novamente.",accountBlocked:"Muitas tentativas de OTP. Sua conta foi bloqueada por uma hora.",submissionError:"Algo deu errado. Por favor, tente novamente."}},n=e=>new Promise((t=>{fetch(e).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{for(let i in e[t])a[t][i]=e[t][i]})),t(!0)}))})),l=(e,t)=>a[void 0!==t?t:"en"][e],d=class{handleNewTranslations(){n(this.translationUrl)}handleClientStylingChange(e,t){e!==t&&o(this.el,this.clientStyling)}handleClientStylingUrlChange(e,t){e!=t&&this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl)}async handleStepUpAuthEvent(e){var t;if(null===(t=e.detail)||void 0===t?void 0:t["x-step-up-required"]){if(this.hasConfigErrors=!1,this.hasErrors=!1,this.errorMessage="",this.showPopup=!0,this.token=e.detail["x-step-up-token"],this.flow=e.detail.flow,!this.token||!this.flow)return this.isLoading=!1,this.hasConfigErrors=!0,void(this.errorMessage=l("configError",this.language));await this.getConfig()}}handleCloseWidget(){this.hasErrors=!1,this.hasConfigErrors=!1,this.errorMessage="",this.showPopup=!1}constructor(t){e(this,t),this.otpInputs=[],this.countdownTimer=null,this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.language="en",this.endpoint=void 0,this.userSession=void 0,this.translationUrl="",this.showPopup=!1,this.otp=void 0,this.isLoading=!0,this.config=null,this.timeLeft=0,this.expirationTime="",this.serverTime="",this.hasErrors=!1,this.hasConfigErrors=!1,this.errorMessage="",this.token="",this.flow="",this.showResendOtp=!1,this.isLastWarning=!1,this.handleResendOtp=this.handleResendOtp.bind(this),this.submitOtp=this.submitOtp.bind(this),this.setOtpContainerRef=this.setOtpContainerRef.bind(this),this.handleCloseWidget=this.handleCloseWidget.bind(this),this.manualClosePopup=this.manualClosePopup.bind(this)}async getConfig(){if(this.endpoint)try{const e=new URL(`/api/v1/mfa/challenge/${this.token}/config`,this.endpoint);this.isLoading=!0;const t=await fetch(e.href);if(!t.ok)throw new Error(`HTTP error! Status: ${t.status}`);this.config=await t.json(),this.otp=new Array(this.config.inputLength).fill(""),this.isLoading=!1,this.showResendOtp=!1,this.expirationTime=this.config.expirationTime,this.serverTime=this.config.serverTime,0!==this.config.numberOfValidateAttempts&&(this.hasErrors=!0,this.errorMessage=l("invalidOtp",this.language)),this.calculateTimeLeft(),this.startCountdown()}catch(e){this.isLoading=!1,this.hasConfigErrors=!0,this.errorMessage=l("configError",this.language),console.error("Error loading 2FA config:",e)}}calculateTimeLeft(){const e=new Date(this.expirationTime),t=new Date(this.serverTime);this.currentTime||(this.currentTime=new Date);const i=t.getTime()-this.currentTime.getTime(),r=new Date(this.currentTime.getTime()+i);this.timeLeft=Math.floor((e.getTime()-r.getTime())/1e3)}startCountdown(){this.countdownTimer&&clearInterval(this.countdownTimer),this.countdownTimer=setInterval((()=>{this.timeLeft>0?this.timeLeft-=1:(clearInterval(this.countdownTimer),this.countdownTimer=null,this.showResendOtp=!0)}),1e3)}formatTime(e){const t=e%60;return`${Math.floor(e/60).toString().padStart(2,"0")}:${t.toString().padStart(2,"0")}`}setOtpContainerRef(e){e&&(this.otpContainer=e)}setOtpInputRef(e,t){e&&(this.otpInputs[t]=e)}handleOnPasteOtp(e){var t;e.preventDefault();const i=null===(t=e.clipboardData)||void 0===t?void 0:t.getData("text").trim();if(!i)return;const r=i.slice(0,this.config.inputLength).split("");this.otp=[...r,...new Array(this.config.inputLength-r.length).fill("")];const o=Array.from(this.otpContainer.children);if(o){r.forEach(((e,t)=>{o[t].value=e}));const e=o[r.length-1];null==e||e.focus(),r.length===this.config.inputLength&&this.submitOtp()}}handleOtpInput(e,t){const i=e.target;let r=i.value.replace(/[^0-9a-zA-Z]/gi,"").toUpperCase();if(i.value=r.charAt(0),!r)return;this.otp[t]=r[0];const o=this.otpInputs[t+1];null==o||o.focus()}handleKeyDown(e,t){if("Backspace"===e.key){this.otp[t]="",this.otpInputs[t].value="";const e=this.otpInputs[t-1];null==e||e.focus()}}handleResendOtp(){const e=new CustomEvent("otpResendRequested");window.dispatchEvent(e)}async submitOtp(){if(this.otp.join("").length!==this.config.inputLength)return this.hasErrors=!0,void(this.errorMessage=l("invalidOtp",this.language));this.isLoading=!0,this.hasErrors=!1,this.errorMessage="";const e=this.otp.join("");"stateless"===this.flow&&this.handleOtpStateless(e),"stateful"===this.flow&&await this.handleOtpStateful(e)}handleOtpStateless(e){window.dispatchEvent(new CustomEvent("otpSubmitted",{detail:{code:e}}))}async handleOtpStateful(e){const t=new URL(`/api/v1/mfa/challenge/${this.token}/validate`,this.endpoint);t.searchParams.append("input",e);try{const e=await fetch(t.href,{method:"POST"});if(200===e.status)return void this.handleSuccess();const i=await e.json();throw new Error(i.message)}catch(e){if("gm.multifactorauthentication.challenge"===e.message)return this.config.numberOfValidateAttempts===this.config.maxValidationAttempts-2&&(this.isLastWarning=!0),this.config.numberOfValidateAttempts===this.config.maxValidationAttempts-1?(window.dispatchEvent(new CustomEvent("otpSetTimeout")),window.postMessage({type:"WidgetNotification",data:{type:"error",message:l("accountBlocked",this.language)}},window.location.href),void this.handleCloseWidget()):(this.hasErrors=!0,this.errorMessage=l("invalidOtp",this.language),void this.getConfig());console.error("OTP submission failed:",e),this.hasErrors=!0,this.errorMessage=l("submissionError",this.language)}finally{this.isLoading=!1}}handleSuccess(){window.dispatchEvent(new CustomEvent("otpSuccess",{detail:{message:"User successfully authenticated"}})),this.handleCloseWidget()}manualClosePopup(){window.dispatchEvent(new CustomEvent("manualClosePopup")),this.handleCloseWidget()}disconnectedCallback(){var e;this.countdownTimer&&clearInterval(this.countdownTimer),null===(e=this.stylingSubscription)||void 0===e||e.unsubscribe()}async componentWillLoad(){this.translationUrl.length>2&&await n(this.translationUrl)}componentDidLoad(){this.stylingContainer&&(null!=window.emMessageBuss?function(e,t){if(window.emMessageBus){const i=document.createElement("style");window.emMessageBus.subscribe(t,(t=>{i.innerHTML=t,e&&e.appendChild(i)}))}}(this.stylingContainer,`${this.mbSource}.Style`):(this.clientStyling&&o(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl)))}render(){return t("div",{key:"b069d0d6602230ca0810d6db4cbfec95cb358759",ref:e=>this.stylingContainer=e},this.showPopup&&t("div",{key:"9571d50a06540d69f204579d9f6e07dc394dd8d6",class:"OtpPopupOverlay"},t("div",{key:"27378e80e17f51aa0492b01cd6562abb8065a67d",class:"OtpPopupContent"},this.isLoading?t("div",{class:"OtpLoaderContainer"},t("span",{class:"OtpLoader"})):this.hasConfigErrors?t("div",{class:"OtpError"},t("div",{class:"OtpErrorHeader"},t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},t("path",{d:"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"})),t("h2",null,l("errorHeader",this.language))),t("p",null,this.errorMessage),t("button",{class:"OtpButton error",onClick:this.manualClosePopup},l("close",this.language))):t(i,null,t("div",{class:"otp-description"},t("p",{class:this.isLastWarning?"LastWarningMessage":""},l(this.isLastWarning?"popupMessageLastWarning":"popupMessage",this.language)),this.hasErrors&&t("p",{class:"OtpErrorMessage"},this.errorMessage)),t("div",{class:"OtpFieldWrapper"},t("h2",null,l("otpHeading",this.language)),t("div",{class:"OtpField",ref:this.setOtpContainerRef},this.otp.map(((e,i)=>t("input",{key:i,ref:e=>this.setOtpInputRef(e,i),id:`otp-input-${i}`,type:"text",class:"otp-box "+(this.config.inputLength%2==0&&i===this.config.inputLength/2-1?"space":""),maxLength:1,value:e,onInput:e=>this.handleOtpInput(e,i),onKeyDown:e=>this.handleKeyDown(e,i),onPaste:e=>this.handleOnPasteOtp(e),disabled:this.timeLeft<=0})))),t("div",{class:"otp-timer"},this.formatTime(this.timeLeft)," ",l("minutes",this.language))),t("div",{class:"OtpActionButtons"},this.showResendOtp?t("button",{class:"OtpButton",onClick:this.handleResendOtp},l("resendOtp",this.language)):t("button",{class:"OtpButton",onClick:this.submitOtp,disabled:this.otp.join("").length!==this.config.inputLength},l("submit",this.language)),t("button",{class:"OtpButton",onClick:this.manualClosePopup},l("close",this.language)))))))}get el(){return r(this)}static get watchers(){return{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}}};d.style=".OtpPopupOverlay{position:fixed;top:0;left:0;width:100%;height:100%;background:var(--emw--color-overlay, rgba(0, 0, 0, 0.5));display:flex;align-items:center;justify-content:center}.OtpButton{font-family:var(--emw--button-typography);border:var(--emw--button-border, none);border-radius:var(--emw--button-border-radius, 3px);border-color:var(--emw--button-border-color);background-color:var(--emw--button-background-color, var(--emw--color-primary, #007bff));color:var(--emw--button-typography, var(--emw--color-white, #fff));padding:10px 20px;cursor:pointer;font-size:16px}.OtpButton.error{background:var(--emw--color-error, #dd3434)}.OtpPopupContent{position:relative;background:var(--emw--color-white, #fff);padding:20px;border-radius:5px;text-align:center;min-width:25%;min-height:200px;display:flex;flex-direction:column;justify-content:center;gap:20px}.OtpPopupContent .OtpError{display:flex;flex-direction:column;gap:20px;align-items:center}.OtpPopupContent .OtpError .OtpErrorHeader{display:flex;justify-content:center;gap:5px}.OtpPopupContent .OtpError h2{margin:0}.OtpPopupContent .OtpError svg{width:25px;fill:var(--emw--color-error, #dd3434)}.OtpFieldWrapper{display:flex;flex-direction:column;gap:10px}.OtpFieldWrapper h2{margin:0}.OtpField{display:flex;justify-content:center}.OtpField input{width:24px;font-size:32px;padding:10px;text-align:center;border-radius:5px;margin:2px;border:2px solid var(--emw--otp-border-color, #55525c);font-weight:bold;outline:none;transition:all 0.1s}.OtpField input.space{margin-right:1rem !important}.OtpField input:focus{border:2px solid var(--emw--color-primary, #007bff);box-shadow:0 0 2px 2px var(--emw--color-primary, #007bff)}.OtpActionButtons{display:flex;justify-content:space-between}.OtpErrorMessage{color:var(--emw--color-error, #dd3434);font-weight:bold}.OtpLoaderContainer{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.OtpLoader{width:48px;height:48px;border:5px solid var(--emw--color-secondary, #b3d8ff);border-bottom-color:var(--emw--color-primary, #007bff);border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1s linear infinite}@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";export{d as P}
@@ -1 +1 @@
1
- export{P as player_step_up_auth}from"./player-step-up-auth-8b1b654c.js";import"./index-c6eee6d8.js";
1
+ export{P as player_step_up_auth}from"./player-step-up-auth-8479f64b.js";import"./index-c6eee6d8.js";
@@ -1 +1 @@
1
- import{p as e,b as n}from"./index-c6eee6d8.js";export{s as setNonce}from"./index-c6eee6d8.js";import{g as t}from"./app-globals-0f993ce5.js";(()=>{const n=import.meta.url,t={};return""!==n&&(t.resourcesUrl=new URL(".",n).href),e(t)})().then((async e=>(await t(),n([["player-step-up-auth",[[1,"player-step-up-auth",{mbSource:[513,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[513],endpoint:[513],userSession:[513,"user-session"],translationUrl:[513,"translation-url"],showPopup:[32],otp:[32],isLoading:[32],config:[32],timeLeft:[32],expirationTime:[32],serverTime:[32],hasErrors:[32],hasConfigErrors:[32],errorMessage:[32],token:[32],flow:[32],showResendOtp:[32]},[[8,"stepUpAuthRequired","handleStepUpAuthEvent"],[8,"closePopup","handleCloseWidget"]],{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}]]]],e))));
1
+ import{p as e,b as n}from"./index-c6eee6d8.js";export{s as setNonce}from"./index-c6eee6d8.js";import{g as t}from"./app-globals-0f993ce5.js";(()=>{const n=import.meta.url,t={};return""!==n&&(t.resourcesUrl=new URL(".",n).href),e(t)})().then((async e=>(await t(),n([["player-step-up-auth",[[1,"player-step-up-auth",{mbSource:[513,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[513],endpoint:[513],userSession:[513,"user-session"],translationUrl:[513,"translation-url"],showPopup:[32],otp:[32],isLoading:[32],config:[32],timeLeft:[32],expirationTime:[32],serverTime:[32],hasErrors:[32],hasConfigErrors:[32],errorMessage:[32],token:[32],flow:[32],showResendOtp:[32],isLastWarning:[32]},[[8,"stepUpAuthRequired","handleStepUpAuthEvent"],[8,"closePopup","handleCloseWidget"]],{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}]]]],e))));
@@ -41,6 +41,7 @@ export declare class PlayerStepUpAuth {
41
41
  token: string;
42
42
  flow: string;
43
43
  showResendOtp: boolean;
44
+ isLastWarning: boolean;
44
45
  private stylingContainer;
45
46
  private stylingSubscription;
46
47
  private otpContainer;
@@ -176,10 +177,6 @@ export declare class PlayerStepUpAuth {
176
177
  * Closes the popup upon successful authentication.
177
178
  */
178
179
  handleSuccess(): void;
179
- /**
180
- * Emits an event to close the popup.
181
- */
182
- closePopup(): void;
183
180
  /**
184
181
  * Emits an event when the close button is pressed.
185
182
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/player-step-up-auth",
3
- "version": "1.70.0",
3
+ "version": "1.70.1",
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 t,F as i,g as r}from"./index-c6eee6d8.js";function o(e,t){if(e){const i=document.createElement("style");i.innerHTML=t,e.appendChild(i)}}function s(e,t){const i=new URL(t);fetch(i.href).then((e=>e.text())).then((t=>{const i=document.createElement("style");i.innerHTML=t,e&&e.appendChild(i)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}const n={en:{popupMessage:"Please enter the security code received on your email address to perform the update.",minutes:"minutes",errorHeader:"Error",configError:"Unable to load OTP data. Please try again later.",otpHeading:"Enter OTP",resendOtp:"Resent OTP",submit:"Submit",close:"Close",invalidOtp:"The code you've sent is not valid. Please try again.",accountBlocked:"Too many attempts for OTP. Your account has been blocked for one hour.",submissionError:"Something went wrong. Please try again."},ro:{popupMessage:"Introduceți codul de securitate primit pe adresa dvs. de e-mail pentru a efectua actualizarea.",minutes:"minute",errorHeader:"Eroare",configError:"Nu s-a putut încărca datele OTP. Vă rugăm să încercați din nou mai târziu.",otpHeading:"Introduceți OTP",resendOtp:"Retrimitere OTP",submit:"Trimite",close:"Închide",invalidOtp:"Codul introdus nu este valid. Vă rugăm să încercați din nou.",accountBlocked:"Prea multe încercări de OTP. Contul dvs. a fost blocat timp de o oră.",submissionError:"Ceva a mers prost. Vă rugăm să încercați din nou."},fr:{popupMessage:"Veuillez entrer le code de sécurité reçu sur votre adresse e-mail pour effectuer la mise à jour.",minutes:"minutes",errorHeader:"Erreur",configError:"Impossible de charger les données OTP. Veuillez réessayer plus tard.",otpHeading:"Entrez OTP",resendOtp:"Renvoyer OTP",submit:"Soumettre",close:"Fermer",invalidOtp:"Le code que vous avez saisi n’est pas valide. Veuillez réessayer.",accountBlocked:"Trop de tentatives OTP. Votre compte a été bloqué pendant une heure.",submissionError:"Quelque chose s'est mal passé. Veuillez réessayer."},hu:{popupMessage:"Kérjük, adja meg az e-mail címére küldött biztonsági kódot a frissítés végrehajtásához.",minutes:"perc",errorHeader:"Hiba",configError:"Nem sikerült betölteni az OTP adatokat. Kérjük, próbálja újra később.",otpHeading:"OTP megadása",resendOtp:"Újraküldés",submit:"Beküldés",close:"Bezárás",invalidOtp:"A megadott kód érvénytelen. Kérjük, próbálja újra.",accountBlocked:"Túl sok OTP próbálkozás. A fiókja egy órára zárolva lett.",submissionError:"Valami hiba történt. Kérjük, próbálja újra."},tr:{popupMessage:"Güncellemeyi gerçekleştirmek için e-posta adresinize gelen güvenlik kodunu girin.",minutes:"dakika",errorHeader:"Hata",configError:"OTP verisi yüklenemedi. Lütfen daha sonra tekrar deneyin.",otpHeading:"OTP Girin",resendOtp:"OTP'yi Yeniden Gönder",submit:"Gönder",close:"Kapat",invalidOtp:"Gönderdiğiniz kod geçersiz. Lütfen tekrar deneyin.",accountBlocked:"Çok fazla OTP denemesi yapıldı. Hesabınız bir saat boyunca kilitlendi.",submissionError:"Bir şeyler yanlış gitti. Lütfen tekrar deneyin."},el:{popupMessage:"Παρακαλώ εισάγετε τον κωδικό ασφαλείας που λάβατε στο email σας για να ολοκληρώσετε την ενημέρωση.",minutes:"λεπτά",errorHeader:"Σφάλμα",configError:"Δεν ήταν δυνατή η φόρτωση των δεδομένων OTP. Παρακαλούμε προσπαθήστε ξανά αργότερα.",otpHeading:"Εισαγωγή OTP",resendOtp:"Αποστολή ξανά OTP",submit:"Υποβολή",close:"Κλείσιμο",invalidOtp:"Ο κωδικός που εισαγάγατε δεν είναι έγκυρος. Παρακαλώ προσπαθήστε ξανά.",accountBlocked:"Πάρα πολλές προσπάθειες OTP. Ο λογαριασμός σας έχει αποκλειστεί για μία ώρα.",submissionError:"Κάτι πήγε στραβά. Παρακαλώ προσπαθήστε ξανά."},es:{popupMessage:"Por favor, introduzca el código de seguridad recibido en su correo electrónico para realizar la actualización.",minutes:"minutos",errorHeader:"Error",configError:"No se pudo cargar los datos del OTP. Por favor, inténtelo de nuevo más tarde.",otpHeading:"Introducir OTP",resendOtp:"Reenviar OTP",submit:"Enviar",close:"Cerrar",invalidOtp:"El código que ingresaste no es válido. Por favor, inténtalo de nuevo.",accountBlocked:"Demasiados intentos de OTP. Su cuenta ha sido bloqueada por una hora.",submissionError:"Algo salió mal. Por favor, inténtelo de nuevo."},pt:{popupMessage:"Por favor, insira o código de segurança recebido no seu e-mail para realizar a atualização.",minutes:"minutos",errorHeader:"Erro",configError:"Não foi possível carregar os dados do OTP. Tente novamente mais tarde.",otpHeading:"Insira o OTP",resendOtp:"Reenviar OTP",submit:"Enviar",close:"Fechar",invalidOtp:"O código inserido não é válido. Por favor, tente novamente.",accountBlocked:"Muitas tentativas de OTP. Sua conta foi bloqueada por uma hora.",submissionError:"Algo deu errado. Por favor, tente novamente."},hr:{popupMessage:"Unesite sigurnosni kod primljen na vašu e-mail adresu kako biste izvršili ažuriranje.",minutes:"minute",errorHeader:"Greška",configError:"Nije moguće učitati OTP podatke. Pokušajte ponovno kasnije.",otpHeading:"Unesite OTP",resendOtp:"Ponovno pošalji OTP",submit:"Pošalji",close:"Zatvori",invalidOtp:"Uneseni kod nije valjan. Molimo pokušajte ponovo.",accountBlocked:"Previše pokušaja unosa OTP-a. Vaš račun je blokiran na jedan sat.",submissionError:"Nešto je pošlo po zlu. Molimo pokušajte ponovo."},de:{popupMessage:"Bitte geben Sie den Sicherheitscode ein, den Sie an Ihre E-Mail-Adresse erhalten haben, um das Update durchzuführen.",minutes:"Minuten",errorHeader:"Fehler",configError:"OTP-Daten konnten nicht geladen werden. Bitte versuchen Sie es später erneut.",otpHeading:"OTP eingeben",resendOtp:"OTP erneut senden",submit:"Absenden",close:"Schließen",invalidOtp:"Der eingegebene Code ist ungültig. Bitte versuchen Sie es erneut.",accountBlocked:"Zu viele OTP-Versuche. Ihr Konto wurde für eine Stunde gesperrt.",submissionError:"Etwas ist schiefgelaufen. Bitte versuchen Sie es erneut."},"es-mx":{popupMessage:"Por favor, ingrese el código de seguridad recibido en su correo electrónico para realizar la actualización.",minutes:"minutos",errorHeader:"Error",configError:"No se pudieron cargar los datos del OTP. Inténtelo de nuevo más tarde.",otpHeading:"Ingrese OTP",resendOtp:"Reenviar OTP",submit:"Enviar",close:"Cerrar",invalidOtp:"El código que ingresó no es válido. Inténtelo de nuevo.",accountBlocked:"Demasiados intentos de OTP. Su cuenta ha sido bloqueada por una hora.",submissionError:"Algo salió mal. Por favor, inténtelo de nuevo."},"pt-br":{popupMessage:"Por favor, digite o código de segurança recebido no seu e-mail para realizar a atualização.",minutes:"minutos",errorHeader:"Erro",configError:"Não foi possível carregar os dados do OTP. Tente novamente mais tarde.",otpHeading:"Digite o OTP",resendOtp:"Reenviar OTP",submit:"Enviar",close:"Fechar",invalidOtp:"O código informado não é válido. Tente novamente.",accountBlocked:"Muitas tentativas de OTP. Sua conta foi bloqueada por uma hora.",submissionError:"Algo deu errado. Por favor, tente novamente."}},a=e=>new Promise((t=>{fetch(e).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{for(let i in e[t])n[t][i]=e[t][i]})),t(!0)}))})),l=(e,t)=>n[void 0!==t?t:"en"][e],d=class{handleNewTranslations(){a(this.translationUrl)}handleClientStylingChange(e,t){e!==t&&o(this.el,this.clientStyling)}handleClientStylingUrlChange(e,t){e!=t&&this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl)}async handleStepUpAuthEvent(e){var t;if(null===(t=e.detail)||void 0===t?void 0:t["x-step-up-required"]){if(this.hasConfigErrors=!1,this.hasErrors=!1,this.errorMessage="",this.showPopup=!0,this.token=e.detail["x-step-up-token"],this.flow=e.detail.flow,!this.token||!this.flow)return this.isLoading=!1,this.hasConfigErrors=!0,void(this.errorMessage=l("configError",this.language));await this.getConfig()}}handleCloseWidget(){this.hasErrors=!1,this.hasConfigErrors=!1,this.errorMessage="",this.showPopup=!1}constructor(t){e(this,t),this.otpInputs=[],this.countdownTimer=null,this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.language="en",this.endpoint=void 0,this.userSession=void 0,this.translationUrl="",this.showPopup=!1,this.otp=void 0,this.isLoading=!0,this.config=null,this.timeLeft=0,this.expirationTime="",this.serverTime="",this.hasErrors=!1,this.hasConfigErrors=!1,this.errorMessage="",this.token="",this.flow="",this.showResendOtp=!1,this.closePopup=this.closePopup.bind(this),this.handleResendOtp=this.handleResendOtp.bind(this),this.submitOtp=this.submitOtp.bind(this),this.setOtpContainerRef=this.setOtpContainerRef.bind(this),this.handleCloseWidget=this.handleCloseWidget.bind(this),this.manualClosePopup=this.manualClosePopup.bind(this)}async getConfig(){if(this.endpoint)try{const e=new URL(`/api/v1/mfa/challenge/${this.token}/config`,this.endpoint);this.isLoading=!0;const t=await fetch(e.href);if(!t.ok)throw new Error(`HTTP error! Status: ${t.status}`);this.config=await t.json(),this.otp=new Array(this.config.inputLength).fill(""),this.isLoading=!1,this.showResendOtp=!1,this.expirationTime=this.config.expirationTime,this.serverTime=this.config.serverTime,0!==this.config.numberOfValidateAttempts&&(this.hasErrors=!0,this.errorMessage=l("invalidOtp",this.language)),this.calculateTimeLeft(),this.startCountdown()}catch(e){this.isLoading=!1,this.hasConfigErrors=!0,this.errorMessage=l("configError",this.language),console.error("Error loading 2FA config:",e)}}calculateTimeLeft(){const e=new Date(this.expirationTime),t=new Date(this.serverTime);this.currentTime||(this.currentTime=new Date);const i=t.getTime()-this.currentTime.getTime(),r=new Date(this.currentTime.getTime()+i);this.timeLeft=Math.floor((e.getTime()-r.getTime())/1e3)}startCountdown(){this.countdownTimer&&clearInterval(this.countdownTimer),this.countdownTimer=setInterval((()=>{this.timeLeft>0?this.timeLeft-=1:(clearInterval(this.countdownTimer),this.countdownTimer=null,this.showResendOtp=!0)}),1e3)}formatTime(e){const t=e%60;return`${Math.floor(e/60).toString().padStart(2,"0")}:${t.toString().padStart(2,"0")}`}setOtpContainerRef(e){e&&(this.otpContainer=e)}setOtpInputRef(e,t){e&&(this.otpInputs[t]=e)}handleOnPasteOtp(e){var t;e.preventDefault();const i=null===(t=e.clipboardData)||void 0===t?void 0:t.getData("text").trim();if(!i)return;const r=i.slice(0,this.config.inputLength).split("");this.otp=[...r,...new Array(this.config.inputLength-r.length).fill("")];const o=Array.from(this.otpContainer.children);if(o){r.forEach(((e,t)=>{o[t].value=e}));const e=o[r.length-1];null==e||e.focus(),r.length===this.config.inputLength&&this.submitOtp()}}handleOtpInput(e,t){const i=e.target;let r=i.value.replace(/[^0-9a-zA-Z]/gi,"").toUpperCase();if(i.value=r.charAt(0),!r)return;this.otp[t]=r[0];const o=this.otpInputs[t+1];null==o||o.focus()}handleKeyDown(e,t){if("Backspace"===e.key){this.otp[t]="",this.otpInputs[t].value="";const e=this.otpInputs[t-1];null==e||e.focus()}}handleResendOtp(){const e=new CustomEvent("otpResendRequested");window.dispatchEvent(e)}async submitOtp(){if(this.otp.join("").length!==this.config.inputLength)return this.hasErrors=!0,void(this.errorMessage=l("invalidOtp",this.language));this.isLoading=!0,this.hasErrors=!1,this.errorMessage="";const e=this.otp.join("");"stateless"===this.flow&&this.handleOtpStateless(e),"stateful"===this.flow&&await this.handleOtpStateful(e)}handleOtpStateless(e){window.dispatchEvent(new CustomEvent("otpSubmitted",{detail:{code:e}}))}async handleOtpStateful(e){const t=new URL(`/api/v1/mfa/challenge/${this.token}/validate`,this.endpoint);t.searchParams.append("input",e);try{const e=await fetch(t.href,{method:"POST"});if(200===e.status)return void this.handleSuccess();const i=await e.json();throw new Error(i.message)}catch(e){if("gm.multifactorauthentication.challenge"===e.message){if(this.config.numberOfValidateAttempts===this.config.maxValidationAttempts-1){const e=new Date(this.serverTime);e.setHours(e.getHours()+1);const t=e.toISOString().slice(0,16).replace("T"," ");return window.postMessage({type:"SetPlayerAccountTimeout",timeoutSelected:"CoolOffUntilSelectedDate",timeoutExpiryDate:t},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"error",message:l("accountBlocked",this.language)}},window.location.href),void this.closePopup()}return this.hasErrors=!0,this.errorMessage=l("invalidOtp",this.language),void this.getConfig()}console.error("OTP submission failed:",e),this.hasErrors=!0,this.errorMessage=l("submissionError",this.language)}finally{this.isLoading=!1}}handleSuccess(){window.dispatchEvent(new CustomEvent("otpSuccess",{detail:{message:"User successfully authenticated"}})),this.closePopup()}closePopup(){window.dispatchEvent(new CustomEvent("closePopup"))}manualClosePopup(){window.dispatchEvent(new CustomEvent("manualClosePopup")),this.handleCloseWidget()}disconnectedCallback(){var e;this.countdownTimer&&clearInterval(this.countdownTimer),null===(e=this.stylingSubscription)||void 0===e||e.unsubscribe()}async componentWillLoad(){this.translationUrl.length>2&&await a(this.translationUrl)}componentDidLoad(){this.stylingContainer&&(null!=window.emMessageBuss?function(e,t){if(window.emMessageBus){const i=document.createElement("style");window.emMessageBus.subscribe(t,(t=>{i.innerHTML=t,e&&e.appendChild(i)}))}}(this.stylingContainer,`${this.mbSource}.Style`):(this.clientStyling&&o(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl)))}render(){return t("div",{key:"40c38bf36879053a8d1ec1757f9f1139cde8409f",ref:e=>this.stylingContainer=e},this.showPopup&&t("div",{key:"06723ab7b14e3ca2ac4fbc9d012fabf953406f6b",class:"OtpPopupOverlay"},t("div",{key:"c1a3d48e4c96049306b045ae4dcbc013f8fcf124",class:"OtpPopupContent"},this.isLoading?t("div",{class:"OtpLoaderContainer"},t("span",{class:"OtpLoader"})):this.hasConfigErrors?t("div",{class:"OtpError"},t("div",{class:"OtpErrorHeader"},t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},t("path",{d:"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"})),t("h2",null,l("errorHeader",this.language))),t("p",null,this.errorMessage),t("button",{class:"OtpButton error",onClick:this.manualClosePopup},l("close",this.language))):t(i,null,t("div",{class:"otp-description"},t("p",null,l("popupMessage",this.language)),this.hasErrors&&t("p",{class:"OtpErrorMessage"},this.errorMessage)),t("div",{class:"OtpFieldWrapper"},t("h2",null,l("otpHeading",this.language)),t("div",{class:"OtpField",ref:this.setOtpContainerRef},this.otp.map(((e,i)=>t("input",{key:i,ref:e=>this.setOtpInputRef(e,i),id:`otp-input-${i}`,type:"text",class:"otp-box "+(this.config.inputLength%2==0&&i===this.config.inputLength/2-1?"space":""),maxLength:1,value:e,onInput:e=>this.handleOtpInput(e,i),onKeyDown:e=>this.handleKeyDown(e,i),onPaste:e=>this.handleOnPasteOtp(e),disabled:this.timeLeft<=0})))),t("div",{class:"otp-timer"},this.formatTime(this.timeLeft)," ",l("minutes",this.language))),t("div",{class:"OtpActionButtons"},this.showResendOtp?t("button",{class:"OtpButton",onClick:this.handleResendOtp},l("resendOtp",this.language)):t("button",{class:"OtpButton",onClick:this.submitOtp,disabled:this.otp.join("").length!==this.config.inputLength},l("submit",this.language)),t("button",{class:"OtpButton",onClick:this.manualClosePopup},l("close",this.language)))))))}get el(){return r(this)}static get watchers(){return{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}}};d.style=".OtpPopupOverlay{position:fixed;top:0;left:0;width:100%;height:100%;background:var(--emw--color-overlay, rgba(0, 0, 0, 0.5));display:flex;align-items:center;justify-content:center}.OtpButton{font-family:var(--emw--button-typography);border:var(--emw--button-border, none);border-radius:var(--emw--button-border-radius, 3px);border-color:var(--emw--button-border-color);background-color:var(--emw--button-background-color, var(--emw--color-primary, #007bff));color:var(--emw--button-typography, var(--emw--color-white, #fff));padding:10px 20px;cursor:pointer;font-size:16px}.OtpButton.error{background:var(--emw--color-error, #dd3434)}.OtpPopupContent{position:relative;background:var(--emw--color-white, #fff);padding:20px;border-radius:5px;text-align:center;min-width:25%;min-height:200px;display:flex;flex-direction:column;justify-content:center;gap:20px}.OtpPopupContent .OtpError{display:flex;flex-direction:column;gap:20px;align-items:center}.OtpPopupContent .OtpError .OtpErrorHeader{display:flex;justify-content:center;gap:5px}.OtpPopupContent .OtpError h2{margin:0}.OtpPopupContent .OtpError svg{width:25px;fill:var(--emw--color-error, #dd3434)}.OtpFieldWrapper{display:flex;flex-direction:column;gap:10px}.OtpFieldWrapper h2{margin:0}.OtpField{display:flex;justify-content:center}.OtpField input{width:24px;font-size:32px;padding:10px;text-align:center;border-radius:5px;margin:2px;border:2px solid var(--emw--otp-border-color, #55525c);font-weight:bold;outline:none;transition:all 0.1s}.OtpField input.space{margin-right:1rem !important}.OtpField input:focus{border:2px solid var(--emw--color-primary, #007bff);box-shadow:0 0 2px 2px var(--emw--color-primary, #007bff)}.OtpActionButtons{display:flex;justify-content:space-between}.OtpErrorMessage{color:var(--emw--color-error, #dd3434);font-weight:bold}.OtpLoaderContainer{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.OtpLoader{width:48px;height:48px;border:5px solid var(--emw--color-secondary, #b3d8ff);border-bottom-color:var(--emw--color-primary, #007bff);border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1s linear infinite}@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";export{d as P}