{ "version": 3, "sources": ["src/app/applicant/online-application-navbar/online-application-navbar.component.ts", "src/app/applicant/online-application-navbar/online-application-navbar.component.html", "src/app/directive/date-format-mask.directive.ts", "src/app/applicant/applicant-shared.module.ts", "src/app/entity/fileUploadModal.ts", "src/app/directive/fileType.validator.ts"], "sourcesContent": ["import { Component, Input, OnInit } from '@angular/core';\r\nimport { Router } from '@angular/router';\r\n\r\n@Component({\r\n selector: 'app-online-application-navbar',\r\n templateUrl: './online-application-navbar.component.html',\r\n styleUrls: ['./online-application-navbar.component.scss']\r\n})\r\nexport class OnlineApplicationNavbarComponent implements OnInit {\r\n\r\n @Input() currentTab: string='';\r\n\r\n constructor(private router:Router) { }\r\n\r\n ngOnInit(): void {\r\n\r\n }\r\n\r\n goToBasicInfo() {\r\n if (this.currentTab !== \"Basic Info\")\r\n return;\r\n\r\n this.router.navigate(['productselection']);\r\n }\r\n\r\n}\r\n", "
\r\n \r\n
\r\n", "import { Directive, HostListener } from '@angular/core';\r\nimport { NgControl } from '@angular/forms';\r\n\r\n@Directive({\r\n selector: '[appDateFormatMask]',\r\n})\r\nexport class DateFormatMaskDirective {\r\n\r\n constructor(private ngControl: NgControl) { }\r\n\r\n @HostListener('input', ['$event'])\r\n onInput(event: any) {\r\n this.onInputChange(event.target.value);\r\n }\r\n\r\n onInputChange(inputValue: string) {\r\n let newVal = inputValue.replace(/\\D/g, ''); // Remove non-digit characters\r\n\r\n if (newVal.length === 0) {\r\n newVal = '';\r\n } else if (newVal.length <= 2) {\r\n newVal = newVal.replace(/^(\\d{0,2})/, '$1');\r\n } else if (newVal.length <= 4) {\r\n newVal = newVal.replace(/^(\\d{0,2})(\\d{0,2})/, '$1/$2');\r\n } else {\r\n newVal = newVal.substring(0, 8); // Limit to MMDDYYYY format\r\n newVal = newVal.replace(/^(\\d{0,2})(\\d{0,2})(\\d{0,4})/, '$1/$2/$3');\r\n }\r\n\r\n // Ensure the value can be parsed by the p-calendar component\r\n const parsedDate = this.parseDateString(newVal);\r\n\r\n if (parsedDate) {\r\n this.ngControl.control?.setValue(parsedDate, { emitEvent: true });\r\n this.ngControl.control?.setErrors(null); // Clear any previous errors if the date is valid\r\n } else {\r\n // Set an invalid error if the date format or value is invalid\r\n this.ngControl.valueAccessor.writeValue(newVal);\r\n this.ngControl.control?.setErrors({ invalidDate: true });\r\n }\r\n }\r\n\r\n // Helper method to parse a formatted date string into a Date object\r\n parseDateString(dateString: string): Date | null {\r\n const parts = dateString.split('/');\r\n if (parts.length === 3) {\r\n const month = parseInt(parts[0], 10);\r\n const day = parseInt(parts[1], 10);\r\n const year = parseInt(parts[2], 10);\r\n\r\n // Basic validations\r\n if (isNaN(month) || isNaN(day) || isNaN(year)) return null;\r\n if (month < 1 || month > 12) return null; // Invalid month\r\n if (year < 1900 || year > new Date().getFullYear()) return null; // Invalid year\r\n\r\n // Validate day based on the month and year (leap year consideration)\r\n const daysInMonth = [31, (this.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\r\n if (day < 1 || day > daysInMonth[month - 1]) return null; // Invalid day\r\n\r\n return new Date(year, month - 1, day);\r\n }\r\n return null;\r\n }\r\n\r\n // Helper method to check if a year is a leap year\r\n isLeapYear(year: number): boolean {\r\n return (year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0));\r\n }\r\n}\r\n", "import { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { OnlineApplicationNavbarComponent } from './online-application-navbar/online-application-navbar.component';\r\nimport { DateFormatMaskDirective } from '../directive/date-format-mask.directive';\r\n\r\n@NgModule({\r\n declarations: [\r\n OnlineApplicationNavbarComponent,\r\n DateFormatMaskDirective,\r\n ],\r\n imports: [\r\n CommonModule,\r\n ReactiveFormsModule,\r\n FormsModule],\r\n exports: [\r\n OnlineApplicationNavbarComponent,\r\n DateFormatMaskDirective,\r\n ],\r\n providers: [\r\n ]\r\n})\r\nexport class ApplicantSharedModule { }\r\n", "export class FileUploadModel {\r\n\r\n public ChooseLabel: string;\r\n public UploadLabel: string;\r\n public ShowUploadButton: boolean;\r\n public ShowCancelButton: boolean;\r\n public Draggable: boolean;\r\n public Mode: 'advanced' | 'basic';\r\n public Multiple: boolean;\r\n public MaxFileSize: number;\r\n public FileLimit: number;\r\n public AcceptFile: string;\r\n public InvalidFileLimitMessageDetail : string\r\n public InvalidFileTypeMessageSummary: string;\r\n public InvalidFileTypeMessageDetail:string;\r\n\r\n constructor(init?: Partial) {\r\n Object.assign(this, init);\r\n }\r\n\r\n}\r\n", "\r\nexport function isFileTypeValid(file: any, fileTypes:string) {\r\n let acceptableTypes = fileTypes.split(',').map(type => type.trim());\r\n for (let type of acceptableTypes) {\r\n let acceptable = isWildcard(type) ? getTypeClass(file.type) === getTypeClass(type)\r\n : file.type == type || getFileExtension(file).toLowerCase() === type.toLowerCase();\r\n if (acceptable) {\r\n return true;\r\n }\r\n }\r\n return false\r\n}\r\nfunction getTypeClass(fileType: string) {\r\n return fileType.substring(0, fileType.indexOf('/'));\r\n}\r\nfunction isWildcard(fileType: string) {\r\n return fileType.indexOf('*') !== -1;\r\n}\r\nfunction getFileExtension(file: any) {\r\n return '.' + file.name.split('.').pop();\r\n}\r\n"], "mappings": ";;;;;;;;;;;;;;;;;;;AAQM,IAAO,oCAAP,MAAO,kCAAgC;EAI3C,YAAoB,QAAa;AAAb,SAAA,SAAA;AAFX,SAAA,aAAmB;EAES;EAErC,WAAQ;EAER;EAEA,gBAAa;AACX,QAAI,KAAK,eAAe;AACtB;AAEF,SAAK,OAAO,SAAS,CAAC,kBAAkB,CAAC;EAC3C;;;mBAfW,mCAAgC,4BAAA,MAAA,CAAA;AAAA;kGAAhC,mCAAgC,WAAA,CAAA,CAAA,+BAAA,CAAA,GAAA,QAAA,EAAA,YAAA,aAAA,GAAA,OAAA,GAAA,MAAA,GAAA,QAAA,CAAA,CAAA,GAAA,aAAA,GAAA,cAAA,MAAA,CAAA,GAAA,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