@everymatrix/pam-login 1.77.30 → 1.77.31
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/index.cjs.js +1 -1
- package/dist/cjs/{pam-login-c9df7cfa.js → pam-login-029176cb.js} +27 -11
- package/dist/cjs/pam-login_2.cjs.entry.js +1 -1
- package/dist/collection/components/pam-login/pam-login.js +27 -11
- package/dist/esm/index.js +1 -1
- package/dist/esm/{pam-login-77f82da1.js → pam-login-e7a6e5e6.js} +27 -11
- package/dist/esm/pam-login_2.entry.js +1 -1
- package/dist/pam-login/index.esm.js +1 -1
- package/dist/pam-login/{pam-login-77f82da1.js → pam-login-e7a6e5e6.js} +1 -1
- package/dist/pam-login/pam-login_2.entry.js +1 -1
- package/package.json +1 -1
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -22370,6 +22370,22 @@ const PamLogin = class {
|
|
|
22370
22370
|
fetch(url.href, options)
|
|
22371
22371
|
.then((res) => res.json(), (err) => reject(err))
|
|
22372
22372
|
.then((res) => {
|
|
22373
|
+
var _a, _b;
|
|
22374
|
+
if (res.error) {
|
|
22375
|
+
const errorCode = (_a = res === null || res === void 0 ? void 0 : res.thirdPartyResponse) === null || _a === void 0 ? void 0 : _a.errorCode;
|
|
22376
|
+
if (errorCode === 'GmErr_USER_AUTH_FAILED' && this.loginByPhoneNumber === 'true') {
|
|
22377
|
+
this.apiErrorMessage = translate$1('AuthFailedPhoneNumber', this.lang);
|
|
22378
|
+
}
|
|
22379
|
+
else {
|
|
22380
|
+
const messageCode = res === null || res === void 0 ? void 0 : res.message;
|
|
22381
|
+
this.apiErrorMessage =
|
|
22382
|
+
translate$1(`${errorCode}`, this.lang) ||
|
|
22383
|
+
translate$1(`${messageCode}`, this.lang) ||
|
|
22384
|
+
((_b = res === null || res === void 0 ? void 0 : res.thirdPartyResponse) === null || _b === void 0 ? void 0 : _b.message) ||
|
|
22385
|
+
translate$1('genericError', this.lang);
|
|
22386
|
+
}
|
|
22387
|
+
return reject(this.apiErrorMessage);
|
|
22388
|
+
}
|
|
22373
22389
|
if (res.sessionId && res.playerId) {
|
|
22374
22390
|
return resolve(res);
|
|
22375
22391
|
}
|
|
@@ -22399,7 +22415,7 @@ const PamLogin = class {
|
|
|
22399
22415
|
})
|
|
22400
22416
|
.catch((err) => {
|
|
22401
22417
|
console.error(`Legislation login failed: ${err.message}`, err.errors);
|
|
22402
|
-
this.apiErrorMessage = translate$1('genericError', this.lang);
|
|
22418
|
+
this.apiErrorMessage = this.apiErrorMessage || translate$1('genericError', this.lang);
|
|
22403
22419
|
this.sendErrorNotification(this.apiErrorMessage);
|
|
22404
22420
|
})
|
|
22405
22421
|
.finally(() => this.isLoading = false);
|
|
@@ -22704,21 +22720,21 @@ const PamLogin = class {
|
|
|
22704
22720
|
* Render function
|
|
22705
22721
|
*/
|
|
22706
22722
|
render() {
|
|
22707
|
-
const visibilityIcon = index.h("span", { key: '
|
|
22723
|
+
const visibilityIcon = index.h("span", { key: '24cb82c372a6ceb1d76652d67e032d0b02389d3c', class: "InputIcon" }, this.isPasswordVisible
|
|
22708
22724
|
? index.h("svg", { onClick: () => this.togglePassword(), class: "TogglePasswordVisibility", part: "TogglePasswordVisibility", xmlns: "http://www.w3.org/2000/svg", width: "18.844", height: "12.887", viewBox: "0 0 18.844 12.887" }, index.h("g", { transform: "translate(-110.856 -23.242)" }, index.h("circle", { class: "PasswordVisibilityIcon", cx: "0.05", cy: "0.05", r: "0.05", transform: "translate(121.017 31.148)" }), index.h("g", { transform: "translate(117.499 27.37)" }, index.h("path", { class: "PasswordVisibilityIcon", d: "M147.413,43.174a2.774,2.774,0,0,0-3.229-3.943Z", transform: "translate(-142.164 -39.123)" }), index.h("path", { class: "PasswordVisibilityIcon", d: "M137.031,43.1a2.778,2.778,0,0,0,3.447,4.209Z", transform: "translate(-136.413 -42.068)" })), index.h("g", { transform: "translate(110.856 24.899)" }, index.h("path", { class: "PasswordVisibilityIcon", d: "M122.538,42.061a7.043,7.043,0,0,1-2.325.53,10.373,10.373,0,0,1-4.393-1.482,36.509,36.509,0,0,1-3.873-2.391.13.13,0,0,1,0-.208,44.141,44.141,0,0,1,3.873-2.651c.394-.233.768-.437,1.13-.622l-.686-.838c-.322.167-.651.347-.99.55a37.989,37.989,0,0,0-3.977,2.729,1.21,1.21,0,0,0-.442.962,1.1,1.1,0,0,0,.494.936,34.416,34.416,0,0,0,3.977,2.469,11.468,11.468,0,0,0,4.886,1.611,8.427,8.427,0,0,0,3.039-.725Z", transform: "translate(-110.856 -33.157)" }), index.h("path", { class: "PasswordVisibilityIcon", d: "M149.119,34.14a45.875,45.875,0,0,0-4.055-2.729,20.541,20.541,0,0,0-2.547-1.248,5.6,5.6,0,0,0-4.79-.017l.7.856a5.254,5.254,0,0,1,1.672-.346,10.072,10.072,0,0,1,4.445,1.663,34.132,34.132,0,0,1,3.925,2.651.13.13,0,0,1,0,.208,40.2,40.2,0,0,1-3.925,2.391c-.179.092-.352.176-.525.26l.684.835c.1-.054.2-.1.309-.159a36.356,36.356,0,0,0,4.055-2.469,1.067,1.067,0,0,0,.52-.936A1.159,1.159,0,0,0,149.119,34.14Z", transform: "translate(-130.743 -29.617)" })), index.h("rect", { class: "PasswordVisibilityIcon", width: "0.972", height: "15.861", rx: "0.486", transform: "translate(114.827 23.858) rotate(-39.315)" })))
|
|
22709
22725
|
: index.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" }, index.h("g", { transform: "translate(-14.185 -27.832)" }, index.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)" }), index.h("circle", { class: "PasswordVisibilityIcon", cx: "2.779", cy: "2.779", r: "2.779", transform: "translate(20.827 30.303)" }))));
|
|
22710
|
-
const loginForm = (index.h("div", { key: '
|
|
22726
|
+
const loginForm = (index.h("div", { key: 'b8a013ae94d14bdaba795b7822515692b73bb748', class: "FormBox" }, index.h("div", { key: '194a4d62a48d25c295ca1ac542f5aebe9c6161ac', class: "FormValue", onKeyDown: this.handleSubmit }, this.loginByPhoneNumber === 'true'
|
|
22711
22727
|
? index.h("div", { class: (this.isContactValid && !this.apiErrorMessage) ? 'InputBox' : 'InputBox InputInvalidBox' }, index.h("div", { class: "PhoneInputBox" }, index.h("div", { class: "PrefixBox" }, index.h("vaadin-combo-box", { items: this.phoneCodes, value: this.phoneCodeValue, onChange: this.handleInputChangePartial('prefix') }), index.h("label", { class: (this.phoneCodeValue ? 'FieldFilledIn' : '') + ' ' + (this.isContactValid ? '' : 'FieldInvalid') }, translate$1('userPrefix', this.lang))), index.h("div", { class: "PhoneBox" }, index.h("input", { type: "text", placeholder: '', value: this.contactValue, onFocus: this.handleInputChangePartial('phone'), onInput: this.handleInputChangePartial('phone'), autocapitalize: "none", required: true }), index.h("label", { class: (this.contactValue ? 'FieldFilledIn' : '') + ' ' + (this.isContactValid ? '' : 'FieldInvalid') }, translate$1('userPhone', this.lang)))), !this.isContactValid &&
|
|
22712
22728
|
index.h("p", { class: "CredentialsError" }, translate$1('userPhoneError', this.lang)))
|
|
22713
22729
|
: index.h("div", { class: this.isContactValid ? 'InputBox' : 'InputBox InputInvalidBox' }, index.h("input", { type: "text", placeholder: '', value: this.contactValue, onInput: this.handleInputChangePartial('user'), autocapitalize: "none", required: true }), index.h("label", { class: (this.contactValue ? 'FieldFilledIn' : '') + ' ' + (this.isContactValid ? '' : 'FieldInvalid') }, translate$1('userEmail', this.lang)), !this.isContactValid &&
|
|
22714
|
-
index.h("p", { class: "CredentialsError" }, translate$1('userEmailError', this.lang))), index.h("div", { key: '
|
|
22715
|
-
index.h("p", { key: '
|
|
22716
|
-
index.h("div", { key: '
|
|
22717
|
-
index.h("slot", { key: '
|
|
22718
|
-
index.h("slot", { key: '
|
|
22719
|
-
index.h("p", { key: '
|
|
22720
|
-
const skeleton = (index.h("div", { key: '
|
|
22721
|
-
return (index.h("section", { key: '
|
|
22730
|
+
index.h("p", { class: "CredentialsError" }, translate$1('userEmailError', this.lang))), index.h("div", { key: '100548b538ba8524b57cbb1b6ca6424398c328cf', class: this.isPasswordValid ? 'InputBox' : 'InputBox InputInvalidBox' }, visibilityIcon, index.h("input", { key: '264d6721749c23a7f2b6431b4608731e57302544', type: this.isPasswordVisible ? "text" : "password", placeholder: '', value: this.passwordValue, onInput: this.handleInputChangePartial('password'), autocapitalize: "none", required: true }), index.h("label", { key: '60b1ad9fd924cff2bc21c21eab670eee044f4af4', class: (this.passwordValue ? 'FieldFilledIn' : '') + ' ' + (this.isPasswordValid ? '' : 'FieldInvalid') }, translate$1('password', this.lang)), this.isPasswordValid ||
|
|
22731
|
+
index.h("p", { key: '4cb9a493124403f4177c950c821692b388b6cf04', class: "CredentialsError" }, translate$1('userPasswordError', this.lang))), this.passwordReset == 'true' &&
|
|
22732
|
+
index.h("div", { key: '602038a2609458f69cbb0589d3b00f32092a865f', class: "ForgotPassword" }, index.h("button", { key: '3462d939c84586d9175fe2cc83b66601a3743bd6', onClick: this.resetPassword }, translate$1('forgotPassword', this.lang))), this.captchaData.isEnabled && this.captchaData.provider === 'cloudflare' &&
|
|
22733
|
+
index.h("slot", { key: 'e5ceda76363941844adc5968a9e662e32a98ec79', name: "turnstile" }), this.captchaData.isEnabled && this.captchaData.provider === 'google' &&
|
|
22734
|
+
index.h("slot", { key: '9ce955f4316d2c3f051bdd8a378703a698af96af', name: "google" }), index.h("button", { key: '0862f621e099f7144b842ccc83f57c0c93892832', disabled: this.isSubmitDisabled(), class: "SubmitCredentials", onClick: this.handleLogin }, translate$1('login', this.lang)), this.apiErrorMessage &&
|
|
22735
|
+
index.h("p", { key: '15dbcab0684e95035a9b7365d39e5a1c2ce88586', class: "CredentialsError" }, this.apiErrorMessage))));
|
|
22736
|
+
const skeleton = (index.h("div", { key: 'c478390ca347af702fbff76438a0ad81831ab01e', class: "LoadingSkeleton" }, index.h("form", { key: '401827bb79817b7b885369f8b52452ece69f4efd', class: "Form" }, index.h("section", { key: '996d42c71521b5ee814a5c8e9833680cc01c41e6', class: "FieldsSection" }, index.h("div", { key: '6d4c9ab780f45f87bc84d0a1b0f332abed93ddd6', class: "FieldContainer" }, index.h("div", { key: '688bfd8803e6ae633073df37b91d953c5d88d787', class: "FieldTitle" }, index.h("ui-skeleton", { key: '5bb5cb4fab3f5423fd5b5230d95097dfe45a2839', structure: "title", width: "auto", height: "20px" })), index.h("ui-skeleton", { key: 'b830c20699f3a8ca7f2227f39c2be72a8aac6ec6', structure: "rectangle", width: "auto", height: "35px" })), index.h("div", { key: 'bf5cdf15c01b92c0339534d8af63222972f9fa72', class: "FieldContainer" }, index.h("div", { key: '710f2ac787ca00d4adf2f023d8b8fcc041886b69', class: "FieldTitle" }, index.h("ui-skeleton", { key: 'fe2dcb513079ddf988b7244a7aa367a4e330d00e', structure: "title", width: "auto", height: "20px" })), index.h("ui-skeleton", { key: 'a3e9f3ef4df8eeca549c6d860bb8d0b6d3f8dd78', structure: "rectangle", width: "auto", height: "35px" }))), index.h("section", { key: '970a83a9133ae4ab757d70d3e04ee433dd35d8d5', class: "ButtonsSection" }, index.h("div", { key: '70a0a206a424ed0ae652b3c5463b78afb54cabd5', class: "Button" }, index.h("ui-skeleton", { key: '65e7b9769d95dc5c6715a9b49c292d0e4a36bbd1', structure: "rectangle", width: "auto", height: "50px" }))))));
|
|
22737
|
+
return (index.h("section", { key: '5a3a40493e559335647849acbf2407f1638a11d3', ref: el => this.stylingContainer = el }, this.isLoading ? skeleton : loginForm));
|
|
22722
22738
|
}
|
|
22723
22739
|
static get watchers() { return {
|
|
22724
22740
|
"translationUrl": ["handleNewTranslations"],
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const pamLogin = require('./pam-login-
|
|
5
|
+
const pamLogin = require('./pam-login-029176cb.js');
|
|
6
6
|
const index = require('./index-c5001c3e.js');
|
|
7
7
|
|
|
8
8
|
const uiSkeletonCss = ":host{display:block}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 10px)}.Circle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.Text{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 10px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.Text:last-child{width:calc(var(--emw-skeleton-text-width, 400px) - 100px)}.Title{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 10px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.Image{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, unset)}.Logo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 10px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, #e0e0e0)}100%{background-color:var(--emw-skeleton-secondary-color, #f0f0f0)}}";
|
|
@@ -95,6 +95,22 @@ export class PamLogin {
|
|
|
95
95
|
fetch(url.href, options)
|
|
96
96
|
.then((res) => res.json(), (err) => reject(err))
|
|
97
97
|
.then((res) => {
|
|
98
|
+
var _a, _b;
|
|
99
|
+
if (res.error) {
|
|
100
|
+
const errorCode = (_a = res === null || res === void 0 ? void 0 : res.thirdPartyResponse) === null || _a === void 0 ? void 0 : _a.errorCode;
|
|
101
|
+
if (errorCode === 'GmErr_USER_AUTH_FAILED' && this.loginByPhoneNumber === 'true') {
|
|
102
|
+
this.apiErrorMessage = translate('AuthFailedPhoneNumber', this.lang);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
const messageCode = res === null || res === void 0 ? void 0 : res.message;
|
|
106
|
+
this.apiErrorMessage =
|
|
107
|
+
translate(`${errorCode}`, this.lang) ||
|
|
108
|
+
translate(`${messageCode}`, this.lang) ||
|
|
109
|
+
((_b = res === null || res === void 0 ? void 0 : res.thirdPartyResponse) === null || _b === void 0 ? void 0 : _b.message) ||
|
|
110
|
+
translate('genericError', this.lang);
|
|
111
|
+
}
|
|
112
|
+
return reject(this.apiErrorMessage);
|
|
113
|
+
}
|
|
98
114
|
if (res.sessionId && res.playerId) {
|
|
99
115
|
return resolve(res);
|
|
100
116
|
}
|
|
@@ -124,7 +140,7 @@ export class PamLogin {
|
|
|
124
140
|
})
|
|
125
141
|
.catch((err) => {
|
|
126
142
|
console.error(`Legislation login failed: ${err.message}`, err.errors);
|
|
127
|
-
this.apiErrorMessage = translate('genericError', this.lang);
|
|
143
|
+
this.apiErrorMessage = this.apiErrorMessage || translate('genericError', this.lang);
|
|
128
144
|
this.sendErrorNotification(this.apiErrorMessage);
|
|
129
145
|
})
|
|
130
146
|
.finally(() => this.isLoading = false);
|
|
@@ -429,21 +445,21 @@ export class PamLogin {
|
|
|
429
445
|
* Render function
|
|
430
446
|
*/
|
|
431
447
|
render() {
|
|
432
|
-
const visibilityIcon = h("span", { key: '
|
|
448
|
+
const visibilityIcon = h("span", { key: '24cb82c372a6ceb1d76652d67e032d0b02389d3c', class: "InputIcon" }, this.isPasswordVisible
|
|
433
449
|
? 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)" })))
|
|
434
450
|
: 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)" }))));
|
|
435
|
-
const loginForm = (h("div", { key: '
|
|
451
|
+
const loginForm = (h("div", { key: 'b8a013ae94d14bdaba795b7822515692b73bb748', class: "FormBox" }, h("div", { key: '194a4d62a48d25c295ca1ac542f5aebe9c6161ac', class: "FormValue", onKeyDown: this.handleSubmit }, this.loginByPhoneNumber === 'true'
|
|
436
452
|
? h("div", { class: (this.isContactValid && !this.apiErrorMessage) ? 'InputBox' : 'InputBox InputInvalidBox' }, h("div", { class: "PhoneInputBox" }, h("div", { class: "PrefixBox" }, h("vaadin-combo-box", { items: this.phoneCodes, value: this.phoneCodeValue, onChange: this.handleInputChangePartial('prefix') }), h("label", { class: (this.phoneCodeValue ? 'FieldFilledIn' : '') + ' ' + (this.isContactValid ? '' : 'FieldInvalid') }, translate('userPrefix', this.lang))), h("div", { class: "PhoneBox" }, h("input", { type: "text", placeholder: '', value: this.contactValue, onFocus: this.handleInputChangePartial('phone'), onInput: this.handleInputChangePartial('phone'), autocapitalize: "none", required: true }), h("label", { class: (this.contactValue ? 'FieldFilledIn' : '') + ' ' + (this.isContactValid ? '' : 'FieldInvalid') }, translate('userPhone', this.lang)))), !this.isContactValid &&
|
|
437
453
|
h("p", { class: "CredentialsError" }, translate('userPhoneError', this.lang)))
|
|
438
454
|
: h("div", { class: this.isContactValid ? 'InputBox' : 'InputBox InputInvalidBox' }, h("input", { type: "text", placeholder: '', value: this.contactValue, onInput: this.handleInputChangePartial('user'), autocapitalize: "none", required: true }), h("label", { class: (this.contactValue ? 'FieldFilledIn' : '') + ' ' + (this.isContactValid ? '' : 'FieldInvalid') }, translate('userEmail', this.lang)), !this.isContactValid &&
|
|
439
|
-
h("p", { class: "CredentialsError" }, translate('userEmailError', this.lang))), h("div", { key: '
|
|
440
|
-
h("p", { key: '
|
|
441
|
-
h("div", { key: '
|
|
442
|
-
h("slot", { key: '
|
|
443
|
-
h("slot", { key: '
|
|
444
|
-
h("p", { key: '
|
|
445
|
-
const skeleton = (h("div", { key: '
|
|
446
|
-
return (h("section", { key: '
|
|
455
|
+
h("p", { class: "CredentialsError" }, translate('userEmailError', this.lang))), h("div", { key: '100548b538ba8524b57cbb1b6ca6424398c328cf', class: this.isPasswordValid ? 'InputBox' : 'InputBox InputInvalidBox' }, visibilityIcon, h("input", { key: '264d6721749c23a7f2b6431b4608731e57302544', type: this.isPasswordVisible ? "text" : "password", placeholder: '', value: this.passwordValue, onInput: this.handleInputChangePartial('password'), autocapitalize: "none", required: true }), h("label", { key: '60b1ad9fd924cff2bc21c21eab670eee044f4af4', class: (this.passwordValue ? 'FieldFilledIn' : '') + ' ' + (this.isPasswordValid ? '' : 'FieldInvalid') }, translate('password', this.lang)), this.isPasswordValid ||
|
|
456
|
+
h("p", { key: '4cb9a493124403f4177c950c821692b388b6cf04', class: "CredentialsError" }, translate('userPasswordError', this.lang))), this.passwordReset == 'true' &&
|
|
457
|
+
h("div", { key: '602038a2609458f69cbb0589d3b00f32092a865f', class: "ForgotPassword" }, h("button", { key: '3462d939c84586d9175fe2cc83b66601a3743bd6', onClick: this.resetPassword }, translate('forgotPassword', this.lang))), this.captchaData.isEnabled && this.captchaData.provider === 'cloudflare' &&
|
|
458
|
+
h("slot", { key: 'e5ceda76363941844adc5968a9e662e32a98ec79', name: "turnstile" }), this.captchaData.isEnabled && this.captchaData.provider === 'google' &&
|
|
459
|
+
h("slot", { key: '9ce955f4316d2c3f051bdd8a378703a698af96af', name: "google" }), h("button", { key: '0862f621e099f7144b842ccc83f57c0c93892832', disabled: this.isSubmitDisabled(), class: "SubmitCredentials", onClick: this.handleLogin }, translate('login', this.lang)), this.apiErrorMessage &&
|
|
460
|
+
h("p", { key: '15dbcab0684e95035a9b7365d39e5a1c2ce88586', class: "CredentialsError" }, this.apiErrorMessage))));
|
|
461
|
+
const skeleton = (h("div", { key: 'c478390ca347af702fbff76438a0ad81831ab01e', class: "LoadingSkeleton" }, h("form", { key: '401827bb79817b7b885369f8b52452ece69f4efd', class: "Form" }, h("section", { key: '996d42c71521b5ee814a5c8e9833680cc01c41e6', class: "FieldsSection" }, h("div", { key: '6d4c9ab780f45f87bc84d0a1b0f332abed93ddd6', class: "FieldContainer" }, h("div", { key: '688bfd8803e6ae633073df37b91d953c5d88d787', class: "FieldTitle" }, h("ui-skeleton", { key: '5bb5cb4fab3f5423fd5b5230d95097dfe45a2839', structure: "title", width: "auto", height: "20px" })), h("ui-skeleton", { key: 'b830c20699f3a8ca7f2227f39c2be72a8aac6ec6', structure: "rectangle", width: "auto", height: "35px" })), h("div", { key: 'bf5cdf15c01b92c0339534d8af63222972f9fa72', class: "FieldContainer" }, h("div", { key: '710f2ac787ca00d4adf2f023d8b8fcc041886b69', class: "FieldTitle" }, h("ui-skeleton", { key: 'fe2dcb513079ddf988b7244a7aa367a4e330d00e', structure: "title", width: "auto", height: "20px" })), h("ui-skeleton", { key: 'a3e9f3ef4df8eeca549c6d860bb8d0b6d3f8dd78', structure: "rectangle", width: "auto", height: "35px" }))), h("section", { key: '970a83a9133ae4ab757d70d3e04ee433dd35d8d5', class: "ButtonsSection" }, h("div", { key: '70a0a206a424ed0ae652b3c5463b78afb54cabd5', class: "Button" }, h("ui-skeleton", { key: '65e7b9769d95dc5c6715a9b49c292d0e4a36bbd1', structure: "rectangle", width: "auto", height: "50px" }))))));
|
|
462
|
+
return (h("section", { key: '5a3a40493e559335647849acbf2407f1638a11d3', ref: el => this.stylingContainer = el }, this.isLoading ? skeleton : loginForm));
|
|
447
463
|
}
|
|
448
464
|
static get is() { return "pam-login"; }
|
|
449
465
|
static get encapsulation() { return "shadow"; }
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { P as PamLogin } from './pam-login-
|
|
1
|
+
export { P as PamLogin } from './pam-login-e7a6e5e6.js';
|
|
2
2
|
import './index-a126c540.js';
|
|
@@ -22368,6 +22368,22 @@ const PamLogin = class {
|
|
|
22368
22368
|
fetch(url.href, options)
|
|
22369
22369
|
.then((res) => res.json(), (err) => reject(err))
|
|
22370
22370
|
.then((res) => {
|
|
22371
|
+
var _a, _b;
|
|
22372
|
+
if (res.error) {
|
|
22373
|
+
const errorCode = (_a = res === null || res === void 0 ? void 0 : res.thirdPartyResponse) === null || _a === void 0 ? void 0 : _a.errorCode;
|
|
22374
|
+
if (errorCode === 'GmErr_USER_AUTH_FAILED' && this.loginByPhoneNumber === 'true') {
|
|
22375
|
+
this.apiErrorMessage = translate$1('AuthFailedPhoneNumber', this.lang);
|
|
22376
|
+
}
|
|
22377
|
+
else {
|
|
22378
|
+
const messageCode = res === null || res === void 0 ? void 0 : res.message;
|
|
22379
|
+
this.apiErrorMessage =
|
|
22380
|
+
translate$1(`${errorCode}`, this.lang) ||
|
|
22381
|
+
translate$1(`${messageCode}`, this.lang) ||
|
|
22382
|
+
((_b = res === null || res === void 0 ? void 0 : res.thirdPartyResponse) === null || _b === void 0 ? void 0 : _b.message) ||
|
|
22383
|
+
translate$1('genericError', this.lang);
|
|
22384
|
+
}
|
|
22385
|
+
return reject(this.apiErrorMessage);
|
|
22386
|
+
}
|
|
22371
22387
|
if (res.sessionId && res.playerId) {
|
|
22372
22388
|
return resolve(res);
|
|
22373
22389
|
}
|
|
@@ -22397,7 +22413,7 @@ const PamLogin = class {
|
|
|
22397
22413
|
})
|
|
22398
22414
|
.catch((err) => {
|
|
22399
22415
|
console.error(`Legislation login failed: ${err.message}`, err.errors);
|
|
22400
|
-
this.apiErrorMessage = translate$1('genericError', this.lang);
|
|
22416
|
+
this.apiErrorMessage = this.apiErrorMessage || translate$1('genericError', this.lang);
|
|
22401
22417
|
this.sendErrorNotification(this.apiErrorMessage);
|
|
22402
22418
|
})
|
|
22403
22419
|
.finally(() => this.isLoading = false);
|
|
@@ -22702,21 +22718,21 @@ const PamLogin = class {
|
|
|
22702
22718
|
* Render function
|
|
22703
22719
|
*/
|
|
22704
22720
|
render() {
|
|
22705
|
-
const visibilityIcon = h$2("span", { key: '
|
|
22721
|
+
const visibilityIcon = h$2("span", { key: '24cb82c372a6ceb1d76652d67e032d0b02389d3c', class: "InputIcon" }, this.isPasswordVisible
|
|
22706
22722
|
? h$2("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$2("g", { transform: "translate(-110.856 -23.242)" }, h$2("circle", { class: "PasswordVisibilityIcon", cx: "0.05", cy: "0.05", r: "0.05", transform: "translate(121.017 31.148)" }), h$2("g", { transform: "translate(117.499 27.37)" }, h$2("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$2("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$2("g", { transform: "translate(110.856 24.899)" }, h$2("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$2("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$2("rect", { class: "PasswordVisibilityIcon", width: "0.972", height: "15.861", rx: "0.486", transform: "translate(114.827 23.858) rotate(-39.315)" })))
|
|
22707
22723
|
: h$2("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$2("g", { transform: "translate(-14.185 -27.832)" }, h$2("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$2("circle", { class: "PasswordVisibilityIcon", cx: "2.779", cy: "2.779", r: "2.779", transform: "translate(20.827 30.303)" }))));
|
|
22708
|
-
const loginForm = (h$2("div", { key: '
|
|
22724
|
+
const loginForm = (h$2("div", { key: 'b8a013ae94d14bdaba795b7822515692b73bb748', class: "FormBox" }, h$2("div", { key: '194a4d62a48d25c295ca1ac542f5aebe9c6161ac', class: "FormValue", onKeyDown: this.handleSubmit }, this.loginByPhoneNumber === 'true'
|
|
22709
22725
|
? h$2("div", { class: (this.isContactValid && !this.apiErrorMessage) ? 'InputBox' : 'InputBox InputInvalidBox' }, h$2("div", { class: "PhoneInputBox" }, h$2("div", { class: "PrefixBox" }, h$2("vaadin-combo-box", { items: this.phoneCodes, value: this.phoneCodeValue, onChange: this.handleInputChangePartial('prefix') }), h$2("label", { class: (this.phoneCodeValue ? 'FieldFilledIn' : '') + ' ' + (this.isContactValid ? '' : 'FieldInvalid') }, translate$1('userPrefix', this.lang))), h$2("div", { class: "PhoneBox" }, h$2("input", { type: "text", placeholder: '', value: this.contactValue, onFocus: this.handleInputChangePartial('phone'), onInput: this.handleInputChangePartial('phone'), autocapitalize: "none", required: true }), h$2("label", { class: (this.contactValue ? 'FieldFilledIn' : '') + ' ' + (this.isContactValid ? '' : 'FieldInvalid') }, translate$1('userPhone', this.lang)))), !this.isContactValid &&
|
|
22710
22726
|
h$2("p", { class: "CredentialsError" }, translate$1('userPhoneError', this.lang)))
|
|
22711
22727
|
: h$2("div", { class: this.isContactValid ? 'InputBox' : 'InputBox InputInvalidBox' }, h$2("input", { type: "text", placeholder: '', value: this.contactValue, onInput: this.handleInputChangePartial('user'), autocapitalize: "none", required: true }), h$2("label", { class: (this.contactValue ? 'FieldFilledIn' : '') + ' ' + (this.isContactValid ? '' : 'FieldInvalid') }, translate$1('userEmail', this.lang)), !this.isContactValid &&
|
|
22712
|
-
h$2("p", { class: "CredentialsError" }, translate$1('userEmailError', this.lang))), h$2("div", { key: '
|
|
22713
|
-
h$2("p", { key: '
|
|
22714
|
-
h$2("div", { key: '
|
|
22715
|
-
h$2("slot", { key: '
|
|
22716
|
-
h$2("slot", { key: '
|
|
22717
|
-
h$2("p", { key: '
|
|
22718
|
-
const skeleton = (h$2("div", { key: '
|
|
22719
|
-
return (h$2("section", { key: '
|
|
22728
|
+
h$2("p", { class: "CredentialsError" }, translate$1('userEmailError', this.lang))), h$2("div", { key: '100548b538ba8524b57cbb1b6ca6424398c328cf', class: this.isPasswordValid ? 'InputBox' : 'InputBox InputInvalidBox' }, visibilityIcon, h$2("input", { key: '264d6721749c23a7f2b6431b4608731e57302544', type: this.isPasswordVisible ? "text" : "password", placeholder: '', value: this.passwordValue, onInput: this.handleInputChangePartial('password'), autocapitalize: "none", required: true }), h$2("label", { key: '60b1ad9fd924cff2bc21c21eab670eee044f4af4', class: (this.passwordValue ? 'FieldFilledIn' : '') + ' ' + (this.isPasswordValid ? '' : 'FieldInvalid') }, translate$1('password', this.lang)), this.isPasswordValid ||
|
|
22729
|
+
h$2("p", { key: '4cb9a493124403f4177c950c821692b388b6cf04', class: "CredentialsError" }, translate$1('userPasswordError', this.lang))), this.passwordReset == 'true' &&
|
|
22730
|
+
h$2("div", { key: '602038a2609458f69cbb0589d3b00f32092a865f', class: "ForgotPassword" }, h$2("button", { key: '3462d939c84586d9175fe2cc83b66601a3743bd6', onClick: this.resetPassword }, translate$1('forgotPassword', this.lang))), this.captchaData.isEnabled && this.captchaData.provider === 'cloudflare' &&
|
|
22731
|
+
h$2("slot", { key: 'e5ceda76363941844adc5968a9e662e32a98ec79', name: "turnstile" }), this.captchaData.isEnabled && this.captchaData.provider === 'google' &&
|
|
22732
|
+
h$2("slot", { key: '9ce955f4316d2c3f051bdd8a378703a698af96af', name: "google" }), h$2("button", { key: '0862f621e099f7144b842ccc83f57c0c93892832', disabled: this.isSubmitDisabled(), class: "SubmitCredentials", onClick: this.handleLogin }, translate$1('login', this.lang)), this.apiErrorMessage &&
|
|
22733
|
+
h$2("p", { key: '15dbcab0684e95035a9b7365d39e5a1c2ce88586', class: "CredentialsError" }, this.apiErrorMessage))));
|
|
22734
|
+
const skeleton = (h$2("div", { key: 'c478390ca347af702fbff76438a0ad81831ab01e', class: "LoadingSkeleton" }, h$2("form", { key: '401827bb79817b7b885369f8b52452ece69f4efd', class: "Form" }, h$2("section", { key: '996d42c71521b5ee814a5c8e9833680cc01c41e6', class: "FieldsSection" }, h$2("div", { key: '6d4c9ab780f45f87bc84d0a1b0f332abed93ddd6', class: "FieldContainer" }, h$2("div", { key: '688bfd8803e6ae633073df37b91d953c5d88d787', class: "FieldTitle" }, h$2("ui-skeleton", { key: '5bb5cb4fab3f5423fd5b5230d95097dfe45a2839', structure: "title", width: "auto", height: "20px" })), h$2("ui-skeleton", { key: 'b830c20699f3a8ca7f2227f39c2be72a8aac6ec6', structure: "rectangle", width: "auto", height: "35px" })), h$2("div", { key: 'bf5cdf15c01b92c0339534d8af63222972f9fa72', class: "FieldContainer" }, h$2("div", { key: '710f2ac787ca00d4adf2f023d8b8fcc041886b69', class: "FieldTitle" }, h$2("ui-skeleton", { key: 'fe2dcb513079ddf988b7244a7aa367a4e330d00e', structure: "title", width: "auto", height: "20px" })), h$2("ui-skeleton", { key: 'a3e9f3ef4df8eeca549c6d860bb8d0b6d3f8dd78', structure: "rectangle", width: "auto", height: "35px" }))), h$2("section", { key: '970a83a9133ae4ab757d70d3e04ee433dd35d8d5', class: "ButtonsSection" }, h$2("div", { key: '70a0a206a424ed0ae652b3c5463b78afb54cabd5', class: "Button" }, h$2("ui-skeleton", { key: '65e7b9769d95dc5c6715a9b49c292d0e4a36bbd1', structure: "rectangle", width: "auto", height: "50px" }))))));
|
|
22735
|
+
return (h$2("section", { key: '5a3a40493e559335647849acbf2407f1638a11d3', ref: el => this.stylingContainer = el }, this.isLoading ? skeleton : loginForm));
|
|
22720
22736
|
}
|
|
22721
22737
|
static get watchers() { return {
|
|
22722
22738
|
"translationUrl": ["handleNewTranslations"],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { P as pam_login } from './pam-login-
|
|
1
|
+
export { P as pam_login } from './pam-login-e7a6e5e6.js';
|
|
2
2
|
import { r as registerInstance, h, H as Host } from './index-a126c540.js';
|
|
3
3
|
|
|
4
4
|
const uiSkeletonCss = ":host{display:block}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 10px)}.Circle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.Text{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 10px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.Text:last-child{width:calc(var(--emw-skeleton-text-width, 400px) - 100px)}.Title{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 10px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.Image{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, unset)}.Logo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 10px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, #e0e0e0)}100%{background-color:var(--emw-skeleton-secondary-color, #f0f0f0)}}";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{P as PamLogin}from"./pam-login-
|
|
1
|
+
export{P as PamLogin}from"./pam-login-e7a6e5e6.js";import"./index-a126c540.js";
|
|
@@ -2651,4 +2651,4 @@ class mr{constructor(t){this.host=t,t.addEventListener("opened-changed",(()=>{t.
|
|
|
2651
2651
|
></vaadin-combo-box-overlay>
|
|
2652
2652
|
|
|
2653
2653
|
<slot name="tooltip"></slot>
|
|
2654
|
-
`}static get properties(){return{_positionTarget:{type:Object}}}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new ir(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new sr(this.inputElement,this._labelController)),this._tooltipController=new Eo(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 _r=class{constructor(e){t(this,e),this.getPhoneCodes=()=>{const t=new URL("v1/player/operatorSupportedPhoneCodes",this.endpoint);return fetch(t.href).then((t=>t.json())).then((t=>{this.phoneCodes=t.phoneCodes.map((t=>({label:t,value:t})))})).catch((t=>console.log("Failed to fetch phone codes:",t)))},this.handleAutofillCredentials=t=>{this.contactValue=t.detail.userNameEmail,this.passwordValue=t.detail.userPassword,this.handleLogin()},this.getLoginToken=()=>{const t=new URL("api/v1/players/password-management/auth/password/verify",this.endpoint),e={"Content-Type":"application/json"};this.captchaData.isEnabled&&(e["X-Captcha-Response"]=this.captchaData.token);const i={method:"POST",headers:e,body:JSON.stringify({contact:this.contactValue,password:this.passwordValue})};return new Promise(((e,s)=>{fetch(t.href,i).then((t=>t.json())).then((t=>{var i,o;if(t.token)return this.apiErrorMessage="",e(t.token);{const e=null===(i=null==t?void 0:t.thirdPartyResponse)||void 0===i?void 0:i.errorCode;if("GmErr_USER_AUTH_FAILED"===e&&"true"===this.loginByPhoneNumber)this.apiErrorMessage=n("AuthFailedPhoneNumber",this.lang);else{const i=null==t?void 0:t.message;this.apiErrorMessage=n(`${e}`,this.lang)||n(`${i}`,this.lang)||(null===(o=null==t?void 0:t.thirdPartyResponse)||void 0===o?void 0:o.message)||n("genericError",this.lang)}return s(this.apiErrorMessage)}}))}))},this.loginPlayer=t=>{const e=new URL("api/v2/gm/legislation/login",this.endpoint),i={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t,method:"login"})};return new Promise(((t,s)=>{fetch(e.href,i).then((t=>t.json()),(t=>s(t))).then((e=>e.sessionId&&e.playerId?t(e):s(e)))}))},this.handleLogin=()=>{this.isLoading=!0,this.getLoginToken().then((t=>{this.loginPlayer(t).then((t=>{var e;(null===(e=t.sessionBlockers)||void 0===e?void 0:e.includes("has-to-set-consents"))&&window.postMessage({type:"PlayerActions"},window.location.href),window.postMessage({type:"UserSessionID",session:t.sessionId,userid:t.playerId},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"success",message:n("successMessage",this.lang)}},window.location.href),this.apiErrorMessage=""})).catch((t=>{console.error(`Legislation login failed: ${t.message}`,t.errors),this.apiErrorMessage=n("genericError",this.lang),this.sendErrorNotification(this.apiErrorMessage)})).finally((()=>this.isLoading=!1))})).catch((t=>{console.error(t),this.sendErrorNotification(this.apiErrorMessage),this.isLoading=!1})),this.dispatchUpdateLoginCredentialsEvent()},this.handleInputChange=(t,e)=>{const i=t.target.value;switch(e){case"user":this.contactValue=i,this.isContactValid=this.validate("user",this.contactValue);break;case"phone":this.contactValue=i,this.isContactValid=this.validate("phone",this.contactValue);break;case"prefix":this.phoneCodeValue=i,this.isContactValid=this.validate("phone",this.contactValue);break;case"password":this.passwordValue=i,this.isPasswordValid=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),e.length<=3||i.test(e);case"phone":return i=new RegExp(this.userPhoneRegex,this.userPhoneRegexOptions),e.length<=3||i.test(e)&&Boolean(this.phoneCodeValue);case"password":return i=new RegExp(this.passwordRegex,this.passwordRegexOptions),e.length<=3||i.test(e)}},this.isSubmitDisabled=()=>!this.isContactValid||!this.contactValue||"true"===this.loginByPhoneNumber&&!this.phoneCodeValue||!this.passwordValue||!this.isPasswordValid||this.isLoading||this.captchaData.isEnabled&&!this.captchaData.token,this.handleSubmit=t=>{"Enter"!==t.key||this.isSubmitDisabled()||this.handleLogin()},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.mbSource=void 0,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.loginByPhoneNumber="false",this.isLoading=!1,this.contactValue="",this.passwordValue="",this.phoneCodeValue="",this.phoneCodes=void 0,this.isContactValid=!0,this.isPasswordValid=!0,this.isPasswordVisible=!1,this.apiErrorMessage="",this.captchaData={isEnabled:!0,token:"",provider:"",siteKey:""}}handleNewTranslations(){r(this.translationUrl)}handleClientStylingChange(t,e){t!=e&&i(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl)}async componentWillLoad(){"true"===this.loginByPhoneNumber&&await this.getPhoneCodes(),this.translationUrl.length>2&&await r(this.translationUrl),this.getLoginConfig().then((()=>this.appendCaptchaScript()),(t=>{console.error(t),this.apiErrorMessage=n("configError",this.lang),this.sendErrorNotification(this.apiErrorMessage)}))}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&&i(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))),window.addEventListener("LoginCredentials",this.handleAutofillCredentials),window.postMessage({type:"UserLoginDidLoad"})}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe(),window.removeEventListener("LoginCredentials",this.handleAutofillCredentials)}getLoginConfig(){const t=new URL("/api/v1/players/password-management/auth/password/config",this.endpoint);return new Promise(((e,i)=>{fetch(t.href).then((t=>{if(!t.ok)throw new Error(`HTTP error! Status: ${t.status}`);return t.json()})).then((t=>{const{captcha:i}=t;i&&"string"==typeof i.provider&&(i.provider=i.provider.toLowerCase()),this.captchaData=Object.assign({},i),e()})).catch((t=>{console.error("Error fetching login configuration:",t),i(t)}))}))}handleCaptcha(){const{isEnabled:t,provider:e,siteKey:i}=this.captchaData;if(t&&["cloudflare","google"].includes(e))switch(e){case"cloudflare":return void window.turnstile.render("#turnstileContainer",{sitekey:i,theme:"light",callback:this.captchaCallback.bind(this)});case"google":return void window.grecaptcha.ready((()=>{window.grecaptcha.render("googleContainer",{sitekey:i,callback:this.captchaCallback.bind(this),theme:"light"})}))}}captchaCallback(t){this.captchaData.token=t,this.captchaData=Object.assign({},this.captchaData)}appendCaptchaScript(){const{isEnabled:t,provider:e}=this.captchaData;if(!t)return;const i=document.createElement("script");switch(e){case"cloudflare":i.src="https://challenges.cloudflare.com/turnstile/v0/api.js";break;case"google":i.src="https://www.google.com/recaptcha/api.js"}i.onload=this.handleCaptcha.bind(this),document.head.appendChild(i)}sendErrorNotification(t){window.postMessage({type:"HasError",error:t},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"error",message:t}},window.location.href)}dispatchUpdateLoginCredentialsEvent(){this.apiErrorMessage||(this.updateLoginCredentialsEvent=new CustomEvent("UpdateLoginCredentials",{bubbles:!0,detail:{userNameEmail:this.contactValue,userPassword:this.passwordValue}}),window.dispatchEvent(this.updateLoginCredentialsEvent))}render(){const t=e("span",{key:"234292860da90cf28654769f29582e202a88f688",class:"InputIcon"},this.isPasswordVisible?e("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"},e("g",{transform:"translate(-110.856 -23.242)"},e("circle",{class:"PasswordVisibilityIcon",cx:"0.05",cy:"0.05",r:"0.05",transform:"translate(121.017 31.148)"}),e("g",{transform:"translate(117.499 27.37)"},e("path",{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",{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",{transform:"translate(110.856 24.899)"},e("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)"}),e("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)"})),e("rect",{class:"PasswordVisibilityIcon",width:"0.972",height:"15.861",rx:"0.486",transform:"translate(114.827 23.858) rotate(-39.315)"}))):e("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"},e("g",{transform:"translate(-14.185 -27.832)"},e("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)"}),e("circle",{class:"PasswordVisibilityIcon",cx:"2.779",cy:"2.779",r:"2.779",transform:"translate(20.827 30.303)"})))),i=e("div",{key:"9a27769e9810a2ed1deb71544f19057a12d21dad",class:"FormBox"},e("div",{key:"0d98c58d94e0a4fc30388297a9ba40264fdbe753",class:"FormValue",onKeyDown:this.handleSubmit},"true"===this.loginByPhoneNumber?e("div",{class:this.isContactValid&&!this.apiErrorMessage?"InputBox":"InputBox InputInvalidBox"},e("div",{class:"PhoneInputBox"},e("div",{class:"PrefixBox"},e("vaadin-combo-box",{items:this.phoneCodes,value:this.phoneCodeValue,onChange:this.handleInputChangePartial("prefix")}),e("label",{class:(this.phoneCodeValue?"FieldFilledIn":"")+" "+(this.isContactValid?"":"FieldInvalid")},n("userPrefix",this.lang))),e("div",{class:"PhoneBox"},e("input",{type:"text",placeholder:"",value:this.contactValue,onFocus:this.handleInputChangePartial("phone"),onInput:this.handleInputChangePartial("phone"),autocapitalize:"none",required:!0}),e("label",{class:(this.contactValue?"FieldFilledIn":"")+" "+(this.isContactValid?"":"FieldInvalid")},n("userPhone",this.lang)))),!this.isContactValid&&e("p",{class:"CredentialsError"},n("userPhoneError",this.lang))):e("div",{class:this.isContactValid?"InputBox":"InputBox InputInvalidBox"},e("input",{type:"text",placeholder:"",value:this.contactValue,onInput:this.handleInputChangePartial("user"),autocapitalize:"none",required:!0}),e("label",{class:(this.contactValue?"FieldFilledIn":"")+" "+(this.isContactValid?"":"FieldInvalid")},n("userEmail",this.lang)),!this.isContactValid&&e("p",{class:"CredentialsError"},n("userEmailError",this.lang))),e("div",{key:"dcb652f9b3c67dc8c5d7969de6c9c2d7bfc27253",class:this.isPasswordValid?"InputBox":"InputBox InputInvalidBox"},t,e("input",{key:"c8efbc69a63edaf171afcdd96c7e582d00e728e5",type:this.isPasswordVisible?"text":"password",placeholder:"",value:this.passwordValue,onInput:this.handleInputChangePartial("password"),autocapitalize:"none",required:!0}),e("label",{key:"522d3b40c719920e1bd059fc42aa7cee90b0ef71",class:(this.passwordValue?"FieldFilledIn":"")+" "+(this.isPasswordValid?"":"FieldInvalid")},n("password",this.lang)),this.isPasswordValid||e("p",{key:"1957b298f2ea240f4170475b2ad14a21aaff2d97",class:"CredentialsError"},n("userPasswordError",this.lang))),"true"==this.passwordReset&&e("div",{key:"1ebf5cc23772a9ec81206860726a619579ce342b",class:"ForgotPassword"},e("button",{key:"d5702ae60d9ff71b2bd09f24ef1bb0fabe13768c",onClick:this.resetPassword},n("forgotPassword",this.lang))),this.captchaData.isEnabled&&"cloudflare"===this.captchaData.provider&&e("slot",{key:"db9fab29d22f719bc435783bf73b8f9e8e1c9a4a",name:"turnstile"}),this.captchaData.isEnabled&&"google"===this.captchaData.provider&&e("slot",{key:"8035ae55e020dc6bce31f9e963b2c584471dbe20",name:"google"}),e("button",{key:"2aa1cf8c12be4479ddd5ef289a0bd89618fdd60a",disabled:this.isSubmitDisabled(),class:"SubmitCredentials",onClick:this.handleLogin},n("login",this.lang)),this.apiErrorMessage&&e("p",{key:"8ab1688055de5059cc089e251b6213167e441ba5",class:"CredentialsError"},this.apiErrorMessage))),s=e("div",{key:"b0ffdecc3b42da67fe3958b398b8df5a9daa8770",class:"LoadingSkeleton"},e("form",{key:"94c39c2b6610043779f766f875bce67242787b76",class:"Form"},e("section",{key:"9ecbf951d9c5f7cc32f4e5ee3494d30196c81153",class:"FieldsSection"},e("div",{key:"fee0c682216c153dde1d677b8568e9b70d53cdfe",class:"FieldContainer"},e("div",{key:"d5e1f8e3dff90820db171da8bb4d9f5ae090c1a0",class:"FieldTitle"},e("ui-skeleton",{key:"c00ec68a01e547956772b6f6cdd42cc8b46e9318",structure:"title",width:"auto",height:"20px"})),e("ui-skeleton",{key:"f58204a9338e05438e6e0e24d374305b9a520151",structure:"rectangle",width:"auto",height:"35px"})),e("div",{key:"d755a4af2a8a0807633c46026d0905c69f80a226",class:"FieldContainer"},e("div",{key:"51e1d50b4d1af66a6d31f285e54c02ae03e41017",class:"FieldTitle"},e("ui-skeleton",{key:"531a0637698d1b350705609269d86a61d3fded8c",structure:"title",width:"auto",height:"20px"})),e("ui-skeleton",{key:"8086826cce3deee021419ea9bfd5c5000e7d9282",structure:"rectangle",width:"auto",height:"35px"}))),e("section",{key:"bf9d44e638325d5ce38e74d099d054bbb90f964e",class:"ButtonsSection"},e("div",{key:"6f01878e8627de88451d03ca75747e23d7fe979f",class:"Button"},e("ui-skeleton",{key:"bf0e52f5c0576e10dcac20398505102fedc771f6",structure:"rectangle",width:"auto",height:"50px"})))));return e("section",{key:"f2a473071b0c33c32d4942ea5f7bd40993da087c",ref:t=>this.stylingContainer=t},this.isLoading?s:i)}static get watchers(){return{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}}};_r.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:var(--emw--color-primary, #0E5924);border-radius:var(--emw--button-border-radius, 10px);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:var(--emw--color-primary, #0E5924);opacity:0.4;cursor:default}.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}}.LoadingSkeleton{width:100%;height:100%}.LoadingSkeleton .Form{display:flex;flex-direction:column;gap:50px;width:100%;height:100%}.LoadingSkeleton .Form .ButtonReturn{width:150px;height:30px;margin-top:15px;display:block}.LoadingSkeleton .Form .FieldsSection{display:block}.LoadingSkeleton .Form .FieldsSection .FieldContainer .FieldTitle{width:150px;margin-top:30px;margin-bottom:15px}.LoadingSkeleton .Form .ButtonsSection .Button{border-radius:50px;background:transparent;border:none;overflow:hidden}';export{_r as P}
|
|
2654
|
+
`}static get properties(){return{_positionTarget:{type:Object}}}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new ir(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new sr(this.inputElement,this._labelController)),this._tooltipController=new Eo(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 _r=class{constructor(e){t(this,e),this.getPhoneCodes=()=>{const t=new URL("v1/player/operatorSupportedPhoneCodes",this.endpoint);return fetch(t.href).then((t=>t.json())).then((t=>{this.phoneCodes=t.phoneCodes.map((t=>({label:t,value:t})))})).catch((t=>console.log("Failed to fetch phone codes:",t)))},this.handleAutofillCredentials=t=>{this.contactValue=t.detail.userNameEmail,this.passwordValue=t.detail.userPassword,this.handleLogin()},this.getLoginToken=()=>{const t=new URL("api/v1/players/password-management/auth/password/verify",this.endpoint),e={"Content-Type":"application/json"};this.captchaData.isEnabled&&(e["X-Captcha-Response"]=this.captchaData.token);const i={method:"POST",headers:e,body:JSON.stringify({contact:this.contactValue,password:this.passwordValue})};return new Promise(((e,s)=>{fetch(t.href,i).then((t=>t.json())).then((t=>{var i,o;if(t.token)return this.apiErrorMessage="",e(t.token);{const e=null===(i=null==t?void 0:t.thirdPartyResponse)||void 0===i?void 0:i.errorCode;if("GmErr_USER_AUTH_FAILED"===e&&"true"===this.loginByPhoneNumber)this.apiErrorMessage=n("AuthFailedPhoneNumber",this.lang);else{const i=null==t?void 0:t.message;this.apiErrorMessage=n(`${e}`,this.lang)||n(`${i}`,this.lang)||(null===(o=null==t?void 0:t.thirdPartyResponse)||void 0===o?void 0:o.message)||n("genericError",this.lang)}return s(this.apiErrorMessage)}}))}))},this.loginPlayer=t=>{const e=new URL("api/v2/gm/legislation/login",this.endpoint),i={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t,method:"login"})};return new Promise(((t,s)=>{fetch(e.href,i).then((t=>t.json()),(t=>s(t))).then((e=>{var i,o;if(e.error){const t=null===(i=null==e?void 0:e.thirdPartyResponse)||void 0===i?void 0:i.errorCode;if("GmErr_USER_AUTH_FAILED"===t&&"true"===this.loginByPhoneNumber)this.apiErrorMessage=n("AuthFailedPhoneNumber",this.lang);else{const i=null==e?void 0:e.message;this.apiErrorMessage=n(`${t}`,this.lang)||n(`${i}`,this.lang)||(null===(o=null==e?void 0:e.thirdPartyResponse)||void 0===o?void 0:o.message)||n("genericError",this.lang)}return s(this.apiErrorMessage)}return e.sessionId&&e.playerId?t(e):s(e)}))}))},this.handleLogin=()=>{this.isLoading=!0,this.getLoginToken().then((t=>{this.loginPlayer(t).then((t=>{var e;(null===(e=t.sessionBlockers)||void 0===e?void 0:e.includes("has-to-set-consents"))&&window.postMessage({type:"PlayerActions"},window.location.href),window.postMessage({type:"UserSessionID",session:t.sessionId,userid:t.playerId},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"success",message:n("successMessage",this.lang)}},window.location.href),this.apiErrorMessage=""})).catch((t=>{console.error(`Legislation login failed: ${t.message}`,t.errors),this.apiErrorMessage=this.apiErrorMessage||n("genericError",this.lang),this.sendErrorNotification(this.apiErrorMessage)})).finally((()=>this.isLoading=!1))})).catch((t=>{console.error(t),this.sendErrorNotification(this.apiErrorMessage),this.isLoading=!1})),this.dispatchUpdateLoginCredentialsEvent()},this.handleInputChange=(t,e)=>{const i=t.target.value;switch(e){case"user":this.contactValue=i,this.isContactValid=this.validate("user",this.contactValue);break;case"phone":this.contactValue=i,this.isContactValid=this.validate("phone",this.contactValue);break;case"prefix":this.phoneCodeValue=i,this.isContactValid=this.validate("phone",this.contactValue);break;case"password":this.passwordValue=i,this.isPasswordValid=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),e.length<=3||i.test(e);case"phone":return i=new RegExp(this.userPhoneRegex,this.userPhoneRegexOptions),e.length<=3||i.test(e)&&Boolean(this.phoneCodeValue);case"password":return i=new RegExp(this.passwordRegex,this.passwordRegexOptions),e.length<=3||i.test(e)}},this.isSubmitDisabled=()=>!this.isContactValid||!this.contactValue||"true"===this.loginByPhoneNumber&&!this.phoneCodeValue||!this.passwordValue||!this.isPasswordValid||this.isLoading||this.captchaData.isEnabled&&!this.captchaData.token,this.handleSubmit=t=>{"Enter"!==t.key||this.isSubmitDisabled()||this.handleLogin()},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.mbSource=void 0,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.loginByPhoneNumber="false",this.isLoading=!1,this.contactValue="",this.passwordValue="",this.phoneCodeValue="",this.phoneCodes=void 0,this.isContactValid=!0,this.isPasswordValid=!0,this.isPasswordVisible=!1,this.apiErrorMessage="",this.captchaData={isEnabled:!0,token:"",provider:"",siteKey:""}}handleNewTranslations(){r(this.translationUrl)}handleClientStylingChange(t,e){t!=e&&i(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl)}async componentWillLoad(){"true"===this.loginByPhoneNumber&&await this.getPhoneCodes(),this.translationUrl.length>2&&await r(this.translationUrl),this.getLoginConfig().then((()=>this.appendCaptchaScript()),(t=>{console.error(t),this.apiErrorMessage=n("configError",this.lang),this.sendErrorNotification(this.apiErrorMessage)}))}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&&i(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))),window.addEventListener("LoginCredentials",this.handleAutofillCredentials),window.postMessage({type:"UserLoginDidLoad"})}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe(),window.removeEventListener("LoginCredentials",this.handleAutofillCredentials)}getLoginConfig(){const t=new URL("/api/v1/players/password-management/auth/password/config",this.endpoint);return new Promise(((e,i)=>{fetch(t.href).then((t=>{if(!t.ok)throw new Error(`HTTP error! Status: ${t.status}`);return t.json()})).then((t=>{const{captcha:i}=t;i&&"string"==typeof i.provider&&(i.provider=i.provider.toLowerCase()),this.captchaData=Object.assign({},i),e()})).catch((t=>{console.error("Error fetching login configuration:",t),i(t)}))}))}handleCaptcha(){const{isEnabled:t,provider:e,siteKey:i}=this.captchaData;if(t&&["cloudflare","google"].includes(e))switch(e){case"cloudflare":return void window.turnstile.render("#turnstileContainer",{sitekey:i,theme:"light",callback:this.captchaCallback.bind(this)});case"google":return void window.grecaptcha.ready((()=>{window.grecaptcha.render("googleContainer",{sitekey:i,callback:this.captchaCallback.bind(this),theme:"light"})}))}}captchaCallback(t){this.captchaData.token=t,this.captchaData=Object.assign({},this.captchaData)}appendCaptchaScript(){const{isEnabled:t,provider:e}=this.captchaData;if(!t)return;const i=document.createElement("script");switch(e){case"cloudflare":i.src="https://challenges.cloudflare.com/turnstile/v0/api.js";break;case"google":i.src="https://www.google.com/recaptcha/api.js"}i.onload=this.handleCaptcha.bind(this),document.head.appendChild(i)}sendErrorNotification(t){window.postMessage({type:"HasError",error:t},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"error",message:t}},window.location.href)}dispatchUpdateLoginCredentialsEvent(){this.apiErrorMessage||(this.updateLoginCredentialsEvent=new CustomEvent("UpdateLoginCredentials",{bubbles:!0,detail:{userNameEmail:this.contactValue,userPassword:this.passwordValue}}),window.dispatchEvent(this.updateLoginCredentialsEvent))}render(){const t=e("span",{key:"24cb82c372a6ceb1d76652d67e032d0b02389d3c",class:"InputIcon"},this.isPasswordVisible?e("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"},e("g",{transform:"translate(-110.856 -23.242)"},e("circle",{class:"PasswordVisibilityIcon",cx:"0.05",cy:"0.05",r:"0.05",transform:"translate(121.017 31.148)"}),e("g",{transform:"translate(117.499 27.37)"},e("path",{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",{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",{transform:"translate(110.856 24.899)"},e("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)"}),e("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)"})),e("rect",{class:"PasswordVisibilityIcon",width:"0.972",height:"15.861",rx:"0.486",transform:"translate(114.827 23.858) rotate(-39.315)"}))):e("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"},e("g",{transform:"translate(-14.185 -27.832)"},e("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)"}),e("circle",{class:"PasswordVisibilityIcon",cx:"2.779",cy:"2.779",r:"2.779",transform:"translate(20.827 30.303)"})))),i=e("div",{key:"b8a013ae94d14bdaba795b7822515692b73bb748",class:"FormBox"},e("div",{key:"194a4d62a48d25c295ca1ac542f5aebe9c6161ac",class:"FormValue",onKeyDown:this.handleSubmit},"true"===this.loginByPhoneNumber?e("div",{class:this.isContactValid&&!this.apiErrorMessage?"InputBox":"InputBox InputInvalidBox"},e("div",{class:"PhoneInputBox"},e("div",{class:"PrefixBox"},e("vaadin-combo-box",{items:this.phoneCodes,value:this.phoneCodeValue,onChange:this.handleInputChangePartial("prefix")}),e("label",{class:(this.phoneCodeValue?"FieldFilledIn":"")+" "+(this.isContactValid?"":"FieldInvalid")},n("userPrefix",this.lang))),e("div",{class:"PhoneBox"},e("input",{type:"text",placeholder:"",value:this.contactValue,onFocus:this.handleInputChangePartial("phone"),onInput:this.handleInputChangePartial("phone"),autocapitalize:"none",required:!0}),e("label",{class:(this.contactValue?"FieldFilledIn":"")+" "+(this.isContactValid?"":"FieldInvalid")},n("userPhone",this.lang)))),!this.isContactValid&&e("p",{class:"CredentialsError"},n("userPhoneError",this.lang))):e("div",{class:this.isContactValid?"InputBox":"InputBox InputInvalidBox"},e("input",{type:"text",placeholder:"",value:this.contactValue,onInput:this.handleInputChangePartial("user"),autocapitalize:"none",required:!0}),e("label",{class:(this.contactValue?"FieldFilledIn":"")+" "+(this.isContactValid?"":"FieldInvalid")},n("userEmail",this.lang)),!this.isContactValid&&e("p",{class:"CredentialsError"},n("userEmailError",this.lang))),e("div",{key:"100548b538ba8524b57cbb1b6ca6424398c328cf",class:this.isPasswordValid?"InputBox":"InputBox InputInvalidBox"},t,e("input",{key:"264d6721749c23a7f2b6431b4608731e57302544",type:this.isPasswordVisible?"text":"password",placeholder:"",value:this.passwordValue,onInput:this.handleInputChangePartial("password"),autocapitalize:"none",required:!0}),e("label",{key:"60b1ad9fd924cff2bc21c21eab670eee044f4af4",class:(this.passwordValue?"FieldFilledIn":"")+" "+(this.isPasswordValid?"":"FieldInvalid")},n("password",this.lang)),this.isPasswordValid||e("p",{key:"4cb9a493124403f4177c950c821692b388b6cf04",class:"CredentialsError"},n("userPasswordError",this.lang))),"true"==this.passwordReset&&e("div",{key:"602038a2609458f69cbb0589d3b00f32092a865f",class:"ForgotPassword"},e("button",{key:"3462d939c84586d9175fe2cc83b66601a3743bd6",onClick:this.resetPassword},n("forgotPassword",this.lang))),this.captchaData.isEnabled&&"cloudflare"===this.captchaData.provider&&e("slot",{key:"e5ceda76363941844adc5968a9e662e32a98ec79",name:"turnstile"}),this.captchaData.isEnabled&&"google"===this.captchaData.provider&&e("slot",{key:"9ce955f4316d2c3f051bdd8a378703a698af96af",name:"google"}),e("button",{key:"0862f621e099f7144b842ccc83f57c0c93892832",disabled:this.isSubmitDisabled(),class:"SubmitCredentials",onClick:this.handleLogin},n("login",this.lang)),this.apiErrorMessage&&e("p",{key:"15dbcab0684e95035a9b7365d39e5a1c2ce88586",class:"CredentialsError"},this.apiErrorMessage))),s=e("div",{key:"c478390ca347af702fbff76438a0ad81831ab01e",class:"LoadingSkeleton"},e("form",{key:"401827bb79817b7b885369f8b52452ece69f4efd",class:"Form"},e("section",{key:"996d42c71521b5ee814a5c8e9833680cc01c41e6",class:"FieldsSection"},e("div",{key:"6d4c9ab780f45f87bc84d0a1b0f332abed93ddd6",class:"FieldContainer"},e("div",{key:"688bfd8803e6ae633073df37b91d953c5d88d787",class:"FieldTitle"},e("ui-skeleton",{key:"5bb5cb4fab3f5423fd5b5230d95097dfe45a2839",structure:"title",width:"auto",height:"20px"})),e("ui-skeleton",{key:"b830c20699f3a8ca7f2227f39c2be72a8aac6ec6",structure:"rectangle",width:"auto",height:"35px"})),e("div",{key:"bf5cdf15c01b92c0339534d8af63222972f9fa72",class:"FieldContainer"},e("div",{key:"710f2ac787ca00d4adf2f023d8b8fcc041886b69",class:"FieldTitle"},e("ui-skeleton",{key:"fe2dcb513079ddf988b7244a7aa367a4e330d00e",structure:"title",width:"auto",height:"20px"})),e("ui-skeleton",{key:"a3e9f3ef4df8eeca549c6d860bb8d0b6d3f8dd78",structure:"rectangle",width:"auto",height:"35px"}))),e("section",{key:"970a83a9133ae4ab757d70d3e04ee433dd35d8d5",class:"ButtonsSection"},e("div",{key:"70a0a206a424ed0ae652b3c5463b78afb54cabd5",class:"Button"},e("ui-skeleton",{key:"65e7b9769d95dc5c6715a9b49c292d0e4a36bbd1",structure:"rectangle",width:"auto",height:"50px"})))));return e("section",{key:"5a3a40493e559335647849acbf2407f1638a11d3",ref:t=>this.stylingContainer=t},this.isLoading?s:i)}static get watchers(){return{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}}};_r.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:var(--emw--color-primary, #0E5924);border-radius:var(--emw--button-border-radius, 10px);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:var(--emw--color-primary, #0E5924);opacity:0.4;cursor:default}.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}}.LoadingSkeleton{width:100%;height:100%}.LoadingSkeleton .Form{display:flex;flex-direction:column;gap:50px;width:100%;height:100%}.LoadingSkeleton .Form .ButtonReturn{width:150px;height:30px;margin-top:15px;display:block}.LoadingSkeleton .Form .FieldsSection{display:block}.LoadingSkeleton .Form .FieldsSection .FieldContainer .FieldTitle{width:150px;margin-top:30px;margin-bottom:15px}.LoadingSkeleton .Form .ButtonsSection .Button{border-radius:50px;background:transparent;border:none;overflow:hidden}';export{_r as P}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{P as pam_login}from"./pam-login-
|
|
1
|
+
export{P as pam_login}from"./pam-login-e7a6e5e6.js";import{r as e,h as t,H as n}from"./index-a126c540.js";const i=class{constructor(t){e(this,t),this.stylingValue={width:this.handleStylingProps(this.width),height:this.handleStylingProps(this.height),borderRadius:this.handleStylingProps(this.borderRadius),marginBottom:this.handleStylingProps(this.marginBottom),marginTop:this.handleStylingProps(this.marginTop),marginLeft:this.handleStylingProps(this.marginLeft),marginRight:this.handleStylingProps(this.marginRight),size:this.handleStylingProps(this.size)},this.structure=void 0,this.width="unset",this.height="unset",this.borderRadius="unset",this.marginBottom="unset",this.marginTop="unset",this.marginLeft="unset",this.marginRight="unset",this.animation=!0,this.rows=0,this.size="100%"}handleStructureChange(e,t){t!==e&&this.handleStructure(e)}handleStylingProps(e){switch(typeof e){case"number":return 0===e?0:`${e}px`;case"undefined":default:return"unset";case"string":return["auto","unset","none","inherit","initial"].includes(e)||e.endsWith("px")||e.endsWith("%")?e:"unset"}}handleStructure(e){switch(e){case"logo":return this.renderLogo();case"image":return this.renderImage();case"title":return this.renderTitle();case"text":return this.renderText();case"rectangle":return this.renderRectangle();case"circle":return this.renderCircle();default:return null}}renderLogo(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Logo "+(this.animation?"Skeleton":"")}))}renderImage(){return t("div",{class:"Image "+(this.animation?"Skeleton":"")})}renderTitle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Title "+(this.animation?"Skeleton":"")}))}renderText(){return t("div",{class:"SkeletonContainer"},Array.from({length:this.rows>0?this.rows:1}).map(((e,n)=>t("div",{key:n,class:"Text "+(this.animation?"Skeleton":"")}))))}renderRectangle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Rectangle "+(this.animation?"Skeleton":"")}))}renderCircle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Circle "+(this.animation?"Skeleton":"")}))}render(){let e="";switch(this.structure){case"logo":e=`\n :host {\n --emw-skeleton-logo-width: ${this.stylingValue.width};\n --emw-skeleton-logo-height: ${this.stylingValue.height};\n --emw-skeleton-logo-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-logo-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-logo-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-logo-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-logo-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"image":e=`\n :host {\n --emw-skeleton-image-width: ${this.stylingValue.width};\n --emw-skeleton-image-height: ${this.stylingValue.height};\n --emw-skeleton-image-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-image-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-image-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-image-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-image-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"title":e=`\n :host {\n --emw-skeleton-title-width: ${this.stylingValue.width};\n --emw-skeleton-title-height: ${this.stylingValue.height};\n --emw-skeleton-title-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-title-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-title-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-title-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-title-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"text":e=`\n :host {\n --emw-skeleton-text-width: ${this.stylingValue.width};\n --emw-skeleton-text-height: ${this.stylingValue.height};\n --emw-skeleton-text-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-text-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-text-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-text-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-text-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"rectangle":e=`\n :host {\n --emw-skeleton-rectangle-width: ${this.stylingValue.width};\n --emw-skeleton-rectangle-height: ${this.stylingValue.height};\n --emw-skeleton-rectangle-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-rectangle-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-rectangle-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-rectangle-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-rectangle-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"circle":e=`\n :host {\n --emw-skeleton-circle-size: ${this.stylingValue.size};\n }\n `;break;default:e=""}return t(n,{key:"e6b885bfd985ce7663d990756fe9101e25eb97f0"},t("style",{key:"06ae24c7bb74f4dacfc12ae58085333f9dc89da5"},e),this.handleStructure(this.structure))}static get watchers(){return{structure:["handleStructureChange"]}}};i.style=":host{display:block}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 10px)}.Circle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.Text{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 10px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.Text:last-child{width:calc(var(--emw-skeleton-text-width, 400px) - 100px)}.Title{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 10px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.Image{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, unset)}.Logo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 10px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, #e0e0e0)}100%{background-color:var(--emw-skeleton-secondary-color, #f0f0f0)}}";export{i as ui_skeleton}
|