@schukai/monster 4.56.0 → 4.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/package.json +1 -1
  3. package/source/components/data/stylesheet/metric-graph.mjs +1 -1
  4. package/source/components/data/stylesheet/metric.mjs +1 -1
  5. package/source/components/datatable/dataset.mjs +10 -0
  6. package/source/components/datatable/datasource/rest.mjs +141 -14
  7. package/source/components/datatable/datasource.mjs +8 -1
  8. package/source/components/datatable/datatable.mjs +3 -7
  9. package/source/components/datatable/save-button.mjs +348 -334
  10. package/source/components/datatable/status.mjs +7 -0
  11. package/source/components/datatable/util.mjs +7 -0
  12. package/source/components/form/button-bar.mjs +193 -95
  13. package/source/components/form/field-set.mjs +283 -283
  14. package/source/components/form/form.mjs +407 -162
  15. package/source/components/form/login.mjs +1571 -1571
  16. package/source/components/form/quantity.mjs +233 -233
  17. package/source/components/form/select.mjs +3106 -3101
  18. package/source/components/form/style/field-set.pcss +6 -2
  19. package/source/components/form/style/form.pcss +8 -0
  20. package/source/components/form/stylesheet/field-set.mjs +1 -1
  21. package/source/components/form/stylesheet/form.mjs +1 -1
  22. package/source/components/form/stylesheet/select.mjs +13 -6
  23. package/source/components/style/typography.css +2 -2
  24. package/source/components/tree-menu/stylesheet/tree-menu.mjs +1 -1
  25. package/source/constraints/abstract.mjs +17 -17
  26. package/source/dom/customelement.mjs +962 -963
  27. package/source/dom/updater.mjs +874 -863
  28. package/source/dom/util/init-options-from-attributes.mjs +56 -56
  29. package/source/monster.mjs +0 -1
  30. package/source/net/webconnect.mjs +325 -325
  31. package/source/types/is.mjs +66 -66
@@ -13,13 +13,13 @@
13
13
  import { instanceSymbol } from "../../constants.mjs";
14
14
  import { addAttributeToken } from "../../dom/attributes.mjs";
15
15
  import {
16
- ATTRIBUTE_ERRORMESSAGE,
17
- ATTRIBUTE_ROLE,
16
+ ATTRIBUTE_ERRORMESSAGE,
17
+ ATTRIBUTE_ROLE,
18
18
  } from "../../dom/constants.mjs";
19
19
  import { CustomElement } from "../../dom/customelement.mjs";
20
20
  import {
21
- assembleMethodSymbol,
22
- registerCustomElement,
21
+ assembleMethodSymbol,
22
+ registerCustomElement,
23
23
  } from "../../dom/customelement.mjs";
24
24
  import { findTargetElementFromEvent, fireEvent } from "../../dom/events.mjs";
25
25
  import { LoginStyleSheet } from "./stylesheet/login.mjs";
@@ -147,936 +147,936 @@ const digitsCollapseSymbol = Symbol("digitsCollapse");
147
147
  */
148
148
 
149
149
  class Login extends CustomElement {
150
- /**
151
- * This method is called by the `instanceof` operator.
152
- * @returns {symbol}
153
- */
154
- static get [instanceSymbol]() {
155
- return Symbol.for("@schukai/monster/components/form/login@@instance");
156
- }
157
-
158
- /**
159
- * @return {void}
160
- */
161
- [assembleMethodSymbol]() {
162
- super[assembleMethodSymbol]();
163
-
164
- setTimeout(() => {
165
- initControlReferences.call(this);
166
- initEventHandler.call(this);
167
-
168
- setTimeout(() => {
169
- this.shadowRoot.querySelector("input[name='username']").focus();
170
- }, 100);
171
- }, 0);
172
- }
173
-
174
- /**
175
- * To set the options via the HTML Tag, the attribute `data-monster-options` must be used.
176
- * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
177
- *
178
- * The individual configuration values can be found in the table.
179
- *
180
- * @property {Object} templates Template definitions
181
- * @property {string} templates.main The main HTML template used for rendering the login form
182
- * @property {Object} labels Label definitions used for localization and form messages
183
- * @property {string} labels.username Label for the username or email field
184
- * @property {string} labels.password Label for the password field
185
- * @property {string} labels.login Label for the login button
186
- * @property {string} labels.forgotPasswordLink Text for the "forgot password" link
187
- * @property {string} labels.mailAddress Label for the email input in password reset flow
188
- * @property {string} labels.requestLink Label for the button that sends a password reset code
189
- * @property {string} labels.digits Label for the digits input field
190
- * @property {string} labels.loginLink Label for the back-to-login link
191
- * @property {string} labels.secondFactor Label for the second factor authentication input
192
- * @property {string} labels.sendDigits Label for the button that submits the digits input
193
- * @property {string} labels.sendSecondFactorDigits Label for the button that submits the second factor code
194
- * @property {string} labels.resetLoginProcess Label for the link to return to the login form
195
- * @property {string} labels.messageEmptyUserName Message shown when username is empty
196
- * @property {string} labels.messageEmptyPassword Message shown when password is empty
197
- * @property {string} labels.messageEmptyBoth Message shown when both username and password are empty
198
- * @property {string} labels.messageEmptyEmail Message shown when email field is empty
199
- * @property {string} labels.messageInvalidEmail Message shown when an invalid email address is entered
200
- * @property {string} labels.digitsEmpty Message shown when digits field is empty
201
- * @property {string} labels.digitsInvalid Message shown when digits input is invalid
202
- * @property {string} labels.messageLoginFailed Message shown on failed login attempt
203
- * @property {string} labels.messageForbidden Message shown on successful login with insufficient permissions
204
- * @property {string} labels.messageSomethingWentWrong Fallback error message
205
- * @property {string} labels.messageThisFormIsNotConfigured Message shown if no backend URL is configured
206
- * @property {string} labels.messagePasswordResetDisabled Message shown if password reset is disabled due to 2FA
207
- * @property {Object} classes Class definitions for visual styling
208
- * @property {string} classes.usernameInvalid CSS class applied when username is invalid
209
- * @property {string} classes.passwordInvalid CSS class applied when password is invalid
210
- * @property {string} classes.emailInvalid CSS class applied when email input is invalid
211
- * @property {string} classes.button CSS class applied to all form buttons
212
- * @property {boolean} disabled If true, disables interaction with the component
213
- * @property {Object} features Feature flags to toggle optional behavior
214
- * @property {boolean} features.forgotPassword Enables the forgot password flow
215
- * @property {boolean} features.redirectToFirstSuccessUrl If true, redirects to the first success URL after login
216
- * @property {Object} actions Action definitions for custom event handling
217
- * @property {Function} actions.click Callback function for generic click actions within the login component
218
- * @property {Object} callbacks Optional callback hooks for modifying internal behavior
219
- * @property {Function} callbacks.username A function that receives and can transform the entered username before submission
220
- * @property {Function} callbacks.forgotPassword A function that receives and can transform the entered email before submission
221
- * @property {number} digits Number of digits required for second factor or password reset code input
222
- * @property {Object[]} successUrls List of URLs shown after successful login (e.g., home or logout)
223
- * @property {string} successUrls.label Label for the success URL (displayed)
224
- * @property {string} successUrls.url Actual target URL
225
- * @property {number} timeoutForMessage Duration in milliseconds to show error messages
226
- * @property {number} timeoutForSuccess Duration in milliseconds before triggering the post-login success state
227
- * @property {Object} accessKeys Keyboard access keys for accessibility and shortcuts
228
- * @property {string} accessKeys.loginLink Access key for switching to login form
229
- * @property {string} accessKeys.username Access key for focusing the username field
230
- * @property {string} accessKeys.password Access key for focusing the password field
231
- * @property {Object} fetch Definitions for backend requests to support login workflows
232
- * @property {Object} placeholder Placeholder text for input fields
233
- * @property {string} placeholder.username Placeholder for the username field
234
- * @property {string} placeholder.password Placeholder for the password field
235
- * @property {string} placeholder.email Placeholder for the email field
236
- * @property {Object} autocomplete Autocomplete settings for the form fields
237
- * @property {string} autocomplete.username Autocomplete value for the username field
238
- * @property {string} autocomplete.password Autocomplete value for the password field
239
- * @property {string} autocomplete.email Autocomplete value for the email field
240
- * @property {Object} fetch.login Fetch config for login request
241
- * @property {string} fetch.login.url Endpoint to post login credentials to
242
- * @property {string} fetch.login.method HTTP method for login (e.g., "POST")
243
- * @property {string} fetch.login.mode Fetch mode (e.g., "same-origin")
244
- * @property {Object} fetch.login.headers HTTP headers to be sent with the login request
245
- * @property {string} fetch.login.headers.accept Accept header value
246
- * @property {string} fetch.login.headers.Content-Type Content-Type header value
247
- * @property {string} fetch.login.credentials Credential mode (e.g., "same-origin")
248
- * @property {Object} fetch.login.payload Field mappings for form inputs
249
- * @property {string} fetch.login.payload.identifier Name of the identifier field (username/email)
250
- * @property {string} fetch.login.payload.password Name of the password field
251
- * @property {Object} fetch.forgotPassword Fetch config for password reset code request
252
- * @property {string} fetch.forgotPassword.url Endpoint to request a reset link/code
253
- * @property {string} fetch.forgotPassword.method HTTP method
254
- * @property {string} fetch.forgotPassword.mode Fetch mode
255
- * @property {Object} fetch.forgotPassword.headers Headers
256
- * @property {string} fetch.forgotPassword.headers.accept Accept header
257
- * @property {string} fetch.forgotPassword.headers.Content-Type Content-Type header
258
- * @property {string} fetch.forgotPassword.credentials Credential mode
259
- * @property {Object} fetch.digits Fetch config for submitting password reset code
260
- * @property {string} fetch.digits.url Endpoint for validating the code
261
- * @property {string} fetch.digits.method HTTP method
262
- * @property {string} fetch.digits.mode Fetch mode
263
- * @property {Object} fetch.digits.headers Headers
264
- * @property {string} fetch.digits.headers.accept Accept header
265
- * @property {string} fetch.digits.headers.Content-Type Content-Type header
266
- * @property {string} fetch.digits.credentials Credential mode
267
- * @property {Object} fetch.secondFactor Fetch config for submitting second factor code
268
- * @property {string} fetch.secondFactor.url Endpoint to validate second factor code
269
- * @property {string} fetch.secondFactor.method HTTP method
270
- * @property {string} fetch.secondFactor.mode Fetch mode
271
- * @property {Object} fetch.secondFactor.headers Headers
272
- * @property {string} fetch.secondFactor.headers.accept Accept header
273
- * @property {string} fetch.secondFactor.headers.Content-Type Content-Type header
274
- * @property {string} fetch.secondFactor.credentials Credential mode
275
- */
276
- get defaults() {
277
- return Object.assign({}, super.defaults, {
278
- templates: {
279
- main: getTemplate(),
280
- },
281
- labels: getTranslations(),
282
- classes: {
283
- usernameInvalid: "",
284
- passwordInvalid: "",
285
- emailInvalid: "",
286
- button: "monster-button-outline-primary",
287
- },
288
- disabled: false,
289
- features: {
290
- forgotPassword: true,
291
- redirectToFirstSuccessUrl: false,
292
- },
293
- actions: {},
294
-
295
- callbacks: {
296
- username: null,
297
- forgotPassword: null,
298
- },
299
-
300
- digits: 6,
301
-
302
- successUrls: [
303
- {
304
- label: "Home",
305
- url: "/",
306
- },
307
- {
308
- label: "Logout",
309
- url: "/logout",
310
- },
311
- ],
312
-
313
- timeoutForMessage: 3500,
314
- timeoutForSuccess: 1000,
315
-
316
- accessKeys: {
317
- loginLink: "x",
318
- username: "u",
319
- password: "p",
320
- },
321
-
322
- placeholder: {
323
- username: "",
324
- password: "",
325
- email: "",
326
- },
327
-
328
- autocomplete: {
329
- username: "off",
330
- password: "off",
331
- email: "off",
332
- },
333
-
334
- fetch: {
335
- login: {
336
- url: "",
337
- method: "POST",
338
- mode: "same-origin",
339
- headers: {
340
- Accept: "application/json",
341
- "Content-Type": "application/json; charset=utf-8",
342
- },
343
- credentials: "same-origin",
344
-
345
- payload: {
346
- identifier: "identifier",
347
- password: "password",
348
- },
349
- },
350
- forgotPassword: {
351
- url: "",
352
- method: "POST",
353
- mode: "same-origin",
354
- headers: {
355
- Accept: "application/json",
356
- "Content-Type": "application/json; charset=utf-8",
357
- },
358
- credentials: "same-origin",
359
- },
360
- digits: {
361
- url: "",
362
- method: "POST",
363
- mode: "same-origin",
364
- headers: {
365
- Accept: "application/json",
366
- "Content-Type": "application/json; charset=utf-8",
367
- },
368
- credentials: "same-origin",
369
- },
370
- secondFactor: {
371
- url: "",
372
- method: "POST",
373
- mode: "same-origin",
374
- headers: {
375
- Accept: "application/json",
376
- "Content-Type": "application/json; charset=utf-8",
377
- },
378
- credentials: "same-origin",
379
- },
380
- },
381
- });
382
- }
383
-
384
- /**
385
- * Opens the login collapse and focuses the username control.
386
- *
387
- * @returns {Login}
388
- */
389
- openLogin() {
390
- this[loginCollapseSymbol].open();
391
- this.shadowRoot.querySelector("input[name='username']").focus();
392
- return this;
393
- }
394
-
395
- /**
396
- * Opens the forgot password collapse. If the feature `forgotPassword` is not enabled, an error will be thrown.
397
- *
398
- * @returns {Login}
399
- * @throws {Error} If the feature is not enabled
400
- */
401
- openForgotPassword() {
402
- if (!this.getOption("features.forgotPassword")) {
403
- throw new Error("Forgot Password is not enabled");
404
- }
405
-
406
- this[forgotPasswordCollapseSymbol].open();
407
- return this;
408
- }
409
-
410
- /**
411
- * Opens the second factor collapse and focuses the second factor control.
412
- * @returns {Login}
413
- */
414
- openSecondFactor() {
415
- this[secondFactorCollapseSymbol].open();
416
- this.shadowRoot.getElementById("secondFactorButton").focus();
417
- return this;
418
- }
419
-
420
- /**
421
- * Opens the digits collapse and focuses the digit control.
422
- * @returns {Login}
423
- */
424
- openDigits() {
425
- this[digitsCollapseSymbol].open();
426
- this.shadowRoot.getElementById("digitsControl").focus();
427
- return this;
428
- }
429
-
430
- /**
431
- * Opens the logged in collapse. If the feature `redirectToFirstSuccessUrl` is enabled, the user will be redirected to the first success URL.
432
- *
433
- * @returns {Login}
434
- */
435
- openLoggedIn() {
436
- fireEvent(this, "login-success");
437
-
438
- if (this.getOption("features.redirectToFirstSuccessUrl")) {
439
- setTimeout(() => {
440
- fireEvent(this, "redirect-to-first-success-url");
441
-
442
- const successUrl = this.getOption("successUrls");
443
- if (isArray(successUrl) && successUrl.length > 0) {
444
- const success = successUrl[0].url;
445
- if (success) {
446
- getWindow().location.href = success;
447
- }
448
- } else if (isFunction(successUrl)) {
449
- const url = successUrl();
450
- if (url) {
451
- getWindow().location.href = url;
452
- }
453
- } else if (isString(successUrl)) {
454
- getWindow().location.href = successUrl;
455
- } else {
456
- console.warn(
457
- "[Monster Login] No valid success URL found for redirection.",
458
- );
459
- }
460
- }, this.getOption("timeoutForSuccess"));
461
-
462
- return;
463
- }
464
-
465
- this[loggedInCollapseSymbol].open();
466
-
467
- return this;
468
- }
469
-
470
- /**
471
- * @return {string}
472
- */
473
- static getTag() {
474
- return "monster-login";
475
- }
476
-
477
- /**
478
- * @return {CSSStyleSheet[]}
479
- */
480
- static getCSSStyleSheet() {
481
- return [LoginStyleSheet, InvalidStyleSheet];
482
- }
150
+ /**
151
+ * This method is called by the `instanceof` operator.
152
+ * @returns {symbol}
153
+ */
154
+ static get [instanceSymbol]() {
155
+ return Symbol.for("@schukai/monster/components/form/login@@instance");
156
+ }
157
+
158
+ /**
159
+ * @return {void}
160
+ */
161
+ [assembleMethodSymbol]() {
162
+ super[assembleMethodSymbol]();
163
+
164
+ setTimeout(() => {
165
+ initControlReferences.call(this);
166
+ initEventHandler.call(this);
167
+
168
+ setTimeout(() => {
169
+ this.shadowRoot.querySelector("input[name='username']").focus();
170
+ }, 100);
171
+ }, 0);
172
+ }
173
+
174
+ /**
175
+ * To set the options via the HTML Tag, the attribute `data-monster-options` must be used.
176
+ * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
177
+ *
178
+ * The individual configuration values can be found in the table.
179
+ *
180
+ * @property {Object} templates Template definitions
181
+ * @property {string} templates.main The main HTML template used for rendering the login form
182
+ * @property {Object} labels Label definitions used for localization and form messages
183
+ * @property {string} labels.username Label for the username or email field
184
+ * @property {string} labels.password Label for the password field
185
+ * @property {string} labels.login Label for the login button
186
+ * @property {string} labels.forgotPasswordLink Text for the "forgot password" link
187
+ * @property {string} labels.mailAddress Label for the email input in password reset flow
188
+ * @property {string} labels.requestLink Label for the button that sends a password reset code
189
+ * @property {string} labels.digits Label for the digits input field
190
+ * @property {string} labels.loginLink Label for the back-to-login link
191
+ * @property {string} labels.secondFactor Label for the second factor authentication input
192
+ * @property {string} labels.sendDigits Label for the button that submits the digits input
193
+ * @property {string} labels.sendSecondFactorDigits Label for the button that submits the second factor code
194
+ * @property {string} labels.resetLoginProcess Label for the link to return to the login form
195
+ * @property {string} labels.messageEmptyUserName Message shown when username is empty
196
+ * @property {string} labels.messageEmptyPassword Message shown when password is empty
197
+ * @property {string} labels.messageEmptyBoth Message shown when both username and password are empty
198
+ * @property {string} labels.messageEmptyEmail Message shown when email field is empty
199
+ * @property {string} labels.messageInvalidEmail Message shown when an invalid email address is entered
200
+ * @property {string} labels.digitsEmpty Message shown when digits field is empty
201
+ * @property {string} labels.digitsInvalid Message shown when digits input is invalid
202
+ * @property {string} labels.messageLoginFailed Message shown on failed login attempt
203
+ * @property {string} labels.messageForbidden Message shown on successful login with insufficient permissions
204
+ * @property {string} labels.messageSomethingWentWrong Fallback error message
205
+ * @property {string} labels.messageThisFormIsNotConfigured Message shown if no backend URL is configured
206
+ * @property {string} labels.messagePasswordResetDisabled Message shown if password reset is disabled due to 2FA
207
+ * @property {Object} classes Class definitions for visual styling
208
+ * @property {string} classes.usernameInvalid CSS class applied when username is invalid
209
+ * @property {string} classes.passwordInvalid CSS class applied when password is invalid
210
+ * @property {string} classes.emailInvalid CSS class applied when email input is invalid
211
+ * @property {string} classes.button CSS class applied to all form buttons
212
+ * @property {boolean} disabled If true, disables interaction with the component
213
+ * @property {Object} features Feature flags to toggle optional behavior
214
+ * @property {boolean} features.forgotPassword Enables the forgot password flow
215
+ * @property {boolean} features.redirectToFirstSuccessUrl If true, redirects to the first success URL after login
216
+ * @property {Object} actions Action definitions for custom event handling
217
+ * @property {Function} actions.click Callback function for generic click actions within the login component
218
+ * @property {Object} callbacks Optional callback hooks for modifying internal behavior
219
+ * @property {Function} callbacks.username A function that receives and can transform the entered username before submission
220
+ * @property {Function} callbacks.forgotPassword A function that receives and can transform the entered email before submission
221
+ * @property {number} digits Number of digits required for second factor or password reset code input
222
+ * @property {Object[]} successUrls List of URLs shown after successful login (e.g., home or logout)
223
+ * @property {string} successUrls.label Label for the success URL (displayed)
224
+ * @property {string} successUrls.url Actual target URL
225
+ * @property {number} timeoutForMessage Duration in milliseconds to show error messages
226
+ * @property {number} timeoutForSuccess Duration in milliseconds before triggering the post-login success state
227
+ * @property {Object} accessKeys Keyboard access keys for accessibility and shortcuts
228
+ * @property {string} accessKeys.loginLink Access key for switching to login form
229
+ * @property {string} accessKeys.username Access key for focusing the username field
230
+ * @property {string} accessKeys.password Access key for focusing the password field
231
+ * @property {Object} fetch Definitions for backend requests to support login workflows
232
+ * @property {Object} placeholder Placeholder text for input fields
233
+ * @property {string} placeholder.username Placeholder for the username field
234
+ * @property {string} placeholder.password Placeholder for the password field
235
+ * @property {string} placeholder.email Placeholder for the email field
236
+ * @property {Object} autocomplete Autocomplete settings for the form fields
237
+ * @property {string} autocomplete.username Autocomplete value for the username field
238
+ * @property {string} autocomplete.password Autocomplete value for the password field
239
+ * @property {string} autocomplete.email Autocomplete value for the email field
240
+ * @property {Object} fetch.login Fetch config for login request
241
+ * @property {string} fetch.login.url Endpoint to post login credentials to
242
+ * @property {string} fetch.login.method HTTP method for login (e.g., "POST")
243
+ * @property {string} fetch.login.mode Fetch mode (e.g., "same-origin")
244
+ * @property {Object} fetch.login.headers HTTP headers to be sent with the login request
245
+ * @property {string} fetch.login.headers.accept Accept header value
246
+ * @property {string} fetch.login.headers.Content-Type Content-Type header value
247
+ * @property {string} fetch.login.credentials Credential mode (e.g., "same-origin")
248
+ * @property {Object} fetch.login.payload Field mappings for form inputs
249
+ * @property {string} fetch.login.payload.identifier Name of the identifier field (username/email)
250
+ * @property {string} fetch.login.payload.password Name of the password field
251
+ * @property {Object} fetch.forgotPassword Fetch config for password reset code request
252
+ * @property {string} fetch.forgotPassword.url Endpoint to request a reset link/code
253
+ * @property {string} fetch.forgotPassword.method HTTP method
254
+ * @property {string} fetch.forgotPassword.mode Fetch mode
255
+ * @property {Object} fetch.forgotPassword.headers Headers
256
+ * @property {string} fetch.forgotPassword.headers.accept Accept header
257
+ * @property {string} fetch.forgotPassword.headers.Content-Type Content-Type header
258
+ * @property {string} fetch.forgotPassword.credentials Credential mode
259
+ * @property {Object} fetch.digits Fetch config for submitting password reset code
260
+ * @property {string} fetch.digits.url Endpoint for validating the code
261
+ * @property {string} fetch.digits.method HTTP method
262
+ * @property {string} fetch.digits.mode Fetch mode
263
+ * @property {Object} fetch.digits.headers Headers
264
+ * @property {string} fetch.digits.headers.accept Accept header
265
+ * @property {string} fetch.digits.headers.Content-Type Content-Type header
266
+ * @property {string} fetch.digits.credentials Credential mode
267
+ * @property {Object} fetch.secondFactor Fetch config for submitting second factor code
268
+ * @property {string} fetch.secondFactor.url Endpoint to validate second factor code
269
+ * @property {string} fetch.secondFactor.method HTTP method
270
+ * @property {string} fetch.secondFactor.mode Fetch mode
271
+ * @property {Object} fetch.secondFactor.headers Headers
272
+ * @property {string} fetch.secondFactor.headers.accept Accept header
273
+ * @property {string} fetch.secondFactor.headers.Content-Type Content-Type header
274
+ * @property {string} fetch.secondFactor.credentials Credential mode
275
+ */
276
+ get defaults() {
277
+ return Object.assign({}, super.defaults, {
278
+ templates: {
279
+ main: getTemplate(),
280
+ },
281
+ labels: getTranslations(),
282
+ classes: {
283
+ usernameInvalid: "",
284
+ passwordInvalid: "",
285
+ emailInvalid: "",
286
+ button: "monster-button-outline-primary",
287
+ },
288
+ disabled: false,
289
+ features: {
290
+ forgotPassword: true,
291
+ redirectToFirstSuccessUrl: false,
292
+ },
293
+ actions: {},
294
+
295
+ callbacks: {
296
+ username: null,
297
+ forgotPassword: null,
298
+ },
299
+
300
+ digits: 6,
301
+
302
+ successUrls: [
303
+ {
304
+ label: "Home",
305
+ url: "/",
306
+ },
307
+ {
308
+ label: "Logout",
309
+ url: "/logout",
310
+ },
311
+ ],
312
+
313
+ timeoutForMessage: 3500,
314
+ timeoutForSuccess: 1000,
315
+
316
+ accessKeys: {
317
+ loginLink: "x",
318
+ username: "u",
319
+ password: "p",
320
+ },
321
+
322
+ placeholder: {
323
+ username: "",
324
+ password: "",
325
+ email: "",
326
+ },
327
+
328
+ autocomplete: {
329
+ username: "off",
330
+ password: "off",
331
+ email: "off",
332
+ },
333
+
334
+ fetch: {
335
+ login: {
336
+ url: "",
337
+ method: "POST",
338
+ mode: "same-origin",
339
+ headers: {
340
+ Accept: "application/json",
341
+ "Content-Type": "application/json; charset=utf-8",
342
+ },
343
+ credentials: "same-origin",
344
+
345
+ payload: {
346
+ identifier: "identifier",
347
+ password: "password",
348
+ },
349
+ },
350
+ forgotPassword: {
351
+ url: "",
352
+ method: "POST",
353
+ mode: "same-origin",
354
+ headers: {
355
+ Accept: "application/json",
356
+ "Content-Type": "application/json; charset=utf-8",
357
+ },
358
+ credentials: "same-origin",
359
+ },
360
+ digits: {
361
+ url: "",
362
+ method: "POST",
363
+ mode: "same-origin",
364
+ headers: {
365
+ Accept: "application/json",
366
+ "Content-Type": "application/json; charset=utf-8",
367
+ },
368
+ credentials: "same-origin",
369
+ },
370
+ secondFactor: {
371
+ url: "",
372
+ method: "POST",
373
+ mode: "same-origin",
374
+ headers: {
375
+ Accept: "application/json",
376
+ "Content-Type": "application/json; charset=utf-8",
377
+ },
378
+ credentials: "same-origin",
379
+ },
380
+ },
381
+ });
382
+ }
383
+
384
+ /**
385
+ * Opens the login collapse and focuses the username control.
386
+ *
387
+ * @returns {Login}
388
+ */
389
+ openLogin() {
390
+ this[loginCollapseSymbol].open();
391
+ this.shadowRoot.querySelector("input[name='username']").focus();
392
+ return this;
393
+ }
394
+
395
+ /**
396
+ * Opens the forgot password collapse. If the feature `forgotPassword` is not enabled, an error will be thrown.
397
+ *
398
+ * @returns {Login}
399
+ * @throws {Error} If the feature is not enabled
400
+ */
401
+ openForgotPassword() {
402
+ if (!this.getOption("features.forgotPassword")) {
403
+ throw new Error("Forgot Password is not enabled");
404
+ }
405
+
406
+ this[forgotPasswordCollapseSymbol].open();
407
+ return this;
408
+ }
409
+
410
+ /**
411
+ * Opens the second factor collapse and focuses the second factor control.
412
+ * @returns {Login}
413
+ */
414
+ openSecondFactor() {
415
+ this[secondFactorCollapseSymbol].open();
416
+ this.shadowRoot.getElementById("secondFactorButton").focus();
417
+ return this;
418
+ }
419
+
420
+ /**
421
+ * Opens the digits collapse and focuses the digit control.
422
+ * @returns {Login}
423
+ */
424
+ openDigits() {
425
+ this[digitsCollapseSymbol].open();
426
+ this.shadowRoot.getElementById("digitsControl").focus();
427
+ return this;
428
+ }
429
+
430
+ /**
431
+ * Opens the logged in collapse. If the feature `redirectToFirstSuccessUrl` is enabled, the user will be redirected to the first success URL.
432
+ *
433
+ * @returns {Login}
434
+ */
435
+ openLoggedIn() {
436
+ fireEvent(this, "login-success");
437
+
438
+ if (this.getOption("features.redirectToFirstSuccessUrl")) {
439
+ setTimeout(() => {
440
+ fireEvent(this, "redirect-to-first-success-url");
441
+
442
+ const successUrl = this.getOption("successUrls");
443
+ if (isArray(successUrl) && successUrl.length > 0) {
444
+ const success = successUrl[0].url;
445
+ if (success) {
446
+ getWindow().location.href = success;
447
+ }
448
+ } else if (isFunction(successUrl)) {
449
+ const url = successUrl();
450
+ if (url) {
451
+ getWindow().location.href = url;
452
+ }
453
+ } else if (isString(successUrl)) {
454
+ getWindow().location.href = successUrl;
455
+ } else {
456
+ console.warn(
457
+ "[Monster Login] No valid success URL found for redirection.",
458
+ );
459
+ }
460
+ }, this.getOption("timeoutForSuccess"));
461
+
462
+ return;
463
+ }
464
+
465
+ this[loggedInCollapseSymbol].open();
466
+
467
+ return this;
468
+ }
469
+
470
+ /**
471
+ * @return {string}
472
+ */
473
+ static getTag() {
474
+ return "monster-login";
475
+ }
476
+
477
+ /**
478
+ * @return {CSSStyleSheet[]}
479
+ */
480
+ static getCSSStyleSheet() {
481
+ return [LoginStyleSheet, InvalidStyleSheet];
482
+ }
483
483
  }
