mesauth-angular 1.1.3 → 1.1.5

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.
@@ -1,1232 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { InjectionToken, makeEnvironmentProviders, provideAppInitializer, inject, Injectable, NgModule, EventEmitter, signal, HostListener, HostBinding, Output, Component, ViewChild } from '@angular/core';
3
- import { HttpClient } from '@angular/common/http';
4
- import { HubConnectionBuilder, LogLevel } from '@microsoft/signalr';
5
- import { BehaviorSubject, Subject, throwError } from 'rxjs';
6
- import { filter, debounceTime, tap, catchError, takeUntil } from 'rxjs/operators';
7
- import * as i2 from '@angular/router';
8
- import { Router, NavigationEnd } from '@angular/router';
9
- import * as i3 from '@angular/common';
10
- import { NgIf, CommonModule, NgFor } from '@angular/common';
11
-
12
- /** Injection token for MesAuth configuration */
13
- const MES_AUTH_CONFIG = new InjectionToken('MES_AUTH_CONFIG');
14
- /**
15
- * Provides MesAuth with configuration.
16
- * This is the recommended way to set up mesauth-angular in standalone apps.
17
- *
18
- * @example
19
- * ```typescript
20
- * // app.config.ts
21
- * export const appConfig: ApplicationConfig = {
22
- * providers: [
23
- * provideHttpClient(withInterceptors([mesAuthInterceptor])),
24
- * provideMesAuth({
25
- * apiBaseUrl: 'https://auth.example.com',
26
- * userBaseUrl: 'https://app.example.com'
27
- * })
28
- * ]
29
- * };
30
- * ```
31
- */
32
- function provideMesAuth(config) {
33
- return makeEnvironmentProviders([
34
- { provide: MES_AUTH_CONFIG, useValue: config },
35
- MesAuthService,
36
- provideAppInitializer(() => {
37
- const mesAuthService = inject(MesAuthService);
38
- const httpClient = inject(HttpClient);
39
- const router = inject(Router);
40
- mesAuthService.init(config, httpClient, router);
41
- })
42
- ]);
43
- }
44
- var NotificationType;
45
- (function (NotificationType) {
46
- NotificationType["Info"] = "Info";
47
- NotificationType["Warning"] = "Warning";
48
- NotificationType["Error"] = "Error";
49
- NotificationType["Success"] = "Success";
50
- })(NotificationType || (NotificationType = {}));
51
- class MesAuthService {
52
- hubConnection = null;
53
- _currentUser = new BehaviorSubject(null);
54
- currentUser$ = this._currentUser.asObservable();
55
- _notifications = new Subject();
56
- notifications$ = this._notifications.asObservable();
57
- apiBase = '';
58
- config = null;
59
- http;
60
- router;
61
- constructor() {
62
- // Empty constructor - all dependencies passed to init()
63
- }
64
- isProtectedRoute(url) {
65
- // Consider routes protected if they don't include auth-related paths
66
- return !url.includes('/login') && !url.includes('/auth') && !url.includes('/signin') && !url.includes('/logout');
67
- }
68
- init(config, httpClient, router) {
69
- this.config = config;
70
- this.http = httpClient;
71
- this.router = router;
72
- this.apiBase = config.apiBaseUrl.replace(/\/$/, '');
73
- // Listen for route changes - only refresh user data if needed for SPA navigation
74
- // This helps maintain authentication state in single-page applications
75
- if (this.router) {
76
- this.router.events
77
- .pipe(filter(event => event instanceof NavigationEnd), debounceTime(1000) // Longer debounce to avoid interfering with login flow
78
- )
79
- .subscribe((event) => {
80
- // Only refresh if user is logged in and navigating to protected routes
81
- // Avoid refreshing during login/logout flows
82
- if (this._currentUser.value && this.isProtectedRoute(event.url)) {
83
- // Small delay to ensure any login/logout operations complete
84
- setTimeout(() => {
85
- if (this._currentUser.value) {
86
- this.refreshUser();
87
- }
88
- }, 100);
89
- }
90
- });
91
- }
92
- this.fetchCurrentUser();
93
- }
94
- getConfig() {
95
- return this.config;
96
- }
97
- fetchCurrentUser() {
98
- if (!this.apiBase)
99
- return;
100
- const url = `${this.apiBase}/auth/me`;
101
- this.http.get(url, { withCredentials: this.config?.withCredentials ?? true }).subscribe({
102
- next: (u) => {
103
- this._currentUser.next(u);
104
- if (u && this.config) {
105
- this.startConnection(this.config);
106
- // Only fetch notifications after confirming user is logged in
107
- this.fetchInitialNotifications();
108
- }
109
- },
110
- error: (err) => {
111
- // Silently handle auth errors (401/403) - user is not logged in
112
- if (err.status === 401 || err.status === 403) {
113
- this._currentUser.next(null);
114
- }
115
- }
116
- });
117
- }
118
- fetchInitialNotifications() {
119
- // Skip if no user is logged in or apiBase not set
120
- if (!this.apiBase || !this._currentUser.value)
121
- return;
122
- this.http.get(`${this.apiBase}/notif/me`, { withCredentials: this.config?.withCredentials ?? true }).subscribe({
123
- next: (notifications) => {
124
- if (Array.isArray(notifications?.items)) {
125
- notifications.items.forEach((n) => this._notifications.next(n));
126
- }
127
- },
128
- error: (err) => {
129
- // Silently handle auth errors (401/403) - user is not logged in
130
- // No need to emit anything
131
- }
132
- });
133
- }
134
- getUnreadCount() {
135
- return this.http.get(`${this.apiBase}/notif/me/unread-count`, { withCredentials: this.config?.withCredentials ?? true });
136
- }
137
- getNotifications(page = 1, pageSize = 20, includeRead = false, type) {
138
- let url = `${this.apiBase}/notif/me?page=${page}&pageSize=${pageSize}&includeRead=${includeRead}`;
139
- if (type) {
140
- url += `&type=${type}`;
141
- }
142
- return this.http.get(url, { withCredentials: this.config?.withCredentials ?? true });
143
- }
144
- markAsRead(notificationId) {
145
- return this.http.patch(`${this.apiBase}/notif/${notificationId}/read`, {}, { withCredentials: this.config?.withCredentials ?? true });
146
- }
147
- markAllAsRead() {
148
- return this.http.patch(`${this.apiBase}/notif/me/read-all`, {}, { withCredentials: this.config?.withCredentials ?? true });
149
- }
150
- deleteNotification(notificationId) {
151
- return this.http.delete(`${this.apiBase}/notif/${notificationId}`, { withCredentials: this.config?.withCredentials ?? true });
152
- }
153
- /**
154
- * Get frontend routes assigned to the current user
155
- * Returns routes grouped by application
156
- */
157
- getFrontEndRoutes() {
158
- if (!this.apiBase)
159
- throw new Error('MesAuth not initialized');
160
- return this.http.get(`${this.apiBase}/fe-routes/me`, { withCredentials: this.config?.withCredentials ?? true });
161
- }
162
- /**
163
- * Get master routes for a specific application
164
- * @param appId - The application ID
165
- */
166
- getRouteMasters(appId) {
167
- if (!this.apiBase)
168
- throw new Error('MesAuth not initialized');
169
- return this.http.get(`${this.apiBase}/fe-routes/masters/${appId}`, { withCredentials: this.config?.withCredentials ?? true });
170
- }
171
- /**
172
- * Register/sync frontend routes for an application
173
- * This is typically called on app startup to sync routes from the frontend app
174
- * @param appId - The application ID (passed via X-App-Id header)
175
- * @param routes - Array of route definitions
176
- */
177
- registerFrontEndRoutes(appId, routes) {
178
- if (!this.apiBase)
179
- throw new Error('MesAuth not initialized');
180
- const headers = { 'X-App-Id': appId };
181
- return this.http.post(`${this.apiBase}/fe-routes/register`, routes, {
182
- headers,
183
- withCredentials: this.config?.withCredentials ?? true
184
- });
185
- }
186
- /**
187
- * Create a new route master
188
- * @param appId - The application ID
189
- * @param route - Route details
190
- */
191
- createRouteMaster(appId, route) {
192
- if (!this.apiBase)
193
- throw new Error('MesAuth not initialized');
194
- return this.http.post(`${this.apiBase}/fe-routes/masters`, {
195
- appId,
196
- ...route
197
- }, { withCredentials: this.config?.withCredentials ?? true });
198
- }
199
- /**
200
- * Update an existing route master
201
- * @param routeId - The route master ID
202
- * @param route - Updated route details
203
- */
204
- updateRouteMaster(routeId, route) {
205
- if (!this.apiBase)
206
- throw new Error('MesAuth not initialized');
207
- return this.http.put(`${this.apiBase}/fe-routes/masters/${routeId}`, route, {
208
- withCredentials: this.config?.withCredentials ?? true
209
- });
210
- }
211
- /**
212
- * Delete a route master
213
- * @param routeId - The route master ID
214
- */
215
- deleteRouteMaster(routeId) {
216
- if (!this.apiBase)
217
- throw new Error('MesAuth not initialized');
218
- return this.http.delete(`${this.apiBase}/fe-routes/masters/${routeId}`, {
219
- withCredentials: this.config?.withCredentials ?? true
220
- });
221
- }
222
- /**
223
- * Assign a route to a role
224
- * @param routeMasterId - The route master ID
225
- * @param roleId - The role ID (GUID)
226
- */
227
- assignRouteToRole(routeMasterId, roleId) {
228
- if (!this.apiBase)
229
- throw new Error('MesAuth not initialized');
230
- return this.http.post(`${this.apiBase}/fe-routes/mappings`, {
231
- routeMasterId,
232
- roleId
233
- }, { withCredentials: this.config?.withCredentials ?? true });
234
- }
235
- /**
236
- * Remove a route assignment from a role
237
- * @param mappingId - The mapping ID
238
- */
239
- removeRouteFromRole(mappingId) {
240
- if (!this.apiBase)
241
- throw new Error('MesAuth not initialized');
242
- return this.http.delete(`${this.apiBase}/fe-routes/mappings/${mappingId}`, {
243
- withCredentials: this.config?.withCredentials ?? true
244
- });
245
- }
246
- /**
247
- * Get route-to-role mappings for a specific role
248
- * @param roleId - The role ID (GUID)
249
- */
250
- getRouteMappingsByRole(roleId) {
251
- if (!this.apiBase)
252
- throw new Error('MesAuth not initialized');
253
- return this.http.get(`${this.apiBase}/fe-routes/mappings?roleId=${roleId}`, {
254
- withCredentials: this.config?.withCredentials ?? true
255
- });
256
- }
257
- startConnection(config) {
258
- if (this.hubConnection)
259
- return;
260
- const signalrUrl = config.apiBaseUrl.replace(/\/$/, '') + '/hub/notification';
261
- const builder = new HubConnectionBuilder()
262
- .withUrl(signalrUrl, { withCredentials: config.withCredentials ?? true })
263
- .withAutomaticReconnect()
264
- .configureLogging(LogLevel.Warning);
265
- this.hubConnection = builder.build();
266
- this.hubConnection.on('ReceiveNotification', (n) => {
267
- this._notifications.next(n);
268
- });
269
- this.hubConnection.start().then(() => { }).catch((err) => { });
270
- this.hubConnection.onclose(() => { });
271
- this.hubConnection.onreconnecting(() => { });
272
- this.hubConnection.onreconnected(() => { });
273
- }
274
- stop() {
275
- if (!this.hubConnection)
276
- return;
277
- this.hubConnection.stop().catch(() => { });
278
- this.hubConnection = null;
279
- }
280
- logout() {
281
- const url = `${this.apiBase}/auth/logout`;
282
- return this.http.post(url, {}, { withCredentials: this.config?.withCredentials ?? true }).pipe(tap(() => {
283
- this._currentUser.next(null);
284
- this.stop();
285
- }));
286
- }
287
- get currentUser() {
288
- return this._currentUser.value;
289
- }
290
- get isAuthenticated() {
291
- return this._currentUser.value !== null;
292
- }
293
- refreshUser() {
294
- this.fetchCurrentUser();
295
- }
296
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MesAuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
297
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MesAuthService });
298
- }
299
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MesAuthService, decorators: [{
300
- type: Injectable
301
- }], ctorParameters: () => [] });
302
-
303
- // Track if we're currently redirecting to prevent loopback
304
- let isRedirecting = false;
305
- /**
306
- * Functional HTTP interceptor for handling 401/403 auth errors.
307
- * Redirects to login page on 401, and to 403 page on 403.
308
- * Includes loopback prevention to avoid infinite redirects.
309
- */
310
- const mesAuthInterceptor = (req, next) => {
311
- const authService = inject(MesAuthService);
312
- const router = inject(Router);
313
- return next(req).pipe(catchError((error) => {
314
- const status = error.status;
315
- // Check if we should handle this error and prevent loopback
316
- if ((status === 401 || status === 403) && !isRedirecting) {
317
- const config = authService.getConfig();
318
- const baseUrl = config?.userBaseUrl || '';
319
- // Use router URL for internal navigation (cleaner URLs)
320
- // Falls back to window.location for full URL if needed
321
- const currentUrl = router.url + (window.location.hash || '');
322
- const returnUrl = encodeURIComponent(currentUrl);
323
- // Avoid loops if already on auth/unauth pages
324
- const isLoginPage = currentUrl.includes('/login');
325
- const is403Page = currentUrl.includes('/403');
326
- const isAuthPage = currentUrl.includes('/auth');
327
- // Check if user is authenticated
328
- const isAuthenticated = authService.isAuthenticated;
329
- if (status === 401 && !isLoginPage && !isAuthPage && !isAuthenticated) {
330
- isRedirecting = true;
331
- // Reset flag after a delay to allow future redirects after user returns
332
- setTimeout(() => { isRedirecting = false; }, 5000);
333
- window.location.href = `${baseUrl}/login?returnUrl=${returnUrl}`;
334
- }
335
- else if (status === 403 && !is403Page) {
336
- isRedirecting = true;
337
- setTimeout(() => { isRedirecting = false; }, 5000);
338
- window.location.href = `${baseUrl}/403?returnUrl=${returnUrl}`;
339
- }
340
- }
341
- return throwError(() => error);
342
- }));
343
- };
344
-
345
- class MesAuthModule {
346
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MesAuthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
347
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.16", ngImport: i0, type: MesAuthModule });
348
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MesAuthModule, providers: [
349
- MesAuthService
350
- ] });
351
- }
352
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MesAuthModule, decorators: [{
353
- type: NgModule,
354
- args: [{
355
- providers: [
356
- MesAuthService
357
- ]
358
- }]
359
- }] });
360
-
361
- class ThemeService {
362
- _currentTheme = new BehaviorSubject('light');
363
- currentTheme$ = this._currentTheme.asObservable();
364
- observer = null;
365
- constructor() {
366
- this.detectTheme();
367
- this.startWatching();
368
- }
369
- ngOnDestroy() {
370
- this.stopWatching();
371
- }
372
- detectTheme() {
373
- const html = document.documentElement;
374
- const isDark = html.classList.contains('dark') ||
375
- html.getAttribute('data-theme') === 'dark' ||
376
- html.getAttribute('theme') === 'dark' ||
377
- html.getAttribute('data-coreui-theme') === 'dark';
378
- this._currentTheme.next(isDark ? 'dark' : 'light');
379
- }
380
- startWatching() {
381
- if (typeof MutationObserver === 'undefined') {
382
- // Fallback for older browsers - check periodically
383
- setInterval(() => this.detectTheme(), 1000);
384
- return;
385
- }
386
- this.observer = new MutationObserver(() => {
387
- this.detectTheme();
388
- });
389
- this.observer.observe(document.documentElement, {
390
- attributes: true,
391
- attributeFilter: ['class', 'data-theme', 'theme', 'data-coreui-theme']
392
- });
393
- }
394
- stopWatching() {
395
- if (this.observer) {
396
- this.observer.disconnect();
397
- this.observer = null;
398
- }
399
- }
400
- get currentTheme() {
401
- return this._currentTheme.value;
402
- }
403
- // Method to manually set theme if needed
404
- setTheme(theme) {
405
- this._currentTheme.next(theme);
406
- }
407
- // Re-detect theme from DOM
408
- refreshTheme() {
409
- this.detectTheme();
410
- }
411
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ThemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
412
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ThemeService, providedIn: 'root' });
413
- }
414
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ThemeService, decorators: [{
415
- type: Injectable,
416
- args: [{
417
- providedIn: 'root'
418
- }]
419
- }], ctorParameters: () => [] });
420
-
421
- class UserProfileComponent {
422
- authService;
423
- router;
424
- themeService;
425
- cdr;
426
- notificationClick = new EventEmitter();
427
- get themeClass() {
428
- return `theme-${this.currentTheme}`;
429
- }
430
- currentUser = signal(null, ...(ngDevMode ? [{ debugName: "currentUser" }] : []));
431
- currentTheme = 'light';
432
- unreadCount = 0;
433
- dropdownOpen = false;
434
- hasUser = false;
435
- destroy$ = new Subject();
436
- // Signal to force avatar refresh
437
- avatarRefresh = signal(Date.now(), ...(ngDevMode ? [{ debugName: "avatarRefresh" }] : []));
438
- constructor(authService, router, themeService, cdr) {
439
- this.authService = authService;
440
- this.router = router;
441
- this.themeService = themeService;
442
- this.cdr = cdr;
443
- }
444
- ngOnInit() {
445
- this.authService.currentUser$
446
- .pipe(takeUntil(this.destroy$))
447
- .subscribe(user => {
448
- this.currentUser.set(user);
449
- this.hasUser = !!user;
450
- // Force avatar refresh when user changes
451
- this.avatarRefresh.set(Date.now());
452
- if (!this.hasUser) {
453
- this.unreadCount = 0;
454
- }
455
- else {
456
- this.loadUnreadCount();
457
- }
458
- this.cdr.markForCheck();
459
- });
460
- this.themeService.currentTheme$
461
- .pipe(takeUntil(this.destroy$))
462
- .subscribe(theme => {
463
- this.currentTheme = theme;
464
- });
465
- // Listen for new notifications
466
- this.authService.notifications$
467
- .pipe(takeUntil(this.destroy$))
468
- .subscribe(() => {
469
- console.log('Notification received, updating unread count');
470
- if (this.hasUser) {
471
- this.loadUnreadCount();
472
- }
473
- });
474
- }
475
- ngOnDestroy() {
476
- this.destroy$.next();
477
- this.destroy$.complete();
478
- }
479
- loadUnreadCount() {
480
- if (!this.hasUser) {
481
- this.unreadCount = 0;
482
- return;
483
- }
484
- this.authService.getUnreadCount().subscribe({
485
- next: (response) => {
486
- this.unreadCount = response.unreadCount || 0;
487
- },
488
- error: (err) => { }
489
- });
490
- }
491
- getAvatarUrl(user) {
492
- // Use the refresh signal to force update
493
- const refresh = this.avatarRefresh();
494
- const config = this.authService.getConfig();
495
- const baseUrl = config?.apiBaseUrl || '';
496
- // If user has avatarPath, use it directly
497
- if (user.avatarPath) {
498
- // If avatarPath is already a full URL, use it as-is
499
- if (user.avatarPath.startsWith('http://') || user.avatarPath.startsWith('https://')) {
500
- return user.avatarPath;
501
- }
502
- // If it's a relative path, construct full URL with refresh timestamp
503
- return `${baseUrl.replace(/\/$/, '')}${user.avatarPath}?t=${refresh}`;
504
- }
505
- // Fallback: construct URL using userId
506
- const userId = user.userId;
507
- if (userId && baseUrl) {
508
- return `${baseUrl.replace(/\/$/, '')}/auth/${userId}/avatar?t=${refresh}`;
509
- }
510
- // Fallback to UI avatars service if no userId or baseUrl
511
- const displayName = user.userName || user.userId || 'User';
512
- return `https://ui-avatars.com/api/?name=${encodeURIComponent(displayName)}&background=1976d2&color=fff`;
513
- }
514
- getLastNameInitial(user) {
515
- const fullName = user.fullName || user.userName || 'U';
516
- const parts = fullName.split(' ');
517
- const lastPart = parts[parts.length - 1];
518
- return lastPart.charAt(0).toUpperCase();
519
- }
520
- toggleDropdown() {
521
- this.dropdownOpen = !this.dropdownOpen;
522
- }
523
- onDocumentClick(event) {
524
- const target = event.target;
525
- const clickedInside = target.closest('.user-menu-wrapper');
526
- if (!clickedInside) {
527
- this.dropdownOpen = false;
528
- }
529
- }
530
- onLogin() {
531
- const config = this.authService.getConfig();
532
- const baseUrl = config?.userBaseUrl || '';
533
- const returnUrl = encodeURIComponent(this.router.url);
534
- window.location.href = `${baseUrl}/login?returnUrl=${returnUrl}`;
535
- }
536
- onViewProfile() {
537
- this.router.navigate(['/profile']);
538
- this.dropdownOpen = false;
539
- }
540
- onLogout() {
541
- this.authService.logout().subscribe({
542
- next: () => {
543
- // Clear current user after successful logout
544
- this.dropdownOpen = false;
545
- // Navigate to login with return URL
546
- const config = this.authService.getConfig();
547
- const baseUrl = config?.userBaseUrl || '';
548
- const returnUrl = encodeURIComponent(window.location.href);
549
- window.location.href = `${baseUrl}/login?returnUrl=${returnUrl}`;
550
- },
551
- error: (err) => {
552
- // Still navigate to login even if logout fails
553
- const config = this.authService.getConfig();
554
- const baseUrl = config?.userBaseUrl || '';
555
- window.location.href = `${baseUrl}/login`;
556
- }
557
- });
558
- }
559
- onNotificationClick() {
560
- this.notificationClick.emit();
561
- }
562
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: UserProfileComponent, deps: [{ token: MesAuthService }, { token: i2.Router }, { token: ThemeService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
563
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: UserProfileComponent, isStandalone: true, selector: "ma-user-profile", outputs: { notificationClick: "notificationClick" }, host: { listeners: { "document:click": "onDocumentClick($event)" }, properties: { "class": "this.themeClass" } }, ngImport: i0, template: `
564
- <div class="user-profile-container">
565
- <!-- Not logged in -->
566
- <ng-container *ngIf="!currentUser()">
567
- <button class="login-btn" (click)="onLogin()">
568
- Login
569
- </button>
570
- </ng-container>
571
-
572
- <!-- Logged in -->
573
- <ng-container *ngIf="currentUser()">
574
- <div class="user-header">
575
- <button class="notification-btn" (click)="onNotificationClick()" title="Notifications">
576
- <span class="icon">🔔</span>
577
- <span class="badge" *ngIf="unreadCount > 0">{{ unreadCount }}</span>
578
- </button>
579
-
580
- <div class="user-menu-wrapper">
581
- <button class="user-menu-btn" (click)="toggleDropdown()">
582
- <img
583
- *ngIf="currentUser().fullName || currentUser().userName"
584
- [src]="getAvatarUrl(currentUser())"
585
- [alt]="currentUser().fullName || currentUser().userName"
586
- class="avatar"
587
- />
588
- <span *ngIf="!(currentUser().fullName || currentUser().userName)" class="avatar-initial">
589
- {{ getLastNameInitial(currentUser()) }}
590
- </span>
591
- </button>
592
-
593
- <div class="mes-dropdown-menu" *ngIf="dropdownOpen">
594
- <div class="mes-dropdown-header">
595
- {{ currentUser().fullName || currentUser().userName }}
596
- </div>
597
- <button class="mes-dropdown-item profile-link" (click)="onViewProfile()">
598
- View Profile
599
- </button>
600
- <button class="mes-dropdown-item logout-item" (click)="onLogout()">
601
- Logout
602
- </button>
603
- </div>
604
- </div>
605
- </div>
606
- </ng-container>
607
- </div>
608
- `, isInline: true, styles: [":host{--primary-color: #1976d2;--primary-hover: #1565c0;--primary-light: rgba(25, 118, 210, .1);--error-color: #f44336;--error-light: #ffebee;--text-primary: #333;--text-secondary: #666;--text-muted: #999;--bg-primary: white;--bg-secondary: #f5f5f5;--bg-tertiary: #fafafa;--bg-hover: #f5f5f5;--border-color: #e0e0e0;--border-light: #f0f0f0;--shadow: rgba(0, 0, 0, .15);--shadow-light: rgba(0, 0, 0, .1)}:host(.theme-dark){--primary-color: #90caf9;--primary-hover: #64b5f6;--primary-light: rgba(144, 202, 249, .1);--error-color: #ef5350;--error-light: rgba(239, 83, 80, .1);--text-primary: #e0e0e0;--text-secondary: #b0b0b0;--text-muted: #888;--bg-primary: #1e1e1e;--bg-secondary: #2d2d2d;--bg-tertiary: #252525;--bg-hover: #333;--border-color: #404040;--border-light: #333;--shadow: rgba(0, 0, 0, .3);--shadow-light: rgba(0, 0, 0, .2)}.user-profile-container{display:flex;align-items:center;gap:16px;padding:0 16px}.login-btn{padding:8px 16px;background-color:var(--primary-color);color:#fff;border:none;border-radius:4px;cursor:pointer;font-weight:500;transition:background-color .3s}.login-btn:hover{background-color:var(--primary-hover)}.user-header{display:flex;align-items:center;gap:16px}.notification-btn{position:relative;background:none;border:none;font-size:24px;cursor:pointer;padding:8px;transition:opacity .2s}.notification-btn:hover{opacity:.7}.icon{display:inline-block}.badge{position:absolute;top:0;right:0;background-color:var(--error-color);color:#fff;border-radius:50%;width:20px;height:20px;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700}.user-menu-wrapper{position:relative}.user-menu-btn{background:none;border:none;cursor:pointer;padding:4px;border-radius:50%;transition:background-color .2s;display:flex;align-items:center;justify-content:center}.user-menu-btn:hover{background-color:var(--primary-light)}.avatar{width:40px;height:40px;border-radius:50%;object-fit:cover;background-color:#e0e0e0}.avatar-initial{width:40px;height:40px;border-radius:50%;background-color:var(--primary-color);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:16px}.mes-dropdown-menu{position:absolute;top:calc(100% + 8px);right:0;background:var(--bg-primary);border:1px solid var(--border-color);border-radius:4px;box-shadow:0 2px 8px var(--shadow);min-width:200px;z-index:1000;overflow:hidden}.mes-dropdown-header{padding:12px 16px;border-bottom:1px solid var(--border-light);font-weight:600;color:var(--text-primary);font-size:14px}.mes-dropdown-item{display:block;width:100%;padding:12px 16px;border:none;background:none;text-align:left;cursor:pointer;font-size:14px;color:var(--text-primary);text-decoration:none;transition:background-color .2s}.mes-dropdown-item:hover{background-color:var(--bg-hover)}.profile-link{color:var(--primary-color)}.logout-item{border-top:1px solid var(--border-light);color:var(--error-color)}.logout-item:hover{background-color:var(--error-light)}.user-info{display:flex;flex-direction:column;gap:2px}.user-name{font-weight:500;font-size:14px;color:var(--text-primary)}.user-position{font-size:12px;color:var(--text-secondary)}.logout-btn{background:none;border:none;font-size:20px;cursor:pointer;color:var(--text-secondary);padding:4px 8px;transition:color .2s}.logout-btn:hover{color:var(--primary-color)}@media(max-width:768px){.user-info{display:none}.avatar{width:32px;height:32px}}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
609
- }
610
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: UserProfileComponent, decorators: [{
611
- type: Component,
612
- args: [{ selector: 'ma-user-profile', standalone: true, imports: [NgIf], template: `
613
- <div class="user-profile-container">
614
- <!-- Not logged in -->
615
- <ng-container *ngIf="!currentUser()">
616
- <button class="login-btn" (click)="onLogin()">
617
- Login
618
- </button>
619
- </ng-container>
620
-
621
- <!-- Logged in -->
622
- <ng-container *ngIf="currentUser()">
623
- <div class="user-header">
624
- <button class="notification-btn" (click)="onNotificationClick()" title="Notifications">
625
- <span class="icon">🔔</span>
626
- <span class="badge" *ngIf="unreadCount > 0">{{ unreadCount }}</span>
627
- </button>
628
-
629
- <div class="user-menu-wrapper">
630
- <button class="user-menu-btn" (click)="toggleDropdown()">
631
- <img
632
- *ngIf="currentUser().fullName || currentUser().userName"
633
- [src]="getAvatarUrl(currentUser())"
634
- [alt]="currentUser().fullName || currentUser().userName"
635
- class="avatar"
636
- />
637
- <span *ngIf="!(currentUser().fullName || currentUser().userName)" class="avatar-initial">
638
- {{ getLastNameInitial(currentUser()) }}
639
- </span>
640
- </button>
641
-
642
- <div class="mes-dropdown-menu" *ngIf="dropdownOpen">
643
- <div class="mes-dropdown-header">
644
- {{ currentUser().fullName || currentUser().userName }}
645
- </div>
646
- <button class="mes-dropdown-item profile-link" (click)="onViewProfile()">
647
- View Profile
648
- </button>
649
- <button class="mes-dropdown-item logout-item" (click)="onLogout()">
650
- Logout
651
- </button>
652
- </div>
653
- </div>
654
- </div>
655
- </ng-container>
656
- </div>
657
- `, styles: [":host{--primary-color: #1976d2;--primary-hover: #1565c0;--primary-light: rgba(25, 118, 210, .1);--error-color: #f44336;--error-light: #ffebee;--text-primary: #333;--text-secondary: #666;--text-muted: #999;--bg-primary: white;--bg-secondary: #f5f5f5;--bg-tertiary: #fafafa;--bg-hover: #f5f5f5;--border-color: #e0e0e0;--border-light: #f0f0f0;--shadow: rgba(0, 0, 0, .15);--shadow-light: rgba(0, 0, 0, .1)}:host(.theme-dark){--primary-color: #90caf9;--primary-hover: #64b5f6;--primary-light: rgba(144, 202, 249, .1);--error-color: #ef5350;--error-light: rgba(239, 83, 80, .1);--text-primary: #e0e0e0;--text-secondary: #b0b0b0;--text-muted: #888;--bg-primary: #1e1e1e;--bg-secondary: #2d2d2d;--bg-tertiary: #252525;--bg-hover: #333;--border-color: #404040;--border-light: #333;--shadow: rgba(0, 0, 0, .3);--shadow-light: rgba(0, 0, 0, .2)}.user-profile-container{display:flex;align-items:center;gap:16px;padding:0 16px}.login-btn{padding:8px 16px;background-color:var(--primary-color);color:#fff;border:none;border-radius:4px;cursor:pointer;font-weight:500;transition:background-color .3s}.login-btn:hover{background-color:var(--primary-hover)}.user-header{display:flex;align-items:center;gap:16px}.notification-btn{position:relative;background:none;border:none;font-size:24px;cursor:pointer;padding:8px;transition:opacity .2s}.notification-btn:hover{opacity:.7}.icon{display:inline-block}.badge{position:absolute;top:0;right:0;background-color:var(--error-color);color:#fff;border-radius:50%;width:20px;height:20px;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700}.user-menu-wrapper{position:relative}.user-menu-btn{background:none;border:none;cursor:pointer;padding:4px;border-radius:50%;transition:background-color .2s;display:flex;align-items:center;justify-content:center}.user-menu-btn:hover{background-color:var(--primary-light)}.avatar{width:40px;height:40px;border-radius:50%;object-fit:cover;background-color:#e0e0e0}.avatar-initial{width:40px;height:40px;border-radius:50%;background-color:var(--primary-color);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:16px}.mes-dropdown-menu{position:absolute;top:calc(100% + 8px);right:0;background:var(--bg-primary);border:1px solid var(--border-color);border-radius:4px;box-shadow:0 2px 8px var(--shadow);min-width:200px;z-index:1000;overflow:hidden}.mes-dropdown-header{padding:12px 16px;border-bottom:1px solid var(--border-light);font-weight:600;color:var(--text-primary);font-size:14px}.mes-dropdown-item{display:block;width:100%;padding:12px 16px;border:none;background:none;text-align:left;cursor:pointer;font-size:14px;color:var(--text-primary);text-decoration:none;transition:background-color .2s}.mes-dropdown-item:hover{background-color:var(--bg-hover)}.profile-link{color:var(--primary-color)}.logout-item{border-top:1px solid var(--border-light);color:var(--error-color)}.logout-item:hover{background-color:var(--error-light)}.user-info{display:flex;flex-direction:column;gap:2px}.user-name{font-weight:500;font-size:14px;color:var(--text-primary)}.user-position{font-size:12px;color:var(--text-secondary)}.logout-btn{background:none;border:none;font-size:20px;cursor:pointer;color:var(--text-secondary);padding:4px 8px;transition:color .2s}.logout-btn:hover{color:var(--primary-color)}@media(max-width:768px){.user-info{display:none}.avatar{width:32px;height:32px}}\n"] }]
658
- }], ctorParameters: () => [{ type: MesAuthService }, { type: i2.Router }, { type: ThemeService }, { type: i0.ChangeDetectorRef }], propDecorators: { notificationClick: [{
659
- type: Output
660
- }], themeClass: [{
661
- type: HostBinding,
662
- args: ['class']
663
- }], onDocumentClick: [{
664
- type: HostListener,
665
- args: ['document:click', ['$event']]
666
- }] } });
667
-
668
- class ToastService {
669
- toasts$ = new BehaviorSubject([]);
670
- toasts = this.toasts$.asObservable();
671
- show(message, title, type = 'info', duration = 5000) {
672
- const id = Math.random().toString(36).substr(2, 9);
673
- const toast = {
674
- id,
675
- message,
676
- title,
677
- type,
678
- duration
679
- };
680
- const currentToasts = this.toasts$.value;
681
- this.toasts$.next([...currentToasts, toast]);
682
- if (duration > 0) {
683
- setTimeout(() => {
684
- this.remove(id);
685
- }, duration);
686
- }
687
- return id;
688
- }
689
- remove(id) {
690
- const currentToasts = this.toasts$.value;
691
- this.toasts$.next(currentToasts.filter(t => t.id !== id));
692
- }
693
- clear() {
694
- this.toasts$.next([]);
695
- }
696
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ToastService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
697
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ToastService, providedIn: 'root' });
698
- }
699
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ToastService, decorators: [{
700
- type: Injectable,
701
- args: [{ providedIn: 'root' }]
702
- }] });
703
-
704
- class ToastContainerComponent {
705
- toastService;
706
- themeService;
707
- get themeClass() {
708
- return `theme-${this.currentTheme}`;
709
- }
710
- toasts = [];
711
- currentTheme = 'light';
712
- destroy$ = new Subject();
713
- constructor(toastService, themeService) {
714
- this.toastService = toastService;
715
- this.themeService = themeService;
716
- }
717
- ngOnInit() {
718
- this.toastService.toasts
719
- .pipe(takeUntil(this.destroy$))
720
- .subscribe(toasts => {
721
- this.toasts = toasts;
722
- });
723
- this.themeService.currentTheme$
724
- .pipe(takeUntil(this.destroy$))
725
- .subscribe(theme => {
726
- this.currentTheme = theme;
727
- });
728
- }
729
- ngOnDestroy() {
730
- this.destroy$.next();
731
- this.destroy$.complete();
732
- }
733
- close(id) {
734
- this.toastService.remove(id);
735
- }
736
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ToastContainerComponent, deps: [{ token: ToastService }, { token: ThemeService }], target: i0.ɵɵFactoryTarget.Component });
737
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: ToastContainerComponent, isStandalone: true, selector: "ma-toast-container", host: { properties: { "class": "this.themeClass" } }, ngImport: i0, template: `
738
- <div class="toast-container">
739
- <div
740
- *ngFor="let toast of toasts"
741
- class="toast"
742
- [class]="'toast-' + toast.type"
743
- [@slideIn]
744
- >
745
- <div class="toast-content">
746
- <div *ngIf="toast.title" class="toast-title">{{ toast.title }}</div>
747
- <div class="toast-message" [innerHTML]="toast.message"></div>
748
- </div>
749
- <button class="toast-close" (click)="close(toast.id)" aria-label="Close">
750
-
751
- </button>
752
- </div>
753
- </div>
754
- `, isInline: true, styles: [":host{--info-color: #2196f3;--success-color: #4caf50;--warning-color: #ff9800;--error-color: #f44336;--text-primary: #333;--bg-primary: white;--shadow: rgba(0, 0, 0, .15);--text-secondary: #999;--border-color: rgba(0, 0, 0, .1)}:host(.theme-dark){--info-color: #64b5f6;--success-color: #81c784;--warning-color: #ffb74d;--error-color: #ef5350;--text-primary: #e0e0e0;--bg-primary: #1e1e1e;--shadow: rgba(0, 0, 0, .3);--text-secondary: #888;--border-color: rgba(255, 255, 255, .1)}.toast-container{position:fixed;top:20px;right:20px;z-index:9999;pointer-events:none}.toast{display:flex;align-items:flex-start;gap:12px;padding:12px 16px;margin-bottom:12px;border-radius:4px;background:var(--bg-primary);border:1px solid var(--border-color);box-shadow:0 4px 12px var(--shadow);pointer-events:auto;min-width:280px;max-width:400px;animation:slideIn .3s ease-out}.toast-content{flex:1}.toast-title{font-weight:600;font-size:14px;margin-bottom:4px}.toast-message{font-size:13px;line-height:1.4}.toast-close{background:none;border:none;cursor:pointer;font-size:18px;color:var(--text-secondary);padding:0;width:24px;height:24px;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:color .2s}.toast-close:hover{color:var(--text-primary)}.toast-info{border-left:4px solid var(--info-color)}.toast-info .toast-title{color:var(--info-color)}.toast-info .toast-message{color:var(--text-primary)}.toast-success{border-left:4px solid var(--success-color)}.toast-success .toast-title{color:var(--success-color)}.toast-success .toast-message{color:var(--text-primary)}.toast-warning{border-left:4px solid var(--warning-color)}.toast-warning .toast-title{color:var(--warning-color)}.toast-warning .toast-message{color:var(--text-primary)}.toast-error{border-left:4px solid var(--error-color)}.toast-error .toast-title{color:var(--error-color)}.toast-error .toast-message{color:var(--text-primary)}@keyframes slideIn{0%{transform:translate(400px);opacity:0}to{transform:translate(0);opacity:1}}@media(max-width:600px){.toast-container{top:10px;right:10px;left:10px}.toast{min-width:auto;max-width:100%}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
755
- }
756
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ToastContainerComponent, decorators: [{
757
- type: Component,
758
- args: [{ selector: 'ma-toast-container', standalone: true, imports: [CommonModule], template: `
759
- <div class="toast-container">
760
- <div
761
- *ngFor="let toast of toasts"
762
- class="toast"
763
- [class]="'toast-' + toast.type"
764
- [@slideIn]
765
- >
766
- <div class="toast-content">
767
- <div *ngIf="toast.title" class="toast-title">{{ toast.title }}</div>
768
- <div class="toast-message" [innerHTML]="toast.message"></div>
769
- </div>
770
- <button class="toast-close" (click)="close(toast.id)" aria-label="Close">
771
-
772
- </button>
773
- </div>
774
- </div>
775
- `, styles: [":host{--info-color: #2196f3;--success-color: #4caf50;--warning-color: #ff9800;--error-color: #f44336;--text-primary: #333;--bg-primary: white;--shadow: rgba(0, 0, 0, .15);--text-secondary: #999;--border-color: rgba(0, 0, 0, .1)}:host(.theme-dark){--info-color: #64b5f6;--success-color: #81c784;--warning-color: #ffb74d;--error-color: #ef5350;--text-primary: #e0e0e0;--bg-primary: #1e1e1e;--shadow: rgba(0, 0, 0, .3);--text-secondary: #888;--border-color: rgba(255, 255, 255, .1)}.toast-container{position:fixed;top:20px;right:20px;z-index:9999;pointer-events:none}.toast{display:flex;align-items:flex-start;gap:12px;padding:12px 16px;margin-bottom:12px;border-radius:4px;background:var(--bg-primary);border:1px solid var(--border-color);box-shadow:0 4px 12px var(--shadow);pointer-events:auto;min-width:280px;max-width:400px;animation:slideIn .3s ease-out}.toast-content{flex:1}.toast-title{font-weight:600;font-size:14px;margin-bottom:4px}.toast-message{font-size:13px;line-height:1.4}.toast-close{background:none;border:none;cursor:pointer;font-size:18px;color:var(--text-secondary);padding:0;width:24px;height:24px;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:color .2s}.toast-close:hover{color:var(--text-primary)}.toast-info{border-left:4px solid var(--info-color)}.toast-info .toast-title{color:var(--info-color)}.toast-info .toast-message{color:var(--text-primary)}.toast-success{border-left:4px solid var(--success-color)}.toast-success .toast-title{color:var(--success-color)}.toast-success .toast-message{color:var(--text-primary)}.toast-warning{border-left:4px solid var(--warning-color)}.toast-warning .toast-title{color:var(--warning-color)}.toast-warning .toast-message{color:var(--text-primary)}.toast-error{border-left:4px solid var(--error-color)}.toast-error .toast-title{color:var(--error-color)}.toast-error .toast-message{color:var(--text-primary)}@keyframes slideIn{0%{transform:translate(400px);opacity:0}to{transform:translate(0);opacity:1}}@media(max-width:600px){.toast-container{top:10px;right:10px;left:10px}.toast{min-width:auto;max-width:100%}}\n"] }]
776
- }], ctorParameters: () => [{ type: ToastService }, { type: ThemeService }], propDecorators: { themeClass: [{
777
- type: HostBinding,
778
- args: ['class']
779
- }] } });
780
-
781
- class NotificationPanelComponent {
782
- authService;
783
- toastService;
784
- themeService;
785
- notificationRead = new EventEmitter();
786
- get themeClass() {
787
- return `theme-${this.currentTheme}`;
788
- }
789
- isOpen = false;
790
- notifications = [];
791
- currentTheme = 'light';
792
- activeTab = 'unread'; // Default to unread tab
793
- destroy$ = new Subject();
794
- get unreadNotifications() {
795
- return this.notifications.filter(n => !n.isRead);
796
- }
797
- get readNotifications() {
798
- return this.notifications.filter(n => n.isRead);
799
- }
800
- get currentNotifications() {
801
- return this.activeTab === 'unread' ? this.unreadNotifications : this.readNotifications;
802
- }
803
- getNotificationMessage(notification) {
804
- return notification.messageHtml || notification.message || '';
805
- }
806
- constructor(authService, toastService, themeService) {
807
- this.authService = authService;
808
- this.toastService = toastService;
809
- this.themeService = themeService;
810
- }
811
- ngOnInit() {
812
- this.themeService.currentTheme$
813
- .pipe(takeUntil(this.destroy$))
814
- .subscribe(theme => {
815
- this.currentTheme = theme;
816
- });
817
- this.loadNotifications();
818
- // Listen for new real-time notifications
819
- this.authService.notifications$
820
- .pipe(takeUntil(this.destroy$))
821
- .subscribe((notification) => {
822
- // Show toast for new notification
823
- this.toastService.show(notification.messageHtml || notification.message || '', notification.title, 'info', 5000);
824
- // Reload notifications list
825
- this.loadNotifications();
826
- });
827
- }
828
- ngOnDestroy() {
829
- this.destroy$.next();
830
- this.destroy$.complete();
831
- }
832
- loadNotifications() {
833
- this.authService.getNotifications(1, 50, true).subscribe({
834
- next: (response) => {
835
- this.notifications = response.items || [];
836
- },
837
- error: (err) => { }
838
- });
839
- }
840
- open() {
841
- this.isOpen = true;
842
- this.activeTab = 'unread'; // Reset to unread tab when opening
843
- }
844
- close() {
845
- this.isOpen = false;
846
- }
847
- switchTab(tab) {
848
- this.activeTab = tab;
849
- }
850
- markAsRead(notificationId, event) {
851
- if (event) {
852
- event.stopPropagation();
853
- }
854
- this.authService.markAsRead(notificationId).subscribe({
855
- next: () => {
856
- const notification = this.notifications.find(n => n.id === notificationId);
857
- if (notification) {
858
- notification.isRead = true;
859
- this.notificationRead.emit();
860
- }
861
- },
862
- error: (err) => { }
863
- });
864
- }
865
- markAllAsRead() {
866
- this.authService.markAllAsRead().subscribe({
867
- next: () => {
868
- this.notifications.forEach(n => n.isRead = true);
869
- this.notificationRead.emit();
870
- },
871
- error: (err) => { }
872
- });
873
- }
874
- deleteAllRead() {
875
- const readNotificationIds = this.notifications
876
- .filter(n => n.isRead)
877
- .map(n => n.id);
878
- // Delete all read notifications
879
- const deletePromises = readNotificationIds.map(id => this.authService.deleteNotification(id).toPromise());
880
- Promise.all(deletePromises).then(() => {
881
- // Remove all read notifications from the local array
882
- this.notifications = this.notifications.filter(n => !n.isRead);
883
- }).catch((err) => {
884
- // If bulk delete fails, reload notifications to get current state
885
- this.loadNotifications();
886
- });
887
- }
888
- deleteAllUnread() {
889
- const unreadNotificationIds = this.notifications
890
- .filter(n => !n.isRead)
891
- .map(n => n.id);
892
- // Delete all unread notifications
893
- const deletePromises = unreadNotificationIds.map(id => this.authService.deleteNotification(id).toPromise());
894
- Promise.all(deletePromises).then(() => {
895
- // Remove all unread notifications from the local array
896
- this.notifications = this.notifications.filter(n => n.isRead);
897
- }).catch((err) => {
898
- // If bulk delete fails, reload notifications to get current state
899
- this.loadNotifications();
900
- });
901
- }
902
- delete(notificationId, event) {
903
- event.stopPropagation();
904
- this.authService.deleteNotification(notificationId).subscribe({
905
- next: () => {
906
- this.notifications = this.notifications.filter(n => n.id !== notificationId);
907
- },
908
- error: (err) => { }
909
- });
910
- }
911
- formatDate(dateString) {
912
- const date = new Date(dateString);
913
- const now = new Date();
914
- const diffMs = now.getTime() - date.getTime();
915
- const diffMins = Math.floor(diffMs / 60000);
916
- const diffHours = Math.floor(diffMs / 3600000);
917
- const diffDays = Math.floor(diffMs / 86400000);
918
- if (diffMins < 1)
919
- return 'Now';
920
- if (diffMins < 60)
921
- return `${diffMins}m ago`;
922
- if (diffHours < 24)
923
- return `${diffHours}h ago`;
924
- if (diffDays < 7)
925
- return `${diffDays}d ago`;
926
- return date.toLocaleDateString();
927
- }
928
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: NotificationPanelComponent, deps: [{ token: MesAuthService }, { token: ToastService }, { token: ThemeService }], target: i0.ɵɵFactoryTarget.Component });
929
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: NotificationPanelComponent, isStandalone: true, selector: "ma-notification-panel", outputs: { notificationRead: "notificationRead" }, host: { properties: { "class": "this.themeClass" } }, ngImport: i0, template: `
930
- <div class="notification-panel" [class.open]="isOpen">
931
- <!-- Header -->
932
- <div class="panel-header">
933
- <h3>Notifications</h3>
934
- <button class="close-btn" (click)="close()" title="Close">✕</button>
935
- </div>
936
-
937
- <!-- Tabs -->
938
- <div class="tabs">
939
- <button
940
- class="tab-btn"
941
- [class.active]="activeTab === 'unread'"
942
- (click)="switchTab('unread')"
943
- >
944
- Unread ({{ unreadNotifications.length }})
945
- </button>
946
- <button
947
- class="tab-btn"
948
- [class.active]="activeTab === 'read'"
949
- (click)="switchTab('read')"
950
- >
951
- Read ({{ readNotifications.length }})
952
- </button>
953
- </div>
954
-
955
- <!-- Notifications List -->
956
- <div class="notifications-list">
957
- <ng-container *ngIf="currentNotifications.length > 0">
958
- <div
959
- *ngFor="let notification of currentNotifications"
960
- class="notification-item"
961
- [class.unread]="!notification.isRead"
962
- (click)="markAsRead(notification.id)"
963
- >
964
- <div class="notification-content">
965
- <div class="notification-title">{{ notification.title }}</div>
966
- <div class="notification-message" [innerHTML]="getNotificationMessage(notification)"></div>
967
- <div class="notification-meta">
968
- <span class="app-name">{{ notification.sourceAppName }}</span>
969
- <span class="time">{{ formatDate(notification.createdAt) }}</span>
970
- </div>
971
- </div>
972
- <button
973
- class="read-btn"
974
- (click)="markAsRead(notification.id, $event)"
975
- title="Mark as read"
976
- *ngIf="!notification.isRead"
977
- >
978
-
979
- </button>
980
- <button
981
- class="delete-btn"
982
- (click)="delete(notification.id, $event)"
983
- title="Delete notification"
984
- *ngIf="notification.isRead"
985
- >
986
-
987
- </button>
988
- </div>
989
- </ng-container>
990
-
991
- <ng-container *ngIf="currentNotifications.length === 0">
992
- <div class="empty-state">
993
- No {{ activeTab }} notifications
994
- </div>
995
- </ng-container>
996
- </div>
997
-
998
- <!-- Footer Actions -->
999
- <div class="panel-footer" *ngIf="currentNotifications.length > 0">
1000
- <div class="footer-actions" *ngIf="activeTab === 'unread'">
1001
- <button class="action-btn" (click)="markAllAsRead()" *ngIf="unreadNotifications.length > 0">
1002
- Mark all as read
1003
- </button>
1004
- <button class="action-btn delete-all-btn" (click)="deleteAllUnread()" *ngIf="unreadNotifications.length > 0">
1005
- Delete all
1006
- </button>
1007
- </div>
1008
- <button class="action-btn delete-all-btn" (click)="deleteAllRead()" *ngIf="activeTab === 'read' && readNotifications.length > 0">
1009
- Delete all
1010
- </button>
1011
- </div>
1012
- </div>
1013
- `, isInline: true, styles: [":host{--primary-color: #1976d2;--primary-hover: #1565c0;--success-color: #4caf50;--error-color: #f44336;--text-primary: #333;--text-secondary: #666;--text-muted: #999;--bg-primary: white;--bg-secondary: #f5f5f5;--bg-tertiary: #fafafa;--bg-hover: #f5f5f5;--bg-unread: #e3f2fd;--border-color: #e0e0e0;--border-light: #f0f0f0;--shadow: rgba(0, 0, 0, .1)}:host(.theme-dark){--primary-color: #90caf9;--primary-hover: #64b5f6;--success-color: #81c784;--error-color: #ef5350;--text-primary: #e0e0e0;--text-secondary: #b0b0b0;--text-muted: #888;--bg-primary: #1e1e1e;--bg-secondary: #2d2d2d;--bg-tertiary: #252525;--bg-hover: #333;--bg-unread: rgba(144, 202, 249, .1);--border-color: #404040;--border-light: #333;--shadow: rgba(0, 0, 0, .3)}.notification-panel{position:fixed;top:0;right:-350px;width:350px;height:100vh;background:var(--bg-primary);box-shadow:-2px 0 8px var(--shadow);display:flex;flex-direction:column;z-index:1000;transition:right .3s ease}.notification-panel.open{right:0}.panel-header{display:flex;justify-content:space-between;align-items:center;padding:16px;border-bottom:1px solid var(--border-color);background-color:var(--bg-secondary)}.panel-header h3{margin:0;font-size:18px;color:var(--text-primary)}.close-btn{background:none;border:none;font-size:20px;cursor:pointer;color:var(--text-secondary);padding:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center;transition:color .2s}.close-btn:hover{color:var(--text-primary)}.tabs{display:flex;border-bottom:1px solid var(--border-color);background-color:var(--bg-secondary)}.tab-btn{flex:1;padding:12px 16px;background:none;border:none;color:var(--text-secondary);cursor:pointer;font-size:14px;font-weight:500;transition:all .2s;border-bottom:2px solid transparent}.tab-btn:hover{background-color:var(--bg-hover);color:var(--text-primary)}.tab-btn.active{color:var(--primary-color);border-bottom-color:var(--primary-color);background-color:var(--bg-primary)}.notifications-list{flex:1;overflow-y:auto}.notification-item{display:flex;gap:12px;padding:12px 16px;border-bottom:1px solid var(--border-light);cursor:pointer;background-color:var(--bg-tertiary);transition:background-color .2s}.notification-item:hover{background-color:var(--bg-hover)}.notification-item.unread{background-color:var(--bg-unread)}.notification-content{flex:1;min-width:0}.notification-title{font-weight:600;color:var(--text-primary);font-size:14px;margin-bottom:4px}.notification-message{color:var(--text-secondary);font-size:13px;line-height:1.4;margin-bottom:6px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.notification-meta{display:flex;justify-content:space-between;font-size:12px;color:var(--text-muted)}.app-name{font-weight:500;color:var(--primary-color)}.read-btn{background:none;border:none;color:var(--text-muted);cursor:pointer;font-size:14px;padding:0;width:24px;height:24px;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:color .2s}.read-btn:hover{color:var(--success-color)}.delete-btn{background:none;border:none;color:var(--text-muted);cursor:pointer;font-size:14px;padding:0;width:24px;height:24px;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:color .2s}.delete-btn:hover{color:var(--error-color)}.empty-state{display:flex;align-items:center;justify-content:center;height:100%;color:var(--text-muted);font-size:14px}.panel-footer{padding:12px 16px;border-top:1px solid var(--border-color);background-color:var(--bg-secondary)}.footer-actions{display:flex;gap:8px}.footer-actions .action-btn{flex:1}.action-btn{width:100%;padding:8px;background-color:var(--primary-color);color:#fff;border:none;border-radius:4px;cursor:pointer;font-weight:500;transition:background-color .2s}.action-btn:hover{background-color:var(--primary-hover)}.delete-all-btn{background-color:var(--error-color);color:#fff}.delete-all-btn:hover{background-color:#d32f2f}@media(max-width:600px){.notification-panel{width:100%;right:-100%}}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
1014
- }
1015
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: NotificationPanelComponent, decorators: [{
1016
- type: Component,
1017
- args: [{ selector: 'ma-notification-panel', standalone: true, imports: [NgIf, NgFor], template: `
1018
- <div class="notification-panel" [class.open]="isOpen">
1019
- <!-- Header -->
1020
- <div class="panel-header">
1021
- <h3>Notifications</h3>
1022
- <button class="close-btn" (click)="close()" title="Close">✕</button>
1023
- </div>
1024
-
1025
- <!-- Tabs -->
1026
- <div class="tabs">
1027
- <button
1028
- class="tab-btn"
1029
- [class.active]="activeTab === 'unread'"
1030
- (click)="switchTab('unread')"
1031
- >
1032
- Unread ({{ unreadNotifications.length }})
1033
- </button>
1034
- <button
1035
- class="tab-btn"
1036
- [class.active]="activeTab === 'read'"
1037
- (click)="switchTab('read')"
1038
- >
1039
- Read ({{ readNotifications.length }})
1040
- </button>
1041
- </div>
1042
-
1043
- <!-- Notifications List -->
1044
- <div class="notifications-list">
1045
- <ng-container *ngIf="currentNotifications.length > 0">
1046
- <div
1047
- *ngFor="let notification of currentNotifications"
1048
- class="notification-item"
1049
- [class.unread]="!notification.isRead"
1050
- (click)="markAsRead(notification.id)"
1051
- >
1052
- <div class="notification-content">
1053
- <div class="notification-title">{{ notification.title }}</div>
1054
- <div class="notification-message" [innerHTML]="getNotificationMessage(notification)"></div>
1055
- <div class="notification-meta">
1056
- <span class="app-name">{{ notification.sourceAppName }}</span>
1057
- <span class="time">{{ formatDate(notification.createdAt) }}</span>
1058
- </div>
1059
- </div>
1060
- <button
1061
- class="read-btn"
1062
- (click)="markAsRead(notification.id, $event)"
1063
- title="Mark as read"
1064
- *ngIf="!notification.isRead"
1065
- >
1066
-
1067
- </button>
1068
- <button
1069
- class="delete-btn"
1070
- (click)="delete(notification.id, $event)"
1071
- title="Delete notification"
1072
- *ngIf="notification.isRead"
1073
- >
1074
-
1075
- </button>
1076
- </div>
1077
- </ng-container>
1078
-
1079
- <ng-container *ngIf="currentNotifications.length === 0">
1080
- <div class="empty-state">
1081
- No {{ activeTab }} notifications
1082
- </div>
1083
- </ng-container>
1084
- </div>
1085
-
1086
- <!-- Footer Actions -->
1087
- <div class="panel-footer" *ngIf="currentNotifications.length > 0">
1088
- <div class="footer-actions" *ngIf="activeTab === 'unread'">
1089
- <button class="action-btn" (click)="markAllAsRead()" *ngIf="unreadNotifications.length > 0">
1090
- Mark all as read
1091
- </button>
1092
- <button class="action-btn delete-all-btn" (click)="deleteAllUnread()" *ngIf="unreadNotifications.length > 0">
1093
- Delete all
1094
- </button>
1095
- </div>
1096
- <button class="action-btn delete-all-btn" (click)="deleteAllRead()" *ngIf="activeTab === 'read' && readNotifications.length > 0">
1097
- Delete all
1098
- </button>
1099
- </div>
1100
- </div>
1101
- `, styles: [":host{--primary-color: #1976d2;--primary-hover: #1565c0;--success-color: #4caf50;--error-color: #f44336;--text-primary: #333;--text-secondary: #666;--text-muted: #999;--bg-primary: white;--bg-secondary: #f5f5f5;--bg-tertiary: #fafafa;--bg-hover: #f5f5f5;--bg-unread: #e3f2fd;--border-color: #e0e0e0;--border-light: #f0f0f0;--shadow: rgba(0, 0, 0, .1)}:host(.theme-dark){--primary-color: #90caf9;--primary-hover: #64b5f6;--success-color: #81c784;--error-color: #ef5350;--text-primary: #e0e0e0;--text-secondary: #b0b0b0;--text-muted: #888;--bg-primary: #1e1e1e;--bg-secondary: #2d2d2d;--bg-tertiary: #252525;--bg-hover: #333;--bg-unread: rgba(144, 202, 249, .1);--border-color: #404040;--border-light: #333;--shadow: rgba(0, 0, 0, .3)}.notification-panel{position:fixed;top:0;right:-350px;width:350px;height:100vh;background:var(--bg-primary);box-shadow:-2px 0 8px var(--shadow);display:flex;flex-direction:column;z-index:1000;transition:right .3s ease}.notification-panel.open{right:0}.panel-header{display:flex;justify-content:space-between;align-items:center;padding:16px;border-bottom:1px solid var(--border-color);background-color:var(--bg-secondary)}.panel-header h3{margin:0;font-size:18px;color:var(--text-primary)}.close-btn{background:none;border:none;font-size:20px;cursor:pointer;color:var(--text-secondary);padding:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center;transition:color .2s}.close-btn:hover{color:var(--text-primary)}.tabs{display:flex;border-bottom:1px solid var(--border-color);background-color:var(--bg-secondary)}.tab-btn{flex:1;padding:12px 16px;background:none;border:none;color:var(--text-secondary);cursor:pointer;font-size:14px;font-weight:500;transition:all .2s;border-bottom:2px solid transparent}.tab-btn:hover{background-color:var(--bg-hover);color:var(--text-primary)}.tab-btn.active{color:var(--primary-color);border-bottom-color:var(--primary-color);background-color:var(--bg-primary)}.notifications-list{flex:1;overflow-y:auto}.notification-item{display:flex;gap:12px;padding:12px 16px;border-bottom:1px solid var(--border-light);cursor:pointer;background-color:var(--bg-tertiary);transition:background-color .2s}.notification-item:hover{background-color:var(--bg-hover)}.notification-item.unread{background-color:var(--bg-unread)}.notification-content{flex:1;min-width:0}.notification-title{font-weight:600;color:var(--text-primary);font-size:14px;margin-bottom:4px}.notification-message{color:var(--text-secondary);font-size:13px;line-height:1.4;margin-bottom:6px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.notification-meta{display:flex;justify-content:space-between;font-size:12px;color:var(--text-muted)}.app-name{font-weight:500;color:var(--primary-color)}.read-btn{background:none;border:none;color:var(--text-muted);cursor:pointer;font-size:14px;padding:0;width:24px;height:24px;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:color .2s}.read-btn:hover{color:var(--success-color)}.delete-btn{background:none;border:none;color:var(--text-muted);cursor:pointer;font-size:14px;padding:0;width:24px;height:24px;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:color .2s}.delete-btn:hover{color:var(--error-color)}.empty-state{display:flex;align-items:center;justify-content:center;height:100%;color:var(--text-muted);font-size:14px}.panel-footer{padding:12px 16px;border-top:1px solid var(--border-color);background-color:var(--bg-secondary)}.footer-actions{display:flex;gap:8px}.footer-actions .action-btn{flex:1}.action-btn{width:100%;padding:8px;background-color:var(--primary-color);color:#fff;border:none;border-radius:4px;cursor:pointer;font-weight:500;transition:background-color .2s}.action-btn:hover{background-color:var(--primary-hover)}.delete-all-btn{background-color:var(--error-color);color:#fff}.delete-all-btn:hover{background-color:#d32f2f}@media(max-width:600px){.notification-panel{width:100%;right:-100%}}\n"] }]
1102
- }], ctorParameters: () => [{ type: MesAuthService }, { type: ToastService }, { type: ThemeService }], propDecorators: { notificationRead: [{
1103
- type: Output
1104
- }], themeClass: [{
1105
- type: HostBinding,
1106
- args: ['class']
1107
- }] } });
1108
-
1109
- class MaUserComponent {
1110
- userProfile;
1111
- ngAfterViewInit() {
1112
- // Ensure proper initialization
1113
- if (this.userProfile) {
1114
- this.userProfile.loadUnreadCount();
1115
- }
1116
- }
1117
- onNotificationRead() {
1118
- if (this.userProfile) {
1119
- this.userProfile.loadUnreadCount();
1120
- }
1121
- }
1122
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MaUserComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1123
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: MaUserComponent, isStandalone: true, selector: "ma-user", viewQueries: [{ propertyName: "userProfile", first: true, predicate: UserProfileComponent, descendants: true }], ngImport: i0, template: `
1124
- <ma-toast-container></ma-toast-container>
1125
- <div class="user-header">
1126
- <ma-user-profile (notificationClick)="notificationPanel.open()"></ma-user-profile>
1127
- </div>
1128
- <ma-notification-panel #notificationPanel (notificationRead)="onNotificationRead()"></ma-notification-panel>
1129
- `, isInline: true, styles: [".user-header{display:flex;justify-content:flex-end}\n"], dependencies: [{ kind: "component", type: ToastContainerComponent, selector: "ma-toast-container" }, { kind: "component", type: UserProfileComponent, selector: "ma-user-profile", outputs: ["notificationClick"] }, { kind: "component", type: NotificationPanelComponent, selector: "ma-notification-panel", outputs: ["notificationRead"] }] });
1130
- }
1131
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MaUserComponent, decorators: [{
1132
- type: Component,
1133
- args: [{ selector: 'ma-user', standalone: true, imports: [ToastContainerComponent, UserProfileComponent, NotificationPanelComponent], template: `
1134
- <ma-toast-container></ma-toast-container>
1135
- <div class="user-header">
1136
- <ma-user-profile (notificationClick)="notificationPanel.open()"></ma-user-profile>
1137
- </div>
1138
- <ma-notification-panel #notificationPanel (notificationRead)="onNotificationRead()"></ma-notification-panel>
1139
- `, styles: [".user-header{display:flex;justify-content:flex-end}\n"] }]
1140
- }], propDecorators: { userProfile: [{
1141
- type: ViewChild,
1142
- args: [UserProfileComponent]
1143
- }] } });
1144
-
1145
- class NotificationBadgeComponent {
1146
- authService;
1147
- themeService;
1148
- notificationClick = new EventEmitter();
1149
- get themeClass() {
1150
- return `theme-${this.currentTheme}`;
1151
- }
1152
- unreadCount = 0;
1153
- currentTheme = 'light';
1154
- hasUser = false;
1155
- destroy$ = new Subject();
1156
- constructor(authService, themeService) {
1157
- this.authService = authService;
1158
- this.themeService = themeService;
1159
- }
1160
- ngOnInit() {
1161
- this.themeService.currentTheme$
1162
- .pipe(takeUntil(this.destroy$))
1163
- .subscribe(theme => {
1164
- this.currentTheme = theme;
1165
- });
1166
- this.authService.currentUser$
1167
- .pipe(takeUntil(this.destroy$))
1168
- .subscribe(user => {
1169
- this.hasUser = !!user;
1170
- if (!this.hasUser) {
1171
- this.unreadCount = 0;
1172
- return;
1173
- }
1174
- this.loadUnreadCount();
1175
- });
1176
- // Listen for new notifications
1177
- this.authService.notifications$
1178
- .pipe(takeUntil(this.destroy$))
1179
- .subscribe(() => {
1180
- if (this.hasUser) {
1181
- this.loadUnreadCount();
1182
- }
1183
- });
1184
- }
1185
- ngOnDestroy() {
1186
- this.destroy$.next();
1187
- this.destroy$.complete();
1188
- }
1189
- loadUnreadCount() {
1190
- if (!this.hasUser) {
1191
- this.unreadCount = 0;
1192
- return;
1193
- }
1194
- this.authService.getUnreadCount().subscribe({
1195
- next: (response) => {
1196
- this.unreadCount = response.unreadCount || 0;
1197
- },
1198
- error: (err) => console.error('Error loading unread count:', err)
1199
- });
1200
- }
1201
- onNotificationClick() {
1202
- this.notificationClick.emit();
1203
- }
1204
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: NotificationBadgeComponent, deps: [{ token: MesAuthService }, { token: ThemeService }], target: i0.ɵɵFactoryTarget.Component });
1205
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: NotificationBadgeComponent, isStandalone: true, selector: "ma-notification-badge", outputs: { notificationClick: "notificationClick" }, host: { properties: { "class": "this.themeClass" } }, ngImport: i0, template: `
1206
- <button class="notification-btn" (click)="onNotificationClick()" title="Notifications">
1207
- <span class="icon">🔔</span>
1208
- <span class="badge" *ngIf="unreadCount > 0">{{ unreadCount }}</span>
1209
- </button>
1210
- `, isInline: true, styles: [":host{--error-color: #f44336}:host(.theme-dark){--error-color: #ef5350}.notification-btn{position:relative;background:none;border:none;font-size:24px;cursor:pointer;padding:8px;transition:opacity .2s}.notification-btn:hover{opacity:.7}.icon{display:inline-block}.badge{position:absolute;top:0;right:0;background-color:var(--error-color);color:#fff;border-radius:50%;width:20px;height:20px;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1211
- }
1212
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: NotificationBadgeComponent, decorators: [{
1213
- type: Component,
1214
- args: [{ selector: 'ma-notification-badge', standalone: true, imports: [NgIf], template: `
1215
- <button class="notification-btn" (click)="onNotificationClick()" title="Notifications">
1216
- <span class="icon">🔔</span>
1217
- <span class="badge" *ngIf="unreadCount > 0">{{ unreadCount }}</span>
1218
- </button>
1219
- `, styles: [":host{--error-color: #f44336}:host(.theme-dark){--error-color: #ef5350}.notification-btn{position:relative;background:none;border:none;font-size:24px;cursor:pointer;padding:8px;transition:opacity .2s}.notification-btn:hover{opacity:.7}.icon{display:inline-block}.badge{position:absolute;top:0;right:0;background-color:var(--error-color);color:#fff;border-radius:50%;width:20px;height:20px;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700}\n"] }]
1220
- }], ctorParameters: () => [{ type: MesAuthService }, { type: ThemeService }], propDecorators: { notificationClick: [{
1221
- type: Output
1222
- }], themeClass: [{
1223
- type: HostBinding,
1224
- args: ['class']
1225
- }] } });
1226
-
1227
- /**
1228
- * Generated bundle index. Do not edit.
1229
- */
1230
-
1231
- export { MES_AUTH_CONFIG, MaUserComponent, MesAuthModule, MesAuthService, NotificationBadgeComponent, NotificationPanelComponent, NotificationType, ThemeService, ToastContainerComponent, ToastService, UserProfileComponent, mesAuthInterceptor, provideMesAuth };
1232
- //# sourceMappingURL=mesauth-angular.mjs.map