mario-education 2.0.253-staging → 2.0.255-staging

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/{ArrowUp-BVv9Kbfu.cjs → ArrowUp-DX4Po1wf.cjs} +1 -1
  2. package/dist/{ArrowUp-dHG66Bq9.js → ArrowUp-DniE2n-S.js} +2 -2
  3. package/dist/CheckInChangeLogs-4A0wuITI.cjs +5 -0
  4. package/dist/{CheckInChangeLogs-C1shebC0.js → CheckInChangeLogs-BjAVIu0t.js} +61 -61
  5. package/dist/{ConversationTarget-C8rW7obD.js → ConversationTarget-BlgNqH-d.js} +1 -1
  6. package/dist/{ConversationTarget-Bp0L_v1P.cjs → ConversationTarget-Mq_yWdg5.cjs} +1 -1
  7. package/dist/CreateSurveyAdminV2-BlYltowD.cjs +1 -0
  8. package/dist/{CreateSurveyAdminV2-CHOu2UhZ.js → CreateSurveyAdminV2-X7yQ1GAa.js} +1094 -1093
  9. package/dist/Dashboard-BadezGQh.cjs +50 -0
  10. package/dist/{Dashboard-BsUhZXpB.js → Dashboard-CT4ySdap.js} +3603 -3585
  11. package/dist/{HomePage-DFybc4IA.js → HomePage-C5wbVAdx.js} +278 -278
  12. package/dist/{HomePage-C0qz8iID.cjs → HomePage-yRsfaYmw.cjs} +1 -1
  13. package/dist/{InterventionDialog-V0Gm0TUu.js → InterventionDialog-0BhKyMgS.js} +313 -317
  14. package/dist/InterventionDialog-Nu5m75IH.cjs +22 -0
  15. package/dist/{LastAnswerTable-Cm1JyX_n.js → LastAnswerTable-B9kxxFBr.js} +32 -32
  16. package/dist/LastAnswerTable-mKwy4mC0.cjs +1 -0
  17. package/dist/{LineChart-Cx9BfUMP.js → LineChart-CLIbJ7z1.js} +340 -340
  18. package/dist/LineChart-D7JQL-Cf.cjs +10 -0
  19. package/dist/OneRosterContainer-BHDMzC1V.cjs +1 -0
  20. package/dist/{OneRosterContainer-BeLapor0.js → OneRosterContainer-DeHIE93G.js} +484 -484
  21. package/dist/QuestionDetail-BsmbO_x3.cjs +1 -0
  22. package/dist/{QuestionDetail-CbXH3cMC.js → QuestionDetail-BzyxVq-3.js} +253 -253
  23. package/dist/SetupContainer-CyG0WZ46.js +2236 -0
  24. package/dist/SetupContainer-Dlgw2pUp.cjs +1 -0
  25. package/dist/{SummarizeQuestion-xjLJbEps.js → SummarizeQuestion-DYFtUnI_.js} +2 -2
  26. package/dist/{SummarizeQuestion-NqITZKdx.cjs → SummarizeQuestion-DlZVirqY.cjs} +1 -1
  27. package/dist/SurveyDashboardContainer-DPbCIDXw.cjs +10 -0
  28. package/dist/{SurveyDashboardContainer-B8xv5qmZ.js → SurveyDashboardContainer-_NA0wieK.js} +796 -785
  29. package/dist/{SurveyDetailAdmin-BquhMvgF.cjs → SurveyDetailAdmin-0W81ZV58.cjs} +1 -1
  30. package/dist/{SurveyDetailAdmin-DnmtGrQJ.js → SurveyDetailAdmin-CdePOhQJ.js} +2 -2
  31. package/dist/{SurveyIndexAdmin-DWwVhU3w.js → SurveyIndexAdmin-BDFnlGk-.js} +1 -1
  32. package/dist/{SurveyIndexAdmin-DjE-Kcv_.cjs → SurveyIndexAdmin-CgU2eWIM.cjs} +1 -1
  33. package/dist/{SurveyResultAdmin-Bq7uxGuw.js → SurveyResultAdmin-Bc2G7dsf.js} +1 -1
  34. package/dist/{SurveyResultAdmin-jbtmu54a.cjs → SurveyResultAdmin-CzirC-Qm.cjs} +1 -1
  35. package/dist/{SurveyStudentFlagListAdmin-IHRYvHZF.js → SurveyStudentFlagListAdmin-CCHdc2_F.js} +1 -1
  36. package/dist/{SurveyStudentFlagListAdmin-BaTpRQR5.cjs → SurveyStudentFlagListAdmin-Doqa72Q9.cjs} +1 -1
  37. package/dist/TableCells-DTLr3PsN.cjs +1 -0
  38. package/dist/{TableCells-BXyePlkG.js → TableCells-DrT6f9dT.js} +163 -168
  39. package/dist/{TeacherConversations-BOppnNbK.js → TeacherConversations-CcicZLxW.js} +70 -70
  40. package/dist/TeacherConversations-ViMew8lQ.cjs +1 -0
  41. package/dist/{UserProfileManagement-C_ouHuiv.js → UserProfileManagement-D7LrJAs6.js} +387 -387
  42. package/dist/UserProfileManagement-DabkIi9U.cjs +1 -0
  43. package/dist/{WellBeingDashboard-CSGawqev.js → WellBeingDashboard-0Dmuv4-I.js} +1 -1
  44. package/dist/{WellBeingDashboard-XL8lBMyy.cjs → WellBeingDashboard-L35Tvoj1.cjs} +1 -1
  45. package/dist/containers/GradeAndYearSystem/api/index.d.ts +3 -0
  46. package/dist/containers/GradeAndYearSystem/hooks/useGradeYearSystem.d.ts +10 -0
  47. package/dist/containers/GradeAndYearSystem/index.d.ts +3 -0
  48. package/dist/containers/GradeAndYearSystem/utils/type.d.ts +11 -0
  49. package/dist/containers/Overview/config/constants.d.ts +1 -2
  50. package/dist/containers/Overview/config/type.d.ts +1 -7
  51. package/dist/containers/Overview/config/utils.d.ts +1 -1
  52. package/dist/{index-C09gzB1r.js → index-DPxXa-qP.js} +688 -812
  53. package/dist/index-DjkTyzTS.cjs +1 -0
  54. package/dist/index.js +1 -1
  55. package/dist/index.modern.js +1 -1
  56. package/dist/mario-education.css +1 -1
  57. package/dist/{styles.module-YpfjvNFo.js → styles.module-B45jLh7Y.js} +182 -185
  58. package/dist/styles.module-D8jEmATu.cjs +1 -0
  59. package/dist/utils-D7z8NQmP.cjs +2 -0
  60. package/dist/{utils-MGZSYWf1.js → utils-Do2z3-3S.js} +52 -51
  61. package/package.json +2 -2
  62. package/dist/CheckInChangeLogs-BpWaexr2.cjs +0 -5
  63. package/dist/CreateSurveyAdminV2-CrnPYh9K.cjs +0 -1
  64. package/dist/Dashboard-DRu089-c.cjs +0 -50
  65. package/dist/InterventionDialog-4FoYxElM.cjs +0 -22
  66. package/dist/LastAnswerTable-JUV3KWJ5.cjs +0 -1
  67. package/dist/LineChart-B6V6YKM2.cjs +0 -10
  68. package/dist/OneRosterContainer-CIi_v1p5.cjs +0 -1
  69. package/dist/QuestionDetail-BOqhehhN.cjs +0 -1
  70. package/dist/SetupContainer-Jy0SNWce.js +0 -2016
  71. package/dist/SetupContainer-j8hhfjeL.cjs +0 -1
  72. package/dist/SurveyDashboardContainer-DWrL7AKH.cjs +0 -10
  73. package/dist/TableCells-CaaoflYr.cjs +0 -1
  74. package/dist/TeacherConversations-Dyuu6YpQ.cjs +0 -1
  75. package/dist/UserProfileManagement-D_dF-HKX.cjs +0 -1
  76. package/dist/index-nGGBIDGH.cjs +0 -1
  77. package/dist/styles.module-BtsPEeBD.cjs +0 -1
  78. package/dist/utils-CSvmgo_K.cjs +0 -2
