@everymatrix/user-login 1.59.3 → 1.60.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.
- package/dist/cjs/user-login.cjs.entry.js +30 -10
- package/dist/collection/components/user-login/user-login.js +11 -9
- package/dist/esm/user-login.entry.js +30 -10
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/user-login/.stencil/packages/stencil/user-login/stencil.config.d.ts +2 -0
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/user-login/.stencil/packages/stencil/user-login/stencil.config.dev.d.ts +2 -0
- package/dist/user-login/{p-8a5948a1.entry.js → p-8fc23f48.entry.js} +2 -2
- package/dist/user-login/user-login.esm.js +1 -1
- package/package.json +1 -1
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/user-login/.stencil/packages/stencil/user-login/stencil.config.d.ts +0 -2
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/user-login/.stencil/packages/stencil/user-login/stencil.config.dev.d.ts +0 -2
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/user-login/.stencil/libs/common/src/storybook/storybook-utils.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/user-login/.stencil/packages/stencil/user-login/storybook/main.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/user-login/.stencil/packages/stencil/user-login/storybook/preview.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/user-login/.stencil/tools/plugins/index.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/user-login/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/user-login/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/user-login/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
|
@@ -285,13 +285,32 @@ function setStreamStyling(stylingContainer, domain, subscription) {
|
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
287
|
|
|
288
|
+
/**
|
|
289
|
+
* @name dispatchCustomEvent
|
|
290
|
+
* @description dispatches the custom event CustomEventProcessor is listening for
|
|
291
|
+
* @param {string} type of the custom event
|
|
292
|
+
* @param {Object} data may contain additional information about the event, e.g. userId
|
|
293
|
+
*/
|
|
294
|
+
const dispatchCustomEvent = (type, data = {}) => {
|
|
295
|
+
const event = new CustomEvent('track-custom-event', {
|
|
296
|
+
detail: {
|
|
297
|
+
type,
|
|
298
|
+
data
|
|
299
|
+
},
|
|
300
|
+
bubbles: true,
|
|
301
|
+
composed: true
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
document.dispatchEvent(event);
|
|
305
|
+
};
|
|
306
|
+
|
|
288
307
|
/**
|
|
289
308
|
* @license
|
|
290
309
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
291
310
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
292
311
|
*/
|
|
293
312
|
|
|
294
|
-
function defineCustomElement(CustomElement, version = '24.5.
|
|
313
|
+
function defineCustomElement(CustomElement, version = '24.5.10') {
|
|
295
314
|
Object.defineProperty(CustomElement, 'version', {
|
|
296
315
|
get() {
|
|
297
316
|
return version;
|
|
@@ -21996,6 +22015,7 @@ const UserLogin = class {
|
|
|
21996
22015
|
message: translate$1('successMessage', this.lang)
|
|
21997
22016
|
} }, window.location.href);
|
|
21998
22017
|
this.hasError = false;
|
|
22018
|
+
dispatchCustomEvent('logged_in', { userId: data.userId });
|
|
21999
22019
|
}
|
|
22000
22020
|
else {
|
|
22001
22021
|
// handles errors thrown by api
|
|
@@ -22232,20 +22252,20 @@ const UserLogin = class {
|
|
|
22232
22252
|
* Render function
|
|
22233
22253
|
*/
|
|
22234
22254
|
render() {
|
|
22235
|
-
let visibilityIcon = index.h("span", { key: '
|
|
22236
|
-
index.h("svg", { key: '
|
|
22237
|
-
index.h("svg", { key: '
|
|
22238
|
-
let userIdentification = index.h("div", { key: '
|
|
22255
|
+
let visibilityIcon = index.h("span", { key: '5247ba1aa9f8208dcf3bd594bdadbafc872203e7', class: "InputIcon" }, this.isPasswordVisible &&
|
|
22256
|
+
index.h("svg", { key: 'bba821c08ba3bf7def52d82534b3f3d35ce82043', 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", { key: '85a74668809bd002bdc50c317d2cba4957e6d86b', transform: "translate(-110.856 -23.242)" }, index.h("circle", { key: 'd74bd44ed1a2da0f34a0c0dad38a8f5b47ca66ca', class: "PasswordVisibilityIcon", cx: "0.05", cy: "0.05", r: "0.05", transform: "translate(121.017 31.148)" }), index.h("g", { key: '99a13eae7b1dbbb4ff1c529eb61f478f9707121b', transform: "translate(117.499 27.37)" }, index.h("path", { key: 'cb210c909fb66a52d4e61d2e94cb7a41420b08b1', 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", { key: '992a1e8fe902029233261a388956c304a702c24a', 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", { key: '55c770518f9c9bd6edc0a7aa6d61f2ebfecf7fb3', transform: "translate(110.856 24.899)" }, index.h("path", { key: '632faef68fb66274f1562703c72fb3b7e33ed2d4', 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", { key: '06b43037bd6e527436b0bdebef02e8021072ee3b', 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", { key: '3cb2410ff11f0218df6f62b53f71ab91473b230e', class: "PasswordVisibilityIcon", width: "0.972", height: "15.861", rx: "0.486", transform: "translate(114.827 23.858) rotate(-39.315)" }))), !this.isPasswordVisible &&
|
|
22257
|
+
index.h("svg", { key: '8f302630f4f4f5bafe986600bafa42b7b2136cd4', 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" }, index.h("g", { key: '5163e48b86eda60be27eb9b0485253886af967e3', transform: "translate(-14.185 -27.832)" }, index.h("path", { key: '1cf091c89a8da407adfb410f019602b780b01d0b', 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)" }), index.h("circle", { key: 'cff32985dd5e49e93e7b101a0a5205494708b87b', class: "PasswordVisibilityIcon", cx: "2.779", cy: "2.779", r: "2.779", transform: "translate(20.827 30.303)" }))));
|
|
22258
|
+
let userIdentification = index.h("div", { key: 'd11df3b91d2b5176ce2742130851bcecf53ca340', class: "FormBox" }, index.h("div", { key: 'fcba164be90c9bcb6e809e65cec8182a0848e7b7', class: "FormValue" }, this.loginByPhoneNumber === 'true'
|
|
22239
22259
|
? index.h("div", { class: (!this.isValidUserPhone || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox ' }, index.h("div", { class: "PhoneInputBox" }, index.h("div", { class: "PrefixBox" }, index.h("vaadin-combo-box", { items: this.userPrefixOptions, value: this.userPrefix, onChange: this.handleInputChangePartial('prefix') }), index.h("label", { class: (this.userPrefix ? 'FieldFilledIn' : '') + ' ' + (!this.isValidUserPhone || this.hasError ? 'FieldInvalid' : '') }, translate$1('userPrefix', this.lang))), index.h("div", { class: "PhoneBox" }, index.h("input", { type: "text", placeholder: '', value: this.userPhone, onFocus: this.handleInputChangePartial('phone'), onInput: this.handleInputChangePartial('phone'), autocapitalize: "none", required: true }), index.h("label", { class: (this.userPhone ? 'FieldFilledIn' : '') + ' ' + (!this.isValidUserPhone || this.hasError ? 'FieldInvalid' : '') }, translate$1('userPhone', this.lang)))), !this.isValidUserPhone &&
|
|
22240
22260
|
index.h("p", { class: "InvalidField" }, translate$1('invalidField', this.lang)))
|
|
22241
22261
|
: index.h("div", { class: (!this.isValidUserEmail || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox' }, index.h("input", { type: "text", placeholder: '', value: this.userNameEmail, onFocus: this.handleInputChangePartial('user'), onInput: this.handleInputChangePartial('user'), autocapitalize: "none", required: true }), index.h("label", { class: (this.userNameEmail ? 'FieldFilledIn' : '') + ' ' + (!this.isValidUserEmail || this.hasError ? 'FieldInvalid' : '') }, translate$1('userEmail', this.lang)), !this.isValidUserEmail &&
|
|
22242
|
-
index.h("p", { class: "InvalidField" }, translate$1('invalidField', this.lang))), index.h("div", { key: '
|
|
22243
|
-
index.h("p", { key: '
|
|
22244
|
-
index.h("div", { key: '
|
|
22262
|
+
index.h("p", { class: "InvalidField" }, translate$1('invalidField', this.lang))), index.h("div", { key: '4d5ed09db6a553c694cea9d2487301156a5f602d', class: (!this.isValidPassword || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox' }, visibilityIcon, index.h("input", { key: 'c298e5d19bdd55f180397d0d943a171cb3b84d6a', type: this.isPasswordVisible ? "text" : "password", placeholder: '', value: this.userPassword, onFocus: this.handleInputChangePartial('password'), onInput: this.handleInputChangePartial('password'), autocapitalize: "none", required: true }), index.h("label", { key: '6de9548545e57214f937129c34b6c8fc3cb56e67', class: (this.userPassword ? 'FieldFilledIn' : '') + ' ' + (!this.isValidPassword || this.hasError ? 'FieldInvalid' : '') }, translate$1('password', this.lang)), !this.isValidPassword &&
|
|
22263
|
+
index.h("p", { key: 'd140446490ce18962d67e068b3c6f021453ec0f3', class: "InvalidField" }, translate$1('invalidField', this.lang))), this.passwordReset == 'true' &&
|
|
22264
|
+
index.h("div", { key: '894ff57a5c2eb6561ecd4b5e1b507c605001ca92', class: "ForgotPassword" }, index.h("button", { key: '77e12a76aa3a9ce581f06405bd2b07e80787ac09', onClick: this.resetPassword }, translate$1('forgotPassword', this.lang))), index.h("button", { key: 'a0b0f632c1950f6544230842d71605ac594f7cea', disabled: ((this.loginByPhoneNumber !== 'true' && (!this.isValidUserEmail || !this.userNameEmail)) ||
|
|
22245
22265
|
(this.loginByPhoneNumber === 'true' && (!this.isValidUserPhone || !this.userPhone || !this.userPrefix)) ||
|
|
22246
22266
|
!this.userPassword || !this.isValidPassword) || this.isLoginLoading, class: "SubmitCredentials", onClick: this.handleLogin }, translate$1('login', this.lang)), this.hasError &&
|
|
22247
|
-
index.h("p", { key: '
|
|
22248
|
-
return index.h("section", { key: '
|
|
22267
|
+
index.h("p", { key: '00e5641d2db355dab4b7b544249482dd4bbdd31a', class: "CredentialsError" }, this.errorMessage)));
|
|
22268
|
+
return index.h("section", { key: '12256f6bbbaf7ddbfe19483463dc85a521c25e9f', ref: el => this.stylingContainer = el }, userIdentification);
|
|
22249
22269
|
}
|
|
22250
22270
|
static get watchers() { return {
|
|
22251
22271
|
"translationUrl": ["handleNewTranslations"],
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { getTranslations, translate } from "../../utils/locale.utils";
|
|
3
3
|
import { setClientStyling, setClientStylingURL, setStreamStyling } from "../../../../../../../../libs/common/src/styling/index";
|
|
4
|
+
import { dispatchCustomEvent } from "../../../../../../../../libs/custom-events/src/index";
|
|
4
5
|
import "@vaadin/combo-box";
|
|
5
6
|
export class UserLogin {
|
|
6
7
|
constructor() {
|
|
@@ -150,6 +151,7 @@ export class UserLogin {
|
|
|
150
151
|
message: translate('successMessage', this.lang)
|
|
151
152
|
} }, window.location.href);
|
|
152
153
|
this.hasError = false;
|
|
154
|
+
dispatchCustomEvent('logged_in', { userId: data.userId });
|
|
153
155
|
}
|
|
154
156
|
else {
|
|
155
157
|
// handles errors thrown by api
|
|
@@ -386,20 +388,20 @@ export class UserLogin {
|
|
|
386
388
|
* Render function
|
|
387
389
|
*/
|
|
388
390
|
render() {
|
|
389
|
-
let visibilityIcon = h("span", { key: '
|
|
390
|
-
h("svg", { key: '
|
|
391
|
-
h("svg", { key: '
|
|
392
|
-
let userIdentification = h("div", { key: '
|
|
391
|
+
let visibilityIcon = h("span", { key: '5247ba1aa9f8208dcf3bd594bdadbafc872203e7', class: "InputIcon" }, this.isPasswordVisible &&
|
|
392
|
+
h("svg", { key: 'bba821c08ba3bf7def52d82534b3f3d35ce82043', 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", { key: '85a74668809bd002bdc50c317d2cba4957e6d86b', transform: "translate(-110.856 -23.242)" }, h("circle", { key: 'd74bd44ed1a2da0f34a0c0dad38a8f5b47ca66ca', class: "PasswordVisibilityIcon", cx: "0.05", cy: "0.05", r: "0.05", transform: "translate(121.017 31.148)" }), h("g", { key: '99a13eae7b1dbbb4ff1c529eb61f478f9707121b', transform: "translate(117.499 27.37)" }, h("path", { key: 'cb210c909fb66a52d4e61d2e94cb7a41420b08b1', 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", { key: '992a1e8fe902029233261a388956c304a702c24a', 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", { key: '55c770518f9c9bd6edc0a7aa6d61f2ebfecf7fb3', transform: "translate(110.856 24.899)" }, h("path", { key: '632faef68fb66274f1562703c72fb3b7e33ed2d4', 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", { key: '06b43037bd6e527436b0bdebef02e8021072ee3b', 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", { key: '3cb2410ff11f0218df6f62b53f71ab91473b230e', class: "PasswordVisibilityIcon", width: "0.972", height: "15.861", rx: "0.486", transform: "translate(114.827 23.858) rotate(-39.315)" }))), !this.isPasswordVisible &&
|
|
393
|
+
h("svg", { key: '8f302630f4f4f5bafe986600bafa42b7b2136cd4', 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", { key: '5163e48b86eda60be27eb9b0485253886af967e3', transform: "translate(-14.185 -27.832)" }, h("path", { key: '1cf091c89a8da407adfb410f019602b780b01d0b', 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", { key: 'cff32985dd5e49e93e7b101a0a5205494708b87b', class: "PasswordVisibilityIcon", cx: "2.779", cy: "2.779", r: "2.779", transform: "translate(20.827 30.303)" }))));
|
|
394
|
+
let userIdentification = h("div", { key: 'd11df3b91d2b5176ce2742130851bcecf53ca340', class: "FormBox" }, h("div", { key: 'fcba164be90c9bcb6e809e65cec8182a0848e7b7', class: "FormValue" }, this.loginByPhoneNumber === 'true'
|
|
393
395
|
? h("div", { class: (!this.isValidUserPhone || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox ' }, h("div", { class: "PhoneInputBox" }, h("div", { class: "PrefixBox" }, h("vaadin-combo-box", { items: this.userPrefixOptions, value: this.userPrefix, onChange: this.handleInputChangePartial('prefix') }), h("label", { class: (this.userPrefix ? 'FieldFilledIn' : '') + ' ' + (!this.isValidUserPhone || this.hasError ? 'FieldInvalid' : '') }, translate('userPrefix', this.lang))), h("div", { class: "PhoneBox" }, h("input", { type: "text", placeholder: '', value: this.userPhone, onFocus: this.handleInputChangePartial('phone'), onInput: this.handleInputChangePartial('phone'), autocapitalize: "none", required: true }), h("label", { class: (this.userPhone ? 'FieldFilledIn' : '') + ' ' + (!this.isValidUserPhone || this.hasError ? 'FieldInvalid' : '') }, translate('userPhone', this.lang)))), !this.isValidUserPhone &&
|
|
394
396
|
h("p", { class: "InvalidField" }, translate('invalidField', this.lang)))
|
|
395
397
|
: h("div", { class: (!this.isValidUserEmail || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox' }, h("input", { type: "text", placeholder: '', value: this.userNameEmail, onFocus: this.handleInputChangePartial('user'), onInput: this.handleInputChangePartial('user'), autocapitalize: "none", required: true }), h("label", { class: (this.userNameEmail ? 'FieldFilledIn' : '') + ' ' + (!this.isValidUserEmail || this.hasError ? 'FieldInvalid' : '') }, translate('userEmail', this.lang)), !this.isValidUserEmail &&
|
|
396
|
-
h("p", { class: "InvalidField" }, translate('invalidField', this.lang))), h("div", { key: '
|
|
397
|
-
h("p", { key: '
|
|
398
|
-
h("div", { key: '
|
|
398
|
+
h("p", { class: "InvalidField" }, translate('invalidField', this.lang))), h("div", { key: '4d5ed09db6a553c694cea9d2487301156a5f602d', class: (!this.isValidPassword || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox' }, visibilityIcon, h("input", { key: 'c298e5d19bdd55f180397d0d943a171cb3b84d6a', type: this.isPasswordVisible ? "text" : "password", placeholder: '', value: this.userPassword, onFocus: this.handleInputChangePartial('password'), onInput: this.handleInputChangePartial('password'), autocapitalize: "none", required: true }), h("label", { key: '6de9548545e57214f937129c34b6c8fc3cb56e67', class: (this.userPassword ? 'FieldFilledIn' : '') + ' ' + (!this.isValidPassword || this.hasError ? 'FieldInvalid' : '') }, translate('password', this.lang)), !this.isValidPassword &&
|
|
399
|
+
h("p", { key: 'd140446490ce18962d67e068b3c6f021453ec0f3', class: "InvalidField" }, translate('invalidField', this.lang))), this.passwordReset == 'true' &&
|
|
400
|
+
h("div", { key: '894ff57a5c2eb6561ecd4b5e1b507c605001ca92', class: "ForgotPassword" }, h("button", { key: '77e12a76aa3a9ce581f06405bd2b07e80787ac09', onClick: this.resetPassword }, translate('forgotPassword', this.lang))), h("button", { key: 'a0b0f632c1950f6544230842d71605ac594f7cea', disabled: ((this.loginByPhoneNumber !== 'true' && (!this.isValidUserEmail || !this.userNameEmail)) ||
|
|
399
401
|
(this.loginByPhoneNumber === 'true' && (!this.isValidUserPhone || !this.userPhone || !this.userPrefix)) ||
|
|
400
402
|
!this.userPassword || !this.isValidPassword) || this.isLoginLoading, class: "SubmitCredentials", onClick: this.handleLogin }, translate('login', this.lang)), this.hasError &&
|
|
401
|
-
h("p", { key: '
|
|
402
|
-
return h("section", { key: '
|
|
403
|
+
h("p", { key: '00e5641d2db355dab4b7b544249482dd4bbdd31a', class: "CredentialsError" }, this.errorMessage)));
|
|
404
|
+
return h("section", { key: '12256f6bbbaf7ddbfe19483463dc85a521c25e9f', ref: el => this.stylingContainer = el }, userIdentification);
|
|
403
405
|
}
|
|
404
406
|
static get is() { return "user-login"; }
|
|
405
407
|
static get encapsulation() { return "shadow"; }
|
|
@@ -281,13 +281,32 @@ function setStreamStyling(stylingContainer, domain, subscription) {
|
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
283
|
|
|
284
|
+
/**
|
|
285
|
+
* @name dispatchCustomEvent
|
|
286
|
+
* @description dispatches the custom event CustomEventProcessor is listening for
|
|
287
|
+
* @param {string} type of the custom event
|
|
288
|
+
* @param {Object} data may contain additional information about the event, e.g. userId
|
|
289
|
+
*/
|
|
290
|
+
const dispatchCustomEvent = (type, data = {}) => {
|
|
291
|
+
const event = new CustomEvent('track-custom-event', {
|
|
292
|
+
detail: {
|
|
293
|
+
type,
|
|
294
|
+
data
|
|
295
|
+
},
|
|
296
|
+
bubbles: true,
|
|
297
|
+
composed: true
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
document.dispatchEvent(event);
|
|
301
|
+
};
|
|
302
|
+
|
|
284
303
|
/**
|
|
285
304
|
* @license
|
|
286
305
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
287
306
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
288
307
|
*/
|
|
289
308
|
|
|
290
|
-
function defineCustomElement(CustomElement, version = '24.5.
|
|
309
|
+
function defineCustomElement(CustomElement, version = '24.5.10') {
|
|
291
310
|
Object.defineProperty(CustomElement, 'version', {
|
|
292
311
|
get() {
|
|
293
312
|
return version;
|
|
@@ -21992,6 +22011,7 @@ const UserLogin = class {
|
|
|
21992
22011
|
message: translate$1('successMessage', this.lang)
|
|
21993
22012
|
} }, window.location.href);
|
|
21994
22013
|
this.hasError = false;
|
|
22014
|
+
dispatchCustomEvent('logged_in', { userId: data.userId });
|
|
21995
22015
|
}
|
|
21996
22016
|
else {
|
|
21997
22017
|
// handles errors thrown by api
|
|
@@ -22228,20 +22248,20 @@ const UserLogin = class {
|
|
|
22228
22248
|
* Render function
|
|
22229
22249
|
*/
|
|
22230
22250
|
render() {
|
|
22231
|
-
let visibilityIcon = h$2("span", { key: '
|
|
22232
|
-
h$2("svg", { key: '
|
|
22233
|
-
h$2("svg", { key: '
|
|
22234
|
-
let userIdentification = h$2("div", { key: '
|
|
22251
|
+
let visibilityIcon = h$2("span", { key: '5247ba1aa9f8208dcf3bd594bdadbafc872203e7', class: "InputIcon" }, this.isPasswordVisible &&
|
|
22252
|
+
h$2("svg", { key: 'bba821c08ba3bf7def52d82534b3f3d35ce82043', 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$2("g", { key: '85a74668809bd002bdc50c317d2cba4957e6d86b', transform: "translate(-110.856 -23.242)" }, h$2("circle", { key: 'd74bd44ed1a2da0f34a0c0dad38a8f5b47ca66ca', class: "PasswordVisibilityIcon", cx: "0.05", cy: "0.05", r: "0.05", transform: "translate(121.017 31.148)" }), h$2("g", { key: '99a13eae7b1dbbb4ff1c529eb61f478f9707121b', transform: "translate(117.499 27.37)" }, h$2("path", { key: 'cb210c909fb66a52d4e61d2e94cb7a41420b08b1', class: "PasswordVisibilityIcon", d: "M147.413,43.174a2.774,2.774,0,0,0-3.229-3.943Z", transform: "translate(-142.164 -39.123)" }), h$2("path", { key: '992a1e8fe902029233261a388956c304a702c24a', class: "PasswordVisibilityIcon", d: "M137.031,43.1a2.778,2.778,0,0,0,3.447,4.209Z", transform: "translate(-136.413 -42.068)" })), h$2("g", { key: '55c770518f9c9bd6edc0a7aa6d61f2ebfecf7fb3', transform: "translate(110.856 24.899)" }, h$2("path", { key: '632faef68fb66274f1562703c72fb3b7e33ed2d4', 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$2("path", { key: '06b43037bd6e527436b0bdebef02e8021072ee3b', 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$2("rect", { key: '3cb2410ff11f0218df6f62b53f71ab91473b230e', class: "PasswordVisibilityIcon", width: "0.972", height: "15.861", rx: "0.486", transform: "translate(114.827 23.858) rotate(-39.315)" }))), !this.isPasswordVisible &&
|
|
22253
|
+
h$2("svg", { key: '8f302630f4f4f5bafe986600bafa42b7b2136cd4', 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$2("g", { key: '5163e48b86eda60be27eb9b0485253886af967e3', transform: "translate(-14.185 -27.832)" }, h$2("path", { key: '1cf091c89a8da407adfb410f019602b780b01d0b', 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$2("circle", { key: 'cff32985dd5e49e93e7b101a0a5205494708b87b', class: "PasswordVisibilityIcon", cx: "2.779", cy: "2.779", r: "2.779", transform: "translate(20.827 30.303)" }))));
|
|
22254
|
+
let userIdentification = h$2("div", { key: 'd11df3b91d2b5176ce2742130851bcecf53ca340', class: "FormBox" }, h$2("div", { key: 'fcba164be90c9bcb6e809e65cec8182a0848e7b7', class: "FormValue" }, this.loginByPhoneNumber === 'true'
|
|
22235
22255
|
? h$2("div", { class: (!this.isValidUserPhone || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox ' }, h$2("div", { class: "PhoneInputBox" }, h$2("div", { class: "PrefixBox" }, h$2("vaadin-combo-box", { items: this.userPrefixOptions, value: this.userPrefix, onChange: this.handleInputChangePartial('prefix') }), h$2("label", { class: (this.userPrefix ? 'FieldFilledIn' : '') + ' ' + (!this.isValidUserPhone || this.hasError ? 'FieldInvalid' : '') }, translate$1('userPrefix', this.lang))), h$2("div", { class: "PhoneBox" }, h$2("input", { type: "text", placeholder: '', value: this.userPhone, onFocus: this.handleInputChangePartial('phone'), onInput: this.handleInputChangePartial('phone'), autocapitalize: "none", required: true }), h$2("label", { class: (this.userPhone ? 'FieldFilledIn' : '') + ' ' + (!this.isValidUserPhone || this.hasError ? 'FieldInvalid' : '') }, translate$1('userPhone', this.lang)))), !this.isValidUserPhone &&
|
|
22236
22256
|
h$2("p", { class: "InvalidField" }, translate$1('invalidField', this.lang)))
|
|
22237
22257
|
: h$2("div", { class: (!this.isValidUserEmail || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox' }, h$2("input", { type: "text", placeholder: '', value: this.userNameEmail, onFocus: this.handleInputChangePartial('user'), onInput: this.handleInputChangePartial('user'), autocapitalize: "none", required: true }), h$2("label", { class: (this.userNameEmail ? 'FieldFilledIn' : '') + ' ' + (!this.isValidUserEmail || this.hasError ? 'FieldInvalid' : '') }, translate$1('userEmail', this.lang)), !this.isValidUserEmail &&
|
|
22238
|
-
h$2("p", { class: "InvalidField" }, translate$1('invalidField', this.lang))), h$2("div", { key: '
|
|
22239
|
-
h$2("p", { key: '
|
|
22240
|
-
h$2("div", { key: '
|
|
22258
|
+
h$2("p", { class: "InvalidField" }, translate$1('invalidField', this.lang))), h$2("div", { key: '4d5ed09db6a553c694cea9d2487301156a5f602d', class: (!this.isValidPassword || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox' }, visibilityIcon, h$2("input", { key: 'c298e5d19bdd55f180397d0d943a171cb3b84d6a', type: this.isPasswordVisible ? "text" : "password", placeholder: '', value: this.userPassword, onFocus: this.handleInputChangePartial('password'), onInput: this.handleInputChangePartial('password'), autocapitalize: "none", required: true }), h$2("label", { key: '6de9548545e57214f937129c34b6c8fc3cb56e67', class: (this.userPassword ? 'FieldFilledIn' : '') + ' ' + (!this.isValidPassword || this.hasError ? 'FieldInvalid' : '') }, translate$1('password', this.lang)), !this.isValidPassword &&
|
|
22259
|
+
h$2("p", { key: 'd140446490ce18962d67e068b3c6f021453ec0f3', class: "InvalidField" }, translate$1('invalidField', this.lang))), this.passwordReset == 'true' &&
|
|
22260
|
+
h$2("div", { key: '894ff57a5c2eb6561ecd4b5e1b507c605001ca92', class: "ForgotPassword" }, h$2("button", { key: '77e12a76aa3a9ce581f06405bd2b07e80787ac09', onClick: this.resetPassword }, translate$1('forgotPassword', this.lang))), h$2("button", { key: 'a0b0f632c1950f6544230842d71605ac594f7cea', disabled: ((this.loginByPhoneNumber !== 'true' && (!this.isValidUserEmail || !this.userNameEmail)) ||
|
|
22241
22261
|
(this.loginByPhoneNumber === 'true' && (!this.isValidUserPhone || !this.userPhone || !this.userPrefix)) ||
|
|
22242
22262
|
!this.userPassword || !this.isValidPassword) || this.isLoginLoading, class: "SubmitCredentials", onClick: this.handleLogin }, translate$1('login', this.lang)), this.hasError &&
|
|
22243
|
-
h$2("p", { key: '
|
|
22244
|
-
return h$2("section", { key: '
|
|
22263
|
+
h$2("p", { key: '00e5641d2db355dab4b7b544249482dd4bbdd31a', class: "CredentialsError" }, this.errorMessage)));
|
|
22264
|
+
return h$2("section", { key: '12256f6bbbaf7ddbfe19483463dc85a521c25e9f', ref: el => this.stylingContainer = el }, userIdentification);
|
|
22245
22265
|
}
|
|
22246
22266
|
static get watchers() { return {
|
|
22247
22267
|
"translationUrl": ["handleNewTranslations"],
|
|
@@ -4,7 +4,7 @@ import{r as t,h as e}from"./p-8cb697c3.js";const i={en:{invalidField:"This field
|
|
|
4
4
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
5
5
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
6
6
|
*/
|
|
7
|
-
function a(t,e="24.5.
|
|
7
|
+
function a(t,e="24.5.10"){Object.defineProperty(t,"version",{get:()=>e});const i=customElements.get(t.is);if(i){const e=i.version;e&&t.version&&e===t.version?console.warn(`The component ${t.is} has been loaded twice`):console.error(`Tried to define ${t.is} version ${t.version} when version ${i.version} is already in use. Something will probably break.`)}else customElements.define(t.is,t)}
|
|
8
8
|
/**
|
|
9
9
|
* @license
|
|
10
10
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
@@ -2652,4 +2652,4 @@ class ur{constructor(t){this.host=t,t.addEventListener("opened-changed",(()=>{t.
|
|
|
2652
2652
|
></vaadin-combo-box-overlay>
|
|
2653
2653
|
|
|
2654
2654
|
<slot name="tooltip"></slot>
|
|
2655
|
-
`}static get properties(){return{_positionTarget:{type:Object}}}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new er(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new ir(this.inputElement,this._labelController)),this._tooltipController=new Io(this),this.addController(this._tooltipController),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this._tooltipController.setShouldShow((t=>!t.opened)),this._positionTarget=this.shadowRoot.querySelector('[part="input-field"]'),this._toggleElement=this.$.toggleButton}_onClearButtonClick(t){t.stopPropagation(),super._onClearButtonClick(t)}_onHostClick(t){const e=t.composedPath();(e.includes(this._labelNode)||e.includes(this._positionTarget))&&super._onHostClick(t)}}a(vr);const gr=class{constructor(e){t(this,e),this.errorCode="",this.getPhonePrefixes=()=>{const t=new URL("v1/player/validPhoneCodes",this.endpoint);return new Promise((e=>{fetch(t.href).then((t=>t.json())).then((t=>{this.userPrefixOptions=t.phoneCodes.map((t=>({label:t.Prefix,value:t.Prefix}))),e()}))}))},this.autofillCredentialsHandler=t=>{this.userNameEmail=t.detail.userNameEmail,this.userPassword=t.detail.userPassword,this.handleLogin()},this.userLoginGm17=async()=>{const t={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({contact:this.userNameEmail,password:this.userPassword})};try{const e=await fetch(`${this.endpoint}/api/v1/players/password-management/auth/password/verify`,t),i=await e.json(),{token:s}=i;if(!s)throw this.isLoginLoading=!1,new Error("Token not received from the API call.");await this.sendLegislationLogin(s)}catch(t){console.error(t),this.hasError=!0,this.isLoginLoading=!1,this.errorMessage=o("genericError",this.lang),this.sendErrorNotification(this.errorMessage)}},this.sendLegislationLogin=async t=>{const e={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t,method:"login"})};try{const t=await fetch(`${this.endpoint}/api/v2/gm/legislation/login`,e),i=await t.json();if(!t.ok){const{message:t,errors:e}=i;throw this.isLoginLoading=!1,console.error(`Legislation login failed: ${t}`,e),new Error("Legislation login request failed.")}{const{sessionId:t,playerId:e}=i;t&&(this.isLoginLoading=!1,window.postMessage({type:"UserSessionID",session:t,userid:e},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"success",message:o("successMessage",this.lang)}},window.location.href),this.hasError=!1)}}catch(t){console.error(t),this.hasError=!0,this.isLoginLoading=!1,this.errorMessage=o("genericError",this.lang),this.sendErrorNotification(this.errorMessage)}},this.userLogin=async()=>{const t=new URL("/v1/player/legislation/login",this.endpoint),e=new Headers;e.append("Content-Type","application/json");const i=JSON.stringify({username:"true"===this.loginByPhoneNumber?`${this.userPrefix} ${this.userPhone}`:this.userNameEmail,password:this.userPassword});fetch(t.href,{method:"POST",headers:e,body:i}).then((t=>t.json())).then((t=>{var e,i,s;if((null===(e=t.sessionBlockers)||void 0===e?void 0:e.includes("has-to-set-consents"))&&window.postMessage({type:"PlayerActions",gmversion:"gm16"},window.location.href),!0===(null==t?void 0:t.hasToSetPass))return this.hasError=!0,this.errorMessage=o("setUpPassowrd",this.lang),this.sendErrorNotification(o("setUpPassowrd",this.lang)),void window.postMessage({type:"HasToSetPass"},window.location.href);t.sessionId?(window.postMessage({type:"UserSessionID",session:t.sessionId,userid:t.userId},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"success",message:o("successMessage",this.lang)}},window.location.href),this.hasError=!1):(this.hasError=!0,this.errorCode=null===(i=null==t?void 0:t.thirdPartyResponse)||void 0===i?void 0:i.errorCode,this.errorMessage=o(`${this.errorCode}`,this.lang)||(null===(s=null==t?void 0:t.thirdPartyResponse)||void 0===s?void 0:s.message)||o("genericError",this.lang),this.errorMessage&&(console.error(this.errorMessage),this.sendErrorNotification(this.errorMessage)))})).catch((t=>{console.error(t),this.hasError=!0,this.errorMessage=o("genericError",this.lang),this.sendErrorNotification(this.errorMessage)})).finally((()=>{this.isLoginLoading=!1}))},this.handleLogin=()=>{this.isLoginLoading=!0,this.debounce({gm16:this.userLogin,gm17:this.userLoginGm17}[this.version]||this.userLogin,850)(),this.dispatchUpdateLoginCredentialsEvent()},this.handleInputChange=(t,e)=>{this.hasError=!1;const i=t.target.value;switch(e){case"user":this.userNameEmail=i,this.isValidUserEmail=this.validate("user",this.userNameEmail);break;case"phone":this.userPhone=i,this.isValidUserPhone=this.validate("phone",this.userPhone);break;case"prefix":this.userPrefix=i,this.isValidUserPhone=this.validate("phone",this.userPhone);break;case"password":this.userPassword=i,this.isValidPassword=this.validate("password",i)}},this.handleInputChangePartial=t=>e=>this.handleInputChange(e,t),this.validate=(t,e)=>{let i;switch(t){case"user":return i=new RegExp(this.userEmailRegex,this.userEmailRegexOptions),i.test(e);case"phone":return i=new RegExp(this.userPhoneRegex,this.userPhoneRegexOptions),i.test(e)&&!!this.userPrefix;case"password":return i=new RegExp(this.passwordRegex,this.passwordRegexOptions),i.test(e)}},this.togglePassword=()=>{this.isPasswordVisible=!this.isPasswordVisible},this.resetPassword=()=>{window.postMessage({type:"NavForgotPassword"},window.location.href)},this.endpoint="",this.lang="en",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.passwordReset="false",this.userEmailRegex=void 0,this.userEmailRegexOptions="i",this.userPhoneRegex=void 0,this.userPhoneRegexOptions="",this.passwordRegex=void 0,this.passwordRegexOptions="",this.version="gm16",this.loginByPhoneNumber="false",this.userNameEmail="",this.userPassword="",this.isValidUserEmail=!0,this.userPhone="",this.userPrefix="",this.isValidPassword=!0,this.isValidUserPhone=!0,this.isPasswordVisible=!1,this.errorMessage="",this.hasError=!1,this.userPrefixOptions=void 0,this.isLoginLoading=!1,this.mbSource=void 0}handleNewTranslations(){s(this.translationUrl)}handleClientStylingChange(t,e){t!=e&&r(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&this.clientStylingUrl&&n(this.stylingContainer,this.clientStylingUrl)}async componentWillLoad(){"true"===this.loginByPhoneNumber&&await this.getPhonePrefixes(),this.translationUrl.length>2&&await s(this.translationUrl)}componentDidLoad(){this.stylingContainer&&(null!=window.emMessageBus?function(t,e){if(window.emMessageBus){const i=document.createElement("style");window.emMessageBus.subscribe(e,(e=>{i.innerHTML=e,t&&t.appendChild(i)}))}}(this.stylingContainer,`${this.mbSource}.Style`):(this.clientStyling&&r(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&n(this.stylingContainer,this.clientStylingUrl))),window.addEventListener("LoginCredentials",this.autofillCredentialsHandler),window.postMessage({type:"UserLoginDidLoad"})}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe(),window.removeEventListener("LoginCredentials",this.autofillCredentialsHandler)}sendErrorNotification(t){window.postMessage({type:"HasError",error:t},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"error",message:t}},window.location.href)}debounce(t,e){let i;return function(...s){clearTimeout(i),i=setTimeout((()=>{t.apply(this,s)}),e)}}dispatchUpdateLoginCredentialsEvent(){this.hasError||(this.updateLoginCredentialsEvent=new CustomEvent("UpdateLoginCredentials",{bubbles:!0,detail:{userNameEmail:this.userNameEmail,userPassword:this.userPassword}}),window.dispatchEvent(this.updateLoginCredentialsEvent))}render(){let t=e("span",{key:"8faa0976496b69519a0197f7091d0236fa8fd730",class:"InputIcon"},this.isPasswordVisible&&e("svg",{key:"09bdd37ae2a2f3f66d642d665dd665ad63de447e",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"},e("g",{key:"f7e3c9b5065fde29b80d16f73333f152bd15a66e",transform:"translate(-110.856 -23.242)"},e("circle",{key:"9ecc3218d6cf3873c69b215f670121fab31e1aec",class:"PasswordVisibilityIcon",cx:"0.05",cy:"0.05",r:"0.05",transform:"translate(121.017 31.148)"}),e("g",{key:"d57cbfb0ff90a839297c0e018602c25350cdd5b4",transform:"translate(117.499 27.37)"},e("path",{key:"2c8992bc61850da7aad512762db6e10e6a4bfc17",class:"PasswordVisibilityIcon",d:"M147.413,43.174a2.774,2.774,0,0,0-3.229-3.943Z",transform:"translate(-142.164 -39.123)"}),e("path",{key:"b2696439c6cdaeacc4db04fc599f454692b6b9d4",class:"PasswordVisibilityIcon",d:"M137.031,43.1a2.778,2.778,0,0,0,3.447,4.209Z",transform:"translate(-136.413 -42.068)"})),e("g",{key:"e83a07b29f3559f536f8792a07add684974279cb",transform:"translate(110.856 24.899)"},e("path",{key:"ac216185b12b7dbf505c0d4c679a2b44c76c8a00",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)"}),e("path",{key:"9985a70080cc4d4b3089a2c7315f506f2f8a32bc",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)"})),e("rect",{key:"e02cc8f65db8593a3b08d618a623f76a3da81ce1",class:"PasswordVisibilityIcon",width:"0.972",height:"15.861",rx:"0.486",transform:"translate(114.827 23.858) rotate(-39.315)"}))),!this.isPasswordVisible&&e("svg",{key:"43c407d82e8bdcea2cfb3a43bfda2c98e5804436",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"},e("g",{key:"6405d54694b21612833f9d1d22d66d60f2d9d871",transform:"translate(-14.185 -27.832)"},e("path",{key:"2ed25088274ee5f42893872a568531515fb2e307",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)"}),e("circle",{key:"55db780da0e461d20f3feae2723a982ad705823c",class:"PasswordVisibilityIcon",cx:"2.779",cy:"2.779",r:"2.779",transform:"translate(20.827 30.303)"})))),i=e("div",{key:"7dabe085c16690665908703468baac7e60888e9f",class:"FormBox"},e("div",{key:"701c9d1f0297e53d8204bd8f7e75450bd601bd6e",class:"FormValue"},"true"===this.loginByPhoneNumber?e("div",{class:!this.isValidUserPhone||this.hasError?"InputBox InputInvalidBox":"InputBox "},e("div",{class:"PhoneInputBox"},e("div",{class:"PrefixBox"},e("vaadin-combo-box",{items:this.userPrefixOptions,value:this.userPrefix,onChange:this.handleInputChangePartial("prefix")}),e("label",{class:(this.userPrefix?"FieldFilledIn":"")+" "+(!this.isValidUserPhone||this.hasError?"FieldInvalid":"")},o("userPrefix",this.lang))),e("div",{class:"PhoneBox"},e("input",{type:"text",placeholder:"",value:this.userPhone,onFocus:this.handleInputChangePartial("phone"),onInput:this.handleInputChangePartial("phone"),autocapitalize:"none",required:!0}),e("label",{class:(this.userPhone?"FieldFilledIn":"")+" "+(!this.isValidUserPhone||this.hasError?"FieldInvalid":"")},o("userPhone",this.lang)))),!this.isValidUserPhone&&e("p",{class:"InvalidField"},o("invalidField",this.lang))):e("div",{class:!this.isValidUserEmail||this.hasError?"InputBox InputInvalidBox":"InputBox"},e("input",{type:"text",placeholder:"",value:this.userNameEmail,onFocus:this.handleInputChangePartial("user"),onInput:this.handleInputChangePartial("user"),autocapitalize:"none",required:!0}),e("label",{class:(this.userNameEmail?"FieldFilledIn":"")+" "+(!this.isValidUserEmail||this.hasError?"FieldInvalid":"")},o("userEmail",this.lang)),!this.isValidUserEmail&&e("p",{class:"InvalidField"},o("invalidField",this.lang))),e("div",{key:"3cd3fde43f1e060d98bc17cd021d40ac0a3daf25",class:!this.isValidPassword||this.hasError?"InputBox InputInvalidBox":"InputBox"},t,e("input",{key:"33d7b8b4db8976dd8677444165a1138917d05c68",type:this.isPasswordVisible?"text":"password",placeholder:"",value:this.userPassword,onFocus:this.handleInputChangePartial("password"),onInput:this.handleInputChangePartial("password"),autocapitalize:"none",required:!0}),e("label",{key:"11decfd4b4bd61163e8c5c002b46c84ee9ff3020",class:(this.userPassword?"FieldFilledIn":"")+" "+(!this.isValidPassword||this.hasError?"FieldInvalid":"")},o("password",this.lang)),!this.isValidPassword&&e("p",{key:"5c2d02b6a329227b9e73c36195ed7e160832a733",class:"InvalidField"},o("invalidField",this.lang))),"true"==this.passwordReset&&e("div",{key:"40a59ed73a4247180b179267e3b7a83a010d6649",class:"ForgotPassword"},e("button",{key:"b3045a97541f13bcab8b2997af26b595d6dd2b6f",onClick:this.resetPassword},o("forgotPassword",this.lang))),e("button",{key:"ca3f956411dca0a6bf54894c5e14bbe2767a53a0",disabled:"true"!==this.loginByPhoneNumber&&(!this.isValidUserEmail||!this.userNameEmail)||"true"===this.loginByPhoneNumber&&(!this.isValidUserPhone||!this.userPhone||!this.userPrefix)||!this.userPassword||!this.isValidPassword||this.isLoginLoading,class:"SubmitCredentials",onClick:this.handleLogin},o("login",this.lang)),this.hasError&&e("p",{key:"6641f60f97cd7f9e81e3097935dfcfb4b8ab6552",class:"CredentialsError"},this.errorMessage)));return e("section",{key:"49d2252c207e8148d230f2f90bf4d1d567df4aae",ref:t=>this.stylingContainer=t},i)}static get watchers(){return{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}}};gr.style=':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(--emw--registration-color-primary, var(--emw--color-primary, #22B04E))}.InputBox .PhoneInputBox{display:flex;flex-direction:row}.InputBox .PhoneInputBox .PhoneBox{position:relative;width:100%}.InputBox .PhoneInputBox .PrefixBox{position:relative;width:fit-content}.InputBox.InputInvalidBox .PasswordVisibilityIcon{fill:var(--emfw-w-color-error, var(--emw--color-red, #FD2839))}.InputBox.InputInvalidBox input{color:var(--emfw-w-color-error, var(--emw--color-red, #FD2839))}.InputBox.InputInvalidBox::after{content:"";height:2px;width:100%;transition:width 0.6s linear;background:var(--emfw-w-color-error, var(--emw--color-red, #FD2839))}.InputBox::after{content:"";display:block;width:0;height:2px;position:relative;top:2px}.InputBox .PasswordVisibilityIcon{fill:var(--emw--registration-color-primary, var(--emw--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(--emw--registration-color-primary, var(--emw--color-primary, #22B04E));font-size:var(--emw--font-size-medium, 16px);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:var(--emw--font-size-medium, 16px);padding:0 35px 0 5px;color:var(--emw--registration-typography, var(--emw--color-typography, #000000));box-sizing:border-box}input:focus~label,label.FieldFilledIn{top:-3px;font-size:var(--emw--font-size-x-small, 16px)}vaadin-combo-box:focus-within~label,label.FieldFilledIn{top:-3px;font-size:var(--emw--font-size-x-small, 16px)}.ForgotPassword button{margin:-10px 0 17px;font-size:var(--emw--font-size-medium, 16px);color:var(--emw--registration-color-primary, var(--emw--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;cursor:default}.Register{font-size:var(--emw--font-size-medium, 16px);color:var(--emw--registration-typography, var(--emw--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;color:var(--emfw-w-color-error, var(--emw--color-red, #FD2839));font-size:var(--emw--font-size-x-small, 12px)}.SubmitCredentials{margin-bottom:20px}.CredentialsError{color:var(--emfw-w-color-error, var(--emw--color-red, #FD2839));font-size:var(--emw--font-size-x-small, 12px);padding:0 0 20px 0;margin:0}.CredentialsError input{color:var(--emfw-w-color-error, var(--emw--color-red, #FD2839))}@media screen and (max-width: 480px){.FormBox{width:100%;border-radius:0px}}';export{gr as user_login}
|
|
2655
|
+
`}static get properties(){return{_positionTarget:{type:Object}}}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new er(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new ir(this.inputElement,this._labelController)),this._tooltipController=new Io(this),this.addController(this._tooltipController),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this._tooltipController.setShouldShow((t=>!t.opened)),this._positionTarget=this.shadowRoot.querySelector('[part="input-field"]'),this._toggleElement=this.$.toggleButton}_onClearButtonClick(t){t.stopPropagation(),super._onClearButtonClick(t)}_onHostClick(t){const e=t.composedPath();(e.includes(this._labelNode)||e.includes(this._positionTarget))&&super._onHostClick(t)}}a(vr);const gr=class{constructor(e){t(this,e),this.errorCode="",this.getPhonePrefixes=()=>{const t=new URL("v1/player/validPhoneCodes",this.endpoint);return new Promise((e=>{fetch(t.href).then((t=>t.json())).then((t=>{this.userPrefixOptions=t.phoneCodes.map((t=>({label:t.Prefix,value:t.Prefix}))),e()}))}))},this.autofillCredentialsHandler=t=>{this.userNameEmail=t.detail.userNameEmail,this.userPassword=t.detail.userPassword,this.handleLogin()},this.userLoginGm17=async()=>{const t={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({contact:this.userNameEmail,password:this.userPassword})};try{const e=await fetch(`${this.endpoint}/api/v1/players/password-management/auth/password/verify`,t),i=await e.json(),{token:s}=i;if(!s)throw this.isLoginLoading=!1,new Error("Token not received from the API call.");await this.sendLegislationLogin(s)}catch(t){console.error(t),this.hasError=!0,this.isLoginLoading=!1,this.errorMessage=o("genericError",this.lang),this.sendErrorNotification(this.errorMessage)}},this.sendLegislationLogin=async t=>{const e={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t,method:"login"})};try{const t=await fetch(`${this.endpoint}/api/v2/gm/legislation/login`,e),i=await t.json();if(!t.ok){const{message:t,errors:e}=i;throw this.isLoginLoading=!1,console.error(`Legislation login failed: ${t}`,e),new Error("Legislation login request failed.")}{const{sessionId:t,playerId:e}=i;t&&(this.isLoginLoading=!1,window.postMessage({type:"UserSessionID",session:t,userid:e},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"success",message:o("successMessage",this.lang)}},window.location.href),this.hasError=!1)}}catch(t){console.error(t),this.hasError=!0,this.isLoginLoading=!1,this.errorMessage=o("genericError",this.lang),this.sendErrorNotification(this.errorMessage)}},this.userLogin=async()=>{const t=new URL("/v1/player/legislation/login",this.endpoint),e=new Headers;e.append("Content-Type","application/json");const i=JSON.stringify({username:"true"===this.loginByPhoneNumber?`${this.userPrefix} ${this.userPhone}`:this.userNameEmail,password:this.userPassword});fetch(t.href,{method:"POST",headers:e,body:i}).then((t=>t.json())).then((t=>{var e,i,s;if((null===(e=t.sessionBlockers)||void 0===e?void 0:e.includes("has-to-set-consents"))&&window.postMessage({type:"PlayerActions",gmversion:"gm16"},window.location.href),!0===(null==t?void 0:t.hasToSetPass))return this.hasError=!0,this.errorMessage=o("setUpPassowrd",this.lang),this.sendErrorNotification(o("setUpPassowrd",this.lang)),void window.postMessage({type:"HasToSetPass"},window.location.href);t.sessionId?(window.postMessage({type:"UserSessionID",session:t.sessionId,userid:t.userId},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"success",message:o("successMessage",this.lang)}},window.location.href),this.hasError=!1,((t,e={})=>{const i=new CustomEvent("track-custom-event",{detail:{type:"logged_in",data:e},bubbles:!0,composed:!0});document.dispatchEvent(i)})(0,{userId:t.userId})):(this.hasError=!0,this.errorCode=null===(i=null==t?void 0:t.thirdPartyResponse)||void 0===i?void 0:i.errorCode,this.errorMessage=o(`${this.errorCode}`,this.lang)||(null===(s=null==t?void 0:t.thirdPartyResponse)||void 0===s?void 0:s.message)||o("genericError",this.lang),this.errorMessage&&(console.error(this.errorMessage),this.sendErrorNotification(this.errorMessage)))})).catch((t=>{console.error(t),this.hasError=!0,this.errorMessage=o("genericError",this.lang),this.sendErrorNotification(this.errorMessage)})).finally((()=>{this.isLoginLoading=!1}))},this.handleLogin=()=>{this.isLoginLoading=!0,this.debounce({gm16:this.userLogin,gm17:this.userLoginGm17}[this.version]||this.userLogin,850)(),this.dispatchUpdateLoginCredentialsEvent()},this.handleInputChange=(t,e)=>{this.hasError=!1;const i=t.target.value;switch(e){case"user":this.userNameEmail=i,this.isValidUserEmail=this.validate("user",this.userNameEmail);break;case"phone":this.userPhone=i,this.isValidUserPhone=this.validate("phone",this.userPhone);break;case"prefix":this.userPrefix=i,this.isValidUserPhone=this.validate("phone",this.userPhone);break;case"password":this.userPassword=i,this.isValidPassword=this.validate("password",i)}},this.handleInputChangePartial=t=>e=>this.handleInputChange(e,t),this.validate=(t,e)=>{let i;switch(t){case"user":return i=new RegExp(this.userEmailRegex,this.userEmailRegexOptions),i.test(e);case"phone":return i=new RegExp(this.userPhoneRegex,this.userPhoneRegexOptions),i.test(e)&&!!this.userPrefix;case"password":return i=new RegExp(this.passwordRegex,this.passwordRegexOptions),i.test(e)}},this.togglePassword=()=>{this.isPasswordVisible=!this.isPasswordVisible},this.resetPassword=()=>{window.postMessage({type:"NavForgotPassword"},window.location.href)},this.endpoint="",this.lang="en",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.passwordReset="false",this.userEmailRegex=void 0,this.userEmailRegexOptions="i",this.userPhoneRegex=void 0,this.userPhoneRegexOptions="",this.passwordRegex=void 0,this.passwordRegexOptions="",this.version="gm16",this.loginByPhoneNumber="false",this.userNameEmail="",this.userPassword="",this.isValidUserEmail=!0,this.userPhone="",this.userPrefix="",this.isValidPassword=!0,this.isValidUserPhone=!0,this.isPasswordVisible=!1,this.errorMessage="",this.hasError=!1,this.userPrefixOptions=void 0,this.isLoginLoading=!1,this.mbSource=void 0}handleNewTranslations(){s(this.translationUrl)}handleClientStylingChange(t,e){t!=e&&r(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&this.clientStylingUrl&&n(this.stylingContainer,this.clientStylingUrl)}async componentWillLoad(){"true"===this.loginByPhoneNumber&&await this.getPhonePrefixes(),this.translationUrl.length>2&&await s(this.translationUrl)}componentDidLoad(){this.stylingContainer&&(null!=window.emMessageBus?function(t,e){if(window.emMessageBus){const i=document.createElement("style");window.emMessageBus.subscribe(e,(e=>{i.innerHTML=e,t&&t.appendChild(i)}))}}(this.stylingContainer,`${this.mbSource}.Style`):(this.clientStyling&&r(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&n(this.stylingContainer,this.clientStylingUrl))),window.addEventListener("LoginCredentials",this.autofillCredentialsHandler),window.postMessage({type:"UserLoginDidLoad"})}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe(),window.removeEventListener("LoginCredentials",this.autofillCredentialsHandler)}sendErrorNotification(t){window.postMessage({type:"HasError",error:t},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"error",message:t}},window.location.href)}debounce(t,e){let i;return function(...s){clearTimeout(i),i=setTimeout((()=>{t.apply(this,s)}),e)}}dispatchUpdateLoginCredentialsEvent(){this.hasError||(this.updateLoginCredentialsEvent=new CustomEvent("UpdateLoginCredentials",{bubbles:!0,detail:{userNameEmail:this.userNameEmail,userPassword:this.userPassword}}),window.dispatchEvent(this.updateLoginCredentialsEvent))}render(){let t=e("span",{key:"5247ba1aa9f8208dcf3bd594bdadbafc872203e7",class:"InputIcon"},this.isPasswordVisible&&e("svg",{key:"bba821c08ba3bf7def52d82534b3f3d35ce82043",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"},e("g",{key:"85a74668809bd002bdc50c317d2cba4957e6d86b",transform:"translate(-110.856 -23.242)"},e("circle",{key:"d74bd44ed1a2da0f34a0c0dad38a8f5b47ca66ca",class:"PasswordVisibilityIcon",cx:"0.05",cy:"0.05",r:"0.05",transform:"translate(121.017 31.148)"}),e("g",{key:"99a13eae7b1dbbb4ff1c529eb61f478f9707121b",transform:"translate(117.499 27.37)"},e("path",{key:"cb210c909fb66a52d4e61d2e94cb7a41420b08b1",class:"PasswordVisibilityIcon",d:"M147.413,43.174a2.774,2.774,0,0,0-3.229-3.943Z",transform:"translate(-142.164 -39.123)"}),e("path",{key:"992a1e8fe902029233261a388956c304a702c24a",class:"PasswordVisibilityIcon",d:"M137.031,43.1a2.778,2.778,0,0,0,3.447,4.209Z",transform:"translate(-136.413 -42.068)"})),e("g",{key:"55c770518f9c9bd6edc0a7aa6d61f2ebfecf7fb3",transform:"translate(110.856 24.899)"},e("path",{key:"632faef68fb66274f1562703c72fb3b7e33ed2d4",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)"}),e("path",{key:"06b43037bd6e527436b0bdebef02e8021072ee3b",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)"})),e("rect",{key:"3cb2410ff11f0218df6f62b53f71ab91473b230e",class:"PasswordVisibilityIcon",width:"0.972",height:"15.861",rx:"0.486",transform:"translate(114.827 23.858) rotate(-39.315)"}))),!this.isPasswordVisible&&e("svg",{key:"8f302630f4f4f5bafe986600bafa42b7b2136cd4",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"},e("g",{key:"5163e48b86eda60be27eb9b0485253886af967e3",transform:"translate(-14.185 -27.832)"},e("path",{key:"1cf091c89a8da407adfb410f019602b780b01d0b",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)"}),e("circle",{key:"cff32985dd5e49e93e7b101a0a5205494708b87b",class:"PasswordVisibilityIcon",cx:"2.779",cy:"2.779",r:"2.779",transform:"translate(20.827 30.303)"})))),i=e("div",{key:"d11df3b91d2b5176ce2742130851bcecf53ca340",class:"FormBox"},e("div",{key:"fcba164be90c9bcb6e809e65cec8182a0848e7b7",class:"FormValue"},"true"===this.loginByPhoneNumber?e("div",{class:!this.isValidUserPhone||this.hasError?"InputBox InputInvalidBox":"InputBox "},e("div",{class:"PhoneInputBox"},e("div",{class:"PrefixBox"},e("vaadin-combo-box",{items:this.userPrefixOptions,value:this.userPrefix,onChange:this.handleInputChangePartial("prefix")}),e("label",{class:(this.userPrefix?"FieldFilledIn":"")+" "+(!this.isValidUserPhone||this.hasError?"FieldInvalid":"")},o("userPrefix",this.lang))),e("div",{class:"PhoneBox"},e("input",{type:"text",placeholder:"",value:this.userPhone,onFocus:this.handleInputChangePartial("phone"),onInput:this.handleInputChangePartial("phone"),autocapitalize:"none",required:!0}),e("label",{class:(this.userPhone?"FieldFilledIn":"")+" "+(!this.isValidUserPhone||this.hasError?"FieldInvalid":"")},o("userPhone",this.lang)))),!this.isValidUserPhone&&e("p",{class:"InvalidField"},o("invalidField",this.lang))):e("div",{class:!this.isValidUserEmail||this.hasError?"InputBox InputInvalidBox":"InputBox"},e("input",{type:"text",placeholder:"",value:this.userNameEmail,onFocus:this.handleInputChangePartial("user"),onInput:this.handleInputChangePartial("user"),autocapitalize:"none",required:!0}),e("label",{class:(this.userNameEmail?"FieldFilledIn":"")+" "+(!this.isValidUserEmail||this.hasError?"FieldInvalid":"")},o("userEmail",this.lang)),!this.isValidUserEmail&&e("p",{class:"InvalidField"},o("invalidField",this.lang))),e("div",{key:"4d5ed09db6a553c694cea9d2487301156a5f602d",class:!this.isValidPassword||this.hasError?"InputBox InputInvalidBox":"InputBox"},t,e("input",{key:"c298e5d19bdd55f180397d0d943a171cb3b84d6a",type:this.isPasswordVisible?"text":"password",placeholder:"",value:this.userPassword,onFocus:this.handleInputChangePartial("password"),onInput:this.handleInputChangePartial("password"),autocapitalize:"none",required:!0}),e("label",{key:"6de9548545e57214f937129c34b6c8fc3cb56e67",class:(this.userPassword?"FieldFilledIn":"")+" "+(!this.isValidPassword||this.hasError?"FieldInvalid":"")},o("password",this.lang)),!this.isValidPassword&&e("p",{key:"d140446490ce18962d67e068b3c6f021453ec0f3",class:"InvalidField"},o("invalidField",this.lang))),"true"==this.passwordReset&&e("div",{key:"894ff57a5c2eb6561ecd4b5e1b507c605001ca92",class:"ForgotPassword"},e("button",{key:"77e12a76aa3a9ce581f06405bd2b07e80787ac09",onClick:this.resetPassword},o("forgotPassword",this.lang))),e("button",{key:"a0b0f632c1950f6544230842d71605ac594f7cea",disabled:"true"!==this.loginByPhoneNumber&&(!this.isValidUserEmail||!this.userNameEmail)||"true"===this.loginByPhoneNumber&&(!this.isValidUserPhone||!this.userPhone||!this.userPrefix)||!this.userPassword||!this.isValidPassword||this.isLoginLoading,class:"SubmitCredentials",onClick:this.handleLogin},o("login",this.lang)),this.hasError&&e("p",{key:"00e5641d2db355dab4b7b544249482dd4bbdd31a",class:"CredentialsError"},this.errorMessage)));return e("section",{key:"12256f6bbbaf7ddbfe19483463dc85a521c25e9f",ref:t=>this.stylingContainer=t},i)}static get watchers(){return{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}}};gr.style=':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(--emw--registration-color-primary, var(--emw--color-primary, #22B04E))}.InputBox .PhoneInputBox{display:flex;flex-direction:row}.InputBox .PhoneInputBox .PhoneBox{position:relative;width:100%}.InputBox .PhoneInputBox .PrefixBox{position:relative;width:fit-content}.InputBox.InputInvalidBox .PasswordVisibilityIcon{fill:var(--emfw-w-color-error, var(--emw--color-red, #FD2839))}.InputBox.InputInvalidBox input{color:var(--emfw-w-color-error, var(--emw--color-red, #FD2839))}.InputBox.InputInvalidBox::after{content:"";height:2px;width:100%;transition:width 0.6s linear;background:var(--emfw-w-color-error, var(--emw--color-red, #FD2839))}.InputBox::after{content:"";display:block;width:0;height:2px;position:relative;top:2px}.InputBox .PasswordVisibilityIcon{fill:var(--emw--registration-color-primary, var(--emw--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(--emw--registration-color-primary, var(--emw--color-primary, #22B04E));font-size:var(--emw--font-size-medium, 16px);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:var(--emw--font-size-medium, 16px);padding:0 35px 0 5px;color:var(--emw--registration-typography, var(--emw--color-typography, #000000));box-sizing:border-box}input:focus~label,label.FieldFilledIn{top:-3px;font-size:var(--emw--font-size-x-small, 16px)}vaadin-combo-box:focus-within~label,label.FieldFilledIn{top:-3px;font-size:var(--emw--font-size-x-small, 16px)}.ForgotPassword button{margin:-10px 0 17px;font-size:var(--emw--font-size-medium, 16px);color:var(--emw--registration-color-primary, var(--emw--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;cursor:default}.Register{font-size:var(--emw--font-size-medium, 16px);color:var(--emw--registration-typography, var(--emw--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;color:var(--emfw-w-color-error, var(--emw--color-red, #FD2839));font-size:var(--emw--font-size-x-small, 12px)}.SubmitCredentials{margin-bottom:20px}.CredentialsError{color:var(--emfw-w-color-error, var(--emw--color-red, #FD2839));font-size:var(--emw--font-size-x-small, 12px);padding:0 0 20px 0;margin:0}.CredentialsError input{color:var(--emfw-w-color-error, var(--emw--color-red, #FD2839))}@media screen and (max-width: 480px){.FormBox{width:100%;border-radius:0px}}';export{gr as user_login}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as r}from"./p-8cb697c3.js";export{s as setNonce}from"./p-8cb697c3.js";import{g as n}from"./p-e1255160.js";(()=>{const s=import.meta.url,r={};return""!==s&&(r.resourcesUrl=new URL(".",s).href),e(r)})().then((async e=>(await n(),r([["p-
|
|
1
|
+
import{p as e,b as r}from"./p-8cb697c3.js";export{s as setNonce}from"./p-8cb697c3.js";import{g as n}from"./p-e1255160.js";(()=>{const s=import.meta.url,r={};return""!==s&&(r.resourcesUrl=new URL(".",s).href),e(r)})().then((async e=>(await n(),r([["p-8fc23f48",[[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"],userPhoneRegex:[513,"user-phone-regex"],userPhoneRegexOptions:[513,"user-phone-regex-options"],passwordRegex:[513,"password-regex"],passwordRegexOptions:[513,"password-regex-options"],version:[513],loginByPhoneNumber:[513,"login-by-phone-number"],mbSource:[513,"mb-source"],userNameEmail:[32],userPassword:[32],isValidUserEmail:[32],userPhone:[32],userPrefix:[32],isValidPassword:[32],isValidUserPhone:[32],isPasswordVisible:[32],errorMessage:[32],hasError:[32],userPrefixOptions:[32],isLoginLoading:[32]},null,{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}]]]],e))));
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|