import { Component } from '@angular/core';
import { Subject, debounceTime, takeUntil } from "rxjs";
import dayjs from 'dayjs';
import utc from 'dayjs/plugin/utc';
import * as i0 from "@angular/core";
import * as i1 from "@angular/router";
import * as i2 from "tango-app-ui-global";
import * as i3 from "tango-app-ui-shared";
import * as i4 from "../../services/trax.service";
import * as i5 from "@angular/common";
import * as i6 from "@angular/forms";
dayjs.extend(utc);
export class TaskComponent {
    route;
    router;
    gs;
    changeDetector;
    toast;
    TraxService;
    pageInfo;
    activatedRoute;
    location;
    dayjs = dayjs;
    destroy$ = new Subject();
    isExport = false;
    itemsPerPage = 10;
    currentPage = 1;
    totalItems = 0;
    paginationSizes = [];
    pageSize = 10;
    sortColumName = '';
    sortBy = '';
    sortDirection = '';
    searchInput = "";
    headerData;
    searchValue;
    limit;
    offset;
    searchDisabled = false;
    taskLoading = true;
    taskNoData = false;
    dataObject = [
        {
            Description: 'Priority',
            Issues: [
                { text: 'High', id: 'high' },
                { text: 'Medium', id: 'medium' },
                { text: 'Low', id: 'low' },
            ],
        },
        {
            Description: 'Coverage',
            Issues: [
                { text: 'Checklist', id: 'checklist' },
            ],
        },
    ];
    overallCardsData = {};
    cardDataLoading = true;
    cardNoData = false;
    taskTableData = [];
    type = 'Task';
    priorityType = [];
    reloadDate;
    checklistId;
    coverageType = [];
    userEmailes = [];
    constructor(route, router, gs, changeDetector, toast, TraxService, pageInfo, activatedRoute, location) {
        this.route = route;
        this.router = router;
        this.gs = gs;
        this.changeDetector = changeDetector;
        this.toast = toast;
        this.TraxService = TraxService;
        this.pageInfo = pageInfo;
        this.activatedRoute = activatedRoute;
        this.location = location;
        this.userEmailes = JSON.parse(localStorage.getItem("usersEmail-info") || "[]");
    }
    ngOnDestroy() {
        this.destroy$.next(true);
        this.destroy$.complete();
    }
    ngOnInit() {
        this.reloadDate = this.dayjs().format('hh:mm:ss A');
        this.activatedRoute.queryParams.subscribe(params => {
            if (params['coverage']) {
                this.coverageType = [params['coverage']];
                this.dataObject.forEach((category) => {
                    if (category.Description === 'Coverage') {
                        category.Issues.forEach((issue) => {
                            if (issue.id === params['coverage']) {
                                issue.checked = true;
                            }
                        });
                    }
                });
                // this.applyFilters([{ Description: 'Coverage', Issues: [{ text: params['coverage'], id: params['coverage'], checked: true}] }]);
                this.router.navigate([], {
                    relativeTo: this.route,
                    queryParams: {
                        coverage: params['coverage'],
                        checklistId: params['checklistId']
                    },
                    queryParamsHandling: 'merge',
                });
            }
            else {
                this.checklistId = '';
            }
            if (params.checklistId) {
                this.checklistId = params.checklistId;
            }
        });
        this.gs.dataRangeValue
            .pipe(takeUntil(this.destroy$), debounceTime(300))
            .subscribe((data) => {
            this.itemsPerPage = 10;
            this.pageSize = 10;
            this.headerData = data;
            this.currentPage = 1;
            this.setPageData();
            this.getOverallCardsData();
            // this.getTaskTableData();
            this.applyFilters([{ Description: 'Coverage', Issues: [{ text: this.coverageType[0], id: this.coverageType[0], checked: true }] }]);
        });
    }
    setPageData() {
        this.pageInfo.setTitle("Dashboard");
        // this.pageInfo.setDescription("Dashboard");
        this.pageInfo.setBreadcrumbs([
            { title: "Tango Trax", path: "/manage/trax/dashboard", isActive: false, isSeparator: false },
            { title: "Tango Trax", path: "/manage/trax/dashboard", isActive: false, isSeparator: true },
        ]);
    }
    getOverallCardsData() {
        this.overallCardsData = [];
        this.cardDataLoading = true;
        this.cardNoData = true;
        const requestData = {
            fromDate: this.headerData.date.startDate,
            toDate: this.headerData.date.endDate,
            storeId: this.headerData.stores.filter((store) => store.checked).map((store) => store.storeId),
            userEmailes: this.userEmailes,
            clientId: this.headerData.client,
        };
        this.TraxService.getOverallTasksData(requestData).pipe(takeUntil(this.destroy$)).subscribe((response) => {
            this.cardDataLoading = false;
            if (response?.code === 200 && response?.status === "success") {
                this.overallCardsData = response.data?.cardData?.[0] || {};
                this.cardDataLoading = false;
                this.cardNoData = false;
            }
            else {
                this.overallCardsData = [];
                this.cardDataLoading = false;
                this.cardNoData = true;
            }
        }, error => {
            this.overallCardsData = [];
            this.cardDataLoading = false;
            this.cardNoData = true;
            this.changeDetector.detectChanges();
        });
    }
    getTaskTableData() {
        this.searchDisabled = true;
        this.taskLoading = true;
        this.taskNoData = true;
        const requestData = {
            fromDate: this.headerData?.date?.startDate,
            toDate: this.headerData?.date?.endDate,
            storeId: this.headerData?.stores.filter((store) => store.checked).map((store) => store.storeId),
            userEmailes: this.userEmailes,
            clientId: this.headerData.client,
            limit: this.itemsPerPage,
            offset: this.currentPage - 1,
            sortBy: this.sortDirection,
            sortColumnName: this.sortColumName,
            searchValue: this.searchInput,
            export: false,
            filter: this.priorityType,
            coverage: this.coverageType || [],
            checklistId: this.checklistId
        };
        this.TraxService.getTaskTableData(requestData)
            .pipe(takeUntil(this.destroy$))
            .subscribe((response) => {
            this.taskLoading = false;
            if (response?.code === 200 && response?.status === "success") {
                this.taskTableData = response.data.data || [];
                this.totalItems = response.data.count;
                this.setPaginationSizes();
                this.taskLoading = false;
                this.taskNoData = false;
                this.searchDisabled = false;
            }
            else {
                this.taskTableData = [];
                this.taskLoading = false;
                this.taskNoData = true;
                this.searchDisabled = true;
                if (this.searchInput?.length) {
                    this.searchDisabled = true;
                }
                this.taskTableData = [];
                this.totalItems = 0;
                this.changeDetector.detectChanges();
            }
        }, error => {
            this.taskTableData = [];
            this.changeDetector.detectChanges();
        });
        this.checklistId = "";
    }
    removeQueryParams() {
        const urlWithoutParams = this.location.path().split('?')[0];
        this.location.replaceState(urlWithoutParams);
    }
    setPaginationSizes() {
        if (this.totalItems > 10) {
            this.paginationSizes = [10, 20, 30];
            this.pageSize = this.pageSize;
        }
        else {
            this.paginationSizes = [this.totalItems];
            this.pageSize = this.totalItems;
        }
    }
    onExport() {
        this.currentPage = 1;
        const requestData = {
            fromDate: this.headerData.date.startDate,
            toDate: this.headerData.date.endDate,
            storeId: this.headerData.stores.filter((store) => store.checked).map((store) => store.storeId),
            userEmailes: this.userEmailes,
            clientId: this.headerData.client,
            limit: 10000,
            offset: 0,
            sortBy: this.sortDirection,
            sortColumnName: this.sortColumName,
            searchValue: this.searchInput,
            export: true,
            filter: this.priorityType,
            coverage: this.coverageType || []
        };
        this.TraxService.getTaskTableDataExport(requestData)
            .pipe(takeUntil(this.destroy$))
            .subscribe({
            next: (res) => {
                this.TraxService.saveAsExcelFile(res, 'TaskTable');
            },
            error: (e) => {
                this.toast.getErrorToast('Something went Wrong..');
            }
        });
    }
    searchField() {
        this.headerData.searchValue = this.searchInput;
        this.headerData.export = false;
        this.currentPage = 1;
        this.pageSize = 10;
        this.getTaskTableData();
    }
    sortData(column) {
        if (this.sortColumName === column) {
            this.sortDirection = this.sortDirection === 1 ? -1 : 1;
        }
        else {
            this.sortColumName = column;
            this.sortDirection = 1;
        }
        this.getTaskTableData();
    }
    onPageSizeChange(pageSize) {
        this.currentPage = 1;
        this.itemsPerPage = parseInt(pageSize);
        this.pageSize = parseInt(pageSize);
        this.changeDetector.detectChanges();
        this.getTaskTableData();
    }
    onPageChange(pageOffset) {
        this.currentPage = pageOffset;
        this.getTaskTableData();
    }
    applyFilters(event) {
        if (event?.length) {
            event.forEach((element) => {
                if (element.Description === 'Priority') {
                    this.priorityType = element.Issues.map((val) => val.id);
                }
                if (element.Description === 'Coverage') {
                    this.coverageType = element.Issues.map((val) => val.id) || [];
                }
            });
        }
        else {
            this.priorityType = [];
            this.coverageType = [];
        }
        this.getTaskTableData();
        this.removeQueryParams();
    }
    selectPlan(selectedType) {
        this.type = selectedType;
    }
    taskDelete(id) {
        const requestData = {
            taskId: id
        };
        this.TraxService.getTaskDelete(requestData).pipe(takeUntil(this.destroy$)).subscribe((response) => {
            if (response?.code === 200 && response?.status === "success" && response?.data?.message) {
                this.toast.getSuccessToast(response.data.message);
                this.getTaskTableData();
                // this.toast.getSuccessToast(`Task Deleted successfully.`);
            }
            else {
                this.toast.getErrorToast("Failed to delete the task.");
            }
        }, error => {
            this.toast.getErrorToast("An error occurred while deleting the task.");
            this.changeDetector.detectChanges();
        });
    }
    navigateToTaskConfig(task) {
        this.router.navigate(['manage/trax/task-configure'], { queryParams: { taskId: task._id } });
    }
    navigateToTaskEdit(task) {
        this.router.navigate(['manage/trax/create-task'], { queryParams: { id: task._id } });
    }
    dateFormat(date) {
        return this.dayjs.utc(date).format('DD MMM YYYY');
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TaskComponent, deps: [{ token: i1.ActivatedRoute }, { token: i1.Router }, { token: i2.GlobalStateService }, { token: i0.ChangeDetectorRef }, { token: i3.ToastService }, { token: i4.TraxService }, { token: i2.PageInfoService }, { token: i1.ActivatedRoute }, { token: i5.Location }], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: TaskComponent, selector: "lib-task", ngImport: i0, template: "<div class=\"daterange my-4 d-flex justify-content-between W-100\">\r\n    <!-- <span class=\"mt-3\"> Data for the date range - Jan 06 to Jan 13, 2022 across all stores</span> -->\r\n    <span class=\"mt-3\">Last refreshed at {{reloadDate}}</span>\r\n    <div class=\"nav-group nav-group-outline border-1 btn-group p-0\">\r\n        <button class=\"btn btn-outline\"\r\n        [ngClass]=\"{\r\n            'activePlanBtn': type === 'Checklist',\r\n            'inactivePlanBtn': type !== 'Checklist',\r\n        }\"\r\n            (click)=\"selectPlan('Checklist')\"\r\n            [routerLink]=\"'/manage/trax/dashboard'\"\r\n           >\r\n           Checklist\r\n        </button>\r\n        <button class=\"btn btn-outline px-6 py-3\"\r\n        [ngClass]=\"{\r\n            'activePlanBtn': type === 'Task',\r\n            'inactivePlanBtn': type !== 'Task',\r\n        }\"\r\n            (click)=\"selectPlan('Task')\"\r\n            [routerLink]=\"'/manage/trax/dashboard/task'\">\r\n           Task\r\n        </button>\r\n    </div>\r\n    </div>\r\n<div class=\"col-md-12\">\r\n    <div class=\"row\">\r\n        <div class=\"col-12\">\r\n            <div class=\"card card-border pt-2 h-100\">\r\n                <ng-container>\r\n                    <div class=\"card-header ellipse1 border-0 px-3\">\r\n                        <div class=\"card-title d-flex align-items-start flex-column\">\r\n                            <div class=\"d-flex\">\r\n                                <div class=\"cardcount\">\r\n                                    {{ overallCardsData.TotalTasks?.count ? overallCardsData.TotalTasks?.count.toLocaleString('en-US', {\r\n                                        minimumFractionDigits: 0 }) : '--' }}\r\n                                </div>\r\n                                <div class=\"cardtext mx-3 mt-3\">Total Tasks</div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"card-body p-0\">\r\n                        <div class=\"row g-0 h-100px py-5\">\r\n                            <div class=\"col-12\">\r\n                                <div class=\"row justify-content-between w-100 pt-3\">\r\n                                    <div class=\"col-md-2\">\r\n                                        <div class=\"d-flex flex-column align-items-center\">\r\n                                            <div class=\"cardsubcount\">{{ overallCardsData.open?.count ? overallCardsData.open?.count.toLocaleString('en-US', {\r\n                                                minimumFractionDigits: 0 }) : '--' }}</div>\r\n                                            <div class=\"cardtext \">Open</div>\r\n                                        </div>\r\n                                    </div>\r\n                                    <div class=\"col-md-2\">\r\n                                        <div class=\"d-flex flex-column align-items-center\">\r\n                                            <div class=\"cardsubcount\">{{ overallCardsData.inprogress?.count ? overallCardsData.inprogress?.count.toLocaleString('en-US', {\r\n                                                minimumFractionDigits: 0 }) : '--' }}</div>\r\n                                            <div class=\"cardtext\">Inprogress</div>\r\n                                        </div>\r\n                                    </div>\r\n                                    <div class=\"col-md-2\">\r\n                                        <div class=\"d-flex flex-column align-items-center\">\r\n                                            <div class=\"cardsubcount\">{{ overallCardsData.reopen?.count ? overallCardsData.reopen?.count.toLocaleString('en-US', {\r\n                                                minimumFractionDigits: 0 }) : '--'  }}</div>\r\n                                            <div class=\"cardtext \">Re-Open</div>\r\n                                        </div>\r\n                                    </div>\r\n                                    <div class=\"col-md-2\">\r\n                                        <div class=\"d-flex flex-column align-items-center\">\r\n                                            <div class=\"cardsubcount\">{{ overallCardsData.submitted?.count ? overallCardsData.submitted?.count.toLocaleString('en-US', {\r\n                                                minimumFractionDigits: 0 }) : '--'  }}</div>\r\n                                            <div class=\"cardtext\">Submitted</div>\r\n                                        </div>\r\n                                    </div>\r\n                                    <div class=\"col-md-2\">\r\n                                        <div class=\"d-flex flex-column align-items-center\">\r\n                                            <div class=\"cardsubcount\">{{ overallCardsData.closed?.count ? overallCardsData.closed?.count.toLocaleString('en-US', {\r\n                                                minimumFractionDigits: 0 }) : '--'  }}</div>\r\n                                            <div class=\"cardtext \">Closed</div>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                </ng-container>\r\n            </div>\r\n        </div>\r\n        <div class=\"col-lg-12 mt-4\">\r\n            <div class=\"card\">\r\n            <div class=\"card-header border-0 pt-3\">\r\n                <h3 class=\"card-title align-items-start flex-column\">\r\n                    <span class=\"card-label mb-2\">Task Info <span class=\"badge badge-light-primary\">{{totalItems}} Total</span></span>\r\n                    <span class=\"text-sub mb-2\"> Based on {{ headerData?.date?.startDate | date: 'MMM d' }} - {{\r\n                        headerData?.date?.endDate | date: 'MMM d, y' }}\r\n                    </span>\r\n                </h3>\r\n                <div class=\"card-toolbar\">\r\n                    <div class=\"d-flex\">\r\n                        <div class=\"d-flex align-items-center  position-relative my-1\">\r\n                            <span class=\"svg-icon footfallsearch svg-icon-1 position-absolute  ms-8\">\r\n                                <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"\r\n                                    fill=\"none\">\r\n                                    <rect opacity=\"0.5\" x=\"17.0365\" y=\"15.1223\" width=\"8.15546\" height=\"2\" rx=\"1\"\r\n                                        transform=\"rotate(45 17.0365 15.1223)\" fill=\"currentColor\">\r\n                                    </rect>\r\n                                    <path\r\n                                        d=\"M11 19C6.55556 19 3 15.4444 3 11C3 6.55556 6.55556 3 11 3C15.4444 3 19 6.55556 19 11C19 15.4444 15.4444 19 11 19ZM11 5C7.53333 5 5 7.53333 5 11C5 14.4667 7.53333 17 11 17C14.4667 17 17 14.4667 17 11C17 7.53333 14.4667 5 11 5Z\"\r\n                                        fill=\"currentColor\"></path>\r\n                                </svg>\r\n                            </span>\r\n                            <input [(ngModel)]=\"searchInput\" type=\"text\" class=\"form-control ps-14 mx-2 footfallsearch\"\r\n                                placeholder=\"Search\" autocomplete=\"off\" (keyup.enter)=\"searchField()\" />\r\n                                <lib-filters [dataObject]=\"dataObject\" (appliedFilters)=\"applyFilters($event)\"></lib-filters>\r\n                            <button type=\"button\" (click)=\"onExport()\"\r\n                                class=\"btn-outline btn align-items-end text-nowrap invheader mx-2\"\r\n                                >\r\n                                <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"\r\n                                    fill=\"none\">\r\n                                    <path\r\n                                        d=\"M17.5 12.5V15.8333C17.5 16.2754 17.3244 16.6993 17.0118 17.0118C16.6993 17.3244 16.2754 17.5 15.8333 17.5H4.16667C3.72464 17.5 3.30072 17.3244 2.98816 17.0118C2.67559 16.6993 2.5 16.2754 2.5 15.8333V12.5M14.1667 6.66667L10 2.5M10 2.5L5.83333 6.66667M10 2.5V12.5\"\r\n                                        stroke=\"#344054\" stroke-width=\"1.67\" stroke-linecap=\"round\"\r\n                                        stroke-linejoin=\"round\"></path>\r\n                                </svg>\r\n                                <span class=\"ms-2\"></span> Export\r\n                            </button>\r\n                            <a *ngIf=\"(gs.userAccess | async)?.TangoTrax_Task_isAdd\" routerLink=\"/manage/trax/create-task\" type=\"button\"\r\n                                class=\"btn btn-primary ms-2 rounded-3 text-nowrap ng-star-inserted\" tabindex=\"0\"><svg\r\n                                    xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"\r\n                                    fill=\"none\">\r\n                                    <path d=\"M10.0001 4.16663V15.8333M4.16675 9.99996H15.8334\" stroke=\"white\"\r\n                                        stroke-width=\"1.67\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\r\n                                </svg><span class=\"ms-2 text-white\">Create Task</span></a>\r\n\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n            <div class=\"card-body p-0\">\r\n                <div class=\"table-responsive\">\r\n                    <table *ngIf=\"!taskLoading && !taskNoData\" class=\"table text-nowrap bottom-border\">\r\n                        <thead>\r\n                            <tr>\r\n                                <th>Task Name</th>\r\n                               \r\n                                <!-- <th>Coverage</th> -->\r\n                                <th class=\"cursor-pointer\" (click)=\"sortData('createdByName')\">Created by<svg\r\n                                        [ngClass]=\"sortColumName === 'createdByName' && sortDirection === 1 ? 'rotate' : ''\"\r\n                                        xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\"\r\n                                        fill=\"none\">\r\n                                        <path\r\n                                            d=\"M8.00016 3.33337V12.6667M8.00016 12.6667L12.6668 8.00004M8.00016 12.6667L3.3335 8.00004\"\r\n                                            [attr.stroke]=\"sortColumName === 'createdByName' ? '#00A3FF' : '#667085'\"\r\n                                            stroke-width=\"1.33333\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\r\n                                    </svg>\r\n                                </th>\r\n                                <th>Created On</th>\r\n                                <th>Priority</th>\r\n                                <th class=\"cursor-pointer\" (click)=\"sortData('storeCount')\">Assigned To<svg\r\n                                    [ngClass]=\"sortColumName === 'storeCount' && sortDirection === 1 ? 'rotate' : ''\"\r\n                                    xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\"\r\n                                    fill=\"none\">\r\n                                    <path\r\n                                        d=\"M8.00016 3.33337V12.6667M8.00016 12.6667L12.6668 8.00004M8.00016 12.6667L3.3335 8.00004\"\r\n                                        [attr.stroke]=\"sortColumName === 'storeCount' ? '#00A3FF' : '#667085'\"\r\n                                        stroke-width=\"1.33333\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\r\n                                </svg>\r\n                            </th>\r\n                                <th class=\"cursor-pointer\" (click)=\"sortData('submitCount')\">Submitted<svg\r\n                                        [ngClass]=\"sortColumName === 'submitCount' && sortDirection === 1 ? 'rotate' : ''\"\r\n                                        xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\"\r\n                                        fill=\"none\">\r\n                                        <path\r\n                                            d=\"M8.00016 3.33337V12.6667M8.00016 12.6667L12.6668 8.00004M8.00016 12.6667L3.3335 8.00004\"\r\n                                            [attr.stroke]=\"sortColumName === 'submitCount' ? '#00A3FF' : '#667085'\"\r\n                                            stroke-width=\"1.33333\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\r\n                                    </svg>\r\n                                </th>\r\n                                <th class=\"cursor-pointer\" (click)=\"sortData('redoCount')\">Redo<svg\r\n                                    [ngClass]=\"sortColumName === 'redoCount' && sortDirection === 1 ? 'rotate' : ''\"\r\n                                    xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\"\r\n                                    fill=\"none\">\r\n                                    <path\r\n                                        d=\"M8.00016 3.33337V12.6667M8.00016 12.6667L12.6668 8.00004M8.00016 12.6667L3.3335 8.00004\"\r\n                                        [attr.stroke]=\"sortColumName === 'redoCount' ? '#00A3FF' : '#667085'\"\r\n                                        stroke-width=\"1.33333\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\r\n                                </svg>\r\n                            </th>\r\n                                <th>Due on</th>\r\n                                <th>Action</th>\r\n                            </tr>\r\n                        </thead>\r\n                        <tbody>\r\n                            <tr *ngFor=\"let task of taskTableData\">\r\n                                <td>\r\n                                    <span [routerLink]=\"['/manage/trax/dashboard/taskinfo']\"\r\n                                    [queryParams]=\"{ taskId: task._id,taskName:task.checkListName }\"\r\n                                        class=\"table-title-primary cursor-pointer\"> {{ task.checkListName || '--' }}</span>\r\n                                </td>\r\n                                <td>\r\n                                    <div class=\"symbol symbol-35px symbol-circle\">\r\n                                        <span class=\"symbol-label bg-light-primary text-primary me-2\">\r\n                                            {{ task.checkListChar || '--' }}\r\n                                        </span>\r\n                                    </div>\r\n                                    <span \r\n                                        class=\"table-title\">{{ task.createdByName || '--' }}</span>\r\n                                </td>\r\n                                <td>\r\n                                    <div \r\n                                        class=\"table-title\">{{ task.publishDate | date:\"dd MMM YYYY\" }}</div>\r\n                                </td>\r\n                                <td>\r\n                                    <div class=\"table-title\">{{task.priorityType?.charAt(0)?.toUpperCase() + task.priorityType?.slice(1).toLowerCase() || '--'}}</div>\r\n                                </td>\r\n                                <!-- <td>\r\n                                        <div class=\"table-title\">\r\n                                            Store\r\n                                        </div>  \r\n                                </td> -->\r\n                                <td>\r\n                                    <div  class=\"table-title\">{{ task.storeCount !==null ? task.storeCount?.toLocaleString('en-US', {\r\n                                        minimumFractionDigits: 0 }) :\r\n                                        '--' }}</div>\r\n                                </td>\r\n                                <td>\r\n                                    <div *ngIf=\"task.submitCount; else noDataSubmitted\" [routerLink]=\"['/manage/trax/dashboard/taskinfo']\" [queryParams]=\"{ type: 'task', taskId: task._id,  status: 'submit', taskName:task.checkListName }\" class=\"table-title-primary cursor-pointer\">{{ task.submitCount !==null ? task.submitCount?.toLocaleString('en-US', {\r\n                                        minimumFractionDigits: 0 }) :\r\n                                        '--' }}</div>\r\n                                        <ng-template #noDataSubmitted>\r\n                                            <div class=\"table-title\">--</div>\r\n                                          </ng-template>\r\n                                </td>\r\n                                <td>\r\n                                    <div *ngIf=\"task.redoCount; else noDataRedo\" [routerLink]=\"['/manage/trax/dashboard/taskinfo']\" [queryParams]=\"{ type: 'task', taskId: task._id,  status: 'redo', taskName:task.checkListName }\" class=\"table-title-primary cursor-pointer\">{{ task.redoCount !==null ? task.redoCount?.toLocaleString('en-US', {\r\n                                        minimumFractionDigits: 0 }) :\r\n                                        '--' }}</div>\r\n                                        <ng-template #noDataRedo>\r\n                                            <div class=\"table-title\">--</div>\r\n                                          </ng-template>\r\n                                </td>\r\n                               \r\n                                <td>\r\n                                    <div \r\n                                        class=\"table-title\">{{ dateFormat(task.scheduleEndTime_iso) }}</div>\r\n                                </td>\r\n                                <td>\r\n                                    <!-- (click)=\"navigateToTaskConfig(task)\" -->\r\n                                    <div class=\"d-flex\">\r\n                                    <a *ngIf=\"(gs.userAccess | async)?.TangoTrax_Task_isEdit\"  [routerLink]=\"['/manage/trax/dashboard/taskinfo']\"\r\n                                    [queryParams]=\"{ taskId: task._id,taskName:task.checkListName}\"  class=\"cursor-pointer table-title\">\r\n                                        <span>\r\n                                            <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\r\n                                                <path d=\"M0.832031 9.99992C0.832031 9.99992 4.16536 3.33325 9.9987 3.33325C15.832 3.33325 19.1654 9.99992 19.1654 9.99992C19.1654 9.99992 15.832 16.6666 9.9987 16.6666C4.16536 16.6666 0.832031 9.99992 0.832031 9.99992Z\" stroke=\"#667085\" stroke-width=\"1.66667\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n                                                <path d=\"M9.9987 12.4999C11.3794 12.4999 12.4987 11.3806 12.4987 9.99992C12.4987 8.61921 11.3794 7.49992 9.9987 7.49992C8.61799 7.49992 7.4987 8.61921 7.4987 9.99992C7.4987 11.3806 8.61799 12.4999 9.9987 12.4999Z\" stroke=\"#667085\" stroke-width=\"1.66667\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n                                                </svg>\r\n                                        </span></a>\r\n                                        <!-- <a *ngIf=\"(gs.userAccess | async)?.TangoTrax_Task_isEdit\" (click)=\"navigateToTaskEdit(task)\" class=\"cursor-pointer ms-6 table-title\">\r\n                                        <span>\r\n                                            <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\r\n                                                <g clip-path=\"url(#clip0_5271_17556)\">\r\n                                                <path d=\"M14.168 2.49993C14.3868 2.28106 14.6467 2.10744 14.9326 1.98899C15.2186 1.87054 15.5251 1.80957 15.8346 1.80957C16.1442 1.80957 16.4507 1.87054 16.7366 1.98899C17.0226 2.10744 17.2824 2.28106 17.5013 2.49993C17.7202 2.7188 17.8938 2.97863 18.0122 3.2646C18.1307 3.55057 18.1917 3.85706 18.1917 4.16659C18.1917 4.47612 18.1307 4.78262 18.0122 5.06859C17.8938 5.35455 17.7202 5.61439 17.5013 5.83326L6.2513 17.0833L1.66797 18.3333L2.91797 13.7499L14.168 2.49993Z\" stroke=\"#667085\" stroke-width=\"1.66667\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n                                                </g>\r\n                                                <defs>\r\n                                                <clipPath id=\"clip0_5271_17556\">\r\n                                                <rect width=\"20\" height=\"20\" fill=\"white\"/>\r\n                                                </clipPath>\r\n                                                </defs>\r\n                                                </svg>\r\n                                        </span></a>  \r\n                                        <a *ngIf=\"(gs.userAccess | async)?.TangoTrax_Task_isEdit\" (click)=\"taskDelete(task._id)\" class=\"cursor-pointer ms-6 table-title\">\r\n                                            <span>\r\n                                                <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\r\n                                                    <path d=\"M2.5 5.00008H4.16667M4.16667 5.00008H17.5M4.16667 5.00008V16.6667C4.16667 17.1088 4.34226 17.5327 4.65482 17.8453C4.96738 18.1578 5.39131 18.3334 5.83333 18.3334H14.1667C14.6087 18.3334 15.0326 18.1578 15.3452 17.8453C15.6577 17.5327 15.8333 17.1088 15.8333 16.6667V5.00008H4.16667ZM6.66667 5.00008V3.33341C6.66667 2.89139 6.84226 2.46746 7.15482 2.1549C7.46738 1.84234 7.89131 1.66675 8.33333 1.66675H11.6667C12.1087 1.66675 12.5326 1.84234 12.8452 2.1549C13.1577 2.46746 13.3333 2.89139 13.3333 3.33341V5.00008M8.33333 9.16675V14.1667M11.6667 9.16675V14.1667\" stroke=\"#667085\" stroke-width=\"1.66667\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n                                                    </svg>\r\n                                            </span></a>   -->\r\n                                    </div>\r\n                                </td>\r\n                            </tr>\r\n                        </tbody>\r\n                    </table>\r\n\r\n                    <ng-container *ngIf=\"taskLoading\">\r\n                        <div class=\"row loader  d-flex justify-content-center align-items-center\">\r\n                            <div class=\"shimmer\">\r\n                                <div class=\"wrapper\">\r\n                                    <div class=\"stroke animate title\"></div>\r\n                                    <div class=\"stroke animate link\"></div>\r\n                                    <div class=\"stroke animate description\"></div>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"shimmer\">\r\n                                <div class=\"wrapper\">\r\n                                    <div class=\"stroke animate title\"></div>\r\n                                    <div class=\"stroke animate link\"></div>\r\n                                    <div class=\"stroke animate description\"></div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </ng-container>\r\n                    <ng-container *ngIf=\"taskNoData && !taskLoading\">\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-12 my-6\">\r\n                                <div class=\"card-body d-flex justify-content-center align-items-center flex-column\">\r\n                                    <img class=\"img-src\" src=\"./assets/tango/Icons/Nodata1.svg\" alt=\"\">\r\n                                    <div class=\"nodatamaintext mt-3\">No data found</div>\r\n                                    <div class=\"nodatasubtext\">There is no result for Task Info</div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </ng-container>\r\n\r\n                </div>\r\n                <div *ngIf=\"!taskLoading && !taskNoData\">\r\n                    <lib-pagination class=\"text-start\" [itemsPerPage]=\"itemsPerPage\" [currentPage]=\"currentPage\"\r\n                        [totalItems]=\"totalItems\" [paginationSizes]=\"paginationSizes\" [pageSize]=\"pageSize\"\r\n                        (pageChange)=\"onPageChange($event)\"\r\n                        (pageSizeChange)=\"onPageSizeChange($event)\"></lib-pagination>\r\n                </div>\r\n            </div>\r\n        </div>\r\n        </div>\r\n    </div>", styles: [".ellipse1{border-radius:6px;border-bottom:2px solid var(--Gray-200, #EAECF0);background:radial-gradient(206.89% 107.47% at 16.16% 32.77%,#fff6,#45bbfe33),#f2f4f7;box-shadow:0 4px 10px #0000000d}.cardcount{color:var(--Black, #101828);font-size:30px;font-style:normal;font-weight:600;line-height:38px}.cardtext{color:var(--Gray-700, #344054);font-size:14px;font-style:normal;font-weight:500;line-height:20px}.cardsubcount{color:var(--Black, #101828);font-size:20px;font-style:normal;font-weight:700;line-height:30px}.card-border{padding:8px;border-radius:12px;border:1px solid var(--Gray-300, #D0D5DD);background:var(--White, #FFF)}.table-title{color:var(--Gray-500, #667085);font-size:14px;font-style:normal;font-weight:500;line-height:20px}.table-title-primary{color:var(--Primary-700, #009BF3)!important;font-size:14px;font-style:normal;font-weight:500;line-height:20px;text-decoration-line:underline}.card .card-header{padding:0px 1.5rem}.nav-group-outline{border-radius:8px;border:1px solid var(--Primary-300, #6BCAFF);box-shadow:0 1px 2px #1018280d}.nav-group .btn.activePlanBtn{border-right:1px solid var(--Primary-300, #6BCAFF);background:var(--Primary-600, #00A3FF);color:#fff}.nav-group .btn.inactivePlanBtn{background-color:#fff;color:#333;border:1px solid #dcdcdc}.daterange{color:var(--Gray-500, #667085);font-size:16px;font-style:normal;font-weight:600;line-height:24px}.nodatamaintext{font-family:Inter;font-size:16px;font-weight:600;line-height:24px;text-align:center;color:#101828}.nodatasubtext{font-family:Inter;font-size:14px;font-weight:400;line-height:20px;text-align:center;color:#667085}.rotate{transform:rotate(180deg)}.loader .title{width:65%}.loader .link{width:85%}.loader .description{width:95%}.loader .shimmer{padding:15px;width:95%;height:120px;margin:10px auto;background:#fff}.loader .shimmer .image-card{height:90px;width:90px;float:right;border-radius:8px}.loader .stroke{height:15px;background:#777;margin-top:20px}.loader .wrapper{width:0px;animation:fullView .5s forwards linear}@keyframes fullView{to{width:100%}}.loader .animate{animation:shimmer 3s;animation-iteration-count:infinite;background:linear-gradient(to right,#e6e6e6 5%,#ccc 25%,#e6e6e6 35%);background-size:1000px 100%}@keyframes shimmer{0%{background-position:-1000px 0}to{background-position:1000px 0}}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i3.PaginationComponent, selector: "lib-pagination", inputs: ["collection", "itemsPerPage", "currentPage", "totalItems", "directionLinks", "pageSize", "paginationSizes"], outputs: ["pageChange", "pageSizeChange"] }, { kind: "component", type: i3.FiltersComponent, selector: "lib-filters", inputs: ["dataObject"], outputs: ["appliedFilters"] }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }, { kind: "pipe", type: i5.DatePipe, name: "date" }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TaskComponent, decorators: [{
            type: Component,
            args: [{ selector: 'lib-task', template: "<div class=\"daterange my-4 d-flex justify-content-between W-100\">\r\n    <!-- <span class=\"mt-3\"> Data for the date range - Jan 06 to Jan 13, 2022 across all stores</span> -->\r\n    <span class=\"mt-3\">Last refreshed at {{reloadDate}}</span>\r\n    <div class=\"nav-group nav-group-outline border-1 btn-group p-0\">\r\n        <button class=\"btn btn-outline\"\r\n        [ngClass]=\"{\r\n            'activePlanBtn': type === 'Checklist',\r\n            'inactivePlanBtn': type !== 'Checklist',\r\n        }\"\r\n            (click)=\"selectPlan('Checklist')\"\r\n            [routerLink]=\"'/manage/trax/dashboard'\"\r\n           >\r\n           Checklist\r\n        </button>\r\n        <button class=\"btn btn-outline px-6 py-3\"\r\n        [ngClass]=\"{\r\n            'activePlanBtn': type === 'Task',\r\n            'inactivePlanBtn': type !== 'Task',\r\n        }\"\r\n            (click)=\"selectPlan('Task')\"\r\n            [routerLink]=\"'/manage/trax/dashboard/task'\">\r\n           Task\r\n        </button>\r\n    </div>\r\n    </div>\r\n<div class=\"col-md-12\">\r\n    <div class=\"row\">\r\n        <div class=\"col-12\">\r\n            <div class=\"card card-border pt-2 h-100\">\r\n                <ng-container>\r\n                    <div class=\"card-header ellipse1 border-0 px-3\">\r\n                        <div class=\"card-title d-flex align-items-start flex-column\">\r\n                            <div class=\"d-flex\">\r\n                                <div class=\"cardcount\">\r\n                                    {{ overallCardsData.TotalTasks?.count ? overallCardsData.TotalTasks?.count.toLocaleString('en-US', {\r\n                                        minimumFractionDigits: 0 }) : '--' }}\r\n                                </div>\r\n                                <div class=\"cardtext mx-3 mt-3\">Total Tasks</div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"card-body p-0\">\r\n                        <div class=\"row g-0 h-100px py-5\">\r\n                            <div class=\"col-12\">\r\n                                <div class=\"row justify-content-between w-100 pt-3\">\r\n                                    <div class=\"col-md-2\">\r\n                                        <div class=\"d-flex flex-column align-items-center\">\r\n                                            <div class=\"cardsubcount\">{{ overallCardsData.open?.count ? overallCardsData.open?.count.toLocaleString('en-US', {\r\n                                                minimumFractionDigits: 0 }) : '--' }}</div>\r\n                                            <div class=\"cardtext \">Open</div>\r\n                                        </div>\r\n                                    </div>\r\n                                    <div class=\"col-md-2\">\r\n                                        <div class=\"d-flex flex-column align-items-center\">\r\n                                            <div class=\"cardsubcount\">{{ overallCardsData.inprogress?.count ? overallCardsData.inprogress?.count.toLocaleString('en-US', {\r\n                                                minimumFractionDigits: 0 }) : '--' }}</div>\r\n                                            <div class=\"cardtext\">Inprogress</div>\r\n                                        </div>\r\n                                    </div>\r\n                                    <div class=\"col-md-2\">\r\n                                        <div class=\"d-flex flex-column align-items-center\">\r\n                                            <div class=\"cardsubcount\">{{ overallCardsData.reopen?.count ? overallCardsData.reopen?.count.toLocaleString('en-US', {\r\n                                                minimumFractionDigits: 0 }) : '--'  }}</div>\r\n                                            <div class=\"cardtext \">Re-Open</div>\r\n                                        </div>\r\n                                    </div>\r\n                                    <div class=\"col-md-2\">\r\n                                        <div class=\"d-flex flex-column align-items-center\">\r\n                                            <div class=\"cardsubcount\">{{ overallCardsData.submitted?.count ? overallCardsData.submitted?.count.toLocaleString('en-US', {\r\n                                                minimumFractionDigits: 0 }) : '--'  }}</div>\r\n                                            <div class=\"cardtext\">Submitted</div>\r\n                                        </div>\r\n                                    </div>\r\n                                    <div class=\"col-md-2\">\r\n                                        <div class=\"d-flex flex-column align-items-center\">\r\n                                            <div class=\"cardsubcount\">{{ overallCardsData.closed?.count ? overallCardsData.closed?.count.toLocaleString('en-US', {\r\n                                                minimumFractionDigits: 0 }) : '--'  }}</div>\r\n                                            <div class=\"cardtext \">Closed</div>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                </ng-container>\r\n            </div>\r\n        </div>\r\n        <div class=\"col-lg-12 mt-4\">\r\n            <div class=\"card\">\r\n            <div class=\"card-header border-0 pt-3\">\r\n                <h3 class=\"card-title align-items-start flex-column\">\r\n                    <span class=\"card-label mb-2\">Task Info <span class=\"badge badge-light-primary\">{{totalItems}} Total</span></span>\r\n                    <span class=\"text-sub mb-2\"> Based on {{ headerData?.date?.startDate | date: 'MMM d' }} - {{\r\n                        headerData?.date?.endDate | date: 'MMM d, y' }}\r\n                    </span>\r\n                </h3>\r\n                <div class=\"card-toolbar\">\r\n                    <div class=\"d-flex\">\r\n                        <div class=\"d-flex align-items-center  position-relative my-1\">\r\n                            <span class=\"svg-icon footfallsearch svg-icon-1 position-absolute  ms-8\">\r\n                                <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"\r\n                                    fill=\"none\">\r\n                                    <rect opacity=\"0.5\" x=\"17.0365\" y=\"15.1223\" width=\"8.15546\" height=\"2\" rx=\"1\"\r\n                                        transform=\"rotate(45 17.0365 15.1223)\" fill=\"currentColor\">\r\n                                    </rect>\r\n                                    <path\r\n                                        d=\"M11 19C6.55556 19 3 15.4444 3 11C3 6.55556 6.55556 3 11 3C15.4444 3 19 6.55556 19 11C19 15.4444 15.4444 19 11 19ZM11 5C7.53333 5 5 7.53333 5 11C5 14.4667 7.53333 17 11 17C14.4667 17 17 14.4667 17 11C17 7.53333 14.4667 5 11 5Z\"\r\n                                        fill=\"currentColor\"></path>\r\n                                </svg>\r\n                            </span>\r\n                            <input [(ngModel)]=\"searchInput\" type=\"text\" class=\"form-control ps-14 mx-2 footfallsearch\"\r\n                                placeholder=\"Search\" autocomplete=\"off\" (keyup.enter)=\"searchField()\" />\r\n                                <lib-filters [dataObject]=\"dataObject\" (appliedFilters)=\"applyFilters($event)\"></lib-filters>\r\n                            <button type=\"button\" (click)=\"onExport()\"\r\n                                class=\"btn-outline btn align-items-end text-nowrap invheader mx-2\"\r\n                                >\r\n                                <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"\r\n                                    fill=\"none\">\r\n                                    <path\r\n                                        d=\"M17.5 12.5V15.8333C17.5 16.2754 17.3244 16.6993 17.0118 17.0118C16.6993 17.3244 16.2754 17.5 15.8333 17.5H4.16667C3.72464 17.5 3.30072 17.3244 2.98816 17.0118C2.67559 16.6993 2.5 16.2754 2.5 15.8333V12.5M14.1667 6.66667L10 2.5M10 2.5L5.83333 6.66667M10 2.5V12.5\"\r\n                                        stroke=\"#344054\" stroke-width=\"1.67\" stroke-linecap=\"round\"\r\n                                        stroke-linejoin=\"round\"></path>\r\n                                </svg>\r\n                                <span class=\"ms-2\"></span> Export\r\n                            </button>\r\n                            <a *ngIf=\"(gs.userAccess | async)?.TangoTrax_Task_isAdd\" routerLink=\"/manage/trax/create-task\" type=\"button\"\r\n                                class=\"btn btn-primary ms-2 rounded-3 text-nowrap ng-star-inserted\" tabindex=\"0\"><svg\r\n                                    xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"\r\n                                    fill=\"none\">\r\n                                    <path d=\"M10.0001 4.16663V15.8333M4.16675 9.99996H15.8334\" stroke=\"white\"\r\n                                        stroke-width=\"1.67\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\r\n                                </svg><span class=\"ms-2 text-white\">Create Task</span></a>\r\n\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n            <div class=\"card-body p-0\">\r\n                <div class=\"table-responsive\">\r\n                    <table *ngIf=\"!taskLoading && !taskNoData\" class=\"table text-nowrap bottom-border\">\r\n                        <thead>\r\n                            <tr>\r\n                                <th>Task Name</th>\r\n                               \r\n                                <!-- <th>Coverage</th> -->\r\n                                <th class=\"cursor-pointer\" (click)=\"sortData('createdByName')\">Created by<svg\r\n                                        [ngClass]=\"sortColumName === 'createdByName' && sortDirection === 1 ? 'rotate' : ''\"\r\n                                        xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\"\r\n                                        fill=\"none\">\r\n                                        <path\r\n                                            d=\"M8.00016 3.33337V12.6667M8.00016 12.6667L12.6668 8.00004M8.00016 12.6667L3.3335 8.00004\"\r\n                                            [attr.stroke]=\"sortColumName === 'createdByName' ? '#00A3FF' : '#667085'\"\r\n                                            stroke-width=\"1.33333\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\r\n                                    </svg>\r\n                                </th>\r\n                                <th>Created On</th>\r\n                                <th>Priority</th>\r\n                                <th class=\"cursor-pointer\" (click)=\"sortData('storeCount')\">Assigned To<svg\r\n                                    [ngClass]=\"sortColumName === 'storeCount' && sortDirection === 1 ? 'rotate' : ''\"\r\n                                    xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\"\r\n                                    fill=\"none\">\r\n                                    <path\r\n                                        d=\"M8.00016 3.33337V12.6667M8.00016 12.6667L12.6668 8.00004M8.00016 12.6667L3.3335 8.00004\"\r\n                                        [attr.stroke]=\"sortColumName === 'storeCount' ? '#00A3FF' : '#667085'\"\r\n                                        stroke-width=\"1.33333\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\r\n                                </svg>\r\n                            </th>\r\n                                <th class=\"cursor-pointer\" (click)=\"sortData('submitCount')\">Submitted<svg\r\n                                        [ngClass]=\"sortColumName === 'submitCount' && sortDirection === 1 ? 'rotate' : ''\"\r\n                                        xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\"\r\n                                        fill=\"none\">\r\n                                        <path\r\n                                            d=\"M8.00016 3.33337V12.6667M8.00016 12.6667L12.6668 8.00004M8.00016 12.6667L3.3335 8.00004\"\r\n                                            [attr.stroke]=\"sortColumName === 'submitCount' ? '#00A3FF' : '#667085'\"\r\n                                            stroke-width=\"1.33333\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\r\n                                    </svg>\r\n                                </th>\r\n                                <th class=\"cursor-pointer\" (click)=\"sortData('redoCount')\">Redo<svg\r\n                                    [ngClass]=\"sortColumName === 'redoCount' && sortDirection === 1 ? 'rotate' : ''\"\r\n                                    xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\"\r\n                                    fill=\"none\">\r\n                                    <path\r\n                                        d=\"M8.00016 3.33337V12.6667M8.00016 12.6667L12.6668 8.00004M8.00016 12.6667L3.3335 8.00004\"\r\n                                        [attr.stroke]=\"sortColumName === 'redoCount' ? '#00A3FF' : '#667085'\"\r\n                                        stroke-width=\"1.33333\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\r\n                                </svg>\r\n                            </th>\r\n                                <th>Due on</th>\r\n                                <th>Action</th>\r\n                            </tr>\r\n                        </thead>\r\n                        <tbody>\r\n                            <tr *ngFor=\"let task of taskTableData\">\r\n                                <td>\r\n                                    <span [routerLink]=\"['/manage/trax/dashboard/taskinfo']\"\r\n                                    [queryParams]=\"{ taskId: task._id,taskName:task.checkListName }\"\r\n                                        class=\"table-title-primary cursor-pointer\"> {{ task.checkListName || '--' }}</span>\r\n                                </td>\r\n                                <td>\r\n                                    <div class=\"symbol symbol-35px symbol-circle\">\r\n                                        <span class=\"symbol-label bg-light-primary text-primary me-2\">\r\n                                            {{ task.checkListChar || '--' }}\r\n                                        </span>\r\n                                    </div>\r\n                                    <span \r\n                                        class=\"table-title\">{{ task.createdByName || '--' }}</span>\r\n                                </td>\r\n                                <td>\r\n                                    <div \r\n                                        class=\"table-title\">{{ task.publishDate | date:\"dd MMM YYYY\" }}</div>\r\n                                </td>\r\n                                <td>\r\n                                    <div class=\"table-title\">{{task.priorityType?.charAt(0)?.toUpperCase() + task.priorityType?.slice(1).toLowerCase() || '--'}}</div>\r\n                                </td>\r\n                                <!-- <td>\r\n                                        <div class=\"table-title\">\r\n                                            Store\r\n                                        </div>  \r\n                                </td> -->\r\n                                <td>\r\n                                    <div  class=\"table-title\">{{ task.storeCount !==null ? task.storeCount?.toLocaleString('en-US', {\r\n                                        minimumFractionDigits: 0 }) :\r\n                                        '--' }}</div>\r\n                                </td>\r\n                                <td>\r\n                                    <div *ngIf=\"task.submitCount; else noDataSubmitted\" [routerLink]=\"['/manage/trax/dashboard/taskinfo']\" [queryParams]=\"{ type: 'task', taskId: task._id,  status: 'submit', taskName:task.checkListName }\" class=\"table-title-primary cursor-pointer\">{{ task.submitCount !==null ? task.submitCount?.toLocaleString('en-US', {\r\n                                        minimumFractionDigits: 0 }) :\r\n                                        '--' }}</div>\r\n                                        <ng-template #noDataSubmitted>\r\n                                            <div class=\"table-title\">--</div>\r\n                                          </ng-template>\r\n                                </td>\r\n                                <td>\r\n                                    <div *ngIf=\"task.redoCount; else noDataRedo\" [routerLink]=\"['/manage/trax/dashboard/taskinfo']\" [queryParams]=\"{ type: 'task', taskId: task._id,  status: 'redo', taskName:task.checkListName }\" class=\"table-title-primary cursor-pointer\">{{ task.redoCount !==null ? task.redoCount?.toLocaleString('en-US', {\r\n                                        minimumFractionDigits: 0 }) :\r\n                                        '--' }}</div>\r\n                                        <ng-template #noDataRedo>\r\n                                            <div class=\"table-title\">--</div>\r\n                                          </ng-template>\r\n                                </td>\r\n                               \r\n                                <td>\r\n                                    <div \r\n                                        class=\"table-title\">{{ dateFormat(task.scheduleEndTime_iso) }}</div>\r\n                                </td>\r\n                                <td>\r\n                                    <!-- (click)=\"navigateToTaskConfig(task)\" -->\r\n                                    <div class=\"d-flex\">\r\n                                    <a *ngIf=\"(gs.userAccess | async)?.TangoTrax_Task_isEdit\"  [routerLink]=\"['/manage/trax/dashboard/taskinfo']\"\r\n                                    [queryParams]=\"{ taskId: task._id,taskName:task.checkListName}\"  class=\"cursor-pointer table-title\">\r\n                                        <span>\r\n                                            <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\r\n                                                <path d=\"M0.832031 9.99992C0.832031 9.99992 4.16536 3.33325 9.9987 3.33325C15.832 3.33325 19.1654 9.99992 19.1654 9.99992C19.1654 9.99992 15.832 16.6666 9.9987 16.6666C4.16536 16.6666 0.832031 9.99992 0.832031 9.99992Z\" stroke=\"#667085\" stroke-width=\"1.66667\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n                                                <path d=\"M9.9987 12.4999C11.3794 12.4999 12.4987 11.3806 12.4987 9.99992C12.4987 8.61921 11.3794 7.49992 9.9987 7.49992C8.61799 7.49992 7.4987 8.61921 7.4987 9.99992C7.4987 11.3806 8.61799 12.4999 9.9987 12.4999Z\" stroke=\"#667085\" stroke-width=\"1.66667\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n                                                </svg>\r\n                                        </span></a>\r\n                                        <!-- <a *ngIf=\"(gs.userAccess | async)?.TangoTrax_Task_isEdit\" (click)=\"navigateToTaskEdit(task)\" class=\"cursor-pointer ms-6 table-title\">\r\n                                        <span>\r\n                                            <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\r\n                                                <g clip-path=\"url(#clip0_5271_17556)\">\r\n                                                <path d=\"M14.168 2.49993C14.3868 2.28106 14.6467 2.10744 14.9326 1.98899C15.2186 1.87054 15.5251 1.80957 15.8346 1.80957C16.1442 1.80957 16.4507 1.87054 16.7366 1.98899C17.0226 2.10744 17.2824 2.28106 17.5013 2.49993C17.7202 2.7188 17.8938 2.97863 18.0122 3.2646C18.1307 3.55057 18.1917 3.85706 18.1917 4.16659C18.1917 4.47612 18.1307 4.78262 18.0122 5.06859C17.8938 5.35455 17.7202 5.61439 17.5013 5.83326L6.2513 17.0833L1.66797 18.3333L2.91797 13.7499L14.168 2.49993Z\" stroke=\"#667085\" stroke-width=\"1.66667\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n                                                </g>\r\n                                                <defs>\r\n                                                <clipPath id=\"clip0_5271_17556\">\r\n                                                <rect width=\"20\" height=\"20\" fill=\"white\"/>\r\n                                                </clipPath>\r\n                                                </defs>\r\n                                                </svg>\r\n                                        </span></a>  \r\n                                        <a *ngIf=\"(gs.userAccess | async)?.TangoTrax_Task_isEdit\" (click)=\"taskDelete(task._id)\" class=\"cursor-pointer ms-6 table-title\">\r\n                                            <span>\r\n                                                <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\r\n                                                    <path d=\"M2.5 5.00008H4.16667M4.16667 5.00008H17.5M4.16667 5.00008V16.6667C4.16667 17.1088 4.34226 17.5327 4.65482 17.8453C4.96738 18.1578 5.39131 18.3334 5.83333 18.3334H14.1667C14.6087 18.3334 15.0326 18.1578 15.3452 17.8453C15.6577 17.5327 15.8333 17.1088 15.8333 16.6667V5.00008H4.16667ZM6.66667 5.00008V3.33341C6.66667 2.89139 6.84226 2.46746 7.15482 2.1549C7.46738 1.84234 7.89131 1.66675 8.33333 1.66675H11.6667C12.1087 1.66675 12.5326 1.84234 12.8452 2.1549C13.1577 2.46746 13.3333 2.89139 13.3333 3.33341V5.00008M8.33333 9.16675V14.1667M11.6667 9.16675V14.1667\" stroke=\"#667085\" stroke-width=\"1.66667\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n                                                    </svg>\r\n                                            </span></a>   -->\r\n                                    </div>\r\n                                </td>\r\n                            </tr>\r\n                        </tbody>\r\n                    </table>\r\n\r\n                    <ng-container *ngIf=\"taskLoading\">\r\n                        <div class=\"row loader  d-flex justify-content-center align-items-center\">\r\n                            <div class=\"shimmer\">\r\n                                <div class=\"wrapper\">\r\n                                    <div class=\"stroke animate title\"></div>\r\n                                    <div class=\"stroke animate link\"></div>\r\n                                    <div class=\"stroke animate description\"></div>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"shimmer\">\r\n                                <div class=\"wrapper\">\r\n                                    <div class=\"stroke animate title\"></div>\r\n                                    <div class=\"stroke animate link\"></div>\r\n                                    <div class=\"stroke animate description\"></div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </ng-container>\r\n                    <ng-container *ngIf=\"taskNoData && !taskLoading\">\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-12 my-6\">\r\n                                <div class=\"card-body d-flex justify-content-center align-items-center flex-column\">\r\n                                    <img class=\"img-src\" src=\"./assets/tango/Icons/Nodata1.svg\" alt=\"\">\r\n                                    <div class=\"nodatamaintext mt-3\">No data found</div>\r\n                                    <div class=\"nodatasubtext\">There is no result for Task Info</div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </ng-container>\r\n\r\n                </div>\r\n                <div *ngIf=\"!taskLoading && !taskNoData\">\r\n                    <lib-pagination class=\"text-start\" [itemsPerPage]=\"itemsPerPage\" [currentPage]=\"currentPage\"\r\n                        [totalItems]=\"totalItems\" [paginationSizes]=\"paginationSizes\" [pageSize]=\"pageSize\"\r\n                        (pageChange)=\"onPageChange($event)\"\r\n                        (pageSizeChange)=\"onPageSizeChange($event)\"></lib-pagination>\r\n                </div>\r\n            </div>\r\n        </div>\r\n        </div>\r\n    </div>", styles: [".ellipse1{border-radius:6px;border-bottom:2px solid var(--Gray-200, #EAECF0);background:radial-gradient(206.89% 107.47% at 16.16% 32.77%,#fff6,#45bbfe33),#f2f4f7;box-shadow:0 4px 10px #0000000d}.cardcount{color:var(--Black, #101828);font-size:30px;font-style:normal;font-weight:600;line-height:38px}.cardtext{color:var(--Gray-700, #344054);font-size:14px;font-style:normal;font-weight:500;line-height:20px}.cardsubcount{color:var(--Black, #101828);font-size:20px;font-style:normal;font-weight:700;line-height:30px}.card-border{padding:8px;border-radius:12px;border:1px solid var(--Gray-300, #D0D5DD);background:var(--White, #FFF)}.table-title{color:var(--Gray-500, #667085);font-size:14px;font-style:normal;font-weight:500;line-height:20px}.table-title-primary{color:var(--Primary-700, #009BF3)!important;font-size:14px;font-style:normal;font-weight:500;line-height:20px;text-decoration-line:underline}.card .card-header{padding:0px 1.5rem}.nav-group-outline{border-radius:8px;border:1px solid var(--Primary-300, #6BCAFF);box-shadow:0 1px 2px #1018280d}.nav-group .btn.activePlanBtn{border-right:1px solid var(--Primary-300, #6BCAFF);background:var(--Primary-600, #00A3FF);color:#fff}.nav-group .btn.inactivePlanBtn{background-color:#fff;color:#333;border:1px solid #dcdcdc}.daterange{color:var(--Gray-500, #667085);font-size:16px;font-style:normal;font-weight:600;line-height:24px}.nodatamaintext{font-family:Inter;font-size:16px;font-weight:600;line-height:24px;text-align:center;color:#101828}.nodatasubtext{font-family:Inter;font-size:14px;font-weight:400;line-height:20px;text-align:center;color:#667085}.rotate{transform:rotate(180deg)}.loader .title{width:65%}.loader .link{width:85%}.loader .description{width:95%}.loader .shimmer{padding:15px;width:95%;height:120px;margin:10px auto;background:#fff}.loader .shimmer .image-card{height:90px;width:90px;float:right;border-radius:8px}.loader .stroke{height:15px;background:#777;margin-top:20px}.loader .wrapper{width:0px;animation:fullView .5s forwards linear}@keyframes fullView{to{width:100%}}.loader .animate{animation:shimmer 3s;animation-iteration-count:infinite;background:linear-gradient(to right,#e6e6e6 5%,#ccc 25%,#e6e6e6 35%);background-size:1000px 100%}@keyframes shimmer{0%{background-position:-1000px 0}to{background-position:1000px 0}}\n"] }]
        }], ctorParameters: () => [{ type: i1.ActivatedRoute }, { type: i1.Router }, { type: i2.GlobalStateService }, { type: i0.ChangeDetectorRef }, { type: i3.ToastService }, { type: i4.TraxService }, { type: i2.PageInfoService }, { type: i1.ActivatedRoute }, { type: i5.Location }] });
//# sourceMappingURL=data:application/json;base64, 