484
484
 
485
485
  function getTranslations() {
486
- const locale = getLocaleOfDocument();
487
- switch (locale.language) {
488
- case "de":
489
- return {
490
- username: "Benutzername oder E-Mail",
491
- password: "Passwort",
492
- login: "Anmelden",
493
- forgotPasswordLink: "Passwort vergessen?",
494
- mailAddress: "E-Mail-Adresse",
495
- requestLink: "Code anfordern",
496
- digits: "Code",
497
- loginLink: "Anmelden",
498
- secondFactor: "Zweiter Faktor Code",
499
- sendDigits: "Code senden",
500
- sendSecondFactorDigits: "Code senden",
501
- resetLoginProcess: "Zurück zum Login",
502
- messageEmptyUserName: "Bitte geben Sie Ihren Benutzernamen ein",
503
- messageEmptyPassword: "Bitte geben Sie Ihr Passwort ein",
504
- messageEmptyBoth:
505
- "Bitte geben Sie Ihren Benutzernamen und Ihr Passwort ein",
506
- messageEmptyEmail: "Bitte geben Sie Ihre E-Mail-Adresse ein",
507
- messageInvalidEmail: "Bitte geben Sie eine gültige E-Mail-Adresse ein",
508
- digitsEmpty: "Bitte geben Sie Ihren Code ein",
509
- digitsInvalid: "Bitte geben Sie einen gültigen Code ein",
510
- messageLoginFailed:
511
- "Anmeldung fehlgeschlagen, bitte überprüfen Sie Ihre Eingaben.",
512
- messageForbidden:
513
- "Die Anmeldung war erfolgreich, aber Sie haben keine Berechtigung. Sie können sich <b>nicht</b> anmelden.<br>Sie können einen anderen Benutzer auswählen oder sich an den Administrator wenden.",
514
- messageSomethingWentWrong:
515
- "Etwas ist schief gelaufen, bitte versuchen Sie es später erneut",
516
- messageThisFormIsNotConfigured:
517
- "Dieses Formular ist nicht konfiguriert.",
518
- messagePasswordResetDisabled:
519
- "Sie können keinen Code anfordern, da die<br>Zwei-Faktor-Authentifizierung bei Ihrem Konto aktiviert ist.<br>Bitte kontaktieren Sie den Administrator.",
520
- };
521
- case "es":
522
- return {
523
- username: "Nombre de usuario o correo electrónico",
524
- password: "Contraseña",
525
- login: "Iniciar sesión",
526
- forgotPasswordLink: "¿Olvidaste tu contraseña?",
527
- mailAddress: "Dirección de correo electrónico",
528
- requestLink: "Solicitar enlace",
529
- digits: "Código",
530
- loginLink: "Iniciar sesión",
531
- secondFactor: "Código de segundo factor",
532
- sendDigits: "Enviar código",
533
- sendSecondFactorDigits: "Enviar código",
534
- resetLoginProcess: "Volver al inicio de sesión",
535
- messageEmptyUserName: "Por favor ingrese su nombre de usuario",
536
- messageEmptyPassword: "Por favor ingrese su contraseña",
537
- messageEmptyBoth: "Por favor ingrese su nombre de usuario y contraseña",
538
- messageEmptyEmail:
539
- "Por favor ingrese su dirección de correo electrónico",
540
- messageInvalidEmail:
541
- "Por favor ingrese una dirección de correo electrónico válida",
542
- digitsEmpty: "Por favor ingrese su código",
543
- digitsInvalid: "Por favor ingrese un código válido",
544
- messageLoginFailed:
545
- "Error al iniciar sesión, por favor verifique sus datos.",
546
- messageForbidden:
547
- "El inicio de sesión fue exitoso, pero no tienes permisos. <b>No puedes</b> iniciar sesión.<br>Puedes seleccionar otro usuario o contactar al administrador.",
548
- messageSomethingWentWrong:
549
- "Algo salió mal, por favor intenta de nuevo más tarde.",
550
- messageThisFormIsNotConfigured: "Este formulario no está configurado.",
551
- messagePasswordResetDisabled:
552
- "Esta función no funciona porque la autenticación de dos factores está activada en su cuenta. Por favor, póngase en contacto con el administrador.",
553
- };
554
- case "zh":
555
- return {
556
- username: "用户名或电子邮箱",
557
- password: "密码",
558
- login: "登录",
559
- forgotPasswordLink: "忘记密码?",
560
- mailAddress: "电子邮件地址",
561
- requestLink: "请求链接",
562
- digits: "验证码",
563
- loginLink: "登录",
564
- secondFactor: "二次验证码",
565
- sendDigits: "发送验证码",
566
- sendSecondFactorDigits: "发送验证码",
567
- resetLoginProcess: "返回登录",
568
- messageEmptyUserName: "请输入用户名",
569
- messageEmptyPassword: "请输入密码",
570
- messageEmptyBoth: "请输入用户名和密码",
571
- messageEmptyEmail: "请输入电子邮件地址",
572
- messageInvalidEmail: "请输入有效的电子邮件地址",
573
- digitsEmpty: "请输入验证码",
574
- digitsInvalid: "请输入有效的验证码",
575
- messageLoginFailed: "登录失败,请检查您的输入。",
576
- messageForbidden:
577
- "登录成功,但您没有权限。您<b>不能</b>登录。<br>您可以选择其他用户或联系管理员。",
578
- messageSomethingWentWrong: "出了点问题,请稍后再试。",
579
- messageThisFormIsNotConfigured: "此表单尚未配置。",
580
- messagePasswordResetDisabled:
581
- "此功能无法使用,因为您的帐户启用了二因素身份验证。请联系管理员。",
582
- };
583
-
584
- case "hi":
585
- return {
586
- username: "उपयगकर नम य ई-मल",
587
- password: "पसवर",
588
- login: "लग इन कर",
589
- forgotPasswordLink: "पसवर भल गए?",
590
- mailAddress: "ई-मल पत",
591
- requestLink: "लक क अनरध कर",
592
- digits: "कड",
593
- loginLink: "लग इन कर",
594
- secondFactor: "दसर फकर कड",
595
- sendDigits: "कड भज",
596
- sendSecondFactorDigits: "कड भज",
597
- resetLoginProcess: "लगन पर वपस जए",
598
- messageEmptyUserName: "कपय अपन उपयगकर नम दर कर",
599
- messageEmptyPassword: "कपय अपन पसवर दर कर",
600
- messageEmptyBoth: "कपय अपन उपयगकर नम और पसवर दर कर",
601
- messageEmptyEmail: "कपय अपन ई-मल पत दर कर",
602
- messageInvalidEmail: "कपय एक वध ई-मल पत दर कर",
603
- digitsEmpty: "कपय अपन कड दर कर",
604
- digitsInvalid: "कपय एक वध कड दर कर",
605
- messageLoginFailed: "लगन वफल हआ, कपय अपन जनकर क जच कर।",
606
- messageForbidden:
607
- "लगन सफल रह लकन आपक पस अनमत नह ह। आप <b>लगन नह</b> कर सकत।<br>आप दसर उपयगकर चन सकत ह य पशसक स सपर कर सकत ह।",
608
- messageSomethingWentWrong: "कछ गलत हआ, कपय बद म पन पयस कर।",
609
- messageThisFormIsNotConfigured: "यह फर कनगर नह ह।",
610
- messagePasswordResetDisabled:
611
- "यह सवध कम नह करत कक आपक खत म द घटक पमणकरण सकम ह। कपय पशसक स सपर कर।",
612
- };
613
-
614
- case "bn":
615
- return {
616
- username: "ইউজরনম ব ই-মইল",
617
- password: "পসওযর",
618
- login: "লগইন করন",
619
- forgotPasswordLink: "পসওযর ভল গছন?",
620
- mailAddress: "ই-মইল ঠকন",
621
- requestLink: "লক অনরধ করন",
622
- digits: "কড",
623
- loginLink: "লগইন করন",
624
- secondFactor: "দতয ফকর কড",
625
- sendDigits: "কড পঠন",
626
- sendSecondFactorDigits: "কড পঠন",
627
- resetLoginProcess: "লগইন ফর যন",
628
- messageEmptyUserName: "দয কর আপনর ইউজরনম লখন",
629
- messageEmptyPassword: "দয কর আপনর পসওযর লখন",
630
- messageEmptyBoth: "দয কর আপনর ইউজরনম এব পসওযর লখন",
631
- messageEmptyEmail: "দয কর আপনর ই-মইল ঠকন লখন",
632
- messageInvalidEmail: "দয কর একট বধ ই-মইল ঠকন লখন",
633
- digitsEmpty: "দয কর আপনর কড লখন",
634
- digitsInvalid: "দয কর একট বধ কড লখন",
635
- messageLoginFailed: "লগইন বর হযছ, দয কর আপনর ইনপট পরক করন।",
636
- messageForbidden:
637
- "লগইন সফল হযছ, কন আপনর অনমত নই। আপন <b>লগইন করত পরবন ন</b>।<br>আপন অন ইউজর নরচন করত পরন অথব অযডমনসটরর সথ যগযগ করত পরন।",
638
- messageSomethingWentWrong: "কছ ভল হযছ, দয কর পর আবর চষ করন।",
639
- messageThisFormIsNotConfigured: "এই ফরট কনফগর কর হযন।",
640
- messagePasswordResetDisabled:
641
- "এই ফশনট করকর নয করণ আপনর অযকউন দট ফকর পমণকরণ সকয কর আছ। দয কর পশসকর সথ যগযগ করন।",
642
- };
643
-
644
- case "pt": // Portuguese
645
- return {
646
- username: "Nome de usuário ou e-mail",
647
- password: "Senha",
648
- login: "Entrar",
649
- forgotPasswordLink: "Esqueceu a senha?",
650
- mailAddress: "Endereço de e-mail",
651
- requestLink: "Solicitar link",
652
- digits: "Código",
653
- loginLink: "Entrar",
654
- secondFactor: "Código do segundo fator",
655
- sendDigits: "Enviar código",
656
- sendSecondFactorDigits: "Enviar código",
657
- resetLoginProcess: "Voltar ao login",
658
- messageEmptyUserName: "Por favor, insira seu nome de usuário",
659
- messageEmptyPassword: "Por favor, insira sua senha",
660
- messageEmptyBoth: "Por favor, insira seu nome de usuário e senha",
661
- messageEmptyEmail: "Por favor, insira seu endereço de e-mail",
662
- messageInvalidEmail: "Por favor, insira um endereço de e-mail válido",
663
- digitsEmpty: "Por favor, insira seu código",
664
- digitsInvalid: "Por favor, insira um código válido",
665
- messageLoginFailed: "Falha no login, verifique suas informações.",
666
- messageForbidden:
667
- "Login foi bem-sucedido, mas você não tem permissão. Você <b>não pode</b> entrar.<br>Você pode escolher outro usuário ou entrar em contato com o administrador.",
668
- messageSomethingWentWrong:
669
- "Algo deu errado, tente novamente mais tarde.",
670
- messageThisFormIsNotConfigured: "Este formulário não está configurado.",
671
- messagePasswordResetDisabled:
672
- "Esta função não funciona porque a autenticação de dois fatores<br>está ativada em sua conta. Por favor, entre em contato com o administrador.",
673
- };
674
-
675
- case "ru": // Russian
676
- return {
677
- username: "Имя пользователя или электронная почта",
678
- password: "Пароль",
679
- login: "Войти",
680
- forgotPasswordLink: "Забыли пароль?",
681
- mailAddress: "Адрес электронной почты",
682
- requestLink: "Запросить ссылку",
683
- digits: "Код",
684
- loginLink: "Войти",
685
- secondFactor: "Код второго фактора",
686
- sendDigits: "Отправить код",
687
- sendSecondFactorDigits: "Отправить код",
688
- resetLoginProcess: "Вернуться к входу",
689
- messageEmptyUserName: "Пожалуйста, введите имя пользователя",
690
- messageEmptyPassword: "Пожалуйста, введите пароль",
691
- messageEmptyBoth: "Пожалуйста, введите имя пользователя и пароль",
692
- messageEmptyEmail: "Пожалуйста, введите адрес электронной почты",
693
- messageInvalidEmail:
694
- "Пожалуйста, введите действительный адрес электронной почты",
695
- digitsEmpty: "Пожалуйста, введите код",
696
- digitsInvalid: "Пожалуйста, введите действительный код",
697
- messageLoginFailed: "Ошибка входа, проверьте введенные данные.",
698
- messageForbidden:
699
- "Вход выполнен, но у вас нет прав. Вы <b>не можете</b> войти.<br>Вы можете выбрать другого пользователя или связаться с администратором.",
700
- messageSomethingWentWrong: "Что-то пошло не так, попробуйте позже.",
701
- messageThisFormIsNotConfigured: "Эта форма не настроена.",
702
- messagePasswordResetDisabled:
703
- "Эта функция не работает, потому что двухфакторная аутентификация<br> включена в вашей учетной записи. Пожалуйста, свяжитесь с администратором.",
704
- };
705
-
706
- case "ja": // Japanese
707
- return {
708
- username: "ユーザー名またはメールアドレス",
709
- password: "パスワード",
710
- login: "ログイン",
711
- forgotPasswordLink: "パスワードを忘れましたか?",
712
- mailAddress: "メールアドレス",
713
- requestLink: "リンクをリクエスト",
714
- digits: "コード",
715
- loginLink: "ログイン",
716
- secondFactor: "二要素コード",
717
- sendDigits: "コードを送信",
718
- sendSecondFactorDigits: "コードを送信",
719
- resetLoginProcess: "ログインに戻る",
720
- messageEmptyUserName: "ユーザー名を入力してください",
721
- messageEmptyPassword: "パスワードを入力してください",
722
- messageEmptyBoth: "ユーザー名とパスワードを入力してください",
723
- messageEmptyEmail: "メールアドレスを入力してください",
724
- messageInvalidEmail: "有効なメールアドレスを入力してください",
725
- digitsEmpty: "コードを入力してください",
726
- digitsInvalid: "有効なコードを入力してください",
727
- messageLoginFailed:
728
- "ログインに失敗しました。入力内容をご確認ください。",
729
- messageForbidden:
730
- "ログイン成功しましたが、権限がありません。<b>ログインできません</b>。<br>他のユーザーを選択するか、管理者に連絡してください。",
731
- messageSomethingWentWrong:
732
- "問題が発生しました。後でもう一度お試しください。",
733
- messageThisFormIsNotConfigured: "このフォームは設定されていません。",
734
- messagePasswordResetDisabled:
735
- "この機能は使用できません。アカウントで二要素認証が有効になっているため、管理者に連絡してください。",
736
- };
737
-
738
- case "pa": // Western Punjabi
739
- return {
740
- username: "ਵਰਤਕਰ ਨਮ ਜ ਈ-ਮਲ",
741
- password: "ਪਸਵਰਡ",
742
- login: "ਲਗਨ ਕਰ",
743
- forgotPasswordLink: "ਪਸਵਰਡ ਭਲ ਗਏ?",
744
- mailAddress: "ਈ-ਮਲ ਪਤ",
745
- requestLink: "ਲਕ ਦ ਬਨਤ ਕਰ",
746
- digits: "ਕਡ",
747
- loginLink: "ਲਗਨ ਕਰ",
748
- secondFactor: "ਦਜ ਫਕਟਰ ਕਡ",
749
- sendDigits: "ਕਡ ਭਜ",
750
- sendSecondFactorDigits: "ਕਡ ਭਜ",
751
- resetLoginProcess: "ਲਗਨ 'ਤ ਵਪਸ ਜਓ",
752
- messageEmptyUserName: "ਕਰਪ ਕਰਕ ਆਪਣ ਵਰਤਕਰ ਨਮ ਦਰਜ ਕਰ",
753
- messageEmptyPassword: "ਕਰਪ ਕਰਕ ਆਪਣ ਪਸਵਰਡ ਦਰਜ ਕਰ",
754
- messageEmptyBoth: "ਕਰਪ ਕਰਕ ਆਪਣ ਵਰਤਕਰ ਨਮ ਤ ਪਸਵਰਡ ਦਰਜ ਕਰ",
755
- messageEmptyEmail: "ਕਰਪ ਕਰਕ ਆਪਣ ਈ-ਮਲ ਪਤ ਦਰਜ ਕਰ",
756
- messageInvalidEmail: "ਕਰਪ ਕਰਕ ਇਕ ਵਧ ਈ-ਮਲ ਪਤ ਦਰਜ ਕਰ",
757
- digitsEmpty: "ਕਰਪ ਕਰਕ ਆਪਣ ਕਡ ਦਰਜ ਕਰ",
758
- digitsInvalid: "ਕਰਪ ਕਰਕ ਇਕ ਵਧ ਕਡ ਦਰਜ ਕਰ",
759
- messageLoginFailed: "ਲਗਨ ਅਸਫਲ ਹਇਆ, ਕਰਪ ਕਰਕ ਆਪਣ ਜਣਕਰ ਦ ਜਚ ਕਰ।",
760
- messageForbidden:
761
- "ਲਗਨ ਸਫਲ ਹਇਆ, ਪਰ ਤਹਡ ਕਲ ਅਧਕਰ ਨਹ ਹਨ। ਤਸ <b>ਲਗਨ ਨਹ</b> ਕਰ ਸਕਦ।<br>ਤਸ ਹਰ ਵਰਤਕਰ ਚਣ सकत ਹ ਜ ਪਰਬਧਕ ਨਲ ਸਪਰਕ ਕਰ ਸਕਦ ਹ।",
762
- messageSomethingWentWrong: "ਕਝ ਗਲਤ ਹ ਗਆ, ਕਰਪ ਕਰਕ ਬਅਦ ਵਚ ਮੜ ਕਸਸ ਕਰ।",
763
- messageThisFormIsNotConfigured: "ਇਸ ਫਰਮ ਨ ਸਰਚਤ ਨਹ ਕਤ ਗਆ ਹ।",
764
- messagePasswordResetDisabled:
765
- "ਇਹ ਫਕਸਨ ਕਮ ਨਹ ਕਰਦ ਕਉਕ ਤਹਡ ਖਤ ਵਚ ਦ ਫਕਟਰ ਪਰਮਣਕਰਣ ਸਰਗਰਮ ਹ। ਕਰਪ ਕਰਕ ਪਰਬਧਕ ਨਲ ਸਪਰਕ ਕਰ।",
766
- };
767
-
768
- case "mr": // Marathi
769
- return {
770
- username: "वपरकरनव कव ईमल",
771
- password: "सकतशब",
772
- login: "पवश कर",
773
- forgotPasswordLink: "सकतशब वसरलत क?",
774
- mailAddress: "ईमल पत",
775
- requestLink: "लकच वनत कर",
776
- digits: "कड",
777
- loginLink: "पवश कर",
778
- secondFactor: "दसर घटक कड",
779
- sendDigits: "कड पठव",
780
- sendSecondFactorDigits: "कड पठव",
781
- resetLoginProcess: "पवशवर परत ज",
782
- messageEmptyUserName: "कपय आपल वपरकरनव पवष कर",
783
- messageEmptyPassword: "कपय आपल सकतशब पवष कर",
784
- messageEmptyBoth: "कपय आपल वपरकरनव आण सकतशब पवष कर",
785
- messageEmptyEmail: "कपय आपल ईमल पत पवष कर",
786
- messageInvalidEmail: "कपय वध ईमल पत पवष कर",
787
- digitsEmpty: "कपय आपल कड पवष कर",
788
- digitsInvalid: "कपय वध कड पवष कर",
789
- messageLoginFailed: "पवश अयशस, कपय आपल महत तपस.",
790
- messageForbidden:
791
- "पवश यशस झल, परत आपलकड परवन नह. आपण <b>पवश कर शकत नह</b>.<br>आपण दसर वपरकर नवड शकत कव ववसपकश सपर सध शकत.",
792
- messageSomethingWentWrong: "कहतर चकल, कपय नतर पन पयत कर.",
793
- messageThisFormIsNotConfigured: "ह फर सरचत कलल नह.",
794
- messagePasswordResetDisabled:
795
- "य करच कमगर करत नह करण आपल खतत दन घटक पमणकरण सकय कल आह. कपय ववसपकश सपर सध.",
796
- };
797
-
798
- case "fr": // French
799
- return {
800
- username: "Nom d'utilisateur ou e-mail",
801
- password: "Mot de passe",
802
- login: "Connexion",
803
- forgotPasswordLink: "Mot de passe oublié ?",
804
- mailAddress: "Adresse e-mail",
805
- requestLink: "Demander un lien",
806
- digits: "Code",
807
- loginLink: "Connexion",
808
- secondFactor: "Code du deuxième facteur",
809
- sendDigits: "Envoyer le code",
810
- sendSecondFactorDigits: "Envoyer le code",
811
- resetLoginProcess: "Retour à la connexion",
812
- messageEmptyUserName: "Veuillez entrer votre nom d'utilisateur",
813
- messageEmptyPassword: "Veuillez entrer votre mot de passe",
814
- messageEmptyBoth:
815
- "Veuillez entrer votre nom d'utilisateur et votre mot de passe",
816
- messageEmptyEmail: "Veuillez entrer votre adresse e-mail",
817
- messageInvalidEmail: "Veuillez entrer une adresse e-mail valide",
818
- digitsEmpty: "Veuillez entrer votre code",
819
- digitsInvalid: "Veuillez entrer un code valide",
820
- messageLoginFailed:
821
- "Échec de la connexion, veuillez vérifier vos informations.",
822
- messageForbidden:
823
- "La connexion a réussi, mais vous n'avez pas les permissions. Vous <b>ne pouvez pas</b> vous connecter.<br>Vous pouvez choisir un autre utilisateur ou contacter l'administrateur.",
824
- messageSomethingWentWrong:
825
- "Une erreur s'est produite, veuillez réessayer plus tard.",
826
- messageThisFormIsNotConfigured: "Ce formulaire n'est pas configuré.",
827
- messagePasswordResetDisabled:
828
- "Cette fonctionnalité ne fonctionne pas car l'authentification à deux facteurs est activée sur<br>votre compte. Veuillez contacter l'administrateur.",
829
- };
830
-
831
- case "it": // Italian
832
- return {
833
- username: "Nome utente o e-mail",
834
- password: "Password",
835
- login: "Accedi",
836
- forgotPasswordLink: "Password dimenticata?",
837
- mailAddress: "Indirizzo e-mail",
838
- requestLink: "Richiedi link",
839
- digits: "Codice",
840
- loginLink: "Accedi",
841
- secondFactor: "Codice a due fattori",
842
- sendDigits: "Invia codice",
843
- sendSecondFactorDigits: "Invia codice",
844
- resetLoginProcess: "Torna al login",
845
- messageEmptyUserName: "Per favore, inserisci il tuo nome utente",
846
- messageEmptyPassword: "Per favore, inserisci la tua password",
847
- messageEmptyBoth:
848
- "Per favore, inserisci il tuo nome utente e la tua password",
849
- messageEmptyEmail: "Per favore, inserisci il tuo indirizzo e-mail",
850
- messageInvalidEmail: "Per favore, inserisci un indirizzo e-mail valido",
851
- digitsEmpty: "Per favore, inserisci il tuo codice",
852
- digitsInvalid: "Per favore, inserisci un codice valido",
853
- messageLoginFailed: "Accesso fallito, verifica i tuoi dati.",
854
- messageForbidden:
855
- "Accesso riuscito, ma non hai i permessi. Non puoi accedere.<br>Puoi scegliere un altro account o contattare l'amministratore.",
856
- messageSomethingWentWrong:
857
- "Qualcosa è andato storto, riprova più tardi.",
858
- messageThisFormIsNotConfigured: "Questo modulo non è configurato.",
859
- messagePasswordResetDisabled:
860
- "Questa funzione non funziona perché l'autenticazione a due<br>fattori è attiva sul tuo account. Contatta l'amministratore.",
861
- };
862
-
863
- case "nl": // Dutch
864
- return {
865
- username: "Gebruikersnaam of e-mail",
866
- password: "Wachtwoord",
867
- login: "Inloggen",
868
- forgotPasswordLink: "Wachtwoord vergeten?",
869
- mailAddress: "E-mailadres",
870
- requestLink: "Link aanvragen",
871
- digits: "Code",
872
- loginLink: "Inloggen",
873
- secondFactor: "Tweede factor code",
874
- sendDigits: "Code verzenden",
875
- sendSecondFactorDigits: "Code verzenden",
876
- resetLoginProcess: "Terug naar inloggen",
877
- messageEmptyUserName: "Voer uw gebruikersnaam in",
878
- messageEmptyPassword: "Voer uw wachtwoord in",
879
- messageEmptyBoth: "Voer uw gebruikersnaam en wachtwoord in",
880
- messageEmptyEmail: "Voer uw e-mailadres in",
881
- messageInvalidEmail: "Voer een geldig e-mailadres in",
882
- digitsEmpty: "Voer uw code in",
883
- digitsInvalid: "Voer een geldige code in",
884
- messageLoginFailed: "Inloggen mislukt, controleer uw gegevens.",
885
- messageForbidden:
886
- "Inloggen geslaagd, maar u heeft geen permissies. U <b>kunt niet</b> inloggen.<br>U kunt een andere gebruiker selecteren of de beheerder contacteren.",
887
- messageSomethingWentWrong:
888
- "Er is iets fout gegaan, probeer het later opnieuw.",
889
- messageThisFormIsNotConfigured: "Dit formulier is niet geconfigureerd.",
890
- messagePasswordResetDisabled:
891
- "Deze functie werkt niet omdat tweefactorauthenticatie is<br>ingeschakeld op uw account. Neem contact op met de beheerder.",
892
- };
893
-
894
- case "sv": // Swedish
895
- return {
896
- username: "Användarnamn eller e-post",
897
- password: "Lösenord",
898
- login: "Logga in",
899
- forgotPasswordLink: "Glömt lösenord?",
900
- mailAddress: "E-postadress",
901
- requestLink: "Begär länk",
902
- digits: "Kod",
903
- loginLink: "Logga in",
904
- secondFactor: "Tvåfaktorkod",
905
- sendDigits: "Skicka kod",
906
- sendSecondFactorDigits: "Skicka kod",
907
- resetLoginProcess: "Tillbaka till inloggning",
908
- messageEmptyUserName: "Ange ditt användarnamn",
909
- messageEmptyPassword: "Ange ditt lösenord",
910
- messageEmptyBoth: "Ange ditt användarnamn och lösenord",
911
- messageEmptyEmail: "Ange din e-postadress",
912
- messageInvalidEmail: "Ange en giltig e-postadress",
913
- digitsEmpty: "Ange din kod",
914
- digitsInvalid: "Ange en giltig kod",
915
- messageLoginFailed:
916
- "Inloggning misslyckades, kontrollera dina uppgifter.",
917
- messageForbidden:
918
- "Inloggningen lyckades, men du har inte behörighet. Du <b>kan inte</b> logga in.<br>Du kan välja en annan användare eller kontakta administratören.",
919
- messageSomethingWentWrong: "Något gick fel, försök igen senare.",
920
- messageThisFormIsNotConfigured: "Detta formulär är inte konfigurerat.",
921
- messagePasswordResetDisabled:
922
- "Denna funktion fungerar inte eftersom tvåfaktorsautentisering är aktiverad på ditt konto. Kontakta administratören.",
923
- };
924
-
925
- case "pl": // Polish
926
- return {
927
- username: "Nazwa użytkownika lub e-mail",
928
- password: "Hasło",
929
- login: "Zaloguj się",
930
- forgotPasswordLink: "Zapomniałeś hasła?",
931
- mailAddress: "Adres e-mail",
932
- requestLink: "Zażądaj linku",
933
- digits: "Kod",
934
- loginLink: "Zaloguj się",
935
- secondFactor: "Kod drugiego czynnika",
936
- sendDigits: "Wyślij kod",
937
- sendSecondFactorDigits: "Wyślij kod",
938
- resetLoginProcess: "Powrót do logowania",
939
- messageEmptyUserName: "Wprowadź swoją nazwę użytkownika",
940
- messageEmptyPassword: "Wprowadź swoje hasło",
941
- messageEmptyBoth: "Wprowadź swoją nazwę użytkownika i hasło",
942
- messageEmptyEmail: "Wprowadź swój adres e-mail",
943
- messageInvalidEmail: "Wprowadź prawidłowy adres e-mail",
944
- digitsEmpty: "Wprowadź swój kod",
945
- digitsInvalid: "Wprowadź prawidłowy kod",
946
- messageLoginFailed: "Logowanie nie powiodło się, sprawdź swoje dane.",
947
- messageForbidden:
948
- "Logowanie powiodło się, ale nie masz uprawnień. <b>Nie możesz</b> się zalogować.<br>Możesz wybrać innego użytkownika lub skontaktować się z administratorem.",
949
- messageSomethingWentWrong:
950
- "Coś poszło nie tak, spróbuj ponownie później.",
951
- messageThisFormIsNotConfigured:
952
- "Ten formularz nie jest skonfigurowany.",
953
- messagePasswordResetDisabled:
954
- "Ta funkcja nie działa, ponieważ włączona jest autoryzacja dwuetapowa na twoim koncie. Skontaktuj się z administratorem.",
955
- };
956
-
957
- case "da": // Danish
958
- return {
959
- username: "Brugernavn eller e-mail",
960
- password: "Adgangskode",
961
- login: "Log ind",
962
- forgotPasswordLink: "Glemt adgangskode?",
963
- mailAddress: "E-mail-adresse",
964
- requestLink: "Anmod om link",
965
- digits: "Kode",
966
- loginLink: "Log ind",
967
- secondFactor: "Tofaktorkode",
968
- sendDigits: "Send kode",
969
- sendSecondFactorDigits: "Send kode",
970
- resetLoginProcess: "Tilbage til log ind",
971
- messageEmptyUserName: "Indtast dit brugernavn",
972
- messageEmptyPassword: "Indtast din adgangskode",
973
- messageEmptyBoth: "Indtast dit brugernavn og din adgangskode",
974
- messageEmptyEmail: "Indtast din e-mail-adresse",
975
- messageInvalidEmail: "Indtast en gyldig e-mail-adresse",
976
- digitsEmpty: "Indtast din kode",
977
- digitsInvalid: "Indtast en gyldig kode",
978
- messageLoginFailed: "Login mislykkedes, kontrollér dine oplysninger.",
979
- messageForbidden:
980
- "Login lykkedes, men du har ikke tilladelse. Du <b>kan ikke</b> logge ind.<br>Du kan vælge en anden bruger eller kontakte administratoren.",
981
- messageSomethingWentWrong: "Noget gik galt, prøv igen senere.",
982
- messageThisFormIsNotConfigured: "Denne formular er ikke konfigureret.",
983
- messagePasswordResetDisabled:
984
- "Denne funktion fungerer ikke, fordi tofaktorautentificering<br>er aktiveret på din konto. Kontakt administratoren.",
985
- };
986
-
987
- case "no": // Norwegian
988
- return {
989
- username: "Brukernavn eller e-post",
990
- password: "Passord",
991
- login: "Logg inn",
992
- forgotPasswordLink: "Glemt passord?",
993
- mailAddress: "E-postadresse",
994
- requestLink: "Be om lenke",
995
- digits: "Kode",
996
- loginLink: "Logg inn",
997
- secondFactor: "Tofaktorkode",
998
- sendDigits: "Send kode",
999
- sendSecondFactorDigits: "Send kode",
1000
- resetLoginProcess: "Tilbake til innlogging",
1001
- messageEmptyUserName: "Vennligst skriv inn brukernavnet ditt",
1002
- messageEmptyPassword: "Vennligst skriv inn passordet ditt",
1003
- messageEmptyBoth: "Vennligst skriv inn brukernavn og passord",
1004
- messageEmptyEmail: "Vennligst skriv inn e-postadressen din",
1005
- messageInvalidEmail: "Vennligst skriv inn en gyldig e-postadresse",
1006
- digitsEmpty: "Vennligst skriv inn koden din",
1007
- digitsInvalid: "Vennligst skriv inn en gyldig kode",
1008
- messageLoginFailed:
1009
- "Innlogging mislyktes, vennligst sjekk informasjonen din.",
1010
- messageForbidden:
1011
- "Innloggingen var vellykket, men du har ikke tillatelse. Du <b>kan ikke</b> logge inn.<br>Du kan velge en annen bruker eller kontakte administratoren.",
1012
- messageSomethingWentWrong:
1013
- "Noe gikk galt, vennligst prøv igjen senere.",
1014
- messageThisFormIsNotConfigured: "Dette skjemaet er ikke konfigurert.",
1015
- messagePasswordResetDisabled:
1016
- "Denne funksjonen fungerer ikke fordi<br>tofaktorautentisering er aktivert på kontoen din. Kontakt administratoren.",
1017
- };
1018
-
1019
- case "cs": // Czech
1020
- return {
1021
- username: "Uživatelské jméno nebo e-mail",
1022
- password: "Heslo",
1023
- login: "Přihlásit se",
1024
- forgotPasswordLink: "Zapomněli jste heslo?",
1025
- mailAddress: "E-mailová adresa",
1026
- requestLink: "Požádat o odkaz",
1027
- digits: "Kód",
1028
- loginLink: "Přihlásit se",
1029
- secondFactor: "Dvoufázový kód",
1030
- sendDigits: "Odeslat kód",
1031
- sendSecondFactorDigits: "Odeslat kód",
1032
- resetLoginProcess: "Zpět na přihlášení",
1033
- messageEmptyUserName: "Zadejte své uživatelské jméno",
1034
- messageEmptyPassword: "Zadejte své heslo",
1035
- messageEmptyBoth: "Zadejte své uživatelské jméno a heslo",
1036
- messageEmptyEmail: "Zadejte svou e-mailovou adresu",
1037
- messageInvalidEmail: "Zadejte platnou e-mailovou adresu",
1038
- digitsEmpty: "Zadejte svůj kód",
1039
- digitsInvalid: "Zadejte platný kód",
1040
- messageLoginFailed: "Přihlášení se nezdařilo, zkontrolujte své údaje.",
1041
- messageForbidden:
1042
- "Přihlášení bylo úspěšné, ale nemáte oprávnění. Nemůžete se přihlásit.<br>Vyberte jiného uživatele nebo kontaktujte správce.",
1043
- messageSomethingWentWrong: "Něco se pokazilo, zkuste to později.",
1044
- messageThisFormIsNotConfigured: "Tento formulář není nakonfigurován.",
1045
- messagePasswordResetDisabled:
1046
- "Tato funkce nefunguje, protože je na vašem<br>účtu aktivováno dvoufaktorové ověřování. Kontaktujte správce.",
1047
- };
1048
-
1049
- default:
1050
- return {
1051
- username: "Username or E-Mail",
1052
- password: "Password",
1053
- login: "Login",
1054
- forgotPasswordLink: "Forgot Password?",
1055
- mailAddress: "E-Mail-Address",
1056
- requestLink: "Request Link",
1057
- digits: "Code",
1058
- loginLink: "Login",
1059
- secondFactor: "Second Factor Code",
1060
- sendDigits: "Send Code",
1061
- sendSecondFactorDigits: "Send Code",
1062
- resetLoginProcess: "Back to Login",
1063
- messageEmptyUserName: "Please enter your username",
1064
- messageEmptyPassword: "Please enter your password",
1065
- messageEmptyBoth: "Please enter your username and password",
1066
- messageEmptyEmail: "Please enter your email address",
1067
- messageInvalidEmail: "Please enter a valid email address",
1068
- digitsEmpty: "Please enter your code",
1069
- digitsInvalid: "Please enter a valid code",
1070
- messageLoginFailed: "Login failed, please check your input.",
1071
- messageForbidden:
1072
- "Login was successful, but you have no permission. You <b>cannot</b> login.<br>You can select another user or contact the administrator.",
1073
- messageSomethingWentWrong:
1074
- "Something went wrong, please try again later.",
1075
- messageThisFormIsNotConfigured: "This form is not configured.",
1076
- messagePasswordResetDisabled:
1077
- "This function does not work because two-factor<br>authentication is enabled on your account.<br>Please contact the administrator.",
1078
- };
1079
- }
486
+ const locale = getLocaleOfDocument();
487
+ switch (locale.language) {
488
+ case "de":
489
+ return {
490
+ username: "Benutzername oder E-Mail",
491
+ password: "Passwort",
492
+ login: "Anmelden",
493
+ forgotPasswordLink: "Passwort vergessen?",
494
+ mailAddress: "E-Mail-Adresse",
495
+ requestLink: "Code anfordern",
496
+ digits: "Code",
497
+ loginLink: "Anmelden",
498
+ secondFactor: "Zweiter Faktor Code",
499
+ sendDigits: "Code senden",
500
+ sendSecondFactorDigits: "Code senden",
501
+ resetLoginProcess: "Zurück zum Login",
502
+ messageEmptyUserName: "Bitte geben Sie Ihren Benutzernamen ein",
503
+ messageEmptyPassword: "Bitte geben Sie Ihr Passwort ein",
504
+ messageEmptyBoth:
505
+ "Bitte geben Sie Ihren Benutzernamen und Ihr Passwort ein",
506
+ messageEmptyEmail: "Bitte geben Sie Ihre E-Mail-Adresse ein",
507
+ messageInvalidEmail: "Bitte geben Sie eine gültige E-Mail-Adresse ein",
508
+ digitsEmpty: "Bitte geben Sie Ihren Code ein",
509
+ digitsInvalid: "Bitte geben Sie einen gültigen Code ein",
510
+ messageLoginFailed:
511
+ "Anmeldung fehlgeschlagen, bitte überprüfen Sie Ihre Eingaben.",
512
+ messageForbidden:
513
+ "Die Anmeldung war erfolgreich, aber Sie haben keine Berechtigung. Sie können sich <b>nicht</b> anmelden.<br>Sie können einen anderen Benutzer auswählen oder sich an den Administrator wenden.",
514
+ messageSomethingWentWrong:
515
+ "Etwas ist schief gelaufen, bitte versuchen Sie es später erneut",
516
+ messageThisFormIsNotConfigured:
517
+ "Dieses Formular ist nicht konfiguriert.",
518
+ messagePasswordResetDisabled:
519
+ "Sie können keinen Code anfordern, da die<br>Zwei-Faktor-Authentifizierung bei Ihrem Konto aktiviert ist.<br>Bitte kontaktieren Sie den Administrator.",
520
+ };
521
+ case "es":
522
+ return {
523
+ username: "Nombre de usuario o correo electrónico",
524
+ password: "Contraseña",
525
+ login: "Iniciar sesión",
526
+ forgotPasswordLink: "¿Olvidaste tu contraseña?",
527
+ mailAddress: "Dirección de correo electrónico",
528
+ requestLink: "Solicitar enlace",
529
+ digits: "Código",
530
+ loginLink: "Iniciar sesión",
531
+ secondFactor: "Código de segundo factor",
532
+ sendDigits: "Enviar código",
533
+ sendSecondFactorDigits: "Enviar código",
534
+ resetLoginProcess: "Volver al inicio de sesión",
535
+ messageEmptyUserName: "Por favor ingrese su nombre de usuario",
536
+ messageEmptyPassword: "Por favor ingrese su contraseña",
537
+ messageEmptyBoth: "Por favor ingrese su nombre de usuario y contraseña",
538
+ messageEmptyEmail:
539
+ "Por favor ingrese su dirección de correo electrónico",
540
+ messageInvalidEmail:
541
+ "Por favor ingrese una dirección de correo electrónico válida",
542
+ digitsEmpty: "Por favor ingrese su código",
543
+ digitsInvalid: "Por favor ingrese un código válido",
544
+ messageLoginFailed:
545
+ "Error al iniciar sesión, por favor verifique sus datos.",
546
+ messageForbidden:
547
+ "El inicio de sesión fue exitoso, pero no tienes permisos. <b>No puedes</b> iniciar sesión.<br>Puedes seleccionar otro usuario o contactar al administrador.",
548
+ messageSomethingWentWrong:
549
+ "Algo salió mal, por favor intenta de nuevo más tarde.",
550
+ messageThisFormIsNotConfigured: "Este formulario no está configurado.",
551
+ messagePasswordResetDisabled:
552
+ "Esta función no funciona porque la autenticación de dos factores está activada en su cuenta. Por favor, póngase en contacto con el administrador.",
553
+ };
554
+ case "zh":
555
+ return {
556
+ username: "用户名或电子邮箱",
557
+ password: "密码",
558
+ login: "登录",
559
+ forgotPasswordLink: "忘记密码?",
560
+ mailAddress: "电子邮件地址",
561
+ requestLink: "请求链接",
562
+ digits: "验证码",
563
+ loginLink: "登录",
564
+ secondFactor: "二次验证码",
565
+ sendDigits: "发送验证码",
566
+ sendSecondFactorDigits: "发送验证码",
567
+ resetLoginProcess: "返回登录",
568
+ messageEmptyUserName: "请输入用户名",
569
+ messageEmptyPassword: "请输入密码",
570
+ messageEmptyBoth: "请输入用户名和密码",
571
+ messageEmptyEmail: "请输入电子邮件地址",
572
+ messageInvalidEmail: "请输入有效的电子邮件地址",
573
+ digitsEmpty: "请输入验证码",
574
+ digitsInvalid: "请输入有效的验证码",
575
+ messageLoginFailed: "登录失败,请检查您的输入。",
576
+ messageForbidden:
577
+ "登录成功,但您没有权限。您<b>不能</b>登录。<br>您可以选择其他用户或联系管理员。",
578
+ messageSomethingWentWrong: "出了点问题,请稍后再试。",
579
+ messageThisFormIsNotConfigured: "此表单尚未配置。",
580
+ messagePasswordResetDisabled:
581
+ "此功能无法使用,因为您的帐户启用了二因素身份验证。请联系管理员。",
582
+ };
583
+
584
+ case "hi":
585
+ return {
586
+ username: "उपयगकर नम य ई-मल",
587
+ password: "पसवर",
588
+ login: "लग इन कर",
589
+ forgotPasswordLink: "पसवर भल गए?",
590
+ mailAddress: "ई-मल पत",
591
+ requestLink: "लक क अनरध कर",
592
+ digits: "कड",
593
+ loginLink: "लग इन कर",
594
+ secondFactor: "दसर फकर कड",
595
+ sendDigits: "कड भज",
596
+ sendSecondFactorDigits: "कड भज",
597
+ resetLoginProcess: "लगन पर वपस जए",
598
+ messageEmptyUserName: "कपय अपन उपयगकर नम दर कर",
599
+ messageEmptyPassword: "कपय अपन पसवर दर कर",
600
+ messageEmptyBoth: "कपय अपन उपयगकर नम और पसवर दर कर",
601
+ messageEmptyEmail: "कपय अपन ई-मल पत दर कर",
602
+ messageInvalidEmail: "कपय एक वध ई-मल पत दर कर",
603
+ digitsEmpty: "कपय अपन कड दर कर",
604
+ digitsInvalid: "कपय एक वध कड दर कर",
605
+ messageLoginFailed: "लगन वफल हआ, कपय अपन जनकर क जच कर।",
606
+ messageForbidden:
607
+ "लगन सफल रह लकन आपक पस अनमत नह ह। आप <b>लगन नह</b> कर सकत।<br>आप दसर उपयगकर चन सकत ह य पशसक स सपर कर सकत ह।",
608
+ messageSomethingWentWrong: "कछ गलत हआ, कपय बद म पन पयस कर।",
609
+ messageThisFormIsNotConfigured: "यह फर कनगर नह ह।",
610
+ messagePasswordResetDisabled:
611
+ "यह सवध कम नह करत कक आपक खत म द घटक पमणकरण सकम ह। कपय पशसक स सपर कर।",
612
+ };
613
+
614
+ case "bn":
615
+ return {
616
+ username: "ইউজরনম ব ই-মইল",
617
+ password: "পসওযর",
618
+ login: "লগইন করন",
619
+ forgotPasswordLink: "পসওযর ভল গছন?",
620
+ mailAddress: "ই-মইল ঠকন",
621
+ requestLink: "লক অনরধ করন",
622
+ digits: "কড",
623
+ loginLink: "লগইন করন",
624
+ secondFactor: "দতয ফকর কড",
625
+ sendDigits: "কড পঠন",
626
+ sendSecondFactorDigits: "কড পঠন",
627
+ resetLoginProcess: "লগইন ফর যন",
628
+ messageEmptyUserName: "দয কর আপনর ইউজরনম লখন",
629
+ messageEmptyPassword: "দয কর আপনর পসওযর লখন",
630
+ messageEmptyBoth: "দয কর আপনর ইউজরনম এব পসওযর লখন",
631
+ messageEmptyEmail: "দয কর আপনর ই-মইল ঠকন লখন",
632
+ messageInvalidEmail: "দয কর একট বধ ই-মইল ঠকন লখন",
633
+ digitsEmpty: "দয কর আপনর কড লখন",
634
+ digitsInvalid: "দয কর একট বধ কড লখন",
635
+ messageLoginFailed: "লগইন বর হযছ, দয কর আপনর ইনপট পরক করন।",
636
+ messageForbidden:
637
+ "লগইন সফল হযছ, কন আপনর অনমত নই। আপন <b>লগইন করত পরবন ন</b>।<br>আপন অন ইউজর নরচন করত পরন অথব অযডমনসটরর সথ যগযগ করত পরন।",
638
+ messageSomethingWentWrong: "কছ ভল হযছ, দয কর পর আবর চষ করন।",
639
+ messageThisFormIsNotConfigured: "এই ফরট কনফগর কর হযন।",
640
+ messagePasswordResetDisabled:
641
+ "এই ফশনট করকর নয করণ আপনর অযকউন দট ফকর পমণকরণ সকয কর আছ। দয কর পশসকর সথ যগযগ করন।",
642
+ };
643
+
644
+ case "pt": // Portuguese
645
+ return {
646
+ username: "Nome de usuário ou e-mail",
647
+ password: "Senha",
648
+ login: "Entrar",
649
+ forgotPasswordLink: "Esqueceu a senha?",
650
+ mailAddress: "Endereço de e-mail",
651
+ requestLink: "Solicitar link",
652
+ digits: "Código",
653
+ loginLink: "Entrar",
654
+ secondFactor: "Código do segundo fator",
655
+ sendDigits: "Enviar código",
656
+ sendSecondFactorDigits: "Enviar código",
657
+ resetLoginProcess: "Voltar ao login",
658
+ messageEmptyUserName: "Por favor, insira seu nome de usuário",
659
+ messageEmptyPassword: "Por favor, insira sua senha",
660
+ messageEmptyBoth: "Por favor, insira seu nome de usuário e senha",
661
+ messageEmptyEmail: "Por favor, insira seu endereço de e-mail",
662
+ messageInvalidEmail: "Por favor, insira um endereço de e-mail válido",
663
+ digitsEmpty: "Por favor, insira seu código",
664
+ digitsInvalid: "Por favor, insira um código válido",
665
+ messageLoginFailed: "Falha no login, verifique suas informações.",
666
+ messageForbidden:
667
+ "Login foi bem-sucedido, mas você não tem permissão. Você <b>não pode</b> entrar.<br>Você pode escolher outro usuário ou entrar em contato com o administrador.",
668
+ messageSomethingWentWrong:
669
+ "Algo deu errado, tente novamente mais tarde.",
670
+ messageThisFormIsNotConfigured: "Este formulário não está configurado.",
671
+ messagePasswordResetDisabled:
672
+ "Esta função não funciona porque a autenticação de dois fatores<br>está ativada em sua conta. Por favor, entre em contato com o administrador.",
673
+ };
674
+
675
+ case "ru": // Russian
676
+ return {
677
+ username: "Имя пользователя или электронная почта",
678
+ password: "Пароль",
679
+ login: "Войти",
680
+ forgotPasswordLink: "Забыли пароль?",
681
+ mailAddress: "Адрес электронной почты",
682
+ requestLink: "Запросить ссылку",
683
+ digits: "Код",
684
+ loginLink: "Войти",
685
+ secondFactor: "Код второго фактора",
686
+ sendDigits: "Отправить код",
687
+ sendSecondFactorDigits: "Отправить код",
688
+ resetLoginProcess: "Вернуться к входу",
689
+ messageEmptyUserName: "Пожалуйста, введите имя пользователя",
690
+ messageEmptyPassword: "Пожалуйста, введите пароль",
691
+ messageEmptyBoth: "Пожалуйста, введите имя пользователя и пароль",
692
+ messageEmptyEmail: "Пожалуйста, введите адрес электронной почты",
693
+ messageInvalidEmail:
694
+ "Пожалуйста, введите действительный адрес электронной почты",
695
+ digitsEmpty: "Пожалуйста, введите код",
696
+ digitsInvalid: "Пожалуйста, введите действительный код",
697
+ messageLoginFailed: "Ошибка входа, проверьте введенные данные.",
698
+ messageForbidden:
699
+ "Вход выполнен, но у вас нет прав. Вы <b>не можете</b> войти.<br>Вы можете выбрать другого пользователя или связаться с администратором.",
700
+ messageSomethingWentWrong: "Что-то пошло не так, попробуйте позже.",
701
+ messageThisFormIsNotConfigured: "Эта форма не настроена.",
702
+ messagePasswordResetDisabled:
703
+ "Эта функция не работает, потому что двухфакторная аутентификация<br> включена в вашей учетной записи. Пожалуйста, свяжитесь с администратором.",
704
+ };
705
+
706
+ case "ja": // Japanese
707
+ return {
708
+ username: "ユーザー名またはメールアドレス",
709
+ password: "パスワード",
710
+ login: "ログイン",
711
+ forgotPasswordLink: "パスワードを忘れましたか?",
712
+ mailAddress: "メールアドレス",
713
+ requestLink: "リンクをリクエスト",
714
+ digits: "コード",
715
+ loginLink: "ログイン",
716
+ secondFactor: "二要素コード",
717
+ sendDigits: "コードを送信",
718
+ sendSecondFactorDigits: "コードを送信",
719
+ resetLoginProcess: "ログインに戻る",
720
+ messageEmptyUserName: "ユーザー名を入力してください",
721
+ messageEmptyPassword: "パスワードを入力してください",
722
+ messageEmptyBoth: "ユーザー名とパスワードを入力してください",
723
+ messageEmptyEmail: "メールアドレスを入力してください",
724
+ messageInvalidEmail: "有効なメールアドレスを入力してください",
725
+ digitsEmpty: "コードを入力してください",
726
+ digitsInvalid: "有効なコードを入力してください",
727
+ messageLoginFailed:
728
+ "ログインに失敗しました。入力内容をご確認ください。",
729
+ messageForbidden:
730
+ "ログイン成功しましたが、権限がありません。<b>ログインできません</b>。<br>他のユーザーを選択するか、管理者に連絡してください。",
731
+ messageSomethingWentWrong:
732
+ "問題が発生しました。後でもう一度お試しください。",
733
+ messageThisFormIsNotConfigured: "このフォームは設定されていません。",
734
+ messagePasswordResetDisabled:
735
+ "この機能は使用できません。アカウントで二要素認証が有効になっているため、管理者に連絡してください。",
736
+ };
737
+
738
+ case "pa": // Western Punjabi
739
+ return {
740
+ username: "ਵਰਤਕਰ ਨਮ ਜ ਈ-ਮਲ",
741
+ password: "ਪਸਵਰਡ",
742
+ login: "ਲਗਨ ਕਰ",
743
+ forgotPasswordLink: "ਪਸਵਰਡ ਭਲ ਗਏ?",
744
+ mailAddress: "ਈ-ਮਲ ਪਤ",
745
+ requestLink: "ਲਕ ਦ ਬਨਤ ਕਰ",
746
+ digits: "ਕਡ",
747
+ loginLink: "ਲਗਨ ਕਰ",
748
+ secondFactor: "ਦਜ ਫਕਟਰ ਕਡ",
749
+ sendDigits: "ਕਡ ਭਜ",
750
+ sendSecondFactorDigits: "ਕਡ ਭਜ",
751
+ resetLoginProcess: "ਲਗਨ 'ਤ ਵਪਸ ਜਓ",
752
+ messageEmptyUserName: "ਕਰਪ ਕਰਕ ਆਪਣ ਵਰਤਕਰ ਨਮ ਦਰਜ ਕਰ",
753
+ messageEmptyPassword: "ਕਰਪ ਕਰਕ ਆਪਣ ਪਸਵਰਡ ਦਰਜ ਕਰ",
754
+ messageEmptyBoth: "ਕਰਪ ਕਰਕ ਆਪਣ ਵਰਤਕਰ ਨਮ ਤ ਪਸਵਰਡ ਦਰਜ ਕਰ",
755
+ messageEmptyEmail: "ਕਰਪ ਕਰਕ ਆਪਣ ਈ-ਮਲ ਪਤ ਦਰਜ ਕਰ",
756
+ messageInvalidEmail: "ਕਰਪ ਕਰਕ ਇਕ ਵਧ ਈ-ਮਲ ਪਤ ਦਰਜ ਕਰ",
757
+ digitsEmpty: "ਕਰਪ ਕਰਕ ਆਪਣ ਕਡ ਦਰਜ ਕਰ",
758
+ digitsInvalid: "ਕਰਪ ਕਰਕ ਇਕ ਵਧ ਕਡ ਦਰਜ ਕਰ",
759
+ messageLoginFailed: "ਲਗਨ ਅਸਫਲ ਹਇਆ, ਕਰਪ ਕਰਕ ਆਪਣ ਜਣਕਰ ਦ ਜਚ ਕਰ।",
760
+ messageForbidden:
761
+ "ਲਗਨ ਸਫਲ ਹਇਆ, ਪਰ ਤਹਡ ਕਲ ਅਧਕਰ ਨਹ ਹਨ। ਤਸ <b>ਲਗਨ ਨਹ</b> ਕਰ ਸਕਦ।<br>ਤਸ ਹਰ ਵਰਤਕਰ ਚਣ सकत ਹ ਜ ਪਰਬਧਕ ਨਲ ਸਪਰਕ ਕਰ ਸਕਦ ਹ।",
762
+ messageSomethingWentWrong: "ਕਝ ਗਲਤ ਹ ਗਆ, ਕਰਪ ਕਰਕ ਬਅਦ ਵਚ ਮੜ ਕਸਸ ਕਰ।",
763
+ messageThisFormIsNotConfigured: "ਇਸ ਫਰਮ ਨ ਸਰਚਤ ਨਹ ਕਤ ਗਆ ਹ।",
764
+ messagePasswordResetDisabled:
765
+ "ਇਹ ਫਕਸਨ ਕਮ ਨਹ ਕਰਦ ਕਉਕ ਤਹਡ ਖਤ ਵਚ ਦ ਫਕਟਰ ਪਰਮਣਕਰਣ ਸਰਗਰਮ ਹ। ਕਰਪ ਕਰਕ ਪਰਬਧਕ ਨਲ ਸਪਰਕ ਕਰ।",
766
+ };
767
+
768
+ case "mr": // Marathi
769
+ return {
770
+ username: "वपरकरनव कव ईमल",
771
+ password: "सकतशब",
772
+ login: "पवश कर",
773
+ forgotPasswordLink: "सकतशब वसरलत क?",
774
+ mailAddress: "ईमल पत",
775
+ requestLink: "लकच वनत कर",
776
+ digits: "कड",
777
+ loginLink: "पवश कर",
778
+ secondFactor: "दसर घटक कड",
779
+ sendDigits: "कड पठव",
780
+ sendSecondFactorDigits: "कड पठव",
781
+ resetLoginProcess: "पवशवर परत ज",
782
+ messageEmptyUserName: "कपय आपल वपरकरनव पवष कर",
783
+ messageEmptyPassword: "कपय आपल सकतशब पवष कर",
784
+ messageEmptyBoth: "कपय आपल वपरकरनव आण सकतशब पवष कर",
785
+ messageEmptyEmail: "कपय आपल ईमल पत पवष कर",
786
+ messageInvalidEmail: "कपय वध ईमल पत पवष कर",
787
+ digitsEmpty: "कपय आपल कड पवष कर",
788
+ digitsInvalid: "कपय वध कड पवष कर",
789
+ messageLoginFailed: "पवश अयशस, कपय आपल महत तपस.",
790
+ messageForbidden:
791
+ "पवश यशस झल, परत आपलकड परवन नह. आपण <b>पवश कर शकत नह</b>.<br>आपण दसर वपरकर नवड शकत कव ववसपकश सपर सध शकत.",
792
+ messageSomethingWentWrong: "कहतर चकल, कपय नतर पन पयत कर.",
793
+ messageThisFormIsNotConfigured: "ह फर सरचत कलल नह.",
794
+ messagePasswordResetDisabled:
795
+ "य करच कमगर करत नह करण आपल खतत दन घटक पमणकरण सकय कल आह. कपय ववसपकश सपर सध.",
796
+ };
797
+
798
+ case "fr": // French
799
+ return {
800
+ username: "Nom d'utilisateur ou e-mail",
801
+ password: "Mot de passe",
802
+ login: "Connexion",
803
+ forgotPasswordLink: "Mot de passe oublié ?",
804
+ mailAddress: "Adresse e-mail",
805
+ requestLink: "Demander un lien",
806
+ digits: "Code",
807
+ loginLink: "Connexion",
808
+ secondFactor: "Code du deuxième facteur",
809
+ sendDigits: "Envoyer le code",
810
+ sendSecondFactorDigits: "Envoyer le code",
811
+ resetLoginProcess: "Retour à la connexion",
812
+ messageEmptyUserName: "Veuillez entrer votre nom d'utilisateur",
813
+ messageEmptyPassword: "Veuillez entrer votre mot de passe",
814
+ messageEmptyBoth:
815
+ "Veuillez entrer votre nom d'utilisateur et votre mot de passe",
816
+ messageEmptyEmail: "Veuillez entrer votre adresse e-mail",
817
+ messageInvalidEmail: "Veuillez entrer une adresse e-mail valide",
818
+ digitsEmpty: "Veuillez entrer votre code",
819
+ digitsInvalid: "Veuillez entrer un code valide",
820
+ messageLoginFailed:
821
+ "Échec de la connexion, veuillez vérifier vos informations.",
822
+ messageForbidden:
823
+ "La connexion a réussi, mais vous n'avez pas les permissions. Vous <b>ne pouvez pas</b> vous connecter.<br>Vous pouvez choisir un autre utilisateur ou contacter l'administrateur.",
824
+ messageSomethingWentWrong:
825
+ "Une erreur s'est produite, veuillez réessayer plus tard.",
826
+ messageThisFormIsNotConfigured: "Ce formulaire n'est pas configuré.",
827
+ messagePasswordResetDisabled:
828
+ "Cette fonctionnalité ne fonctionne pas car l'authentification à deux facteurs est activée sur<br>votre compte. Veuillez contacter l'administrateur.",
829
+ };
830
+
831
+ case "it": // Italian
832
+ return {
833
+ username: "Nome utente o e-mail",
834
+ password: "Password",
835
+ login: "Accedi",
836
+ forgotPasswordLink: "Password dimenticata?",
837
+ mailAddress: "Indirizzo e-mail",
838
+ requestLink: "Richiedi link",
839
+ digits: "Codice",
840
+ loginLink: "Accedi",
841
+ secondFactor: "Codice a due fattori",
842
+ sendDigits: "Invia codice",
843
+ sendSecondFactorDigits: "Invia codice",
844
+ resetLoginProcess: "Torna al login",
845
+ messageEmptyUserName: "Per favore, inserisci il tuo nome utente",
846
+ messageEmptyPassword: "Per favore, inserisci la tua password",
847
+ messageEmptyBoth:
848
+ "Per favore, inserisci il tuo nome utente e la tua password",
849
+ messageEmptyEmail: "Per favore, inserisci il tuo indirizzo e-mail",
850
+ messageInvalidEmail: "Per favore, inserisci un indirizzo e-mail valido",
851
+ digitsEmpty: "Per favore, inserisci il tuo codice",
852
+ digitsInvalid: "Per favore, inserisci un codice valido",
853
+ messageLoginFailed: "Accesso fallito, verifica i tuoi dati.",
854
+ messageForbidden:
855
+ "Accesso riuscito, ma non hai i permessi. Non puoi accedere.<br>Puoi scegliere un altro account o contattare l'amministratore.",
856
+ messageSomethingWentWrong:
857
+ "Qualcosa è andato storto, riprova più tardi.",
858
+ messageThisFormIsNotConfigured: "Questo modulo non è configurato.",
859
+ messagePasswordResetDisabled:
860
+ "Questa funzione non funziona perché l'autenticazione a due<br>fattori è attiva sul tuo account. Contatta l'amministratore.",
861
+ };
862
+
863
+ case "nl": // Dutch
864
+ return {
865
+ username: "Gebruikersnaam of e-mail",
866
+ password: "Wachtwoord",
867
+ login: "Inloggen",
868
+ forgotPasswordLink: "Wachtwoord vergeten?",
869
+ mailAddress: "E-mailadres",
870
+ requestLink: "Link aanvragen",
871
+ digits: "Code",
872
+ loginLink: "Inloggen",
873
+ secondFactor: "Tweede factor code",
874
+ sendDigits: "Code verzenden",
875
+ sendSecondFactorDigits: "Code verzenden",
876
+ resetLoginProcess: "Terug naar inloggen",
877
+ messageEmptyUserName: "Voer uw gebruikersnaam in",
878
+ messageEmptyPassword: "Voer uw wachtwoord in",
879
+ messageEmptyBoth: "Voer uw gebruikersnaam en wachtwoord in",
880
+ messageEmptyEmail: "Voer uw e-mailadres in",
881
+ messageInvalidEmail: "Voer een geldig e-mailadres in",
882
+ digitsEmpty: "Voer uw code in",
883
+ digitsInvalid: "Voer een geldige code in",
884
+ messageLoginFailed: "Inloggen mislukt, controleer uw gegevens.",
885
+ messageForbidden:
886
+ "Inloggen geslaagd, maar u heeft geen permissies. U <b>kunt niet</b> inloggen.<br>U kunt een andere gebruiker selecteren of de beheerder contacteren.",
887
+ messageSomethingWentWrong:
888
+ "Er is iets fout gegaan, probeer het later opnieuw.",
889
+ messageThisFormIsNotConfigured: "Dit formulier is niet geconfigureerd.",
890
+ messagePasswordResetDisabled:
891
+ "Deze functie werkt niet omdat tweefactorauthenticatie is<br>ingeschakeld op uw account. Neem contact op met de beheerder.",
892
+ };
893
+
894
+ case "sv": // Swedish
895
+ return {
896
+ username: "Användarnamn eller e-post",
897
+ password: "Lösenord",
898
+ login: "Logga in",
899
+ forgotPasswordLink: "Glömt lösenord?",
900
+ mailAddress: "E-postadress",
901
+ requestLink: "Begär länk",
902
+ digits: "Kod",
903
+ loginLink: "Logga in",
904
+ secondFactor: "Tvåfaktorkod",
905
+ sendDigits: "Skicka kod",
906
+ sendSecondFactorDigits: "Skicka kod",
907
+ resetLoginProcess: "Tillbaka till inloggning",
908
+ messageEmptyUserName: "Ange ditt användarnamn",
909
+ messageEmptyPassword: "Ange ditt lösenord",
910
+ messageEmptyBoth: "Ange ditt användarnamn och lösenord",
911
+ messageEmptyEmail: "Ange din e-postadress",
912
+ messageInvalidEmail: "Ange en giltig e-postadress",
913
+ digitsEmpty: "Ange din kod",
914
+ digitsInvalid: "Ange en giltig kod",
915
+ messageLoginFailed:
916
+ "Inloggning misslyckades, kontrollera dina uppgifter.",
917
+ messageForbidden:
918
+ "Inloggningen lyckades, men du har inte behörighet. Du <b>kan inte</b> logga in.<br>Du kan välja en annan användare eller kontakta administratören.",
919
+ messageSomethingWentWrong: "Något gick fel, försök igen senare.",
920
+ messageThisFormIsNotConfigured: "Detta formulär är inte konfigurerat.",
921
+ messagePasswordResetDisabled:
922
+ "Denna funktion fungerar inte eftersom tvåfaktorsautentisering är aktiverad på ditt konto. Kontakta administratören.",
923
+ };
924
+
925
+ case "pl": // Polish
926
+ return {
927
+ username: "Nazwa użytkownika lub e-mail",
928
+ password: "Hasło",
929
+ login: "Zaloguj się",
930
+ forgotPasswordLink: "Zapomniałeś hasła?",
931
+ mailAddress: "Adres e-mail",
932
+ requestLink: "Zażądaj linku",
933
+ digits: "Kod",
934
+ loginLink: "Zaloguj się",
935
+ secondFactor: "Kod drugiego czynnika",
936
+ sendDigits: "Wyślij kod",
937
+ sendSecondFactorDigits: "Wyślij kod",
938
+ resetLoginProcess: "Powrót do logowania",
939
+ messageEmptyUserName: "Wprowadź swoją nazwę użytkownika",
940
+ messageEmptyPassword: "Wprowadź swoje hasło",
941
+ messageEmptyBoth: "Wprowadź swoją nazwę użytkownika i hasło",
942
+ messageEmptyEmail: "Wprowadź swój adres e-mail",
943
+ messageInvalidEmail: "Wprowadź prawidłowy adres e-mail",
944
+ digitsEmpty: "Wprowadź swój kod",
945
+ digitsInvalid: "Wprowadź prawidłowy kod",
946
+ messageLoginFailed: "Logowanie nie powiodło się, sprawdź swoje dane.",
947
+ messageForbidden:
948
+ "Logowanie powiodło się, ale nie masz uprawnień. <b>Nie możesz</b> się zalogować.<br>Możesz wybrać innego użytkownika lub skontaktować się z administratorem.",
949
+ messageSomethingWentWrong:
950
+ "Coś poszło nie tak, spróbuj ponownie później.",
951
+ messageThisFormIsNotConfigured:
952
+ "Ten formularz nie jest skonfigurowany.",
953
+ messagePasswordResetDisabled:
954
+ "Ta funkcja nie działa, ponieważ włączona jest autoryzacja dwuetapowa na twoim koncie. Skontaktuj się z administratorem.",
955
+ };
956
+
957
+ case "da": // Danish
958
+ return {
959
+ username: "Brugernavn eller e-mail",
960
+ password: "Adgangskode",
961
+ login: "Log ind",
962
+ forgotPasswordLink: "Glemt adgangskode?",
963
+ mailAddress: "E-mail-adresse",
964
+ requestLink: "Anmod om link",
965
+ digits: "Kode",
966
+ loginLink: "Log ind",
967
+ secondFactor: "Tofaktorkode",
968
+ sendDigits: "Send kode",
969
+ sendSecondFactorDigits: "Send kode",
970
+ resetLoginProcess: "Tilbage til log ind",
971
+ messageEmptyUserName: "Indtast dit brugernavn",
972
+ messageEmptyPassword: "Indtast din adgangskode",
973
+ messageEmptyBoth: "Indtast dit brugernavn og din adgangskode",
974
+ messageEmptyEmail: "Indtast din e-mail-adresse",
975
+ messageInvalidEmail: "Indtast en gyldig e-mail-adresse",
976
+ digitsEmpty: "Indtast din kode",
977
+ digitsInvalid: "Indtast en gyldig kode",
978
+ messageLoginFailed: "Login mislykkedes, kontrollér dine oplysninger.",
979
+ messageForbidden:
980
+ "Login lykkedes, men du har ikke tilladelse. Du <b>kan ikke</b> logge ind.<br>Du kan vælge en anden bruger eller kontakte administratoren.",
981
+ messageSomethingWentWrong: "Noget gik galt, prøv igen senere.",
982
+ messageThisFormIsNotConfigured: "Denne formular er ikke konfigureret.",
983
+ messagePasswordResetDisabled:
984
+ "Denne funktion fungerer ikke, fordi tofaktorautentificering<br>er aktiveret på din konto. Kontakt administratoren.",
985
+ };
986
+
987
+ case "no": // Norwegian
988
+ return {
989
+ username: "Brukernavn eller e-post",
990
+ password: "Passord",
991
+ login: "Logg inn",
992
+ forgotPasswordLink: "Glemt passord?",
993
+ mailAddress: "E-postadresse",
994
+ requestLink: "Be om lenke",
995
+ digits: "Kode",
996
+ loginLink: "Logg inn",
997
+ secondFactor: "Tofaktorkode",
998
+ sendDigits: "Send kode",
999
+ sendSecondFactorDigits: "Send kode",
1000
+ resetLoginProcess: "Tilbake til innlogging",
1001
+ messageEmptyUserName: "Vennligst skriv inn brukernavnet ditt",
1002
+ messageEmptyPassword: "Vennligst skriv inn passordet ditt",
1003
+ messageEmptyBoth: "Vennligst skriv inn brukernavn og passord",
1004
+ messageEmptyEmail: "Vennligst skriv inn e-postadressen din",
1005
+ messageInvalidEmail: "Vennligst skriv inn en gyldig e-postadresse",
1006
+ digitsEmpty: "Vennligst skriv inn koden din",
1007
+ digitsInvalid: "Vennligst skriv inn en gyldig kode",
1008
+ messageLoginFailed:
1009
+ "Innlogging mislyktes, vennligst sjekk informasjonen din.",
1010
+ messageForbidden:
1011
+ "Innloggingen var vellykket, men du har ikke tillatelse. Du <b>kan ikke</b> logge inn.<br>Du kan velge en annen bruker eller kontakte administratoren.",
1012
+ messageSomethingWentWrong:
1013
+ "Noe gikk galt, vennligst prøv igjen senere.",
1014
+ messageThisFormIsNotConfigured: "Dette skjemaet er ikke konfigurert.",
1015
+ messagePasswordResetDisabled:
1016
+ "Denne funksjonen fungerer ikke fordi<br>tofaktorautentisering er aktivert på kontoen din. Kontakt administratoren.",
1017
+ };
1018
+
1019
+ case "cs": // Czech
1020
+ return {
1021
+ username: "Uživatelské jméno nebo e-mail",
1022
+ password: "Heslo",
1023
+ login: "Přihlásit se",
1024
+ forgotPasswordLink: "Zapomněli jste heslo?",
1025
+ mailAddress: "E-mailová adresa",
1026
+ requestLink: "Požádat o odkaz",
1027
+ digits: "Kód",
1028
+ loginLink: "Přihlásit se",
1029
+ secondFactor: "Dvoufázový kód",
1030
+ sendDigits: "Odeslat kód",
1031
+ sendSecondFactorDigits: "Odeslat kód",
1032
+ resetLoginProcess: "Zpět na přihlášení",
1033
+ messageEmptyUserName: "Zadejte své uživatelské jméno",
1034
+ messageEmptyPassword: "Zadejte své heslo",
1035
+ messageEmptyBoth: "Zadejte své uživatelské jméno a heslo",
1036
+ messageEmptyEmail: "Zadejte svou e-mailovou adresu",
1037
+ messageInvalidEmail: "Zadejte platnou e-mailovou adresu",
1038
+ digitsEmpty: "Zadejte svůj kód",
1039
+ digitsInvalid: "Zadejte platný kód",
1040
+ messageLoginFailed: "Přihlášení se nezdařilo, zkontrolujte své údaje.",
1041
+ messageForbidden:
1042
+ "Přihlášení bylo úspěšné, ale nemáte oprávnění. Nemůžete se přihlásit.<br>Vyberte jiného uživatele nebo kontaktujte správce.",
1043
+ messageSomethingWentWrong: "Něco se pokazilo, zkuste to později.",
1044
+ messageThisFormIsNotConfigured: "Tento formulář není nakonfigurován.",
1045
+ messagePasswordResetDisabled:
1046
+ "Tato funkce nefunguje, protože je na vašem<br>účtu aktivováno dvoufaktorové ověřování. Kontaktujte správce.",
1047
+ };
1048
+
1049
+ default:
1050
+ return {
1051
+ username: "Username or E-Mail",
1052
+ password: "Password",
1053
+ login: "Login",
1054
+ forgotPasswordLink: "Forgot Password?",
1055
+ mailAddress: "E-Mail-Address",
1056
+ requestLink: "Request Link",
1057
+ digits: "Code",
1058
+ loginLink: "Login",
1059
+ secondFactor: "Second Factor Code",
1060
+ sendDigits: "Send Code",
1061
+ sendSecondFactorDigits: "Send Code",
1062
+ resetLoginProcess: "Back to Login",
1063
+ messageEmptyUserName: "Please enter your username",
1064
+ messageEmptyPassword: "Please enter your password",
1065
+ messageEmptyBoth: "Please enter your username and password",
1066
+ messageEmptyEmail: "Please enter your email address",
1067
+ messageInvalidEmail: "Please enter a valid email address",
1068
+ digitsEmpty: "Please enter your code",
1069
+ digitsInvalid: "Please enter a valid code",
1070
+ messageLoginFailed: "Login failed, please check your input.",
1071
+ messageForbidden:
1072
+ "Login was successful, but you have no permission. You <b>cannot</b> login.<br>You can select another user or contact the administrator.",
1073
+ messageSomethingWentWrong:
1074
+ "Something went wrong, please try again later.",
1075
+ messageThisFormIsNotConfigured: "This form is not configured.",
1076
+ messagePasswordResetDisabled:
1077
+ "This function does not work because two-factor<br>authentication is enabled on your account.<br>Please contact the administrator.",
1078
+ };
1079
+ }
1080
1080
  }
