@everymatrix/user-login 1.33.3 → 1.33.4

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.
@@ -173,17 +173,13 @@ const UserLogin = class {
173
173
  setTimeout(() => { this.stylingContainer.appendChild(cssFile); }, 1);
174
174
  });
175
175
  };
176
- this.messageHandler = (e) => {
177
- switch (e.data.type) {
178
- case 'SendLoginCredentials':
179
- this.userNameEmail = e.data.data.userNameEmail;
180
- this.userPassword = e.data.data.userPassword;
181
- this.userLogin({
182
- username: this.userNameEmail,
183
- password: this.userPassword
184
- });
185
- break;
186
- }
176
+ this.autofillCredentialsHandler = (e) => {
177
+ this.userNameEmail = e.detail.userNameEmail;
178
+ this.userPassword = e.detail.userPassword;
179
+ this.userLogin({
180
+ username: this.userNameEmail,
181
+ password: this.userPassword
182
+ });
187
183
  };
188
184
  this.userLogin = async ({ username, password }) => {
189
185
  let headers = {
@@ -240,6 +236,7 @@ const UserLogin = class {
240
236
  username: this.userNameEmail,
241
237
  password: this.userPassword
242
238
  });
239
+ this.dispatchUpdateLoginCredentialsEvent();
243
240
  };
244
241
  this.handleInputChange = (event, location) => {
245
242
  this.hasError = false;
@@ -277,7 +274,7 @@ const UserLogin = class {
277
274
  }
278
275
  }
279
276
  componentDidLoad() {
280
- window.addEventListener('message', this.messageHandler);
277
+ window.addEventListener('LoginCredentials', this.autofillCredentialsHandler);
281
278
  }
282
279
  componentDidRender() {
283
280
  // start custom styling area
@@ -306,6 +303,19 @@ const UserLogin = class {
306
303
  }, delay);
307
304
  };
308
305
  }
306
+ dispatchUpdateLoginCredentialsEvent() {
307
+ if (!this.hasError) {
308
+ this.updateLoginCredentialsEvent = new CustomEvent("UpdateLoginCredentials", {
309
+ bubbles: true,
310
+ detail: {
311
+ userNameEmail: this.userNameEmail,
312
+ userPassword: this.userPassword
313
+ }
314
+ });
315
+ window.dispatchEvent(this.updateLoginCredentialsEvent);
316
+ }
317
+ }
318
+ ;
309
319
  render() {
310
320
  let visibilityIcon = index.h("span", { class: "InputIcon" }, this.isPasswordVisible &&
311
321
  index.h("svg", { onClick: () => this.togglePassword(), class: "TogglePasswordVisibility", part: "TogglePasswordVisibility", xmlns: "http://www.w3.org/2000/svg", width: "18.844", height: "12.887", viewBox: "0 0 18.844 12.887" }, index.h("g", { transform: "translate(-110.856 -23.242)" }, index.h("circle", { class: "PasswordVisibilityIcon", cx: "0.05", cy: "0.05", r: "0.05", transform: "translate(121.017 31.148)" }), index.h("g", { transform: "translate(117.499 27.37)" }, index.h("path", { class: "PasswordVisibilityIcon", d: "M147.413,43.174a2.774,2.774,0,0,0-3.229-3.943Z", transform: "translate(-142.164 -39.123)" }), index.h("path", { class: "PasswordVisibilityIcon", d: "M137.031,43.1a2.778,2.778,0,0,0,3.447,4.209Z", transform: "translate(-136.413 -42.068)" })), index.h("g", { transform: "translate(110.856 24.899)" }, index.h("path", { class: "PasswordVisibilityIcon", d: "M122.538,42.061a7.043,7.043,0,0,1-2.325.53,10.373,10.373,0,0,1-4.393-1.482,36.509,36.509,0,0,1-3.873-2.391.13.13,0,0,1,0-.208,44.141,44.141,0,0,1,3.873-2.651c.394-.233.768-.437,1.13-.622l-.686-.838c-.322.167-.651.347-.99.55a37.989,37.989,0,0,0-3.977,2.729,1.21,1.21,0,0,0-.442.962,1.1,1.1,0,0,0,.494.936,34.416,34.416,0,0,0,3.977,2.469,11.468,11.468,0,0,0,4.886,1.611,8.427,8.427,0,0,0,3.039-.725Z", transform: "translate(-110.856 -33.157)" }), index.h("path", { class: "PasswordVisibilityIcon", d: "M149.119,34.14a45.875,45.875,0,0,0-4.055-2.729,20.541,20.541,0,0,0-2.547-1.248,5.6,5.6,0,0,0-4.79-.017l.7.856a5.254,5.254,0,0,1,1.672-.346,10.072,10.072,0,0,1,4.445,1.663,34.132,34.132,0,0,1,3.925,2.651.13.13,0,0,1,0,.208,40.2,40.2,0,0,1-3.925,2.391c-.179.092-.352.176-.525.26l.684.835c.1-.054.2-.1.309-.159a36.356,36.356,0,0,0,4.055-2.469,1.067,1.067,0,0,0,.52-.936A1.159,1.159,0,0,0,149.119,34.14Z", transform: "translate(-130.743 -29.617)" })), index.h("rect", { class: "PasswordVisibilityIcon", width: "0.972", height: "15.861", rx: "0.486", transform: "translate(114.827 23.858) rotate(-39.315)" }))), !this.isPasswordVisible &&
@@ -63,17 +63,13 @@ export class UserLogin {
63
63
  setTimeout(() => { this.stylingContainer.appendChild(cssFile); }, 1);
64
64
  });
65
65
  };
66
- this.messageHandler = (e) => {
67
- switch (e.data.type) {
68
- case 'SendLoginCredentials':
69
- this.userNameEmail = e.data.data.userNameEmail;
70
- this.userPassword = e.data.data.userPassword;
71
- this.userLogin({
72
- username: this.userNameEmail,
73
- password: this.userPassword
74
- });
75
- break;
76
- }
66
+ this.autofillCredentialsHandler = (e) => {
67
+ this.userNameEmail = e.detail.userNameEmail;
68
+ this.userPassword = e.detail.userPassword;
69
+ this.userLogin({
70
+ username: this.userNameEmail,
71
+ password: this.userPassword
72
+ });
77
73
  };
78
74
  this.userLogin = async ({ username, password }) => {
79
75
  let headers = {
@@ -130,6 +126,7 @@ export class UserLogin {
130
126
  username: this.userNameEmail,
131
127
  password: this.userPassword
132
128
  });
129
+ this.dispatchUpdateLoginCredentialsEvent();
133
130
  };
134
131
  this.handleInputChange = (event, location) => {
135
132
  this.hasError = false;
@@ -167,7 +164,7 @@ export class UserLogin {
167
164
  }
168
165
  }
169
166
  componentDidLoad() {
170
- window.addEventListener('message', this.messageHandler);
167
+ window.addEventListener('LoginCredentials', this.autofillCredentialsHandler);
171
168
  }
172
169
  componentDidRender() {
173
170
  // start custom styling area
@@ -196,6 +193,19 @@ export class UserLogin {
196
193
  }, delay);
197
194
  };
