var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { Component, ViewChild, ChangeDetectionStrategy } from '@angular/core';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { BaseResourceComponent } from '@memberjunction/ng-shared';
import { RegisterClass } from '@memberjunction/global';
import { Metadata, CompositeKey } from '@memberjunction/core';
import { UserInfoEngine } from '@memberjunction/core-entities';
import { MJNotificationService } from '@memberjunction/ng-notifications';
import * as i0 from "@angular/core";
import * as i1 from "@memberjunction/ng-base-application";
import * as i2 from "@memberjunction/ng-shared";
import * as i3 from "@progress/kendo-angular-buttons";
import * as i4 from "@memberjunction/ng-shared-generic";
import * as i5 from "@memberjunction/ng-explorer-settings";
import * as i6 from "@angular/common";
const _c0 = ["appConfigDialog"];
function HomeDashboardComponent_Conditional_8_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 6);
    i0.ɵɵelement(1, "mj-loading", 11);
    i0.ɵɵelementEnd();
} }
function HomeDashboardComponent_Conditional_9_For_6_Conditional_7_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "p", 22);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const appData_r3 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(appData_r3.app.Description);
} }
function HomeDashboardComponent_Conditional_9_For_6_Conditional_8_For_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 26);
    i0.ɵɵelement(1, "i");
    i0.ɵɵelementStart(2, "span");
    i0.ɵɵtext(3);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const item_r5 = ctx.$implicit;
    i0.ɵɵadvance();
    i0.ɵɵclassMap(item_r5.Icon);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(item_r5.Label);
} }
function HomeDashboardComponent_Conditional_9_For_6_Conditional_8_Conditional_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 27);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const appData_r3 = i0.ɵɵnextContext(2).$implicit;
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" +", appData_r3.moreItemsCount, " more ");
} }
function HomeDashboardComponent_Conditional_9_For_6_Conditional_8_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 23);
    i0.ɵɵrepeaterCreate(1, HomeDashboardComponent_Conditional_9_For_6_Conditional_8_For_2_Template, 4, 3, "div", 26, i0.ɵɵcomponentInstance().trackByNavItem, true);
    i0.ɵɵconditionalCreate(3, HomeDashboardComponent_Conditional_9_For_6_Conditional_8_Conditional_3_Template, 2, 1, "span", 27);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const appData_r3 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵadvance();
    i0.ɵɵrepeater(appData_r3.navItemsPreview);
    i0.ɵɵadvance(2);
    i0.ɵɵconditional(appData_r3.showMoreItems ? 3 : -1);
} }
function HomeDashboardComponent_Conditional_9_For_6_Template(rf, ctx) { if (rf & 1) {
    const _r2 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 17);
    i0.ɵɵlistener("click", function HomeDashboardComponent_Conditional_9_For_6_Template_div_click_0_listener() { const appData_r3 = i0.ɵɵrestoreView(_r2).$implicit; const ctx_r3 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r3.onAppClick(appData_r3.app)); });
    i0.ɵɵelementStart(1, "div", 18)(2, "div", 19);
    i0.ɵɵelement(3, "i");
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(4, "div", 20)(5, "h3", 21);
    i0.ɵɵtext(6);
    i0.ɵɵelementEnd();
    i0.ɵɵconditionalCreate(7, HomeDashboardComponent_Conditional_9_For_6_Conditional_7_Template, 2, 1, "p", 22);
    i0.ɵɵconditionalCreate(8, HomeDashboardComponent_Conditional_9_For_6_Conditional_8_Template, 4, 1, "div", 23);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(9, "div", 24);
    i0.ɵɵelement(10, "i", 25);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const appData_r3 = ctx.$implicit;
    i0.ɵɵstyleProp("--app-color", appData_r3.color);
    i0.ɵɵadvance(3);
    i0.ɵɵclassMap(appData_r3.icon);
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate(appData_r3.app.Name);
    i0.ɵɵadvance();
    i0.ɵɵconditional(appData_r3.app.Description ? 7 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(appData_r3.navItemsCount > 0 ? 8 : -1);
} }
function HomeDashboardComponent_Conditional_9_Conditional_7_Template(rf, ctx) { if (rf & 1) {
    const _r6 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 16)(1, "div", 28);
    i0.ɵɵelement(2, "i", 29);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(3, "h3");
    i0.ɵɵtext(4, "No Applications Available");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(5, "p");
    i0.ɵɵtext(6, "You don't have any applications configured yet.");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(7, "button", 30);
    i0.ɵɵlistener("click", function HomeDashboardComponent_Conditional_9_Conditional_7_Template_button_click_7_listener() { i0.ɵɵrestoreView(_r6); const ctx_r3 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r3.openConfigDialog()); });
    i0.ɵɵelement(8, "i", 31);
    i0.ɵɵtext(9, " Configure Applications ");
    i0.ɵɵelementEnd()();
} }
function HomeDashboardComponent_Conditional_9_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 7)(1, "h2", 12);
    i0.ɵɵelement(2, "i", 13);
    i0.ɵɵtext(3, " Your Applications ");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(4, "div", 14);
    i0.ɵɵrepeaterCreate(5, HomeDashboardComponent_Conditional_9_For_6_Template, 11, 7, "div", 15, i0.ɵɵcomponentInstance().trackByApp, true);
    i0.ɵɵelementEnd();
    i0.ɵɵconditionalCreate(7, HomeDashboardComponent_Conditional_9_Conditional_7_Template, 10, 0, "div", 16);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext();
    i0.ɵɵadvance(5);
    i0.ɵɵrepeater(ctx_r3.appsDisplayData);
    i0.ɵɵadvance(2);
    i0.ɵɵconditional(ctx_r3.apps.length === 0 ? 7 : -1);
} }
function HomeDashboardComponent_Conditional_10_Conditional_8_For_8_Template(rf, ctx) { if (rf & 1) {
    const _r8 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 46);
    i0.ɵɵlistener("click", function HomeDashboardComponent_Conditional_10_Conditional_8_For_8_Template_div_click_0_listener() { const notification_r9 = i0.ɵɵrestoreView(_r8).$implicit; const ctx_r3 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r3.onNotificationClick(notification_r9)); });
    i0.ɵɵelementStart(1, "div", 47)(2, "span", 48);
    i0.ɵɵtext(3);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(4, "span", 49);
    i0.ɵɵtext(5);
    i0.ɵɵpipe(6, "slice");
    i0.ɵɵelementEnd()()();
} if (rf & 2) {
    const notification_r9 = ctx.$implicit;
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate(notification_r9.Title);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate2("", i0.ɵɵpipeBind3(6, 3, notification_r9.Message, 0, 40), "", ((notification_r9.Message == null ? null : notification_r9.Message.length) || 0) > 40 ? "..." : "");
} }
function HomeDashboardComponent_Conditional_10_Conditional_8_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 37)(1, "h4", 41);
    i0.ɵɵelement(2, "i", 42);
    i0.ɵɵtext(3, " Notifications ");
    i0.ɵɵelementStart(4, "span", 43);
    i0.ɵɵtext(5);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(6, "div", 44);
    i0.ɵɵrepeaterCreate(7, HomeDashboardComponent_Conditional_10_Conditional_8_For_8_Template, 7, 7, "div", 45, i0.ɵɵcomponentInstance().trackByNotification, true);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(5);
    i0.ɵɵtextInterpolate(ctx_r3.unreadNotifications.length);
    i0.ɵɵadvance(2);
    i0.ɵɵrepeater(ctx_r3.unreadNotifications);
} }
function HomeDashboardComponent_Conditional_10_Conditional_9_Conditional_4_For_2_Template(rf, ctx) { if (rf & 1) {
    const _r10 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 53);
    i0.ɵɵlistener("click", function HomeDashboardComponent_Conditional_10_Conditional_9_Conditional_4_For_2_Template_div_click_0_listener() { const favorite_r11 = i0.ɵɵrestoreView(_r10).$implicit; const ctx_r3 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r3.onFavoriteClick(favorite_r11)); });
    i0.ɵɵelementStart(1, "div", 54);
    i0.ɵɵelement(2, "i");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(3, "div", 47)(4, "span", 48);
    i0.ɵɵtext(5);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(6, "span", 49);
    i0.ɵɵtext(7);
    i0.ɵɵelementEnd()()();
} if (rf & 2) {
    const favorite_r11 = ctx.$implicit;
    const ctx_r3 = i0.ɵɵnextContext(4);
    i0.ɵɵadvance(2);
    i0.ɵɵclassMap(ctx_r3.getEntityIconByName(favorite_r11.Entity));
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate(ctx_r3.getFavoriteDisplayName(favorite_r11));
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(favorite_r11.Entity);
} }
function HomeDashboardComponent_Conditional_10_Conditional_9_Conditional_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 44);
    i0.ɵɵrepeaterCreate(1, HomeDashboardComponent_Conditional_10_Conditional_9_Conditional_4_For_2_Template, 8, 4, "div", 52, i0.ɵɵcomponentInstance().trackByFavorite, true);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance();
    i0.ɵɵrepeater(ctx_r3.favorites);
} }
function HomeDashboardComponent_Conditional_10_Conditional_9_Conditional_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 51);
    i0.ɵɵelement(1, "i", 55);
    i0.ɵɵelementStart(2, "span");
    i0.ɵɵtext(3, "Loading...");
    i0.ɵɵelementEnd()();
} }
function HomeDashboardComponent_Conditional_10_Conditional_9_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 38)(1, "h4", 41);
    i0.ɵɵelement(2, "i", 50);
    i0.ɵɵtext(3, " Favorites ");
    i0.ɵɵelementEnd();
    i0.ɵɵconditionalCreate(4, HomeDashboardComponent_Conditional_10_Conditional_9_Conditional_4_Template, 3, 0, "div", 44);
    i0.ɵɵconditionalCreate(5, HomeDashboardComponent_Conditional_10_Conditional_9_Conditional_5_Template, 4, 0, "div", 51);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(4);
    i0.ɵɵconditional(!ctx_r3.favoritesLoading ? 4 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r3.favoritesLoading ? 5 : -1);
} }
function HomeDashboardComponent_Conditional_10_Conditional_10_Conditional_4_For_2_Template(rf, ctx) { if (rf & 1) {
    const _r12 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 58);
    i0.ɵɵlistener("click", function HomeDashboardComponent_Conditional_10_Conditional_10_Conditional_4_For_2_Template_div_click_0_listener() { const item_r13 = i0.ɵɵrestoreView(_r12).$implicit; const ctx_r3 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r3.onRecentClick(item_r13)); });
    i0.ɵɵelementStart(1, "div", 54);
    i0.ɵɵelement(2, "i");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(3, "div", 47)(4, "span", 48);
    i0.ɵɵtext(5);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(6, "span", 49);
    i0.ɵɵtext(7);
    i0.ɵɵelementEnd()()();
} if (rf & 2) {
    const item_r13 = ctx.$implicit;
    const ctx_r3 = i0.ɵɵnextContext(4);
    i0.ɵɵadvance(2);
    i0.ɵɵclassMap(ctx_r3.getEntityIconByName(item_r13.entityName));
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate(item_r13.recordName || item_r13.recordId);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate2("", item_r13.entityName, " \u00B7 ", ctx_r3.formatDate(item_r13.latestAt));
} }
function HomeDashboardComponent_Conditional_10_Conditional_10_Conditional_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 44);
    i0.ɵɵrepeaterCreate(1, HomeDashboardComponent_Conditional_10_Conditional_10_Conditional_4_For_2_Template, 8, 5, "div", 57, i0.ɵɵcomponentInstance().trackByRecent, true);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance();
    i0.ɵɵrepeater(ctx_r3.recentItems);
} }
function HomeDashboardComponent_Conditional_10_Conditional_10_Conditional_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 51);
    i0.ɵɵelement(1, "i", 55);
    i0.ɵɵelementStart(2, "span");
    i0.ɵɵtext(3, "Loading...");
    i0.ɵɵelementEnd()();
} }
function HomeDashboardComponent_Conditional_10_Conditional_10_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 39)(1, "h4", 41);
    i0.ɵɵelement(2, "i", 56);
    i0.ɵɵtext(3, " Recent ");
    i0.ɵɵelementEnd();
    i0.ɵɵconditionalCreate(4, HomeDashboardComponent_Conditional_10_Conditional_10_Conditional_4_Template, 3, 0, "div", 44);
    i0.ɵɵconditionalCreate(5, HomeDashboardComponent_Conditional_10_Conditional_10_Conditional_5_Template, 4, 0, "div", 51);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(4);
    i0.ɵɵconditional(!ctx_r3.recentsLoading ? 4 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r3.recentsLoading ? 5 : -1);
} }
function HomeDashboardComponent_Conditional_10_Conditional_11_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 40);
    i0.ɵɵelement(1, "i", 59);
    i0.ɵɵelementStart(2, "p");
    i0.ɵɵtext(3, "No quick access items");
    i0.ɵɵelementEnd()();
} }
function HomeDashboardComponent_Conditional_10_Template(rf, ctx) { if (rf & 1) {
    const _r7 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 8)(1, "div", 32)(2, "h3");
    i0.ɵɵelement(3, "i", 33);
    i0.ɵɵtext(4, " Quick Access ");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(5, "button", 34);
    i0.ɵɵlistener("click", function HomeDashboardComponent_Conditional_10_Template_button_click_5_listener() { i0.ɵɵrestoreView(_r7); const ctx_r3 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r3.toggleSidebar()); });
    i0.ɵɵelement(6, "i", 35);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(7, "div", 36);
    i0.ɵɵconditionalCreate(8, HomeDashboardComponent_Conditional_10_Conditional_8_Template, 9, 1, "div", 37);
    i0.ɵɵconditionalCreate(9, HomeDashboardComponent_Conditional_10_Conditional_9_Template, 6, 2, "div", 38);
    i0.ɵɵconditionalCreate(10, HomeDashboardComponent_Conditional_10_Conditional_10_Template, 6, 2, "div", 39);
    i0.ɵɵconditionalCreate(11, HomeDashboardComponent_Conditional_10_Conditional_11_Template, 4, 0, "div", 40);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext();
    i0.ɵɵadvance(8);
    i0.ɵɵconditional(ctx_r3.unreadNotifications.length > 0 ? 8 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r3.favorites.length > 0 || ctx_r3.favoritesLoading ? 9 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r3.recentItems.length > 0 || ctx_r3.recentsLoading ? 10 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(!ctx_r3.favoritesLoading && !ctx_r3.recentsLoading && ctx_r3.unreadNotifications.length === 0 && ctx_r3.favorites.length === 0 && ctx_r3.recentItems.length === 0 ? 11 : -1);
} }
function HomeDashboardComponent_Conditional_11_Conditional_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 61);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(ctx_r3.unreadNotifications.length);
} }
function HomeDashboardComponent_Conditional_11_Template(rf, ctx) { if (rf & 1) {
    const _r14 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 60);
    i0.ɵɵlistener("click", function HomeDashboardComponent_Conditional_11_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r14); const ctx_r3 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r3.toggleSidebar()); });
    i0.ɵɵelement(1, "i", 33);
    i0.ɵɵconditionalCreate(2, HomeDashboardComponent_Conditional_11_Conditional_2_Template, 2, 1, "span", 61);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext();
    i0.ɵɵadvance(2);
    i0.ɵɵconditional(ctx_r3.unreadNotifications.length > 0 ? 2 : -1);
} }
/**
 * Home Dashboard - Personalized home screen showing all available applications
 * with quick access navigation and configuration options.
 *
 * Uses OnPush change detection and cached computed values for optimal performance.
 * Registered as a BaseResourceComponent so it can be used as a Custom resource type
 * in nav items, allowing users to return to the Home dashboard after viewing orphan resources.
 */
