import { Component, ElementRef, Input, ViewEncapsulation } from '@angular/core';
import { BreadCrumbsService } from './bread-crumbs.service';
import { ScreenType } from '../enlighten-lib/filters/condition-type';
import { BreadCrumbsStyle } from '../enlighten-lib/enums/bread-crumbs-style';
import { takeUntil, take, switchMap, catchError, map } from 'rxjs/operators';
import { ActivatedRoute, Router } from '@angular/router';
import { Subject, throwError } from 'rxjs';
import { FlattenService } from '../flatten-module/flatten.service';
import { CommonLibConfigurationService } from '../common-lib-configuration.service';
import { CommonService } from '../common.service';
import * as i0 from "@angular/core";
import * as i1 from "./bread-crumbs.service";
import * as i2 from "@angular/router";
import * as i3 from "../flatten-module/flatten.service";
import * as i4 from "../common-lib-configuration.service";
import * as i5 from "../common.service";
import * as i6 from "@angular/common";
import * as i7 from "@angular/material/tooltip";
import * as i8 from "@angular/material/icon";
function BreadCrumbsComponent_ng_container_1_ng_container_1_button_3_a_1_Template(rf, ctx) { if (rf & 1) {
    const _r15 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "a", 14);
    i0.ɵɵlistener("click", function BreadCrumbsComponent_ng_container_1_ng_container_1_button_3_a_1_Template_a_click_0_listener() { i0.ɵɵrestoreView(_r15); const crumb_r2 = i0.ɵɵnextContext(3).$implicit; const ctx_r13 = i0.ɵɵnextContext(); return ctx_r13.navigateToHome(crumb_r2.appVersionId); });
    i0.ɵɵelementStart(1, "img", 15, 16);
    i0.ɵɵlistener("error", function BreadCrumbsComponent_ng_container_1_ng_container_1_button_3_a_1_Template_img_error_1_listener($event) { i0.ɵɵrestoreView(_r15); const crumb_r2 = i0.ɵɵnextContext(3).$implicit; const ctx_r16 = i0.ɵɵnextContext(); return ctx_r16.onIconError($event, crumb_r2.onErrorIcon); });
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r11 = i0.ɵɵnextContext(4);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("src", ctx_r11.baseUrl + ctx_r11.crumbIcon, i0.ɵɵsanitizeUrl);
} }
const _c0 = function (a0) { return { "remove-link-decoration": a0 }; };
function BreadCrumbsComponent_ng_container_1_ng_container_1_button_3_Template(rf, ctx) { if (rf & 1) {
    const _r20 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 12);
    i0.ɵɵlistener("click", function BreadCrumbsComponent_ng_container_1_ng_container_1_button_3_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r20); const ctx_r19 = i0.ɵɵnextContext(2); const crumb_r2 = ctx_r19.$implicit; const i_r3 = ctx_r19.index; const ctx_r18 = i0.ɵɵnextContext(); return ctx_r18.onBreadCrumbChange(crumb_r2, i_r3); });
    i0.ɵɵtemplate(1, BreadCrumbsComponent_ng_container_1_ng_container_1_button_3_a_1_Template, 3, 1, "a", 13);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const crumb_r2 = i0.ɵɵnextContext(2).$implicit;
    i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(2, _c0, !crumb_r2.url));
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", crumb_r2.onErrorIcon);
} }
function BreadCrumbsComponent_ng_container_1_ng_container_1_a_4_span_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 19);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r22 = i0.ɵɵnextContext(4);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1(" v", ctx_r22.appMinorVersion, " ");
} }
const _c1 = function (a0, a1) { return { "remove-link-decoration": a0, "first-crumb": a1 }; };
function BreadCrumbsComponent_ng_container_1_ng_container_1_a_4_Template(rf, ctx) { if (rf & 1) {
    const _r25 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "a", 17);
    i0.ɵɵlistener("click", function BreadCrumbsComponent_ng_container_1_ng_container_1_a_4_Template_a_click_0_listener() { i0.ɵɵrestoreView(_r25); const ctx_r24 = i0.ɵɵnextContext(2); const crumb_r2 = ctx_r24.$implicit; const i_r3 = ctx_r24.index; const isFirst_r4 = ctx_r24.first; const ctx_r23 = i0.ɵɵnextContext(); ctx_r23.onBreadCrumbChange(crumb_r2, i_r3); return isFirst_r4 ? ctx_r23.navigateToHome(ctx_r23.appVersionId) : null; });
    i0.ɵɵtext(1);
    i0.ɵɵtemplate(2, BreadCrumbsComponent_ng_container_1_ng_container_1_a_4_span_2_Template, 2, 1, "span", 18);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r26 = i0.ɵɵnextContext(2);
    const crumb_r2 = ctx_r26.$implicit;
    const isFirst_r4 = ctx_r26.first;
    const i_r3 = ctx_r26.index;
    const ctx_r7 = i0.ɵɵnextContext();
    i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(3, _c1, !crumb_r2.url, isFirst_r4 && i_r3 === 0));
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1(" ", crumb_r2.title, " ");
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", isFirst_r4 && i_r3 === 0 && ctx_r7.appMinorVersion && ctx_r7.avs === "P");
} }
function BreadCrumbsComponent_ng_container_1_ng_container_1_div_5_Template(rf, ctx) { if (rf & 1) {
    const _r29 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 20);
    i0.ɵɵelementStart(1, "input", 21, 22);
    i0.ɵɵlistener("input", function BreadCrumbsComponent_ng_container_1_ng_container_1_div_5_Template_input_input_1_listener() { i0.ɵɵrestoreView(_r29); const _r27 = i0.ɵɵreference(2); const crumb_r2 = i0.ɵɵnextContext(2).$implicit; const ctx_r28 = i0.ɵɵnextContext(); return ctx_r28.onCrumbTitleChange(_r27.value, crumb_r2.guid); })("keyup.enter", function BreadCrumbsComponent_ng_container_1_ng_container_1_div_5_Template_input_keyup_enter_1_listener($event) { i0.ɵɵrestoreView(_r29); const ctx_r31 = i0.ɵɵnextContext(3); return ctx_r31.onRenameKeyEnter($event); });
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const crumb_r2 = i0.ɵɵnextContext(2).$implicit;
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("value", crumb_r2.title);
} }
function BreadCrumbsComponent_ng_container_1_ng_container_1_mat_icon_6_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "mat-icon", 23);
} }
function BreadCrumbsComponent_ng_container_1_ng_container_1_div_7_Template(rf, ctx) { if (rf & 1) {
    const _r34 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 24);
    i0.ɵɵelementStart(1, "div");
    i0.ɵɵelementStart(2, "label", 25);
    i0.ɵɵelement(3, "mat-icon", 26);
    i0.ɵɵelementStart(4, "p", 27);
    i0.ɵɵtext(5, "App Owner");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(6, "p", 28);
    i0.ɵɵelementStart(7, "span", 29);
    i0.ɵɵtext(8);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(9, "div");
    i0.ɵɵelementStart(10, "label", 25);
    i0.ɵɵelement(11, "mat-icon", 30);
    i0.ɵɵelementStart(12, "p", 27);
    i0.ɵɵtext(13, "Publish Status");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(14, "p", 28);
    i0.ɵɵelementStart(15, "span", 29);
    i0.ɵɵtext(16);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(17, "div", 31);
    i0.ɵɵlistener("click", function BreadCrumbsComponent_ng_container_1_ng_container_1_div_7_Template_div_click_17_listener() { i0.ɵɵrestoreView(_r34); const ctx_r33 = i0.ɵɵnextContext(3); return ctx_r33.navigateToUsersList(); });
    i0.ɵɵelementStart(18, "label", 32);
    i0.ɵɵelement(19, "mat-icon", 33);
    i0.ɵɵelementStart(20, "p", 27);
    i0.ɵɵtext(21, "Users");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(22, "p", 28);
    i0.ɵɵelementStart(23, "span", 34);
    i0.ɵɵtext(24);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(25, "div");
    i0.ɵɵelementStart(26, "label", 25);
    i0.ɵɵelement(27, "mat-icon", 35);
    i0.ɵɵelementStart(28, "p", 27);
    i0.ɵɵtext(29, "Submissions");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(30, "p", 28);
    i0.ɵɵelementStart(31, "span", 34);
    i0.ɵɵtext(32);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(33, "div");
    i0.ɵɵelementStart(34, "button", 36);
    i0.ɵɵlistener("click", function BreadCrumbsComponent_ng_container_1_ng_container_1_div_7_Template_button_click_34_listener() { i0.ɵɵrestoreView(_r34); const ctx_r35 = i0.ɵɵnextContext(3); return ctx_r35.goToAppSettings(); });
    i0.ɵɵelement(35, "mat-icon", 37);
    i0.ɵɵelementStart(36, "p");
    i0.ɵɵtext(37, "App Settings");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r10 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance(8);
    i0.ɵɵtextInterpolate(ctx_r10.selectedAppOwnerName);
    i0.ɵɵadvance(8);
    i0.ɵɵtextInterpolate(ctx_r10.publishStatus);
    i0.ɵɵadvance(8);
    i0.ɵɵtextInterpolate(ctx_r10.appUsersNo);
    i0.ɵɵadvance(8);
    i0.ɵɵtextInterpolate(ctx_r10.formObjectSum);
} }
function BreadCrumbsComponent_ng_container_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    const _r38 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "div", 5);
    i0.ɵɵlistener("mouseover", function BreadCrumbsComponent_ng_container_1_ng_container_1_Template_div_mouseover_1_listener() { i0.ɵɵrestoreView(_r38); const ctx_r37 = i0.ɵɵnextContext(); const crumb_r2 = ctx_r37.$implicit; const isFirst_r4 = ctx_r37.first; const i_r3 = ctx_r37.index; return crumb_r2.showHoverBox = isFirst_r4 && i_r3 === 0; })("mouseleave", function BreadCrumbsComponent_ng_container_1_ng_container_1_Template_div_mouseleave_1_listener() { i0.ɵɵrestoreView(_r38); const crumb_r2 = i0.ɵɵnextContext().$implicit; return crumb_r2.showHoverBox = false; });
    i0.ɵɵelementStart(2, "div", 6);
    i0.ɵɵtemplate(3, BreadCrumbsComponent_ng_container_1_ng_container_1_button_3_Template, 2, 4, "button", 7);
    i0.ɵɵtemplate(4, BreadCrumbsComponent_ng_container_1_ng_container_1_a_4_Template, 3, 6, "a", 8);
    i0.ɵɵtemplate(5, BreadCrumbsComponent_ng_container_1_ng_container_1_div_5_Template, 3, 1, "div", 9);
    i0.ɵɵelementEnd();
    i0.ɵɵtemplate(6, BreadCrumbsComponent_ng_container_1_ng_container_1_mat_icon_6_Template, 1, 0, "mat-icon", 10);
    i0.ɵɵtemplate(7, BreadCrumbsComponent_ng_container_1_ng_container_1_div_7_Template, 38, 4, "div", 11);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r41 = i0.ɵɵnextContext();
    const isFirst_r4 = ctx_r41.first;
    const crumb_r2 = ctx_r41.$implicit;
    const i_r3 = ctx_r41.index;
    const ctx_r5 = i0.ɵɵnextContext();
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngClass", ctx_r5.showHoverBox ? "" : "border-none");
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", isFirst_r4);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", !crumb_r2.isEditable);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", crumb_r2.isEditable);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r5.breadCrumbsStyle !== ctx_r5.breadCrumbsStyles.SkipCurrent && i_r3 < ctx_r5.breadCrumbs.length - 1 || i_r3 < ctx_r5.breadCrumbs.length - 2);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", crumb_r2.showHoverBox && ctx_r5.showHoverBox);
} }
function BreadCrumbsComponent_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, BreadCrumbsComponent_ng_container_1_ng_container_1_Template, 8, 6, "ng-container", 4);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const i_r3 = ctx.index;
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r0.breadCrumbsStyle !== ctx_r0.breadCrumbsStyles.SkipCurrent || i_r3 < ctx_r0.breadCrumbs.length - 1);
} }
function BreadCrumbsComponent_a_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "a", 38);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(ctx_r1.currentBreadCrumbTitle);
} }
// import { AndromedaService } from 'app/layout/layouts/vertical/andromeda/andromeda.service';
export class BreadCrumbsComponent {
    constructor(_breadCrumbsService, _router, _flattenService, commonLibConfig, elRef, _commonService, _activatedRoute) {
        this._breadCrumbsService = _breadCrumbsService;
        this._router = _router;
        this._flattenService = _flattenService;
        this.commonLibConfig = commonLibConfig;
        this.elRef = elRef;
        this._commonService = _commonService;
        this._activatedRoute = _activatedRoute;
        this.showHoverBox = false;
        this.breadCrumbs = [];
        this.baseUrl = this.commonLibConfig.x1MediaUrl; //need config
        this.currentBreadCrumbTitle = '';
        this.selectedAppOwnerName = '';
        this.selectedAppOwner = [];
        this._unsubscribeAll = new Subject();
        this.appName = '';
    }
    get screenTypes() {
        return ScreenType;
    }
    get breadCrumbsStyles() {
        return BreadCrumbsStyle;
    }
    navigateToHome(appVersionId) {
        this._router.navigateByUrl(`apps/${appVersionId}/home`);
    }
    navigateToUsersList() {
        this._router.navigate(['/apps/' + this.appVersionId + '/users']);
    }
    goToAppSettings() {
        this._router.navigate(['/apps/' + this.appVersionId + '/app-settings']);
    }
    ngAfterViewInit() {
        const breadcrumbContainer = this.elRef.nativeElement.querySelector('.breadcrumb-container');
        breadcrumbContainer.addEventListener('mouseover', () => {
            breadcrumbContainer.classList.add('hover');
        });
        breadcrumbContainer.addEventListener('mouseleave', () => {
            breadcrumbContainer.classList.remove('hover');
        });
    }
    fetchVersionList() {
        return this._flattenService.flatten$.pipe(take(1), switchMap((flatten) => {
            if (flatten?.appId !== undefined && flatten?.version !== undefined) {
                const { appId, version } = flatten;
                return this._commonService.getVersionList(appId, version).pipe(map((result) => {
                    if (result?.v?.versionslist?.length > 0) {
                        const latestVersion = result.v.versionslist
                            .reduce((max, curr) => (curr.appminorversion > max.appminorversion ? curr : max), result.v.versionslist[0]);
                        this._commonService.setAppMinorVersion(latestVersion.appminorversion); // Update the service with the latest version
                    }
                    else {
                        console.warn('No versions found or result is not in expected format.');
                    }
                }), catchError((error) => {
                    console.error('Error fetching version list:', error);
                    return throwError(() => new Error('Failed to fetch version list'));
                }));
            }
            else {
                console.warn('Flatten object or its properties are undefined');
                return throwError(() => new Error('Flatten object or its properties are undefined'));
            }
        }));
    }
    fetchInitialAppStatus() {
        return this._flattenService.flatten$
            .pipe(take(1), switchMap(flatten => this._commonService.fetchAppDetails(flatten.appVersionId, this.commonLibConfig.axonatorX1Url).pipe(map(appDetails => {
            this.avs = appDetails.data.details.avs;
        }), catchError((error) => {
            return throwError(error);
        }))));
    }
    ngOnInit() {
        // const url = window.location.href;
        //   this.currentAppVersionId = url.split("/")[4];
        this._commonService.appMinorVersion$.subscribe(version => {
            this.appMinorVersion = version;
        });
        this._activatedRoute.params.subscribe(params => {
            this.appVersionId = params.appVersionId;
            this._flattenService.getFlattenData(this.appVersionId).pipe(switchMap(() => {
                return this.fetchVersionList();
            }), switchMap(() => {
                return this.fetchInitialAppStatus();
            }), switchMap(() => {
                return this._flattenService.flatten$.pipe(take(1), switchMap((flatten) => {
                    if (flatten && flatten.appId !== undefined && flatten.version !== undefined) {
                        const { appId, version } = flatten;
                        return this._commonService.getApplist(appId, version).pipe(catchError((error) => {
                            return throwError(error);
                        }));
                    }
                    else {
                        return throwError('Flatten object or its properties are undefined');
                    }
                }));
            }), switchMap((responseData) => {
                this.publishStatus = responseData.data.avs === "P" ? "Published" : "Unpublished";
                this.crumbIcon = responseData.data.ic;
                return this._flattenService.flatten$.pipe(take(1), switchMap((flatten) => {
                    if (flatten && flatten.appId !== undefined && flatten.version !== undefined) {
                        const { appId, version } = flatten;
                        return this._commonService.getAppUsers(appId, version).pipe(catchError((error) => {
                            return throwError(error);
                        }));
                    }
                    else {
                        return throwError('Flatten object or its properties are undefined');
                    }
                }));
            }), takeUntil(this._unsubscribeAll)).subscribe((userData) => {
                this.appUsersNo = userData.appuser.AppUser.appusers.length;
                this.selectedAppOwner = userData.appuser.AppUser.appusers;
                const appOwner = this.selectedAppOwner.find(user => user.isOwner === 'true');
                if (appOwner) {
                    this.selectedAppOwnerName = `${appOwner.first_name} ${appOwner.last_name}`;
                }
            }, (error) => {
            });
            this.subscribers();
            // Subscribe to app name changes
            this.appNameSubscription = this._commonService.appName$.subscribe((newAppName) => {
                this.appName = newAppName;
                this.updateAppNameInBreadcrumbs();
            });
        });
    }
    ngOnDestroy() {
        if (this.appNameSubscription) {
            this.appNameSubscription.unsubscribe();
        }
    }
    updateAppNameInBreadcrumbs() {
        if (this.breadCrumbs.length > 0 && this.appName) {
            this.breadCrumbs[0].title = this.appName;
            this._breadCrumbsService.update();
        }
    }
    subscribers() {
        this._breadCrumbsService.onBreadCrumbsChanged
            .subscribe(response => {
            if (response) {
                this.setBreadCrumbs(response);
            }
        });
        this._breadCrumbsService.breadCrumbStyleChanged
            .subscribe(breadCrumbStyle => {
            this.breadCrumbsStyle = breadCrumbStyle;
        });
    }
    setBreadCrumbs(crumbs) {
        this.breadCrumbs = Object.assign([], crumbs);
        if (this.breadCrumbs.length > 0) {
            this.currentBreadCrumbTitle = this.breadCrumbs[this.breadCrumbs.length - 1].title;
            if (this.appName) {
                this.breadCrumbs[0].title = this.appName;
            }
        }
    }
    onBreadCrumbChange(crumb, index) {
        if (crumb.url && (crumb.url !== this._router.url)) {
            this._router.navigate([crumb.url]);
            this._breadCrumbsService.changeCurrentBreadCrumb(index);
        }
    }
    onCrumbTitleChange(title, id) {
        const crumbIndex = this.breadCrumbs.findIndex(b => b.guid === id);
        if (crumbIndex !== -1) {
            this.breadCrumbs[crumbIndex].title = title;
            this._breadCrumbsService.changeTitle(title, id);
            if (crumbIndex === 0) {
                this.currentBreadCrumbTitle = title;
            }
        }
    }
    onIconError(event, onErrorIcon) {
        event.target['src'] = onErrorIcon;
    }
    onRenameKeyEnter(event) {
        event.target.blur();
    }
}
BreadCrumbsComponent.ɵfac = function BreadCrumbsComponent_Factory(t) { return new (t || BreadCrumbsComponent)(i0.ɵɵdirectiveInject(i1.BreadCrumbsService), i0.ɵɵdirectiveInject(i2.Router), i0.ɵɵdirectiveInject(i3.FlattenService), i0.ɵɵdirectiveInject(i4.CommonLibConfigurationService), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i5.CommonService), i0.ɵɵdirectiveInject(i2.ActivatedRoute)); };
BreadCrumbsComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: BreadCrumbsComponent, selectors: [["lib-bread-crumbs"]], inputs: { showHoverBox: "showHoverBox" }, decls: 4, vars: 2, consts: [[1, "hidden", "md:flex", "items-center"], [4, "ngFor", "ngForOf"], [1, "flex", "md:hidden", "items-center"], ["class", "ml-1 mr-1 nav-active crumb-title", 4, "ngIf"], [4, "ngIf"], [1, "breadcrumb-container", "px-1.5", 3, "mouseover", "mouseleave"], [1, "breadcrumb-title-container", 3, "ngClass"], ["class", "icon-button mb-1 md-body-1", "mat-icon-button", "", 3, "ngClass", "click", 4, "ngIf"], ["class", "ml-1 mr-1 nav-active crumb-title", 3, "ngClass", "click", 4, "ngIf"], ["class", "nav-active editable-title", 4, "ngIf"], ["svgIcon", "heroicons_outline:chevron-right", "class", "crumb-chevron", 4, "ngIf"], ["class", "hover-box", 4, "ngIf"], ["mat-icon-button", "", 1, "icon-button", "mb-1", "md-body-1", 3, "ngClass", "click"], ["class", "app-icon-link", 3, "click", 4, "ngIf"], [1, "app-icon-link", 3, "click"], ["alt", "", 1, "app-icon", "w-30", 3, "src", "error"], ["icon", ""], [1, "ml-1", "mr-1", "nav-active", "crumb-title", 3, "ngClass", "click"], ["class", "version-text", 4, "ngIf"], [1, "version-text"], [1, "nav-active", "editable-title"], ["type", "text", "matInput", "", "placeholder", "Report Name", "matTooltip", "Click to Rename", 1, "px-2", "py-1", "rounded-md", "analytical-report-name", 3, "value", "input", "keyup.enter"], ["crumbTitle", ""], ["svgIcon", "heroicons_outline:chevron-right", 1, "crumb-chevron"], [1, "hover-box"], [1, "control-label-hover"], ["svgIcon", "axo_app_owner", 1, "hover-icons"], [1, "hover-heading"], [1, "hover-content"], [1, "ml-2"], ["svgIcon", "axo_published", 1, "hover-icons"], [1, "clickable-div", 3, "click"], [1, "control-label-hover", "clickable-div"], ["svgIcon", "axo_users", 1, "hover-icons"], [1, "ml-2", "underline"], ["svgIcon", "axo_submission", 1, "hover-icons"], [1, "hover-btn", 3, "click"], ["svgIcon", "axo_setting"], [1, "ml-1", "mr-1", "nav-active", "crumb-title"]], template: function BreadCrumbsComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵelementStart(0, "div", 0);
        i0.ɵɵtemplate(1, BreadCrumbsComponent_ng_container_1_Template, 2, 1, "ng-container", 1);
        i0.ɵɵelementEnd();
        i0.ɵɵelementStart(2, "div", 2);
        i0.ɵɵtemplate(3, BreadCrumbsComponent_a_3_Template, 2, 1, "a", 3);
        i0.ɵɵelementEnd();
    } if (rf & 2) {
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngForOf", ctx.breadCrumbs);
        i0.ɵɵadvance(2);
        i0.ɵɵproperty("ngIf", ctx.breadCrumbs.length > 0);
    } }, directives: [i6.NgForOf, i6.NgIf, i6.NgClass, i7.MatTooltip, i8.MatIcon], styles: ["@import\"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@300&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@200&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@500&display=swap\";lib-bread-crumbs{display:flex;align-items:center}lib-bread-crumbs .editable-title{padding:4px;border:solid 1px white}lib-bread-crumbs .editable-title input{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}lib-bread-crumbs .crumb-title{cursor:pointer;color:#1b2b4b;font-family:Noto Sans,sans-serif;font-size:14px;font-weight:400}lib-bread-crumbs .remove-link-decoration{text-decoration:none;cursor:unset}lib-bread-crumbs .crumb-chevron{min-width:10px;min-height:10px;height:13px;color:#000000e6}lib-bread-crumbs .app-icon{max-width:30px}lib-bread-crumbs .icon-button{height:1.55rem;width:1.55rem}lib-bread-crumbs .icon-button .enlighten{max-height:100%!important;min-height:100%!important}.breadcrumb-container{display:flex;align-items:center;position:relative}.breadcrumb-title-container{flex:1;border:1px solid white;padding:5px;border-bottom:none;display:flex;justify-content:center;align-items:center;gap:.6rem;z-index:50}.breadcrumb-title-container a{font-family:Noto Sans,sans-serif;font-weight:400;cursor:pointer}.breadcrumb-container:first-of-type .breadcrumb-title-container:hover,.breadcrumb-container.hover .breadcrumb-title-container{border-bottom:white;z-index:100;border-top-left-radius:5px;border-top-right-radius:5px;background-color:#fff;border:1px solid #EAECF0;border-bottom:none}.hover-box{position:absolute;top:calc(100% - 1px);left:7px;background-color:#fff;border:1px solid none;border-bottom-left-radius:10px;border-bottom-right-radius:10px;border-top-right-radius:10px;width:calc(100% + 100px);padding:12px 10px 10px;z-index:99;box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f}.control-label-hover{display:flex;justify-content:start;align-items:center;gap:.3rem;color:#a5a5a5;font-size:.9rem;font-weight:450;width:100%}.control-label-hover .hover-icons{margin:0}.control-label-hover .hover-icons svg{width:.9rem;height:.9rem}.control-label-hover .hover-heading{margin:0}.hover-content{font-size:15px;font-weight:400}.breadcrumb-container.first-crumb:hover .hover-box{display:block}.clickable-div{cursor:pointer}.version-text{color:#a8a8a8;font-size:12px}.hover-btn{border-radius:1.5rem;display:flex;align-items:center;gap:.2rem;padding:.4rem .8rem;background-color:#e29865;color:#fff}.hover-btn svg,.hover-btn p{margin:0}.analytical-report-name{border:1px solid transparent}.analytical-report-name:hover{border:1px dashed #D0D5DD}.analytical-report-name:focus{border:1px solid #D0D5DD}\n"], encapsulation: 2 });
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BreadCrumbsComponent, [{
        type: Component,
        args: [{ selector: 'lib-bread-crumbs', encapsulation: ViewEncapsulation.None, template: "\n<div class=\"hidden md:flex items-center\">\n    <ng-container *ngFor=\"let crumb of breadCrumbs; let i = index; let isFirst = first;\">\n        <ng-container *ngIf=\"(breadCrumbsStyle !== breadCrumbsStyles.SkipCurrent) || (i < breadCrumbs.length-1)\">\n            \n            <div class=\"breadcrumb-container px-1.5\" \n                 (mouseover)=\"crumb.showHoverBox = (isFirst && i === 0)\" \n                 (mouseleave)=\"crumb.showHoverBox = false\">\n                <div class=\"breadcrumb-title-container\" [ngClass]=\"showHoverBox ? '' : 'border-none'\">\n\n                    <button *ngIf=\"isFirst\" class=\"icon-button mb-1 md-body-1\" \n                    [ngClass]=\"{'remove-link-decoration': !crumb.url}\" \n                    mat-icon-button \n                    (click)=\"onBreadCrumbChange(crumb, i)\">\n                <a *ngIf=\"crumb.onErrorIcon\" class=\"app-icon-link\" \n                   (click)=\"navigateToHome(crumb.appVersionId)\">\n                    <img alt=\"\" #icon class=\"app-icon w-30\" \n                         [src]=\"baseUrl + crumbIcon\" \n                         (error)=\"onIconError($event, crumb.onErrorIcon)\">\n                </a>\n            </button>\n\n                    <a *ngIf=\"!crumb.isEditable\" class=\"ml-1 mr-1 nav-active crumb-title\"\n                       [ngClass]=\"{'remove-link-decoration': !crumb.url, 'first-crumb': isFirst && i === 0}\"\n                       (click)=\"onBreadCrumbChange(crumb, i); isFirst ? navigateToHome(appVersionId) : null\">\n                        {{ crumb.title }} \n                        <span *ngIf=\"isFirst && i === 0 && appMinorVersion && avs === 'P'\" \n                              class=\"version-text\">\n                            v{{ appMinorVersion }}\n                        </span>\n                    </a>\n     \n\n    \n        <!-- Code to display the title of the report in the breadcrumbs section  -->\n        <!-- <a *ngIf=\"crumb.isEditable\" class=\"ml-1 mr-1 nav-active crumb-title editable-crumb\"\n           [ngClass]=\"{'remove-link-decoration': !crumb.url, 'first-crumb': isFirst && i === 0}\"\n           (click)=\"onBreadCrumbChange(crumb, i)\">\n            {{ crumb.title }}\n        </a> -->\n\n        <div class=\"nav-active editable-title\" *ngIf=\"crumb.isEditable\">\n            <input type=\"text\" #crumbTitle\n                   (input)=\"onCrumbTitleChange(crumbTitle.value, crumb.guid)\"  \n                   matInput [value]=\"crumb.title\"\n                   class=\"px-2 py-1 rounded-md analytical-report-name\"\n                   placeholder=\"Report Name\"\n                   matTooltip=\"Click to Rename\"\n                   (keyup.enter)=\"onRenameKeyEnter($event)\"\n                   >\n        </div>\n    </div>\n\n\n                <mat-icon *ngIf=\"((breadCrumbsStyle !== breadCrumbsStyles.SkipCurrent) && (i < breadCrumbs.length-1)) || (i < breadCrumbs.length-2)\" svgIcon=\"heroicons_outline:chevron-right\" class=\"crumb-chevron\"></mat-icon>\n                <div class=\"hover-box\" *ngIf=\"crumb.showHoverBox && showHoverBox\">\n                    <!-- Content for hover box goes here -->\n                    <div>\n                        <label class=\"control-label-hover\">\n                            <mat-icon svgIcon=\"axo_app_owner\" class=\"hover-icons\"></mat-icon>\n                            <p class=\"hover-heading\">App Owner</p>\n                        </label>\n                        <p class=\"hover-content\">\n                            <span class=\"ml-2\">{{ selectedAppOwnerName }}</span>\n                        </p>\n                    </div>\n                    <div>\n                        <label class=\"control-label-hover\">\n                            <mat-icon svgIcon=\"axo_published\" class=\"hover-icons\"></mat-icon>\n                            <p class=\"hover-heading\">Publish Status</p>\n                        </label>\n                        <p class=\"hover-content\">\n                            <span class=\"ml-2\">{{ publishStatus }}</span>\n                        </p>\n                    </div>\n                    <div class=\"clickable-div\" (click)=\"navigateToUsersList()\">\n                        <label class=\"control-label-hover clickable-div\">\n                            <mat-icon svgIcon=\"axo_users\" class=\"hover-icons\"></mat-icon>\n                                <p class=\"hover-heading\">Users</p>\n                        </label>\n                        <p class=\"hover-content\">\n                            <span class=\"ml-2 underline\">{{ appUsersNo }}</span>\n                        </p>\n                    </div>\n                    <div>\n                        <label class=\"control-label-hover\">\n                          <mat-icon svgIcon=\"axo_submission\" class=\"hover-icons\"></mat-icon>\n                          <p class=\"hover-heading\">Submissions</p>\n                        </label>\n                        <p class=\"hover-content\">\n                          <span class=\"ml-2 underline\">{{ formObjectSum }}</span> <!-- Display sum of form object counts -->\n                        </p>\n                      </div>\n                    <div>\n                        <button class=\"hover-btn\" (click)=\"goToAppSettings()\">\n                            <mat-icon svgIcon=\"axo_setting\"></mat-icon>\n                            <p>App Settings</p>\n                        </button>\n                    </div>\n                </div>\n            </div>\n        </ng-container>\n    </ng-container>\n</div>\n<div class=\"flex md:hidden items-center\">\n    <a *ngIf=\"breadCrumbs.length > 0\" class=\"ml-1 mr-1 nav-active crumb-title\" >{{currentBreadCrumbTitle}}</a>\n</div>\n\n<!-- <router-outlet></router-outlet> -->\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@300&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@200&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@500&display=swap\";lib-bread-crumbs{display:flex;align-items:center}lib-bread-crumbs .editable-title{padding:4px;border:solid 1px white}lib-bread-crumbs .editable-title input{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}lib-bread-crumbs .crumb-title{cursor:pointer;color:#1b2b4b;font-family:Noto Sans,sans-serif;font-size:14px;font-weight:400}lib-bread-crumbs .remove-link-decoration{text-decoration:none;cursor:unset}lib-bread-crumbs .crumb-chevron{min-width:10px;min-height:10px;height:13px;color:#000000e6}lib-bread-crumbs .app-icon{max-width:30px}lib-bread-crumbs .icon-button{height:1.55rem;width:1.55rem}lib-bread-crumbs .icon-button .enlighten{max-height:100%!important;min-height:100%!important}.breadcrumb-container{display:flex;align-items:center;position:relative}.breadcrumb-title-container{flex:1;border:1px solid white;padding:5px;border-bottom:none;display:flex;justify-content:center;align-items:center;gap:.6rem;z-index:50}.breadcrumb-title-container a{font-family:Noto Sans,sans-serif;font-weight:400;cursor:pointer}.breadcrumb-container:first-of-type .breadcrumb-title-container:hover,.breadcrumb-container.hover .breadcrumb-title-container{border-bottom:white;z-index:100;border-top-left-radius:5px;border-top-right-radius:5px;background-color:#fff;border:1px solid #EAECF0;border-bottom:none}.hover-box{position:absolute;top:calc(100% - 1px);left:7px;background-color:#fff;border:1px solid none;border-bottom-left-radius:10px;border-bottom-right-radius:10px;border-top-right-radius:10px;width:calc(100% + 100px);padding:12px 10px 10px;z-index:99;box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f}.control-label-hover{display:flex;justify-content:start;align-items:center;gap:.3rem;color:#a5a5a5;font-size:.9rem;font-weight:450;width:100%}.control-label-hover .hover-icons{margin:0}.control-label-hover .hover-icons svg{width:.9rem;height:.9rem}.control-label-hover .hover-heading{margin:0}.hover-content{font-size:15px;font-weight:400}.breadcrumb-container.first-crumb:hover .hover-box{display:block}.clickable-div{cursor:pointer}.version-text{color:#a8a8a8;font-size:12px}.hover-btn{border-radius:1.5rem;display:flex;align-items:center;gap:.2rem;padding:.4rem .8rem;background-color:#e29865;color:#fff}.hover-btn svg,.hover-btn p{margin:0}.analytical-report-name{border:1px solid transparent}.analytical-report-name:hover{border:1px dashed #D0D5DD}.analytical-report-name:focus{border:1px solid #D0D5DD}\n"] }]
    }], function () { return [{ type: i1.BreadCrumbsService }, { type: i2.Router }, { type: i3.FlattenService }, { type: i4.CommonLibConfigurationService }, { type: i0.ElementRef }, { type: i5.CommonService }, { type: i2.ActivatedRoute }]; }, { showHoverBox: [{
            type: Input
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 