198
195
  }
196
+ dispatchUpdateLoginCredentialsEvent() {
197
+ if (!this.hasError) {
198
+ this.updateLoginCredentialsEvent = new CustomEvent("UpdateLoginCredentials", {
199
+ bubbles: true,
200
+ detail: {
201
+ userNameEmail: this.userNameEmail,
202
+ userPassword: this.userPassword
203
+ }
204
+ });
205
+ window.dispatchEvent(this.updateLoginCredentialsEvent);
206
+ }
207
+ }
208
+ ;
199
209
  render() {
200
210
  let visibilityIcon = h("span", { class: "InputIcon" },
201
211
  this.isPasswordVisible &&
@@ -171,17 +171,13 @@ const UserLogin$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
171
171
  setTimeout(() => { this.stylingContainer.appendChild(cssFile); }, 1);
172
172
  });
173
173
  };
174
- this.messageHandler = (e) => {
175
- switch (e.data.type) {
176
- case 'SendLoginCredentials':
177
- this.userNameEmail = e.data.data.userNameEmail;
178
- this.userPassword = e.data.data.userPassword;
179
- this.userLogin({
180
- username: this.userNameEmail,
181
- password: this.userPassword
182
- });
183
- break;
184
- }
174
+ this.autofillCredentialsHandler = (e) => {
175
+ this.userNameEmail = e.detail.userNameEmail;
176
+ this.userPassword = e.detail.userPassword;
177
+ this.userLogin({
178
+ username: this.userNameEmail,
179
+ password: this.userPassword
180
+ });
185
181
  };
186
182
  this.userLogin = async ({ username, password }) => {
187
183
  let headers = {
@@ -238,6 +234,7 @@ const UserLogin$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
238
234
  username: this.userNameEmail,
239
235
  password: this.userPassword
240
236
  });
237
+ this.dispatchUpdateLoginCredentialsEvent();
241
238
  };
242
239
  this.handleInputChange = (event, location) => {
243
240
  this.hasError = false;
@@ -275,7 +272,7 @@ const UserLogin$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
275
272
  }
276
273
  }
277
274
  componentDidLoad() {
278
- window.addEventListener('message', this.messageHandler);
275
+ window.addEventListener('LoginCredentials', this.autofillCredentialsHandler);
279
276
  }
280
277
  componentDidRender() {
281
278
  // start custom styling area
@@ -304,6 +301,19 @@ const UserLogin$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
304
301
  }, delay);
305
302
  };
306
303
  }
304
+ dispatchUpdateLoginCredentialsEvent() {
305
+ if (!this.hasError) {
306
+ this.updateLoginCredentialsEvent = new CustomEvent("UpdateLoginCredentials", {
307
+ bubbles: true,
308
+ detail: {
309
+ userNameEmail: this.userNameEmail,
310
+ userPassword: this.userPassword
311
+ }
312
+ });
313
+ window.dispatchEvent(this.updateLoginCredentialsEvent);
314
+ }
315
+ }
316
+ ;
307
317
  render() {
308
318
  let visibilityIcon = h("span", { class: "InputIcon" }, this.isPasswordVisible &&
309
319
  h("svg", { onClick: () => this.togglePassword(), class: "TogglePasswordVisibility", part: "TogglePasswordVisibility", xmlns: "http://www.w3.org/2000/svg", width: "18.844", height: "12.887", viewBox: "0 0 18.844 12.887" }, h("g", { transform: "translate(-110.856 -23.242)" }, h("circle", { class: "PasswordVisibilityIcon", cx: "0.05", cy: "0.05", r: "0.05", transform: "translate(121.017 31.148)" }), h("g", { transform: "translate(117.499 27.37)" }, h("path", { class: "PasswordVisibilityIcon", d: "M147.413,43.174a2.774,2.774,0,0,0-3.229-3.943Z", transform: "translate(-142.164 -39.123)" }), h("path", { class: "PasswordVisibilityIcon", d: "M137.031,43.1a2.778,2.778,0,0,0,3.447,4.209Z", transform: "translate(-136.413 -42.068)" })), h("g", { transform: "translate(110.856 24.899)" }, h("path", { class: "PasswordVisibilityIcon", d: "M122.538,42.061a7.043,7.043,0,0,1-2.325.53,10.373,10.373,0,0,1-4.393-1.482,36.509,36.509,0,0,1-3.873-2.391.13.13,0,0,1,0-.208,44.141,44.141,0,0,1,3.873-2.651c.394-.233.768-.437,1.13-.622l-.686-.838c-.322.167-.651.347-.99.55a37.989,37.989,0,0,0-3.977,2.729,1.21,1.21,0,0,0-.442.962,1.1,1.1,0,0,0,.494.936,34.416,34.416,0,0,0,3.977,2.469,11.468,11.468,0,0,0,4.886,1.611,8.427,8.427,0,0,0,3.039-.725Z", transform: "translate(-110.856 -33.157)" }), h("path", { class: "PasswordVisibilityIcon", d: "M149.119,34.14a45.875,45.875,0,0,0-4.055-2.729,20.541,20.541,0,0,0-2.547-1.248,5.6,5.6,0,0,0-4.79-.017l.7.856a5.254,5.254,0,0,1,1.672-.346,10.072,10.072,0,0,1,4.445,1.663,34.132,34.132,0,0,1,3.925,2.651.13.13,0,0,1,0,.208,40.2,40.2,0,0,1-3.925,2.391c-.179.092-.352.176-.525.26l.684.835c.1-.054.2-.1.309-.159a36.356,36.356,0,0,0,4.055-2.469,1.067,1.067,0,0,0,.52-.936A1.159,1.159,0,0,0,149.119,34.14Z", transform: "translate(-130.743 -29.617)" })), h("rect", { class: "PasswordVisibilityIcon", width: "0.972", height: "15.861", rx: "0.486", transform: "translate(114.827 23.858) rotate(-39.315)" }))), !this.isPasswordVisible &&
@@ -169,17 +169,13 @@ const UserLogin = class {
169
169
  setTimeout(() => { this.stylingContainer.appendChild(cssFile); }, 1);
170
170
  });
171
171
  };