let HomeDashboardComponent = class HomeDashboardComponent extends BaseResourceComponent {
    appManager;
    navigationService;
    recentAccessService;
    cdr;
    destroy$ = new Subject();
    metadata = new Metadata();
    appConfigDialog;
    // State
    isLoading = true;
    apps = [];
    appsDisplayData = []; // Pre-computed display data
    currentUser = null;
    showConfigDialog = false;
    // Favorites
    favorites = [];
    favoritesLoading = true;
    // Recents
    recentItems = [];
    recentsLoading = true;
    // Notifications
    unreadNotifications = [];
    notificationsLoading = true;
    // Sidebar state - default closed on all screen sizes
    sidebarOpen = false;
    // Cached icon lookups to avoid repeated method calls
    favoriteIconCache = new Map();
    resourceIconCache = new Map();
    // Resolved display names for favorites (keyed by favorite ID)
    favoriteDisplayNames = new Map();
    /**
     * Check if sidebar has any content to show
     */
    get hasSidebarContent() {
        return this.unreadNotifications.length > 0 ||
            this.favorites.length > 0 ||
            this.recentItems.length > 0 ||
            this.favoritesLoading ||
            this.recentsLoading;
    }
    /**
     * Toggle sidebar visibility
     */
    toggleSidebar() {
        this.sidebarOpen = !this.sidebarOpen;
    }
    /**
     * Check if current device is mobile (width <= 768px)
     */
    isMobileDevice() {
        return typeof window !== 'undefined' && window.innerWidth <= 768;
    }
    constructor(appManager, navigationService, recentAccessService, cdr) {
        super();
        this.appManager = appManager;
        this.navigationService = navigationService;
        this.recentAccessService = recentAccessService;
        this.cdr = cdr;
    }
    async GetResourceDisplayName(data) {
        return 'Home';
    }
    async GetResourceIconClass(data) {
        return '';
    }
    async ngAfterViewInit() {
        // Get current user info
        this.currentUser = {
            Name: this.metadata.CurrentUser?.Name || 'User',
            Email: this.metadata.CurrentUser?.Email || ''
        };
        // Subscribe to loading state from ApplicationManager
        this.appManager.Loading
            .pipe(takeUntil(this.destroy$))
            .subscribe(loading => {
            // Only update isLoading if manager is actively loading
            // (we start with isLoading=true and only set to false when we have apps)
            if (loading) {
                this.isLoading = true;
                this.cdr.markForCheck();
            }
        });
        // Subscribe to applications list, filtering out the Home app
        this.appManager.Applications
            .pipe(takeUntil(this.destroy$))
            .subscribe(async (apps) => {
            // Exclude the Home app from the list (users are already on Home)
            this.apps = apps.filter(app => app.Name !== 'Home');
            // Pre-compute display data for all apps
            await this.computeAppsDisplayData();
            this.isLoading = false;
            this.NotifyLoadComplete();
            this.cdr.markForCheck();
        });
        // Subscribe to unread notifications
        MJNotificationService.Notifications$
            .pipe(takeUntil(this.destroy$))
            .subscribe(notifications => {
            this.unreadNotifications = notifications.filter(n => n.Unread).slice(0, 5);
            this.notificationsLoading = false;
            this.cdr.markForCheck();
        });
        // Subscribe to recent items
        this.recentAccessService.RecentItems
            .pipe(takeUntil(this.destroy$))
            .subscribe(items => {
            this.recentItems = this.deduplicateRecents(items).slice(0, 5);
            this.recentsLoading = false;
            this.cdr.markForCheck();
        });
        // Favorites and recents load asynchronously in the sidebar
        this.NotifyLoadComplete();
        // Load favorites and recents asynchronously (don't block rendering)
        this.loadFavorites();
        this.loadRecents();
    }
    ngOnDestroy() {
        this.destroy$.next();
        this.destroy$.complete();
    }
    /**
     * Get a greeting based on time of day
     */
    get greeting() {
        const hour = new Date().getHours();
        if (hour < 12)
            return 'Good morning';
        if (hour < 17)
            return 'Good afternoon';
        return 'Good evening';
    }
    /**
     * Get formatted date string
     */
    get formattedDate() {
        return new Date().toLocaleDateString('en-US', {
            weekday: 'long',
            month: 'long',
            day: 'numeric'
        });
    }
    /**
     * Navigate to an application
     */
    async onAppClick(app) {
        // Use NavigationService to switch to the app (handles tab creation if needed)
        await this.navigationService.SwitchToApp(app.ID);
    }
    /**
     * Open app configuration dialog
     */
    openConfigDialog() {
        this.showConfigDialog = true;
        setTimeout(() => {
            if (this.appConfigDialog) {
                this.appConfigDialog.Open();
            }
        }, 0);
    }
    /**
     * Handle when config is saved
     */
    onConfigSaved() {
        this.showConfigDialog = false;
    }
    /**
     * Pre-compute display data for all apps to avoid repeated calculations during change detection
     */
    async computeAppsDisplayData() {
        this.appsDisplayData = await Promise.all(this.apps.map(async (app) => {
            const navItems = await app.GetNavItems();
            const navItemsCount = navItems.length;
            const navItemsPreview = navItems.slice(0, 3).map(item => ({
                Label: item.Label,
                Icon: item.Icon || 'fa-solid fa-circle'
            }));
            return {
                app,
                color: app.GetColor() || '#1976d2',
                icon: app.Icon || 'fa-solid fa-cube',
                navItemsCount,
                navItemsPreview,
                showMoreItems: navItemsCount > 3,
                moreItemsCount: navItemsCount - 3
            };
        }));
    }
    /**
     * Track function for apps loop
     */
    trackByApp(_index, item) {
        return item.app.ID;
    }
    /**
     * Track function for nav items preview
     */
    trackByNavItem(_index, item) {
        return item.Label;
    }
    /**
     * Load user favorites from UserInfoEngine (cached) and resolve record display names
     */
    async loadFavorites() {
        try {
            this.favoritesLoading = true;
            // Get first 10 favorites (already ordered by __mj_CreatedAt DESC in engine)
            this.favorites = UserInfoEngine.Instance.UserFavorites.slice(0, 10);
            // Batch-resolve record names for all favorites
            await this.resolveFavoriteNames();
        }
        catch (error) {
            console.error('Error loading favorites:', error);
        }
        finally {
            this.favoritesLoading = false;
            this.cdr.markForCheck();
        }
    }
    /**
     * Batch-resolve record display names for favorites using GetEntityRecordNames()
     */
    async resolveFavoriteNames() {
        const nameInputs = [];
        const favoriteIdByKey = new Map(); // map key -> favorite ID
        for (const fav of this.favorites) {
            if (!fav.Entity || !fav.RecordID)
                continue;
            const compositeKey = this.buildCompositeKeyForRecord(fav.Entity, fav.RecordID);
            if (!compositeKey)
                continue;
            nameInputs.push({ EntityName: fav.Entity, CompositeKey: compositeKey });
            favoriteIdByKey.set(`${fav.Entity}||${compositeKey.ToConcatenatedString()}`, fav.ID);
        }
        if (nameInputs.length === 0)
            return;
        try {
            const nameResults = await this.metadata.GetEntityRecordNames(nameInputs);
            for (const result of nameResults) {
                if (result.Success && result.RecordName) {
                    const key = `${result.EntityName}||${result.CompositeKey.ToConcatenatedString()}`;
                    const favId = favoriteIdByKey.get(key);
                    if (favId) {
                        this.favoriteDisplayNames.set(favId, result.RecordName);
                    }
                }
            }
        }
        catch (error) {
            console.warn('Failed to resolve favorite record names:', error);
        }
    }
    /**
     * Build a CompositeKey for a record. RecordID may be stored as either:
     * - Concatenated format: "FieldName|Value" or "Field1|Val1||Field2|Val2"
     * - Plain value: just the raw value (e.g. a GUID)
     */
    buildCompositeKeyForRecord(entityName, recordId) {
        if (!recordId)
            return null;
        // If recordId contains '|', it's in concatenated format
        if (recordId.includes('|')) {
            try {
                const compositeKey = new CompositeKey();
                compositeKey.LoadFromConcatenatedString(recordId);
                if (compositeKey.KeyValuePairs.length > 0)
                    return compositeKey;
            }
            catch {
                // Fall through to entity-based lookup
            }
        }
        // Plain value — look up entity primary key field(s) to construct the key
        const entityInfo = this.metadata.Entities.find(e => e.Name === entityName);
        if (!entityInfo)
            return null;
        const pkField = entityInfo.FirstPrimaryKey;
        if (!pkField)
            return null;
        const compositeKey = new CompositeKey();
        compositeKey.KeyValuePairs = [{ FieldName: pkField.Name, Value: recordId }];
        return compositeKey;
    }
    /**
     * Get the display name for a favorite (resolved name or entity name fallback)
     */
    getFavoriteDisplayName(favorite) {
        return this.favoriteDisplayNames.get(favorite.ID) || favorite.Entity || favorite.RecordID;
    }
    /**
     * Load recent items via the RecentAccessService
     */
    async loadRecents() {
        try {
            this.recentsLoading = true;
            this.cdr.markForCheck();
            await this.recentAccessService.loadRecentItems(10);
        }
        catch (error) {
            console.error('Error loading recents:', error);
        }
        finally {
            this.recentsLoading = false;
            this.cdr.markForCheck();
        }
    }
    /**
     * Navigate to a favorite item using NavigationService
     */
    onFavoriteClick(favorite) {
        // Navigate based on entity type using NavigationService
        const entityName = favorite.Entity?.toLowerCase();
        const recordId = favorite.RecordID;
        if (entityName === 'dashboards') {
            this.navigationService.OpenDashboard(recordId, 'Dashboard');
        }
        else if (entityName === 'user views') {
            this.navigationService.OpenView(recordId, 'View');
        }
        else if (entityName === 'reports') {
            this.navigationService.OpenReport(recordId, 'Report');
        }
        else if (entityName?.includes('artifact')) {
            this.navigationService.OpenArtifact(recordId, 'Artifact');
        }
        else {
            // Default: navigate to record
            const compositeKey = this.buildCompositeKeyForRecord(favorite.Entity, recordId);
            if (compositeKey) {
                this.navigationService.OpenEntityRecord(favorite.Entity, compositeKey);
            }
        }
    }
    /**
     * Navigate to a recent item using NavigationService
     */
    onRecentClick(item) {
        // Use recordName if available, otherwise fall back to generic titles
        const name = item.recordName;
        switch (item.resourceType) {
            case 'view':
                this.navigationService.OpenView(item.recordId, name || 'View');
                break;
            case 'dashboard':
                this.navigationService.OpenDashboard(item.recordId, name || 'Dashboard');
                break;
            case 'artifact':
                this.navigationService.OpenArtifact(item.recordId, name || 'Artifact');
                break;
            case 'report':
                this.navigationService.OpenReport(item.recordId, name || 'Report');
                break;
            default: {
                // Regular record
                const compositeKey = this.buildCompositeKeyForRecord(item.entityName, item.recordId);
                if (compositeKey) {
                    this.navigationService.OpenEntityRecord(item.entityName, compositeKey);
                }
            }
        }
    }
    /**
     * Navigate to a notification using NavigationService
     */
    onNotificationClick(notification) {
        // Navigate to the notifications view using NavigationService
        this.navigationService.OpenDynamicView('MJ: User Notifications');
    }
    /**
     * Get icon for an entity by name, using entity metadata Icon field (cached)
     */
    getEntityIconByName(entityName) {
        if (!entityName)
            return 'fa-solid fa-file';
        const cached = this.resourceIconCache.get(entityName);
        if (cached)
            return cached;
        const entityInfo = this.metadata.Entities.find(e => e.Name === entityName);
        const icon = entityInfo ? this.resolveEntityIcon(entityInfo.Icon) : 'fa-solid fa-file';
        this.resourceIconCache.set(entityName, icon);
        return icon;
    }
    /**
     * Resolve an entity's Icon field to a full Font Awesome class string
     */
    resolveEntityIcon(icon) {
        if (!icon)
            return 'fa-solid fa-table';
        // Already has a style prefix
        if (icon.startsWith('fa-solid') || icon.startsWith('fa-regular') ||
            icon.startsWith('fa-light') || icon.startsWith('fa-brands') ||
            icon.startsWith('fa ')) {
            return icon;
        }
        // Has fa- prefix but no style
        if (icon.startsWith('fa-')) {
            return `fa-solid ${icon}`;
        }
        // Just an icon name like "table" or "users"
        return `fa-solid fa-${icon}`;
    }
    /**
     * Format a date for display (pure function, safe to call in template)
     */
    formatDate(date) {
        if (!date)
            return '';
        const now = new Date();
        const diff = now.getTime() - new Date(date).getTime();
        const days = Math.floor(diff / (1000 * 60 * 60 * 24));
        if (days === 0)
            return 'Today';
        if (days === 1)
            return 'Yesterday';
        if (days < 7)
            return `${days} days ago`;
        return new Date(date).toLocaleDateString();
    }
    /**
     * Track function for favorites
     */
    trackByFavorite(_index, item) {
        return item.ID;
    }
    /**
     * Remove duplicate recent items (same entity + recordId). Keeps the first occurrence.
     */
    deduplicateRecents(items) {
        const seen = new Set();
        return items.filter(item => {
            const key = `${item.entityName}-${item.recordId}`;
            if (seen.has(key)) {
                return false;
            }
            seen.add(key);
            return true;
        });
    }
    /**
     * Track function for recent items
     */
    trackByRecent(_index, item) {
        return `${item.entityName}-${item.recordId}`;
    }
    /**
     * Track function for notifications
     */
    trackByNotification(_index, item) {
        return item.ID;
    }
    static ɵfac = function HomeDashboardComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HomeDashboardComponent)(i0.ɵɵdirectiveInject(i1.ApplicationManager), i0.ɵɵdirectiveInject(i2.NavigationService), i0.ɵɵdirectiveInject(i2.RecentAccessService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
    static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HomeDashboardComponent, selectors: [["mj-home-dashboard"]], viewQuery: function HomeDashboardComponent_Query(rf, ctx) { if (rf & 1) {
            i0.ɵɵviewQuery(_c0, 5);
        } if (rf & 2) {
            let _t;
            i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.appConfigDialog = _t.first);
        } }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 14, vars: 10, consts: [["appConfigDialog", ""], [1, "home-dashboard"], [1, "main-content"], [1, "home-header"], [1, "greeting-section"], [1, "date"], [1, "loading-container"], [1, "apps-section"], [1, "quick-access-sidebar"], ["title", "Quick Access", 1, "sidebar-fab-toggle"], [3, "ShowDialogChange", "ConfigSaved", "ShowDialog"], ["text", "Loading your applications...", "size", "large"], [1, "section-title"], [1, "fa-solid", "fa-grid-2"], [1, "apps-grid"], [1, "app-card", 3, "--app-color"], [1, "empty-state"], [1, "app-card", 3, "click"], [1, "app-icon-wrapper"], [1, "app-icon"], [1, "app-info"], [1, "app-name"], [1, "app-description"], [1, "nav-preview"], [1, "app-arrow"], [1, "fa-solid", "fa-arrow-right"], [1, "nav-item-chip"], [1, "more-items"], [1, "empty-icon"], [1, "fa-solid", "fa-folder-open"], ["kendoButton", "", "themeColor", "primary", 3, "click"], [1, "fa-solid", "fa-gear"], [1, "sidebar-header"], [1, "fa-solid", "fa-bolt"], ["title", "Close panel", 1, "sidebar-close-btn", 3, "click"], [1, "fa-solid", "fa-xmark"], [1, "sidebar-content"], [1, "sidebar-section", "notifications-section"], [1, "sidebar-section", "favorites-section"], [1, "sidebar-section", "recents-section"], [1, "sidebar-empty"], [1, "sidebar-section-title"], [1, "fa-solid", "fa-bell"], [1, "section-badge"], [1, "sidebar-items"], [1, "sidebar-item", "notification-item"], [1, "sidebar-item", "notification-item", 3, "click"], [1, "sidebar-item-info"], [1, "sidebar-item-title"], [1, "sidebar-item-subtitle"], [1, "fa-solid", "fa-star"], [1, "sidebar-loading"], [1, "sidebar-item", "favorite-item"], [1, "sidebar-item", "favorite-item", 3, "click"], [1, "sidebar-item-icon"], [1, "fa-solid", "fa-spinner", "fa-spin"], [1, "fa-solid", "fa-clock-rotate-left"], [1, "sidebar-item", "recent-item"], [1, "sidebar-item", "recent-item", 3, "click"], [1, "fa-solid", "fa-inbox"], ["title", "Quick Access", 1, "sidebar-fab-toggle", 3, "click"], [1, "fab-badge"]], template: function HomeDashboardComponent_Template(rf, ctx) { if (rf & 1) {
            const _r1 = i0.ɵɵgetCurrentView();
            i0.ɵɵelementStart(0, "div", 1)(1, "div", 2)(2, "div", 3)(3, "div", 4)(4, "h1");
            i0.ɵɵtext(5);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(6, "p", 5);
            i0.ɵɵtext(7);
            i0.ɵɵelementEnd()()();
            i0.ɵɵconditionalCreate(8, HomeDashboardComponent_Conditional_8_Template, 2, 0, "div", 6);
            i0.ɵɵconditionalCreate(9, HomeDashboardComponent_Conditional_9_Template, 8, 1, "div", 7);
            i0.ɵɵelementEnd();
            i0.ɵɵconditionalCreate(10, HomeDashboardComponent_Conditional_10_Template, 12, 4, "div", 8);
            i0.ɵɵconditionalCreate(11, HomeDashboardComponent_Conditional_11_Template, 3, 1, "button", 9);
            i0.ɵɵelementStart(12, "mj-user-app-config", 10, 0);
            i0.ɵɵtwoWayListener("ShowDialogChange", function HomeDashboardComponent_Template_mj_user_app_config_ShowDialogChange_12_listener($event) { i0.ɵɵrestoreView(_r1); i0.ɵɵtwoWayBindingSet(ctx.showConfigDialog, $event) || (ctx.showConfigDialog = $event); return i0.ɵɵresetView($event); });
            i0.ɵɵlistener("ConfigSaved", function HomeDashboardComponent_Template_mj_user_app_config_ConfigSaved_12_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onConfigSaved()); });
            i0.ɵɵelementEnd()();
        } if (rf & 2) {
            i0.ɵɵclassProp("sidebar-open", ctx.sidebarOpen && ctx.hasSidebarContent);
            i0.ɵɵadvance(5);
            i0.ɵɵtextInterpolate2("", ctx.greeting, ", ", ctx.currentUser == null ? null : ctx.currentUser.Name);
            i0.ɵɵadvance(2);
            i0.ɵɵtextInterpolate(ctx.formattedDate);
            i0.ɵɵadvance();
            i0.ɵɵconditional(ctx.isLoading ? 8 : -1);
            i0.ɵɵadvance();
            i0.ɵɵconditional(!ctx.isLoading ? 9 : -1);
            i0.ɵɵadvance();
            i0.ɵɵconditional(ctx.hasSidebarContent ? 10 : -1);
            i0.ɵɵadvance();
            i0.ɵɵconditional(ctx.hasSidebarContent && !ctx.sidebarOpen ? 11 : -1);
            i0.ɵɵadvance();
            i0.ɵɵtwoWayProperty("ShowDialog", ctx.showConfigDialog);
        } }, dependencies: [i3.ButtonComponent, i4.LoadingComponent, i5.UserAppConfigComponent, i6.SlicePipe], styles: [".home-dashboard[_ngcontent-%COMP%] {\n  display: flex;\n  height: 100%;\n  background: var(--mj-bg-page);\n  overflow: hidden;\n  position: relative;\n}\n\n\n\n.main-content[_ngcontent-%COMP%] {\n  flex: 1;\n  display: flex;\n  flex-direction: column;\n  padding: 32px;\n  overflow-y: auto;\n  transition: margin-right var(--mj-transition-slow);\n}\n\n\n\n.home-dashboard.sidebar-open[_ngcontent-%COMP%]   .main-content[_ngcontent-%COMP%] {\n  margin-right: 320px;\n}\n\n\n\n.home-header[_ngcontent-%COMP%] {\n  display: flex;\n  justify-content: space-between;\n  align-items: flex-start;\n  margin-bottom: 32px;\n}\n\n.greeting-section[_ngcontent-%COMP%]   h1[_ngcontent-%COMP%] {\n  margin: 0 0 8px 0;\n  font-size: var(--mj-text-4xl);\n  font-weight: var(--mj-font-semibold);\n  color: var(--mj-text-primary);\n}\n\n.greeting-section[_ngcontent-%COMP%]   .date[_ngcontent-%COMP%] {\n  margin: 0;\n  font-size: var(--mj-text-base);\n  color: var(--mj-text-muted);\n}\n\n\n\n.sidebar-fab-toggle[_ngcontent-%COMP%] {\n  position: fixed;\n  top: 80px; \n\n  right: 24px;\n  width: 56px;\n  height: 56px;\n  border: none;\n  border-radius: var(--mj-radius-full);\n  background: var(--mj-brand-primary);\n  color: var(--mj-text-inverse);\n  font-size: var(--mj-text-xl);\n  cursor: pointer;\n  box-shadow: var(--mj-shadow-brand-md);\n  transition: all var(--mj-transition-base);\n  z-index: 100;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n}\n\n.sidebar-fab-toggle[_ngcontent-%COMP%]:hover {\n  background: var(--mj-brand-primary-hover);\n  transform: scale(1.05);\n  box-shadow: 0 6px 16px color-mix(in srgb, var(--mj-brand-primary) 50%, transparent);\n}\n\n.fab-badge[_ngcontent-%COMP%] {\n  position: absolute;\n  top: -4px;\n  right: -4px;\n  min-width: 20px;\n  height: 20px;\n  padding: 0 6px;\n  background: var(--mj-status-error);\n  color: var(--mj-text-inverse);\n  font-size: var(--mj-text-xs);\n  font-weight: var(--mj-font-semibold);\n  border-radius: var(--mj-radius-full);\n  display: flex;\n  align-items: center;\n  justify-content: center;\n}\n\n\n\n.loading-container[_ngcontent-%COMP%] {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  flex: 1;\n  gap: 16px;\n  color: var(--mj-text-muted);\n}\n\n.loading-spinner[_ngcontent-%COMP%] {\n  font-size: var(--mj-text-4xl);\n  color: var(--mj-brand-primary);\n}\n\n\n\n.apps-section[_ngcontent-%COMP%] {\n  flex: 0 0 auto;\n}\n\n.section-title[_ngcontent-%COMP%] {\n  display: flex;\n  align-items: center;\n  gap: 12px;\n  margin: 0 0 24px 0;\n  font-size: var(--mj-text-xl);\n  font-weight: var(--mj-font-semibold);\n  color: var(--mj-text-secondary);\n}\n\n.section-title[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n  color: var(--mj-text-muted);\n}\n\n\n\n.apps-grid[_ngcontent-%COMP%] {\n  display: grid;\n  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));\n  gap: 20px;\n}\n\n\n\n.app-card[_ngcontent-%COMP%] {\n  --app-color: var(--mj-text-muted);\n  display: flex;\n  align-items: flex-start;\n  gap: 16px;\n  padding: 20px;\n  background: var(--mj-bg-surface-card);\n  border-radius: var(--mj-radius-lg);\n  border: 1px solid var(--mj-border-default);\n  box-shadow: var(--mj-shadow-sm);\n  cursor: pointer;\n  transition: all 0.25s ease;\n  position: relative;\n  overflow: hidden;\n}\n\n.app-card[_ngcontent-%COMP%]::before {\n  content: '';\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 4px;\n  height: 100%;\n  background: var(--app-color);\n  opacity: 0;\n  transition: opacity 0.25s ease;\n}\n\n.app-card[_ngcontent-%COMP%]:hover {\n  border-color: var(--app-color);\n  box-shadow: var(--mj-shadow-lg);\n  transform: translateY(-3px);\n}\n\n.app-card[_ngcontent-%COMP%]:hover::before {\n  opacity: 1;\n}\n\n\n\n.app-icon-wrapper[_ngcontent-%COMP%] {\n  flex-shrink: 0;\n}\n\n.app-icon[_ngcontent-%COMP%] {\n  width: 52px;\n  height: 52px;\n  border-radius: var(--mj-radius-lg);\n  background: color-mix(in srgb, var(--app-color) 12%, transparent);\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  transition: all 0.25s ease;\n}\n\n.app-icon[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n  font-size: var(--mj-text-xl);\n  color: var(--app-color);\n  transition: transform 0.25s ease;\n}\n\n.app-card[_ngcontent-%COMP%]:hover   .app-icon[_ngcontent-%COMP%] {\n  background: var(--app-color);\n}\n\n.app-card[_ngcontent-%COMP%]:hover   .app-icon[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n  color: var(--mj-text-inverse);\n  transform: scale(1.1);\n}\n\n\n\n.app-info[_ngcontent-%COMP%] {\n  flex: 1;\n  min-width: 0;\n}\n\n.app-name[_ngcontent-%COMP%] {\n  margin: 0 0 4px 0;\n  font-size: var(--mj-text-base);\n  font-weight: var(--mj-font-semibold);\n  color: var(--mj-text-primary);\n}\n\n.app-description[_ngcontent-%COMP%] {\n  margin: 0 0 10px 0;\n  font-size: var(--mj-text-sm);\n  color: var(--mj-text-muted);\n  line-height: var(--mj-leading-snug);\n  display: -webkit-box;\n  -webkit-line-clamp: 2;\n  -webkit-box-orient: vertical;\n  overflow: hidden;\n}\n\n\n\n.nav-preview[_ngcontent-%COMP%] {\n  display: flex;\n  flex-wrap: wrap;\n  gap: 6px;\n  align-items: center;\n}\n\n.nav-item-chip[_ngcontent-%COMP%] {\n  display: flex;\n  align-items: center;\n  gap: 5px;\n  padding: 3px 8px;\n  background: var(--mj-bg-surface-card);\n  border-radius: var(--mj-radius-sm);\n  font-size: var(--mj-text-xs);\n  color: var(--mj-text-secondary);\n}\n\n.nav-item-chip[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n  font-size: 9px;\n  color: var(--mj-text-muted);\n}\n\n.more-items[_ngcontent-%COMP%] {\n  font-size: var(--mj-text-xs);\n  color: var(--mj-text-muted);\n  font-style: italic;\n}\n\n\n\n.app-arrow[_ngcontent-%COMP%] {\n  position: absolute;\n  right: 14px;\n  top: 50%;\n  transform: translateY(-50%) translateX(10px);\n  opacity: 0;\n  transition: all 0.25s ease;\n  color: var(--app-color);\n  font-size: var(--mj-text-base);\n}\n\n.app-card[_ngcontent-%COMP%]:hover   .app-arrow[_ngcontent-%COMP%] {\n  opacity: 1;\n  transform: translateY(-50%) translateX(0);\n}\n\n\n\n.empty-state[_ngcontent-%COMP%] {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  padding: 64px 24px;\n  background: var(--mj-bg-surface);\n  border-radius: var(--mj-radius-xl);\n  border: 2px dashed var(--mj-border-default);\n  text-align: center;\n}\n\n.empty-icon[_ngcontent-%COMP%] {\n  width: 80px;\n  height: 80px;\n  border-radius: var(--mj-radius-full);\n  background: var(--mj-bg-surface-card);\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  margin-bottom: 24px;\n}\n\n.empty-icon[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n  font-size: var(--mj-text-4xl);\n  color: var(--mj-text-disabled);\n}\n\n.empty-state[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%] {\n  margin: 0 0 8px 0;\n  font-size: var(--mj-text-xl);\n  font-weight: var(--mj-font-semibold);\n  color: var(--mj-text-secondary);\n}\n\n.empty-state[_ngcontent-%COMP%]   p[_ngcontent-%COMP%] {\n  margin: 0 0 20px 0;\n  font-size: var(--mj-text-sm);\n  color: var(--mj-text-muted);\n  max-width: 400px;\n}\n\n.empty-state[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n  margin-right: 8px;\n}\n\n\n\n\n\n.quick-access-sidebar[_ngcontent-%COMP%] {\n  position: fixed;\n  top: 60px; \n\n  right: 0;\n  bottom: 0;\n  width: 320px;\n  background: var(--mj-bg-surface);\n  border-left: 1px solid var(--mj-border-default);\n  display: flex;\n  flex-direction: column;\n  transform: translateX(100%);\n  transition: transform var(--mj-transition-slow);\n  overflow: hidden;\n  z-index: 100;\n  box-shadow: -2px 0 8px color-mix(in srgb, var(--mj-text-primary) 8%, transparent);\n}\n\n.home-dashboard.sidebar-open[_ngcontent-%COMP%]   .quick-access-sidebar[_ngcontent-%COMP%] {\n  transform: translateX(0);\n}\n\n.sidebar-header[_ngcontent-%COMP%] {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  padding: 20px;\n  border-bottom: 1px solid var(--mj-border-default);\n  background: var(--mj-bg-surface-card);\n}\n\n.sidebar-header[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%] {\n  margin: 0;\n  font-size: var(--mj-text-base);\n  font-weight: var(--mj-font-semibold);\n  color: var(--mj-text-primary);\n  display: flex;\n  align-items: center;\n  gap: 10px;\n}\n\n.sidebar-header[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n  color: var(--mj-brand-primary);\n  font-size: var(--mj-text-sm);\n}\n\n.sidebar-close-btn[_ngcontent-%COMP%] {\n  width: 32px;\n  height: 32px;\n  border: none;\n  border-radius: var(--mj-radius-md);\n  background: transparent;\n  color: var(--mj-text-muted);\n  cursor: pointer;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  transition: all var(--mj-transition-base);\n}\n\n.sidebar-close-btn[_ngcontent-%COMP%]:hover {\n  background: var(--mj-bg-surface-hover);\n  color: var(--mj-text-primary);\n}\n\n.sidebar-content[_ngcontent-%COMP%] {\n  flex: 1;\n  overflow-y: auto;\n  padding: 16px;\n}\n\n\n\n.sidebar-section[_ngcontent-%COMP%] {\n  margin-bottom: 20px;\n}\n\n.sidebar-section[_ngcontent-%COMP%]:last-child {\n  margin-bottom: 0;\n}\n\n.sidebar-section-title[_ngcontent-%COMP%] {\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  margin: 0 0 12px 0;\n  font-size: var(--mj-text-sm);\n  font-weight: var(--mj-font-semibold);\n  color: var(--mj-text-muted);\n  text-transform: uppercase;\n  letter-spacing: 0.5px;\n}\n\n.sidebar-section-title[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n  font-size: var(--mj-text-xs);\n}\n\n.notifications-section[_ngcontent-%COMP%]   .sidebar-section-title[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n  color: var(--mj-color-warning-600);\n}\n\n.favorites-section[_ngcontent-%COMP%]   .sidebar-section-title[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n  color: var(--mj-status-warning);\n}\n\n.recents-section[_ngcontent-%COMP%]   .sidebar-section-title[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n  color: var(--mj-brand-primary);\n}\n\n.section-badge[_ngcontent-%COMP%] {\n  background: var(--mj-status-error);\n  color: var(--mj-text-inverse);\n  font-size: 10px;\n  font-weight: var(--mj-font-semibold);\n  padding: 2px 6px;\n  border-radius: var(--mj-radius-md);\n  margin-left: auto;\n}\n\n\n\n.sidebar-items[_ngcontent-%COMP%] {\n  display: flex;\n  flex-direction: column;\n  gap: 8px;\n}\n\n.sidebar-item[_ngcontent-%COMP%] {\n  display: flex;\n  align-items: center;\n  gap: 12px;\n  padding: 10px 12px;\n  background: var(--mj-bg-surface-card);\n  border-radius: var(--mj-radius-lg);\n  cursor: pointer;\n  transition: all var(--mj-transition-base);\n}\n\n.sidebar-item[_ngcontent-%COMP%]:hover {\n  background: var(--mj-bg-surface-hover);\n  transform: translateX(4px);\n}\n\n.sidebar-item-icon[_ngcontent-%COMP%] {\n  width: 36px;\n  height: 36px;\n  border-radius: var(--mj-radius-md);\n  background: var(--mj-bg-surface);\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  flex-shrink: 0;\n}\n\n.sidebar-item-icon[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n  font-size: var(--mj-text-sm);\n  color: var(--mj-text-muted);\n}\n\n.notification-item[_ngcontent-%COMP%]   .sidebar-item-icon[_ngcontent-%COMP%] {\n  background: var(--mj-color-warning-50);\n}\n\n.notification-item[_ngcontent-%COMP%]   .sidebar-item-icon[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n  color: var(--mj-color-warning-600);\n}\n\n.favorite-item[_ngcontent-%COMP%]   .sidebar-item-icon[_ngcontent-%COMP%] {\n  background: var(--mj-color-warning-50);\n}\n\n.favorite-item[_ngcontent-%COMP%]   .sidebar-item-icon[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n  color: var(--mj-color-warning-500);\n}\n\n.recent-item[_ngcontent-%COMP%]   .sidebar-item-icon[_ngcontent-%COMP%] {\n  background: var(--mj-color-info-50);\n}\n\n.recent-item[_ngcontent-%COMP%]   .sidebar-item-icon[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n  color: var(--mj-brand-primary);\n}\n\n.sidebar-item-info[_ngcontent-%COMP%] {\n  display: flex;\n  flex-direction: column;\n  gap: 2px;\n  min-width: 0;\n  flex: 1;\n}\n\n.sidebar-item-title[_ngcontent-%COMP%] {\n  font-size: var(--mj-text-sm);\n  font-weight: var(--mj-font-medium);\n  color: var(--mj-text-primary);\n  white-space: nowrap;\n  overflow: hidden;\n  text-overflow: ellipsis;\n}\n\n.sidebar-item-subtitle[_ngcontent-%COMP%] {\n  font-size: var(--mj-text-xs);\n  color: var(--mj-text-muted);\n  white-space: nowrap;\n  overflow: hidden;\n  text-overflow: ellipsis;\n}\n\n.sidebar-loading[_ngcontent-%COMP%] {\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  color: var(--mj-text-muted);\n  font-size: var(--mj-text-sm);\n  padding: 8px 0;\n}\n\n.sidebar-loading[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n  color: var(--mj-brand-primary);\n}\n\n.sidebar-empty[_ngcontent-%COMP%] {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  padding: 40px 20px;\n  text-align: center;\n  color: var(--mj-text-disabled);\n}\n\n.sidebar-empty[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n  font-size: var(--mj-text-4xl);\n  margin-bottom: 12px;\n}\n\n.sidebar-empty[_ngcontent-%COMP%]   p[_ngcontent-%COMP%] {\n  margin: 0;\n  font-size: var(--mj-text-sm);\n}\n\n\n\n\n\n\n\n\n\n@media (max-width: 1200px) {\n  .quick-access-sidebar[_ngcontent-%COMP%] {\n    width: 280px;\n  }\n\n  .home-dashboard.sidebar-open[_ngcontent-%COMP%]   .main-content[_ngcontent-%COMP%] {\n    margin-right: 280px;\n  }\n\n  .apps-grid[_ngcontent-%COMP%] {\n    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));\n  }\n}\n\n\n\n@media (max-width: 992px) {\n  .main-content[_ngcontent-%COMP%] {\n    padding: 24px;\n  }\n\n  .greeting-section[_ngcontent-%COMP%]   h1[_ngcontent-%COMP%] {\n    font-size: var(--mj-text-3xl);\n  }\n\n  \n\n  .quick-access-sidebar[_ngcontent-%COMP%] {\n    position: fixed;\n    top: 60px; \n\n    right: 0;\n    bottom: 0;\n    width: 320px;\n    z-index: 1000;\n    box-shadow: -4px 0 20px color-mix(in srgb, var(--mj-text-primary) 15%, transparent);\n  }\n\n  .home-dashboard.sidebar-open[_ngcontent-%COMP%]   .main-content[_ngcontent-%COMP%] {\n    margin-right: 0;\n  }\n\n  \n\n  .home-dashboard.sidebar-open[_ngcontent-%COMP%]::after {\n    content: '';\n    position: fixed;\n    top: 60px;\n    left: 0;\n    right: 320px;\n    bottom: 0;\n    background: var(--mj-bg-overlay);\n    z-index: 999;\n  }\n}\n\n\n\n@media (max-width: 768px) {\n  .home-dashboard[_ngcontent-%COMP%] {\n    height: auto;\n    min-height: 100%;\n    overflow: visible;\n  }\n\n  .main-content[_ngcontent-%COMP%] {\n    padding: 20px;\n    padding-bottom: 100px; \n\n    overflow: visible;\n  }\n\n  .home-header[_ngcontent-%COMP%] {\n    flex-direction: column;\n    gap: 16px;\n    margin-bottom: 24px;\n  }\n\n  .greeting-section[_ngcontent-%COMP%]   h1[_ngcontent-%COMP%] {\n    font-size: var(--mj-text-2xl);\n  }\n\n  \n\n  .quick-access-sidebar[_ngcontent-%COMP%] {\n    position: fixed;\n    top: 60px; \n\n    right: 0;\n    bottom: 0;\n    width: 100%;\n    max-width: 100%;\n    z-index: 100; \n\n    border-left: none;\n    border-top: 1px solid var(--mj-border-default);\n  }\n\n  \n\n  .home-dashboard.sidebar-open[_ngcontent-%COMP%]::before {\n    content: '';\n    position: fixed;\n    top: 60px;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    background: var(--mj-bg-overlay);\n    z-index: 99;\n  }\n\n  \n\n  .home-dashboard.sidebar-open[_ngcontent-%COMP%]::after {\n    display: none;\n  }\n\n  .apps-grid[_ngcontent-%COMP%] {\n    grid-template-columns: 1fr;\n    gap: 16px;\n  }\n\n  .app-card[_ngcontent-%COMP%] {\n    padding: 16px;\n  }\n\n  .app-icon[_ngcontent-%COMP%] {\n    width: 44px;\n    height: 44px;\n  }\n\n  .app-icon[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n    font-size: var(--mj-text-lg);\n  }\n\n  .app-name[_ngcontent-%COMP%] {\n    font-size: var(--mj-text-sm);\n  }\n\n  .nav-preview[_ngcontent-%COMP%] {\n    display: none;\n  }\n\n  \n\n  .sidebar-fab-toggle[_ngcontent-%COMP%] {\n    top: auto;\n    bottom: 20px;\n    right: 20px;\n    width: 48px;\n    height: 48px;\n    font-size: var(--mj-text-lg);\n  }\n}\n\n@media (max-width: 480px) {\n  .main-content[_ngcontent-%COMP%] {\n    padding: 16px;\n    padding-bottom: 80px;\n  }\n\n  .greeting-section[_ngcontent-%COMP%]   h1[_ngcontent-%COMP%] {\n    font-size: var(--mj-text-xl);\n  }\n\n  .greeting-section[_ngcontent-%COMP%]   .date[_ngcontent-%COMP%] {\n    font-size: var(--mj-text-sm);\n  }\n\n  .section-title[_ngcontent-%COMP%] {\n    font-size: var(--mj-text-base);\n    margin-bottom: 16px;\n  }\n\n  .sidebar-fab-toggle[_ngcontent-%COMP%] {\n    bottom: 16px;\n    right: 16px;\n    width: 44px;\n    height: 44px;\n    font-size: var(--mj-text-base);\n  }\n}"], changeDetection: 0 });
};
HomeDashboardComponent = __decorate([
    RegisterClass(BaseResourceComponent, 'HomeDashboard')
], HomeDashboardComponent);
export { HomeDashboardComponent };
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HomeDashboardComponent, [{
        type: Component,
        args: [{ standalone: false, selector: 'mj-home-dashboard', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"home-dashboard\" [class.sidebar-open]=\"sidebarOpen && hasSidebarContent\">\n  <!-- Main Content Area -->\n  <div class=\"main-content\">\n    <!-- Header Section -->\n    <div class=\"home-header\">\n      <div class=\"greeting-section\">\n        <h1>{{ greeting }}, {{ currentUser?.Name }}</h1>\n        <p class=\"date\">{{ formattedDate }}</p>\n      </div>\n    </div>\n\n    <!-- Loading State -->\n    @if (isLoading) {\n      <div class=\"loading-container\">\n        <mj-loading text=\"Loading your applications...\" size=\"large\"></mj-loading>\n      </div>\n    }\n\n    <!-- Apps Grid -->\n    @if (!isLoading) {\n      <div class=\"apps-section\">\n        <h2 class=\"section-title\">\n          <i class=\"fa-solid fa-grid-2\"></i>\n          Your Applications\n        </h2>\n        <div class=\"apps-grid\">\n          @for (appData of appsDisplayData; track trackByApp($index, appData)) {\n            <div\n              class=\"app-card\"\n              [style.--app-color]=\"appData.color\"\n              (click)=\"onAppClick(appData.app)\">\n              <!-- App Icon -->\n              <div class=\"app-icon-wrapper\">\n                <div class=\"app-icon\">\n                  <i [class]=\"appData.icon\"></i>\n                </div>\n              </div>\n              <!-- App Info -->\n              <div class=\"app-info\">\n                <h3 class=\"app-name\">{{ appData.app.Name }}</h3>\n                @if (appData.app.Description) {\n                  <p class=\"app-description\">{{ appData.app.Description }}</p>\n                }\n                <!-- Nav Items Preview -->\n                @if (appData.navItemsCount > 0) {\n                  <div class=\"nav-preview\">\n                    @for (item of appData.navItemsPreview; track trackByNavItem($index, item)) {\n                      <div class=\"nav-item-chip\">\n                        <i [class]=\"item.Icon\"></i>\n                        <span>{{ item.Label }}</span>\n                      </div>\n                    }\n                    @if (appData.showMoreItems) {\n                      <span class=\"more-items\">\n                        +{{ appData.moreItemsCount }} more\n                      </span>\n                    }\n                  </div>\n                }\n              </div>\n              <!-- Hover Arrow -->\n              <div class=\"app-arrow\">\n                <i class=\"fa-solid fa-arrow-right\"></i>\n              </div>\n            </div>\n          }\n        </div>\n        <!-- Empty State -->\n        @if (apps.length === 0) {\n          <div class=\"empty-state\">\n            <div class=\"empty-icon\">\n              <i class=\"fa-solid fa-folder-open\"></i>\n            </div>\n            <h3>No Applications Available</h3>\n            <p>You don't have any applications configured yet.</p>\n            <button kendoButton\n              themeColor=\"primary\"\n              (click)=\"openConfigDialog()\">\n              <i class=\"fa-solid fa-gear\"></i>\n              Configure Applications\n            </button>\n          </div>\n        }\n      </div>\n    }\n  </div>\n\n  <!-- Collapsible Right Sidebar -->\n  @if (hasSidebarContent) {\n    <div class=\"quick-access-sidebar\">\n      <div class=\"sidebar-header\">\n        <h3>\n          <i class=\"fa-solid fa-bolt\"></i>\n          Quick Access\n        </h3>\n        <button class=\"sidebar-close-btn\" (click)=\"toggleSidebar()\" title=\"Close panel\">\n          <i class=\"fa-solid fa-xmark\"></i>\n        </button>\n      </div>\n      <div class=\"sidebar-content\">\n        <!-- Unread Notifications Section -->\n        @if (unreadNotifications.length > 0) {\n          <div class=\"sidebar-section notifications-section\">\n            <h4 class=\"sidebar-section-title\">\n              <i class=\"fa-solid fa-bell\"></i>\n              Notifications\n              <span class=\"section-badge\">{{ unreadNotifications.length }}</span>\n            </h4>\n            <div class=\"sidebar-items\">\n              @for (notification of unreadNotifications; track trackByNotification($index, notification)) {\n                <div\n                  class=\"sidebar-item notification-item\"\n                  (click)=\"onNotificationClick(notification)\">\n                  <div class=\"sidebar-item-info\">\n                    <span class=\"sidebar-item-title\">{{ notification.Title }}</span>\n                    <span class=\"sidebar-item-subtitle\">{{ notification.Message | slice:0:40 }}{{ (notification.Message?.length || 0) > 40 ? '...' : '' }}</span>\n                  </div>\n                </div>\n              }\n            </div>\n          </div>\n        }\n        <!-- Favorites Section -->\n        @if (favorites.length > 0 || favoritesLoading) {\n          <div class=\"sidebar-section favorites-section\">\n            <h4 class=\"sidebar-section-title\">\n              <i class=\"fa-solid fa-star\"></i>\n              Favorites\n            </h4>\n            @if (!favoritesLoading) {\n              <div class=\"sidebar-items\">\n                @for (favorite of favorites; track trackByFavorite($index, favorite)) {\n                  <div\n                    class=\"sidebar-item favorite-item\"\n                    (click)=\"onFavoriteClick(favorite)\">\n                    <div class=\"sidebar-item-icon\">\n                      <i [class]=\"getEntityIconByName(favorite.Entity)\"></i>\n                    </div>\n                    <div class=\"sidebar-item-info\">\n                      <span class=\"sidebar-item-title\">{{ getFavoriteDisplayName(favorite) }}</span>\n                      <span class=\"sidebar-item-subtitle\">{{ favorite.Entity }}</span>\n                    </div>\n                  </div>\n                }\n              </div>\n            }\n            @if (favoritesLoading) {\n              <div class=\"sidebar-loading\">\n                <i class=\"fa-solid fa-spinner fa-spin\"></i>\n                <span>Loading...</span>\n              </div>\n            }\n          </div>\n        }\n        <!-- Recents Section -->\n        @if (recentItems.length > 0 || recentsLoading) {\n          <div class=\"sidebar-section recents-section\">\n            <h4 class=\"sidebar-section-title\">\n              <i class=\"fa-solid fa-clock-rotate-left\"></i>\n              Recent\n            </h4>\n            @if (!recentsLoading) {\n              <div class=\"sidebar-items\">\n                @for (item of recentItems; track trackByRecent($index, item)) {\n                  <div\n                    class=\"sidebar-item recent-item\"\n                    (click)=\"onRecentClick(item)\">\n                    <div class=\"sidebar-item-icon\">\n                      <i [class]=\"getEntityIconByName(item.entityName)\"></i>\n                    </div>\n                    <div class=\"sidebar-item-info\">\n                      <span class=\"sidebar-item-title\">{{ item.recordName || item.recordId }}</span>\n                      <span class=\"sidebar-item-subtitle\">{{ item.entityName }} \u00B7 {{ formatDate(item.latestAt) }}</span>\n                    </div>\n                  </div>\n                }\n              </div>\n            }\n            @if (recentsLoading) {\n              <div class=\"sidebar-loading\">\n                <i class=\"fa-solid fa-spinner fa-spin\"></i>\n                <span>Loading...</span>\n              </div>\n            }\n          </div>\n        }\n        <!-- Empty sidebar state -->\n        @if (!favoritesLoading && !recentsLoading && unreadNotifications.length === 0 && favorites.length === 0 && recentItems.length === 0) {\n          <div class=\"sidebar-empty\">\n            <i class=\"fa-solid fa-inbox\"></i>\n            <p>No quick access items</p>\n          </div>\n        }\n      </div>\n    </div>\n  }\n\n  <!-- Quick Access FAB Toggle (Fixed Button) -->\n  @if (hasSidebarContent && !sidebarOpen) {\n    <button class=\"sidebar-fab-toggle\"\n      (click)=\"toggleSidebar()\"\n      title=\"Quick Access\">\n      <i class=\"fa-solid fa-bolt\"></i>\n      @if (unreadNotifications.length > 0) {\n        <span class=\"fab-badge\">{{ unreadNotifications.length }}</span>\n      }\n    </button>\n  }\n\n  <!-- App Configuration Dialog -->\n  <mj-user-app-config\n    #appConfigDialog\n    [(ShowDialog)]=\"showConfigDialog\"\n    (ConfigSaved)=\"onConfigSaved()\">\n  </mj-user-app-config>\n</div>\n", styles: [".home-dashboard {\n  display: flex;\n  height: 100%;\n  background: var(--mj-bg-page);\n  overflow: hidden;\n  position: relative;\n}\n\n/* Main Content Area */\n.main-content {\n  flex: 1;\n  display: flex;\n  flex-direction: column;\n  padding: 32px;\n  overflow-y: auto;\n  transition: margin-right var(--mj-transition-slow);\n}\n\n/* Sidebar open state adjusts main content on desktop */\n.home-dashboard.sidebar-open .main-content {\n  margin-right: 320px;\n}\n\n/* Header */\n.home-header {\n  display: flex;\n  justify-content: space-between;\n  align-items: flex-start;\n  margin-bottom: 32px;\n}\n\n.greeting-section h1 {\n  margin: 0 0 8px 0;\n  font-size: var(--mj-text-4xl);\n  font-weight: var(--mj-font-semibold);\n  color: var(--mj-text-primary);\n}\n\n.greeting-section .date {\n  margin: 0;\n  font-size: var(--mj-text-base);\n  color: var(--mj-text-muted);\n}\n\n/* FAB Toggle Button for Quick Access - top-right on desktop */\n.sidebar-fab-toggle {\n  position: fixed;\n  top: 80px; /* Below shell header with some spacing */\n  right: 24px;\n  width: 56px;\n  height: 56px;\n  border: none;\n  border-radius: var(--mj-radius-full);\n  background: var(--mj-brand-primary);\n  color: var(--mj-text-inverse);\n  font-size: var(--mj-text-xl);\n  cursor: pointer;\n  box-shadow: var(--mj-shadow-brand-md);\n  transition: all var(--mj-transition-base);\n  z-index: 100;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n}\n\n.sidebar-fab-toggle:hover {\n  background: var(--mj-brand-primary-hover);\n  transform: scale(1.05);\n  box-shadow: 0 6px 16px color-mix(in srgb, var(--mj-brand-primary) 50%, transparent);\n}\n\n.fab-badge {\n  position: absolute;\n  top: -4px;\n  right: -4px;\n  min-width: 20px;\n  height: 20px;\n  padding: 0 6px;\n  background: var(--mj-status-error);\n  color: var(--mj-text-inverse);\n  font-size: var(--mj-text-xs);\n  font-weight: var(--mj-font-semibold);\n  border-radius: var(--mj-radius-full);\n  display: flex;\n  align-items: center;\n  justify-content: center;\n}\n\n/* Loading State */\n.loading-container {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  flex: 1;\n  gap: 16px;\n  color: var(--mj-text-muted);\n}\n\n.loading-spinner {\n  font-size: var(--mj-text-4xl);\n  color: var(--mj-brand-primary);\n}\n\n/* Apps Section */\n.apps-section {\n  flex: 0 0 auto;\n}\n\n.section-title {\n  display: flex;\n  align-items: center;\n  gap: 12px;\n  margin: 0 0 24px 0;\n  font-size: var(--mj-text-xl);\n  font-weight: var(--mj-font-semibold);\n  color: var(--mj-text-secondary);\n}\n\n.section-title i {\n  color: var(--mj-text-muted);\n}\n\n/* Apps Grid */\n.apps-grid {\n  display: grid;\n  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));\n  gap: 20px;\n}\n\n/* App Card */\n.app-card {\n  --app-color: var(--mj-text-muted);\n  display: flex;\n  align-items: flex-start;\n  gap: 16px;\n  padding: 20px;\n  background: var(--mj-bg-surface-card);\n  border-radius: var(--mj-radius-lg);\n  border: 1px solid var(--mj-border-default);\n  box-shadow: var(--mj-shadow-sm);\n  cursor: pointer;\n  transition: all 0.25s ease;\n  position: relative;\n  overflow: hidden;\n}\n\n.app-card::before {\n  content: '';\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 4px;\n  height: 100%;\n  background: var(--app-color);\n  opacity: 0;\n  transition: opacity 0.25s ease;\n}\n\n.app-card:hover {\n  border-color: var(--app-color);\n  box-shadow: var(--mj-shadow-lg);\n  transform: translateY(-3px);\n}\n\n.app-card:hover::before {\n  opacity: 1;\n}\n\n/* App Icon */\n.app-icon-wrapper {\n  flex-shrink: 0;\n}\n\n.app-icon {\n  width: 52px;\n  height: 52px;\n  border-radius: var(--mj-radius-lg);\n  background: color-mix(in srgb, var(--app-color) 12%, transparent);\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  transition: all 0.25s ease;\n}\n\n.app-icon i {\n  font-size: var(--mj-text-xl);\n  color: var(--app-color);\n  transition: transform 0.25s ease;\n}\n\n.app-card:hover .app-icon {\n  background: var(--app-color);\n}\n\n.app-card:hover .app-icon i {\n  color: var(--mj-text-inverse);\n  transform: scale(1.1);\n}\n\n/* App Info */\n.app-info {\n  flex: 1;\n  min-width: 0;\n}\n\n.app-name {\n  margin: 0 0 4px 0;\n  font-size: var(--mj-text-base);\n  font-weight: var(--mj-font-semibold);\n  color: var(--mj-text-primary);\n}\n\n.app-description {\n  margin: 0 0 10px 0;\n  font-size: var(--mj-text-sm);\n  color: var(--mj-text-muted);\n  line-height: var(--mj-leading-snug);\n  display: -webkit-box;\n  -webkit-line-clamp: 2;\n  -webkit-box-orient: vertical;\n  overflow: hidden;\n}\n\n/* Nav Items Preview */\n.nav-preview {\n  display: flex;\n  flex-wrap: wrap;\n  gap: 6px;\n  align-items: center;\n}\n\n.nav-item-chip {\n  display: flex;\n  align-items: center;\n  gap: 5px;\n  padding: 3px 8px;\n  background: var(--mj-bg-surface-card);\n  border-radius: var(--mj-radius-sm);\n  font-size: var(--mj-text-xs);\n  color: var(--mj-text-secondary);\n}\n\n.nav-item-chip i {\n  font-size: 9px;\n  color: var(--mj-text-muted);\n}\n\n.more-items {\n  font-size: var(--mj-text-xs);\n  color: var(--mj-text-muted);\n  font-style: italic;\n}\n\n/* App Arrow */\n.app-arrow {\n  position: absolute;\n  right: 14px;\n  top: 50%;\n  transform: translateY(-50%) translateX(10px);\n  opacity: 0;\n  transition: all 0.25s ease;\n  color: var(--app-color);\n  font-size: var(--mj-text-base);\n}\n\n.app-card:hover .app-arrow {\n  opacity: 1;\n  transform: translateY(-50%) translateX(0);\n}\n\n/* Empty State */\n.empty-state {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  padding: 64px 24px;\n  background: var(--mj-bg-surface);\n  border-radius: var(--mj-radius-xl);\n  border: 2px dashed var(--mj-border-default);\n  text-align: center;\n}\n\n.empty-icon {\n  width: 80px;\n  height: 80px;\n  border-radius: var(--mj-radius-full);\n  background: var(--mj-bg-surface-card);\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  margin-bottom: 24px;\n}\n\n.empty-icon i {\n  font-size: var(--mj-text-4xl);\n  color: var(--mj-text-disabled);\n}\n\n.empty-state h3 {\n  margin: 0 0 8px 0;\n  font-size: var(--mj-text-xl);\n  font-weight: var(--mj-font-semibold);\n  color: var(--mj-text-secondary);\n}\n\n.empty-state p {\n  margin: 0 0 20px 0;\n  font-size: var(--mj-text-sm);\n  color: var(--mj-text-muted);\n  max-width: 400px;\n}\n\n.empty-state button i {\n  margin-right: 8px;\n}\n\n/* ========================================\n   RIGHT SIDEBAR\n   ======================================== */\n.quick-access-sidebar {\n  position: fixed;\n  top: 60px; /* Below shell header */\n  right: 0;\n  bottom: 0;\n  width: 320px;\n  background: var(--mj-bg-surface);\n  border-left: 1px solid var(--mj-border-default);\n  display: flex;\n  flex-direction: column;\n  transform: translateX(100%);\n  transition: transform var(--mj-transition-slow);\n  overflow: hidden;\n  z-index: 100;\n  box-shadow: -2px 0 8px color-mix(in srgb, var(--mj-text-primary) 8%, transparent);\n}\n\n.home-dashboard.sidebar-open .quick-access-sidebar {\n  transform: translateX(0);\n}\n\n.sidebar-header {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  padding: 20px;\n  border-bottom: 1px solid var(--mj-border-default);\n  background: var(--mj-bg-surface-card);\n}\n\n.sidebar-header h3 {\n  margin: 0;\n  font-size: var(--mj-text-base);\n  font-weight: var(--mj-font-semibold);\n  color: var(--mj-text-primary);\n  display: flex;\n  align-items: center;\n  gap: 10px;\n}\n\n.sidebar-header h3 i {\n  color: var(--mj-brand-primary);\n  font-size: var(--mj-text-sm);\n}\n\n.sidebar-close-btn {\n  width: 32px;\n  height: 32px;\n  border: none;\n  border-radius: var(--mj-radius-md);\n  background: transparent;\n  color: var(--mj-text-muted);\n  cursor: pointer;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  transition: all var(--mj-transition-base);\n}\n\n.sidebar-close-btn:hover {\n  background: var(--mj-bg-surface-hover);\n  color: var(--mj-text-primary);\n}\n\n.sidebar-content {\n  flex: 1;\n  overflow-y: auto;\n  padding: 16px;\n}\n\n/* Sidebar Sections */\n.sidebar-section {\n  margin-bottom: 20px;\n}\n\n.sidebar-section:last-child {\n  margin-bottom: 0;\n}\n\n.sidebar-section-title {\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  margin: 0 0 12px 0;\n  font-size: var(--mj-text-sm);\n  font-weight: var(--mj-font-semibold);\n  color: var(--mj-text-muted);\n  text-transform: uppercase;\n  letter-spacing: 0.5px;\n}\n\n.sidebar-section-title i {\n  font-size: var(--mj-text-xs);\n}\n\n.notifications-section .sidebar-section-title i {\n  color: var(--mj-color-warning-600);\n}\n\n.favorites-section .sidebar-section-title i {\n  color: var(--mj-status-warning);\n}\n\n.recents-section .sidebar-section-title i {\n  color: var(--mj-brand-primary);\n}\n\n.section-badge {\n  background: var(--mj-status-error);\n  color: var(--mj-text-inverse);\n  font-size: 10px;\n  font-weight: var(--mj-font-semibold);\n  padding: 2px 6px;\n  border-radius: var(--mj-radius-md);\n  margin-left: auto;\n}\n\n/* Sidebar Items */\n.sidebar-items {\n  display: flex;\n  flex-direction: column;\n  gap: 8px;\n}\n\n.sidebar-item {\n  display: flex;\n  align-items: center;\n  gap: 12px;\n  padding: 10px 12px;\n  background: var(--mj-bg-surface-card);\n  border-radius: var(--mj-radius-lg);\n  cursor: pointer;\n  transition: all var(--mj-transition-base);\n}\n\n.sidebar-item:hover {\n  background: var(--mj-bg-surface-hover);\n  transform: translateX(4px);\n}\n\n.sidebar-item-icon {\n  width: 36px;\n  height: 36px;\n  border-radius: var(--mj-radius-md);\n  background: var(--mj-bg-surface);\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  flex-shrink: 0;\n}\n\n.sidebar-item-icon i {\n  font-size: var(--mj-text-sm);\n  color: var(--mj-text-muted);\n}\n\n.notification-item .sidebar-item-icon {\n  background: var(--mj-color-warning-50);\n}\n\n.notification-item .sidebar-item-icon i {\n  color: var(--mj-color-warning-600);\n}\n\n.favorite-item .sidebar-item-icon {\n  background: var(--mj-color-warning-50);\n}\n\n.favorite-item .sidebar-item-icon i {\n  color: var(--mj-color-warning-500);\n}\n\n.recent-item .sidebar-item-icon {\n  background: var(--mj-color-info-50);\n}\n\n.recent-item .sidebar-item-icon i {\n  color: var(--mj-brand-primary);\n}\n\n.sidebar-item-info {\n  display: flex;\n  flex-direction: column;\n  gap: 2px;\n  min-width: 0;\n  flex: 1;\n}\n\n.sidebar-item-title {\n  font-size: var(--mj-text-sm);\n  font-weight: var(--mj-font-medium);\n  color: var(--mj-text-primary);\n  white-space: nowrap;\n  overflow: hidden;\n  text-overflow: ellipsis;\n}\n\n.sidebar-item-subtitle {\n  font-size: var(--mj-text-xs);\n  color: var(--mj-text-muted);\n  white-space: nowrap;\n  overflow: hidden;\n  text-overflow: ellipsis;\n}\n\n.sidebar-loading {\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  color: var(--mj-text-muted);\n  font-size: var(--mj-text-sm);\n  padding: 8px 0;\n}\n\n.sidebar-loading i {\n  color: var(--mj-brand-primary);\n}\n\n.sidebar-empty {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  padding: 40px 20px;\n  text-align: center;\n  color: var(--mj-text-disabled);\n}\n\n.sidebar-empty i {\n  font-size: var(--mj-text-4xl);\n  margin-bottom: 12px;\n}\n\n.sidebar-empty p {\n  margin: 0;\n  font-size: var(--mj-text-sm);\n}\n\n\n/* ========================================\n   RESPONSIVE DESIGN\n   ======================================== */\n\n/* Tablet and smaller desktop */\n@media (max-width: 1200px) {\n  .quick-access-sidebar {\n    width: 280px;\n  }\n\n  .home-dashboard.sidebar-open .main-content {\n    margin-right: 280px;\n  }\n\n  .apps-grid {\n    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));\n  }\n}\n\n/* Tablet */\n@media (max-width: 992px) {\n  .main-content {\n    padding: 24px;\n  }\n\n  .greeting-section h1 {\n    font-size: var(--mj-text-3xl);\n  }\n\n  /* Make sidebar an overlay on tablet */\n  .quick-access-sidebar {\n    position: fixed;\n    top: 60px; /* Below shell header */\n    right: 0;\n    bottom: 0;\n    width: 320px;\n    z-index: 1000;\n    box-shadow: -4px 0 20px color-mix(in srgb, var(--mj-text-primary) 15%, transparent);\n  }\n\n  .home-dashboard.sidebar-open .main-content {\n    margin-right: 0;\n  }\n\n  /* Show backdrop when sidebar is open on tablet */\n  .home-dashboard.sidebar-open::after {\n    content: '';\n    position: fixed;\n    top: 60px;\n    left: 0;\n    right: 320px;\n    bottom: 0;\n    background: var(--mj-bg-overlay);\n    z-index: 999;\n  }\n}\n\n/* Mobile */\n@media (max-width: 768px) {\n  .home-dashboard {\n    height: auto;\n    min-height: 100%;\n    overflow: visible;\n  }\n\n  .main-content {\n    padding: 20px;\n    padding-bottom: 100px; /* Space for FAB button */\n    overflow: visible;\n  }\n\n  .home-header {\n    flex-direction: column;\n    gap: 16px;\n    margin-bottom: 24px;\n  }\n\n  .greeting-section h1 {\n    font-size: var(--mj-text-2xl);\n  }\n\n  /* Full-width sidebar on mobile - positioned below top nav */\n  .quick-access-sidebar {\n    position: fixed;\n    top: 60px; /* Below the shell header */\n    right: 0;\n    bottom: 0;\n    width: 100%;\n    max-width: 100%;\n    z-index: 100; /* Below shell header */\n    border-left: none;\n    border-top: 1px solid var(--mj-border-default);\n  }\n\n  /* Add backdrop on mobile when sidebar is open */\n  .home-dashboard.sidebar-open::before {\n    content: '';\n    position: fixed;\n    top: 60px;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    background: var(--mj-bg-overlay);\n    z-index: 99;\n  }\n\n  /* No ::after backdrop needed on mobile */\n  .home-dashboard.sidebar-open::after {\n    display: none;\n  }\n\n  .apps-grid {\n    grid-template-columns: 1fr;\n    gap: 16px;\n  }\n\n  .app-card {\n    padding: 16px;\n  }\n\n  .app-icon {\n    width: 44px;\n    height: 44px;\n  }\n\n  .app-icon i {\n    font-size: var(--mj-text-lg);\n  }\n\n  .app-name {\n    font-size: var(--mj-text-sm);\n  }\n\n  .nav-preview {\n    display: none;\n  }\n\n  /* Move FAB to bottom-right on mobile */\n  .sidebar-fab-toggle {\n    top: auto;\n    bottom: 20px;\n    right: 20px;\n    width: 48px;\n    height: 48px;\n    font-size: var(--mj-text-lg);\n  }\n}\n\n@media (max-width: 480px) {\n  .main-content {\n    padding: 16px;\n    padding-bottom: 80px;\n  }\n\n  .greeting-section h1 {\n    font-size: var(--mj-text-xl);\n  }\n\n  .greeting-section .date {\n    font-size: var(--mj-text-sm);\n  }\n\n  .section-title {\n    font-size: var(--mj-text-base);\n    margin-bottom: 16px;\n  }\n\n  .sidebar-fab-toggle {\n    bottom: 16px;\n    right: 16px;\n    width: 44px;\n    height: 44px;\n    font-size: var(--mj-text-base);\n  }\n}\n"] }]
    }], () => [{ type: i1.ApplicationManager }, { type: i2.NavigationService }, { type: i2.RecentAccessService }, { type: i0.ChangeDetectorRef }], { appConfigDialog: [{
            type: ViewChild,
            args: ['appConfigDialog']
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(HomeDashboardComponent, { className: "HomeDashboardComponent", filePath: "src/Home/home-dashboard.component.ts", lineNumber: 41 }); })();
//# sourceMappingURL=home-dashboard.component.js.map