@topconsultnpm/sdkui-react-beta 6.11.50 → 6.11.52

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 (41) hide show
  1. package/lib/assets/icomoon.svg +96 -96
  2. package/lib/components/editors/TMFormulaEditor.d.ts +12 -0
  3. package/lib/components/editors/TMFormulaEditor.js +3 -3
  4. package/lib/components/forms/Login/ChangePassword.d.ts +8 -0
  5. package/lib/components/forms/Login/ChangePassword.js +22 -0
  6. package/lib/components/forms/Login/ChangePasswordInputs.d.ts +14 -0
  7. package/lib/components/forms/Login/ChangePasswordInputs.js +67 -0
  8. package/lib/components/forms/Login/Chooser.d.ts +28 -0
  9. package/lib/components/forms/Login/Chooser.js +145 -0
  10. package/lib/components/forms/Login/LOGINLocalizator.d.ts +29 -0
  11. package/lib/components/forms/Login/LOGINLocalizator.js +247 -0
  12. package/lib/components/forms/Login/LoginValidatorService.d.ts +50 -0
  13. package/lib/components/forms/Login/LoginValidatorService.js +162 -0
  14. package/lib/components/forms/Login/Menu.d.ts +10 -0
  15. package/lib/components/forms/Login/Menu.js +48 -0
  16. package/lib/components/forms/Login/OTPReader.d.ts +14 -0
  17. package/lib/components/forms/Login/OTPReader.js +90 -0
  18. package/lib/components/forms/Login/PasswordStrengthChecker.d.ts +7 -0
  19. package/lib/components/forms/Login/PasswordStrengthChecker.js +45 -0
  20. package/lib/components/forms/Login/RapidAccessLogin.d.ts +25 -0
  21. package/lib/components/forms/Login/RapidAccessLogin.js +292 -0
  22. package/lib/components/forms/Login/RecoverPasswordFlow.d.ts +11 -0
  23. package/lib/components/forms/Login/RecoverPasswordFlow.js +95 -0
  24. package/lib/components/forms/Login/SelectBox.d.ts +23 -0
  25. package/lib/components/forms/Login/SelectBox.js +95 -0
  26. package/lib/components/forms/Login/StepIndicator.d.ts +7 -0
  27. package/lib/components/forms/Login/StepIndicator.js +19 -0
  28. package/lib/components/forms/Login/TMLoginForm.d.ts +43 -0
  29. package/lib/components/forms/Login/TMLoginForm.js +642 -0
  30. package/lib/components/forms/Login/TextBox.d.ts +27 -0
  31. package/lib/components/forms/Login/TextBox.js +111 -0
  32. package/lib/components/forms/TMLoginForm.js +9 -10
  33. package/lib/components/index.d.ts +1 -1
  34. package/lib/components/index.js +1 -1
  35. package/lib/helper/helpers.d.ts +1 -0
  36. package/lib/helper/helpers.js +5 -0
  37. package/lib/stories/TMSDKUI_Localizator.stories.d.ts +4 -0
  38. package/lib/stories/TMSDKUI_Localizator.stories.js +123 -0
  39. package/package.json +1 -1
  40. package/lib/components/forms/TMLoginPopupSaveLoginInfo.d.ts +0 -42
  41. package/lib/components/forms/TMLoginPopupSaveLoginInfo.js +0 -425
