@everymatrix/user-login 1.44.0 → 1.45.0

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.
Files changed (48) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/index-465784fc.js +1240 -0
  3. package/dist/cjs/loader.cjs.js +7 -13
  4. package/dist/cjs/user-login.cjs.entry.js +301 -328
  5. package/dist/cjs/user-login.cjs.js +17 -11
  6. package/dist/collection/collection-manifest.json +3 -3
  7. package/dist/collection/components/user-login/index.js +1 -0
  8. package/dist/collection/components/user-login/user-login.js +397 -443
  9. package/dist/collection/utils/locale.utils.js +110 -110
  10. package/dist/collection/utils/utils.js +1 -1
  11. package/dist/esm/app-globals-0f993ce5.js +3 -0
  12. package/dist/esm/index-4e85bfaa.js +1214 -0
  13. package/dist/esm/loader.js +7 -13
  14. package/dist/esm/user-login.entry.js +301 -328
  15. package/dist/esm/user-login.js +14 -11
  16. package/dist/stencil.config.dev.js +17 -0
  17. package/dist/stencil.config.js +14 -19
  18. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/user-login/.stencil/packages/stencil/user-login/stencil.config.d.ts +2 -0
  19. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/user-login/.stencil/packages/stencil/user-login/stencil.config.dev.d.ts +2 -0
  20. package/dist/types/components/user-login/index.d.ts +1 -0
  21. package/dist/types/components/user-login/user-login.d.ts +80 -80
  22. package/dist/types/stencil-public-runtime.d.ts +142 -33
  23. package/dist/user-login/p-11519ff0.entry.js +1 -0
  24. package/dist/user-login/p-a86a26ad.js +2 -0
  25. package/dist/user-login/p-e1255160.js +1 -0
  26. package/dist/user-login/user-login.esm.js +1 -1
  27. package/loader/cdn.js +1 -3
  28. package/loader/index.cjs.js +1 -3
  29. package/loader/index.d.ts +13 -1
  30. package/loader/index.es2017.js +1 -3
  31. package/loader/index.js +1 -3
  32. package/loader/package.json +1 -0
  33. package/package.json +8 -1
  34. package/dist/cjs/index-5d65f61a.js +0 -1233
  35. package/dist/components/index.d.ts +0 -26
  36. package/dist/components/index.js +0 -1
  37. package/dist/components/user-login.d.ts +0 -11
  38. package/dist/components/user-login.js +0 -389
  39. package/dist/esm/index-20da8fd1.js +0 -1208
  40. package/dist/esm/polyfills/core-js.js +0 -11
  41. package/dist/esm/polyfills/css-shim.js +0 -1
  42. package/dist/esm/polyfills/dom.js +0 -79
  43. package/dist/esm/polyfills/es5-html-element.js +0 -1
  44. package/dist/esm/polyfills/index.js +0 -34
  45. package/dist/esm/polyfills/system.js +0 -6
  46. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/user-login/.stencil/packages/user-login/stencil.config.d.ts +0 -2
  47. package/dist/user-login/p-55726395.js +0 -1
  48. package/dist/user-login/p-f0b89924.entry.js +0 -1