172
- this.messageHandler = (e) => {
173
- switch (e.data.type) {
174
- case 'SendLoginCredentials':
175
- this.userNameEmail = e.data.data.userNameEmail;
176
- this.userPassword = e.data.data.userPassword;
177
- this.userLogin({
178
- username: this.userNameEmail,
179
- password: this.userPassword
180
- });
181
- break;
182
- }
172
+ this.autofillCredentialsHandler = (e) => {
173
+ this.userNameEmail = e.detail.userNameEmail;
174
+ this.userPassword = e.detail.userPassword;
175
+ this.userLogin({
176
+ username: this.userNameEmail,
177
+ password: this.userPassword
178
+ });
183
179
  };
184
180
  this.userLogin = async ({ username, password }) => {
185
181
  let headers = {
@@ -236,6 +232,7 @@ const UserLogin = class {
236
232
  username: this.userNameEmail,
237
233
  password: this.userPassword
238
234
  });
235
+ this.dispatchUpdateLoginCredentialsEvent();
239
236
  };
240
237
  this.handleInputChange = (event, location) => {
241
238
  this.hasError = false;
@@ -273,7 +270,7 @@ const UserLogin = class {
273
270
  }
274
271
  }
275
272
  componentDidLoad() {
276
- window.addEventListener('message', this.messageHandler);
273
+ window.addEventListener('LoginCredentials', this.autofillCredentialsHandler);
277
274
  }
278
275
  componentDidRender() {
279
276
  // start custom styling area
@@ -302,6 +299,19 @@ const UserLogin = class {
302
299
  }, delay);
303
300
  };
304
301
  }