@@ -1 +1 @@
1
- "use strict";const e=require("react/jsx-runtime"),i=require("@mui/material"),p=require("./styles.module-CHKJJ8Zm.cjs"),C=require("react"),a=require("./plp.module-BMy_AJUh.cjs"),ge=require("react-redux"),v=require("mario-core"),Z=require("./OverallDonutChart-BvdmVEAZ.cjs"),l=require("./constants-AmXlyc2R.cjs"),k=require("./LineChart-B6V6YKM2.cjs"),B=require("./constantsFn-DEDzy_j8.cjs"),ye=require("./Error-exzLuOWM.cjs"),xe=require("./CheckCircle-CrhPOfzW.cjs"),E=require("./utils-CSvmgo_K.cjs"),je=require("./CheckboxCustom-ZjvBGVzS.cjs"),T=require("./Loading-CHowA_dQ.cjs"),Ne=require("./ArrowRightIcon-D2CQJfsL.cjs"),Le=({options:s,value:r,onChange:o,disabled:d=!1,customClassName:t})=>e.jsxs(i.Grid,{className:`${p.styles["calendar-select"]} ${p.styles[t||""]}`,children:[e.jsx(i.Typography,{className:p.styles["calendar-label"],children:"Filter by date"}),e.jsx(i.Grid,{className:p.styles["calendar-options"],children:s.map(c=>e.jsx(i.Typography,{onClick:()=>!d&&o?.(c),className:`${p.styles["option-item"]} ${r==c.value?p.styles.selected:p.styles["no-selected"]}`,children:c.label},c.value))})]}),$e=s=>s.replace(/rgba\((\d+),\s*(\d+),\s*(\d+),\s*[\d.]+\)/,(r,o,d,t)=>`rgba(${o}, ${d}, ${t}, 0.6)`),pe=(s,r=!1)=>{const o=["rgba(196, 65, 64, 0.24)","rgba(255, 176, 79, 0.24)","rgba(255, 208, 40, 0.24)","rgba(169, 214, 96, 0.24)","rgba(15, 150, 85, 0.24)"];if(r){if(s<=-60||s>=60)return o[0];if(s>=-60&&s<-20)return o[3];if(s>=-20&&s<20)return o[4];if(s>=20&&s<60)return o[2]}const d=Math.max(0,Math.min(100,s)),t=100/o.length;let c=Math.floor(d/t);return c=Math.min(c,o.length-1),o[c]},H=({value:s,label:r,isStress:o,timeOfDay:d,valueData:t,loadingComplete:c=!0})=>{const g=$e(pe(t||0,o)),N=r?`${r} |`:"";return e.jsxs(i.Grid,{className:`${a.styles["graph-trend"]}`,children:[c?e.jsx(i.Typography,{style:{backgroundColor:g},className:`${a.styles["graph-label"]}`,children:`${N} ${(t||0)?.toFixed(2)}%`}):e.jsx(T.Loading,{}),d&&e.jsx("img",{src:`/images/${s<0?"trend-down.png":"trend-up.png"}`,alt:"Graph Trend Icon"})]})},fe=({percent:s,lowMetricStudents:r=[],isPrint:o=!1,onBeforeViewCheckIn:d})=>{const{t}=v.useTranslation(),[c,g]=C.useState(!1),N=()=>{g(!c)},f=k.uniq(r?.filter(u=>u.matchedGroupNames.includes("Not Ready to Learn"))?.map(u=>u.studentName)).length||0,h=k.uniq(r?.filter(u=>u.matchedGroupNames.includes("Success")||u.matchedGroupNames.includes("Readiness"))?.map(u=>u.studentName)).length||0;return e.jsxs(i.Grid,{className:`${a.styles["static-metric"]} ${a.styles[r?.length===0?"green-background":"red-background"]}`,children:[r?.length===0?e.jsx(xe.CheckCircleIcon,{className:`${a.styles["check-icon"]}`}):e.jsx(ye.ErrorIcon,{className:`${a.styles["warning-icon"]}`}),r?.length===0?e.jsx("div",{children:t("all_students_have_good_metrics")}):e.jsxs("div",{className:a.styles["static-metric__container"],children:[e.jsxs("div",{children:[e.jsx("b",{children:`${s.toFixed(2)}%`})," ",t("of_students_have_concerned_metrics")," ",!o&&e.jsxs("b",{className:`${a.styles.link}`,onClick:()=>N(),children:["(",t("see_them"),")"]})]}),e.jsxs("div",{children:[e.jsx("b",{children:`${f} ${t("students")}`})," ",t("are_not_ready_to_learn"),","," ",e.jsx("b",{children:`${h} ${t("students")}`})," ",t("have_metrics_40")]})]}),!o&&e.jsx(k.MetricModelStudent,{lowMetricStudents:r,handleToggleModel:N,openModel:c,onBeforeViewCheckIn:d})]})},ke=()=>e.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("circle",{cx:"24.9521",cy:"25.943",r:"12.2047",fill:"white",stroke:"#242424",strokeWidth:"1.6"}),e.jsx("path",{d:"M32.1831 16.1109C30.1591 14.6197 27.658 13.7385 24.9512 13.7385C20.4316 13.7385 16.4858 16.1951 14.3762 19.846C13.3396 21.64 12.7464 23.7223 12.7464 25.9432C16.174 26.6908 24.8599 25.7709 32.1831 16.1109Z",fill:"#C44140"}),e.jsx("path",{d:"M12.7464 25.9432C16.174 26.6908 24.8599 25.7709 32.1831 16.1109C30.1591 14.6197 27.658 13.7385 24.9512 13.7385C20.4316 13.7385 16.4858 16.1951 14.3762 19.846C13.3396 21.64 12.7464 23.7223 12.7464 25.9432ZM12.7464 25.9432L13.7157 31.0541",stroke:"#242424",strokeWidth:"1.6"}),e.jsx("path",{d:"M35.0033 32.457C33.9026 31.3239 30.3194 29.4838 27.1494 31.0636",stroke:"#242424",strokeWidth:"1.6",strokeLinecap:"round"}),e.jsx("path",{d:"M2.84277 14.5371L6.56435 17.4966C6.79541 17.6803 7.13909 17.559 7.20364 17.2709L7.88551 14.2275C7.95006 13.9394 8.29374 13.8181 8.5248 14.0018L12.5278 17.1851",stroke:"#242424",strokeWidth:"1.6"}),e.jsx("path",{d:"M11.6611 4.42773L13.3372 8.87738C13.4412 9.15364 13.7985 9.22586 14.0017 9.0117L16.1485 6.74917C16.3517 6.53501 16.7089 6.60722 16.8129 6.88349L18.6158 11.6697",stroke:"#242424",strokeWidth:"1.6"}),e.jsx("path",{d:"M24.3058 1.85364L23.8326 6.59318C23.8034 6.8849 24.0876 7.10781 24.364 7.01001L27.4233 5.92739C27.6997 5.82959 27.9839 6.05249 27.9548 6.34421L27.4459 11.4416",stroke:"#242424",strokeWidth:"1.6"})]}),Me=()=>e.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxs("g",{clipPath:"url(#clip0_14971_6395)",children:[e.jsx("path",{d:"M37.7857 8.62683L36.3306 10.8095L37.7857 12.9921M37.7857 8.62683V12.9921M37.7857 8.62683L39.2408 10.8095L37.7857 12.9921",stroke:"#242424",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M1.98141 26.75L0.759216 28.5833L1.98141 30.4166M1.98141 26.75V30.4166M1.98141 26.75L3.20361 28.5833L1.98141 30.4166",stroke:"#242424",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M31.9033 3.48816L30.6811 5.32146L31.9033 7.15476M31.9033 3.48816V7.15476M31.9033 3.48816L33.1255 5.32146L31.9033 7.15476",stroke:"#242424",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M8.43676 18.6139C8.43676 17.7971 8.42098 16.9786 8.43676 16.1547C8.45418 15.8087 8.50763 15.4655 8.59627 15.1306C8.68743 14.7512 8.85225 14.637 9.23617 14.6036C10.0163 14.5404 10.7999 14.5035 11.5765 14.4087C12.0909 14.33 12.6006 14.2233 13.1034 14.089C13.3944 14.0205 13.6749 13.894 13.9677 13.8501C14.4778 13.771 14.9091 13.4988 15.3701 13.3003C16.4538 12.81 17.4434 12.1335 18.2943 11.3013C18.4542 11.1587 18.6308 11.036 18.8202 10.9359C18.941 10.853 19.084 10.8086 19.2304 10.8086C19.3768 10.8086 19.5198 10.853 19.6406 10.9359C19.8593 11.0708 20.0653 11.2254 20.2559 11.3979C20.9967 12.0849 21.8214 12.6751 22.7102 13.1545C23.2682 13.4441 23.856 13.6721 24.4633 13.8343C25.1347 14.0433 25.8184 14.2154 26.5074 14.3612C26.91 14.4195 27.3156 14.4546 27.7223 14.4666C28.271 14.5141 28.8179 14.5738 29.3649 14.623C29.4655 14.6306 29.5616 14.6681 29.6409 14.7307C29.7202 14.7932 29.7791 14.8781 29.8101 14.9743C29.9278 15.2706 29.9988 15.5835 30.0205 15.9018C30.0509 17.3176 30.0597 18.7334 30.0468 20.1492C30.0441 21.5198 29.9215 22.8876 29.6804 24.2367C29.6608 24.367 29.6508 24.4985 29.6506 24.6302C29.614 25.2189 29.4996 25.8001 29.3105 26.3587C29.1352 26.9208 29.0283 27.5022 28.8214 28.0503C28.597 28.651 28.328 29.2341 28.0168 29.7946C27.3467 30.9887 26.4963 32.0719 25.4959 33.0056C24.389 34.0306 23.1306 34.8779 21.7653 35.5175C21.0326 35.8689 20.284 36.1921 19.5249 36.4784C19.3251 36.5539 19.0428 36.4784 18.8237 36.4099C18.3611 36.2612 17.9065 36.0888 17.4615 35.8935C17.0018 35.6971 16.5535 35.4748 16.1187 35.2277C15.3719 34.7886 14.6216 34.3494 13.9186 33.847C13.4424 33.4838 12.9983 33.0801 12.5915 32.6403C11.8769 31.9517 11.2594 31.1686 10.7561 30.3128C10.4163 29.7343 10.1113 29.136 9.84272 28.5211C9.5745 27.8606 9.40621 27.1615 9.18181 26.4817C8.97193 25.8103 8.84247 25.1162 8.79615 24.4142C8.72252 23.5007 8.57875 22.5926 8.47006 21.6827C8.44937 21.5236 8.43826 21.3635 8.43676 21.2031C8.43676 20.3407 8.43676 19.4799 8.43676 18.6192V18.6139Z",fill:"white",stroke:"#242424",strokeWidth:"1.6"}),e.jsx("path",{d:"M19.6304 10.9359C19.5096 10.853 19.3666 10.8086 19.2202 10.8086V36.5043C19.3259 36.5155 19.428 36.5111 19.5147 36.4784C20.2738 36.1921 21.0223 35.8689 21.7551 35.5175C23.1204 34.8779 24.3788 34.0306 25.4856 33.0056C26.4861 32.0719 27.3364 30.9887 28.0065 29.7946C28.3178 29.2341 28.5868 28.651 28.8112 28.0503C29.0181 27.5022 29.125 26.9208 29.3003 26.3587C29.4894 25.8001 29.6037 25.2189 29.6404 24.6302C29.6406 24.4985 29.6505 24.367 29.6702 24.2367C29.9113 22.8876 30.0339 21.5198 30.0366 20.1492C30.0494 18.7334 30.0406 17.3176 30.0103 15.9018C29.9886 15.5835 29.9176 15.2706 29.7999 14.9743C29.7689 14.8781 29.71 14.7932 29.6307 14.7307C29.5514 14.6681 29.4553 14.6306 29.3546 14.623C28.8077 14.5738 28.2607 14.5141 27.712 14.4666C27.3054 14.4546 26.8998 14.4195 26.4972 14.3612C25.8082 14.2154 25.1245 14.0433 24.453 13.8343C23.8458 13.6721 23.258 13.4441 22.7 13.1545C21.8111 12.6751 20.9865 12.0849 20.2457 11.3979C20.0551 11.2254 19.8491 11.0708 19.6304 10.9359Z",fill:"#0F9655"}),e.jsx("path",{d:"M18.8099 10.9359C18.9307 10.853 19.0737 10.8086 19.2202 10.8086M19.2202 10.8086C19.3666 10.8086 19.5096 10.853 19.6304 10.9359C19.8491 11.0708 20.0551 11.2254 20.2457 11.3979C20.9865 12.0849 21.8111 12.6751 22.7 13.1545C23.258 13.4441 23.8458 13.6721 24.453 13.8343C25.1245 14.0433 25.8082 14.2154 26.4972 14.3612C26.8998 14.4195 27.3054 14.4546 27.712 14.4666C28.2607 14.5141 28.8077 14.5738 29.3546 14.623C29.4553 14.6306 29.5514 14.6681 29.6307 14.7307C29.71 14.7932 29.7689 14.8781 29.7999 14.9743C29.9176 15.2706 29.9886 15.5835 30.0103 15.9018C30.0406 17.3176 30.0494 18.7334 30.0366 20.1492C30.0339 21.5198 29.9113 22.8876 29.6702 24.2367C29.6505 24.367 29.6406 24.4985 29.6404 24.6302C29.6037 25.2189 29.4894 25.8001 29.3003 26.3587C29.125 26.9208 29.0181 27.5022 28.8112 28.0503C28.5868 28.651 28.3178 29.2341 28.0065 29.7946C27.3364 30.9887 26.4861 32.0719 25.4856 33.0056C24.3788 34.0306 23.1204 34.8779 21.7551 35.5175C21.0223 35.8689 20.2738 36.1921 19.5147 36.4784C19.428 36.5111 19.3259 36.5155 19.2202 36.5043M19.2202 10.8086V36.5043M18.8134 36.4099C18.9376 36.4487 19.082 36.4898 19.2202 36.5043",stroke:"#242424",strokeWidth:"1.6"})]}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_14971_6395",children:e.jsx("rect",{width:"40",height:"40",fill:"white"})})})]}),we=({typeChart:s,activeColumn:r,series:o,months:d,name:t,dayOfWeek:c=[],colors:g,textColors:N,avgQuestionLastMonth:f,studentCount:h,studentPercentage:u,responseStudent:$,classFontSize:M,avgContent:w,print:j,width:z,height:Y,titleClassFontSize:K,min:J,hiddenKpi:X,timeOfDay:ee,weeklySeries:G,weeks:P=[],description:F,skillClass:W,kpiClassName:se,lowMetricStudents:A=[],studentMetricPercent:te,noGradient:re,setOptionDate:ae,stressValue:Q,noAvgTotal:ne,onActiveColumn:D,loadingComplete:S=!0,optionDate:b,onBeforeViewCheckIn:q,interventionLogs:ie})=>{const{t:y}=v.useTranslation(),[L,le]=C.useState("Monthly"),oe=ge.useSelector(n=>n?.common?.user).roles.includes("Student"),m=C.useMemo(()=>L!="Monthly"||j&&b!="Monthly"?G||[]:o,[o,G,L,b,j]),_=C.useMemo(()=>L!="Monthly"||j&&b!="Monthly"?P:d,[L,d,P,b,j]),ce=C.useMemo(()=>m.map(n=>{const x=f.find(I=>I.questionText.toLowerCase().includes(n.name.toLowerCase()));if(x)return x.avgQuestionResponse-x.avgQuestionResponseLastMonth;const R=n?.data.reduce((I,Ce)=>I+Ce,0);return n?.data?.length>0?R/n.data.length:0}),[m,f]),O=C.useMemo(()=>m.filter((n,x)=>r[x]).map(n=>({data:n.data,name:n.questionTranslation||n.name,questionTranslation:n.questionTranslation??""})),[m,r]),V=C.useMemo(()=>m.map(n=>n.data[0]||0),[m]),de=C.useMemo(()=>m.map(n=>n.name.charAt(0).toUpperCase()+n.name.slice(1)),[m]),he=(t===y(l.readinessTrendName)||t===y(l.successIndicatorsName)||t===y(l.overallReadinessToLearnName))&&6,ue=t===y(l.readinessTrendName)&&6||(t===y(l.successIndicatorsName)||t===y(l.learningProcessName))&&4||t===y(l.overallReadinessToLearnName)&&12,me=(t===y(l.readinessTrendName)||t===y(l.successIndicatorsName)||t===y(l.overallReadinessToLearnName)||t===y(l.learningProcessName))&&"auto",U=n=>n.length===0?0:n.reduce((x,R)=>x+R)/n.length;return e.jsxs(i.Grid,{className:`${a.styles["generate-chart"]} ${a.styles[M]}`,children:[(l.averageSafetyName===t||l.averageStressName===t)&&e.jsxs("div",{className:a.styles["icon-safety-and-stress"],children:[l.averageSafetyName===t&&e.jsx(Me,{}),l.averageStressName===t&&e.jsx(ke,{})]}),!j&&e.jsxs(i.Grid,{className:`${a.styles["header-chart-generate"]}`,children:[e.jsx(i.Typography,{className:`${K||a.styles["title-chart"]}`,children:y(t)}),!ne&&m?.[0]?.description?.length>0&&t!==l.lowMetricName&&(S?e.jsx(H,{label:E.getDescriptionFromPercent((l.averageStressName===t||l.averageSafetyName===t?U(Q??[]):m[0].data[0])||0,m[0].description,t===l.averageStressName),valueData:(l.averageStressName===t||l.averageSafetyName===t?U(Q??[]):m[0].data[0])||0,value:ce[0]||0,isStress:t==l.averageStressName,timeOfDay:ee,loadingComplete:S}):e.jsx(T.Loading,{}))]}),!j&&F&&e.jsx(i.Typography,{className:`${a.styles["header-chart-description"]}`,children:y(F)}),!S&&e.jsx("div",{style:{width:"100%",height:400,display:"flex",justifyContent:"center",alignItems:"center"},children:e.jsx(T.Loading,{})}),S&&e.jsxs(C.Fragment,{children:[e.jsxs(i.Grid,{className:`${a.styles["kpi-module"]} ${a.styles[se??""]}`,children:[!j&&e.jsx(i.Grid,{className:`${a.styles["box-model-student-skill"]} ${a.styles[W??""]}`,hidden:!h&&h!=0||oe||m.length==0||t===l.lowMetricName,children:e.jsx(k.ModelSkillStudent,{studentCount:h,studentPercentage:u,name:t,responseStudent:$,onBeforeViewCheckIn:q})}),e.jsx(i.Grid,{className:`${a.styles["box-model-student-skill"]} ${a.styles[W??""]}`,hidden:t!==l.lowMetricName,children:e.jsx(fe,{lowMetricStudents:A,percent:te||0,isPrint:j,onBeforeViewCheckIn:q})}),!X&&e.jsx(i.Grid,{className:`${a.styles.listItem} ${a.styles["ml-10"]}`,children:m.map((n,x)=>j&&!r[x]?null:e.jsxs(i.Grid,{item:!0,xs:he,sm:ue,lg:me,hidden:!n.name,className:`${a.styles["item-checkbox"]}`,children:[!!D&&e.jsx("div",{className:`${a.styles["box-checkbox"]}`,children:e.jsx(je.CheckboxCustom,{isActive:!!r[x],onClick:()=>D?.(x,t)})}),e.jsxs(i.Grid,{className:`${a.styles["item-detail"]}`,children:[e.jsxs(i.Grid,{className:`${a.styles.question}`,children:[e.jsx(i.Grid,{className:`${a.styles["point-custom"]}`,style:{backgroundColor:g[x]}}),e.jsx("label",{className:`${a.styles["label-chart"]}`,children:n.questionTranslation||n.name})]}),e.jsx(i.Typography,{className:`${a.styles["avr-question"]}`,children:B.handleGenerateAvgQuestion(n.data,J==-100,w)??0})]})]},x))}),!!G&&!j&&e.jsx(i.Grid,{className:`${a.styles["label-options"]}`,children:l.optionLabelDate.map(n=>e.jsx(i.Typography,{onClick:()=>{le?.(n),ae?.(n)},className:`${a.styles["option-item"]} ${L==n?a.styles.selected:a.styles["no-selected"]}`,children:n},n))})]}),e.jsxs(i.Grid,{className:`${j?`w-100 d-flex justify-content-center ${s=="donut"?"":a.styles["print-chart"]}`:""}`,style:{position:"relative"},children:[s=="area"&&e.jsx(Z.AreaChart,{isCountSeries:!!w,months:_,activeColumn:r,series:O,dayOfWeek:c,colors:g,min:J,noGradient:re,interventionLogs:ie},L),s=="line"&&e.jsx(k.LineChart,{months:_,activeColumn:r,series:O,dayOfWeek:c,colors:g},L),s=="donut"&&e.jsxs(C.Fragment,{children:[e.jsx(Z.OverallDonutChart,{isCountSeries:!!w,series:V,colors:g,textColors:N,label:de,width:z,height:Y,hasTooltip:t!==l.overallReadinessToLearnName},L),t===l.overallReadinessToLearnName&&e.jsxs("div",{className:a.styles["data-overall-readline-value-yes"],children:[e.jsxs("p",{children:["Yes: ",(V?.[0]||0).toFixed(1),"%"]}),e.jsx("span",{children:"of student"})]})]}),s=="bar"&&e.jsx(k.BarChart,{series:O,activeColumn:r,dayOfWeek:c,months:_,colors:g,print:j,isCountSeries:!0,lowMetricStudents:A,labelDate:L,onBeforeViewCheckIn:q},L)]})]})]},t)};function Se(s,r){return s.name===r.name&&s.typeChart===r.typeChart&&s.print===r.print&&JSON.stringify(s.dayOfWeek)===JSON.stringify(r.dayOfWeek)&&s.lowMetricStudents===r.lowMetricStudents&&s.studentMetricPercent===r.studentMetricPercent&&JSON.stringify(s.series)===JSON.stringify(r.series)&&JSON.stringify(s.weeklySeries)===JSON.stringify(r.weeklySeries)&&JSON.stringify(s.activeColumn)===JSON.stringify(r.activeColumn)&&JSON.stringify(s.avgQuestionLastMonth)===JSON.stringify(r.avgQuestionLastMonth)&&JSON.stringify(s.lowMetricStudents)===JSON.stringify(r.lowMetricStudents)&&s.studentCount===r.studentCount&&s.studentPercentage===r.studentPercentage&&JSON.stringify(s.responseStudent)===JSON.stringify(r.responseStudent)&&s.timeOfDay===r.timeOfDay&&s.stressValue===r.stressValue&&s.loadingComplete===r.loadingComplete&&s.interventionLogs===r.interventionLogs}const be=C.memo(we,Se),Te=({iconSrc:s,label:r,value:o,loadingComplete:d=!0,customClassName:t,handleOpenModal:c,customClassNameBootStrap:g})=>{const{t:N}=v.useTranslation();return e.jsxs(i.Grid,{className:`${a.styles["total-item"]} ${a.styles[t||""]} ${g||""}`,children:[e.jsxs(i.Grid,{className:`${a.styles["total-item-content"]}`,children:[e.jsx("div",{className:`${a.styles["total-item-name"]}`,dangerouslySetInnerHTML:{__html:r}}),d?e.jsxs("div",{children:[e.jsxs("div",{className:`${a.styles["total-item-value"]}`,children:[o,!!c&&Number(o)>0&&r.toLocaleLowerCase().indexOf("check-ins")<0&&e.jsxs("button",{type:"button",className:`${a.styles["total-item-btn"]}`,onClick:()=>c?.(),children:[N("see_them"),e.jsx(Ne.ArrowRightIcon,{})]})]}),!!c&&Number(o)>0&&r.toLocaleLowerCase().indexOf("check-ins")>=0&&e.jsxs("button",{type:"button",className:`${a.styles["total-item-btn"]}`,onClick:()=>c?.(),children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[e.jsx("rect",{width:"20",height:"16",x:"2",y:"4",rx:"2"}),e.jsx("path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"})]}),N("send_reminder")]})]}):e.jsx(T.Loading,{size:24})]}),s&&e.jsx("img",{className:`${a.styles["total-item-icon"]}`,src:`/images/${s}`,alt:""})]})},ve=C.memo(Te),Ge=({series:s,avgQuestionLastMonth:r,icons:o,className:d,noAvgText:t,timeOfDay:c,loadingComplete:g})=>{const{t:N}=v.useTranslation(),f=C.useMemo(()=>s.map(h=>{const u=h?.data.reduce(($,M)=>$+M,0);return h.data.length>0?u/h.data.length:0}),[s]);return e.jsx(i.Grid,{className:`${a.styles["trend-question-list"]}`,children:s.map((h,u)=>{const $=r.find(w=>w.questionText?.toLowerCase()?.includes(h.name?.toLowerCase())),M=$?$.avgQuestionResponse-$.avgQuestionResponseLastMonth:0;return e.jsxs(i.Grid,{className:`${a.styles["trend-question-item"]}`,children:[e.jsxs(i.Grid,{className:`${a.styles["trend-item-header"]}`,children:[e.jsx("div",{className:`${a.styles["trend-item-title"]}`,dangerouslySetInnerHTML:{__html:`${t?"":N("average")} ${h.questionTranslation||h.name}`}}),e.jsx("img",{className:`${a.styles["trend-item-icon"]} ${a.styles[d||""]}`,src:`/images/${o[u]}`,alt:"icon"})]}),e.jsx(H,{label:B.capitalizeFirstLetter(E.getDescriptionFromPercent(h?.data?.[0]||0,h.description)||""),value:M||0,valueData:f[u]||0,timeOfDay:c,loadingComplete:g})]},h.name)})})},qe=C.memo(Ge),_e=({opacity:s=1,color:r="#242424"})=>e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{opacity:s,d:"M8 10L3.5 6H12.5L8 10Z",fill:r})});exports.ArrowUp=_e;exports.CalendarSelect=Le;exports.GeneratePlpChart=be;exports.GenerateTrendQuestion=qe;exports.TotalCard=ve;
1
+ "use strict";const e=require("react/jsx-runtime"),i=require("@mui/material"),p=require("./styles.module-CHKJJ8Zm.cjs"),C=require("react"),a=require("./plp.module-BMy_AJUh.cjs"),ge=require("react-redux"),v=require("mario-core"),Z=require("./OverallDonutChart-BvdmVEAZ.cjs"),l=require("./constants-AmXlyc2R.cjs"),k=require("./LineChart-D7JQL-Cf.cjs"),B=require("./constantsFn-DEDzy_j8.cjs"),ye=require("./Error-exzLuOWM.cjs"),xe=require("./CheckCircle-CrhPOfzW.cjs"),E=require("./utils-D7z8NQmP.cjs"),je=require("./CheckboxCustom-ZjvBGVzS.cjs"),T=require("./Loading-CHowA_dQ.cjs"),Ne=require("./ArrowRightIcon-D2CQJfsL.cjs"),Le=({options:s,value:r,onChange:o,disabled:d=!1,customClassName:t})=>e.jsxs(i.Grid,{className:`${p.styles["calendar-select"]} ${p.styles[t||""]}`,children:[e.jsx(i.Typography,{className:p.styles["calendar-label"],children:"Filter by date"}),e.jsx(i.Grid,{className:p.styles["calendar-options"],children:s.map(c=>e.jsx(i.Typography,{onClick:()=>!d&&o?.(c),className:`${p.styles["option-item"]} ${r==c.value?p.styles.selected:p.styles["no-selected"]}`,children:c.label},c.value))})]}),$e=s=>s.replace(/rgba\((\d+),\s*(\d+),\s*(\d+),\s*[\d.]+\)/,(r,o,d,t)=>`rgba(${o}, ${d}, ${t}, 0.6)`),pe=(s,r=!1)=>{const o=["rgba(196, 65, 64, 0.24)","rgba(255, 176, 79, 0.24)","rgba(255, 208, 40, 0.24)","rgba(169, 214, 96, 0.24)","rgba(15, 150, 85, 0.24)"];if(r){if(s<=-60||s>=60)return o[0];if(s>=-60&&s<-20)return o[3];if(s>=-20&&s<20)return o[4];if(s>=20&&s<60)return o[2]}const d=Math.max(0,Math.min(100,s)),t=100/o.length;let c=Math.floor(d/t);return c=Math.min(c,o.length-1),o[c]},H=({value:s,label:r,isStress:o,timeOfDay:d,valueData:t,loadingComplete:c=!0})=>{const g=$e(pe(t||0,o)),N=r?`${r} |`:"";return e.jsxs(i.Grid,{className:`${a.styles["graph-trend"]}`,children:[c?e.jsx(i.Typography,{style:{backgroundColor:g},className:`${a.styles["graph-label"]}`,children:`${N} ${(t||0)?.toFixed(2)}%`}):e.jsx(T.Loading,{}),d&&e.jsx("img",{src:`/images/${s<0?"trend-down.png":"trend-up.png"}`,alt:"Graph Trend Icon"})]})},fe=({percent:s,lowMetricStudents:r=[],isPrint:o=!1,onBeforeViewCheckIn:d})=>{const{t}=v.useTranslation(),[c,g]=C.useState(!1),N=()=>{g(!c)},f=k.uniq(r?.filter(u=>u.matchedGroupNames.includes("Not Ready to Learn"))?.map(u=>u.studentName)).length||0,h=k.uniq(r?.filter(u=>u.matchedGroupNames.includes("Success")||u.matchedGroupNames.includes("Readiness"))?.map(u=>u.studentName)).length||0;return e.jsxs(i.Grid,{className:`${a.styles["static-metric"]} ${a.styles[r?.length===0?"green-background":"red-background"]}`,children:[r?.length===0?e.jsx(xe.CheckCircleIcon,{className:`${a.styles["check-icon"]}`}):e.jsx(ye.ErrorIcon,{className:`${a.styles["warning-icon"]}`}),r?.length===0?e.jsx("div",{children:t("all_students_have_good_metrics")}):e.jsxs("div",{className:a.styles["static-metric__container"],children:[e.jsxs("div",{children:[e.jsx("b",{children:`${s.toFixed(2)}%`})," ",t("of_students_have_concerned_metrics")," ",!o&&e.jsxs("b",{className:`${a.styles.link}`,onClick:()=>N(),children:["(",t("see_them"),")"]})]}),e.jsxs("div",{children:[e.jsx("b",{children:`${f} ${t("students")}`})," ",t("are_not_ready_to_learn"),","," ",e.jsx("b",{children:`${h} ${t("students")}`})," ",t("have_metrics_40")]})]}),!o&&e.jsx(k.MetricModelStudent,{lowMetricStudents:r,handleToggleModel:N,openModel:c,onBeforeViewCheckIn:d})]})},ke=()=>e.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("circle",{cx:"24.9521",cy:"25.943",r:"12.2047",fill:"white",stroke:"#242424",strokeWidth:"1.6"}),e.jsx("path",{d:"M32.1831 16.1109C30.1591 14.6197 27.658 13.7385 24.9512 13.7385C20.4316 13.7385 16.4858 16.1951 14.3762 19.846C13.3396 21.64 12.7464 23.7223 12.7464 25.9432C16.174 26.6908 24.8599 25.7709 32.1831 16.1109Z",fill:"#C44140"}),e.jsx("path",{d:"M12.7464 25.9432C16.174 26.6908 24.8599 25.7709 32.1831 16.1109C30.1591 14.6197 27.658 13.7385 24.9512 13.7385C20.4316 13.7385 16.4858 16.1951 14.3762 19.846C13.3396 21.64 12.7464 23.7223 12.7464 25.9432ZM12.7464 25.9432L13.7157 31.0541",stroke:"#242424",strokeWidth:"1.6"}),e.jsx("path",{d:"M35.0033 32.457C33.9026 31.3239 30.3194 29.4838 27.1494 31.0636",stroke:"#242424",strokeWidth:"1.6",strokeLinecap:"round"}),e.jsx("path",{d:"M2.84277 14.5371L6.56435 17.4966C6.79541 17.6803 7.13909 17.559 7.20364 17.2709L7.88551 14.2275C7.95006 13.9394 8.29374 13.8181 8.5248 14.0018L12.5278 17.1851",stroke:"#242424",strokeWidth:"1.6"}),e.jsx("path",{d:"M11.6611 4.42773L13.3372 8.87738C13.4412 9.15364 13.7985 9.22586 14.0017 9.0117L16.1485 6.74917C16.3517 6.53501 16.7089 6.60722 16.8129 6.88349L18.6158 11.6697",stroke:"#242424",strokeWidth:"1.6"}),e.jsx("path",{d:"M24.3058 1.85364L23.8326 6.59318C23.8034 6.8849 24.0876 7.10781 24.364 7.01001L27.4233 5.92739C27.6997 5.82959 27.9839 6.05249 27.9548 6.34421L27.4459 11.4416",stroke:"#242424",strokeWidth:"1.6"})]}),Me=()=>e.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxs("g",{clipPath:"url(#clip0_14971_6395)",children:[e.jsx("path",{d:"M37.7857 8.62683L36.3306 10.8095L37.7857 12.9921M37.7857 8.62683V12.9921M37.7857 8.62683L39.2408 10.8095L37.7857 12.9921",stroke:"#242424",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M1.98141 26.75L0.759216 28.5833L1.98141 30.4166M1.98141 26.75V30.4166M1.98141 26.75L3.20361 28.5833L1.98141 30.4166",stroke:"#242424",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M31.9033 3.48816L30.6811 5.32146L31.9033 7.15476M31.9033 3.48816V7.15476M31.9033 3.48816L33.1255 5.32146L31.9033 7.15476",stroke:"#242424",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M8.43676 18.6139C8.43676 17.7971 8.42098 16.9786 8.43676 16.1547C8.45418 15.8087 8.50763 15.4655 8.59627 15.1306C8.68743 14.7512 8.85225 14.637 9.23617 14.6036C10.0163 14.5404 10.7999 14.5035 11.5765 14.4087C12.0909 14.33 12.6006 14.2233 13.1034 14.089C13.3944 14.0205 13.6749 13.894 13.9677 13.8501C14.4778 13.771 14.9091 13.4988 15.3701 13.3003C16.4538 12.81 17.4434 12.1335 18.2943 11.3013C18.4542 11.1587 18.6308 11.036 18.8202 10.9359C18.941 10.853 19.084 10.8086 19.2304 10.8086C19.3768 10.8086 19.5198 10.853 19.6406 10.9359C19.8593 11.0708 20.0653 11.2254 20.2559 11.3979C20.9967 12.0849 21.8214 12.6751 22.7102 13.1545C23.2682 13.4441 23.856 13.6721 24.4633 13.8343C25.1347 14.0433 25.8184 14.2154 26.5074 14.3612C26.91 14.4195 27.3156 14.4546 27.7223 14.4666C28.271 14.5141 28.8179 14.5738 29.3649 14.623C29.4655 14.6306 29.5616 14.6681 29.6409 14.7307C29.7202 14.7932 29.7791 14.8781 29.8101 14.9743C29.9278 15.2706 29.9988 15.5835 30.0205 15.9018C30.0509 17.3176 30.0597 18.7334 30.0468 20.1492C30.0441 21.5198 29.9215 22.8876 29.6804 24.2367C29.6608 24.367 29.6508 24.4985 29.6506 24.6302C29.614 25.2189 29.4996 25.8001 29.3105 26.3587C29.1352 26.9208 29.0283 27.5022 28.8214 28.0503C28.597 28.651 28.328 29.2341 28.0168 29.7946C27.3467 30.9887 26.4963 32.0719 25.4959 33.0056C24.389 34.0306 23.1306 34.8779 21.7653 35.5175C21.0326 35.8689 20.284 36.1921 19.5249 36.4784C19.3251 36.5539 19.0428 36.4784 18.8237 36.4099C18.3611 36.2612 17.9065 36.0888 17.4615 35.8935C17.0018 35.6971 16.5535 35.4748 16.1187 35.2277C15.3719 34.7886 14.6216 34.3494 13.9186 33.847C13.4424 33.4838 12.9983 33.0801 12.5915 32.6403C11.8769 31.9517 11.2594 31.1686 10.7561 30.3128C10.4163 29.7343 10.1113 29.136 9.84272 28.5211C9.5745 27.8606 9.40621 27.1615 9.18181 26.4817C8.97193 25.8103 8.84247 25.1162 8.79615 24.4142C8.72252 23.5007 8.57875 22.5926 8.47006 21.6827C8.44937 21.5236 8.43826 21.3635 8.43676 21.2031C8.43676 20.3407 8.43676 19.4799 8.43676 18.6192V18.6139Z",fill:"white",stroke:"#242424",strokeWidth:"1.6"}),e.jsx("path",{d:"M19.6304 10.9359C19.5096 10.853 19.3666 10.8086 19.2202 10.8086V36.5043C19.3259 36.5155 19.428 36.5111 19.5147 36.4784C20.2738 36.1921 21.0223 35.8689 21.7551 35.5175C23.1204 34.8779 24.3788 34.0306 25.4856 33.0056C26.4861 32.0719 27.3364 30.9887 28.0065 29.7946C28.3178 29.2341 28.5868 28.651 28.8112 28.0503C29.0181 27.5022 29.125 26.9208 29.3003 26.3587C29.4894 25.8001 29.6037 25.2189 29.6404 24.6302C29.6406 24.4985 29.6505 24.367 29.6702 24.2367C29.9113 22.8876 30.0339 21.5198 30.0366 20.1492C30.0494 18.7334 30.0406 17.3176 30.0103 15.9018C29.9886 15.5835 29.9176 15.2706 29.7999 14.9743C29.7689 14.8781 29.71 14.7932 29.6307 14.7307C29.5514 14.6681 29.4553 14.6306 29.3546 14.623C28.8077 14.5738 28.2607 14.5141 27.712 14.4666C27.3054 14.4546 26.8998 14.4195 26.4972 14.3612C25.8082 14.2154 25.1245 14.0433 24.453 13.8343C23.8458 13.6721 23.258 13.4441 22.7 13.1545C21.8111 12.6751 20.9865 12.0849 20.2457 11.3979C20.0551 11.2254 19.8491 11.0708 19.6304 10.9359Z",fill:"#0F9655"}),e.jsx("path",{d:"M18.8099 10.9359C18.9307 10.853 19.0737 10.8086 19.2202 10.8086M19.2202 10.8086C19.3666 10.8086 19.5096 10.853 19.6304 10.9359C19.8491 11.0708 20.0551 11.2254 20.2457 11.3979C20.9865 12.0849 21.8111 12.6751 22.7 13.1545C23.258 13.4441 23.8458 13.6721 24.453 13.8343C25.1245 14.0433 25.8082 14.2154 26.4972 14.3612C26.8998 14.4195 27.3054 14.4546 27.712 14.4666C28.2607 14.5141 28.8077 14.5738 29.3546 14.623C29.4553 14.6306 29.5514 14.6681 29.6307 14.7307C29.71 14.7932 29.7689 14.8781 29.7999 14.9743C29.9176 15.2706 29.9886 15.5835 30.0103 15.9018C30.0406 17.3176 30.0494 18.7334 30.0366 20.1492C30.0339 21.5198 29.9113 22.8876 29.6702 24.2367C29.6505 24.367 29.6406 24.4985 29.6404 24.6302C29.6037 25.2189 29.4894 25.8001 29.3003 26.3587C29.125 26.9208 29.0181 27.5022 28.8112 28.0503C28.5868 28.651 28.3178 29.2341 28.0065 29.7946C27.3364 30.9887 26.4861 32.0719 25.4856 33.0056C24.3788 34.0306 23.1204 34.8779 21.7551 35.5175C21.0223 35.8689 20.2738 36.1921 19.5147 36.4784C19.428 36.5111 19.3259 36.5155 19.2202 36.5043M19.2202 10.8086V36.5043M18.8134 36.4099C18.9376 36.4487 19.082 36.4898 19.2202 36.5043",stroke:"#242424",strokeWidth:"1.6"})]}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_14971_6395",children:e.jsx("rect",{width:"40",height:"40",fill:"white"})})})]}),we=({typeChart:s,activeColumn:r,series:o,months:d,name:t,dayOfWeek:c=[],colors:g,textColors:N,avgQuestionLastMonth:f,studentCount:h,studentPercentage:u,responseStudent:$,classFontSize:M,avgContent:w,print:j,width:z,height:Y,titleClassFontSize:K,min:J,hiddenKpi:X,timeOfDay:ee,weeklySeries:G,weeks:P=[],description:F,skillClass:W,kpiClassName:se,lowMetricStudents:A=[],studentMetricPercent:te,noGradient:re,setOptionDate:ae,stressValue:Q,noAvgTotal:ne,onActiveColumn:D,loadingComplete:S=!0,optionDate:b,onBeforeViewCheckIn:q,interventionLogs:ie})=>{const{t:y}=v.useTranslation(),[L,le]=C.useState("Monthly"),oe=ge.useSelector(n=>n?.common?.user).roles.includes("Student"),m=C.useMemo(()=>L!="Monthly"||j&&b!="Monthly"?G||[]:o,[o,G,L,b,j]),_=C.useMemo(()=>L!="Monthly"||j&&b!="Monthly"?P:d,[L,d,P,b,j]),ce=C.useMemo(()=>m.map(n=>{const x=f.find(I=>I.questionText.toLowerCase().includes(n.name.toLowerCase()));if(x)return x.avgQuestionResponse-x.avgQuestionResponseLastMonth;const R=n?.data.reduce((I,Ce)=>I+Ce,0);return n?.data?.length>0?R/n.data.length:0}),[m,f]),O=C.useMemo(()=>m.filter((n,x)=>r[x]).map(n=>({data:n.data,name:n.questionTranslation||n.name,questionTranslation:n.questionTranslation??""})),[m,r]),V=C.useMemo(()=>m.map(n=>n.data[0]||0),[m]),de=C.useMemo(()=>m.map(n=>n.name.charAt(0).toUpperCase()+n.name.slice(1)),[m]),he=(t===y(l.readinessTrendName)||t===y(l.successIndicatorsName)||t===y(l.overallReadinessToLearnName))&&6,ue=t===y(l.readinessTrendName)&&6||(t===y(l.successIndicatorsName)||t===y(l.learningProcessName))&&4||t===y(l.overallReadinessToLearnName)&&12,me=(t===y(l.readinessTrendName)||t===y(l.successIndicatorsName)||t===y(l.overallReadinessToLearnName)||t===y(l.learningProcessName))&&"auto",U=n=>n.length===0?0:n.reduce((x,R)=>x+R)/n.length;return e.jsxs(i.Grid,{className:`${a.styles["generate-chart"]} ${a.styles[M]}`,children:[(l.averageSafetyName===t||l.averageStressName===t)&&e.jsxs("div",{className:a.styles["icon-safety-and-stress"],children:[l.averageSafetyName===t&&e.jsx(Me,{}),l.averageStressName===t&&e.jsx(ke,{})]}),!j&&e.jsxs(i.Grid,{className:`${a.styles["header-chart-generate"]}`,children:[e.jsx(i.Typography,{className:`${K||a.styles["title-chart"]}`,children:y(t)}),!ne&&m?.[0]?.description?.length>0&&t!==l.lowMetricName&&(S?e.jsx(H,{label:E.getDescriptionFromPercent((l.averageStressName===t||l.averageSafetyName===t?U(Q??[]):m[0].data[0])||0,m[0].description,t===l.averageStressName),valueData:(l.averageStressName===t||l.averageSafetyName===t?U(Q??[]):m[0].data[0])||0,value:ce[0]||0,isStress:t==l.averageStressName,timeOfDay:ee,loadingComplete:S}):e.jsx(T.Loading,{}))]}),!j&&F&&e.jsx(i.Typography,{className:`${a.styles["header-chart-description"]}`,children:y(F)}),!S&&e.jsx("div",{style:{width:"100%",height:400,display:"flex",justifyContent:"center",alignItems:"center"},children:e.jsx(T.Loading,{})}),S&&e.jsxs(C.Fragment,{children:[e.jsxs(i.Grid,{className:`${a.styles["kpi-module"]} ${a.styles[se??""]}`,children:[!j&&e.jsx(i.Grid,{className:`${a.styles["box-model-student-skill"]} ${a.styles[W??""]}`,hidden:!h&&h!=0||oe||m.length==0||t===l.lowMetricName,children:e.jsx(k.ModelSkillStudent,{studentCount:h,studentPercentage:u,name:t,responseStudent:$,onBeforeViewCheckIn:q})}),e.jsx(i.Grid,{className:`${a.styles["box-model-student-skill"]} ${a.styles[W??""]}`,hidden:t!==l.lowMetricName,children:e.jsx(fe,{lowMetricStudents:A,percent:te||0,isPrint:j,onBeforeViewCheckIn:q})}),!X&&e.jsx(i.Grid,{className:`${a.styles.listItem} ${a.styles["ml-10"]}`,children:m.map((n,x)=>j&&!r[x]?null:e.jsxs(i.Grid,{item:!0,xs:he,sm:ue,lg:me,hidden:!n.name,className:`${a.styles["item-checkbox"]}`,children:[!!D&&e.jsx("div",{className:`${a.styles["box-checkbox"]}`,children:e.jsx(je.CheckboxCustom,{isActive:!!r[x],onClick:()=>D?.(x,t)})}),e.jsxs(i.Grid,{className:`${a.styles["item-detail"]}`,children:[e.jsxs(i.Grid,{className:`${a.styles.question}`,children:[e.jsx(i.Grid,{className:`${a.styles["point-custom"]}`,style:{backgroundColor:g[x]}}),e.jsx("label",{className:`${a.styles["label-chart"]}`,children:n.questionTranslation||n.name})]}),e.jsx(i.Typography,{className:`${a.styles["avr-question"]}`,children:B.handleGenerateAvgQuestion(n.data,J==-100,w)??0})]})]},x))}),!!G&&!j&&e.jsx(i.Grid,{className:`${a.styles["label-options"]}`,children:l.optionLabelDate.map(n=>e.jsx(i.Typography,{onClick:()=>{le?.(n),ae?.(n)},className:`${a.styles["option-item"]} ${L==n?a.styles.selected:a.styles["no-selected"]}`,children:n},n))})]}),e.jsxs(i.Grid,{className:`${j?`w-100 d-flex justify-content-center ${s=="donut"?"":a.styles["print-chart"]}`:""}`,style:{position:"relative"},children:[s=="area"&&e.jsx(Z.AreaChart,{isCountSeries:!!w,months:_,activeColumn:r,series:O,dayOfWeek:c,colors:g,min:J,noGradient:re,interventionLogs:ie},L),s=="line"&&e.jsx(k.LineChart,{months:_,activeColumn:r,series:O,dayOfWeek:c,colors:g},L),s=="donut"&&e.jsxs(C.Fragment,{children:[e.jsx(Z.OverallDonutChart,{isCountSeries:!!w,series:V,colors:g,textColors:N,label:de,width:z,height:Y,hasTooltip:t!==l.overallReadinessToLearnName},L),t===l.overallReadinessToLearnName&&e.jsxs("div",{className:a.styles["data-overall-readline-value-yes"],children:[e.jsxs("p",{children:["Yes: ",(V?.[0]||0).toFixed(1),"%"]}),e.jsx("span",{children:"of student"})]})]}),s=="bar"&&e.jsx(k.BarChart,{series:O,activeColumn:r,dayOfWeek:c,months:_,colors:g,print:j,isCountSeries:!0,lowMetricStudents:A,labelDate:L,onBeforeViewCheckIn:q},L)]})]})]},t)};function Se(s,r){return s.name===r.name&&s.typeChart===r.typeChart&&s.print===r.print&&JSON.stringify(s.dayOfWeek)===JSON.stringify(r.dayOfWeek)&&s.lowMetricStudents===r.lowMetricStudents&&s.studentMetricPercent===r.studentMetricPercent&&JSON.stringify(s.series)===JSON.stringify(r.series)&&JSON.stringify(s.weeklySeries)===JSON.stringify(r.weeklySeries)&&JSON.stringify(s.activeColumn)===JSON.stringify(r.activeColumn)&&JSON.stringify(s.avgQuestionLastMonth)===JSON.stringify(r.avgQuestionLastMonth)&&JSON.stringify(s.lowMetricStudents)===JSON.stringify(r.lowMetricStudents)&&s.studentCount===r.studentCount&&s.studentPercentage===r.studentPercentage&&JSON.stringify(s.responseStudent)===JSON.stringify(r.responseStudent)&&s.timeOfDay===r.timeOfDay&&s.stressValue===r.stressValue&&s.loadingComplete===r.loadingComplete&&s.interventionLogs===r.interventionLogs}const be=C.memo(we,Se),Te=({iconSrc:s,label:r,value:o,loadingComplete:d=!0,customClassName:t,handleOpenModal:c,customClassNameBootStrap:g})=>{const{t:N}=v.useTranslation();return e.jsxs(i.Grid,{className:`${a.styles["total-item"]} ${a.styles[t||""]} ${g||""}`,children:[e.jsxs(i.Grid,{className:`${a.styles["total-item-content"]}`,children:[e.jsx("div",{className:`${a.styles["total-item-name"]}`,dangerouslySetInnerHTML:{__html:r}}),d?e.jsxs("div",{children:[e.jsxs("div",{className:`${a.styles["total-item-value"]}`,children:[o,!!c&&Number(o)>0&&r.toLocaleLowerCase().indexOf("check-ins")<0&&e.jsxs("button",{type:"button",className:`${a.styles["total-item-btn"]}`,onClick:()=>c?.(),children:[N("see_them"),e.jsx(Ne.ArrowRightIcon,{})]})]}),!!c&&Number(o)>0&&r.toLocaleLowerCase().indexOf("check-ins")>=0&&e.jsxs("button",{type:"button",className:`${a.styles["total-item-btn"]}`,onClick:()=>c?.(),children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[e.jsx("rect",{width:"20",height:"16",x:"2",y:"4",rx:"2"}),e.jsx("path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"})]}),N("send_reminder")]})]}):e.jsx(T.Loading,{size:24})]}),s&&e.jsx("img",{className:`${a.styles["total-item-icon"]}`,src:`/images/${s}`,alt:""})]})},ve=C.memo(Te),Ge=({series:s,avgQuestionLastMonth:r,icons:o,className:d,noAvgText:t,timeOfDay:c,loadingComplete:g})=>{const{t:N}=v.useTranslation(),f=C.useMemo(()=>s.map(h=>{const u=h?.data.reduce(($,M)=>$+M,0);return h.data.length>0?u/h.data.length:0}),[s]);return e.jsx(i.Grid,{className:`${a.styles["trend-question-list"]}`,children:s.map((h,u)=>{const $=r.find(w=>w.questionText?.toLowerCase()?.includes(h.name?.toLowerCase())),M=$?$.avgQuestionResponse-$.avgQuestionResponseLastMonth:0;return e.jsxs(i.Grid,{className:`${a.styles["trend-question-item"]}`,children:[e.jsxs(i.Grid,{className:`${a.styles["trend-item-header"]}`,children:[e.jsx("div",{className:`${a.styles["trend-item-title"]}`,dangerouslySetInnerHTML:{__html:`${t?"":N("average")} ${h.questionTranslation||h.name}`}}),e.jsx("img",{className:`${a.styles["trend-item-icon"]} ${a.styles[d||""]}`,src:`/images/${o[u]}`,alt:"icon"})]}),e.jsx(H,{label:B.capitalizeFirstLetter(E.getDescriptionFromPercent(h?.data?.[0]||0,h.description)||""),value:M||0,valueData:f[u]||0,timeOfDay:c,loadingComplete:g})]},h.name)})})},qe=C.memo(Ge),_e=({opacity:s=1,color:r="#242424"})=>e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{opacity:s,d:"M8 10L3.5 6H12.5L8 10Z",fill:r})});exports.ArrowUp=_e;exports.CalendarSelect=Le;exports.GeneratePlpChart=be;exports.GenerateTrendQuestion=qe;exports.TotalCard=ve;
@@ -7,11 +7,11 @@ import { useSelector as b1 } from "react-redux";
7
7
  import { useTranslation as x } from "mario-core";
8
8
  import { A as w1, O as S1 } from "./OverallDonutChart-CXTBNnZs.js";
9
9
  import { r as Q, E as j, y as T, Q as e1, q, t as w, v as F, R as _1 } from "./constants-B823Sm_9.js";
10
- import { u as t1, a as T1, M as v1, L as O1, B as q1 } from "./LineChart-Cx9BfUMP.js";
10
+ import { u as t1, a as T1, M as v1, L as O1, B as q1 } from "./LineChart-CLIbJ7z1.js";
11
11
  import { h as J1, c as x1 } from "./constantsFn-xJPOaqgs.js";
12
12
  import { E as G1 } from "./Error-DGB_YSVF.js";
13
13
  import { C as I1 } from "./CheckCircle-pzvKW5G5.js";
14
- import { i as r1 } from "./utils-MGZSYWf1.js";
14
+ import { i as r1 } from "./utils-Do2z3-3S.js";
15
15
  import { C as P1 } from "./CheckboxCustom-CRZWuCKp.js";
16
16
  import { L as J } from "./Loading-9Xhwui4j.js";
17
17
  import { A as W1 } from "./ArrowRightIcon-Sq9hCEbe.js";
@@ -0,0 +1,5 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),K=require("react-redux"),F=require("mario-core"),_=`${F.BASE_URL}/api/Session`,V=g=>{const{schoolLevel:y,...w}=g,i={};return y==="es"&&(i["X-School-Level"]="es"),F.api.get(`${_}/change-logs`,{params:w,headers:Object.keys(i).length>0?i:void 0})},W=()=>{const{getLabel:g,system:y}=F.useGradeLabel(),i=K.useSelector(s=>s.common?.user)?.hasEsSchool!==!1,[o,D]=t.useState("ms"),[u,I]=t.useState(""),[x,E]=t.useState(""),[C,G]=t.useState(""),[j,T]=t.useState(""),[f,A]=t.useState(""),[h,m]=t.useState(1),[d,U]=t.useState(20),[l,q]=t.useState({totalItems:0,currentPage:1,pageSize:20,totalPages:0,items:[]}),[L,$]=t.useState(!1),[P,M]=t.useState(null),[a,v]=t.useState(null),[z,N]=t.useState(!1),p=t.useCallback(async(s=h,n=d,S=o)=>{$(!0),M(null);try{const r={page:s,pageSize:n,schoolLevel:i?S:"ms"};u.trim()&&(r.searchStudent=u.trim()),x.trim()&&(r.flagType=x.trim()),C.trim()&&(r.gradeLevel=C.trim()),j&&(r.startDate=j),f&&(r.endDate=f);const k=await V(r);k&&k.data&&q(k.data)}catch(c){console.error("Failed to load check-in change logs:",c),M(c?.response?.data?.message||c?.message||"Failed to load check-in change logs. Please try again.")}finally{$(!1)}},[h,d,o,u,x,C,j,f,i]);t.useEffect(()=>{p(h,d,o)},[h,d,o]);const H=s=>{s.preventDefault(),m(1),p(1,d,o)},O=s=>{D(s),m(1),p(1,d,s)},Y=()=>{I(""),E(""),G(""),T(""),A(""),D("ms"),m(1)},B=async()=>{if(!a)return;const s=["=== CHECK-IN CHANGE AUDIT LOG ===",`Session ID: ${a.sessionId}`,`Student: ${a.studentName||"Unknown"} (${a.gradeLevel||"N/A"})`,`Teacher: ${a.teacherName||"N/A"}`,`Session Date: ${b(a.sessionDate)}`,`Current Flag: ${a.flagType}`,`Total Edits: ${a.logCount}`,"---------------------------------","Modification History:"].join(`
2
+ `),n=a.changeLogs&&a.changeLogs.length>0?a.changeLogs.map((c,r)=>`[#${r+1}] ${c}`).join(`
3
+ `):"No modification records.",S=`${s}
4
+ ${n}
5
+ =================================`;try{await navigator.clipboard.writeText(S),N(!0),setTimeout(()=>N(!1),2e3)}catch{const c=document.createElement("textarea");c.value=S,document.body.appendChild(c),c.select(),document.execCommand("copy"),document.body.removeChild(c),N(!0),setTimeout(()=>N(!1),2e3)}},b=s=>{if(!s)return"-";try{return new Date(s).toLocaleString(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}catch{return s}},R=s=>{const n=(s||"Green").toLowerCase();return n==="red"?e.jsx("span",{className:"badge-flag flag-red",children:"Red Flag"}):n==="yellow"?e.jsx("span",{className:"badge-flag flag-yellow",children:"Yellow Flag"}):e.jsx("span",{className:"badge-flag flag-green",children:"Green Flag"})};return e.jsxs("div",{className:"checkin-change-logs-page fadeIn animated",children:[e.jsxs("div",{className:"page-header",children:[e.jsxs("h1",{className:"page-title",children:["Check-in Change Logs",i&&e.jsx("span",{className:"internal-badge",children:o==="es"?"Elementary School (ES)":"Middle School (MS)"})]}),e.jsx("p",{className:"page-subtitle",children:"Audit trail of completed student check-ins whose scores or flags were manually modified."})]}),e.jsx("div",{className:"filter-card",children:e.jsxs("form",{onSubmit:H,className:"row g-3",children:[i&&e.jsxs("div",{className:"col-md-2",children:[e.jsx("label",{className:"form-label",htmlFor:"filter-school-level",children:"School Level"}),e.jsxs("select",{id:"filter-school-level",className:"form-select form-select-sm",value:o,onChange:s=>O(s.target.value),children:[e.jsx("option",{value:"ms",children:"Middle School (MS)"}),e.jsx("option",{value:"es",children:"Elementary School (ES)"})]})]}),e.jsxs("div",{className:i?"col-md-3":"col-md-4",children:[e.jsx("label",{className:"form-label",htmlFor:"filter-student",children:"Search Student"}),e.jsx("input",{id:"filter-student",type:"text",className:"form-control form-control-sm",placeholder:"e.g. Student Name",value:u,onChange:s=>I(s.target.value)})]}),e.jsxs("div",{className:"col-md-2",children:[e.jsx("label",{className:"form-label",htmlFor:"filter-flag",children:"Current Flag"}),e.jsxs("select",{id:"filter-flag",className:"form-select form-select-sm",value:x,onChange:s=>E(s.target.value),children:[e.jsx("option",{value:"",children:"All Flags"}),e.jsx("option",{value:"Red",children:"Red Flag"}),e.jsx("option",{value:"Yellow",children:"Yellow Flag"}),e.jsx("option",{value:"Green",children:"Green Flag"})]})]}),e.jsxs("div",{className:"col-md-2",children:[e.jsx("label",{className:"form-label",htmlFor:"filter-start-date",children:"Start Date"}),e.jsx("input",{id:"filter-start-date",type:"date",className:"form-control form-control-sm",value:j,onChange:s=>T(s.target.value)})]}),e.jsxs("div",{className:"col-md-2",children:[e.jsx("label",{className:"form-label",htmlFor:"filter-end-date",children:"End Date"}),e.jsx("input",{id:"filter-end-date",type:"date",className:"form-control form-control-sm",value:f,onChange:s=>A(s.target.value)})]}),e.jsx("div",{className:"col-md-1 d-flex align-items-end",children:e.jsxs("div",{className:"btn-filter-group w-100",children:[e.jsx("button",{type:"submit",className:"btn btn-primary btn-sm flex-fill",disabled:L,children:"Filter"}),e.jsx("button",{type:"button",className:"btn btn-outline-secondary btn-sm",onClick:Y,title:"Reset Filters",children:"↺"})]})})]})}),P&&e.jsx("div",{className:"alert alert-danger",role:"alert",children:P}),e.jsxs("div",{className:"table-card",children:[L?e.jsxs("div",{className:"loading-container",children:[e.jsx("div",{className:"spinner-border",role:"status",children:e.jsx("span",{className:"visually-hidden",children:"Loading..."})}),e.jsx("p",{className:"mt-2 text-muted",children:"Loading audit change logs..."})]}):l.items.length===0?e.jsxs("div",{className:"empty-state",children:[e.jsx("div",{className:"empty-icon",children:"📋"}),e.jsx("div",{className:"empty-title",children:"No Modified Check-Ins Found"}),e.jsx("div",{className:"empty-desc",children:"There are no check-in records matching the selected filters with manual modifications."})]}):e.jsx("div",{className:"table-responsive",children:e.jsxs("table",{className:"table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Session ID"}),e.jsx("th",{children:"Student Name"}),e.jsx("th",{children:y==="UK"?"Year":"Grade"}),e.jsx("th",{children:"Teacher"}),e.jsx("th",{children:"Session Date"}),e.jsx("th",{children:"Current Flag"}),e.jsx("th",{children:"Edits"}),e.jsx("th",{children:"Last Modified"}),e.jsx("th",{style:{width:"120px",textAlign:"center"},children:"Action"})]})}),e.jsx("tbody",{children:l.items.map(s=>e.jsxs("tr",{children:[e.jsxs("td",{children:["#",s.sessionId]}),e.jsx("td",{className:"student-cell",children:s.studentName||"Unknown Student"}),e.jsx("td",{children:s.gradeLevel?g(s.gradeLevel):"-"}),e.jsx("td",{className:"teacher-cell",children:s.teacherName||"-"}),e.jsx("td",{children:b(s.sessionDate)}),e.jsx("td",{children:R(s.flagType)}),e.jsx("td",{children:e.jsxs("span",{className:"badge-edits",children:[s.logCount," edit",s.logCount!==1?"s":""]})}),e.jsx("td",{children:b(s.updatedAt)}),e.jsx("td",{style:{textAlign:"center"},children:e.jsx("button",{type:"button",className:"btn-view-logs",onClick:()=>v(s),children:"View Logs"})})]},s.sessionId))})]})}),!L&&l.totalItems>0&&e.jsxs("div",{className:"pagination-container",children:[e.jsxs("div",{className:"pagination-info",children:["Showing ",(l.currentPage-1)*l.pageSize+1," to ",Math.min(l.currentPage*l.pageSize,l.totalItems)," of ",l.totalItems," modified sessions"]}),e.jsxs("div",{className:"pagination-controls",children:[e.jsxs("select",{className:"form-select form-select-sm",style:{width:"90px"},value:d,onChange:s=>{const n=parseInt(s.target.value,10);U(n),m(1),p(1,n,o)},children:[e.jsx("option",{value:10,children:"10 / page"}),e.jsx("option",{value:20,children:"20 / page"}),e.jsx("option",{value:50,children:"50 / page"})]}),e.jsx("button",{type:"button",className:"btn btn-outline-secondary btn-sm",disabled:h<=1,onClick:()=>m(s=>Math.max(s-1,1)),children:"Previous"}),e.jsxs("span",{className:"page-indicator",style:{fontSize:"13px",fontWeight:600},children:[l.currentPage," / ",l.totalPages||1]}),e.jsx("button",{type:"button",className:"btn btn-outline-secondary btn-sm",disabled:h>=l.totalPages,onClick:()=>m(s=>Math.min(s+1,l.totalPages)),children:"Next"})]})]})]}),a&&e.jsxs("div",{className:"checkin-change-log-modal fadeIn animated",children:[e.jsx("div",{className:"modal-backdrop-custom",onClick:()=>v(null)}),e.jsxs("div",{className:"modal-content-custom",children:[e.jsxs("div",{className:"modal-header",children:[e.jsxs("h2",{className:"modal-title",children:[e.jsx("span",{children:"Check-in Audit Log"}),e.jsxs("span",{className:"badge bg-secondary",style:{fontSize:"12px"},children:["Session #",a.sessionId]})]}),e.jsx("button",{type:"button",className:"btn-close-custom",onClick:()=>v(null),"aria-label":"Close",children:"✕"})]}),e.jsxs("div",{className:"modal-body",children:[e.jsxs("div",{className:"info-grid",children:[e.jsxs("div",{className:"info-item",children:[e.jsx("div",{className:"info-label",children:"Student"}),e.jsxs("div",{className:"info-value",children:[a.studentName||"Unknown"," (",a.gradeLevel?g(a.gradeLevel):"N/A",")"]})]}),e.jsxs("div",{className:"info-item",children:[e.jsx("div",{className:"info-label",children:"Teacher"}),e.jsx("div",{className:"info-value",children:a.teacherName||"N/A"})]}),e.jsxs("div",{className:"info-item",children:[e.jsx("div",{className:"info-label",children:"Session Date"}),e.jsx("div",{className:"info-value",children:b(a.sessionDate)})]}),e.jsxs("div",{className:"info-item",children:[e.jsx("div",{className:"info-label",children:"Current Flag"}),e.jsx("div",{className:"info-value",children:R(a.flagType)})]})]}),e.jsxs("div",{className:"audit-header",children:[e.jsxs("h3",{className:"audit-title",children:["Modification History (",a.logCount," recent changes)"]}),e.jsx("button",{type:"button",className:`btn btn-sm ${z?"btn-success":"btn-outline-primary"} btn-copy`,onClick:B,children:z?"✓ Copied to Clipboard!":"📋 Copy All Logs"})]}),e.jsx("div",{className:"timeline-container",children:a.changeLogs&&a.changeLogs.length>0?a.changeLogs.map((s,n)=>e.jsxs("div",{className:"log-entry-card",children:[e.jsxs("span",{className:"log-index-tag",children:["#",n+1]}),s]},n)):e.jsx("p",{className:"text-muted fst-italic",children:"No detailed log entries available."})})]}),e.jsx("div",{className:"modal-footer",children:e.jsx("button",{type:"button",className:"btn btn-secondary btn-sm",onClick:()=>v(null),children:"Close"})})]})]})]})};exports.default=W;
@@ -1,47 +1,47 @@
1
1
  import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
