PageSourceSearch

https://demo.safsims.com/static/js/7536.11efb07b.chunk.js

js safsims.com collected 2026-10-09 22:53:14 UTC 65,077 bytes, 1 lines download raw bytes

1(self.webpackChunksafsims=self.webpackChunksafsims||[]).push([[7536],{2266(e,l,t){"use strict";t.d(l,{l:()=>I});var o=t(89379),n=t(80045),i=t(57528),s=t(73026),d=t(54737),a=t(2667),r=t.n(a),c=t(70414),u=(t(22193),t(20176)),v=t.n(u),x=t(12546),h=t.n(x),p=t(49727),g=t.n(p),m=t(88094),f=t(59397),j=t(15678);const b=["label","required"];var y,C,S;const A=f.default.div(y||(y=(0,i.A)(["\n  display: inline-block;\n  /* position: absolute; */\n  margin-bottom: 8px;\n\n  & label {\n    text-transform: uppercase;\n    ","\n    position: relative;\n    font-weight: 700;\n    display: inline-block;\n    font-size: 0.9em;\n\n    &::after {\n      ","\n    }\n  }\n"])),e=>e.theme.noLabelUpperCase&&(0,f.css)(C||(C=(0,i.A)(["\n        text-transform: none;\n      "]))),e=>e.required&&(0,f.css)(S||(S=(0,i.A)(["\n          content: '*';\n          color: ",";\n          position: absolute;\n          top: -2px;\n          margin-left: 2px;\n        "])),d.S.PrimaryRed)),w="DD/MM/YYYY",k=-1!==location.search.indexOf("cn"),_=r()();k?_.locale("zh-cn").utcOffset(8):_.locale("en-gb").utcOffset(0);const I=m.forwardRef((e,l)=>{const[t,i]=(0,m.useState)(!1),[d,a]=(0,m.useState)(!1),u=(0,j.jsx)(c.A,{className:"week-calendar",showWeekNumber:!0,dateRender:l=>{const t=e.value;return t&&l.year()===t.year()&&l.week()===t.week()?(0,j.jsx)("div",{className:"rc-calendar-selected-day",children:(0,j.jsx)("div",{className:"rc-calendar-date",children:l.date()})}):(0,j.jsx)("div",{className:"rc-calendar-date",children:l.date()})},locale:k?h():v(),format:w,style:{zIndex:1e3},dateInputPlaceholder:"-- / -- / ----",defaultValue:_,showDateInput:!0,disabledDate:l=>{let t=!1;return e.maxDate&&(t=l.isAfter(r()(e.maxDate))),e.minDate&&(t=l.isBefore(r()(e.minDate))),e.maxDate&&e.minDate&&(t=l.isBefore(r()(e.minDate))||l.isAfter(r()(e.maxDate))),t}}),{label:x,required:p}=e;(0,n.A)(e,b);return(0,j.jsxs)("div",(0,o.A)((0,o.A)({style:{width:"auto",margin:0}},e),{},{"data-testid":"dob-calendar",children:[x?(0,j.jsx)(A,{required:p,children:void 0!==x&&(0,j.jsx)("label",{children:x})}):null,(0,j.jsx)("div",{style:{boxSizing:"border-box",position:"relative",display:"block",lineHeight:1.5,marginBottom:22},children:(0,j.jsx)(g(),{onOpenChange:e=>{i(e)},open:t,animation:"slide-up",calendar:u,value:e.value,onChange:e.onChange,children:l=>{let{value:t}=l;return(0,j.jsx)("span",{tabIndex:"0",children:(0,j.jsx)(s.Input,{placeholder:"-- / -- / ----",width:e.width,disabled:d,iconRight:"saf-calendar-1",readOnly:!0,tabIndex:"-1",type:"",value:e.value&&t.format(w)||""})})}})})]}))})},9337(){},9939(e,l,t){"use strict";t.d(l,{A:()=>a});var o=t(89379),n=t(80045),i=t(88094),s=t(15678);const d=["src","onError","alt"],a=e=>{let{src:l,onError:t,alt:a=""}=e,r=(0,n.A)(e,d);const[c,u]=(0,i.useState)(!1);return!(e=>{if(!e||"string"!==typeof e)return!1;const l=e.trim();return!(!l||"undefined"===l||"null"===l)&&/^(https?:|data:|blob:|\/|\.)/i.test(l)})(l)||c?null:(0,s.jsx)("img",(0,o.A)((0,o.A)({},r),{},{alt:a,src:l,onError:e=>{u(!0),null===t||void 0===t||t(e)}}))}},51916(e,l,t){"use strict";t.d(l,{Y:()=>a});var o=t(73026),n=t(98819),i=t(88094),s=t(58597),d=t(23536);const a=()=>{const[e,l]=(0,i.useState)(!1),[t,a]=(0,i.useState)(!1),[r,c]=(0,i.useState)([]),u=(0,i.useCallback)(async e=>{a(!0);try{const l=await(0,s.M2)(()=>n.aC.createUsingPost11({request:e}));return(0,o.Notify)("Weekly config was saved successfully.",{status:"success",position:"top-right"}),a(!1),{success:!0,response:l}}catch(l){return a(!1),(0,d.H4)(l),{success:!1,error:l}}},[]),v=(0,i.useCallback)(async e=>{a(!0);try{const l=await(0,s.M2)(()=>n.aC.updateUsingPut9({request:e}));return(0,o.Notify)("Weekly config was saved successfully.",{status:"success",position:"top-right"}),a(!1),{success:!0,response:l}}catch(l){return a(!1),(0,d.H4)(l),{success:!1,error:l}}},[]);return{loadingFetch:e,loadingSave:t,postWeeklyConfig:u,fetchWeeklyConfig:(0,i.useCallback)(async e=>{let{subjectId:t,classLevelId:o}=e;l(!0);try{const e=await(0,s.M2)(()=>null===n.aC||void 0===n.aC?void 0:n.aC.getBySubjectUsingGet2({subjectId:t,classLevelId:o})),i=null===e||void 0===e?void 0:e.sort((e,l)=>((null===e||void 0===e?void 0:e.order)||"")<((null===l||void 0===l?void 0:l.order)||"")?-1:((null===e||void 0===e?void 0:e.order)||"")>((null===l||void 0===l?void 0:l.order)||"")?1:0);return l(!1),c(i),{success:!0,response:i}}catch(i){return l(!1),(0,d.H4)(i),{success:!1,response:[]}}},[]),weeklyConfig:r,putWeeklyConfig:v,postImportWeeklyConfig:(0,i.useCallback)(async e=>{a(!0);try{const l=await(0,s.M2)(()=>n.aC.duplicateUsingPost3({request:e}));return(0,o.Notify)("Weekly config is imported successfully.",{status:"success",position:"top-right"}),a(!1),{success:!0,response:l}}catch(l){return a(!1),(0,d.H4)(l),{success:!1,error:l}}},[]),postImportAssessmentConfig:(0,i.useCallback)(async e=>{a(!0);try{const l=await(0,s.M2)(()=>n.vj.duplicateUsingPost2({request:e}));return(0,o.Notify)("Weekly config is imported successfully.",{status:"success",position:"top-right"}),a(!1),{success:!0,response:l}}catch(l){return a(!1),(0,d.H4)(l),{success:!1,error:l}}},[])}}},54451(e,l,t){"use strict";t.d(l,{L:()=>s});var o,n=t(57528),i=t(54737);const s=t(59397).default.div(o||(o=(0,n.A)(["\n  border-radius: ",";\n  width: 100%;\n  background: #fff;\n\n  & .school-info {\n    display: none;\n  }\n  & .print_table {\n    display: none;\n  }\n\n  @media print {\n    @page {\n      margin: 0.5cm;\n    }\n\n    & .print_table {\n      display: block;\n    }\n\n    & table {\n      width: 100%;\n      font-size: 10px;\n\n      & thead {\n        & th {\n          padding: 3px;\n        }\n      }\n\n      & tbody {\n        & tr {\n          & td {\n            padding: 3px;\n          }\n        }\n      }\n    }\n\n    margin: 20px auto;\n    & .school-info {\n      display: grid;\n      grid-template-columns: auto max-content;\n      align-items: flex-end;\n      padding: 20px;\n      & .school-info-left img {\n        max-height: 80px;\n        display: block;\n        margin-bottom: 10px;\n      }\n      & .school-info-right {\n        text-align: right;\n      }\n    }\n    @page {\n      size: A3 landscape;\n    }\n  }\n"])),i.S.SecondaryRadius)},54945(e,l,t){"use strict";t.d(l,{t:()=>s});var o=t(89379),n=t(73026),i=t(15678);const s=e=>"segmented"===e.mode?(0,i.jsx)("div",{className:"sh-segmented-tabs",children:(0,i.jsx)(n.Tabs,(0,o.A)({},e))}):(0,i.jsx)(n.Tabs,(0,o.A)({},e))},66867(e,l,t){"use strict";t.r(l),t.d(l,{default:()=>re});var o=t(73026),n=t(54945),i=t(75350),s=t(89379),d=t(17514),a=t(95069),r=t(88094),c=t(64437),u=t(82861),v=t(54737),x=t(78176),h=t(98819),p=t(66721),g=t(58597),m=t(23536);const f=e=>{let{armId:l,classLevelId:t,sessionId:o}=e;const[n,i]=(0,r.useState)(!1),[s,d]=(0,r.useState)([]),[a,c]=(0,r.useState)(""),[u]=(0,p.d7)(a,300),[v,x]=(0,r.useState)(0),f=(0,r.useCallback)(async e=>{i(!0);try{const l=await(0,g.M2)(()=>h.Op.getClassMemberBySessionUsingGet(e));d(l),i(!1)}catch(l){i(!1),(0,m.H4)(l)}},[]);return(0,r.useEffect)(()=>{l&&t&&o&&f({sessionId:o,armId:l,classLevelId:t,search:u})},[o,l,t,u,v,f]),{setSearch:c,search:a,classMembers:s,loading:n,refetch:()=>x(e=>e+1)}};var j=t(70226),b=t(22358),y=t(38862),C=t(5518),S=t(43355),A=t(57519),w=t(72769),k=t(208),_=t(12868),I=t(15678);const F=e=>{let{open:l,onClose:t,student:n,templateId:i,toggleStudent:s,term:d}=e;const c=(0,r.useRef)(),u=(0,k.R8)({content:()=>c.current||null});return(0,I.jsx)(o.Modal,{open:l,onClose:t,children:(0,I.jsxs)(o.ModalBody,{width:"90vw",children:[(0,I.jsx)(o.ModalClose,{onClick:t,children:"\xd7"}),(0,I.jsxs)(o.Box,{pad:"20px",style:{display:"flex",gap:"10px"},children:[(0,I.jsx)(a.A,{xs:!0,pale:!0,onClick:()=>s("PREVIOUS"),style:{borderRadius:"100%",height:"48px"},children:(0,I.jsx)(_.A,{name:"saf-arrow-left-2",size:16})}),(0,I.jsx)(a.A,{xs:!0,pale:!0,onClick:()=>s("NEXT"),style:{borderRadius:"100%",height:"48px"},children:(0,I.jsx)(_.A,{name:"saf-arrow-right-3",size:16})}),(0,I.jsxs)(a.A,{onClick:()=>u(),style:{marginLeft:"auto",background:"#e8e8ef",color:v.S.PrimaryFontColor},children:[(0,I.jsx)(_.A,{name:"saf-printer",size:16})," Download"]})]}),(0,I.jsx)(o.Box,{pad:"20px 0",style:{borderTop:"1px solid ".concat(v.S.PrimaryBorderColor),background:"#FFF"},children:(0,I.jsx)(o.Box,{ref:c,children:(0,I.jsx)(w.h,{studentInfo:n,templateId:i,termId:null===d||void 0===d?void 0:d.term_id})})})]})})},B=e=>{var l,t;let{open:n,onClose:i,data:s,templateId:d,type:c,month:u,year:x,subject:p}=e;const{loadingSave:f,postAcademicProfileNotification:j,postMonthlyReportNotification:b}=(()=>{const[e,l]=(0,r.useState)(!1);return{loadingSave:e,postAcademicProfileNotification:(0,r.useCallback)(async e=>{l(!0);try{const t=await(0,g.M2)(()=>h.C5.sendProfileAssessmentNotificationUsingPost({request:e}));return l(!1),(0,o.Notify)("Notifcation has been sent successfully."),{success:!0,response:t}}catch(t){return(0,m.H4)(t),l(!1),{success:!1}}},[]),postMonthlyReportNotification:(0,r.useCallback)(async e=>{l(!0);try{const t=await(0,g.M2)(()=>h.M_.sendNotificationUsingPost({request:e}));return l(!1),(0,o.Notify)("Notifcation has been sent successfully."),{success:!0,response:t}}catch(t){return(0,m.H4)(t),l(!1),{success:!1}}},[])}})();return(0,I.jsx)(o.Modal,{open:n,onClose:i,children:(0,I.jsxs)(o.ModalBody,{width:"45vw",children:[(0,I.jsx)(o.ModalClose,{onClick:i,children:"\xd7"}),(0,I.jsx)(o.Box,{pad:"40px 30px 30px 30px",style:{borderTop:"1px solid ".concat(v.S.PrimaryBorderColor)},children:(0,I.jsxs)("div",{children:[(0,I.jsx)("h1",{children:"Send Notifcation"}),(0,I.jsxs)(o.Text,{children:["You are about to send"," ","ACADEMIC_PROFILE"===c?"Academic Profile notification":"notification for Monthly Report for ".concat(u," ").concat(x," on ").concat(null===p||void 0===p?void 0:p.subject_name)," ","to the parent(s) of ",(0,I.jsx)("b",{children:null!==(l=null===(t=Object.entries(s))||void 0===t?void 0:t.length)&&void 0!==l?l:0})," students.",(0,I.jsx)("br",{}),(0,I.jsx)("br",{})," Please click on the 'Send Notifcation' button below to confirm."]})]})}),(0,I.jsx)(o.ModalFooter,{children:(0,I.jsxs)(o.Box,{pad:"20px",align:"right",children:[(0,I.jsx)(a.A,{pale:!0,color:v.S.PrimaryFontColor,fontColor:v.S.PrimaryFontColor,onClick:i,style:{marginRight:"10px"},children:"Cancel"}),(0,I.jsx)(a.A,{onClick:async()=>
1{if("ACADEMIC_PROFILE"===c&&d){var e;const l={profile_template_id:d,student_ids:null!==(e=null===Object||void 0===Object?void 0:Object.values(s).map(e=>e||""))&&void 0!==e?e:[]},{success:t}=await j(l);t&&i()}if("MONTHLY_REPORT"===c&&u&&x&&null!==p&&void 0!==p&&p.id){var l;const e={subject_id:null===p||void 0===p?void 0:p.id,month:u,year:x,student_ids:null!==(l=null===Object||void 0===Object?void 0:Object.values(s).map(e=>e||""))&&void 0!==l?l:[]},{success:t}=await b(e);t&&i()}},progress:f,children:"Send Notification"})]})})]})})},P=()=>{var e,l,t,n,i,h,p,g,w,k,P,E,M;const T=(0,b.useDispatch)(),[z,D]=(0,r.useState)(null),L=(0,b.useSelector)(C.ZE),{sessionValue:O,setSessionValue:R,groupedTermsBySessions:N}=(0,x.A)({}),[Y,W]=(0,r.useState)(null),V=(0,b.useSelector)(C.Sw),U=(0,b.useSelector)(C.pj),H=(0,b.useSelector)(A.P3),G=(0,b.useSelector)(A.kk),$=(0,b.useSelector)(S.lW),q=(0,r.useMemo)(()=>{var e;const l=[];return null===V||void 0===V||null===(e=V.filter(e=>"ACTIVE"===(null===e||void 0===e?void 0:e.active_status)))||void 0===e||e.sort((e,l)=>((null===e||void 0===e?void 0:e.class_order)||0)>((null===l||void 0===l?void 0:l.class_order)||0)?1:-1).forEach(e=>{const t=Array.isArray(H)?H.find(l=>l.class_level===e.id):void 0,o=Array.isArray(G)?G.find(l=>l.class_level_id===e.id):void 0;var n;($||(t||o))&&(null===e||void 0===e||null===(n=e.arms)||void 0===n||n.forEach(t=>{const n=Array.isArray(H)?H.find(l=>l.arm===(null===t||void 0===t?void 0:t.id)&&l.class_level===(null===e||void 0===e?void 0:e.id)):void 0;($||(n||o))&&l.push({label:"".concat(null===e||void 0===e?void 0:e.name," ").concat(null===t||void 0===t?void 0:t.name),value:"".concat(null===e||void 0===e?void 0:e.id,"-").concat(null===t||void 0===t?void 0:t.id),extra:{level:e,arm:t}})}))}),(null===l||void 0===l?void 0:l.length)>0&&W(l[0]),l},[V,$,H,G]);(0,r.useEffect)(()=>{var e,l;null!==O&&void 0!==O&&null!==(e=O.value)&&void 0!==e&&e.term_id&&T((0,y.Ie3)(null===O||void 0===O||null===(l=O.value)||void 0===l?void 0:l.term_id))},[T,null===O||void 0===O||null===(e=O.value)||void 0===e?void 0:e.term_id]);const[X,Q]=(0,r.useState)(null),{loadingFetch:Z,fetchClassLevelAcademicProfileConfig:J,allAcademicProfile:K}=(0,j.A)(),ee=(0,r.useCallback)(async e=>{const{success:l,response:t}=await J(e);var o,n,i;l&&t&&Q({label:null!==(o=null===(n=t[0])||void 0===n?void 0:n.title)&&void 0!==o?o:"",value:null===(i=t[0])||void 0===i?void 0:i.id,extra:t[0]})},[J]);(0,r.useEffect)(()=>{var e,l,t,o,n,i,s,d;null!==Y&&void 0!==Y&&null!==(e=Y.extra)&&void 0!==e&&null!==(l=e.level)&&void 0!==l&&l.id&&null!==O&&void 0!==O&&null!==(t=O.value)&&void 0!==t&&null!==(o=t.session)&&void 0!==o&&o.id&&ee({classLevelId:null===Y||void 0===Y||null===(n=Y.extra)||void 0===n||null===(i=n.level)||void 0===i?void 0:i.id,sessionId:null===O||void 0===O||null===(s=O.value)||void 0===s||null===(d=s.session)||void 0===d?void 0:d.id})},[null===Y||void 0===Y||null===(l=Y.extra)||void 0===l||null===(t=l.level)||void 0===t?void 0:t.id,ee,null===O||void 0===O||null===(n=O.value)||void 0===n||null===(i=n.session)||void 0===i?void 0:i.id]);const[le,te]=(0,r.useState)(""),{loading:oe,classMembers:ne}=f({armId:null===Y||void 0===Y||null===(h=Y.extra)||void 0===h||null===(p=h.arm)||void 0===p?void 0:p.id,classLevelId:null===Y||void 0===Y||null===(g=Y.extra)||void 0===g||null===(w=g.level)||void 0===w?void 0:w.id,sessionId:null===O||void 0===O||null===(k=O.value)||void 0===k||null===(P=k.session)||void 0===P?void 0:P.id}),ie=(0,r.useMemo)(()=>null===ne||void 0===ne?void 0:ne.filter(e=>{if(le){var l;const t=(0,m.wo)({data:e});return!(null===t||void 0===t||null===(l=t.toLocaleLowerCase())||void 0===l||!l.includes(null===le||void 0===le?void 0:le.toLocaleLowerCase()))}return!0}),[ne,le]),[se,de]=(0,r.useState)({}),ae=Object.values(se).length,re=(0,r.useMemo)(()=>{let e=!0;return null===ie||void 0===ie||ie.forEach(l=>{null!==l&&void 0!==l&&l.id&&!se[null===l||void 0===l?void 0:l.id]&&(e=!1)}),(null===ie||void 0===ie?void 0:ie.length)<1&&(e=!1),e},[se,ie]),[ce,ue]=(0,r.useState)(!1);return(0,I.jsxs)("div",{children:[(0,I.jsxs)(o.Box,{pad:"10px 0",children:[(0,I.jsxs)(o.Grid,{default:"repeat(5,1fr)",md:"repeat(5,1fr)",sm:"repeat(1, 1fr)",gap:"5px",children:[(0,I.jsx)(o.Box,{children:(0,I.jsx)(o.Select,{label:"Session",placeholder:"Select session...",loading:U,options:null===Object||void 0===Object||null===(E=Object.entries(N))||void 0===E?void 0:E.map(e=>{let[l,t]=e;return{label:l,value:t?t[0]:{}}}),value:O,onChange:e=>{de({}),Q(null),R(e)}})}),(0,I.jsx)(o.Box,{children:(0,I.jsx)(o.Select,{label:"Class",placeholder:"Select Class...",loading:U,options:q,value:Y,onChange:e=>{de({}),Q(null),W(e)}})}),(0,I.jsx)(o.Box,{children:(0,I.jsx)(o.Select,{label:"Template",placeholder:"Select template...",loading:Z,options:null===K||void 0===K?void 0:K.map(e=>({label:null===e||void 0===e?void 0:e.title,value:null===e||void 0===e?void 0:e.id,extra:e})),value:X,onChange:e=>Q(e)})})]}),(0,I.jsxs)(o.Box,{pad:"10px 0",children:[(0,I.jsxs)(o.Grid,{default:"repeat(4, 1fr)",gap:"5px",children:[(0,I.jsx)(o.Box,{pad:"10px 0",children:(0,I.jsx)(o.Input,{type:"search",placeholder:"Search by name...",value:le,onChange:e=>{var l;return te(null===e||void 0===e||null===(l=e.tartget)||void 0===l?void 0:l.value)}})}),(0,I.jsx)("div",{}),(0,I.jsx)(o.Box,{style:{marginLeft:"atuo",display:"flex",alignItems:"center"},children:ae>0?"Selected: ".concat(ae):""}),(0,I.jsx)(o.Box,{pad:"10px 0",children:(0,I.jsx)(a.A,{color:"#000000",fontColor:"#fff",disabled:!(ae>0&&null!==X&&void 0!==X&&X.value),onClick:()=>ue(!0),children:"Send Notification"})})]}),oe?(0,I.jsx)(o.Box,{pad:"20px",display:"flex",children:(0,I.jsx)(o.Loader,{style:{margin:"auto"}})}):(0,I.jsx)(o.Box,{children:(null===ie||void 0===ie?void 0:ie.length)>0?(0,I.jsx)(I.Fragment,{children:(0,I.jsx)(o.Table,{naked:!0,striped:!0,children:(0,I.jsxs)("table",{children:[(0,I.jsx)("thead",{children:(0,I.jsxs)("tr",{children:[(0,I.jsx)("th",{style:{width:"50px"},children:(0,I.jsx)(o.Checkbox,{label:"",checked:re,onChange:e=>(e=>{if("ADD"===e){const e=(0,s.A)({},se);null===ie||void 0===ie||ie.forEach(l=>(null===l||void 0===l?void 0:l.id)&&(e[null===l||void 0===l?void 0:l.id]=null===l||void 0===l?void 0:l.id)),de(e)}"REMOVE"===e&&de({})})(re?"REMOVE":"ADD"),size:"15px"})}),(0,I.jsx)("th",{children:"Student"}),(0,I.jsx)("th",{children:"Action"})]})}),(0,I.jsx)("tbody",{children:null===ie||void 0===ie?void 0:ie.map((e,l)=>{var t;const n=null!==(t=(0,m.wo)({data:e}))&&void 0!==t?t:"",i=(null===e||void 0===e?void 0:e.id)&&se[null===e||void 0===e?void 0:e.id];return(0,I.jsxs)("tr",{children:[(0,I.jsx)("td",{children:(0,I.jsx)(o.Checkbox,{label:"",checked:!!i,onChange:l=>(e=>{let{studentId:l,action:t}=e;const o=(0,s.A)({},se);l&&("ADD"===t&&(o[l]=l),"REMOVE"===t&&delete o[l],de(o))})({studentId:(null===e||void 0===e?void 0:e.id)||"",action:i?"REMOVE":"ADD"}),size:"15px"})}),(0,I.jsx)("td",{children:(0,I.jsxs)("p",{style:{display:"flex",gap:"5px"},children:[(0,I.jsx)(d.Ay,{src:null===e||void 0===e?void 0:e.profile_pic,name:n,size:"30px",round:!0}),(0,I.jsxs)("span",{children:[n," ",(0,I.jsx)("br",{}),(0,I.jsx)("span",{style:{color:v.S.PrimaryColor},children:null===e||void 0===e?void 0:e.student_id})]})]})}),(0,I.jsx)("td",{children:(0,I.jsxs)(a.A,{color:"#000000",onClick:()=>{var l,t,o,n;return D({id:null===e||void 0===e?void 0:e.id,student:(0,s.A)((0,s.A)({},e),{},{arm_id:null===Y||void 0===Y||null===(l=Y.extra)||void 0===l||null===(t=l.arm)||void 0===t?void 0:t.id}),classLevelId:null===Y||void 0===Y||null===(o=Y.extra)||void 0===o||null===(n=o.level)||void 0===n?void 0:n.id,templateId:null===X||void 0===X?void 0:X.value,term:L})},style:{margin:"0"}
1,disabled:!(null!==X&&void 0!==X&&X.value),children:[(0,I.jsx)(_.A,{name:"saf-eye",size:16})," View Profile"]})})]},l)})})]})})}):(0,I.jsx)(o.Box,{children:(0,I.jsx)(c.c,{image:u.A,title:"No student found",info:"There are currently records found."})})})]})]}),(0,I.jsx)(F,{open:!(null===z||void 0===z||null===(M=z.student)||void 0===M||!M.id),onClose:()=>D(null),student:null===z||void 0===z?void 0:z.student,templateId:null===X||void 0===X?void 0:X.value,toggleStudent:e=>(e=>{const l=null===ne||void 0===ne?void 0:ne.length;if(l>1){const t=null===ne||void 0===ne?void 0:ne.findIndex(e=>{var l;return(null===e||void 0===e?void 0:e.id)===(null===z||void 0===z||null===(l=z.student)||void 0===l?void 0:l.id)});let o=t;"NEXT"===e&&(o=t+1,o===l&&(o=0)),"PREVIOUS"===e&&(o=t-1,-1===o&&(o=l-1)),D(()=>{var e,l,t;return{id:null===(e=ne[o])||void 0===e?void 0:e.id,student:ne[o],classLevelId:null===Y||void 0===Y||null===(l=Y.extra)||void 0===l||null===(t=l.level)||void 0===t?void 0:t.id,templateId:null===X||void 0===X?void 0:X.value}})}})(e),term:null===z||void 0===z?void 0:z.term}),(0,I.jsx)(B,{open:ce,onClose:()=>ue(!1),data:se,templateId:null===X||void 0===X?void 0:X.value,type:"ACADEMIC_PROFILE"})]})};var E=t(21784),M=t(87743),T=t(63550),z=t(2667),D=t.n(z),L=t(87757),O=t(75884);const R=e=>{let{open:l,onClose:t,data:n,toggleStudent:i}=e;return(0,I.jsx)(o.Modal,{open:l,onClose:t,children:(0,I.jsxs)(o.ModalBody,{width:"90vw",children:[(0,I.jsx)(o.ModalClose,{onClick:t,children:"\xd7"}),(0,I.jsxs)(o.Box,{pad:"20px",style:{display:"flex",gap:"10px"},children:[(0,I.jsx)(a.A,{xs:!0,pale:!0,onClick:()=>i("PREVIOUS"),style:{borderRadius:"100%",height:"48px"},children:(0,I.jsx)(_.A,{name:"saf-arrow-left-2",size:16})}),(0,I.jsx)(a.A,{xs:!0,pale:!0,onClick:()=>i("NEXT"),style:{borderRadius:"100%",height:"48px"},children:(0,I.jsx)(_.A,{name:"saf-arrow-right-3",size:16})})]}),(0,I.jsx)(o.Box,{pad:"60px 30px 30px 30px",style:{borderTop:"1px solid ".concat(v.S.PrimaryBorderColor)},children:(0,I.jsx)("div",{children:(0,I.jsx)(O.SummaryReportDisplay,{studentInfo:null===n||void 0===n?void 0:n.student,selectedSubject:n.selectedSubject,selectedDate:n.selectedDate})})})]})})},N=e=>{switch(e){case"READY":return(0,I.jsx)(o.Badge,{color:v.S.PrimaryGreen,label:"Ready"});case"WAITING":return(0,I.jsx)(o.Badge,{color:v.S.PrimaryOrange,label:"Waiting"});default:return(0,I.jsx)(r.Fragment,{})}},Y=()=>{var e,l,t,n,i,x,h;const p=(0,b.useDispatch)(),[g,f]=(0,r.useState)(D()().format("YYYY-MM-DD")),j=(0,b.useSelector)(C.ZE),w=null!==(e=null===j||void 0===j?void 0:j.term_id)&&void 0!==e?e:"",[k,F]=(0,r.useState)({}),[P,z]=(0,r.useState)(null),O=(0,b.useSelector)(C.Sw),Y=(0,b.useSelector)(C.pj),W=(0,b.useSelector)(A.P3),V=(0,b.useSelector)(A.kk),U=(0,b.useSelector)(S.lW),H=(0,r.useMemo)(()=>{var e;const l=[];return null===O||void 0===O||null===(e=O.filter(e=>"ACTIVE"===(null===e||void 0===e?void 0:e.active_status)))||void 0===e||e.sort((e,l)=>((null===e||void 0===e?void 0:e.class_order)||0)>((null===l||void 0===l?void 0:l.class_order)||0)?1:-1).forEach(e=>{const t=Array.isArray(W)?W.find(l=>l.class_level===e.id):void 0,o=Array.isArray(V)?V.find(l=>l.class_level_id===e.id):void 0;var n;(U||(t||o))&&(null===e||void 0===e||null===(n=e.arms)||void 0===n||n.forEach(t=>{const n=Array.isArray(W)?W.find(l=>l.arm===(null===t||void 0===t?void 0:t.id)&&l.class_level===(null===e||void 0===e?void 0:e.id)):void 0;(U||(n||o))&&l.push({label:"".concat(null===e||void 0===e?void 0:e.name," ").concat(null===t||void 0===t?void 0:t.name),value:"".concat(null===e||void 0===e?void 0:e.id,"-").concat(null===t||void 0===t?void 0:t.id),extra:{level:e,arm:t}})}))}),(null===l||void 0===l?void 0:l.length)>0&&z(l[0]),l},[O,U,W,V]);(0,r.useEffect)(()=>{p((0,y.Ie3)(w))},[p,w]);const[G,$]=(0,r.useState)(null),{loadingSubjects:q,subjects:X}=(0,T.A)({classLevelId:null===P||void 0===P||null===(l=P.extra)||void 0===l||null===(t=l.level)||void 0===t?void 0:t.id}),Q=(0,r.useMemo)(()=>{const e=[];return null===X||void 0===X||X.forEach(l=>
1e.push({label:"".concat(null===l||void 0===l?void 0:l.subject_name),value:null===l||void 0===l?void 0:l.id,extra:l})),(null===e||void 0===e?void 0:e.length)>0&&$(e[0]),e},[X]),{fetchAllStudentMonthlyReportComment:Z,loadingFetch:J,allMonthlyComments:K,allPagination:ee}=(0,L.$)(),le=(0,r.useCallback)(e=>{var l,t,o,n;const i={month:D()(g).format("MMMM").toUpperCase(),year:parseInt(D()(g).format("YYYY")),classLevelId:null===P||void 0===P||null===(l=P.extra)||void 0===l||null===(t=l.level)||void 0===t?void 0:t.id,subjectId:null===G||void 0===G?void 0:G.value,armId:null===P||void 0===P||null===(o=P.extra)||void 0===o||null===(n=o.arm)||void 0===n?void 0:n.id,limit:null===e||void 0===e?void 0:e.limit,offset:null===e||void 0===e?void 0:e.offset};null!==e&&void 0!==e&&e.search&&(i.search=e.search),Z(i)},[Z,null===P||void 0===P||null===(n=P.extra)||void 0===n||null===(i=n.level)||void 0===i?void 0:i.id,null===P||void 0===P||null===(x=P.extra)||void 0===x||null===(h=x.arm)||void 0===h?void 0:h.id,g,null===G||void 0===G?void 0:G.value]);(0,r.useEffect)(()=>{null!==P&&void 0!==P&&P.value&&null!==G&&void 0!==G&&G.value&&le({limit:10,offset:0})},[le,null===P||void 0===P?void 0:P.value,null===G||void 0===G?void 0:G.value]);const[te,oe]=(0,r.useState)({}),ne=Object.values(te).length,ie=(0,r.useMemo)(()=>{let e=!0;return null===K||void 0===K||K.forEach(l=>{var t,o;null!==l&&void 0!==l&&null!==(t=l.student)&&void 0!==t&&t.id&&!te[null===l||void 0===l||null===(o=l.student)||void 0===o?void 0:o.id]&&(e=!1)}),(null===K||void 0===K?void 0:K.length)<1&&(e=!1),e},[te,K]),[se,de]=(0,r.useState)(!1);return(0,I.jsxs)("div",{children:[(0,I.jsxs)(o.Box,{pad:"5px 0",children:[(0,I.jsx)(o.Box,{pad:"10px 0",children:(0,I.jsxs)(o.Grid,{default:"repeat(5,1fr)",md:"repeat(5,1fr)",sm:"repeat(1, 1fr)",children:[(0,I.jsx)(o.Box,{children:(0,I.jsx)(E.Ay,{label:(0,I.jsx)(o.Text,{size:"10px",children:"Year/Month"}),hideDay:!0,value:g,onDateChange:e=>f(D()(e).startOf("month").toISOString())})}),(0,I.jsx)(o.Box,{children:(0,I.jsx)(o.Select,{label:"Class",placeholder:"Select Class...",loading:Y,options:H,value:P,onChange:e=>{$(null),z(e),oe({})}})}),(0,I.jsx)(o.Box,{children:(0,I.jsx)(o.Select,{label:"Subject",placeholder:"Select subject...",loading:q,options:Q,value:G,onChange:e=>{$(e),oe({})}})})]})}),null!==G&&void 0!==G&&G.value?(0,I.jsx)(M.m,{render:(e,l,t,n,i,r,x,h)=>(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(o.Grid,{default:"repeat(4, 1fr)",gap:"5px",children:[(0,I.jsx)(o.Box,{pad:"10px 0",children:(0,I.jsx)(o.Input,{type:"search",placeholder:"Search by name...",onChange:e=>t(e,le)})}),(0,I.jsx)("div",{}),(0,I.jsx)(o.Box,{style:{marginLeft:"atuo",display:"flex",alignItems:"center"},children:ne>0?"Selected: ".concat(ne):""}),(0,I.jsx)(o.Box,{pad:"10px 0",children:(0,I.jsx)(a.A,{color:"#000000",fontColor:"#fff",disabled:!(ne>0&&null!==G&&void 0!==G&&G.value),onClick:()=>de(!0),children:"Send Notification"})})]}),J?(0,I.jsx)(o.Box,{pad:"20px",display:"flex",children:(0,I.jsx)(o.Loader,{style:{margin:"auto"}})}):(0,I.jsx)(o.Box,{pad:"10px 0",children:(null===K||void 0===K?void 0:K.length)>0?(0,I.jsxs)(I.Fragment,{children:[" ",(0,I.jsx)(o.Table,{naked:!0,striped:!0,children:(0,I.jsxs)("table",{children:[(0,I.jsx)("thead",{children:(0,I.jsxs)("tr",{children:[(0,I.jsx)("th",{style:{width:"50px"},children:(0,I.jsx)(o.Checkbox,{label:"",checked:ie,onChange:e=>(e=>{if("ADD"===e){const e=(0,s.A)({},te);null===K||void 0===K||K.forEach(l=>{var t,o,n;return(null===l||void 0===l||null===(t=l.student)||void 0===t?void 0:t.id)&&(e[null===l||void 0===l||null===(o=l.student)||void 0===o?void 0:o.id]=null===l||void 0===l||null===(n=l.student)||void 0===n?void 0:n.id)}),oe(e)}"REMOVE"===e&&oe({})})(ie?"REMOVE":"ADD"),size:"15px"})}),(0,I.jsx)("th",{children:"Student"}),(0,I.jsx)("th",{style:{width:"100px",textAlign:"center"},children:"Status"}),(0,I.jsx)("th",{children:"Comment"}),(0,I.jsx)("th",{children:"Action"})]})}),(0,I.jsx)("tbody",{children:null===K||void 0===K?void 0:K.map((e,l)=>{var t,n,i,r,c;const u=null!==(t=(0,m.wo)({data:null===e||void 0===e?void 0:e.student}))&&void 0!==t?t:"",x=(null===e||void 0===e||null===(n=e.student)||void 0===n?void 0:n.id)&&te[null===e||void 0===e||null===(i=e.student)||void 0===i?void 0:i.id];return(0,I.jsxs)("tr",{children:[(0,I.jsx)("td",{children:(0,I.jsx)(o.Checkbox,{label:"",checked:!!x,onChange:l=>{var t,o;return(e=>{let{studentId:l,action:t}=e;const o=(0,s.A)({},te);l&&("ADD"===t&&(o[l]=l),"REMOVE"===t&&delete o[l],oe(o))})({studentId:null!==(t=null===e||void 0===e||null===(o=e.student)||void 0===o?void 0:o.id)&&void 0!==t?t:"",action:x?"REMOVE":"ADD"})},size:"15px"})}),(0,I.jsx)("td",{children:(0,I.jsxs)("p",{style:{display:"flex",gap:"5px"},children:[(0,I.jsx)(d.Ay,{src:null===e||void 0===e||null===(r=e.student)||void 0===r?void 0:r.profile_pic,name:u,size:"30px",round:!0}),(0,I.jsxs)("span",{children:[u," ",(0,I.jsx)("br",{}),(0,I.jsx)("span",{style:{color:v.S.PrimaryColor},children:null===e||void 0===e||null===(c=e.student)||void 0===c?void 0:c.student_id})]})]})}),(0,I.jsx)("td",{children:N(null===e||void 0===e?void 0:e.status)}),(0,I.jsx)("td",{children:(0,I.jsx)("p",{children:null===e||void 0===e?void 0:e.comment})}),(0,I.jsx)("td",{children:(0,I.jsxs)(a.A,{color:"#000000",onClick:()=>{var l;return F({id:null===e||void 0===e||null===(l=e.student)||void 0===l?void 0:l.id,student:null===e||void 0===e?void 0:e.student,selectedClass:P,selectedSubject:G,selectedDate:g,comment:null===e||void 0===e?void 0:e.comment,status:null===e||void 0===e?void 0:e.status})},style:{margin:"0"},children:[(0,I.jsx)(_.A,{name:"saf-eye",size:16})," View Report"]})})]},l)})})]})}),(0,I.jsx)(o.FlexiPagination,{pageCounts:m.kf,itemsDisplayed:!0,total:null===ee||void 0===ee?void 0:ee.total,pageSize:i,onChange:l=>e(l,le),changePageSize:e=>l(e,le),current:n})]}):(0,I.jsx)(o.Box,{children:(0,I.jsx)(c.c,{image:u.A,title:"No record found",info:"There are currently no records foun
1d."})})})]})}):(0,I.jsx)(o.Box,{children:(0,I.jsx)(c.c,{image:u.A,title:"No subject found",info:"There are currently no subjects in this class."})})]}),(0,I.jsx)(R,{open:!(null===k||void 0===k||!k.id),onClose:()=>F({}),data:k,toggleStudent:e=>(e=>{const l=null===K||void 0===K?void 0:K.length;if(l>1){const t=null===K||void 0===K?void 0:K.findIndex(e=>{var l,t;return(null===e||void 0===e||null===(l=e.student)||void 0===l?void 0:l.id)===(null===k||void 0===k||null===(t=k.student)||void 0===t?void 0:t.id)});let o=t;"NEXT"===e&&(o=t+1,o===l&&(o=0)),"PREVIOUS"===e&&(o=t-1,-1===o&&(o=l-1)),F(()=>{var e,l,t,n,i;return{selectedClass:P,selectedSubject:G,selectedDate:g,id:null===(e=K[o])||void 0===e||null===(l=e.student)||void 0===l?void 0:l.id,student:null===(t=K[o])||void 0===t?void 0:t.student,comment:null===(n=K[o])||void 0===n?void 0:n.comment,status:null===(i=K[o])||void 0===i?void 0:i.status}})}})(e)}),(0,I.jsx)(B,{open:se,onClose:()=>de(!1),data:te,month:D()(g).format("MMMM").toUpperCase(),year:parseInt(D()(g).format("YYYY")),type:"MONTHLY_REPORT",subject:null===G||void 0===G?void 0:G.extra})]})};var W=t(77653),V=t(89158),U=t(97659),H=t(78046),G=t(26133),$=t(51916),q=t(77122),X=t(54451),Q=t(67051),Z=t(74647);const J=e=>{let{armId:l,classLevelId:t,month:o,subjectId:n,year:i,search:s}=e;const[d,a]=(0,r.useState)(!1),[c,u]=(0,r.useState)(null),{limit:v,offset:x,setOffset:p,setLimit:f,lastPage:j,firstPage:b,totalElements:y,totalPages:C,numberOfElements:S,setPageable:A,page:w,setPage:k,pageOptions:_,debouncedSearchText:I,searchText:F,setSearchText:B}=(0,Z.A)();(0,r.useEffect)(()=>{f(20)},[f]);const P=(0,r.useCallback)(async()=>{a(!0);try{const e=await(0,g.M2)(()=>h.Q3.getClassOverviewUsingGet({armId:l,classLevelId:t,month:o,subjectId:n,year:i,limit:v,offset:x,search:I}));u((null===e||void 0===e?void 0:e.content)||[]),A(e)}catch(e){(0,m.H4)(e)}finally{a(!1)}},[l,t,o,n,i,v,x,I,A]);return(0,r.useEffect)(()=>{l&&t&&n&&o&&i&&P()},[P,l,t,o,n,i,x,v,I]),{loadingClassOverview:d,fetchClassOverview:P,classOverview:c,limit:v,offset:x,setOffset:p,setLimit:f,lastPage:j,firstPage:b,totalElements:y,totalPages:C,numberOfElements:S,setPageable:A,page:w,setPage:k,pageOptions:_,debouncedSearchText:I,searchText:F,setSearchText:B}};var K=t(36011),ee=t(26196),le=t(37815),te=t(32309),oe=t(1697);const ne=e=>{let{termId:l,studentProgressStats:t,studentProgressList:n,loadingFetch:i}=e;const s=null===t||void 0===t?void 0:t.total,d=null===t||void 0===t?void 0:t.onTrack,a=s-d,r=s?Math.round(d/s*1e4)/100:0,c=s?Math.round(a/s*1e4)/100:0;return(0,I.jsx)(I.Fragment,{children:(0,I.jsx)(oe.j,{style:{width:"370px",margin:"32px 0px"},children:i?(0,I.jsx)(o.Box,{children:(0,I.jsx)(o.Loader,{section:!0,size:60,color:v.S.PrimaryColor})}):(0,I.jsxs)(o.Box,{style:{zIndex:3,position:"relative"},children:[(0,I.jsxs)(o.Box,{children:[(0,I.jsx)(o.Box,{children:(0,I.jsx)(o.Text,{block:!0,bold:!0,size:v.S.Paragraph,children:"No. of Student"})}),(0,I.jsx)(o.Box,{children:(0,I.jsx)(o.Text,{block:!0,style:{fontWeight:"700"},size:v.S.H5,children:null===t||void 0===t?void 0:t.total})})]}),(0,I.jsxs)(o.Box,{children:[(0,I.jsx)(o.Box,{pad:"15px 0",children:(0,I.jsx)(o.ProgressBar,{height:"6px",value:r,color:v.S.PrimaryGreen,style:{backgroundColor:v.S.PrimaryOrange}})}),(0,I.jsxs)(o.Box,{style:{display:"flex",alignItems:"center",gap:"24px"},children:[(0,I.jsxs)(o.Box,{children:[(0,I.jsx)(o.StatusIndicator,{label:"On Track",color:v.S.PrimaryGreen}),"(".concat(r,"%)"),(0,I.jsx)(o.Text,{block:!0,style:{fontWeight:"bold",fontSize:"14px"},children:d})]}),(0,I.jsxs)(o.Box,{children:[(0,I.jsx)(o.StatusIndicator,{label:"Lacking Behind",color:v.S.PrimaryOrange}),"(".concat(c,"%)"),(0,I.jsx)(o.Text,{block:!0,style:{fontWeight:"bold",fontSize:"14px"},children:a})]})]})]})]})})})},ie=e=>{let{termId:l,armId:t,classLevelId:n,subjectId:i,studentProgressStats:s,studentProgressList:d,loadingFetch:a,projectionConfig:c,weeklyConfig:u}=e;const[x,h]=(0,r.useState)({}),[p,g]=(0,r.useState)(!1),[f,j]=(0,r.useState)(""),b=(0,r.useMemo)(()=>null===d||void 0===d?void 0:d.filter(e=>!!(0,m.wo)({data:null===e||void 0===e?void 0:e.student}).toUpperCase().includes(null===f||void 0===f?void 0:f.toUpperCase())),[f,d]);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(o.Box,{children:[(0,I.jsx)(ne,{studentProgressStats:s,studentProgressList:d,loadingFetch:a,termId:l}),(0,I.jsx)(o.Box,{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"32px"},children:(0,I.jsx)(o.Box,{pad:"10px 0",children:(0,I.jsx)(o.Input,{type:"search",placeholder:"Search students",value:f,onChange:e=>{var l;return j(null===e||void 0===e||null===(l=e.target)||void 0===l?void 0:l.value)}})})}),(0,I.jsxs)(o.Box,{children:[null!==c&&void 0!==c&&c.track_progress?(0,I.jsxs)(o.Box,{pad:"10px 0",style:{display:"flex",flexDirection:"column",alignItems:"flex-start",ga
1p:"5px"},children:[(0,I.jsx)(o.Text,{bold:!0,size:v.S.Small,children:"LEGEND"}),(0,I.jsxs)(o.Box,{style:{display:"flex",gap:"10px"},children:[(0,I.jsx)(K.A,{label:"Actual"}),(0,I.jsx)(ee.A,{label:"Projection"})]})]}):(0,I.jsx)(o.Box,{}),(0,I.jsx)(le.A,{studentProgressList:b,weeklyConfig:null!==c&&void 0!==c&&c.track_progress?u:[],handleStudentClick:e=>h(e)})]})]}),(0,I.jsx)(te.u,{open:p,close:()=>g(!1),subjectId:i,classLevelId:n,termId:l,armId:t})]})},se=()=>{var e,l,t,n,i,x,h,p,g,m,f,j,b,y,C,S,A,w,_,F,B,P,z,L;const[O,R]=(0,r.useState)(D()().format("YYYY-MM-DD")),[N,Y]=(0,r.useState)(D()().format("MMMM").toUpperCase()),[Z,K]=(0,r.useState)(D()().year()),{currentTerm:ee}=(0,U.A)(),le=null!==(e=null===ee||void 0===ee?void 0:ee.term_id)&&void 0!==e?e:"",{classLevelsWithArms:te,loadingClassLevels:oe}=(0,V.A)({termId:le}),[ne,se]=(0,r.useState)(!1),[de,ae]=(0,r.useState)(null),re=(0,r.useMemo)(()=>{var e;const l=[];return null===te||void 0===te||null===(e=te.filter(e=>"ACTIVE"===(null===e||void 0===e?void 0:e.active_status)))||void 0===e||e.sort((e,l)=>((null===e||void 0===e?void 0:e.class_order)||0)>((null===l||void 0===l?void 0:l.class_order)||0)?1:-1).forEach(e=>{var t;null===e||void 0===e||null===(t=e.arms)||void 0===t||t.forEach(t=>{l.push({label:"".concat(null===e||void 0===e?void 0:e.name," ").concat(null===t||void 0===t?void 0:t.name),value:"".concat(null===e||void 0===e?void 0:e.id,"-").concat(null===t||void 0===t?void 0:t.id),extra:{level:e,arm:t}})})}),(null===l||void 0===l?void 0:l.length)>0&&ae(l[0]),l},[te]),[ce,ue]=(0,r.useState)(null),{loadingSubjects:ve,subjects:xe}=(0,T.A)({classLevelId:null===de||void 0===de||null===(l=de.extra)||void 0===l||null===(t=l.level)||void 0===t?void 0:t.id}),he=(0,r.useMemo)(()=>{const e=[];return null===xe||void 0===xe||xe.forEach(l=>
1e.push({label:"".concat(null===l||void 0===l?void 0:l.subject_name),value:null===l||void 0===l?void 0:l.id,extra:l})),(null===e||void 0===e?void 0:e.length)>0&&ue(e[0]),e},[xe]),{classOverview:pe,fetchClassOverview:ge,loadingClassOverview:me,limit:fe,offset:je,setLimit:be,setOffset:ye,setSearchText:Ce,searchText:Se,page:Ae,totalElements:we,pageOptions:ke}=J({armId:null===de||void 0===de||null===(n=de.extra)||void 0===n||null===(i=n.arm)||void 0===i?void 0:i.id,classLevelId:null===de||void 0===de||null===(x=de.extra)||void 0===x||null===(h=x.level)||void 0===h?void 0:h.id,month:N,subjectId:null===ce||void 0===ce||null===(p=ce.extra)||void 0===p?void 0:p.id,year:Z}),{fetchStudentProjectionProgress:_e,loadingFetch:Ie,studentProgressList:Fe,studentProgressStats:Be}=(0,q.y)();(0,r.useEffect)(()=>{var e,l,t,o,n;const i=null===de||void 0===de||null===(e=de.extra)||void 0===e||null===(l=e.arm)||void 0===l?void 0:l.id,s=null===de||void 0===de||null===(t=de.extra)||void 0===t||null===(o=t.level)||void 0===o?void 0:o.id,d=null===ce||void 0===ce||null===(n=ce.extra)||void 0===n?void 0:n.id;if(!i||!s||!d||!le)return;(async()=>{await _e({armId:i,classLevelId:s,subjectId:d,termId:le})})()},[_e,null===de||void 0===de||null===(g=de.extra)||void 0===g||null===(m=g.arm)||void 0===m?void 0:m.id,null===de||void 0===de||null===(f=de.extra)||void 0===f||null===(j=f.level)||void 0===j?void 0:j.id,null===ce||void 0===ce||null===(b=ce.extra)||void 0===b?void 0:b.id,le]);const{loadingFetch:Pe,projectionConfig:Ee,fetchProjectionConfig:Me}=(0,G.H)(),Te=(0,r.useCallback)(()=>{var e,l,t,o,n;null!==ce&&void 0!==ce&&ce.value&&null!==de&&void 0!==de&&null!==(e=de.extra)&&void 0!==e&&null!==(l=e.level)&&void 0!==l&&l.id&&Me({subjectId:null===ce||void 0===ce||null===(t=ce.extra)||void 0===t?void 0:t.id,classLevelId:null===de||void 0===de||null===(o=de.extra)||void 0===o||null===(n=o.level)||void 0===n?void 0:n.id})},[Me,null===ce||void 0===ce?void 0:ce.value,de,null===ce||void 0===ce||null===(y=ce.extra)||void 0===y?void 0:y.id]);(0,r.useEffect)(()=>{Te()},[Te]);const{loadingFetch:ze,weeklyConfig:De,fetchWeeklyConfig:Le}=(0,$.Y)();(0,r.useEffect)(()=>{var e,l,t;null!==ce&&void 0!==ce&&ce.value&&null!==Ee&&void 0!==Ee&&Ee.track_progress&&Le({classLevelId:null===de||void 0===de||null===(e=de.extra)||void 0===e||null===(l=e.level)||void 0===l?void 0:l.id,subjectId:null===ce||void 0===ce||null===(t=ce.extra)||void 0===t?void 0:t.id})},[de,Le,null===ce||void 0===ce||null===(C=ce.extra)||void 0===C?void 0:C.id,null===Ee||void 0===Ee?void 0:Ee.track_progress,null===ce||void 0===ce?void 0:ce.value]);const Oe=(0,r.useRef)(),Re=(0,k.R8)({content:()=>Oe.current||null,documentTitle:"".concat(null===de||void 0===de?void 0:de.label,"_Class_Overview_Report")}),Ne=e=>D()(e).format("ddd, DD"),Ye=null!==(S=null===pe||void 0===pe||null===(A=pe[0])||void 0===A||null===(w=A.overview_breakdowns)||void 0===w?void 0:w.map((e,l)=>({header:Ne(e.date),key:"pagesRead_".concat(l+1),width:20})))&&void 0!==S?S:[],We=[{header:"S/NO",key:"serial_no",width:10},{header:"Student",key:"student",width:40},{header:" Total",key:"total",width:20}];Ye&&We.splice(3,0,...Ye);const Ve=(null===pe||void 0===pe?void 0:pe.map((e,l)=>{var t,o,n,i;const d="".concat(null===e||void 0===e||null===(t=e.student)||void 0===t?void 0:t.first_name," ").concat(null===e||void 0===e||null===(o=e.student)||void 0===o?void 0:o.surname),a=null===e||void 0===e||null===(n=e.overview_breakdowns)||void 0===n?void 0:n.reduce((e,l)=>{var t;return e+(null!==(t=null===l||void 0===l?void 0:l.pages_read)&&void 0!==t?t:0)},0).toFixed(2),r={};return null===e||void 0===e||null===(i=e.overview_breakdowns)||void 0===i||i.forEach((e,l)=>{let t;t=null==(null===e||void 0===e?void 0:e.pages_read)&&null==(null===e||void 0===e?void 0:e.visible_in_report_answer)?"\u2013":null!=(null===e||void 0===e?void 0:e.visible_in_report_answer)?e.visible_in_report_answer:e.pages_read,r["pagesRead_".concat(l+1)]=t}),(0,s.A)({serial_no:++l,student:d,total:a},r)}))||[],{downloadExcel:Ue}=(0,H.A)();return(0,I.jsx)("div",{children:(0,I.jsxs)(o.Box,{pad:"5px 0",children:[(0,I.jsxs)(o.PageTitle,{children:[" ",(0,I.jsx)(o.Text,{bold:!0,title:"Broadsheet",size:v.S.H6,children:"Performance Report"})," "]}),(0,I.jsx)(o.Box,{pad:"10px 0",children:(0,I.jsx)(o.Box,{style:{borderBottom:"1px solid ".concat(v.S.PrimaryGrey)},children:(0,I.jsxs)(o.Box,{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"32px"},children:[(0,I.jsxs)(o.Box,{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,I.jsx)(o.Box,{children:(0,I.jsx)(E.Ay,{label:(0,I.jsx)(o.Text,{size:"10px",children:"Year/Month"}),hideDay:!0,value:O,onDateChange:e=>{const l=D()(e),t=l.year(),o=l.format("MMMM").toUpperCase();Y(o),K(t),R(D()(e).startOf("month").toISOString())}})}),(0,I.jsx)(o.Box,{children:(0,I.jsx)(o.Select,{label:"Class",placeholder:"Select Class...",loading:oe,options:re,value:de,onChange:e=>{ue(null),ae(e)}})}),(0,I.jsx)(o.Box,{children:(0,I.jsx)(o.Select,{label:"Subject",placeholder:"Select subject...",loading:ve,options:he,value:ce,onChange:e=>{ue(e)}})})]}),(0,I.jsx)(o.Box,{children:(0,I.jsx)(W.A,{label:"View student projection",onChange:()=>
1se(!ne),block:!0,size:10,checked:!0===ne})})]})})}),ne&&le?(0,I.jsx)(ie,{studentProgressStats:Be,studentProgressList:Fe,loadingFetch:Ie,projectionConfig:Ee,weeklyConfig:De,termId:le,armId:null===de||void 0===de||null===(_=de.extra)||void 0===_||null===(F=_.arm)||void 0===F?void 0:F.id,classLevelId:null===de||void 0===de||null===(B=de.extra)||void 0===B||null===(P=B.level)||void 0===P?void 0:P.id,subjectId:null===ce||void 0===ce||null===(z=ce.extra)||void 0===z?void 0:z.id}):null!==ce&&void 0!==ce&&null!==(L=ce.extra)&&void 0!==L&&L.id?(0,I.jsx)(M.m,{render:(e,l,t,n,i)=>{var s,r;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(o.Box,{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,I.jsx)(o.Box,{pad:"10px 0",children:(0,I.jsx)(o.Input,{type:"search",placeholder:"Search students",value:Se,onChange:e=>{var l;return Ce(null===e||void 0===e||null===(l=e.target)||void 0===l?void 0:l.value)}})}),(0,I.jsx)(o.Box,{pad:"10px 0",children:(0,I.jsxs)(o.DropDown,{trigger:"click",label:(0,I.jsx)(a.A,{color:"#FFFFFF",fontColor:"#383A3F",iconRight:(0,I.jsx)("i",{className:"flexibull-angle-down"}),children:"Export"}),menuAlign:"bottom right",children:[(0,I.jsx)("li",{onClick:Re,children:"PDF"},"text"),(0,I.jsx)("li",{onClick:()=>{var e,l;Ue({fileName:"".concat(null===de||void 0===de?void 0:de.label," Class Overview Report"),column:We,tableData:Ve,classLevel:null===de||void 0===de||null===(e=de.extra)||void 0===e||null===(l=e.level)||void 0===l?void 0:l.name})},children:"Excel sheet"},"text")]})})]}),me?(0,I.jsx)(o.Box,{pad:"20px",display:"flex",children:(0,I.jsx)(o.Loader,{style:{margin:"auto"}})}):(0,I.jsx)(o.Box,{pad:"10px 0",children:null!==pe&&void 0!==pe&&pe.length&&(null===pe||void 0===pe?void 0:pe.length)>0?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(X.L,{ref:Oe,children:[(0,I.jsx)(Q.A,{className:null===de||void 0===de?void 0:de.label}),(0,I.jsx)(o.Table,{naked:!0,striped:!0,style:{overflowX:"scroll"},children:(0,I.jsxs)("table",{children:[(0,I.jsx)("thead",{children:(0,I.jsxs)("tr",{children:[(0,I.jsx)("th",{children:"S/N"}),(0,I.jsx)("th",{style:{textAlign:"center",position:"sticky",left:0,backgroundColor:"white"},children:"Student"}),(0,I.jsx)("th",{style:{textAlign:"center",position:"sticky",left:"265px",backgroundColor:"white"},children:"Total"}),null===pe||void 0===pe||null===(s=pe[0])||void 0===s||null===(r=s.overview_breakdowns)||void 0===r?void 0:r.map((e,l)=>(0,I.jsx)("th",{children:(0,I.jsx)("span",{style:{display:"block",width:"50px"},children:Ne(null===e||void 0===e?void 0:e.date)})},l))]})}),(0,I.jsx)("tbody",{children:null===pe||void 0===pe?void 0:pe.map((e,l)=>{var t,o,n,i,s,a;return(0,I.jsxs)("tr",{children:[(0,I.jsx)("td",{children:++l}),(0,I.jsx)("td",{style:{position:"sticky",left:0,backgroundColor:"white"},children:(0,I.jsxs)("p",{style:{display:"flex",gap:"5px",alignItems:"center"},children:[(0,I.jsx)(d.Ay,{src:null===e||void 0===e||null===(t=e.student)||void 0===t?void 0:t.profile_pic,name:null===e||void 0===e||null===(o=e.student)||void 0===o?void 0:o.first_name,size:"30px",round:!0}),(0,I.jsxs)("span",{style:{width:"200px"},children:["".concat(null===e||void 0===e||null===(n=e.student)||void 0===n?void 0:n.first_name," ").concat(null===e||void 0===e||null===(i=e.student)||void 0===i?void 0:i.surname)," ",(0,I.jsx)("br",{})]})]})}),(0,I.jsx)("td",{style:{textAlign:"center",position:"sticky",left:"265px",backgroundColor:"white"},children:null===e||void 0===e||null===(s=e.overview_breakdowns)||void 0===s?void 0:s.reduce((e,l)=>{var t;return e+(null!==(t=null===l||void 0===l?void 0:l.pages_read)&&void 0!==t?t:0)},0).toFixed(2)}),null===e||void 0===e||null===(a=e.overview_breakdowns)||void 0===a?void 0:a.map((e,l)=>(0,I.jsx)("td",{style:{textAlign:"center",backgroundColor:null!=(null===e||void 0===e?void 0:e.visible_in_report_answer)?"#808080":"transparent",color:null!=(null===e||void 0===e?void 0:e.visible_in_report_answer)?"white":"inherit",fontWeight:null!=(null===e||void 0===e?void 0:e.visible_in_report_answer)?"bold":"normal"},children:null==(null===e||void 0===e?void 0:e.pages_read)&&null==(null===e||void 0===e?void 0:e.visible_in_report_answer)?"\u2013":null!=(null===e||void 0===e?void 0:e.visible_in_report_answer)?null===e||void 0===e?void 0:e.visible_in_report_answer:null===e||void 0===e?void 0:e.pages_read},l))]},l)})})]})})]}),(0,I.jsx)(o.FlexiPagination,{pageCounts:ke,itemsDisplayed:!0,total:we,pageSize:fe,onChange:e=>{ye(e-1)},changePageSize:e=>{let{value:l}=e;return be(l)},current:Ae})]}):(0,I.jsx)(o.Box,{children:(0,I.jsx)(c.c,{image:u.A,title:"No record found",info:"There are currently no records foun
1d."})})})]})}}):(0,I.jsx)(o.Box,{children:(0,I.jsx)(c.c,{image:u.A,title:"No subject found",info:"There are currently no subjects in this class."})})]})})},de=e=>{let{armId:l,classLevelId:t,sessionId:o,subjectId:n}=e;const[i,s]=(0,r.useState)(!1),[d,a]=(0,r.useState)(null),[c,u]=(0,r.useState)(""),[v]=(0,p.d7)(c,300),x=(0,r.useCallback)(async()=>{if(l&&t&&o&&n){s(!0);try{const e=await(0,g.M2)(()=>h.Q3.getStudentProgress2UsingGet({armId:l,classLevelId:t,sessionId:o,subjectId:n,search:v}));a(e)}catch(e){(0,m.H4)(e)}finally{s(!1)}}},[l,t,o,n,v]);return(0,r.useEffect)(()=>{x()},[x]),{loading:i,progress:d,fetchProgress:x,searchText:c,setSearchText:u,setProgress:a}},ae=()=>{var e,l,t,n,i,s,h,p,g,m,f,j,b,y,C,S,A,w,_,F,B,P,E,M,z,D,L;const{sessionValue:O,selectedTerm:R,loading:N,groupedTermsBySessions:Y,setSessionValue:W}=(0,x.A)({}),{currentTerm:G}=(0,U.A)(),$=null!==(e=null===G||void 0===G?void 0:G.term_id)&&void 0!==e?e:"",{classLevelsWithArms:q,loadingClassLevels:Z}=(0,V.A)({termId:$}),[J,K]=(0,r.useState)(null),ee=(0,r.useMemo)(()=>{var e;const l=[];return null===q||void 0===q||null===(e=q.filter(e=>"ACTIVE"===(null===e||void 0===e?void 0:e.active_status)))||void 0===e||e.sort((e,l)=>((null===e||void 0===e?void 0:e.class_order)||0)>((null===l||void 0===l?void 0:l.class_order)||0)?1:-1).forEach(e=>{var t;null===e||void 0===e||null===(t=e.arms)||void 0===t||t.forEach(t=>{l.push({label:"".concat(null===e||void 0===e?void 0:e.name," ").concat(null===t||void 0===t?void 0:t.name),value:"".concat(null===e||void 0===e?void 0:e.id,"-").concat(null===t||void 0===t?void 0:t.id),extra:{level:e,arm:t}})})}),(null===l||void 0===l?void 0:l.length)>0&&K(l[0]),l},[q]),[le,te]=(0,r.useState)(null),{loadingSubjects:oe,subjects:ne}=(0,T.A)({classLevelId:null===J||void 0===J||null===(l=J.extra)||void 0===l||null===(t=l.level)||void 0===t?void 0:t.id}),ie=(0,r.useMemo)(()=>{const e=[];return null===ne||void 0===ne||ne.forEach(l=>
1e.push({label:"".concat(null===l||void 0===l?void 0:l.subject_name),value:null===l||void 0===l?void 0:l.id,extra:l})),(null===e||void 0===e?void 0:e.length)>0&&te(e[0]),e},[ne]),{loading:se,progress:ae,setSearchText:re,searchText:ce}=de({armId:null===J||void 0===J||null===(n=J.extra)||void 0===n||null===(i=n.arm)||void 0===i?void 0:i.id,classLevelId:null===J||void 0===J||null===(s=J.extra)||void 0===s||null===(h=s.level)||void 0===h?void 0:h.id,subjectId:null===le||void 0===le||null===(p=le.extra)||void 0===p?void 0:p.id,sessionId:null===O||void 0===O||null===(g=O.value)||void 0===g||null===(m=g.session)||void 0===m?void 0:m.id}),ue=(0,r.useRef)(),ve=(0,k.R8)({content:()=>ue.current||null,documentTitle:"".concat(null===J||void 0===J?void 0:J.label,"_Class_Overview_Report")}),{downloadExcel:xe}=(0,H.A)(),he=null!==(f=null===ae||void 0===ae?void 0:ae.term_memorizing_count)&&void 0!==f?f:[],pe=null!==(j=null===ae||void 0===ae?void 0:ae.term_averages)&&void 0!==j?j:[],ge=Math.max(null!==(b=null===ae||void 0===ae||null===(y=ae.student_term_breakdowns)||void 0===y||null===(C=y[0])||void 0===C||null===(S=C.term_breakdowns)||void 0===S?void 0:S.length)&&void 0!==b?b:0,null===he||void 0===he?void 0:he.length,null===pe||void 0===pe?void 0:pe.length);return(0,I.jsx)("div",{children:(0,I.jsxs)(o.Box,{pad:"5px 0",children:[(0,I.jsxs)(o.PageTitle,{children:[" ",(0,I.jsx)(o.Text,{bold:!0,title:"Performance Report",size:v.S.H6,children:"Performance Report"})," "]}),(0,I.jsx)(o.Box,{pad:"10px 0",children:(0,I.jsx)(o.Box,{style:{borderBottom:"1px solid ".concat(v.S.PrimaryGrey)},children:(0,I.jsx)(o.Box,{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"32px"},children:(0,I.jsxs)(o.Box,{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,I.jsx)(o.Box,{children:(0,I.jsx)(o.Select,{label:"Session",placeholder:"Select session...",loading:N,options:null===Object||void 0===Object||null===(A=Object.entries(Y))||void 0===A?void 0:A.map(e=>{let[l,t]=e;return{label:l,value:t?t[0]:{}}}),value:O,onChange:e=>{W(e)}})}),(0,I.jsx)(o.Box,{children:(0,I.jsx)(o.Select,{label:"Class",placeholder:"Select Class...",loading:Z,options:ee,value:J,onChange:e=>{te(null),K(e)}})}),(0,I.jsx)(o.Box,{children:(0,I.jsx)(o.Select,{label:"Subject",placeholder:"Select subject...",loading:oe,options:ie,value:le,onChange:e=>{te(e)}})})]})})})}),null!==J&&void 0!==J&&null!==(w=J.extra)&&void 0!==w&&null!==(_=w.arm)&&void 0!==_&&_.id?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(o.Box,{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,I.jsx)(o.Box,{pad:"10px 0",children:(0,I.jsx)(o.Input,{type:"search",placeholder:"Search students",value:ce,onChange:e=>{var l;return re(null===e||void 0===e||null===(l=e.target)||void 0===l?void 0:l.value)}})}),(0,I.jsx)(o.Box,{pad:"10px 0",children:(0,I.jsx)(o.DropDown,{trigger:"click",label:(0,I.jsx)(a.A,{color:"#FFFFFF",fontColor:"#383A3F",iconRight:(0,I.jsx)("i",{className:"flexibull-angle-down"}),children:"Export"}),menuAlign:"bottom right",children:(0,I.jsx)("li",{onClick:ve,children:"PDF"},"text")})})]}),se?(0,I.jsx)(o.Box,{pad:"20px",display:"flex",children:(0,I.jsx)(o.Loader,{style:{margin:"auto"}})}):(0,I.jsx)(o.Box,{pad:"10px 0",children:null!==ae&&void 0!==ae&&ae.student_term_breakdowns&&(null===ae||void 0===ae||null===(F=ae.student_term_breakdowns)||void 0===F?void 0:F.length)>0?(0,I.jsx)(I.Fragment,{children:(0,I.jsxs)(X.L,{ref:ue,children:[(0,I.jsx)(Q.A,{className:null===J||void 0===J?void 0:J.label}),(0,I.jsx)(o.Table,{naked:!0,striped:!0,style:{overflowX:"scroll",padding:"0px"},children:(0,I.jsxs)("table",{children:[(0,I.jsxs)("thead",{children:[(0,I.jsxs)("tr",{children:[(0,I.jsx)("th",{style:{width:"62px"},rowSpan:2,children:"S/N"}),(0,I.jsx)("th",{rowSpan:2,style:{textAlign:"center",position:"sticky",left:0,backgroundColor:"white",width:"200px"},children:"Student"}),null===ae||void 0===ae||null===(B=ae.student_term_breakdowns)||void 0===B||null===(P=B[0])||void 0===P||null===(E=P.term_breakdowns)||void 0===E?void 0:E.map((e,l)=>{var t;return(0,I.jsx)("th",{colSpan:3,style:{textAlign:"center"},children:null===e||void 0===e||null===(t=e.term)||void 0===t?void 0:t.term_definition_name},l)})]}),(0,I.jsx)("tr",{children:null===ae||void 0===ae||null===(M=ae.student_term_breakdowns)||void 0===M||null===(z=M[0])||void 0===z||null===(D=z.term_breakdowns)||void 0===D?void 0:D.map((e,l)=>(0,I.jsxs)(r.Fragment,{children:[(0,I.jsx)("th",{style:{width:"200px"},children:"Juz/Qtr at the start of term"}),(0,I.jsx)("th",{style:{width:"100px",backgroundColor:"#FBDEC833"},children:"Goal"}),(0,I.jsx)("th",{style:{width:"100px"},children:"Achieved"})]},l))})]}),(0,I.jsxs)("tbody",{children:[null===ae||void 0===ae||null===(L=ae.student_term_breakdowns)||void 0===L?void 0:L.map((e,l)=>{var t,o,n,i,s;return(0,I.jsxs)("tr",{children:[(0,I.jsx)("td",{children:++l}),(0,I.jsx)("td",{style:{position:"sticky",left:0,backgroundColor:"white"},children:(0,I.jsxs)("p",{style:{display:"flex",gap:"5px",alignItems:"center"},children:[(0,I.jsx)(d.Ay,{src:null===e||void 0===e||null===(t=e.student)||void 0===t?void 0:t.profile_pic,name:null===e||void 0===e||null===(o=e.student)||void 0===o?void 0:o.first_name,size:"30px",round:!0}),(0,I.jsxs)("span",{style:{width:"200px"},children:["".concat(null===e||void 0===e||null===(n=e.student)||void 0===n?void 0:n.first_name," ").concat(null===e||void 0===e||null===(i=e.student)||void 0===i?void 0:i.surname),(0,I.jsx)("br",{})]})]})}),null===e||void 0===e||null===(s=e.term_breakdowns)||void 0===s?void 0:s.map((e,l)=>{var t,o,n;return(0,I.jsxs)(r.Fragment,{children:[(0,I.jsx)("td",{children:null!==(t=null===e||void 0===e?void 0:e.start_juz)&&void 0!==t?t:"-"}),(0,I.jsx)("td",{style:{backgroundColor:"#FBDEC833"},children:null!==(o=null===e||void 0===e?void 0:e.target_juz)&&void 0!==o?o:"-"}),(0,I.jsx)("td",{children:null!==(n=null===e||void 0===e?void 0:e.achieved_juz)&&void 0!==n?n:"-"})]},l)})]},l)}),(0,I.jsxs)("tr",{children:[(0,I.jsx)("td",{}),(0,I.jsx)("td",{style:{position:"sticky",left:0,backgroundColor:"#F0F9F6"},children:"No. of students memorizing"}),Array.from({length:ge}).map((e,l)=>{const t=he[l],o=pe[l];return(0,I.jsxs)(r.Fragment,{children:[(0,I.jsx)("td",{style:{backgroundColor:"#F0F9F6"},children:null!==t&&void 0!==t?t:0}),(0,I.jsx)("td",{style:{backgroundColor:"#FBDEC833",fontWeight:"700"},children:"AVERAGE"}),(0,I.jsx)("td",{children:"number"===typeof o?o.toFixed(2):null!==o&&void 0!==o?o:0})]},"footer-term-".concat(l))})]})]})]})})]})}):(0,I.jsx)(o.Box,{children:(0,I.jsx)(c.c,{image:u.A,title:"No record found",info:"There are currently no records foun
1d."})})})]}):(0,I.jsx)(o.Box,{children:(0,I.jsx)(c.c,{image:u.A,title:"Nothing to view",info:"Select a class to to view student overview."})})]})})},re=()=>{const{isProjection:e,isAcademicProfileActive:l}=(0,i.A)();return(0,I.jsx)("div",{children:(0,I.jsx)(o.Box,{pad:"20px",children:(0,I.jsxs)(n.t,{mode:"segmented",highlightColor:"#000000",color:"#000000",labelColor:"#000000",padContent:"10px 0",children:[e&&(0,I.jsx)(o.Box,{label:"Class Overview",persist:!1,children:(0,I.jsx)(se,{})}),e&&(0,I.jsx)(o.Box,{label:"Student Progress",persist:!1,children:(0,I.jsx)(ae,{})}),e&&(0,I.jsx)(o.Box,{label:"Monthly Report",persist:!1,children:(0,I.jsx)(Y,{})}),l&&(0,I.jsx)(o.Box,{label:"Academic Profile",persist:!1,children:(0,I.jsx)(P,{})})]})})})}},67051(e,l,t){"use strict";t.d(l,{A:()=>c});var o=t(73026),n=t(9939),i=t(2667),s=t.n(i),d=t(22358),a=t(5518),r=t(15678);const c=e=>{var l,t;let{className:i}=e;const c=(0,d.useSelector)(a.Hx),u=null===c||void 0===c||null===(l=c.basic_school_information_dto)||void 0===l?void 0:l.logo;return(0,r.jsxs)(o.Box,{className:"school-info",children:[(0,r.jsxs)(o.Box,{className:"school-info-left",children:[(0,r.jsx)(n.A,{src:u,alt:""}),(0,r.jsx)(o.Text,{bold:!0,block:!0,children:(null===c||void 0===c||null===(t=c.basic_school_information_dto)||void 0===t?void 0:t.school_name)&&(0,r.jsxs)(r.Fragment,{children:[c.basic_school_information_dto.school_name,(0,r.jsx)("br",{})]})}),(0,r.jsx)(o.Text,{bold:!0,block:!0,children:i&&(0,r.jsxs)(r.Fragment,{children:[i,(0,r.jsx)("br",{})]})})]}),(0,r.jsxs)(o.Box,{className:"school-info-right",children:[(0,r.jsx)(o.Text,{children:"Date:"}),(0,r.jsx)(o.Text,{bold:!0,block:!0,children:s()(new Date).format("Do MMM YYYY, h:mm:ss a")})]})]})}},74647(e,l,t){"use strict";t.d(l,{A:()=>s});var o=t(88094),n=t(66721);const i=[{value:10,label:"10 Rows"},{value:20,label:"20 Rows"},{value:50,label:"50 Rows"}],s=()=>{const[e,l]=(0,o.useState)(),[t,s]=(0,o.useState)(!1),[d,a]=(0,o.useState)(!0),[r,c]=(0,o.useState)(0),[u,v]=(0,o.useState)(10),[x,h]=(0,o.useState)(0),[p,g]=(0,o.useState)(0),[m,f]=(0,o.useState)(0),[j,b]=(0,o.useState)(1),[y,C]=(0,o.useState)(""),[S]=(0,n.d7)(y,300),[A,w]=(0,o.useState)({});return(0,o.useEffect)(()=>{e&&(s(e.last),a(e.first),h(e.total_elements||(null===e||void 0===e?void 0:e.total)),g(e.total_pages||(null===e||void 0===e?void 0:e.page_count)),f(e.number_of_elements||(null===e||void 0===e?void 0:e.skipped)),b(e.number+1||(null===e||void 0===e?void 0:e.page)||1))},[e]),(0,o.useEffect)(()=>{c(0)},[S,A]),{limit:u,offset:r,setOffset:c,setLimit:v,lastPage:t,firstPage:d,setFirst:a,totalElements:x,totalPages:p,numberOfElements:m,setPageable:l,page:j,setPage:b,pageOptions:i,searchText:y,debouncedSearchText:S,setSearchText:C,setTotalElements:h,resetPagination:()=>{c(0),v(10)},filter:A,setFilter:w}}},77653(e,l,t){"use strict";t.d(l,{A:()=>C});var o=t(89379),n=t(80045),i=t(57528),s=t(87391),d=t(59397),a=t(54737),r=t(15678);const c=["label","checked","onChange","onClick","disabled","color","block","bold","className","style","name","size","height","thickness","elevate","uncheckColor","spaceLeft","spaceRight","radius","formAlign"];var u,v,x,h,p,g;const m=d.default.label(u||(u=(0,i.A)(["\n  display: ",";\n  align-items: center;\n  gap: 8px;\n  cursor: ",";\n  opacity: ",";\n  user-select: none;\n"])),e=>e.$block?"flex":"inline-flex",e=>e.$disabled?"not-allowed":"pointer",e=>e.$disabled?.5:1),f=d.default.input(v||(v=(0,i.A)(["\n  position: absolute;\n  opacity: 0;\n  width: 0;\n  height: 0;\n  margin: 0;\n"]))),j=d.default.span(x||(x=(0,i.A)(["\n  position: relative;\n  display: inline-flex;\n  align-items: center;\n  flex-shrink: 0;\n  width: ","px;\n  height: ","px;\n  border-radius: 9999px;\n  border: 2px solid transparent;\n  background: ",";\n  transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),\n    box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1);\n\n  ",":focus-visible + & {\n    outline: none;\n    box-shadow: 0 0 0 3px ",";\n  }\n"])),44,24,e=>e.$checked?e.$color:"#E4E4E7",f,e=>(0,s.rgba)(e.$color,.28)),b=d.default.span(h||(h=(0,i.A)(["\n  position: absolute;\n  top: 50%;\n  left: 0;\n  width: ","px;\n  height: ","px;\n  border-radius: 9999px;\n  background: #fff;\n  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.1);\n  pointer-events: none;\n  transform: translate(","px, -50%);\n  transition: transform 150ms cubic-bezier(0.4, 0, 0.2, 1);\n"])),20,20,e=>e.$checked?20:0),y=d.default.span(p||(p=(0,i.A)(["\n  font-size: 14px;\n  line-height: 20px;\n  color: ",";\n  ","\n"])),a.S.PrimaryFontColor,e=>e.$bold&&(0,d.css)(g||(g=(0,i.A)(["\n      font-weight: 600;\n    "])))),C=e=>{let{label:l,checked:t=!1,onChange:i,onClick:s,disabled:d,color:u,block:v,bold:x,className:h,style:p,name:g,size:C,height:S,thickness:A,elevate:w,uncheckColor:k,space
1Left:_,spaceRight:I,radius:F,formAlign:B}=e,P=(0,n.A)(e,c);const E=u||a.S.PrimaryColor;return(0,r.jsxs)(m,{$disabled:d,$block:v,className:h,style:p,children:[(0,r.jsx)(f,(0,o.A)({name:g,type:"checkbox",role:"switch","aria-checked":!!t,"aria-label":"string"===typeof l?l:void 0,checked:!!t,disabled:d,onChange:i,onClick:s},P)),(0,r.jsx)(j,{$checked:!!t,$color:E,children:(0,r.jsx)(b,{$checked:!!t})}),l?(0,r.jsx)(y,{$bold:x,children:l}):null]})}},78046(e,l,t){"use strict";t.d(l,{A:()=>u});var o=t(89379),n=t(93216),i=t.n(n),s=t(8035),d=t.n(s),a=t(22358),r=t(5518);function c(e){let l="";for(;e>=0;)l=String.fromCharCode(65+e%26)+l,e=Math.floor(e/26)-1;return l}const u=()=>{const e=(0,a.useSelector)(r.Hx);return{downloadExcel:async l=>{var t,n,s,a;let{fileName:r,column:u,tableData:v,classLevel:x,armName:h,termSession:p,numberOfStudents:g,classAverage:m,highestAverage:f,lowestAverage:j,broadsheetTitle:b}=l;const y=new(i().Workbook),C=y.addWorksheet("Sheet");C.columns=u;const S=c(9);C.mergeCells("A1:".concat(S,"1")),C.mergeCells("A2:".concat(S,"2")),C.mergeCells("A3:".concat(S,"3")),C.mergeCells("A4:".concat(S,"4")),C.mergeCells("A5:".concat(S,"5")),C.mergeCells("A6:".concat(S,"6")),C.mergeCells("B7:".concat(S,"7"));const A=null===e||void 0===e||null===(t=e.basic_school_information_dto)||void 0===t?void 0:t.logo,w=(null===e||void 0===e||null===(n=e.basic_school_information_dto)||void 0===n?void 0:n.school_name)||"",k=(null===e||void 0===e||null===(s=e.basic_school_information_dto)||void 0===s?void 0:s.motto)||"",_=(null===e||void 0===e||null===(a=e.basic_school_information_dto)||void 0===a?void 0:a.address)||"",I=(new Date).toLocaleString("en-US",{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0});C.getCell("A1").value=w,C.getCell("A1").alignment={vertical:"middle",horizontal:"center"},C.getCell("A1").font={size:16,bold:!0},C.getCell("A1").fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFFFFFFF"}},C.getCell("A1").border={},C.getCell("A2").value=k?"Motto: ".concat(k):"",C.getCell("A2").alignment={vertical:"middle",horizontal:"center"},C.getCell("A2").font={size:12},C.getCell("A2").fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFFFFFFF"}},C.getCell("A2").border={},C.getCell("A3").value=_?"Address: ".concat(_):"",C.getCell("A3").alignment={vertical:"middle",horizontal:"center"},C.getCell("A3").font={size:12},C.getCell("A3").fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFFFFFFF"}},C.getCell("A3").border={},C.getCell("A4").value=b||"",C.getCell("A4").alignment={vertical:"middle",horizontal:"center"},C.getCell("A4").font={size:14,bold:!0},C.getCell("A4").fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFFFFFFF"}},C.getCell("A4").border={},C.getCell("A5").value="",C.getCell("A5").alignment={vertical:"middle",horizontal:"center"},C.getCell("A5").font={size:12},C.getCell("A5").fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFFFFFFF"}},C.getCell("A5").border={};let F="Class Level: ".concat(x||"");h&&(F+="   Arm: ".concat(h)),p&&(F+="   Term/Session: ".concat(p)),void 0!==g&&(F+="   No. of students: ".concat(g)),C.getCell("A6").value=F,C.getCell("A6").alignment={vertical:"middle",horizontal:"center"},C.getCell("A6").font={size:12,bold:!0},C.getCell("A6").fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFFFFFFF"}},C.getCell("A6").border={},C.getCell("A7").value="",C.getCell("A7").alignment={vertical:"middle",horizontal:"center"},C.getCell("A7").font={size:12},C.getCell("A7").fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFFFFFFF"}},C.getCell("A7").border={},C.getCell("B7").value="Date: ".concat(I),C.getCell("B7").alignment={vertical:"middle",horizontal:"center"},C.getCell("B7").font={size:12},C.getCell("B7").fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFFFFFFF"}},C.getCell("B7").border={};for(let e=1;e<=8;e++)for(let l=10;l<=16;l++)C.getCell("".concat(c(l)).concat(e)).value="",C.getCell("".concat(c(l)).concat(e)).border={};await async function(e,l){try{if(!l)return;const t=await fetch(l,{cache:"no-store"});if(!t.ok)return;const o=await t.blob(),n=await o.arrayBuffer(),i=e.addImage({buffer:n,extension:"png"});e.getWorksheet(1).addImage(i,{tl:{col:0,row:0},ext:{width:80,height:80}})}catch(t){}}(y,A),C.addRow([]);const B=u.map(e=>
1"string"===typeof e?e:e.header||e.title||e.key||"");C.addRow(B).eachCell(e=>{e.font={size:12,bold:!0},e.alignment={vertical:"middle",horizontal:"center"},e.border={top:{style:"thin"},bottom:{style:"thin"}}}),v.forEach(e=>{C.addRow((0,o.A)({},e)).eachCell(e=>{e.alignment={horizontal:"center",vertical:"middle"}})}),C.eachRow((e,l)=>{l<=8&&e.eachCell(e=>{e.font={size:1===l?16:4===l?14:12,bold:1===l||4===l||6===l||7===l},e.alignment={vertical:"middle",horizontal:"center"},e.fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFFFFFFF"}},e.border={}})}),y.xlsx.writeBuffer().then(function(e){d()(new Blob([e],{type:"application/octet-stream"}),"".concat(r,".xlsx"))})}}}},87743(e,l,t){"use strict";t.d(l,{m:()=>i});var o=t(89379),n=t(88094);class i extends n.Component{constructor(e){super(e),this.handlePagination=(e,l)=>{let t=e-1;this.setState({currentPage:e,filter:(0,o.A)((0,o.A)({},this.state.filter),{},{offset:t})}),l((0,o.A)((0,o.A)({},this.state.filter),{},{offset:t}))},this.changePageSize=(e,l)=>{this.setState({pageSize:e.value,currentPage:1,filter:(0,o.A)((0,o.A)({},this.state.filter),{},{limit:e.value})},()=>{l(this.state.filter)})},this.search=(e,l)=>{e.stopPropagation(),clearTimeout(this.searchInputDebounceTimer),this.setState({filter:(0,o.A)((0,o.A)({},this.state.filter),{},{search:e.target.value?e.target.value:null})},()=>{this.searchInputDebounceTimer=setTimeout(()=>{l(this.state.filter)},300)})},this.filter=(e,l,t)=>{this.setState({filter:(0,o.A)((0,o.A)({},this.state.filter),{},{[l]:e.value})},()=>{t(this.state.filter)})},this.removeTag=(e,l)=>{let t=this.state.filter;delete t[e.key],this.setState({filter:t},()=>{l(this.state.filter)})},this.state={filter:{offset:0,limit:10},currentPage:1,pageSize:10},this.searchInputDebounceTimer=null}render(){return this.props.render(this.handlePagination,this.changePageSize,this.search,this.state.currentPage,this.state.pageSize,this.filter,this.state.filter,this.removeTag)}}},89158(e,l,t){"use strict";t.d(l,{A:()=>d});var o=t(98819),n=t(88094),i=t(58597),s=t(23536);const d=e=>{let{termId:l,fetch:t=!0}=e;const[d,a]=(0,n.useState)(!1),[r,c]=(0,n.useState)([]),u=(0,n.useCallback)(async()=>{a(!0);try{const e=await(0,i.M2)(()=>o.IV.getClassesWithArmInfosUsingGet({termId:l}));c(e),a(!1)}catch(e){a(!1),(0,s.H4)(e)}},[l]);return(0,n.useEffect)(()=>{l&&t&&u()},[u,l,t]),{loadingClassLevels:d,fetchClassLevelsWithArms:u,classLevelsWithArms:r}}},97659(e,l,t){"use strict";t.d(l,{A:()=>c});var o=t(98819),n=t(88094),i=t(22358),s=t(38862),d=t(58597),a=t(49470),r=t(23536);const c=()=>{const{loading:e,startLoading:l,stopLoading:t}
1=(0,a.A)(),[c,u]=(0,n.useState)(void 0),v=(0,i.useDispatch)(),x=(0,n.useCallback)(async()=>{l();try{const e=await(0,d.M2)(()=>o.Qx.getCurrentTermUsingGet());t(),u(e),v((0,s.rPc)(e))}catch(e){t(),(0,r.H4)(e)}},[v,l,t]);return(0,n.useEffect)(()=>{x()},[x]),{loading:e,currentTerm:c}}}}]);

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.