1081
1081
 
1082
1082
  /**
@@ -1094,46 +1094,46 @@ function getTranslations() {
1094
1094
  * @return {{ value: string, valid: (boolean|undefined), message: (string|undefined), stop: boolean, raw: * }}
1095
1095
  */
1096
1096
  function normalizeCallbackResult(callbackResult, currentValue) {
1097
- const normalized = {
1098
- value: currentValue,
1099
- valid: undefined,
1100
- message: undefined,
1101
- stop: false,
1102
- raw: callbackResult,
1103
- };
1104
-
1105
- if (callbackResult === undefined) {
1106
- return normalized;
1107
- }
1108
-
1109
- if (typeof callbackResult === "string") {
1110
- normalized.value = callbackResult;
1111
- return normalized;
1112
- }
1113
-
1114
- if (callbackResult === false) {
1115
- normalized.valid = false;
1116
- return normalized;
1117
- }
1118
-
1119
- if (callbackResult && typeof callbackResult === "object") {
1120
- if (Object.prototype.hasOwnProperty.call(callbackResult, "value")) {
1121
- normalized.value = callbackResult.value;
1122
- }
1123
- if (Object.prototype.hasOwnProperty.call(callbackResult, "valid")) {
1124
- normalized.valid = callbackResult.valid;
1125
- }
1126
- if (Object.prototype.hasOwnProperty.call(callbackResult, "message")) {
1127
- normalized.message = callbackResult.message;
1128
- }
1129
- if (Object.prototype.hasOwnProperty.call(callbackResult, "stop")) {
1130
- normalized.stop = Boolean(callbackResult.stop);
1131
- }
1132
-
1133
- return normalized;
1134
- }
1135
-
1136
- return normalized;
1097
+ const normalized = {
1098
+ value: currentValue,
1099
+ valid: undefined,
1100
+ message: undefined,
1101
+ stop: false,
1102
+ raw: callbackResult,
1103
+ };
1104
+
1105
+ if (callbackResult === undefined) {
1106
+ return normalized;
1107
+ }
1108
+
1109
+ if (typeof callbackResult === "string") {
1110
+ normalized.value = callbackResult;
1111
+ return normalized;
1112
+ }
1113
+
1114
+ if (callbackResult === false) {
1115
+ normalized.valid = false;
1116
+ return normalized;
1117
+ }
1118
+
1119
+ if (callbackResult && typeof callbackResult === "object") {
1120
+ if (Object.prototype.hasOwnProperty.call(callbackResult, "value")) {
1121
+ normalized.value = callbackResult.value;
1122
+ }
1123
+ if (Object.prototype.hasOwnProperty.call(callbackResult, "valid")) {
1124
+ normalized.valid = callbackResult.valid;
1125
+ }
1126
+ if (Object.prototype.hasOwnProperty.call(callbackResult, "message")) {
1127
+ normalized.message = callbackResult.message;
1128
+ }
1129
+ if (Object.prototype.hasOwnProperty.call(callbackResult, "stop")) {
1130
+ normalized.stop = Boolean(callbackResult.stop);
1131
+ }
1132
+
1133
+ return normalized;
1134
+ }
1135
+
1136
+ return normalized;
1137
1137
  }
