import { Component, Input, Output, EventEmitter, } from '@angular/core';
import moment from 'moment/moment';
import * as i0 from "@angular/core";
import * as i1 from "../frequency.service";
import * as i2 from "../../../ui-kit/snack-bar/snack-bar.service";
import * as i3 from "@angular/common";
import * as i4 from "../../floating-bar/floating-bar.component";
import * as i5 from "../frequency-daily/frequency-daily.component";
import * as i6 from "../frequency-weekly/frequency-weekly.component";
import * as i7 from "../frequency-monthly/frequency-monthly.component";
import * as i8 from "../frequency-quarterly/frequency-quarterly.component";
import * as i9 from "../frequency-biannual/frequency-biannual.component";
import * as i10 from "../frequency-annual/frequency-annual.component";
import * as i11 from "../frequency-one-time/frequency-one-time.component";
import * as i12 from "../frequency-random/frequency-random.component";
import * as i13 from "../frequency-on-completion-of/frequency-on-completion-of.component";
import * as i14 from "../frequency-ongoing/frequency-ongoing.component";
export class FrequencyContainerComponent {
    constructor(frequencyService, snackbar) {
        this.frequencyService = frequencyService;
        this.snackbar = snackbar;
        this.frequencyTab = 'daily';
        this.currentTabName = 'a Daily';
        this.selectedFrequency = new EventEmitter();
        this.closeFrequency = new EventEmitter();
        this.mode = '';
        this.pageType = 'responsibility';
        this.frequencyList = [
            {
                name: 'Daily',
                type: 'daily',
            },
            {
                name: 'Weekly',
                type: 'weekly',
            },
            {
                name: 'Monthly',
                type: 'monthly',
            },
            {
                name: 'Quarterly',
                type: 'quarterly',
            },
            {
                name: 'Biannual',
                type: 'biannual',
            },
            {
                name: 'Annual',
                type: 'annual',
            },
            {
                name: 'One Time',
                type: 'oneTime',
            },
            {
                name: 'Random',
                type: 'random',
            },
            {
                name: 'On Completion Of',
                type: 'onCompletionOf',
            },
            {
                name: 'Ongoing',
                type: 'ongoing',
            },
        ];
        this.isNextDisabled = false;
        this.openedRadioForm = false;
    }
    ngOnInit() {
        this.featureFlag_on_completion_of = this.feature.isFeatureEnabled('ff_frequency_on_completion_of');
        if (this.frequencyDetails.pattern != '') {
            this.populateFrequency();
        }
        const hideElements = ['random', 'onCompletionOf', 'ongoing'];
        if (this.mode == 'policy') {
            hideElements.forEach((element) => {
                const index = this.frequencyList.findIndex((elementIndex) => elementIndex.type == element);
                this.frequencyList.splice(index, 1);
            });
        }
        const hideElements2 = ['daily', 'random', 'onCompletionOf', 'ongoing'];
        if (this.mode == 'reviewerFrequency') {
            this.frequencyTab =
                this.frequencyDetails?.pattern == '' ? 'weekly' : this.frequencyTab;
            this.currentTabName =
                this.frequencyDetails?.pattern == '' ? 'a weekly' : this.currentTabName;
            hideElements2.forEach((element) => {
                const index = this.frequencyList.findIndex((elementIndex) => elementIndex.type == element);
                this.frequencyList.splice(index, 1);
            });
        }
    }
    ngOnChanges() {
        this.selectedFrequencyData = Object.assign({ ...this.frequencyDetails });
        this.frequencyData = Object.assign({ ...this.frequencyDetails });
    }
    populateFrequency() {
        const frequencyPattern = parseInt(this.frequencyDetails.pattern.split('~')[0]);
        switch (frequencyPattern) {
            case 0:
                this.frequencyTab = 'oneTime';
                this.currentTabName = 'a one time';
                break;
            case 1:
                this.frequencyTab = 'daily';
                this.currentTabName = 'a daily';
                break;
            case 2:
                this.frequencyTab = 'weekly';
                this.currentTabName = 'a weekly';
                break;
            case 3:
                this.frequencyTab = 'monthly';
                this.currentTabName = 'a monthly';
                break;
            case 4:
                this.frequencyTab = 'annual';
                this.currentTabName = 'an annual ';
                break;
            case 5:
                this.frequencyTab = 'daily';
                this.currentTabName = 'a daily';
                break;
            case 6:
                this.frequencyTab = 'onCompletionOf';
                this.currentTabName = 'an on completion of';
                this.frequencyData.report_id = this.frequencyDetails.selectedReport;
                break;
            case 7:
                this.frequencyTab = 'quarterly';
                this.currentTabName = 'a quarterly';
                break;
            case 8:
                this.frequencyTab = 'random';
                this.currentTabName = 'a random';
                break;
            case 9:
                this.frequencyTab = 'biannual';
                this.currentTabName = 'a biannual';
                break;
            case 10:
                this.frequencyTab = 'ongoing';
                this.currentTabName = 'an ongoing';
                break;
        }
        this.isNextDisabled = false;
    }
    changeFrequencyTab(frequency) {
        this.frequencyTab = frequency.type;
        if (frequency.name == 'One Time') {
            this.currentTabName = 'a one time';
        }
        else {
            this.currentTabName =
                frequency.name.startsWith('On') ||
                    frequency.name.toLowerCase() === 'annual'
                    ? 'an ' + frequency.name
                    : 'a ' + frequency.name;
        }
    }
    isInvalid() {
        let isInvalid = false;
        const frequencyDetails = this.frequencyData?.pattern?.split('~');
        switch (this.frequencyTab) {
            case 'daily':
                if (this.frequencyData.continuous_failed_days < 2) {
                    this.snackbar.show('Input value should be greater than 1.', 'alert');
                    isInvalid = true;
                }
                else {
                    isInvalid = false;
                    this.isNextDisabled = false;
                }
                break;
            case 'weekly':
                if (this.frequencyData.continuous_failed_days < 2) {
                    this.snackbar.show('Input value should be greater than 1.', 'alert');
                    isInvalid = true;
                    break;
                }
                else {
                    isInvalid = false;
                    this.isNextDisabled = false;
                }
                if (frequencyDetails[1] == '' ||
                    !frequencyDetails[1] ||
                    frequencyDetails.length < 4) {
                    isInvalid = true;
                }
                else {
                    isInvalid = false;
                }
                break;
            case 'monthly':
                if (this.frequencyData.continuous_failed_days < 2) {
                    this.snackbar.show('Input value should be greater than 1.', 'alert');
                    isInvalid = true;
                    break;
                }
                else {
                    isInvalid = false;
                    this.isNextDisabled = false;
                }
                if (frequencyDetails[2] == '' ||
                    !frequencyDetails[2] ||
                    frequencyDetails.length < 4) {
                    isInvalid = true;
                }
                else {
                    isInvalid = false;
                }
                break;
            case 'biannual':
                if (frequencyDetails.length === 0 ||
                    frequencyDetails[2] === '' ||
                    frequencyDetails[2].split(',')?.length < 2) {
                    isInvalid = true;
                }
                else {
                    isInvalid = false;
                }
                break;
            case 'oneTime':
                if (frequencyDetails?.length > 0) {
                    const selectedTime = moment(`${frequencyDetails[3]}-${frequencyDetails[2]}-${frequencyDetails[1]} ${this.frequencyData.timeIn12hr}`, 'DD-MM-YYYY HH:mm a').unix();
                    if (Date.now() / 1000 > selectedTime) {
                        this.snackbar.show('Please set a future date.', 'alert');
                        isInvalid = true;
                        break;
                    }
                    else {
                        isInvalid = false;
                        this.isNextDisabled = false;
                    }
                }
                else {
                    isInvalid = true;
                }
                break;
            case 'onCompletionOf':
                if (this.frequencyData.reportId > 0) {
                    isInvalid = false;
                }
                else {
                    isInvalid = true;
                }
                break;
            case 'random':
                if (parseInt(frequencyDetails[1]) == 2 &&
                    (frequencyDetails[2] == '' ||
                        !frequencyDetails[2] ||
                        frequencyDetails.length < 4)) {
                    isInvalid = true;
                }
                else {
                    isInvalid = false;
                }
                break;
            default:
                isInvalid = false;
        }
        return isInvalid;
    }
    onFrequencySelected(event) {
        this.frequencyData = event;
        this.isNextDisabled = this.isInvalid();
    }
    openedRadio(event) {
        this.openedRadioForm = event;
    }
    //   checkNextValidity()
    // {
    // }
    save() {
        this.selectedFrequency.emit(this.frequencyData);
    }
    close() {
        this.closeFrequency.emit();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FrequencyContainerComponent, deps: [{ token: i1.FrequencyService }, { token: i2.SnackBarService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FrequencyContainerComponent, selector: "app-frequency-container", inputs: { frequencyDetails: "frequencyDetails", mode: "mode", feature: "feature", pageType: "pageType" }, outputs: { selectedFrequency: "selectedFrequency", closeFrequency: "closeFrequency" }, usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"mode !== 'policy'\">\n  <div class=\"frequency-dialog\" *ngIf=\"mode !== 'policy'\">\n    <div\n      class=\"frequency-dialog-head vx-p-3 vx-mb-4 vx-d-flex vx-align-center vx-justify-between\"\n    >\n      <div class=\"vx-fs-14 vx-fw-500 vx-label-txt\">Set a Frequency</div>\n    </div>\n    <div class=\"frequency-dialog-body vx-pl-4 vx-pr-4\">\n      <div class=\"frequency-dialog-body-inner\" [ngSwitch]=\"frequencyTab\">\n        <div class=\"frequency-tab vx-d-flex vx-align-center\">\n          <ng-container *ngFor=\"let frequencyType of frequencyList; let i = index\">\n            <button (click)=\"changeFrequencyTab(frequencyType)\" class=\"tab-btn vx-fs-11 vx-fw-500 vx-paragraph-txt vx-tt-uppercase vx-p-0 vx-pb-2 vx-m-0\" [class.active]=\"frequencyType?.type == frequencyTab\">{{ frequencyType?.name }}</button>\n          </ng-container>\n        </div>\n        <div class=\"frequency-tab-bottom vx-pl-4 vx-pr-4\">\n          <!-- Daily Frequency Start -->\n          <app-frequency-daily\n            *ngSwitchCase=\"'daily'\"\n            [mode]=\"mode\"\n            [pageType]=\"pageType\"\n            (frequencyDetails)=\"onFrequencySelected($event)\"\n            [frequencyData]=\"frequencyDetails\"\n          ></app-frequency-daily>\n          <!-- Daily Frequency End -->\n          <!-- Weekly Frequency Start -->\n          <app-frequency-weekly\n            *ngSwitchCase=\"'weekly'\"\n            [mode]=\"mode\"\n            [pageType]=\"pageType\"\n            (frequencyDetails)=\"onFrequencySelected($event)\"\n            [frequencyData]=\"frequencyDetails\"\n          ></app-frequency-weekly>\n          <!-- Weekly Frequency End -->\n          <!-- Monthly Frequency Start -->\n          <app-frequency-monthly\n            *ngSwitchCase=\"'monthly'\"\n            [mode]=\"mode\"\n            [pageType]=\"pageType\"\n            (frequencyDetails)=\"onFrequencySelected($event)\"\n            [frequencyData]=\"frequencyDetails\"\n          ></app-frequency-monthly>\n          <!-- Monthly Frequency End -->\n          <!-- Quarterly Frequency Start -->\n          <app-frequency-quarterly\n            *ngSwitchCase=\"'quarterly'\"\n            [mode]=\"mode\"\n            [pageType]=\"pageType\"\n            (frequencyDetails)=\"onFrequencySelected($event)\"\n            [frequencyData]=\"frequencyDetails\"\n          ></app-frequency-quarterly>\n          <!-- Quarterly Frequency End -->\n          <!-- Biannual Frequency Start -->\n          <app-frequency-biannual\n            *ngSwitchCase=\"'biannual'\"\n            [mode]=\"mode\"\n            [pageType]=\"pageType\"\n            (frequencyDetails)=\"onFrequencySelected($event)\"\n            [frequencyData]=\"frequencyDetails\"\n          ></app-frequency-biannual>\n          <!-- Biannual Frequency End -->\n          <!-- Annual Frequency Start -->\n          <app-frequency-annual\n            *ngSwitchCase=\"'annual'\"\n            [mode]=\"mode\"\n            [pageType]=\"pageType\"\n            (frequencyDetails)=\"onFrequencySelected($event)\"\n            [frequencyData]=\"frequencyDetails\"\n          ></app-frequency-annual>\n          <!-- Annual Frequency End -->\n          <!-- One Time Frequency Start -->\n          <app-frequency-one-time\n            *ngSwitchCase=\"'oneTime'\"\n            [mode]=\"mode\"\n            [pageType]=\"pageType\"\n            (frequencyDetails)=\"onFrequencySelected($event)\"\n            [frequencyData]=\"frequencyDetails\"\n          ></app-frequency-one-time>\n          <!-- One Time Frequency End -->\n          <!-- Random Frequency Start -->\n          <app-frequency-random\n            *ngSwitchCase=\"'random'\"\n            [mode]=\"mode\"\n            (frequencyDetails)=\"onFrequencySelected($event)\"\n            [frequencyData]=\"frequencyDetails\"\n          ></app-frequency-random>\n          <!-- Random Frequency End -->\n          <!-- On Completion Frequency Start -->\n          <app-frequency-on-completion-of\n            *ngSwitchCase=\"'onCompletionOf'\"\n            [mode]=\"mode\"\n            [feature]=\"feature\"\n            (frequencyDetails)=\"onFrequencySelected($event)\"\n            [frequencyData]=\"frequencyDetails\"\n            (radioForm)=\"openedRadio($event)\"\n          ></app-frequency-on-completion-of>\n          <!-- On Completion Frequency End -->\n          <!-- Ongoing Frequency Start -->\n          <app-frequency-ongoing\n            *ngSwitchCase=\"'ongoing'\"\n            (frequencyDetails)=\"onFrequencySelected($event)\"\n            [frequencyData]=\"frequencyDetails\"\n          ></app-frequency-ongoing>\n          <!-- Ongoing Frequency End -->\n        </div>\n      </div>\n    </div>\n\n    <div class=\"frequency-dialog-footer\" *ngIf=\"!openedRadioForm\">\n      <app-floating-bar\n        [showFrequencyText]=\"true\"\n        [currentFrequency]=\"currentTabName\"\n        [isDisabled]=\"isNextDisabled\"\n        (closeEvent)=\"save()\"\n        (closeList)=\"close()\"\n      ></app-floating-bar>\n    </div>\n  </div>\n</ng-container>\n<!-- When responsibility list show then hide frequency-dialog html -->\n\n<!-- For Policy -->\n<div class=\"frequency-dialog\" *ngIf=\"mode === 'policy'\">\n  <div class=\"frequency-dialog-head vx-p-3 vx-mb-4 vx-d-flex vx-align-center vx-justify-between\">\n    <div class=\"vx-fs-14 vx-fw-500 vx-label-txt\">Set a Frequency</div>\n  </div>\n  <div class=\"frequency-dialog-body vx-pl-4 vx-pr-4\">\n    <div class=\"frequency-dialog-body-inner\" [ngSwitch]=\"frequencyTab\">\n      <div class=\"frequency-tab vx-d-flex vx-align-center\">\n        <ng-container *ngFor=\"let frequencyType of frequencyList; let i = index\">\n          <button (click)=\"changeFrequencyTab(frequencyType)\" class=\"tab-btn vx-fs-11 vx-fw-500 vx-paragraph-txt vx-tt-uppercase vx-p-0 vx-pb-2 vx-m-0\" [class.active]=\"frequencyType?.type == frequencyTab\">{{ frequencyType?.name }}</button>\n        </ng-container>\n      </div>\n      <div class=\"frequency-tab-bottom vx-pl-4 vx-pr-4\">\n        <!-- Daily Frequency Start -->\n        <app-frequency-daily\n          *ngSwitchCase=\"'daily'\"\n          [mode]=\"mode\"\n          [pageType]=\"pageType\"\n          (frequencyDetails)=\"onFrequencySelected($event)\"\n          [frequencyData]=\"frequencyDetails\"\n        ></app-frequency-daily>\n        <!-- Daily Frequency End -->\n        <!-- Weekly Frequency Start -->\n        <app-frequency-weekly\n          *ngSwitchCase=\"'weekly'\"\n          [mode]=\"mode\"\n          [pageType]=\"pageType\"\n          (frequencyDetails)=\"onFrequencySelected($event)\"\n          [frequencyData]=\"frequencyDetails\"\n        ></app-frequency-weekly>\n        <!-- Weekly Frequency End -->\n        <!-- Monthly Frequency Start -->\n        <app-frequency-monthly\n          *ngSwitchCase=\"'monthly'\"\n          [mode]=\"mode\"\n          [pageType]=\"pageType\"\n          (frequencyDetails)=\"onFrequencySelected($event)\"\n          [frequencyData]=\"frequencyDetails\"\n        ></app-frequency-monthly>\n        <!-- Monthly Frequency End -->\n        <!-- Quarterly Frequency Start -->\n        <app-frequency-quarterly\n          *ngSwitchCase=\"'quarterly'\"\n          [mode]=\"mode\"\n          [pageType]=\"pageType\"\n          (frequencyDetails)=\"onFrequencySelected($event)\"\n          [frequencyData]=\"frequencyDetails\"\n        ></app-frequency-quarterly>\n        <!-- Quarterly Frequency End -->\n        <!-- Biannual Frequency Start -->\n        <app-frequency-biannual\n          *ngSwitchCase=\"'biannual'\"\n          [mode]=\"mode\"\n          [pageType]=\"pageType\"\n          (frequencyDetails)=\"onFrequencySelected($event)\"\n          [frequencyData]=\"frequencyDetails\"\n        ></app-frequency-biannual>\n        <!-- Biannual Frequency End -->\n        <!-- Annual Frequency Start -->\n        <app-frequency-annual\n          *ngSwitchCase=\"'annual'\"\n          [mode]=\"mode\"\n          [pageType]=\"pageType\"\n          (frequencyDetails)=\"onFrequencySelected($event)\"\n          [frequencyData]=\"frequencyDetails\"\n        ></app-frequency-annual>\n        <!-- Annual Frequency End -->\n        <!-- One Time Frequency Start -->\n        <app-frequency-one-time\n          *ngSwitchCase=\"'oneTime'\"\n          [mode]=\"mode\"\n          [pageType]=\"pageType\"\n          (frequencyDetails)=\"onFrequencySelected($event)\"\n          [frequencyData]=\"frequencyDetails\"\n        ></app-frequency-one-time>\n        <!-- One Time Frequency End -->\n        <!-- Random Frequency Start -->\n        <app-frequency-random\n          *ngSwitchCase=\"'random'\"\n          [mode]=\"mode\"\n          (frequencyDetails)=\"onFrequencySelected($event)\"\n          [frequencyData]=\"frequencyDetails\"\n        ></app-frequency-random>\n        <!-- Random Frequency End -->\n        <!-- On Completion Frequency Start -->\n        <app-frequency-on-completion-of\n          *ngSwitchCase=\"'onCompletionOf'\"\n          [mode]=\"mode\"\n          (frequencyDetails)=\"onFrequencySelected($event)\"\n          [frequencyData]=\"frequencyDetails\"\n        ></app-frequency-on-completion-of>\n        <!-- On Completion Frequency End -->\n        <!-- Ongoing Frequency Start -->\n        <app-frequency-ongoing\n          *ngSwitchCase=\"'ongoing'\"\n          (frequencyDetails)=\"onFrequencySelected($event)\"\n          [frequencyData]=\"frequencyDetails\"\n        ></app-frequency-ongoing>\n        <!-- Ongoing Frequency End -->\n      </div>\n    </div>\n  </div>\n  <div class=\"frequency-dialog-footer\">\n    <app-floating-bar\n      [showFrequencyText]=\"true\"\n      [currentFrequency]=\"currentTabName\"\n      [isDisabled]=\"isNextDisabled\"\n      (closeEvent)=\"save()\"\n      (closeList)=\"close()\"\n    ></app-floating-bar>\n  </div>\n</div>\n", styles: ["@import\"https://cdn.v-comply.com/design-system/css/icons/icons.css\";@import\"https://cdn.v-comply.com/design-system/css/mixin/mixin.css\";@import\"https://cdn.v-comply.com/design-system/css/header/header.css\";@import\"https://cdn.v-comply.com/design-system/css/display/display.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-bottom.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-top.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-left.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-right.css\";@import\"https://cdn.v-comply.com/design-system/css/alignment/alignment.css\";@import\"https://cdn.v-comply.com/design-system/css/text/text.css\";@import\"https://cdn.v-comply.com/design-system/css/button/button.css\";@import\"https://cdn.v-comply.com/design-system/css/color/color.css\";@import\"https://cdn.v-comply.com/design-system/css/popover/popover.css\";@import\"https://cdn.v-comply.com/design-system/css/width/width.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-top.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-bottom.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-left.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-right.css\";::ng-deep .frequency-dialog{position:fixed;inset:0 500px 0 0;z-index:11}::ng-deep .frequency-dialog:before{background:#1e5dd3;content:\"\";position:absolute;top:0;left:0;right:0;width:100%;height:3px}@media screen and (max-width: 1280px){::ng-deep .frequency-dialog{right:30px}::ng-deep .frequency-dialog .frequency-dialog-body .frequency-dialog-body-inner .frequency-tab-bottom app-frequency-on-completion-of .frequency-completion .frequency-completion-inner .frequency-completion-bottom app-frequency-responsibility-list .frequency-responsibility-list{right:0;z-index:9999}}::ng-deep .frequency-dialog-head{background:#fbfbfb;border-radius:.125rem .125rem 0 0;border-bottom:1px solid #f1f1f1}::ng-deep .frequency-dialog-head button.back-btn{background:transparent;border-radius:0;border:none}::ng-deep .frequency-dialog-body{height:calc(100vh - 9.75rem);margin:0 auto 1rem;overflow:hidden;overflow-y:auto;width:calc(100% - 2.5rem)}::ng-deep .frequency-dialog-body::-webkit-scrollbar-track{background-color:transparent}::ng-deep .frequency-dialog-body-inner{width:54.5rem;margin:0 auto}@media screen and (min-width: 1366px){::ng-deep .frequency-dialog-body-inner{width:auto}}::ng-deep .frequency-dialog-body .frequency-tab{border:none!important;border-bottom:1px solid #f1f1f1!important;margin-bottom:1.5rem}::ng-deep .frequency-dialog-body .frequency-tab button.tab-btn{background:transparent;border-radius:0;border:none;border-bottom:.125rem solid transparent;height:1.5rem;margin-right:1.5rem!important}::ng-deep .frequency-dialog-body .frequency-tab button.tab-btn:last-of-type{margin-right:0!important}@media screen and (max-width: 1366px){::ng-deep .frequency-dialog-body .frequency-tab button.tab-btn{margin-right:1rem!important}}@media screen and (max-width: 1280px){::ng-deep .frequency-dialog-body .frequency-tab button.tab-btn{margin-right:.75rem!important}}::ng-deep .frequency-dialog-body .frequency-tab button.tab-btn.active{color:#1e5dd3!important;border-color:#1e5dd3}::ng-deep .frequency-dialog-footer{padding:0 2rem}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: i4.FloatingBarComponent, selector: "app-floating-bar", inputs: ["selectedData", "selectedGroups", "displayElementKey", "elementId", "singularText", "pluralText", "showNextButton", "showFrequencyText", "showWorkflow", "workflowText", "currentFrequency", "isDisabled", "workflowList", "selectedWorkflow", "workflowPlaceHolder", "mode", "defaultSelected", "groupsEnabled", "nonRemovableUsersList", "removePosition"], outputs: ["closeEvent", "deleteEvent", "closeList", "deleteGroupEvent", "workflowTypeChanged"] }, { kind: "component", type: i5.FrequencyDailyComponent, selector: "app-frequency-daily", inputs: ["mode", "frequencyData", "startDate", "pageType"], outputs: ["frequencyDetails"] }, { kind: "component", type: i6.FrequencyWeeklyComponent, selector: "app-frequency-weekly", inputs: ["mode", "pageType", "startDate", "frequencyData"], outputs: ["frequencyDetails"] }, { kind: "component", type: i7.FrequencyMonthlyComponent, selector: "app-frequency-monthly", inputs: ["mode", "pageType", "startDate", "frequencyData"], outputs: ["frequencyDetails"] }, { kind: "component", type: i8.FrequencyQuarterlyComponent, selector: "app-frequency-quarterly", inputs: ["mode", "startDate", "frequencyData", "pageType"], outputs: ["frequencyDetails"] }, { kind: "component", type: i9.FrequencyBiannualComponent, selector: "app-frequency-biannual", inputs: ["mode", "pageType", "startDate", "frequencyData"], outputs: ["frequencyDetails"] }, { kind: "component", type: i10.FrequencyAnnualComponent, selector: "app-frequency-annual", inputs: ["pageType", "frequencyData", "mode", "startDate"], outputs: ["frequencyDetails"] }, { kind: "component", type: i11.FrequencyOneTimeComponent, selector: "app-frequency-one-time", inputs: ["pageType", "frequencyData", "mode"], outputs: ["frequencyDetails"] }, { kind: "component", type: i12.FrequencyRandomComponent, selector: "app-frequency-random", inputs: ["mode", "startDate", "frequencyData"], outputs: ["frequencyDetails"] }, { kind: "component", type: i13.FrequencyOnCompletionOfComponent, selector: "app-frequency-on-completion-of", inputs: ["mode", "feature", "startDate", "frequencyData"], outputs: ["frequencyDetails", "radioForm"] }, { kind: "component", type: i14.FrequencyOngoingComponent, selector: "app-frequency-ongoing", inputs: ["selectedType", "selectedOngoingType", "frequencyData", "startDate"], outputs: ["frequencyDetails"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FrequencyContainerComponent, decorators: [{
            type: Component,
            args: [{ selector: 'app-frequency-container', template: "<ng-container *ngIf=\"mode !== 'policy'\">\n  <div class=\"frequency-dialog\" *ngIf=\"mode !== 'policy'\">\n    <div\n      class=\"frequency-dialog-head vx-p-3 vx-mb-4 vx-d-flex vx-align-center vx-justify-between\"\n    >\n      <div class=\"vx-fs-14 vx-fw-500 vx-label-txt\">Set a Frequency</div>\n    </div>\n    <div class=\"frequency-dialog-body vx-pl-4 vx-pr-4\">\n      <div class=\"frequency-dialog-body-inner\" [ngSwitch]=\"frequencyTab\">\n        <div class=\"frequency-tab vx-d-flex vx-align-center\">\n          <ng-container *ngFor=\"let frequencyType of frequencyList; let i = index\">\n            <button (click)=\"changeFrequencyTab(frequencyType)\" class=\"tab-btn vx-fs-11 vx-fw-500 vx-paragraph-txt vx-tt-uppercase vx-p-0 vx-pb-2 vx-m-0\" [class.active]=\"frequencyType?.type == frequencyTab\">{{ frequencyType?.name }}</button>\n          </ng-container>\n        </div>\n        <div class=\"frequency-tab-bottom vx-pl-4 vx-pr-4\">\n          <!-- Daily Frequency Start -->\n          <app-frequency-daily\n            *ngSwitchCase=\"'daily'\"\n            [mode]=\"mode\"\n            [pageType]=\"pageType\"\n            (frequencyDetails)=\"onFrequencySelected($event)\"\n            [frequencyData]=\"frequencyDetails\"\n          ></app-frequency-daily>\n          <!-- Daily Frequency End -->\n          <!-- Weekly Frequency Start -->\n          <app-frequency-weekly\n            *ngSwitchCase=\"'weekly'\"\n            [mode]=\"mode\"\n            [pageType]=\"pageType\"\n            (frequencyDetails)=\"onFrequencySelected($event)\"\n            [frequencyData]=\"frequencyDetails\"\n          ></app-frequency-weekly>\n          <!-- Weekly Frequency End -->\n          <!-- Monthly Frequency Start -->\n          <app-frequency-monthly\n            *ngSwitchCase=\"'monthly'\"\n            [mode]=\"mode\"\n            [pageType]=\"pageType\"\n            (frequencyDetails)=\"onFrequencySelected($event)\"\n            [frequencyData]=\"frequencyDetails\"\n          ></app-frequency-monthly>\n          <!-- Monthly Frequency End -->\n          <!-- Quarterly Frequency Start -->\n          <app-frequency-quarterly\n            *ngSwitchCase=\"'quarterly'\"\n            [mode]=\"mode\"\n            [pageType]=\"pageType\"\n            (frequencyDetails)=\"onFrequencySelected($event)\"\n            [frequencyData]=\"frequencyDetails\"\n          ></app-frequency-quarterly>\n          <!-- Quarterly Frequency End -->\n          <!-- Biannual Frequency Start -->\n          <app-frequency-biannual\n            *ngSwitchCase=\"'biannual'\"\n            [mode]=\"mode\"\n            [pageType]=\"pageType\"\n            (frequencyDetails)=\"onFrequencySelected($event)\"\n            [frequencyData]=\"frequencyDetails\"\n          ></app-frequency-biannual>\n          <!-- Biannual Frequency End -->\n          <!-- Annual Frequency Start -->\n          <app-frequency-annual\n            *ngSwitchCase=\"'annual'\"\n            [mode]=\"mode\"\n            [pageType]=\"pageType\"\n            (frequencyDetails)=\"onFrequencySelected($event)\"\n            [frequencyData]=\"frequencyDetails\"\n          ></app-frequency-annual>\n          <!-- Annual Frequency End -->\n          <!-- One Time Frequency Start -->\n          <app-frequency-one-time\n            *ngSwitchCase=\"'oneTime'\"\n            [mode]=\"mode\"\n            [pageType]=\"pageType\"\n            (frequencyDetails)=\"onFrequencySelected($event)\"\n            [frequencyData]=\"frequencyDetails\"\n          ></app-frequency-one-time>\n          <!-- One Time Frequency End -->\n          <!-- Random Frequency Start -->\n          <app-frequency-random\n            *ngSwitchCase=\"'random'\"\n            [mode]=\"mode\"\n            (frequencyDetails)=\"onFrequencySelected($event)\"\n            [frequencyData]=\"frequencyDetails\"\n          ></app-frequency-random>\n          <!-- Random Frequency End -->\n          <!-- On Completion Frequency Start -->\n          <app-frequency-on-completion-of\n            *ngSwitchCase=\"'onCompletionOf'\"\n            [mode]=\"mode\"\n            [feature]=\"feature\"\n            (frequencyDetails)=\"onFrequencySelected($event)\"\n            [frequencyData]=\"frequencyDetails\"\n            (radioForm)=\"openedRadio($event)\"\n          ></app-frequency-on-completion-of>\n          <!-- On Completion Frequency End -->\n          <!-- Ongoing Frequency Start -->\n          <app-frequency-ongoing\n            *ngSwitchCase=\"'ongoing'\"\n            (frequencyDetails)=\"onFrequencySelected($event)\"\n            [frequencyData]=\"frequencyDetails\"\n          ></app-frequency-ongoing>\n          <!-- Ongoing Frequency End -->\n        </div>\n      </div>\n    </div>\n\n    <div class=\"frequency-dialog-footer\" *ngIf=\"!openedRadioForm\">\n      <app-floating-bar\n        [showFrequencyText]=\"true\"\n        [currentFrequency]=\"currentTabName\"\n        [isDisabled]=\"isNextDisabled\"\n        (closeEvent)=\"save()\"\n        (closeList)=\"close()\"\n      ></app-floating-bar>\n    </div>\n  </div>\n</ng-container>\n<!-- When responsibility list show then hide frequency-dialog html -->\n\n<!-- For Policy -->\n<div class=\"frequency-dialog\" *ngIf=\"mode === 'policy'\">\n  <div class=\"frequency-dialog-head vx-p-3 vx-mb-4 vx-d-flex vx-align-center vx-justify-between\">\n    <div class=\"vx-fs-14 vx-fw-500 vx-label-txt\">Set a Frequency</div>\n  </div>\n  <div class=\"frequency-dialog-body vx-pl-4 vx-pr-4\">\n    <div class=\"frequency-dialog-body-inner\" [ngSwitch]=\"frequencyTab\">\n      <div class=\"frequency-tab vx-d-flex vx-align-center\">\n        <ng-container *ngFor=\"let frequencyType of frequencyList; let i = index\">\n          <button (click)=\"changeFrequencyTab(frequencyType)\" class=\"tab-btn vx-fs-11 vx-fw-500 vx-paragraph-txt vx-tt-uppercase vx-p-0 vx-pb-2 vx-m-0\" [class.active]=\"frequencyType?.type == frequencyTab\">{{ frequencyType?.name }}</button>\n        </ng-container>\n      </div>\n      <div class=\"frequency-tab-bottom vx-pl-4 vx-pr-4\">\n        <!-- Daily Frequency Start -->\n        <app-frequency-daily\n          *ngSwitchCase=\"'daily'\"\n          [mode]=\"mode\"\n          [pageType]=\"pageType\"\n          (frequencyDetails)=\"onFrequencySelected($event)\"\n          [frequencyData]=\"frequencyDetails\"\n        ></app-frequency-daily>\n        <!-- Daily Frequency End -->\n        <!-- Weekly Frequency Start -->\n        <app-frequency-weekly\n          *ngSwitchCase=\"'weekly'\"\n          [mode]=\"mode\"\n          [pageType]=\"pageType\"\n          (frequencyDetails)=\"onFrequencySelected($event)\"\n          [frequencyData]=\"frequencyDetails\"\n        ></app-frequency-weekly>\n        <!-- Weekly Frequency End -->\n        <!-- Monthly Frequency Start -->\n        <app-frequency-monthly\n          *ngSwitchCase=\"'monthly'\"\n          [mode]=\"mode\"\n          [pageType]=\"pageType\"\n          (frequencyDetails)=\"onFrequencySelected($event)\"\n          [frequencyData]=\"frequencyDetails\"\n        ></app-frequency-monthly>\n        <!-- Monthly Frequency End -->\n        <!-- Quarterly Frequency Start -->\n        <app-frequency-quarterly\n          *ngSwitchCase=\"'quarterly'\"\n          [mode]=\"mode\"\n          [pageType]=\"pageType\"\n          (frequencyDetails)=\"onFrequencySelected($event)\"\n          [frequencyData]=\"frequencyDetails\"\n        ></app-frequency-quarterly>\n        <!-- Quarterly Frequency End -->\n        <!-- Biannual Frequency Start -->\n        <app-frequency-biannual\n          *ngSwitchCase=\"'biannual'\"\n          [mode]=\"mode\"\n          [pageType]=\"pageType\"\n          (frequencyDetails)=\"onFrequencySelected($event)\"\n          [frequencyData]=\"frequencyDetails\"\n        ></app-frequency-biannual>\n        <!-- Biannual Frequency End -->\n        <!-- Annual Frequency Start -->\n        <app-frequency-annual\n          *ngSwitchCase=\"'annual'\"\n          [mode]=\"mode\"\n          [pageType]=\"pageType\"\n          (frequencyDetails)=\"onFrequencySelected($event)\"\n          [frequencyData]=\"frequencyDetails\"\n        ></app-frequency-annual>\n        <!-- Annual Frequency End -->\n        <!-- One Time Frequency Start -->\n        <app-frequency-one-time\n          *ngSwitchCase=\"'oneTime'\"\n          [mode]=\"mode\"\n          [pageType]=\"pageType\"\n          (frequencyDetails)=\"onFrequencySelected($event)\"\n          [frequencyData]=\"frequencyDetails\"\n        ></app-frequency-one-time>\n        <!-- One Time Frequency End -->\n        <!-- Random Frequency Start -->\n        <app-frequency-random\n          *ngSwitchCase=\"'random'\"\n          [mode]=\"mode\"\n          (frequencyDetails)=\"onFrequencySelected($event)\"\n          [frequencyData]=\"frequencyDetails\"\n        ></app-frequency-random>\n        <!-- Random Frequency End -->\n        <!-- On Completion Frequency Start -->\n        <app-frequency-on-completion-of\n          *ngSwitchCase=\"'onCompletionOf'\"\n          [mode]=\"mode\"\n          (frequencyDetails)=\"onFrequencySelected($event)\"\n          [frequencyData]=\"frequencyDetails\"\n        ></app-frequency-on-completion-of>\n        <!-- On Completion Frequency End -->\n        <!-- Ongoing Frequency Start -->\n        <app-frequency-ongoing\n          *ngSwitchCase=\"'ongoing'\"\n          (frequencyDetails)=\"onFrequencySelected($event)\"\n          [frequencyData]=\"frequencyDetails\"\n        ></app-frequency-ongoing>\n        <!-- Ongoing Frequency End -->\n      </div>\n    </div>\n  </div>\n  <div class=\"frequency-dialog-footer\">\n    <app-floating-bar\n      [showFrequencyText]=\"true\"\n      [currentFrequency]=\"currentTabName\"\n      [isDisabled]=\"isNextDisabled\"\n      (closeEvent)=\"save()\"\n      (closeList)=\"close()\"\n    ></app-floating-bar>\n  </div>\n</div>\n", styles: ["@import\"https://cdn.v-comply.com/design-system/css/icons/icons.css\";@import\"https://cdn.v-comply.com/design-system/css/mixin/mixin.css\";@import\"https://cdn.v-comply.com/design-system/css/header/header.css\";@import\"https://cdn.v-comply.com/design-system/css/display/display.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-bottom.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-top.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-left.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-right.css\";@import\"https://cdn.v-comply.com/design-system/css/alignment/alignment.css\";@import\"https://cdn.v-comply.com/design-system/css/text/text.css\";@import\"https://cdn.v-comply.com/design-system/css/button/button.css\";@import\"https://cdn.v-comply.com/design-system/css/color/color.css\";@import\"https://cdn.v-comply.com/design-system/css/popover/popover.css\";@import\"https://cdn.v-comply.com/design-system/css/width/width.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-top.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-bottom.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-left.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-right.css\";::ng-deep .frequency-dialog{position:fixed;inset:0 500px 0 0;z-index:11}::ng-deep .frequency-dialog:before{background:#1e5dd3;content:\"\";position:absolute;top:0;left:0;right:0;width:100%;height:3px}@media screen and (max-width: 1280px){::ng-deep .frequency-dialog{right:30px}::ng-deep .frequency-dialog .frequency-dialog-body .frequency-dialog-body-inner .frequency-tab-bottom app-frequency-on-completion-of .frequency-completion .frequency-completion-inner .frequency-completion-bottom app-frequency-responsibility-list .frequency-responsibility-list{right:0;z-index:9999}}::ng-deep .frequency-dialog-head{background:#fbfbfb;border-radius:.125rem .125rem 0 0;border-bottom:1px solid #f1f1f1}::ng-deep .frequency-dialog-head button.back-btn{background:transparent;border-radius:0;border:none}::ng-deep .frequency-dialog-body{height:calc(100vh - 9.75rem);margin:0 auto 1rem;overflow:hidden;overflow-y:auto;width:calc(100% - 2.5rem)}::ng-deep .frequency-dialog-body::-webkit-scrollbar-track{background-color:transparent}::ng-deep .frequency-dialog-body-inner{width:54.5rem;margin:0 auto}@media screen and (min-width: 1366px){::ng-deep .frequency-dialog-body-inner{width:auto}}::ng-deep .frequency-dialog-body .frequency-tab{border:none!important;border-bottom:1px solid #f1f1f1!important;margin-bottom:1.5rem}::ng-deep .frequency-dialog-body .frequency-tab button.tab-btn{background:transparent;border-radius:0;border:none;border-bottom:.125rem solid transparent;height:1.5rem;margin-right:1.5rem!important}::ng-deep .frequency-dialog-body .frequency-tab button.tab-btn:last-of-type{margin-right:0!important}@media screen and (max-width: 1366px){::ng-deep .frequency-dialog-body .frequency-tab button.tab-btn{margin-right:1rem!important}}@media screen and (max-width: 1280px){::ng-deep .frequency-dialog-body .frequency-tab button.tab-btn{margin-right:.75rem!important}}::ng-deep .frequency-dialog-body .frequency-tab button.tab-btn.active{color:#1e5dd3!important;border-color:#1e5dd3}::ng-deep .frequency-dialog-footer{padding:0 2rem}\n"] }]
        }], ctorParameters: function () { return [{ type: i1.FrequencyService }, { type: i2.SnackBarService }]; }, propDecorators: { frequencyDetails: [{
                type: Input
            }], selectedFrequency: [{
                type: Output
            }], closeFrequency: [{
                type: Output
            }], mode: [{
                type: Input
            }], feature: [{
                type: Input
            }], pageType: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64, 