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
/
51-es2015.0e9bf7d4352d82b4fa33.js
/
/
(window.webpackJsonp=window.webpackJsonp||[]).push([[51],{Attm:function(t,e,c){"use strict";class a{constructor(){this.classId="",this.className="",this.status=""}}var r=c("fXoL");c.d(e,"a",(function(){return n}));let n=(()=>{class t{adapt(t){return this.obj=new a,this.obj.classId=t.class_id,this.obj.className=t.class_name,this.obj.status=t.status,this.obj}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=r.Tb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},DGYh:function(t,e,c){"use strict";var a=c("NbAS"),r=c("fXoL");let n=(()=>{class t{adapt(t){return this.obj=new a.a,this.obj.academicYearId=t.academic_year_id,this.obj.academicYear=t.academic_year,this.obj.fromYear=t.from_year,this.obj.toYear=t.to_year,this.obj.yearName=t.year_name,this.obj.startDate=t.start_date,this.obj.endDate=t.end_date,this.obj.status=t.status,this.obj}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=r.Tb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),i=(()=>{class t{constructor(t){this.adapter=t}adapt(t){let e=[];return t.data.forEach(t=>{e.push(this.adapter.adapt(t))}),{keyword:t.keyword,message:t.message,academicYears:e,pageSize:t.count,page:t.page}}}return t.\u0275fac=function(e){return new(e||t)(r.hc(n))},t.\u0275prov=r.Tb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var o=c("tk/3"),l=c("q3Kh"),s=c("qc5V"),d=c("sYmb");c.d(e,"a",(function(){return u}));let u=(()=>{class t{constructor(t,e,c){this.translate=t,this.adapter=e,this.apiService=c}setLang(){return this.currentLang=localStorage.getItem("langCode"),this.currentLang}create(t){return this.apiService.post("academic/create",t).pipe(Object(l.map)(t=>this.adapter.adapt(t)))}update(t){return this.apiService.post("academic/update",t).pipe(Object(l.map)(t=>this.adapter.adapt(t)))}status(t,e){return this.apiService.post(2!=e?"academic/status":"academic/delete",t)}getOne(t){return this.apiService.get(`academic/${t}`).pipe(Object(l.map)(t=>this.adapter.adapt(t)))}getList(){let t=new o.e;return this.apiService.get("academic",t).pipe(Object(l.map)(t=>this.adapter.adapt(t)))}getListForAcademic(t){let e=new o.e;for(let c in t)e=e.set(c,t[c]);return this.apiService.get("academic",e).pipe(Object(l.map)(t=>this.adapter.adapt(t)))}}return t.\u0275fac=function(e){return new(e||t)(r.hc(d.d),r.hc(i),r.hc(s.a))},t.\u0275prov=r.Tb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},FWf1:function(t,e,c){"use strict";var a=this&&this.__extends||function(){var t=function(e,c){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var c in e)e.hasOwnProperty(c)&&(t[c]=e[c])})(e,c)};return function(e,c){function a(){this.constructor=e}t(e,c),e.prototype=null===c?Object.create(c):(a.prototype=c.prototype,new a)}}(),r=c("pshJ"),n=c("GiSu"),i=c("zB/H"),o=c("p//D"),l=c("n3uD"),s=c("MkmW"),d=function(t){function e(c,a,r){var i=t.call(this)||this;switch(i.syncErrorValue=null,i.syncErrorThrown=!1,i.syncErrorThrowable=!1,i.isStopped=!1,arguments.length){case 0:i.destination=n.empty;break;case 1:if(!c){i.destination=n.empty;break}if("object"==typeof c){c instanceof e?(i.syncErrorThrowable=c.syncErrorThrowable,i.destination=c,c.add(i)):(i.syncErrorThrowable=!0,i.destination=new u(i,c));break}default:i.syncErrorThrowable=!0,i.destination=new u(i,c,a,r)}return i}return a(e,t),e.prototype[o.rxSubscriber]=function(){return this},e.create=function(t,c,a){var r=new e(t,c,a);return r.syncErrorThrowable=!1,r},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var t=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this},e}(i.Subscription);e.Subscriber=d;var u=function(t){function e(e,c,a,i){var o,l=t.call(this)||this;l._parentSubscriber=e;var s=l;return r.isFunction(c)?o=c:c&&(o=c.next,a=c.error,i=c.complete,c!==n.empty&&(s=Object.create(c),r.isFunction(s.unsubscribe)&&l.add(s.unsubscribe.bind(s)),s.unsubscribe=l.unsubscribe.bind(l))),l._context=s,l._next=o,l._error=a,l._complete=i,l}return a(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;l.config.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,c=l.config.useDeprecatedSynchronousErrorHandling;if(this._error)c&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)c?(e.syncErrorValue=t,e.syncErrorThrown=!0):s.hostReportError(t),this.unsubscribe();else{if(this.unsubscribe(),c)throw t;s.hostReportError(t)}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var c=function(){return t._complete.call(t._context)};l.config.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,c),this.unsubscribe()):(this.__tryOrUnsub(c),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(c){if(this.unsubscribe(),l.config.useDeprecatedSynchronousErrorHandling)throw c;s.hostReportError(c)}},e.prototype.__tryOrSetError=function(t,e,c){if(!l.config.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,c)}catch(a){return l.config.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=a,t.syncErrorThrown=!0,!0):(s.hostReportError(a),!0)}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(d);e.SafeSubscriber=u},GMZp:function(t,e,c){"use strict";e.isObject=function(t){return null!==t&&"object"==typeof t}},GiSu:function(t,e,c){"use strict";var a=c("n3uD"),r=c("MkmW");e.empty={closed:!0,next:function(t){},error:function(t){if(a.config.useDeprecatedSynchronousErrorHandling)throw t;r.hostReportError(t)},complete:function(){}}},LBXl:function(t,e,c){"use strict";e.UnsubscriptionError=function(){function t(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t}()},MkmW:function(t,e,c){"use strict";e.hostReportError=function(t){setTimeout((function(){throw t}),0)}},NbAS:function(t,e,c){"use strict";c.d(e,"a",(function(){return a}));class a{constructor(){this.academicYearId="",this.academicYear="",this.fromYear=0,this.toYear=0,this.yearName="",this.startDate="",this.endDate="",this.status=""}}},k9Bo:function(t,e,c){"use strict";var a=c("tk/3"),r=c("2Vo4"),n=c("lJxs"),i=c("Attm"),o=c("fXoL");let l=(()=>{class t{constructor(t){this.adapter=t}adapt(t){let e=[];return t.data.forEach(t=>{e.push(this.adapter.adapt(t))}),{keyword:t.keyword,message:t.message,classes:e,pageSize:t.count,page:t.page}}}return t.\u0275fac=function(e){return new(e||t)(o.hc(i.a))},t.\u0275prov=o.Tb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var s=c("qc5V");c.d(e,"a",(function(){return d}));let d=(()=>{class t{constructor(t,e){this.adapter=t,this.apiService=e,this.recordAddedSubject=new r.a([{}]),this.recordUpdatedSubject=new r.a([{}]),this.userId=0}create(t){return this.apiService.post("class/create",t).pipe(Object(n.a)(t=>this.adapter.adapt(t)))}update(t){return this.apiService.post("class/update",t).pipe(Object(n.a)(t=>this.adapter.adapt(t)))}status(t,e){return this.apiService.post(2!=e?"class/status":"class/delete",t)}getListForClass(t){let e=new a.e;for(let c in t)e=e.set(c,t[c]);return this.apiService.get("class",e).pipe(Object(n.a)(t=>this.adapter.adapt(t)))}getList(){let t=new a.e;return this.apiService.get("class",t).pipe(Object(n.a)(t=>this.adapter.adapt(t)))}getRecordAddedSub(){return this.recordAddedSubject.asObservable()}getRecordUpdatedSub(){return this.recordUpdatedSubject.asObservable()}getClassByBatch(t){return this.apiService.get(`loadClassByBatch/${t}`).pipe(Object(n.a)(t=>this.adapter.adapt(t)))}getClasses(t){return this.apiService.get(`getAttendClass/${t}`).pipe(Object(n.a)(t=>this.adapter.adapt(t)))}}return t.\u0275fac=function(e){return new(e||t)(o.hc(l),o.hc(s.a))},t.\u0275prov=o.Tb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},live:function(t,e,c){"use strict";c.d(e,"b",(function(){return o})),c.d(e,"a",(function(){return s}));var a=c("FKr1"),r=c("sWYD"),n=c("47VO"),i=c("fXoL");let o=(()=>{class t extends a.w{format(t,e){return"input"===e?Object(r.a)(t,Object(n.b)()):t.toDateString()}}return t.\u0275fac=function(e){return l(e||t)},t.\u0275prov=i.Tb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();const l=i.fc(o),s={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"}}}},mbIT:function(t,e,c){"use strict";e.isArray=function(){return Array.isArray||function(t){return t&&"number"==typeof t.length}}()},n3uD:function(t,e,c){"use strict";var a=!1;e.config={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){if(t){var e=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+e.stack)}else a&&console.log("RxJS: Back to a better error behavior. Thank you. <3");a=t},get useDeprecatedSynchronousErrorHandling(){return a}}},"p//D":function(t,e,c){"use strict";e.rxSubscriber=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),e.$$rxSubscriber=e.rxSubscriber},pshJ:function(t,e,c){"use strict";e.isFunction=function(t){return"function"==typeof t}},q3Kh:function(t,e,c){"use strict";var a=this&&this.__extends||function(){var t=function(e,c){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var c in e)e.hasOwnProperty(c)&&(t[c]=e[c])})(e,c)};return function(e,c){function a(){this.constructor=e}t(e,c),e.prototype=null===c?Object.create(c):(a.prototype=c.prototype,new a)}}(),r=c("FWf1");e.map=function(t,e){return function(c){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return c.lift(new n(t,e))}};var n=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new i(t,this.project,this.thisArg))},t}();e.MapOperator=n;var i=function(t){function e(e,c,a){var r=t.call(this,e)||this;return r.project=c,r.count=0,r.thisArg=a||r,r}return a(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(c){return void this.destination.error(c)}this.destination.next(e)},e}(r.Subscriber)},q5SV:function(t,e,c){"use strict";c.r(e);var a=c("tyNb"),r=c("ofXK"),n=c("3Pt+"),i=c("YUcS"),o=c("CzEO"),l=c("lDzL"),s=c("7pIB"),d=c("r3oX"),u=c("0IaG"),m=c("Gh3/"),p=c("FKr1"),h=c("live"),g=c("Olgc"),f=c("Gg3P"),b=c("tk/3"),y=c("lJxs");class k{constructor(){this.customizeDate="",this.empAttendanceGroupId="",this.status="",this.department="",this.position="",this.departmentNames="",this.positionNames="",this.routineList=[],this.departmentIds="",this.positionIds=""}}class v{constructor(){this.checkIn="",this.checkOut="",this.day="",this.dayId="",this.empAttendanceRoutineId="",this.halfDayMark="",this.isWorkingDay="",this.lateMark="",this.status=""}}class S{constructor(){this.checkIn="",this.checkOut="",this.day="",this.halfDayMarkTime="",this.isWorkingDay="",this.lateMarkMin=""}}var D=c("fXoL");let I=(()=>{class t{constructor(){}adapt(t){var e,c,a,r,n,i,o;let l=[];return(null===(c=null===(e=t)||void 0===e?void 0:e.routine)||void 0===c?void 0:c.length)>0&&t.routine.forEach(t=>{l.push(this.adaptRoutine(t))}),this.obj=new k,this.obj.customizeDate=null!=(a=t.customize_date)?a:"",this.obj.empAttendanceGroupId=null!=(r=t.emp_attendance_group_id)?r:"",this.obj.status=null!=(n=t.status)?n:"",this.obj.department=null!=(i=t.department)?i:"",this.obj.departmentNames=this.filterArray("name",t.department),this.obj.departmentIds=this.filterArray("employee_department_id",t.department),this.obj.position=null!=(o=t.position)?o:"",this.obj.positionNames=this.filterArray("name",t.position),this.obj.positionIds=this.filterArray("employee_position_id",t.position),this.obj.routineList=l,this.obj}filterArray(t,e){return Array.isArray(e)?e.map(e=>e[t]):e}adaptRoutine(t){var e,c,a,r,n,i,o,l,s;return this.routineObj=new v,this.routineObj.checkIn=null!=(e=t.check_in)?e:"",this.routineObj.checkOut=null!=(c=t.check_out)?c:"",this.routineObj.day=null!=(a=t.day)?a:"",this.routineObj.dayId=null!=(r=t.day_id)?r:"",this.routineObj.empAttendanceRoutineId=null!=(n=t.emp_attendance_routine_id)?n:"",this.routineObj.halfDayMark=null!=(i=t.half_day_mark)?i:"",this.routineObj.isWorkingDay=null!=(o=t.is_working_day)?o:"",this.routineObj.lateMark=null!=(l=t.late_mark)?l:"",this.routineObj.status=null!=(s=t.status)?s:"",this.routineObj}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=D.Tb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var M=c("wd/R");let O=(()=>{class t{constructor(){this.days=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]}adapt(t){var e,c,a,r,n,i,o;let l=[];return(null===(c=null===(e=t)||void 0===e?void 0:e.routine)||void 0===c?void 0:c.length)>0&&t.routine.forEach(t=>{l.push(this.adaptRoutine(t))}),this.obj=new k,this.obj.customizeDate=null!=(a=t.customize_date)?a:"",this.obj.empAttendanceGroupId=null!=(r=t.emp_attendance_group_id)?r:"",this.obj.status=null!=(n=t.status)?n:"",this.obj.department=null!=(i=t.department)?i:"",this.obj.departmentNames=this.filterArray("name",t.department),this.obj.departmentIds=this.filterArray("employee_department_id",t.department),this.obj.position=null!=(o=t.position)?o:"",this.obj.positionNames=this.filterArray("name",t.position),this.obj.positionIds=this.filterArray("employee_position_id",t.position),this.obj.routineList=l,this.obj}filterArray(t,e){return Array.isArray(e)?e.map(e=>e[t]):e}adaptRoutine(t){var e,c,a;return this.routineObj=new S,this.routineObj.checkIn=null!=(e=t.check_in)?e:"00:00:00",this.routineObj.checkOut=null!=(c=t.check_out)?c:"00:00:00",this.routineObj.day=t.day_id?this.days[t.day_id-1]:"Monday",this.routineObj.halfDayMarkTime=null!=(a=t.half_day_mark)?a:"00:00:00",this.routineObj.isWorkingDay=1==t.is_working_day?"true":"false",this.routineObj.lateMarkMin=t.late_mark?M(t.late_mark,"HH:mm:ss").format("ss"):"00",this.routineObj}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=D.Tb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),x=(()=>{class t{constructor(t,e){this.adapter=t,this.adapterList=e}adapt(t){var e;let c=[];return(null===(e=t)||void 0===e?void 0:e.data[0])&&t.data[0].forEach(t=>{c.push(this.adapter.adapt(t))}),{keyword:t.keyword,message:t.message,empList:c,pageSize:t.count,page:t.page}}adaptList(t){var e;let c=[];return(null===(e=t)||void 0===e?void 0:e.data[0])&&t.data[0].forEach(t=>{c.push(this.adapterList.adapt(t))}),{keyword:t.keyword,message:t.message,empList:c,pageSize:t.count,page:t.page}}}return t.\u0275fac=function(e){return new(e||t)(D.hc(I),D.hc(O))},t.\u0275prov=D.Tb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var _=c("qc5V");class T{constructor(){this.departmentId="",this.name=""}}let A=(()=>{class t{adapt(t){return this.dept=new T,this.dept.departmentId=t.employee_department_id,this.dept.name=t.name,this.dept}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=D.Tb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),w=(()=>{class t{constructor(t){this.adapterDept=t}adapt(t){var e,c,a,r,n,i,o,l;let s=[];(null===(c=null===(e=t)||void 0===e?void 0:e.data)||void 0===c?void 0:c.overall_id)&&(null===(r=null===(a=t)||void 0===a?void 0:a.data)||void 0===r||r.overall_id.forEach(t=>{s.push(this.adapterDept.adapt(t))}));let d=[];return(null===(i=null===(n=t)||void 0===n?void 0:n.data)||void 0===i?void 0:i.selected_id)&&(null===(l=null===(o=t)||void 0===o?void 0:o.data)||void 0===l||l.selected_id.forEach(t=>{d.push(this.adapterDept.adapt(t))})),{keyword:t.keyword,message:t.message,departments:s,selectedDept:d,pageSize:t.count,page:t.page}}}return t.\u0275fac=function(e){return new(e||t)(D.hc(A))},t.\u0275prov=D.Tb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();class C{constructor(){this.positionId="",this.positionName=""}}let F=(()=>{class t{adapt(t){var e,c;return this.obj=new C,this.obj.positionId=null!=(e=t.employee_position_id)?e:"",this.obj.positionName=null!=(c=t.name)?c:"",this.obj}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=D.Tb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),E=(()=>{class t{constructor(t){this.adapter=t}adapt(t){var e,c,a,r,n,i,o,l,s,d;let u=[];(null===(c=null===(e=t)||void 0===e?void 0:e.data)||void 0===c?void 0:c.overall_id)&&(null===(n=null===(r=null===(a=t)||void 0===a?void 0:a.data)||void 0===r?void 0:r.overall_id)||void 0===n||n.forEach(t=>{u.push(this.adapter.adapt(t))}));let m=[];return(null===(o=null===(i=t)||void 0===i?void 0:i.data)||void 0===o?void 0:o.selected_id)&&(null===(d=null===(s=null===(l=t)||void 0===l?void 0:l.data)||void 0===s?void 0:s.selected_id)||void 0===d||d.forEach(t=>{m.push(this.adapter.adapt(t))})),{keyword:t.keyword,message:t.message,positions:u,selectedPositions:m,pageSize:t.count,page:t.page}}}return t.\u0275fac=function(e){return new(e||t)(D.hc(F))},t.\u0275prov=D.Tb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();class P{constructor(){this.checkIn="",this.checkOut="",this.halfDayMark="",this.status="",this.customizeDate="",this.empAttendanceCustomizeDateId=""}}let G=(()=>{class t{constructor(){}adapt(t){var e,c,a,r,n,i,o,l,s;return this.obj=new P,this.obj.checkIn=(null===(e=t)||void 0===e?void 0:e.check_in)?M(t.check_in,"HH:mm:ss").format("HH:mm"):"",this.obj.checkOut=(null===(c=t)||void 0===c?void 0:c.check_out)?M(t.check_out,"HH:mm:ss").format("HH:mm"):"",this.obj.customizeDate=(null===(a=t)||void 0===a?void 0:a.customize_date)?M(t.customize_date,"YYYY-MM-DD").format("DD-MM-YYYY"):"",this.obj.empAttendanceCustomizeDateId=null!=(n=null===(r=t)||void 0===r?void 0:r.emp_attendance_customize_date_id)?n:"",this.obj.halfDayMark=(null===(i=t)||void 0===i?void 0:i.half_day_mark)?M(t.half_day_mark,"HH:mm:ss").format("HH:mm"):"",this.obj.lateMark=(null===(o=t)||void 0===o?void 0:o.late_mark)?M(t.late_mark,"HH:mm:ss").diff(M().startOf("day"),"minutes"):"00",this.obj.status=null!=(s=null===(l=t)||void 0===l?void 0:l.status)?s:"",this.obj}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=D.Tb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),Y=(()=>{class t{constructor(t){this.adapter=t}adapt(t){var e;let c=[];return(null===(e=t)||void 0===e?void 0:e.data[0])&&t.data[0].forEach(t=>{c.push(this.adapter.adapt(t))}),{keyword:t.keyword,message:t.message,customizeList:c,pageSize:t.count,page:t.page}}adaptCreateResponse(t){var e;let c=[];return(null===(e=t)||void 0===e?void 0:e.data[0])&&t.data.forEach(t=>{c.push(this.adapter.adapt(t))}),{keyword:t.keyword,message:t.message,customizeList:c,pageSize:t.count,page:t.page}}}return t.\u0275fac=function(e){return new(e||t)(D.hc(G))},t.\u0275prov=D.Tb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),z=(()=>{class t{constructor(t,e,c,a,r){this.adapter=t,this.customizeAdapt=e,this.deptAdap=c,this.postAdap=a,this.apiService=r,this.userId=0}getList(t){let e=new b.e;for(let c in t)e=e.set(c,t[c]);return this.apiService.get("EmpAttendanceList",e).pipe(Object(y.a)(t=>this.adapter.adaptList(t)))}getDepartmentList(t){return this.apiService.get(`getAttendanceDept/${t}`).pipe(Object(y.a)(t=>this.deptAdap.adapt(t)))}getPositionList(t){return this.apiService.get(`getAttendancePos/${t}`).pipe(Object(y.a)(t=>this.postAdap.adapt(t)))}createEmpAttendanceRoutine(t){return this.apiService.post("EmpAttendanceRoutine/create",t).pipe(Object(y.a)(t=>this.adapter.adapt(t)))}updateEmpAttendanceRoutine(t){return this.apiService.post("EmpAttendanceRoutine/update",t).pipe(Object(y.a)(t=>this.adapter.adapt(t)))}getOneEmpAttendacneRoutine(t){return this.apiService.get(`EmpAttendanceRoutine/${t}`).pipe(Object(y.a)(t=>this.adapter.adapt(t)))}changeEmpAttendanceRoutineStatus(t){return this.apiService.post("EmpAttendanceRoutine/status",t).pipe(Object(y.a)(t=>this.adapter.adapt(t)))}getEmpCustomizeList(t){return this.apiService.get(`cusDateList/${t}`).pipe(Object(y.a)(t=>this.customizeAdapt.adapt(t)))}getOneEmpCustomizeList(t){return this.apiService.get(`EmpAttendanceDate/${t}`).pipe(Object(y.a)(t=>this.customizeAdapt.adapt(t)))}createEmpAttendanceCustom(t){return this.apiService.post("EmpAttendanceCusDate/create",t).pipe(Object(y.a)(t=>this.customizeAdapt.adaptCreateResponse(t)))}updateEmpAttendanceCustom(t){return this.apiService.post("EmpAttendanceCusDate/update",t).pipe(Object(y.a)(t=>this.customizeAdapt.adaptCreateResponse(t)))}deleteEmpAttendanceCustom(t){return this.apiService.post("EmpAttendanceCusDate/delete",t).pipe(Object(y.a)(t=>this.customizeAdapt.adapt(t)))}createEmpAttendanceTracking(t){return this.apiService.devicepost("attendance/set/employee-attendance-settings",t)}createEmpAttendanceDateTracking(t){return this.apiService.devicepost("attendance/set/employee-attendance-date-settings",t)}updateEmpAttendanceDateTracking(t){return this.apiService.deviceput("attendance/update/employee-attendance-date-settings",t)}deleteEmpAttendanceDateTracking(t){return this.apiService.devicepost("attendance/delete/employee-attendance-date-settings",t)}deviceStatus(t){return this.apiService.post("updateDevice",t).pipe(Object(y.a)(t=>this.adapter.adapt(t)))}}return t.\u0275fac=function(e){return new(e||t)(D.hc(x),D.hc(Y),D.hc(w),D.hc(E),D.hc(_.a))},t.\u0275prov=D.Tb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var H=c("34SS"),j=c("LvDl"),V=c("jtrZ"),L=c("Wp6s"),B=c("f0Cb"),N=c("XiUz"),q=c("kmnG"),R=c("qFsG"),X=c("iadO"),W=c("bTqV");function $(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide date "),D.cc())}function U(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide the check in time "),D.cc())}function J(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide the check out time "),D.cc())}function K(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide the half day mark time "),D.cc())}function Q(t,e){1&t&&(D.dc(0,"span"),D.cd(1," Please provide the late mark after time "),D.cc())}function Z(t,e){if(1&t&&(D.dc(0,"mat-error"),D.ad(1,Q,2,0,"span",28),D.cc()),2&t){const t=D.pc(),e=D.Oc(74);D.Gb(1),D.yc("ngIf",null==t.control?null:null==t.control.lateMarkAfter?null:t.control.lateMarkAfter.errors.required)("ngIfElse",e)}}function tt(t,e){1&t&&(D.dc(0,"mat-error"),D.dc(1,"span"),D.cd(2," Please provide the valid late mark after time "),D.cc(),D.cc())}function et(t,e){if(1&t&&D.ad(0,tt,3,0,"mat-error",28),2&t){const t=D.pc(),e=D.Oc(76);D.yc("ngIf",null==t.control?null:null==t.control.lateMarkAfter?null:t.control.lateMarkAfter.errors.pattern)("ngIfElse",e)}}function ct(t,e){1&t&&(D.dc(0,"mat-error"),D.dc(1,"span"),D.cd(2," Please provide the minute within 2 digit "),D.cc(),D.cc())}function at(t,e){if(1&t&&D.ad(0,ct,3,0,"mat-error",28),2&t){const t=D.pc(),e=D.Oc(78);D.yc("ngIf",null==t.control?null:null==t.control.lateMarkAfter?null:t.control.lateMarkAfter.errors.maxLength)("ngIfElse",e)}}function rt(t,e){1&t&&(D.dc(0,"mat-error"),D.dc(1,"span"),D.cd(2," Please provide the minute within 60 minutes "),D.cc(),D.cc())}function nt(t,e){if(1&t&&D.ad(0,rt,3,0,"mat-error",13),2&t){const t=D.pc();D.yc("ngIf",null==t.control?null:null==t.control.lateMarkAfter?null:t.control.lateMarkAfter.errors.max)}}let it=(()=>{class t{constructor(t,e,c,a,r,n,i,o){this.dialogRef=t,this.data=e,this.appServerDatePipe=c,this.toaster=a,this.loader=r,this.modelService=n,this.fb=i,this.config=o,this.timeFormat=Number(this.config.timeFormat),this.setForm()}setForm(){this.customizeForm=this.fb.group({date:["",n.B.required],checkIn:["",n.B.required],checkOut:["",n.B.required],halfDayMarkTime:["",n.B.required],lateMarkAfter:new n.g("",[n.B.required,n.B.pattern(/^[0-9]{1,2}$/),n.B.max(60),n.B.maxLength(2)])})}get control(){return this.customizeForm.controls}ngOnInit(){this.depart=this.data.departmentArr,this.post=this.data.positionArr,this.groupId=this.data.groupId,this.routineData=this.data.routineArray}submit(){var t,e,c,a,r,n,i,o,l,s,d;if(this.customizeForm.valid){var u=this.customizeForm.value;let m=this.appServerDatePipe.transform(null===(t=u)||void 0===t?void 0:t.date),p=M.utc().startOf("day").add(null===(e=u)||void 0===e?void 0:e.lateMarkAfter,"minutes").format("HH:mm"),h=new FormData;h.append("emp_attendance_group_id",null!=(c=this.groupId)?c:""),h.append("department_id",null!=(a=this.depart.toString())?a:""),h.append("position_id",null!=(r=this.post.toString())?r:""),h.append("customize_date",null!=m?m:""),h.append("check_in",null!=(i=null===(n=u)||void 0===n?void 0:n.checkIn)?i:""),h.append("check_out",null!=(l=null===(o=u)||void 0===o?void 0:o.checkOut)?l:""),h.append("half_day_mark",null!=(d=null===(s=u)||void 0===s?void 0:s.halfDayMarkTime)?d:""),h.append("late_mark",null!=p?p:""),h.append("attendance_data",JSON.stringify(this.routineData)),this.loader.open(),this.modelService.createEmpAttendanceCustom(h).subscribe(t=>{"success"==t.keyword?(this.empResponse=t.customizeList[0],this.createCustomizeTracking(u),this.loader.close(),this.close(!0),this.toaster.present(t.message,"")):"failed"==t.keyword&&(this.loader.close(),this.toaster.present(t.message,""))})}}createCustomizeTracking(t){var e,c,a,r,n,i,o,l,s;const d=Object(H.b)();let u=Object(j.get)(d,"customer_id"),m=Object(j.get)(d,"branch_id"),p=(null===(e=t)||void 0===e?void 0:e.date)?this.appServerDatePipe.transform(null===(c=t)||void 0===c?void 0:c.date):M().format("YYYY-MM-DD"),h=(null===(a=t)||void 0===a?void 0:a.checkIn)?M(t.checkIn,"HH:mm").format("HH:mm:ss"):"00:00:00",g=(null===(r=t)||void 0===r?void 0:r.checkOut)?M(t.checkOut,"HH:mm").format("HH:mm:ss"):"00:00:00",f=(null===(n=t)||void 0===n?void 0:n.halfDayMarkTime)?M(t.halfDayMarkTime,"HH:mm").format("HH:mm:ss"):"00:00:00",b=this.depart?this.depart:[],y=this.post?this.post:[],k=new FormData;k.append("customerId",String(u)),k.append("schoolId",String(m)),k.append("departmentIds",null!=(i=String(b))?i:""),k.append("positionIds",null!=(o=String(y))?o:""),k.append("thisDate",null!=p?p:""),k.append("checkIn",null!=h?h:""),k.append("checkOut",null!=g?g:""),k.append("halfDayMarkTime",null!=f?f:""),k.append("lateMarkMin",null!=(s=String(null===(l=t)||void 0===l?void 0:l.lateMarkAfter))?s:""),k.append("isWorkingDay","true"),this.modelService.createEmpAttendanceDateTracking(k).subscribe(t=>{let e=t;"Success"==e.keyword?(this.deviceInsert(),console.log("Tracking created",e)):console.log("Tracking created",e)})}deviceInsert(){let t=new FormData;t.append("id",this.groupId),t.append("type","emp_attendance_date"),this.modelService.deviceStatus(t).subscribe(t=>{console.log("Tracking created",t)})}close(t){this.dialogRef.close(t)}}return t.\u0275fac=function(e){return new(e||t)(D.Xb(u.f),D.Xb(u.a),D.Xb(m.d),D.Xb(g.a),D.Xb(f.a),D.Xb(z),D.Xb(n.f),D.Xb(V.a))},t.\u0275cmp=D.Rb({type:t,selectors:[["app-edit"]],features:[D.Fb([{provide:p.c,useClass:h.b},{provide:p.f,useValue:h.a},m.d])],decls:83,vars:16,consts:[[1,"form_bg"],[1,"p-0"],[1,""],[1,"card-title-text"],["autocomplete","off",3,"formGroup"],["fxLayout","row wrap",1,"mt-0"],["fxFlex","100","fxFlex.gt-xs","30",1,"pt-12"],[1,"red_color"],["fxFlex","100","fxFlex.gt-xs","70",1,""],["appearance","fill"],["matInput","","formControlName","date",3,"matDatepicker","click"],["matSuffix","",3,"for"],["picker",""],[4,"ngIf"],["fxFlex","100","fxFlex.gt-xs","30",1,""],["appearance","fill",1,""],["type","text","matInput","","formControlName","checkIn","readonly","","value","",3,"ngxTimepicker","format"],["timePickerFrom",""],["type","text","matInput","","formControlName","checkOut","readonly","","value","",3,"min","ngxTimepicker","format"],["timePickerTo",""],["type","text","matInput","","formControlName","halfDayMarkTime","readonly","","value","",3,"ngxTimepicker","format"],["timePickerHalfDay",""],["matInput","","formControlName","lateMarkAfter"],["patternError",""],["maxLengthError",""],["maxError",""],["mat-raised-button","","color","primary",1,"btn-primary-bg","ml-0",3,"disabled","click"],[1,"pl-8","primary-txt-color",3,"click"],[4,"ngIf","ngIfElse"]],template:function(t,e){if(1&t){const t=D.ec();D.dc(0,"div",0),D.dc(1,"mat-card",1),D.dc(2,"mat-card-title",2),D.dc(3,"div",3),D.cd(4,"Create Customize Date"),D.cc(),D.Yb(5,"mat-divider"),D.cc(),D.dc(6,"mat-card-content"),D.dc(7,"form",4),D.dc(8,"div",5),D.dc(9,"div",6),D.dc(10,"label"),D.dc(11,"strong"),D.cd(12,"Date"),D.cc(),D.dc(13,"span",7),D.cd(14,"*"),D.cc(),D.cc(),D.cc(),D.dc(15,"div",8),D.dc(16,"mat-form-field",9),D.Yb(17,"mat-label"),D.dc(18,"input",10),D.lc("click",(function(e){return D.Sc(t),D.Oc(21).open()})),D.cc(),D.Yb(19,"mat-datepicker-toggle",11),D.Yb(20,"mat-datepicker",null,12),D.ad(22,$,2,0,"mat-error",13),D.cc(),D.cc(),D.cc(),D.dc(23,"div",5),D.dc(24,"div",14),D.dc(25,"label"),D.dc(26,"strong"),D.cd(27," Check In"),D.cc(),D.dc(28,"span",7),D.cd(29,"*"),D.cc(),D.cc(),D.cc(),D.dc(30,"div",8),D.dc(31,"mat-form-field",15),D.Yb(32,"input",16),D.Yb(33,"ngx-material-timepicker",null,17),D.ad(35,U,2,0,"mat-error",13),D.cc(),D.cc(),D.cc(),D.dc(36,"div",5),D.dc(37,"div",14),D.dc(38,"label"),D.dc(39,"strong"),D.cd(40," Check Out"),D.cc(),D.dc(41,"span",7),D.cd(42,"*"),D.cc(),D.cc(),D.cc(),D.dc(43,"div",8),D.dc(44,"mat-form-field",15),D.Yb(45,"input",18),D.Yb(46,"ngx-material-timepicker",null,19),D.ad(48,J,2,0,"mat-error",13),D.cc(),D.cc(),D.cc(),D.dc(49,"div",5),D.dc(50,"div",14),D.dc(51,"label"),D.dc(52,"strong"),D.cd(53,"Half Day Mark Time"),D.cc(),D.dc(54,"span",7),D.cd(55,"*"),D.cc(),D.cc(),D.cc(),D.dc(56,"div",8),D.dc(57,"mat-form-field",15),D.Yb(58,"input",20),D.Yb(59,"ngx-material-timepicker",null,21),D.ad(61,K,2,0,"mat-error",13),D.cc(),D.cc(),D.cc(),D.dc(62,"div",5),D.dc(63,"div",14),D.dc(64,"label"),D.dc(65,"strong"),D.cd(66,"Late Mark After(Mins)"),D.cc(),D.dc(67,"span",7),D.cd(68,"*"),D.cc(),D.cc(),D.cc(),D.dc(69,"div",8),D.dc(70,"mat-form-field",9),D.Yb(71,"input",22),D.ad(72,Z,2,2,"mat-error",13),D.ad(73,et,1,2,"ng-template",null,23,D.bd),D.ad(75,at,1,2,"ng-template",null,24,D.bd),D.ad(77,nt,1,1,"ng-template",null,25,D.bd),D.cc(),D.cc(),D.cc(),D.dc(79,"button",26),D.lc("click",(function(t){return e.submit()})),D.cd(80,"Submit"),D.cc(),D.dc(81,"a",27),D.lc("click",(function(t){return e.close(!1)})),D.cd(82,"Discard"),D.cc(),D.cc(),D.cc(),D.cc(),D.cc()}if(2&t){const t=D.Oc(21),c=D.Oc(34),a=D.Oc(47),r=D.Oc(60);D.Gb(7),D.yc("formGroup",e.customizeForm),D.Gb(11),D.yc("matDatepicker",t),D.Gb(1),D.yc("for",t),D.Gb(3),D.yc("ngIf",(null==e.control?null:null==e.control.date?null:null==e.control.date.errors?null:e.control.date.errors.required)&&(null==e.control?null:null==e.control.date?null:e.control.date.touched)),D.Gb(10),D.yc("ngxTimepicker",c)("format",e.timeFormat),D.Gb(3),D.yc("ngIf",(null==e.control?null:null==e.control.checkIn?null:null==e.control.checkIn.errors?null:e.control.checkIn.errors.required)&&(null==e.control?null:null==e.control.checkIn?null:e.control.checkIn.touched)),D.Gb(10),D.yc("min",null==e.control?null:null==e.control.checkIn?null:e.control.checkIn.value)("ngxTimepicker",a)("format",e.timeFormat),D.Gb(3),D.yc("ngIf",(null==e.control?null:null==e.control.checkOut?null:null==e.control.checkOut.errors?null:e.control.checkOut.errors.required)&&(null==e.control?null:null==e.control.checkOut?null:e.control.checkOut.touched)),D.Gb(10),D.yc("ngxTimepicker",r)("format",e.timeFormat),D.Gb(3),D.yc("ngIf",(null==e.control?null:null==e.control.halfDayMarkTime?null:null==e.control.halfDayMarkTime.errors?null:e.control.halfDayMarkTime.errors.required)&&(null==e.control?null:null==e.control.halfDayMarkTime?null:e.control.halfDayMarkTime.touched)),D.Gb(11),D.yc("ngIf",(null==e.control?null:null==e.control.lateMarkAfter?null:e.control.lateMarkAfter.errors)&&((null==e.control?null:null==e.control.lateMarkAfter?null:e.control.lateMarkAfter.dirty)||(null==e.control?null:null==e.control.lateMarkAfter?null:e.control.lateMarkAfter.touched))),D.Gb(7),D.yc("disabled",!e.customizeForm.valid)}},directives:[L.a,L.f,B.a,L.c,n.D,n.u,n.k,N.c,N.a,q.b,q.e,R.b,n.c,X.b,n.t,n.i,X.d,q.f,X.a,r.o,d.d,d.a,W.a,q.a],styles:[".mat-form-field[_ngcontent-%COMP%]{width:80%}.batch-name[_ngcontent-%COMP%]{font-size:24px}mat-checkbox[_ngcontent-%COMP%]{margin-right:23px}.text-center[_ngcontent-%COMP%]{text-align:center!important}th[_ngcontent-%COMP%]{border-bottom:1px solid grey}.ml-0[_ngcontent-%COMP%]{margin-left:0!important}.btn-dis[_ngcontent-%COMP%]:disabled, .btn-dis[disabled][_ngcontent-%COMP%]{border:1px solid #999!important;background-color:#ccc!important;color:#666!important}"]}),t})();var ot=c("PSD3"),lt=c.n(ot);function st(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide date "),D.cc())}function dt(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide the check in time "),D.cc())}function ut(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide the check out time "),D.cc())}function mt(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide the half day mark time "),D.cc())}function pt(t,e){1&t&&(D.dc(0,"span"),D.cd(1," Please provide the late mark after time "),D.cc())}function ht(t,e){if(1&t&&(D.dc(0,"mat-error"),D.ad(1,pt,2,0,"span",28),D.cc()),2&t){const t=D.pc(),e=D.Oc(74);D.Gb(1),D.yc("ngIf",null==t.control?null:null==t.control.lateMarkAfter?null:t.control.lateMarkAfter.errors.required)("ngIfElse",e)}}function gt(t,e){1&t&&(D.dc(0,"mat-error"),D.dc(1,"span"),D.cd(2," Please provide the valid late mark after time "),D.cc(),D.cc())}function ft(t,e){if(1&t&&D.ad(0,gt,3,0,"mat-error",28),2&t){const t=D.pc(),e=D.Oc(76);D.yc("ngIf",null==t.control?null:null==t.control.lateMarkAfter?null:t.control.lateMarkAfter.errors.pattern)("ngIfElse",e)}}function bt(t,e){1&t&&(D.dc(0,"mat-error"),D.dc(1,"span"),D.cd(2," Please provide the minute within 2 digit "),D.cc(),D.cc())}function yt(t,e){if(1&t&&D.ad(0,bt,3,0,"mat-error",28),2&t){const t=D.pc(),e=D.Oc(78);D.yc("ngIf",null==t.control?null:null==t.control.lateMarkAfter?null:t.control.lateMarkAfter.errors.maxLength)("ngIfElse",e)}}function kt(t,e){1&t&&(D.dc(0,"mat-error"),D.dc(1,"span"),D.cd(2," Please provide the minute within 60 minutes "),D.cc(),D.cc())}function vt(t,e){if(1&t&&D.ad(0,kt,3,0,"mat-error",13),2&t){const t=D.pc();D.yc("ngIf",null==t.control?null:null==t.control.lateMarkAfter?null:t.control.lateMarkAfter.errors.max)}}let St=(()=>{class t{constructor(t,e,c,a,r,n,i,o){this.dialogRef=t,this.data=e,this.appServerDatePipe=c,this.toaster=a,this.loader=r,this.modelService=n,this.fb=i,this.config=o,this.timeFormat=Number(this.config.timeFormat),this.setForm()}setForm(){this.customizeForm=this.fb.group({date:["",n.B.required],checkIn:["",n.B.required],checkOut:["",n.B.required],halfDayMarkTime:["",n.B.required],lateMarkAfter:new n.g("",[n.B.required,n.B.pattern(/^[0-9]{1,2}$/),n.B.max(60),n.B.maxLength(2)])})}get control(){return this.customizeForm.controls}ngOnInit(){this.depart=this.data.departmentArr,this.post=this.data.positionArr,this.groupId=this.data.groupId,this.customCreatedData=this.data.customData,this.routineData=this.data.routineArray,console.log(this.customCreatedData),this.customPatchValue(this.customCreatedData)}customPatchValue(t){let e=M(t.customizeDate,"DD-MM-YYYY").format("YYYY-MM-DD");this.customizeForm.patchValue({date:e,checkIn:t.checkIn,checkOut:t.checkOut,halfDayMarkTime:t.halfDayMark,lateMarkAfter:t.lateMark})}updateCustomizeEmp(){var t,e,c,a,r,n,i,o,l,s,d;if(this.customizeForm.valid){var u=this.customizeForm.value;let m=this.appServerDatePipe.transform(null===(t=u)||void 0===t?void 0:t.date),p=M(this.customCreatedData.customizeDate,"DD-MM-YYYY").format("YYYY-MM-DD"),h=M.utc().startOf("day").add(null===(e=u)||void 0===e?void 0:e.lateMarkAfter,"minutes").format("HH:mm"),g=new FormData;g.append("emp_attendance_group_id",null!=(c=this.groupId)?c:""),g.append("department_id",null!=(a=this.depart.toString())?a:""),g.append("position_id",null!=(r=this.post.toString())?r:""),g.append("old_customize_date",null!=p?p:""),g.append("customize_date",null!=m?m:""),g.append("check_in",null!=(i=null===(n=u)||void 0===n?void 0:n.checkIn)?i:""),g.append("check_out",null!=(l=null===(o=u)||void 0===o?void 0:o.checkOut)?l:""),g.append("half_day_mark",null!=(d=null===(s=u)||void 0===s?void 0:s.halfDayMarkTime)?d:""),g.append("late_mark",null!=h?h:""),g.append("attendance_data",JSON.stringify(this.routineData)),this.loader.open(),this.modelService.updateEmpAttendanceCustom(g).subscribe(t=>{"success"==t.keyword?(this.updateCustomizeTracking(u),this.loader.close(),this.close(!0),this.toaster.present(t.message,"")):"failed"==t.keyword&&(this.loader.close(),this.toaster.present(t.message,""))})}}updateCustomizeTracking(t){var e,c,a,r,n,i,o,l,s;const d=Object(H.b)();let u=Object(j.get)(d,"customer_id"),m=Object(j.get)(d,"branch_id"),p=(null===(e=t)||void 0===e?void 0:e.date)?this.appServerDatePipe.transform(null===(c=t)||void 0===c?void 0:c.date):M().format("YYYY-MM-DD"),h=(null===(a=t)||void 0===a?void 0:a.checkIn)?M(t.checkIn,"HH:mm").format("HH:mm:ss"):"00:00:00",g=(null===(r=t)||void 0===r?void 0:r.checkOut)?M(t.checkOut,"HH:mm").format("HH:mm:ss"):"00:00:00",f=(null===(n=t)||void 0===n?void 0:n.halfDayMarkTime)?M(t.halfDayMarkTime,"HH:mm").format("HH:mm:ss"):"00:00:00",b=this.depart?this.depart.map(t=>String(t)):[],y=this.post?this.post.map(t=>String(t)):[],k=new FormData;k.append("customerId",String(u)),k.append("schoolId",String(m)),k.append("departmentIds",null!=(i=String(b))?i:""),k.append("positionIds",null!=(o=String(y))?o:""),k.append("thisDate",null!=p?p:""),k.append("checkIn",null!=h?h:""),k.append("checkOut",null!=g?g:""),k.append("halfDayMarkTime",null!=f?f:""),k.append("lateMarkMin",null!=(s=String(null===(l=t)||void 0===l?void 0:l.lateMarkAfter))?s:""),k.append("isWorkingDay","true"),this.modelService.updateEmpAttendanceDateTracking(k).subscribe(t=>{let e=t;"Success"==e.keyword?(this.deviceInsert(),console.log("Tracking edited",e)):this.modelService.createEmpAttendanceDateTracking(k).subscribe(t=>{let e=t;"Success"==e.keyword?(this.deviceInsert(),console.log("Tracking Created",e)):console.log("Tracking edited",e)})})}deviceInsert(){let t=new FormData;t.append("id",this.groupId),t.append("type","emp_attendance_date"),this.modelService.deviceStatus(t).subscribe(t=>{console.log("Tracking created",t)})}close(t){this.dialogRef.close(t)}}return t.\u0275fac=function(e){return new(e||t)(D.Xb(u.f),D.Xb(u.a),D.Xb(m.d),D.Xb(g.a),D.Xb(f.a),D.Xb(z),D.Xb(n.f),D.Xb(V.a))},t.\u0275cmp=D.Rb({type:t,selectors:[["app-edit"]],features:[D.Fb([{provide:p.c,useClass:h.b},{provide:p.f,useValue:h.a},m.d])],decls:83,vars:16,consts:[[1,"form_bg"],[1,"p-0"],[1,""],[1,"card-title-text"],["autocomplete","off",3,"formGroup"],["fxLayout","row wrap",1,"mt-0"],["fxFlex","100","fxFlex.gt-xs","30",1,"pt-12"],[1,"red_color"],["fxFlex","100","fxFlex.gt-xs","70",1,""],["appearance","fill"],["matInput","","formControlName","date",3,"matDatepicker","click"],["matSuffix","",3,"for"],["picker",""],[4,"ngIf"],["fxFlex","100","fxFlex.gt-xs","30",1,""],["appearance","fill",1,""],["type","text","matInput","","formControlName","checkIn","readonly","","value","",3,"ngxTimepicker","format"],["timePickerFrom",""],["type","text","matInput","","formControlName","checkOut","readonly","","value","",3,"min","ngxTimepicker","format"],["timePickerTo",""],["type","text","matInput","","formControlName","halfDayMarkTime","readonly","","value","",3,"ngxTimepicker","format"],["timePickerHalfDay",""],["matInput","","formControlName","lateMarkAfter"],["patternError",""],["maxLengthError",""],["maxError",""],["mat-raised-button","","color","primary",1,"btn-primary-bg","ml-0",3,"disabled","click"],[1,"pl-8","primary-txt-color",3,"click"],[4,"ngIf","ngIfElse"]],template:function(t,e){if(1&t){const t=D.ec();D.dc(0,"div",0),D.dc(1,"mat-card",1),D.dc(2,"mat-card-title",2),D.dc(3,"div",3),D.cd(4,"Create Customize Date"),D.cc(),D.Yb(5,"mat-divider"),D.cc(),D.dc(6,"mat-card-content"),D.dc(7,"form",4),D.dc(8,"div",5),D.dc(9,"div",6),D.dc(10,"label"),D.dc(11,"strong"),D.cd(12,"Date"),D.cc(),D.dc(13,"span",7),D.cd(14,"*"),D.cc(),D.cc(),D.cc(),D.dc(15,"div",8),D.dc(16,"mat-form-field",9),D.Yb(17,"mat-label"),D.dc(18,"input",10),D.lc("click",(function(e){return D.Sc(t),D.Oc(21).open()})),D.cc(),D.Yb(19,"mat-datepicker-toggle",11),D.Yb(20,"mat-datepicker",null,12),D.ad(22,st,2,0,"mat-error",13),D.cc(),D.cc(),D.cc(),D.dc(23,"div",5),D.dc(24,"div",14),D.dc(25,"label"),D.dc(26,"strong"),D.cd(27," Check In"),D.cc(),D.dc(28,"span",7),D.cd(29,"*"),D.cc(),D.cc(),D.cc(),D.dc(30,"div",8),D.dc(31,"mat-form-field",15),D.Yb(32,"input",16),D.Yb(33,"ngx-material-timepicker",null,17),D.ad(35,dt,2,0,"mat-error",13),D.cc(),D.cc(),D.cc(),D.dc(36,"div",5),D.dc(37,"div",14),D.dc(38,"label"),D.dc(39,"strong"),D.cd(40," Check Out"),D.cc(),D.dc(41,"span",7),D.cd(42,"*"),D.cc(),D.cc(),D.cc(),D.dc(43,"div",8),D.dc(44,"mat-form-field",15),D.Yb(45,"input",18),D.Yb(46,"ngx-material-timepicker",null,19),D.ad(48,ut,2,0,"mat-error",13),D.cc(),D.cc(),D.cc(),D.dc(49,"div",5),D.dc(50,"div",14),D.dc(51,"label"),D.dc(52,"strong"),D.cd(53,"Half Day Mark Time"),D.cc(),D.dc(54,"span",7),D.cd(55,"*"),D.cc(),D.cc(),D.cc(),D.dc(56,"div",8),D.dc(57,"mat-form-field",15),D.Yb(58,"input",20),D.Yb(59,"ngx-material-timepicker",null,21),D.ad(61,mt,2,0,"mat-error",13),D.cc(),D.cc(),D.cc(),D.dc(62,"div",5),D.dc(63,"div",14),D.dc(64,"label"),D.dc(65,"strong"),D.cd(66,"Late Mark After(Mins)"),D.cc(),D.dc(67,"span",7),D.cd(68,"*"),D.cc(),D.cc(),D.cc(),D.dc(69,"div",8),D.dc(70,"mat-form-field",9),D.Yb(71,"input",22),D.ad(72,ht,2,2,"mat-error",13),D.ad(73,ft,1,2,"ng-template",null,23,D.bd),D.ad(75,yt,1,2,"ng-template",null,24,D.bd),D.ad(77,vt,1,1,"ng-template",null,25,D.bd),D.cc(),D.cc(),D.cc(),D.dc(79,"button",26),D.lc("click",(function(t){return e.updateCustomizeEmp()})),D.cd(80,"Submit"),D.cc(),D.dc(81,"a",27),D.lc("click",(function(t){return e.close(!1)})),D.cd(82,"Discard"),D.cc(),D.cc(),D.cc(),D.cc(),D.cc()}if(2&t){const t=D.Oc(21),c=D.Oc(34),a=D.Oc(47),r=D.Oc(60);D.Gb(7),D.yc("formGroup",e.customizeForm),D.Gb(11),D.yc("matDatepicker",t),D.Gb(1),D.yc("for",t),D.Gb(3),D.yc("ngIf",(null==e.control?null:null==e.control.date?null:null==e.control.date.errors?null:e.control.date.errors.required)&&(null==e.control?null:null==e.control.date?null:e.control.date.touched)),D.Gb(10),D.yc("ngxTimepicker",c)("format",e.timeFormat),D.Gb(3),D.yc("ngIf",(null==e.control?null:null==e.control.checkIn?null:null==e.control.checkIn.errors?null:e.control.checkIn.errors.required)&&(null==e.control?null:null==e.control.checkIn?null:e.control.checkIn.touched)),D.Gb(10),D.yc("min",null==e.control?null:null==e.control.checkIn?null:e.control.checkIn.value)("ngxTimepicker",a)("format",e.timeFormat),D.Gb(3),D.yc("ngIf",(null==e.control?null:null==e.control.checkOut?null:null==e.control.checkOut.errors?null:e.control.checkOut.errors.required)&&(null==e.control?null:null==e.control.checkOut?null:e.control.checkOut.touched)),D.Gb(10),D.yc("ngxTimepicker",r)("format",e.timeFormat),D.Gb(3),D.yc("ngIf",(null==e.control?null:null==e.control.halfDayMarkTime?null:null==e.control.halfDayMarkTime.errors?null:e.control.halfDayMarkTime.errors.required)&&(null==e.control?null:null==e.control.halfDayMarkTime?null:e.control.halfDayMarkTime.touched)),D.Gb(11),D.yc("ngIf",(null==e.control?null:null==e.control.lateMarkAfter?null:e.control.lateMarkAfter.errors)&&((null==e.control?null:null==e.control.lateMarkAfter?null:e.control.lateMarkAfter.dirty)||(null==e.control?null:null==e.control.lateMarkAfter?null:e.control.lateMarkAfter.touched))),D.Gb(7),D.yc("disabled",!e.customizeForm.valid)}},directives:[L.a,L.f,B.a,L.c,n.D,n.u,n.k,N.c,N.a,q.b,q.e,R.b,n.c,X.b,n.t,n.i,X.d,q.f,X.a,r.o,d.d,d.a,W.a,q.a],styles:[".mat-form-field[_ngcontent-%COMP%]{width:80%}.batch-name[_ngcontent-%COMP%]{font-size:24px}mat-checkbox[_ngcontent-%COMP%]{margin-right:23px}.text-center[_ngcontent-%COMP%]{text-align:center!important}th[_ngcontent-%COMP%]{border-bottom:1px solid grey}.ml-0[_ngcontent-%COMP%]{margin-left:0!important}.btn-dis[_ngcontent-%COMP%]:disabled, .btn-dis[disabled][_ngcontent-%COMP%]{border:1px solid #999!important;background-color:#ccc!important;color:#666!important}"]}),t})();var Dt=c("VxG0"),It=c("QibW"),Mt=c("d3UM"),Ot=c("bSwM"),xt=c("NFeN");const _t=["allDepartmentSelected"],Tt=["allPositionSelected"];function At(t,e){if(1&t&&(D.dc(0,"mat-option",39),D.cd(1),D.cc()),2&t){const t=e.$implicit;D.yc("value",t.departmentId),D.Gb(1),D.ed(" ",t.name," ")}}function wt(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please select atleast one department "),D.cc())}function Ct(t,e){if(1&t&&(D.dc(0,"mat-option",39),D.cd(1),D.cc()),2&t){const t=e.$implicit;D.yc("value",t.positionId),D.Gb(1),D.ed(" ",t.positionName," ")}}function Ft(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please select atleast one position "),D.cc())}function Et(t,e){if(1&t&&(D.dc(0,"div"),D.dc(1,"div",8),D.dc(2,"div",33),D.dc(3,"label"),D.dc(4,"strong"),D.cd(5,"Department"),D.cc(),D.dc(6,"span",12),D.cd(7,"*"),D.cc(),D.cc(),D.cc(),D.dc(8,"div",34),D.dc(9,"mat-form-field",35),D.Yb(10,"mat-label"),D.dc(11,"mat-select",36),D.ad(12,At,2,2,"mat-option",37),D.cc(),D.ad(13,wt,2,0,"mat-error",17),D.cc(),D.cc(),D.cc(),D.dc(14,"div",8),D.dc(15,"div",33),D.dc(16,"label"),D.dc(17,"strong"),D.cd(18,"Position"),D.cc(),D.dc(19,"span",12),D.cd(20,"*"),D.cc(),D.cc(),D.cc(),D.dc(21,"div",34),D.dc(22,"mat-form-field",35),D.Yb(23,"mat-label"),D.dc(24,"mat-select",38),D.ad(25,Ct,2,2,"mat-option",37),D.cc(),D.ad(26,Ft,2,0,"mat-error",17),D.cc(),D.cc(),D.cc(),D.cc()),2&t){const t=D.pc();D.Gb(12),D.yc("ngForOf",t.departments),D.Gb(1),D.yc("ngIf",null==t.control?null:null==t.control.department?null:null==t.control.department.errors?null:t.control.department.errors.required),D.Gb(12),D.yc("ngForOf",t.positions),D.Gb(1),D.yc("ngIf",null==t.control?null:null==t.control.position?null:null==t.control.position.errors?null:t.control.position.errors.required)}}function Pt(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide the check in time "),D.cc())}function Gt(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide the check out time "),D.cc())}function Yt(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide the half day mark time "),D.cc())}function zt(t,e){1&t&&(D.dc(0,"span"),D.cd(1," Please provide the late mark after time "),D.cc())}function Ht(t,e){if(1&t&&(D.dc(0,"mat-error"),D.ad(1,zt,2,0,"span",54),D.cc()),2&t){const t=D.pc().$implicit,e=D.Oc(29);D.Gb(1),D.yc("ngIf",null==t.controls?null:null==t.controls.lateMarkAfter?null:t.controls.lateMarkAfter.errors.required)("ngIfElse",e)}}function jt(t,e){1&t&&(D.dc(0,"mat-error"),D.dc(1,"span"),D.cd(2," Please provide the valid late mark after time "),D.cc(),D.cc())}function Vt(t,e){if(1&t&&D.ad(0,jt,3,0,"mat-error",54),2&t){const t=D.pc().$implicit,e=D.Oc(31);D.yc("ngIf",null==t.controls?null:null==t.controls.lateMarkAfter?null:t.controls.lateMarkAfter.errors.pattern)("ngIfElse",e)}}function Lt(t,e){1&t&&(D.dc(0,"mat-error"),D.dc(1,"span"),D.cd(2," Please provide the minute within 2 digit "),D.cc(),D.cc())}function Bt(t,e){if(1&t&&D.ad(0,Lt,3,0,"mat-error",54),2&t){const t=D.pc().$implicit,e=D.Oc(33);D.yc("ngIf",null==t.controls?null:null==t.controls.lateMarkAfter?null:t.controls.lateMarkAfter.errors.maxLength)("ngIfElse",e)}}function Nt(t,e){1&t&&(D.dc(0,"mat-error"),D.dc(1,"span"),D.cd(2," Please provide the minute within 60 minutes "),D.cc(),D.cc())}function qt(t,e){if(1&t&&D.ad(0,Nt,3,0,"mat-error",17),2&t){const t=D.pc().$implicit;D.yc("ngIf",null==t.controls?null:null==t.controls.lateMarkAfter?null:t.controls.lateMarkAfter.errors.max)}}function Rt(t,e){if(1&t){const t=D.ec();D.dc(0,"tr",40),D.dc(1,"td",41),D.dc(2,"mat-checkbox",42),D.lc("change",(function(c){D.Sc(t);const a=e.index;return D.pc().isdayClicked(c,a)})),D.cc(),D.cc(),D.dc(3,"td",43),D.cd(4),D.qc(5,"titlecase"),D.cc(),D.dc(6,"td",41),D.dc(7,"mat-form-field",35),D.Yb(8,"input",44),D.Yb(9,"ngx-material-timepicker",null,45),D.ad(11,Pt,2,0,"mat-error",17),D.cc(),D.cc(),D.dc(12,"td",41),D.dc(13,"mat-form-field",35),D.Yb(14,"input",46),D.Yb(15,"ngx-material-timepicker",null,47),D.ad(17,Gt,2,0,"mat-error",17),D.cc(),D.cc(),D.dc(18,"td",41),D.dc(19,"mat-form-field",35),D.Yb(20,"input",48),D.Yb(21,"ngx-material-timepicker",null,49),D.ad(23,Yt,2,0,"mat-error",17),D.cc(),D.cc(),D.dc(24,"td",41),D.dc(25,"mat-form-field",35),D.Yb(26,"input",50),D.ad(27,Ht,2,2,"mat-error",17),D.ad(28,Vt,1,2,"ng-template",null,51,D.bd),D.ad(30,Bt,1,2,"ng-template",null,52,D.bd),D.ad(32,qt,1,1,"ng-template",null,53,D.bd),D.cc(),D.cc(),D.cc()}if(2&t){const t=e.$implicit,c=e.index,a=D.Oc(10),r=D.Oc(16),n=D.Oc(22),i=D.pc();D.Gb(1),D.yc("formGroupName",c),D.Gb(1),D.yc("value",t.value.day),D.Gb(2),D.dd(D.rc(5,18,t.value.day)),D.Gb(2),D.yc("formGroupName",c),D.Gb(2),D.yc("ngxTimepicker",a)("format",i.timeFormat),D.Gb(3),D.yc("ngIf",(null==t.controls.checkInTime?null:null==t.controls.checkInTime.errors?null:t.controls.checkInTime.errors.required)&&t.controls.checkInTime.touched),D.Gb(1),D.yc("formGroupName",c),D.Gb(2),D.yc("min",t.controls.checkInTime.value)("ngxTimepicker",r)("format",i.timeFormat),D.Gb(3),D.yc("ngIf",(null==t.controls.checkOutTime?null:null==t.controls.checkOutTime.errors?null:t.controls.checkOutTime.errors.required)&&t.controls.checkOutTime.touched),D.Gb(1),D.yc("formGroupName",c),D.Gb(2),D.yc("ngxTimepicker",n)("format",i.timeFormat),D.Gb(3),D.yc("ngIf",(null==t.controls.halfDayMarkTime?null:null==t.controls.halfDayMarkTime.errors?null:t.controls.halfDayMarkTime.errors.required)&&t.controls.halfDayMarkTime.touched),D.Gb(1),D.yc("formGroupName",c),D.Gb(3),D.yc("ngIf",(null==t.controls?null:null==t.controls.lateMarkAfter?null:t.controls.lateMarkAfter.errors)&&((null==t.controls?null:null==t.controls.lateMarkAfter?null:t.controls.lateMarkAfter.dirty)||(null==t.controls?null:null==t.controls.lateMarkAfter?null:t.controls.lateMarkAfter.touched)))}}function Xt(t,e){if(1&t){const t=D.ec();D.dc(0,"button",55),D.lc("click",(function(e){return D.Sc(t),D.pc().openDialog()})),D.cd(1,"Create"),D.cc()}if(2&t){const t=D.pc();D.yc("disabled",!(null!=t.control&&null!=t.control.department&&t.control.department.valid&&null!=t.control&&null!=t.control.position&&t.control.position.valid))}}function Wt(t,e){if(1&t){const t=D.ec();D.dc(0,"button",56),D.lc("click",(function(e){return D.Sc(t),D.pc().openDialog()})),D.cd(1,"Create"),D.cc()}}function $t(t,e){if(1&t){const t=D.ec();D.dc(0,"span",58),D.lc("click",(function(e){D.Sc(t);const c=D.pc().index;return D.pc(2).customAction("edit",c)})),D.dc(1,"mat-icon",59),D.cd(2,"edit"),D.cc(),D.cc()}}function Ut(t,e){if(1&t){const t=D.ec();D.dc(0,"span",58),D.lc("click",(function(e){D.Sc(t);const c=D.pc().index;return D.pc(2).customAction("delete",c)})),D.dc(1,"mat-icon",60),D.cd(2,"delete"),D.cc(),D.cc()}}const Jt=function(){return["emp_attendance_setting"]},Kt=function(){return["emp_attendance_setting_customize_update"]},Qt=function(){return["emp_attendance_setting_customize_delete"]};function Zt(t,e){if(1&t&&(D.dc(0,"tr",40),D.dc(1,"td",43),D.cd(2),D.qc(3,"displayDate"),D.cc(),D.dc(4,"td",43),D.cd(5),D.qc(6,"displayTime"),D.cc(),D.dc(7,"td",43),D.cd(8),D.qc(9,"displayTime"),D.cc(),D.dc(10,"td",43),D.cd(11),D.qc(12,"displayTime"),D.cc(),D.dc(13,"td",43),D.cd(14),D.cc(),D.dc(15,"td",43),D.ad(16,$t,3,0,"span",57),D.ad(17,Ut,3,0,"span",57),D.cc(),D.cc()),2&t){const t=e.$implicit,c=D.pc(2);D.Gb(2),D.dd(null!=t&&t.customizeDate?null==t?null:t.customizeDate:D.rc(3,7,"")),D.Gb(3),D.ed(" ",D.rc(6,9,null==t?null:t.checkIn)," "),D.Gb(3),D.ed(" ",D.rc(9,11,null==t?null:t.checkOut)," "),D.Gb(3),D.ed(" ",D.rc(12,13,null==t?null:t.halfDayMark)," "),D.Gb(3),D.ed(" ",null==t?null:t.lateMark," "),D.Gb(2),D.yc("ngIf",c.permission.hasPermission(D.Ec(15,Jt),D.Ec(16,Kt))),D.Gb(1),D.yc("ngIf",c.permission.hasPermission(D.Ec(17,Jt),D.Ec(18,Qt)))}}function te(t,e){if(1&t&&(D.dc(0,"tbody"),D.ad(1,Zt,18,19,"tr",25),D.cc()),2&t){const t=D.pc();D.Gb(1),D.yc("ngForOf",t.customizeList)}}function ee(t,e){1&t&&(D.dc(0,"tbody"),D.dc(1,"tr",40),D.dc(2,"td",61),D.dc(3,"strong"),D.cd(4,"No Data Found"),D.cc(),D.cc(),D.cc(),D.cc())}const ce=function(){return["emp_attendance_setting_customize_create"]};let ae=(()=>{class t{constructor(t,e,c,a,r,n,i,o,l){this.dialog=t,this.fb=e,this.toaster=c,this.loader=a,this.router=r,this.activatedRoute=n,this.modalService=i,this.permission=o,this.config=l,this.selectedDepart=[],this.selectedPosition=[],this.staticDays=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],this.customizeList=[],this.days=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],this.timeFormat=Number(this.config.timeFormat),this.groupId=this.activatedRoute.snapshot.params.id,this.getDepartments(this.groupId),this.getPostions(this.groupId),this.getData(this.groupId),this.getCustomizeData(this.groupId)}ngOnInit(){this.setForm()}getCustomizeData(t){this.modalService.getEmpCustomizeList(t).subscribe(t=>{"success"==t.keyword?(console.log(t),this.customizeList=t.customizeList):this.customizeList=[]})}getData(t){this.loader.open(),this.modalService.getOneEmpAttendacneRoutine(t).subscribe(t=>{"success"==t.keyword?(this.createdData=t.empList[0],this.responseData(),this.loader.close()):(this.toaster.present(t.message),this.loader.close())})}responseData(){const t=this.selectedDepart.filter(t=>"all"==t.departmentId),e=this.selectedPosition.filter(t=>"all"==t.positionId);this.selectedDepart.length>0&&this.selectedPosition.length>0&&(t[0]&&e[0]?(this.setForm(),this.patchAllData(this.createdData,"1")):(this.setForm(),this.patchAllData(this.createdData,"2")))}patchAllData(t,e){var c,a,r,n;"1"==e?(this.clearEmployeeControl(),this.createEmpSettingForm.patchValue({type:e}),this.patchDataForEachDay(null===(c=t)||void 0===c?void 0:c.routineList)):(this.manageEmployeeControl(),this.createEmpSettingForm.patchValue({type:e,department:this.filterArray("employee_department_id",null===(a=t)||void 0===a?void 0:a.department),position:this.filterArray("employee_position_id",null===(r=t)||void 0===r?void 0:r.position)}),this.patchDataForEachDay(null===(n=t)||void 0===n?void 0:n.routineList))}patchDataForEachDay(t){t&&t.forEach(t=>{let e=parseInt(t.dayId)-1,c=this.createEmpSettingForm.get("days").controls[e];1==t.isWorkingDay?(this.setEnableForSelectedDay(c),c.patchValue({id:t.dayId,day:t.day,isWorkingDay:1==t.isWorkingDay,checkInTime:t.checkIn?M(t.checkIn,"HH:mm:ss").format("HH:mm"):"00:00",checkOutTime:t.checkOut?M(t.checkOut,"HH:mm:ss").format("HH:mm"):"00:00",halfDayMarkTime:t.halfDayMark?M(t.halfDayMark,"HH:mm:ss").format("HH:mm"):"00:00",lateMarkAfter:t.lateMark?M(t.lateMark,"HH:mm:ss").diff(M().startOf("day"),"minutes"):"00"})):this.setDisabledForSelectedDay(c)})}filterArray(t,e){return Array.isArray(e)?e.map(e=>e[t]):e}getDepartments(t){this.modalService.getDepartmentList(t).subscribe(t=>{if("success"==t.keyword){this.selectedDepart=t.selectedDept;let e=t.departments.filter(t=>"all"!==t.departmentId);this.departments=e,"1"!==this.createEmpSettingForm.get("type").value&&"2"!==this.createEmpSettingForm.get("type").value&&this.responseData()}else this.departments=[],this.selectedDepart=[]})}getPostions(t){this.modalService.getPositionList(t).subscribe(t=>{if("success"==t.keyword){this.selectedPosition=t.selectedPositions;let e=t.positions.filter(t=>"all"!==t.positionId);this.positions=e,"1"!==this.createEmpSettingForm.get("type").value&&"2"!==this.createEmpSettingForm.get("type").value&&this.responseData()}else this.positions=[],this.selectedPosition=[]})}setForm(){this.createEmpSettingForm=this.fb.group({type:["",n.B.required],days:new n.d([])}),this.setFormArrayForDays()}get control(){return this.createEmpSettingForm.controls}manageEmployeeControl(){this.createEmpSettingForm.addControl("department",new n.g("",n.B.required)),this.createEmpSettingForm.addControl("position",new n.g("",n.B.required))}clearEmployeeControl(){this.createEmpSettingForm.removeControl("department"),this.createEmpSettingForm.removeControl("position")}setFormArrayForDays(){let t=this.createEmpSettingForm.get("days");this.staticDays.map((e,c)=>{t.push(this.getGroup(e,c))})}getGroup(t,e){return this.fb.group({id:new n.g(e+1),day:new n.g(t),isWorkingDay:new n.g(!1,[n.B.required]),checkInTime:new n.g({value:"",disabled:!0},[n.B.required]),checkOutTime:new n.g({value:"",disabled:!0},[n.B.required]),halfDayMarkTime:new n.g({value:"",disabled:!0},[n.B.required]),lateMarkAfter:new n.g({value:"",disabled:!0},[n.B.required,n.B.pattern(/^[0-9]{1,2}$/),n.B.max(60),n.B.maxLength(2)])})}setEnableForSelectedDay(t){t.get("checkInTime").setValue(""),t.get("checkInTime").enable(),t.get("checkInTime").setValidators(n.B.required),t.get("checkInTime").updateValueAndValidity(),t.get("checkOutTime").setValue(""),t.get("checkOutTime").enable(),t.get("checkOutTime").setValidators(n.B.required),t.get("checkOutTime").updateValueAndValidity(),t.get("halfDayMarkTime").setValue(""),t.get("halfDayMarkTime").enable(),t.get("halfDayMarkTime").setValidators(n.B.required),t.get("halfDayMarkTime").updateValueAndValidity(),t.get("lateMarkAfter").setValue(""),t.get("lateMarkAfter").enable(),t.get("lateMarkAfter").setValidators([n.B.required,n.B.pattern(/^[0-9]{1,2}$/),n.B.max(60),n.B.maxLength(2)]),t.get("lateMarkAfter").updateValueAndValidity()}setDisabledForSelectedDay(t){t.get("checkInTime").setValue(""),t.get("checkInTime").disable(),t.get("checkInTime").clearValidators(),t.get("checkInTime").updateValueAndValidity(),t.get("checkOutTime").setValue(""),t.get("checkOutTime").disable(),t.get("checkOutTime").clearValidators(),t.get("checkOutTime").updateValueAndValidity(),t.get("halfDayMarkTime").setValue(""),t.get("halfDayMarkTime").disable(),t.get("halfDayMarkTime").clearValidators(),t.get("halfDayMarkTime").updateValueAndValidity(),t.get("lateMarkAfter").setValue(""),t.get("lateMarkAfter").disable(),t.get("lateMarkAfter").clearValidators(),t.get("lateMarkAfter").updateValueAndValidity()}isdayClicked(t,e){let c=this.createEmpSettingForm.get("days").controls[e];t.checked?this.setEnableForSelectedDay(c):this.setDisabledForSelectedDay(c)}openDialog(){"1"==this.createEmpSettingForm.get("type").value?this.dialog.open(it,{width:"40%",data:{departmentArr:"all",positionArr:"all",routineArray:this.setArrayVar(this.createEmpSettingForm.get("days").value),groupId:this.groupId}}).afterClosed().subscribe(t=>{t&&this.getCustomizeData(this.groupId)}):this.dialog.open(it,{width:"40%",data:{departmentArr:this.createEmpSettingForm.get("department").value,positionArr:this.createEmpSettingForm.get("position").value,routineArray:this.setArrayVar(this.createEmpSettingForm.get("days").value),groupId:this.groupId}}).afterClosed().subscribe(t=>{t&&this.getCustomizeData(this.groupId)})}setArrayVar(t){let e=[];for(let c of t){let t=this.changeStructureObj(c);e.push(t)}return e}changeStructureObj(t){return{day_id:t.id,is_working_day:t.isWorkingDay?"1":"0",check_in:t.checkInTime?t.checkInTime:"00:00",check_out:t.checkOutTime?t.checkOutTime:"00:00",half_day:t.halfDayMarkTime?t.halfDayMarkTime:"00:00",late_mark:M.utc().startOf("day").add(t.lateMarkAfter,"minutes").format("HH:mm")}}update(){var t,e,c,a;if(this.createEmpSettingForm.value.days.filter(t=>1==t.isWorkingDay).length>0)if(this.createEmpSettingForm.valid){this.loader.open();var r=this.createEmpSettingForm.value;let n=new FormData;n.append("attendance_data",JSON.stringify(this.setArrayVar(r.days))),n.append("emp_attendance_group_id",this.groupId),"2"==r.type?(n.append("department_id",null!=(e=(null===(t=r)||void 0===t?void 0:t.department).toString())?e:""),n.append("position_id",null!=(a=(null===(c=r)||void 0===c?void 0:c.position).toString())?a:"")):(n.append("department_id","all"),n.append("position_id","all")),this.modalService.updateEmpAttendanceRoutine(n).subscribe(t=>{"success"==t.keyword?(this.empResponse=t.empList[0],this.deviceEmployee(r),this.toaster.present(t.message,"")):"failed"==t.keyword&&(this.loader.close(),this.toaster.present(t.message,""))})}else lt.a.fire({title:"Check Required",text:"Fill Mandatory Fields",icon:"warning"});else lt.a.fire({title:"Check Required",text:"Please Fill One Working Day Fields",icon:"warning"})}deviceEmployee(t){var e,c;const a=Object(H.b)();let r=Object(j.get)(a,"customer_id"),n=Object(j.get)(a,"branch_id"),i=(null===(e=t)||void 0===e?void 0:e.department)?t.department.map(t=>String(t)):[],o=(null===(c=t)||void 0===c?void 0:c.position)?t.position.map(t=>String(t)):[],l={schoolOpenDays:this.setVar(t.days),customerId:String(r),schoolId:String(n),departmentIds:["all"],positionIds:["all"]};"2"==t.type&&(l.departmentIds=i,l.positionIds=o),this.modalService.createEmpAttendanceTracking(l).subscribe(t=>{"Success"==t.keyword?(this.deviceInsert(),0!=this.customizeList.length&&this.updateCustomizeTracking()):"Failed"==t.keyword&&(this.loader.close(),this.router.navigate(["school/new-attendance-settings/employee/list"]))})}deviceInsert(){let t=new FormData;t.append("id",this.empResponse.empAttendanceGroupId),t.append("type","emp_attendance_routine"),this.modalService.deviceStatus(t).subscribe(t=>{this.loader.close(),this.router.navigate(["school/new-attendance-settings/employee/list"])})}setVar(t){let e=[];for(let c of t){let t=this.changeStructureObjForTracking(c);e.push(t)}return e}changeStructureObjForTracking(t){var e,c,a,r,n;return{day:this.days[t.id-1],isWorkingDay:String(t.isWorkingDay),checkIn:(null===(e=t)||void 0===e?void 0:e.checkInTime)?M(t.checkInTime,"HH:mm").format("HH:mm:ss"):"00:00:00",checkOut:(null===(c=t)||void 0===c?void 0:c.checkOutTime)?M(t.checkOutTime,"HH:mm").format("HH:mm:ss"):"00:00:00",halfDayMarkTime:(null===(a=t)||void 0===a?void 0:a.halfDayMarkTime)?M(t.halfDayMarkTime,"HH:mm").format("HH:mm:ss"):"00:00:00",lateMarkMin:(null===(r=t)||void 0===r?void 0:r.lateMarkAfter)?null===(n=t)||void 0===n?void 0:n.lateMarkAfter:"00"}}submit(){console.log("Form value - ",this.createEmpSettingForm.value),console.log("Form is Valid? - ",this.createEmpSettingForm.valid),console.log("Days - ",this.createEmpSettingForm.value.days)}customAction(t,e){"edit"!=t&&"delete"!=t||lt.a.fire({title:"edit"==t?"Update Customize Date":"Delete Customize Date",text:"Are you sure? You want to "+t+" !",icon:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:"Yes, "+t+" it!"}).then(c=>{c.value&&("edit"==t?this.openEditDialog(this.customizeList[e]):"delete"==t&&this.deleteCustomizeEmp(this.customizeList[e]))})}openEditDialog(t){"1"==this.createEmpSettingForm.get("type").value?this.dialog.open(St,{width:"40%",data:{departmentArr:["all"],positionArr:["all"],routineArray:this.setArrayVar(this.createEmpSettingForm.get("days").value),customData:t,groupId:this.groupId}}).afterClosed().subscribe(t=>{t&&this.getCustomizeData(this.groupId)}):this.dialog.open(St,{width:"40%",data:{departmentArr:this.createEmpSettingForm.get("department").value,positionArr:this.createEmpSettingForm.get("position").value,routineArray:this.setArrayVar(this.createEmpSettingForm.get("days").value),groupId:this.groupId,customData:t}}).afterClosed().subscribe(t=>{t&&this.getCustomizeData(this.groupId)})}deleteCustomizeEmp(t){var e;this.loader.open();let c=new FormData,a=(null===(e=t)||void 0===e?void 0:e.customizeDate)?M(t.customizeDate,"DD-MM-YYYY").format("YYYY-MM-DD"):"";c.append("customize_date",null!=a?a:""),c.append("emp_attendance_group_id",this.groupId),this.modalService.deleteEmpAttendanceCustom(c).subscribe(e=>{"success"==e.keyword?(this.deleteCustomizeTracking(t),this.loader.close(),this.getCustomizeData(this.groupId),this.toaster.present(e.message,"")):"failed"==e.keyword&&(this.loader.close(),this.toaster.present(e.message,""))})}deleteCustomizeTracking(t){var e;const c=Object(H.b)();let a=Object(j.get)(c,"customer_id"),r=Object(j.get)(c,"branch_id"),n=(null===(e=t)||void 0===e?void 0:e.customizeDate)?M(t.customizeDate,"DD-MM-YYYY").format("YYYY-MM-DD"):"",i=[],o=[];if("2"==this.createEmpSettingForm.get("type").value){let t=this.createEmpSettingForm.get("department").value,e=this.createEmpSettingForm.get("position").value;i=t?t.map(t=>String(t)):[],o=e?e.map(t=>String(t)):[]}else i=["all"],o=["all"];let l=new FormData;l.append("customerId",String(a)),l.append("schoolId",String(r)),l.append("departmentIds",String(i)),l.append("positionIds",String(o)),l.append("thisDate",n),this.modalService.deleteEmpAttendanceDateTracking(l).subscribe(t=>{console.log("Tracking deleted",t)})}updateCustomizeTracking(){const t=Object(H.b)();let e=Object(j.get)(t,"customer_id"),c=Object(j.get)(t,"branch_id");this.customizeList.forEach(t=>{var a,r,n,i,o,l,s,d;let u=(null===(a=t)||void 0===a?void 0:a.customizeDate)?M(t.customizeDate,"DD-MM-YYYY").format("YYYY-MM-DD"):"",m=(null===(r=t)||void 0===r?void 0:r.checkIn)?M(t.checkIn,"HH:mm").format("HH:mm:ss"):"00:00:00",p=(null===(n=t)||void 0===n?void 0:n.checkOut)?M(t.checkOut,"HH:mm").format("HH:mm:ss"):"00:00:00",h=(null===(i=t)||void 0===i?void 0:i.halfDayMark)?M(t.halfDayMark,"HH:mm").format("HH:mm:ss"):"00:00:00";"1"==this.createEmpSettingForm.get("type").value?(this.dept=["all"],this.position=["all"]):(this.dept=this.createEmpSettingForm.get("department").value?this.createEmpSettingForm.get("department").value.map(t=>String(t)):[],this.position=this.createEmpSettingForm.get("position").value?this.createEmpSettingForm.get("position").value.map(t=>String(t)):[]);let g=new FormData;g.append("customerId",String(e)),g.append("schoolId",String(c)),g.append("departmentIds",null!=(o=String(this.dept))?o:""),g.append("positionIds",null!=(l=String(this.position))?l:""),g.append("thisDate",null!=u?u:""),g.append("checkIn",null!=m?m:""),g.append("checkOut",null!=p?p:""),g.append("halfDayMarkTime",null!=h?h:""),g.append("lateMarkMin",null!=(d=String(null===(s=t)||void 0===s?void 0:s.lateMark))?d:""),g.append("isWorkingDay","true"),this.modalService.updateEmpAttendanceDateTracking(g).subscribe(t=>{"Success"==t.keyword?console.log("Tracking edited",t):this.modalService.createEmpAttendanceDateTracking(g).subscribe(t=>{let e=t;"Success"==e.keyword?console.log("Tracking Created",e):console.log("Tracking edited",e)})})})}}return t.\u0275fac=function(e){return new(e||t)(D.Xb(u.b),D.Xb(n.f),D.Xb(g.a),D.Xb(f.a),D.Xb(a.g),D.Xb(a.a),D.Xb(z),D.Xb(Dt.a),D.Xb(V.a))},t.\u0275cmp=D.Rb({type:t,selectors:[["app-edit"]],viewQuery:function(t,e){var c;1&t&&(D.md(_t,!0),D.md(Tt,!0)),2&t&&(D.Nc(c=D.mc())&&(e.allDepartmentSelected=c.first),D.Nc(c=D.mc())&&(e.allPositionSelected=c.first))},decls:73,vars:13,consts:[[1,"create_btn"],["mat-raised-button","","color","primary",1,"btn-primary-bg",3,"disabled","click"],["href","#",1,"pl-12","primary-txt-color",3,"routerLink"],[1,"form_bg"],[1,"p-0"],[1,""],[1,"card-title-text"],[3,"formGroup"],["fxLayout","row wrap",1,"mt-0"],["fxFlex","100","fxFlex.gt-xs","50",1,"mt-12"],["fxLayout","row wrap",1,"mb-24"],["fxFlex","100","fxFlex.gt-xs","9",1,""],[1,"red_color"],["fxFlex","100","fxFlex.gt-xs","35",1,""],["formControlName","type","aria-label","Select an option","name","type"],["value","1",3,"click"],["value","2",1,"ml-12",3,"click"],[4,"ngIf"],["border","1","cellspacing","0",1,"mat-table","mt-12","emp_setting"],[1,"mat-header-row"],["rowspan","2",1,"mat-header-cell","text-center","pt-3",2,"width","10%"],["colspan","2",1,"mat-header-cell","text-center","pt-3",2,"width","10%"],["rowspan","2",1,"mat-header-cell","text-center",2,"width","10%"],[1,"mat-header-cell","text-center","pt-3",2,"width","10%"],["formArrayName","days"],["class","mat-row",4,"ngFor","ngForOf"],[1,"mt-24"],[1,"create_btn","mt-40"],["mat-raised-button","","color","primary","class","btn-primary-bg ml-0",3,"disabled","click",4,"ngIf"],["mat-raised-button","","color","primary","class","btn-primary-bg ml-0",3,"click",4,"ngIf"],["border","1","cellspacing","0",1,"mat-table","mt-12","customize_setting"],[1,"mat-header-cell","text-center",2,"width","10%"],[1,"mat-header-cell","text-center","pt-3",2,"width","5%"],["fxFlex","100","fxFlex.gt-xs","30",1,"mt-12"],["fxFlex","100","fxFlex.gt-xs","70",1,"mt-12"],["appearance","fill"],["multiple","","formControlName","department"],[3,"value",4,"ngFor","ngForOf"],["multiple","","formControlName","position"],[3,"value"],[1,"mat-row"],[1,"mat-cell","text-center",3,"formGroupName"],["formControlName","isWorkingDay",3,"value","change"],[1,"mat-cell","text-center"],["type","text","matInput","","formControlName","checkInTime","readonly","","value","",3,"ngxTimepicker","format"],["timePickerMonFrom",""],["type","text","matInput","","formControlName","checkOutTime","readonly","","value","",3,"min","ngxTimepicker","format"],["timePickerMonto",""],["type","text","matInput","","formControlName","halfDayMarkTime","readonly","","value","",3,"ngxTimepicker","format"],["timePickerMonhalfday",""],["matInput","","formControlName","lateMarkAfter"],["patternError",""],["maxLengthError",""],["maxError",""],[4,"ngIf","ngIfElse"],["mat-raised-button","","color","primary",1,"btn-primary-bg","ml-0",3,"disabled","click"],["mat-raised-button","","color","primary",1,"btn-primary-bg","ml-0",3,"click"],["class","mt-8 ml-0 mr-8","style","cursor: pointer;",3,"click",4,"ngIf"],[1,"mt-8","ml-0","mr-8",2,"cursor","pointer",3,"click"],[1,"edit-icon"],[1,"delete-icon"],["colspan","6",1,"mat-cell","text-center"]],template:function(t,e){1&t&&(D.dc(0,"div",0),D.dc(1,"button",1),D.lc("click",(function(t){return e.update()})),D.cd(2,"Update"),D.cc(),D.dc(3,"a",2),D.cd(4,"Discard"),D.cc(),D.cc(),D.dc(5,"div",3),D.dc(6,"mat-card",4),D.dc(7,"mat-card-title",5),D.dc(8,"div",6),D.cd(9,"Employee Attendance Settings"),D.cc(),D.Yb(10,"mat-divider"),D.cc(),D.dc(11,"mat-card-content"),D.dc(12,"form",7),D.dc(13,"div",8),D.dc(14,"div",9),D.dc(15,"div",10),D.dc(16,"div",11),D.dc(17,"label"),D.dc(18,"strong"),D.cd(19,"Type"),D.cc(),D.dc(20,"span",12),D.cd(21,"*"),D.cc(),D.cc(),D.cc(),D.dc(22,"div",13),D.dc(23,"mat-radio-group",14),D.dc(24,"mat-radio-button",15),D.lc("click",(function(t){return e.clearEmployeeControl()})),D.cd(25,"All"),D.cc(),D.dc(26,"mat-radio-button",16),D.lc("click",(function(t){return e.manageEmployeeControl()})),D.cd(27,"Custom "),D.cc(),D.cc(),D.cc(),D.cc(),D.ad(28,Et,27,4,"div",17),D.cc(),D.cc(),D.dc(29,"table",18),D.dc(30,"thead"),D.dc(31,"tr",19),D.dc(32,"th",20),D.cd(33,"Is Working Day?"),D.cc(),D.dc(34,"th",20),D.cd(35,"Schools opens On"),D.cc(),D.dc(36,"th",21),D.cd(37,"Check"),D.cc(),D.dc(38,"th",22),D.cd(39,"Half Day Mark Time"),D.cc(),D.dc(40,"th",20),D.cd(41,"Late Mark After(Mins) "),D.cc(),D.cc(),D.dc(42,"tr",19),D.dc(43,"th",23),D.cd(44,"In"),D.cc(),D.dc(45,"th",23),D.cd(46,"Out"),D.cc(),D.cc(),D.cc(),D.dc(47,"tbody",24),D.ad(48,Rt,34,20,"tr",25),D.cc(),D.cc(),D.cc(),D.Yb(49,"mat-divider",26),D.dc(50,"div",27),D.dc(51,"h3"),D.dc(52,"strong"),D.cd(53,"Customize Date"),D.cc(),D.cc(),D.ad(54,Xt,2,1,"button",28),D.ad(55,Wt,2,0,"button",29),D.cc(),D.dc(56,"table",30),D.dc(57,"thead"),D.dc(58,"tr",19),D.dc(59,"th",23),D.cd(60,"Date"),D.cc(),D.dc(61,"th",23),D.cd(62,"Check In"),D.cc(),D.dc(63,"th",23),D.cd(64,"Check Out"),D.cc(),D.dc(65,"th",31),D.cd(66,"Half Day Mark Time"),D.cc(),D.dc(67,"th",23),D.cd(68,"Late Mark After(Mins)"),D.cc(),D.dc(69,"th",32),D.cd(70,"Action "),D.cc(),D.cc(),D.cc(),D.ad(71,te,2,1,"tbody",17),D.ad(72,ee,5,0,"tbody",17),D.cc(),D.cc(),D.cc(),D.cc()),2&t&&(D.Gb(1),D.yc("disabled",!e.createEmpSettingForm.valid),D.Gb(2),D.yc("routerLink","/school/new-attendance-settings/employee/list"),D.Gb(9),D.yc("formGroup",e.createEmpSettingForm),D.Gb(16),D.yc("ngIf",2==e.control.type.value),D.Gb(20),D.yc("ngForOf",e.createEmpSettingForm.get("days").controls),D.Gb(6),D.yc("ngIf",2==(null==e.control?null:null==e.control.type?null:e.control.type.value)&&e.permission.hasPermission(D.Ec(9,Jt),D.Ec(10,ce))),D.Gb(1),D.yc("ngIf",1==(null==e.control?null:null==e.control.type?null:e.control.type.value)&&e.permission.hasPermission(D.Ec(11,Jt),D.Ec(12,ce))),D.Gb(16),D.yc("ngIf",e.customizeList.length>0),D.Gb(1),D.yc("ngIf",0==e.customizeList.length))},directives:[W.a,a.j,L.a,L.f,B.a,L.c,n.D,n.u,n.k,N.c,N.a,It.b,n.t,n.i,It.a,r.o,n.e,r.n,q.b,q.e,Mt.a,p.p,q.a,n.l,Ot.a,R.b,n.c,d.d,d.a,xt.a],pipes:[r.y,m.a,m.c],styles:[".mat-form-field[_ngcontent-%COMP%]{width:100%}table[_ngcontent-%COMP%] .mat-form-field[_ngcontent-%COMP%]{width:80%}.batch-name[_ngcontent-%COMP%]{font-size:24px}mat-checkbox[_ngcontent-%COMP%]{margin-right:24px}.text-center[_ngcontent-%COMP%]{text-align:center!important}th[_ngcontent-%COMP%]{background:hsla(0,0%,50.2%,.30196078431372547)}table[_ngcontent-%COMP%]{width:100%;line-height:10px;border-color:hsla(0,0%,50.2%,.30196078431372547)}table[_ngcontent-%COMP%] .mat-form-field[_ngcontent-%COMP%]{width:60%;height:40px;text-align:center!important}.ml-0[_ngcontent-%COMP%]{margin-left:0!important}.delete-icon[_ngcontent-%COMP%]{border:1px solid red;border-radius:50%;background:red}.delete-icon[_ngcontent-%COMP%], .edit-icon[_ngcontent-%COMP%]{font-size:13px;line-height:20px;width:20px!important;height:20px!important;color:#fff;text-align:center}.edit-icon[_ngcontent-%COMP%]{border:1px solid #00f;border-radius:50%;background:#00f}.btn-dis[_ngcontent-%COMP%]:disabled, .btn-dis[disabled][_ngcontent-%COMP%]{border:1px solid #999!important;background-color:#ccc!important;color:#666!important}.mat-table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{color:#000}.emp_setting[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr.mat-row[_ngcontent-%COMP%]{height:65px!important}.customize_setting[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr.mat-row[_ngcontent-%COMP%]{height:45px!important}"]}),t})();var re=c("0EQZ"),ne=c("M9IT"),ie=c("+0xr");class oe{constructor(){this.limit=10,this.offset=0,this.sortByKey="",this.sortByType="",this.searchWith="",this.totalSize=0}}var le=c("Dh3D"),se=c("xe9D"),de=c("STbY"),ue=c("Qu3c");function me(t,e){1&t&&(D.dc(0,"button",23),D.cd(1,"Create"),D.cc()),2&t&&D.yc("routerLink","/school/new-attendance-settings/employee/create")}function pe(t,e){if(1&t){const t=D.ec();D.dc(0,"th",24),D.dc(1,"mat-checkbox",25),D.lc("change",(function(e){D.Sc(t);const c=D.pc();return e?c.masterToggle():null})),D.cc(),D.cc()}if(2&t){const t=D.pc();D.Gb(1),D.yc("checked",t.selection.hasValue()&&t.isAllSelected())("indeterminate",t.selection.hasValue()&&!t.isAllSelected())}}function he(t,e){if(1&t){const t=D.ec();D.dc(0,"td",26),D.dc(1,"mat-checkbox",27),D.lc("click",(function(e){return D.Sc(t),e.stopPropagation()}))("change",(function(c){D.Sc(t);const a=e.$implicit,r=D.pc();return c?r.selection.toggle(a):null})),D.cc(),D.cc()}if(2&t){const t=e.$implicit,c=D.pc();D.Gb(1),D.yc("checked",c.selection.isSelected(t))}}function ge(t,e){1&t&&(D.dc(0,"th",28),D.dc(1,"b"),D.cd(2,"Department"),D.cc(),D.cc())}function fe(t,e){if(1&t&&(D.dc(0,"td",29),D.cd(1),D.cc()),2&t){const t=e.$implicit;D.Gb(1),D.ed(" ",t.departmentNames," ")}}function be(t,e){1&t&&(D.dc(0,"th",28),D.dc(1,"b"),D.cd(2,"Position"),D.cc(),D.cc())}function ye(t,e){if(1&t&&(D.dc(0,"td",29),D.cd(1),D.cc()),2&t){const t=e.$implicit;D.Gb(1),D.ed(" ",t.positionNames," ")}}function ke(t,e){1&t&&(D.dc(0,"th",30),D.cd(1," Customized Date "),D.cc())}function ve(t,e){if(1&t&&(D.dc(0,"td",29),D.cd(1),D.qc(2,"titlecase"),D.cc()),2&t){const t=e.$implicit;D.Gb(1),D.ed(" ",D.rc(2,1,t.customizeDate)," ")}}function Se(t,e){if(1&t){const t=D.ec();D.dc(0,"button",35),D.lc("click",(function(e){return D.Sc(t),D.pc(2).action("view")})),D.dc(1,"mat-icon",36),D.cd(2,"visibility"),D.cc(),D.dc(3,"span"),D.cd(4,"View"),D.cc(),D.cc()}}function De(t,e){if(1&t){const t=D.ec();D.dc(0,"button",35),D.lc("click",(function(e){return D.Sc(t),D.pc(2).action("edit")})),D.dc(1,"mat-icon",37),D.cd(2,"edit"),D.cc(),D.dc(3,"span"),D.cd(4,"Edit"),D.cc(),D.cc()}}function Ie(t,e){if(1&t){const t=D.ec();D.dc(0,"button",35),D.lc("click",(function(e){return D.Sc(t),D.pc(2).setStatus(1)})),D.dc(1,"mat-icon",38),D.cd(2,"check"),D.cc(),D.dc(3,"span"),D.cd(4,"Active"),D.cc(),D.cc()}}function Me(t,e){if(1&t){const t=D.ec();D.dc(0,"button",35),D.lc("click",(function(e){return D.Sc(t),D.pc(2).setStatus(0)})),D.dc(1,"mat-icon",39),D.cd(2,"block"),D.cc(),D.dc(3,"span"),D.cd(4,"Inactive"),D.cc(),D.cc()}}const Oe=function(){return["emp_attendance_setting"]},xe=function(){return["emp_attendance_setting_view"]},_e=function(){return["emp_attendance_setting_update"]},Te=function(){return["emp_attendance_setting_status"]};function Ae(t,e){if(1&t&&(D.dc(0,"th",31),D.cd(1," Status "),D.dc(2,"mat-icon",32),D.cd(3,"more_vert"),D.cc(),D.dc(4,"mat-menu",null,33),D.ad(6,Se,5,0,"button",34),D.ad(7,De,5,0,"button",34),D.ad(8,Ie,5,0,"button",34),D.ad(9,Me,5,0,"button",34),D.cc(),D.cc()),2&t){const t=D.Oc(5),e=D.pc();D.Gb(2),D.yc("matMenuTriggerFor",t),D.Gb(4),D.yc("ngIf",e.permission.hasPermission(D.Ec(5,Oe),D.Ec(6,xe))),D.Gb(1),D.yc("ngIf",e.permission.hasPermission(D.Ec(7,Oe),D.Ec(8,_e))),D.Gb(1),D.yc("ngIf",e.permission.hasPermission(D.Ec(9,Oe),D.Ec(10,Te))),D.Gb(1),D.yc("ngIf",e.permission.hasPermission(D.Ec(11,Oe),D.Ec(12,Te)))}}function we(t,e){1&t&&(D.dc(0,"label",43),D.cd(1,"Inactive"),D.cc())}function Ce(t,e){1&t&&(D.dc(0,"label",44),D.cd(1,"Active"),D.cc())}function Fe(t,e){1&t&&(D.dc(0,"label",45),D.cd(1,"Incompleted"),D.cc())}function Ee(t,e){if(1&t){const t=D.ec();D.dc(0,"span"),D.dc(1,"mat-icon",46),D.lc("click",(function(e){D.Sc(t);const c=D.pc().$implicit;return D.pc().deviceEmployee(c)})),D.cd(2,"refresh"),D.cc(),D.cc()}}function Pe(t,e){if(1&t&&(D.dc(0,"td",29),D.ad(1,we,2,0,"label",40),D.ad(2,Ce,2,0,"label",41),D.ad(3,Fe,2,0,"label",42),D.ad(4,Ee,3,0,"span",21),D.cc()),2&t){const t=e.$implicit;D.Gb(1),D.yc("ngIf",0==t.status),D.Gb(1),D.yc("ngIf",1==t.status),D.Gb(1),D.yc("ngIf",3==t.status),D.Gb(1),D.yc("ngIf",3==t.status)}}function Ge(t,e){1&t&&D.Yb(0,"tr",47)}function Ye(t,e){1&t&&D.Yb(0,"tr",48)}function ze(t,e){1&t&&(D.bc(0),D.dc(1,"p",49),D.dc(2,"b"),D.cd(3,"No Data Found..."),D.cc(),D.cc(),D.ac())}const He=function(){return["emp_attendance_setting_create"]};let je=(()=>{class t{constructor(t,e,c,a,r,n){this.dialog=t,this.router=e,this.loader=c,this.toaster=a,this.modelService=r,this.permission=n,this.displayedColumns=["select","department","position","customizeDate","status"],this.dataSource=new ie.o,this.selection=new re.c(!0,[]),this.pageSizeOptions=[],this.currentPageDataSize=0,this.value="",this.paginationDTO=new oe,this.pageSizeOptions=Object(se.b)().app.table.filtering.pageSizeOptions,this.getData()}isAllSelected(){return this.selection.selected.length===this.dataSource.data.length}masterToggle(){this.isAllSelected()?this.selection.clear():this.dataSource.data.forEach(t=>this.selection.select(t))}ngAfterViewInit(){this.filterKeyUp()}filterKeyUp(){}sortData(t){}applyFilter(t){t=(t=t.trim()).toLowerCase(),this.paginationDTO.searchWith=t,this.getData()}onPaginateChange(t){this.paginationDTO.offset=t.pageIndex,this.paginationDTO.limit=t.pageSize,this.getData()}getData(){this.loader.open(),this.modelService.getList(this.paginationDTO).subscribe(t=>{"success"==t.keyword?(this.paginationDTO.totalSize=t.pageSize,this.currentPageDataSize=t.empList.length,this.dataSource=new ie.o(t.empList),this.dataSource.sort=this.sort,this.loader.close()):(this.toaster.present(t.message),this.loader.close())})}ngOnInit(){this.dataSource.paginator=this.paginator,this.dataSource.sort=this.sort}getCheckedValue(){let t=[];return this.dataSource.connect().value.forEach(e=>{this.selection.isSelected(e)&&t.push(e)}),t}action(t){1==this.getCheckedValue().length?"edit"!=t&&"view"!=t||lt.a.fire({title:"edit"==t?"Update Employee Attendance Settings":"View Employee Attendance Settings",text:"Are you sure? You want to "+t+" !",icon:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:"Yes, "+t+" it!"}).then(e=>{if(e.value)if("edit"==t){let t=this.getCheckedValue()[0].empAttendanceGroupId;this.router.navigate(["school/new-attendance-settings/employee/edit",t])}else if("view"==t){let t=this.getCheckedValue()[0].empAttendanceGroupId;this.router.navigate(["school/new-attendance-settings/employee/view",t])}}):lt.a.fire({icon:"error",title:"edit"==t?"Update Employee Attendance Settings":"View Employee Attendance Settings",text:"Please Select One Employee Attendance Settings!"})}setStatus(t){let e="";if(1==t?e="active":0==t?e="Inactive":2==t&&(e="delete"),this.getCheckedValue().length>=1){let c=1==t?0:1;2==t?this.statusAlert(e,t):this.isMultiStatus(String(c))?lt.a.fire({icon:"error",title:"Employee Attendance Settings Status",text:"Please select the "+(1==t?"Inactive":"active")+" status of the Employee Attendance Settings!"}):this.statusAlert(e,t)}else 2!=t?lt.a.fire({icon:"error",title:"Change Employee Attendance Settings Status",text:"Please Select Altleast One Employee Attendance Settings!"}):2==t&<.a.fire({icon:"error",title:"Delete Employee Attendance Settings",text:"Please Select Altleast One Employee Attendance Settings!"})}isMultiStatus(t){return this.getCheckedValue().filter(e=>{if(e.status!=t)return e}).length>0}statusAlert(t,e){lt.a.fire({title:"Confirm?",text:"Are you sure? You want to "+t+" it !",icon:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:"Yes, "+t+" it!"}).then(t=>{t.value&&this.saveStatus(e)})}saveStatus(t){let e=[];this.getCheckedValue().forEach(t=>{var c;e.push(null===(c=t)||void 0===c?void 0:c.empAttendanceGroupId)});let c=new FormData;c.append("id",JSON.stringify(e)),c.append("status",String(t)),this.loader.open(),this.modelService.changeEmpAttendanceRoutineStatus(c).subscribe(e=>{"success"==e.keyword?(this.loader.close(),this.refreshTable(2==t?"delete":"other"),this.toaster.present(e.message,"")):(this.loader.close(),this.toaster.present(e.message,""))})}refreshTable(t){this.value="",this.paginationDTO.offset=this.paginator.pageIndex,this.paginationDTO.limit=this.paginator.pageSize,this.paginationDTO.totalSize=this.paginator.length,"add"==t&&(this.paginationDTO.offset=0),"delete"==t&&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 re.c(!0,[])}deviceEmployee(t){var e,c,a,r,n,i,o;const l=Object(H.b)();let s=Object(j.get)(l,"customer_id"),d=Object(j.get)(l,"branch_id"),u=Array.isArray(null===(e=t)||void 0===e?void 0:e.departmentIds)?null===(c=t)||void 0===c?void 0:c.departmentIds:[null===(a=t)||void 0===a?void 0:a.departmentIds],m=Array.isArray(null===(r=t)||void 0===r?void 0:r.positionIds)?null===(n=t)||void 0===n?void 0:n.positionIds:[null===(i=t)||void 0===i?void 0:i.positionIds],p={schoolOpenDays:null===(o=t)||void 0===o?void 0:o.routineList,customerId:String(s),schoolId:String(d),departmentIds:u,positionIds:m};this.modelService.createEmpAttendanceTracking(p).subscribe(e=>{"Success"==e.keyword?this.deviceInsert(t):"Failed"==e.keyword&&this.loader.close()})}deviceInsert(t){let e=new FormData;e.append("id",t.empAttendanceGroupId),e.append("type","emp_attendance_routine"),this.modelService.deviceStatus(e).subscribe(t=>{"success"==t.keyword?(this.loader.close(),this.refreshTable("other")):this.loader.close()})}}return t.\u0275fac=function(e){return new(e||t)(D.Xb(u.b),D.Xb(a.g),D.Xb(f.a),D.Xb(g.a),D.Xb(z),D.Xb(Dt.a))},t.\u0275cmp=D.Rb({type:t,selectors:[["app-list"]],viewQuery:function(t,e){var c;1&t&&(D.Yc(ne.a,!0),D.Yc(le.a,!0)),2&t&&(D.Nc(c=D.mc())&&(e.paginator=c.first),D.Nc(c=D.mc())&&(e.sort=c.first))},decls:27,vars:11,consts:[["fxLayout","row wrap",1,"pagewrap"],["fxFlex","100","fxFlex.gt-xs","50",1,"pr-1",2,"margin-bottom","15px"],[1,"example-button-row","mt-10"],["mat-flat-button","","class","btn-primary-bg",3,"routerLink",4,"ngIf"],["fxFlex","100","fxFlex.gt-xs","50",1,"pr-1"],[1,"table_container","pb-1"],[1,""],["mat-table","","matSort","",1,"mat-elevation-z8",3,"dataSource","matSortChange"],["matColumnDef","select",1,"checkbox-field"],["style","width: 5%; padding-left: 2%;\n text-align: center;","mat-header-cell","",4,"matHeaderCellDef"],["style","width: 5%; padding-left: 2%;\n text-align: center;","mat-cell","",4,"matCellDef"],["matColumnDef","department"],["style","width: 35%;text-align: center;","mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","position"],["matColumnDef","customizeDate"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","status"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[4,"ngIf"],[3,"length","pageSize","pageIndex","pageSizeOptions","page"],["mat-flat-button","",1,"btn-primary-bg",3,"routerLink"],["mat-header-cell","",2,"width","5%","padding-left","2%","text-align","center"],[3,"checked","indeterminate","change"],["mat-cell","",2,"width","5%","padding-left","2%","text-align","center"],[3,"checked","click","change"],["mat-header-cell","","mat-sort-header","",2,"width","35%","text-align","center"],["mat-cell",""],["mat-header-cell","","mat-sort-header",""],["mat-header-cell",""],[1,"action",3,"matMenuTriggerFor"],["menu","matMenu"],["mat-menu-item","",3,"click",4,"ngIf"],["mat-menu-item","",3,"click"],[2,"color","#3F51B5"],[2,"color","grey"],[2,"color","green"],[2,"color","#f19421"],["matTooltip","InActive Status","class","mat-chip mat-danger mat-standard-chip ng-tns-c12-751 mat-chip-selected ng-star-inserted",4,"ngIf"],["class","mat-chip mat-primary mat-standard-chip ng-tns-c12-751 mat-chip-selected ng-star-inserted",4,"ngIf"],["class","mat-block mat-standard-chip ng-tns-c12-751 mat-chip-selected ng-star-inserted","matTooltip","Please update/refresh it again",4,"ngIf"],["matTooltip","InActive Status",1,"mat-chip","mat-danger","mat-standard-chip","ng-tns-c12-751","mat-chip-selected","ng-star-inserted"],[1,"mat-chip","mat-primary","mat-standard-chip","ng-tns-c12-751","mat-chip-selected","ng-star-inserted"],["matTooltip","Please update/refresh it again",1,"mat-block","mat-standard-chip","ng-tns-c12-751","mat-chip-selected","ng-star-inserted"],[1,"ml-8","refresh-icon",3,"click"],["mat-header-row",""],["mat-row",""],[1,"text-center"]],template:function(t,e){1&t&&(D.dc(0,"div",0),D.dc(1,"div",1),D.dc(2,"div",2),D.ad(3,me,2,1,"button",3),D.cc(),D.cc(),D.Yb(4,"div",4),D.cc(),D.dc(5,"div",5),D.dc(6,"div",6),D.dc(7,"table",7),D.lc("matSortChange",(function(t){return e.sortData(t)})),D.bc(8,8),D.ad(9,pe,2,2,"th",9),D.ad(10,he,2,1,"td",10),D.ac(),D.bc(11,11),D.ad(12,ge,3,0,"th",12),D.ad(13,fe,2,1,"td",13),D.ac(),D.bc(14,14),D.ad(15,be,3,0,"th",12),D.ad(16,ye,2,1,"td",13),D.ac(),D.bc(17,15),D.ad(18,ke,2,0,"th",16),D.ad(19,ve,3,3,"td",13),D.ac(),D.bc(20,17),D.ad(21,Ae,10,13,"th",18),D.ad(22,Pe,5,4,"td",13),D.ac(),D.ad(23,Ge,1,0,"tr",19),D.ad(24,Ye,1,0,"tr",20),D.cc(),D.ad(25,ze,4,0,"ng-container",21),D.dc(26,"mat-paginator",22),D.lc("page",(function(t){return e.onPaginateChange(t)})),D.cc(),D.cc(),D.cc()),2&t&&(D.Gb(3),D.yc("ngIf",e.permission.hasPermission(D.Ec(9,Oe),D.Ec(10,He))),D.Gb(4),D.yc("dataSource",e.dataSource),D.Gb(16),D.yc("matHeaderRowDef",e.displayedColumns),D.Gb(1),D.yc("matRowDefColumns",e.displayedColumns),D.Gb(1),D.yc("ngIf",0===e.dataSource.filteredData.length||0===e.dataSource.data.length),D.Gb(1),D.yc("length",e.paginationDTO.totalSize)("pageSize",e.paginationDTO.limit)("pageIndex",e.paginationDTO.offset)("pageSizeOptions",e.pageSizeOptions))},directives:[N.c,N.a,r.o,ie.n,le.a,ie.c,ie.i,ie.b,ie.k,ie.m,ne.a,W.a,a.h,ie.h,Ot.a,ie.a,le.b,xt.a,de.d,de.e,de.b,ue.a,ie.j,ie.l],pipes:[r.y],styles:[""]}),t})();class Ve{constructor(){this.limit=10,this.offset=0,this.sortByKey="",this.sortByType="",this.searchWith="",this.totalSize=0}}class Le{constructor(){this.academicYearName="",this.batchName="",this.class="",this.classNames="",this.status="",this.studAttendanceGroupId="",this.routineList=[],this.academicYearId="",this.batchId="",this.classIds="",this.customizeDate=""}}class Be{constructor(){this.checkIn="",this.checkOut="",this.day="",this.dayId="",this.empAttendanceRoutineId="",this.halfDayMark="",this.isWorkingDay="",this.lateMark="",this.status=""}}class Ne{constructor(){this.checkIn="",this.checkOut="",this.day="",this.halfDayMarkTime="",this.isWorkingDay="",this.lateMarkMin=""}}let qe=(()=>{class t{constructor(){}adapt(t){var e,c,a,r,n,i,o,l,s;let d=[];return(null===(c=null===(e=t)||void 0===e?void 0:e.routine)||void 0===c?void 0:c.length)>0&&t.routine.forEach(t=>{d.push(this.adaptRoutine(t))}),this.obj=new Le,this.obj.academicYearName=null!=(a=t.academic_year_name)?a:"",this.obj.academicYearId=null!=(r=t.academic_year_id)?r:"",this.obj.batchName=null!=(n=t.batch_name)?n:"",this.obj.batchId=null!=(i=t.batch_id)?i:"",this.obj.class=null!=(o=t.class)?o:"",this.obj.classNames=this.filterArray("class_name",t.class),this.obj.classIds=this.filterArray("class_id",t.class),this.obj.status=null!=(l=t.status)?l:"",this.obj.studAttendanceGroupId=null!=(s=t.stud_attendance_group_id)?s:"",this.obj.routineList=d,this.obj}filterArray(t,e){return Array.isArray(e)?e.map(e=>e[t]):e}adaptRoutine(t){var e,c,a,r,n,i,o,l,s;return this.routineObj=new Be,this.routineObj.checkIn=null!=(e=t.check_in)?e:"",this.routineObj.checkOut=null!=(c=t.check_out)?c:"",this.routineObj.day=null!=(a=t.day)?a:"",this.routineObj.dayId=null!=(r=t.day_id)?r:"",this.routineObj.empAttendanceRoutineId=null!=(n=t.emp_attendance_routine_id)?n:"",this.routineObj.halfDayMark=null!=(i=t.half_day_mark)?i:"",this.routineObj.isWorkingDay=null!=(o=t.is_working_day)?o:"",this.routineObj.lateMark=null!=(l=t.late_mark)?l:"",this.routineObj.status=null!=(s=t.status)?s:"",this.routineObj}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=D.Tb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),Re=(()=>{class t{constructor(){this.days=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]}adapt(t){var e,c,a,r,n,i,o,l,s,d;let u=[];return(null===(c=null===(e=t)||void 0===e?void 0:e.routine)||void 0===c?void 0:c.length)>0&&t.routine.forEach(t=>{u.push(this.adaptRoutine(t))}),this.obj=new Le,this.obj.customizeDate=null!=(a=t.customize_date)?a:"",this.obj.academicYearName=null!=(r=t.academic_year_name)?r:"",this.obj.academicYearId=null!=(n=t.academic_year_id)?n:"",this.obj.batchName=null!=(i=t.batch_name)?i:"",this.obj.batchId=null!=(o=t.batch_id)?o:"",this.obj.class=null!=(l=t.class)?l:"",this.obj.classNames=this.filterArray("class_name",t.class),this.obj.classIds=this.filterArray("class_id",t.class),this.obj.status=null!=(s=t.status)?s:"",this.obj.studAttendanceGroupId=null!=(d=t.stud_attendance_group_id)?d:"",this.obj.routineList=u,this.obj}filterArray(t,e){return Array.isArray(e)?e.map(e=>e[t]):e}adaptRoutine(t){var e,c,a;return this.routineObj=new Ne,this.routineObj.checkIn=null!=(e=t.check_in)?e:"00:00:00",this.routineObj.checkOut=null!=(c=t.check_out)?c:"00:00:00",this.routineObj.day=t.day_id?this.days[t.day_id-1]:"Monday",this.routineObj.halfDayMarkTime=null!=(a=t.half_day_mark)?a:"00:00:00",this.routineObj.isWorkingDay=1==t.is_working_day?"true":"false",this.routineObj.lateMarkMin=t.late_mark?M(t.late_mark,"HH:mm:ss").format("ss"):"00",this.routineObj}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=D.Tb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),Xe=(()=>{class t{constructor(t,e){this.adapter=t,this.list=e}adapt(t){var e;let c=[];return(null===(e=t)||void 0===e?void 0:e.data[0])&&t.data[0].forEach(t=>{c.push(this.adapter.adapt(t))}),{keyword:t.keyword,message:t.message,attendList:c,pageSize:t.count,page:t.page}}adaptList(t){var e;let c=[];return(null===(e=t)||void 0===e?void 0:e.data[0])&&t.data[0].forEach(t=>{c.push(this.list.adapt(t))}),{keyword:t.keyword,message:t.message,attendList:c,pageSize:t.count,page:t.page}}}return t.\u0275fac=function(e){return new(e||t)(D.hc(qe),D.hc(Re))},t.\u0275prov=D.Tb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();class We{constructor(){this.positionId="",this.positionName=""}}let $e=(()=>{class t{adapt(t){var e,c;return this.obj=new We,this.obj.positionId=null!=(e=t.employee_position_id)?e:"",this.obj.positionName=null!=(c=t.name)?c:"",this.obj}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=D.Tb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),Ue=(()=>{class t{constructor(t){this.adapter=t}adapt(t){var e,c,a,r,n;let i=[];return(null===(c=null===(e=t)||void 0===e?void 0:e.data)||void 0===c?void 0:c.overall_id)&&(null===(n=null===(r=null===(a=t)||void 0===a?void 0:a.data)||void 0===r?void 0:r.overall_id)||void 0===n||n.forEach(t=>{i.push(this.adapter.adapt(t))})),{keyword:t.keyword,message:t.message,positions:i,pageSize:t.count,page:t.page}}}return t.\u0275fac=function(e){return new(e||t)(D.hc($e))},t.\u0275prov=D.Tb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();class Je{constructor(){this.checkIn="",this.checkOut="",this.halfDayMark="",this.status="",this.customizeDate="",this.empAttendanceCustomizeDateId=""}}let Ke=(()=>{class t{constructor(){}adapt(t){var e,c,a,r,n,i,o,l,s;return this.obj=new Je,this.obj.checkIn=(null===(e=t)||void 0===e?void 0:e.check_in)?M(t.check_in,"HH:mm:ss").format("HH:mm"):"",this.obj.checkOut=(null===(c=t)||void 0===c?void 0:c.check_out)?M(t.check_out,"HH:mm:ss").format("HH:mm"):"",this.obj.customizeDate=(null===(a=t)||void 0===a?void 0:a.customize_date)?M(t.customize_date,"YYYY-MM-DD").format("DD-MM-YYYY"):"",this.obj.empAttendanceCustomizeDateId=null!=(n=null===(r=t)||void 0===r?void 0:r.stud_attendance_customize_date_id)?n:"",this.obj.halfDayMark=(null===(i=t)||void 0===i?void 0:i.half_day_mark)?M(t.half_day_mark,"HH:mm:ss").format("HH:mm"):"",this.obj.lateMark=(null===(o=t)||void 0===o?void 0:o.late_mark)?M(t.late_mark,"HH:mm:ss").diff(M().startOf("day"),"minutes"):"00",this.obj.status=null!=(s=null===(l=t)||void 0===l?void 0:l.status)?s:"",this.obj}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=D.Tb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),Qe=(()=>{class t{constructor(t){this.adapter=t}adapt(t){var e;let c=[];return(null===(e=t)||void 0===e?void 0:e.data[0])&&t.data[0].forEach(t=>{c.push(this.adapter.adapt(t))}),{keyword:t.keyword,message:t.message,customizeList:c,pageSize:t.count,page:t.page}}adaptCreateResponse(t){var e;let c=[];return(null===(e=t)||void 0===e?void 0:e.data[0])&&t.data.forEach(t=>{c.push(this.adapter.adapt(t))}),{keyword:t.keyword,message:t.message,customizeList:c,pageSize:t.count,page:t.page}}}return t.\u0275fac=function(e){return new(e||t)(D.hc(Ke))},t.\u0275prov=D.Tb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();class Ze{constructor(){this.classId="",this.className=""}}let tc=(()=>{class t{adapt(t){var e,c;return this.dept=new Ze,this.dept.classId=null!=(e=t.class_id)?e:"",this.dept.className=null!=(c=t.class_name)?c:"",this.dept}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=D.Tb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),ec=(()=>{class t{constructor(t){this.adapterDept=t}adapt(t){var e,c,a,r,n,i,o,l;let s=[];(null===(c=null===(e=t)||void 0===e?void 0:e.data)||void 0===c?void 0:c.overall_id)&&(null===(r=null===(a=t)||void 0===a?void 0:a.data)||void 0===r||r.overall_id.forEach(t=>{s.push(this.adapterDept.adapt(t))}));let d=[];return(null===(i=null===(n=t)||void 0===n?void 0:n.data)||void 0===i?void 0:i.selected_id)&&(null===(l=null===(o=t)||void 0===o?void 0:o.data)||void 0===l||l.selected_id.forEach(t=>{d.push(this.adapterDept.adapt(t))})),{keyword:t.keyword,message:t.message,classes:s,selectedClass:d,pageSize:t.count,page:t.page}}}return t.\u0275fac=function(e){return new(e||t)(D.hc(tc))},t.\u0275prov=D.Tb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),cc=(()=>{class t{constructor(t,e,c,a,r){this.adapter=t,this.customizeAdapt=e,this.classAdpt=c,this.postAdap=a,this.apiService=r,this.userId=0}getList(t){let e=new b.e;for(let c in t)e=e.set(c,t[c]);return this.apiService.get("StudAttendanceList",e).pipe(Object(y.a)(t=>this.adapter.adaptList(t)))}createStudentAttendanceRoutine(t){return this.apiService.post("StudAttendanceRoutine/create",t).pipe(Object(y.a)(t=>this.adapter.adapt(t)))}updateStudentAttendanceRoutine(t){return this.apiService.post("StudAttendanceRoutine/update",t).pipe(Object(y.a)(t=>this.adapter.adapt(t)))}getOneStudentAttendacneRoutine(t){return this.apiService.get(`StudAttendanceRoutine/${t}`).pipe(Object(y.a)(t=>this.adapter.adapt(t)))}changeStudentAttendanceRoutineStatus(t){return this.apiService.post("StudAttendanceRoutine/status",t).pipe(Object(y.a)(t=>this.adapter.adapt(t)))}getClassByBatchId(t,e){return this.apiService.get(`loadClassbyBatchStud/${t}/${e}`).pipe(Object(y.a)(t=>this.classAdpt.adapt(t)))}getStudentCustomizeList(t){return this.apiService.get(`StudcusDateList/${t}`).pipe(Object(y.a)(t=>this.customizeAdapt.adapt(t)))}getOneStudentCustomizeList(t){return this.apiService.get(`StudAttendanceDate/${t}`).pipe(Object(y.a)(t=>this.customizeAdapt.adapt(t)))}createStudentAttendanceCustom(t){return this.apiService.post("StudAttendanceDate/create",t).pipe(Object(y.a)(t=>this.customizeAdapt.adaptCreateResponse(t)))}updateStudentAttendanceCustom(t){return this.apiService.post("StudAttendanceDate/update",t).pipe(Object(y.a)(t=>this.customizeAdapt.adaptCreateResponse(t)))}deleteStudentAttendanceCustom(t){return this.apiService.post("StudAttendanceDate/delete",t).pipe(Object(y.a)(t=>this.customizeAdapt.adapt(t)))}createStudentAttendanceTracking(t){return this.apiService.devicepost("attendance/set/student-attendance-settings",t)}createStudentAttendanceDateTracking(t){return this.apiService.devicepost("attendance/set/student-attendance-date-settings",t)}updateStudentAttendanceDateTracking(t){return this.apiService.deviceput("attendance/update/student-attendance-date-settings",t)}deleteStudentAttendanceDateTracking(t){return this.apiService.devicepost("attendance/delete/student-attendance-date-settings",t)}deviceStatus(t){return this.apiService.post("updateDevice",t).pipe(Object(y.a)(t=>this.adapter.adapt(t)))}}return t.\u0275fac=function(e){return new(e||t)(D.hc(Xe),D.hc(Qe),D.hc(ec),D.hc(Ue),D.hc(_.a))},t.\u0275prov=D.Tb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function ac(t,e){1&t&&(D.dc(0,"button",25),D.cd(1,"Create"),D.cc()),2&t&&D.yc("routerLink","/school/new-attendance-settings/student/create")}function rc(t,e){if(1&t){const t=D.ec();D.dc(0,"th",26),D.dc(1,"mat-checkbox",27),D.lc("change",(function(e){D.Sc(t);const c=D.pc();return e?c.masterToggle():null})),D.cc(),D.cc()}if(2&t){const t=D.pc();D.Gb(1),D.yc("checked",t.selection.hasValue()&&t.isAllSelected())("indeterminate",t.selection.hasValue()&&!t.isAllSelected())}}function nc(t,e){if(1&t){const t=D.ec();D.dc(0,"td",28),D.dc(1,"mat-checkbox",29),D.lc("click",(function(e){return D.Sc(t),e.stopPropagation()}))("change",(function(c){D.Sc(t);const a=e.$implicit,r=D.pc();return c?r.selection.toggle(a):null})),D.cc(),D.cc()}if(2&t){const t=e.$implicit,c=D.pc();D.Gb(1),D.yc("checked",c.selection.isSelected(t))}}function ic(t,e){1&t&&(D.dc(0,"th",30),D.dc(1,"b"),D.cd(2,"Academic Year"),D.cc(),D.cc())}function oc(t,e){if(1&t&&(D.dc(0,"td",31),D.cd(1),D.cc()),2&t){const t=e.$implicit;D.Gb(1),D.ed(" ",t.academicYearName," ")}}function lc(t,e){1&t&&(D.dc(0,"th",30),D.dc(1,"b"),D.cd(2,"Batch"),D.cc(),D.cc())}function sc(t,e){if(1&t&&(D.dc(0,"td",31),D.cd(1),D.cc()),2&t){const t=e.$implicit;D.Gb(1),D.ed(" ",t.batchName," ")}}function dc(t,e){1&t&&(D.dc(0,"th",32),D.cd(1," Classes "),D.cc())}function uc(t,e){if(1&t&&(D.dc(0,"td",31),D.cd(1),D.cc()),2&t){const t=e.$implicit;D.Gb(1),D.ed(" ",t.classNames," ")}}function mc(t,e){1&t&&(D.dc(0,"th",33),D.cd(1," Customized Date "),D.cc())}function pc(t,e){if(1&t&&(D.dc(0,"td",31),D.cd(1),D.qc(2,"titlecase"),D.cc()),2&t){const t=e.$implicit;D.Gb(1),D.ed(" ",D.rc(2,1,t.customizeDate)," ")}}function hc(t,e){if(1&t){const t=D.ec();D.dc(0,"button",38),D.lc("click",(function(e){return D.Sc(t),D.pc(2).action("view")})),D.dc(1,"mat-icon",39),D.cd(2,"visibility"),D.cc(),D.dc(3,"span"),D.cd(4,"View"),D.cc(),D.cc()}}function gc(t,e){if(1&t){const t=D.ec();D.dc(0,"button",38),D.lc("click",(function(e){return D.Sc(t),D.pc(2).action("edit")})),D.dc(1,"mat-icon",40),D.cd(2,"edit"),D.cc(),D.dc(3,"span"),D.cd(4,"Edit"),D.cc(),D.cc()}}function fc(t,e){if(1&t){const t=D.ec();D.dc(0,"button",38),D.lc("click",(function(e){return D.Sc(t),D.pc(2).setStatus(1)})),D.dc(1,"mat-icon",41),D.cd(2,"check"),D.cc(),D.dc(3,"span"),D.cd(4,"Active"),D.cc(),D.cc()}}function bc(t,e){if(1&t){const t=D.ec();D.dc(0,"button",38),D.lc("click",(function(e){return D.Sc(t),D.pc(2).setStatus(0)})),D.dc(1,"mat-icon",42),D.cd(2,"block"),D.cc(),D.dc(3,"span"),D.cd(4,"Inactive"),D.cc(),D.cc()}}const yc=function(){return["stu_attendance_setting"]},kc=function(){return["stu_attendance_setting_view"]},vc=function(){return["stu_attendance_setting_update"]},Sc=function(){return["stu_attendance_setting_status"]};function Dc(t,e){if(1&t&&(D.dc(0,"th",34),D.cd(1," Status "),D.dc(2,"mat-icon",35),D.cd(3,"more_vert"),D.cc(),D.dc(4,"mat-menu",null,36),D.ad(6,hc,5,0,"button",37),D.ad(7,gc,5,0,"button",37),D.ad(8,fc,5,0,"button",37),D.ad(9,bc,5,0,"button",37),D.cc(),D.cc()),2&t){const t=D.Oc(5),e=D.pc();D.Gb(2),D.yc("matMenuTriggerFor",t),D.Gb(4),D.yc("ngIf",e.permission.hasPermission(D.Ec(5,yc),D.Ec(6,kc))),D.Gb(1),D.yc("ngIf",e.permission.hasPermission(D.Ec(7,yc),D.Ec(8,vc))),D.Gb(1),D.yc("ngIf",e.permission.hasPermission(D.Ec(9,yc),D.Ec(10,Sc))),D.Gb(1),D.yc("ngIf",e.permission.hasPermission(D.Ec(11,yc),D.Ec(12,Sc)))}}function Ic(t,e){1&t&&(D.dc(0,"label",46),D.cd(1,"Inactive"),D.cc())}function Mc(t,e){1&t&&(D.dc(0,"label",47),D.cd(1,"Active"),D.cc())}function Oc(t,e){1&t&&(D.dc(0,"label",48),D.cd(1,"Incompleted"),D.cc())}function xc(t,e){if(1&t){const t=D.ec();D.dc(0,"span"),D.dc(1,"mat-icon",49),D.lc("click",(function(e){D.Sc(t);const c=D.pc().$implicit;return D.pc().deviceStudent(c)})),D.cd(2,"refresh"),D.cc(),D.cc()}}function _c(t,e){if(1&t&&(D.dc(0,"td",31),D.ad(1,Ic,2,0,"label",43),D.ad(2,Mc,2,0,"label",44),D.ad(3,Oc,2,0,"label",45),D.ad(4,xc,3,0,"span",23),D.cc()),2&t){const t=e.$implicit;D.Gb(1),D.yc("ngIf",0==t.status),D.Gb(1),D.yc("ngIf",1==t.status),D.Gb(1),D.yc("ngIf",3==t.status),D.Gb(1),D.yc("ngIf",3==t.status)}}function Tc(t,e){1&t&&D.Yb(0,"tr",50)}function Ac(t,e){1&t&&D.Yb(0,"tr",51)}function wc(t,e){1&t&&(D.bc(0),D.dc(1,"p",52),D.dc(2,"b"),D.cd(3,"No Data Found..."),D.cc(),D.cc(),D.ac())}const Cc=function(){return["stu_attendance_setting_create"]};let Fc=(()=>{class t{constructor(t,e,c,a,r,n){this.dialog=t,this.router=e,this.loader=c,this.toaster=a,this.permission=r,this.modelService=n,this.displayedColumns=["select","academicYearName","batchName","classNames","customizeDate","status"],this.dataSource=new ie.o,this.selection=new re.c(!0,[]),this.pageSizeOptions=[],this.currentPageDataSize=0,this.value="",this.paginationDTO=new Ve,this.pageSizeOptions=Object(se.b)().app.table.filtering.pageSizeOptions,this.getData()}isAllSelected(){return this.selection.selected.length===this.dataSource.data.length}masterToggle(){this.isAllSelected()?this.selection.clear():this.dataSource.data.forEach(t=>this.selection.select(t))}ngAfterViewInit(){this.filterKeyUp()}filterKeyUp(){}sortData(t){}applyFilter(t){t=(t=t.trim()).toLowerCase(),this.paginationDTO.searchWith=t,this.getData()}onPaginateChange(t){this.paginationDTO.offset=t.pageIndex,this.paginationDTO.limit=t.pageSize,this.getData()}getData(){this.loader.open(),this.modelService.getList(this.paginationDTO).subscribe(t=>{"success"==t.keyword?(this.paginationDTO.totalSize=t.pageSize,this.currentPageDataSize=t.attendList.length,this.dataSource=new ie.o(t.attendList),this.dataSource.sort=this.sort,this.loader.close()):(this.toaster.present(t.message),this.loader.close())})}ngOnInit(){this.dataSource.paginator=this.paginator,this.dataSource.sort=this.sort}getCheckedValue(){let t=[];return this.dataSource.connect().value.forEach(e=>{this.selection.isSelected(e)&&t.push(e)}),t}action(t){1==this.getCheckedValue().length?"edit"!=t&&"view"!=t||lt.a.fire({title:"edit"==t?"Update Student Attendance Settings":"View Student Attendance Settings",text:"Are you sure? You want to "+t+" !",icon:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:"Yes, "+t+" it!"}).then(e=>{if(e.value)if("edit"==t){let t=this.getCheckedValue()[0].studAttendanceGroupId;this.router.navigate(["school/new-attendance-settings/student/edit",t])}else if("view"==t){let t=this.getCheckedValue()[0].studAttendanceGroupId;this.router.navigate(["school/new-attendance-settings/student/view",t])}}):lt.a.fire({icon:"error",title:"edit"==t?"Update Student Attendance Settings":"View Student Attendance Settings",text:"Please Select One Student Attendance Settings!"})}setStatus(t){let e="";if(1==t?e="active":0==t?e="Inactive":2==t&&(e="delete"),this.getCheckedValue().length>=1){let c=1==t?0:1;2==t?this.statusAlert(e,t):this.isMultiStatus(String(c))?lt.a.fire({icon:"error",title:"Student Attendance Settings Status",text:"Please select the "+(1==t?"Inactive":"active")+" status of the Student Attendance Settings!"}):this.statusAlert(e,t)}else 2!=t?lt.a.fire({icon:"error",title:"Change Student Attendance Settings Status",text:"Please Select Altleast One Student Attendance Settings!"}):2==t&<.a.fire({icon:"error",title:"Delete Student Attendance Settings",text:"Please Select Altleast One Student Attendance Settings!"})}isMultiStatus(t){return this.getCheckedValue().filter(e=>{if(e.status!=t)return e}).length>0}statusAlert(t,e){lt.a.fire({title:"Confirm?",text:"Are you sure? You want to "+t+" it !",icon:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:"Yes, "+t+" it!"}).then(t=>{t.value&&this.saveStatus(e)})}saveStatus(t){let e=[];this.getCheckedValue().forEach(t=>{var c;e.push(null===(c=t)||void 0===c?void 0:c.studAttendanceGroupId)});let c=new FormData;c.append("id",JSON.stringify(e)),c.append("status",String(t)),this.loader.open(),this.modelService.changeStudentAttendanceRoutineStatus(c).subscribe(e=>{"success"==e.keyword?(this.loader.close(),this.refreshTable(2==t?"delete":"other"),this.toaster.present(e.message,"")):(this.loader.close(),this.toaster.present(e.message,""))})}refreshTable(t){this.value="",this.paginationDTO.offset=this.paginator.pageIndex,this.paginationDTO.limit=this.paginator.pageSize,this.paginationDTO.totalSize=this.paginator.length,"add"==t&&(this.paginationDTO.offset=0),"delete"==t&&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 re.c(!0,[])}deviceStudent(t){var e,c,a,r;this.loader.open();const n=Object(H.b)();let i=Object(j.get)(n,"customer_id"),o=Object(j.get)(n,"branch_id"),l=Array.isArray(null===(e=t)||void 0===e?void 0:e.classIds)?t.classIds:[null===(c=t)||void 0===c?void 0:c.classIds],s={schoolOpenDays:t.routineList,customerId:String(i),schoolId:String(o),academicYearId:(null===(a=t)||void 0===a?void 0:a.academicYearName).toString(),batchId:(null===(r=t)||void 0===r?void 0:r.batchName).toString(),classIds:l};this.modelService.createStudentAttendanceTracking(s).subscribe(e=>{"Success"==e.keyword?this.deviceInsert(t):"Failed"==e.keyword&&this.loader.close()})}deviceInsert(t){let e=new FormData;e.append("id",t.studAttendanceGroupId),e.append("type","stud_attendance_routine"),this.modelService.deviceStatus(e).subscribe(t=>{"success"==t.keyword?(this.loader.close(),this.refreshTable("other")):this.loader.close()})}}return t.\u0275fac=function(e){return new(e||t)(D.Xb(u.b),D.Xb(a.g),D.Xb(f.a),D.Xb(g.a),D.Xb(Dt.a),D.Xb(cc))},t.\u0275cmp=D.Rb({type:t,selectors:[["app-list"]],viewQuery:function(t,e){var c;1&t&&(D.Yc(ne.a,!0),D.Yc(le.a,!0)),2&t&&(D.Nc(c=D.mc())&&(e.paginator=c.first),D.Nc(c=D.mc())&&(e.sort=c.first))},decls:30,vars:11,consts:[["fxLayout","row wrap",1,"pagewrap"],["fxFlex","100","fxFlex.gt-xs","50",1,"pr-1",2,"margin-bottom","15px"],[1,"example-button-row","mt-10"],["mat-flat-button","","class","btn-primary-bg",3,"routerLink",4,"ngIf"],["fxFlex","100","fxFlex.gt-xs","50",1,"pr-1"],[1,"table_container","pb-1"],[1,""],["mat-table","","matSort","",1,"mat-elevation-z8",3,"dataSource","matSortChange"],["matColumnDef","select",1,"checkbox-field"],["style","width: 5%; padding-left: 2%;\n text-align: center;","mat-header-cell","",4,"matHeaderCellDef"],["style","width: 5%; padding-left: 2%;\n text-align: center;","mat-cell","",4,"matCellDef"],["matColumnDef","academicYearName"],["style","width: 25%;text-align: center;","mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","batchName"],["matColumnDef","classNames"],["style","width: 15%;text-align: center;","mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","customizeDate"],["style","text-align: center;","mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","status"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[4,"ngIf"],[3,"length","pageSize","pageIndex","pageSizeOptions","page"],["mat-flat-button","",1,"btn-primary-bg",3,"routerLink"],["mat-header-cell","",2,"width","5%","padding-left","2%","text-align","center"],[3,"checked","indeterminate","change"],["mat-cell","",2,"width","5%","padding-left","2%","text-align","center"],[3,"checked","click","change"],["mat-header-cell","","mat-sort-header","",2,"width","25%","text-align","center"],["mat-cell",""],["mat-header-cell","","mat-sort-header","",2,"width","15%","text-align","center"],["mat-header-cell","","mat-sort-header","",2,"text-align","center"],["mat-header-cell",""],[1,"action",3,"matMenuTriggerFor"],["menu","matMenu"],["mat-menu-item","",3,"click",4,"ngIf"],["mat-menu-item","",3,"click"],[2,"color","#3F51B5"],[2,"color","grey"],[2,"color","green"],[2,"color","#f19421"],["matTooltip","Incomplete Status","class","mat-chip mat-danger mat-standard-chip ng-tns-c12-751 mat-chip-selected ng-star-inserted",4,"ngIf"],["class","mat-chip mat-primary mat-standard-chip ng-tns-c12-751 mat-chip-selected ng-star-inserted",4,"ngIf"],["class","mat-block mat-standard-chip ng-tns-c12-751 mat-chip-selected ng-star-inserted","matTooltip","Please update/refresh it again",4,"ngIf"],["matTooltip","Incomplete Status",1,"mat-chip","mat-danger","mat-standard-chip","ng-tns-c12-751","mat-chip-selected","ng-star-inserted"],[1,"mat-chip","mat-primary","mat-standard-chip","ng-tns-c12-751","mat-chip-selected","ng-star-inserted"],["matTooltip","Please update/refresh it again",1,"mat-block","mat-standard-chip","ng-tns-c12-751","mat-chip-selected","ng-star-inserted"],[1,"ml-8","refresh-icon",3,"click"],["mat-header-row",""],["mat-row",""],[1,"text-center"]],template:function(t,e){1&t&&(D.dc(0,"div",0),D.dc(1,"div",1),D.dc(2,"div",2),D.ad(3,ac,2,1,"button",3),D.cc(),D.cc(),D.Yb(4,"div",4),D.cc(),D.dc(5,"div",5),D.dc(6,"div",6),D.dc(7,"table",7),D.lc("matSortChange",(function(t){return e.sortData(t)})),D.bc(8,8),D.ad(9,rc,2,2,"th",9),D.ad(10,nc,2,1,"td",10),D.ac(),D.bc(11,11),D.ad(12,ic,3,0,"th",12),D.ad(13,oc,2,1,"td",13),D.ac(),D.bc(14,14),D.ad(15,lc,3,0,"th",12),D.ad(16,sc,2,1,"td",13),D.ac(),D.bc(17,15),D.ad(18,dc,2,0,"th",16),D.ad(19,uc,2,1,"td",13),D.ac(),D.bc(20,17),D.ad(21,mc,2,0,"th",18),D.ad(22,pc,3,3,"td",13),D.ac(),D.bc(23,19),D.ad(24,Dc,10,13,"th",20),D.ad(25,_c,5,4,"td",13),D.ac(),D.ad(26,Tc,1,0,"tr",21),D.ad(27,Ac,1,0,"tr",22),D.cc(),D.ad(28,wc,4,0,"ng-container",23),D.dc(29,"mat-paginator",24),D.lc("page",(function(t){return e.onPaginateChange(t)})),D.cc(),D.cc(),D.cc()),2&t&&(D.Gb(3),D.yc("ngIf",e.permission.hasPermission(D.Ec(9,yc),D.Ec(10,Cc))),D.Gb(4),D.yc("dataSource",e.dataSource),D.Gb(19),D.yc("matHeaderRowDef",e.displayedColumns),D.Gb(1),D.yc("matRowDefColumns",e.displayedColumns),D.Gb(1),D.yc("ngIf",0===e.dataSource.filteredData.length||0===e.dataSource.data.length),D.Gb(1),D.yc("length",e.paginationDTO.totalSize)("pageSize",e.paginationDTO.limit)("pageIndex",e.paginationDTO.offset)("pageSizeOptions",e.pageSizeOptions))},directives:[N.c,N.a,r.o,ie.n,le.a,ie.c,ie.i,ie.b,ie.k,ie.m,ne.a,W.a,a.h,ie.h,Ot.a,ie.a,le.b,xt.a,de.d,de.e,de.b,ue.a,ie.j,ie.l],pipes:[r.y],styles:[""]}),t})();const Ec=["allDepartmentSelected"],Pc=["allPositionSelected"];function Gc(t,e){if(1&t&&(D.dc(0,"mat-option",32),D.cd(1),D.cc()),2&t){const t=e.$implicit;D.yc("value",t.departmentId),D.Gb(1),D.ed(" ",t.name," ")}}function Yc(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please select atleast one department "),D.cc())}function zc(t,e){if(1&t&&(D.dc(0,"mat-option",32),D.cd(1),D.cc()),2&t){const t=e.$implicit;D.yc("value",t.positionId),D.Gb(1),D.ed(" ",t.positionName," ")}}function Hc(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please select atleast one position "),D.cc())}function jc(t,e){if(1&t&&(D.dc(0,"div"),D.dc(1,"div",8),D.dc(2,"div",26),D.dc(3,"label"),D.dc(4,"strong"),D.cd(5,"Department"),D.cc(),D.dc(6,"span",12),D.cd(7,"*"),D.cc(),D.cc(),D.cc(),D.dc(8,"div",27),D.dc(9,"mat-form-field",28),D.Yb(10,"mat-label"),D.dc(11,"mat-select",29),D.ad(12,Gc,2,2,"mat-option",30),D.cc(),D.ad(13,Yc,2,0,"mat-error",17),D.cc(),D.cc(),D.cc(),D.dc(14,"div",8),D.dc(15,"div",26),D.dc(16,"label"),D.dc(17,"strong"),D.cd(18,"Position"),D.cc(),D.dc(19,"span",12),D.cd(20,"*"),D.cc(),D.cc(),D.cc(),D.dc(21,"div",27),D.dc(22,"mat-form-field",28),D.Yb(23,"mat-label"),D.dc(24,"mat-select",31),D.ad(25,zc,2,2,"mat-option",30),D.cc(),D.ad(26,Hc,2,0,"mat-error",17),D.cc(),D.cc(),D.cc(),D.cc()),2&t){const t=D.pc();D.Gb(12),D.yc("ngForOf",t.departments),D.Gb(1),D.yc("ngIf",null==t.control?null:null==t.control.department?null:null==t.control.department.errors?null:t.control.department.errors.required),D.Gb(12),D.yc("ngForOf",t.positions),D.Gb(1),D.yc("ngIf",null==t.control?null:null==t.control.position?null:null==t.control.position.errors?null:t.control.position.errors.required)}}function Vc(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide the check in time "),D.cc())}function Lc(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide the check out time "),D.cc())}function Bc(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide the half day mark time "),D.cc())}function Nc(t,e){1&t&&(D.dc(0,"span"),D.cd(1," Please provide the late mark after time "),D.cc())}function qc(t,e){if(1&t&&(D.dc(0,"mat-error"),D.ad(1,Nc,2,0,"span",47),D.cc()),2&t){const t=D.pc().$implicit,e=D.Oc(29);D.Gb(1),D.yc("ngIf",null==t.controls?null:null==t.controls.lateMarkAfter?null:t.controls.lateMarkAfter.errors.required)("ngIfElse",e)}}function Rc(t,e){1&t&&(D.dc(0,"mat-error"),D.dc(1,"span"),D.cd(2," Please provide the valid late mark after time "),D.cc(),D.cc())}function Xc(t,e){if(1&t&&D.ad(0,Rc,3,0,"mat-error",47),2&t){const t=D.pc().$implicit,e=D.Oc(31);D.yc("ngIf",null==t.controls?null:null==t.controls.lateMarkAfter?null:t.controls.lateMarkAfter.errors.pattern)("ngIfElse",e)}}function Wc(t,e){1&t&&(D.dc(0,"mat-error"),D.dc(1,"span"),D.cd(2," Please provide the minute within 2 digit "),D.cc(),D.cc())}function $c(t,e){if(1&t&&D.ad(0,Wc,3,0,"mat-error",47),2&t){const t=D.pc().$implicit,e=D.Oc(33);D.yc("ngIf",null==t.controls?null:null==t.controls.lateMarkAfter?null:t.controls.lateMarkAfter.errors.maxLength)("ngIfElse",e)}}function Uc(t,e){1&t&&(D.dc(0,"mat-error"),D.dc(1,"span"),D.cd(2," Please provide the minute within 60 minutes "),D.cc(),D.cc())}function Jc(t,e){if(1&t&&D.ad(0,Uc,3,0,"mat-error",17),2&t){const t=D.pc().$implicit;D.yc("ngIf",null==t.controls?null:null==t.controls.lateMarkAfter?null:t.controls.lateMarkAfter.errors.max)}}function Kc(t,e){if(1&t){const t=D.ec();D.dc(0,"tr",33),D.dc(1,"td",34),D.dc(2,"mat-checkbox",35),D.lc("change",(function(c){D.Sc(t);const a=e.index;return D.pc().isdayClicked(c,a)})),D.cc(),D.cc(),D.dc(3,"td",36),D.cd(4),D.qc(5,"titlecase"),D.cc(),D.dc(6,"td",34),D.dc(7,"mat-form-field",28),D.Yb(8,"input",37),D.Yb(9,"ngx-material-timepicker",null,38),D.ad(11,Vc,2,0,"mat-error",17),D.cc(),D.cc(),D.dc(12,"td",34),D.dc(13,"mat-form-field",28),D.Yb(14,"input",39),D.Yb(15,"ngx-material-timepicker",null,40),D.ad(17,Lc,2,0,"mat-error",17),D.cc(),D.cc(),D.dc(18,"td",34),D.dc(19,"mat-form-field",28),D.Yb(20,"input",41),D.Yb(21,"ngx-material-timepicker",null,42),D.ad(23,Bc,2,0,"mat-error",17),D.cc(),D.cc(),D.dc(24,"td",34),D.dc(25,"mat-form-field",28),D.Yb(26,"input",43),D.ad(27,qc,2,2,"mat-error",17),D.ad(28,Xc,1,2,"ng-template",null,44,D.bd),D.ad(30,$c,1,2,"ng-template",null,45,D.bd),D.ad(32,Jc,1,1,"ng-template",null,46,D.bd),D.cc(),D.cc(),D.cc()}if(2&t){const t=e.$implicit,c=e.index,a=D.Oc(10),r=D.Oc(16),n=D.Oc(22),i=D.pc();D.Gb(1),D.yc("formGroupName",c),D.Gb(1),D.yc("value",t.value.day),D.Gb(2),D.dd(D.rc(5,18,t.value.day)),D.Gb(2),D.yc("formGroupName",c),D.Gb(2),D.yc("ngxTimepicker",a)("format",i.timeFormat),D.Gb(3),D.yc("ngIf",(null==t.controls.checkInTime?null:null==t.controls.checkInTime.errors?null:t.controls.checkInTime.errors.required)&&t.controls.checkInTime.touched),D.Gb(1),D.yc("formGroupName",c),D.Gb(2),D.yc("min",t.controls.checkInTime.value)("ngxTimepicker",r)("format",i.timeFormat),D.Gb(3),D.yc("ngIf",(null==t.controls.checkOutTime?null:null==t.controls.checkOutTime.errors?null:t.controls.checkOutTime.errors.required)&&t.controls.checkOutTime.touched),D.Gb(1),D.yc("formGroupName",c),D.Gb(2),D.yc("ngxTimepicker",n)("format",i.timeFormat),D.Gb(3),D.yc("ngIf",(null==t.controls.halfDayMarkTime?null:null==t.controls.halfDayMarkTime.errors?null:t.controls.halfDayMarkTime.errors.required)&&t.controls.halfDayMarkTime.touched),D.Gb(1),D.yc("formGroupName",c),D.Gb(3),D.yc("ngIf",(null==t.controls?null:null==t.controls.lateMarkAfter?null:t.controls.lateMarkAfter.errors)&&((null==t.controls?null:null==t.controls.lateMarkAfter?null:t.controls.lateMarkAfter.dirty)||(null==t.controls?null:null==t.controls.lateMarkAfter?null:t.controls.lateMarkAfter.touched)))}}let Qc=(()=>{class t{constructor(t,e,c,a,r,n,i){this.dialog=t,this.fb=e,this.toaster=c,this.loader=a,this.router=r,this.modalService=n,this.config=i,this.staticDays=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],this.days=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],this.timeFormat=Number(this.config.timeFormat)}ngOnInit(){this.setForm(),this.getDepartments(),this.getPostions()}setForm(){this.createEmpSettingForm=this.fb.group({type:["",n.B.required],days:new n.d([])}),this.setFormArrayForDays()}get control(){return this.createEmpSettingForm.controls}manageEmployeeControl(){this.createEmpSettingForm.addControl("department",new n.g("",n.B.required)),this.createEmpSettingForm.addControl("position",new n.g("",n.B.required))}clearEmployeeControl(){this.createEmpSettingForm.removeControl("department"),this.createEmpSettingForm.removeControl("position")}setFormArrayForDays(){let t=this.createEmpSettingForm.get("days");this.staticDays.map((e,c)=>{t.push(this.getGroup(e,c))})}getGroup(t,e){return this.fb.group({id:new n.g(e+1),day:new n.g(t),isWorkingDay:new n.g(!1,[n.B.required]),checkInTime:new n.g({value:"",disabled:!0},[n.B.required]),checkOutTime:new n.g({value:"",disabled:!0},[n.B.required]),halfDayMarkTime:new n.g({value:"",disabled:!0},[n.B.required]),lateMarkAfter:new n.g({value:"",disabled:!0},[n.B.required,n.B.pattern(/^[0-9]{1,2}$/),n.B.max(60),n.B.maxLength(2)])})}isdayClicked(t,e){let c=this.createEmpSettingForm.get("days").controls[e];t.checked?(c.get("checkInTime").setValue(""),c.get("checkInTime").enable(),c.get("checkInTime").setValidators(n.B.required),c.get("checkInTime").updateValueAndValidity(),c.get("checkOutTime").setValue(""),c.get("checkOutTime").enable(),c.get("checkOutTime").setValidators(n.B.required),c.get("checkOutTime").updateValueAndValidity(),c.get("halfDayMarkTime").setValue(""),c.get("halfDayMarkTime").enable(),c.get("halfDayMarkTime").setValidators(n.B.required),c.get("halfDayMarkTime").updateValueAndValidity(),c.get("lateMarkAfter").setValue(""),c.get("lateMarkAfter").enable(),c.get("lateMarkAfter").setValidators([n.B.required,n.B.pattern(/^[0-9]{1,2}$/),n.B.max(60),n.B.maxLength(2)]),c.get("lateMarkAfter").updateValueAndValidity()):(c.get("checkInTime").setValue(""),c.get("checkInTime").disable(),c.get("checkInTime").clearValidators(),c.get("checkInTime").updateValueAndValidity(),c.get("checkOutTime").setValue(""),c.get("checkOutTime").disable(),c.get("checkOutTime").clearValidators(),c.get("checkOutTime").updateValueAndValidity(),c.get("halfDayMarkTime").setValue(""),c.get("halfDayMarkTime").disable(),c.get("halfDayMarkTime").clearValidators(),c.get("halfDayMarkTime").updateValueAndValidity(),c.get("lateMarkAfter").setValue(""),c.get("lateMarkAfter").disable(),c.get("lateMarkAfter").clearValidators(),c.get("lateMarkAfter").updateValueAndValidity())}getDepartments(){this.modalService.getDepartmentList(0).subscribe(t=>{if("success"==t.keyword){let e=t.departments.filter(t=>"all"!==t.departmentId);this.departments=e}else this.departments=[]})}getPostions(){this.modalService.getPositionList(0).subscribe(t=>{if("success"==t.keyword){let e=t.positions.filter(t=>"all"!==t.positionId);this.positions=e}else this.positions=[]})}openDialog(){this.dialog.open(it,{width:"40%",data:{departmentArr:this.createEmpSettingForm.get("department").value,positionArr:this.createEmpSettingForm.get("position").value}}).afterClosed().subscribe(t=>{console.log("The dialog was closed")})}setArrayVar(t){let e=[];for(let c of t){let t=this.changeStructureObj(c);e.push(t)}return e}changeStructureObj(t){return{day_id:t.id,is_working_day:t.isWorkingDay?"1":"0",check_in:t.checkInTime?t.checkInTime:"00:00",check_out:t.checkOutTime?t.checkOutTime:"00:00",half_day:t.halfDayMarkTime?t.halfDayMarkTime:"00:00",late_mark:M.utc().startOf("day").add(t.lateMarkAfter,"minutes").format("HH:mm")}}submit(){var t,e,c,a;if(this.createEmpSettingForm.value.days.filter(t=>1==t.isWorkingDay).length>0)if(this.createEmpSettingForm.valid){this.loader.open();var r=this.createEmpSettingForm.value;let n=new FormData;n.append("attendance_data",JSON.stringify(this.setArrayVar(r.days))),"2"==r.type?(n.append("department_id",null!=(e=(null===(t=r)||void 0===t?void 0:t.department).toString())?e:""),n.append("position_id",null!=(a=(null===(c=r)||void 0===c?void 0:c.position).toString())?a:"")):(n.append("department_id","all"),n.append("position_id","all")),this.modalService.createEmpAttendanceRoutine(n).subscribe(t=>{"success"==t.keyword?(this.empResponse=t.empList[0],this.deviceEmployee(r),this.toaster.present(t.message,"")):"failed"==t.keyword&&(this.loader.close(),this.toaster.present(t.message,""))})}else lt.a.fire({title:"Check Required",text:"Fill Mandatory Fields",icon:"warning"});else lt.a.fire({title:"Check Required",text:"Please Fill One Working Day Fields",icon:"warning"})}deviceEmployee(t){var e,c;const a=Object(H.b)();let r=Object(j.get)(a,"customer_id"),n=Object(j.get)(a,"branch_id"),i=(null===(e=t)||void 0===e?void 0:e.department)?t.department.map(t=>String(t)):[],o=(null===(c=t)||void 0===c?void 0:c.position)?t.position.map(t=>String(t)):[],l={schoolOpenDays:this.setVar(t.days),customerId:String(r),schoolId:String(n),departmentIds:["all"],positionIds:["all"]};"2"==t.type&&(l.departmentIds=i,l.positionIds=o),this.modalService.createEmpAttendanceTracking(l).subscribe(t=>{"Success"==t.keyword?this.deviceInsert():"Failed"==t.keyword&&(this.loader.close(),this.router.navigate(["school/new-attendance-settings/employee/list"]))})}deviceInsert(){let t=new FormData;t.append("id",this.empResponse.empAttendanceGroupId),t.append("type","emp_attendance_routine"),this.modalService.deviceStatus(t).subscribe(t=>{this.loader.close(),this.router.navigate(["school/new-attendance-settings/employee/list"])})}setVar(t){let e=[];for(let c of t){let t=this.changeStructureObjForTracking(c);e.push(t)}return e}changeStructureObjForTracking(t){var e,c,a,r,n;return{day:this.days[t.id-1],isWorkingDay:String(t.isWorkingDay),checkIn:(null===(e=t)||void 0===e?void 0:e.checkInTime)?M(t.checkInTime,"HH:mm").format("HH:mm:ss"):"00:00:00",checkOut:(null===(c=t)||void 0===c?void 0:c.checkOutTime)?M(t.checkOutTime,"HH:mm").format("HH:mm:ss"):"00:00:00",halfDayMarkTime:(null===(a=t)||void 0===a?void 0:a.halfDayMarkTime)?M(t.halfDayMarkTime,"HH:mm").format("HH:mm:ss"):"00:00:00",lateMarkMin:(null===(r=t)||void 0===r?void 0:r.lateMarkAfter)?null===(n=t)||void 0===n?void 0:n.lateMarkAfter:"00"}}}return t.\u0275fac=function(e){return new(e||t)(D.Xb(u.b),D.Xb(n.f),D.Xb(g.a),D.Xb(f.a),D.Xb(a.g),D.Xb(z),D.Xb(V.a))},t.\u0275cmp=D.Rb({type:t,selectors:[["app-create"]],viewQuery:function(t,e){var c;1&t&&(D.md(Ec,!0),D.md(Pc,!0)),2&t&&(D.Nc(c=D.mc())&&(e.allDepartmentSelected=c.first),D.Nc(c=D.mc())&&(e.allPositionSelected=c.first))},decls:49,vars:5,consts:[[1,"create_btn"],["mat-raised-button","","color","primary",1,"btn-primary-bg",3,"disabled","click"],["href","#",1,"pl-12","primary-txt-color",3,"routerLink"],[1,"form_bg"],[1,"p-0"],[1,""],[1,"card-title-text"],[3,"formGroup"],["fxLayout","row wrap",1,"mt-0"],["fxFlex","100","fxFlex.gt-xs","50",1,"mt-12"],["fxLayout","row wrap",1,"mb-24"],["fxFlex","100","fxFlex.gt-xs","9",1,""],[1,"red_color"],["fxFlex","100","fxFlex.gt-xs","35",1,""],["formControlName","type","aria-label","Select an option","name","type"],["value","1",3,"click"],["value","2",1,"ml-12",3,"click"],[4,"ngIf"],["border","1","cellspacing","0",1,"mat-table","mt-12","emp_setting"],[1,"mat-header-row"],["rowspan","2",1,"mat-header-cell","text-center","pt-3",2,"width","10%"],["colspan","2",1,"mat-header-cell","text-center","pt-3",2,"width","10%"],["rowspan","2",1,"mat-header-cell","text-center",2,"width","10%"],[1,"mat-header-cell","text-center","pt-3",2,"width","10%"],["formArrayName","days"],["class","mat-row",4,"ngFor","ngForOf"],["fxFlex","100","fxFlex.gt-xs","30",1,"mt-12"],["fxFlex","100","fxFlex.gt-xs","70",1,"mt-12"],["appearance","fill"],["multiple","","formControlName","department"],[3,"value",4,"ngFor","ngForOf"],["multiple","","formControlName","position"],[3,"value"],[1,"mat-row"],[1,"mat-cell","text-center",3,"formGroupName"],["formControlName","isWorkingDay",3,"value","change"],[1,"mat-cell","text-center"],["type","text","matInput","","formControlName","checkInTime","readonly","","value","",3,"ngxTimepicker","format"],["timePickerMonFrom",""],["type","text","matInput","","formControlName","checkOutTime","readonly","","value","",3,"min","ngxTimepicker","format"],["timePickerMonto",""],["type","text","matInput","","formControlName","halfDayMarkTime","readonly","","value","",3,"ngxTimepicker","format"],["timePickerMonhalfday",""],["matInput","","formControlName","lateMarkAfter"],["patternError",""],["maxLengthError",""],["maxError",""],[4,"ngIf","ngIfElse"]],template:function(t,e){1&t&&(D.dc(0,"div",0),D.dc(1,"button",1),D.lc("click",(function(t){return e.submit()})),D.cd(2,"Save"),D.cc(),D.dc(3,"a",2),D.cd(4,"Discard"),D.cc(),D.cc(),D.dc(5,"div",3),D.dc(6,"mat-card",4),D.dc(7,"mat-card-title",5),D.dc(8,"div",6),D.cd(9,"Employee Attendance Settings"),D.cc(),D.Yb(10,"mat-divider"),D.cc(),D.dc(11,"mat-card-content"),D.dc(12,"form",7),D.dc(13,"div",8),D.dc(14,"div",9),D.dc(15,"div",10),D.dc(16,"div",11),D.dc(17,"label"),D.dc(18,"strong"),D.cd(19,"Type"),D.cc(),D.dc(20,"span",12),D.cd(21,"*"),D.cc(),D.cc(),D.cc(),D.dc(22,"div",13),D.dc(23,"mat-radio-group",14),D.dc(24,"mat-radio-button",15),D.lc("click",(function(t){return e.clearEmployeeControl()})),D.cd(25,"All"),D.cc(),D.dc(26,"mat-radio-button",16),D.lc("click",(function(t){return e.manageEmployeeControl()})),D.cd(27,"Custom "),D.cc(),D.cc(),D.cc(),D.cc(),D.ad(28,jc,27,4,"div",17),D.cc(),D.cc(),D.dc(29,"table",18),D.dc(30,"thead"),D.dc(31,"tr",19),D.dc(32,"th",20),D.cd(33,"Is Working Day?"),D.cc(),D.dc(34,"th",20),D.cd(35,"Schools opens On"),D.cc(),D.dc(36,"th",21),D.cd(37,"Check"),D.cc(),D.dc(38,"th",22),D.cd(39,"Half Day Mark Time"),D.cc(),D.dc(40,"th",20),D.cd(41,"Late Mark After(Mins) "),D.cc(),D.cc(),D.dc(42,"tr",19),D.dc(43,"th",23),D.cd(44,"In"),D.cc(),D.dc(45,"th",23),D.cd(46,"Out"),D.cc(),D.cc(),D.cc(),D.dc(47,"tbody",24),D.ad(48,Kc,34,20,"tr",25),D.cc(),D.cc(),D.cc(),D.cc(),D.cc(),D.cc()),2&t&&(D.Gb(1),D.yc("disabled",!e.createEmpSettingForm.valid),D.Gb(2),D.yc("routerLink","/school/new-attendance-settings/employee/list"),D.Gb(9),D.yc("formGroup",e.createEmpSettingForm),D.Gb(16),D.yc("ngIf",2==e.control.type.value),D.Gb(20),D.yc("ngForOf",e.createEmpSettingForm.get("days").controls))},directives:[W.a,a.j,L.a,L.f,B.a,L.c,n.D,n.u,n.k,N.c,N.a,It.b,n.t,n.i,It.a,r.o,n.e,r.n,q.b,q.e,Mt.a,p.p,q.a,n.l,Ot.a,R.b,n.c,d.d,d.a],pipes:[r.y],styles:[".mat-form-field[_ngcontent-%COMP%]{width:100%}table[_ngcontent-%COMP%] .mat-form-field[_ngcontent-%COMP%]{width:80%}.batch-name[_ngcontent-%COMP%]{font-size:24px}mat-checkbox[_ngcontent-%COMP%]{margin-right:24px}.text-center[_ngcontent-%COMP%]{text-align:center!important}th[_ngcontent-%COMP%]{background:hsla(0,0%,50.2%,.30196078431372547)}table[_ngcontent-%COMP%]{width:100%;line-height:10px;border-color:hsla(0,0%,50.2%,.30196078431372547)}table[_ngcontent-%COMP%] .mat-form-field[_ngcontent-%COMP%]{width:60%;height:40px;text-align:center!important}.ml-0[_ngcontent-%COMP%]{margin-left:0!important}.delete-icon[_ngcontent-%COMP%]{border:1px solid red;border-radius:50%;background:red}.delete-icon[_ngcontent-%COMP%], .edit-icon[_ngcontent-%COMP%]{font-size:13px;line-height:20px;width:20px!important;height:20px!important;color:#fff;text-align:center}.edit-icon[_ngcontent-%COMP%]{border:1px solid #00f;border-radius:50%;background:#00f}.btn-dis[_ngcontent-%COMP%]:disabled, .btn-dis[disabled][_ngcontent-%COMP%]{border:1px solid #999!important;background-color:#ccc!important;color:#666!important}.mat-table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{color:#000}.emp_setting[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr.mat-row[_ngcontent-%COMP%]{height:65px!important}"]}),t})();function Zc(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide date "),D.cc())}function ta(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide the check in time "),D.cc())}function ea(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide the check out time "),D.cc())}function ca(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide the half day mark time "),D.cc())}function aa(t,e){1&t&&(D.dc(0,"span"),D.cd(1," Please provide the late mark after time "),D.cc())}function ra(t,e){if(1&t&&(D.dc(0,"mat-error"),D.ad(1,aa,2,0,"span",28),D.cc()),2&t){const t=D.pc(),e=D.Oc(74);D.Gb(1),D.yc("ngIf",null==t.control?null:null==t.control.lateMarkAfter?null:t.control.lateMarkAfter.errors.required)("ngIfElse",e)}}function na(t,e){1&t&&(D.dc(0,"mat-error"),D.dc(1,"span"),D.cd(2," Please provide the valid late mark after time "),D.cc(),D.cc())}function ia(t,e){if(1&t&&D.ad(0,na,3,0,"mat-error",28),2&t){const t=D.pc(),e=D.Oc(76);D.yc("ngIf",null==t.control?null:null==t.control.lateMarkAfter?null:t.control.lateMarkAfter.errors.pattern)("ngIfElse",e)}}function oa(t,e){1&t&&(D.dc(0,"mat-error"),D.dc(1,"span"),D.cd(2," Please provide the minute within 2 digit "),D.cc(),D.cc())}function la(t,e){if(1&t&&D.ad(0,oa,3,0,"mat-error",28),2&t){const t=D.pc(),e=D.Oc(78);D.yc("ngIf",null==t.control?null:null==t.control.lateMarkAfter?null:t.control.lateMarkAfter.errors.maxLength)("ngIfElse",e)}}function sa(t,e){1&t&&(D.dc(0,"mat-error"),D.dc(1,"span"),D.cd(2," Please provide the minute within 60 minutes "),D.cc(),D.cc())}function da(t,e){if(1&t&&D.ad(0,sa,3,0,"mat-error",13),2&t){const t=D.pc();D.yc("ngIf",null==t.control?null:null==t.control.lateMarkAfter?null:t.control.lateMarkAfter.errors.max)}}let ua=(()=>{class t{constructor(t,e,c,a,r,n,i,o){this.dialogRef=t,this.data=e,this.appServerDatePipe=c,this.toaster=a,this.loader=r,this.modelService=n,this.fb=i,this.config=o,this.timeFormat=Number(this.config.timeFormat),this.setForm()}setForm(){this.customizeForm=this.fb.group({date:["",n.B.required],checkIn:["",n.B.required],checkOut:["",n.B.required],halfDayMarkTime:["",n.B.required],lateMarkAfter:new n.g("",[n.B.required,n.B.pattern(/^[0-9]{1,2}$/),n.B.max(60),n.B.maxLength(2)])})}get control(){return this.customizeForm.controls}ngOnInit(){this.class=this.data.classesArr,this.batch=this.data.batchYear.toString(),this.academicId=this.data.academicYear.toString(),this.routineData=this.data.routineArray,this.groupId=this.data.groupId}submit(){var t,e,c,a,r,n,i,o,l,s,d,u;if(this.customizeForm.valid){var m=this.customizeForm.value;let p=this.appServerDatePipe.transform(null===(t=m)||void 0===t?void 0:t.date),h=M.utc().startOf("day").add(null===(e=m)||void 0===e?void 0:e.lateMarkAfter,"minutes").format("HH:mm"),g=new FormData;g.append("stud_attendance_group_id",null!=(c=this.groupId)?c:""),g.append("academic_year_id",null!=(a=this.academicId)?a:""),g.append("batch_id",null!=(r=this.batch)?r:""),g.append("class_id",null!=(n=this.class.toString())?n:""),g.append("customize_date",null!=p?p:""),g.append("check_in",null!=(o=null===(i=m)||void 0===i?void 0:i.checkIn)?o:""),g.append("check_out",null!=(s=null===(l=m)||void 0===l?void 0:l.checkOut)?s:""),g.append("half_day_mark",null!=(u=null===(d=m)||void 0===d?void 0:d.halfDayMarkTime)?u:""),g.append("late_mark",null!=h?h:""),g.append("attendance_data",JSON.stringify(this.routineData)),this.loader.open(),this.modelService.createStudentAttendanceCustom(g).subscribe(t=>{"success"==t.keyword?(this.empResponse=t.customizeList[0],this.createCustomizeTracking(m),this.loader.close(),this.close(!0),this.toaster.present(t.message,"")):"failed"==t.keyword&&(this.loader.close(),this.toaster.present(t.message,""))})}}createCustomizeTracking(t){var e,c,a,r,n,i,o,l,s,d;const u=Object(H.b)();let m=Object(j.get)(u,"customer_id"),p=Object(j.get)(u,"branch_id"),h=(null===(e=t)||void 0===e?void 0:e.date)?this.appServerDatePipe.transform(null===(c=t)||void 0===c?void 0:c.date):M().format("YYYY-MM-DD"),g=(null===(a=t)||void 0===a?void 0:a.checkIn)?M(t.checkIn,"HH:mm").format("HH:mm:ss"):"00:00:00",f=(null===(r=t)||void 0===r?void 0:r.checkOut)?M(t.checkOut,"HH:mm").format("HH:mm:ss"):"00:00:00",b=(null===(n=t)||void 0===n?void 0:n.halfDayMarkTime)?M(t.halfDayMarkTime,"HH:mm").format("HH:mm:ss"):"00:00:00",y=this.class?this.class.map(t=>String(t)):[],k=new FormData;k.append("customerId",m),k.append("schoolId",p),k.append("academicYearId",null!=(i=this.academicId)?i:""),k.append("batchId",null!=(o=this.batch)?o:""),k.append("classIds",null!=(l=String(y))?l:""),k.append("thisDate",null!=h?h:""),k.append("checkIn",null!=g?g:""),k.append("checkOut",null!=f?f:""),k.append("halfDayMarkTime",null!=b?b:""),k.append("lateMarkMin",null!=(d=String(null===(s=t)||void 0===s?void 0:s.lateMarkAfter))?d:""),k.append("isWorkingDay","true"),this.modelService.createStudentAttendanceDateTracking(k).subscribe(t=>{let e=t;"Success"==e.keyword?(this.deviceInsert(),console.log("Tracking created",e)):console.log("Tracking created",e)})}deviceInsert(){let t=new FormData;t.append("id",this.groupId),t.append("type","stud_attendance_date"),this.modelService.deviceStatus(t).subscribe(t=>{console.log("Tracking created",t)})}close(t){this.dialogRef.close(t)}}return t.\u0275fac=function(e){return new(e||t)(D.Xb(u.f),D.Xb(u.a),D.Xb(m.d),D.Xb(g.a),D.Xb(f.a),D.Xb(cc),D.Xb(n.f),D.Xb(V.a))},t.\u0275cmp=D.Rb({type:t,selectors:[["app-edit"]],features:[D.Fb([{provide:p.c,useClass:h.b},{provide:p.f,useValue:h.a},m.d])],decls:83,vars:16,consts:[[1,"form_bg"],[1,"p-0"],[1,""],[1,"card-title-text"],["autocomplete","off",3,"formGroup"],["fxLayout","row wrap",1,"mt-0"],["fxFlex","100","fxFlex.gt-xs","30",1,"pt-12"],[1,"red_color"],["fxFlex","100","fxFlex.gt-xs","70",1,""],["appearance","fill"],["matInput","","formControlName","date",3,"matDatepicker","click"],["matSuffix","",3,"for"],["picker",""],[4,"ngIf"],["fxFlex","100","fxFlex.gt-xs","30",1,""],["appearance","fill",1,""],["type","text","matInput","","formControlName","checkIn","readonly","","value","",3,"ngxTimepicker","format"],["timePickerFrom",""],["type","text","matInput","","formControlName","checkOut","readonly","","value","",3,"min","ngxTimepicker","format"],["timePickerTo",""],["type","text","matInput","","formControlName","halfDayMarkTime","readonly","","value","",3,"ngxTimepicker","format"],["timePickerHalfDay",""],["matInput","","formControlName","lateMarkAfter"],["patternError",""],["maxLengthError",""],["maxError",""],["mat-raised-button","","color","primary",1,"btn-primary-bg","ml-0",3,"disabled","click"],[1,"pl-8","primary-txt-color",3,"click"],[4,"ngIf","ngIfElse"]],template:function(t,e){if(1&t){const t=D.ec();D.dc(0,"div",0),D.dc(1,"mat-card",1),D.dc(2,"mat-card-title",2),D.dc(3,"div",3),D.cd(4,"Create Customize Date"),D.cc(),D.Yb(5,"mat-divider"),D.cc(),D.dc(6,"mat-card-content"),D.dc(7,"form",4),D.dc(8,"div",5),D.dc(9,"div",6),D.dc(10,"label"),D.dc(11,"strong"),D.cd(12,"Date"),D.cc(),D.dc(13,"span",7),D.cd(14,"*"),D.cc(),D.cc(),D.cc(),D.dc(15,"div",8),D.dc(16,"mat-form-field",9),D.Yb(17,"mat-label"),D.dc(18,"input",10),D.lc("click",(function(e){return D.Sc(t),D.Oc(21).open()})),D.cc(),D.Yb(19,"mat-datepicker-toggle",11),D.Yb(20,"mat-datepicker",null,12),D.ad(22,Zc,2,0,"mat-error",13),D.cc(),D.cc(),D.cc(),D.dc(23,"div",5),D.dc(24,"div",14),D.dc(25,"label"),D.dc(26,"strong"),D.cd(27," Check In"),D.cc(),D.dc(28,"span",7),D.cd(29,"*"),D.cc(),D.cc(),D.cc(),D.dc(30,"div",8),D.dc(31,"mat-form-field",15),D.Yb(32,"input",16),D.Yb(33,"ngx-material-timepicker",null,17),D.ad(35,ta,2,0,"mat-error",13),D.cc(),D.cc(),D.cc(),D.dc(36,"div",5),D.dc(37,"div",14),D.dc(38,"label"),D.dc(39,"strong"),D.cd(40," Check Out"),D.cc(),D.dc(41,"span",7),D.cd(42,"*"),D.cc(),D.cc(),D.cc(),D.dc(43,"div",8),D.dc(44,"mat-form-field",15),D.Yb(45,"input",18),D.Yb(46,"ngx-material-timepicker",null,19),D.ad(48,ea,2,0,"mat-error",13),D.cc(),D.cc(),D.cc(),D.dc(49,"div",5),D.dc(50,"div",14),D.dc(51,"label"),D.dc(52,"strong"),D.cd(53,"Half Day Mark Time"),D.cc(),D.dc(54,"span",7),D.cd(55,"*"),D.cc(),D.cc(),D.cc(),D.dc(56,"div",8),D.dc(57,"mat-form-field",15),D.Yb(58,"input",20),D.Yb(59,"ngx-material-timepicker",null,21),D.ad(61,ca,2,0,"mat-error",13),D.cc(),D.cc(),D.cc(),D.dc(62,"div",5),D.dc(63,"div",14),D.dc(64,"label"),D.dc(65,"strong"),D.cd(66,"Late Mark After(Mins)"),D.cc(),D.dc(67,"span",7),D.cd(68,"*"),D.cc(),D.cc(),D.cc(),D.dc(69,"div",8),D.dc(70,"mat-form-field",9),D.Yb(71,"input",22),D.ad(72,ra,2,2,"mat-error",13),D.ad(73,ia,1,2,"ng-template",null,23,D.bd),D.ad(75,la,1,2,"ng-template",null,24,D.bd),D.ad(77,da,1,1,"ng-template",null,25,D.bd),D.cc(),D.cc(),D.cc(),D.dc(79,"button",26),D.lc("click",(function(t){return e.submit()})),D.cd(80,"Submit"),D.cc(),D.dc(81,"a",27),D.lc("click",(function(t){return e.close(!1)})),D.cd(82,"Discard"),D.cc(),D.cc(),D.cc(),D.cc(),D.cc()}if(2&t){const t=D.Oc(21),c=D.Oc(34),a=D.Oc(47),r=D.Oc(60);D.Gb(7),D.yc("formGroup",e.customizeForm),D.Gb(11),D.yc("matDatepicker",t),D.Gb(1),D.yc("for",t),D.Gb(3),D.yc("ngIf",(null==e.control?null:null==e.control.date?null:null==e.control.date.errors?null:e.control.date.errors.required)&&(null==e.control?null:null==e.control.date?null:e.control.date.touched)),D.Gb(10),D.yc("ngxTimepicker",c)("format",e.timeFormat),D.Gb(3),D.yc("ngIf",(null==e.control?null:null==e.control.checkIn?null:null==e.control.checkIn.errors?null:e.control.checkIn.errors.required)&&(null==e.control?null:null==e.control.checkIn?null:e.control.checkIn.touched)),D.Gb(10),D.yc("min",null==e.control?null:null==e.control.checkIn?null:e.control.checkIn.value)("ngxTimepicker",a)("format",e.timeFormat),D.Gb(3),D.yc("ngIf",(null==e.control?null:null==e.control.checkOut?null:null==e.control.checkOut.errors?null:e.control.checkOut.errors.required)&&(null==e.control?null:null==e.control.checkOut?null:e.control.checkOut.touched)),D.Gb(10),D.yc("ngxTimepicker",r)("format",e.timeFormat),D.Gb(3),D.yc("ngIf",(null==e.control?null:null==e.control.halfDayMarkTime?null:null==e.control.halfDayMarkTime.errors?null:e.control.halfDayMarkTime.errors.required)&&(null==e.control?null:null==e.control.halfDayMarkTime?null:e.control.halfDayMarkTime.touched)),D.Gb(11),D.yc("ngIf",(null==e.control?null:null==e.control.lateMarkAfter?null:e.control.lateMarkAfter.errors)&&((null==e.control?null:null==e.control.lateMarkAfter?null:e.control.lateMarkAfter.dirty)||(null==e.control?null:null==e.control.lateMarkAfter?null:e.control.lateMarkAfter.touched))),D.Gb(7),D.yc("disabled",!e.customizeForm.valid)}},directives:[L.a,L.f,B.a,L.c,n.D,n.u,n.k,N.c,N.a,q.b,q.e,R.b,n.c,X.b,n.t,n.i,X.d,q.f,X.a,r.o,d.d,d.a,W.a,q.a],styles:[".mat-form-field[_ngcontent-%COMP%]{width:80%}.batch-name[_ngcontent-%COMP%]{font-size:24px}mat-checkbox[_ngcontent-%COMP%]{margin-right:23px}.text-center[_ngcontent-%COMP%]{text-align:center!important}th[_ngcontent-%COMP%]{border-bottom:1px solid grey}.ml-0[_ngcontent-%COMP%]{margin-left:0!important}.btn-dis[_ngcontent-%COMP%]:disabled, .btn-dis[disabled][_ngcontent-%COMP%]{border:1px solid #999!important;background-color:#ccc!important;color:#666!important}"]}),t})();var ma=c("DGYh"),pa=c("t/Tn"),ha=c("k9Bo");const ga=["allDepartmentSelected"],fa=["allPositionSelected"];function ba(t,e){if(1&t){const t=D.ec();D.dc(0,"mat-option",33),D.lc("click",(function(c){D.Sc(t);const a=e.$implicit;return D.pc().getBatch(a.academicYearId)})),D.cd(1),D.cc()}if(2&t){const t=e.$implicit;D.yc("value",t.academicYearId),D.Gb(1),D.ed(" ",t.academicYear," ")}}function ya(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide one academic year "),D.cc())}function ka(t,e){if(1&t){const t=D.ec();D.dc(0,"mat-option",33),D.lc("click",(function(c){D.Sc(t);const a=e.$implicit;return D.pc().getClass(a.batchId)})),D.cd(1),D.cc()}if(2&t){const t=e.$implicit;D.yc("value",t.batchId),D.Gb(1),D.ed(" ",t.batchName," ")}}function va(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide the batch "),D.cc())}function Sa(t,e){if(1&t&&(D.dc(0,"mat-option",36),D.cd(1),D.cc()),2&t){const t=e.$implicit;D.yc("value",t.classId),D.Gb(1),D.ed(" ",t.className," ")}}function Da(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please select atleast one class "),D.cc())}function Ia(t,e){if(1&t&&(D.dc(0,"div",8),D.dc(1,"div",10),D.dc(2,"label"),D.dc(3,"strong"),D.cd(4,"Classes"),D.cc(),D.dc(5,"span",11),D.cd(6,"*"),D.cc(),D.cc(),D.cc(),D.dc(7,"div",12),D.dc(8,"mat-form-field",13),D.Yb(9,"mat-label"),D.dc(10,"mat-select",34),D.ad(11,Sa,2,2,"mat-option",35),D.cc(),D.ad(12,Da,2,0,"mat-error",16),D.cc(),D.cc(),D.cc()),2&t){const t=D.pc();D.Gb(11),D.yc("ngForOf",t.classes),D.Gb(1),D.yc("ngIf",null==t.control?null:null==t.control.class?null:null==t.control.class.errors?null:t.control.class.errors.required)}}function Ma(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide the check in time "),D.cc())}function Oa(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide the check out time "),D.cc())}function xa(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide the half day mark time "),D.cc())}function _a(t,e){1&t&&(D.dc(0,"span"),D.cd(1," Please provide the late mark after time "),D.cc())}function Ta(t,e){if(1&t&&(D.dc(0,"mat-error"),D.ad(1,_a,2,0,"span",51),D.cc()),2&t){const t=D.pc().$implicit,e=D.Oc(29);D.Gb(1),D.yc("ngIf",null==t.controls?null:null==t.controls.lateMarkAfter?null:t.controls.lateMarkAfter.errors.required)("ngIfElse",e)}}function Aa(t,e){1&t&&(D.dc(0,"mat-error"),D.dc(1,"span"),D.cd(2," Please provide the valid late mark after time "),D.cc(),D.cc())}function wa(t,e){if(1&t&&D.ad(0,Aa,3,0,"mat-error",51),2&t){const t=D.pc().$implicit,e=D.Oc(31);D.yc("ngIf",null==t.controls?null:null==t.controls.lateMarkAfter?null:t.controls.lateMarkAfter.errors.pattern)("ngIfElse",e)}}function Ca(t,e){1&t&&(D.dc(0,"mat-error"),D.dc(1,"span"),D.cd(2," Please provide the minute within 2 digit "),D.cc(),D.cc())}function Fa(t,e){if(1&t&&D.ad(0,Ca,3,0,"mat-error",51),2&t){const t=D.pc().$implicit,e=D.Oc(33);D.yc("ngIf",null==t.controls?null:null==t.controls.lateMarkAfter?null:t.controls.lateMarkAfter.errors.maxLength)("ngIfElse",e)}}function Ea(t,e){1&t&&(D.dc(0,"mat-error"),D.dc(1,"span"),D.cd(2," Please provide the minute within 60 minutes "),D.cc(),D.cc())}function Pa(t,e){if(1&t&&D.ad(0,Ea,3,0,"mat-error",16),2&t){const t=D.pc().$implicit;D.yc("ngIf",null==t.controls?null:null==t.controls.lateMarkAfter?null:t.controls.lateMarkAfter.errors.max)}}function Ga(t,e){if(1&t){const t=D.ec();D.dc(0,"tr",37),D.dc(1,"td",38),D.dc(2,"mat-checkbox",39),D.lc("change",(function(c){D.Sc(t);const a=e.index;return D.pc().isdayClicked(c,a)})),D.cc(),D.cc(),D.dc(3,"td",40),D.cd(4),D.qc(5,"titlecase"),D.cc(),D.dc(6,"td",38),D.dc(7,"mat-form-field",13),D.Yb(8,"input",41),D.Yb(9,"ngx-material-timepicker",null,42),D.ad(11,Ma,2,0,"mat-error",16),D.cc(),D.cc(),D.dc(12,"td",38),D.dc(13,"mat-form-field",13),D.Yb(14,"input",43),D.Yb(15,"ngx-material-timepicker",null,44),D.ad(17,Oa,2,0,"mat-error",16),D.cc(),D.cc(),D.dc(18,"td",38),D.dc(19,"mat-form-field",13),D.Yb(20,"input",45),D.Yb(21,"ngx-material-timepicker",null,46),D.ad(23,xa,2,0,"mat-error",16),D.cc(),D.cc(),D.dc(24,"td",38),D.dc(25,"mat-form-field",13),D.Yb(26,"input",47),D.ad(27,Ta,2,2,"mat-error",16),D.ad(28,wa,1,2,"ng-template",null,48,D.bd),D.ad(30,Fa,1,2,"ng-template",null,49,D.bd),D.ad(32,Pa,1,1,"ng-template",null,50,D.bd),D.cc(),D.cc(),D.cc()}if(2&t){const t=e.$implicit,c=e.index,a=D.Oc(10),r=D.Oc(16),n=D.Oc(22),i=D.pc();D.Gb(1),D.yc("formGroupName",c),D.Gb(1),D.yc("value",t.value.day),D.Gb(2),D.dd(D.rc(5,18,t.value.day)),D.Gb(2),D.yc("formGroupName",c),D.Gb(2),D.yc("ngxTimepicker",a)("format",i.timeFormat),D.Gb(3),D.yc("ngIf",(null==t.controls.checkInTime?null:null==t.controls.checkInTime.errors?null:t.controls.checkInTime.errors.required)&&t.controls.checkInTime.touched),D.Gb(1),D.yc("formGroupName",c),D.Gb(2),D.yc("min",t.controls.checkInTime.value)("ngxTimepicker",r)("format",i.timeFormat),D.Gb(3),D.yc("ngIf",(null==t.controls.checkOutTime?null:null==t.controls.checkOutTime.errors?null:t.controls.checkOutTime.errors.required)&&t.controls.checkOutTime.touched),D.Gb(1),D.yc("formGroupName",c),D.Gb(2),D.yc("ngxTimepicker",n)("format",i.timeFormat),D.Gb(3),D.yc("ngIf",(null==t.controls.halfDayMarkTime?null:null==t.controls.halfDayMarkTime.errors?null:t.controls.halfDayMarkTime.errors.required)&&t.controls.halfDayMarkTime.touched),D.Gb(1),D.yc("formGroupName",c),D.Gb(3),D.yc("ngIf",(null==t.controls?null:null==t.controls.lateMarkAfter?null:t.controls.lateMarkAfter.errors)&&((null==t.controls?null:null==t.controls.lateMarkAfter?null:t.controls.lateMarkAfter.dirty)||(null==t.controls?null:null==t.controls.lateMarkAfter?null:t.controls.lateMarkAfter.touched)))}}let Ya=(()=>{class t{constructor(t,e,c,a,r,n,i,o,l,s){this.dialog=t,this.fb=e,this.toaster=c,this.loader=a,this.router=r,this.academicYearService=n,this.batchService=i,this.classService=o,this.modalService=l,this.config=s,this.staticDays=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],this.days=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],this.timeFormat=Number(this.config.timeFormat)}ngOnInit(){this.setForm(),this.getAcademicYear()}getAcademicYear(){this.academicYearService.getList().subscribe(t=>{"success"==t.keyword?(this.academicYears=t.academicYears.filter(t=>"1"==t.status),this.batches=[],this.classes=[]):(this.academicYears=[],this.batches=[],this.classes=[])})}getBatch(t){this.createEmpSettingForm.get("batch").setValue(""),"2"==this.createEmpSettingForm.get("type").value&&this.createEmpSettingForm.get("class").setValue(""),this.batchService.getListByAcademic(t).subscribe(t=>{"success"==t.keyword?(this.batches=t.batches,this.classes=[]):(this.batches=[],this.classes=[],this.createEmpSettingForm.get("batch").setValue(""),"2"==this.createEmpSettingForm.get("type").value&&this.createEmpSettingForm.get("class").setValue(""))})}getClass(t){this.classService.getClassByBatch(t).subscribe(t=>{"success"==t.keyword?("2"==this.createEmpSettingForm.get("type").value&&this.createEmpSettingForm.get("class").setValue(""),this.classes=t.classes):(this.classes=[],"2"==this.createEmpSettingForm.get("type").value&&this.createEmpSettingForm.get("class").setValue(""))})}setForm(){this.createEmpSettingForm=this.fb.group({type:["",n.B.required],academicYear:["",n.B.required],batch:["",n.B.required],days:new n.d([])}),this.setFormArrayForDays()}get control(){return this.createEmpSettingForm.controls}manageEmployeeControl(){this.createEmpSettingForm.addControl("class",new n.g("",n.B.required))}clearEmployeeControl(){this.createEmpSettingForm.removeControl("class")}setFormArrayForDays(){let t=this.createEmpSettingForm.get("days");this.staticDays.map((e,c)=>{t.push(this.getGroup(e,c))})}getGroup(t,e){return this.fb.group({id:new n.g(e+1),day:new n.g(t),isWorkingDay:new n.g(!1,[n.B.required]),checkInTime:new n.g({value:"",disabled:!0},[n.B.required]),checkOutTime:new n.g({value:"",disabled:!0},[n.B.required]),halfDayMarkTime:new n.g({value:"",disabled:!0},[n.B.required]),lateMarkAfter:new n.g({value:"",disabled:!0},[n.B.required,n.B.pattern(/^[0-9]{1,2}$/),n.B.max(60),n.B.maxLength(2)])})}isdayClicked(t,e){let c=this.createEmpSettingForm.get("days").controls[e];t.checked?(c.get("checkInTime").setValue(""),c.get("checkInTime").enable(),c.get("checkInTime").setValidators(n.B.required),c.get("checkInTime").updateValueAndValidity(),c.get("checkOutTime").setValue(""),c.get("checkOutTime").enable(),c.get("checkOutTime").setValidators(n.B.required),c.get("checkOutTime").updateValueAndValidity(),c.get("halfDayMarkTime").setValue(""),c.get("halfDayMarkTime").enable(),c.get("halfDayMarkTime").setValidators(n.B.required),c.get("halfDayMarkTime").updateValueAndValidity(),c.get("lateMarkAfter").setValue(""),c.get("lateMarkAfter").enable(),c.get("lateMarkAfter").setValidators([n.B.required,n.B.pattern(/^[0-9]{1,2}$/),n.B.max(60),n.B.maxLength(2)]),c.get("lateMarkAfter").updateValueAndValidity()):(c.get("checkInTime").setValue(""),c.get("checkInTime").disable(),c.get("checkInTime").clearValidators(),c.get("checkInTime").updateValueAndValidity(),c.get("checkOutTime").setValue(""),c.get("checkOutTime").disable(),c.get("checkOutTime").clearValidators(),c.get("checkOutTime").updateValueAndValidity(),c.get("halfDayMarkTime").setValue(""),c.get("halfDayMarkTime").disable(),c.get("halfDayMarkTime").clearValidators(),c.get("halfDayMarkTime").updateValueAndValidity(),c.get("lateMarkAfter").setValue(""),c.get("lateMarkAfter").disable(),c.get("lateMarkAfter").clearValidators(),c.get("lateMarkAfter").updateValueAndValidity())}openDialog(){this.dialog.open(ua,{width:"40%",data:{departmentArr:this.createEmpSettingForm.get("department").value,positionArr:this.createEmpSettingForm.get("position").value}}).afterClosed().subscribe(t=>{console.log("The dialog was closed")})}setArrayVar(t){let e=[];for(let c of t){let t=this.changeStructureObj(c);e.push(t)}return e}changeStructureObj(t){return{day_id:t.id,is_working_day:t.isWorkingDay?"1":"0",check_in:t.checkInTime?t.checkInTime:"00:00",check_out:t.checkOutTime?t.checkOutTime:"00:00",half_day:t.halfDayMarkTime?t.halfDayMarkTime:"00:00",late_mark:M.utc().startOf("day").add(t.lateMarkAfter,"minutes").format("HH:mm")}}submit(){var t,e,c,a,r,n;if(this.createEmpSettingForm.value.days.filter(t=>1==t.isWorkingDay).length>0)if(this.createEmpSettingForm.valid){this.loader.open();var i=this.createEmpSettingForm.value;let o=new FormData;o.append("attendance_data",JSON.stringify(this.setArrayVar(i.days))),o.append("academic_year_id",null!=(e=(null===(t=i)||void 0===t?void 0:t.academicYear).toString())?e:""),o.append("batch_id",null!=(a=(null===(c=i)||void 0===c?void 0:c.batch).toString())?a:""),o.append("class_id","2"==i.type?null!=(n=(null===(r=i)||void 0===r?void 0:r.class).toString())?n:"":"all"),this.modalService.createStudentAttendanceRoutine(o).subscribe(t=>{"success"==t.keyword?(this.studResponse=t.attendList[0],this.deviceStudent(i),this.toaster.present(t.message,"")):"failed"==t.keyword&&(this.loader.close(),this.toaster.present(t.message,""))})}else lt.a.fire({title:"Check Required",text:"Fill Mandatory Fields",icon:"warning"});else lt.a.fire({title:"Check Required",text:"Please Fill One Working Day Fields",icon:"warning"})}deviceStudent(t){var e,c,a;const r=Object(H.b)();let n=Object(j.get)(r,"customer_id"),i=Object(j.get)(r,"branch_id"),o=(null===(e=t)||void 0===e?void 0:e.class)?t.class.map(t=>String(t)):[],l={schoolOpenDays:this.setVar(t.days),customerId:String(n),schoolId:String(i),academicYearId:(null===(c=t)||void 0===c?void 0:c.academicYear).toString(),batchId:(null===(a=t)||void 0===a?void 0:a.batch).toString(),classIds:["all"]};"2"==t.type&&(l.classIds=o),this.modalService.createStudentAttendanceTracking(l).subscribe(t=>{"Success"==t.keyword?this.deviceInsert():"Failed"==t.keyword&&(this.loader.close(),this.router.navigate(["school/new-attendance-settings/student/list"]))})}deviceInsert(){let t=new FormData;t.append("id",this.studResponse.studAttendanceGroupId),t.append("type","stud_attendance_routine"),this.modalService.deviceStatus(t).subscribe(t=>{this.loader.close(),this.router.navigate(["school/new-attendance-settings/student/list"])})}setVar(t){let e=[];for(let c of t){let t=this.changeStructureObjForTracking(c);e.push(t)}return e}changeStructureObjForTracking(t){var e,c,a,r,n;return{day:this.days[t.id-1],isWorkingDay:String(t.isWorkingDay),checkIn:(null===(e=t)||void 0===e?void 0:e.checkInTime)?M(t.checkInTime,"HH:mm").format("HH:mm:ss"):"00:00:00",checkOut:(null===(c=t)||void 0===c?void 0:c.checkOutTime)?M(t.checkOutTime,"HH:mm").format("HH:mm:ss"):"00:00:00",halfDayMarkTime:(null===(a=t)||void 0===a?void 0:a.halfDayMarkTime)?M(t.halfDayMarkTime,"HH:mm").format("HH:mm:ss"):"00:00:00",lateMarkMin:(null===(r=t)||void 0===r?void 0:r.lateMarkAfter)?null===(n=t)||void 0===n?void 0:n.lateMarkAfter:"00"}}}return t.\u0275fac=function(e){return new(e||t)(D.Xb(u.b),D.Xb(n.f),D.Xb(g.a),D.Xb(f.a),D.Xb(a.g),D.Xb(ma.a),D.Xb(pa.a),D.Xb(ha.a),D.Xb(cc),D.Xb(V.a))},t.\u0275cmp=D.Rb({type:t,selectors:[["app-create"]],viewQuery:function(t,e){var c;1&t&&(D.md(ga,!0),D.md(fa,!0)),2&t&&(D.Nc(c=D.mc())&&(e.allDepartmentSelected=c.first),D.Nc(c=D.mc())&&(e.allPositionSelected=c.first))},decls:75,vars:9,consts:[[1,"create_btn"],["mat-raised-button","","color","primary",1,"btn-primary-bg",3,"disabled","click"],["href","#",1,"pl-12","primary-txt-color",3,"routerLink"],[1,"form_bg"],[1,"p-0"],[1,""],[1,"card-title-text"],[3,"formGroup"],["fxLayout","row wrap",1,"mt-0"],["fxFlex","100","fxFlex.gt-xs","50",1,"mt-12"],["fxFlex","100","fxFlex.gt-xs","30",1,"mt-12"],[1,"red_color"],["fxFlex","100","fxFlex.gt-xs","70",1,"mt-12"],["appearance","fill"],["formControlName","academicYear"],[3,"value","click",4,"ngFor","ngForOf"],[4,"ngIf"],["formControlName","batch"],["fxLayout","row wrap",1,"mb-24"],["fxFlex","100","fxFlex.gt-xs","9",1,""],["fxFlex","100","fxFlex.gt-xs","35",1,""],["formControlName","type","aria-label","Select an option","name","type"],["value","1",3,"click"],["value","2",1,"ml-12",3,"click"],["fxLayout","row wrap","class","mt-0",4,"ngIf"],["border","1","cellspacing","0",1,"mat-table","mt-12","emp_setting"],[1,"mat-header-row"],["rowspan","2",1,"mat-header-cell","text-center","pt-3",2,"width","10%"],["colspan","2",1,"mat-header-cell","text-center","pt-3",2,"width","10%"],["rowspan","2",1,"mat-header-cell","text-center",2,"width","10%"],[1,"mat-header-cell","text-center","pt-3",2,"width","10%"],["formArrayName","days"],["class","mat-row",4,"ngFor","ngForOf"],[3,"value","click"],["formControlName","class","multiple",""],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[1,"mat-row"],[1,"mat-cell","text-center",3,"formGroupName"],["formControlName","isWorkingDay",3,"value","change"],[1,"mat-cell","text-center"],["type","text","matInput","","formControlName","checkInTime","readonly","","value","",3,"ngxTimepicker","format"],["timePickerMonFrom",""],["type","text","matInput","","formControlName","checkOutTime","readonly","","value","",3,"min","ngxTimepicker","format"],["timePickerMonto",""],["type","text","matInput","","formControlName","halfDayMarkTime","readonly","","value","",3,"ngxTimepicker","format"],["timePickerMonhalfday",""],["matInput","","formControlName","lateMarkAfter"],["patternError",""],["maxLengthError",""],["maxError",""],[4,"ngIf","ngIfElse"]],template:function(t,e){1&t&&(D.dc(0,"div",0),D.dc(1,"button",1),D.lc("click",(function(t){return e.submit()})),D.cd(2,"Save"),D.cc(),D.dc(3,"a",2),D.cd(4,"Discard"),D.cc(),D.cc(),D.dc(5,"div",3),D.dc(6,"mat-card",4),D.dc(7,"mat-card-title",5),D.dc(8,"div",6),D.cd(9,"Student Attendance Settings"),D.cc(),D.Yb(10,"mat-divider"),D.cc(),D.dc(11,"mat-card-content"),D.dc(12,"form",7),D.dc(13,"div",8),D.dc(14,"div",9),D.dc(15,"div",8),D.dc(16,"div",10),D.dc(17,"label"),D.dc(18,"strong"),D.cd(19,"Academic Year"),D.cc(),D.dc(20,"span",11),D.cd(21,"*"),D.cc(),D.cc(),D.cc(),D.dc(22,"div",12),D.dc(23,"mat-form-field",13),D.Yb(24,"mat-label"),D.dc(25,"mat-select",14),D.ad(26,ba,2,2,"mat-option",15),D.cc(),D.ad(27,ya,2,0,"mat-error",16),D.cc(),D.cc(),D.cc(),D.dc(28,"div",8),D.dc(29,"div",10),D.dc(30,"label"),D.dc(31,"strong"),D.cd(32,"Batch"),D.cc(),D.dc(33,"span",11),D.cd(34,"*"),D.cc(),D.cc(),D.cc(),D.dc(35,"div",12),D.dc(36,"mat-form-field",13),D.Yb(37,"mat-label"),D.dc(38,"mat-select",17),D.ad(39,ka,2,2,"mat-option",15),D.cc(),D.ad(40,va,2,0,"mat-error",16),D.cc(),D.cc(),D.cc(),D.dc(41,"div",18),D.dc(42,"div",19),D.dc(43,"label"),D.dc(44,"strong"),D.cd(45,"Type"),D.cc(),D.dc(46,"span",11),D.cd(47,"*"),D.cc(),D.cc(),D.cc(),D.dc(48,"div",20),D.dc(49,"mat-radio-group",21),D.dc(50,"mat-radio-button",22),D.lc("click",(function(t){return e.clearEmployeeControl()})),D.cd(51,"All"),D.cc(),D.dc(52,"mat-radio-button",23),D.lc("click",(function(t){return e.manageEmployeeControl()})),D.cd(53,"Custom "),D.cc(),D.cc(),D.cc(),D.cc(),D.ad(54,Ia,13,2,"div",24),D.cc(),D.cc(),D.dc(55,"table",25),D.dc(56,"thead"),D.dc(57,"tr",26),D.dc(58,"th",27),D.cd(59,"Is Working Day?"),D.cc(),D.dc(60,"th",27),D.cd(61,"Schools opens On"),D.cc(),D.dc(62,"th",28),D.cd(63,"Check"),D.cc(),D.dc(64,"th",29),D.cd(65,"Half Day Mark Time"),D.cc(),D.dc(66,"th",27),D.cd(67,"Late Mark After(Mins) "),D.cc(),D.cc(),D.dc(68,"tr",26),D.dc(69,"th",30),D.cd(70,"In"),D.cc(),D.dc(71,"th",30),D.cd(72,"Out"),D.cc(),D.cc(),D.cc(),D.dc(73,"tbody",31),D.ad(74,Ga,34,20,"tr",32),D.cc(),D.cc(),D.cc(),D.cc(),D.cc(),D.cc()),2&t&&(D.Gb(1),D.yc("disabled",!e.createEmpSettingForm.valid),D.Gb(2),D.yc("routerLink","/school/new-attendance-settings/student/list"),D.Gb(9),D.yc("formGroup",e.createEmpSettingForm),D.Gb(14),D.yc("ngForOf",e.academicYears),D.Gb(1),D.yc("ngIf",null==e.control?null:null==e.control.academicYear?null:null==e.control.academicYear.errors?null:e.control.academicYear.errors.required),D.Gb(12),D.yc("ngForOf",e.batches),D.Gb(1),D.yc("ngIf",null==e.control?null:null==e.control.batch?null:null==e.control.batch.errors?null:e.control.batch.errors.required),D.Gb(14),D.yc("ngIf",2==e.control.type.value),D.Gb(20),D.yc("ngForOf",e.createEmpSettingForm.get("days").controls))},directives:[W.a,a.j,L.a,L.f,B.a,L.c,n.D,n.u,n.k,N.c,N.a,q.b,q.e,Mt.a,n.t,n.i,r.n,r.o,It.b,It.a,n.e,p.p,q.a,n.l,Ot.a,R.b,n.c,d.d,d.a],pipes:[r.y],styles:[".mat-form-field[_ngcontent-%COMP%]{width:100%}table[_ngcontent-%COMP%] .mat-form-field[_ngcontent-%COMP%]{width:80%}.batch-name[_ngcontent-%COMP%]{font-size:24px}mat-checkbox[_ngcontent-%COMP%]{margin-right:24px}.text-center[_ngcontent-%COMP%]{text-align:center!important}th[_ngcontent-%COMP%]{background:hsla(0,0%,50.2%,.30196078431372547)}table[_ngcontent-%COMP%]{width:100%;line-height:10px;border-color:hsla(0,0%,50.2%,.30196078431372547)}table[_ngcontent-%COMP%] .mat-form-field[_ngcontent-%COMP%]{width:60%;height:40px;text-align:center!important}.ml-0[_ngcontent-%COMP%]{margin-left:0!important}.delete-icon[_ngcontent-%COMP%]{border:1px solid red;border-radius:50%;background:red}.delete-icon[_ngcontent-%COMP%], .edit-icon[_ngcontent-%COMP%]{font-size:13px;line-height:20px;width:20px!important;height:20px!important;color:#fff;text-align:center}.edit-icon[_ngcontent-%COMP%]{border:1px solid #00f;border-radius:50%;background:#00f}.btn-dis[_ngcontent-%COMP%]:disabled, .btn-dis[disabled][_ngcontent-%COMP%]{border:1px solid #999!important;background-color:#ccc!important;color:#666!important}.mat-table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{color:#000}.emp_setting[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr.mat-row[_ngcontent-%COMP%]{height:65px!important}"]}),t})();function za(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide date "),D.cc())}function Ha(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide the check in time "),D.cc())}function ja(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide the check out time "),D.cc())}function Va(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide the half day mark time "),D.cc())}function La(t,e){1&t&&(D.dc(0,"span"),D.cd(1," Please provide the late mark after time "),D.cc())}function Ba(t,e){if(1&t&&(D.dc(0,"mat-error"),D.ad(1,La,2,0,"span",28),D.cc()),2&t){const t=D.pc(),e=D.Oc(74);D.Gb(1),D.yc("ngIf",null==t.control?null:null==t.control.lateMarkAfter?null:t.control.lateMarkAfter.errors.required)("ngIfElse",e)}}function Na(t,e){1&t&&(D.dc(0,"mat-error"),D.dc(1,"span"),D.cd(2," Please provide the valid late mark after time "),D.cc(),D.cc())}function qa(t,e){if(1&t&&D.ad(0,Na,3,0,"mat-error",28),2&t){const t=D.pc(),e=D.Oc(76);D.yc("ngIf",null==t.control?null:null==t.control.lateMarkAfter?null:t.control.lateMarkAfter.errors.pattern)("ngIfElse",e)}}function Ra(t,e){1&t&&(D.dc(0,"mat-error"),D.dc(1,"span"),D.cd(2," Please provide the minute within 2 digit "),D.cc(),D.cc())}function Xa(t,e){if(1&t&&D.ad(0,Ra,3,0,"mat-error",28),2&t){const t=D.pc(),e=D.Oc(78);D.yc("ngIf",null==t.control?null:null==t.control.lateMarkAfter?null:t.control.lateMarkAfter.errors.maxLength)("ngIfElse",e)}}function Wa(t,e){1&t&&(D.dc(0,"mat-error"),D.dc(1,"span"),D.cd(2," Please provide the minute within 60 minutes "),D.cc(),D.cc())}function $a(t,e){if(1&t&&D.ad(0,Wa,3,0,"mat-error",13),2&t){const t=D.pc();D.yc("ngIf",null==t.control?null:null==t.control.lateMarkAfter?null:t.control.lateMarkAfter.errors.max)}}let Ua=(()=>{class t{constructor(t,e,c,a,r,n,i,o){this.dialogRef=t,this.data=e,this.appServerDatePipe=c,this.toaster=a,this.loader=r,this.modelService=n,this.fb=i,this.config=o,this.timeFormat=Number(this.config.timeFormat),this.setForm()}setForm(){this.customizeForm=this.fb.group({date:["",n.B.required],checkIn:["",n.B.required],checkOut:["",n.B.required],halfDayMarkTime:["",n.B.required],lateMarkAfter:new n.g("",[n.B.required,n.B.pattern(/^[0-9]{1,2}$/),n.B.max(60),n.B.maxLength(2)])})}get control(){return this.customizeForm.controls}ngOnInit(){this.class=this.data.classesArr,this.batch=this.data.batchYear.toString(),this.academicId=this.data.academicYear.toString(),this.routineData=this.data.routineArray,this.groupId=this.data.groupId,this.customCreatedData=this.data.customData,this.customPatchValue(this.customCreatedData)}customPatchValue(t){let e=M(t.customizeDate,"DD-MM-YYYY").format("YYYY-MM-DD");this.customizeForm.patchValue({date:e,checkIn:t.checkIn,checkOut:t.checkOut,halfDayMarkTime:t.halfDayMark,lateMarkAfter:t.lateMark})}updateCustomizeEmp(){var t,e,c,a,r,n,i,o,l,s,d,u;if(this.customizeForm.valid){var m=this.customizeForm.value;let p=this.appServerDatePipe.transform(null===(t=m)||void 0===t?void 0:t.date),h=M(this.customCreatedData.customizeDate,"DD-MM-YYYY").format("YYYY-MM-DD"),g=M.utc().startOf("day").add(null===(e=m)||void 0===e?void 0:e.lateMarkAfter,"minutes").format("HH:mm"),f=new FormData;f.append("stud_attendance_group_id",null!=(c=this.groupId)?c:""),f.append("academic_year_id",null!=(a=this.academicId)?a:""),f.append("batch_id",null!=(r=this.batch)?r:""),f.append("class_id",null!=(n=this.class.toString())?n:""),f.append("old_customize_date",null!=h?h:""),f.append("customize_date",null!=p?p:""),f.append("check_in",null!=(o=null===(i=m)||void 0===i?void 0:i.checkIn)?o:""),f.append("check_out",null!=(s=null===(l=m)||void 0===l?void 0:l.checkOut)?s:""),f.append("half_day_mark",null!=(u=null===(d=m)||void 0===d?void 0:d.halfDayMarkTime)?u:""),f.append("late_mark",null!=g?g:""),f.append("attendance_data",JSON.stringify(this.routineData)),this.loader.open(),this.modelService.updateStudentAttendanceCustom(f).subscribe(t=>{"success"==t.keyword?(this.updateCustomizeTracking(m),this.loader.close(),this.close(!0),this.toaster.present(t.message,"")):"failed"==t.keyword&&(this.loader.close(),this.toaster.present(t.message,""))})}}updateCustomizeTracking(t){var e,c,a,r,n,i,o,l,s,d;const u=Object(H.b)();let m=Object(j.get)(u,"customer_id"),p=Object(j.get)(u,"branch_id"),h=(null===(e=t)||void 0===e?void 0:e.date)?this.appServerDatePipe.transform(null===(c=t)||void 0===c?void 0:c.date):M().format("YYYY-MM-DD"),g=(null===(a=t)||void 0===a?void 0:a.checkIn)?M(t.checkIn,"HH:mm").format("HH:mm:ss"):"00:00:00",f=(null===(r=t)||void 0===r?void 0:r.checkOut)?M(t.checkOut,"HH:mm").format("HH:mm:ss"):"00:00:00",b=(null===(n=t)||void 0===n?void 0:n.halfDayMarkTime)?M(t.halfDayMarkTime,"HH:mm").format("HH:mm:ss"):"00:00:00",y=this.class?this.class.map(t=>String(t)):[],k=new FormData;k.append("customerId",String(m)),k.append("schoolId",String(p)),k.append("academicYearId",null!=(i=this.academicId)?i:""),k.append("batchId",null!=(o=this.batch)?o:""),k.append("classIds",null!=(l=String(y))?l:""),k.append("thisDate",null!=h?h:""),k.append("checkIn",null!=g?g:""),k.append("checkOut",null!=f?f:""),k.append("halfDayMarkTime",null!=b?b:""),k.append("lateMarkMin",null!=(d=String(null===(s=t)||void 0===s?void 0:s.lateMarkAfter))?d:""),k.append("isWorkingDay","true"),this.modelService.updateStudentAttendanceDateTracking(k).subscribe(t=>{let e=t;"Success"==e.keyword?(this.deviceInsert(),console.log("Tracking edited",e)):this.modelService.createStudentAttendanceDateTracking(k).subscribe(t=>{let e=t;"Success"==e.keyword?(this.deviceInsert(),console.log("Tracking created",e)):console.log("Tracking created",e)})})}deviceInsert(){let t=new FormData;t.append("id",this.groupId),t.append("type","stud_attendance_date"),this.modelService.deviceStatus(t).subscribe(t=>{console.log("Tracking created",t)})}close(t){this.dialogRef.close(t)}}return t.\u0275fac=function(e){return new(e||t)(D.Xb(u.f),D.Xb(u.a),D.Xb(m.d),D.Xb(g.a),D.Xb(f.a),D.Xb(cc),D.Xb(n.f),D.Xb(V.a))},t.\u0275cmp=D.Rb({type:t,selectors:[["app-edit"]],features:[D.Fb([{provide:p.c,useClass:h.b},{provide:p.f,useValue:h.a},m.d])],decls:83,vars:16,consts:[[1,"form_bg"],[1,"p-0"],[1,""],[1,"card-title-text"],["autocomplete","off",3,"formGroup"],["fxLayout","row wrap",1,"mt-0"],["fxFlex","100","fxFlex.gt-xs","30",1,"pt-12"],[1,"red_color"],["fxFlex","100","fxFlex.gt-xs","70",1,""],["appearance","fill"],["matInput","","formControlName","date",3,"matDatepicker","click"],["matSuffix","",3,"for"],["picker",""],[4,"ngIf"],["fxFlex","100","fxFlex.gt-xs","30",1,""],["appearance","fill",1,""],["type","text","matInput","","formControlName","checkIn","readonly","","value","",3,"ngxTimepicker","format"],["timePickerFrom",""],["type","text","matInput","","formControlName","checkOut","readonly","","value","",3,"min","ngxTimepicker","format"],["timePickerTo",""],["type","text","matInput","","formControlName","halfDayMarkTime","readonly","","value","",3,"ngxTimepicker","format"],["timePickerHalfDay",""],["matInput","","formControlName","lateMarkAfter"],["patternError",""],["maxLengthError",""],["maxError",""],["mat-raised-button","","color","primary",1,"btn-primary-bg","ml-0",3,"disabled","click"],[1,"pl-8","primary-txt-color",3,"click"],[4,"ngIf","ngIfElse"]],template:function(t,e){if(1&t){const t=D.ec();D.dc(0,"div",0),D.dc(1,"mat-card",1),D.dc(2,"mat-card-title",2),D.dc(3,"div",3),D.cd(4,"Update Customize Date"),D.cc(),D.Yb(5,"mat-divider"),D.cc(),D.dc(6,"mat-card-content"),D.dc(7,"form",4),D.dc(8,"div",5),D.dc(9,"div",6),D.dc(10,"label"),D.dc(11,"strong"),D.cd(12,"Date"),D.cc(),D.dc(13,"span",7),D.cd(14,"*"),D.cc(),D.cc(),D.cc(),D.dc(15,"div",8),D.dc(16,"mat-form-field",9),D.Yb(17,"mat-label"),D.dc(18,"input",10),D.lc("click",(function(e){return D.Sc(t),D.Oc(21).open()})),D.cc(),D.Yb(19,"mat-datepicker-toggle",11),D.Yb(20,"mat-datepicker",null,12),D.ad(22,za,2,0,"mat-error",13),D.cc(),D.cc(),D.cc(),D.dc(23,"div",5),D.dc(24,"div",14),D.dc(25,"label"),D.dc(26,"strong"),D.cd(27," Check In"),D.cc(),D.dc(28,"span",7),D.cd(29,"*"),D.cc(),D.cc(),D.cc(),D.dc(30,"div",8),D.dc(31,"mat-form-field",15),D.Yb(32,"input",16),D.Yb(33,"ngx-material-timepicker",null,17),D.ad(35,Ha,2,0,"mat-error",13),D.cc(),D.cc(),D.cc(),D.dc(36,"div",5),D.dc(37,"div",14),D.dc(38,"label"),D.dc(39,"strong"),D.cd(40," Check Out"),D.cc(),D.dc(41,"span",7),D.cd(42,"*"),D.cc(),D.cc(),D.cc(),D.dc(43,"div",8),D.dc(44,"mat-form-field",15),D.Yb(45,"input",18),D.Yb(46,"ngx-material-timepicker",null,19),D.ad(48,ja,2,0,"mat-error",13),D.cc(),D.cc(),D.cc(),D.dc(49,"div",5),D.dc(50,"div",14),D.dc(51,"label"),D.dc(52,"strong"),D.cd(53,"Half Day Mark Time"),D.cc(),D.dc(54,"span",7),D.cd(55,"*"),D.cc(),D.cc(),D.cc(),D.dc(56,"div",8),D.dc(57,"mat-form-field",15),D.Yb(58,"input",20),D.Yb(59,"ngx-material-timepicker",null,21),D.ad(61,Va,2,0,"mat-error",13),D.cc(),D.cc(),D.cc(),D.dc(62,"div",5),D.dc(63,"div",14),D.dc(64,"label"),D.dc(65,"strong"),D.cd(66,"Late Mark After(Mins)"),D.cc(),D.dc(67,"span",7),D.cd(68,"*"),D.cc(),D.cc(),D.cc(),D.dc(69,"div",8),D.dc(70,"mat-form-field",9),D.Yb(71,"input",22),D.ad(72,Ba,2,2,"mat-error",13),D.ad(73,qa,1,2,"ng-template",null,23,D.bd),D.ad(75,Xa,1,2,"ng-template",null,24,D.bd),D.ad(77,$a,1,1,"ng-template",null,25,D.bd),D.cc(),D.cc(),D.cc(),D.dc(79,"button",26),D.lc("click",(function(t){return e.updateCustomizeEmp()})),D.cd(80,"Submit"),D.cc(),D.dc(81,"a",27),D.lc("click",(function(t){return e.close(!1)})),D.cd(82,"Discard"),D.cc(),D.cc(),D.cc(),D.cc(),D.cc()}if(2&t){const t=D.Oc(21),c=D.Oc(34),a=D.Oc(47),r=D.Oc(60);D.Gb(7),D.yc("formGroup",e.customizeForm),D.Gb(11),D.yc("matDatepicker",t),D.Gb(1),D.yc("for",t),D.Gb(3),D.yc("ngIf",(null==e.control?null:null==e.control.date?null:null==e.control.date.errors?null:e.control.date.errors.required)&&(null==e.control?null:null==e.control.date?null:e.control.date.touched)),D.Gb(10),D.yc("ngxTimepicker",c)("format",e.timeFormat),D.Gb(3),D.yc("ngIf",(null==e.control?null:null==e.control.checkIn?null:null==e.control.checkIn.errors?null:e.control.checkIn.errors.required)&&(null==e.control?null:null==e.control.checkIn?null:e.control.checkIn.touched)),D.Gb(10),D.yc("min",null==e.control?null:null==e.control.checkIn?null:e.control.checkIn.value)("ngxTimepicker",a)("format",e.timeFormat),D.Gb(3),D.yc("ngIf",(null==e.control?null:null==e.control.checkOut?null:null==e.control.checkOut.errors?null:e.control.checkOut.errors.required)&&(null==e.control?null:null==e.control.checkOut?null:e.control.checkOut.touched)),D.Gb(10),D.yc("ngxTimepicker",r)("format",e.timeFormat),D.Gb(3),D.yc("ngIf",(null==e.control?null:null==e.control.halfDayMarkTime?null:null==e.control.halfDayMarkTime.errors?null:e.control.halfDayMarkTime.errors.required)&&(null==e.control?null:null==e.control.halfDayMarkTime?null:e.control.halfDayMarkTime.touched)),D.Gb(11),D.yc("ngIf",(null==e.control?null:null==e.control.lateMarkAfter?null:e.control.lateMarkAfter.errors)&&((null==e.control?null:null==e.control.lateMarkAfter?null:e.control.lateMarkAfter.dirty)||(null==e.control?null:null==e.control.lateMarkAfter?null:e.control.lateMarkAfter.touched))),D.Gb(7),D.yc("disabled",!e.customizeForm.valid)}},directives:[L.a,L.f,B.a,L.c,n.D,n.u,n.k,N.c,N.a,q.b,q.e,R.b,n.c,X.b,n.t,n.i,X.d,q.f,X.a,r.o,d.d,d.a,W.a,q.a],styles:[".mat-form-field[_ngcontent-%COMP%]{width:80%}.batch-name[_ngcontent-%COMP%]{font-size:24px}mat-checkbox[_ngcontent-%COMP%]{margin-right:23px}.text-center[_ngcontent-%COMP%]{text-align:center!important}th[_ngcontent-%COMP%]{border-bottom:1px solid grey}.ml-0[_ngcontent-%COMP%]{margin-left:0!important}.btn-dis[_ngcontent-%COMP%]:disabled, .btn-dis[disabled][_ngcontent-%COMP%]{border:1px solid #999!important;background-color:#ccc!important;color:#666!important}"]}),t})();const Ja=["allDepartmentSelected"],Ka=["allPositionSelected"];function Qa(t,e){if(1&t){const t=D.ec();D.dc(0,"mat-option",40),D.lc("click",(function(c){D.Sc(t);const a=e.$implicit;return D.pc().getBatch(a.academicYearId)})),D.cd(1),D.cc()}if(2&t){const t=e.$implicit;D.yc("value",t.academicYearId),D.Gb(1),D.ed(" ",t.academicYear," ")}}function Za(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please select one academic year "),D.cc())}function tr(t,e){if(1&t){const t=D.ec();D.dc(0,"mat-option",40),D.lc("click",(function(c){D.Sc(t);const a=e.$implicit;return D.pc().getClassFromSelectedBatch(a.batchId)})),D.cd(1),D.cc()}if(2&t){const t=e.$implicit;D.yc("value",t.batchId),D.Gb(1),D.ed(" ",t.batchName," ")}}function er(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide the batch "),D.cc())}function cr(t,e){if(1&t&&(D.dc(0,"mat-option",43),D.cd(1),D.cc()),2&t){const t=e.$implicit;D.yc("value",t.classId),D.Gb(1),D.ed(" ",t.className," ")}}function ar(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please select atleast one class "),D.cc())}function rr(t,e){if(1&t&&(D.dc(0,"div",8),D.dc(1,"div",10),D.dc(2,"label"),D.dc(3,"strong"),D.cd(4,"Classes"),D.cc(),D.dc(5,"span",11),D.cd(6,"*"),D.cc(),D.cc(),D.cc(),D.dc(7,"div",12),D.dc(8,"mat-form-field",13),D.Yb(9,"mat-label"),D.dc(10,"mat-select",41),D.ad(11,cr,2,2,"mat-option",42),D.cc(),D.ad(12,ar,2,0,"mat-error",16),D.cc(),D.cc(),D.cc()),2&t){const t=D.pc();D.Gb(11),D.yc("ngForOf",t.classes),D.Gb(1),D.yc("ngIf",null==t.control?null:null==t.control.class?null:null==t.control.class.errors?null:t.control.class.errors.required)}}function nr(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide the check in time "),D.cc())}function ir(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide the check out time "),D.cc())}function or(t,e){1&t&&(D.dc(0,"mat-error"),D.cd(1," Please provide the half day mark time "),D.cc())}function lr(t,e){1&t&&(D.dc(0,"span"),D.cd(1," Please provide the late mark after time "),D.cc())}function sr(t,e){if(1&t&&(D.dc(0,"mat-error"),D.ad(1,lr,2,0,"span",58),D.cc()),2&t){const t=D.pc().$implicit,e=D.Oc(29);D.Gb(1),D.yc("ngIf",null==t.controls?null:null==t.controls.lateMarkAfter?null:t.controls.lateMarkAfter.errors.required)("ngIfElse",e)}}function dr(t,e){1&t&&(D.dc(0,"mat-error"),D.dc(1,"span"),D.cd(2," Please provide the valid late mark after time "),D.cc(),D.cc())}function ur(t,e){if(1&t&&D.ad(0,dr,3,0,"mat-error",58),2&t){const t=D.pc().$implicit,e=D.Oc(31);D.yc("ngIf",null==t.controls?null:null==t.controls.lateMarkAfter?null:t.controls.lateMarkAfter.errors.pattern)("ngIfElse",e)}}function mr(t,e){1&t&&(D.dc(0,"mat-error"),D.dc(1,"span"),D.cd(2," Please provide the minute within 2 digit "),D.cc(),D.cc())}function pr(t,e){if(1&t&&D.ad(0,mr,3,0,"mat-error",58),2&t){const t=D.pc().$implicit,e=D.Oc(33);D.yc("ngIf",null==t.controls?null:null==t.controls.lateMarkAfter?null:t.controls.lateMarkAfter.errors.maxLength)("ngIfElse",e)}}function hr(t,e){1&t&&(D.dc(0,"mat-error"),D.dc(1,"span"),D.cd(2," Please provide the minute within 60 minutes "),D.cc(),D.cc())}function gr(t,e){if(1&t&&D.ad(0,hr,3,0,"mat-error",16),2&t){const t=D.pc().$implicit;D.yc("ngIf",null==t.controls?null:null==t.controls.lateMarkAfter?null:t.controls.lateMarkAfter.errors.max)}}function fr(t,e){if(1&t){const t=D.ec();D.dc(0,"tr",44),D.dc(1,"td",45),D.dc(2,"mat-checkbox",46),D.lc("change",(function(c){D.Sc(t);const a=e.index;return D.pc().isdayClicked(c,a)})),D.cc(),D.cc(),D.dc(3,"td",47),D.cd(4),D.qc(5,"titlecase"),D.cc(),D.dc(6,"td",45),D.dc(7,"mat-form-field",13),D.Yb(8,"input",48),D.Yb(9,"ngx-material-timepicker",null,49),D.ad(11,nr,2,0,"mat-error",16),D.cc(),D.cc(),D.dc(12,"td",45),D.dc(13,"mat-form-field",13),D.Yb(14,"input",50),D.Yb(15,"ngx-material-timepicker",null,51),D.ad(17,ir,2,0,"mat-error",16),D.cc(),D.cc(),D.dc(18,"td",45),D.dc(19,"mat-form-field",13),D.Yb(20,"input",52),D.Yb(21,"ngx-material-timepicker",null,53),D.ad(23,or,2,0,"mat-error",16),D.cc(),D.cc(),D.dc(24,"td",45),D.dc(25,"mat-form-field",13),D.Yb(26,"input",54),D.ad(27,sr,2,2,"mat-error",16),D.ad(28,ur,1,2,"ng-template",null,55,D.bd),D.ad(30,pr,1,2,"ng-template",null,56,D.bd),D.ad(32,gr,1,1,"ng-template",null,57,D.bd),D.cc(),D.cc(),D.cc()}if(2&t){const t=e.$implicit,c=e.index,a=D.Oc(10),r=D.Oc(16),n=D.Oc(22),i=D.pc();D.Gb(1),D.yc("formGroupName",c),D.Gb(1),D.yc("value",t.value.day),D.Gb(2),D.dd(D.rc(5,18,t.value.day)),D.Gb(2),D.yc("formGroupName",c),D.Gb(2),D.yc("ngxTimepicker",a)("format",i.timeFormat),D.Gb(3),D.yc("ngIf",(null==t.controls.checkInTime?null:null==t.controls.checkInTime.errors?null:t.controls.checkInTime.errors.required)&&t.controls.checkInTime.touched),D.Gb(1),D.yc("formGroupName",c),D.Gb(2),D.yc("min",t.controls.checkInTime.value)("ngxTimepicker",r)("format",i.timeFormat),D.Gb(3),D.yc("ngIf",(null==t.controls.checkOutTime?null:null==t.controls.checkOutTime.errors?null:t.controls.checkOutTime.errors.required)&&t.controls.checkOutTime.touched),D.Gb(1),D.yc("formGroupName",c),D.Gb(2),D.yc("ngxTimepicker",n)("format",i.timeFormat),D.Gb(3),D.yc("ngIf",(null==t.controls.halfDayMarkTime?null:null==t.controls.halfDayMarkTime.errors?null:t.controls.halfDayMarkTime.errors.required)&&t.controls.halfDayMarkTime.touched),D.Gb(1),D.yc("formGroupName",c),D.Gb(3),D.yc("ngIf",(null==t.controls?null:null==t.controls.lateMarkAfter?null:t.controls.lateMarkAfter.errors)&&((null==t.controls?null:null==t.controls.lateMarkAfter?null:t.controls.lateMarkAfter.dirty)||(null==t.controls?null:null==t.controls.lateMarkAfter?null:t.controls.lateMarkAfter.touched)))}}function br(t,e){if(1&t){const t=D.ec();D.dc(0,"button",59),D.lc("click",(function(e){return D.Sc(t),D.pc().openDialog()})),D.cd(1,"Create"),D.cc()}if(2&t){const t=D.pc();D.yc("disabled",!(null!=t.control&&null!=t.control.class&&t.control.class.valid))}}function yr(t,e){if(1&t){const t=D.ec();D.dc(0,"button",60),D.lc("click",(function(e){return D.Sc(t),D.pc().openDialog()})),D.cd(1,"Create"),D.cc()}}function kr(t,e){if(1&t){const t=D.ec();D.dc(0,"span",62),D.lc("click",(function(e){D.Sc(t);const c=D.pc().index;return D.pc(2).customAction("edit",c)})),D.dc(1,"mat-icon",63),D.cd(2,"edit"),D.cc(),D.cc()}}function vr(t,e){if(1&t){const t=D.ec();D.dc(0,"span",62),D.lc("click",(function(e){D.Sc(t);const c=D.pc().index;return D.pc(2).customAction("delete",c)})),D.dc(1,"mat-icon",64),D.cd(2,"delete"),D.cc(),D.cc()}}const Sr=function(){return["stu_attendance_setting"]},Dr=function(){return["stu_attendance_setting_customize_update"]},Ir=function(){return["stu_attendance_setting_delete"]};function Mr(t,e){if(1&t&&(D.dc(0,"tr",44),D.dc(1,"td",47),D.cd(2),D.qc(3,"displayDate"),D.cc(),D.dc(4,"td",47),D.cd(5),D.qc(6,"displayTime"),D.cc(),D.dc(7,"td",47),D.cd(8),D.qc(9,"displayTime"),D.cc(),D.dc(10,"td",47),D.cd(11),D.qc(12,"displayTime"),D.cc(),D.dc(13,"td",47),D.cd(14),D.cc(),D.dc(15,"td",47),D.ad(16,kr,3,0,"span",61),D.ad(17,vr,3,0,"span",61),D.cc(),D.cc()),2&t){const t=e.$implicit,c=D.pc(2);D.Gb(2),D.dd(null!=t&&t.customizeDate?null==t?null:t.customizeDate:D.rc(3,7,"")),D.Gb(3),D.ed(" ",D.rc(6,9,null==t?null:t.checkIn)," "),D.Gb(3),D.ed(" ",D.rc(9,11,null==t?null:t.checkOut)," "),D.Gb(3),D.ed(" ",D.rc(12,13,null==t?null:t.halfDayMark)," "),D.Gb(3),D.ed(" ",null==t?null:t.lateMark," "),D.Gb(2),D.yc("ngIf",c.permission.hasPermission(D.Ec(15,Sr),D.Ec(16,Dr))),D.Gb(1),D.yc("ngIf",c.permission.hasPermission(D.Ec(17,Sr),D.Ec(18,Ir)))}}function Or(t,e){if(1&t&&(D.dc(0,"tbody"),D.ad(1,Mr,18,19,"tr",32),D.cc()),2&t){const t=D.pc();D.Gb(1),D.yc("ngForOf",t.customizeList)}}function xr(t,e){1&t&&(D.dc(0,"tbody"),D.dc(1,"tr",44),D.dc(2,"td",65),D.dc(3,"strong"),D.cd(4,"No Data Found"),D.cc(),D.cc(),D.cc(),D.cc())}const _r=function(){return["stu_attendance_setting_customize_create"]};let Tr=(()=>{class t{constructor(t,e,c,a,r,n,i,o,l,s,d,u){this.dialog=t,this.fb=e,this.toaster=c,this.loader=a,this.router=r,this.academicYearService=n,this.batchService=i,this.classService=o,this.activatedRoute=l,this.modalService=s,this.permission=d,this.config=u,this.staticDays=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],this.customizeList=[],this.days=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],this.timeFormat=Number(this.config.timeFormat),this.groupId=this.activatedRoute.snapshot.params.id,this.getData(this.groupId),this.getAcademicYear(),this.getCustomizeData(this.groupId)}ngOnInit(){this.setForm()}getAcademicYear(){this.academicYearService.getList().subscribe(t=>{"success"==t.keyword?(this.academicYears=t.academicYears.filter(t=>"1"==t.status),this.batches=[],this.classes=[]):(this.academicYears=[],this.batches=[],this.classes=[])})}getBatch(t,e){this.createEmpSettingForm.get("batch").setValue(""),this.batchService.getListByAcademic(t).subscribe(t=>{"success"==t.keyword?(this.batches=t.batches,e||(this.createEmpSettingForm.get("type").setValue(""),this.classes=[])):(this.batches=[],this.classes=[],this.createEmpSettingForm.get("batch").setValue(""))})}getClass(t,e){this.loader.open(),this.modalService.getClassByBatchId(t,this.groupId).subscribe(t=>{if("success"==t.keyword){let e=t.classes.filter(t=>"all"!==t.classId);this.classes=e,this.selectedClass=t.selectedClass,this.responseData(this.selectedClass),this.loader.close()}else this.classes=[],this.responseData(this.selectedClass),this.loader.close()})}getClassFromSelectedBatch(t){this.createEmpSettingForm.get("type").setValue(""),this.loader.open(),this.classes=[],this.modalService.getClassByBatchId(t,this.groupId).subscribe(t=>{if("success"==t.keyword){let e=t.classes.filter(t=>"all"!==t.classId);this.classes=e,this.loader.close()}else this.classes=[],this.loader.close()})}getCustomizeData(t){this.modalService.getStudentCustomizeList(t).subscribe(t=>{this.customizeList="success"==t.keyword?t.customizeList:[]})}getData(t){this.loader.open(),this.modalService.getOneStudentAttendacneRoutine(t).subscribe(t=>{"success"==t.keyword?(this.loader.close(),this.createdData=t.attendList[0],this.getBatch(this.createdData.academicYearId,!0),this.getClass(this.createdData.batchId,!0)):(this.toaster.present(t.message),this.loader.close())})}responseData(t){this.loader.dialogRef&&this.loader.close();const e=t.filter(t=>"all"==t.classId);this.selectedClass.length>0&&(e[0]?(this.setForm(),this.patchAllData(this.createdData,"1")):(this.setForm(),this.patchAllData(this.createdData,"2")))}patchAllData(t,e){var c,a,r;"1"==e?(this.clearEmployeeControl(),this.createEmpSettingForm.patchValue({type:e,academicYear:t.academicYearId,batch:t.batchId}),this.patchDataForEachDay(null===(c=t)||void 0===c?void 0:c.routineList)):(this.manageEmployeeControl(),this.createEmpSettingForm.patchValue({type:e,academicYear:t.academicYearId,batch:t.batchId,class:this.filterArray("class_id",null===(a=t)||void 0===a?void 0:a.class)}),this.patchDataForEachDay(null===(r=t)||void 0===r?void 0:r.routineList))}patchDataForEachDay(t){t.forEach(t=>{let e=parseInt(t.dayId)-1,c=this.createEmpSettingForm.get("days").controls[e];1==t.isWorkingDay?(this.setEnableForSelectedDay(c),c.patchValue({id:t.dayId,day:t.day,isWorkingDay:1==t.isWorkingDay,checkInTime:t.checkIn?M(t.checkIn,"HH:mm:ss").format("HH:mm"):"00:00",checkOutTime:t.checkOut?M(t.checkOut,"HH:mm:ss").format("HH:mm"):"00:00",halfDayMarkTime:t.halfDayMark?M(t.halfDayMark,"HH:mm:ss").format("HH:mm"):"00:00",lateMarkAfter:t.lateMark?M(t.lateMark,"HH:mm:ss").diff(M().startOf("day"),"minutes"):"00"})):this.setDisabledForSelectedDay(c)})}filterArray(t,e){return Array.isArray(e)?e.map(e=>e[t]):e}setForm(){this.createEmpSettingForm=this.fb.group({type:["",n.B.required],academicYear:["",n.B.required],batch:["",n.B.required],days:new n.d([])}),this.setFormArrayForDays()}get control(){return this.createEmpSettingForm.controls}manageEmployeeControl(){this.createEmpSettingForm.addControl("class",new n.g("",n.B.required)),this.createEmpSettingForm.get("class").setValue("")}clearEmployeeControl(){this.createEmpSettingForm.removeControl("class")}setFormArrayForDays(){let t=this.createEmpSettingForm.get("days");this.staticDays.map((e,c)=>{t.push(this.getGroup(e,c))})}getGroup(t,e){return this.fb.group({id:new n.g(e+1),day:new n.g(t),isWorkingDay:new n.g(!1,[n.B.required]),checkInTime:new n.g({value:"",disabled:!0},[n.B.required]),checkOutTime:new n.g({value:"",disabled:!0},[n.B.required]),halfDayMarkTime:new n.g({value:"",disabled:!0},[n.B.required]),lateMarkAfter:new n.g({value:"",disabled:!0},[n.B.required,n.B.pattern(/^[0-9]{1,2}$/),n.B.max(60),n.B.maxLength(2)])})}setEnableForSelectedDay(t){t.get("checkInTime").setValue(""),t.get("checkInTime").enable(),t.get("checkInTime").setValidators(n.B.required),t.get("checkInTime").updateValueAndValidity(),t.get("checkOutTime").setValue(""),t.get("checkOutTime").enable(),t.get("checkOutTime").setValidators(n.B.required),t.get("checkOutTime").updateValueAndValidity(),t.get("halfDayMarkTime").setValue(""),t.get("halfDayMarkTime").enable(),t.get("halfDayMarkTime").setValidators(n.B.required),t.get("halfDayMarkTime").updateValueAndValidity(),t.get("lateMarkAfter").setValue(""),t.get("lateMarkAfter").enable(),t.get("lateMarkAfter").setValidators([n.B.required,n.B.pattern(/^[0-9]{1,2}$/),n.B.max(60),n.B.maxLength(2)]),t.get("lateMarkAfter").updateValueAndValidity()}setDisabledForSelectedDay(t){t.get("checkInTime").setValue(""),t.get("checkInTime").disable(),t.get("checkInTime").clearValidators(),t.get("checkInTime").updateValueAndValidity(),t.get("checkOutTime").setValue(""),t.get("checkOutTime").disable(),t.get("checkOutTime").clearValidators(),t.get("checkOutTime").updateValueAndValidity(),t.get("halfDayMarkTime").setValue(""),t.get("halfDayMarkTime").disable(),t.get("halfDayMarkTime").clearValidators(),t.get("halfDayMarkTime").updateValueAndValidity(),t.get("lateMarkAfter").setValue(""),t.get("lateMarkAfter").disable(),t.get("lateMarkAfter").clearValidators(),t.get("lateMarkAfter").updateValueAndValidity()}isdayClicked(t,e){let c=this.createEmpSettingForm.get("days").controls[e];t.checked?this.setEnableForSelectedDay(c):this.setDisabledForSelectedDay(c)}openDialog(){"1"==this.createEmpSettingForm.get("type").value?this.dialog.open(ua,{width:"40%",data:{classesArr:["all"],batchYear:this.createEmpSettingForm.get("batch").value,academicYear:this.createEmpSettingForm.get("academicYear").value,groupId:this.groupId,routineArray:this.setArrayVar(this.createEmpSettingForm.get("days").value)}}).afterClosed().subscribe(t=>{t&&this.getCustomizeData(this.groupId)}):this.dialog.open(ua,{width:"40%",data:{classesArr:this.createEmpSettingForm.get("class").value,batchYear:this.createEmpSettingForm.get("batch").value,academicYear:this.createEmpSettingForm.get("academicYear").value,routineArray:this.setArrayVar(this.createEmpSettingForm.get("days").value),groupId:this.groupId}}).afterClosed().subscribe(t=>{t&&this.getCustomizeData(this.groupId)})}setArrayVar(t){let e=[];for(let c of t){let t=this.changeStructureObj(c);e.push(t)}return e}changeStructureObj(t){return{day_id:t.id,is_working_day:t.isWorkingDay?"1":"0",check_in:t.checkInTime?t.checkInTime:"00:00",check_out:t.checkOutTime?t.checkOutTime:"00:00",half_day:t.halfDayMarkTime?t.halfDayMarkTime:"00:00",late_mark:M.utc().startOf("day").add(t.lateMarkAfter,"minutes").format("HH:mm")}}update(){var t,e,c,a,r,n;if(this.createEmpSettingForm.value.days.filter(t=>1==t.isWorkingDay).length>0)if(this.createEmpSettingForm.valid){this.loader.open();var i=this.createEmpSettingForm.value;let o=new FormData;o.append("stud_attendance_group_id",this.groupId),o.append("attendance_data",JSON.stringify(this.setArrayVar(i.days))),o.append("academic_year_id",null!=(e=(null===(t=i)||void 0===t?void 0:t.academicYear).toString())?e:""),o.append("batch_id",null!=(a=(null===(c=i)||void 0===c?void 0:c.batch).toString())?a:""),o.append("class_id","2"==i.type?null!=(n=(null===(r=i)||void 0===r?void 0:r.class).toString())?n:"":"all"),this.modalService.updateStudentAttendanceRoutine(o).subscribe(t=>{"success"==t.keyword?(this.studentResponse=t.attendList[0],this.deviceStudent(i),this.toaster.present(t.message,"")):"failed"==t.keyword&&(this.loader.close(),this.toaster.present(t.message,""))})}else lt.a.fire({title:"Check Required",text:"Fill Mandatory Fields",icon:"warning"});else lt.a.fire({title:"Check Required",text:"Please Fill One Working Day Fields",icon:"warning"})}deviceStudent(t){var e,c,a;const r=Object(H.b)();let n=Object(j.get)(r,"customer_id"),i=Object(j.get)(r,"branch_id"),o=(null===(e=t)||void 0===e?void 0:e.class)?t.class.map(t=>String(t)):[],l={schoolOpenDays:this.setVar(t.days),customerId:String(n),schoolId:String(i),academicYearId:(null===(c=t)||void 0===c?void 0:c.academicYear).toString(),batchId:(null===(a=t)||void 0===a?void 0:a.batch).toString(),classIds:["all"]};"2"==t.type&&(l.classIds=o),this.modalService.createStudentAttendanceTracking(l).subscribe(t=>{"Success"==t.keyword?(this.deviceInsert(),this.updateCustomizeTracking()):"Failed"==t.keyword&&(this.loader.close(),this.router.navigate(["school/new-attendance-settings/student/list"]))})}deviceInsert(){let t=new FormData;t.append("id",this.studentResponse.studAttendanceGroupId),t.append("type","stud_attendance_routine"),this.modalService.deviceStatus(t).subscribe(t=>{this.loader.close(),this.router.navigate(["school/new-attendance-settings/student/list"])})}setVar(t){let e=[];for(let c of t){let t=this.changeStructureObjForTracking(c);e.push(t)}return e}changeStructureObjForTracking(t){var e,c,a,r,n;return{day:this.days[t.id-1],isWorkingDay:String(t.isWorkingDay),checkIn:(null===(e=t)||void 0===e?void 0:e.checkInTime)?M(t.checkInTime,"HH:mm").format("HH:mm:ss"):"00:00:00",checkOut:(null===(c=t)||void 0===c?void 0:c.checkOutTime)?M(t.checkOutTime,"HH:mm").format("HH:mm:ss"):"00:00:00",halfDayMarkTime:(null===(a=t)||void 0===a?void 0:a.halfDayMarkTime)?M(t.halfDayMarkTime,"HH:mm").format("HH:mm:ss"):"00:00:00",lateMarkMin:(null===(r=t)||void 0===r?void 0:r.lateMarkAfter)?null===(n=t)||void 0===n?void 0:n.lateMarkAfter:"00"}}submit(){console.log("Form value - ",this.createEmpSettingForm.value),console.log("Form is Valid? - ",this.createEmpSettingForm.valid),console.log("Days - ",this.createEmpSettingForm.value.days)}customAction(t,e){"edit"!=t&&"delete"!=t||lt.a.fire({title:"edit"==t?"Update Customize Date":"Delete Customize Date",text:"Are you sure? You want to "+t+" !",icon:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:"Yes, "+t+" it!"}).then(c=>{c.value&&("edit"==t?this.openEditDialog(this.customizeList[e]):"delete"==t&&this.deleteCustomizeEmp(this.customizeList[e]))})}openEditDialog(t){"1"==this.createEmpSettingForm.get("type").value?this.dialog.open(Ua,{width:"40%",data:{classesArr:["all"],batchYear:this.createEmpSettingForm.get("batch").value,academicYear:this.createEmpSettingForm.get("academicYear").value,routineArray:this.setArrayVar(this.createEmpSettingForm.get("days").value),groupId:this.groupId,customData:t}}).afterClosed().subscribe(t=>{t&&this.getCustomizeData(this.groupId)}):this.dialog.open(Ua,{width:"40%",data:{classesArr:this.createEmpSettingForm.get("class").value,batchYear:this.createEmpSettingForm.get("batch").value,academicYear:this.createEmpSettingForm.get("academicYear").value,routineArray:this.setArrayVar(this.createEmpSettingForm.get("days").value),groupId:this.groupId,customData:t}}).afterClosed().subscribe(t=>{t&&this.getCustomizeData(this.groupId)})}deleteCustomizeEmp(t){var e;this.loader.open();let c=new FormData,a=(null===(e=t)||void 0===e?void 0:e.customizeDate)?M(t.customizeDate,"DD-MM-YYYY").format("YYYY-MM-DD"):"",r=this.createEmpSettingForm.get("academicYear").value.toString(),n=this.createEmpSettingForm.get("batch").value.toString();c.append("academic_year_id",null!=r?r:""),c.append("batch_id",null!=n?n:""),c.append("customize_date",null!=a?a:""),this.modalService.deleteStudentAttendanceCustom(c).subscribe(e=>{"success"==e.keyword?(this.deleteCustomizeTracking(t),this.loader.close(),0!=this.customizeList.length&&this.getCustomizeData(this.groupId),this.toaster.present(e.message,"")):"failed"==e.keyword&&(this.loader.close(),this.toaster.present(e.message,""))})}deleteCustomizeTracking(t){var e;const c=Object(H.b)();let a=Object(j.get)(c,"customer_id"),r=Object(j.get)(c,"branch_id"),n=(null===(e=t)||void 0===e?void 0:e.customizeDate)?M(t.customizeDate,"DD-MM-YYYY").format("YYYY-MM-DD"):"",i=this.createEmpSettingForm.get("academicYear").value.toString(),o=this.createEmpSettingForm.get("batch").value.toString(),l=[];if("2"==this.createEmpSettingForm.get("type").value){let t=this.createEmpSettingForm.get("class").value;l=t?t.map(t=>String(t)):[]}else l=["all"];let s=new FormData;s.append("customerId",String(a)),s.append("schoolId",String(r)),s.append("classIds",String(l)),s.append("academicYearId",null!=i?i:""),s.append("batchId",null!=o?o:""),s.append("thisDate",null!=n?n:""),this.modalService.deleteStudentAttendanceDateTracking(s).subscribe(t=>{console.log("Tracking deleted",t)})}updateCustomizeTracking(){const t=Object(H.b)();let e=Object(j.get)(t,"customer_id"),c=Object(j.get)(t,"branch_id");this.customizeList.forEach(t=>{var a,r,n,i,o,l,s,d,u;let m=(null===(a=t)||void 0===a?void 0:a.customizeDate)?M(t.customizeDate,"DD-MM-YYYY").format("YYYY-MM-DD"):"",p=(null===(r=t)||void 0===r?void 0:r.checkIn)?M(t.checkIn,"HH:mm").format("HH:mm:ss"):"00:00:00",h=(null===(n=t)||void 0===n?void 0:n.checkOut)?M(t.checkOut,"HH:mm").format("HH:mm:ss"):"00:00:00",g=(null===(i=t)||void 0===i?void 0:i.halfDayMark)?M(t.halfDayMark,"HH:mm").format("HH:mm:ss"):"00:00:00";this.position="1"==this.createEmpSettingForm.get("type").value?["all"]:this.createEmpSettingForm.get("class").value?this.createEmpSettingForm.get("class").value.map(t=>String(t)):[];let f=new FormData;f.append("customerId",String(e)),f.append("schoolId",String(c)),f.append("academicYearId",null!=(o=String(this.createEmpSettingForm.get("academicYear").value))?o:""),f.append("batchId",null!=(l=String(this.createEmpSettingForm.get("batch").value))?l:""),f.append("classIds",null!=(s=String(this.position))?s:""),f.append("thisDate",null!=m?m:""),f.append("checkIn",null!=p?p:""),f.append("checkOut",null!=h?h:""),f.append("halfDayMarkTime",null!=g?g:""),f.append("lateMarkMin",null!=(u=String(null===(d=t)||void 0===d?void 0:d.lateMark))?u:""),f.append("isWorkingDay","true"),this.modalService.updateStudentAttendanceDateTracking(f).subscribe(t=>{"Success"==t.keyword?console.log("Tracking edited",t):this.modalService.createStudentAttendanceDateTracking(f).subscribe(t=>{console.log("Tracking created",t)})})})}}return t.\u0275fac=function(e){return new(e||t)(D.Xb(u.b),D.Xb(n.f),D.Xb(g.a),D.Xb(f.a),D.Xb(a.g),D.Xb(ma.a),D.Xb(pa.a),D.Xb(ha.a),D.Xb(a.a),D.Xb(cc),D.Xb(Dt.a),D.Xb(V.a))},t.\u0275cmp=D.Rb({type:t,selectors:[["app-edit"]],viewQuery:function(t,e){var c;1&t&&(D.md(Ja,!0),D.md(Ka,!0)),2&t&&(D.Nc(c=D.mc())&&(e.allDepartmentSelected=c.first),D.Nc(c=D.mc())&&(e.allPositionSelected=c.first))},decls:99,vars:17,consts:[[1,"create_btn"],["mat-raised-button","","color","primary",1,"btn-primary-bg",3,"disabled","click"],["href","#",1,"pl-12","primary-txt-color",3,"routerLink"],[1,"form_bg"],[1,"p-0"],[1,""],[1,"card-title-text"],[3,"formGroup"],["fxLayout","row wrap",1,"mt-0"],["fxFlex","100","fxFlex.gt-xs","50",1,"mt-12"],["fxFlex","100","fxFlex.gt-xs","30",1,"mt-12"],[1,"red_color"],["fxFlex","100","fxFlex.gt-xs","70",1,"mt-12"],["appearance","fill"],["formControlName","academicYear"],[3,"value","click",4,"ngFor","ngForOf"],[4,"ngIf"],["formControlName","batch"],["fxLayout","row wrap",1,"mb-24"],["fxFlex","100","fxFlex.gt-xs","9",1,""],["fxFlex","100","fxFlex.gt-xs","35",1,""],["formControlName","type","aria-label","Select an option","name","type"],["value","1",3,"click"],["value","2",1,"ml-12",3,"click"],["fxLayout","row wrap","class","mt-0",4,"ngIf"],["border","1","cellspacing","0",1,"mat-table","mt-12","emp_setting"],[1,"mat-header-row"],["rowspan","2",1,"mat-header-cell","text-center","pt-3",2,"width","10%"],["colspan","2",1,"mat-header-cell","text-center","pt-3",2,"width","10%"],["rowspan","2",1,"mat-header-cell","text-center",2,"width","10%"],[1,"mat-header-cell","text-center","pt-3",2,"width","10%"],["formArrayName","days"],["class","mat-row",4,"ngFor","ngForOf"],[1,"mt-24"],[1,"create_btn","mt-40"],["mat-raised-button","","color","primary","class","btn-primary-bg ml-0",3,"disabled","click",4,"ngIf"],["mat-raised-button","","color","primary","class","btn-primary-bg ml-0",3,"click",4,"ngIf"],["border","1","cellspacing","0",1,"mat-table","mt-12","customize_setting"],[1,"mat-header-cell","text-center",2,"width","10%"],[1,"mat-header-cell","text-center","pt-3",2,"width","5%"],[3,"value","click"],["formControlName","class","multiple",""],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[1,"mat-row"],[1,"mat-cell","text-center",3,"formGroupName"],["formControlName","isWorkingDay",3,"value","change"],[1,"mat-cell","text-center"],["type","text","matInput","","formControlName","checkInTime","readonly","","value","",3,"ngxTimepicker","format"],["timePickerMonFrom",""],["type","text","matInput","","formControlName","checkOutTime","readonly","","value","",3,"min","ngxTimepicker","format"],["timePickerMonto",""],["type","text","matInput","","formControlName","halfDayMarkTime","readonly","","value","",3,"ngxTimepicker","format"],["timePickerMonhalfday",""],["matInput","","formControlName","lateMarkAfter"],["patternError",""],["maxLengthError",""],["maxError",""],[4,"ngIf","ngIfElse"],["mat-raised-button","","color","primary",1,"btn-primary-bg","ml-0",3,"disabled","click"],["mat-raised-button","","color","primary",1,"btn-primary-bg","ml-0",3,"click"],["class","mt-8 ml-0 mr-8","style","cursor: pointer;",3,"click",4,"ngIf"],[1,"mt-8","ml-0","mr-8",2,"cursor","pointer",3,"click"],[1,"edit-icon"],[1,"delete-icon"],["colspan","6",1,"mat-cell","text-center"]],template:function(t,e){1&t&&(D.dc(0,"div",0),D.dc(1,"button",1),D.lc("click",(function(t){return e.update()})),D.cd(2,"Update"),D.cc(),D.dc(3,"a",2),D.cd(4,"Discard"),D.cc(),D.cc(),D.dc(5,"div",3),D.dc(6,"mat-card",4),D.dc(7,"mat-card-title",5),D.dc(8,"div",6),D.cd(9,"Student Attendance Settings"),D.cc(),D.Yb(10,"mat-divider"),D.cc(),D.dc(11,"mat-card-content"),D.dc(12,"form",7),D.dc(13,"div",8),D.dc(14,"div",9),D.dc(15,"div",8),D.dc(16,"div",10),D.dc(17,"label"),D.dc(18,"strong"),D.cd(19,"Academic Year"),D.cc(),D.dc(20,"span",11),D.cd(21,"*"),D.cc(),D.cc(),D.cc(),D.dc(22,"div",12),D.dc(23,"mat-form-field",13),D.Yb(24,"mat-label"),D.dc(25,"mat-select",14),D.ad(26,Qa,2,2,"mat-option",15),D.cc(),D.ad(27,Za,2,0,"mat-error",16),D.cc(),D.cc(),D.cc(),D.dc(28,"div",8),D.dc(29,"div",10),D.dc(30,"label"),D.dc(31,"strong"),D.cd(32,"Batch"),D.cc(),D.dc(33,"span",11),D.cd(34,"*"),D.cc(),D.cc(),D.cc(),D.dc(35,"div",12),D.dc(36,"mat-form-field",13),D.Yb(37,"mat-label"),D.dc(38,"mat-select",17),D.ad(39,tr,2,2,"mat-option",15),D.cc(),D.ad(40,er,2,0,"mat-error",16),D.cc(),D.cc(),D.cc(),D.dc(41,"div",18),D.dc(42,"div",19),D.dc(43,"label"),D.dc(44,"strong"),D.cd(45,"Type"),D.cc(),D.dc(46,"span",11),D.cd(47,"*"),D.cc(),D.cc(),D.cc(),D.dc(48,"div",20),D.dc(49,"mat-radio-group",21),D.dc(50,"mat-radio-button",22),D.lc("click",(function(t){return e.clearEmployeeControl()})),D.cd(51,"All"),D.cc(),D.dc(52,"mat-radio-button",23),D.lc("click",(function(t){return e.manageEmployeeControl()})),D.cd(53,"Custom "),D.cc(),D.cc(),D.cc(),D.cc(),D.ad(54,rr,13,2,"div",24),D.cc(),D.cc(),D.dc(55,"table",25),D.dc(56,"thead"),D.dc(57,"tr",26),D.dc(58,"th",27),D.cd(59,"Is Working Day?"),D.cc(),D.dc(60,"th",27),D.cd(61,"Schools opens On"),D.cc(),D.dc(62,"th",28),D.cd(63,"Check"),D.cc(),D.dc(64,"th",29),D.cd(65,"Half Day Mark Time"),D.cc(),D.dc(66,"th",27),D.cd(67,"Late Mark After(Mins) "),D.cc(),D.cc(),D.dc(68,"tr",26),D.dc(69,"th",30),D.cd(70,"In"),D.cc(),D.dc(71,"th",30),D.cd(72,"Out"),D.cc(),D.cc(),D.cc(),D.dc(73,"tbody",31),D.ad(74,fr,34,20,"tr",32),D.cc(),D.cc(),D.cc(),D.Yb(75,"mat-divider",33),D.dc(76,"div",34),D.dc(77,"h3"),D.dc(78,"strong"),D.cd(79,"Customize Date"),D.cc(),D.cc(),D.ad(80,br,2,1,"button",35),D.ad(81,yr,2,0,"button",36),D.cc(),D.dc(82,"table",37),D.dc(83,"thead"),D.dc(84,"tr",26),D.dc(85,"th",30),D.cd(86,"Date"),D.cc(),D.dc(87,"th",30),D.cd(88,"Check In"),D.cc(),D.dc(89,"th",30),D.cd(90,"Check Out"),D.cc(),D.dc(91,"th",38),D.cd(92,"Half Day Mark Time"),D.cc(),D.dc(93,"th",30),D.cd(94,"Late Mark After(Mins)"),D.cc(),D.dc(95,"th",39),D.cd(96,"Action "),D.cc(),D.cc(),D.cc(),D.ad(97,Or,2,1,"tbody",16),D.ad(98,xr,5,0,"tbody",16),D.cc(),D.cc(),D.cc(),D.cc()),2&t&&(D.Gb(1),D.yc("disabled",!e.createEmpSettingForm.valid),D.Gb(2),D.yc("routerLink","/school/new-attendance-settings/student/list"),D.Gb(9),D.yc("formGroup",e.createEmpSettingForm),D.Gb(14),D.yc("ngForOf",e.academicYears),D.Gb(1),D.yc("ngIf",null==e.control?null:null==e.control.academicYear?null:null==e.control.academicYear.errors?null:e.control.academicYear.errors.required),D.Gb(12),D.yc("ngForOf",e.batches),D.Gb(1),D.yc("ngIf",null==e.control?null:null==e.control.batch?null:null==e.control.batch.errors?null:e.control.batch.errors.required),D.Gb(14),D.yc("ngIf",2==e.control.type.value),D.Gb(20),D.yc("ngForOf",e.createEmpSettingForm.get("days").controls),D.Gb(6),D.yc("ngIf",2==(null==e.control?null:null==e.control.type?null:e.control.type.value)&&e.permission.hasPermission(D.Ec(13,Sr),D.Ec(14,_r))),D.Gb(1),D.yc("ngIf",1==(null==e.control?null:null==e.control.type?null:e.control.type.value)&&e.permission.hasPermission(D.Ec(15,Sr),D.Ec(16,_r))),D.Gb(16),D.yc("ngIf",e.customizeList.length>0),D.Gb(1),D.yc("ngIf",0==e.customizeList.length))},directives:[W.a,a.j,L.a,L.f,B.a,L.c,n.D,n.u,n.k,N.c,N.a,q.b,q.e,Mt.a,n.t,n.i,r.n,r.o,It.b,It.a,n.e,p.p,q.a,n.l,Ot.a,R.b,n.c,d.d,d.a,xt.a],pipes:[r.y,m.a,m.c],styles:[".mat-form-field[_ngcontent-%COMP%]{width:100%}table[_ngcontent-%COMP%] .mat-form-field[_ngcontent-%COMP%]{width:80%}.batch-name[_ngcontent-%COMP%]{font-size:24px}mat-checkbox[_ngcontent-%COMP%]{margin-right:24px}.text-center[_ngcontent-%COMP%]{text-align:center!important}th[_ngcontent-%COMP%]{background:hsla(0,0%,50.2%,.30196078431372547)}table[_ngcontent-%COMP%]{width:100%;line-height:10px;border-color:hsla(0,0%,50.2%,.30196078431372547)}table[_ngcontent-%COMP%] .mat-form-field[_ngcontent-%COMP%]{width:60%;height:40px;text-align:center!important}.ml-0[_ngcontent-%COMP%]{margin-left:0!important}.delete-icon[_ngcontent-%COMP%]{border:1px solid red;border-radius:50%;background:red}.delete-icon[_ngcontent-%COMP%], .edit-icon[_ngcontent-%COMP%]{font-size:13px;line-height:20px;width:20px!important;height:20px!important;color:#fff;text-align:center}.edit-icon[_ngcontent-%COMP%]{border:1px solid #00f;border-radius:50%;background:#00f}.btn-dis[_ngcontent-%COMP%]:disabled, .btn-dis[disabled][_ngcontent-%COMP%]{border:1px solid #999!important;background-color:#ccc!important;color:#666!important}.mat-table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{color:#000}.emp_setting[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr.mat-row[_ngcontent-%COMP%]{height:65px!important}.customize_setting[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr.mat-row[_ngcontent-%COMP%]{height:45px!important}"]}),t})();function Ar(t,e){if(1&t&&(D.dc(0,"button",24),D.cd(1,"Edit"),D.cc()),2&t){const t=D.pc();D.yc("routerLink","/school/new-attendance-settings/employee/edit/"+t.groupId)}}function wr(t,e){1&t&&(D.dc(0,"button",24),D.cd(1,"Create"),D.cc()),2&t&&D.yc("routerLink","/school/new-attendance-settings/employee/create")}function Cr(t,e){1&t&&(D.dc(0,"label"),D.cd(1,"All"),D.cc())}function Fr(t,e){1&t&&(D.dc(0,"label"),D.cd(1,"Custom"),D.cc())}function Er(t,e){if(1&t&&(D.dc(0,"span"),D.cd(1),D.cc()),2&t){const t=e.$implicit,c=e.last;D.Gb(1),D.fd(" ",t,"",c?"":", "," ")}}function Pr(t,e){if(1&t&&(D.dc(0,"div",7),D.dc(1,"div",9),D.dc(2,"label"),D.dc(3,"strong"),D.cd(4,"Department"),D.cc(),D.cc(),D.cc(),D.dc(5,"div",10),D.dc(6,"label"),D.ad(7,Er,2,2,"span",25),D.cc(),D.cc(),D.cc()),2&t){const t=D.pc();D.Gb(7),D.yc("ngForOf",t.finalDept)}}function Gr(t,e){if(1&t&&(D.dc(0,"span"),D.cd(1),D.cc()),2&t){const t=e.$implicit,c=e.last;D.Gb(1),D.fd(" ",t,"",c?"":", "," ")}}function Yr(t,e){if(1&t&&(D.dc(0,"div",7),D.dc(1,"div",9),D.dc(2,"label"),D.dc(3,"strong"),D.cd(4,"Position"),D.cc(),D.cc(),D.cc(),D.dc(5,"div",10),D.dc(6,"label"),D.ad(7,Gr,2,2,"span",25),D.cc(),D.cc(),D.cc()),2&t){const t=D.pc();D.Gb(7),D.yc("ngForOf",t.finalPosition)}}function zr(t,e){if(1&t&&(D.dc(0,"tr",26),D.dc(1,"td",27),D.Yb(2,"mat-checkbox",28),D.cc(),D.dc(3,"td",27),D.cd(4),D.qc(5,"titlecase"),D.cc(),D.dc(6,"td",27),D.cd(7),D.qc(8,"displayTime"),D.cc(),D.dc(9,"td",27),D.cd(10),D.qc(11,"displayTime"),D.cc(),D.dc(12,"td",27),D.cd(13),D.qc(14,"displayTime"),D.cc(),D.dc(15,"td",27),D.cd(16),D.cc(),D.cc()),2&t){const t=e.$implicit;D.Gb(2),D.yc("disabled",!0)("checked",t.isWorkingDay)("value",t.isWorkingDay),D.Gb(2),D.dd(D.rc(5,8,t.day)),D.Gb(3),D.dd("--"==t.checkIn?"--":D.rc(8,10,t.checkIn)),D.Gb(3),D.dd("--"==t.checkOut?"--":D.rc(11,12,t.checkOut)),D.Gb(3),D.dd("--"==t.halfDayMarkTime?"--":D.rc(14,14,t.halfDayMarkTime)),D.Gb(3),D.dd(t.lateMarkMin)}}function Hr(t,e){if(1&t&&(D.dc(0,"tr",26),D.dc(1,"td",27),D.cd(2),D.qc(3,"displayDate"),D.cc(),D.dc(4,"td",27),D.cd(5),D.qc(6,"displayTime"),D.cc(),D.dc(7,"td",27),D.cd(8),D.qc(9,"displayTime"),D.cc(),D.dc(10,"td",27),D.cd(11),D.qc(12,"displayTime"),D.cc(),D.dc(13,"td",27),D.cd(14),D.cc(),D.cc()),2&t){const t=e.$implicit;D.Gb(2),D.dd(null!=t&&t.customizeDate?null==t?null:t.customizeDate:D.rc(3,5,"")),D.Gb(3),D.ed(" ",D.rc(6,7,null==t?null:t.checkIn)," "),D.Gb(3),D.ed(" ",D.rc(9,9,null==t?null:t.checkOut)," "),D.Gb(3),D.ed(" ",D.rc(12,11,null==t?null:t.halfDayMark)," "),D.Gb(3),D.ed(" ",null==t?null:t.lateMark," ")}}function jr(t,e){if(1&t&&(D.dc(0,"tbody"),D.ad(1,Hr,15,13,"tr",20),D.cc()),2&t){const t=D.pc();D.Gb(1),D.yc("ngForOf",t.customizeList)}}function Vr(t,e){1&t&&(D.dc(0,"tbody"),D.dc(1,"tr",26),D.dc(2,"td",29),D.dc(3,"strong"),D.cd(4,"No Data Found"),D.cc(),D.cc(),D.cc(),D.cc())}const Lr=function(){return["emp_attendance_setting"]},Br=function(){return["emp_attendance_setting_update"]},Nr=function(){return["emp_attendance_setting_create"]};function qr(t,e){if(1&t&&(D.dc(0,"button",24),D.cd(1,"Edit"),D.cc()),2&t){const t=D.pc();D.yc("routerLink","/school/new-attendance-settings/student/edit/"+t.groupId)}}function Rr(t,e){1&t&&(D.dc(0,"button",24),D.cd(1,"Create"),D.cc()),2&t&&D.yc("routerLink","/school/new-attendance-settings/student/create")}function Xr(t,e){1&t&&(D.dc(0,"label"),D.cd(1,"All"),D.cc())}function Wr(t,e){1&t&&(D.dc(0,"label"),D.cd(1,"Custom"),D.cc())}function $r(t,e){if(1&t&&(D.dc(0,"span"),D.cd(1),D.cc()),2&t){const t=e.$implicit,c=e.last;D.Gb(1),D.fd(" ",t,"",c?"":", "," ")}}function Ur(t,e){if(1&t&&(D.dc(0,"div",7),D.dc(1,"div",9),D.dc(2,"label"),D.dc(3,"strong"),D.cd(4,"Classes"),D.cc(),D.cc(),D.cc(),D.dc(5,"div",10),D.dc(6,"label"),D.ad(7,$r,2,2,"span",25),D.cc(),D.cc(),D.cc()),2&t){const t=D.pc();D.Gb(7),D.yc("ngForOf",t.class)}}function Jr(t,e){if(1&t&&(D.dc(0,"tr",26),D.dc(1,"td",27),D.Yb(2,"mat-checkbox",28),D.cc(),D.dc(3,"td",27),D.cd(4),D.qc(5,"titlecase"),D.cc(),D.dc(6,"td",27),D.cd(7),D.qc(8,"displayTime"),D.cc(),D.dc(9,"td",27),D.cd(10),D.qc(11,"displayTime"),D.cc(),D.dc(12,"td",27),D.cd(13),D.qc(14,"displayTime"),D.cc(),D.dc(15,"td",27),D.cd(16),D.cc(),D.cc()),2&t){const t=e.$implicit;D.Gb(2),D.yc("disabled",!0)("checked",t.isWorkingDay)("value",t.isWorkingDay),D.Gb(2),D.dd(D.rc(5,8,t.day)),D.Gb(3),D.dd("--"==t.checkIn?"--":D.rc(8,10,t.checkIn)),D.Gb(3),D.dd("--"==t.checkOut?"--":D.rc(11,12,t.checkOut)),D.Gb(3),D.dd("--"==t.halfDayMarkTime?"--":D.rc(14,14,t.halfDayMarkTime)),D.Gb(3),D.dd(t.lateMarkMin)}}function Kr(t,e){if(1&t&&(D.dc(0,"tr",26),D.dc(1,"td",27),D.cd(2),D.qc(3,"displayDate"),D.cc(),D.dc(4,"td",27),D.cd(5),D.qc(6,"displayTime"),D.cc(),D.dc(7,"td",27),D.cd(8),D.qc(9,"displayTime"),D.cc(),D.dc(10,"td",27),D.cd(11),D.qc(12,"displayTime"),D.cc(),D.dc(13,"td",27),D.cd(14),D.cc(),D.cc()),2&t){const t=e.$implicit;D.Gb(2),D.dd(null!=t&&t.customizeDate?null==t?null:t.customizeDate:D.rc(3,5,"")),D.Gb(3),D.ed(" ",D.rc(6,7,null==t?null:t.checkIn)," "),D.Gb(3),D.ed(" ",D.rc(9,9,null==t?null:t.checkOut)," "),D.Gb(3),D.ed(" ",D.rc(12,11,null==t?null:t.halfDayMark)," "),D.Gb(3),D.ed(" ",null==t?null:t.lateMark," ")}}function Qr(t,e){if(1&t&&(D.dc(0,"tbody"),D.ad(1,Kr,15,13,"tr",20),D.cc()),2&t){const t=D.pc();D.Gb(1),D.yc("ngForOf",t.customizeList)}}function Zr(t,e){1&t&&(D.dc(0,"tbody"),D.dc(1,"tr",26),D.dc(2,"td",29),D.dc(3,"strong"),D.cd(4,"No Data Found"),D.cc(),D.cc(),D.cc(),D.cc())}const tn=function(){return["stu_attendance_setting"]},en=function(){return["stu_attendance_setting_update"]},cn=function(){return["stu_attendance_setting_create"]},an=[{path:"",children:[{path:"employee/create",component:Qc,data:{title:"Create Employee Attendance Settings",breadcrumb:"Employee Attendance Settings / Create"}},{path:"employee/edit/:id",component:ae,data:{title:"Update Employee Attendance Settings",breadcrumb:"Employee Attendance Settings / Update"}},{path:"employee/list",component:je,data:{title:"Manage Employee Attendance Settings",breadcrumb:"Employee Attendance Settings / List"}},{path:"employee/customize",component:it,data:{title:"Update Employee Attendance Settings",breadcrumb:"Employee Attendance Settings / Update"}},{path:"employee/customize-edit",component:St,data:{title:"Update Employee Attendance Settings",breadcrumb:"Employee Attendance Settings / Update"}},{path:"employee/view/:id",component:(()=>{class t{constructor(t,e,c,a,r,n,i,o){this.dialog=t,this.fb=e,this.toaster=c,this.loader=a,this.router=r,this.activatedRoute=n,this.permission=i,this.modalService=o,this.selectedDepart=[],this.selectedPosition=[],this.staticDays=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],this.customizeList=[],this.routineArray=[],this.dayFormat=[{day:"Monday",dayId:1,isWorkingDay:0,checkIn:"--",checkOut:"--",halfDayMarkTime:"--",lateMarkMin:"--"},{day:"Tuesday",dayId:2,isWorkingDay:0,checkIn:"--",checkOut:"--",halfDayMarkTime:"--",lateMarkMin:"--"},{day:"Wednesday",dayId:3,isWorkingDay:0,checkIn:"--",checkOut:"--",halfDayMarkTime:"--",lateMarkMin:"--"},{day:"Thursday",dayId:4,isWorkingDay:0,checkIn:"--",checkOut:"--",halfDayMarkTime:"--",lateMarkMin:"--"},{day:"Friday",dayId:5,isWorkingDay:0,checkIn:"--",checkOut:"--",halfDayMarkTime:"--",lateMarkMin:"--"},{day:"Saturday",dayId:6,isWorkingDay:0,checkIn:"--",checkOut:"--",halfDayMarkTime:"--",lateMarkMin:"--"},{day:"Sunday",dayId:7,isWorkingDay:0,checkIn:"--",checkOut:"--",halfDayMarkTime:"--",lateMarkMin:"--"}],this.days=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],this.groupId=this.activatedRoute.snapshot.params.id,this.getDepartments(this.groupId),this.getPostions(this.groupId),this.getData(this.groupId),this.getCustomizeData(this.groupId)}ngOnInit(){}getCustomizeData(t){this.modalService.getEmpCustomizeList(t).subscribe(t=>{this.customizeList="success"==t.keyword?t.customizeList:[]})}getData(t){this.loader.open(),this.modalService.getOneEmpAttendacneRoutine(t).subscribe(t=>{"success"==t.keyword?(this.createdData=t.empList[0],this.responseData(),this.loader.close()):(this.toaster.present(t.message),this.loader.close())})}responseData(){var t,e,c,a;const r=this.selectedDepart.filter(t=>"all"==t.departmentId),n=this.selectedPosition.filter(t=>"all"==t.positionId);this.selectedDepart.length>0&&this.selectedPosition.length>0&&(r[0]&&n[0]?(this.type="1",this.setVar(null===(t=this.createdData)||void 0===t?void 0:t.routineList)):(this.type="2",this.finalDept=this.filterArray("name",null===(e=this.createdData)||void 0===e?void 0:e.department),this.finalPosition=this.filterArray("name",null===(c=this.createdData)||void 0===c?void 0:c.position),this.setVar(null===(a=this.createdData)||void 0===a?void 0:a.routineList)))}getDepartments(t){this.modalService.getDepartmentList(t).subscribe(t=>{if("success"==t.keyword){this.selectedDepart=t.selectedDept;let e=t.departments.filter(t=>"all"!==t.departmentId);this.departments=e,"1"!==this.type&&"2"!==this.type&&this.responseData()}else this.departments=[],this.selectedDepart=[]})}getPostions(t){this.modalService.getPositionList(t).subscribe(t=>{if("success"==t.keyword){this.selectedPosition=t.selectedPositions;let e=t.positions.filter(t=>"all"!==t.positionId);this.positions=e,"1"!==this.type&&"2"!==this.type&&this.responseData()}else this.positions=[],this.selectedPosition=[]})}filterArray(t,e){return Array.isArray(e)?e.map(e=>e[t]):e}setVar(t){if(t)for(let e of t){let t=this.dayFormat.findIndex(t=>t.dayId==e.dayId);this.dayFormat[t]=this.changeStructureObjForTracking(e)}}changeStructureObjForTracking(t){var e,c,a;return 1==t.isWorkingDay?{day:this.days[t.dayId-1],dayId:t.dayId,isWorkingDay:t.isWorkingDay,checkIn:(null===(e=t)||void 0===e?void 0:e.checkIn)?M(t.checkIn,"HH:mm").format("HH:mm"):"--",checkOut:(null===(c=t)||void 0===c?void 0:c.checkOut)?M(t.checkOut,"HH:mm").format("HH:mm"):"--",halfDayMarkTime:(null===(a=t)||void 0===a?void 0:a.halfDayMark)?M(t.halfDayMark,"HH:mm").format("HH:mm"):"--",lateMarkMin:t.lateMark?M(t.lateMark,"HH:mm:ss").diff(M().startOf("day"),"minutes").toString():"00"}:{day:this.days[t.dayId-1],dayId:t.dayId,isWorkingDay:t.isWorkingDay,checkIn:"--",checkOut:"--",halfDayMarkTime:"--",lateMarkMin:"--"}}}return t.\u0275fac=function(e){return new(e||t)(D.Xb(u.b),D.Xb(n.f),D.Xb(g.a),D.Xb(f.a),D.Xb(a.g),D.Xb(a.a),D.Xb(Dt.a),D.Xb(z))},t.\u0275cmp=D.Rb({type:t,selectors:[["app-view"]],decls:66,vars:14,consts:[[1,"create_btn"],["mat-raised-button","","color","primary","class","btn-primary-bg",3,"routerLink",4,"ngIf"],["href","#",1,"pl-12","primary-txt-color",3,"routerLink"],[1,"form_bg"],[1,"p-0"],[1,""],[1,"card-title-text"],["fxLayout","row wrap",1,"mt-0"],["fxFlex","100","fxFlex.gt-xs","50",1,"mt-12"],["fxFlex","100","fxFlex.gt-xs","30",1,"mt-12"],["fxFlex","100","fxFlex.gt-xs","70",1,"mt-12"],[4,"ngIf"],["fxLayout","row wrap","class","mt-0",4,"ngIf"],[1,"mt-24"],["border","1","cellspacing","0",1,"mat-table","mt-12","emp_setting"],[1,"mat-header-row"],["rowspan","2",1,"mat-header-cell","text-center","pt-3",2,"width","10%"],["colspan","2",1,"mat-header-cell","text-center","pt-3",2,"width","10%"],["rowspan","2",1,"mat-header-cell","text-center",2,"width","10%"],[1,"mat-header-cell","text-center","pt-3",2,"width","10%"],["class","mat-row",4,"ngFor","ngForOf"],[1,"create_btn","mt-40"],["border","1","cellspacing","0",1,"mat-table","mt-12"],[1,"mat-header-cell","text-center",2,"width","10%"],["mat-raised-button","","color","primary",1,"btn-primary-bg",3,"routerLink"],[4,"ngFor","ngForOf"],[1,"mat-row"],[1,"mat-cell","text-center"],[3,"disabled","checked","value"],["colspan","6",1,"mat-cell","text-center"]],template:function(t,e){1&t&&(D.dc(0,"div",0),D.ad(1,Ar,2,1,"button",1),D.ad(2,wr,2,1,"button",1),D.dc(3,"a",2),D.cd(4,"Discard"),D.cc(),D.cc(),D.dc(5,"div",3),D.dc(6,"mat-card",4),D.dc(7,"mat-card-title",5),D.dc(8,"div",6),D.cd(9,"View Employee Attendance Settings"),D.cc(),D.Yb(10,"mat-divider"),D.cc(),D.dc(11,"mat-card-content"),D.dc(12,"div",7),D.dc(13,"div",8),D.dc(14,"div",7),D.dc(15,"div",9),D.dc(16,"label"),D.dc(17,"strong"),D.cd(18,"Type"),D.cc(),D.cc(),D.cc(),D.dc(19,"div",10),D.ad(20,Cr,2,0,"label",11),D.ad(21,Fr,2,0,"label",11),D.cc(),D.cc(),D.ad(22,Pr,8,1,"div",12),D.ad(23,Yr,8,1,"div",12),D.cc(),D.cc(),D.Yb(24,"mat-divider",13),D.Yb(25,"br"),D.dc(26,"table",14),D.dc(27,"thead"),D.dc(28,"tr",15),D.dc(29,"th",16),D.cd(30,"Is Working Day?"),D.cc(),D.dc(31,"th",16),D.cd(32,"Schools opens On"),D.cc(),D.dc(33,"th",17),D.cd(34,"Check"),D.cc(),D.dc(35,"th",18),D.cd(36,"Half Day Mark Time"),D.cc(),D.dc(37,"th",16),D.cd(38,"Late Mark After(Mins) "),D.cc(),D.cc(),D.dc(39,"tr",15),D.dc(40,"th",19),D.cd(41,"In"),D.cc(),D.dc(42,"th",19),D.cd(43,"Out"),D.cc(),D.cc(),D.cc(),D.dc(44,"tbody"),D.ad(45,zr,17,16,"tr",20),D.cc(),D.cc(),D.Yb(46,"mat-divider",13),D.dc(47,"div",21),D.dc(48,"h3"),D.dc(49,"strong"),D.cd(50,"Customize Date"),D.cc(),D.cc(),D.cc(),D.dc(51,"table",22),D.dc(52,"thead"),D.dc(53,"tr",15),D.dc(54,"th",19),D.cd(55,"Date"),D.cc(),D.dc(56,"th",19),D.cd(57,"Check In"),D.cc(),D.dc(58,"th",19),D.cd(59,"Check Out"),D.cc(),D.dc(60,"th",23),D.cd(61,"Half Day Mark Time"),D.cc(),D.dc(62,"th",19),D.cd(63,"Late Mark After(Mins)"),D.cc(),D.cc(),D.cc(),D.ad(64,jr,2,1,"tbody",11),D.ad(65,Vr,5,0,"tbody",11),D.cc(),D.cc(),D.cc(),D.cc()),2&t&&(D.Gb(1),D.yc("ngIf",e.permission.hasPermission(D.Ec(10,Lr),D.Ec(11,Br))),D.Gb(1),D.yc("ngIf",e.permission.hasPermission(D.Ec(12,Lr),D.Ec(13,Nr))),D.Gb(1),D.yc("routerLink","/school/new-attendance-settings/employee/list"),D.Gb(17),D.yc("ngIf","1"==e.type),D.Gb(1),D.yc("ngIf","2"==e.type),D.Gb(1),D.yc("ngIf","2"==e.type),D.Gb(1),D.yc("ngIf","2"==e.type),D.Gb(22),D.yc("ngForOf",e.dayFormat),D.Gb(19),D.yc("ngIf",e.customizeList.length>0),D.Gb(1),D.yc("ngIf",0==e.customizeList.length))},directives:[r.o,a.j,L.a,L.f,B.a,L.c,N.c,N.a,r.n,W.a,a.h,Ot.a],pipes:[r.y,m.c,m.a],styles:[".mat-form-field[_ngcontent-%COMP%]{width:100%}table[_ngcontent-%COMP%] .mat-form-field[_ngcontent-%COMP%]{width:80%}.batch-name[_ngcontent-%COMP%]{font-size:24px}mat-checkbox[_ngcontent-%COMP%]{margin-right:24px}.text-center[_ngcontent-%COMP%]{text-align:center!important}th[_ngcontent-%COMP%]{background:hsla(0,0%,50.2%,.30196078431372547)}table[_ngcontent-%COMP%]{width:100%;line-height:10px;border-color:hsla(0,0%,50.2%,.30196078431372547)}table[_ngcontent-%COMP%] .mat-form-field[_ngcontent-%COMP%]{width:60%;height:40px;text-align:center!important}.ml-0[_ngcontent-%COMP%]{margin-left:0!important}.delete-icon[_ngcontent-%COMP%]{border:1px solid red;border-radius:50%;background:red}.delete-icon[_ngcontent-%COMP%], .edit-icon[_ngcontent-%COMP%]{font-size:13px;line-height:20px;width:20px!important;height:20px!important;color:#fff;text-align:center}.edit-icon[_ngcontent-%COMP%]{border:1px solid #00f;border-radius:50%;background:#00f}.btn-dis[_ngcontent-%COMP%]:disabled, .btn-dis[disabled][_ngcontent-%COMP%]{border:1px solid #999!important;background-color:#ccc!important;color:#666!important}.mat-table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{color:#000}.mat-table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr.mat-row[_ngcontent-%COMP%]{height:45px!important}"]}),t})(),data:{title:"View Employee Attendance Settings",breadcrumb:"Employee Attendance Settings / View"}},{path:"student/list",component:Fc,data:{title:"Manage Student Attendance Settings",breadcrumb:"Student Attendance Settings / List"}},{path:"student/create",component:Ya,data:{title:"Create Student Attendance Settings",breadcrumb:"Student Attendance Settings / Create"}},{path:"student/edit/:id",component:Tr,data:{title:"Update Student Attendance Settings",breadcrumb:"Student Attendance Settings / Update"}},{path:"student/view/:id",component:(()=>{class t{constructor(t,e,c,a,r,n,i,o,l,s){this.dialog=t,this.fb=e,this.toaster=c,this.loader=a,this.router=r,this.academicYearService=n,this.batchService=i,this.activatedRoute=o,this.permission=l,this.modalService=s,this.staticDays=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],this.customizeList=[],this.routineArray=[],this.dayFormat=[{day:"Monday",dayId:1,isWorkingDay:0,checkIn:"--",checkOut:"--",halfDayMarkTime:"--",lateMarkMin:"--"},{day:"Tuesday",dayId:2,isWorkingDay:0,checkIn:"--",checkOut:"--",halfDayMarkTime:"--",lateMarkMin:"--"},{day:"Wednesday",dayId:3,isWorkingDay:0,checkIn:"--",checkOut:"--",halfDayMarkTime:"--",lateMarkMin:"--"},{day:"Thursday",dayId:4,isWorkingDay:0,checkIn:"--",checkOut:"--",halfDayMarkTime:"--",lateMarkMin:"--"},{day:"Friday",dayId:5,isWorkingDay:0,checkIn:"--",checkOut:"--",halfDayMarkTime:"--",lateMarkMin:"--"},{day:"Saturday",dayId:6,isWorkingDay:0,checkIn:"--",checkOut:"--",halfDayMarkTime:"--",lateMarkMin:"--"},{day:"Sunday",dayId:7,isWorkingDay:0,checkIn:"--",checkOut:"--",halfDayMarkTime:"--",lateMarkMin:"--"}],this.days=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],this.groupId=this.activatedRoute.snapshot.params.id,this.getData(this.groupId),this.getCustomizeData(this.groupId)}ngOnInit(){}getCustomizeData(t){this.modalService.getStudentCustomizeList(t).subscribe(t=>{this.customizeList="success"==t.keyword?t.customizeList:[]})}getData(t){this.loader.open(),this.modalService.getOneStudentAttendacneRoutine(t).subscribe(t=>{"success"==t.keyword?(this.loader.close(),this.createdData=t.attendList[0],this.getClass(this.createdData.batchId,!0)):(this.toaster.present(t.message),this.loader.close())})}getClass(t,e){this.loader.open(),this.modalService.getClassByBatchId(t,this.groupId).subscribe(t=>{if("success"==t.keyword){let e=t.classes.filter(t=>"all"!==t.classId);this.classes=e,this.selectedClass=t.selectedClass,this.responseData(this.selectedClass),this.loader.close()}else this.classes=[],this.responseData(this.selectedClass),this.loader.close()})}responseData(t){var e,c,a;this.loader.dialogRef&&this.loader.close();const r=t.filter(t=>"all"==t.classId);this.selectedClass.length>0&&(r[0]?(this.type="1",this.setVar(null===(e=this.createdData)||void 0===e?void 0:e.routineList)):(this.type="2",this.class=this.filterArray("class_name",null===(c=this.createdData)||void 0===c?void 0:c.class),this.setVar(null===(a=this.createdData)||void 0===a?void 0:a.routineList)))}filterArray(t,e){return Array.isArray(e)?e.map(e=>e[t]):e}setVar(t){if(t)for(let e of t){let t=this.dayFormat.findIndex(t=>t.dayId==e.dayId);this.dayFormat[t]=this.changeStructureObjForTracking(e)}}changeStructureObjForTracking(t){var e,c,a;return 1==t.isWorkingDay?{day:this.days[t.dayId-1],dayId:t.dayId,isWorkingDay:t.isWorkingDay,checkIn:(null===(e=t)||void 0===e?void 0:e.checkIn)?M(t.checkIn,"HH:mm").format("HH:mm"):"--",checkOut:(null===(c=t)||void 0===c?void 0:c.checkOut)?M(t.checkOut,"HH:mm").format("HH:mm"):"--",halfDayMarkTime:(null===(a=t)||void 0===a?void 0:a.halfDayMark)?M(t.halfDayMark,"HH:mm").format("HH:mm"):"--",lateMarkMin:t.lateMark?M(t.lateMark,"HH:mm:ss").diff(M().startOf("day"),"minutes").toString():"00"}:{day:this.days[t.dayId-1],dayId:t.dayId,isWorkingDay:t.isWorkingDay,checkIn:"--",checkOut:"--",halfDayMarkTime:"--",lateMarkMin:"--"}}}return t.\u0275fac=function(e){return new(e||t)(D.Xb(u.b),D.Xb(n.f),D.Xb(g.a),D.Xb(f.a),D.Xb(a.g),D.Xb(ma.a),D.Xb(pa.a),D.Xb(a.a),D.Xb(Dt.a),D.Xb(cc))},t.\u0275cmp=D.Rb({type:t,selectors:[["app-view"]],decls:81,vars:15,consts:[[1,"create_btn"],["mat-raised-button","","color","primary","class","btn-primary-bg",3,"routerLink",4,"ngIf"],["href","#",1,"pl-12","primary-txt-color",3,"routerLink"],[1,"form_bg"],[1,"p-0"],[1,""],[1,"card-title-text"],["fxLayout","row wrap",1,"mt-0"],["fxFlex","100","fxFlex.gt-xs","50",1,"mt-12"],["fxFlex","100","fxFlex.gt-xs","30",1,"mt-12"],["fxFlex","100","fxFlex.gt-xs","70",1,"mt-12"],[4,"ngIf"],["fxLayout","row wrap","class","mt-0",4,"ngIf"],[1,"mt-24"],["border","1","cellspacing","0",1,"mat-table","mt-12","emp_setting"],[1,"mat-header-row"],["rowspan","2",1,"mat-header-cell","text-center","pt-3",2,"width","10%"],["colspan","2",1,"mat-header-cell","text-center","pt-3",2,"width","10%"],["rowspan","2",1,"mat-header-cell","text-center",2,"width","10%"],[1,"mat-header-cell","text-center","pt-3",2,"width","10%"],["class","mat-row",4,"ngFor","ngForOf"],[1,"create_btn","mt-40"],["border","1","cellspacing","0",1,"mat-table","mt-12"],[1,"mat-header-cell","text-center",2,"width","10%"],["mat-raised-button","","color","primary",1,"btn-primary-bg",3,"routerLink"],[4,"ngFor","ngForOf"],[1,"mat-row"],[1,"mat-cell","text-center"],[3,"disabled","checked","value"],["colspan","6",1,"mat-cell","text-center"]],template:function(t,e){1&t&&(D.dc(0,"div",0),D.ad(1,qr,2,1,"button",1),D.ad(2,Rr,2,1,"button",1),D.dc(3,"a",2),D.cd(4,"Discard"),D.cc(),D.cc(),D.dc(5,"div",3),D.dc(6,"mat-card",4),D.dc(7,"mat-card-title",5),D.dc(8,"div",6),D.cd(9,"View Student Attendance Settings"),D.cc(),D.Yb(10,"mat-divider"),D.cc(),D.dc(11,"mat-card-content"),D.dc(12,"div",7),D.dc(13,"div",8),D.dc(14,"div",7),D.dc(15,"div",9),D.dc(16,"label"),D.dc(17,"strong"),D.cd(18,"Academic Year"),D.cc(),D.cc(),D.cc(),D.dc(19,"div",10),D.dc(20,"label"),D.cd(21),D.cc(),D.cc(),D.cc(),D.dc(22,"div",7),D.dc(23,"div",9),D.dc(24,"label"),D.dc(25,"strong"),D.cd(26,"Batch"),D.cc(),D.cc(),D.cc(),D.dc(27,"div",10),D.dc(28,"label"),D.cd(29),D.cc(),D.cc(),D.cc(),D.dc(30,"div",7),D.dc(31,"div",9),D.dc(32,"label"),D.dc(33,"strong"),D.cd(34,"Type"),D.cc(),D.cc(),D.cc(),D.dc(35,"div",10),D.ad(36,Xr,2,0,"label",11),D.ad(37,Wr,2,0,"label",11),D.cc(),D.cc(),D.ad(38,Ur,8,1,"div",12),D.cc(),D.cc(),D.Yb(39,"mat-divider",13),D.Yb(40,"br"),D.dc(41,"table",14),D.dc(42,"thead"),D.dc(43,"tr",15),D.dc(44,"th",16),D.cd(45,"Is Working Day?"),D.cc(),D.dc(46,"th",16),D.cd(47,"Schools opens On"),D.cc(),D.dc(48,"th",17),D.cd(49,"Check"),D.cc(),D.dc(50,"th",18),D.cd(51,"Half Day Mark Time"),D.cc(),D.dc(52,"th",16),D.cd(53,"Late Mark After(Mins) "),D.cc(),D.cc(),D.dc(54,"tr",15),D.dc(55,"th",19),D.cd(56,"In"),D.cc(),D.dc(57,"th",19),D.cd(58,"Out"),D.cc(),D.cc(),D.cc(),D.dc(59,"tbody"),D.ad(60,Jr,17,16,"tr",20),D.cc(),D.cc(),D.Yb(61,"mat-divider",13),D.dc(62,"div",21),D.dc(63,"h3"),D.dc(64,"strong"),D.cd(65,"Customize Date"),D.cc(),D.cc(),D.cc(),D.dc(66,"table",22),D.dc(67,"thead"),D.dc(68,"tr",15),D.dc(69,"th",19),D.cd(70,"Date"),D.cc(),D.dc(71,"th",19),D.cd(72,"Check In"),D.cc(),D.dc(73,"th",19),D.cd(74,"Check Out"),D.cc(),D.dc(75,"th",23),D.cd(76,"Half Day Mark Time"),D.cc(),D.dc(77,"th",19),D.cd(78,"Late Mark After(Mins)"),D.cc(),D.cc(),D.cc(),D.ad(79,Qr,2,1,"tbody",11),D.ad(80,Zr,5,0,"tbody",11),D.cc(),D.cc(),D.cc(),D.cc()),2&t&&(D.Gb(1),D.yc("ngIf",e.permission.hasPermission(D.Ec(11,tn),D.Ec(12,en))),D.Gb(1),D.yc("ngIf",e.permission.hasPermission(D.Ec(13,tn),D.Ec(14,cn))),D.Gb(1),D.yc("routerLink","/school/new-attendance-settings/student/list"),D.Gb(18),D.dd(null==e.createdData?null:e.createdData.academicYearName),D.Gb(8),D.dd(null==e.createdData?null:e.createdData.batchName),D.Gb(7),D.yc("ngIf","1"==e.type),D.Gb(1),D.yc("ngIf","2"==e.type),D.Gb(1),D.yc("ngIf","2"==e.type),D.Gb(22),D.yc("ngForOf",e.dayFormat),D.Gb(19),D.yc("ngIf",e.customizeList.length>0),D.Gb(1),D.yc("ngIf",0==e.customizeList.length))},directives:[r.o,a.j,L.a,L.f,B.a,L.c,N.c,N.a,r.n,W.a,a.h,Ot.a],pipes:[r.y,m.c,m.a],styles:[".mat-form-field[_ngcontent-%COMP%]{width:100%}table[_ngcontent-%COMP%] .mat-form-field[_ngcontent-%COMP%]{width:80%}.batch-name[_ngcontent-%COMP%]{font-size:24px}mat-checkbox[_ngcontent-%COMP%]{margin-right:24px}.text-center[_ngcontent-%COMP%]{text-align:center!important}th[_ngcontent-%COMP%]{background:hsla(0,0%,50.2%,.30196078431372547)}table[_ngcontent-%COMP%]{width:100%;line-height:10px;border-color:hsla(0,0%,50.2%,.30196078431372547)}table[_ngcontent-%COMP%] .mat-form-field[_ngcontent-%COMP%]{width:60%;height:40px;text-align:center!important}.ml-0[_ngcontent-%COMP%]{margin-left:0!important}.delete-icon[_ngcontent-%COMP%]{border:1px solid red;border-radius:50%;background:red}.delete-icon[_ngcontent-%COMP%], .edit-icon[_ngcontent-%COMP%]{font-size:13px;line-height:20px;width:20px!important;height:20px!important;color:#fff;text-align:center}.edit-icon[_ngcontent-%COMP%]{border:1px solid #00f;border-radius:50%;background:#00f}.btn-dis[_ngcontent-%COMP%]:disabled, .btn-dis[disabled][_ngcontent-%COMP%]{border:1px solid #999!important;background-color:#ccc!important;color:#666!important}.mat-table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{color:#000}.mat-table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr.mat-row[_ngcontent-%COMP%]{height:45px!important}"]}),t})(),data:{title:"View Student Attendance Settings",breadcrumb:"Student Attendance Settings / View"}},{path:"student/customize",component:ua,data:{title:"Update Student Attendance Settings",breadcrumb:"Student Attendance Settings / Update"}},{path:"student/customize-edit",component:Ua,data:{title:"Update Student Attendance Settings",breadcrumb:"Student Attendance Settings / Update"}}]}];var rn=c("zMWy"),nn=c("aYsj");c.d(e,"AppNewAttendancesettingModule",(function(){return on}));let on=(()=>{class t{}return t.\u0275mod=D.Vb({type:t}),t.\u0275inj=D.Ub({factory:function(e){return new(e||t)},imports:[[r.c,n.m,n.z,i.a,rn.a,o.b,l.a,s.a,d.b,nn.a,a.k.forChild(an)]]}),t})()},"zB/H":function(t,e,c){"use strict";var a=c("mbIT"),r=c("GMZp"),n=c("pshJ"),i=c("LBXl");function o(t){return t.reduce((function(t,e){return t.concat(e instanceof i.UnsubscriptionError?e.errors:e)}),[])}e.Subscription=function(){function t(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._unsubscribe=t)}var e;return t.prototype.unsubscribe=function(){var e;if(!this.closed){var c=this._parentOrParents,l=this._unsubscribe,s=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,c instanceof t)c.remove(this);else if(null!==c)for(var d=0;d<c.length;++d)c[d].remove(this);if(n.isFunction(l))try{l.call(this)}catch(p){e=p instanceof i.UnsubscriptionError?o(p.errors):[p]}if(a.isArray(s)){d=-1;for(var u=s.length;++d<u;){var m=s[d];if(r.isObject(m))try{m.unsubscribe()}catch(p){e=e||[],p instanceof i.UnsubscriptionError?e=e.concat(o(p.errors)):e.push(p)}}}if(e)throw new i.UnsubscriptionError(e)}},t.prototype.add=function(e){var c=e;if(!e)return t.EMPTY;switch(typeof e){case"function":c=new t(e);case"object":if(c===this||c.closed||"function"!=typeof c.unsubscribe)return c;if(this.closed)return c.unsubscribe(),c;if(!(c instanceof t)){var a=c;(c=new t)._subscriptions=[a]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var r=c._parentOrParents;if(null===r)c._parentOrParents=this;else if(r instanceof t){if(r===this)return c;c._parentOrParents=[r,this]}else{if(-1!==r.indexOf(this))return c;r.push(this)}var n=this._subscriptions;return null===n?this._subscriptions=[c]:n.push(c),c},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var c=e.indexOf(t);-1!==c&&e.splice(c,1)}},t.EMPTY=((e=new t).closed=!0,e),t}()}}]);
/var/www/krbed.in/../../www/../www/html/../school_portal_admin/51-es2015.0e9bf7d4352d82b4fa33.js