@@ -1,26 +0,0 @@
1
- /* UserLogin custom elements */
2
-
3
- import type { Components, JSX } from "../types/components";
4
-
5
- /**
6
- * Used to manually set the base path where assets can be found.
7
- * If the script is used as "module", it's recommended to use "import.meta.url",
8
- * such as "setAssetPath(import.meta.url)". Other options include
9
- * "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
10
- * dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
11
- * But do note that this configuration depends on how your script is bundled, or lack of
12
- * bundling, and where your assets can be loaded from. Additionally custom bundling
13
- * will have to ensure the static assets are copied to its build directory.
14
- */
15
- export declare const setAssetPath: (path: string) => void;
16
-
17
- export interface SetPlatformOptions {
18
- raf?: (c: FrameRequestCallback) => number;
19
- ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
20
- rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
21
- }
22
- export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
23
-
24
- export type { Components, JSX };
25
-
26
- export * from '../types';
@@ -1 +0,0 @@
1
- export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
@@ -1,11 +0,0 @@
1
- import type { Components, JSX } from "../types/components";
2
-
3
- interface UserLogin extends Components.UserLogin, HTMLElement {}
4
- export const UserLogin: {
5
- prototype: UserLogin;
6
- new (): UserLogin;
7
- };
8
- /**
9
- * Used to define this component and all nested components recursively.
10
- */
11
- export const defineCustomElement: () => void;
@@ -1,389 +0,0 @@
1
- import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
-
3
- const DEFAULT_LANGUAGE = 'en';
4
- const TRANSLATIONS = {
5
- en: {
6
- invalidField: 'This field is invalid',
7
- forgotPassword: 'Forgot Password',
8
- userEmail: 'Username or Email',
9
- password: 'Password',
10
- login: 'Login',
11
- genericError: 'An unexpected error has occured',
12
- successMessage: 'Login successful',
13
- Forbidden_UserAccount_Blocked: 'Player account blocked',
14
- Unauthorized: 'The player account number, e-mail address or password is incorrect'
15
- },
16
- ro: {
17
- invalidField: 'This field is invalid',
18
- forgotPassword: 'Forgot Password',
19
- userEmail: 'Username or Email',
20
- password: 'Password',
21
- login: 'Login',
22
- genericError: 'An unexpected error has occured',
23
- successMessage: 'Login successful',
24
- Forbidden_UserAccount_Blocked: 'Player account blocked',
25
- Unauthorized: 'Numărul contului de jucător, adresa de e-mail sau parola este incorectă'
26
- },
27
- hr: {
28
- invalidField: 'Ovo polje je nevažeće',
29
- forgotPassword: 'Zaboravljena lozinka',
30
- userEmail: 'Korisničko ime ili email',
31
- password: 'Lozinka',
32
- login: 'Prijava',
33
- genericError: 'Došlo je do neočekivane pogreške',
34
- successMessage: 'Prijava uspješna',
35
- Forbidden_UserAccount_Blocked: 'Vaš račun je blokiran',
36
- Unauthorized: 'Lozinka, e-mail adresa ili korisničko ime su pogrešno uneseni'
37
- },
38
- fr: {
39
- invalidField: 'This field is invalid',
40
- forgotPassword: 'Forgot Password',
41
- userEmail: 'Username or Email',
42
- password: 'Password',
43
- login: 'Login',
44
- genericError: 'An unexpected error has occured',
45
- successMessage: 'Login successful',
46
- Forbidden_UserAccount_Blocked: 'Player account blocked',
47
- Unauthorized: 'Le numéro de compte du joueur, l\'adresse e-mail ou le mot de passe est incorrect'
48
- },
49
- cs: {
50
- invalidField: 'Ovo polje je nevažeće.',
51
- forgotPassword: 'Zaboravio sam lozinku ',
52
- userEmail: 'Korisničko ime ili email',
53
- password: 'Lozinka',
54
- login: 'Prijava',
55
- genericError: 'An unexpected error has occured',
56
- successMessage: 'Login successful',
57
- Forbidden_UserAccount_Blocked: 'Player account blocked',
58
- Unauthorized: 'Číslo účtu hráče, e-mailová adresa nebo heslo je nesprávné'
59
- },
60
- de: {
61
- invalidField: 'This field is invalid',
62
- forgotPassword: 'Forgot Password',
63
- userEmail: 'Username or Email',
64
- password: 'Password',
65
- login: 'Login',
66
- genericError: 'An unexpected error has occured',
67
- successMessage: 'Login successful',
68
- Forbidden_UserAccount_Blocked: 'Player account blocked',
69
- Unauthorized: 'Die Spielerkontonummer, E-Mail-Adresse oder das Passwort ist falsch'
70
- },
71
- 'pt-br': {
72
- 'invalidField': 'O campo é inválido',
73
- 'forgotPassword': 'Esqueceu sua senha',
74
- 'userEmail': 'Usuário ou e-mail',
75
- 'Password': 'Senha',
76
- 'login': 'Entrem',
77
- 'genericError': 'Ocorreu um erro inesperado',
78
- 'successMessage': 'Você fez login com sucesso',
79
- 'Forbidden_UserAccount_Blocked': 'Player account blocked',
80
- 'Unauthorized': 'O número da conta do jogador, o endereço de e-mail ou a senha estão incorretos'
81
- },
82
- 'es-mx': {
83
- 'invalidField': 'El campo es inválido',
84
- 'forgotPassword': 'Olvidó contraseña',
85
- 'userEmail': 'Usuario o Correo Electrónico',
86
- 'Password': 'Contraseña',
87
- 'login': 'Entrar',
88
- 'genericError': 'Ha ocurrido un error inesperado',
89
- 'successMessage': 'Ha ingreasado de forma exitosa',
90
- 'Forbidden_UserAccount_Blocked': 'Player account blocked',
91
- 'Unauthorized': 'El número de cuenta del jugador, la dirección de correo electrónico o la contraseña son incorrectos'
92
- }
93
- };
94
- const getTranslations = (url) => {
95
- return new Promise((resolve) => {
96
- fetch(url)
97
- .then((res) => res.json())
98
- .then((data) => {
99
- Object.keys(data).forEach((lang) => {
100
- if (!TRANSLATIONS[lang]) {
101
- TRANSLATIONS[lang] = {};
102
- }
103
- for (let key in data[lang]) {
104
- TRANSLATIONS[lang][key] = data[lang][key];
105
- }
106
- });
107
- resolve(true);
108
- });
109
- });
110
- };
111
- const translate = (key, customLang, values) => {
112
- const lang = customLang;
113
- let translation = TRANSLATIONS[(lang !== undefined) && (lang in TRANSLATIONS) ? lang : DEFAULT_LANGUAGE][key];
114
- if (values !== undefined) {
115
- for (const [key, value] of Object.entries(values.values)) {
116
- const regex = new RegExp(`{${key}}`, 'g');
117
- translation = translation.replace(regex, value);
118
- }
119
- }
120
- return translation;
121
- };
122
-
123
- const userLoginCss = ":host{display:block;font-family:\"Roboto\", sans-serif}section{height:100%;width:100%;background-position:center;background-size:cover}.FormValue{width:100%}.FormBox{height:100%;display:flex;position:relative;background:none;border:none;justify-content:center;align-items:center}.InputBox{position:relative;margin:30px 0;width:100%;border-bottom:2px solid var(--emfe-w-registration-color-primary, var(--emfe-w-color-primary, #22B04E))}.InputBox.InputInvalidBox .PasswordVisibilityIcon{fill:var(--emfw-w-color-error, var(--emfe-w-color-red, #FD2839))}.InputBox.InputInvalidBox input{color:var(--emfw-w-color-error, var(--emfe-w-color-red, #FD2839))}.InputBox.InputInvalidBox::after{content:\"\";height:2px;width:100%;transition:width 0.6s linear;background:var(--emfw-w-color-error, var(--emfe-w-color-red, #FD2839))}.InputBox::after{content:\"\";display:block;width:0;height:2px;position:relative;top:2px}.InputBox .PasswordVisibilityIcon{fill:var(--emfe-w-registration-color-primary, var(--emfe-w-color-primary, #22B04E))}.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:var(--emfe-w-registration-color-primary, var(--emfe-w-color-primary, #22B04E));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:var(--emfe-w-registration-typography, var(--emfe-w-color-typography, #FFFFFF));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:var(--emfe-w-registration-color-primary, var(--emfe-w-color-primary, #22B04E));display:flex;justify-content:space-between;background-color:transparent;padding:0;height:unset;border:0;cursor:pointer}.SubmitCredentials{display:block;margin:0 auto;outline:none;cursor:pointer;background-image:linear-gradient(to bottom, color-mix(in srgb, var(--emw--color-primary, #22B04E) 80%, black 20%), var(--emw--color-primary, #22B04E), color-mix(in srgb, var(--emw--color-primary, #22B04E) 80%, white 30%));border:2px solid var(--emw--button-border-color, #0E5924);border-radius:var(--emw--button-border-radius, 50px);padding:10px 20px;font-size:var(--emw--font-size-large, 20px);font-family:var(--emw--button-typography);color:var(--emw--button-text-color, #FFFFFF)}.SubmitCredentials:disabled{background:#707070}.Register{font-size:0.9em;color:var(--emfe-w-registration-typography, var(--emfe-w-color-typography, #FFFFFF));text-align:center;margin:25px 0 10px}.Register p a{text-decoration:none;font-weight:600}.Register p a:hover{text-decoration:underline}.InvalidField{position:absolute;top:45px;color:var(--emfw-w-color-error, var(--emfe-w-color-red, #FD2839));font-size:0.7em}.SubmitCredentials{margin-bottom:20px}.CredentialsError{color:var(--emfw-w-color-error, var(--emfe-w-color-red, #FD2839));font-size:0.7em;padding:0 0 20px 0;margin:0}.CredentialsError input{color:var(--emfw-w-color-error, var(--emfe-w-color-red, #FD2839))}@media screen and (max-width: 480px){.FormBox{width:100%;border-radius:0px}}";
124
-
125
- const UserLogin$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
126
- constructor() {
127
- super();
128
- this.__registerHost();
129
- this.__attachShadow();
130
- /**
131
- * Endpoint
132
- */
133
- this.endpoint = '';
134
- /**
135
- * Language
136
- */
137
- this.lang = 'en';
138
- /**
139
- * Client styling
140
- */
141
- this.clientStyling = '';
142
- /**
143
- * Client styling by url
144
- */
145
- this.clientStylingUrl = '';
146
- /**
147
- * Translation url
148
- */
149
- this.translationUrl = '';
150
- /**
151
- * Password reset
152
- */
153
- this.passwordReset = 'false';
154
- /**
155
- * User email regex options
156
- */
157
- this.userEmailRegexOptions = 'i';
158
- /**
159
- * Password regex options
160
- */
161
- this.passwordRegexOptions = '';
162
- /**
163
- * Username
164
- */
165
- this.userNameEmail = '';
166
- /**
167
- * Password
168
- */
169
- this.userPassword = '';
170
- this.isValidUserEmail = true;
171
- this.isValidPassword = true;
172
- this.isPasswordVisible = false;
173
- this.limitStylingAppends = false;
174
- this.errorMessage = '';
175
- this.hasError = false;
176
- this.errorCode = '';
177
- this.setClientStyling = () => {
178
- let sheet = document.createElement('style');
179
- sheet.innerHTML = this.clientStyling;
180
- this.stylingContainer.appendChild(sheet);
181
- };
182
- this.setClientStylingURL = () => {
183
- let url = new URL(this.clientStylingUrl);
184
- let cssFile = document.createElement('style');
185
- fetch(url.href)
186
- .then((res) => res.text())
187
- .then((data) => {
188
- cssFile.innerHTML = data;
189
- setTimeout(() => { this.stylingContainer.appendChild(cssFile); }, 1);
190
- });
191
- };
192
- this.autofillCredentialsHandler = (e) => {
193
- this.userNameEmail = e.detail.userNameEmail;
194
- this.userPassword = e.detail.userPassword;
195
- this.handleLogin();
196
- };
197
- this.userLogin = async ({ username, password }) => {
198
- let headers = {
199
- 'Content-Type': 'application/json'
200
- };
201
- let bodyData = {
202
- username,
203
- password
204
- };
205
- let options = {
206
- method: 'POST',
207
- headers,
208
- body: JSON.stringify(bodyData),
209
- };
210
- fetch(`${this.endpoint}/v1/player/legislation/login`, options)
211
- .then((res) => {
212
- return res.json();
213
- }).then((data) => {
214
- var _a, _b, _c;
215
- if ((_a = data.sessionBlockers) === null || _a === void 0 ? void 0 : _a.includes('has-to-set-consents')) {
216
- window.postMessage({ type: 'PlayerActions', gmversion: 'gm16' }, window.location.href);
217
- }
218
- if ((data === null || data === void 0 ? void 0 : data.hasToSetPass) === true) {
219
- window.postMessage({ type: 'HasToSetPass' }, window.location.href);
220
- }
221
- if (data.sessionId) {
222
- window.postMessage({ type: 'UserSessionID', session: data.sessionId, userid: data.userId }, window.location.href);
223
- window.postMessage({ type: 'WidgetNotification', data: {
224
- type: 'success',
225
- message: translate('successMessage', this.lang)
226
- } }, window.location.href);
227
- this.hasError = false;
228
- }
229
- else {
230
- // handles errors thrown by api
231
- this.hasError = true;
232
- this.errorCode = (_b = data === null || data === void 0 ? void 0 : data.thirdPartyResponse) === null || _b === void 0 ? void 0 : _b.errorCode;
233
- this.errorMessage = translate(`${this.errorCode}`, this.lang) || ((_c = data === null || data === void 0 ? void 0 : data.thirdPartyResponse) === null || _c === void 0 ? void 0 : _c.message) || translate('genericError', this.lang);
234
- if (this.errorMessage) {
235
- console.error(this.errorMessage);
236
- this.sendErrorNotification(this.errorMessage);
237
- }
238
- }
239
- }).catch((err) => {
240
- // handles unexpected errors
241
- console.error(err);
242
- this.hasError = true;
243
- this.errorMessage = translate('genericError', this.lang);
244
- this.sendErrorNotification(this.errorMessage);
245
- });
246
- };
247
- this.debouncedUserLogin = this.debounce(this.userLogin, 850);
248
- this.handleLogin = () => {
249
- this.debouncedUserLogin({
250
- username: this.userNameEmail,
251
- password: this.userPassword
252
- });
253
- this.dispatchUpdateLoginCredentialsEvent();
254
- };
255
- this.handleInputChange = (event, location) => {
256
- this.hasError = false;
257
- const inputValue = event.target.value;
258
- if (location === 'user') {
259
- this.userNameEmail = inputValue;
260
- this.isValidUserEmail = this.userEmailValidation(this.userNameEmail);
261
- }
262
- else {
263
- this.userPassword = inputValue;
264
- this.isValidPassword = this.passwordValidation(inputValue);
265
- }
266
- };
267
- this.userEmailValidation = (input) => {
268
- const regex = new RegExp(this.userEmailRegex, this.userEmailRegexOptions);
269
- return regex.test(input);
270
- };
271
- this.passwordValidation = (input) => {
272
- const regex = new RegExp(this.passwordRegex, this.passwordRegexOptions);
273
- return regex.test(input);
274
- };
275
- this.togglePassword = () => {
276
- this.isPasswordVisible = !this.isPasswordVisible;
277
- };
278
- this.resetPassword = () => {
279
- window.postMessage({ type: "NavForgotPassword" }, window.location.href);
280
- };
281
- }
282
- handleNewTranslations() {
283
- getTranslations(this.translationUrl);
284
- }
285
- async componentWillLoad() {
286
- if (this.translationUrl.length > 2) {
287
- await getTranslations(this.translationUrl);
288
- }
289
- }
290
- componentDidLoad() {
291
- window.addEventListener('LoginCredentials', this.autofillCredentialsHandler);
292
- window.postMessage({ type: 'UserLoginDidLoad' });
293
- }
294
- componentDidRender() {
295
- // start custom styling area
296
- if (!this.limitStylingAppends && this.stylingContainer) {
297
- if (this.clientStyling)
298
- this.setClientStyling();
299
- if (this.clientStylingUrl)
300
- this.setClientStylingURL();
301
- this.limitStylingAppends = true;
302
- }
303
- // end custom styling area
304
- }
305
- disconnectedCallback() {
306
- window.removeEventListener('LoginCredentials', this.autofillCredentialsHandler);
307
- }
308
- sendErrorNotification(errorMessage) {
309
- window.postMessage({ type: "HasError", error: errorMessage }, window.location.href);
310
- window.postMessage({ type: 'WidgetNotification', data: {
311
- type: 'error',
312
- message: errorMessage
313
- } }, window.location.href);
314
- }
315
- debounce(func, delay) {
316
- let timer;
317
- return function (...args) {
318
- clearTimeout(timer);
319
- timer = setTimeout(() => {
320
- func.apply(this, args);
321
- }, delay);
322
- };
323
- }
324
- dispatchUpdateLoginCredentialsEvent() {
325
- if (!this.hasError) {
326
- this.updateLoginCredentialsEvent = new CustomEvent("UpdateLoginCredentials", {
327
- bubbles: true,
328
- detail: {
329
- userNameEmail: this.userNameEmail,
330
- userPassword: this.userPassword
331
- }
332
- });
333
- window.dispatchEvent(this.updateLoginCredentialsEvent);
334
- }
335
- }
336
- ;
337
- render() {
338
- let visibilityIcon = h("span", { class: "InputIcon" }, this.isPasswordVisible &&
339
- 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 &&
340
- h("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" }, h("g", { transform: "translate(-14.185 -27.832)" }, h("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)" }), h("circle", { class: "PasswordVisibilityIcon", cx: "2.779", cy: "2.779", r: "2.779", transform: "translate(20.827 30.303)" }))));
341
- let userIdentification = h("div", { class: "FormBox" }, h("div", { class: "FormValue" }, h("div", { class: (!this.isValidUserEmail || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox' }, h("input", { type: "text", placeholder: '', value: this.userNameEmail, onFocus: (event) => this.handleInputChange(event, 'user'), onInput: (event) => this.handleInputChange(event, 'user'), autocapitalize: "none", required: true }), h("label", { class: (this.userNameEmail ? 'FieldFilledIn' : '') + ' ' + (!this.isValidUserEmail || this.hasError ? 'FieldInvalid' : '') }, translate('userEmail', this.lang)), !this.isValidUserEmail &&
342
- h("p", { class: "InvalidField" }, translate('invalidField', this.lang))), h("div", { class: (!this.isValidPassword || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox' }, visibilityIcon, h("input", { type: this.isPasswordVisible ? "text" : "password", placeholder: '', value: this.userPassword, onFocus: (event) => this.handleInputChange(event, 'password'), onInput: (event) => this.handleInputChange(event, 'password'), autocapitalize: "none", required: true }), h("label", { class: (this.userPassword ? 'FieldFilledIn' : '') + ' ' + (!this.isValidPassword || this.hasError ? 'FieldInvalid' : '') }, translate('password', this.lang)), !this.isValidPassword &&
343
- h("p", { class: "InvalidField" }, translate('invalidField', this.lang))), this.passwordReset == 'true' &&
344
- h("div", { class: "ForgotPassword" }, h("button", { onClick: () => this.resetPassword() }, translate('forgotPassword', this.lang))), h("button", { disabled: (!this.isValidUserEmail || !this.isValidPassword || !this.userNameEmail || !this.userPassword), class: "SubmitCredentials", onClick: () => this.handleLogin() }, translate('login', this.lang)), this.hasError &&
345
- h("p", { class: "CredentialsError" }, this.errorMessage)));
346
- return h("section", { ref: el => this.stylingContainer = el }, userIdentification);
347
- }
348
- static get watchers() { return {
349
- "translationUrl": ["handleNewTranslations"]
350
- }; }
351
- static get style() { return userLoginCss; }
352
- }, [1, "user-login", {
353
- "endpoint": [513],
354
- "lang": [1537],
355
- "clientStyling": [513, "client-styling"],
356
- "clientStylingUrl": [513, "client-styling-url"],
357
- "translationUrl": [513, "translation-url"],
358
- "passwordReset": [513, "password-reset"],
359
- "userEmailRegex": [513, "user-email-regex"],
360
- "userEmailRegexOptions": [513, "user-email-regex-options"],
361
- "passwordRegex": [513, "password-regex"],
362
- "passwordRegexOptions": [513, "password-regex-options"],
363
- "userNameEmail": [32],
364
- "userPassword": [32],
365
- "isValidUserEmail": [32],
366
- "isValidPassword": [32],
367
- "isPasswordVisible": [32],
368
- "limitStylingAppends": [32],
369
- "errorMessage": [32],
370
- "hasError": [32]
371
- }]);
372
- function defineCustomElement$1() {
373
- if (typeof customElements === "undefined") {
374
- return;
375
- }
376
- const components = ["user-login"];
377
- components.forEach(tagName => { switch (tagName) {
378
- case "user-login":
379
- if (!customElements.get(tagName)) {
380
- customElements.define(tagName, UserLogin$1);
381
- }
382
- break;
383
- } });
384
- }
385
-
386
- const UserLogin = UserLogin$1;
387
- const defineCustomElement = defineCustomElement$1;
388
-
389
- export { UserLogin, defineCustomElement };