1138
1138
 
1139
1139
  /**
@@ -1141,560 +1141,560 @@ function normalizeCallbackResult(callbackResult, currentValue) {
1141
1141
  * @return {initEventHandler}
1142
1142
  */
1143
1143
  function initEventHandler() {
1144
- const self = this;
1145
- const element = this[loginElementSymbol];
1146
-
1147
- const type = "click";
1148
-
1149
- element.addEventListener(type, function (event) {
1150
- const callback = self.getOption("actions.click");
1151
-
1152
- fireCustomEvent(self, "monster-login-clicked", {
1153
- element: self,
1154
- });
1155
-
1156
- if (!isFunction(callback)) {
1157
- return;
1158
- }
1159
-
1160
- const element = findTargetElementFromEvent(
1161
- event,
1162
- ATTRIBUTE_ROLE,
1163
- "control",
1164
- );
1165
-
1166
- if (!(element instanceof Node && self.hasNode(element))) {
1167
- return;
1168
- }
1169
-
1170
- callback.call(self, event);
1171
- });
1172
-
1173
- this[forgotPasswordLinkSymbol].addEventListener(type, (event) => {
1174
- event.preventDefault();
1175
- this[forgotPasswordCollapseSymbol].open();
1176
- setTimeout(() => {
1177
- this.shadowRoot.querySelector("input[name='email']").focus();
1178
- }, 0);
1179
- });
1180
-
1181
- this[loginLinkSymbol].addEventListener(type, (event) => {
1182
- event.preventDefault();
1183
- this[loginCollapseSymbol].open();
1184
-
1185
- setTimeout(() => {
1186
- this.shadowRoot.querySelector("input[name='username']").focus();
1187
- }, 0);
1188
- });
1189
-
1190
- for (const e of this[resetLoginProcessLinksSymbol]) {
1191
- e.addEventListener(type, (event) => {
1192
- event.preventDefault();
1193
- this[loginCollapseSymbol].open();
1194
- setTimeout(() => {
1195
- this.shadowRoot.querySelector("input[name='username']").focus();
1196
- }, 0);
1197
- });
1198
- }
1199
-
1200
- this[loginCollapseSymbol].addEventListener("keydown", (event) => {
1201
- if (event.key === "Enter") {
1202
- this[loginButtonSymbol].click();
1203
- }
1204
- });
1205
-
1206
- this[secondFactorCollapseSymbol].addEventListener("keydown", (event) => {
1207
- if (event.key === "Enter") {
1208
- this[secondFactorButtonSymbol].click();
1209
- }
1210
- });
1211
-
1212
- this[forgotPasswordCollapseSymbol].addEventListener("keydown", (event) => {
1213
- if (event.key === "Enter") {
1214
- this[requestLinkButtonSymbol].click();
1215
- }
1216
- });
1217
-
1218
- this[digitsCollapseSymbol].addEventListener("keydown", (event) => {
1219
- if (event.key === "Enter") {
1220
- this[digitsButtonSymbol].click();
1221
- }
1222
- });
1223
-
1224
- this[loginButtonSymbol].setOption("actions.click", (event) => {
1225
- let username = this.shadowRoot.querySelector(
1226
- "input[name='username']",
1227
- ).value;
1228
-
1229
- // New structured callback handling for username (backwards compatible)
1230
- const userCallback = this.getOption("callbacks.username");
1231
- if (isFunction(userCallback)) {
1232
- const result = normalizeCallbackResult(
1233
- userCallback.call(this, username),
1234
- username,
1235
- );
1236
- username = result.value;
1237
-
1238
- // If callback explicitly marks invalid or wants to stop, handle immediately
1239
- if (result.valid === false || result.stop === true) {
1240
- const timeout = this.getOption("timeoutForMessage");
1241
- const msg =
1242
- result.message || this.getOption("labels.messageEmptyUserName");
1243
-
1244
- this.setOption("classes.usernameInvalid", "invalid");
1245
- this[loginButtonSymbol].setMessage(msg);
1246
- this[loginButtonSymbol].showMessage(timeout);
1247
- this[loginButtonSymbol].setState("failed", timeout);
1248
-
1249
- setTimeout(() => {
1250
- this.shadowRoot.querySelector("input[name='username']").focus();
1251
- }, 0);
1252
- return;
1253
- }
1254
- }
1255
-
1256
- const password = this.shadowRoot.querySelector("monster-password").value;
1257
-
1258
- let missingBits = 0;
1259
- if (username === "" || username === null) {
1260
- this.setOption("classes.usernameInvalid", "invalid");
1261
- missingBits |= 1; // Set bit 1 for username
1262
- } else {
1263
- this.setOption("classes.usernameInvalid", "");
1264
- }
1265
-
1266
- if (password === "" || password === null) {
1267
- this.setOption("classes.passwordInvalid", "invalid");
1268
- missingBits |= 2; // Set bit 2 for password
1269
- } else {
1270
- this.setOption("classes.passwordInvalid", "");
1271
- }
1272
-
1273
- let msg = null;
1274
- if (missingBits === 1) {
1275
- // missing username
1276
- msg = this.getOption("labels.messageEmptyUserName");
1277
-
1278
- setTimeout(() => {
1279
- this.shadowRoot.querySelector("input[name='username']").focus();
1280
- }, 0);
1281
- } else if (missingBits === 2) {
1282
- // missing password
1283
- msg = this.getOption("labels.messageEmptyPassword");
1284
-
1285
- setTimeout(() => {
1286
- this.shadowRoot.querySelector("monster-password").focus();
1287
- });
1288
- } else if (missingBits === 3) {
1289
- msg = this.getOption("labels.messageEmptyBoth");
1290
-
1291
- setTimeout(() => {
1292
- this.shadowRoot.querySelector("input[name='username']").focus();
1293
- }, 0);
1294
- }
1295
-
1296
- const timeout = this.getOption("timeoutForMessage");
1297
-
1298
- if (msg !== null && msg !== undefined) {
1299
- this[loginButtonSymbol].setMessage(msg);
1300
- this[loginButtonSymbol].showMessage(timeout);
1301
- this[loginButtonSymbol].setState("failed", timeout);
1302
- return;
1303
- }
1304
-
1305
- const url = this.getOption("fetch.login.url");
1306
-
1307
- if (url === "" || url === null || url === undefined) {
1308
- this[loginButtonSymbol].setMessage(
1309
- this.getOption("labels.messageThisFormIsNotConfigured"),
1310
- );
1311
- this[loginButtonSymbol].showMessage(timeout);
1312
- this[loginButtonSymbol].setState("failed", timeout);
1313
- return;
1314
- }
1315
-
1316
- const identifierField =
1317
- this.getOption("fetch.login.payload.identifier") || "username";
1318
-
1319
- const passwordField =
1320
- this.getOption("fetch.login.payload.password") || "password";
1321
-
1322
- const payload = {
1323
- [identifierField]: username,
1324
- [passwordField]: password,
1325
- };
1326
-
1327
- const options = {
1328
- method: this.getOption("fetch.login.method"),
1329
- mode: this.getOption("fetch.login.mode"),
1330
- headers: this.getOption("fetch.login.headers"),
1331
- credentials: this.getOption("fetch.login.credentials"),
1332
- body: JSON.stringify(payload),
1333
- };
1334
-
1335
- getWindow()
1336
- .fetch(url, options)
1337
- .then((response) => {
1338
- if (response.ok) {
1339
- this[loginButtonSymbol].setState("successful", timeout);
1340
- setTimeout(() => {
1341
- this.openLoggedIn();
1342
- }, 1200);
1343
- } else {
1344
- if (response.status === 403) {
1345
- this[loginButtonSymbol].setMessage(
1346
- this.getOption("labels.messageForbidden"),
1347
- );
1348
- } else if (response.status === 401) {
1349
- const wwwAuthenticateHeader =
1350
- response.headers.get("www-authenticate");
1351
- if (wwwAuthenticateHeader) {
1352
- const wwwAuthenticateParts = wwwAuthenticateHeader
1353
- .split(/,\s*/)
1354
- .map((part) => {
1355
- const [key, value] = part.split("=");
1356
- return {
1357
- key: key.trim(),
1358
- value: value ? value.trim().replace(/^"|"$/g, "") : null,
1359
- };
1360
- });
1361
-
1362
- const filteredParts = wwwAuthenticateParts.filter(
1363
- (part) => part.key.toLowerCase() === "2fa",
1364
- );
1365
- if (filteredParts.length > 0) {
1366
- const timeout = this.getOption("timeoutForSuccess");
1367
- this[loginButtonSymbol].setState("successful", timeout);
1368
- setTimeout(() => {
1369
- this.openSecondFactor();
1370
- const digitsElement = this.shadowRoot.getElementById(
1371
- "secondFactorControl",
1372
- );
1373
- digitsElement.focus();
1374
- }, timeout);
1375
- return;
1376
- }
1377
- }
1378
-
1379
- this[loginButtonSymbol].setMessage(
1380
- this.getOption("labels.messageLoginFailed"),
1381
- );
1382
- } else {
1383
- this[loginButtonSymbol].setMessage(
1384
- this.getOption("labels.messageSomethingWentWrong"),
1385
- );
1386
- }
1387
- this[loginButtonSymbol].showMessage(timeout);
1388
- this[loginButtonSymbol].setState("failed", timeout);
1389
-
1390
- setTimeout(() => {
1391
- this.shadowRoot.querySelector("input[name='username']").focus();
1392
- }, 0);
1393
- }
1394
- })
1395
- .catch((error) => {
1396
- this[loginButtonSymbol].setMessage(
1397
- this.getOption("labels.messageSomethingWentWrong"),
1398
- );
1399
- this[loginButtonSymbol].showMessage(timeout);
1400
- this[loginButtonSymbol].setState("failed", timeout);
1401
-
1402
- setTimeout(() => {
1403
- this.shadowRoot.querySelector("input[name='username']").focus();
1404
- }, 0);
1405
- });
1406
- });
1407
-
1408
- this[requestLinkButtonSymbol].setOption("actions.click", (event) => {
1409
- const emailElement = this.shadowRoot.querySelector("input[name='email']");
1410
-
1411
- // get email value and HTML validity
1412
- let mail = emailElement.value;
1413
- let valid = emailElement.checkValidity();
1414
-
1415
- const timeout = this.getOption("timeoutForMessage");
1416
-
1417
- // New structured callback handling for forgotPassword (backwards compatible)
1418
- const mailCallback = this.getOption("callbacks.forgotPassword");
1419
- if (isFunction(mailCallback)) {
1420
- const result = normalizeCallbackResult(
1421
- mailCallback.call(this, mail),
1422
- mail,
1423
- );
1424
-
1425
- mail = result.value;
1426
-
1427
- if (result.valid !== undefined) {
1428
- valid = result.valid;
1429
- }
1430
-
1431
- if (result.valid === false || result.stop === true) {
1432
- this.setOption("classes.emailInvalid", "invalid");
1433
-
1434
- const msg =
1435
- result.message ||
1436
- (mail === "" || mail === null
1437
- ? this.getOption("labels.messageEmptyEmail")
1438
- : this.getOption("labels.messageInvalidEmail"));
1439
-
1440
- this[requestLinkButtonSymbol].setMessage(msg);
1441
- this[requestLinkButtonSymbol].showMessage(timeout);
1442
- this[requestLinkButtonSymbol].setState("failed", timeout);
1443
- return;
1444
- }
1445
- }
1446
-
1447
- let msg = null;
1448
- if (mail === "" || mail === null) {
1449
- this.setOption("classes.emailInvalid", "invalid");
1450
- msg = this.getOption("labels.messageEmptyEmail");
1451
- } else if (!valid) {
1452
- this.setOption("classes.emailInvalid", "invalid");
1453
- msg = this.getOption("labels.messageInvalidEmail");
1454
- } else {
1455
- this.setOption("classes.emailInvalid", "");
1456
- }
1457
-
1458
- if (msg !== null && msg !== undefined) {
1459
- this[requestLinkButtonSymbol].setMessage(msg);
1460
- this[requestLinkButtonSymbol].showMessage(timeout);
1461
- this[requestLinkButtonSymbol].setState("failed", timeout);
1462
- return;
1463
- }
1464
-
1465
- const url = this.getOption("fetch.forgotPassword.url");
1466
-
1467
- if (url === "" || url === null || url === undefined) {
1468
- this[requestLinkButtonSymbol].setMessage(
1469
- this.getOption("labels.messageThisFormIsNotConfigured"),
1470
- );
1471
- this[requestLinkButtonSymbol].showMessage(timeout);
1472
- this[requestLinkButtonSymbol].setState("failed", timeout);
1473
- return;
1474
- }
1475
-
1476
- const options = {
1477
- method: this.getOption("fetch.forgotPassword.method"),
1478
- mode: this.getOption("fetch.forgotPassword.mode"),
1479
- headers: this.getOption("fetch.forgotPassword.headers"),
1480
- credentials: this.getOption("fetch.forgotPassword.credentials"),
1481
- body: JSON.stringify({ mail }),
1482
- };
1483
-
1484
- getWindow()
1485
- .fetch(url, options)
1486
- .then((response) => {
1487
- if (response.ok) {
1488
- const timeoutSuccess = this.getOption("timeoutForSuccess");
1489
- this[requestLinkButtonSymbol].setState("successful", timeoutSuccess);
1490
- setTimeout(() => {
1491
- this.openDigits();
1492
- }, timeoutSuccess);
1493
- } else {
1494
- if (response.status === 403) {
1495
- this[requestLinkButtonSymbol].setMessage(
1496
- this.getOption("labels.messageForbidden"),
1497
- );
1498
- } else if (response.status === 401) {
1499
- if (
1500
- response.headers.has("x-password-reset") &&
1501
- response.headers.get("x-password-reset").includes("disabled")
1502
- ) {
1503
- this[requestLinkButtonSymbol].setMessage(
1504
- this.getOption("labels.messagePasswordResetDisabled"),
1505
- );
1506
- } else {
1507
- this[requestLinkButtonSymbol].setMessage(
1508
- this.getOption("labels.messageLoginFailed"),
1509
- );
1510
- }
1511
- } else {
1512
- this[requestLinkButtonSymbol].setMessage(
1513
- this.getOption("labels.messageSomethingWentWrong"),
1514
- );
1515
- }
1516
- this[requestLinkButtonSymbol].showMessage(timeout);
1517
- this[requestLinkButtonSymbol].setState("failed", timeout);
1518
- }
1519
- })
1520
- .catch(() => {
1521
- this[requestLinkButtonSymbol].setMessage(
1522
- this.getOption("labels.messageSomethingWentWrong"),
1523
- );
1524
- this[requestLinkButtonSymbol].showMessage(timeout);
1525
- this[requestLinkButtonSymbol].setState("failed", timeout);
1526
- });
1527
- });
1528
-
1529
- this[secondFactorButtonSymbol].setOption("actions.click", (event) => {
1530
- const digitsElement = this.shadowRoot.getElementById("secondFactorControl");
1531
-
1532
- const digits = digitsElement.value;
1533
- const valid = digitsElement.checkValidity();
1534
-
1535
- let msg = null;
1536
- if (digits === "" || digits === null) {
1537
- msg = this.getOption("labels.digitsEmpty");
1538
- } else if (!valid) {
1539
- msg = this.getOption("labels.digitsInvalid");
1540
- }
1541
-
1542
- const timeout = this.getOption("timeoutForMessage");
1543
-
1544
- if (msg !== null && msg !== undefined) {
1545
- this[secondFactorButtonSymbol].setMessage(msg);
1546
- this[secondFactorButtonSymbol].showMessage(timeout);
1547
- this[secondFactorButtonSymbol].setState("failed", timeout);
1548
- return;
1549
- }
1550
-
1551
- const url = this.getOption("fetch.secondFactor.url");
1552
-
1553
- if (url === "" || url === null || url === undefined) {
1554
- this[secondFactorButtonSymbol].setMessage(
1555
- this.getOption("labels.messageThisFormIsNotConfigured"),
1556
- );
1557
- this[secondFactorButtonSymbol].showMessage(timeout);
1558
- this[secondFactorButtonSymbol].setState("failed", timeout);
1559
- return;
1560
- }
1561
-
1562
- const options = {
1563
- method: this.getOption("fetch.secondFactor.method"),
1564
- mode: this.getOption("fetch.secondFactor.mode"),
1565
- headers: this.getOption("fetch.secondFactor.headers"),
1566
- credentials: this.getOption("fetch.secondFactor.credentials"),
1567
- body: JSON.stringify({ digits }),
1568
- };
1569
-
1570
- getWindow()
1571
- .fetch(url, options)
1572
- .then((response) => {
1573
- if (response.ok) {
1574
- const timeoutSuccess = this.getOption("timeoutForSuccess");
1575
- this[secondFactorButtonSymbol].setState("successful", timeoutSuccess);
1576
- fireEvent(this, "second-factor-success");
1577
- setTimeout(() => {
1578
- this.openLoggedIn();
1579
- }, timeoutSuccess);
1580
- } else {
1581
- if (response.status === 403) {
1582
- this[secondFactorButtonSymbol].setMessage(
1583
- this.getOption("labels.messageForbidden"),
1584
- );
1585
- } else if (response.status === 401) {
1586
- this[secondFactorButtonSymbol].setMessage(
1587
- this.getOption("labels.messageLoginFailed"),
1588
- );
1589
- } else {
1590
- this[secondFactorButtonSymbol].setMessage(
1591
- this.getOption("labels.messageSomethingWentWrong"),
1592
- );
1593
- }
1594
- this[secondFactorButtonSymbol].showMessage(timeout);
1595
- this[secondFactorButtonSymbol].setState("failed", timeout);
1596
- setTimeout(() => {
1597
- digitsElement.focus();
1598
- }, 0);
1599
- }
1600
- })
1601
- .catch(() => {
1602
- this[secondFactorButtonSymbol].setMessage(
1603
- this.getOption("labels.messageSomethingWentWrong"),
1604
- );
1605
- this[secondFactorButtonSymbol].showMessage(timeout);
1606
- this[secondFactorButtonSymbol].setState("failed", timeout);
1607
- setTimeout(() => {
1608
- digitsElement.focus();
1609
- }, 0);
1610
- });
1611
- });
1612
-
1613
- this[digitsButtonSymbol].setOption("actions.click", (event) => {
1614
- const digitsElement = this.shadowRoot.getElementById("digitsControl");
1615
-
1616
- const digits = digitsElement.value;
1617
- const valid = digitsElement.checkValidity();
1618
-
1619
- let msg = null;
1620
- if (digits === "" || digits === null || digits === undefined) {
1621
- msg = this.getOption("labels.digitsEmpty");
1622
- } else if (!valid) {
1623
- msg = this.getOption("labels.digitsInvalid");
1624
- }
1625
-
1626
- const timeout = this.getOption("timeoutForMessage");
1627
- if (msg !== null && msg !== undefined) {
1628
- this[digitsButtonSymbol].setMessage(msg);
1629
- this[digitsButtonSymbol].showMessage(timeout);
1630
- this[digitsButtonSymbol].setState("failed", timeout);
1631
- return;
1632
- }
1633
-
1634
- const url = this.getOption("fetch.digits.url");
1635
-
1636
- if (url === "" || url === null || url === undefined) {
1637
- this[digitsButtonSymbol].setMessage(
1638
- this.getOption("labels.messageThisFormIsNotConfigured"),
1639
- );
1640
- this[digitsButtonSymbol].showMessage(timeout);
1641
- this[digitsButtonSymbol].setState("failed", timeout);
1642
- return;
1643
- }
1644
-
1645
- const options = {
1646
- method: this.getOption("fetch.digits.method"),
1647
- mode: this.getOption("fetch.digits.mode"),
1648
- headers: this.getOption("fetch.digits.headers"),
1649
- credentials: this.getOption("fetch.digits.credentials"),
1650
- body: JSON.stringify({ digits }),
1651
- };
1652
-
1653
- getWindow()
1654
- .fetch(url, options)
1655
- .then((response) => {
1656
- const timeoutSuccess = this.getOption("timeoutForSuccess");
1657
-
1658
- if (response.ok) {
1659
- this[digitsButtonSymbol].setState("successful", timeoutSuccess);
1660
- fireEvent(this, "digits-success");
1661
- setTimeout(() => {
1662
- this.openLoggedIn();
1663
- }, timeoutSuccess);
1664
- } else {
1665
- if (response.status === 403) {
1666
- this[digitsButtonSymbol].setMessage(
1667
- this.getOption("labels.messageForbidden"),
1668
- );
1669
- } else if (response.status === 401) {
1670
- this[digitsButtonSymbol].setMessage(
1671
- this.getOption("labels.messageLoginFailed"),
1672
- );
1673
- } else {
1674
- this[digitsButtonSymbol].setMessage(
1675
- this.getOption("labels.messageSomethingWentWrong"),
1676
- );
1677
- }
1678
- this[digitsButtonSymbol].showMessage(timeout);
1679
- this[digitsButtonSymbol].setState("failed", timeout);
1680
- setTimeout(() => {
1681
- digitsElement.focus();
1682
- }, 0);
1683
- }
1684
- })
1685
- .catch(() => {
1686
- this[digitsButtonSymbol].setMessage(
1687
- this.getOption("labels.messageSomethingWentWrong"),
1688
- );
1689
- this[digitsButtonSymbol].showMessage(timeout);
1690
- this[digitsButtonSymbol].setState("failed", timeout);
1691
- setTimeout(() => {
1692
- digitsElement.focus();
1693
- }, 0);
1694
- });
1695
- });
1696
-
1697
- return this;
1144
+ const self = this;
1145
+ const element = this[loginElementSymbol];
1146
+
1147
+ const type = "click";
1148
+
1149
+ element.addEventListener(type, function (event) {
1150
+ const callback = self.getOption("actions.click");
1151
+
1152
+ fireCustomEvent(self, "monster-login-clicked", {
1153
+ element: self,
1154
+ });
1155
+
1156
+ if (!isFunction(callback)) {
1157
+ return;
1158
+ }
1159
+
1160
+ const element = findTargetElementFromEvent(
1161
+ event,
1162
+ ATTRIBUTE_ROLE,
1163
+ "control",
1164
+ );
1165
+
1166
+ if (!(element instanceof Node && self.hasNode(element))) {
1167
+ return;
1168
+ }
1169
+
1170
+ callback.call(self, event);
1171
+ });
1172
+
1173
+ this[forgotPasswordLinkSymbol].addEventListener(type, (event) => {
1174
+ event.preventDefault();
1175
+ this[forgotPasswordCollapseSymbol].open();
1176
+ setTimeout(() => {
1177
+ this.shadowRoot.querySelector("input[name='email']").focus();
1178
+ }, 0);
1179
+ });
1180
+
1181
+ this[loginLinkSymbol].addEventListener(type, (event) => {
1182
+ event.preventDefault();
1183
+ this[loginCollapseSymbol].open();
1184
+
1185
+ setTimeout(() => {
1186
+ this.shadowRoot.querySelector("input[name='username']").focus();
1187
+ }, 0);
1188
+ });
1189
+
1190
+ for (const e of this[resetLoginProcessLinksSymbol]) {
1191
+ e.addEventListener(type, (event) => {
1192
+ event.preventDefault();
1193
+ this[loginCollapseSymbol].open();
1194
+ setTimeout(() => {
1195
+ this.shadowRoot.querySelector("input[name='username']").focus();
1196
+ }, 0);
1197
+ });
1198
+ }
1199
+
1200
+ this[loginCollapseSymbol].addEventListener("keydown", (event) => {
1201
+ if (event.key === "Enter") {
1202
+ this[loginButtonSymbol].click();
1203
+ }
1204
+ });
1205
+
1206
+ this[secondFactorCollapseSymbol].addEventListener("keydown", (event) => {
1207
+ if (event.key === "Enter") {
1208
+ this[secondFactorButtonSymbol].click();
1209
+ }
1210
+ });
1211
+
1212
+ this[forgotPasswordCollapseSymbol].addEventListener("keydown", (event) => {
1213
+ if (event.key === "Enter") {
1214
+ this[requestLinkButtonSymbol].click();
1215
+ }
1216
+ });
1217
+
1218
+ this[digitsCollapseSymbol].addEventListener("keydown", (event) => {
1219
+ if (event.key === "Enter") {
1220
+ this[digitsButtonSymbol].click();
1221
+ }
1222
+ });
1223
+
1224
+ this[loginButtonSymbol].setOption("actions.click", (event) => {
1225
+ let username = this.shadowRoot.querySelector(
1226
+ "input[name='username']",
1227
+ ).value;
1228
+
1229
+ // New structured callback handling for username (backwards compatible)
1230
+ const userCallback = this.getOption("callbacks.username");
1231
+ if (isFunction(userCallback)) {
1232
+ const result = normalizeCallbackResult(
1233
+ userCallback.call(this, username),
1234
+ username,
1235
+ );
1236
+ username = result.value;
1237
+
1238
+ // If callback explicitly marks invalid or wants to stop, handle immediately
1239
+ if (result.valid === false || result.stop === true) {
1240
+ const timeout = this.getOption("timeoutForMessage");
1241
+ const msg =
1242
+ result.message || this.getOption("labels.messageEmptyUserName");
1243
+
1244
+ this.setOption("classes.usernameInvalid", "invalid");
1245
+ this[loginButtonSymbol].setMessage(msg);
1246
+ this[loginButtonSymbol].showMessage(timeout);
1247
+ this[loginButtonSymbol].setState("failed", timeout);
1248
+
1249
+ setTimeout(() => {
1250
+ this.shadowRoot.querySelector("input[name='username']").focus();
1251
+ }, 0);
1252
+ return;
1253
+ }
1254
+ }
1255
+
1256
+ const password = this.shadowRoot.querySelector("monster-password").value;
1257
+
1258
+ let missingBits = 0;
1259
+ if (username === "" || username === null) {
1260
+ this.setOption("classes.usernameInvalid", "invalid");
1261
+ missingBits |= 1; // Set bit 1 for username
1262
+ } else {
1263
+ this.setOption("classes.usernameInvalid", "");
1264
+ }
1265
+
1266
+ if (password === "" || password === null) {
1267
+ this.setOption("classes.passwordInvalid", "invalid");
1268
+ missingBits |= 2; // Set bit 2 for password
1269
+ } else {
1270
+ this.setOption("classes.passwordInvalid", "");
1271
+ }
1272
+
1273
+ let msg = null;
1274
+ if (missingBits === 1) {
1275
+ // missing username
1276
+ msg = this.getOption("labels.messageEmptyUserName");
1277
+
1278
+ setTimeout(() => {
1279
+ this.shadowRoot.querySelector("input[name='username']").focus();
1280
+ }, 0);
1281
+ } else if (missingBits === 2) {
1282
+ // missing password
1283
+ msg = this.getOption("labels.messageEmptyPassword");
1284
+
1285
+ setTimeout(() => {
1286
+ this.shadowRoot.querySelector("monster-password").focus();
1287
+ });
1288
+ } else if (missingBits === 3) {
1289
+ msg = this.getOption("labels.messageEmptyBoth");
1290
+
1291
+ setTimeout(() => {
1292
+ this.shadowRoot.querySelector("input[name='username']").focus();
1293
+ }, 0);
1294
+ }
1295
+
1296
+ const timeout = this.getOption("timeoutForMessage");
1297
+
1298
+ if (msg !== null && msg !== undefined) {
1299
+ this[loginButtonSymbol].setMessage(msg);
1300
+ this[loginButtonSymbol].showMessage(timeout);
1301
+ this[loginButtonSymbol].setState("failed", timeout);
1302
+ return;
1303
+ }
1304
+
1305
+ const url = this.getOption("fetch.login.url");
1306
+
1307
+ if (url === "" || url === null || url === undefined) {
1308
+ this[loginButtonSymbol].setMessage(
1309
+ this.getOption("labels.messageThisFormIsNotConfigured"),
1310
+ );
1311
+ this[loginButtonSymbol].showMessage(timeout);
1312
+ this[loginButtonSymbol].setState("failed", timeout);
1313
+ return;
1314
+ }
1315
+
1316
+ const identifierField =
1317
+ this.getOption("fetch.login.payload.identifier") || "username";
1318
+
1319
+ const passwordField =
1320
+ this.getOption("fetch.login.payload.password") || "password";
1321
+
1322
+ const payload = {
1323
+ [identifierField]: username,
1324
+ [passwordField]: password,
1325
+ };
1326
+
1327
+ const options = {
1328
+ method: this.getOption("fetch.login.method"),
1329
+ mode: this.getOption("fetch.login.mode"),
1330
+ headers: this.getOption("fetch.login.headers"),
1331
+ credentials: this.getOption("fetch.login.credentials"),
1332
+ body: JSON.stringify(payload),
1333
+ };
1334
+
1335
+ getWindow()
1336
+ .fetch(url, options)
1337
+ .then((response) => {
1338
+ if (response.ok) {
1339
+ this[loginButtonSymbol].setState("successful", timeout);
1340
+ setTimeout(() => {
1341
+ this.openLoggedIn();
1342
+ }, 1200);
1343
+ } else {
1344
+ if (response.status === 403) {
1345
+ this[loginButtonSymbol].setMessage(
1346
+ this.getOption("labels.messageForbidden"),
1347
+ );
1348
+ } else if (response.status === 401) {
1349
+ const wwwAuthenticateHeader =
1350
+ response.headers.get("www-authenticate");
1351
+ if (wwwAuthenticateHeader) {
1352
+ const wwwAuthenticateParts = wwwAuthenticateHeader
1353
+ .split(/,\s*/)
1354
+ .map((part) => {
1355
+ const [key, value] = part.split("=");
1356
+ return {
1357
+ key: key.trim(),
1358
+ value: value ? value.trim().replace(/^"|"$/g, "") : null,
1359
+ };
1360
+ });
1361
+
1362
+ const filteredParts = wwwAuthenticateParts.filter(
1363
+ (part) => part.key.toLowerCase() === "2fa",
1364
+ );
1365
+ if (filteredParts.length > 0) {
1366
+ const timeout = this.getOption("timeoutForSuccess");
1367
+ this[loginButtonSymbol].setState("successful", timeout);
1368
+ setTimeout(() => {
1369
+ this.openSecondFactor();
1370
+ const digitsElement = this.shadowRoot.getElementById(
1371
+ "secondFactorControl",
1372
+ );
1373
+ digitsElement.focus();
1374
+ }, timeout);
1375
+ return;
1376
+ }
1377
+ }
1378
+
1379
+ this[loginButtonSymbol].setMessage(
1380
+ this.getOption("labels.messageLoginFailed"),
1381
+ );
1382
+ } else {
1383
+ this[loginButtonSymbol].setMessage(
1384
+ this.getOption("labels.messageSomethingWentWrong"),
1385
+ );
1386
+ }
1387
+ this[loginButtonSymbol].showMessage(timeout);
1388
+ this[loginButtonSymbol].setState("failed", timeout);
1389
+
1390
+ setTimeout(() => {
1391
+ this.shadowRoot.querySelector("input[name='username']").focus();
1392
+ }, 0);
1393
+ }
1394
+ })
1395
+ .catch((error) => {
1396
+ this[loginButtonSymbol].setMessage(
1397
+ this.getOption("labels.messageSomethingWentWrong"),
1398
+ );
1399
+ this[loginButtonSymbol].showMessage(timeout);
1400
+ this[loginButtonSymbol].setState("failed", timeout);
1401
+
1402
+ setTimeout(() => {
1403
+ this.shadowRoot.querySelector("input[name='username']").focus();
1404
+ }, 0);
1405
+ });
1406
+ });
1407
+
1408
+ this[requestLinkButtonSymbol].setOption("actions.click", (event) => {
1409
+ const emailElement = this.shadowRoot.querySelector("input[name='email']");
1410
+
1411
+ // get email value and HTML validity
1412
+ let mail = emailElement.value;
1413
+ let valid = emailElement.checkValidity();
1414
+
1415
+ const timeout = this.getOption("timeoutForMessage");
1416
+
1417
+ // New structured callback handling for forgotPassword (backwards compatible)
1418
+ const mailCallback = this.getOption("callbacks.forgotPassword");
1419
+ if (isFunction(mailCallback)) {
1420
+ const result = normalizeCallbackResult(
1421
+ mailCallback.call(this, mail),
1422
+ mail,
1423
+ );
1424
+
1425
+ mail = result.value;
1426
+
1427
+ if (result.valid !== undefined) {
1428
+ valid = result.valid;
1429
+ }
1430
+
1431
+ if (result.valid === false || result.stop === true) {
1432
+ this.setOption("classes.emailInvalid", "invalid");
1433
+
1434
+ const msg =
1435
+ result.message ||
1436
+ (mail === "" || mail === null
1437
+ ? this.getOption("labels.messageEmptyEmail")
1438
+ : this.getOption("labels.messageInvalidEmail"));
1439
+
1440
+ this[requestLinkButtonSymbol].setMessage(msg);
1441
+ this[requestLinkButtonSymbol].showMessage(timeout);
1442
+ this[requestLinkButtonSymbol].setState("failed", timeout);
1443
+ return;
1444
+ }
1445
+ }
1446
+
1447
+ let msg = null;
1448
+ if (mail === "" || mail === null) {
1449
+ this.setOption("classes.emailInvalid", "invalid");
1450
+ msg = this.getOption("labels.messageEmptyEmail");
1451
+ } else if (!valid) {
1452
+ this.setOption("classes.emailInvalid", "invalid");
1453
+ msg = this.getOption("labels.messageInvalidEmail");
1454
+ } else {
1455
+ this.setOption("classes.emailInvalid", "");
1456
+ }
1457
+
1458
+ if (msg !== null && msg !== undefined) {
1459
+ this[requestLinkButtonSymbol].setMessage(msg);
1460
+ this[requestLinkButtonSymbol].showMessage(timeout);
1461
+ this[requestLinkButtonSymbol].setState("failed", timeout);
1462
+ return;
1463
+ }
1464
+
1465
+ const url = this.getOption("fetch.forgotPassword.url");
1466
+
1467
+ if (url === "" || url === null || url === undefined) {
1468
+ this[requestLinkButtonSymbol].setMessage(
1469
+ this.getOption("labels.messageThisFormIsNotConfigured"),
1470
+ );
1471
+ this[requestLinkButtonSymbol].showMessage(timeout);
1472
+ this[requestLinkButtonSymbol].setState("failed", timeout);
1473
+ return;
1474
+ }
1475
+
1476
+ const options = {
1477
+ method: this.getOption("fetch.forgotPassword.method"),
1478
+ mode: this.getOption("fetch.forgotPassword.mode"),
1479
+ headers: this.getOption("fetch.forgotPassword.headers"),
1480
+ credentials: this.getOption("fetch.forgotPassword.credentials"),
1481
+ body: JSON.stringify({ mail }),
1482
+ };
1483
+
1484
+ getWindow()
1485
+ .fetch(url, options)
1486
+ .then((response) => {
1487
+ if (response.ok) {
1488
+ const timeoutSuccess = this.getOption("timeoutForSuccess");
1489
+ this[requestLinkButtonSymbol].setState("successful", timeoutSuccess);
1490
+ setTimeout(() => {
1491
+ this.openDigits();
1492
+ }, timeoutSuccess);
1493
+ } else {
1494
+ if (response.status === 403) {
1495
+ this[requestLinkButtonSymbol].setMessage(
1496
+ this.getOption("labels.messageForbidden"),
1497
+ );
1498
+ } else if (response.status === 401) {
1499
+ if (
1500
+ response.headers.has("x-password-reset") &&
1501
+ response.headers.get("x-password-reset").includes("disabled")
1502
+ ) {
1503
+ this[requestLinkButtonSymbol].setMessage(
1504
+ this.getOption("labels.messagePasswordResetDisabled"),
1505
+ );
1506
+ } else {
1507
+ this[requestLinkButtonSymbol].setMessage(
1508
+ this.getOption("labels.messageLoginFailed"),
1509
+ );
1510
+ }
1511
+ } else {
1512
+ this[requestLinkButtonSymbol].setMessage(
1513
+ this.getOption("labels.messageSomethingWentWrong"),
1514
+ );
1515
+ }
1516
+ this[requestLinkButtonSymbol].showMessage(timeout);
1517
+ this[requestLinkButtonSymbol].setState("failed", timeout);
1518
+ }
1519
+ })
1520
+ .catch(() => {
1521
+ this[requestLinkButtonSymbol].setMessage(
1522
+ this.getOption("labels.messageSomethingWentWrong"),
1523
+ );
1524
+ this[requestLinkButtonSymbol].showMessage(timeout);
1525
+ this[requestLinkButtonSymbol].setState("failed", timeout);
1526
+ });
1527
+ });
1528
+
1529
+ this[secondFactorButtonSymbol].setOption("actions.click", (event) => {
1530
+ const digitsElement = this.shadowRoot.getElementById("secondFactorControl");
1531
+
1532
+ const digits = digitsElement.value;
1533
+ const valid = digitsElement.checkValidity();
1534
+
1535
+ let msg = null;
1536
+ if (digits === "" || digits === null) {
1537
+ msg = this.getOption("labels.digitsEmpty");
1538
+ } else if (!valid) {
1539
+ msg = this.getOption("labels.digitsInvalid");
1540
+ }
1541
+
1542
+ const timeout = this.getOption("timeoutForMessage");
1543
+
1544
+ if (msg !== null && msg !== undefined) {
1545
+ this[secondFactorButtonSymbol].setMessage(msg);
1546
+ this[secondFactorButtonSymbol].showMessage(timeout);
1547
+ this[secondFactorButtonSymbol].setState("failed", timeout);
1548
+ return;
1549
+ }
1550
+
1551
+ const url = this.getOption("fetch.secondFactor.url");
1552
+
1553
+ if (url === "" || url === null || url === undefined) {
1554
+ this[secondFactorButtonSymbol].setMessage(
1555
+ this.getOption("labels.messageThisFormIsNotConfigured"),
1556
+ );
1557
+ this[secondFactorButtonSymbol].showMessage(timeout);
1558
+ this[secondFactorButtonSymbol].setState("failed", timeout);
1559
+ return;
1560
+ }
1561
+
1562
+ const options = {
1563
+ method: this.getOption("fetch.secondFactor.method"),
1564
+ mode: this.getOption("fetch.secondFactor.mode"),
1565
+ headers: this.getOption("fetch.secondFactor.headers"),
1566
+ credentials: this.getOption("fetch.secondFactor.credentials"),
1567
+ body: JSON.stringify({ digits }),
1568
+ };
1569
+
1570
+ getWindow()
1571
+ .fetch(url, options)
1572
+ .then((response) => {
1573
+ if (response.ok) {
1574
+ const timeoutSuccess = this.getOption("timeoutForSuccess");
1575
+ this[secondFactorButtonSymbol].setState("successful", timeoutSuccess);
1576
+ fireEvent(this, "second-factor-success");
1577
+ setTimeout(() => {
1578
+ this.openLoggedIn();
1579
+ }, timeoutSuccess);
1580
+ } else {
1581
+ if (response.status === 403) {
1582
+ this[secondFactorButtonSymbol].setMessage(
1583
+ this.getOption("labels.messageForbidden"),
1584
+ );
1585
+ } else if (response.status === 401) {
1586
+ this[secondFactorButtonSymbol].setMessage(
1587
+ this.getOption("labels.messageLoginFailed"),
1588
+ );
1589
+ } else {
1590
+ this[secondFactorButtonSymbol].setMessage(
1591
+ this.getOption("labels.messageSomethingWentWrong"),
1592
+ );
1593
+ }
1594
+ this[secondFactorButtonSymbol].showMessage(timeout);
1595
+ this[secondFactorButtonSymbol].setState("failed", timeout);
1596
+ setTimeout(() => {
1597
+ digitsElement.focus();
1598
+ }, 0);
1599
+ }
1600
+ })
1601
+ .catch(() => {
1602
+ this[secondFactorButtonSymbol].setMessage(
1603
+ this.getOption("labels.messageSomethingWentWrong"),
1604
+ );
1605
+ this[secondFactorButtonSymbol].showMessage(timeout);
1606
+ this[secondFactorButtonSymbol].setState("failed", timeout);
1607
+ setTimeout(() => {
1608
+ digitsElement.focus();
1609
+ }, 0);
1610
+ });
1611
+ });
1612
+
1613
+ this[digitsButtonSymbol].setOption("actions.click", (event) => {
1614
+ const digitsElement = this.shadowRoot.getElementById("digitsControl");
1615
+
1616
+ const digits = digitsElement.value;
1617
+ const valid = digitsElement.checkValidity();
1618
+
1619
+ let msg = null;
1620
+ if (digits === "" || digits === null || digits === undefined) {
1621
+ msg = this.getOption("labels.digitsEmpty");
1622
+ } else if (!valid) {
1623
+ msg = this.getOption("labels.digitsInvalid");
1624
+ }
1625
+
1626
+ const timeout = this.getOption("timeoutForMessage");
1627
+ if (msg !== null && msg !== undefined) {
1628
+ this[digitsButtonSymbol].setMessage(msg);
1629
+ this[digitsButtonSymbol].showMessage(timeout);
1630
+ this[digitsButtonSymbol].setState("failed", timeout);
1631
+ return;
1632
+ }
1633
+
1634
+ const url = this.getOption("fetch.digits.url");
1635
+
1636
+ if (url === "" || url === null || url === undefined) {
1637
+ this[digitsButtonSymbol].setMessage(
1638
+ this.getOption("labels.messageThisFormIsNotConfigured"),
1639
+ );
1640
+ this[digitsButtonSymbol].showMessage(timeout);
1641
+ this[digitsButtonSymbol].setState("failed", timeout);
1642
+ return;
1643
+ }
1644
+
1645
+ const options = {
1646
+ method: this.getOption("fetch.digits.method"),
1647
+ mode: this.getOption("fetch.digits.mode"),
1648
+ headers: this.getOption("fetch.digits.headers"),
1649
+ credentials: this.getOption("fetch.digits.credentials"),
1650
+ body: JSON.stringify({ digits }),
1651
+ };
1652
+
1653
+ getWindow()
1654
+ .fetch(url, options)
1655
+ .then((response) => {
1656
+ const timeoutSuccess = this.getOption("timeoutForSuccess");
1657
+
1658
+ if (response.ok) {
1659
+ this[digitsButtonSymbol].setState("successful", timeoutSuccess);
1660
+ fireEvent(this, "digits-success");
1661
+ setTimeout(() => {
1662
+ this.openLoggedIn();
1663
+ }, timeoutSuccess);
1664
+ } else {
1665
+ if (response.status === 403) {
1666
+ this[digitsButtonSymbol].setMessage(
1667
+ this.getOption("labels.messageForbidden"),
1668
+ );
1669
+ } else if (response.status === 401) {
1670
+ this[digitsButtonSymbol].setMessage(
1671
+ this.getOption("labels.messageLoginFailed"),
1672
+ );
1673
+ } else {
1674
+ this[digitsButtonSymbol].setMessage(
1675
+ this.getOption("labels.messageSomethingWentWrong"),
1676
+ );
1677
+ }
1678
+ this[digitsButtonSymbol].showMessage(timeout);
1679
+ this[digitsButtonSymbol].setState("failed", timeout);
1680
+ setTimeout(() => {
1681
+ digitsElement.focus();
1682
+ }, 0);
1683
+ }
1684
+ })
1685
+ .catch(() => {
1686
+ this[digitsButtonSymbol].setMessage(
1687
+ this.getOption("labels.messageSomethingWentWrong"),
1688
+ );
1689
+ this[digitsButtonSymbol].showMessage(timeout);
1690
+ this[digitsButtonSymbol].setState("failed", timeout);
1691
+ setTimeout(() => {
1692
+ digitsElement.focus();
1693
+ }, 0);
1694
+ });
1695
+ });
1696
+
1697
+ return this;
1698
1698
  }