302
+ dispatchUpdateLoginCredentialsEvent() {
303
+ if (!this.hasError) {
304
+ this.updateLoginCredentialsEvent = new CustomEvent("UpdateLoginCredentials", {
305
+ bubbles: true,
306
+ detail: {
307
+ userNameEmail: this.userNameEmail,
308
+ userPassword: this.userPassword
309
+ }
310
+ });
311
+ window.dispatchEvent(this.updateLoginCredentialsEvent);
312
+ }
313
+ }
314
+ ;
305
315
  render() {
306
316
  let visibilityIcon = h("span", { class: "InputIcon" }, this.isPasswordVisible &&
307
317
  h("svg", { onClick: () => this.togglePassword(), class: "TogglePasswordVisibility", part: "TogglePasswordVisibility", xmlns: "http://www.w3.org/2000/svg", width: "18.844", height: "12.887", viewBox: "0 0 18.844 12.887" }, h("g", { transform: "translate(-110.856 -23.242)" }, h("circle", { class: "PasswordVisibilityIcon", cx: "0.05", cy: "0.05", r: "0.05", transform: "translate(121.017 31.148)" }), h("g", { transform: "translate(117.499 27.37)" }, h("path", { class: "PasswordVisibilityIcon", d: "M147.413,43.174a2.774,2.774,0,0,0-3.229-3.943Z", transform: "translate(-142.164 -39.123)" }), h("path", { class: "PasswordVisibilityIcon", d: "M137.031,43.1a2.778,2.778,0,0,0,3.447,4.209Z", transform: "translate(-136.413 -42.068)" })), h("g", { transform: "translate(110.856 24.899)" }, h("path", { class: "PasswordVisibilityIcon", d: "M122.538,42.061a7.043,7.043,0,0,1-2.325.53,10.373,10.373,0,0,1-4.393-1.482,36.509,36.509,0,0,1-3.873-2.391.13.13,0,0,1,0-.208,44.141,44.141,0,0,1,3.873-2.651c.394-.233.768-.437,1.13-.622l-.686-.838c-.322.167-.651.347-.99.55a37.989,37.989,0,0,0-3.977,2.729,1.21,1.21,0,0,0-.442.962,1.1,1.1,0,0,0,.494.936,34.416,34.416,0,0,0,3.977,2.469,11.468,11.468,0,0,0,4.886,1.611,8.427,8.427,0,0,0,3.039-.725Z", transform: "translate(-110.856 -33.157)" }), h("path", { class: "PasswordVisibilityIcon", d: "M149.119,34.14a45.875,45.875,0,0,0-4.055-2.729,20.541,20.541,0,0,0-2.547-1.248,5.6,5.6,0,0,0-4.79-.017l.7.856a5.254,5.254,0,0,1,1.672-.346,10.072,10.072,0,0,1,4.445,1.663,34.132,34.132,0,0,1,3.925,2.651.13.13,0,0,1,0,.208,40.2,40.2,0,0,1-3.925,2.391c-.179.092-.352.176-.525.26l.684.835c.1-.054.2-.1.309-.159a36.356,36.356,0,0,0,4.055-2.469,1.067,1.067,0,0,0,.52-.936A1.159,1.159,0,0,0,149.119,34.14Z", transform: "translate(-130.743 -29.617)" })), h("rect", { class: "PasswordVisibilityIcon", width: "0.972", height: "15.861", rx: "0.486", transform: "translate(114.827 23.858) rotate(-39.315)" }))), !this.isPasswordVisible &&
@@ -54,13 +54,14 @@ export declare class UserLogin {
54
54
  private errorMessage;
55
55
  private hasError;
56
56
  private stylingContainer;
57
+ updateLoginCredentialsEvent: CustomEvent;
57
58
  handleNewTranslations(): void;
58
59
  componentWillLoad(): Promise<void>;
59
60
  componentDidLoad(): void;
60
61
  componentDidRender(): void;
61
62
  setClientStyling: () => void;
62
63
  setClientStylingURL: () => void;
63
- messageHandler: (e: any) => void;
64
+ autofillCredentialsHandler: (e: any) => void;
64
65
  userLogin: ({ username, password }: {
65
66
  username: any;
66
67
  password: any;
@@ -69,6 +70,7 @@ export declare class UserLogin {
69
70
  debounce(func: any, delay: any): (...args: any[]) => void;
70
71
  debouncedUserLogin: (...args: any[]) => void;
71
72
  handleLogin: () => void;
73
+ dispatchUpdateLoginCredentialsEvent(): void;
72
74
  handleInputChange: (event: Event, location: string) => void;
73
75
  userEmailValidation: (input: any) => boolean;
74
76
  passwordValidation: (input: any) => boolean;
@@ -0,0 +1 @@
1
+ import{r as s,h as i}from"./p-f775dfb7.js";const t=["ro","en","cz","de","hr"],o={en:{invalidField:"This field is invalid",forgotPassword:"Forgot Password",userEmail:"Username or Email",password:"Password",login:"Login",genericError:"An unexpected error has occured",successMessage:"Login successful"},ro:{invalidField:"This field is invalid",forgotPassword:"Forgot Password",userEmail:"Username or Email",password:"Password",login:"Login",genericError:"An unexpected error has occured",successMessage:"Login successful"},hr:{invalidField:"Ovo polje je nevažeće",forgotPassword:"Zaboravljena lozinka",userEmail:"Korisničko ime ili email",password:"Lozinka",login:"Prijava",genericError:"Došlo je do neočekivane pogreške",successMessage:"Prijava uspješna"},fr:{invalidField:"This field is invalid",forgotPassword:"Forgot Password",userEmail:"Username or Email",password:"Password",login:"Login",genericError:"An unexpected error has occured",successMessage:"Login successful"},cs:{invalidField:"Ovo polje je nevažeće.",forgotPassword:"Zaboravio sam lozinku ",userEmail:"Korisničko ime ili email",password:"Lozinka",login:"Prijava",genericError:"An unexpected error has occured",successMessage:"Login successful"},de:{invalidField:"This field is invalid",forgotPassword:"Forgot Password",userEmail:"Username or Email",password:"Password",login:"Login",genericError:"An unexpected error has occured",successMessage:"Login successful"},"pt-br":{invalidField:"O campo é inválido",forgotPassword:"Esqueceu sua senha",userEmail:"Usuário ou e-mail",Password:"Senha",login:"Entrem",genericError:"Ocorreu um erro inesperado",successMessage:"Você fez login com sucesso"},"es-mx":{invalidField:"El campo es inválido",forgotPassword:"Olvidó contraseña",userEmail:"Usuario o Correo Electrónico",Password:"Contraseña",login:"Entrar",genericError:"Ha ocurrido un error inesperado",successMessage:"Ha ingreasado de forma exitosa"}},e=s=>new Promise((i=>{fetch(s).then((s=>s.json())).then((s=>{Object.keys(s).forEach((i=>{for(let t in s[i])o[i][t]=s[i][t]})),i(!0)}))})),r=(s,i,e)=>{const r=i;let n=o[void 0!==r&&t.includes(r)?r:"en"][s];if(void 0!==e)for(const[s,i]of Object.entries(e.values)){const t=new RegExp(`{${s}}`,"g");n=n.replace(t,i)}return n},n=class{constructor(i){s(this,i),this.endpoint="",this.lang="en",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.passwordReset="false",this.userEmailRegexOptions="i",this.passwordRegexOptions="",this.userNameEmail="",this.userPassword="",this.isValidUserEmail=!0,this.isValidPassword=!0,this.isPasswordVisible=!1,this.limitStylingAppends=!1,this.errorMessage="",this.hasError=!1,this.setClientStyling=()=>{let s=document.createElement("style");s.innerHTML=this.clientStyling,this.stylingContainer.appendChild(s)},this.setClientStylingURL=()=>{let s=new URL(this.clientStylingUrl),i=document.createElement("style");fetch(s.href).then((s=>s.text())).then((s=>{i.innerHTML=s,setTimeout((()=>{this.stylingContainer.appendChild(i)}),1)}))},this.autofillCredentialsHandler=s=>{this.userNameEmail=s.detail.userNameEmail,this.userPassword=s.detail.userPassword,this.userLogin({username:this.userNameEmail,password:this.userPassword})},this.userLogin=async({username:s,password:i})=>{let t={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:s,password:i})};fetch(`${this.endpoint}/v1/player/legislation/login`,t).then((s=>s.json())).then((s=>{var i,t;(null===(i=s.sessionBlockers)||void 0===i?void 0:i.includes("has-to-set-consents"))&&window.postMessage({type:"PlayerActions",gmversion:"gm16"},window.location.href),!0===(null==s?void 0:s.hasToSetPass)&&window.postMessage({type:"HasToSetPass"},window.location.href),s.sessionId?(window.postMessage({type:"UserSessionID",session:s.sessionId,userid:s.userId},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"success",message:r("successMessage",this.lang)}},window.location.href),this.hasError=!1):(this.hasError=!0,this.errorMessage=null===(t=null==s?void 0:s.thirdPartyResponse)||void 0===t?void 0:t.message,this.errorMessage&&(console.error(this.errorMessage),this.sendErrorNotification(this.errorMessage)))})).catch((s=>{console.error(s),this.hasError=!0,this.errorMessage=r("genericError",this.lang),this.sendErrorNotification(this.errorMessage)}))},this.debouncedUserLogin=this.debounce(this.userLogin,850),this.handleLogin=()=>{this.debouncedUserLogin({username:this.userNameEmail,password:this.userPassword}),this.dispatchUpdateLoginCredentialsEvent()},this.handleInputChange=(s,i)=>{this.hasError=!1;const t=s.target.value;"user"===i?(this.userNameEmail=t,this.isValidUserEmail=this.userEmailValidation(this.userNameEmail)):(this.userPassword=t,this.isValidPassword=this.passwordValidation(t))},this.userEmailValidation=s=>new RegExp(this.userEmailRegex,this.userEmailRegexOptions).test(s),this.passwordValidation=s=>new RegExp(this.passwordRegex,this.passwordRegexOptions).test(s),this.togglePassword=()=>{this.isPasswordVisible=!this.isPasswordVisible},this.resetPassword=()=>{window.postMessage({type:"NavForgotPassword"},window.location.href)}}handleNewTranslations(){e(this.translationUrl)}async componentWillLoad(){this.translationUrl.length>2&&await e(this.translationUrl)}componentDidLoad(){window.addEventListener("LoginCredentials",this.autofillCredentialsHandler)}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}sendErrorNotification(s){window.postMessage({type:"HasError",error:s},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"error",message:s}},window.location.href)}debounce(s,i){let t;return function(...o){clearTimeout(t),t=setTimeout((()=>{s.apply(this,o)}),i)}}dispatchUpdateLoginCredentialsEvent(){this.hasError||(this.updateLoginCredentialsEvent=new CustomEvent("UpdateLoginCredentials",{bubbles:!0,detail:{userNameEmail:this.userNameEmail,userPassword:this.userPassword}}),window.dispatchEvent(this.updateLoginCredentialsEvent))}render(){let s=i("span",{class:"InputIcon"},this.isPasswordVisible&&i("svg",{onClick:()=>this.togglePassword(),class:"TogglePasswordVisibility",part:"TogglePasswordVisibility",xmlns:"http://www.w3.org/2000/svg",width:"18.844",height:"12.887",viewBox:"0 0 18.844 12.887"},i("g",{transform:"translate(-110.856 -23.242)"},i("circle",{class:"PasswordVisibilityIcon",cx:"0.05",cy:"0.05",r:"0.05",transform:"translate(121.017 31.148)"}),i("g",{transform:"translate(117.499 27.37)"},i("path",{class:"PasswordVisibilityIcon",d:"M147.413,43.174a2.774,2.774,0,0,0-3.229-3.943Z",transform:"translate(-142.164 -39.123)"}),i("path",{class:"PasswordVisibilityIcon",d:"M137.031,43.1a2.778,2.778,0,0,0,3.447,4.209Z",transform:"translate(-136.413 -42.068)"})),i("g",{transform:"translate(110.856 24.899)"},i("path",{class:"PasswordVisibilityIcon",d:"M122.538,42.061a7.043,7.043,0,0,1-2.325.53,10.373,10.373,0,0,1-4.393-1.482,36.509,36.509,0,0,1-3.873-2.391.13.13,0,0,1,0-.208,44.141,44.141,0,0,1,3.873-2.651c.394-.233.768-.437,1.13-.622l-.686-.838c-.322.167-.651.347-.99.55a37.989,37.989,0,0,0-3.977,2.729,1.21,1.21,0,0,0-.442.962,1.1,1.1,0,0,0,.494.936,34.416,34.416,0,0,0,3.977,2.469,11.468,11.468,0,0,0,4.886,1.611,8.427,8.427,0,0,0,3.039-.725Z",transform:"translate(-110.856 -33.157)"}),i("path",{class:"PasswordVisibilityIcon",d:"M149.119,34.14a45.875,45.875,0,0,0-4.055-2.729,20.541,20.541,0,0,0-2.547-1.248,5.6,5.6,0,0,0-4.79-.017l.7.856a5.254,5.254,0,0,1,1.672-.346,10.072,10.072,0,0,1,4.445,1.663,34.132,34.132,0,0,1,3.925,2.651.13.13,0,0,1,0,.208,40.2,40.2,0,0,1-3.925,2.391c-.179.092-.352.176-.525.26l.684.835c.1-.054.2-.1.309-.159a36.356,36.356,0,0,0,4.055-2.469,1.067,1.067,0,0,0,.52-.936A1.159,1.159,0,0,0,149.119,34.14Z",transform:"translate(-130.743 -29.617)"})),i("rect",{class:"PasswordVisibilityIcon",width:"0.972",height:"15.861",rx:"0.486",transform:"translate(114.827 23.858) rotate(-39.315)"}))),!this.isPasswordVisible&&i("svg",{onClick:()=>this.togglePassword(),class:"TogglePasswordVisibility PasswordVisible",part:"TogglePasswordVisibility",xmlns:"http://www.w3.org/2000/svg",width:"18.843",height:"10.5",viewBox:"0 0 18.843 10.5"},i("g",{transform:"translate(-14.185 -27.832)"},i("path",{class:"PasswordVisibilityIcon",d:"M23.541,38.332a11.467,11.467,0,0,1-4.886-1.611,34.413,34.413,0,0,1-3.976-2.469,1.1,1.1,0,0,1-.494-.936,1.21,1.21,0,0,1,.442-.962A37.986,37.986,0,0,1,18.6,29.625a16.06,16.06,0,0,1,2.521-1.248,6.862,6.862,0,0,1,2.417-.546,6.862,6.862,0,0,1,2.417.546,20.541,20.541,0,0,1,2.547,1.248,45.872,45.872,0,0,1,4.054,2.729,1.159,1.159,0,0,1,.468.962,1.067,1.067,0,0,1-.52.936,36.353,36.353,0,0,1-4.054,2.469A11.2,11.2,0,0,1,23.541,38.332Zm0-9.46a9.813,9.813,0,0,0-4.392,1.663,44.138,44.138,0,0,0-3.873,2.651.13.13,0,0,0,0,.208,36.5,36.5,0,0,0,3.873,2.391,10.372,10.372,0,0,0,4.392,1.481,11.051,11.051,0,0,0,4.444-1.481,40.2,40.2,0,0,0,3.925-2.391.13.13,0,0,0,0-.208h0a34.132,34.132,0,0,0-3.925-2.651A10.072,10.072,0,0,0,23.541,28.872Z",transform:"translate(0)"}),i("circle",{class:"PasswordVisibilityIcon",cx:"2.779",cy:"2.779",r:"2.779",transform:"translate(20.827 30.303)"})))),t=i("div",{class:"FormBox"},i("div",{class:"FormValue"},i("div",{class:!this.isValidUserEmail||this.hasError?"InputBox InputInvalidBox":"InputBox"},i("input",{type:"text",placeholder:"",value:this.userNameEmail,onFocus:s=>this.handleInputChange(s,"user"),onInput:s=>this.handleInputChange(s,"user"),required:!0}),i("label",{class:(this.userNameEmail?"FieldFilledIn":"")+" "+(!this.isValidUserEmail||this.hasError?"FieldInvalid":"")},r("userEmail",this.lang)),!this.isValidUserEmail&&i("p",{class:"InvalidField"},r("invalidField",this.lang))),i("div",{class:!this.isValidPassword||this.hasError?"InputBox InputInvalidBox":"InputBox"},s,i("input",{type:this.isPasswordVisible?"text":"password",placeholder:"",value:this.userPassword,onFocus:s=>this.handleInputChange(s,"password"),onInput:s=>this.handleInputChange(s,"password"),required:!0}),i("label",{class:(this.userPassword?"FieldFilledIn":"")+" "+(!this.isValidPassword||this.hasError?"FieldInvalid":"")},r("password",this.lang)),!this.isValidPassword&&i("p",{class:"InvalidField"},r("invalidField",this.lang))),"true"==this.passwordReset&&i("div",{class:"ForgotPassword"},i("button",{onClick:()=>this.resetPassword()},r("forgotPassword",this.lang))),i("button",{disabled:!(this.isValidUserEmail&&this.isValidPassword&&this.userNameEmail&&this.userPassword),class:"SubmitCredentials",onClick:()=>this.handleLogin()},r("login",this.lang)),this.hasError&&i("p",{class:"CredentialsError"},this.errorMessage?this.errorMessage:r("genericError",this.lang))));return i("section",{ref:s=>this.stylingContainer=s},t)}static get watchers(){return{translationUrl:["handleNewTranslations"]}}};n.style=':host{display:block;font-family:"Roboto", sans-serif}section{height:100%;width:100%;background-position:center;background-size:cover}.FormBox{height:100%;display:flex;position:relative;background:none;border:none;backdrop-filter:blur(15px) brightness(80%);justify-content:center;align-items:center}.InputBox{position:relative;margin:30px 0;width:310px;border-bottom:2px solid #0797B9}.InputBox.InputInvalidBox::after{content:"";height:2px;width:100%;transition:width 0.6s linear;background:#C23135}.InputBox::after{content:"";display:block;width:0;height:2px;position:relative;top:2px}.InputBox .PasswordVisibilityIcon{fill:#0797B9}.InputBox .InputIcon .TogglePasswordVisibility{cursor:pointer;position:absolute;top:18px;right:0}.InputBox .InputIcon .TogglePasswordVisibility.PasswordVisible{top:19.5px}.InputBox label{position:absolute;top:50%;left:5px;transform:translateY(-50%);color:#0797B9;font-size:1em;pointer-events:none;transition:0.5s}.InputBox label.FieldInvalid{color:#C23135}.InputBox input{width:100%;height:50px;background:transparent;border:none;outline:none;font-size:1em;padding:0 35px 0 5px;color:#fff;box-sizing:border-box}input:focus~label,label.FieldFilledIn{top:-3px;font-size:0.7em}.ForgotPassword button{margin:-10px 0 17px;font-size:0.9em;color:#0797B9;display:flex;justify-content:space-between;background-color:transparent;padding:0;height:unset;border:0;cursor:pointer}.ForgotPassword button:hover{color:#fff}.SubmitCredentials{display:block;margin:0 auto;padding:10px 20px;border-radius:5px;color:var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));background:linear-gradient(to right, #EA0C66, #77318F);border:none;outline:none;cursor:pointer;font-size:1em}.SubmitCredentials:disabled{background:#707070}.Register{font-size:0.9em;color:#fff;text-align:center;margin:25px 0 10px}.Register p a{text-decoration:none;color:#fff;font-weight:600}.Register p a:hover{text-decoration:underline}.InvalidField{position:absolute;top:45px;color:#C23135;font-size:0.7em}.SubmitCredentials{margin-bottom:20px}.CredentialsError{color:#C23135;font-size:0.7em;padding:0 0 20px 0;margin:0}@media screen and (max-width: 480px){.FormBox{width:100%;border-radius:0px}}';export{n as user_login}
@@ -1 +1 @@
1
- import{p as s,b as e}from"./p-f775dfb7.js";(()=>{const e=import.meta.url,r={};return""!==e&&(r.resourcesUrl=new URL(".",e).href),s(r)})().then((s=>e([["p-05867322",[[1,"user-login",{endpoint:[513],lang:[1537],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],passwordReset:[513,"password-reset"],userEmailRegex:[513,"user-email-regex"],userEmailRegexOptions:[513,"user-email-regex-options"],passwordRegex:[513,"password-regex"],passwordRegexOptions:[513,"password-regex-options"],userNameEmail:[32],userPassword:[32],isValidUserEmail:[32],isValidPassword:[32],isPasswordVisible:[32],limitStylingAppends:[32],errorMessage:[32],hasError:[32]}]]]],s)));
1
+ import{p as s,b as e}from"./p-f775dfb7.js";(()=>{const e=import.meta.url,r={};return""!==e&&(r.resourcesUrl=new URL(".",e).href),s(r)})().then((s=>e([["p-26b5d1e1",[[1,"user-login",{endpoint:[513],lang:[1537],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],passwordReset:[513,"password-reset"],userEmailRegex:[513,"user-email-regex"],userEmailRegexOptions:[513,"user-email-regex-options"],passwordRegex:[513,"password-regex"],passwordRegexOptions:[513,"password-regex-options"],userNameEmail:[32],userPassword:[32],isValidUserEmail:[32],isValidPassword:[32],isPasswordVisible:[32],limitStylingAppends:[32],errorMessage:[32],hasError:[32]}]]]],s)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/user-login",
3
- "version": "1.33.3",
3
+ "version": "1.33.4",
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 s,h as i}from"./p-f775dfb7.js";const o=["ro","en","cz","de","hr"],t={en:{invalidField:"This field is invalid",forgotPassword:"Forgot Password",userEmail:"Username or Email",password:"Password",login:"Login",genericError:"An unexpected error has occured",successMessage:"Login successful"},ro:{invalidField:"This field is invalid",forgotPassword:"Forgot Password",userEmail:"Username or Email",password:"Password",login:"Login",genericError:"An unexpected error has occured",successMessage:"Login successful"},hr:{invalidField:"Ovo polje je nevažeće",forgotPassword:"Zaboravljena lozinka",userEmail:"Korisničko ime ili email",password:"Lozinka",login:"Prijava",genericError:"Došlo je do neočekivane pogreške",successMessage:"Prijava uspješna"},fr:{invalidField:"This field is invalid",forgotPassword:"Forgot Password",userEmail:"Username or Email",password:"Password",login:"Login",genericError:"An unexpected error has occured",successMessage:"Login successful"},cs:{invalidField:"Ovo polje je nevažeće.",forgotPassword:"Zaboravio sam lozinku ",userEmail:"Korisničko ime ili email",password:"Lozinka",login:"Prijava",genericError:"An unexpected error has occured",successMessage:"Login successful"},de:{invalidField:"This field is invalid",forgotPassword:"Forgot Password",userEmail:"Username or Email",password:"Password",login:"Login",genericError:"An unexpected error has occured",successMessage:"Login successful"},"pt-br":{invalidField:"O campo é inválido",forgotPassword:"Esqueceu sua senha",userEmail:"Usuário ou e-mail",Password:"Senha",login:"Entrem",genericError:"Ocorreu um erro inesperado",successMessage:"Você fez login com sucesso"},"es-mx":{invalidField:"El campo es inválido",forgotPassword:"Olvidó contraseña",userEmail:"Usuario o Correo Electrónico",Password:"Contraseña",login:"Entrar",genericError:"Ha ocurrido un error inesperado",successMessage:"Ha ingreasado de forma exitosa"}},e=s=>new Promise((i=>{fetch(s).then((s=>s.json())).then((s=>{Object.keys(s).forEach((i=>{for(let o in s[i])t[i][o]=s[i][o]})),i(!0)}))})),r=(s,i,e)=>{const r=i;let n=t[void 0!==r&&o.includes(r)?r:"en"][s];if(void 0!==e)for(const[s,i]of Object.entries(e.values)){const o=new RegExp(`{${s}}`,"g");n=n.replace(o,i)}return n},n=class{constructor(i){s(this,i),this.endpoint="",this.lang="en",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.passwordReset="false",this.userEmailRegexOptions="i",this.passwordRegexOptions="",this.userNameEmail="",this.userPassword="",this.isValidUserEmail=!0,this.isValidPassword=!0,this.isPasswordVisible=!1,this.limitStylingAppends=!1,this.errorMessage="",this.hasError=!1,this.setClientStyling=()=>{let s=document.createElement("style");s.innerHTML=this.clientStyling,this.stylingContainer.appendChild(s)},this.setClientStylingURL=()=>{let s=new URL(this.clientStylingUrl),i=document.createElement("style");fetch(s.href).then((s=>s.text())).then((s=>{i.innerHTML=s,setTimeout((()=>{this.stylingContainer.appendChild(i)}),1)}))},this.messageHandler=s=>{switch(s.data.type){case"SendLoginCredentials":this.userNameEmail=s.data.data.userNameEmail,this.userPassword=s.data.data.userPassword,this.userLogin({username:this.userNameEmail,password:this.userPassword})}},this.userLogin=async({username:s,password:i})=>{let o={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:s,password:i})};fetch(`${this.endpoint}/v1/player/legislation/login`,o).then((s=>s.json())).then((s=>{var i,o;(null===(i=s.sessionBlockers)||void 0===i?void 0:i.includes("has-to-set-consents"))&&window.postMessage({type:"PlayerActions",gmversion:"gm16"},window.location.href),!0===(null==s?void 0:s.hasToSetPass)&&window.postMessage({type:"HasToSetPass"},window.location.href),s.sessionId?(window.postMessage({type:"UserSessionID",session:s.sessionId,userid:s.userId},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"success",message:r("successMessage",this.lang)}},window.location.href),this.hasError=!1):(this.hasError=!0,this.errorMessage=null===(o=null==s?void 0:s.thirdPartyResponse)||void 0===o?void 0:o.message,this.errorMessage&&(console.error(this.errorMessage),this.sendErrorNotification(this.errorMessage)))})).catch((s=>{console.error(s),this.hasError=!0,this.errorMessage=r("genericError",this.lang),this.sendErrorNotification(this.errorMessage)}))},this.debouncedUserLogin=this.debounce(this.userLogin,850),this.handleLogin=()=>{this.debouncedUserLogin({username:this.userNameEmail,password:this.userPassword})},this.handleInputChange=(s,i)=>{this.hasError=!1;const o=s.target.value;"user"===i?(this.userNameEmail=o,this.isValidUserEmail=this.userEmailValidation(this.userNameEmail)):(this.userPassword=o,this.isValidPassword=this.passwordValidation(o))},this.userEmailValidation=s=>new RegExp(this.userEmailRegex,this.userEmailRegexOptions).test(s),this.passwordValidation=s=>new RegExp(this.passwordRegex,this.passwordRegexOptions).test(s),this.togglePassword=()=>{this.isPasswordVisible=!this.isPasswordVisible},this.resetPassword=()=>{window.postMessage({type:"NavForgotPassword"},window.location.href)}}handleNewTranslations(){e(this.translationUrl)}async componentWillLoad(){this.translationUrl.length>2&&await e(this.translationUrl)}componentDidLoad(){window.addEventListener("message",this.messageHandler)}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}sendErrorNotification(s){window.postMessage({type:"HasError",error:s},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"error",message:s}},window.location.href)}debounce(s,i){let o;return function(...t){clearTimeout(o),o=setTimeout((()=>{s.apply(this,t)}),i)}}render(){let s=i("span",{class:"InputIcon"},this.isPasswordVisible&&i("svg",{onClick:()=>this.togglePassword(),class:"TogglePasswordVisibility",part:"TogglePasswordVisibility",xmlns:"http://www.w3.org/2000/svg",width:"18.844",height:"12.887",viewBox:"0 0 18.844 12.887"},i("g",{transform:"translate(-110.856 -23.242)"},i("circle",{class:"PasswordVisibilityIcon",cx:"0.05",cy:"0.05",r:"0.05",transform:"translate(121.017 31.148)"}),i("g",{transform:"translate(117.499 27.37)"},i("path",{class:"PasswordVisibilityIcon",d:"M147.413,43.174a2.774,2.774,0,0,0-3.229-3.943Z",transform:"translate(-142.164 -39.123)"}),i("path",{class:"PasswordVisibilityIcon",d:"M137.031,43.1a2.778,2.778,0,0,0,3.447,4.209Z",transform:"translate(-136.413 -42.068)"})),i("g",{transform:"translate(110.856 24.899)"},i("path",{class:"PasswordVisibilityIcon",d:"M122.538,42.061a7.043,7.043,0,0,1-2.325.53,10.373,10.373,0,0,1-4.393-1.482,36.509,36.509,0,0,1-3.873-2.391.13.13,0,0,1,0-.208,44.141,44.141,0,0,1,3.873-2.651c.394-.233.768-.437,1.13-.622l-.686-.838c-.322.167-.651.347-.99.55a37.989,37.989,0,0,0-3.977,2.729,1.21,1.21,0,0,0-.442.962,1.1,1.1,0,0,0,.494.936,34.416,34.416,0,0,0,3.977,2.469,11.468,11.468,0,0,0,4.886,1.611,8.427,8.427,0,0,0,3.039-.725Z",transform:"translate(-110.856 -33.157)"}),i("path",{class:"PasswordVisibilityIcon",d:"M149.119,34.14a45.875,45.875,0,0,0-4.055-2.729,20.541,20.541,0,0,0-2.547-1.248,5.6,5.6,0,0,0-4.79-.017l.7.856a5.254,5.254,0,0,1,1.672-.346,10.072,10.072,0,0,1,4.445,1.663,34.132,34.132,0,0,1,3.925,2.651.13.13,0,0,1,0,.208,40.2,40.2,0,0,1-3.925,2.391c-.179.092-.352.176-.525.26l.684.835c.1-.054.2-.1.309-.159a36.356,36.356,0,0,0,4.055-2.469,1.067,1.067,0,0,0,.52-.936A1.159,1.159,0,0,0,149.119,34.14Z",transform:"translate(-130.743 -29.617)"})),i("rect",{class:"PasswordVisibilityIcon",width:"0.972",height:"15.861",rx:"0.486",transform:"translate(114.827 23.858) rotate(-39.315)"}))),!this.isPasswordVisible&&i("svg",{onClick:()=>this.togglePassword(),class:"TogglePasswordVisibility PasswordVisible",part:"TogglePasswordVisibility",xmlns:"http://www.w3.org/2000/svg",width:"18.843",height:"10.5",viewBox:"0 0 18.843 10.5"},i("g",{transform:"translate(-14.185 -27.832)"},i("path",{class:"PasswordVisibilityIcon",d:"M23.541,38.332a11.467,11.467,0,0,1-4.886-1.611,34.413,34.413,0,0,1-3.976-2.469,1.1,1.1,0,0,1-.494-.936,1.21,1.21,0,0,1,.442-.962A37.986,37.986,0,0,1,18.6,29.625a16.06,16.06,0,0,1,2.521-1.248,6.862,6.862,0,0,1,2.417-.546,6.862,6.862,0,0,1,2.417.546,20.541,20.541,0,0,1,2.547,1.248,45.872,45.872,0,0,1,4.054,2.729,1.159,1.159,0,0,1,.468.962,1.067,1.067,0,0,1-.52.936,36.353,36.353,0,0,1-4.054,2.469A11.2,11.2,0,0,1,23.541,38.332Zm0-9.46a9.813,9.813,0,0,0-4.392,1.663,44.138,44.138,0,0,0-3.873,2.651.13.13,0,0,0,0,.208,36.5,36.5,0,0,0,3.873,2.391,10.372,10.372,0,0,0,4.392,1.481,11.051,11.051,0,0,0,4.444-1.481,40.2,40.2,0,0,0,3.925-2.391.13.13,0,0,0,0-.208h0a34.132,34.132,0,0,0-3.925-2.651A10.072,10.072,0,0,0,23.541,28.872Z",transform:"translate(0)"}),i("circle",{class:"PasswordVisibilityIcon",cx:"2.779",cy:"2.779",r:"2.779",transform:"translate(20.827 30.303)"})))),o=i("div",{class:"FormBox"},i("div",{class:"FormValue"},i("div",{class:!this.isValidUserEmail||this.hasError?"InputBox InputInvalidBox":"InputBox"},i("input",{type:"text",placeholder:"",value:this.userNameEmail,onFocus:s=>this.handleInputChange(s,"user"),onInput:s=>this.handleInputChange(s,"user"),required:!0}),i("label",{class:(this.userNameEmail?"FieldFilledIn":"")+" "+(!this.isValidUserEmail||this.hasError?"FieldInvalid":"")},r("userEmail",this.lang)),!this.isValidUserEmail&&i("p",{class:"InvalidField"},r("invalidField",this.lang))),i("div",{class:!this.isValidPassword||this.hasError?"InputBox InputInvalidBox":"InputBox"},s,i("input",{type:this.isPasswordVisible?"text":"password",placeholder:"",value:this.userPassword,onFocus:s=>this.handleInputChange(s,"password"),onInput:s=>this.handleInputChange(s,"password"),required:!0}),i("label",{class:(this.userPassword?"FieldFilledIn":"")+" "+(!this.isValidPassword||this.hasError?"FieldInvalid":"")},r("password",this.lang)),!this.isValidPassword&&i("p",{class:"InvalidField"},r("invalidField",this.lang))),"true"==this.passwordReset&&i("div",{class:"ForgotPassword"},i("button",{onClick:()=>this.resetPassword()},r("forgotPassword",this.lang))),i("button",{disabled:!(this.isValidUserEmail&&this.isValidPassword&&this.userNameEmail&&this.userPassword),class:"SubmitCredentials",onClick:()=>this.handleLogin()},r("login",this.lang)),this.hasError&&i("p",{class:"CredentialsError"},this.errorMessage?this.errorMessage:r("genericError",this.lang))));return i("section",{ref:s=>this.stylingContainer=s},o)}static get watchers(){return{translationUrl:["handleNewTranslations"]}}};n.style=':host{display:block;font-family:"Roboto", sans-serif}section{height:100%;width:100%;background-position:center;background-size:cover}.FormBox{height:100%;display:flex;position:relative;background:none;border:none;backdrop-filter:blur(15px) brightness(80%);justify-content:center;align-items:center}.InputBox{position:relative;margin:30px 0;width:310px;border-bottom:2px solid #0797B9}.InputBox.InputInvalidBox::after{content:"";height:2px;width:100%;transition:width 0.6s linear;background:#C23135}.InputBox::after{content:"";display:block;width:0;height:2px;position:relative;top:2px}.InputBox .PasswordVisibilityIcon{fill:#0797B9}.InputBox .InputIcon .TogglePasswordVisibility{cursor:pointer;position:absolute;top:18px;right:0}.InputBox .InputIcon .TogglePasswordVisibility.PasswordVisible{top:19.5px}.InputBox label{position:absolute;top:50%;left:5px;transform:translateY(-50%);color:#0797B9;font-size:1em;pointer-events:none;transition:0.5s}.InputBox label.FieldInvalid{color:#C23135}.InputBox input{width:100%;height:50px;background:transparent;border:none;outline:none;font-size:1em;padding:0 35px 0 5px;color:#fff;box-sizing:border-box}input:focus~label,label.FieldFilledIn{top:-3px;font-size:0.7em}.ForgotPassword button{margin:-10px 0 17px;font-size:0.9em;color:#0797B9;display:flex;justify-content:space-between;background-color:transparent;padding:0;height:unset;border:0;cursor:pointer}.ForgotPassword button:hover{color:#fff}.SubmitCredentials{display:block;margin:0 auto;padding:10px 20px;border-radius:5px;color:var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));background:linear-gradient(to right, #EA0C66, #77318F);border:none;outline:none;cursor:pointer;font-size:1em}.SubmitCredentials:disabled{background:#707070}.Register{font-size:0.9em;color:#fff;text-align:center;margin:25px 0 10px}.Register p a{text-decoration:none;color:#fff;font-weight:600}.Register p a:hover{text-decoration:underline}.InvalidField{position:absolute;top:45px;color:#C23135;font-size:0.7em}.SubmitCredentials{margin-bottom:20px}.CredentialsError{color:#C23135;font-size:0.7em;padding:0 0 20px 0;margin:0}@media screen and (max-width: 480px){.FormBox{width:100%;border-radius:0px}}';export{n as user_login}