1import{a as N}from"./chunk-J7NG55KZ.js";import{a as Je,b as Ze,c as et}from"./chunk-EHRUXARM.js";import"./chunk-C342R6R4.js";import{d as Ue,e as $e,h as ze}from"./chunk-V5KJRP2K.js";import"./chunk-57S6Q36M.js";import"./chunk-QEGAIP75.js";import{a as Ee}from"./chunk-JYWN7MLM.js";import"./chunk-OBZIPSN4.js";import{a as Xe}from"./chunk-EEGLZW5Y.js";import{h as Qe}from"./chunk-4XHWYO6A.js";import"./chunk-JAVXKLPM.js";import"./chunk-A7DVSW7U.js";import{a as ee}from"./chunk-3KJJR4PR.js";import"./chunk-ABAWT23C.js";import"./chunk-IWOLENFE.js";import"./chunk-UWQZ6LHD.js";import{a as O}from"./chunk-7FBSWJHX.js";import{b as Ke}from"./chunk-4DJXF7UW.js";import{a as te}from"./chunk-NDDBMTF2.js";import"./chunk-PP6OKG4J.js";import{b as q}from"./chunk-OOXBIU4P.js";import{f as Z,g as R,m as We}from"./chunk-RAZ6272N.js";import{c as P}from"./chunk-D6CDOXMU.js";import{a as ge}from"./chunk-Q5YFQ62E.js";import"./chunk-Y7PLHQ6M.js";import{a as ve,e as qe}from"./chunk-QNJ3LBLE.js";import"./chunk-3R646RNR.js";import{d as $,e as z,f as He}from"./chunk-PLPK6HII.js";import{G as Be,H as Ge,b as Ye,c as Fe,g as H,l as U,n as Pe,y as Re,z as Ne}from"./chunk-UFCZWRLF.js";import{a as W}from"./chunk-7Q5L7ALI.js";import"./chunk-CARY4E7O.js";import"./chunk-2PT6A6VZ.js";import{$ as le,Ac as ke,Bc as F,Cc as V,Hb as X,Ib as a,Ja as l,Jb as h,Ka as b,Kb as I,Lb as L,Nc as ue,Rc as Ae,Sb as S,Tb as C,Ub as x,Va as g,Xb as Y,_a as s,ab as G,ec as de,fa as A,ga as ce,gc as pe,gd as Ce,hd as Oe,id as Le,jc as me,jd as J,kb as n,kd as Ve,lb as i,mb as y,md as xe,na as v,nb as D,oa as _,ob as j,qb as T,ub as f,va as se,wb as u,zb as ne}from"./chunk-32W73H3G.js";import{a as oe,b as Se}from"./chunk-WWX6BADO.js";function mt(r,d){r&1&&(n(0,"li",4)(1,"a",9),y(2,"i",10),a(3,"Elective Subject Report"),i()())}function ut(r,d){r&1&&(n(0,"li",4)(1,"a",11),y(2,"i",10),a(3,"Elective Subject Department Report"),i()())}function gt(r,d){r&1&&(n(0,"li",4)(1,"a",12),y(2,"i",13),a(3,"Elective Count Manage"),i()())}var he=(()=>{class r{userService;title="electiveSubject";currentUser;constructor(e){this.userService=e}ngOnInit(){this.getCurrentUser()}getCurrentUser(){this.userService.getCurrentUser().then(e=>{this.currentUser=e})}static \u0275fac=function(o){return new(o||r)(b(P))};static \u0275cmp=A({type:r,selectors:[["app-root"]],decls:14,vars:3,consts:[[1,"container"],[1,"row","mt-3"],[1,"col-12"],[1,"nav","nav-tabs"],[1,"nav-item"],["aria-current","page","routerLink","home","routerLinkActive","active",1,"nav-link"],["aria-hidden","true",1,"fa","fa-home","me-2"],["class","nav-item",4,"ngIf"],[1,"row"],["aria-current","page","routerLink","subjectReport","routerLinkActive","active",1,"nav-link"],["aria-hidden","true",1,"fa","fa-book","me-2"],["aria-current","page","routerLink","subjectDepartmentReport","routerLinkActive","active",1,"nav-link"],["aria-current","page","routerLink","electiveCountManage","routerLinkActive","active",1,"nav-link"],["aria-hidden","true",1,"fa","fa-sliders-h","me-2"]],template:function(o,t){o&1&&(n(0,"div",0)(1,"div",1)(2,"div",2)(3,"ul",3)(4,"li",4)(5,"a",5),y(6,"i",6),a(7,"Home"),i()(),g(8,mt,4,0,"li",7)(9,ut,4,0,"li",7)(10,gt,4,0,"li",7),i()()(),n(11,"div",8)(12,"div",2),y(13,"router-outlet"),i()()()),o&2&&(l(8),s("ngIf",t.currentUser.userType=="HOD"),l(),s("ngIf",t.currentUser.userType=="HOD"),l(),s("ngIf",t.currentUser.userType=="HOD"||t.currentUser.userType=="ADMIN"))},dependencies:[Oe,J,Ve,V]})}return r})();function vt(r,d){if(r&1&&(n(0,"div",5)(1,"div",6)(2,"div",7)(3,"table",8)(4,"tbody")(5,"tr"),D(6),n(7,"td")(8,"label"),a(9,"Total Subject Limit "),i()(),n(10,"td"),a(11),i(),j(),i(),n(12,"tr"),D(13),n(14,"td")(15,"label"),a(16,"Total Department Limit "),i()(),n(17,"td"),a(18),i(),j(),i(),n(19,"tr"),D(20),n(21,"td")(22,"label"),a(23,"Total Group Limit "),i()(),n(24,"td"),a(25),i(),j(),i(),n(26,"tr"),D(27),n(28,"td")(29,"label"),a(30,"Current Subject Availablity "),i()(),n(31,"td"),a(32),i(),j(),i(),n(33,"tr"),D(34),n(35,"td")(36,"label"),a(37,"Current Department Availablity "),i()(),n(38,"td"),a(39),i(),j(),i(),n(40,"tr"),D(41),n(42,"td")(43,"label"),a(44,"Current Group Availablity "),i()(),n(45,"td"),a(46),i(),j(),i()()()()()()),r&2){let e=u();l(11),I(" ",e.electiveSubjectsCount.electiveCount," "),l(7),I(" ",e.electiveSubjectsCount.totalIndividualDepartmentCount," "),l(7),I(" ",e.electiveSubjectsCount.totalIndividualGroupCount," "),l(7),I(" ",e.electiveSubjectsCount.subjectElligibleCount," "),l(7),I(" ",e.electiveSubjectsCount.subjectDepartmentCount," "),l(7),I(" ",e.electiveSubjectsCount.subjectGroupCount," ")}}var it=(()=>{class r{route;subjectService;modalService;accyearService;value;electiveSubjectsCount;accyear;accyearId;constructor(e,o,t,c){this.route=e,this.subjectService=o,this.modalService=t,this.accyearService=c}ngOnInit(){this.getElectiveCount(this.value)}
1getElectiveCount(e){this.subjectService.getElectiveCount(e.count.id,e.studentId).then(o=>{this.electiveSubjectsCount=o})}close(){this.route.close()}static \u0275fac=function(o){return new(o||r)(b(Z),b(O),b(R),b(ee))};static \u0275cmp=A({type:r,selectors:[["app-elective-count-view-popup"]],inputs:{value:"value"},decls:6,vars:1,consts:[[1,"container"],[1,"modal-header","my-0"],[1,"fs-6","fw-semibold"],["type","button","data-backdrop","static","data-bs-dismiss","modal","aria-label","Close",1,"btn-close",3,"click"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-12"],[1,"table-responsive"],[1,"table","table-bordered","jack_table"]],template:function(o,t){o&1&&(n(0,"div",0)(1,"div",1)(2,"span",2),a(3,"Apply Students Elective Count"),i(),n(4,"button",3),f("click",function(){return t.close()}),i()(),g(5,vt,47,6,"div",4),i()),o&2&&(l(5),s("ngIf",t.electiveSubjectsCount!=null))},dependencies:[V]})}return r})();function _t(r,d){if(r&1&&(n(0,"td"),a(1),i()),r&2){let e=u().$implicit;l(),h(e.deptName)}}function ht(r,d){r&1&&(n(0,"span"),y(1,"i",22),a(2,"Apply "),i())}function ft(r,d){r&1&&(n(0,"span"),y(1,"span",23),a(2," Applying... "),i())}function bt(r,d){if(r&1){let e=T();n(0,"tbody")(1,"tr"),D(2),n(3,"td"),a(4),i(),n(5,"td"),a(6),i(),g(7,_t,2,1,"td",12),n(8,"td")(9,"div",13)(10,"div",14)(11,"small",15),a(12,"Total Seats:"),i(),n(13,"span",16),a(14),i()(),n(15,"div",14)(16,"small",15),a(17,"Group Available:"),i(),n(18,"span",17),a(19),i()()(),n(20,"div",18)(21,"button",19),f("click",function(){let t=v(e).$implicit,c=u(2);return _(c.applySubjects(t))}),g(22,ht,3,0,"span",12)(23,ft,3,0,"span",12),i(),n(24,"a",20),f("click",function(){let t=v(e).$implicit,c=u(2);return _(c.getElectiveCount(t))}),y(25,"i",21),a(26,"Details "),i()()(),j(),i()()}if(r&2){let e=d.$implicit,o=u(2);l(4),I("",e.subjectName," "),l(2),h(e.batchName),l(),s("ngIf",e.deptName!=null),l(7),h(e.electiveCount||0),l(4),s("ngClass",e.subjectGroupCount>0?"text-success":"text-danger"),l(),I(" ",e.subjectGroupCount||0," "),l(2),G("btn-success",e.subjectGroupCount>0)("btn-secondary",e.subjectGroupCount<=0),s("disabled",e.subjectGroupCount<=0||o.loadingSubjectId===e.id),l(),s("ngIf",o.loadingSubjectId!==e.id),l(),s("ngIf",o.loadingSubjectId===e.id)}}function yt(r,d){if(r&1&&(n(0,"div",6)(1,"div",7)(2,"div",8)(3,"table",9)(4,"thead")(5,"tr")(6,"th",10),a(7,"Subject"),i(),n(8,"th",10),a(9,"Batch"),i(),n(10,"th",10),a(11,"Degree & Dept"),i(),n(12,"th",10),a(13,"No Of Seats Available"),i()()(),g(14,bt,27,13,"tbody",11),i()()()()),r&2){let e=u();l(14),s("ngForOf",e.electiveSubjectsDashboard)}}function St(r,d){r&1&&(n(0,"div",24),y(1,"div",7),n(2,"div",25),a(3," No Elective Subjects "),i()())}var nt=(()=>{class r{route;subjectService;modalService;toast;value;eleId;eleName;reload=new se;electiveSubjectsDashboard;electiveSubjectsDashboard1=[];subInvitedDepts;deptId;applySubject;userId;updatedSubject;electiveCountView;loadingSubjectId=null;constructor(e,o,t,c){this.route=e,this.subjectService=o,this.modalService=t,this.toast=c}ngOnInit(){this.getStudentElective(this.value,this.eleId)}getStudentElective(e,o){console.log(o),this.subjectService.getStudentElective(e,o).then(t=>{this.electiveSubjectsDashboard=t,console.log(this.electiveSubjectsDashboard);for(var c=0;c<this.electiveSubjectsDashboard.length;c++)if(this.electiveSubjectsDashboard[c].invitedDepartments!=null&&this.electiveSubjectsDashboard[c].invitedDepartments.length!=0){this.subInvitedDepts=this.electiveSubjectsDashboard[c].invitedDepartments;for(var p=0;p<this.subInvitedDepts.length;p++)this.subInvitedDepts[p].department!=null&&(this.electiveSubjectsDashboard[c].deptName=this.subInvitedDepts[p].department)}})}getElectiveCount(e){this.electiveCountView={count:e,studentId:this.value.id};let o=this.modalService.open(it,{size:"md",backdrop:"static"});o.componentInstance.value=this.electiveCountView}applySubjects(e){if((e.subjectElligibleCount!=null?e.subjectElligibleCount:-1)===0){this.toast.warning("Applied count Over \u2014 no seats left for this subject","Cannot Apply");return}if(e.subjectGroupCount==0){this.toast.warning("No seats available for your group","Cannot Apply");return}this.userId=[],this.loadingSubjectId=e.id,e!=null?this.subjectService.getElectiveCount(e.id,this.value.id).then(t=>{this.applySubject=t;let c={id:e.id};this.subjectService.electiveApplyFast(this.value.id,c).then(p=>{this.updatedSubject=p,this.loadingSubjectId=null,this.updatedSubject=="Success"?(this.toast.success("Student Applied Successfully"),this.reload.emit(),this.route.close()):this.toast.error(this.updatedSubject,"Error",{timeOut:3e3})})}):alert("Subject not selected ...")}close(){this.route.close()}static \u0275fac=function(o){return new(o||r)(b(Z),b(O),b(R),b(W))};static \u0275cmp=A({type:r,selectors:[["app-apply"]],inputs:{value:"value",eleId:"eleId",eleName:"eleName"},outputs:{reload:"reload"},decls:7,vars:2,consts:[[1,"container"],[1,"modal-header","my-0"],[1,"fs-6","fw-semibold"],["type","button","data-backdrop","static","data-bs-dismiss","modal","aria-label","Close",1,"btn-close",3,"click"],["class","row mt-3",4,"ngIf"],["class","row mt-2",4,"ngIf"],[1,"row","mt-3"],[1,"col-12"],[1,"table-responsive"],[1,"table","table-bordered","jack_table"],["scope","col"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"availability-info"],[1,"mb-2"],[1,"text-muted"],[1,"fw-bold"],[1,"fw-bold",3,"ngClass"],[1,"mt-2","d-flex","gap-2"],["type","button",1,"btn","btn-sm",3,"click","disabled"],[1,"btn","btn-sm","btn-outline-primary",3,"click","routerLink"],[1,"fa","fa-info-circle","me-1"],[1,"fa","fa-check","me-1"],["role","status","aria-hidden","true",1,"spinner-border","spinner-border-sm","me-1"],[1,"row","mt-2"],[1,"alert","alert-warning","col-md-12"]],template:function(o,t){o&1&&(n(0,"div",0)(1,"div",1)(2,"span",2),a(3,"Apply Students Elective"),i(),n(4,"button",3),f("click",function(){return t.close()}),i()(),g(5,yt,15,1,"div",4)(6,St,4,0,"div",5),i()),o&2&&(l(5),s("ngIf",(t.electiveSubjectsDashboard==null?null:t.electiveSubjectsDashboard.length)>0),l(),s("ngIf",t.electiveSubjectsDashboard.length==0))},dependencies:[J,ke,F,V],styles:[".availability-info[_ngcontent-%COMP%]{background-color:#f8f9fa;padding:10px;border-radius:6px;border:1px solid #dee2e6;min-width:120px}.availability-info[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px}.availability-info[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:last-child{margin-bottom:0}.availability-info[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{font-size:.8rem;color:#6c757d}.availability-info[_ngcontent-%COMP%] .fw-bold[_ngcontent-%COMP%]{font-size:.9rem;font-weight:600}.jack_table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{vertical-align:middle}.btn-sm[_ngcontent-%COMP%]{font-size:.75rem;padding:.25rem .5rem;border-radius:4px}.text-success[_ngcontent-%COMP%]{color:#198754!important}.text-danger[_ngcontent-%COMP%]{color:#dc3545!important}.d-flex.gap-2[_ngcontent-%COMP%]{gap:.5rem}.btn-sm[_ngcontent-%COMP%]{font-size:.75rem;padding:.25rem .5rem;border-radius:4px;min-width:70px}.btn-success[_ngcontent-%COMP%]{background-color:#198754;border-color:#198754}.btn-success[_ngcontent-%COMP%]:hover:not(:disabled){background-color:#157347;border-color:#146c43}.btn-secondary[_ngcontent-%COMP%]:disabled{background-color:#6c757d;border-color:#6c757d;opacity:.65}"]})}return r})();var fe=(()=>{class r{activeModal;subjectService;value;reload=new se;subject;constructor(e,o){this.activeModal=e,this.subjectService=o}ngOnInit(){}returnNo(e){this.value.applyAccess="enabled",this.subjectService.createElectiveApplyAccess(e,this.value).then(o=>{this.subject=o,this.reload.emit()}),this.activeModal.close()}returnYes(e){this.value.applyAccess="disabled",this.subjectService.createElectiveApplyAccess(e,this.value).then(o=>{this.subject=o,this.reload.emit()}),this.activeModal.close()}close(){this.activeModal.close()}static \u0275fac=function(o){return new(o||r)(b(Z),b(O))};static \u0275cmp=A({type:r,selectors:[["app-elective-apply-settings"]],inputs:{value:"value"},outputs:{reload:"reloadSettings"},decls:12,vars:0,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title","text-center"],["type","button","aria-label","Close",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body","text-end"],[1,"btn","btn-success","btn-sm","mr-1",3,"click"],[1,"btn","btn-danger","btn-sm",3,"click"]],template:function(o,t){o&1&&(n(0,"div",0)(1,"div",1)(2,"h6",2),a(3," Are you sure do you want to disable the access to apply for students ? "),i(),n(4,"button",3),f("click",function(){return t.close()}),n(5,"span",4),a(6,"\xD7"),i()()(),n(7,"div",5)(8,"button",6),f("
1click",function(){return t.returnNo(t.value.id)}),a(9,"Enable"),i(),n(10,"button",7),f("click",function(){return t.returnYes(t.value.id)}),a(11,"Disable"),i()()())}})}return r})();var rt=()=>["1","2","3","4","5","6","7","8","9","10"];function Et(r,d){if(r&1&&(n(0,"ng-option",22),a(1),i()),r&2){let e=d.$implicit;s("value",e),l(),L("",e.degreeName," -",e.departmentName,"")}}function It(r,d){if(r&1&&(n(0,"ng-option",22),a(1),i()),r&2){let e=d.$implicit;s("value",e.id),l(),L(" ",e.startYear,"-",e.endYear," ")}}function wt(r,d){if(r&1&&(n(0,"ng-option",22),a(1),i()),r&2){let e=d.$implicit;s("value",e),l(),I("",e," ")}}function Mt(r,d){if(r&1&&(n(0,"ng-option",22)(1,"b",23),a(2),i(),a(3),i()),r&2){let e=d.$implicit;s("value",e.id),l(2),h(e.sem),l(),I(" ",e.groupName," ")}}function Tt(r,d){if(r&1&&(n(0,"ng-option",22),a(1),i()),r&2){let e=d.$implicit;s("value",e.id),l(),I(" ",e.electiveConfigType," ")}}function Dt(r,d){r&1&&(n(0,"span"),y(1,"i",24),a(2,"View"),i())}function jt(r,d){r&1&&(n(0,"span"),y(1,"span",25),a(2,"Loa
1ding... "),i())}function kt(r,d){r&1&&(n(0,"span"),y(1,"i",28),a(2,"Export"),i())}function At(r,d){r&1&&(n(0,"span"),y(1,"span",25),a(2,"Loading... "),i())}function Ot(r,d){if(r&1){let e=T();n(0,"div",26)(1,"div",17)(2,"button",27),f("click",function(){v(e);let t=u(2);return _(t.getElectiveSubStudentsExcell(t.groupId,t.sem,t.electiveId))}),g(3,kt,3,0,"span",19)(4,At,3,0,"span",19),i()()()}if(r&2){let e=u(2);l(2),s("disabled",e.isExcelLoading),l(),s("ngIf",!e.isExcelLoading),l(),s("ngIf",e.isExcelLoading)}}function Lt(r,d){if(r&1&&(n(0,"td",34)(1,"small",35),a(2),i(),y(3,"br"),n(4,"small"),a(5),i()()),r&2){let e=u().$implicit;l(2),I("[",e.subjectLength,"]"),l(3),I('["',e.electiveSubject,'"]')}}function Vt(r,d){if(r&1&&(n(0,"td",34),y(1,"br"),n(2,"small"),a(3),i()()),r&2){let e=u().$implicit;l(3),I('["',e.electiveSubStaffName,'"]')}}function Yt(r,d){if(r&1&&(n(0,"td",34),y(1,"br"),n(2,"small"),a(3),i()()),r&2){let e=u().$implicit;l(3),I('["',e.electiveSubDepartment,'"]')}}function Ft(r,d){if(r&1){let e=T();n(0,"td")(1,"a",36),f("click",function(){v(e);let t=u().$implicit,c=u(3);return _(c.getStudentElective(t))}),a(2,"Apply"),i()()}}function Pt(r,d){r&1&&(n(0,"td"),a(1,"-"),i())}function Rt(r,d){if(r&1&&(n(0,"tr"),D(1),n(2,"td"),a(3),i(),n(4,"td"),a(5),i(),n(6,"td"),a(7),i(),g(8,Lt,6,2,"td",33),n(9,"td",34)(10,"small",35),a(11),i(),y(12,"br"),n(13,"small"),a(14),i()(),g(15,Vt,4,1,"td",33)(16,Yt,4,1,"td",33)(17,Ft,3,0,"td",19)(18,Pt,2,0,"td",19),j(),i()),r&2){let e=d.$implicit,o=d.index;l(3),h(o+1),l(2),h(e.name),l(2),h(e.registerNo),l(),s("ngIf",e.electiveSubject!=null),l(3),I("[",e.batchLength,"]"),l(3),I('["',e.electiveBatch,'"]'),l(),s("ngIf",e.electiveSubStaffName!=null),l(),s("ngIf",e.electiveSubDepartment!=null),l(),s("ngIf",e.electiveSubject.length==0),l(),s("ngIf",e.electiveSubject.length!=0)}}function Nt(r,d){if(r&1&&(n(0,"div",5)(1,"div",17)(2,"div",29)(3,"table",30)(4,"thead")(5,"tr")(6,"td",31),a(7,"#"),i(),n(8,"td",31)(9,"small")(10,"strong"),a(11,"STUDENT"),i()()(),n(12,"td",31)(13,"small")(14,"strong"),a(15,"REGISTER NO"),i()()(),n(16,"td",31)(17,"small")(18,"strong"),a(19,"APPLIED SUBJECT"),i()()(),n(20,"td",31)(21,"small")(22,"strong"),a(23,"APPLIED BATCH"),i()()(),n(24,"td",31)(25,"small")(26,"strong"),a(27,"STAFF"),i()()(),n(28,"td",31)(29,"small")(30,"strong"),a(31,"APPLIED DEPARTMENT"),i()()(),n(32,"td",31)(33,"small")(34,"strong"),a(35,"APPLY"),i()()()()(),n(36,"tbody"),g(37,Rt,19,10,"tr",32),i()()()()()),r&2){let e=u(2);l(37),s("ngForOf",e.electiveStudent)}}
1function Bt(r,d){r&1&&(n(0,"div")(1,"div",37)(2,"span"),a(3,"No data found."),i()()())}function Gt(r,d){if(r&1){let e=T();n(0,"div",1)(1,"div",2)(2,"div",3)(3,"span",4),a(4,"Elective Subject Applied Students"),i()()(),n(5,"div",5)(6,"div",6)(7,"label",7)(8,"span",4),a(9,"Degree & Department"),i(),n(10,"span",8),a(11,"*"),i(),a(12,":"),i()(),n(13,"div",9)(14,"ng-select",10),x("ngModelChange",function(t){v(e);let c=u();return C(c.dept,t)||(c.dept=t),_(t)}),f("change",function(){v(e);let t=u();return _(t.getAccyears(t.dept))}),n(15,"ng-option",11),a(16,"------------------select-----------------"),i(),g(17,Et,2,3,"ng-option",12),i()()(),n(18,"div",5)(19,"div",6)(20,"label",13)(21,"span",4),a(22,"Accyear "),i(),n(23,"span",8),a(24,"*"),i(),a(25,":"),i()(),n(26,"div",9)(27,"ng-select",14),x("ngModelChange",function(t){v(e);let c=u();return C(c.accyearId,t)||(c.accyearId=t),_(t)}),f("change",function(){v(e);let t=u();return _(t.getGroup(t.accyearId))}),n(28,"ng-option",15),a(29,"----------------------Select Accyear--------------------"),i(),g(30,It,2,3,"ng-option",12),i()()(),n(31,"div",5)(32,"div",6)(33,"label",7)(34,"span",4),a(35,"Select Sem "),i(),n(36,"span",8),a(37,"*"),i(),a(38,":"),i()(),n(39,"div",9)(40,"ng-select",10),x("ngModelChange",function(t){v(e);let c=u();return C(c.sem,t)||(c.sem=t),_(t)}),f("change",function(){v(e);let t=u();return _(t.resetDropdowns("semester"))}),n(41,"ng-option",11),a(42,"------------------select Semester-----------------"),i(),g(43,wt,2,2,"ng-option",12),i()()(),n(44,"div",5)(45,"div",6)(46,"label",13)(47,"span",4),a(48,"Group :"),i()()(),n(49,"div",9)(50,"ng-select",14),x("ngModelChange",function(t){v(e);let c=u();return C(c.groupId,t)||(c.groupId=t),_(t)}),f("change",function(){v(e);let t=u();return _(t.resetDropdowns("group"))}),n(51,"ng-option",15),a(52,"----------------------Select Group--------------------"),i(),g(53,Mt,4,3,"ng-option",12),de(54,"orderBy"),i()()(),n(55,"div",5)(56,"div",6)(57,"label",13)(58,"span",4),a(59,"Config Type :"),i()()(),n(60,"div",9)(61,"ng-select",14),x("ngModelChange",function(t){v(e);let c=u();return C(c.electiveId,t)||(c.electiveId=t),_(t)}),f("change",function(){v(e);let t=u();return _(t.resetDropdowns("electiveType"))}),n(62,"ng-option",15),a(63,"----------------------Select ElectiveType--------------------"),i(),g(64,Tt,2,2,"ng-option",12),i()()(),n(65,"div",16)(66,"div",17)(67,"button",18),f("click",function(){v(e);let t=u();return _(t.getElectiveSubStudents(t.groupId,t.sem,t.electiveId))}),g(68,Dt,3,0,"span",19)(69,jt,3,0,"span",19),i()()(),g(70,Ot,5,3,"div",20)(71,Nt,38,1,"div",21),n(72,"div",5)(73,"div",17),g(74,Bt,4,0,"div",19),i()()()}if(r&2){let e=u();l(14),S("ngModel",e.dept),s("clearable",!1)("placeholder","--------------------------Select--------------------------"),l(3),s("ngForOf",e.departments),l(10),s("searchable",!0)("clearable",!1),S("ngModel",e.accyearId),s("placeholder","--------------------------Select--------------------------"),l(3),s("ngForOf",e.accyears),l(10),S("ngModel",e.sem),s("clearable",!1)("placeholder","--------------------------Select--------------------------"),l(3),s("ngForOf",Y(32,rt)),l(7),s("searchable",!0)("clearable",!1),S("ngModel",e.groupId),s("placeholder","--------------------------Select--------------------------"),l(3),s("ngForOf",pe(54,29,e.groups,"sem")),l(8),s("searchable",!0)("clearable",!1),S("ngModel",e.electiveId),s("placeholder","--------------------------Select--------------------------"),l(3),s("ngForOf",e.electiveType),l(3),s("disabled",e.isLoading),l(),s("ngIf",!e.isLoading),l(),s("ngIf",e.isLoading),l(),s("ngIf",(e.electiveStudent==null?null:e.electiveStudent.length)>0),l(),s("ngIf",(e.electiveStudent==null?null:e.electiveStudent.length)>0),l(3),s("ngIf",(e.electiveStudent==null?null:e.electiveStudent.length)==0&&e.showData)}}function Wt(r,d){if(r&1&&(n(0,"ng-option",22),a(1),i()),r&2){let e=d.$implicit;s("value",e),l(),L("",e.degreeName," -",e.departmentName,"")}}function Ht(r,d){if(r&1&&(n(0,"ng-option",22),a(1),i()),r&2){let e=d.$implicit;s("value",e.id),l(),L(" ",e.startYear,"-",e.endYear," ")}}function Ut(r,d){if(r&1&&(n(0,"ng-option",22),a(1),i()),r&2){let e=d.$implicit;s("value",e),l(),I("",e," ")}}
1function $t(r,d){if(r&1&&(n(0,"ng-option",22),a(1),i()),r&2){let e=d.$implicit;s("value",e.id),l(),I("",e.subjectName," ")}}function zt(r,d){if(r&1){let e=T();n(0,"td")(1,"button",42),f("click",function(){v(e);let t=u().$implicit,c=u(3);return _(c.Access(t))}),a(2),i()()}if(r&2){let e=u(4);l(2),h(e.access)}}function qt(r,d){if(r&1){let e=T();n(0,"td")(1,"button",43),f("click",function(){v(e);let t=u().$implicit,c=u(3);return _(c.Access(t))}),a(2),i()()}if(r&2){let e=u(4);l(2),h(e.access)}}function Kt(r,d){if(r&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td"),a(4),i(),g(5,zt,3,1,"td",19)(6,qt,3,1,"td",19),i()),r&2){let e=d.$implicit,o=d.index,t=u(3);l(2),h(o+1),l(2),h(e.subjectName),l(),s("ngIf",t.access=="enabled"),l(),s("ngIf",t.access=="disabled")}}function Qt(r,d){if(r&1&&(n(0,"div",40)(1,"table",41)(2,"thead")(3,"tr")(4,"th",31),a(5," S.No"),i(),n(6,"th",31),a(7,"Elective Batches"),i(),n(8,"th",31),a(9,"Access"),i()()(),n(10,"tbody"),g(11,Kt,7,4,"tr",32),i()()()),r&2){let e=u(2);l(11),s("ngForOf",e.batches)}}function Xt(r,d){if(r&1){let e=T();n(0,"div",1)(1,"div",2)(2,"div",3)(3,"span",4),a(4,"Elective Subject Apply Settings"),i()()(),n(5,"div",5)(6,"div",6)(7,"label",7)(8,"span",4),a(9,"Degree & Department"),i(),n(10,"span",8),a(11,"*"),i(),a(12,":"),i()(),n(13,"div",9)(14,"ng-select",10),x("ngModelChange",function(t){v(e);let c=u();return C(c.dept,t)||(c.dept=t),_(t)}),f("change",function(){v(e);let t=u();return _(t.getAccyearList(t.dept))}),n(15,"ng-option",11),a(16,"------------------select-----------------"),i(),g(17,Wt,2,3,"ng-option",12),i()()(),n(18,"div",5)(19,"div",6)(20,"label",13)(21,"span",4),a(22,"Accyear "),i(),n(23,"span",8),a(24,"*"),i(),a(25,":"),i()(),n(26,"div",9)(27,"ng-select",14),x("ngModelChange",function(t){v(e);let c=u();return C(c.accyearId,t)||(c.accyearId=t),_(t)}),f("change",function(){v(e);let t=u();return _(t.getRegulation(t.accyearId))}),n(28,"ng-option",15),a(29,"----------------------Select Accyear--------------------"),i(),g(30,Ht,2,3,"ng-option",12),i()()(),n(31,"div",5)(32,"div",6)(33,"label",7)(34,"span",4),a(35,"Select Sem "),i(),n(36,"span",8),a(37,"*"),i(),a(38,":"),i()(),n(39,"div",9)(40,"ng-select",10),x("ngModelChange",function(t){v(e);let c=u();return C(c.sem,t)||(c.sem=t),_(t)}),f("change",function(){v(e);let t=u();return _(t.getElectiveRegSub(t.sem))}),n(41,"ng-option",11),a(42,"------------------select Semester-----------------"),i(),g(43,Ut,2,2,"ng-option",12),i()()(),n(44,"div",2)(45,"div",6)(46,"label",7)(47,"span",4),a(48,"Subjects :"),i()()(),n(49,"div",9)(50,"ng-select",38),x("ngModelChange",function(t){v(e);let c=u();return C(c.subId,t)||(c.subId=t),_(t)}),f("change",function(){v(e);let t=u();return _(t.getBatches(t.subId))}),n(51,"ng-option",11),a(52,"------------------select-----------------"),i(),g(53,$t,2,2,"ng-option",12),i()()(),g(54,Qt,12,1,"div",39),i()}if(r&2){let e=u();l(14),S("ngModel",e.dept),s("clearable",!1)("placeholder","--------------------------Select--------------------------"),l(3),s("ngForOf",e.departments),l(10),s("searchable",!0)("clearable",!1),S("ngModel",e.accyearId),s("placeholder","--------------------------Select--------------------------"),l(3),s("ngForOf",e.accyears),l(10),S("ngModel",e.sem),s("clearable",!1)("placeholder","--------------------------Select--------------------------"),l(3),s("ngForOf",Y(17,rt)),l(7),S("ngModel",e.subId),s("clearable",!1),l(3),s("ngForOf",e.regElectiveSubList),l(),s("ngIf",e.showTable)}}var ot=(()=>{class r{departmentsService;accyearService;groupService;subjectService;facultyDepartmentService;electiveService;regulationService;modalService;userService;toastr;dept;accyearId;sem;groupId;access;electiveId;departments;accyears;facultyDepartmentData;electiveType;groups;students;electiveStudent;singleUser;electiveDeptHod;showApplyButton;electiveSubjectExcell;currentUser;accYr;electiveName;regulationId;regSubjects;subId;regElectiveSubList=[];showTable;batches;departmentId;isLoading=!1;showData=!1;isExcelLoading=!1;constructor(e,o,t,c,p,m,w,E,k,M){this.departmentsService=e,this.accyearService=o,this.groupService=t,this.subjectService=c,this.facultyDepartmentService=p,this.electiveService=m,this.regulationService=w,this.modalService=E,this.userService=k,this.toastr=M}
1ngOnInit(){this.getCurrentUser(),this.getDepartments(),this.getSingleUser()}getCurrentUser(){this.userService.getCurrentUser().then(e=>{this.currentUser=e})}getSingleUser(){this.userService.getSingleUser().then(e=>{this.singleUser=e})}getDepartments(){this.departmentsService.getDepartment().then(e=>{this.departments=e})}getRegulation(e){this.accyearService.getById(e).then(o=>{this.accYr=o,this.regulationId=this.accYr.regulationId})}getAccyearList(e){this.accyearService.getAcademicByDep(e.id).then(o=>{this.accyears=o})}getElectiveRegSub(e){this.regElectiveSubList=[],this.regulationService.getRegSub(this.dept.id,this.regulationId,e).then(o=>{this.regSubjects=o.datas;for(var t=0;t<this.regSubjects.length;t++)this.regSubjects[t].paperType==!0&&this.regElectiveSubList.push(this.regSubjects[t])})}getBatches(e){this.subjectService.getActiveBatch(e).then(o=>{this.batches=o,this.batches.sort((c,p)=>c.batchName.localeCompare(p.batchName));for(var t=0;t<this.batches.length;t++)(this.batches[t].applyAccess==""||this.batches[t].applyAccess==null||this.batches[t].applyAccess=="enabled")&&(this.access="enabled"),this.batches[t].applyAccess=="disabled"&&(this.access="disabled")}),this.showTable=!0}Access(e){let o=this.modalService.open(fe,{size:"lg",backdrop:"static"});o.componentInstance.value=e,o.componentInstance.reload.subscribe(()=>{this.reloadSettings(this.subId)})}reloadSettings(e){this.getBatches(e)}getAccyears(e){this.departmentId=e.id,this.resetDropdowns("department"),this.accyearService.fetchAccYear(e.id).then(o=>{this.accyears=o,this.facultyDepartmentService.getFacultyDepartmentEdit(e.facultyDeptId).then(t=>{this.facultyDepartmentData=t,this.getElectiveType(this.facultyDepartmentData.facultyId)})})}getElectiveType(e){this.electiveService.getElectiveConfig(e).then(o=>{this.electiveType=o})}getGroup(e){this.resetDropdowns("accyear"),this.groupService.getCurrentGroup(e).then(o=>{this.groups=o})}resetDropdowns(e){this.electiveStudent=[],this.electiveSubjectExcell=[],this.showApplyButton=!1,this.showData=!1,e==="department"?(this.accyearId="",this.sem="",this.groupId="",this.electiveId="",this.groups=[]):e==="accyear"?(this.sem="",this.groupId="",this.electiveId=""):e==="semester"?(this.groupId="",this.electiveId=""):e==="group"&&(this.electiveId="")}getElectiveSubStudents(e,o,t){console.log(e,o,t,"dfdsf"),this.isLoading=!0,this.showData=!1,this.subjectService.getElectiveSubjectStudent(e,o,t).then(c=>{if(this.electiveStudent=c,this.showData=!0,console.log(this.electiveType),this.electiveType.forEach(m=>{m.id===t&&(this.electiveName=m.electiveConfigType,console.log(this.electiveName))}),this.isLoading=!1,this.electiveStudent!=null)for(var p=0;p<this.electiveStudent.length;p++)this.electiveStudent[p].electiveSubject!=null?(this.electiveStudent[p].subjectLength=this.electiveStudent[p].electiveSubject.length,this.electiveStudent[p].batchLength=this.electiveStudent[p].electiveBatch?this.electiveStudent[p].electiveBatch.length:0):(this.electiveStudent[p].electiveSubject="-",this.electiveStudent[p].electiveSubStaffName="-",this.electiveStudent[p].electiveSubDepartment="-",this.electiveStudent[p].electiveBatch="-")}).catch(c=>{this.isLoading=!1})}getElectiveSubStudentsExcell(e,o,t){this.isExcelLoading=!0,this.subjectService.getElectiveSubjectExcell(e,o,t).then(c=>{this.electiveSubjectExcell=c,this.isExcelLoading=!1})}getStudentElective(e){if(console.log(e,"reportData"),this.electiveDeptHod=this.singleUser.departmentid,this.electiveDeptHod.includes(this.departmentId)){let o=this.modalService.open(nt,{size:"lg",backdrop:"static"});o.componentInstance.value=e,o.componentInstance.eleId=this.electiveId,o.componentInstance.eleName=this.electiveName,o.componentInstance.reload.subscribe(()=>{this.reload()})}else this.toastr.warning("Only department HOD has the rights to apply")}reload(){console.log(this.groupId,this.sem,this.electiveId),this.getElectiveSubStudents(this.groupId,this.sem,this.electiveId)}static \u0275fac=function(o){return new(o||r)(b(q),b(ee),b(te),b(O),b(ge),b(N),b(Ke),b(R),b(P),b(W))};
1static \u0275cmp=A({type:r,selectors:[["app-elective-subject-home"]],decls:2,vars:2,consts:[["class","container",4,"ngIf"],[1,"container"],[1,"row","mt-4"],[1,"col-12","py-0","border-bottom"],[1,"fs-6","fw-semibold"],[1,"row","mt-3"],[1,"col-4","text-end"],["for","exampleDataList",1,"form-label"],[1,"text-danger"],[1,"col-4"],[3,"ngModelChange","change","ngModel","clearable","placeholder"],["value","",3,"disabled"],[3,"value",4,"ngFor","ngForOf"],["for","accyearDataList",1,"form-label"],[3,"ngModelChange","change","searchable","clearable","ngModel","placeholder"],["value",""],[1,"row","mt-3","text-center"],[1,"col-12"],["type","button",1,"btn","btn-success","px-4","py-2","rounded-pill","shadow-sm",3,"click","disabled"],[4,"ngIf"],["class","row mt-3 text-end",4,"ngIf"],["class","row mt-3",4,"ngIf"],[3,"value"],[1,"me-2"],[1,"fa","fa-eye","me-2"],["role","status","aria-hidden","true",1,"spinner-border","spinner-border-sm","me-2"],[1,"row","mt-3","text-end"],["type","button",1,"btn","btn-primary",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-download","me-2"],[1,"table-responsive"],[1,"table","table-bordered","jack_table"],["scope","col"],[4,"ngFor","ngForOf"],["style","text-align: center",4,"ngIf"],[2,"text-align","center"],[2,"color","blue"],[3,"click","routerLink"],[1,"alert","alert-warning"],["placeholder","-------------------select------------------",3,"ngModelChange","change","ngModel","clearable"],["class","row mt-2",4,"ngIf"],[1,"row","mt-2"],[1,"table","table-striped","table_size"],[1,"btn","btn-primary",3,"click"],[1,"btn","btn-danger",3,"click"]],template:function(o,t){o&1&&g(0,Gt,75,33,"div",0)(1,Xt,55,18,"div",0),o&2&&(s("ngIf",t.currentUser.userType=="HOD"),l(),s("ngIf",t.currentUser.userType=="ADMIN"))},dependencies:[J,F,V,z,$,H,U,ve]})}return r})();function Jt(r,d){if(r&1&&(n(0,"ng-option",20),a(1),i()),r&2){let e=d.$implicit;s("value",e),l(),L("",e.degreeName," -",e.departmentName,"")}}function Zt(r,d){if(r&1&&(n(0,"ng-option",20),a(1),i()),r&2){let e=d.$implicit;s("value",e),l(),L(" ",e.startYear,"-",e.endYear," ")}}function ei(r,d){if(r&1&&(n(0,"ng-option",20),a(1),i()),r&2){let e=d.$implicit;s("value",e.sem),l(),L("",e.year," - ",e.semType," ")}}function ti(r,d){if(r&1&&(n(0,"ng-option",20)(1,"b",21),a(2),i(),a(3),i()),r&2){let e=d.$implicit;s("value",e.id),l(2),h(e.sem),l(),I(" ",e.groupName," ")}}function ii(r,d){if(r&1&&(n(0,"ng-option",20),a(1),i()),r&2){let e=d.$implicit;s("value",e.id),l(),I(" ",e.electiveConfigType," ")}}function ni(r,d){r&1&&(n(0,"div",22)(1,"div",23)(2,"span",24),a(3,"Loading..."),i()()())}function ai(r,d){if(r&1&&(n(0,"div",4)(1,"div",8)(2,"p")(3,"span",21),a(4,"Department Name :"),i(),n(5,"b"),a(6),i()()(),n(7,"div",8)(8,"p")(9,"span",21),a(10,"Academic Year :"),i(),n(11,"b"),a(12),i()()(),n(13,"div",8)(14,"p")(15,"span",21),a(16,"Semester :"),i(),n(17,"b"),a(18),i()()()()),r&2){let e=u();l(6),h(e.dept.departmentName),l(6),L("",e.accyearId.startYear,"-",e.accyearId.endYear,""),l(6),h(e.groupData[0].sem)}}function ri(r,d){if(r&1&&(n(0,"div")(1,"span",21),a(2,"Group:"),i(),n(3,"b"),a(4),i(),a(5," \xA0\xA0\xA0\xA0 "),n(6,"span",21),a(7,"Total Students:"),i(),n(8,"b"),a(9),i(),a(10," \xA0\xA0\xA0\xA0 "),n(11,"span",21),a(12,"Applied:"),i(),n(13,"b"),a(14),i(),a(15," \xA0\xA0\xA0\xA0"),n(16,"span",21),a(17,"NotYetApplied:"),i(),n(18,"b"),a(19),i()()),r&2){let e=d.$implicit;l(4),h(e.groupName),l(5),I("",e.total," "),l(5),I("",e.applied," "),l(5),h(e.notYetApplied)}}function oi(r,d){if(r&1&&(n(0,"div",25)(1,"div",18),g(2,ri,20,4,"div",26),i()()),r&2){let e=u();l(2),s("ngForOf",e.getGroupCounts)}}function li(r,d){if(r&1&&(n(0,"tr"),D(1),n(2,"td"),a(3),i(),n(4,"td"),a(5),i(),n(6,"td"),a(7),i(),n(8,"td"),a(9),i(),n(10,"td"),a(11),i(),n(12,"td"),a(13),i(),n(14,"td"),a(15),i(),n(16,"td"),a(17),i(),j(),i()),r&2){let e=d.$implicit,o=d.index;l(3),h(o+1),l(2),h(e.subjectName),l(2),h(e.batchName),l(2),h(e.subjectDepartment),l(2),h(e.totalLimit),l(2),h(e.totalAvailability),l(2),h(e.deptLimit),l(2),h(e.deptAvailability)}}function ci(r,d){if(r&1&&(n(0,"div",4)(1,"div",18)(2,"div",27)(3,"table",28)(4,"thead")(5,"tr")(6,"th",29),a(7,"#"),i(),n(8,"th",29)(9,"small")(10,"strong"),a(11,"Subject"),i()()(),n(12,"th",29)(13,"small")(14,"strong"),a(15,"Batch"),i()()(),n(16,"th",29)(17,"small")(18,"strong"),a(19,"Department"),i()()(),n(20,"th",29)(21,"small")(22,"strong"),a(23,"Total Limit"),i()()(),n(24,"th",29)(25,"small")(26,"strong"),a(27,"Total Availability"),i()()(),n(28,"th",29)(29,"small")(30,"strong"),a(31,"Department Limit"),i()()(),n(32,"th",29)(33,"small")(34,"strong"),a(35,"Department Availability"),i()()()()(),n(36,"tbody"),g(37,li,18,8,"tr",26),i()()()()()),r&2){let e=u();l(37),s("ngForOf",e.eSubjectDepartmentreports)}}function si(r,d){r&1&&(n(0,"div")(1,"div",30)(2,"span"),a(3,"No data found."),i()()())}var lt=(()=>{class r{departmentsService;accyearService;groupService;subjectService;facultyDepartmentService;electiveService;modalService;userService;singleUser;departments;showApplyButton;electiveDeptHod;accyears;facultyDepartmentData;electiveType;groups;dept;accyearId;sem;groupId;semYear;eSubjectDepartmentreports;showError;getGroupCounts;groupData;configId;facultyId;isLoading;constructor(e,o,t,c,p,m,w,E){this.departmentsService=e,this.accyearService=o,this.groupService=t,this.subjectService=c,this.facultyDepartmentService=p,this.electiveService=m,this.modalService=w,this.userService=E}
1ngOnInit(){this.getDepartments(),this.getSingleUser(),this.resetAllData()}getSingleUser(){this.userService.getSingleUser().then(e=>{this.singleUser=e})}getDepartments(){this.departmentsService.getDepartment().then(e=>{this.departments=e})}resetAllData(){this.dept=null,this.accyearId=null,this.sem=null,this.groupId=null,this.configId=null,this.accyears=null,this.electiveType=null,this.groupData=null,this.facultyId=null,this.eSubjectDepartmentreports=null,this.getGroupCounts=null,this.showError=!1}resetReportData(){this.eSubjectDepartmentreports=null,this.getGroupCounts=null,this.showError=!1}getAccyears(e){if(!e){this.resetAllData();return}this.accyearId=null,this.sem=null,this.groupId=null,this.configId=null,this.electiveType=null,this.groupData=null,this.resetReportData(),this.showApplyButton=!1,this.electiveDeptHod=this.singleUser.departmentid,this.electiveDeptHod.includes(e.id)&&(this.showApplyButton=!0),this.accyearService.fetchAccYear(e.id).then(o=>{this.accyears=o,this.facultyDepartmentService.getFacultyDepartmentEdit(e.facultyDeptId).then(t=>{this.facultyDepartmentData=t,this.facultyId=this.facultyDepartmentData.facultyId})})}getGroup(e){if(!e){this.sem=null,this.groupId=null,this.configId=null,this.groupData=null,this.electiveType=null,this.resetReportData();return}this.sem=null,this.groupId=null,this.configId=null,this.groupData=null,this.resetReportData(),this.semYear=e.years,this.groupService.getCurrentGroup(e.id).then(o=>{this.groups=o})}getElectiveType(e){if(!e){this.configId=null,this.electiveType=null,this.resetReportData();return}this.configId=null,this.resetReportData(),this.electiveService.getElectiveConfig(e).then(o=>{this.electiveType=o})}getSemElective(e,o){if(!e||!o){this.groupId=null,this.configId=null,this.groupData=null,this.resetReportData();return}this.groupId=null,this.configId=null,this.resetReportData(),this.groupService.getGroupBySem(e.id,o).then(t=>{this.groupData=t})}getGroupsDept(e,o){if(!e||!o){this.resetReportData();return}this.isLoading=!0,this.subjectService.getElectiveSubjectDepartment(e,o).then(t=>{this.eSubjectDepartmentreports=t,this.showError=!0,this.isLoading=!1,this.eSubjectDepartmentreports.length!=0&&this.eSubjectDepartmentreports[0].electiveSubjectDeptGroups!=null&&(this.getGroupCounts=this.eSubjectDepartmentreports[0].electiveSubjectDeptGroups)})}static \u0275fac=function(o){return new(o||r)(b(q),b(ee),b(te),b(O),b(ge),b(N),b(R),b(P))};static \u0275cmp=A({type:r,selectors:[["app-elective-subject-department-report"]],decls:75,vars:30,consts:[[1,"container"],[1,"row","mt-4"],[1,"col-12","py-0","border-bottom"],[1,"fs-6","fw-semibold"],[1,"row","mt-3"],[1,"col-4","text-end"],["for","exampleDataList",1,"form-label"],[1,"text-danger"],[1,"col-4"],[3,"ngModelChange","change","ngModel","clearable","placeholder"],["value","",3,"disabled"],[3,"value",4,"ngFor","ngForOf"],["for","accyearDataList",1,"form-label"],[3,"ngModelChange","change","searchable","clearable","ngModel","placeholder"],["value",""],["class","col-12 text-center","style","margin-top: 50px;",4,"ngIf"],["class","row mt-3",4,"ngIf"],["class","row mt-2",4,"ngIf"],[1,"col-12"],[4,"ngIf"],[3,"value"],[1,"me-2"],[1,"col-12","text-center",2,"margin-top","50px"],["role","status",1,"spinner-border","text-primary"],[1,"visually-hidden"],[1,"row","mt-2"],[4,"ngFor","ngForOf"],[1,"table-responsive"],[1,"table","table-bordered","jack_table"],["scope","col"],[1,"alert","alert-warning"]],template:function(o,t){o&1&&(n(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),a(4,"Elective Subject Department Report"),i()()(),n(5,"div",4)(6,"div",5)(7,"label",6)(8,"span",3),a(9,"Degree & Department"),i(),n(10,"span",7),a(11,"*"),i(),a(12,":"),i()(),n(13,"div",8)(14,"ng-select",9),x("ngModelChange",function(p){return C(t.dept,p)||(t.dept=p),p}),f("change",function(){return t.getAccyears(t.dept)}),n(15,"ng-option",10),a(16,"------------------select-----------------"),i(),g(17,Jt,2,3,"ng-option",11),i()()(),n(18,"div",4)(19,"div",5)(20,"label",12)(21,"span",3),a(22,"Accyear "),i(),n(23,"span",7),a(24,"*"),i(),a(25,":"),i()(),n(26,"div",8)(27,"ng-select",13),x("ngModelChange",function(p){return C(t.accyearId,p)||(t.accyearId=p),p}),f("change",function(){return t.getGroup(t.accyearId)}),n(28,"ng-option",14),a(29,"----------------------Select Accyear--------------------"),i(),g(30,Zt,2,3,"ng-option",11),i()()(),n(31,"div",4)(32,"div",5)(33,"label",6)(34,"span",3),a(35,"Year of exam & Sem type "),i(),n(36,"span",7),a(37,"*"),i(),a(38,":"),i()(),n(39,"div",8)(40,"ng-select",9),x("ngModelChange",function(p){return C(t.sem,p)||(t.sem=p),p}),f("change",function(){return t.getSemElective(t.accyearId,t.sem)}),n(41,"ng-option",10),a(42,"------------------select Semester-----------------"),i(),g(43,ei,2,3,"ng-option",11),i()()(),n(44,"div",4)(45,"div",5)(46,"label",12)(47,"span",3),a(48,"Group :"),i()()(),n(49,"div",8)(50,"ng-select",13),x("ngModelChange",function(p){return C(t.groupId,p)||(t.groupId=p),p}),f("change",function(){return t.getElectiveType(t.facultyId)}),n(51,"ng-option",14),a(52,"----------------------Select Group--------------------"),i(),g(53,ti,4,3,"ng-option",11),de(54,"orderBy"),i()()(),n(55,"div",4)(56,"div",5)(57,"label",6)(58,"span",3),a(59," Elective Config Type"),i(),n(60,"span",7),a(61,"*"),i(),a(62,":"),i()(),n(63,"div",8)(64,"ng-select",9),x("ngModelChange",function(p){return C(t.configId,p)||(t.configId=p),p}),f("change",function(){return t.getGroupsDept(t.groupId,t.configId)}),n(65,"ng-option",10),a(66,"------------------select-----------------"),i(),g(67,ii,2,2,"ng-option",11),i()()(),g(68,ni,4,0,"div",15)(69,ai,19,4,"div",16)(70,oi,3,1,"div",17)(71,ci,38,1,"div",16),n(72,"div",4)(73,"div",18),g(74,si,4,0,"div",19),i()()()),o&2&&(l(14),S("ngModel",t.dept),s("clearable",!1)("placeholder","--------------------------Select--------------------------"),l(3),s("ngForOf",t.departments),l(10),s("searchable",!0)("clearable",!1),S("ngModel",t.accyearId),s("placeholder","--------------------------Select--------------------------"),l(3),s("ngForOf",t.accyears),l(10),S("ngModel",t.sem),s("clearable",!1)("placeholder","--------------------------Select--------------------------"),l(3),s("ngForOf",t.semYear),l(7),s("searchable",!0)("clearable",!1),S("ngModel",t.groupId),s("placeholder","--------------------------Select--------------------------"),l(3),s("ngForOf",pe(54,27,t.groupData,"sem")),l(11),S("ngModel",t.configId),s("clearable",!1)("placeholder","--------------------------Select--------------------------"),l(3),s("ngForOf",t.electiveType),l(),s("ngIf",t.isLoading),l(
1),s("ngIf",t.eSubjectDepartmentreports!=null),l(),s("ngIf",t.getGroupCounts!=null&&t.eSubjectDepartmentreports.length!=0),l(),s("ngIf",t.eSubjectDepartmentreports!=null&&(t.eSubjectDepartmentreports==null?null:t.eSubjectDepartmentreports.length)!=0),l(3),s("ngIf",(t.eSubjectDepartmentreports==null?null:t.eSubjectDepartmentreports.length)==0))},dependencies:[F,V,z,$,H,U,ve]})}return r})();function di(r,d){if(r&1&&(n(0,"ng-option",18),a(1),i()),r&2){let e=d.$implicit;s("value",e),l(),I(" ",e," ")}}function pi(r,d){if(r&1&&(n(0,"ng-option",18),a(1),i()),r&2){let e=d.$implicit;s("value",e),l(),I(" ",e," ")}}function mi(r,d){if(r&1&&(n(0,"ng-option",18),a(1),i()),r&2){let e=d.$implicit;s("value",e.id),l(),I(" ",e.electiveConfigType," ")}}function ui(r,d){if(r&1&&(n(0,"ng-option",18)(1,"small")(2,"b"),a(3),i(),a(4),i()()),r&2){let e=d.$implicit;s("value",e),l(3),h(e.subjectName),l(),I(" - ",e.batchName,"")}}function gi(r,d){r&1&&(n(0,"div",19)(1,"div",20)(2,"span",21),a(3,"Loading..."),i()()())}function vi(r,d){if(r&1&&(n(0,"div",1)(1,"div",22)(2,"div",12)(3,"p")(4,"span",23),a(5,"Subject Name :"),i(),n(6,"b"),a(7),i()()(),n(8,"div",12)(9,"p")(10,"span",23),a(11,"Batch Name :"),i(),n(12,"b"),a(13),i()()()(),n(14,"div",24)(15,"div",12)(16,"p")(17,"span",23),a(18,"Offering Department :"),i(),n(19,"b"),a(20),i()()(),n(21,"div",12)(22,"p")(23,"span",23),a(24,"Branch :"),i(),n(25,"b"),a(26),i()()()(),n(27,"div",24)(28,"div",12)(29,"p")(30,"span",23),a(31,"Total Limit:"),i(),n(32,"b"),a(33),i()()(),n(34,"div",12)(35,"p")(36,"span",23),a(37,"Availability :"),i(),n(38,"b"),a(39),i()()()()()),r&2){let e=u();l(7),h(e.subjectId.subjectName),l(6),h(e.subjectId.batchName),l(7),h(e.subjectId.department),l(6),h(e.subjectId.department),l(7),h(e.subjectId.electiveCount),l(6),h(e.subjectReportsData[0].subjectAvailabiltityCount)}}function _i(r,d){if(r&1&&(n(0,"tr"),D(1),n(2,"td"),a(3),i(),n(4,"td")(5,"small"),a(6),i()(),n(7,"td")(8,"small"),a(9),i()(),n(10,"td")(11,"small"),a(12),i()(),n(13,"td")(14,"small"),a(15),i()(),n(16,"td")(17,"small"),a(18),i()(),n(19,"td")(20,"small"),a(21),i()(),n(22,"td")(23,"small"),a(24),i()(),n(25,"td")(26,"small"),a(27),i()(),n(28,"td")(29,"small"),a(30),i()(),j(),i()),r&2){let e=d.$implicit,o=d.index;l(3),h(o+1),l(3),h(e.department),l(3),h(e.accyear),l(3),h(e.groupName),l(3),h(e.groupTotal),l(3),h(e.groupAvailability),l(3),h(e.groupApplied),l(3),h(e.total),l(3),h(e.availability),l(3),h(e.applied)}}function hi(r,d){if(r&1&&(n(0,"div",4)(1,"div",16)(2,"div",25)(3,"table",26)(4,"thead")(5,"tr")(6,"th",27),a(7,"#"),i(),n(8,"th",27)(9,"small")(10,"strong"),a(11,"Department"),i()()(),n(12,"th",27)(13,"small")(14,"strong"),a(15,"Academic Year"),i()()(),n(16,"th",27)(17,"small")(18,"strong"),a(19,"Group"),i()()(),n(20,"th",27)(21,"small")(22,"strong"),a(23,"Total Group Count"),i()()(),n(24,"th",27)(25,"small")(26,"strong"),a(27,"Group Availability Count"),i()()(),n(28,"th",27)(29,"small")(30,"strong"),a(31,"Group Applied Count"),i()()(),n(32,"th",27)(33,"small")(34,"strong"),a(35,"Total Dept Count"),i()()(),n(36,"th",27)(37,"small")(38,"strong"),a(39,"Dept Availability Count"),i()()(),n(40,"th",27)(41,"small")(42,"strong"),a(43,"Dept Applied Count"),i()()()()(),n(44,"tbody"),g(45,_i,31,10,"tr",28),i()()()()()),r&2){let e=u();l(45),s("ngForOf",e.subjectReportsData)}}function fi(r,d){r&1&&(n(0,"div")(1,"div",29)(2,"span"),a(3,"No data found."),i()()())}var ct=(()=>{class r{route;userService;modalService;loadingService;router;toastr;activatedRoute;subjectService;electiveConfig;subjectId;OpenElectiveSubjects;subjectReportsData;showError;electiveConfigData;configId;currentYears;semType;currentYear;semester;isLoading=!1;constructor(e,o,t,c,p,m,w,E,k){this.route=e,this.userService=o,this.modalService=t,this.loadingService=c,this.router=p,this.toastr=m,this.activatedRoute=w,this.subjectService=E,this.electiveConfig=k}ngOnInit(){this.getCurrentYears()}getCurrentYears(){this.semester=void 0,this.currentYear="",this.currentYears=["2010","2011","2012","2013","2014","2015","2016","2017","2018","2019","2020","2021","2022","2023","2024","2025","2026","2027","2028","2029","2030"]}getSemTypes(){this.semester=void 0,this.configId=void 0,this.subjectId=void 0,this.subjectReportsData=void 0,this.semType=["Odd","Even"]}
1getElectiveConfig(){this.configId=void 0,this.subjectId=void 0,this.subjectReportsData=void 0,this.electiveConfig.getElectiveConfigData().then(e=>{this.electiveConfigData=e})}getOpenElectiveSubjects(){this.subjectId=void 0,this.subjectReportsData=void 0,this.subjectService.getOpenElectiveSubjectsByConfigType(this.configId,this.currentYear,this.semester).then(e=>{this.OpenElectiveSubjects=e})}getElectiveDepartments(e){this.isLoading=!0,this.subjectService.getElectiveDepartments(e.id).then(o=>{this.subjectReportsData=o,this.showError=!0,this.isLoading=!1})}static \u0275fac=function(o){return new(o||r)(b(Ce),b(P),b(R),b(Xe),b(Le),b(W),b(Ce),b(O),b(N))};static \u0275cmp=A({type:r,selectors:[["app-elective-subject-report"]],decls:63,vars:20,consts:[[1,"container"],[1,"row","mt-4"],[1,"col-12","py-0","border-bottom"],[1,"fs-6","fw-semibold"],[1,"row","mt-3"],[1,"col-4","text-end"],["for","exampleDataList",1,"form-label"],[1,"text-danger"],[1,"col-4"],[3,"ngModelChange","change","ngModel","clearable","placeholder"],["value","",3,"disabled"],[3,"value",4,"ngFor","ngForOf"],[1,"col-6"],["class","col-12 text-center","style","margin-top: 50px;",4,"ngIf"],["class","row mt-4",4,"ngIf"],["class","row mt-3",4,"ngIf"],[1,"col-12"],[4,"ngIf"],[3,"value"],[1,"col-12","text-center",2,"margin-top","50px"],["role","status",1,"spinner-border","text-primary"],[1,"visually-hidden"],[1,"row","mt-2"],[1,"me-2"],[1,"row"],[1,"table-responsive"],[1,"table","table-bordered","jack_table"],["scope","col"],[4,"ngFor","ngForOf"],[1,"alert","alert-warning"]],template:function(o,t){o&1&&(n(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),a(4,"Elective Subject Report"),i()()(),n(5,"div",4)(6,"div",5)(7,"label",6)(8,"span",3),a(9," Academic Year"),i(),n(10,"span",7),a(11,"*"),i(),a(12,":"),i()(),n(13,"div",8)(14,"ng-select",9),x("ngModelChange",function(p){return C(t.currentYear,p)||(t.currentYear=p),p}),f("change",function(){return t.getSemTypes()}),n(15,"ng-option",10),a(16,"------------------select-----------------"),i(),g(17,di,2,2,"ng-option",11),i()()(),n(18,"div",4)(19,"div",5)(20,"label",6)(21,"span",3),a(22," Semester Type"),i(),n(23,"span",7),a(24,"*"),i(),a(25,":"),i()(),n(26,"div",8)(27,"ng-select",9),x("ngModelChange",function(p){return C(t.semester,p)||(t.semester=p),p}),f("change",function(){return t.getElectiveConfig()}),n(28,"ng-option",10),a(29,"------------------select-----------------"),i(),g(30,pi,2,2,"ng-option",11),i()()(),n(31,"div",4)(32,"div",5)(33,"label",6)(34,"span",3),a(35," Elective Config Type"),i(),n(36,"span",7),a(37,"*"),i(),a(38,":"),i()(),n(39,"div",8)(40,"ng-select",9),x("ngModelChange",function(p){return C(t.configId,p)||(t.configId=p),p}),f("change",function(){return t.getOpenElectiveSubjects()}),n(41,"ng-option",10),a(42,"------------------select-----------------"),i(),g(43,mi,2,2,"ng-option",11),i()()(),n(44,"div",4)(45,"div",5)(46,"label",6)(47,"span",3),a(48,"Open Elective"),i(),n(49,"span",7),a(50,"*"),i(),a(51,":"),i()(),n(52,"div",12)(53,"ng-select",9),x("ngModelChange",function(p){return C(t.subjectId,p)||(t.subjectId=p),p}),f("change",function(){return t.getElectiveDepartments(t.subjectId)}),n(54,"ng-option",10),a(55,"---------------------------------------select--------------------------------------"),i(),g(56,ui,5,3,"ng-option",11),i()()(),g(57,gi,4,0,"div",13)(58,vi,40,6,"div",14)(59,hi,46,1,"div",15),n(60,"div",4)(61,"div",16),g(62,fi,4,0,"div",17),i()()()),o&2&&(l(14),S("ngModel",t.currentYear),s("clearable",!1)("placeholder","--------------------------Select--------------------------"),l(3),s("ngForOf",t.currentYears),l(10),S("ngModel",t.semester),s("clearable",!1)("placeholder","--------------------------Select--------------------------"),l(3),s("ngForOf",t.semType),l(10),S("ngModel",t.configId),s("clearable",!1)("placeholder","--------------------------Select--------------------------"),l(3),s("ngForOf",t.electiveConfigData),l(10),S("ngModel",t.subjectId),s("clearable",!1)("placeholder","---------------------------------------select--------------------------------------"),l(3),s("ngForOf",t.OpenElectiveSubjects),l(),s("ngIf",t.isLoading),l(
1),s("ngIf",t.subjectReportsData!=null&&(t.subjectReportsData==null?null:t.subjectReportsData.length)!=0),l(),s("ngIf",t.subjectReportsData!=null&&(t.subjectReportsData==null?null:t.subjectReportsData.length)!=0),l(3),s("ngIf",(t.subjectReportsData==null?null:t.subjectReportsData.length)==0))},dependencies:[F,V,z,$,H,U]})}return r})();var st=()=>({showSeconds:!0}),re=()=>[];function yi(r,d){if(r&1&&(n(0,"ng-option",76),a(1),i()),r&2){let e=d.$implicit;s("value",e.id),l(),h(e.name)}}function Si(r,d){if(r&1&&(n(0,"ng-option",76),a(1),i()),r&2){let e=d.$implicit;s("value",e.id),l(),L(" ",e.electiveConfigType," (",e.capMode||"PARTITIONED",") ")}}function Ci(r,d){r&1&&(n(0,"span"),a(1," \u2014 total count only; invited rows are eligibility, not per-group quotas."),i())}function xi(r,d){if(r&1&&(n(0,"p",77),a(1," Cap mode: "),n(2,"strong"),a(3),i(),g(4,Ci,2,0,"span",32),i()),r&2){let e=u();l(3),h(e.selectedCapMode),l(),s("ngIf",e.selectedCapMode==="POOL")}}function Ei(r,d){if(r&1&&(n(0,"ng-option",76),a(1),i()),r&2){let e=d.$implicit;s("value",e),l(),h(e)}}function Ii(r,d){if(r&1&&(n(0,"ng-option",76),a(1),i()),r&2){let e=d.$implicit;s("value",e),l(),h(e)}}function wi(r,d){if(r&1&&(n(0,"ng-option",76),a(1),i()),r&2){let e=d.$implicit;s("value",e),l(),h(e)}}function Mi(r,d){if(r&1&&(n(0,"ng-option",76),a(1),i()),r&2){let e=d.$implicit;s("value",e),l(),h(e)}}function Ti(r,d){if(r&1){let e=T();n(0,"button",78),f("click",function(){v(e);let t=u();return _(t.clearSelectedFile())}),y(1,"i",79),i()}}function Di(r,d){r&1&&(n(0,"span"),y(1,"i",80),a(2," Upload"),i())}function ji(r,d){r&1&&(n(0,"span"),y(1,"span",81),a(2," Loading..."),i())}function ki(r,d){r&1&&(n(0,"span"),a(1,"Load Counts"),i())}function Ai(r,d){r&1&&(n(0,"span"),y(1,"span",82),a(2,"Loading..."),i())}function Oi(r,d){r&1&&(n(0,"span"),y(1,"i",84),a(2," Sync Slot Data"),i())}function Li(r,d){r&1&&(n(0,"span"),y(1,"span",85),a(2," Syncing..."),i())}function Vi(r,d){if(r&1){let e=T();n(0,"button",83),f("click",function(){v(e);let t=u();return _(t.syncElectiveSlotData())}),g(1,Oi,3,0,"span",32)(2,Li,3,0,"span",32),i()}if(r&2){let e=u();s("disabled",!e.canLoad()||e.isSyncingSlotData),l(),s("ngIf",!e.isSyncingSlotData),l(),s("ngIf",e.isSyncingSlotData)}}function Yi(r,d){r&1&&(n(0,"span"),y(1,"i",87),a(2,"Preview & Save"),i())}function Fi(r,d){r&1&&(n(0,"span"),y(1,"span",88),a(2,"Saving..."),i())}function Pi(r,d){if(r&1){let e=T();n(0,"button",86),f("click",function(){v(e);let t=u();return _(t.openPreviewModal())}),g(1,Yi,3,0,"span",32)(2,Fi,3,0,"span",32),i()}if(r&2){let e=u();s("disabled",e.isSaving),l(),s("ngIf",!e.isSaving),l(),s("ngIf",e.isSaving)}}function Ri(r,d){r&1&&(n(0,"span"),a(1,"pool totals in the "),n(2,"strong"),a(3,"Total"),i(),a(4," row"),i())}function Ni(r,d){r&1&&(n(0,"span"),a(1,"counts that sum to each subject total"),i())}function Bi(r,d){if(r&1&&(n(0,"div",89),a(1," No invited groups yet. Click "),n(2,"strong"),a(3,"Add invited group"),i(),a(4,", then set per-group counts (0 allowed in POOL) and "),g(5,Ri,5,0,"span",32)(6,Ni,2,0,"span",32),a(7,". "),i()),r&2){let e=u();l(5),s("ngIf",e.selectedCapMode==="POOL"),l(),s("ngIf",e.selectedCapMode!=="POOL")}}function Gi(r,d){if(r&1&&(n(0,"th",106)(1,"div",107),a(2),i(),n(3,"div",108),a(4),n(5,"span"),a(6),i()()()),r&2){let e=d.$implicit,o=u(2);l(2),I(" ",e.batchName," "),l(2),I(" ",e.subjectCode," | Total: "),l(),G("text-danger",o.isInvalidTotal(e.subjectId)),l(),h(e.total)}}function Wi(r,d){if(r&1&&(n(0,"small",124),a(1),i()),r&2){let e=u().ngIf,o=u().$implicit,t=u(3);l(),I(" ",t.getErrorForGroup(o.subjectId,e.accYrId,e.grpId)," ")}}function Hi(r,d){if(r&1){let e=T();D(0),n(1,"input",122),x("ngModelChange",function(t){let c=v(e).ngIf;return C(c.count,t)||(c.count=t),_(t)}),f("ngModelChange",function(){let t=v(e).ngIf,c=u().$implicit,p=u().$implicit,m=u(2);return _(m.onGridCountInput(c.subjectId,t,p))})("blur",function(){let t=v(e).ngIf,c=u().$implicit,p=u().$implicit,m=u(2);return _(m.onGridCountBlur(c.subjectId,t,p))}),i(),g(2,Wi,2,1,"small",123),j()}if(r&2){let e=d.ngIf,o=u().$implicit,t=u(3);l(),G("jp-invalid-cell",t.isInvalidGroup(o.subjectId,e.accYrId,e.grpId)),S("ngModel",e.count),l(),s("ngIf",t.isInvalidGroup(o.subjectId,e.accYrId,e.grpId))}}function Ui(r,d){r&1&&(n(0,"span",125),a(1,"-"),i())}function $i(r,d){if(r&1&&(n(0,"td",120),g(1,Hi,3,4,"ng-container",121)(2,Ui,2,0,"ng-template",null,2,me),i()),r&2){let e=d.$implicit,o=X(3),t=u().$implicit;l(),s("ngIf",t.cellsBySubjectId==null?null:t.cellsBySubjectId[e.subjectId])("ngIfElse",o)}}function zi(r,d){if(r&1){let e=T();n(0,"tr",109)(1,"td",110),a(2),i(),n(3,"td",111),a(4),i(),n(5,"td",112)(6,"div",113),a(7),i(),n(8,"div",114)(9,"div"),a(10,"Total: "),n(11,"span",115),a(12),i()(),n(13,"div"),a(14,"Assigned: "),n(15,"span",115),a(16),i()(),n(17,"div"),a(18," Remaining: "),n(19,"span",115),a(20),i()()()(),n(21,"td",116)(22,"button",117),f("click",function(){let t=v(e).$implicit,c=u(2);return _(c.removeInvitedRow(t))}),y(23,"i",118),i()(),g(24,$i,4,2,"td",119),i()}if(r&2){let e=d.$implicit,o=u(2);l(2),h(e.departmentLabel),l(2),h(e.accYearLabel),l(3),h(e.groupName),l(5),h(e.totalStudentsInGroup||0),l(4),h(e.assignedElectiveCount||0),l(3),G("text-danger",(e.remainingStudents||0)<0)("text-muted",(e.remainingStudents||0)>=0),l(),h(e.remainingStudents||0),l(4),s("ngForOf",o.columnDefs||Y(11,re))}}function qi(r,d){if(r&1){let e=T();D(0),n(1,"input",128),f("ngModelChange",function(t){v(e);let c=u().$implicit,p=u(2);return _(p.onPoolTotalChange(c.subjectId,t))}),i(),j()}if(r&2){let e=u().$implicit,o=u(2);l(),G("jp-invalid-cell",o.isInvalidTotal(e.subjectId)),s("ngModel",e.total)}}function Ki(r,d){if(r&1&&(n(0,"span"),a(1),i()),r&2){let e=u().$implicit,o=u(2);G("text-danger",o.isInvalidTotal(e.subjectId)),l(),h(e.total)}}function Qi(r,d){if(r&1&&(n(0,"small",129),a(1),i()),r&2){let e=u().$implicit,o=u(2);l(),I(" ",o.getErrorForTotal(e.subjectId)," ")}}function Xi(r,d){if(r&1&&(n(0,"td",126),g(1,qi,2,3,"ng-container",121)(2,Ki,2,3,"ng-template",null,3,me)(4,Qi,2,1,"small",127),i()),r&2){let e=d.$implicit,o=X(3),t=u(2);l(),s("ngIf",t.selectedCapMode==="POOL")("ngIfElse",o),l(3),s("ngIf",t.isInvalidTotal(e.subjectId))}}function Ji(r,d){if(r&1&&(n(0,"small",130),a(1),i()),r&2){let e=d.$implicit,o=u(2);s("hidden",!o.isInvalidTotal(e.subjectId)),l(),L(" ",e.batchName,": ",o.getErrorForTotal(e.subjectId)," ")}}function Zi(r,d){if(r&1&&(n(0,"div",90)(1,"div",91)(2,"table",92)(3,"thead")(4,"tr",93)(5,"th",94),a(6,"Department"),i(),n(7,"th",95),a(8,"Acc Year"),i(),n(9,"th",96
1),a(10,"Group"),i(),y(11,"th",97),g(12,Gi,7,5,"th",98),i()(),n(13,"tbody"),g(14,zi,25,12,"tr",99),i(),n(15,"tfoot")(16,"tr",100)(17,"td",101),a(18,"Total"),i(),g(19,Xi,5,3,"td",102),i()()()(),n(20,"div",103)(21,"div",104),g(22,Ji,2,3,"small",105),i()()()),r&2){let e=u();l(12),s("ngForOf",e.columnDefs||Y(4,re)),l(2),s("ngForOf",e.groupRows||Y(5,re)),l(5),s("ngForOf",e.columnDefs||Y(6,re)),l(3),s("ngForOf",e.columnDefs||Y(7,re))}}function en(r,d){r&1&&(n(0,"div")(1,"div",131),a(2,"No elective subjects found for selected filters."),i()())}function tn(r,d){if(r&1&&(n(0,"ng-option",76),a(1),i()),r&2){let e=d.$implicit;s("value",e.departmentID),l(),h(e.degdep)}}function nn(r,d){if(r&1&&(n(0,"ng-option",76),a(1),i()),r&2){let e=d.$implicit;s("value",e.id),l(),L(" ",e.startYear,"-",e.endYear," ")}}function an(r,d){if(r&1&&(n(0,"ng-option",76),a(1),i()),r&2){let e=d.$implicit;s("value",e.id),l(),h(e.groupName)}}function rn(r,d){if(r&1){let e=T();n(0,"div",132)(1,"div",133)(2,"div",134)(3,"h2",135),a(4,"Add invited group"),i(),n(5,"button",136),f("click",function(){v(e);let t=u();return _(t.closeAddGroupModal())}),a(6,"Close"),i()(),n(7,"div",137)(8,"p",138),a(9," Adds department / acc year / section row(s) for "),n(10,"strong"),a(11,"all"),i(),a(12," elective subjects in this matrix. You can select "),n(13,"strong"),a(14,"multiple groups"),i(),a(15," at once. POOL: use count "),n(16,"strong"),a(17,"0"),i(),a(18," for eligibility only; set the pool cap in the Total row. "),i(),n(19,"div")(20,"label",10),a(21,"Department"),n(22,"span",11),a(23,"*"),i()(),n(24,"ng-select",139),x("ngModelChange",function(t){v(e);let c=u();return C(c.addGroupDepartmentId,t)||(c.addGroupDepartmentId=t),_(t)}),f("change",function(){v(e);let t=u();return _(t.onAddGroupDeptChange())}),g(25,tn,2,2,"ng-option",13),i()(),n(26,"div")(27,"label",10),a(28,"Acc year"),n(29,"span",11),a(30,"*"),i()(),n(31,"ng-select",140),x("ngModelChange",function(t){v(e);let c=u();return C(c.addGroupAccYearId,t)||(c.addGroupAccYearId=t),_(t)}),f("change",function(){v(e);let t=u();return _(t.onAddGroupAccYearChange())}),g(32,nn,2,3,"ng-option",13),i()(),n(33,"div")(34,"label",10),a(35,"Group (section)"),n(36,"span",11),a(37,"*"),i()(),n(38,"ng-select",141),x("ngModelChange",function(t){v(e);let c=u();return C(c.addGroupGroupIds,t)||(c.addGroupGroupIds=t),_(t)}),g(39,an,2,2,"ng-option",13),i()()(),n(40,"div",142)(41,"button",136),f("click",function(){v(e);let t=u();return _(t.closeAddGroupModal())}),a(42,"Cancel"),i(),n(43,"button",143),f("click",function(){v(e);let t=u();return _(t.confirmAddInvitedGroup())}),a(44,"Add to grid"),i()()()()}if(r&2){let e=u();l(24),s("searchable",!0)("clearable",!1),S("ngModel",e.addGroupDepartmentId),s("loading",e.loadingAddGroupPicker),l(),s("ngForOf",e.addGroupDeptOptions),l(6),s("searchable",!0)("clearable",!1),S("ngModel",e.addGroupAccYearId),s("disabled",!e.addGroupDepartmentId),l(),s("ngForOf",e.addGroupAccYearOptions),l(6),s("multiple",!0)("closeOnSelect",!1)("searchable",!0)("clearable",!0),S("ngModel",e.addGroupGroupIds),s("disabled",!e.addGroupAccYearId)("loading",e.loadingAddGroupPicker),l(),s("ngForOf",e.addGroupGroupOptions)}}function on(r,d){if(r&1&&(n(0,"tr",109)(1,"td",153),a(2),i(),n(3,"td",154),a(4),i(),n(5,"td",154),a(6),i(),n(7,"td",154),a(8),i()()),r&2){let e=d.$implicit;l(2),h(e.label),l(2),h(e.field),l(2),h(e.oldValue),l(2),h(e.newValue)}}function ln(r,d){r&1&&(n(0,"span"),a(1,"Confirm save"),i())}function cn(r,d){r&1&&(n(0,"span",155),y(1,"span",81),a(2," Saving\u2026 "),i())}function sn(r,d){if(r&1){let e=T();n(0,"div",144)(1,"div",145)(2,"div",134)(3,"h2",146),a(4,"Changed cells preview"),i(),n(5,"button",136),f("click",function(){v(e);let t=u();return _(t.closePreviewModal())}),a(6,"Close"),i()(),n(7,"div",147)(8,"div",148)(9,"table",149)(10,"thead")(11,"tr",93)(12,"th",150),a(13,"Subject"),i(),n(14,"th",150),a(15,"Field"),i(),n(16,"th",150),a(17,"Old"),i(),n(18,"th",150),a(19,"New"),i()()(),n(20,"tbody"),g(21,on,9,4,"tr",99),i()()()(),n(22,"div",151)(23,"button",136),f("click",function(){v(e);let t=u();return _(t.closePreviewModal())}),a(24,"Cancel"),i(),n(25,"button",31),f("click",function(){v(e);let t=u();return _(t.confirmSave())}),g(26,ln,2,0,"span",32)(27,cn,3,0,"span",152),i()()()()}if(r&2){let e=u();l(21),s("ngForOf",e.previewChanges),l(4),s("disabled",e.isSaving),l(),s("ngIf",!e.isSaving),l(),s("ngIf",e.isSaving)}}function dn(r,d){r&1&&(n(0,"span"),a(1,"Set deadline"),i())}function pn(r,d){r&1&&(n(0,"span"),y(1,"span",81),n(2,"span",169),a(3,"Loading"),i()())}function mn(r,d){if(r&1){let e=T();n(0,"div",158)(1,"div",159)(2,"input",160),x("ngModelChange",function(t){let c=v(e).$implicit;return C(c.selectedForBulk,t)||(c.selectedForBulk=t),_(t)}),f("change",function(){v(e);let t=u(2);return _(t.updateSelectAllDeadlineRows())}),i(),n(3,"span",161),a(4),i()(),n(5,"div",162)(6,"div",163)(7,"label",10),a(8,"Opening time"),i()(),n(9,"div",164)(10,"input",165),x("ngModelChange",function(t){let c=v(e).$implicit;return C(c.deadlineDate,t)||(c.deadlineDate=t),_(t)}),i()(),n(11,"div",163)(12,"div",59)(13,"input",166),x("ngModelChange",function(t){let c=v(e).$implicit;return C(c.deadlineTime,t)||(c.deadlineTime=t),_(t)}),i(),n(14,"button",61),a(15," Pick "),i()(),y(16,"ngx-material-timepicker",62,4),i(),n(18,"div",167)(19,"button",168),f("click",function(){let t=v(e).$implicit,c=u(2);return _(c.setDeadline(c.getDeptAccYearId(t),t.deadlineDate,t.deadlineTime))}),g(20,dn,2,0,"span",32)(21,pn,4,0,"span",32),i()()()()}if(r&2){let e=d.$implicit,o=d.index,t=X(17),c=u(2);
1l(2),ne("name","selectDept"+o),S("ngModel",e.selectedForBulk),l(2),h(c.getDeadlineRowLabel(e)),l(6),ne("name","deadlineManage"+o),S("ngModel",e.deadlineDate),s("bsConfig",Y(15,st)),l(3),ne("name","timeManage"+o),s("ngxTimepicker",t),S("ngModel",e.deadlineTime),l(),s("ngxTimepicker",t),l(2),s("enableKeyboardInput",!0)("format",12),l(3),s("disabled",!e.deadlineDate||!e.deadlineTime||!c.getDeptAccYearId(e)||c.isDepartmentLoading(c.getDeptAccYearId(e))),l(),s("ngIf",!c.isDepartmentLoading(c.getDeptAccYearId(e))),l(),s("ngIf",c.isDepartmentLoading(c.getDeptAccYearId(e)))}}function un(r,d){if(r&1&&(n(0,"div",156),g(1,mn,22,16,"div",157),i()),r&2){let e=u();l(),s("ngForOf",e.elecSubDepartments)}}function gn(r,d){r&1&&(n(0,"div",131),a(1,"No departments found for selected filters."),i())}function vn(r,d){if(r&1&&(n(0,"ng-option",76),a(1),i()),r&2){let e=d.$implicit;s("value",e),l(),h(e)}}function _n(r,d){if(r&1&&(n(0,"ng-option",76),a(1),i()),r&2){let e=d.$implicit;s("value",e),l(),h(e)}}function hn(r,d){if(r&1){let e=T();n(0,"div",170)(1,"input",171),x("ngModelChange",function(t){let c=v(e).$implicit;return C(c.check,t)||(c.check=t),_(t)}),f("click",function(){let t=v(e).$implicit,c=u();return _(c.selectThisDeptAccYr(t.departmentID))}),i(),n(2,"label",172),a(3),i()()}if(r&2){let e=d.$implicit,o=d.index;l(),ne("name","exportCheckDept"+o),S("ngModel",e.check),l(2),h(e.degdep)}}function fn(r,d){r&1&&(n(0,"span"),y(1,"i",26),a(2," Download"),i())}function bn(r,d){r&1&&(n(0,"span"),y(1,"span",81),a(2," Loading..."),i())}var dt=(()=>{class r{facultyService;electiveService;subjectService;deptService;groupService;userService;datePipe;toastr;facultyData=[];getElective=[];years=[];semType=[];accYearScopeStart=null;accYearScopeEnd=null;facultyId;configType;yearOfBatch;semesterType;selectedCapMode=null;matrixData=[];columnDefs=[];groupRows=[];slotLookup={};originalMatrixData=[];previewChanges=[];showPreviewModal=!1;elecSubDepartments=[];loadingDepartments=new Map;bulkDeadlineDate=null;bulkDeadlineTime="";selectAllDeadlineRows=!0;validationErrors={};hasValidationErrors=!1;isLoading=!1;isSaving=!1;isSyncingSlotData=!1;currentUser;matrixLoadRequestId=0;file=null;isExcelLoading=!1;isUploading=!1;departments=[];deptIds=[];startYear=null;endYear=null;showAddGroupModal=!1;loadingAddGroupPicker=!1;addGroupDeptOptions=[];addGroupAccYearOptions=[];addGroupGroupOptions=[];addGroupDepartmentId=null;addGroupAccYearId=null;addGroupGroupIds=[];constructor(e,o,t,c,p,m,w,E){this.facultyService=e,this.electiveService=o,this.subjectService=t,this.deptService=c,this.groupService=p,this.userService=m,this.datePipe=w,this.toastr=E}ngOnInit(){this.userService.getCurrentUser().then(e=>{this.currentUser=e}),this.facultyService.getAllFacultys().then(e=>{this.facultyData=e||[],this.years=["2021","2022","2023","2024","2025","2026","2027","2028","2029","2030","2031","2032","2033","2034","2035","2036","2037","2038","2039","2040"],this.semType=["Odd","Even"]})}getAllElectiveConfig(e){this.configType=null,this.yearOfBatch=null,this.semesterType=null,this.accYearScopeStart=null,this.accYearScopeEnd=null,this.clearLoadedData(),this.electiveService.getElectiveConfig(e).then(o=>{this.getElective=o||[],this.getDepartmentsByFacId()})}onConfigChange(){this.yearOfBatch=null,this.semesterType=null,this.selectedCapMode=this.resolveCapModeLabel(),this.clearLoadedData()}resolveCapModeLabel(){if(!this.configType||!this.getElective?.length)return null;let e=this.getElective.find(o=>o.id===this.configType);return e?.capMode&&String(e.capMode).toUpperCase()==="POOL"?"POOL":"PARTITIONED"}onYearChange(){this.semesterType=null,this.clearLoadedData()}onSemTypeChange(){this.clearLoadedData()}onAccYearScopeChange(){this.clearLoadedData()}clearLoadedData(){this.matrixData=[],this.columnDefs=[],this.groupRows=[],this.slotLookup={},this.originalMatrixData=[],this.previewChanges=[],this.elecSubDepartments=[],this.showPreviewModal=!1,this.validationErrors={},this.hasValidationErrors=!1}getDepartmentsByFacId(){if(!this.facultyId){this.departments=[],this.deptIds=[];return}this.deptService.getDepartmentsByFacId(this.facultyId).then(e=>{this.departments=Array.isArray(e)?e:[],this.deptIds=[]})}onSelect(e){if(!e||!e.length){this.file=null;return}this.file=e[0]}clearSelectedFile(){this.file=null;let e=document.getElementById("electiveCountManageFile");e&&(e.value="")}
1uploadExcel(){if(!this.file||!this.facultyId||!this.configType||!this.yearOfBatch||!this.semesterType){this.toastr.error("Select required filters and file before upload");return}this.isUploading=!0;let e=new FormData;e.append("file",this.file),this.subjectService.importElectiveSubCount(e,this.configType,this.semesterType,this.yearOfBatch).then(o=>{if(o?.error?.error){this.toastr.error(o.error.error);return}this.toastr.success("Elective Count Imported Successfully"),this.clearSelectedFile()}).finally(()=>{this.isUploading=!1})}selectThisDeptAccYr(e){let o=this.deptIds.indexOf(e);if(o===-1){this.deptIds.push(e);return}this.deptIds.splice(o,1)}exportAsXLSX(){if(!this.configType||!this.yearOfBatch||!this.semesterType||!this.startYear||!this.endYear||!this.deptIds.length){this.toastr.error("Select start/end year and at least one department");return}this.isExcelLoading=!0,this.subjectService.exportElectiveSubject(this.configType,this.yearOfBatch,this.semesterType,this.startYear,this.endYear,this.deptIds).then(()=>{let e=d
1ocument.getElementById("exportElectiveCountModalClose");e&&e.click()}).finally(()=>{this.isExcelLoading=!1})}canLoad(){return!!(this.facultyId&&this.configType&&this.yearOfBatch&&this.semesterType)}canShowSlotSyncAction(){return this.currentUser?.userType==="ADMIN"}accYearScopeValid(){let e=this.accYearScopeStart,o=this.accYearScopeEnd;return!e&&!o?!0:!!(e&&o)}normalizeElectiveTotalsForMatrix(){if(this.selectedCapMode==="POOL"){this.syncUnifiedColumnTotals();return}(this.matrixData||[]).forEach(e=>{(e.slots||[]).forEach(o=>{o.electiveCount=this.sumInvitedGroupCounts(o)}),this.syncSlotColumnTotals(e)}),this.syncUnifiedColumnTotals()}canManageInvitedRows(){return this.canLoad()&&(this.columnDefs?.length||0)>0}openAddGroupModal(){if(!this.canManageInvitedRows()){this.toastr.error("Load counts first (need elective subjects for selected filters)");return}this.showAddGroupModal=!0,this.addGroupDepartmentId=null,this.addGroupAccYearId=null,this.addGroupGroupIds=[],this.addGroupAccYearOptions=[],this.addGroupGroupOptions=[],!(!this.facultyId||!this.yearOfBatch||!this.semesterType)&&(this.loadingAddGroupPicker=!0,this.deptService.getAllAccyear(this.semesterType,this.yearOfBatch,this.facultyId).then(e=>{let o=this.normalizeDeptAccYearList(e);this.addGroupDeptOptions=o.filter(t=>this.getDeptAccYearsForPicker(t).length>0),this.addGroupDeptOptions.length||this.toastr.warning("No departments with acc years for this faculty, batch year, and semester")},()=>{this.toastr.error("Failed to load departments")}).finally(()=>{this.loadingAddGroupPicker=!1}))}closeAddGroupModal(){this.showAddGroupModal=!1}onAddGroupDeptChange(){this.addGroupAccYearId=null,this.addGroupGroupIds=[],this.addGroupGroupOptions=[];let e=this.findAddGroupDept();this.addGroupAccYearOptions=e?this.getDeptAccYearsForPicker(e):[]}onAddGroupAccYearChange(){if(this.addGroupGroupIds=[],this.addGroupGroupOptions=[],!this.addGroupAccYearId||!this.yearOfBatch||!this.semesterType)return;let e=this.addGroupAccYearOptions.find(c=>c.id===this.addGroupAccYearId),o=this.resolveSemForBatch(e);this.loadingAddGroupPicker=!0,(o!=null?this.groupService.getGroupBySem(this.addGroupAccYearId,o):this.groupService.getGroupByYear(this.addGroupAccYearId,this.yearOfBatch)).then(c=>{this.addGroupGroupOptions=this.normalizeGroupList(c),this.addGroupGroupOptions.length||this.toastr.warning("No groups found for this acc year and batch")},()=>{this.toastr.error("Failed to load groups")}).finally(()=>{this.loadingAddGroupPicker=!1})}confirmAddInvitedGroup(){let e=Array.isArray(this.addGroupGroupIds)?this.addGroupGroupIds.filter(Boolean):[];if(!this.addGroupDepartmentId||!this.addGroupAccYearId||!e.length){this.toastr.error("Select department, acc year, and at least one group");return}let o=this.findAddGroupDept(),t=this.addGroupAccYearOptions.find(E=>E.id===this.addGroupAccYearId);if(!o||!t){this.toastr.error("Invalid selection");return}let c=e.map(E=>this.addGroupGroupOptions.find(k=>k.id===E)).filter(E=>!!E);if(!c.length){this.toastr.error("Invalid group selection");return}let p=0,m=0;if(c.forEach(E=>{if(this.hasInvitedRow(this.addGroupAccYearId,E.id)){m++;return}this.appendInvitedRow(this.buildInvitedGridRow(o,t,E)),p++}),!p){this.toastr.warning(m?"Selected group(s) are already in the matrix":"No groups were added");return}this.validateMatrix(),this.closeAddGroupModal();let w=m?` (${m} already in matrix skipped)`:"";this.toastr.success(p===1?`Invited group added${w} \u2014 set counts in the grid, then Preview & Save`:`${p} invited groups added${w} \u2014 set counts in the grid, then Preview & Save`)}removeInvitedRow(e){!e?.accYrId||!e?.grpId||(this.groupRows=(this.groupRows||[]).filter(o=>!(o.accYrId===e.accYrId&&o.grpId===e.grpId)),(this.matrixData||[]).forEach(o=>{(o.slots||[]).forEach(t=>{let c=Array.isArray(t.invitedDepartments)?t.invitedDepartments:[];t.invitedDepartments=c.filter(p=>!(p.accYrId===e.accYrId&&p.grpId===e.grpId))})}),this.buildSlotLookup(),this.normalizeElectiveTotalsForMatrix(),this.validateMatrix())}onPoolTotalChange(e,o){let t=this.slotLookup[e];if(!t)return;let c=this.toNumber(o);t.electiveCount=c;let p=(this.columnDefs||[]).find(m=>m.subjectId===e);p&&(p.total=c),this.validateMatrix()}normalizeDeptAccYearList(e){if(Array.isArray(e))return e;if(typeof e=="string"&&e.trim())try{let o=JSON.parse(e);return Array.isArray(o)?o:[]}catch{return[]}return[]}normalizeGroupList(e){return Array.isArray(e)?e:e&&Array.isArray(e.data)?e.data:[]}getDeptAccYearsForPicker(e){if(!e)return[];let o=Array.isArray(e.accyearList)?e.accyearList:[];return this.accYearScopeStart&&this.accYearScopeEnd&&(o=o.filter(t=>this.accYearInScope(t,this.accYearScopeStart,this.accYearScopeEnd))),o.filter(t=>Array.isArray(t.years)&&t.years.length>0)}findAddGroupDept(){return this.addGroupDepartmentId?(this.addGroupDeptOptions||[]).find(e=>e.departmentID===this.addGroupDepartmentId):null}accYearInScope(e,o,t){let c=parseInt(String(e?.startYear),10),p=parseInt(String(e?.endYear),10),m=parseInt(o,10),w=parseInt(t,10);return Number.isNaN(c)||Number.isNaN(p)||Number.isNaN(m)||Number.isNaN(w)?!0:c<=w&&p>=m}resolveSemForBatch(e){let t=(Array.isArray(e?.years)?e.years:[]).find(p=>String(p?.year)===String(this.yearOfBatch)&&String(p?.semType)===String(this.semesterType));if(t?.sem==null)return null;
1let c=parseInt(String(t.sem),10);return Number.isNaN(c)?null:c}hasInvitedRow(e,o){return(this.groupRows||[]).some(t=>t.accYrId===e&&t.grpId===o)}buildInvitedGridRow(e,o,t){let c=Array.isArray(t?.studentList)?t.studentList.length:0,p=`${o.startYear}-${o.endYear}`,m={};return Object.keys(this.slotLookup||{}).forEach(w=>{m[w]={accYrId:o.id,grpId:t.id,count:0,__prevCount:0}}),{accYrId:o.id,grpId:t.id,departmentId:o.departmentId||e?.departmentId,departmentLabel:e.degdep,accYearLabel:p,groupName:t.groupName,totalStudentsInGroup:c,assignedElectiveCount:0,remainingStudents:c,cellsBySubjectId:m}}appendInvitedRow(e){this.groupRows=[...this.groupRows||[],e];let o={accYrId:e.accYrId,grpId:e.grpId,count:0,departmentLabel:e.departmentLabel,accYearLabel:e.accYearLabel,groupName:e.groupName};(this.matrixData||[]).forEach(t=>{(t.slots||[]).forEach(c=>{Array.isArray(c.invitedDepartments)||(c.invitedDepartments=[]),c.invitedDepartments.push(oe({},o))})}),this.buildSlotLookup(),this.normalizeElectiveTotalsForMatrix()}syncSlotColumnTotals(e){let o=Array.isArray(e?.slots)?e.slots:[];(Array.isArray(e?.slotColumns)?e.slotColumns:[]).forEach(c=>{let p=o.find(m=>m.subjectId===c.subjectId);c.total=p?p.electiveCount:0})}buildSlotLookup(){let e={};(this.matrixData||[]).forEach(o=>{(o.slots||[]).forEach(t=>{e[t.subjectId]=t})}),this.slotLookup=e}syncUnifiedColumnTotals(){(this.columnDefs||[]).forEach(e=>{let o=this.slotLookup[e.subjectId];e.total=o?o.electiveCount:0})}initializeCellTracking(){(this.groupRows||[]).forEach(e=>{let o=e?.cellsBySubjectId||{};Object.keys(o).forEach(t=>{let c=o[t];c.__prevCount=this.toNumber(c?.count)})})}loadMatrix(){if(!this.canLoad())return;if(!this.accYearScopeValid()){this.toastr.warning("Select both acc year start and end, or clear both, to filter.");return}let e=this.accYearScopeStart||null,o=this.accYearScopeEnd||null,t=e&&o?e:null,c=e&&o?o:null;this.isLoading=!0;let p=++this.matrixLoadRequestId;this.subjectService.getElectiveCountMatrix(this.facultyId,this.configType,this.yearOfBatch,this.semesterType,t,c).then(m=>{p===this.matrixLoadRequestId&&(this.matrixData=Array.isArray(m?.subjectGroups)?m.subjectGroups:[],this.columnDefs=Array.isArray(m?.columnDefs)?m.columnDefs:[],this.groupRows=Array.isArray(m?.groupRows)?m.groupRows:[],this.buildSlotLookup(),this.initializeCellTracking(),this.normalizeElectiveTotalsForMatrix(),this.originalMatrixData=JSON.parse(JSON.stringify(this.matrixData)),this.validationErrors={},this.hasValidationErrors=!1)}).finally(()=>{p===this.matrixLoadRequestId&&(this.isLoading=!1)})}sumInvitedGroupCounts(e){let o=Array.isArray(e.invitedDepartments)?e.invitedDepartments:[],t=0;return o.forEach(c=>{let p=parseInt(c.count,10);t+=Number.isNaN(p)?0:p}),t}toNumber(e){let o=parseInt(e,10);return Number.isNaN(o)?0:o}onGridCountInput(e,o,t){let c=this.slotLookup[e];if(!c||!o)return;let p=this.toNumber(o.__prevCount),m=Array.isArray(c.invitedDepartments)?c.invitedDepartments:[],w=m.find(k=>k.accYrId===o.accYrId&&k.grpId===o.grpId);w||(w={accYrId:o.accYrId,grpId:o.grpId,count:0},m.push(w),c.invitedDepartments=m),w.count=o.count;let E=this.toNumber(o.count);t&&(t.assignedElectiveCount=this.toNumber(t.assignedElectiveCount)-p+E,t.remainingStudents=this.toNumber(t.totalStudentsInGroup)-this.toNumber(t.assignedElectiveCount)),o.__prevCount=E}onGridCountBlur(e,o,t){this.onGridCountInput(e,o,t);let c=this.slotLookup[e];c&&(this.selectedCapMode!=="POOL"&&(c.electiveCount=this.sumInvitedGroupCounts(c),this.syncUnifiedColumnTotals()),this.validateMatrix())}getElectiveSubAccYear(){if(this.canLoad()){if(this.selectAllDeadlineRows=!0,this.bulkDeadlineDate=null,this.bulkDeadlineTime="",(this.groupRows||[]).length>0){this.elecSubDepartments=this.buildDeadlineRowsFromMatrix(),this.loadDeadlinePrefills();return}this.subjectService.getElectiveSubAccYear(this.facultyId,this.configType,this.semesterType,this.yearOfBatch).then(e=>{this.elecSubDepartments=this.normalizeDeadlineRows(Array.isArray(e)?e:[]),this.loadDeadlinePrefills()})}}buildDeadlineRowsFromMatrix(){let e=new Map;return(this.groupRows||[]).forEach(o=>{let t=o?.accYrId;if(!t)return;let c=`${o.departmentLabel||""}|${t}`;e.has(c)||e.set(c,{accYearId:t,accYrId:t,degdep:o.departmentLabel||"",accYearLabel:o.accYearLabel||"",selectedForBulk:!0,deadlineDate:null,deadlineTime:""})}),Array.from(e.values())}normalizeDeadlineRows(e){return e.map(o=>{let t=this.getDeptAccYearId(o),c=o?.accyearList?.[0];return Se(oe({},o),{accYearId:t||o?.accYearId,accYrId:t||o?.accYrId,accYearLabel:o?.accYearLabel||o?.accyear||(c?.startYear&&c?.endYear?`${c.startYear}-${c.endYear}`:""),selectedForBulk:o?.selectedForBulk!==!1,deadlineDate:o?.deadlineDate??null,deadlineTime:o?.deadlineTime??""})})}loadDeadlinePrefills(){this.selectAllDeadlineRows=this.elecSubDepartments.length>0&&this.elecSubDepartments.every(e=>
1e.selectedForBulk!==!1),(this.elecSubDepartments||[]).forEach((e,o)=>{e.selectedForBulk===void 0&&(e.selectedForBulk=!0);let t=this.getDeptAccYearId(e);t&&this.electiveService.getElectiveDeadlineByFilter(this.facultyId,this.configType,this.yearOfBatch,this.semesterType,t).then(c=>{if(Array.isArray(c)&&c.length>0&&c[0].date){let p=c[0].date.split(" ")[0],m=c[0].date.split(" ")[1].concat(" ",c[0].date.split(" ")[2]);this.elecSubDepartments[o].deadlineDate=this.datePipe.transform(p,"MM/dd/yyyy"),this.elecSubDepartments[o].deadlineTime=this.normalizeTimeForDisplay(m)}})})}setDeadline(e,o,t,c=!1){if(!e)return c||this.toastr.error("Missing acc year id for selected department"),Promise.reject();if(!o||!t)return Promise.resolve();let p=this.toMeridianTime(t),m=this.datePipe.transform(o,"dd-MMM-yyyy")?.concat(" ",p),w=this.datePipe.transform(m,"dd-MMM-yyyy hh:mm a"),E={};return E.facultyId=this.facultyId,E.electiveConfigTypeId=this.configType,E.year=this.yearOfBatch,E.semType=this.semesterType,E.date=w,E.accYearId=e,this.loadingDepartments.set(e,!0),this.electiveService.createElectiveDeadline(E).then(()=>{this.loadingDepartments.set(e,!1),c||this.toastr.success("Deadline Created Successfully")},()=>(this.loadingDepartments.set(e,!1),c||this.toastr.error("Failed to set deadline"),Promise.reject()))}isDepartmentLoading(e){return this.loadingDepartments.get(e)===!0}toggleSelectAllDeadlineRows(){this.elecSubDepartments.forEach(e=>{e.selectedForBulk=this.selectAllDeadlineRows})}updateSelectAllDeadlineRows(){this.selectAllDeadlineRows=this.elecSubDepartments.length>0&&this.elecSubDepartments.every(e=>!!e.selectedForBulk)}applyBulkDeadlineToSelected(){if(!this.bulkDeadlineDate||!this.bulkDeadlineTime){this.toastr.error("Select bulk date and time first");return}let e=this.elecSubDepartments.filter(c=>c.selectedForBulk);if(!e.length){this.toastr.error("Select at least one department");return}let o=e.filter(c=>!this.getDeptAccYearId(c));if(o.length>0){this.toastr.error(`Cannot apply bulk deadline: ${o.length} selected row(s) missing acc year`);return}let t=e.map(c=>this.setDeadline(this.getDeptAccYearId(c),this.bulkDeadlineDate,this.bulkDeadlineTime,!0));Promise.allSettled(t).then(c=>{let p=c.filter(m=>m.status==="rejected").length;p>0?this.toastr.error(`Bulk apply completed with ${p} failure(s)`):(e.forEach(m=>{m.deadlineDate=this.datePipe.transform(this.bulkDeadlineDate,"MM/dd/yyyy"),m.deadlineTime=this.normalizeTimeForDisplay(this.bulkDeadlineTime)}),this.toastr.success("Deadline applied to selected departments"),this.closeDeadlineModal())})}closeDeadlineModal(){let e=document.getElementById("deadlineModalCloseManage");e&&e.click()}toMeridianTime(e){if(!e)return"";if(e.toUpperCase().includes("AM")||e.toUpperCase().includes("PM"))return e;let o=e.split(":");if(o.length<2)return e;let t=parseInt(o[0],10),c=o[1],p=t>=12?"PM":"AM";return t=t%12,t===0&&(t=12),`${t<10?`0${t}`:`${t}`}:${c} ${p}`}to24HourTime(e){if(!e)return"";if(!e.toUpperCase().includes("AM")&&!e.toUpperCase().includes("PM"))return e;let[o,t]=e.split(" "),[c,p]=o.split(":"),m=parseInt(c,10);return t.toUpperCase()==="PM"&&m<12&&(m+=12),t.toUpperCase()==="AM"&&m===12&&(m=0),`${m<10?`0${m}`:`${m}`}:${p}`}normalizeTimeForDisplay(e){return e?e.toUpperCase().includes("AM")||e.toUpperCase().includes("PM")?e:this.toMeridianTime(e):""}getTotalKey(e){return`${e}__total`}getGroupKey(e,o){return`${e}__${o}`}getGroupAccYearKey(e,o,t){return`${e}__${o}__${t}`}getDeptAccYearId(e){return e?.accYearId||e?.accYrId||e?.accyearList?.[0]?.id||""}getDeadlineRowLabel(e){let o=e?.degdep||e?.departmentLabel||"",t=e?.accYearLabel||e?.accyear||"";return t?`${o} \xB7 ${t}`:o}validateMatrix(){let e={};return(this.matrixData||[]).forEach(o=>{(o.slots||[]).forEach(t=>{let c=Array.isArray(t.invitedDepartments)?t.invitedDepartments:[],p=0;
1c.forEach(E=>{let k=parseInt(E.count,10),M=this.getGroupAccYearKey(t.subjectId,E.accYrId,E.grpId);if(Number.isNaN(k)){e[M]="Count must be numeric";return}if(k<0){e[M]="Count must be >= 0";return}p+=k});let m=parseInt(t.electiveCount,10),w=this.getTotalKey(t.subjectId);Number.isNaN(m)?e[w]="Total must be numeric":this.selectedCapMode!=="POOL"&&m!==p&&(e[w]=`Total must equal sum of group counts (${p})`)})}),this.validationErrors=e,this.hasValidationErrors=Object.keys(e).length>0,!this.hasValidationErrors}isInvalidTotal(e){return!!this.validationErrors[this.getTotalKey(e)]}isInvalidGroup(e,o,t){return!!this.validationErrors[this.getGroupAccYearKey(e,o,t)]}getErrorForTotal(e){return this.validationErrors[this.getTotalKey(e)]}getErrorForGroup(e,o,t){return this.validationErrors[this.getGroupAccYearKey(e,o,t)]}buildPayload(){let e=[];return(this.matrixData||[]).forEach(o=>{(o.slots||[]).forEach(t=>{e.push({subjectId:t.subjectId,electiveCount:parseInt(t.electiveCount,10)||0,invitedDepartments:(t.invitedDepartments||[]).map(c=>({accYrId:c.accYrId,grpId:c.grpId,count:parseInt(c.count,10)||0}))})})}),e}openPreviewModal(){if(!(!this.canLoad()||this.matrixData.length===0)){if(!this.validateMatrix()){this.toastr.error("Please fix highlighted validation errors before preview");return}if(this.previewChanges=this.calculateChanges(),this.previewChanges.length===0){this.toastr.info("No changes detected");return}this.showPreviewModal=!0}}closePreviewModal(){this.showPreviewModal=!1}calculateChanges(){let e={};(this.originalMatrixData||[]).forEach(t=>{(t.slots||[]).forEach(c=>{e[c.subjectId]=c})});let o=[];return(this.matrixData||[]).forEach(t=>{(t.slots||[]).forEach(c=>{let p=e[c.subjectId];if(!p)return;let m=parseInt(c.electiveCount,10)||0,w=parseInt(p.electiveCount,10)||0;m!==w&&o.push({subjectId:c.subjectId,label:`${c.subjectCode}/${c.batchName}`,field:"Total count",oldValue:w,newValue:m});let E={},k=new Set;(p.invitedDepartments||[]).forEach(M=>{let Q=`${M.accYrId}|${M.grpId}`;k.add(Q),E[Q]=parseInt(M.count,10)||0}),(c.invitedDepartments||[]).forEach(M=>{let Q=parseInt(M.count,10)||0,ye=`${M.accYrId}|${M.grpId}`,je=E[ye]??0;k.has(ye)?Q!==je&&o.push({subjectId:c.subjectId,label:`${c.subjectCode}/${c.batchName}`,field:`${M.departmentLabel||""} - ${M.accYearLabel||""} - ${M.groupName||M.grpId}`,oldValue:je,newValue:Q}):o.push({subjectId:c.subjectId,label:`${c.subjectCode}/${c.batchName}`,field:`Added invite ${M.departmentLabel||""} - ${M.accYearLabel||""} - ${M.groupName||M.grpId}`,oldValue:"\u2014",newValue:Q}),delete E[ye]}
1),Object.keys(E).forEach(M=>{o.push({subjectId:c.subjectId,label:`${c.subjectCode}/${c.batchName}`,field:`Removed invite ${M}`,oldValue:E[M],newValue:0})})})}),o}confirmSave(){if(!this.canLoad()||this.matrixData.length===0)return;if(!this.validateMatrix()){this.toastr.error("Please fix highlighted validation errors before save");return}this.isSaving=!0;let e=this.buildPayload();this.subjectService.saveElectiveCountMatrix(this.facultyId,this.configType,this.yearOfBatch,this.semesterType,e).then(o=>{if(o?.error?.error){this.toastr.error(o.error.error);return}this.toastr.success("Elective counts saved successfully"),this.showPreviewModal=!1,this.loadMatrix()}).finally(()=>{this.isSaving=!1})}syncElectiveSlotData(){if(!this.canLoad()){this.toastr.error("Select required filters before sync");return}if(!this.accYearScopeValid()){this.toastr.warning("Select both acc year start and end, or clear both, to filter sync.");return}let e=this.accYearScopeStart||null,o=this.accYearScopeEnd||null,t=e&&o?e:null,c=e&&o?o:null;this.isSyncingSlotData=!0,this.subjectService.syncElectiveCountMatrixBackfill(this.facultyId,this.configType,this.yearOfBatch,this.semesterType,t,c).then(p=>{if(p?.error?.error){this.toastr.error(p.error.error);return}let m=p?.scannedSubjects??0,w=p?.rebuiltSubjects??0,E=p?.studentsPatched??0,k=p?.failedSubjects??0;this.toastr.success(`Sync done. Scanned: ${m}, Rebuilt: ${w}, Patched: ${E}, Failed: ${k}`)}).finally(()=>{this.isSyncingSlotData=!1})}static \u0275fac=function(o){return new(o||r)(b(Ee),b(N),b(O),b(q),b(te),b(P),b(ue),b(W))};static \u0275cmp=A({type:r,selectors:[["app-elective-count-manage"]],decls:147,vars:71,consts:[["BulkTimePicker",""],["noDepartmentForDeadline",""],["noSlotCell",""],["partitionedTotal",""],["RowTimePicker",""],[1,"pb-4",2,"display","flex","flex-direction","column","gap","1rem"],[1,"border-bottom","pb-3"],[1,"jp-section-title","mb-0"],[1,"row","g-4","align-items-end"],[1,"col-12","col-sm-6","col-lg-4","col-xl-2"],[1,"jp-kv-label","mb-1","block"],[1,"text-danger"],["appendTo","body","name","facultyDeptSelect","required","",1,"jp-select-elevated",3,"ngModelChange","change","searchable","clearable","ngModel","placeholder"],[3,"value",4,"ngFor","ngForOf"],["appendTo","body","name","electiveConf","required","",1,"jp-select-elevated",3,"ngModelChange","change","searchable","clearable","ngModel","placeholder"],["class","mt-1 small text-muted",4,"ngIf"],[1,"col-12","col-xl-2"],["appendTo","body","name","year","required","",1,"jp-select-elevated",3,"ngModelChange","change","searchable","clearable","ngModel","placeholder"],["appendTo","body","name","semType","required","",1,"jp-select-elevated",3,"ngModelChange","change","searchable","clearable","ngModel","placeholder"],[1,"font-normal","text-muted"],["appendTo","body","name","accYearStart","placeholder","Any",1,"jp-select-elevated",3,"ngModelChange","change","searchable","clearable","ngModel"],["appendTo","body","name","accYearEnd","placeholder","Any",1,"jp-select-elevated",3,"ngModelChange","change","searchable","clearable","ngModel"],[1,"d-flex","flex-wrap","align-items-end","justify-content-between","gap-3","border-top","border-1","pt-3"],[1,"d-flex","flex-wrap","align-items-end","gap-3"],[2,"min-width","150px"],["type","button","data-bs-toggle","modal","data-bs-target","#exportElectiveCountModal",1,"btn","btn-warning","d-inline-flex","align-items-center","justify-content-center","gap-2",3,"disabled"],["aria-hidden","true",1,"fa","fa-download"],[2,"min-width","300px","max-width","430px"],[1,"d-flex","align-items-center","gap-2"],["type","file","id","electiveCountManageFile",1,"form-control","form-control-sm","shadow-sm",3,"change"],["type","button","class","jp-tw-btn-outline px-2 py-2 text-xs",3,"click",4,"ngIf"],["type","button",1,"btn","btn-success","d-inline-flex","align-items-center","justify-content-center","gap-2",3,"click","disabled"],[4,"ngIf"],[1,"d-flex","flex-wrap","align-items-center","justify-content-end","gap-2"],["type","button",1,"btn","btn-primary","d-inline-flex","align-items-center","gap-2",3,"click","disabled"],["type","button","data-bs-toggle","modal","data-bs-target","#deadlineModalManage",1,"btn","btn-outline-secondary",3,"click","disabled"],["type","button","class","btn btn-outline-warning",3,"disabled","click",4,"ngIf"],["type","button",1,"btn","btn-outline-secondary",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-plus","me-1"],["type","button","class","btn btn-success d-inline-flex align-items-center gap-2",3,"disabled","click",4,"ngIf"],["class","jp-info-banner",4,"ngIf"],["class","rounded border border-1 bg-white shadow-sm",4,"ngIf"],["class","jp-modal-backdrop","role","dialog","aria-modal","true","aria-labelledby","addGroupModalTitle",4,"ngIf"],["class","jp-modal-backdrop","role","dialog","aria-modal","true","aria-labelledby","previewModalTitle",4,"ngIf"],["id","deadlineModalManage","data-bs-backdrop","static","data-bs-keyboard","false","tabindex","-1","aria-labelledby","deadlineModalManageTitle","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
1-dialog-centered","modal-lg",2,"max-width","56rem"],[1,"modal-content","overflow-hidden","rounded","border","border-1","shadow-lg"],[1,"modal-header","border-bottom","border-1","bg-light","px-4","py-3"],["id","deadlineModalManageTitle",1,"modal-title","text-base","fw-semibold","text-dark"],["type","button","data-bs-dismiss","modal","aria-label","Close",1,"btn-close"],[1,"modal-body","bg-white","p-4"],[1,"mb-4","rounded","border","border-1","p-4",2,"background-color","rgba(248, 249, 250, 0.9)"],[1,"row","g-3","align-items-end"],[1,"col-lg-2"],[1,"d-flex","align-items-center","gap-2","pt-1"],["type","checkbox","id","selectAllDeadlineRows",1,"form-check-input","rounded","border-1",2,"width","1rem","height","1rem",3,"ngModelChange","change","ngModel"],["for","selectAllDeadlineRows",1,"mb-0","text-sm","text-muted"],[1,"col-lg-4"],["type","text","placeholder","Select date","bsDatepicker","",1,"form-control","form-control-sm","shadow-sm",3,"ngModelChange","ngModel","bsConfig"],[1,"d-flex","gap-2"],["type","text","placeholder","Select time",1,"form-control","form-control-sm","shadow-sm","flex-grow-1",3,"ngModelChange","ngxTimepicker","ngModel"],["type","button","aria-label","Open time picker",1,"btn","btn-outline-secondary","btn-sm",2,"flex-shrink","0",3,"ngxTimepicker"],[3,"enableKeyboardInput","format"],["type","button",1,"btn","btn-success","w-100","d-inline-flex","align-items-center","justify-content-center",3,"click"],["style","display: flex; flex-direction: column; gap: 1rem;",4,"ngIf","ngIfElse"],[1,"modal-footer","border-top","border-1","bg-light","px-4","py-3"],["type","button","id","deadlineModalCloseManage","data-bs-dismiss","modal",1,"btn","btn-outline-secondary"],["id","exportElectiveCountModal","data-bs-backdrop","static","data-bs-keyboard","false","tabindex","-1","aria-labelledby","exportElectiveCountModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
1-lg"],["id","exportElectiveCountModalLabel",1,"modal-title","text-base","fw-semibold","text-dark"],[1,"col-md-3"],["appendTo","body","name","exportStartYear",1,"jp-select-elevated",3,"ngModelChange","searchable","clearable","ngModel","placeholder"],["appendTo","body","name","exportEndYear",1,"jp-select-elevated",3,"ngModelChange","searchable","clearable","ngModel","placeholder"],[1,"overflow-auto","rounded","border","border-1","p-3",2,"max-height","280px"],["class","d-flex align-items-center gap-2 py-1",4,"ngFor","ngForOf"],["type","button","id","exportElectiveCountModalClose","data-bs-dismiss","modal",1,"btn","btn-outline-secondary"],[3,"value"],[1,"mt-1","small","text-muted"],["type","button",1,"jp-tw-btn-outline","px-2","py-2","text-xs",3,"click"],["aria-hidden","true",1,"fa","fa-times"],["aria-hidden","true",1,"fa","fa-upload"],["role","status","aria-hidden","true",1,"spinner-border","spinner-border-sm","text-white"],["role","status","aria-hidden","true",1,"spinner-border","spinner-border-sm","text-primary"],["type","button",1,"btn","btn-outline-warning",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-refresh"],["role","status","aria-hidden","true",1,"spinner-border","spinner-border-sm","text-warning"],["type","button",1,"btn","btn-success","d-inline-flex","align-items-center","gap-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-eye"],["role","status","aria-hidden","true",1,"spinner-border","spinner-border-sm","text-success"],[1,"jp-info-banner"],[1,"rounded","border","border-1","bg-white","shadow-sm"],[1,"overflow-auto","px-3","pb-2",2,"max-height","75vh"],[1,"mb-0","w-100","border-collapse","text-sm","sticky-table",2,"min-width","1100px"],[1,"border-bottom","border-1","bg-light","text-start","text-xs","fw-semibold","text-muted"],[1,"sticky-header","sticky-col-1","px-3","py-2"],[1,"sticky-header","sticky-col-2","px-3","py-2"],[1,"sticky-header","sticky-col-3","px-3","py-2"],[1,"sticky-header","sticky-col-4","px-2","py-2","text-center"],["class","sticky-header text-nowrap px-3 py-2 text-center",4,"ngFor","ngForOf"],["class","border-bottom border-1",4,"ngFor","ngForOf"],[1,"border-top","border-2","bg-light","text-sm","fw-semibold","text-dark"],["colspan","4",1,"px-3","py-2"],["class","px-3 py-2 text-center",4,"ngFor","ngForOf"],[1,"px-3","pb-3"],[1,"row","g-1"],["class","text-danger",3,"hidden",4,"ngFor","ngForOf"],[1,"sticky-header","text-nowrap","px-3","py-2","text-center"],[1,"fw-semibold","text-muted","mx-auto",2,"max-width","220px"],[1,"mt-1","small","fw-medium","text-muted"],[1,"border-bottom","border-1"],[1,"sticky-col-1","px-3","py-2","align-top","text-dark"],[1,"sticky-col-2","px-3","py-2","align-top","text-muted"],[1,"sticky-col-3","px-3","py-2","align-top","text-muted"],[1,"fw-medium","text-dark"],[1,"mt-1","small","text-muted","jp-elective-group-stats"],[1,"fw-medium"],[1,"sticky-col-4","px-2","py-2","align-top","text-center"],["type","button","title","Remove invited group",1,"btn","btn-outline-danger","btn-sm",3,"click"],["aria-hidden","true",1,"fa","fa-trash"],["class","px-3 py-2 align-top",4,"ngFor","ngForOf"],[1,"px-3","py-2","align-top"],[4,"ngIf","ngIfElse"],["type","number","min","0",1,"form-control","form-control-sm","rounded","border-1",2,"max-width","7rem",3,"ngModelChange","blur","ngModel"],["class","mt-1 block text-danger",4,"ngIf"],[1,"mt-1","block","text-danger"],[1,"text-muted"],[1,"px-3","py-2","text-center"],["class","mt-1 block font-normal text-danger",4,"ngIf"],["type","number","min","0",1,"form-control","form-control-sm","total-count-input","mx-auto","rounded","border-1",2,"margin","0 auto",3,"ngModelChange","ngModel"],[1,"mt-1","block","font-normal","text-danger"],[1,"text-danger",3,"hidden"],[1,"jp-info-banner","mb-0"],["role","dialog","aria-modal","true","aria-labelledby","addGroupModalTitle",1,"jp-modal-backdrop"],[1,"d-flex","w-100","flex-column","overflow-hidden","rounded","border","border-1","bg-white","shadow-lg",2,"max-width","30rem","max-height","90vh"],[1,"d-flex","align-items-center","justify-content-between","border-bottom","border-1","bg-light","px-4","py-3"],["id","addGroupModalTitle",1,"mb-0","text-base","fw-semibold","text-dark"],["type","button",1,"btn","btn-outline-secondary","btn-sm",3,"click"],[1,"flex-grow-1","overflow-auto","bg-white","p-4",2,"display","flex","flex-direction","column","gap","1rem","min-height","0"],[1,"mb-0","text-sm","text-muted"],["appendTo","body","placeholder","Select department","notFoundText","No departments for this batch/semester",1,"jp-select-elevated","add-group-select","jp-modal-backdrop-select",3,"ngModelChange","change","searchable","clearable","ngModel","loading"],["appendTo","body","placeholder","Select acc year","notFoundText","Select department first",1,"jp-select-elevated","add-group-select","jp-modal-backdrop-select",3,"ngModelChange","change","searchable","clearable","ngModel","disabled"],["appendTo","body","placeholder","Select one or more groups","notFoundText","Select acc year first",1,"jp-select-elevated","add-group-select","jp-modal-backdrop-select",3,"ngModelChange","multiple","closeOnSelect","searchable","clearable","ngModel","disabled","loading"],[1,"d-flex","justify-content-end","gap-2","border-top","border-1","bg-light","px-4","py-3"],["type","button",1,"btn","btn-primary","d-inline-flex","align-items-center",3,"click"],["role","dialog","aria-modal","true","aria-labelledby","previewModalTitle",1,"jp-modal-backdrop"],[1,"d-flex","w-100","flex-column","overflow-hidden","rounded","border","border-1","bg-white","shadow-lg",2,"max-height","85vh","max-width","980px"],["id","previewModalTitle",1,"mb-0","text-base","fw-semibold","text-dark"],[1,"flex-grow-1","overflow-auto","bg-white","p-4",2,"min-height","0"],[1,"preview-table-wrap","overflow-auto","rounded","border","border-1"],[1,"mb-0","w-100","border-collapse","text-sm"],[1,"text-nowrap","px-3","py-2"],[1,"d-flex","flex-wrap","align-items-center","justify-content-end","gap-2","border-top","border-1","bg-light","px-4","py-3"],["class","d-inline-flex align-items-center gap-2",4,"ngIf"],[1,"px-3","py-2","text-dark"],[1,"px-3","py-2","text-muted"],[1,"d-inline-flex","align-items-center","gap-2"],[2,"display","flex","flex-direction","column","gap","1rem"],["class","rounded border border-1 bg-white p-4 shadow-sm",4,"ngFor","ngForOf"],[1,"rounded","border","border-1","bg-white","p-4","shadow-sm"],[1,"d-flex","flex-wrap","align-items-center","gap-3","border-bottom","border-1","pb-3"],["type","checkbox",1,"form-check-input","rounded","border-1",2,"width","1rem","height","1rem",3,"ngModelChange","change","name","ngModel"],[1,"text-sm","fw-semibold","text-dark"],[1,"mt-3","row","g-3","align-items-end"],[1,"col-md-12","col-lg-3"],[1,"col-md-12","col-lg-4"],["type","text","placeholder","Date","bsDatepicker","",1,"form-control","form-control-sm","shadow-sm",3,"ngModelChange","name","ngModel","bsConfig"],["type","text","placeholder","Time",1,"form-control","form-control-sm","shadow-sm","flex-grow-1",3,"ngModelChange","name","ngxTimepicker","ngModel"],[1,"col-md-12","col-lg-2"],["type","button",1,"btn","btn-primary","w-100","d-inline-flex","align-items-center","justify-content-center",3,"click","disabled"],[1,"ms-2"],[1,"d-flex","align-items-center","gap-2","py-1"],["type","checkbox",1,"form-check-input","rounded","border-1",2,"width","1rem","height","1rem",3,"ngModelChange","click","ngModel","name"],[1,"text-sm","text-muted"]],template:function(o,t){if(o&1){let c=T();n(0,"div",5)(1,"div",6)(2,"h2",7),a(3,"Elective Count Manage"),i()(),n(4,"div",8)(5,"div",9)(6,"label",10),a(7,"Faculty"),n(8,"span",11),a(9,"*"),i()(),n(10,"ng-select",12),x("ngModelChange",function(m){return v(c),C(t.facultyId,m)||(t.facultyId=m),_(m)}),f("change",function(){return v(c),_(t.getAllElectiveConfig(t.facultyId))}),g(11,yi,2,2,"ng-option",13),i()(),n(12,"div",9)(13,"label",10),a(14,"Elective Config"),n(1
15,"span",11),a(16,"*"),i()(),n(17,"ng-select",14),x("ngModelChange",function(m){return v(c),C(t.configType,m)||(t.configType=m),_(m)}),f("change",function(){return v(c),_(t.onConfigChange())}),g(18,Si,2,3,"ng-option",13),i(),g(19,xi,5,2,"p",15),i(),n(20,"div",16)(21,"label",10),a(22,"Year"),n(23,"span",11),a(24,"*"),i()(),n(25,"ng-select",17),x("ngModelChange",function(m){return v(c),C(t.yearOfBatch,m)||(t.yearOfBatch=m),_(m)}),f("change",function(){return v(c),_(t.onYearChange())}),g(26,Ei,2,2,"ng-option",13),i()(),n(27,"div",16)(28,"label",10),a(29,"Sem Type"),n(30,"span",11),a(31,"*"),i()(),n(32,"ng-select",18),x("ngModelChange",function(m){return v(c),C(t.semesterType,m)||(t.semesterType=m),_(m)}),f("change",function(){return v(c),_(t.onSemTypeChange())}),g(33,Ii,2,2,"ng-option",13),i()(),n(34,"div",16)(35,"label",10),a(36,"Acc year start "),n(37,"span",19),a(38,"(opt.)"),i()(),n(39,"ng-select",20),x("ngModelChange",function(m){return v(c),C(t.accYearScopeStart,m)||(t.accYearScopeStart=m),_(m)}),f("change",function(){return v(c),_(t.onAccYearScopeChange())}),g(40,wi,2,2,"ng-option",13),i()(),n(41,"div",16)(42,"label",10),a(43,"Acc year end "),n(44,"span",19),a(45,"(opt.)"),i()(),n(46,"ng-select",21),x("ngModelChange",function(m){return v(c),C(t.accYearScopeEnd,m)||(t.accYearScopeEnd=m),_(m)}),f("change",function(){return v(c),_(t.onAccYearScopeChange())}),g(47,Mi,2,2,"ng-option",13),i()()(),n(48,"div",22)(49,"div",23)(50,"div",24)(51,"label",10),a(52,"Elective Count Excel"),i(),n(53,"button",25),y(54,"i",26),a(55," Download "),i()(),n(56,"div",27)(57,"label",10),a(58,"Import Elective Count"),i(),n(59,"div",28)(60,"input",29),f("change",function(m){return v(c),_(t.onSelect(m.target.files))}),i(),g(61,Ti,2,0,"button",30),n(62,"button",31),f("click",function(){return v(c),_(t.uploadExcel())}),g(63,Di,3,0,"span",32)(64,ji,3,0,"span",32),i()()()(),n(65,"div",33)(66,"button",34),f("click",function(){return v(c),_(t.loadMatrix())}),g(67,ki,2,0,"span",32)(68,Ai,3,0,"span",32),i(),n(69,"button",35),f("click",function(){return v(c),_(t.getElectiveSubAccYear())}),a(70," Set Opening Time "),i(),g(71,Vi,3,3,"button",36),n(72,"button",37),f("click",function(){return v(c),_(t.openAddGroupModal())}),y(73,"i",38),a(74,"Add invited group "),i(),g(75,Pi,3,3,"button",39),i()(),g(76,Bi,8,2,"div",40)(77,Zi,23,8,"div",41)(78,en,3,0,"div",32)(79,rn,45,18,"div",42)(80,sn,28,4,"div",43),n(81,"div",44)(82,"div",45)(83,"div",46)(84,"div",47)(85,"h5",48),a(86,"Set Opening Time"),i(),y(87,"button",49),i(),n(88,"div",50)(89,"div",51)(90,"div",52)(91,"div",53)(92,"label",10),a(93,"Select all"),i(),n(94,"div",54)(95,"input",55),x("ngModelChange",function(m){return v(c),C(t.selectAllDeadlineRows,m)||(t.selectAllDeadlineRows=m),_(m)}),f("change",function(){return v(c),_(t.toggleSelectAllDeadlineRows())}),i(),n(96,"label",56),a(97,"All departments"),i()()(),n(98,"div",57)(99,"label",10),a(100,"Bulk date"),i(),n(101,"input",58),x("ngModelChange",function(m){return v(c),C(t.bulkDeadlineDate,m)||(t.bulkDeadlineDate=m),_(m)}),i()(),n(102,"div",57)(103,"label",10),a(104,"Bulk time"),i(),n(105,"div",59)(106,"input",60),x("ngModelChange",function(m){return v(c),C(t.bulkDeadlineTime,m)||(t.bulkDeadlineTime=m),_(m)}),i(),n(107,"button",61),a(108," Pick "),i()(),y(109,"ngx-material-timepicker",62,0),i(),n(111,"div",53)(112,"button",63),f("click",function(){return v(c),_(t.applyBulkDeadlineToSelected())}
1),a(113," Apply to selected "),i()()()(),g(114,un,2,1,"div",64)(115,gn,2,0,"ng-template",null,1,me),i(),n(117,"div",65)(118,"button",66),a(119,"Close"),i()()()()()(),n(120,"div",67)(121,"div",68)(122,"div",46)(123,"div",47)(124,"h5",69),a(125,"Select Departments"),i(),y(126,"button",49),i(),n(127,"div",50)(128,"div",52)(129,"div",70)(130,"label",10),a(131,"Start Year"),i(),n(132,"ng-select",71),x("ngModelChange",function(m){return v(c),C(t.startYear,m)||(t.startYear=m),_(m)}),g(133,vn,2,2,"ng-option",13),i()(),n(134,"div",70)(135,"label",10),a(136,"End Year"),i(),n(137,"ng-select",72),x("ngModelChange",function(m){return v(c),C(t.endYear,m)||(t.endYear=m),_(m)}),g(138,_n,2,2,"ng-option",13),i()()(),n(139,"div",73),g(140,hn,4,3,"div",74),i()(),n(141,"div",65)(142,"button",75),a(143,"Close"),i(),n(144,"button",34),f("click",function(){return v(c),_(t.exportAsXLSX())}),g(145,fn,3,0,"span",32)(146,bn,3,0,"span",32),i()()()()()}if(o&2){let c=X(110),p=X(116);l(10),s("searchable",!0)("clearable",!1),S("ngModel",t.facultyId),s("placeholder","--------------------------Select--------------------------"),l(),s("ngForOf",t.facultyData),l(6),s("searchable",!0)("clearable",!1),S("ngModel",t.configType),s("placeholder","--------------------------Select--------------------------"),l(),s("ngForOf",t.getElective),l(),s("ngIf",t.selectedCapMode),l(6),s("searchable",!0)("clearable",!1),S("ngModel",t.yearOfBatch),s("placeholder","--------------------------Select--------------------------"),l(),s("ngForOf",t.years),l(6),s("searchable",!0)("clearable",!1),S("ngModel",t.semesterType),s("placeholder","--------------------------Select--------------------------"),l(),s("ngForOf",t.semType),l(6),s("searchable",!0)("clearable",!0),S("ngModel",t.accYearScopeStart),l(),s("ngForOf",t.years),l(6),s("searchable",!0)("clearable",!0),S("ngModel",t.accYearScopeEnd),l(),s("ngForOf",t.years),l(6),s("disabled",!t.canLoad()),l(8),s("ngIf",t.file),l(),s("disabled",!t.canLoad()||!t.file||t.isUploading),l(),s("ngIf",!t.isUploading),l(),s("ngIf",t.isUploading),l(2),s("disabled",!t.canLoad()||t.isLoading),l(),s("ngIf",!t.isLoading),l(),s("ngIf",t.isLoading),l(),s("disabled",!t.canLoad()),l(2),s("ngIf",t.canShowSlotSyncAction()),l(),s("disabled",!t.canManageInvitedRows()||t.isLoading),l(3),s("ngIf",t.matrixData==null?null:t.matrixData.length),l(),s("ngIf",t.canManageInvitedRows()&&(t.columnDefs==null?null:t.columnDefs.length)&&!(t.groupRows!=null&&t.groupRows.length)),l(),s("ngIf",t.columnDefs==null?null:t.columnDefs.length),l(),s("ngIf",!t.isLoading&&(t.matrixData==null?null:t.matrixData.length)===0&&t.canLoad()),l(),s("ngIf",t.showAddGroupModal),l(),s("ngIf",t.showPreviewModal),l(15),S("ngModel",t.selectAllDeadlineRows),l(6),S("ngModel",t.bulkDeadlineDate),s("bsConfig",Y(70,st)),l(5),s("ngxTimepicker",c),S("ngModel",t.bulkDeadlineTime),l(),s("ngxTimepicker",c),l(2),s("enableKeyboardInput",!0)("format",12),l(5),s("ngIf",t.elecSubDepartments==null?null:t.elecSubDepartments.length)("ngIfElse",p),l(18),s("searchable",!0)("clearable",!1),S("ngModel",t.startYear),s("placeholder","-----------Select-----------"),l(),s("ngForOf",t.years),l(4),s("searchable",!0)("clearable",!1),S("ngModel",t.endYear),s("placeholder","-----------Select-----------"),l(),s("ngForOf",t.years),l(2),s("ngForOf",t.departments),l(4),s("disabled",!t.startYear||!t.endYear||t.deptIds.length===0||t.isExcelLoading),l(),s("ngIf",!t.isExcelLoading),l(),s("ngIf",t.isExcelLoading)}},dependencies:[F,V,z,$,Fe,Pe,Ye,H,Ne,Re,U,Ue,$e,Je,Ze],styles:["[_nghost-%COMP%]{display:block;padding:.5rem}.total-count-input[_ngcontent-%COMP%]{width:120px}.jp-invalid-cell[_ngcontent-%COMP%]{border-color:#dc3545!important;box-shadow:0 0 0 .1rem #dc354526}.jp-modal-backdrop[_ngcontent-%COMP%]{position:fixed;inset:0;background:#00000073;display:flex;align-items:center;justify-content:center;z-index:1200;padding:1rem}.preview-table-wrap[_ngcontent-%COMP%]{max-height:55vh}.sticky-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th.sticky-header[_ngcontent-%COMP%]{position:sticky;top:0;z-index:30;background-color:#f8fafc}.sticky-table[_ngcontent-%COMP%] .sticky-col-1[_ngcontent-%COMP%]{position:sticky;left:0;z-index:20;background-color:#fff;min-width:180px;max-width:180px;width:180px}.sticky-table[_ngcontent-%COMP%] .sticky-col-2[_ngcontent-%COMP%]{position:sticky;
1left:180px;z-index:20;background-color:#fff;min-width:100px;max-width:100px;width:100px}.sticky-table[_ngcontent-%COMP%] .sticky-col-3[_ngcontent-%COMP%]{position:sticky;left:280px;z-index:20;background-color:#fff;min-width:220px;max-width:220px;width:220px}.sticky-table[_ngcontent-%COMP%] .sticky-col-4[_ngcontent-%COMP%]{position:sticky;left:500px;z-index:20;background-color:#fff;min-width:56px;max-width:56px;width:56px}.sticky-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th.sticky-col-1[_ngcontent-%COMP%], .sticky-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th.sticky-col-2[_ngcontent-%COMP%], .sticky-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th.sticky-col-3[_ngcontent-%COMP%], .sticky-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th.sticky-col-4[_ngcontent-%COMP%]{z-index:40}.sticky-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{background-color:#fff}.jp-elective-group-stats[_ngcontent-%COMP%]{line-height:1.35;white-space:normal}"]})}return r})();var yn=[{path:"",redirectTo:"home",pathMatch:"full"},{path:"",component:he,children:[{path:"home",component:ot},{path:"subjectReport",component:ct},{path:"subjectDepartmentReport",component:lt},{path:"electiveApplySettings",component:fe},{path:"electiveCountManage",component:dt}]}],pt=(()=>{class r{static \u0275fac=function(o){return new(o||r)};static \u0275mod=ce({type:r});static \u0275inj=le({imports:[xe.forChild(yn),xe]})}return r})();var Ma=(()=>{class r{static \u0275fac=function(o){return new(o||r)};static \u0275mod=ce({type:r,bootstrap:[he]});static \u0275inj=le({providers:[ue],imports:[pt,Ae,Qe,Be,We,Ge,He,qe,ze.forRoot(),et]})}return r})();export{Ma as ElectiveSubjectModule};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.