1699
1699
 
1700
1700
  /**
@@ -1702,50 +1702,50 @@ function initEventHandler() {
1702
1702
  * @return {void}
1703
1703
  */
1704
1704
  function initControlReferences() {
1705
- this[loginElementSymbol] = this.shadowRoot.querySelector(
1706
- `[${ATTRIBUTE_ROLE}="control"]`,
1707
- );
1708
-
1709
- // data-monster-role="forgot-password-link"
1710
-
1711
- this[forgotPasswordLinkSymbol] = this.shadowRoot.querySelector(
1712
- `[data-monster-role="forgot-password-link"]`,
1713
- );
1714
-
1715
- this[forgotPasswordCollapseSymbol] = this.shadowRoot.querySelector(
1716
- `[data-monster-role="forgot-password-collapse"]`,
1717
- );
1718
-
1719
- this[loginCollapseSymbol] = this.shadowRoot.querySelector(
1720
- `[data-monster-role="login-collapse"]`,
1721
- );
1722
-
1723
- this[loginLinkSymbol] = this.shadowRoot.querySelector(
1724
- `[data-monster-role="login-link"]`,
1725
- );
1726
-
1727
- this[secondFactorCollapseSymbol] = this.shadowRoot.querySelector(
1728
- `[data-monster-role="second-factor-collapse"]`,
1729
- );
1730
-
1731
- this[resetLoginProcessLinksSymbol] = this.shadowRoot.querySelectorAll(
1732
- `[data-monster-role="reset-login-process-link"]`,
1733
- );
1734
-
1735
- this[loggedInCollapseSymbol] = this.shadowRoot.querySelector(
1736
- `[data-monster-role="logged-in-collapse"]`,
1737
- );
1738
-
1739
- this[digitsCollapseSymbol] = this.shadowRoot.querySelector(
1740
- `[data-monster-role="digits-collapse"]`,
1741
- );
1742
-
1743
- this[loginButtonSymbol] = this.shadowRoot.getElementById("loginButton");
1744
- this[requestLinkButtonSymbol] =
1745
- this.shadowRoot.getElementById("requestLinkButton");
1746
- this[secondFactorButtonSymbol] =
1747
- this.shadowRoot.getElementById("secondFactorButton");
1748
- this[digitsButtonSymbol] = this.shadowRoot.getElementById("digitsButton");
1705
+ this[loginElementSymbol] = this.shadowRoot.querySelector(
1706
+ `[${ATTRIBUTE_ROLE}="control"]`,
1707
+ );
1708
+
1709
+ // data-monster-role="forgot-password-link"
1710
+
1711
+ this[forgotPasswordLinkSymbol] = this.shadowRoot.querySelector(
1712
+ `[data-monster-role="forgot-password-link"]`,
1713
+ );
1714
+
1715
+ this[forgotPasswordCollapseSymbol] = this.shadowRoot.querySelector(
1716
+ `[data-monster-role="forgot-password-collapse"]`,
1717
+ );
1718
+
1719
+ this[loginCollapseSymbol] = this.shadowRoot.querySelector(
1720
+ `[data-monster-role="login-collapse"]`,
1721
+ );
1722
+
1723
+ this[loginLinkSymbol] = this.shadowRoot.querySelector(
1724
+ `[data-monster-role="login-link"]`,
1725
+ );
1726
+
1727
+ this[secondFactorCollapseSymbol] = this.shadowRoot.querySelector(
1728
+ `[data-monster-role="second-factor-collapse"]`,
1729
+ );
1730
+
1731
+ this[resetLoginProcessLinksSymbol] = this.shadowRoot.querySelectorAll(
1732
+ `[data-monster-role="reset-login-process-link"]`,
1733
+ );
1734
+
1735
+ this[loggedInCollapseSymbol] = this.shadowRoot.querySelector(
1736
+ `[data-monster-role="logged-in-collapse"]`,
1737
+ );
1738
+
1739
+ this[digitsCollapseSymbol] = this.shadowRoot.querySelector(
1740
+ `[data-monster-role="digits-collapse"]`,
1741
+ );
1742
+
1743
+ this[loginButtonSymbol] = this.shadowRoot.getElementById("loginButton");
1744
+ this[requestLinkButtonSymbol] =
1745
+ this.shadowRoot.getElementById("requestLinkButton");
1746
+ this[secondFactorButtonSymbol] =
1747
+ this.shadowRoot.getElementById("secondFactorButton");
1748
+ this[digitsButtonSymbol] = this.shadowRoot.getElementById("digitsButton");
1749
1749
  }
1750
1750
 
1751
1751
  /**
@@ -1753,8 +1753,8 @@ function initControlReferences() {
1753
1753
  * @return {string}
1754
1754
  */
1755
1755
  function getTemplate() {
1756
- // language=HTML
1757
- return `
1756
+ // language=HTML
1757
+ return `
1758
1758
 
1759
1759
  <template id="urls">
1760
1760
  <li><a data-monster-attributes="href path:urls.url"