- import { useState as c, useCallback as B, useEffect as _ } from "react";
3
- import { useSelector as K } from "react-redux";
4
- import { api as V, BASE_URL as W } from "mario-core";
5
- const X = `${W}/api/Session`, q = (x) => {
6
- const { schoolLevel: r, ...o } = x, m = {};
7
- return r === "es" && (m["X-School-Level"] = "es"), V.get(`${X}/change-logs`, {
8
- params: o,
9
- headers: Object.keys(m).length > 0 ? m : void 0
2
+ import { useState as c, useCallback as _, useEffect as V } from "react";
3
+ import { useSelector as W } from "react-redux";
4
+ import { api as X, BASE_URL as q, useGradeLabel as J } from "mario-core";
5
+ const Q = `${q}/api/Session`, Z = (u) => {
6
+ const { schoolLevel: k, ...D } = u, o = {};
7
+ return k === "es" && (o["X-School-Level"] = "es"), X.get(`${Q}/change-logs`, {
8
+ params: D,
9
+ headers: Object.keys(o).length > 0 ? o : void 0
10
10
  });
11
- }, ae = () => {
12
- const r = K((a) => a.common?.user)?.hasEsSchool !== !1, [o, m] = c("ms"), [f, D] = c(""), [p, I] = c(""), [k, G] = c(""), [N, E] = c(""), [v, T] = c(""), [g, u] = c(1), [h, U] = c(20), [n, R] = c({
11
+ }, ne = () => {
12
+ const { getLabel: u, system: k } = J(), o = W((a) => a.common?.user)?.hasEsSchool !== !1, [d, I] = c("ms"), [f, E] = c(""), [p, T] = c(""), [F, R] = c(""), [N, A] = c(""), [v, $] = c(""), [m, g] = c(1), [h, j] = c(20), [n, H] = c({
13
13
  totalItems: 0,
14
14
  currentPage: 1,
15
15
  pageSize: 20,
16
16
  totalPages: 0,
17
17
  items: []
18
- }), [F, A] = c(!1), [$, P] = c(null), [t, b] = c(null), [M, y] = c(!1), S = B(async (a = g, s = h, L = o) => {
19
- A(!0), P(null);
18
+ }), [w, P] = c(!1), [M, z] = c(null), [t, b] = c(null), [G, y] = c(!1), S = _(async (a = m, s = h, L = d) => {
19
+ P(!0), z(null);
20
20
  try {
21
- const d = {
21
+ const r = {
22
22
  page: a,
23
23
  pageSize: s,
24
- schoolLevel: r ? L : "ms"
24
+ schoolLevel: o ? L : "ms"
25
25
  };
26
- f.trim() && (d.searchStudent = f.trim()), p.trim() && (d.flagType = p.trim()), k.trim() && (d.gradeLevel = k.trim()), N && (d.startDate = N), v && (d.endDate = v);
27
- const w = await q(d);
28
- w && w.data && R(w.data);
26
+ f.trim() && (r.searchStudent = f.trim()), p.trim() && (r.flagType = p.trim()), F.trim() && (r.gradeLevel = F.trim()), N && (r.startDate = N), v && (r.endDate = v);
27
+ const x = await Z(r);
28
+ x && x.data && H(x.data);
29
29
  } catch (i) {
30
- console.error("Failed to load check-in change logs:", i), P(i?.response?.data?.message || i?.message || "Failed to load check-in change logs. Please try again.");
30
+ console.error("Failed to load check-in change logs:", i), z(i?.response?.data?.message || i?.message || "Failed to load check-in change logs. Please try again.");
31
31
  } finally {
32
- A(!1);
32
+ P(!1);
33
33
  }
34
- }, [g, h, o, f, p, k, N, v, r]);
35
- _(() => {
36
- S(g, h, o);
37
- }, [g, h, o]);
38
- const j = (a) => {
39
- a.preventDefault(), u(1), S(1, h, o);
40
- }, H = (a) => {
41
- m(a), u(1), S(1, h, a);
42
- }, O = () => {
43
- D(""), I(""), G(""), E(""), T(""), m("ms"), u(1);
44
- }, Y = async () => {
34
+ }, [m, h, d, f, p, F, N, v, o]);
35
+ V(() => {
36
+ S(m, h, d);
37
+ }, [m, h, d]);
38
+ const Y = (a) => {
39
+ a.preventDefault(), g(1), S(1, h, d);
40
+ }, O = (a) => {
41
+ I(a), g(1), S(1, h, a);
42
+ }, B = () => {
43
+ E(""), T(""), R(""), A(""), $(""), I("ms"), g(1);
44
+ }, K = async () => {
45
45
  if (!t) return;
46
46
  const a = [
47
47
  "=== CHECK-IN CHANGE AUDIT LOG ===",
@@ -54,7 +54,7 @@ const X = `${W}/api/Session`, q = (x) => {
54
54
  "---------------------------------",
55
55
  "Modification History:"
56
56
  ].join(`
57
- `), s = t.changeLogs && t.changeLogs.length > 0 ? t.changeLogs.map((i, d) => `[#${d + 1}] ${i}`).join(`
57
+ `), s = t.changeLogs && t.changeLogs.length > 0 ? t.changeLogs.map((i, r) => `[#${r + 1}] ${i}`).join(`
58
58
  `) : "No modification records.", L = `${a}
59
59
  ${s}
60
60
  =================================`;
@@ -77,7 +77,7 @@ ${s}
77
77
  } catch {
78
78
  return a;
79
79
  }
80
- }, z = (a) => {
80
+ }, U = (a) => {
81
81
  const s = (a || "Green").toLowerCase();
82
82
  return s === "red" ? /* @__PURE__ */ e("span", { className: "badge-flag flag-red", children: "Red Flag" }) : s === "yellow" ? /* @__PURE__ */ e("span", { className: "badge-flag flag-yellow", children: "Yellow Flag" }) : /* @__PURE__ */ e("span", { className: "badge-flag flag-green", children: "Green Flag" });
83
83
  };
@@ -85,20 +85,20 @@ ${s}
85
85
  /* @__PURE__ */ l("div", { className: "page-header", children: [
86
86
  /* @__PURE__ */ l("h1", { className: "page-title", children: [
87
87
  "Check-in Change Logs",
88
- r && /* @__PURE__ */ e("span", { className: "internal-badge", children: o === "es" ? "Elementary School (ES)" : "Middle School (MS)" })
88
+ o && /* @__PURE__ */ e("span", { className: "internal-badge", children: d === "es" ? "Elementary School (ES)" : "Middle School (MS)" })
89
89
  ] }),
90
90
  /* @__PURE__ */ e("p", { className: "page-subtitle", children: "Audit trail of completed student check-ins whose scores or flags were manually modified." })
91
91
  ] }),
92
- /* @__PURE__ */ e("div", { className: "filter-card", children: /* @__PURE__ */ l("form", { onSubmit: j, className: "row g-3", children: [
93
- r && /* @__PURE__ */ l("div", { className: "col-md-2", children: [
92
+ /* @__PURE__ */ e("div", { className: "filter-card", children: /* @__PURE__ */ l("form", { onSubmit: Y, className: "row g-3", children: [
93
+ o && /* @__PURE__ */ l("div", { className: "col-md-2", children: [
94
94
  /* @__PURE__ */ e("label", { className: "form-label", htmlFor: "filter-school-level", children: "School Level" }),
95
95
  /* @__PURE__ */ l(
96
96
  "select",
97
97
  {
98
98
  id: "filter-school-level",
99
99
  className: "form-select form-select-sm",
100
- value: o,
101
- onChange: (a) => H(a.target.value),
100
+ value: d,
101
+ onChange: (a) => O(a.target.value),
102
102
  children: [
103
103
  /* @__PURE__ */ e("option", { value: "ms", children: "Middle School (MS)" }),
104
104
  /* @__PURE__ */ e("option", { value: "es", children: "Elementary School (ES)" })
@@ -106,7 +106,7 @@ ${s}
106
106
  }
107
107
  )
108
108
  ] }),
109
- /* @__PURE__ */ l("div", { className: r ? "col-md-3" : "col-md-4", children: [
109
+ /* @__PURE__ */ l("div", { className: o ? "col-md-3" : "col-md-4", children: [
110
110
  /* @__PURE__ */ e("label", { className: "form-label", htmlFor: "filter-student", children: "Search Student" }),
111
111
  /* @__PURE__ */ e(
112
112
  "input",
@@ -116,7 +116,7 @@ ${s}
116
116
  className: "form-control form-control-sm",
117
117
  placeholder: "e.g. Student Name",
118
118
  value: f,
119
- onChange: (a) => D(a.target.value)
119
+ onChange: (a) => E(a.target.value)
120
120
  }
121
121
  )
122
122
  ] }),
@@ -128,7 +128,7 @@ ${s}
128
128
  id: "filter-flag",
129
129
  className: "form-select form-select-sm",
130
130
  value: p,
131
- onChange: (a) => I(a.target.value),
131
+ onChange: (a) => T(a.target.value),
132
132
  children: [
133
133
  /* @__PURE__ */ e("option", { value: "", children: "All Flags" }),
134
134
  /* @__PURE__ */ e("option", { value: "Red", children: "Red Flag" }),
@@ -147,7 +147,7 @@ ${s}
147
147
  type: "date",
148
148
  className: "form-control form-control-sm",
149
149
  value: N,
150
- onChange: (a) => E(a.target.value)
150
+ onChange: (a) => A(a.target.value)
151
151
  }
152
152
  )
153
153
  ] }),
@@ -160,18 +160,18 @@ ${s}
160
160
  type: "date",
161
161
  className: "form-control form-control-sm",
162
162
  value: v,
163
- onChange: (a) => T(a.target.value)
163
+ onChange: (a) => $(a.target.value)
164
164
  }
165
165
  )
166
166
  ] }),
167
167
  /* @__PURE__ */ e("div", { className: "col-md-1 d-flex align-items-end", children: /* @__PURE__ */ l("div", { className: "btn-filter-group w-100", children: [
168
- /* @__PURE__ */ e("button", { type: "submit", className: "btn btn-primary btn-sm flex-fill", disabled: F, children: "Filter" }),
169
- /* @__PURE__ */ e("button", { type: "button", className: "btn btn-outline-secondary btn-sm", onClick: O, title: "Reset Filters", children: "↺" })
168
+ /* @__PURE__ */ e("button", { type: "submit", className: "btn btn-primary btn-sm flex-fill", disabled: w, children: "Filter" }),
169
+ /* @__PURE__ */ e("button", { type: "button", className: "btn btn-outline-secondary btn-sm", onClick: B, title: "Reset Filters", children: "↺" })
170
170
  ] }) })
171
171
  ] }) }),
172
- $ && /* @__PURE__ */ e("div", { className: "alert alert-danger", role: "alert", children: $ }),
172
+ M && /* @__PURE__ */ e("div", { className: "alert alert-danger", role: "alert", children: M }),
173
173
  /* @__PURE__ */ l("div", { className: "table-card", children: [
174
- F ? /* @__PURE__ */ l("div", { className: "loading-container", children: [
174
+ w ? /* @__PURE__ */ l("div", { className: "loading-container", children: [
175
175
  /* @__PURE__ */ e("div", { className: "spinner-border", role: "status", children: /* @__PURE__ */ e("span", { className: "visually-hidden", children: "Loading..." }) }),
176
176
  /* @__PURE__ */ e("p", { className: "mt-2 text-muted", children: "Loading audit change logs..." })
177
177
  ] }) : n.items.length === 0 ? /* @__PURE__ */ l("div", { className: "empty-state", children: [
@@ -182,7 +182,7 @@ ${s}
182
182
  /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ l("tr", { children: [
183
183
  /* @__PURE__ */ e("th", { children: "Session ID" }),
184
184
  /* @__PURE__ */ e("th", { children: "Student Name" }),
185
- /* @__PURE__ */ e("th", { children: "Grade" }),
185
+ /* @__PURE__ */ e("th", { children: k === "UK" ? "Year" : "Grade" }),
186
186
  /* @__PURE__ */ e("th", { children: "Teacher" }),
187
187
  /* @__PURE__ */ e("th", { children: "Session Date" }),
188
188
  /* @__PURE__ */ e("th", { children: "Current Flag" }),
@@ -196,10 +196,10 @@ ${s}
196
196
  a.sessionId
197
197
  ] }),
198
198
  /* @__PURE__ */ e("td", { className: "student-cell", children: a.studentName || "Unknown Student" }),
199
- /* @__PURE__ */ e("td", { children: a.gradeLevel || "-" }),
199
+ /* @__PURE__ */ e("td", { children: a.gradeLevel ? u(a.gradeLevel) : "-" }),
200
200
  /* @__PURE__ */ e("td", { className: "teacher-cell", children: a.teacherName || "-" }),
201
201
  /* @__PURE__ */ e("td", { children: C(a.sessionDate) }),
202
- /* @__PURE__ */ e("td", { children: z(a.flagType) }),
202
+ /* @__PURE__ */ e("td", { children: U(a.flagType) }),
203
203
  /* @__PURE__ */ e("td", { children: /* @__PURE__ */ l("span", { className: "badge-edits", children: [
204
204
  a.logCount,
205
205
  " edit",
@@ -217,7 +217,7 @@ ${s}
217
217
  ) })
218
218
  ] }, a.sessionId)) })
219
219
  ] }) }),
220
- !F && n.totalItems > 0 && /* @__PURE__ */ l("div", { className: "pagination-container", children: [
220
+ !w && n.totalItems > 0 && /* @__PURE__ */ l("div", { className: "pagination-container", children: [
221
221
  /* @__PURE__ */ l("div", { className: "pagination-info", children: [
222
222
  "Showing ",
223
223
  (n.currentPage - 1) * n.pageSize + 1,
@@ -236,7 +236,7 @@ ${s}
236
236
  value: h,
237
237
  onChange: (a) => {
238
238
  const s = parseInt(a.target.value, 10);
239
- U(s), u(1), S(1, s, o);
239
+ j(s), g(1), S(1, s, d);
240
240
  },
241
241
  children: [
242
242
  /* @__PURE__ */ e("option", { value: 10, children: "10 / page" }),
@@ -250,8 +250,8 @@ ${s}
250
250
  {
251
251
  type: "button",
252
252
  className: "btn btn-outline-secondary btn-sm",
253
- disabled: g <= 1,
254
- onClick: () => u((a) => Math.max(a - 1, 1)),
253
+ disabled: m <= 1,
254
+ onClick: () => g((a) => Math.max(a - 1, 1)),
255
255
  children: "Previous"
256
256
  }
257
257
  ),
@@ -265,8 +265,8 @@ ${s}
265
265
  {
266
266
  type: "button",
267
267
  className: "btn btn-outline-secondary btn-sm",
268
- disabled: g >= n.totalPages,
269
- onClick: () => u((a) => Math.min(a + 1, n.totalPages)),
268
+ disabled: m >= n.totalPages,
269
+ onClick: () => g((a) => Math.min(a + 1, n.totalPages)),
270
270
  children: "Next"
271
271
  }
272
272
  )
@@ -302,7 +302,7 @@ ${s}
302
302
  /* @__PURE__ */ l("div", { className: "info-value", children: [
303
303
  t.studentName || "Unknown",
304
304
  " (",
305
- t.gradeLevel || "N/A",
305
+ t.gradeLevel ? u(t.gradeLevel) : "N/A",
306
306
  ")"
307
307
  ] })
308
308
  ] }),
@@ -316,7 +316,7 @@ ${s}
316
316
  ] }),
317
317
  /* @__PURE__ */ l("div", { className: "info-item", children: [
318
318
  /* @__PURE__ */ e("div", { className: "info-label", children: "Current Flag" }),
319
- /* @__PURE__ */ e("div", { className: "info-value", children: z(t.flagType) })
319
+ /* @__PURE__ */ e("div", { className: "info-value", children: U(t.flagType) })
320
320
  ] })
321
321
  ] }),
322
322
  /* @__PURE__ */ l("div", { className: "audit-header", children: [
@@ -329,9 +329,9 @@ ${s}
329
329
  "button",
330
330
  {
331
331
  type: "button",
332
- className: `btn btn-sm ${M ? "btn-success" : "btn-outline-primary"} btn-copy`,
333
- onClick: Y,
334
- children: M ? "✓ Copied to Clipboard!" : "📋 Copy All Logs"
332
+ className: `btn btn-sm ${G ? "btn-success" : "btn-outline-primary"} btn-copy`,
333
+ onClick: K,
334
+ children: G ? "✓ Copied to Clipboard!" : "📋 Copy All Logs"
335
335
  }
336
336
  )
337
337
  ] }),
@@ -357,5 +357,5 @@ ${s}
357
357
  ] });
358
358
  };
359
359
  export {
360
- ae as default
360
+ ne as default
361
361
  };
@@ -1,5 +1,5 @@
1
1
  import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
- import { a as b } from "./TeacherConversations-BOppnNbK.js";
2
+ import { a as b } from "./TeacherConversations-CcicZLxW.js";
3
3
  import { u as k } from "./useEducatorConversationTarget-CnXgmMdd.js";
4
4
  import { A as C } from "./ArrowBackIcon-BE0U8s5I.js";
5
5
  import { useNavigate as S } from "react-router-dom";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("./TeacherConversations-Dyuu6YpQ.cjs"),q=require("./useEducatorConversationTarget-1gc_aK9B.cjs"),f=require("./ArrowBackIcon-TdJHJ-Ht.cjs"),j=require("react-router-dom"),t=require("./plp.module-BMy_AJUh.cjs"),C=require("@mui/material"),S=()=>{const r=j.useNavigate(),{teachers:a,teacherDefault:o,getTeachersData:s,setSelectTeacherUserId:n,setSelected:c,educatorsData:i,loading:l,pagination:u,changeFilters:d,educatorTarget:g,filter:h,handleFilterMonth:v,filterStartDate:T,filterEndDate:D,handleFilterStatus:b}=q.useEducatorConversationTarget(),m=()=>{r(-1)};return e.jsxs(C.Grid,{className:t.styles["conversation-target-page"],children:[e.jsxs("button",{type:"button",onClick:m,className:t.styles["conversation-target-page-back"],children:[e.jsx(f.ArrowBackIcon,{color:"#242424"}),"Dashboard"]}),e.jsx(p.TeacherConversations,{educators:i,teachers:a,teacherDefault:o,getTeachersData:s,setSelectTeacherUserId:n,setSelected:c,loading:l,pagination:u,changeFilters:d,educatorTarget:g,filter:h,handleFilterMonth:v,filterStartDate:T,filterEndDate:D,handleFilterStatus:b})]})};exports.default=S;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("./TeacherConversations-ViMew8lQ.cjs"),q=require("./useEducatorConversationTarget-1gc_aK9B.cjs"),f=require("./ArrowBackIcon-TdJHJ-Ht.cjs"),j=require("react-router-dom"),t=require("./plp.module-BMy_AJUh.cjs"),C=require("@mui/material"),S=()=>{const r=j.useNavigate(),{teachers:a,teacherDefault:o,getTeachersData:s,setSelectTeacherUserId:n,setSelected:c,educatorsData:i,loading:l,pagination:u,changeFilters:d,educatorTarget:g,filter:h,handleFilterMonth:v,filterStartDate:T,filterEndDate:D,handleFilterStatus:b}=q.useEducatorConversationTarget(),m=()=>{r(-1)};return e.jsxs(C.Grid,{className:t.styles["conversation-target-page"],children:[e.jsxs("button",{type:"button",onClick:m,className:t.styles["conversation-target-page-back"],children:[e.jsx(f.ArrowBackIcon,{color:"#242424"}),"Dashboard"]}),e.jsx(p.TeacherConversations,{educators:i,teachers:a,teacherDefault:o,getTeachersData:s,setSelectTeacherUserId:n,setSelected:c,loading:l,pagination:u,changeFilters:d,educatorTarget:g,filter:h,handleFilterMonth:v,filterStartDate:T,filterEndDate:D,handleFilterStatus:b})]})};exports.default=S;