@@ -0,0 +1,642 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
3
+ import { AppModules, AuthenticationModes, CultureIDs, LocalStorageService, SDK_Globals, SDK_Localizator, SessionDescriptor, TopMediaServer, TopMediaSession } from "@topconsultnpm/sdk-ts-beta";
4
+ import deMessages from "devextreme/localization/messages/de.json";
5
+ import enMessages from "devextreme/localization/messages/en.json";
6
+ import esMessages from "devextreme/localization/messages/es.json";
7
+ import frMessages from "devextreme/localization/messages/fr.json";
8
+ import itMessages from "devextreme/localization/messages/it.json";
9
+ import ptMessages from "devextreme/localization/messages/pt.json";
10
+ import { locale as dxlocale, loadMessages } from "devextreme/localization";
11
+ import six from '@topconsultnpm/sdkui-react-beta/lib/assets/loading.png';
12
+ import styled from "styled-components";
13
+ import Menu from "./Menu";
14
+ import TextBox from "./TextBox";
15
+ import Chooser from "./Chooser";
16
+ import SelectBox from "./SelectBox";
17
+ import it from '../../assets/images/italy.svg';
18
+ import en from '../../assets/images/united-kingdom.svg';
19
+ import es from '../../assets/images/spain.svg';
20
+ import fr from '../../assets/images/france.svg';
21
+ import de from '../../assets/images/german.svg';
22
+ import pt from '../../assets/images/portugal.svg';
23
+ import OTPReader from "./OTPReader";
24
+ import ChangePassword from "./ChangePassword";
25
+ import RecoverPasswordFlow from "./RecoverPasswordFlow";
26
+ import RapidAccessLogin from "./RapidAccessLogin";
27
+ import { LoginValidator } from "./LoginValidatorService";
28
+ import { LOGINLocalizator } from "./LOGINLocalizator";
29
+ import { TMAboutApp } from "../../sidebar/TMAboutApp";
30
+ import { SDKUI_Localizator, IconWifi, IconRefresh, IconInfo, IconAccessPoint, IconArchiveDoc, IconLogin, IconWeb, IconArrowLeft, IconUser, IconPassword } from "../../../helper";
31
+ import { TMColors } from "../../../utils/theme";
32
+ import ShowAlert from "../../base/TMAlert";
33
+ import TMButton from "../../base/TMButton";
34
+ import { useDeviceType, DeviceType } from "../../base/TMDeviceProvider";
35
+ import { TMExceptionBoxManager, TMMessageBoxManager, ButtonNames } from "../../base/TMPopUp";
36
+ import TMSpinner from "../../base/TMSpinner";
37
+ import TMTooltip from "../../base/TMTooltip";
38
+ import TMCheckBox from "../../editors/TMCheckBox";
39
+ export var WindowHeight;
40
+ (function (WindowHeight) {
41
+ WindowHeight["SMALL"] = "sm";
42
+ WindowHeight["MEDIUM"] = "md";
43
+ WindowHeight["LARGE"] = "lg";
44
+ })(WindowHeight || (WindowHeight = {}));
45
+ export const onChangeLanguage = (cultureID) => {
46
+ //localizzazione devexpress
47
+ switch (cultureID) {
48
+ case CultureIDs.De_DE:
49
+ dxlocale("de");
50
+ break;
51
+ case CultureIDs.Es_ES:
52
+ dxlocale("es");
53
+ break;
54
+ case CultureIDs.Fr_FR:
55
+ dxlocale("fr");
56
+ break;
57
+ case CultureIDs.It_IT:
58
+ dxlocale("it");
59
+ break;
60
+ case CultureIDs.Pt_PT:
61
+ dxlocale("pt");
62
+ break;
63
+ default:
64
+ dxlocale("en");
65
+ break;
66
+ }
67
+ SDKUI_Localizator.setLanguage(cultureID);
68
+ SDK_Localizator.setLanguage(cultureID);
69
+ LOGINLocalizator.setLanguage(cultureID);
70
+ };
71
+ export const useCultureID = ({ cultureID = CultureIDs.It_IT }) => {
72
+ const [currentCultureID, setCurrentCultureID] = useState(cultureID);
73
+ useEffect(() => {
74
+ onChangeLanguage(cultureID);
75
+ setCurrentCultureID(cultureID);
76
+ }, [cultureID]);
77
+ useEffect(() => {
78
+ loadMessages(deMessages);
79
+ loadMessages(enMessages);
80
+ loadMessages(esMessages);
81
+ loadMessages(frMessages);
82
+ loadMessages(itMessages);
83
+ loadMessages(ptMessages);
84
+ }, []);
85
+ return (currentCultureID);
86
+ };
87
+ export const cultureIDsDataSource = [{ value: CultureIDs.It_IT, display: "Italiano" }, { value: CultureIDs.Fr_FR, display: "Française" }, { value: CultureIDs.Pt_PT, display: "Português" }, { value: CultureIDs.En_US, display: "English" }, { value: CultureIDs.Es_ES, display: "Español" }, { value: CultureIDs.De_DE, display: "Deutsch" },];
88
+ const TMLoginForm = (props) => {
89
+ const LOCAL_STORAGE_KEY = 'LOGIN_HISTORY';
90
+ const BANNER_DIMENSION = 25;
91
+ const deviceType = useDeviceType();
92
+ const isMobile = useMemo(() => {
93
+ return deviceType === DeviceType.MOBILE;
94
+ }, [deviceType]);
95
+ const isDesktop = useMemo(() => {
96
+ return deviceType === DeviceType.DESKTOP;
97
+ }, [deviceType]);
98
+ const isTablet = useMemo(() => {
99
+ return deviceType === DeviceType.TABLET;
100
+ }, [deviceType]);
101
+ let localRa = LocalStorageService.getItem(LOCAL_STORAGE_KEY);
102
+ const authDomainRef = useRef(null);
103
+ const usernameRef = useRef(null);
104
+ const passwordRef = useRef(null);
105
+ const usernameOnBehalfOfRef = useRef(null);
106
+ const passwordOnBehalfOfRRef = useRef(null);
107
+ const [loginStep, setLoginStep] = useState(1);
108
+ const [tmServer, setTmServer] = useState();
109
+ const [tmSession, setTmSession] = useState();
110
+ const [endpoint, setEndpoint] = useState();
111
+ const [showCultureIDs, setShowCultureIDs] = useState(false);
112
+ const [dcmtArchives, setDcmtArchives] = useState([]);
113
+ const [dcmtArchive, setDcmtArchive] = useState();
114
+ const [authMode, setAuthMode] = useState(AuthenticationModes.TopMedia);
115
+ const [username, setUsername] = useState('SysAdmin');
116
+ const [password, setPassword] = useState('');
117
+ const [authDomain, setAuthDomain] = useState('');
118
+ const [usernameOnBehalf, setUsernameOnBehalf] = useState('');
119
+ const [passwordOnBehalf, setPasswordOnBehalf] = useState('');
120
+ const [showChangePassword, setShowChangePassword] = useState(false);
121
+ const [showForgetPassword, setShowForgetPassword] = useState(false);
122
+ const [showRapidAccess, setShowRapidAccess] = useState(false);
123
+ const [otpCode, setOtpCode] = useState(['', '', '', '', '', '']);
124
+ const [saveLoginEnable, setSaveLoginEnable] = useState(false);
125
+ const [saveLoginName, setSaveLoginName] = useState('');
126
+ const [isSuccess, setIsSuccess] = useState(true);
127
+ const [isOTPSent, setIsOTPSent] = useState(false);
128
+ const [showDefaultLogo, setShowDefaultLogo] = useState(false);
129
+ const loginData = useMemo(() => {
130
+ return {
131
+ authenticationMode: authMode,
132
+ cultureID: props.cultureID ?? CultureIDs.It_IT,
133
+ dcmtArchive: dcmtArchive,
134
+ endpoint: endpoint,
135
+ authDomain: authDomain,
136
+ authDomainOnBehalfOf: authDomain,
137
+ otp: otpCode.join(''),
138
+ password: password,
139
+ passwordOnBehalfOf: passwordOnBehalf,
140
+ rapidAccessName: saveLoginName,
141
+ saveAsRapidAccess: saveLoginEnable,
142
+ username: username,
143
+ usernameOnBehalfOf: usernameOnBehalf
144
+ };
145
+ }, [authMode, props.cultureID, dcmtArchive, endpoint, authDomain, otpCode, password, passwordOnBehalf, saveLoginName, saveLoginEnable, username, usernameOnBehalf]);
146
+ const inputRefs = useMemo(() => {
147
+ switch (authMode) {
148
+ case AuthenticationModes.TopMedia:
149
+ case AuthenticationModes.TopMediaWithMFA: return [usernameRef, passwordRef];
150
+ case AuthenticationModes.WindowsThroughTopMedia: return [authDomainRef, usernameRef, passwordRef];
151
+ case AuthenticationModes.TopMediaOnBehalfOf: return [usernameRef, passwordRef, authDomainRef, usernameOnBehalfOfRef, passwordOnBehalfOfRRef];
152
+ default: return [];
153
+ }
154
+ }, [authMode]);
155
+ const hasSingleOption = useMemo(() => {
156
+ return (props.endpoints.length === 1 && dcmtArchives.length === 1);
157
+ }, [dcmtArchives, props.endpoints]);
158
+ useEffect(() => {
159
+ const checkRefsReady = () => inputRefs.every(ref => ref?.current);
160
+ if (!checkRefsReady()) {
161
+ const interval = setInterval(() => {
162
+ if (checkRefsReady()) {
163
+ clearInterval(interval);
164
+ const firstEmpty = inputRefs.find(input => input?.current?.value === '');
165
+ firstEmpty?.current?.focus();
166
+ }
167
+ }, 100);
168
+ return () => clearInterval(interval);
169
+ }
170
+ else {
171
+ const firstEmpty = inputRefs.find(input => input?.current?.value === '');
172
+ firstEmpty?.current?.focus();
173
+ }
174
+ return () => { };
175
+ }, [inputRefs]);
176
+ useEffect(() => {
177
+ if (props.sdInput) {
178
+ if (props.sdInput.userName)
179
+ setUsername(props.sdInput.userName);
180
+ }
181
+ }, []);
182
+ useEffect(() => {
183
+ if (!hasSingleOption)
184
+ return;
185
+ setLoginStep(2);
186
+ }, [hasSingleOption]);
187
+ useEffect(() => { if (loginStep === 1) {
188
+ setShowCultureIDs(false);
189
+ } }, [loginStep]);
190
+ useEffect(() => {
191
+ if (isSuccess)
192
+ return;
193
+ setDcmtArchives([]);
194
+ setDcmtArchive(undefined);
195
+ }, [isSuccess]);
196
+ useEffect(() => {
197
+ let preferredRapidAccess = localRa?.find(ar => ar.preferred === true);
198
+ if (preferredRapidAccess) {
199
+ handleRapidAccessSelection(preferredRapidAccess);
200
+ return;
201
+ }
202
+ if (props.endpoints.length === 1) {
203
+ setEndpoint(props.endpoints[0]);
204
+ return;
205
+ }
206
+ if (!props.endpoints.find(ep => ep.isDefault === 1))
207
+ return;
208
+ setEndpoint(props.endpoints.find(ep => ep.isDefault === 1));
209
+ }, [props.endpoints]);
210
+ useEffect(() => {
211
+ setTmServer(new TopMediaServer(endpoint?.URL));
212
+ }, [endpoint]);
213
+ useEffect(() => {
214
+ if (!tmServer)
215
+ return;
216
+ setTmSession(new TopMediaSession(tmServer));
217
+ }, [tmServer]);
218
+ useEffect(() => {
219
+ getArchivesAsync();
220
+ }, [tmSession]);
221
+ useEffect(() => {
222
+ if (!saveLoginEnable || !dcmtArchive)
223
+ return;
224
+ setSaveLoginName(dcmtArchive?.description + ' - ' + username);
225
+ }, [saveLoginEnable, dcmtArchive, username]);
226
+ const validators = LoginValidator.validate(loginData);
227
+ const fieldValidations = useCallback((key) => {
228
+ return validators.fieldValidations.get(key) ?? [];
229
+ }, [validators]);
230
+ const accessPointChooserColumns = useMemo(() => [
231
+ { caption: "Descrizione", field: "Description" },
232
+ { caption: "URL", field: "URL" },
233
+ { caption: "Default", field: "isDefault", type: "boolean" }
234
+ ], []);
235
+ const dcmtArchiveChooserColumns = useMemo(() => [
236
+ { caption: "ID", field: "id" },
237
+ { caption: "Descrizione", field: "description" },
238
+ { caption: "Default", field: "isDefault", type: "boolean" }
239
+ ], []);
240
+ const authModeOptions = useMemo(() => {
241
+ return [{ value: AuthenticationModes.TopMedia, display: 'TopMedia' },
242
+ { value: AuthenticationModes.TopMediaWithMFA, display: LOGINLocalizator.TopMediaWithMFA },
243
+ { value: AuthenticationModes.TopMediaOnBehalfOf, display: SDKUI_Localizator.AuthMode_OnBehalfOf },
244
+ { value: AuthenticationModes.WindowsThroughTopMedia, display: SDKUI_Localizator.AuthMode_WindowsViaTopMedia },
245
+ { value: AuthenticationModes.MSAzure, display: 'MSAzure' }];
246
+ }, [props.cultureID]);
247
+ const accessPointAdditionalIcons = useMemo(() => {
248
+ return [
249
+ { icon: _jsx(IconWifi, {}), onClick: async () => pingAsync(endpoint), tooltip: 'Ping' },
250
+ { icon: _jsx(IconRefresh, { fontSize: 20 }), onClick: async () => getArchivesAsync(), tooltip: SDKUI_Localizator.Refresh, visible: !isSuccess }
251
+ ];
252
+ }, [endpoint, isSuccess]);
253
+ const showPasswordOperations = useMemo(() => {
254
+ return loginStep === 2 && (authMode === AuthenticationModes.TopMedia || authMode === AuthenticationModes.TopMediaWithMFA || authMode === AuthenticationModes.TopMediaOnBehalfOf);
255
+ }, [authMode, loginStep]);
256
+ const disablePasswordOperations = useMemo(() => {
257
+ return (username.length === 0 || !dcmtArchive || !endpoint);
258
+ }, [username, dcmtArchive, endpoint]);
259
+ const showLoginBtn = useMemo(() => {
260
+ if (loginStep === 1)
261
+ return false;
262
+ if (loginStep === 2 && authMode === AuthenticationModes.TopMediaWithMFA)
263
+ return false;
264
+ return true;
265
+ }, [loginStep, authMode]);
266
+ const showContinueBtn = useMemo(() => {
267
+ if (loginStep === 3)
268
+ return false;
269
+ if (loginStep === 2 && authMode !== AuthenticationModes.TopMediaWithMFA)
270
+ return false;
271
+ return true;
272
+ }, [loginStep, authMode]);
273
+ const showBackBtn = useMemo(() => {
274
+ return loginStep !== 1;
275
+ }, [loginStep]);
276
+ const windowHeight = useMemo(() => {
277
+ let currentHeight = window.innerHeight;
278
+ if (!currentHeight)
279
+ return WindowHeight.LARGE;
280
+ if (currentHeight > 768)
281
+ return WindowHeight.LARGE;
282
+ if (currentHeight <= 768 && currentHeight > 680)
283
+ return WindowHeight.MEDIUM;
284
+ return WindowHeight.SMALL;
285
+ }, []);
286
+ const disableContinueBtn = useMemo(() => {
287
+ switch (loginStep) {
288
+ case 1: return fieldValidations('endpoint').length > 0 || fieldValidations('dcmtArchive').length > 0;
289
+ case 2: return fieldValidations('authenticationMode').length > 0 || fieldValidations('username').length > 0 || fieldValidations('password').length > 0;
290
+ default: return false;
291
+ }
292
+ }, [loginStep, validators]);
293
+ const disableLoginBtn = useMemo(() => {
294
+ return validators.totalValidationItems.length > 0;
295
+ }, [validators]);
296
+ const changePswTmSession = useMemo(() => {
297
+ let tmServer = new TopMediaServer(endpoint?.URL);
298
+ let tmSession = tmServer.NewSession();
299
+ let sd = new SessionDescriptor();
300
+ sd.userName = username;
301
+ sd.accessToken = "CHANGEPSWTOKEN";
302
+ sd.archiveID = dcmtArchive?.id;
303
+ tmSession.SessionDescr = sd;
304
+ return tmSession;
305
+ }, [endpoint, username, dcmtArchive]);
306
+ const nextStepHandler = async () => {
307
+ if (!endpoint || !dcmtArchive)
308
+ return;
309
+ if (loginStep === 1) {
310
+ setLoginStep(2);
311
+ }
312
+ if (loginStep === 2 && authMode === AuthenticationModes.TopMediaWithMFA) {
313
+ try {
314
+ await loginForMFAAsync(3);
315
+ }
316
+ catch (e) {
317
+ TMExceptionBoxManager.show({ exception: e });
318
+ return;
319
+ }
320
+ }
321
+ if (loginStep === 2) {
322
+ setLoginStep(3);
323
+ }
324
+ if (loginStep === 3)
325
+ return;
326
+ };
327
+ const previousStepHandler = useCallback(() => {
328
+ if (loginStep === 1)
329
+ return;
330
+ setLoginStep(prev => prev - 1);
331
+ }, [loginStep]);
332
+ const getArchivesAsync = async () => {
333
+ if (!tmSession)
334
+ return;
335
+ setIsSuccess(true);
336
+ try {
337
+ TMSpinner.show({ description: '' });
338
+ let archives = tmSession.TopMediaServer.BaseAddress && await tmSession.NewArchiveEngine().RetrieveAllAsync();
339
+ if (!archives)
340
+ return;
341
+ setDcmtArchives(archives);
342
+ if (archives.length === 1) {
343
+ setDcmtArchive(archives[0]);
344
+ return;
345
+ }
346
+ !dcmtArchive && setDcmtArchive(archives.find(arch => arch.isDefault === 1));
347
+ }
348
+ catch (e) {
349
+ setIsSuccess(false);
350
+ return TMExceptionBoxManager.show({ exception: e });
351
+ }
352
+ finally {
353
+ TMSpinner.hide();
354
+ }
355
+ };
356
+ const pingAsync = async (endpoint) => {
357
+ const server = new TopMediaServer(endpoint.URL);
358
+ try {
359
+ TMSpinner.show();
360
+ TMMessageBoxManager.show({ title: 'Ping', message: (await server?.PingAsync())?.toString(), buttons: [ButtonNames.OK] });
361
+ }
362
+ catch (e) {
363
+ TMExceptionBoxManager.show({ exception: e });
364
+ }
365
+ finally {
366
+ TMSpinner.hide();
367
+ }
368
+ };
369
+ async function loginAsync() {
370
+ TMSpinner.show();
371
+ try {
372
+ const sdInput = {
373
+ authenticationMode: authMode,
374
+ appModuleID: props.appModule,
375
+ archiveID: dcmtArchive?.id,
376
+ userName: username,
377
+ password: password,
378
+ cultureID: props.cultureID,
379
+ domain: authMode === AuthenticationModes.WindowsThroughTopMedia ? authDomain : '',
380
+ otp: loginStep === 3 && authMode === AuthenticationModes.TopMediaWithMFA ? parseInt(otpCode.join('')) : undefined,
381
+ onBehalfOf: {
382
+ domain: authMode === AuthenticationModes.TopMediaOnBehalfOf ? authDomain : '',
383
+ userName: authMode === AuthenticationModes.TopMediaOnBehalfOf ? usernameOnBehalf : '',
384
+ password: authMode === AuthenticationModes.TopMediaOnBehalfOf ? passwordOnBehalf : ''
385
+ }
386
+ };
387
+ let tmServer = new TopMediaServer(endpoint?.URL);
388
+ let tmSession = tmServer.NewSession();
389
+ await tmSession.LoginAsync(sdInput);
390
+ switch (props.appModule) {
391
+ case AppModules.DESIGNER:
392
+ case AppModules.ORCHESTRATOR:
393
+ case AppModules.SURFER:
394
+ try {
395
+ SDK_Globals.license = await tmSession.NewLicenseEngine().RetrieveAsync();
396
+ }
397
+ catch (e) {
398
+ TMExceptionBoxManager.show({ title: LOGINLocalizator.LicenseLoadingError, exception: e });
399
+ }
400
+ break;
401
+ }
402
+ props.onLogged(tmSession);
403
+ return true;
404
+ }
405
+ catch (e) {
406
+ TMExceptionBoxManager.show({ exception: e });
407
+ return false;
408
+ }
409
+ finally {
410
+ TMSpinner.hide();
411
+ }
412
+ }
413
+ async function loginForMFAAsync(otp) {
414
+ try {
415
+ TMSpinner.show();
416
+ const sdInput = {
417
+ authenticationMode: authMode,
418
+ appModuleID: props.appModule,
419
+ archiveID: dcmtArchive?.id,
420
+ userName: username,
421
+ password: password,
422
+ cultureID: props.cultureID,
423
+ domain: authDomain,
424
+ otp: otp
425
+ };
426
+ let tmServer = new TopMediaServer(endpoint?.URL);
427
+ let tmSession = tmServer.NewSession();
428
+ await tmSession.LoginAsync(sdInput);
429
+ if (otp === 1) {
430
+ ShowAlert({ message: LOGINLocalizator.OtpCodeSent, mode: 'success', duration: 5000, title: 'OTP' });
431
+ }
432
+ if (otp === 2) {
433
+ TMMessageBoxManager.show({ buttons: [ButtonNames.OK], message: SDK_Globals.tmSession?.SessionDescr?.customData2, title: LOGINLocalizator.ConfigureAuthenticator });
434
+ }
435
+ }
436
+ finally {
437
+ TMSpinner.hide();
438
+ }
439
+ }
440
+ const getCultureIDImg = useCallback(() => {
441
+ switch (props.cultureID) {
442
+ case CultureIDs.En_US: return en;
443
+ case CultureIDs.De_DE: return de;
444
+ case CultureIDs.Es_ES: return es;
445
+ case CultureIDs.Fr_FR: return fr;
446
+ case CultureIDs.Pt_PT: return pt;
447
+ default: return it;
448
+ }
449
+ }, [props.cultureID]);
450
+ const cultureIDHandler = useCallback((CID) => {
451
+ if (!props.onChangeLanguage)
452
+ return;
453
+ props.onChangeLanguage(CID);
454
+ setShowCultureIDs(false);
455
+ }, [props.onChangeLanguage]);
456
+ const handleDigitChange = (index, value) => {
457
+ const updated = [...otpCode];
458
+ updated[index] = value;
459
+ setOtpCode(updated);
460
+ };
461
+ const handleFullChange = (newDigits) => {
462
+ setOtpCode(newDigits.slice(0, 6));
463
+ };
464
+ const handleRapidAccessSelection = (ra) => {
465
+ if (!ra)
466
+ return;
467
+ setEndpoint(ra.endpoint);
468
+ setDcmtArchive(ra.archive);
469
+ setAuthMode(ra.authenticationMode);
470
+ setUsername(ra.username);
471
+ setAuthDomain(ra.domain.length > 0 ? ra.domain : ra.domainAlternative);
472
+ setUsernameOnBehalf(ra.onBehalfUsername);
473
+ cultureIDHandler(ra.language);
474
+ setLoginStep(2);
475
+ };
476
+ const handleRapidAccessCreate = async () => {
477
+ if (!saveLoginEnable)
478
+ return;
479
+ let ra = LocalStorageService.getItem(LOCAL_STORAGE_KEY);
480
+ if (!ra) {
481
+ ra = [];
482
+ }
483
+ ;
484
+ let maxId = ra.length > 0
485
+ ? ra.reduce((max, obj) => (obj.id > max.id ? obj : max), ra[0]).id //NOSONAR
486
+ : 0;
487
+ let loginToBeSaved = {
488
+ archive: dcmtArchive,
489
+ authenticationMode: authMode,
490
+ domain: authMode === AuthenticationModes.WindowsThroughTopMedia ? authDomain : '',
491
+ domainAlternative: authMode === AuthenticationModes.TopMediaOnBehalfOf ? authDomain : '',
492
+ endpoint: endpoint,
493
+ id: maxId + 1,
494
+ language: props.cultureID ?? CultureIDs.It_IT,
495
+ name: saveLoginName,
496
+ onBehalfUsername: usernameOnBehalf,
497
+ preferred: false,
498
+ username: username
499
+ };
500
+ if (ra.find(rapidAccess => rapidAccess.name === saveLoginName)) {
501
+ let existedRapidAccessIndex = ra.findIndex(rapidAccess => rapidAccess.name === saveLoginName);
502
+ TMMessageBoxManager.show({
503
+ buttons: [ButtonNames.YES, ButtonNames.NO, ButtonNames.CANCEL],
504
+ message: LOGINLocalizator.QuickAccessExistsReplace,
505
+ title: LOGINLocalizator.QuickAccessExists,
506
+ onButtonClick(e) {
507
+ (async () => {
508
+ switch (e) {
509
+ case ButtonNames.CANCEL: return;
510
+ case ButtonNames.NO:
511
+ await loginAsync();
512
+ return;
513
+ default: {
514
+ const success = await loginAsync();
515
+ if (success) {
516
+ ra[existedRapidAccessIndex] = loginToBeSaved;
517
+ LocalStorageService.setItem(LOCAL_STORAGE_KEY, ra);
518
+ }
519
+ }
520
+ }
521
+ })();
522
+ }
523
+ });
524
+ return;
525
+ }
526
+ const success = await loginAsync();
527
+ if (success) {
528
+ ra.push(loginToBeSaved);
529
+ LocalStorageService.setItem(LOCAL_STORAGE_KEY, ra);
530
+ }
531
+ };
532
+ const showVersionPopup = () => {
533
+ TMMessageBoxManager.show({ buttons: [ButtonNames.OK], title: `About. ${SDK_Globals.appModule}`, message: _jsx(TMAboutApp, { app: true, skdui: true, sdk: true, websdk: false }) });
534
+ };
535
+ return (_jsxs(StyledWrapper, { children: [!isMobile && _jsxs(StyledVersionContainer, { children: [_jsxs(StyledVersion, { children: [_jsxs(StyledVersionName, { children: [_jsx("span", { style: { color: TMColors.primary }, children: "\u25CF" }), SDK_Globals.appModule] }), _jsxs("p", { children: ["v.", SDK_Globals.appVersion] })] }), _jsxs(StyledVersion, { children: [_jsxs(StyledVersionName, { children: [_jsx("span", { style: { color: TMColors.tertiary }, children: "\u25CF" }), "SDKUI"] }), _jsxs("p", { children: ["v.", SDK_Globals.sdkuiVersion] })] }), _jsxs(StyledVersion, { children: [_jsxs(StyledVersionName, { children: [_jsx("span", { style: { color: TMColors.error }, children: "\u25CF" }), "SDK"] }), _jsxs("p", { children: ["v.", SDK_Globals.sdkVersion] })] })] }), _jsxs(StyledLoginContainer, { "$isMobile": isMobile, children: [_jsxs(StyledLeftSection, { "$isMobile": isMobile, children: [isMobile && _jsxs(StyledTopBar, { children: [_jsx(StyledTitle, { children: SDKUI_Localizator.WelcomeTo.replaceParams('') + ' ' + SDK_Globals.appModule }), _jsx(StyledMobileVersionIcon, { onClick: showVersionPopup, children: _jsx(IconInfo, { fontSize: 20, color: TMColors.primary }) })] }), _jsxs(StyledOverlay, { "$isMobile": isMobile, children: [" ", _jsx("img", { src: showDefaultLogo ? '/logo-default.svg' : '/logo-custom.svg', onError: () => setShowDefaultLogo(true), alt: "Logo", width: isMobile ? 110 : 180 }), " "] }), (windowHeight === WindowHeight.LARGE || !isMobile) && _jsxs(StyledPoweredByContainer, { "$isMobile": isMobile, children: [" ", showDefaultLogo ? 'Powered by TopConsult' : _jsx("img", { src: "/logo-default.svg", alt: "Logo", width: isMobile ? 50 : 100 }), " "] })] }), _jsxs(StyledRightSection, { "$isMobile": isMobile, children: [!isMobile && _jsxs(StyledLogoContainer, { "$isMobile": isMobile, children: [_jsx(StyledWelcomeText, { children: SDKUI_Localizator.WelcomeTo.replaceParams('') }), _jsxs(StyledLogo, { children: [_jsx("img", { src: six, alt: "six", width: 40 }), _jsxs(StyledLogoTextContainer, { children: [_jsx("div", { style: { fontWeight: 'lighter', color: 'black', fontSize: '0.9rem' }, children: "TopMedia" }), _jsx("div", { style: { fontSize: '1.3rem', color: TMColors.secondary, fontStyle: 'italic', fontWeight: 'bolder', textTransform: 'uppercase', letterSpacing: '6px' }, children: "Surfer" })] })] })] }), _jsxs(StyledToolbarContainer, { children: [_jsx(StyledLanguageChooser, { onClick: () => setShowCultureIDs(true), children: _jsx(TMTooltip, { content: SDKUI_Localizator.CultureID, children: _jsx("img", { src: getCultureIDImg(), alt: "Lang", width: 25, height: 25 }) }) }), loginStep !== 3 && _jsx(TMButton, { btnStyle: "icon", onClick: () => setShowRapidAccess(true), icon: _jsx(IconFastAccess, { fontSize: 20 }), caption: LOGINLocalizator.QuickAccess }), showPasswordOperations && _jsx(TMButton, { disabled: disablePasswordOperations, btnStyle: "icon", onClick: () => setShowChangePassword(true), icon: _jsx(IconPasswordOutline, { fontSize: 19 }), caption: SDKUI_Localizator.ChangePassword })] }), _jsxs(StyledFormContainer, { "$isMobile": isMobile, "$windowHeight": windowHeight, children: [loginStep === 1 &&
536
+ _jsxs(StyledStepContainer, { children: [_jsx(Chooser, { isDropDown: isDesktop, dataSource: props.endpoints, value: 'Description', columns: accessPointChooserColumns, additionalIcons: accessPointAdditionalIcons, icon: _jsx(IconAccessPoint, {}), label: SDKUI_Localizator.Endpoint, onSelectionChanged: (ep) => { setEndpoint(ep); setDcmtArchive(undefined); }, validationItems: fieldValidations('endpoint'), selectedRow: endpoint ?? undefined }), _jsx(Chooser, { isDropDown: isDesktop, dataSource: dcmtArchives, value: 'description', columns: dcmtArchiveChooserColumns, icon: _jsx(IconArchiveDoc, {}), label: SDKUI_Localizator.ArchiveID, onSelectionChanged: (arch) => setDcmtArchive(arch), validationItems: fieldValidations('dcmtArchive'), disabled: !endpoint, selectedRow: dcmtArchive ?? undefined })] }), loginStep === 2 &&
537
+ _jsxs(StyledStepContainer, { style: { marginTop: '20px' }, children: [_jsxs(StyledSummaryContainer, { style: { position: 'absolute', top: getTopOffset(windowHeight, isMobile, isTablet), left: '50%', transform: 'translateX(-50%)', width: 'max-content' }, children: [_jsxs(StyledDescription, { children: [_jsx(TMTooltip, { content: SDKUI_Localizator.Endpoint, children: _jsx(IconAccessPoint, { color: TMColors.primary, fontSize: 16 }) }), _jsx("p", { children: endpoint?.Description })] }), _jsxs(StyledDescription, { children: [_jsx(TMTooltip, { content: SDKUI_Localizator.ArchiveID, children: _jsx(IconArchiveDoc, { color: TMColors.primary, fontSize: 16 }) }), _jsx("p", { children: dcmtArchive?.description })] })] }), _jsx(SelectBox, { value: authMode, options: authModeOptions, onValueChanged: (value) => setAuthMode(value), validationItems: fieldValidations('authenticationMode'), icon: _jsx(IconLogin, {}), label: SDKUI_Localizator.AuthMode }), _jsxs(StyledCredentialWrapper, { children: [authMode === AuthenticationModes.WindowsThroughTopMedia && _jsx(TextBox, { ref: authDomainRef, value: authDomain, onValueChanged: (e) => setAuthDomain(e), validationItems: fieldValidations('authDomain'), type: "text", icon: _jsx(IconWeb, {}), label: SDKUI_Localizator.Domain }), authMode !== AuthenticationModes.MSAzure && _jsx(CeredentialContainer, { isMobile: isMobile, ref: usernameRef, secondaryRef: passwordRef, usernameValidator: fieldValidations('username'), passwordValidator: fieldValidations('password'), authMode: authMode, username: username, password: password, onUsernameChanged: (un) => setUsername(un), onPasswordChanged: (ps) => setPassword(ps) }), authMode === AuthenticationModes.TopMediaOnBehalfOf &&
538
+ _jsxs(StyledCredentialWrapper, { children: [_jsx(TextBox, { value: authDomain, ref: authDomainRef, onValueChanged: (e) => setAuthDomain(e), validationItems: fieldValidations('authDomain'), type: "text", icon: _jsx(IconWeb, {}), label: SDKUI_Localizator.Domain }), _jsx(CeredentialContainer, { isMobile: isMobile, ref: usernameOnBehalfOfRef, secondaryRef: passwordOnBehalfOfRRef, usernameValidator: fieldValidations('usernameOnBehalfOf'), passwordValidator: fieldValidations('passwordOnBehalfOf'), authMode: AuthenticationModes.TopMediaOnBehalfOf, username: usernameOnBehalf, password: passwordOnBehalf, onUsernameChanged: (un) => setUsernameOnBehalf(un), onPasswordChanged: (ps) => setPasswordOnBehalf(ps) })] })] }), authMode !== AuthenticationModes.TopMediaWithMFA &&
539
+ _jsx(RapidAccessContainer, { isSaveEnable: saveLoginEnable, name: saveLoginName, nameValidationItems: fieldValidations('rapidAccessName'), onEnableSaveChange: () => setSaveLoginEnable(!saveLoginEnable), onNameChange: (name) => setSaveLoginName(name) })] }), loginStep === 3 &&
540
+ _jsxs(StyledStepThreeContainer, { "$isMobile": isMobile, children: [_jsx(OTPReader, { isMobile: isMobile, digits: otpCode, onChange: handleDigitChange, onFullChange: handleFullChange, text: _jsxs("div", { children: [" ", LOGINLocalizator.EnterOtpInstructions, " "] }), header: '', additionalButtons: [
541
+ _jsx(TMButton, { btnStyle: 'text', caption: LOGINLocalizator.SetupAuthenticator, showTooltip: false, onClick: async () => await loginForMFAAsync(2), color: 'success' }, 0),
542
+ _jsx(TMButton, { btnStyle: 'text', disabled: isOTPSent, caption: LOGINLocalizator.SendOtpByEmail, showTooltip: false, onClick: async () => { await loginForMFAAsync(1); setIsOTPSent(true); }, color: 'primary' }, 1),
543
+ ] }), _jsx(StyledRapidAccessWrapper, { "$isMobile": isMobile, children: _jsx(RapidAccessContainer, { isSaveEnable: saveLoginEnable, name: saveLoginName, nameValidationItems: fieldValidations('rapidAccessName'), onEnableSaveChange: () => setSaveLoginEnable(!saveLoginEnable), onNameChange: (name) => setSaveLoginName(name) }) })] }), _jsxs(StyledButtonContainer, { children: [showContinueBtn && _jsx(TMButton, { fontSize: "1.2rem", onClick: nextStepHandler, showTooltip: false, caption: LOGINLocalizator.Continue, disabled: disableContinueBtn }), showLoginBtn && _jsx(TMButton, { fontSize: "1.2rem", showTooltip: false, onClick: async () => saveLoginEnable ? await handleRapidAccessCreate() : await loginAsync(), caption: saveLoginEnable ? SDKUI_Localizator.SaveAndLogin : SDKUI_Localizator.Login, disabled: disableLoginBtn })] })] }), showPasswordOperations && _jsx(StyledForgetPassword, { "$isMobile": isMobile, children: _jsx(TMButton, { disabled: disablePasswordOperations, btnStyle: "text", caption: SDKUI_Localizator.ForgetPassword, showTooltip: false, onClick: () => setShowForgetPassword(true) }) }), showBackBtn && _jsx(StyledBackButton, { children: _jsx(TMButton, { onClick: previousStepHandler, btnStyle: "icon", icon: _jsx(IconArrowLeft, { fontSize: 20 }), caption: SDKUI_Localizator.Back }) }), showCultureIDs && _jsx(Menu, { onClose: () => setShowCultureIDs(false), x: 'calc(100% - 250px)', y: 50, visible: showCultureIDs, children: _jsxs(StyledMenuItemContainer, { children: [_jsx(StyledLangChooser, { onClick: () => cultureIDHandler(CultureIDs.It_IT), title: cultureIDsDataSource[0].display, src: it, alt: "it", width: BANNER_DIMENSION, height: BANNER_DIMENSION }), _jsx(StyledLangChooser, { onClick: () => cultureIDHandler(CultureIDs.En_US), title: cultureIDsDataSource[3].display, src: en, alt: "en", width: BANNER_DIMENSION, height: BANNER_DIMENSION }), _jsx(StyledLangChooser, { onClick: () => cultureIDHandler(CultureIDs.Fr_FR), title: cultureIDsDataSource[1].display, src: fr, alt: "fr", width: BANNER_DIMENSION, height: BANNER_DIMENSION }), _jsx(StyledLangChooser, { onClick: () => cultureIDHandler(CultureIDs.Es_ES), title: cultureIDsDataSource[4].display, src: es, alt: "es", width: BANNER_DIMENSION, height: BANNER_DIMENSION }), _jsx(StyledLangChooser, { onClick: () => cultureIDHandler(CultureIDs.Pt_PT), title: cultureIDsDataSource[2].display, src: pt, alt: "pt", width: BANNER_DIMENSION, height: BANNER_DIMENSION }), _jsx(StyledLangChooser, { onClick: () => cultureIDHandler(CultureIDs.De_DE), title: cultureIDsDataSource[5].display, src: de, alt: "de", width: BANNER_DIMENSION, height: BANNER_DIMENSION })] }) }), showChangePassword && _jsx(ChangePassword, { tmSession: changePswTmSession, onClose: () => setShowChangePassword(false) }), showForgetPassword && _jsx(RecoverPasswordFlow, { isMobile: isMobile, tmSession: changePswTmSession, onClose: () => setShowForgetPassword(false), windowHeight: windowHeight }), showRapidAccess && _jsx(RapidAccessLogin, { isMobile: isMobile, onClose: () => setShowRapidAccess(false), onSelect: handleRapidAccessSelection })] })] })] }));
544
+ };
545
+ export default TMLoginForm;
546
+ const CeredentialContainer = forwardRef(({ isMobile = false, authMode = AuthenticationModes.TopMedia, password = '', username = '', onPasswordChanged, onUsernameChanged, passwordValidator = [], usernameValidator = [], secondaryRef }, ref) => {
547
+ const passwordRef = useRef(null);
548
+ useImperativeHandle(ref, () => {
549
+ return usernameRef.current;
550
+ });
551
+ const usernameRef = useRef(null);
552
+ useEffect(() => {
553
+ if (!secondaryRef)
554
+ return;
555
+ if (typeof secondaryRef === 'function') {
556
+ secondaryRef(passwordRef.current);
557
+ }
558
+ else if (typeof secondaryRef === 'object' && secondaryRef !== null) {
559
+ secondaryRef.current = passwordRef.current;
560
+ }
561
+ }, [secondaryRef]);
562
+ return (_jsxs(StyledCredentialContainer, { "$isMobile": isMobile, "$authMode": authMode, children: [_jsx(TextBox, { ref: usernameRef, value: username, onValueChanged: (e) => onUsernameChanged(e), validationItems: usernameValidator, type: "text", icon: _jsx(IconUser, {}), label: SDKUI_Localizator.UserName }), _jsx(TextBox, { ref: passwordRef, value: password, onValueChanged: (e) => onPasswordChanged(e), validationItems: passwordValidator, type: "password", icon: authMode !== AuthenticationModes.TopMediaOnBehalfOf ? _jsx(IconPassword, {}) : undefined, label: SDKUI_Localizator.Password })] }));
563
+ });
564
+ const RapidAccessContainer = ({ isSaveEnable, name, nameValidationItems, onEnableSaveChange, onNameChange }) => {
565
+ return (_jsxs(StyledRapidLoginSave, { children: [_jsx(TMCheckBox, { label: LOGINLocalizator.CreateNewQuickAccess, onValueChanged: () => onEnableSaveChange(), value: isSaveEnable, labelColor: "#313131" }), isSaveEnable && _jsx(TextBox, { validationItems: nameValidationItems, disabled: !isSaveEnable, type: "text", value: name, onValueChanged: (value) => onNameChange(value), placeHolder: "Es: Admin risorse umane" })] }));
566
+ };
567
+ const getTopOffset = (windowHeight, isMobile, isTablet) => {
568
+ const getDeviceType = () => {
569
+ const ua = navigator.userAgent;
570
+ const isTouch = 'ontouchstart' in window || navigator.maxTouchPoints > 0;
571
+ if (/Mobi|Android/i.test(ua))
572
+ return 'mobile';
573
+ if (/iPad|Tablet/i.test(ua) || (isTouch && /Macintosh/i.test(ua)))
574
+ return 'tablet';
575
+ return 'desktop';
576
+ };
577
+ if (windowHeight === WindowHeight.LARGE) {
578
+ if (isMobile)
579
+ return '70px';
580
+ if (isTablet)
581
+ return '130px';
582
+ if (getDeviceType() !== 'desktop')
583
+ return '140px';
584
+ return '180px';
585
+ }
586
+ if (windowHeight === WindowHeight.MEDIUM) {
587
+ if (getDeviceType() === 'desktop') {
588
+ if (isMobile)
589
+ return '60px';
590
+ }
591
+ return '120px';
592
+ }
593
+ return '60px';
594
+ };
595
+ const getFlexDirection = (isMobile, authMode) => {
596
+ if (isMobile)
597
+ return 'column';
598
+ return authMode === AuthenticationModes.TopMediaOnBehalfOf ? 'row' : 'column';
599
+ };
600
+ const getPadding = (windowHeight, isMobile) => {
601
+ if (windowHeight === WindowHeight.LARGE) {
602
+ return isMobile ? '35px 35px 10px 35px' : '65px 65px 10px 65px';
603
+ }
604
+ if (windowHeight === WindowHeight.MEDIUM) {
605
+ return isMobile ? '20px' : '20px 55px';
606
+ }
607
+ return '20px';
608
+ };
609
+ const StyledMobileVersionIcon = styled.div ` display: flex; align-items: center; justify-content: center; border-radius: 30px; width: 25px; height: 25px; background-color: white; `;
610
+ const StyledWrapper = styled.div ` display: flex; align-items: center; justify-content: center; width: 100%; height: 100vh; overflow: hidden; background-color: #a9a9a9; `;
611
+ const StyledVersionContainer = styled.div ` position: absolute; bottom: 35px; left: 50%; transform: translateX(-50%); color: white; font-size: 0.9rem; display:flex; align-items:center; gap:10px; `;
612
+ const StyledVersion = styled.div ` display: flex; align-items: center; gap: 2px; `;
613
+ const StyledVersionName = styled.p ` display: flex; align-items: center; gap: 3px; `;
614
+ const StyledLoginContainer = styled.div ` min-width: ${props => props.$isMobile ? '100%' : '800px'}; width: ${props => props.$isMobile ? '100%' : '50%'}; height:${props => props.$isMobile ? '100%' : '80%'}; background: #FFFFFF 0% 0% no-repeat padding-box; box-shadow: ${props => !props.$isMobile ? '7px 7px 5px #AEAEAFBF' : 'none'}; border-radius: ${props => !props.$isMobile ? '10px' : 'none'};; opacity: 1; display: flex; flex-direction: ${props => props.$isMobile ? 'column' : 'row'}; overflow: hidden; `;
615
+ const StyledLeftSection = styled.div ` width: ${props => props.$isMobile ? '100%' : '33%'}; min-width: ${props => props.$isMobile ? '100%' : '300px'}; height: ${props => props.$isMobile ? 'calc(25% - 40px)' : '100%'}; background: transparent linear-gradient(180deg, ${() => TMColors.primaryColor + 'B2'} 0%, ${() => TMColors.primaryColor} 100%) 0% 0% no-repeat padding-box; mix-blend-mode: multiply; opacity: 1; position: relative; `;
616
+ const StyledOverlay = styled.div ` position: ${props => props.$isMobile ? 'unset' : 'absolute'}; top: 148px; left: 0; width: 100%; height: ${props => props.$isMobile ? 'calc(100% - 40px)' : '150px'}; background: linear-gradient(90deg, transparent, #ffffff95, transparent); opacity: 1; display: flex; align-items: center; justify-content: center; `;
617
+ const StyledPoweredByContainer = styled.div ` position: absolute; width: 100%; height: 20px; bottom: ${props => props.$isMobile ? '10px' : '40px'}; left: 0; display: flex; align-items: center; justify-content: center; color: white; font-size: 0.8rem; `;
618
+ const StyledRightSection = styled.div ` width: ${props => props.$isMobile ? '100%' : '67%'}; min-width: ${props => props.$isMobile ? '100%' : '500px'}; height: ${props => props.$isMobile ? '80%' : '100%'}; background: white; mix-blend-mode: multiply; opacity: 1; position: relative; display: flex; align-items: center; justify-content: center; `;
619
+ const StyledLogoContainer = styled.div ` position: absolute; top: ${props => props.$isMobile ? '40px' : '20px'}; left: 0; width: 100%; height: fit-content; padding: ${props => props.$isMobile ? '40px' : '30px'} 10px; transform:${props => props.$isMobile ? 'scale(0.8)' : 'scale(0.9)'}; display: flex; align-items: center; justify-content: center; gap: 10px; `;
620
+ const StyledWelcomeText = styled.h1 ` text-align: left; letter-spacing: 0px; color: ${TMColors.primary}; opacity: 1; `;
621
+ const StyledLogo = styled.div ` display: flex; gap: 5px; align-items: center; `;
622
+ const StyledLogoTextContainer = styled.div ` display: flex; flex-direction: column; `;
623
+ const StyledFormContainer = styled.div ` display: flex; flex-direction: column; padding: ${props => getPadding(props.$windowHeight, props.$isMobile)} ; align-items: center; justify-content: center; gap: 10px; width: 100%; height: fit-content; max-height: calc(100% - 100px); margin-top : ${props => !props.$isMobile && props.$windowHeight === WindowHeight.MEDIUM ? '70px' : '0'} ; `;
624
+ const StyledButtonContainer = styled.div ` display: flex; align-items: center; justify-content: center; padding: 10px; width: 100%; margin-top: 10px; `;
625
+ const StyledDescription = styled.div ` display: flex; align-items: center; gap: 2px; `;
626
+ const StyledRapidLoginSave = styled.div ` display: flex; flex-direction: column; width: 100%; gap: 2px; `;
627
+ const StyledForgetPassword = styled.div ` position: absolute; bottom: ${props => props.$isMobile ? '15px' : '25px'}; left: 50%; transform: translateX(-50%); font-size: 0.8rem; `;
628
+ const StyledBackButton = styled.div ` position: absolute; top: 20px; left: 20px; `;
629
+ const StyledLanguageChooser = styled.button ` border: none; border-radius: 50px; background-color: transparent; cursor: pointer; `;
630
+ const StyledLangChooser = styled.img ` cursor: pointer; border: 3px solid white; border-radius: 50px; `;
631
+ const StyledSummaryContainer = styled.div ` display: flex; align-items: center; gap: 10px; `;
632
+ const StyledCredentialContainer = styled.div ` width: '100%'; display: flex; flex-direction: ${props => getFlexDirection(props.$isMobile, props.$authMode)}; gap: 10px; `;
633
+ const StyledCredentialWrapper = styled.div ` width: 100%; display: flex; flex-direction: column; gap: 10px; `;
634
+ const StyledToolbarContainer = styled.div ` display: flex; gap: 10px; align-items: center; position: absolute; top: 20px; right: 20px; `;
635
+ const StyledStepContainer = styled.div ` width: 100%; display: flex; flex-direction: column; gap: 10px; overflow: auto; `;
636
+ const StyledStepThreeContainer = styled.div ` width: 100%; display: flex; flex-direction: column; gap: 10px; padding: 10px ${props => props.$isMobile ? '0' : '60px'}; `;
637
+ const StyledRapidAccessWrapper = styled.div `width:100%; margin-top:${props => props.$isMobile ? '0' : '30px'};`;
638
+ const StyledMenuItemContainer = styled.div `display:flex;align-items:center;gap:10px;padding:5px;`;
639
+ const StyledTopBar = styled.div ` width: 100%; height: 40px; background-color: ${TMColors.primary}; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; `;
640
+ const StyledTitle = styled.div ` width: 100%; color: white; font-size: 1rem; `;
641
+ function IconPasswordOutline(props) { return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 15 15", width: "1em", height: "1em", ...props, children: [" ", _jsx("path", { fill: "none", stroke: "currentColor", d: "M12.5 8.5v-1a1 1 0 0 0-1-1h-10a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1v-1m0-4h-4a2 2 0 1 0 0 4h4m0-4a2 2 0 1 1 0 4m-9-6v-3a3 3 0 0 1 6 0v3m2.5 4h1m-3 0h1m-3 0h1" }), " "] })); } //NOSONAR
642
+ function IconFastAccess(props) { return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", width: "1em", height: "1em", ...props, children: [" ", _jsx("circle", { cx: "256", cy: "56", r: "40", fill: "none", stroke: "currentColor", strokeLinejoin: "round", strokeWidth: "32" }), " ", _jsx("path", { fill: "none", stroke: "currentColor", strokeLinejoin: "round", strokeWidth: "32", d: "M204.23 274.44c2.9-18.06 4.2-35.52-.5-47.59c-4-10.38-12.7-16.19-23.2-20.15L88 176.76c-12-4-23.21-10.7-24-23.94c-1-17 14-28 29-24c0 0 88 31.14 163 31.14s162-31 162-31c18-5 30 9 30 23.79c0 14.21-11 19.21-24 23.94l-88 31.91c-8 3-21 9-26 18.18c-6 10.75-5 29.53-2.1 47.59l5.9 29.63l37.41 163.9c2.8 13.15-6.3 25.44-19.4 27.74S308 489 304.12 476.28l-37.56-115.93q-2.71-8.34-4.8-16.87L256 320l-5.3 21.65q-2.52 10.35-5.8 20.48L208 476.18c-4 12.85-14.5 21.75-27.6 19.46s-22.4-15.59-19.46-27.74l37.39-163.83Z" }), " "] })); } //NOSONAR