uawdijnntqw1x1x1
IP : 216.73.216.55
Hostname : srv913213
Kernel : Linux srv913213 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
OS : Linux
PATH:
/
var
/
www
/
krbed.in
/
..
/
..
/
www
/
..
/
www
/
html
/
..
/
school_portal_admin
/
93-es5.cd6b717dc1a40ca6ba3b.js
/
/
function _callSuper(e,t,a){return t=_getPrototypeOf(t),_possibleConstructorReturn(e,_isNativeReflectConstruct()?Reflect.construct(t,a||[],_getPrototypeOf(e).constructor):t.apply(e,a))}function _possibleConstructorReturn(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_isNativeReflectConstruct=function(){return!!e})()}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _defineProperties(e,t){for(var a=0;a<t.length;a++){var c=t[a];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(e,_toPropertyKey(c.key),c)}}function _createClass(e,t,a){return t&&_defineProperties(e.prototype,t),a&&_defineProperties(e,a),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==typeof t?t:t+""}function _toPrimitive(e,t){if("object"!=typeof e||!e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var c=a.call(e,t||"default");if("object"!=typeof c)return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(window.webpackJsonp=window.webpackJsonp||[]).push([[93],{"0OQn":function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));var c=a("ofXK"),r=a("sYmb"),o=a("tk/3"),l=a("fXoL"),i=function(){var e=_createClass((function e(){_classCallCheck(this,e)}));return e.\u0275mod=l.Vb({type:e}),e.\u0275inj=l.Ub({factory:function(t){return new(t||e)},imports:[[o.c,c.c,r.b.forChild({})],c.c,r.b]}),e}()},live:function(e,t,a){"use strict";a.d(t,"b",(function(){return i})),a.d(t,"a",(function(){return d}));var c=a("FKr1"),r=a("sWYD"),o=a("47VO"),l=a("fXoL"),i=function(){var e=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"format",value:function(e,t){return"input"===t?Object(r.a)(e,Object(o.b)()):e.toDateString()}}])}(c.w);return e.\u0275fac=function(t){return n(t||e)},e.\u0275prov=l.Tb({token:e,factory:e.\u0275fac,providedIn:"root"}),e}(),n=l.fc(i),d={parse:{dateInput:{month:"short",year:"numeric",day:"numeric"}},display:{dateInput:"input",monthYearLabel:{year:"numeric",month:"numeric"},dateA11yLabel:{year:"numeric",month:"long",day:"numeric"},monthYearA11yLabel:{year:"numeric",month:"long"}}}},ot3a:function(e,t,a){"use strict";a.r(t);var c,r,o,l,i=a("tyNb"),n=a("ofXK"),d=a("3Pt+"),s=a("YUcS"),u=a("CzEO"),m=a("lDzL"),p=a("7pIB"),f=a("r3oX"),h=a("M9IT"),v=a("+0xr"),g=a("0EQZ"),b=a("ZgjI"),y=a("Dh3D"),F=a("tk/3"),x=a("lJxs"),D=_createClass((function e(){_classCallCheck(this,e),this.leaveRequestId="",this.type="",this.reqDate="",this.departmentName="",this.positionName="",this.employeeId="",this.permissionDate="",this.fromDate="",this.toDate="",this.startTime="",this.endTime="",this.fromDay="",this.toDay="",this.reason="",this.isDoctorCertificate="",this.doctorAttach="",this.userType="",this.branchId="",this.status="",this.createdAt="",this.createdBy="",this.studentId="",this.studentName="",this.updatedAt="",this.updatedBy=""})),k=_createClass((function e(){_classCallCheck(this,e),this.leaveRequestDocId="",this.leaveRequestId="",this.attachment="",this.status=""})),A=a("fXoL"),C=((o=function(){return _createClass((function e(){_classCallCheck(this,e)}),[{key:"adapt",value:function(e){var t,a,c,r;return this.obj=new k,this.obj.leaveRequestDocId=null!=(t=e.leave_request_doc_id)?t:"",this.obj.leaveRequestId=null!=(a=e.leave_request_id)?a:"",this.obj.attachment=null!=(c=e.attachment)?c:"",this.obj.status=null!=(r=e.status)?r:"",this.obj}}])}()).\u0275fac=function(e){return new(e||o)},o.\u0275prov=A.Tb({token:o,factory:o.\u0275fac,providedIn:"root"}),o),V=((r=function(){return _createClass((function e(t){_classCallCheck(this,e),this.adapterSupport=t}),[{key:"adapt",value:function(e){var t,a,c,r=this,o=[];return e.attchment&&(null===(t=e)||void 0===t||t.attchment.forEach((function(e){o.push(r.adapterSupport.adapt(e))}))),this.obj=new D,this.obj.leaveRequestId=e.leave_request_id,this.obj.reqDate=e.req_date,this.obj.type=null!=(c=null===(a=e)||void 0===a?void 0:a.type)?c:"",this.obj.departmentName=e.dept_name,this.obj.positionName=e.pos_name,this.obj.status=e.status,this.obj.attchment=o,this.obj.branchId=e.branch_id,this.obj.doctorAttach=e.doctor_attach,this.obj.employeeId=e.employee_id,this.obj.endTime=e.end_time,this.obj.fromDate=e.from_date,this.obj.isDoctorCertificate=e.is_doctor_certificate,this.obj.permissionDate=e.permission_date,this.obj.empPhoto=e.photo,this.obj.reason=e.reason,this.obj.startTime=e.start_time,this.obj.toDate=e.to_date,this.obj.fromDay=e.from_day,this.obj.toDay=e.to_day,this.obj.userType=e.user_type,this.obj.createdAt=e.created_at,this.obj.createdBy=e.created_by,this.obj.studentId=e.student_id,this.obj.studentName=e.student_name,this.obj.updatedAt=e.updated_at,this.obj.updatedBy=e.updated_by,this.obj}}])}()).\u0275fac=function(e){return new(e||r)(A.hc(C))},r.\u0275prov=A.Tb({token:r,factory:r.\u0275fac,providedIn:"root"}),r),w=((c=function(){return _createClass((function e(t){_classCallCheck(this,e),this.adapter=t}),[{key:"adapt",value:function(e){var t=this,a=[];return e.data.forEach((function(e){a.push(t.adapter.adapt(e))})),{keyword:e.keyword,message:e.message,leaveRequest:a,pageSize:e.count,page:e.page}}},{key:"adaptOneRecord",value:function(e){var t=[];return t.push(this.adapter.adapt(e.data)),{keyword:e.keyword,message:e.message,leaveRequest:t,pageSize:e.count,page:e.page}}}])}()).\u0275fac=function(e){return new(e||c)(A.hc(V))},c.\u0275prov=A.Tb({token:c,factory:c.\u0275fac,providedIn:"root"}),c),S=a("qc5V"),_=((l=function(){return _createClass((function e(t,a){_classCallCheck(this,e),this.adapter=t,this.apiService=a}),[{key:"save",value:function(e,t,a){var c=this;return this.apiService.post("create"==t?"leaveRequest/create":"leaveRequest/update",e).pipe(Object(x.a)((function(e){return c.adapter.adaptOneRecord(e)})))}},{key:"status",value:function(e,t){return 2==t||3==t?this.apiService.post("leaveRequest/status",e):0==t?this.apiService.post("leaveRequest/delete",e):void 0}},{key:"getList",value:function(e,t){var a=this,c=new F.e;for(var r in c=c.set("student_id",e),t)c=c.set(r,t[r]);return this.apiService.get("studentLeaveRequest",c).pipe(Object(x.a)((function(e){return a.adapter.adapt(e)})))}},{key:"getOne",value:function(e){var t=this;return this.apiService.get("leaveRequest/".concat(e)).pipe(Object(x.a)((function(e){return t.adapter.adaptOneRecord(e)})))}}])}()).\u0275fac=function(e){return new(e||l)(A.hc(w),A.hc(S.a))},l.\u0275prov=A.Tb({token:l,factory:l.\u0275fac,providedIn:"root"}),l),I=a("Gg3P"),G=a("Olgc"),T=a("VxG0"),q=a("xe9D"),O=a("Kj3r"),N=a("/uUt"),P=a("xgIS"),L=a("PSD3"),R=a.n(L),j=a("et5Z"),Y=a("dNgK"),B=a("XiUz"),z=a("bTqV"),M=a("kmnG"),U=a("qFsG"),E=a("NFeN"),X=a("bSwM"),H=a("STbY"),J=a("Gh3/"),$=["filterInput"];function K(e,t){if(1&e){var a=A.ec();A.dc(0,"button",33),A.lc("click",(function(e){A.Sc(a);var t=A.pc();return t.value="",t.applyFilter("")})),A.dc(1,"mat-icon"),A.cd(2,"close"),A.cc(),A.cc()}}function W(e,t){if(1&e){var a=A.ec();A.dc(0,"th",34),A.dc(1,"mat-checkbox",35),A.lc("change",(function(e){A.Sc(a);var t=A.pc();return e?t.masterToggle():null})),A.cc(),A.cc()}if(2&e){var c=A.pc();A.Gb(1),A.yc("checked",c.selection.hasValue()&&c.isAllSelected())("indeterminate",c.selection.hasValue()&&!c.isAllSelected())}}function Q(e,t){if(1&e){var a=A.ec();A.dc(0,"td",36),A.dc(1,"mat-checkbox",37),A.lc("click",(function(e){return A.Sc(a),e.stopPropagation()}))("change",(function(e){A.Sc(a);var c=t.$implicit,r=A.pc();return e?r.selection.toggle(c):null})),A.cc(),A.cc()}if(2&e){var c=t.$implicit,r=A.pc();A.Gb(1),A.yc("checked",r.selection.isSelected(c))}}function Z(e,t){1&e&&(A.dc(0,"th",38),A.cd(1,"Req.Date "),A.cc())}function ee(e,t){if(1&e&&(A.dc(0,"td",39),A.cd(1),A.qc(2,"displayDate"),A.cc()),2&e){var a=t.$implicit;A.Gb(1),A.ed(" ",A.rc(2,1,a.reqDate)," ")}}function te(e,t){1&e&&(A.dc(0,"th",40),A.cd(1,"Student Name "),A.cc())}function ae(e,t){if(1&e&&(A.dc(0,"td",39),A.cd(1),A.cc()),2&e){var a=t.$implicit;A.Gb(1),A.ed(" ",a.studentName," ")}}function ce(e,t){1&e&&(A.dc(0,"th",41),A.cd(1," Leave Date - From "),A.cc())}function re(e,t){if(1&e&&(A.dc(0,"td",39),A.cd(1),A.qc(2,"displayDate"),A.cc()),2&e){var a=t.$implicit;A.Gb(1),A.ed(" ",a.fromDate?A.rc(2,1,a.fromDate):"--"," ")}}function oe(e,t){1&e&&(A.dc(0,"th",42),A.cd(1," Leave Date - To "),A.cc())}function le(e,t){if(1&e&&(A.dc(0,"td",39),A.cd(1),A.qc(2,"displayDate"),A.cc()),2&e){var a=t.$implicit;A.Gb(1),A.ed(" ",a.toDate?A.rc(2,1,a.toDate):"--"," ")}}function ie(e,t){1&e&&(A.dc(0,"th",43),A.cd(1," Reason "),A.cc())}function ne(e,t){if(1&e&&(A.dc(0,"td",39),A.cd(1),A.cc()),2&e){var a=t.$implicit;A.Gb(1),A.ed(" ",a.reason," ")}}function de(e,t){1&e&&(A.dc(0,"th",44),A.cd(1," Type "),A.cc())}function se(e,t){1&e&&(A.dc(0,"lable"),A.cd(1,"Permission"),A.cc())}function ue(e,t){1&e&&(A.dc(0,"lable"),A.cd(1,"Leave"),A.cc())}function me(e,t){if(1&e&&(A.dc(0,"td",39),A.ad(1,se,2,0,"lable",31),A.ad(2,ue,2,0,"lable",31),A.cc()),2&e){var a=t.$implicit;A.Gb(1),A.yc("ngIf",0==a.type),A.Gb(1),A.yc("ngIf",1==a.type)}}function pe(e,t){if(1&e){var a=A.ec();A.dc(0,"th",44),A.cd(1," Status "),A.dc(2,"mat-icon",45),A.cd(3,"more_vert"),A.cc(),A.dc(4,"mat-menu",null,46),A.dc(6,"button",47),A.lc("click",(function(e){return A.Sc(a),A.pc().action("view")})),A.dc(7,"mat-icon",48),A.cd(8,"visibility"),A.cc(),A.dc(9,"span"),A.cd(10,"View"),A.cc(),A.cc(),A.dc(11,"button",47),A.lc("click",(function(e){return A.Sc(a),A.pc().action("edit")})),A.dc(12,"mat-icon",49),A.cd(13,"edit"),A.cc(),A.dc(14,"span"),A.cd(15,"Edit"),A.cc(),A.cc(),A.cc(),A.cc()}if(2&e){var c=A.Oc(5);A.Gb(2),A.yc("matMenuTriggerFor",c)}}function fe(e,t){1&e&&(A.dc(0,"label",54),A.cd(1,"Approved"),A.cc())}function he(e,t){1&e&&(A.dc(0,"label",55),A.cd(1,"Denied"),A.cc())}function ve(e,t){1&e&&(A.dc(0,"label",56),A.cd(1,"Created"),A.cc())}function ge(e,t){1&e&&(A.dc(0,"label",57),A.cd(1,"Cancelled"),A.cc())}function be(e,t){if(1&e&&(A.dc(0,"td",39),A.ad(1,fe,2,0,"label",50),A.ad(2,he,2,0,"label",51),A.ad(3,ve,2,0,"label",52),A.ad(4,ge,2,0,"label",53),A.cc()),2&e){var a=t.$implicit;A.Gb(1),A.yc("ngIf",2==a.status),A.Gb(1),A.yc("ngIf",3==a.status),A.Gb(1),A.yc("ngIf",1==a.status),A.Gb(1),A.yc("ngIf",5==a.status)}}function ye(e,t){1&e&&A.Yb(0,"tr",58)}function Fe(e,t){1&e&&A.Yb(0,"tr",59)}function xe(e,t){1&e&&(A.bc(0),A.dc(1,"p",60),A.dc(2,"b"),A.cd(3,"No Data Found..."),A.cc(),A.cc(),A.ac())}var De,ke=((De=function(){return _createClass((function e(t,a,c,r,o,l,i,n){_classCallCheck(this,e),this.cdr=t,this.router=a,this.modelService=c,this.toaster=r,this.loader=o,this.snack=l,this.permission=i,this.currentUserService=n,this.displayedColumns=["select","request_date","student_name","type","from_date","to_date","reason","status"],this.dataSource=new v.o,this.selection=new g.c(!0,[]),this.isLoading=!1,this.isTotalReached=!1,this.totalItems=0,this.pageSizeOptions=[],this.value="",this.vehicle={},this.currentPageDataSize=0,this.paginationDTO=new b.a,this.pageSizeOptions=Object(q.b)().app.table.filtering.pageSizeOptions}),[{key:"ngOnInit",value:function(){this.dataSource.paginator=this.paginator,this.dataSource.sort=this.sort}},{key:"ngOnDestroy",value:function(){this.studentIdSub.unsubscribe()}},{key:"getStudentId",value:function(){var e=this;this.studentIdSub=this.currentUserService.currentSub.subscribe((function(t){t&&e.getData()}))}},{key:"ngAfterViewInit",value:function(){this.filterKeyUp(),this.getStudentId()}},{key:"filterKeyUp",value:function(){var e=this;Object(P.a)(this.filter.nativeElement,"keyup").pipe(Object(O.a)(150),Object(N.a)()).subscribe((function(){if(e.dataSource){var t=e.filter.nativeElement.value;t=(t=t.trim()).toLowerCase(),e.paginationDTO.searchWith=t,e.getData()}})),this.getData()}},{key:"sortData",value:function(e){this.paginationDTO.sortByKey=e.active,this.paginationDTO.sortByType=e.direction.toUpperCase(),this.getData()}},{key:"applyFilter",value:function(e){e=(e=e.trim()).toLowerCase(),this.paginationDTO.searchWith=e,this.getData()}},{key:"onPaginateChange",value:function(e){this.paginationDTO.offset=e.pageIndex,this.paginationDTO.limit=e.pageSize,this.getData()}},{key:"getData",value:function(e){var t=this,a=e||this.currentUserService.getCurrentStudent();this.modelService.getList(a,this.paginationDTO).subscribe((function(e){t.paginationDTO.totalSize=e.pageSize,t.currentPageDataSize=e.leaveRequest.length,t.dataSource=new v.o(e.leaveRequest)}))}},{key:"action",value:function(e){var t=this;1==this.getCheckedValue().length?"2"==this.getCheckedValue()[0].status&&"edit"==e?R.a.fire({icon:"error",title:"Update Leave Request",text:"Already Approved!"}):"3"==this.getCheckedValue()[0].status&&"edit"==e?R.a.fire({icon:"error",title:"Update Leave Request",text:"Already Denied!"}):"5"!=this.getCheckedValue()[0].status||"edit"!=e&&"view"!=e?"edit"!=e&&"view"!=e||R.a.fire({title:"edit"==e?"Update Leave Request":"View Leave Request",text:"Are you sure? You want to "+e+" !",icon:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:"Yes, "+e+" it!"}).then((function(a){if(a.value){var c=t.getCheckedValue()[0].leaveRequestId;t.router.navigate(["edit"==e?"/parent/leave-request/edit/".concat(c):"/parent/leave-request/view/".concat(c)])}})):R.a.fire({icon:"error",title:"edit"==e?"Update Leave Request":"View Leave Request",text:"Already Cancelled!"}):R.a.fire({icon:"error",title:"edit"==e?"Update Leave Request":"View Leave Request",text:"Please Select One Leave Request!"})}},{key:"setStaus",value:function(e){var t="";if(2==e?t="Approve":3==e?t="Denied":0==e&&(t="delete"),this.getCheckedValue().length>=1){var a=1==e?0:1;0==e?this.statusAlert(t,e):this.isMultiStatus(String(a))?"2"==this.getCheckedValue()[0].status?R.a.fire({icon:"error",title:"Leave Request",text:"Already Approved!"}):"3"==this.getCheckedValue()[0].status&&R.a.fire({icon:"error",title:"Leave Request",text:"Already Denied!"}):this.statusAlert(t,e)}else R.a.fire({icon:"error",title:2==e?"Approve Leave Request":"Denied Leave Request status",text:"Please Select Altleast One Leave Request!"})}},{key:"statusAlert",value:function(e,t){var a=this;R.a.fire({title:"Confirm?",text:"Are you sure? You want to "+e+" it !",icon:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:"Yes, "+e+" it!"}).then((function(e){e.value&&a.saveStatus(t)}))}},{key:"saveStatus",value:function(e){var t=this,a=[];this.getCheckedValue().forEach((function(e){a.push(e.leaveRequestId)}));var c=new FormData;c.append("id",JSON.stringify(a)),0!=e&&c.append("status",String(e)),this.loader.open(),this.modelService.status(c,e).subscribe((function(a){t.data=a,"success"==t.data.keyword?(t.refreshTable(0==e?"delete":"other"),t.loader.close(),t.toaster.present(t.data.message,"")):(t.loader.close(),t.toaster.present(t.data.message,""))}))}},{key:"refreshTable",value:function(e){this.filter.nativeElement.value="",this.value="",this.paginationDTO.offset=this.paginator.pageIndex,this.paginationDTO.limit=this.paginator.pageSize,this.paginationDTO.totalSize=this.paginator.length,"delete"==e&&this.getCheckedValue().length==this.currentPageDataSize&&(this.paginationDTO.offset=this.paginator.pageIndex>0?this.paginator.pageIndex-1:0),this.getData(),this.paginator.pageIndex=this.paginationDTO.offset,this.paginator.pageSize=this.paginationDTO.limit,this.paginator.length=this.paginationDTO.totalSize,this.selection=new g.c(!0,[])}},{key:"isAllSelected",value:function(){return this.selection.selected.length===this.dataSource.data.length}},{key:"masterToggle",value:function(){var e=this;this.isAllSelected()?this.selection.clear():this.dataSource.data.forEach((function(t){return e.selection.select(t)}))}},{key:"getCheckedValue",value:function(){var e=this,t=[];return this.dataSource.connect().value.forEach((function(a){e.selection.isSelected(a)&&t.push(a)})),t}},{key:"isMultiStatus",value:function(e){return this.getCheckedValue().filter((function(t){if(t.status!=e)return t})).length>0}}])}()).\u0275fac=function(e){return new(e||De)(A.Xb(A.h),A.Xb(i.g),A.Xb(_),A.Xb(G.a),A.Xb(I.a),A.Xb(Y.a),A.Xb(T.a),A.Xb(j.a))},De.\u0275cmp=A.Rb({type:De,selectors:[["app-list"]],viewQuery:function(e,t){var a;1&e&&(A.Yc(h.a,!0),A.Yc(y.a,!0),A.md($,!0)),2&e&&(A.Nc(a=A.mc())&&(t.paginator=a.first),A.Nc(a=A.mc())&&(t.sort=a.first),A.Nc(a=A.mc())&&(t.filter=a.first))},decls:43,vars:11,consts:[["fxLayout","row wrap",1,"pagewrap"],["fxFlex","100","fxFlex.gt-xs","50",1,"pr-1"],[1,"example-button-row","mt-10"],["mat-flat-button","",1,"btn-primary-bg",3,"routerLink"],[1,"search",2,"width","100%"],["matInput","","id","filterInput","placeholder","Search","value","",3,"ngModel","ngModelChange"],["filterInput",""],["mat-button","","matSuffix","","mat-icon-button","","aria-label","Clear",3,"click",4,"ngIf"],[1,"material-icons","search-icon"],[1,"table_container","pb-1"],[1,""],["mat-table","","matSort","",1,"mat-elevation-z8",3,"dataSource","matSortChange"],["matColumnDef","select",1,"checkbox-field"],["style","width: 5%; text-align: center;","mat-header-cell","",4,"matHeaderCellDef"],["style","width: 5%; text-align: center;","mat-cell","",4,"matCellDef"],["matColumnDef","request_date"],["mat-header-cell","","mat-sort-header","req_date",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","student_name"],["mat-header-cell","","mat-sort-header","student_name",4,"matHeaderCellDef"],["matColumnDef","from_date"],["mat-header-cell","","mat-sort-header","from_date",4,"matHeaderCellDef"],["matColumnDef","to_date"],["mat-header-cell","","mat-sort-header","to_date",4,"matHeaderCellDef"],["matColumnDef","reason"],["mat-header-cell","","mat-sort-header","reason",4,"matHeaderCellDef"],["matColumnDef","type"],["mat-header-cell","",4,"matHeaderCellDef"],["matColumnDef","status"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[4,"ngIf"],[3,"length","pageSize","pageIndex","pageSizeOptions","page"],["mat-button","","matSuffix","","mat-icon-button","","aria-label","Clear",3,"click"],["mat-header-cell","",2,"width","5%","text-align","center"],[3,"checked","indeterminate","change"],["mat-cell","",2,"width","5%","text-align","center"],[3,"checked","click","change"],["mat-header-cell","","mat-sort-header","req_date"],["mat-cell",""],["mat-header-cell","","mat-sort-header","student_name"],["mat-header-cell","","mat-sort-header","from_date"],["mat-header-cell","","mat-sort-header","to_date"],["mat-header-cell","","mat-sort-header","reason"],["mat-header-cell",""],[1,"action",3,"matMenuTriggerFor"],["menu","matMenu"],["mat-menu-item","",3,"click"],[2,"color","blue"],[2,"color","grey"],["class","mat-chip mat-success mat-standard-chip ng-tns-c12-751 mat-chip-selected ng-star-inserted",4,"ngIf"],["class","mat-chip mat-danger mat-standard-chip ng-tns-c12-751 mat-chip-selected ng-star-inserted",4,"ngIf"],["class","mat-chip createstatus mat-standard-chip ng-tns-c12-751 mat-chip-selected ng-star-inserted",4,"ngIf"],["class","mat-chip mat-cancel mat-standard-chip ng-tns-c12-751 mat-chip-selected ng-star-inserted",4,"ngIf"],[1,"mat-chip","mat-success","mat-standard-chip","ng-tns-c12-751","mat-chip-selected","ng-star-inserted"],[1,"mat-chip","mat-danger","mat-standard-chip","ng-tns-c12-751","mat-chip-selected","ng-star-inserted"],[1,"mat-chip","createstatus","mat-standard-chip","ng-tns-c12-751","mat-chip-selected","ng-star-inserted"],[1,"mat-chip","mat-cancel","mat-standard-chip","ng-tns-c12-751","mat-chip-selected","ng-star-inserted"],["mat-header-row",""],["mat-row",""],[1,"text-center"]],template:function(e,t){1&e&&(A.dc(0,"div",0),A.dc(1,"div",1),A.dc(2,"div",2),A.dc(3,"button",3),A.cd(4,"Create"),A.cc(),A.cc(),A.cc(),A.dc(5,"div",1),A.dc(6,"mat-form-field",4),A.dc(7,"input",5,6),A.lc("ngModelChange",(function(e){return t.value=e})),A.cc(),A.ad(9,K,3,0,"button",7),A.cc(),A.dc(10,"i",8),A.cd(11," search "),A.cc(),A.cc(),A.cc(),A.dc(12,"div",9),A.dc(13,"div",10),A.dc(14,"table",11),A.lc("matSortChange",(function(e){return t.sortData(e)})),A.bc(15,12),A.ad(16,W,2,2,"th",13),A.ad(17,Q,2,1,"td",14),A.ac(),A.bc(18,15),A.ad(19,Z,2,0,"th",16),A.ad(20,ee,3,3,"td",17),A.ac(),A.bc(21,18),A.ad(22,te,2,0,"th",19),A.ad(23,ae,2,1,"td",17),A.ac(),A.bc(24,20),A.ad(25,ce,2,0,"th",21),A.ad(26,re,3,3,"td",17),A.ac(),A.bc(27,22),A.ad(28,oe,2,0,"th",23),A.ad(29,le,3,3,"td",17),A.ac(),A.bc(30,24),A.ad(31,ie,2,0,"th",25),A.ad(32,ne,2,1,"td",17),A.ac(),A.bc(33,26),A.ad(34,de,2,0,"th",27),A.ad(35,me,3,2,"td",17),A.ac(),A.bc(36,28),A.ad(37,pe,16,1,"th",27),A.ad(38,be,5,4,"td",17),A.ac(),A.ad(39,ye,1,0,"tr",29),A.ad(40,Fe,1,0,"tr",30),A.cc(),A.ad(41,xe,4,0,"ng-container",31),A.dc(42,"mat-paginator",32),A.lc("page",(function(e){return t.onPaginateChange(e)})),A.cc(),A.cc(),A.cc()),2&e&&(A.Gb(3),A.yc("routerLink","/parent/leave-request/create"),A.Gb(4),A.yc("ngModel",t.value),A.Gb(2),A.yc("ngIf",t.value),A.Gb(5),A.yc("dataSource",t.dataSource),A.Gb(25),A.yc("matHeaderRowDef",t.displayedColumns),A.Gb(1),A.yc("matRowDefColumns",t.displayedColumns),A.Gb(1),A.yc("ngIf",0===t.dataSource.filteredData.length||0===t.dataSource.data.length),A.Gb(1),A.yc("length",t.paginationDTO.totalSize)("pageSize",t.paginationDTO.limit)("pageIndex",t.paginationDTO.offset)("pageSizeOptions",t.pageSizeOptions))},directives:[B.c,B.a,z.a,i.h,M.b,U.b,d.c,d.t,d.w,n.o,v.n,y.a,v.c,v.i,v.b,v.k,v.m,h.a,M.f,E.a,v.h,X.a,v.a,y.b,H.d,H.e,H.b,v.j,v.l],pipes:[J.a],styles:[".mat-success[_ngcontent-%COMP%]{background:green!important}.createstatus[_ngcontent-%COMP%], .mat-success[_ngcontent-%COMP%]{color:#fff!important;padding:2px 4px 1px!important;border-radius:0!important}.createstatus[_ngcontent-%COMP%]{background:#5e4feb!important;font-size:11px!important}.mat-cancel[_ngcontent-%COMP%]{background-color:#ffc400!important;padding:2px 8px 1px!important;border-radius:0!important;font-size:11px!important;color:#fff!important}"]}),De),Ae=a("FKr1"),Ce=a("live"),Ve=a("jtrZ"),we=a("47VO"),Se=a("Wp6s"),_e=a("f0Cb"),Ie=a("iadO"),Ge=a("QibW"),Te=a("d3UM");function qe(e,t){1&e&&(A.dc(0,"mat-error"),A.cd(1," please provide the required date "),A.cc())}function Oe(e,t){1&e&&(A.dc(0,"mat-error"),A.cd(1," please provide the type "),A.cc())}function Ne(e,t){1&e&&(A.dc(0,"mat-error"),A.cd(1," please provide the date "),A.cc())}function Pe(e,t){1&e&&(A.dc(0,"mat-error"),A.cd(1," please provide the start time "),A.cc())}function Le(e,t){1&e&&(A.dc(0,"mat-error"),A.cd(1," please provide the end time "),A.cc())}function Re(e,t){if(1&e){var a=A.ec();A.dc(0,"div",35),A.dc(1,"div",36),A.dc(2,"div",15),A.dc(3,"label"),A.dc(4,"strong"),A.cd(5,"Date"),A.cc(),A.dc(6,"span",12),A.cd(7,"*"),A.cc(),A.cc(),A.cc(),A.dc(8,"div",37),A.dc(9,"mat-form-field",17),A.Yb(10,"mat-label"),A.dc(11,"input",38),A.lc("focus",(function(e){return A.Sc(a),A.Oc(14).open()}))("click",(function(e){return A.Sc(a),A.Oc(14).open()})),A.cc(),A.Yb(12,"mat-datepicker-toggle",19),A.Yb(13,"mat-datepicker",null,39),A.ad(15,Ne,2,0,"mat-error",21),A.cc(),A.cc(),A.cc(),A.dc(16,"div",40),A.dc(17,"div",41),A.dc(18,"label"),A.dc(19,"strong"),A.cd(20,"Start Time"),A.cc(),A.dc(21,"span",12),A.cd(22,"*"),A.cc(),A.cc(),A.cc(),A.dc(23,"div",42),A.dc(24,"mat-form-field",17),A.Yb(25,"input",43),A.Yb(26,"ngx-material-timepicker",null,44),A.ad(28,Pe,2,0,"mat-error",21),A.cc(),A.cc(),A.dc(29,"div",45),A.dc(30,"label"),A.dc(31,"strong"),A.cd(32,"End Time"),A.cc(),A.dc(33,"span",12),A.cd(34,"*"),A.cc(),A.cc(),A.cc(),A.dc(35,"div",46),A.dc(36,"mat-form-field",17),A.Yb(37,"input",47),A.Yb(38,"ngx-material-timepicker",null,48),A.ad(40,Le,2,0,"mat-error",21),A.cc(),A.cc(),A.cc(),A.cc()}if(2&e){var c=A.Oc(14),r=A.Oc(27),o=A.Oc(39),l=A.pc();A.Gb(11),A.yc("matDatepicker",c),A.Gb(1),A.yc("for",c),A.Gb(3),A.yc("ngIf",null==l.control.date.errors?null:l.control.date.errors.required),A.Gb(10),A.yc("ngxTimepicker",r)("format",l.defaultTimeFormat),A.Gb(3),A.yc("ngIf",(null==l.control?null:null==l.control.startTime?null:null==l.control.startTime.errors?null:l.control.startTime.errors.required)&&l.leaveForm.controls.startTime.touched),A.Gb(9),A.yc("min",null==l.control.startTime.value?12:l.control.startTime.value)("ngxTimepicker",o)("format",l.defaultTimeFormat),A.Gb(3),A.yc("ngIf",(null==l.control?null:null==l.control.endTime?null:null==l.control.endTime.errors?null:l.control.endTime.errors.required)&&l.leaveForm.controls.endTime.touched)}}function je(e,t){1&e&&(A.dc(0,"mat-error"),A.cd(1," please provide the from date "),A.cc())}function Ye(e,t){if(1&e&&(A.dc(0,"mat-option",62),A.cd(1),A.cc()),2&e){var a=t.$implicit;A.yc("value",a.value),A.Gb(1),A.ed(" ",a.viewValue," ")}}function Be(e,t){1&e&&(A.dc(0,"mat-error"),A.cd(1," please provide the from day "),A.cc())}function ze(e,t){1&e&&(A.dc(0,"mat-error"),A.cd(1," please provide the to date "),A.cc())}function Me(e,t){if(1&e&&(A.dc(0,"mat-option",62),A.cd(1),A.cc()),2&e){var a=t.$implicit;A.yc("value",a.value),A.Gb(1),A.ed(" ",a.viewValue," ")}}function Ue(e,t){1&e&&(A.dc(0,"mat-error"),A.cd(1," please provide the to day "),A.cc())}function Ee(e,t){if(1&e){var a=A.ec();A.dc(0,"div",49),A.dc(1,"div",15),A.dc(2,"label"),A.dc(3,"strong"),A.cd(4,"Leave Date"),A.cc(),A.dc(5,"span",12),A.cd(6,"*"),A.cc(),A.cc(),A.cc(),A.dc(7,"div",50),A.dc(8,"mat-form-field",17),A.dc(9,"mat-label"),A.cd(10,"From Date"),A.cc(),A.dc(11,"input",51),A.lc("focus",(function(e){return A.Sc(a),A.Oc(14).open()}))("click",(function(e){return A.Sc(a),A.Oc(14).open()})),A.cc(),A.Yb(12,"mat-datepicker-toggle",19),A.Yb(13,"mat-datepicker",null,52),A.ad(15,je,2,0,"mat-error",21),A.cc(),A.cc(),A.dc(16,"div",53),A.dc(17,"mat-form-field",54),A.Yb(18,"mat-label"),A.dc(19,"mat-select",55),A.ad(20,Ye,2,2,"mat-option",56),A.cc(),A.ad(21,Be,2,0,"mat-error",21),A.cc(),A.cc(),A.dc(22,"div",57),A.dc(23,"mat-form-field",54),A.dc(24,"mat-label"),A.cd(25,"To Date"),A.cc(),A.dc(26,"input",58),A.lc("focus",(function(e){return A.Sc(a),A.Oc(29).open()}))("click",(function(e){return A.Sc(a),A.Oc(29).open()})),A.cc(),A.Yb(27,"mat-datepicker-toggle",19),A.Yb(28,"mat-datepicker",null,59),A.ad(30,ze,2,0,"mat-error",21),A.cc(),A.cc(),A.dc(31,"div",60),A.dc(32,"mat-form-field",54),A.Yb(33,"mat-label"),A.dc(34,"mat-select",61),A.ad(35,Me,2,2,"mat-option",56),A.cc(),A.ad(36,Ue,2,0,"mat-error",21),A.cc(),A.cc(),A.cc()}if(2&e){var c=A.Oc(14),r=A.Oc(29),o=A.pc();A.Gb(11),A.yc("matDatepicker",c),A.Gb(1),A.yc("for",c),A.Gb(3),A.yc("ngIf",null==o.control.fromDate.errors?null:o.control.fromDate.errors.required),A.Gb(5),A.yc("ngForOf",o.leaves),A.Gb(1),A.yc("ngIf",null==o.control.fromDay.errors?null:o.control.fromDay.errors.required),A.Gb(5),A.yc("matDatepicker",r)("min",o.leaveForm.controls.fromDate.value),A.Gb(1),A.yc("for",r),A.Gb(3),A.yc("ngIf",null==o.control.toDate.errors?null:o.control.toDate.errors.required),A.Gb(5),A.yc("ngForOf",o.leaves),A.Gb(1),A.yc("ngIf",null==o.control.toDay.errors?null:o.control.toDay.errors.required)}}function Xe(e,t){1&e&&(A.dc(0,"mat-error"),A.cd(1," please provide the reason "),A.cc())}function He(e,t){if(1&e&&(A.dc(0,"span"),A.cd(1),A.cc()),2&e){var a=A.pc(2);A.Gb(1),A.ed(" ",null==a.fileList?null:a.fileList.length," file(s) selected")}}function Je(e,t){if(1&e){var a=A.ec();A.dc(0,"a",79),A.lc("click",(function(e){return A.Sc(a),A.pc(2).clearsupport()})),A.dc(1,"mat-icon",80),A.cd(2,"close"),A.cc(),A.cc()}}function $e(e,t){1&e&&(A.dc(0,"mat-error"),A.dc(1,"small"),A.cd(2,"Please provide the support attachment "),A.cc(),A.cc())}function Ke(e,t){1&e&&(A.dc(0,"mat-error"),A.dc(1,"small"),A.cd(2," JPG, JPEG, PNG, BMP, PDF are allowed "),A.cc(),A.cc())}function We(e,t){1&e&&(A.dc(0,"p",81),A.cd(1," File size should be 2MB maximumn "),A.cc())}function Qe(e,t){1&e&&(A.dc(0,"p",81),A.cd(1," please upload maximumn 10 file "),A.cc())}function Ze(e,t){1&e&&(A.dc(0,"mat-error"),A.cd(1," please choose any one "),A.cc())}function et(e,t){if(1&e){var a=A.ec();A.dc(0,"button",68),A.lc("click",(function(e){return A.Sc(a),A.pc(),A.Oc(2).click()})),A.dc(1,"mat-icon",69),A.cd(2,"attach_file"),A.cc(),A.cd(3," Add File "),A.cc()}}function tt(e,t){if(1&e){var a=A.ec();A.dc(0,"a",79),A.lc("click",(function(e){return A.Sc(a),A.pc(3).clearDoc()})),A.dc(1,"mat-icon",80),A.cd(2,"close"),A.cc(),A.cc()}}function at(e,t){1&e&&(A.dc(0,"mat-error"),A.dc(1,"small"),A.cd(2,"Please provide the attachment "),A.cc(),A.cc())}function ct(e,t){1&e&&(A.dc(0,"mat-error"),A.dc(1,"small"),A.cd(2," JPG, JPEG, PNG, BMP, PDF are allowed "),A.cc(),A.cc())}function rt(e,t){1&e&&(A.dc(0,"p",81),A.cd(1," File size should be 2MB maximumn "),A.cc())}function ot(e,t){if(1&e){var a=A.ec();A.dc(0,"div",82),A.dc(1,"input",83,84),A.lc("change",(function(e){return A.Sc(a),A.pc(2).onSelectFile(e,"doc")})),A.cc(),A.ad(3,et,4,0,"button",85),A.dc(4,"label",86),A.cd(5),A.cc(),A.Yb(6,"input",87),A.ad(7,tt,3,0,"a",70),A.dc(8,"div",71),A.ad(9,at,3,0,"mat-error",21),A.ad(10,ct,3,0,"mat-error",21),A.ad(11,rt,2,0,"p",72),A.dc(12,"span",73),A.cd(13,"Format : JPG, JPEG, PNG, BMP, PDF"),A.cc(),A.Yb(14,"br"),A.dc(15,"span",73),A.cd(16,"File Size : Maximum 2MB"),A.cc(),A.Yb(17,"br"),A.cc(),A.cc()}if(2&e){var c=A.pc(2);A.Gb(3),A.yc("ngIf",!(null!=c.control.docName&&c.control.docName.value)),A.Gb(2),A.dd(null==c.control.docName?null:c.control.docName.value),A.Gb(2),A.yc("ngIf",""!=(null==c.control.docName?null:c.control.docName.value)||(null==c.control.docAttach?null:null==c.control.docAttach.errors?null:c.control.docAttach.errors.pattern)||c.isdocAttachFileSizeTooHigh),A.Gb(2),A.yc("ngIf",(null==c.control.docAttach?null:null==c.control.docAttach.errors?null:c.control.docAttach.errors.required)&&c.leaveForm.controls.docAttach.touched),A.Gb(1),A.yc("ngIf",null==c.control.docAttach?null:null==c.control.docAttach.errors?null:c.control.docAttach.errors.pattern),A.Gb(1),A.yc("ngIf",c.isdocAttachFileSizeTooHigh)}}function lt(e,t){if(1&e){var a=A.ec();A.dc(0,"div"),A.dc(1,"label",63),A.cd(2,"If Leave exceeds 1 day"),A.cc(),A.dc(3,"div",49),A.dc(4,"div",64),A.dc(5,"label"),A.dc(6,"strong"),A.cd(7,"Upload Supporting Document"),A.cc(),A.dc(8,"span",12),A.cd(9,"*"),A.cc(),A.cc(),A.cc(),A.dc(10,"div",65),A.dc(11,"input",66,67),A.lc("change",(function(e){return A.Sc(a),A.pc().onSelectFile(e,"support")})),A.cc(),A.dc(13,"button",68),A.lc("click",(function(e){return A.Sc(a),A.Oc(12).click()})),A.dc(14,"mat-icon",69),A.cd(15,"attach_file"),A.cc(),A.cd(16," Add File "),A.cc(),A.ad(17,He,2,1,"span",21),A.ad(18,Je,3,0,"a",70),A.dc(19,"div",71),A.ad(20,$e,3,0,"mat-error",21),A.ad(21,Ke,3,0,"mat-error",21),A.ad(22,We,2,0,"p",72),A.ad(23,Qe,2,0,"p",72),A.dc(24,"span",73),A.cd(25,"Format : JPG, JPEG, PNG, BMP, PDF"),A.cc(),A.Yb(26,"br"),A.dc(27,"span",73),A.cd(28,"File Size : Maximum 2MB"),A.cc(),A.Yb(29,"br"),A.cc(),A.Yb(30,"input",74),A.cc(),A.cc(),A.dc(31,"div",49),A.dc(32,"div",64),A.dc(33,"label"),A.dc(34,"strong"),A.cd(35,"Doctor Certificate Available"),A.cc(),A.dc(36,"span",12),A.cd(37,"*"),A.cc(),A.cc(),A.cc(),A.dc(38,"div",75),A.dc(39,"mat-radio-group",76),A.dc(40,"mat-radio-button",27),A.cd(41,"Yes "),A.cc(),A.dc(42,"mat-radio-button",77),A.cd(43,"No"),A.cc(),A.ad(44,Ze,2,0,"mat-error",21),A.cc(),A.cc(),A.ad(45,ot,18,6,"div",78),A.cc(),A.cc()}if(2&e){var c=A.pc();A.Gb(17),A.yc("ngIf",(null==c.fileList?null:c.fileList.length)>0),A.Gb(1),A.yc("ngIf",(null==c.fileList?null:c.fileList.length)>0),A.Gb(2),A.yc("ngIf",(null==c.control.suppotAttach?null:null==c.control.suppotAttach.errors?null:c.control.suppotAttach.errors.required)&&c.leaveForm.controls.suppotAttach.touched),A.Gb(1),A.yc("ngIf",null==c.control.suppotAttach?null:null==c.control.suppotAttach.errors?null:c.control.suppotAttach.errors.pattern),A.Gb(1),A.yc("ngIf",c.issuppotAttachFileSizeTooHigh),A.Gb(1),A.yc("ngIf",c.isAttachmentFileLength),A.Gb(21),A.yc("ngIf",(null==c.control.docCert.errors?null:c.control.docCert.errors.required)&&c.leaveForm.controls.docCert.touched),A.Gb(1),A.yc("ngIf","1"===c.leaveForm.controls.docCert.value)}}var it,nt=((it=function(){return _createClass((function e(t,a,c,r,o,l,i){_classCallCheck(this,e),this.modelService=t,this.toaster=a,this.loader=c,this.router=r,this.severdatePipe=o,this.currentUserService=l,this.config=i,this.defaultTimeFormat=Number(Object(we.a)().timeFormat),this.formData={},this.console=console,this.fileList=[],this.oldfile=[],this.years=[{value:"2018-2019",viewValue:"2018-2019"},{value:"2018-2020",viewValue:"2018-2020"}],this.leaves=[{value:"1",viewValue:"Full day"},{value:"2",viewValue:"First half of the day"},{value:"3",viewValue:"Second half of the day"}],this.urls=[],this.studentName=""}),[{key:"ngOnInit",value:function(){this.form()}},{key:"form",value:function(){var e=this;this.leaveForm=new d.j({employeeName:new d.g("",[d.B.required]),reqDate:new d.g("",[d.B.required]),type:new d.g(""),date:new d.g(""),startTime:new d.g(""),endTime:new d.g(""),fromDate:new d.g(""),fromDay:new d.g(""),toDate:new d.g(""),toDay:new d.g(""),reason:new d.g("",[d.B.required]),suppotAttach:new d.g(""),docCert:new d.g(""),docAttach:new d.g("",[d.B.pattern(Object(q.b)().app.validators.imageAndPdf)]),docName:new d.g(""),supportAttachName:new d.g("",[d.B.pattern(Object(q.b)().app.validators.imageAndPdf)])}),this.setStudentName(),this.leaveForm.get("type").valueChanges.subscribe((function(t){0==t?(e.leaveForm.get("fromDate").clearValidators(),e.leaveForm.get("toDate").clearValidators(),e.leaveForm.get("fromDay").clearValidators(),e.leaveForm.get("toDay").clearValidators(),e.leaveForm.get("suppotAttach").clearValidators(),e.leaveForm.get("docCert").clearValidators(),e.leaveForm.get("docAttach").clearValidators(),e.leaveForm.get("suppotAttach").updateValueAndValidity(),e.leaveForm.get("docCert").updateValueAndValidity(),e.leaveForm.get("docAttach").updateValueAndValidity(),e.leaveForm.get("suppotAttach").setValue(""),e.leaveForm.get("docCert").setValue(""),e.leaveForm.get("docAttach").setValue(""),e.fileList=[],e.leaveForm.get("docAttach").clearValidators(),e.leaveForm.get("docAttach").setValue(""),e.docattachment=null,e.leaveForm.get("docName").setValue(""),e.leaveForm.get("date").clearValidators(),e.leaveForm.get("startTime").clearValidators(),e.leaveForm.get("endTime").clearValidators(),e.leaveForm.get("date").setValidators([d.B.required]),e.leaveForm.get("startTime").setValidators([d.B.required]),e.leaveForm.get("endTime").setValidators([d.B.required]),e.leaveForm.get("date").markAsDirty(),e.leaveForm.get("startTime").markAsDirty(),e.leaveForm.get("endTime").markAsDirty(),e.leaveForm.get("fromDate").markAsUntouched(),e.leaveForm.get("startTime").markAsUntouched(),e.leaveForm.get("fromDate").markAsUntouched(),e.leaveForm.get("endTime"),e.leaveForm.get("startTime"),e.leaveForm.get("endTime"),e.leaveForm.get("fromDate").setValue(""),e.leaveForm.get("toDate").setValue(""),e.leaveForm.get("fromDay").setValue(""),e.leaveForm.get("toDay").setValue(""),e.leaveForm.get("docName").setValue(""),e.leaveForm.get("supportAttachName").setValue(""),e.fileList.pop(),e.docattachment=null):(e.leaveForm.get("date").clearValidators(),e.leaveForm.get("startTime").clearValidators(),e.leaveForm.get("endTime").clearValidators(),e.leaveForm.get("fromDate").setValidators([d.B.required]),e.leaveForm.get("fromDay").setValidators([d.B.required]),e.leaveForm.get("toDate").setValidators([d.B.required]),e.leaveForm.get("toDay").setValidators([d.B.required]),e.leaveForm.get("fromDate").markAsDirty(),e.leaveForm.get("toDate").markAsDirty(),e.leaveForm.get("fromDay").markAsDirty(),e.leaveForm.get("toDay").markAsDirty(),e.leaveForm.get("fromDate").markAsUntouched(),e.leaveForm.get("toDate").markAsUntouched(),e.leaveForm.get("fromDay").markAsUntouched(),e.leaveForm.get("toDay").markAsUntouched(),e.leaveForm.get("reason").markAsUntouched(),e.leaveForm.get("fromDate"),e.leaveForm.get("fromDay"),e.leaveForm.get("toDate"),e.leaveForm.get("toDay"),e.leaveForm.get("date").setValue(""),e.leaveForm.get("startTime").setValue(""),e.leaveForm.get("endTime").setValue(""),e.leaveForm.get("reason").setValue(""),e.leaveForm.get("toDate").setValue(""),e.leaveForm.get("fromDate").setValue(""))})),this.leaveForm.get("toDate").valueChanges.subscribe((function(t){e.todate=t})),this.leaveForm.get("toDate").valueChanges.subscribe((function(t){t>e.leaveForm.value.fromDate?(e.leaveForm.get("suppotAttach").clearValidators(),e.leaveForm.get("docCert").clearValidators(),e.leaveForm.get("suppotAttach").setValidators([d.B.required]),e.leaveForm.get("docCert").setValidators([d.B.required]),e.leaveForm.get("docCert").markAsDirty(),e.leaveForm.get("suppotAttach").markAsDirty(),e.leaveForm.get("suppotAttach"),e.leaveForm.get("docCert")):(e.leaveForm.get("suppotAttach").clearValidators(),e.leaveForm.get("docCert").clearValidators(),e.leaveForm.get("docAttach").clearValidators(),e.leaveForm.get("suppotAttach").updateValueAndValidity(),e.leaveForm.get("docCert").updateValueAndValidity(),e.leaveForm.get("docAttach").updateValueAndValidity(),e.leaveForm.get("suppotAttach").setValue(""),e.leaveForm.get("docCert").setValue(""),e.leaveForm.get("docAttach").setValue(""),e.docattachment=null,e.leaveForm.get("docName").setValue(""),e.fileList=[])})),this.leaveForm.get("docCert").valueChanges.subscribe((function(t){1==t?(e.leaveForm.get("docAttach").clearValidators(),e.leaveForm.get("docAttach").setValidators([d.B.required,d.B.pattern(Object(q.b)().app.validators.imageAndPdf)]),e.leaveForm.get("docAttach").markAsDirty(),e.leaveForm.get("docAttach")):(e.leaveForm.get("docAttach").clearValidators(),e.leaveForm.get("docAttach").setValue(""),e.docattachment=null,e.leaveForm.get("docName").setValue(""))}))}},{key:"setStudentName",value:function(){var e=this,t=this.currentUserService.getCurrentStudent();this.leaveForm.get("employeeName").setValue(t),this.studentName=this.currentUserService.getStudentName(t),this.studentIdSub=this.currentUserService.currentSub.subscribe((function(t){t&&(e.leaveForm.get("employeeName").setValue(t),e.studentName=e.currentUserService.getStudentName(t))}))}},{key:"ngOnDestroy",value:function(){this.studentIdSub.unsubscribe()}},{key:"control",get:function(){return this.leaveForm.controls}},{key:"onSelectFile",value:function(e,t){if("doc"==t&&(e.target.files&&e.target.files[0]?e.target.files[0].size>2e6?(this.isdocAttachFileSizeTooHigh=!0,this.docattachment=null):(this.isdocAttachFileSizeTooHigh=!1,this.docattachment=e.target.files[0],this.docFileName=this.docattachment.name,this.leaveForm.get("docName").setValue(this.docattachment.name)):(this.docattachment=null,this.leaveForm.get("docName").setValue(""))),"support"==t&&(this.issuppotAttachFileSizeTooHigh=!1,this.isAttachmentFileLength=!1,this.fileList.length>9&&(this.isAttachmentFileLength=!0),e.target.files&&e.target.files[0])){for(var a=e.target.files.length,c=0;c<a;c++)if(e.target.files[0].size>2e6){this.issuppotAttachFileSizeTooHigh=!0;break}if(!this.issuppotAttachFileSizeTooHigh)for(var r=0;r<a;r++)this.fileList.push(e.target.files[r])}}},{key:"clearDoc",value:function(){this.isdocAttachFileSizeTooHigh=!1,this.docattachment="",this.leaveForm.get("docName").setValue(""),this.leaveForm.get("docAttach").setValue("")}},{key:"clearsupport",value:function(){this.fileList=[]}},{key:"create",value:function(){var e,t,a,c,r,o,l,i,n,d,s,u=this;if(this.findInvalidControls(),this.leaveForm.valid&&this.checkType()){var m=this.leaveForm.value;if(this.leaveForm.valid){var p=this.severdatePipe.transform(null===(e=m)||void 0===e?void 0:e.fromDate),f=this.severdatePipe.transform(null===(t=m)||void 0===t?void 0:t.toDate),h=this.severdatePipe.transform(null===(a=m)||void 0===a?void 0:a.date),v=this.severdatePipe.transform(null===(c=m)||void 0===c?void 0:c.reqDate),g=new FormData;g.append("type",m.type),g.append("from_date",null!=p?p:""),g.append("to_date",null!=f?f:""),g.append("reason",null===(r=m)||void 0===r?void 0:r.reason),g.append("permission_date",null!=h?h:""),g.append("student_id",null===(o=m)||void 0===o?void 0:o.employeeName),g.append("req_date",null!=v?v:""),g.append("start_time",null===(l=m)||void 0===l?void 0:l.startTime),g.append("end_time",null===(i=m)||void 0===i?void 0:i.endTime),g.append("from_day",null===(n=m)||void 0===n?void 0:n.fromDay),g.append("to_day",null===(d=m)||void 0===d?void 0:d.toDay),g.append("is_doctor_certificate",null===(s=m)||void 0===s?void 0:s.docCert),this.docattachment&&g.append("doctor_attach",this.docattachment),this.fileList.forEach((function(e){g.append("attachment[]",e)})),this.loader.open(),this.modelService.save(g,"create").subscribe((function(e){"success"==e.keyword?(u.loader.close(),u.router.navigate(["/parent/leave-request/list"]),u.toaster.present(e.message,"")):"failed"==e.keyword&&(u.loader.close(),u.toaster.present(e.message,""))}))}}else R.a.fire({title:"Check Required",text:"Fill Mandatory Fields ",icon:"warning"})}},{key:"checkType",value:function(){return""!==this.leaveForm.value.type&&null!=this.leaveForm.value.type}},{key:"findInvalidControls",value:function(){var e=[],t=this.leaveForm.controls;for(var a in t)t[a].invalid&&e.push(a);return console.log(e,"invalid"),e}}])}()).\u0275fac=function(e){return new(e||it)(A.Xb(_),A.Xb(G.a),A.Xb(I.a),A.Xb(i.g),A.Xb(J.d),A.Xb(j.a),A.Xb(Ve.a))},it.\u0275cmp=A.Rb({type:it,selectors:[["app-create"]],features:[A.Fb([{provide:Ae.c,useClass:Ce.b},{provide:Ae.f,useValue:Ce.a},J.d])],decls:70,vars:11,consts:[[1,"create_btn"],["mat-raised-button","","color","green",1,"btn-primary-bg",3,"click"],["href","#",1,"discard_button",3,"routerLink"],[1,"form_bg","leave-request"],[1,"p-0"],[1,""],["fxLayout","row wrap"],["fxFlex","100","fxFlex.gt-xs","30"],[1,"card-title-text"],[3,"formGroup"],["fxLayout","row wrap",1,"mt-24"],["fxFlex","100","fxFlex.gt-xs","10",1,"pt-8"],[1,"red_color"],["fxFlex","100","fxFlex.gt-xs","40",2,"margin-top","10px"],["fxLayout","row wrap",1,"mt-16"],["fxFlex","100","fxFlex.gt-xs","10",1,"pt-12"],["fxFlex","100","fxFlex.gt-xs","40"],["appearance","fill"],["matInput","","formControlName","reqDate",3,"matDatepicker","focus","click"],["matSuffix","",3,"for"],["picker3",""],[4,"ngIf"],["fxLayout","row wrap",1,"mt-16","mb-16"],["fxFlex","100","fxFlex.gt-xs","10"],["fxFlex","100","fxFlex.gt-xs","40",1,"mt-0","mb-4"],["aria-label","Select an option","name","type","formControlName","type",1,"ml-15"],["value","0",1,"mr-40"],["value","1",1,"mr-40"],["class","mt-20",4,"ngIf"],["fxLayout","row wrap","class","mt-20",4,"ngIf"],["fxLayout","row wrap",1,""],["fxFlex","100","fxFlex.gt-xs","10",1,"mt-12"],["fxFlex","100","fxFlex.gt-xs","78.5",1,""],[1,"example-full-width"],["matInput","","placeholder","","formControlName","reason"],[1,"mt-20"],["fxLayout","row wrap",1,"row"],["fxFlex","100","fxFlex.gt-xs","40",1,""],["matInput","","formControlName","date",3,"matDatepicker","focus","click"],["picker4",""],["fxLayout","row wrap",1,"row","mt-8","mb-8"],["fxFlex","100","fxFlex.gt-xs","10",1,"label","mt-12"],["fxFlex","100","fxFlex.gt-xs","14",1,"starttime","pt-12"],["type","text","formControlName","startTime","matInput","","readonly","","value","",3,"ngxTimepicker","format"],["timePickerFrom",""],["fxFlex","100","fxFlex.gt-xs","11",1,"label","pl-24","mt-12"],["fxFlex","100","fxFlex.gt-xs","14",1,"endtime","pt-12"],["type","text","formControlName","endTime","matInput","","readonly","","value","",3,"min","ngxTimepicker","format"],["timePickerFroms",""],["fxLayout","row wrap",1,"mt-20"],["fxFlex","100","fxFlex.gt-xs","20",1,""],["matInput","","formControlName","fromDate",3,"matDatepicker","focus","click"],["picker5",""],["fxFlex","100","fxFlex.gt-xs","18",1,"pt-12"],["appearance","fill",1,"full-width"],["tabindex","10","formControlName","fromDay"],[3,"value",4,"ngFor","ngForOf"],["fxFlex","100","fxFlex.gt-xs","20",1,"pl-12"],["matInput","","placeholder","From date","formControlName","toDate",3,"matDatepicker","min","focus","click"],["picker1",""],["fxFlex","100","fxFlex.gt-xs","18",1,"pt-12","pl-12"],["tabindex","10","formControlName","toDay"],[3,"value"],[1,"mt-16",2,"color","red"],["fxFlex","100","fxFlex.gt-xs","18",1,"mt-12"],["fxFlex","100","fxFlex.gt-xs","80",1,"mt-12"],["type","file","formControlName","suppotAttach",2,"display","none",3,"change"],["fileInput",""],["mat-raised-button","","type","button",1,"btn-primary-bg","ml-0",3,"click"],[1,"attachment"],["class","ml-8",3,"click",4,"ngIf"],[1,"mt-8"],["style","color: red;",4,"ngIf"],[1,"f11"],["formControlName","supportAttachName","readonly","",2,"display","none"],["fxFlex","100","fxFlex.gt-xs","14",1,"mt-12"],["aria-label","Select an option","name","type1","formControlName","docCert",1,"ml-15"],["value","2",1,"mr-40"],["fxFlex","100","fxFlex.gt-xs","20","class","mt-12",4,"ngIf"],[1,"ml-8",3,"click"],[1,"delete-icon"],[2,"color","red"],["fxFlex","100","fxFlex.gt-xs","20",1,"mt-12"],["type","file","formControlName","docAttach",2,"display","none",3,"change"],["docfileInput",""],["mat-raised-button","","class","btn-primary-bg ml-0","type","button",3,"click",4,"ngIf"],[1,"ml-4","mt-8"],["formControlName","docName","readonly","",2,"display","none"]],template:function(e,t){if(1&e){var a=A.ec();A.dc(0,"div",0),A.dc(1,"button",1),A.lc("click",(function(e){return t.create()})),A.cd(2,"Save"),A.cc(),A.dc(3,"a",2),A.cd(4,"Discard"),A.cc(),A.cc(),A.dc(5,"div",3),A.dc(6,"mat-card",4),A.dc(7,"mat-card-title",5),A.dc(8,"div",6),A.dc(9,"div",7),A.dc(10,"div",8),A.cd(11,"Create Leave Request"),A.cc(),A.cc(),A.cc(),A.Yb(12,"mat-divider"),A.cc(),A.dc(13,"mat-card-content"),A.dc(14,"form",9),A.dc(15,"div",10),A.dc(16,"div",11),A.dc(17,"label"),A.dc(18,"strong"),A.cd(19,"Student Name"),A.cc(),A.dc(20,"span",12),A.cd(21,"*"),A.cc(),A.cc(),A.cc(),A.dc(22,"div",13),A.Yb(23,"mat-label"),A.dc(24,"mat-label"),A.cd(25),A.cc(),A.cc(),A.cc(),A.dc(26,"div",14),A.dc(27,"div",15),A.dc(28,"label"),A.dc(29,"strong"),A.cd(30,"Req.Date"),A.cc(),A.dc(31,"span",12),A.cd(32,"*"),A.cc(),A.cc(),A.cc(),A.dc(33,"div",16),A.dc(34,"mat-form-field",17),A.Yb(35,"mat-label"),A.dc(36,"input",18),A.lc("focus",(function(e){return A.Sc(a),A.Oc(39).open()}))("click",(function(e){return A.Sc(a),A.Oc(39).open()})),A.cc(),A.Yb(37,"mat-datepicker-toggle",19),A.Yb(38,"mat-datepicker",null,20),A.ad(40,qe,2,0,"mat-error",21),A.cc(),A.cc(),A.cc(),A.dc(41,"div",22),A.dc(42,"div",23),A.dc(43,"label"),A.dc(44,"strong"),A.cd(45,"Type"),A.cc(),A.dc(46,"span",12),A.cd(47,"*"),A.cc(),A.cc(),A.cc(),A.dc(48,"div",24),A.dc(49,"mat-radio-group",25),A.dc(50,"mat-radio-button",26),A.cd(51,"Permission "),A.cc(),A.dc(52,"mat-radio-button",27),A.cd(53,"Leave"),A.cc(),A.ad(54,Oe,2,0,"mat-error",21),A.cc(),A.cc(),A.cc(),A.ad(55,Re,41,10,"div",28),A.ad(56,Ee,37,11,"div",29),A.dc(57,"div",30),A.dc(58,"div",31),A.dc(59,"label"),A.dc(60,"strong"),A.cd(61,"Reason"),A.cc(),A.dc(62,"span",12),A.cd(63,"*"),A.cc(),A.cc(),A.cc(),A.dc(64,"div",32),A.dc(65,"mat-form-field",33),A.Yb(66,"mat-label"),A.Yb(67,"textarea",34),A.ad(68,Xe,2,0,"mat-error",21),A.cc(),A.cc(),A.cc(),A.ad(69,lt,46,8,"div",21),A.cc(),A.cc(),A.cc(),A.cc()}if(2&e){var c=A.Oc(39);A.Gb(3),A.yc("routerLink","/parent/leave-request/list"),A.Gb(11),A.yc("formGroup",t.leaveForm),A.Gb(11),A.dd(t.studentName),A.Gb(11),A.yc("matDatepicker",c),A.Gb(1),A.yc("for",c),A.Gb(3),A.yc("ngIf",null==t.control.reqDate.errors?null:t.control.reqDate.errors.required),A.Gb(14),A.yc("ngIf",null==t.control.type.errors?null:t.control.type.errors.required),A.Gb(1),A.yc("ngIf","0"===t.leaveForm.controls.type.value),A.Gb(1),A.yc("ngIf","1"===t.leaveForm.controls.type.value),A.Gb(12),A.yc("ngIf",null==t.control.reason.errors?null:t.control.reason.errors.required),A.Gb(1),A.yc("ngIf",t.leaveForm.controls.fromDate.value<t.leaveForm.controls.toDate.value)}},directives:[z.a,i.j,Se.a,Se.f,B.c,B.a,_e.a,Se.c,d.D,d.u,d.k,M.e,M.b,U.b,d.c,Ie.b,d.t,d.i,Ie.d,M.f,Ie.a,n.o,Ge.b,Ge.a,M.a,f.d,f.a,Te.a,n.n,Ae.p,E.a],styles:["mat-form-field[_ngcontent-%COMP%]{width:97%}.label[_ngcontent-%COMP%]{margin-top:25px}button[_ngcontent-%COMP%]{background:#01a39d!important;color:#fff!important;border-radius:0}.discard_button[_ngcontent-%COMP%]{color:#01a39d;padding-left:15px}.datefield[_ngcontent-%COMP%]{margin-top:-10px}.mt-20[_ngcontent-%COMP%]{margin-top:20px}.ml-0[_ngcontent-%COMP%]{margin-left:0!important}.delete-icon[_ngcontent-%COMP%]{border:1px solid red;border-radius:50%;background:red;line-height:16px;width:15px!important;height:15px!important;color:#fff}"]}),it);function dt(e,t){1&e&&(A.dc(0,"label"),A.cd(1,"Permission"),A.cc())}function st(e,t){1&e&&(A.dc(0,"label"),A.cd(1,"Leave"),A.cc())}function ut(e,t){if(1&e&&(A.dc(0,"div",7),A.dc(1,"div",8),A.dc(2,"label"),A.dc(3,"strong"),A.cd(4," Date"),A.cc(),A.cc(),A.cc(),A.dc(5,"div",11),A.dc(6,"label"),A.cd(7),A.qc(8,"displayDate"),A.cc(),A.cc(),A.cc()),2&e){var a=A.pc();A.Gb(7),A.ed("",A.rc(8,1,a.employees.permissionDate)," ")}}function mt(e,t){if(1&e&&(A.dc(0,"div",7),A.dc(1,"div",8),A.dc(2,"label"),A.dc(3,"strong"),A.cd(4,"Start Time"),A.cc(),A.cc(),A.cc(),A.dc(5,"div",11),A.dc(6,"label"),A.cd(7),A.qc(8,"displayTime"),A.cc(),A.cc(),A.cc()),2&e){var a=A.pc();A.Gb(7),A.dd(A.rc(8,1,a.employees.startTime))}}function pt(e,t){if(1&e&&(A.dc(0,"div",7),A.dc(1,"div",8),A.dc(2,"label"),A.dc(3,"strong"),A.cd(4,"End Time"),A.cc(),A.cc(),A.cc(),A.dc(5,"div",11),A.dc(6,"label"),A.cd(7),A.qc(8,"displayTime"),A.cc(),A.cc(),A.cc()),2&e){var a=A.pc();A.Gb(7),A.dd(A.rc(8,1,a.employees.endTime))}}function ft(e,t){if(1&e&&(A.dc(0,"div",7),A.dc(1,"div",8),A.dc(2,"label"),A.dc(3,"strong"),A.cd(4,"Leave Date"),A.cc(),A.cc(),A.cc(),A.dc(5,"div",11),A.dc(6,"label"),A.cd(7),A.qc(8,"displayDate"),A.dc(9,"strong"),A.cd(10),A.cc(),A.cd(11),A.qc(12,"displayDate"),A.cc(),A.cc(),A.cc()),2&e){var a=A.pc();A.Gb(7),A.id("",A.rc(8,11,a.employees.fromDate)," ",""!==a.employees.fromDate?"-":""," ","1"==a.employees.fromDay?"Full Day":""," ","2"==a.employees.fromDay?"First half of the day":""," ","3"==a.employees.fromDay?"Second half of the day":""," "),A.Gb(3),A.dd(""!==a.employees.toDate?"to":""),A.Gb(1),A.id(" ",A.rc(12,13,a.employees.toDate)," ",""!==a.employees.toDate?"-":""," ","1"==a.employees.toDay?"Full Day":""," ","2"==a.employees.toDay?"First half of the day":""," ","3"==a.employees.toDay?"Second half of the day":"","")}}function ht(e,t){if(1&e){var a=A.ec();A.dc(0,"button",22),A.lc("click",(function(e){A.Sc(a);var t=A.pc().$implicit;return A.pc(2).download(t.attachment)})),A.dc(1,"i",23),A.cd(2," cloud_download "),A.cc(),A.cc()}}function vt(e,t){if(1&e&&(A.dc(0,"div",5),A.dc(1,"a",20),A.cd(2),A.cc(),A.ad(3,ht,3,0,"button",21),A.cc()),2&e){var a=t.$implicit,c=A.pc(2);A.Gb(2),A.dd(a.attachment),A.Gb(1),A.yc("ngIf",0!==c.employees.attchment.length)}}function gt(e,t){if(1&e){var a=A.ec();A.dc(0,"button",22),A.lc("click",(function(e){A.Sc(a);var t=A.pc(2);return t.download(t.employees.doctorAttach)})),A.dc(1,"i",23),A.cd(2," cloud_download "),A.cc(),A.cc()}}function bt(e,t){if(1&e&&(A.dc(0,"div"),A.dc(1,"label",15),A.cd(2,"If Leave exceeds 1 day"),A.cc(),A.dc(3,"div",16),A.dc(4,"div",17),A.dc(5,"label"),A.dc(6,"strong"),A.cd(7,"Upload Supporting Document"),A.cc(),A.cc(),A.cc(),A.dc(8,"div",18),A.ad(9,vt,4,2,"div",19),A.cc(),A.cc(),A.dc(10,"div",16),A.dc(11,"div",17),A.dc(12,"label"),A.dc(13,"strong"),A.cd(14,"Doctor Certificate Available"),A.cc(),A.cc(),A.cc(),A.dc(15,"div",18),A.dc(16,"div",5),A.dc(17,"a",20),A.cd(18),A.cc(),A.ad(19,gt,3,0,"button",21),A.cc(),A.cc(),A.cc(),A.cc()),2&e){var a=A.pc();A.Gb(9),A.yc("ngForOf",a.employees.attchment),A.Gb(9),A.dd(a.employees.doctorAttach),A.Gb(1),A.yc("ngIf",""!==a.employees.doctorAttach)}}var yt,Ft=((yt=function(){return _createClass((function e(t,a,c,r,o,l){_classCallCheck(this,e),this.employeeService=t,this.toaster=a,this.loader=c,this.router=r,this.activateRoute=o,this.apiserv=l,this.employees=[],this.employeeId=this.activateRoute.snapshot.params.id}),[{key:"ngOnInit",value:function(){this.getOneEmployeeRecord()}},{key:"getOneEmployeeRecord",value:function(){var e=this;this.loader.open(),this.employeeService.getOne(this.employeeId).subscribe((function(t){"success"==t.keyword?(e.employees=t.leaveRequest[0],e.loader.close()):(e.loader.close(),e.toaster.present(t.message))}))}},{key:"download",value:function(e){""!=e&&this.apiserv.downloadFile("leaveRequest/download/".concat(e),{fileName:this.employeeId}).subscribe((function(t){switch(t.type){case F.d.DownloadProgress:break;case F.d.Response:var a=new Blob([t.body],{type:t.body.type}),c=document.createElement("a");c.setAttribute("style","display:none;"),document.body.appendChild(c),c.download=e,c.href=URL.createObjectURL(a),c.target="_blank",c.click(),document.body.removeChild(c)}}),(function(e){}))}}])}()).\u0275fac=function(e){return new(e||yt)(A.Xb(_),A.Xb(G.a),A.Xb(I.a),A.Xb(i.g),A.Xb(i.a),A.Xb(S.a))},yt.\u0275cmp=A.Rb({type:yt,selectors:[["app-view"]],decls:53,vars:15,consts:[[1,"create_btn"],["mat-raised-button","","color","green",1,"btn-primary-bg",3,"routerLink"],["href","#",1,"pl-8","primary-txt-color",3,"routerLink"],[1,"form_bg"],[1,"p-0"],[1,""],[1,"card-title-text"],["fxLayout","row wrap",1,""],["fxFlex","100","fxFlex.gt-xs","10",1,"pt-12"],["fxFlex","100","fxFlex.gt-xs","30",1,"pt-12"],["fxLayout","row wrap"],["fxFlex","100","fxFlex.gt-xs","40",1,"pt-12"],[4,"ngIf"],["fxLayout","row wrap","class","",4,"ngIf"],["fxFlex","100","fxFlex.gt-xs","90",1,"pt-12"],[1,"mt-16",2,"color","red"],["fxLayout","row wrap",1,"mt-20"],["fxFlex","100","fxFlex.gt-xs","18",1,"mt-12"],["fxFlex","100","fxFlex.gt-xs","80",1,"mt-12"],["class"," ",4,"ngFor","ngForOf"],["target","_blank",2,"color","blue"],["mat-button","","class","bg-download mb-4 ml-4","color","primary",3,"click",4,"ngIf"],["mat-button","","color","primary",1,"bg-download","mb-4","ml-4",3,"click"],[1,"material-icons"]],template:function(e,t){1&e&&(A.dc(0,"div",0),A.dc(1,"button",1),A.cd(2,"Edit"),A.cc(),A.dc(3,"button",1),A.cd(4,"Create"),A.cc(),A.dc(5,"a",2),A.cd(6,"Discard"),A.cc(),A.cc(),A.dc(7,"div",3),A.dc(8,"mat-card",4),A.dc(9,"mat-card-title",5),A.dc(10,"div",6),A.cd(11,"View Leave Request"),A.cc(),A.Yb(12,"mat-divider"),A.cc(),A.dc(13,"mat-card-content"),A.dc(14,"div",7),A.dc(15,"div",8),A.dc(16,"label"),A.dc(17,"strong"),A.cd(18,"Student Name"),A.cc(),A.cc(),A.cc(),A.dc(19,"div",9),A.Yb(20,"mat-label"),A.dc(21,"mat-label"),A.cd(22),A.cc(),A.cc(),A.cc(),A.dc(23,"div",10),A.dc(24,"div",8),A.dc(25,"label"),A.dc(26,"strong"),A.cd(27,"Request Date"),A.cc(),A.cc(),A.cc(),A.dc(28,"div",11),A.dc(29,"label"),A.cd(30),A.qc(31,"displayDate"),A.cc(),A.cc(),A.cc(),A.dc(32,"div",10),A.dc(33,"div",8),A.dc(34,"label"),A.dc(35,"strong"),A.cd(36,"Type"),A.cc(),A.cc(),A.cc(),A.dc(37,"div",11),A.ad(38,dt,2,0,"label",12),A.ad(39,st,2,0,"label",12),A.cc(),A.cc(),A.ad(40,ut,9,3,"div",13),A.ad(41,mt,9,3,"div",13),A.ad(42,pt,9,3,"div",13),A.ad(43,ft,13,15,"div",13),A.dc(44,"div",7),A.dc(45,"div",8),A.dc(46,"label"),A.dc(47,"strong"),A.cd(48,"Reason"),A.cc(),A.cc(),A.cc(),A.dc(49,"div",14),A.dc(50,"p"),A.cd(51),A.cc(),A.cc(),A.cc(),A.ad(52,bt,20,3,"div",12),A.cc(),A.cc(),A.cc()),2&e&&(A.Gb(1),A.yc("routerLink","/parent/leave-request/edit/ "+t.employeeId),A.Gb(2),A.yc("routerLink","/parent/leave-request/create"),A.Gb(2),A.yc("routerLink","/parent/leave-request/list"),A.Gb(17),A.dd(t.employees.studentName),A.Gb(8),A.dd(A.rc(31,13,t.employees.reqDate)),A.Gb(8),A.yc("ngIf",0==t.employees.type),A.Gb(1),A.yc("ngIf",1==t.employees.type),A.Gb(1),A.yc("ngIf",0==t.employees.type),A.Gb(1),A.yc("ngIf",0==t.employees.type),A.Gb(1),A.yc("ngIf",0==t.employees.type),A.Gb(1),A.yc("ngIf",1==t.employees.type),A.Gb(8),A.dd(t.employees.reason),A.Gb(1),A.yc("ngIf",t.employees.fromDate<t.employees.toDate))},directives:[z.a,i.h,i.j,Se.a,Se.f,_e.a,Se.c,B.c,B.a,M.e,n.o,n.n],pipes:[J.a,J.c],styles:["p[_ngcontent-%COMP%]{text-align:justify}.contact_person_detail[_ngcontent-%COMP%]{border-radius:50%;width:85px}"]}),yt),xt=a("sWYD"),Dt=["picker1"];function kt(e,t){1&e&&(A.dc(0,"mat-error"),A.cd(1," please provide the requred date "),A.cc())}function At(e,t){1&e&&(A.dc(0,"mat-error"),A.cd(1," please provide the type "),A.cc())}function Ct(e,t){1&e&&(A.dc(0,"mat-error"),A.cd(1," please provide the date "),A.cc())}function Vt(e,t){1&e&&(A.dc(0,"mat-error"),A.cd(1," please provide the start time "),A.cc())}function wt(e,t){1&e&&(A.dc(0,"mat-error"),A.cd(1," please provide the end time "),A.cc())}function St(e,t){if(1&e){var a=A.ec();A.dc(0,"div",32),A.dc(1,"div",33),A.dc(2,"div",9),A.dc(3,"label"),A.dc(4,"strong"),A.cd(5,"Date"),A.cc(),A.dc(6,"span",10),A.cd(7,"*"),A.cc(),A.cc(),A.cc(),A.dc(8,"div",34),A.dc(9,"mat-form-field",14),A.Yb(10,"mat-label"),A.dc(11,"input",35),A.lc("focus",(function(e){return A.Sc(a),A.Oc(14).open()}))("click",(function(e){return A.Sc(a),A.Oc(14).open()})),A.cc(),A.Yb(12,"mat-datepicker-toggle",16),A.Yb(13,"mat-datepicker",null,36),A.ad(15,Ct,2,0,"mat-error",18),A.cc(),A.cc(),A.cc(),A.dc(16,"div",37),A.dc(17,"div",38),A.dc(18,"label"),A.dc(19,"strong"),A.cd(20,"Start Time"),A.cc(),A.dc(21,"span",10),A.cd(22,"*"),A.cc(),A.cc(),A.cc(),A.dc(23,"div",39),A.dc(24,"mat-form-field",14),A.Yb(25,"input",40),A.Yb(26,"ngx-material-timepicker",null,41),A.ad(28,Vt,2,0,"mat-error",18),A.cc(),A.cc(),A.dc(29,"div",42),A.dc(30,"label"),A.dc(31,"strong"),A.cd(32,"End Time"),A.cc(),A.dc(33,"span",10),A.cd(34,"*"),A.cc(),A.cc(),A.cc(),A.dc(35,"div",43),A.dc(36,"mat-form-field",14),A.Yb(37,"input",44),A.Yb(38,"ngx-material-timepicker",null,45),A.ad(40,wt,2,0,"mat-error",18),A.cc(),A.cc(),A.cc(),A.cc()}if(2&e){var c=A.Oc(14),r=A.Oc(27),o=A.Oc(39),l=A.pc();A.Gb(11),A.yc("matDatepicker",c),A.Gb(1),A.yc("for",c),A.Gb(3),A.yc("ngIf",null==l.control.date.errors?null:l.control.date.errors.required),A.Gb(10),A.yc("ngxTimepicker",r)("format",l.defaultTimeFormat),A.Gb(3),A.yc("ngIf",(null==l.control?null:null==l.control.startTime?null:null==l.control.startTime.errors?null:l.control.startTime.errors.required)&&l.leaveForm.controls.startTime.touched),A.Gb(9),A.yc("min",null==l.control.startTime.value?12:l.control.startTime.value)("ngxTimepicker",o)("format",l.defaultTimeFormat),A.Gb(3),A.yc("ngIf",(null==l.control?null:null==l.control.endTime?null:null==l.control.endTime.errors?null:l.control.endTime.errors.required)&&l.leaveForm.controls.endTime.touched)}}function _t(e,t){1&e&&(A.dc(0,"mat-error"),A.cd(1," please provide the from date "),A.cc())}function It(e,t){if(1&e&&(A.dc(0,"mat-option",60),A.cd(1),A.cc()),2&e){var a=t.$implicit;A.yc("value",a.value),A.Gb(1),A.ed(" ",a.viewValue," ")}}function Gt(e,t){1&e&&(A.dc(0,"mat-error"),A.cd(1," please provide the from day "),A.cc())}function Tt(e,t){1&e&&(A.dc(0,"mat-error"),A.cd(1," please provide the to date "),A.cc())}function qt(e,t){if(1&e&&(A.dc(0,"mat-option",60),A.cd(1),A.cc()),2&e){var a=t.$implicit;A.yc("value",a.value),A.Gb(1),A.ed(" ",a.viewValue," ")}}function Ot(e,t){1&e&&(A.dc(0,"mat-error"),A.cd(1," please provide the to day "),A.cc())}function Nt(e,t){if(1&e){var a=A.ec();A.dc(0,"div",46),A.dc(1,"div",9),A.dc(2,"label"),A.dc(3,"strong"),A.cd(4,"Leave Date"),A.cc(),A.dc(5,"span",10),A.cd(6,"*"),A.cc(),A.cc(),A.cc(),A.dc(7,"div",47),A.dc(8,"mat-form-field",14),A.dc(9,"mat-label"),A.cd(10,"From Date"),A.cc(),A.dc(11,"input",48),A.lc("focus",(function(e){return A.Sc(a),A.Oc(14).open()}))("click",(function(e){return A.Sc(a),A.Oc(14).open()})),A.cc(),A.Yb(12,"mat-datepicker-toggle",16),A.Yb(13,"mat-datepicker",null,49),A.ad(15,_t,2,0,"mat-error",18),A.cc(),A.cc(),A.dc(16,"div",50),A.dc(17,"mat-form-field",51),A.Yb(18,"mat-label"),A.dc(19,"mat-select",52),A.ad(20,It,2,2,"mat-option",53),A.cc(),A.ad(21,Gt,2,0,"mat-error",18),A.cc(),A.cc(),A.dc(22,"div",54),A.dc(23,"mat-form-field",51),A.dc(24,"mat-label"),A.cd(25,"To Date"),A.cc(),A.dc(26,"input",55),A.lc("focus",(function(e){A.Sc(a);var t=A.Oc(29),c=A.pc();return t.open(),c.getTodate(e.target.value)}))("click",(function(e){A.Sc(a);var t=A.Oc(29),c=A.pc();return t.open(),c.getTodate(e.target.value)})),A.cc(),A.Yb(27,"mat-datepicker-toggle",16),A.dc(28,"mat-datepicker",56,57),A.lc("click",(function(e){return A.Sc(a),A.pc().getTodate(e.target.value)})),A.cc(),A.ad(30,Tt,2,0,"mat-error",18),A.cc(),A.cc(),A.dc(31,"div",58),A.dc(32,"mat-form-field",51),A.Yb(33,"mat-label"),A.dc(34,"mat-select",59),A.ad(35,qt,2,2,"mat-option",53),A.cc(),A.ad(36,Ot,2,0,"mat-error",18),A.cc(),A.cc(),A.cc()}if(2&e){var c=A.Oc(14),r=A.Oc(29),o=A.pc();A.Gb(11),A.yc("matDatepicker",c),A.Gb(1),A.yc("for",c),A.Gb(3),A.yc("ngIf",null==o.control.fromDate.errors?null:o.control.fromDate.errors.required),A.Gb(5),A.yc("ngForOf",o.leaves),A.Gb(1),A.yc("ngIf",null==o.control.fromDay.errors?null:o.control.fromDay.errors.required),A.Gb(5),A.yc("matDatepicker",r)("min",o.leaveForm.controls.fromDate.value),A.Gb(1),A.yc("for",r),A.Gb(3),A.yc("ngIf",null==o.control.toDate.errors?null:o.control.toDate.errors.required),A.Gb(5),A.yc("ngForOf",o.leaves),A.Gb(1),A.yc("ngIf",null==o.control.toDay.errors?null:o.control.toDay.errors.required)}}function Pt(e,t){1&e&&(A.dc(0,"mat-error"),A.cd(1," please provide the reason "),A.cc())}function Lt(e,t){if(1&e){var a=A.ec();A.dc(0,"button",77),A.lc("click",(function(e){return A.Sc(a),A.pc(),A.Oc(12).click()})),A.dc(1,"mat-icon",78),A.cd(2,"attach_file"),A.cc(),A.cd(3," Add File "),A.cc()}}function Rt(e,t){if(1&e&&(A.dc(0,"label"),A.cd(1),A.cc()),2&e){var a=A.pc(2);A.Gb(1),A.ed(" ",null==a.urls?null:a.urls.length," files selected ")}}function jt(e,t){if(1&e){var a=A.ec();A.dc(0,"a",79),A.lc("click",(function(e){return A.Sc(a),A.pc(2).clearsupport()})),A.dc(1,"mat-icon",80),A.cd(2,"close"),A.cc(),A.cc()}}function Yt(e,t){1&e&&(A.dc(0,"mat-error"),A.dc(1,"small"),A.cd(2,"Please provide the support attachment "),A.cc(),A.cc())}function Bt(e,t){1&e&&(A.dc(0,"mat-error"),A.dc(1,"small"),A.cd(2," JPG, JPEG, PNG, BMP, PDF are allowed "),A.cc(),A.cc())}function zt(e,t){1&e&&(A.dc(0,"p",81),A.cd(1," File size should be 2MB maximumn "),A.cc())}function Mt(e,t){1&e&&(A.dc(0,"p",81),A.cd(1," please upload maximumn 10 file "),A.cc())}function Ut(e,t){1&e&&(A.dc(0,"mat-error"),A.cd(1," please choose any one "),A.cc())}function Et(e,t){if(1&e){var a=A.ec();A.dc(0,"button",77),A.lc("click",(function(e){return A.Sc(a),A.pc(),A.Oc(2).click()})),A.dc(1,"mat-icon",78),A.cd(2,"attach_file"),A.cc(),A.cd(3," Add File "),A.cc()}}function Xt(e,t){if(1&e){var a=A.ec();A.dc(0,"a",79),A.lc("click",(function(e){return A.Sc(a),A.pc(3).clearDoc()})),A.dc(1,"mat-icon",80),A.cd(2,"close"),A.cc(),A.cc()}}function Ht(e,t){1&e&&(A.dc(0,"mat-error"),A.dc(1,"small"),A.cd(2,"Please provide the attachment "),A.cc(),A.cc())}function Jt(e,t){1&e&&(A.dc(0,"mat-error"),A.dc(1,"small"),A.cd(2," JPG, JPEG, PNG, BMP, PDF are allowed "),A.cc(),A.cc())}function $t(e,t){1&e&&(A.dc(0,"p",81),A.cd(1," File size should be 2MB maximumn "),A.cc())}function Kt(e,t){if(1&e){var a=A.ec();A.dc(0,"div",82),A.dc(1,"input",83,84),A.lc("change",(function(e){return A.Sc(a),A.pc(2).onSelectFile(e,"doc")})),A.cc(),A.ad(3,Et,4,0,"button",66),A.dc(4,"label",85),A.cd(5),A.cc(),A.Yb(6,"input",86),A.ad(7,Xt,3,0,"a",67),A.dc(8,"div",68),A.ad(9,Ht,3,0,"mat-error",18),A.ad(10,Jt,3,0,"mat-error",18),A.ad(11,$t,2,0,"p",69),A.dc(12,"span",70),A.cd(13,"Format : JPG, JPEG, PNG, BMP, PDF"),A.cc(),A.Yb(14,"br"),A.dc(15,"span",70),A.cd(16,"File Size : Maximum 2MB"),A.cc(),A.Yb(17,"br"),A.cc(),A.cc()}if(2&e){var c=A.pc(2);A.Gb(3),A.yc("ngIf",!(null!=c.control.docName&&c.control.docName.value)),A.Gb(2),A.dd(null==c.control.docName?null:c.control.docName.value),A.Gb(2),A.yc("ngIf",""!=(null==c.control.docName?null:c.control.docName.value)||(null==c.control.docAttach?null:null==c.control.docAttach.errors?null:c.control.docAttach.errors.pattern)||c.isdocAttachFileSizeTooHigh),A.Gb(2),A.yc("ngIf",(null==c.control.docAttach?null:null==c.control.docAttach.errors?null:c.control.docAttach.errors.required)&&c.leaveForm.controls.docAttach.touched),A.Gb(1),A.yc("ngIf",null==c.control.docAttach?null:null==c.control.docAttach.errors?null:c.control.docAttach.errors.pattern),A.Gb(1),A.yc("ngIf",c.isdocAttachFileSizeTooHigh)}}function Wt(e,t){if(1&e){var a=A.ec();A.dc(0,"div"),A.dc(1,"label",61),A.cd(2,"If Leave exceeds 1 day"),A.cc(),A.dc(3,"div",46),A.dc(4,"div",62),A.dc(5,"label"),A.dc(6,"strong"),A.cd(7,"Upload Supporting Document"),A.cc(),A.dc(8,"span",10),A.cd(9,"*"),A.cc(),A.cc(),A.cc(),A.dc(10,"div",63),A.dc(11,"input",64,65),A.lc("change",(function(e){return A.Sc(a),A.pc().onSelectFile(e,"support")})),A.cc(),A.ad(13,Lt,4,0,"button",66),A.ad(14,Rt,2,1,"label",18),A.ad(15,jt,3,0,"a",67),A.dc(16,"div",68),A.ad(17,Yt,3,0,"mat-error",18),A.ad(18,Bt,3,0,"mat-error",18),A.ad(19,zt,2,0,"p",69),A.ad(20,Mt,2,0,"p",69),A.dc(21,"span",70),A.cd(22,"Format : JPG, JPEG, PNG, BMP, PDF"),A.cc(),A.Yb(23,"br"),A.dc(24,"span",70),A.cd(25,"File Size : Maximum 2MB"),A.cc(),A.Yb(26,"br"),A.cc(),A.Yb(27,"input",71),A.cc(),A.cc(),A.dc(28,"div",46),A.dc(29,"div",62),A.dc(30,"label"),A.dc(31,"strong"),A.cd(32,"Doctor Certificate Available"),A.cc(),A.dc(33,"span",10),A.cd(34,"*"),A.cc(),A.cc(),A.cc(),A.dc(35,"div",72),A.dc(36,"mat-radio-group",73),A.dc(37,"mat-radio-button",74),A.cd(38,"Yes "),A.cc(),A.dc(39,"mat-radio-button",75),A.cd(40,"No "),A.cc(),A.ad(41,Ut,2,0,"mat-error",18),A.cc(),A.cc(),A.ad(42,Kt,18,6,"div",76),A.cc(),A.cc()}if(2&e){var c=A.pc();A.Gb(13),A.yc("ngIf",0==(null==c.urls?null:c.urls.length)),A.Gb(1),A.yc("ngIf",c.urls.length>0),A.Gb(1),A.yc("ngIf",(null==c.fileList?null:c.fileList.length)>0||(null==c.urls?null:c.urls.length)>0),A.Gb(2),A.yc("ngIf",(null==c.control.suppotAttach?null:null==c.control.suppotAttach.errors?null:c.control.suppotAttach.errors.required)&&c.leaveForm.controls.suppotAttach.touched),A.Gb(1),A.yc("ngIf",null==c.control.suppotAttach?null:null==c.control.suppotAttach.errors?null:c.control.suppotAttach.errors.pattern),A.Gb(1),A.yc("ngIf",c.issuppotAttachFileSizeTooHigh),A.Gb(1),A.yc("ngIf",c.isAttachmentFileLength),A.Gb(21),A.yc("ngIf",(null==c.control.docCert.errors?null:c.control.docCert.errors.required)&&c.leaveForm.controls.docCert.touched),A.Gb(1),A.yc("ngIf","1"===c.leaveForm.controls.docCert.value)}}var Qt,Zt=[{path:"",children:[{path:"create",component:nt,data:{title:"Create Leave Request",breadcrumb:"New"}},{path:"list",component:ke,data:{title:"List of Leave Request",breadcrumb:"List"}},{path:"view/:id",component:Ft,data:{title:"View Leave Request",breadcrumb:"View"}},{path:"edit/:id",component:(Qt=function(){return _createClass((function e(t,a,c,r,o,l,i){_classCallCheck(this,e),this.modelService=t,this.toaster=a,this.loader=c,this.router=r,this.severdatePipe=o,this.config=l,this.activateRoute=i,this.defaultTimeFormat=Number(Object(we.a)().timeFormat),this.formData={},this.console=console,this.fileList=[],this.oldfile=[],this.studentName="",this.employee=[],this.leaves=[{value:"1",viewValue:"Full day"},{value:"2",viewValue:"First half of the day"},{value:"3",viewValue:"Second half of the day"}],this.urls=[],this.deleteId=[],this.employeeId=this.activateRoute.snapshot.params.id}),[{key:"ngOnInit",value:function(){this.form(),this.getOneEmployeeRecord()}},{key:"form",value:function(){var e=this;this.leaveForm=new d.j({employeeName:new d.g("",[d.B.required]),reqDate:new d.g("",[d.B.required]),type:new d.g(""),date:new d.g(""),startTime:new d.g(""),endTime:new d.g(""),fromDate:new d.g(""),fromDay:new d.g(""),toDate:new d.g(""),toDay:new d.g(""),reason:new d.g("",[d.B.required]),suppotAttach:new d.g(""),docCert:new d.g(""),docAttach:new d.g("",[d.B.pattern(Object(q.b)().app.validators.imageAndPdf)]),docName:new d.g,supportAttachName:new d.g("",[d.B.pattern(Object(q.b)().app.validators.imageAndPdf)])}),this.leaveForm.get("type").valueChanges.subscribe((function(t){0==t?(e.leaveForm.get("fromDate").clearValidators(),e.leaveForm.get("toDate").clearValidators(),e.leaveForm.get("fromDay").clearValidators(),e.leaveForm.get("toDay").clearValidators(),e.leaveForm.get("suppotAttach").clearValidators(),e.leaveForm.get("docCert").clearValidators(),e.leaveForm.get("docAttach").clearValidators(),e.leaveForm.get("suppotAttach").updateValueAndValidity(),e.leaveForm.get("docCert").updateValueAndValidity(),e.leaveForm.get("docAttach").updateValueAndValidity(),e.leaveForm.get("suppotAttach").setValue(""),e.leaveForm.get("docCert").setValue(""),e.leaveForm.get("docAttach").setValue(""),e.fileList=[],e.urls=[],e.employee.attchment.forEach((function(t){e.oldfile.push(t.leaveRequestDocId)})),e.leaveForm.get("docAttach").clearValidators(),e.leaveForm.get("docAttach").setValue(""),e.docattachment=null,e.leaveForm.get("docName").setValue(""),e.leaveForm.get("date").setValidators([d.B.required]),e.leaveForm.get("startTime").setValidators([d.B.required]),e.leaveForm.get("endTime").setValidators([d.B.required]),e.leaveForm.get("date").markAsDirty(),e.leaveForm.get("startTime").markAsDirty(),e.leaveForm.get("endTime").markAsDirty(),e.leaveForm.get("fromDate").markAsUntouched(),e.leaveForm.get("startTime").markAsUntouched(),e.leaveForm.get("fromDate").markAsUntouched(),e.leaveForm.get("reason").markAsUntouched(),e.leaveForm.get("endTime"),e.leaveForm.get("startTime"),e.leaveForm.get("endTime"),e.leaveForm.get("fromDate").setValue(""),e.leaveForm.get("toDate").setValue(""),e.leaveForm.get("fromDay").setValue(""),e.leaveForm.get("toDay").setValue(""),e.leaveForm.get("reason").setValue(""),e.leaveForm.get("docName").setValue(""),e.leaveForm.get("supportAttachName").setValue("")):(e.leaveForm.get("date").clearValidators(),e.leaveForm.get("startTime").clearValidators(),e.leaveForm.get("endTime").clearValidators(),e.leaveForm.get("fromDate").setValidators([d.B.required]),e.leaveForm.get("fromDay").setValidators([d.B.required]),e.leaveForm.get("toDate").setValidators([d.B.required]),e.leaveForm.get("toDay").setValidators([d.B.required]),e.leaveForm.get("fromDate").markAsDirty(),e.leaveForm.get("toDate").markAsDirty(),e.leaveForm.get("fromDay").markAsDirty(),e.leaveForm.get("toDay").markAsDirty(),e.leaveForm.get("fromDate").markAsUntouched(),e.leaveForm.get("toDate").markAsUntouched(),e.leaveForm.get("fromDay").markAsUntouched(),e.leaveForm.get("toDay").markAsUntouched(),e.leaveForm.get("reason").markAsUntouched(),e.leaveForm.get("fromDate"),e.leaveForm.get("fromDay"),e.leaveForm.get("toDate"),e.leaveForm.get("toDay"),e.leaveForm.get("date").setValue(""),e.leaveForm.get("startTime").setValue(""),e.leaveForm.get("endTime").setValue(""),e.leaveForm.get("reason").setValue(""),e.leaveForm.get("toDate").setValue(""),e.leaveForm.get("fromDate").setValue(""))})),this.formdatevalidate(),this.docValidate()}},{key:"control",get:function(){return this.leaveForm.controls}},{key:"formdatevalidate",value:function(){var e=this;this.leaveForm.get("toDate").valueChanges.subscribe((function(t){t>e.leaveForm.value.fromDate?(e.leaveForm.get("suppotAttach").clearValidators(),e.leaveForm.get("docCert").clearValidators(),e.leaveForm.get("suppotAttach").setValidators([d.B.required]),e.leaveForm.get("docCert").setValidators([d.B.required]),e.leaveForm.get("docCert").markAsDirty(),e.leaveForm.get("suppotAttach").markAsDirty(),e.leaveForm.get("suppotAttach"),e.leaveForm.get("docCert")):(e.leaveForm.get("suppotAttach").clearValidators(),e.leaveForm.get("docCert").clearValidators(),e.leaveForm.get("docAttach").clearValidators(),e.leaveForm.get("suppotAttach").updateValueAndValidity(),e.leaveForm.get("docCert").updateValueAndValidity(),e.leaveForm.get("docAttach").updateValueAndValidity())}))}},{key:"docValidate",value:function(){var e=this;this.leaveForm.get("docCert").valueChanges.subscribe((function(t){1==t?e.leaveForm.get("docAttach").value||(e.leaveForm.get("docAttach").clearValidators(),e.leaveForm.get("docAttach").markAsDirty(),e.leaveForm.get("docAttach"),e.leaveForm.get("docName").setValue(""),e.leaveForm.get("docAttach").setValue(""),e.leaveForm.get("docName").setValidators([d.B.required]),e.leaveForm.get("docAttach").setValidators([d.B.required,d.B.pattern(Object(q.b)().app.validators.imageAndPdf)])):(e.leaveForm.get("docAttach").clearValidators(),e.leaveForm.get("docName").clearValidators(),e.leaveForm.get("docAttach").setValue(""),e.docattachment=null,e.leaveForm.get("docName").setValue(""))}))}},{key:"getTodate",value:function(e){Object(xt.a)(new Date(String(this.leaveForm.value.fromDate)),Object(we.b)())<e?(this.valide="1",this.leaveForm.get("suppotAttach").clearValidators(),this.leaveForm.get("docCert").clearValidators(),this.leaveForm.get("suppotAttach").setValidators([d.B.required]),this.leaveForm.get("docCert").setValidators([d.B.required]),this.leaveForm.get("docCert").markAsDirty(),this.leaveForm.get("suppotAttach").markAsDirty(),this.leaveForm.get("suppotAttach"),this.leaveForm.get("docCert")):(this.valide="0",this.leaveForm.get("suppotAttach").clearValidators(),this.leaveForm.get("docCert").clearValidators(),this.leaveForm.get("docAttach").clearValidators(),this.leaveForm.get("suppotAttach").updateValueAndValidity(),this.leaveForm.get("docCert").updateValueAndValidity(),this.leaveForm.get("docAttach").updateValueAndValidity(),this.leaveForm.get("suppotAttach").setValue(""),this.leaveForm.get("docCert").setValue(""),this.leaveForm.get("docAttach").setValue(""),this.docattachment=null,this.leaveForm.get("docName").setValue(""),this.urls=[],this.fileList=[])}},{key:"getfromdate",value:function(e){var t=this.severdatePipe.transform(e);this.leaveForm.get("fromDate").setValue(t)}},{key:"onSelectFile",value:function(e,t){if("doc"==t&&(e.target.files&&e.target.files[0]?e.target.files[0].size>2e6?(this.isdocAttachFileSizeTooHigh=!0,this.docattachment=null):(this.isdocAttachFileSizeTooHigh=!1,this.docattachment=e.target.files[0],this.docFileName=this.docattachment.name,this.leaveForm.get("docName").setValue(this.docattachment.name),this.leaveForm.get("docAttach").setValue(this.docattachment.name)):(this.docattachment=null,this.leaveForm.get("docName").setValue(""))),"support"==t&&(this.issuppotAttachFileSizeTooHigh=!1,this.isAttachmentFileLength=!1,this.fileList.length>9&&(this.isAttachmentFileLength=!0),e.target.files&&e.target.files[0])){for(var a=e.target.files.length,c=0;c<a;c++)if(e.target.files[0].size>2e6){this.issuppotAttachFileSizeTooHigh=!0;break}if(!this.issuppotAttachFileSizeTooHigh)for(var r=0;r<a;r++)this.fileList.push(e.target.files[r]),this.urls.push({attachment:e.target.files[r].name}),this.leaveForm.get("suppotAttach").setValue(e.target.files[r].name),this.leaveForm.get("supportAttachName").setValue(e.target.files[r].name)}}},{key:"clearDoc",value:function(){this.isdocAttachFileSizeTooHigh=!1,this.docattachment="",this.leaveForm.get("docName").setValue(""),this.leaveForm.get("docAttach").setValue("")}},{key:"clearsupport",value:function(){this.fileList=[],this.urls=[],this.leaveForm.get("supportAttachName").setValue(""),this.leaveForm.get("suppotAttach").setValue("")}},{key:"getOneEmployeeRecord",value:function(){var e=this;this.loader.open(),this.modelService.getOne(this.employeeId).subscribe((function(t){"success"==t.keyword?(e.employee=t.leaveRequest[0],e.setValues(e.employee),e.urls=e.employee.attchment,e.loader.close()):(e.loader.close(),e.toaster.present(t.message))}))}},{key:"setValues",value:function(e){this.studentName=e.studentName;var t=this.severdatePipe.transform(e.fromDate),a=this.severdatePipe.transform(e.toDate);this.leaveForm.patchValue({employeeName:e.studentId,reqDate:e.reqDate,type:String(e.type),date:e.permissionDate,startTime:e.startTime,endTime:e.endTime,fromDate:t,fromDay:String(e.fromDay),toDate:a,toDay:String(e.toDay),reason:e.reason,docCert:e.isDoctorCertificate,docName:e.doctorAttach,docAttach:e.doctorAttach,suppotAttach:e.attchment}),this.docattachment=e.doctorAttach,a<=t&&(this.leaveForm.get("suppotAttach").clearValidators(),this.leaveForm.get("docCert").clearValidators(),this.leaveForm.get("docAttach").clearValidators(),this.leaveForm.get("suppotAttach").updateValueAndValidity(),this.leaveForm.get("docCert").updateValueAndValidity(),this.leaveForm.get("docAttach").updateValueAndValidity(),this.leaveForm.get("suppotAttach").setValue(""),this.leaveForm.get("docCert").setValue(""),this.leaveForm.get("docAttach").setValue(""),this.docattachment=null,this.leaveForm.get("docName").setValue(""),this.fileList=[])}},{key:"create",value:function(){var e,t,a,c,r,o,l,i,n,d,s,u=this;if(this.findInvalidControls(),this.leaveForm.valid){var m=this.leaveForm.value,p=this.severdatePipe.transform(null===(e=m)||void 0===e?void 0:e.fromDate),f=this.severdatePipe.transform(null===(t=m)||void 0===t?void 0:t.toDate),h=this.severdatePipe.transform(null===(a=m)||void 0===a?void 0:a.date),v=this.severdatePipe.transform(null===(c=m)||void 0===c?void 0:c.reqDate);if(this.leaveForm.valid){var g=new FormData;g.append("leave_request_id",this.employeeId),g.append("type",m.type),g.append("from_date",null!=p?p:""),g.append("to_date",null!=f?f:""),g.append("reason",null===(r=m)||void 0===r?void 0:r.reason),g.append("permission_date",null!=h?h:""),g.append("student_id",null===(o=m)||void 0===o?void 0:o.employeeName),g.append("req_date",null!=v?v:""),g.append("start_time",null===(l=m)||void 0===l?void 0:l.startTime),g.append("end_time",null===(i=m)||void 0===i?void 0:i.endTime),g.append("from_day",null===(n=m)||void 0===n?void 0:n.fromDay),g.append("to_day",null===(d=m)||void 0===d?void 0:d.toDay),g.append("is_doctor_certificate",null===(s=m)||void 0===s?void 0:s.docCert),this.docattachment&&g.append("doctor_attach",this.docattachment),this.fileList.forEach((function(e){g.append("attachment[]",e)})),this.loader.open(),this.modelService.save(g,"update").subscribe((function(e){"success"==e.keyword?(u.loader.close(),u.router.navigate(["/parent/leave-request/list"]),u.toaster.present(e.message,"")):"failed"==e.keyword&&(u.loader.close(),u.toaster.present(e.message,""))}))}}else R.a.fire({title:"Check Required",text:"Fill Mandatory Fields ",icon:"warning"})}},{key:"findInvalidControls",value:function(){var e=[],t=this.leaveForm.controls;for(var a in t)t[a].invalid&&e.push(a);return console.log(e,"invalid"),e}}])}(),Qt.\u0275fac=function(e){return new(e||Qt)(A.Xb(_),A.Xb(G.a),A.Xb(I.a),A.Xb(i.g),A.Xb(J.d),A.Xb(Ve.a),A.Xb(i.a))},Qt.\u0275cmp=A.Rb({type:Qt,selectors:[["app-edit"]],viewQuery:function(e,t){var a;1&e&&A.md(Dt,!0),2&e&&A.Nc(a=A.mc())&&(t.picker1=a.first)},features:[A.Fb([{provide:Ae.c,useClass:Ce.b},{provide:Ae.f,useValue:Ce.a},J.d])],decls:68,vars:13,consts:[[1,"create_btn"],["mat-raised-button","","color","green",1,"btn-primary-bg",3,"click"],["href","#",1,"discard_button",3,"routerLink"],[1,"form_bg","leave-request"],[1,"p-0"],[1,""],[1,"card-title-text"],[3,"formGroup"],["fxLayout","row wrap",1,"mt-24"],["fxFlex","100","fxFlex.gt-xs","10",1,"pt-12"],[1,"red_color"],["fxFlex","100","fxFlex.gt-xs","30",1,"pt-12"],["fxLayout","row wrap",1,"mt-16"],["fxFlex","100","fxFlex.gt-xs","40"],["appearance","fill"],["matInput","","formControlName","reqDate",3,"matDatepicker","focus","click"],["matSuffix","",3,"for"],["picker3",""],[4,"ngIf"],["fxLayout","row wrap",1,"mt-16","mb-16"],["fxFlex","100","fxFlex.gt-xs","10"],["fxFlex","100","fxFlex.gt-xs","40",1,"mt-0","mb-4"],["aria-label","Select an option","name","type","formControlName","type",1,"ml-15"],["value","0",1,"mr-40",3,"checked"],["value","1",1,"mr-40",3,"checked"],["class","mt-20",4,"ngIf"],["fxLayout","row wrap","class","mt-20",4,"ngIf"],["fxLayout","row wrap",1,""],["fxFlex","100","fxFlex.gt-xs","10",1,"mt-12"],["fxFlex","100","fxFlex.gt-xs","78.5",1,""],[1,"example-full-width"],["matInput","","placeholder","","formControlName","reason"],[1,"mt-20"],["fxLayout","row wrap",1,"row"],["fxFlex","100","fxFlex.gt-xs","40",1,""],["matInput","","formControlName","date",3,"matDatepicker","focus","click"],["picker4",""],["fxLayout","row wrap",1,"row","mt-8","mb-8"],["fxFlex","100","fxFlex.gt-xs","10",1,"label","mt-12"],["fxFlex","100","fxFlex.gt-xs","14",1,"starttime","pt-12"],["type","text","formControlName","startTime","matInput","","readonly","","value","",3,"ngxTimepicker","format"],["timePickerFrom",""],["fxFlex","100","fxFlex.gt-xs","11",1,"label","pl-24","mt-12"],["fxFlex","100","fxFlex.gt-xs","14",1,"endtime","pt-12"],["type","text","formControlName","endTime","matInput","","readonly","","value","",3,"min","ngxTimepicker","format"],["timePickerFroms",""],["fxLayout","row wrap",1,"mt-20"],["fxFlex","100","fxFlex.gt-xs","20",1,""],["matInput","","formControlName","fromDate",3,"matDatepicker","focus","click"],["picker5",""],["fxFlex","100","fxFlex.gt-xs","18",1,"pt-12"],["appearance","fill",1,"full-width"],["tabindex","10","formControlName","fromDay"],[3,"value",4,"ngFor","ngForOf"],["fxFlex","100","fxFlex.gt-xs","20",1,"pl-12"],["matInput","","placeholder","From date","formControlName","toDate",3,"matDatepicker","min","focus","click"],[3,"click"],["picker1",""],["fxFlex","100","fxFlex.gt-xs","18",1,"pt-12","pl-12"],["tabindex","10","formControlName","toDay"],[3,"value"],[1,"mt-16",2,"color","red"],["fxFlex","100","fxFlex.gt-xs","18",1,"mt-12"],["fxFlex","100","fxFlex.gt-xs","80",1,"mt-12"],["type","file","formControlName","suppotAttach",2,"display","none",3,"change"],["fileInput",""],["mat-raised-button","","class","btn-primary-bg ml-0","type","button",3,"click",4,"ngIf"],["class","ml-8",3,"click",4,"ngIf"],[1,"mt-8"],["style","color: red;",4,"ngIf"],[1,"f11"],["formControlName","supportAttachName","readonly","",2,"display","none"],["fxFlex","100","fxFlex.gt-xs","14",1,"mt-12"],["aria-label","Select an option","name","type1","formControlName","docCert",1,"ml-15"],["value","1","checked","leaveForm.controls.docCert.value == '1'",1,"mr-40"],["value","2","checked","leaveForm.controls.docCert.value == '2'",1,"mr-40"],["fxFlex","100","fxFlex.gt-xs","20","class","mt-12",4,"ngIf"],["mat-raised-button","","type","button",1,"btn-primary-bg","ml-0",3,"click"],[1,"attachment"],[1,"ml-8",3,"click"],[1,"delete-icon"],[2,"color","red"],["fxFlex","100","fxFlex.gt-xs","20",1,"mt-12"],["type","file",2,"display","none",3,"change"],["docfileInput",""],[1,"ml-4","mt-8"],["formControlName","docName","readonly","",2,"display","none"]],template:function(e,t){if(1&e){var a=A.ec();A.dc(0,"div",0),A.dc(1,"button",1),A.lc("click",(function(e){return t.create()})),A.cd(2,"Update"),A.cc(),A.dc(3,"a",2),A.cd(4,"Discard"),A.cc(),A.cc(),A.dc(5,"div",3),A.dc(6,"mat-card",4),A.dc(7,"mat-card-title",5),A.dc(8,"div",6),A.cd(9,"Update Leave Request"),A.cc(),A.Yb(10,"mat-divider"),A.cc(),A.dc(11,"mat-card-content"),A.dc(12,"form",7),A.dc(13,"div",8),A.dc(14,"div",9),A.dc(15,"label"),A.dc(16,"strong"),A.cd(17,"Student Name"),A.cc(),A.dc(18,"span",10),A.cd(19,"*"),A.cc(),A.cc(),A.cc(),A.dc(20,"div",11),A.Yb(21,"mat-label"),A.dc(22,"mat-label"),A.cd(23),A.cc(),A.cc(),A.cc(),A.dc(24,"div",12),A.dc(25,"div",9),A.dc(26,"label"),A.dc(27,"strong"),A.cd(28,"Req.Date"),A.cc(),A.dc(29,"span",10),A.cd(30,"*"),A.cc(),A.cc(),A.cc(),A.dc(31,"div",13),A.dc(32,"mat-form-field",14),A.Yb(33,"mat-label"),A.dc(34,"input",15),A.lc("focus",(function(e){return A.Sc(a),A.Oc(37).open()}))("click",(function(e){return A.Sc(a),A.Oc(37).open()})),A.cc(),A.Yb(35,"mat-datepicker-toggle",16),A.Yb(36,"mat-datepicker",null,17),A.ad(38,kt,2,0,"mat-error",18),A.cc(),A.cc(),A.cc(),A.dc(39,"div",19),A.dc(40,"div",20),A.dc(41,"label"),A.dc(42,"strong"),A.cd(43,"Type"),A.cc(),A.dc(44,"span",10),A.cd(45,"*"),A.cc(),A.cc(),A.cc(),A.dc(46,"div",21),A.dc(47,"mat-radio-group",22),A.dc(48,"mat-radio-button",23),A.cd(49," Permission "),A.cc(),A.dc(50,"mat-radio-button",24),A.cd(51,"Leave "),A.cc(),A.ad(52,At,2,0,"mat-error",18),A.cc(),A.cc(),A.cc(),A.ad(53,St,41,10,"div",25),A.ad(54,Nt,37,11,"div",26),A.dc(55,"div",27),A.dc(56,"div",28),A.dc(57,"label"),A.dc(58,"strong"),A.cd(59,"Reason"),A.cc(),A.dc(60,"span",10),A.cd(61,"*"),A.cc(),A.cc(),A.cc(),A.dc(62,"div",29),A.dc(63,"mat-form-field",30),A.Yb(64,"mat-label"),A.Yb(65,"textarea",31),A.ad(66,Pt,2,0,"mat-error",18),A.cc(),A.cc(),A.cc(),A.ad(67,Wt,43,9,"div",18),A.cc(),A.cc(),A.cc(),A.cc()}if(2&e){var c=A.Oc(37);A.Gb(3),A.yc("routerLink","/parent/leave-request/list"),A.Gb(9),A.yc("formGroup",t.leaveForm),A.Gb(11),A.dd(t.studentName),A.Gb(11),A.yc("matDatepicker",c),A.Gb(1),A.yc("for",c),A.Gb(3),A.yc("ngIf",null==t.control.reqDate.errors?null:t.control.reqDate.errors.required),A.Gb(10),A.zc("checked","0"==t.leaveForm.controls.type.value),A.Gb(2),A.zc("checked","1"==t.leaveForm.controls.type.value),A.Gb(2),A.yc("ngIf",null==t.control.type.errors?null:t.control.type.errors.required),A.Gb(1),A.yc("ngIf","0"===t.leaveForm.controls.type.value),A.Gb(1),A.yc("ngIf","1"===t.leaveForm.controls.type.value),A.Gb(12),A.yc("ngIf",null==t.control.reason.errors?null:t.control.reason.errors.required),A.Gb(1),A.yc("ngIf",t.leaveForm.controls.fromDate.value<t.leaveForm.controls.toDate.value||1==t.valide)}},directives:[z.a,i.j,Se.a,Se.f,_e.a,Se.c,d.D,d.u,d.k,B.c,B.a,M.e,M.b,U.b,d.c,Ie.b,d.t,d.i,Ie.d,M.f,Ie.a,n.o,Ge.b,Ge.a,M.a,f.d,f.a,Te.a,n.n,Ae.p,E.a],styles:["mat-form-field[_ngcontent-%COMP%]{width:97%}.label[_ngcontent-%COMP%]{margin-top:25px}button[_ngcontent-%COMP%]{background:#01a39d!important;color:#fff!important;border-radius:0}.discard_button[_ngcontent-%COMP%]{color:#01a39d;padding-left:15px}.datefield[_ngcontent-%COMP%]{margin-top:-10px}.mt-20[_ngcontent-%COMP%]{margin-top:20px}.ml-0[_ngcontent-%COMP%]{margin-left:0!important}.delete-icon[_ngcontent-%COMP%]{border:1px solid red;border-radius:50%;background:red;line-height:16px;width:15px!important;height:15px!important;color:#fff}"]}),Qt),data:{title:"Edit Leave Request",breadcrumb:"Edit"}}]}],ea=a("0OQn"),ta=a("zMWy"),aa=a("aYsj");a.d(t,"AppLeaveRequestModule",(function(){return ra}));var ca,ra=((ca=_createClass((function e(){_classCallCheck(this,e)}))).\u0275mod=A.Vb({type:ca}),ca.\u0275inj=A.Ub({factory:function(e){return new(e||ca)},imports:[[n.c,d.m,d.z,s.a,u.b,m.a,f.b,p.a,aa.a,ea.a,ta.a,i.k.forChild(Zt)]]}),ca)}}]);
/var/www/krbed.in/../../www/../www/html/../school_portal_admin/93-es5.cd6b717dc1a40ca6ba3b.js