mario-teacher-student-client 2.2.97-staging → 2.2.98-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.
@@ -0,0 +1,235 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),Q=require("react-redux"),u=require("react"),i=require("@mui/material"),te=require("react-router-dom"),A=require("moment"),a=require("./LearningPlanChip-fJNgsJiX.cjs"),oe=require("./styles.module-qEnh_9p1.cjs"),as=require("date-fns"),p=require("mario-core"),ae=require("./ArrowIcon-F5L7sPU_.cjs"),Es=require("./PlusIcon-BupcXmKx.cjs"),fe=require("./StudentSelector-BmJvwSw5.cjs"),Ie=require("./Error-B1W3Ilwy.cjs"),Ms=require("./CheckCircle-B93hTHH7.cjs"),Bs=require("./useChartOneToOne-BV5FDATD.cjs"),Fs=require("./utils-Bkd9m9N7.cjs"),de=require("./SimpleDialog-Cv1oQ1wV.cjs"),H=require("./constants-BJ-bWPpG.cjs"),ls=require("./CalendarIcon-DcA4xF5x.cjs"),he=require("./myOneToOne.module-Bn2RaIiP.cjs"),Ae=require("./OneToOne-sN0TScKJ.cjs"),Gs=require("./StudentSupporterSelector-CRi0jvWC.cjs"),Be=require("./useStudentList-CtKHls5N.cjs"),Os=require("@fullcalendar/react"),Ys=require("@fullcalendar/timegrid"),Ws=require("@emotion/styled"),z=require("./constants-BvFRR4A_.cjs"),pe=require("./styled-lvsUm6Nd.cjs"),Pe=require("lodash"),Hs=require("./ArrowBack-7VCmUcq8.cjs"),rs=require("./ArrowForward-YavAssQw.cjs"),Ps=require("./constantsFn-DmYKNJBH.cjs"),Vs=require("./useAudioRecorder-O_UqjAHp.cjs"),x=require("./DialogThankYouJourney-C9ts0Wyj.cjs"),Js=require("./Check-C4zFEKCV.cjs"),Us=require("./useWeeklyQuest-BU9f4el4.cjs"),Ks=require("./Goals-azezgE07.cjs"),zs=require("./useFontStyles-BgcHhaVa.cjs"),Qs=require("./MyStudent-BJiclWTy.cjs"),Xs=require("@mui/icons-material"),Zs=require("./ExpandLess-B8i04FJT.cjs"),et=require("./ExpandMore-XvtD_TlH.cjs"),st=require("./constants-CANl_Dur.cjs"),tt=require("./useMobilePicker-xis8soWs.cjs"),nt=require("./AdapterMoment-B-q0UCj0.cjs"),Ve=require("./DatePicker-DOVAbhAu.cjs"),ot={position:"absolute",top:"100px",left:"50%",zIndex:1e3,transform:"translate(-50%, 0)"},is=()=>e.jsxs("div",{style:ot,className:"d-flex align-items-center justify-content-center",children:[e.jsx("div",{className:"spinner-grow",role:"status",children:e.jsx("span",{className:"sr-only",children:"Loading..."})}),e.jsx("div",{className:"spinner-grow mx-2",role:"status",children:e.jsx("span",{className:"sr-only",children:"Loading..."})}),e.jsx("div",{className:"spinner-grow",role:"status",children:e.jsx("span",{className:"sr-only",children:"Loading..."})})]}),at=`${p.BASE_URL}/api/GoogleCalendar/eventCalendarDashboard`,lt=`${p.BASE_URL}/api/GoogleCalendar/eventTotalCardDashboard`,rt=(n,s,t,l)=>p.api.get(`${at}`,{params:{userId:n,startDate:s,roles:t,type:l}}),it=(n,s,t)=>p.api.get(`${p.BASE_URL}/api/GoogleCalendar/eventCalendarToDay`,{params:{startDate:n,teacherUserId:s,roles:t}}),ct=n=>p.api.get(`${lt}`,{params:n}),dt=20,ht=12,ut=(n,s,t)=>{const l=Q.useSelector(v=>v.common?.user?.roles),c=Q.useDispatch(),[h,d]=u.useState(),[r,g]=u.useState(!1),_=Q.useSelector(v=>v?.common?.defaultFontSize),m=u.useMemo(()=>_==dt?"font-large":_==ht?"font-small":"",[_]),f=u.useCallback(async()=>{g(!0),t&&t(v=>({...v,todaySchedule:!1}));try{const v=await it(n,s,l);d(v.data)}catch(v){c(p.setAlert({type:"danger",message:v.response?.data?.title||v.message}))}t&&t(v=>({...v,todaySchedule:!0})),g(!1)},[l]);return u.useEffect(()=>{f()},[l]),{isLoading:r,response:h,classFontSize:m}},_t=({fill:n="#316CD9",...s})=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",...s,children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.31504 4.5827L3.31485 4.2338L3.36224 4.27858C3.38704 4.30189 3.40661 4.32029 3.42548 4.33921C3.9084 4.82366 4.39174 5.30811 4.87508 5.79255L4.87508 5.79255C4.90555 5.82309 4.9358 5.85384 4.96606 5.88459L4.96606 5.8846L4.96607 5.8846C5.04818 5.96806 5.13029 6.05152 5.21666 6.1307C5.40512 6.30314 5.64995 6.30525 5.84261 6.13871C5.90254 6.08689 5.95834 6.02991 6.01406 5.97302L6.06051 5.92579C6.31712 5.66775 6.3167 5.40677 6.05925 5.14873C5.47369 4.56183 4.88855 3.97535 4.30298 3.38802C4.28498 3.36997 4.26765 3.35124 4.24685 3.32873L4.24684 3.32872L4.24682 3.32869L4.24671 3.32858C4.23499 3.3159 4.22217 3.30203 4.20749 3.28641C4.22715 3.28549 4.24184 3.28457 4.25372 3.28383L4.25372 3.28383L4.25373 3.28382C4.26904 3.28286 4.2797 3.2822 4.29036 3.2822C4.39241 3.2822 4.49445 3.28263 4.5965 3.28307C4.81079 3.28399 5.02508 3.28492 5.23938 3.28177C5.50776 3.27798 5.69327 3.09668 5.71052 2.8281C5.71767 2.71933 5.71557 2.60928 5.71304 2.49966C5.70547 2.18597 5.52669 2.00298 5.21456 2.00214C4.32444 1.99919 3.43432 1.99877 2.54377 2.00425C2.44702 2.00509 2.34017 2.03292 2.25646 2.08098C2.0802 2.18175 2.02804 2.35462 2.02846 2.55152C2.02986 3.14124 2.02977 3.73114 2.02968 4.32098V4.32099V4.32099C2.02963 4.6159 2.02958 4.9108 2.02972 5.20565C2.02972 5.25203 2.03267 5.29967 2.03982 5.34563C2.076 5.5809 2.25141 5.73817 2.48783 5.74575C2.57364 5.74861 2.65975 5.74814 2.74565 5.74768L2.79239 5.74744C3.1306 5.74618 3.31401 5.56403 3.31485 5.22673C3.3154 5.01497 3.31523 4.8032 3.31504 4.5827ZM11.7691 3.28644L11.5534 3.28649H11.5533H11.5533H11.5533C11.3376 3.28657 11.1221 3.28665 10.9064 3.28601L10.8863 3.28603C10.8227 3.2861 10.7588 3.28618 10.6956 3.27969C10.4836 3.25819 10.3107 3.08363 10.2964 2.87029C10.2876 2.7417 10.2888 2.61183 10.2918 2.48282C10.2985 2.19232 10.4807 2.00765 10.7713 2.00343C11.0252 1.99981 11.2791 2.0005 11.533 2.00119C11.6346 2.00147 11.7362 2.00174 11.8377 2.00174L12.2931 2.0016C12.6724 2.00143 13.0517 2.00126 13.4312 2.00216C13.7833 2.00301 13.9734 2.19443 13.9734 2.54775C13.9738 3.43653 13.9743 4.32532 13.9734 5.21411C13.973 5.56532 13.79 5.74704 13.4379 5.74831L13.4013 5.7485C13.3276 5.74892 13.2537 5.74933 13.18 5.74789C12.8793 5.74283 12.6904 5.55562 12.6883 5.25501C12.6868 5.05183 12.6872 4.84846 12.6876 4.64516V4.64511V4.64506V4.64502C12.6877 4.55473 12.6879 4.46446 12.6879 4.37423V4.23847C12.6712 4.254 12.6566 4.26742 12.6435 4.27952C12.6181 4.30289 12.598 4.32133 12.5789 4.3405C12.2917 4.62815 12.0046 4.91601 11.7175 5.20387C11.4302 5.49195 11.1429 5.78003 10.8555 6.0679C10.5938 6.32973 10.3347 6.32931 10.0722 6.06706C10.0251 6.02026 9.97796 5.97303 9.93127 5.92581C9.68981 5.68169 9.68897 5.40679 9.93127 5.16351C10.516 4.57577 11.102 3.98929 11.688 3.4028C11.7074 3.38331 11.7283 3.36507 11.7492 3.3468C11.7604 3.33701 11.7716 3.32721 11.7826 3.31721C11.7784 3.30667 11.7738 3.29655 11.7691 3.28644ZM14.0001 13.6145C13.9042 13.9004 13.7027 14.0032 13.4074 13.9999C12.7973 13.9928 12.1873 13.9936 11.5774 13.9944H11.5772H11.5772H11.5771H11.5771C11.3203 13.9947 11.0636 13.9951 10.8068 13.9948C10.4329 13.9944 10.2583 13.8177 10.2566 13.44L10.2563 13.3977V13.3976C10.2559 13.3413 10.2555 13.285 10.2562 13.2287C10.26 12.9062 10.4522 12.7114 10.7761 12.7084C10.9702 12.7064 11.1643 12.7072 11.3583 12.708C11.4415 12.7084 11.5246 12.7087 11.6078 12.7089H11.7676L11.7229 12.6613C11.7009 12.6378 11.6837 12.6196 11.6662 12.6018L11.0944 12.0282C10.7136 11.6464 10.3327 11.2645 9.95205 10.8824C9.68114 10.6104 9.68072 10.3596 9.94953 10.0901L9.98668 10.0528L9.98701 10.0525C10.0242 10.0152 10.0614 9.9778 10.0989 9.94088C10.334 9.70983 10.6079 9.70941 10.8413 9.94299C11.4273 10.5291 12.0125 11.1164 12.5972 11.7037C12.6158 11.7224 12.6328 11.7426 12.6548 11.7688L12.6549 11.7688L12.6549 11.7689L12.6549 11.7689C12.6687 11.7853 12.6844 11.8039 12.7036 11.826C12.7055 11.8041 12.7072 11.786 12.7087 11.7704C12.7117 11.7401 12.7137 11.7193 12.7137 11.6986C12.7139 11.567 12.7136 11.4354 12.7134 11.3037V11.3031C12.7131 11.1453 12.7128 10.9875 12.7133 10.8297C12.7141 10.5004 12.9097 10.3047 13.2383 10.3031C13.2571 10.3029 13.2759 10.3033 13.2948 10.3037C13.3307 10.3045 13.3667 10.3053 13.4023 10.3022C13.6951 10.2786 13.9004 10.3933 14.0001 10.6779V13.6145ZM4.26461 12.7148L4.52892 12.715C4.76403 12.7153 4.99925 12.7155 5.23424 12.714C5.37264 12.7131 5.49673 12.7464 5.59853 12.8447C5.81013 13.0487 5.80844 13.6681 5.59559 13.8701C5.5001 13.9607 5.38399 13.9987 5.25359 13.9982C5.13414 13.998 5.0147 13.9981 4.89525 13.9981H4.89434L4.71472 13.9982L3.99617 13.9983C3.51703 13.9984 3.03784 13.9985 2.55883 13.9982C2.18275 13.9978 2.00019 13.8136 2.00019 13.4354L2.00009 12.574C2 11.9997 1.99991 11.4255 2.00019 10.8512C2.00019 10.4916 2.18275 10.3073 2.53906 10.3056L2.57421 10.3054C2.64452 10.305 2.71483 10.3046 2.78514 10.3061C3.09181 10.3128 3.28195 10.5013 3.28531 10.8078C3.2876 11.0053 3.28697 11.2027 3.28633 11.4003C3.28603 11.4926 3.28573 11.5849 3.28573 11.6772V11.8155C3.30438 11.7983 3.3206 11.7838 3.33515 11.7708L3.33516 11.7708C3.35737 11.751 3.37572 11.7346 3.393 11.7172L5.12445 9.98142C5.39619 9.70905 5.657 9.70778 5.92665 9.97889C5.94329 9.99556 5.9601 10.0121 5.97691 10.0286C6.02428 10.0752 6.07164 10.1218 6.11511 10.1716C6.28674 10.3676 6.28379 10.6261 6.1109 10.8213C6.08956 10.8451 6.06681 10.8678 6.04427 10.8902L6.04425 10.8903L6.02929 10.9052C5.46602 11.4702 4.90276 12.0352 4.33823 12.5989C4.31797 12.6192 4.2917 12.6333 4.26548 12.6474L4.26547 12.6474C4.25304 12.654 4.24062 12.6607 4.22886 12.668C4.24063 12.6832 4.25283 12.6992 4.26461 12.7148ZM6.71007 7.96144C6.69283 8.70266 7.24642 9.28577 7.98258 9.30263C8.67793 9.31865 9.27275 8.74904 9.28873 8.05209C9.30556 7.32226 8.75113 6.7383 8.02044 6.71512C7.33013 6.69319 6.72606 7.26787 6.71007 7.96144Z",fill:"#316CD9"})}),mt=292,gt=({studentUserId:n,date:s,teacherUserId:t,onViewCalendar:l,isStudent:c,setLoadingComplete:h})=>{const{t:d}=p.useTranslation(),r=te.useNavigate(),g=A(s).format("YYYY-MM-DD"),{response:_,isLoading:m,classFontSize:f}=ut(g,t,h),v=u.useRef(null),[y,j]=u.useState([]),S=b=>`${a.home[`today-schedule__list-item--${`${b.summary.startsWith("1-1 Conversation")?"conversation":b.summary.startsWith("Conference")?"conference":"check-in"}`}`]}`,T=b=>{const{studentId:N,sessionId:E,conferenceId:O,teacherResultId:W,studentResultId:q}=b;if(W||q){r(`/start-question/${E}/${c?q:W}`);return}if(O){r(`/start-conference/${N}/${O}/conferenceRubric`);return}};return u.useEffect(()=>{if(_){const b=_.sort((N,E)=>as.compareAsc(new Date(N.startDate),new Date(E.startDate))).map(N=>({text:p.utcToLocalTime(N.startDate,"h:mm a"),summary:`${N.summary}`,time:parseInt(p.utcToLocalTime(N.startDate,"H")),location:N.location,sessionId:N.sessionId,conferenceId:N.conferenceId,teacherResultId:N.sessionResult?.find(E=>!!E.isTeacherResult)?.id,studentResultId:N.sessionResult?.find(E=>!E.isTeacherResult)?.id,studentId:N.conferenceAnswers?.studentId||N.sessionResult?.[0]?.studentId}));j(b)}},[_,n]),e.jsxs("div",{className:`${a.home["today-schedule"]} ${a.home[f]} h-100 d-flex flex-column`,children:[e.jsx(i.Typography,{className:`${a.home["today-schedule__title"]} text-capitalize`,children:d("today_schedule")}),e.jsx("div",{className:`${a.home["today-schedule__view"]}`,children:e.jsx(i.Button,{variant:"text",color:"primary",endIcon:e.jsx(_t,{}),className:`${a.home["today-schedule__view__btn"]}`,onClick:l,children:e.jsx(i.Typography,{className:`${a.home["today-schedule__view__text"]}`,children:d("view_calendar")})})}),e.jsxs(i.List,{ref:v,className:`position-relative ${a.home["today-schedule__list"]} flex-grow-1 ${v.current?.scrollHeight&&v.current?.scrollHeight>mt?`${a.home["today-schedule__list--scroll"]} ${oe.styles["custom-scrollbar"]}`:""} ${m?a.home["today-schedule__list--loading"]:""}`,children:[y.length>0?y.map((b,N)=>e.jsxs(i.ListItem,{className:`${a.home["today-schedule__list-item"]} ${S(b)}`,onClick:()=>T(b),children:[e.jsx(i.Typography,{className:`${a.home["today-schedule__list-item__time"]}`,children:b.text}),e.jsx(i.Typography,{className:`${a.home["today-schedule__list-item__content"]}`,children:b.summary})]},N)):e.jsxs(i.ListItem,{className:`${a.home["today-schedule__list-item--empty"]}`,children:[d("no_events_today"),"!"]}),m&&e.jsx(is,{})]})]})},Je=({fill:n="#242424",...s})=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"8",height:"9",viewBox:"0 0 8 9",fill:"none",...s,children:e.jsx("path",{d:"M4.35355 0.646446C4.15829 0.451184 3.84171 0.451184 3.64645 0.646446L0.464466 3.82843C0.269204 4.02369 0.269204 4.34027 0.464466 4.53553C0.659728 4.7308 0.976311 4.7308 1.17157 4.53553L4 1.70711L6.82843 4.53553C7.02369 4.7308 7.34027 4.7308 7.53553 4.53553C7.7308 4.34027 7.7308 4.02369 7.53553 3.82843L4.35355 0.646446ZM4.5 9L4.5 1L3.5 1L3.5 9L4.5 9Z",fill:n})}),cs=({percent:n,percentText:s,number:t,numberText:l,numberUnit:c=t&&t>1?"students":"student",isBelowNumber:h,defaultText:d,onSeeMore:r,className:g=""})=>{const{t:_}=p.useTranslation();return e.jsxs(i.Grid,{container:!0,className:`${a.home["student-wellness__note"]} ${t?a.home["student-wellness__note--danger"]:""} ${g}`,children:[e.jsx("span",{className:`${a.home["student-wellness__note__icon"]}`,children:t?e.jsx(Ie.ErrorIcon,{className:`${a.home["student-wellness__note__icon--danger"]}`}):e.jsx(Ms.CheckCircleIcon,{className:`${a.home["student-wellness__note__icon--success"]}`})}),e.jsxs("div",{children:[!t&&e.jsxs(i.Typography,{children:[d,"."]}),!!n&&e.jsx(i.Typography,{className:`${a.home["student-wellness__item__info"]}`,children:e.jsxs("span",{children:[e.jsx("span",{className:` ${a.home["student-wellness__item__info__percent--bold"]}`,style:{marginRight:3},children:`${n?.toFixed(2)}%`}),!!t&&`(${t} ${_(c)}) `,s]})}),!h&&!!t&&t>0&&e.jsxs(i.Typography,{className:`${a.home["student-wellness__item__info__students"]} mb-0`,onClick:r,children:["(",_("see_them"),")"]}),!!t&&h&&e.jsx(i.Typography,{className:`${a.home["student-wellness__item__info"]} d-block`,children:e.jsxs("span",{children:[e.jsx("span",{className:`text-nowrap ${a.home["student-wellness__item__info__percent--bold"]} text-lowercase`,style:{marginRight:3},children:`${t} ${_(c)}`}),l]})}),h&&!!t&&t>0&&e.jsxs(i.Typography,{className:`${a.home["student-wellness__item__info__students"]} mb-0`,onClick:r,children:["(",_("see_them"),")"]})]})]})},Ee=({name:n,image:s,percent:t,diffPercent:l,percentOfStudent:c,numberOfStudent:h,percentOfStudentText:d,numberOfStudentText:r,onSeeMore:g,showMore:_=!0,isStudent:m,defaultText:f})=>{const{t:v}=p.useTranslation(),y=()=>{g?.()};return e.jsxs("div",{className:`${a.home["student-wellness__item"]} h-100 d-flex flex-column`,children:[_&&e.jsxs(i.Grid,{container:!0,className:`${a.home["student-wellness__main-block"]} justify-content-between align-items-center flex-nowrap`,children:[e.jsxs("div",{className:"w-100",children:[e.jsxs("div",{className:"d-flex justify-content-between align-items-center w-100",children:[e.jsx(i.Typography,{className:`${a.home["student-wellness__item__name"]}`,children:n}),e.jsx("div",{className:`${a.home["student-wellness__item__image"]} d-block d-lg-none`,children:e.jsx("img",{src:s,alt:n})})]}),e.jsxs("div",{className:`${a.home["student-wellness__item__info"]} ${a.home[`student-wellness__item__info--${l>=0?"increase":"decrease"}`]} flex-wrap`,children:[e.jsx("span",{className:`${a.home["student-wellness__item__info__percent"]} ${a.home["student-wellness__item__info__percent--bold"]} mb-0`,children:`${t.toFixed(2)}%`}),e.jsxs("span",{className:"d-flex mt-1 mt-lg-0",children:[e.jsxs("span",{className:"d-flex flex-nowrap",children:[e.jsx("span",{className:`${a.home["student-wellness__item__info__icon"]} ${n.includes("Stress")&&a.home.stress}`,children:e.jsx(Je,{style:{transform:`rotate(${l>=0?"0deg":"180deg"})`}})}),e.jsx("span",{className:`${a.home["student-wellness__item__info__percent-diff"]} ${a.home["student-wellness__item__info__percent--bold"]} ${n.includes("Stress")&&a.home.stress}`,children:`${Math.abs(l).toFixed(2)}%`})]}),e.jsx("span",{className:"text-nowrap",children:v("vs_last_month")})]})]})]}),e.jsx("div",{className:`${a.home["student-wellness__item__image"]} d-none d-lg-block`,children:e.jsx("img",{src:s,alt:n})})]}),!_&&e.jsxs(i.Grid,{container:!0,className:`${a.home["student-wellness__main-block"]}`,children:[e.jsxs("div",{className:"d-flex justify-content-between align-items-center w-100",children:[e.jsx(i.Typography,{className:`${a.home["student-wellness__item__name"]}`,children:n}),e.jsx("div",{className:`${a.home["student-wellness__item__image"]}`,children:e.jsx("img",{src:s,alt:n})})]}),e.jsxs("div",{className:`${a.home["student-wellness__item__info"]} ${a.home[`student-wellness__item__info--${l>=0?"increase":"decrease"}`]} d-block`,children:[e.jsx("p",{className:`${a.home["student-wellness__item__info__percent"]} ${a.home["student-wellness__item__info__percent--bold"]} mb-0`,children:`${t.toFixed(2)}%`}),e.jsxs("p",{className:"mb-0 mt-2",children:[e.jsx("span",{className:`${a.home["student-wellness__item__info__icon"]} ml-0`,children:e.jsx(Je,{style:{transform:`rotate(${l>=0?"0deg":"180deg"})`}})}),e.jsx("span",{className:`${a.home["student-wellness__item__info__percent-diff"]} ${a.home["student-wellness__item__info__percent--bold"]}`,children:`${Math.abs(l).toFixed(2)}% `}),e.jsx("span",{className:"text-nowrap",children:v("vs_last_month")})]})]})]}),_&&!m&&t!=0&&e.jsx(cs,{className:"flex-grow-1",percent:c,percentText:d,number:h,numberText:r,onSeeMore:y,defaultText:f,seeMoreable:!0})]})},pt="/images/image-default.png",xt=({endTime:n,startTime:s,onView:t,sessionId:l,sessionResultId:c,name:h,avatar:d,percent:r,tagTitle:g,isSession:_=!0})=>{const{t:m}=p.useTranslation(),f=()=>{t(l,c,!0)},v=u.useMemo(()=>n&&n!==H.DATE_MIN_VALUE?A().diff(A.utc(n).local(),"hours"):void 0,[n]);return e.jsx("div",{children:e.jsxs("div",{className:`${a.home["check-in-item"]}`,children:[e.jsxs("div",{className:"d-flex justify-content-between flex-grow-1 align-items-center",children:[e.jsxs("div",{className:"d-flex w-100 gap-2",children:[e.jsx(i.Avatar,{alt:h?.toUpperCase(),src:p.getFileUrl(d)||pt}),e.jsxs("div",{className:"ml-2 ml-sm-3 d-flex flex-column justify-content-center",children:[e.jsxs("div",{className:"d-flex align-items-baseline",children:[e.jsx(i.Typography,{className:`${a.home["check-in-item__name"]}`,children:h}),!!r&&e.jsx("span",{className:`${a.home["check-in-item__hashtag"]}`,children:g})]}),e.jsxs("div",{className:"d-flex flex-row flex-wrap gap-2",children:[e.jsx(i.Typography,{className:`${a.home["check-in-item__type"]} text-nowrap`,children:`${m(_?"check_in_flagged":"last_1_1")}:`}),e.jsxs("div",{className:`${a.home["check-in-item__info"]}`,children:[!!s&&s!==H.DATE_MIN_VALUE&&e.jsx(i.Typography,{className:`${a.home["check-in-item__info__time"]}`,children:p.utcToLocalTime(s,"do MMM yyyy - hh:mm a")}),v!==void 0&&!!n&&e.jsxs("div",{className:`${a.home["check-in-item__info__note"]}`,children:[e.jsx("span",{className:`${a.home["check-in-item__info__note__icon"]}`,children:e.jsx(Ie.ErrorIcon,{})}),e.jsx(i.Typography,{className:`${a.home["check-in-item__info__note__text"]}`,children:v===0?"ended in less than one hour":`ended over ${v>24?24:v} ${v>1?"hours":"hour"} ago`})]})]})]})]})]}),e.jsx("div",{children:!!r&&e.jsxs("div",{className:`${a.home["check-in-item__percent"]} ${r>0?a.home["check-in-item__percent--success"]:""}`,children:[e.jsx("span",{className:`${a.home["check-in-item__percent__text"]}`,children:`${Math.abs(r).toFixed(2)}%`}),e.jsx("img",{src:`images/chart-${r>0?"increase":"reduced"}.png`})]})})]}),e.jsx("div",{className:`${a.home["check-in-item__action"]}`,children:e.jsx(i.Button,{className:`${a.home["check-in-item__action__btn"]}`,variant:"text",color:"primary",onClick:f,children:m("view_results")})})]})})},ft=({className:n="",checkInList:s,onView:t,showEmptyText:l,emptyText:c})=>{const{t:h}=p.useTranslation();return e.jsxs(i.Grid,{container:!0,spacing:2,className:`${oe.styles["custom-scrollbar"]} ${s.length>5?a.home["check-in-list--scroll"]:""} ${n}`,children:[s.length>0&&s.map((d,r)=>e.jsx("div",{className:`${a.home["check-in-list__item"]} w-100`,children:e.jsx(xt,{onView:t,endTime:d.endTime||H.DATE_MIN_VALUE,startTime:d.startTime||H.DATE_MIN_VALUE,sessionId:d.sessionId,sessionResultId:d.sessionResultId,avatar:d.avatar||"",name:d.name||"",percent:d.percentDiff,tagTitle:d.tagTitle,isSession:d.isSessionCheckIn})},r)),!!l&&!s.length&&e.jsx("div",{className:`${a.home["check-in-list__item"]} ${a.home["check-in-list__item--empty"]}`,children:e.jsx(i.Typography,{children:c||h("no_last_or_requested_check_ins")})})]})},yt=n=>{const{open:s,onClose:t,checkIns:l,subject:c}=n;return e.jsx(de.SimpleDialog,{open:s,onClose:t,scroll:"body",maxWidth:"lg",children:e.jsx(jt,{checkIns:l,subject:c})})},jt=({checkIns:n,subject:s})=>{const{t}=p.useTranslation(),[l,c]=u.useState(0),h=te.useNavigate(),d=(_,m)=>{const f=`/start-question/${_}/${m}`;h(f)},r=()=>n.filter(_=>_.studentId==l||!l),g=u.useMemo(()=>r(),[n,l]);return e.jsxs("div",{className:`${a.home["this-week-checkIn-dialog"]}`,children:[e.jsxs("div",{className:`${a.home["this-week-checkIn-dialog__head"]}`,children:[e.jsxs(i.Box,{sx:{display:"flex",justifyContent:"space-between"},children:[e.jsx(i.Typography,{variant:"h5",className:`${a.home["this-week-checkIn-dialog__head__title"]}`,children:t(s==="stress"?"students_who_are_highly_stressed":"students_who_are_not_feeling_safe")}),e.jsxs("div",{className:`${a.home["this-week-checkIn-dialog__head__icon"]}`,children:[e.jsx("img",{src:p.getStaticFileUrl(`/images/home/${s}.png`),alt:t("check_in")})," "]})]}),e.jsx("div",{className:`${a.home["this-week-checkIn-dialog__head__selector"]}`,children:e.jsx(fe.StudentSelector,{setStudentId:c,studentId:l,isDialog:!0})})]}),e.jsx("div",{className:`${a.home["this-week-checkIn-dialog__body"]}`,children:e.jsx(ft,{className:`${a.home["check-in-list"]}`,onView:d,checkInList:g})})]})},vt=({studentId:n,isStudent:s,setLoadingComplete:t})=>{const{t:l}=p.useTranslation(),c=te.useNavigate(),h=Q.useSelector(I=>I.common.language),[d,r]=u.useState(),[g,_]=u.useState(!1),[m,f]=u.useState(""),{avgQuestionLastMonth:v,stressData:y,safetyData:j,preparednessData:S,studentSkillQuestion:T,getDataStudentSkillServices:b,getDataOneToOne:N}=Bs.useChartOneToOne(n,{startDate:A().startOf("month").valueOf(),endDate:A().endOf("month").valueOf(),optionDate:"Month"},void 0,void 0,!0),E=async()=>{t&&t(I=>({...I,dataCheckIns:!1})),await b(),await N(h),t&&t(I=>({...I,dataCheckIns:!0}))},O=()=>{c("/data-dashboard")},W=()=>{_(!1),r(void 0)},q=()=>_(!0),C=(I,J)=>{r(I),f(J),q()},M=(I,J)=>!I||!I?.data?.length?0:Fs.handleAveraged(I.data,J)??0,L=I=>{if(!I||!I?.data?.length)return 0;const Y=I.data.reduce((w,G)=>w+G,0)/I.data.length,K=v.find(w=>w.questionText.toLocaleLowerCase().includes(I.name.toLocaleLowerCase()));return K?K.avgQuestionResponse-K.avgQuestionResponseLastMonth:Y},F=u.useMemo(()=>M(j?.[0]),[j]),$=u.useMemo(()=>M(y?.[0]),[y]),k=u.useMemo(()=>L(j?.[0]),[j,v]),D=u.useMemo(()=>L(y?.[0]),[y,v]),V=()=>d?.map(I=>{const J=I.sessionResults?.find(K=>!!K.isTeacherResult),Y=I.sessionResults?.find(K=>!K.isTeacherResult);return{startTime:Y?.startTime||H.DATE_MIN_VALUE,endTime:Y?.endTime,sessionId:I.sessionId,sessionResultId:J?.id||0,name:I.studentName,avatar:I.studentAvatar,isSessionCheckIn:I.isSessionCheckIn,percentDiff:I.point-I.averageOtherRatings,tagTitle:l(m==="stress"?"high_stressed":"unsafe"),studentId:I.studentId}})?.sort((I,J)=>I.name.toLocaleLowerCase()>J.name.toLocaleLowerCase()?1:I.name.toLocaleLowerCase()<J.name.toLocaleLowerCase()?-1:0)||[],U=u.useMemo(()=>V(),[m,d]);return u.useEffect(()=>{E()},[]),e.jsxs("div",{className:`${a.home["student-wellness"]}`,children:[e.jsxs(i.Grid,{container:!0,className:`${a.home["student-wellness__head"]}`,children:[e.jsx(i.Typography,{className:`${a.home["student-wellness__title"]}`,children:l("student_wellness")}),e.jsx(i.Button,{variant:"text",color:"primary",endIcon:e.jsx(ae.ArrowIcon,{fill:"#316CD9"}),className:`${a.home["student-wellness__view-btn"]}`,onClick:O,children:l("view_data_dashboard")})]}),e.jsx(i.Grid,{container:!0,children:e.jsx(i.Typography,{variant:"h4",component:"h4",className:`${a.home["student-wellness__sub-title"]}`,children:"This Month's Average vs. Last Month"})}),e.jsxs(i.Grid,{container:!0,spacing:1,className:`${a.home["student-wellness__container"]} mb-4`,children:[e.jsx(i.Grid,{item:!0,xs:s?12:6,children:e.jsx(Ee,{name:l("average_safety"),image:`${p.getStaticFileUrl("/images/home/safety.png")}`,percent:F,diffPercent:k,numberOfStudent:T?.studentSafetyQuestionCount||0,percentOfStudent:T?.studentPercentageUnsafe||0,percentOfStudentText:l("are_not_feeling_safe"),onSeeMore:()=>C(T.responseStudentSafety,"safety"),isStudent:s,defaultText:l("all_of_the_students_marked_as_feeling_safe")})}),e.jsx(i.Grid,{item:!0,xs:s?12:6,children:e.jsx(Ee,{name:l("average_stress"),image:`${p.getStaticFileUrl("/images/home/stress.png")}`,percent:$,diffPercent:D,numberOfStudent:T?.studentStressQuestionCount||0,percentOfStudent:T?.studentPercentageStress||0,percentOfStudentText:l("are_feeling_highly_stressed"),onSeeMore:()=>C(T.responseStudentStress,"stress"),isStudent:s,defaultText:l("all_of_the_students_report_manageable_stress_levels")})}),!!S?.length&&S.map(I=>e.jsx(i.Grid,{item:!0,xs:s?12:4,children:e.jsx(Ee,{name:l(`average_${I?.name?.toLocaleLowerCase()}`),image:I?.name?`${p.getStaticFileUrl(`/images/home/${I?.name?.toLocaleLowerCase()}.png`)}`:"",percent:M(I),diffPercent:L(I),showMore:!1,isStudent:s})},I?.name))]}),!s&&g&&e.jsx(yt,{open:g,onClose:W,subject:m,checkIns:U})]})},wt=({item:n,onView:s,onRequestOneToOne:t})=>{const{t:l}=p.useTranslation(),{sessionResults:c,isToday:h,isLast:d,bookTime:r,isOneToOneConversation:g}=n,_=c.find(T=>!!T.isTeacherResult),m=c.find(T=>!T.isTeacherResult),f=te.useNavigate(),v=u.useMemo(()=>{const T=m?.endTime;return T&&T!==H.DATE_MIN_VALUE?A().diff(A.utc(T).local(),"hours"):void 0},[m]),y=()=>{_?.id&&s(n.id,p.utcToLocalTime(r),n.studentProfile.name)},j=()=>{m&&f(`/view-session/${n.id}/${m.id}?from=home`)},S=()=>{_?.id&&t(n.id,_.id,_.isDone)};return e.jsx("div",{children:e.jsxs("div",{className:`${a.home["check-in-item"]} d-flex flex-column flex-sm-row align-items-between`,children:[e.jsxs("div",{className:"d-flex flex-column flex-sm-row flex-grow-1 mr-2",children:[e.jsx(i.Typography,{className:`${a.home["check-in-item__type"]} text-nowrap`,children:`${l(d?"last_check_in":g?"todays_1_1":"todays_check_in")}:`}),e.jsxs("div",{className:`${a.home["check-in-item__info"]}`,children:[e.jsx(i.Typography,{className:`${a.home["check-in-item__info__time"]}`,children:p.utcToLocalTime(r,"do MMM yyyy - hh:mm a")}),v!==void 0&&e.jsxs("div",{className:`${a.home["check-in-item__info__note"]}`,children:[e.jsx("span",{className:`${a.home["check-in-item__info__note__icon"]}`,children:e.jsx(Ie.ErrorIcon,{})}),e.jsx(i.Typography,{className:`${a.home["check-in-item__info__note__text"]}`,children:v===0?"ended in less than one hour":`ended over ${v>24?24:v} ${v>1?"hours":"hour"} ago`})]})]})]}),e.jsx("div",{className:`${a.home["check-in-item__action"]}`,children:h&&!m?.isDone&&!g?e.jsx(i.Button,{className:`${a.home["check-in-item__action__btn"]}`,variant:"text",color:"primary",onClick:S,children:l("start_a_1_1_conversation")}):g?e.jsx(i.Button,{className:`${a.home["check-in-item__action__btn"]}`,variant:"text",color:"primary",onClick:j,children:l("view_check_in")}):e.jsx(i.Button,{className:`${a.home["check-in-item__action__btn"]}`,variant:"text",color:"primary",onClick:y,children:l("start")+" "+l("1-1")})})]})})},kt=({className:n="",checkInList:s,onView:t,showEmptyText:l,emptyText:c,setTodayCheckIn:h,onRequestOneToOne:d,isStudent:r,onStartCheckIn:g})=>{const{t:_}=p.useTranslation();return u.useEffect(()=>{h?.(s.some(m=>m.isToday&&!m.sessionResults.some(f=>!f.isTeacherResult&&f.isDone)&&!m.isOneToOneConversation))},[s]),e.jsxs(i.Grid,{container:!0,spacing:2,className:`${oe.styles["custom-scrollbar"]} ${s.length>5?a.home["check-in-list--scroll"]:""} ${n}`,children:[s.length>0&&s.map((m,f)=>e.jsx("div",{className:`${a.home["check-in-list__item"]} w-100`,children:e.jsx(wt,{onView:t,item:m,onRequestOneToOne:d})},f)),!!l&&!s.length&&e.jsxs("div",{className:`${a.home["check-in-list__item"]} ${a.home["check-in-list__item--empty"]} flex-wrap flex-sm-nowrap d-flex justify-content-between align-items-center w-100`,children:[e.jsx(i.Typography,{className:"text-wrap flex-grow-1 py-2 pr-2",children:c||_("no_last_or_requested_check_ins")}),!r&&e.jsx(i.Button,{variant:"contained",color:"primary",endIcon:e.jsx(ae.ArrowIcon,{fill:"#FFFFFF"}),onClick:g,className:"rounded-pill ms-0 ms-sm-3 text-nowrap",children:_("start_check_in")})]})]})},ds=n=>{const{open:s,onClose:t}=n;return e.jsx(de.SimpleDialog,{open:s,onClose:t,scroll:"body",maxWidth:"lg",children:e.jsx(Ct,{})})},Ct=()=>{const n=Q.useSelector(k=>k.common?.user),s=n.studentId,t=n.roles.includes("Student"),{t:l}=p.useTranslation(),c=te.useNavigate(),h=Q.useDispatch(),[d,r]=u.useState("0"),[g,_]=u.useState(),[m,f]=u.useState(0),[v,y]=u.useState(!1),[j,S]=u.useState(!1),[T,b]=u.useState([]),[N,E]=u.useState(),O=k=>{r(k?.toString()||"")},W=k=>{_(k??void 0)},q=u.useCallback(async()=>{if(!t)try{const k=await Be.getLastOrTodaySession({studentId:m||void 0},n.roles);b(k.data)}catch(k){h(p.setAlert({type:"danger",message:k.message}))}},[m]),C=(k,D,V)=>{const U=`/my-one-to-one/completed?date=${D}&name=${V}&session=${k}`;c(U)},M=async()=>{h(p.setLoading(!0));try{if(!d||d==="0"||d==="undefined")throw r(""),t?new Error(l("please_select_a_teacher")):new Error(l("please_select_a_student"));const k=await Ae.startSession(t?s:m,g,n.roles,N),D=k.data.sessionId,V=k.data.teacherResult.id,U=k.data.studentResult.id;c(`/start-question/${D}/${t?U:V}`)}catch(k){h(p.setAlert({type:"danger",message:k.message}))}h(p.setLoading(!1))},L=()=>{if((!d||d==="0")&&(r(""),!t))throw new Error(l("please_select_a_student"));c(`/my-one-to-one/pending?new-check-in=true&studentId=${m}`)},F=async(k,D,V)=>{h(p.setLoading(!0));try{c(`/${V?"result-session":"start-question"}/${k}/${D}?isOneToOne=true`)}catch(U){h(p.setAlert({type:"danger",message:U.message}))}h(p.setLoading(!1))},$=()=>{try{if(!d||d==="0"||d==="undefined")throw r(""),t?new Error(l("please_provide_a_valid_teacher")):new Error(l("please_provide_a_valid_student"));c(t?`/book-session?startSession=${g}&teacherEmailStart=${N}`:`/book-session/${m}`)}catch(k){h(p.setAlert({type:"danger",message:k.message}))}};return u.useEffect(()=>{!t&&m&&q()},[m,t]),e.jsxs("div",{className:`${a.home["one-to-one-dialog"]}`,children:[e.jsxs("div",{className:`${a.home["one-to-one-dialog__head"]}`,children:[e.jsx(i.Typography,{variant:"h5",className:`${a.home["one-to-one-dialog__head__title"]}`,children:l(t?"start_check_in_homepage":"start_1_1_conversation")}),e.jsx(i.Typography,{className:`${a.home["one-to-one-dialog__head__content"]}`,children:l(t?"select_the_teacher_or_counselor_asking_you_to_check_in_if_you_have_more_than_one_teacher_choose_any_teacher_in_the_class_all_the_teachers_and_counselors_listed_can_view_your_check_ins":"you_can_start_a_1-1_conversation_after_the_results_of_the_student's_check-in._If_the_check-in_is_24_hours_older,_you_can_request_the_new_check-in_or_start_the_conversation_by_viewing_the_results")}),e.jsxs("div",{className:`${a.home["one-to-one-dialog__head__selector"]}`,children:[t?e.jsx(Gs.StudentSupporterSelector,{isTeacherStart:g,setIsTeacherStart:W,setTeacherName:O,setIsCheckTeacher:S,teacherEmailStart:N,setTeacherEmailStart:E}):e.jsx(fe.StudentSelector,{setStudentId:f,studentId:m,setStudentName:O,setIsCheckStudent:S,isDialog:!0}),!d&&e.jsxs(i.Typography,{className:`${he.myOneToOne["session-invalid"]}`,children:[l("this_is_a_required_field"),"."]}),!j&&e.jsxs(i.Typography,{className:`${he.myOneToOne["session-box-description"]} ${he.myOneToOne["session-description"]}`,children:[l(t?"you_have_no_teacher":"you_have_no_student"),"."]})]})]}),e.jsx("div",{className:`${a.home["one-to-one-dialog__body"]}`,children:!!m&&!t&&e.jsx(kt,{className:`${a.home["check-in-list"]}`,onView:C,onRequestOneToOne:F,checkInList:T,showEmptyText:!0,setTodayCheckIn:y,isStudent:t,onStartCheckIn:L})}),j&&e.jsxs("div",{className:`${a.home["one-to-one-dialog__footer"]}`,children:[!v&&e.jsx(i.Button,{variant:"contained",color:"primary",endIcon:e.jsx(ae.ArrowIcon,{fill:"#FFFFFF"}),onClick:M,style:{backgroundColor:"#316CD9"},children:l(t?"start_check_in":"request_check_in")}),e.jsx(i.Button,{variant:"outlined",color:"primary",endIcon:e.jsx(ls.CalendarIcon,{fill:"#316CD9"}),className:`${a.home["one-to-one-dialog__footer__book-btn"]}`,onClick:$,children:l("book_for_later")})]})]})},Nt=12,bt=20,St=()=>{const n=Q.useSelector(Z=>Z.common?.user),s=n.studentId,t=n.roles.includes("Student"),l=n.roles.includes("Teacher")||n.roles.includes("Assistant"),c=n?.id,h=te.useNavigate(),{t:d}=p.useTranslation(),r=Q.useDispatch(),[g,_]=u.useState(!1),[m,f]=u.useState(!1),[v,y]=u.useState(!1),[j,S]=u.useState(!1),[T,b]=u.useState(!1),[N,E]=u.useState(!1),[O,W]=u.useState(),[q,C]=u.useState("0"),[M,L]=u.useState(),[F,$]=u.useState(),[k,D]=u.useState({events:!1,goals:!1,academicYears:!1,dataCheckIns:!1,todaySchedule:!1,listStudent:!1});u.useEffect(()=>{t?D(Z=>({...Z,dataCheckIns:!0,events:!0,listStudent:!0,todaySchedule:!0})):(D(Z=>({...Z,weeklyQuests:!0,goals:!0,academicYears:!0})),l||D(Z=>({...Z,dataCheckIns:!0})))},[t]);const V=Q.useSelector(Z=>Z.common?.defaultFontSize),U=()=>{_(!0)},I=()=>{_(!1)},J=()=>{f(!0)},Y=()=>{f(!1)},K=()=>{y(!0)},w=()=>{y(!1)},G=()=>{S(!0)},X=()=>{S(!1)},ne=()=>{b(!0)},ie=()=>{b(!1)},me=()=>{E(!0)},ve=()=>{E(!1)},ye=()=>{U()},we=()=>{h("/student-detail/create")},ke=()=>{try{if(!q||q==="0")throw C(""),t?new Error(d("please_select_a_teacher")):new Error(d("please_select_a_student"));h(`/student-detail/overview/${O}`)}catch(Z){r(p.setAlert({type:"danger",message:Z.message}))}},Ce=async()=>{D(Z=>({...Z,events:!1}));try{const Z=A().weekday(),je={startDate:A().add(-Z+1,"day").startOf("day").valueOf(),endDate:A().add(7-Z,"day").endOf("day").valueOf(),userId:c,roles:n.roles},be=await ct(je);$(be.data)}catch(Z){r(p.setAlert({type:"danger",message:Z.message}))}D(Z=>({...Z,events:!0}))};u.useEffect(()=>{window.document.title="Home Page"},[]),u.useEffect(()=>{t||Ce()},[t]),u.useEffect(()=>(k.academicYears&&k.dataCheckIns&&k.events&&k.goals&&k.todaySchedule&&k.listStudent?r(p.setLoading(!1)):r(p.setLoading(!0)),()=>{r(p.setLoading(!1))}),[k]);const Ne=u.useMemo(()=>V==bt?"font-large":V==Nt?"font-small":"",[V]);return{t:d,isStudent:t,isTeacher:l,currentUser:n,dataCardTotal:F,isOpenCalendarDialog:N,currentUserId:s,isOpenOneToOneDialog:g,isOpenThisWeekCheckInDialog:m,isOpenThisWeekOneToOneDialog:v,isOpenLatestCheckInDialog:j,isOpenMissingStudentDialog:T,studentSelectedId:O,isCheckStudents:M,studentSelected:q,classFontSize:Ne,setStudentSelectedId:W,setCheckStudents:L,setStudentSelected:C,handleAddNewStudent:we,handleViewStudent:ke,handleCloseOneToOneDialog:I,handleStartOrBookOneToOne:ye,handleCloseThisWeekCheckInDialog:Y,handleOpenCalendarDialog:me,handleCloseCalendarDialog:ve,handleOpenThisWeekOneToOneDialog:K,handleCloseThisWeekOneToOneDialog:w,handleOpenLatestCheckInDialog:G,handleCloseLatestCheckInDialog:X,handleOpenMissingStudentDialog:ne,handleCloseMissingStudentDialog:ie,handleOpenThisWeekCheckInDialog:J,setLoadingComplete:D}},hs=n=>{const{studentId:s,options:t,requireStudent:l}=n,c=Q.useSelector(y=>y.common?.user),h=c.roles.includes("Student"),[d,r]=u.useState(!1),g=Q.useDispatch(),[_,m]=u.useState([]),f=y=>y.map(j=>({sessionId:j.id,sessionResultId:h?j.studentResultId:j.teacherResultId,startTime:j.startTime,resultStartTime:j.resultStartTime,endTime:j.endTime,isDone:j.isDone,createdAt:j.createdAt,name:h?j.teacherName:j.studentProfile.name,avatar:h?j.teacherProfileImage:j.studentProfile.avatar})),v=u.useCallback(async()=>{if(!d){r(!0);try{const y=await Ae.getSessionOneToOne({...t,roles:c.roles,studentId:s||void 0,isDone:!0});m(f(y.data.items||[]))}catch(y){g(p.setAlert({type:"danger",message:y.response?.data?.title||y.message}))}r(!1)}},[s,t]);return u.useEffect(()=>{!t||!s&&l?m([]):v()},[s,JSON.stringify(t),l]),{checkInList:_,isLoading:d}},Tt=p.getStaticFileUrl("/images/image-default.png"),It=({endTime:n,startTime:s,isDone:t,onView:l,sessionId:c,sessionResultId:h,name:d,avatar:r,isSession:g=!0})=>{const{t:_}=p.useTranslation(),m=u.useMemo(()=>n&&n!==H.DATE_MIN_VALUE?A().diff(A.utc(n).local(),"hours"):void 0,[n]),f=()=>{l(c,h,t)};return e.jsx("div",{children:e.jsxs("div",{className:`${a.home["check-in-item"]}`,children:[e.jsxs("div",{className:"d-flex",style:{gap:"8px"},children:[e.jsx(i.Avatar,{alt:d?.toUpperCase(),src:p.getFileUrl(r)||Tt}),e.jsxs("div",{className:"ml-2 ml-sm-3 d-flex flex-column justify-content-center",children:[e.jsx("div",{className:"d-flex align-items-baseline",children:e.jsx(i.Typography,{className:`${a.home["check-in-item__name"]}`,children:d})}),e.jsxs("div",{className:"d-flex flex-row flex-wrap",children:[e.jsx(i.Typography,{className:`${a.home["check-in-item__type"]} text-nowrap`,children:`${_(g?"check_in":"1-1")}:`}),e.jsxs("div",{className:`${a.home["check-in-item__info"]}`,children:[!!s&&s!==H.DATE_MIN_VALUE&&e.jsx(i.Typography,{className:`${a.home["check-in-item__info__time"]}`,children:p.utcToLocalTime(s,"do MMM yyyy - hh:mm a")}),m!==void 0&&!!n&&e.jsxs("div",{className:`${a.home["check-in-item__info__note"]}`,children:[e.jsx("span",{className:`${a.home["check-in-item__info__note__icon"]}`,children:e.jsx(Ie.ErrorIcon,{})}),e.jsx(i.Typography,{className:`${a.home["check-in-item__info__note__text"]}`,children:m===0?"ended in less than one hour":`ended over ${m>24?24:m} ${m>1?"hours":"hour"} ago`})]})]})]})]})]}),e.jsx("div",{className:`${a.home["check-in-item__action"]}`,children:e.jsx(i.Button,{className:`${a.home["check-in-item__action__btn"]}`,variant:"text",color:"primary",onClick:f,children:_("view_results")})})]})})},us=({className:n="",checkInList:s,onView:t,showEmptyText:l,emptyText:c,isSession:h})=>{const{t:d}=p.useTranslation();return e.jsxs(i.Grid,{container:!0,spacing:2,className:`${oe.styles["custom-scrollbar"]} ${s.length>5?a.home["check-in-list--scroll"]:""} ${n}`,children:[s.length>0&&s.map((r,g)=>e.jsx("div",{className:`${a.home["check-in-list__item"]} w-100`,children:e.jsx(It,{onView:t,endTime:r.endTime||H.DATE_MIN_VALUE,startTime:r.startTime||H.DATE_MIN_VALUE,isDone:r.isDone,sessionId:r.sessionId,sessionResultId:r.sessionResultId,avatar:r.avatar||"",name:r.name||"",isSession:h})},g)),!!l&&!s.length&&e.jsx("div",{className:`${a.home["check-in-list__item"]} ${a.home["check-in-list__item--empty"]}`,children:e.jsx(i.Typography,{children:c||d("no_last_or_requested_check_ins")})})]})},Lt=n=>{const{open:s,onClose:t}=n;return e.jsx(de.SimpleDialog,{open:s,onClose:t,scroll:"body",maxWidth:"lg",children:e.jsx(Dt,{})})},Ue=A().weekday(),$t={startDate:A().add(-Ue+1,"day").startOf("day").valueOf(),endDate:A().add(7-Ue,"day").endOf("day").valueOf(),loadLastCheckIn:!0,sortBy:"Name",sortOrder:"ASC"},Dt=()=>{const{t:n}=p.useTranslation(),[s,t]=u.useState(0),{checkInList:l}=hs({options:$t,studentId:s}),[c,h]=u.useState(!1),d=te.useNavigate(),r=(g,_,m)=>{const f=`/${m?"result-session":"start-question"}/${g}/${_}`;d(f)};return e.jsxs("div",{className:`${a.home["this-week-checkIn-dialog"]}`,children:[e.jsxs("div",{className:`${a.home["this-week-checkIn-dialog__head"]}`,children:[e.jsx(i.Box,{sx:{display:"flex",justifyContent:"space-between"},children:e.jsx(i.Typography,{variant:"h5",className:`${a.home["this-week-checkIn-dialog__head__title"]}`,children:n("this_weeks_check_ins")})}),e.jsxs("div",{className:`${a.home["this-week-checkIn-dialog__head__selector"]}`,children:[e.jsx(fe.StudentSelector,{setStudentId:t,studentId:s,setIsCheckStudent:h,isDialog:!0}),!c&&e.jsxs(i.Typography,{className:`${he.myOneToOne["session-box-description"]} ${he.myOneToOne["session-description"]}`,children:[n("you_have_no_student"),"."]})]})]}),e.jsx("div",{className:`${a.home["this-week-checkIn-dialog__body"]}`,children:c&&e.jsx(us,{className:`${a.home["check-in-list"]}`,onView:r,checkInList:l,showEmptyText:!!s,emptyText:n("this_student_does_nt_have_check_in_in_this_week")})})]})},At=Ws.div`
2
+ @media (max-width: 1279.95px) {
3
+ .fc-timegrid-slot-label {
4
+ padding: 16px 20px 16px 8px;
5
+ }
6
+ }
7
+ @media (max-width: 599.95px) {
8
+ table {
9
+ border-radius: 0 0 16px 16px;
10
+ }
11
+ .fc-timegrid-cols {
12
+ .fc-day-today {
13
+ border-radius: 0 0 16px 16px;
14
+ }
15
+ }
16
+ .fc-timeGridDay-view {
17
+ border-top: 1px solid #d3d3d3;
18
+ }
19
+ .fc-timegrid-slot-label {
20
+ padding: 8px;
21
+ }
22
+ .calendar-wrapper {
23
+ background-color: #f6f6f6b8;
24
+ border-radius: 16px;
25
+ border: 1px solid #d3d3d3;
26
+ .header-container {
27
+ border-radius: 16px 16px 0 0;
28
+ padding: 16px 12px;
29
+ background-color: #f6f6f6b8;
30
+ display: flex;
31
+ flex-wrap: nowrap;
32
+ &::-webkit-scrollbar {
33
+ height: 0px;
34
+ }
35
+ }
36
+ }
37
+ table {
38
+ background-color: #f6f6f6b8;
39
+ .fc-timegrid-col-events {
40
+ width: 100%;
41
+ .fc-timegrid-event-harness {
42
+ width: 100%;
43
+ padding-right: 4px;
44
+ }
45
+ }
46
+ }
47
+ .fc-col-header {
48
+ display: none;
49
+ }
50
+ }
51
+ background-color: #ffffff;
52
+ border-radius: 24px;
53
+ .fc-header-toolbar {
54
+ display: none;
55
+ }
56
+ .fc-timegrid-slot-label {
57
+ padding: 24px 20px 16px 16px;
58
+ .fc-timegrid-slot-label-cushion {
59
+ font-weight: 400;
60
+ font-size: 12px;
61
+ line-height: 18px;
62
+ color: #242424;
63
+ }
64
+ }
65
+ .fc-scrollgrid {
66
+ border-top: none;
67
+ border-left: none;
68
+ }
69
+ .fc-timegrid-slot-label-frame {
70
+ text-align: left;
71
+ }
72
+ .fc-header-toolbar {
73
+ padding: 1.5rem 2rem 1rem;
74
+ }
75
+ .fc-timegrid-event-harness {
76
+ inset: unset !important;
77
+ height: 0;
78
+ width: 100%;
79
+ }
80
+ .fc-event-main {
81
+ z-index: unset !important;
82
+ }
83
+ .fc-scrollgrid-section.fc-scrollgrid-section-header {
84
+ & > th {
85
+ border-right: none;
86
+ }
87
+ }
88
+ .fc-col-header {
89
+ border: none;
90
+ width: 100% !important;
91
+ }
92
+ .fc-daygrid-body,
93
+ .fc-scrollgrid-sync-table {
94
+ }
95
+ .fc-toolbar-title,
96
+ .fc-col-header-cell-cushion,
97
+ .fc-daygrid-day-number,
98
+ .fc-daygrid-more-link {
99
+ font-weight: 600;
100
+ }
101
+ ,
102
+ .fc-event-title {
103
+ }
104
+ .fc-h-event {
105
+ }
106
+ .fc-col-header-cell {
107
+ border: none;
108
+ border-bottom: 1px solid #d3d3d3;
109
+ }
110
+ .fc-col-header-cell {
111
+ padding-block: 8px;
112
+ &.fc-day-today {
113
+ border-radius: 8px 8px 0 0;
114
+ background: #f6f6f6b8;
115
+ }
116
+ }
117
+ .fc-timegrid-col.fc-day.fc-day-today {
118
+ background: #f6f6f6b8;
119
+ }
120
+ .fc-day-sat,
121
+ .fc-day-sun {
122
+ color: #999;
123
+ }
124
+ .fc-timegrid-col.fc-timegrid-axis {
125
+ border-right: 1px solid #d3d3d3;
126
+ }
127
+ .fc-timegrid-col.fc-day {
128
+ border-width: 1px;
129
+ padding-inline: 2px;
130
+ border: 1px dashed #d3d3d3;
131
+ &.fc-day {
132
+ &-mon {
133
+ border-left: 1px solid #d3d3d3 !important;
134
+ }
135
+ }
136
+ }
137
+ .fc-timegrid-slots {
138
+ table {
139
+ height: auto !important;
140
+ }
141
+ }
142
+ .fc-timegrid-slot {
143
+ height: 2.5rem;
144
+ border: none;
145
+ border-top: 1px dashed #d3d3d3;
146
+ }
147
+ .fc-scrollgrid.fc-scrollgrid-liquid {
148
+ border: none;
149
+ thead {
150
+ .fc-theme-standard td,
151
+ .fc-theme-standard th {
152
+ border: none;
153
+ }
154
+ }
155
+ }
156
+ .fc-timegrid-event.fc-event {
157
+ height: 0;
158
+ background: transparent;
159
+ border: none;
160
+ &::after {
161
+ background: none !important;
162
+ }
163
+ }
164
+ .fc-timegrid-slot-label {
165
+ border: none;
166
+ }
167
+ .fc-timegrid-slot-minor {
168
+ border: none;
169
+ }
170
+ .fc-timegrid-axis {
171
+ border-right: none;
172
+ border-width: 1px;
173
+ }
174
+ .fc-timegrid-slot-label-cushion {
175
+ font-weight: 500;
176
+ text-transform: uppercase;
177
+ padding: 0;
178
+ }
179
+ .fc-col-header-cell-cushion {
180
+ font-weight: 400;
181
+ font-size: 12px;
182
+ line-height: 18px;
183
+ text-decoration: none;
184
+ color: #242424;
185
+ }
186
+ .fc-scrollgrid-sync-inner {
187
+ height: 100%;
188
+ }
189
+ .fc-timegrid-event-harness.fc-timegrid-event-harness-inset {
190
+ z-index: unset !important;
191
+ }
192
+ .fc-timegrid-slot.fc-timegrid-slot-label {
193
+ vertical-align: top;
194
+ border-bottom: 1px dashed #d3d3d3;
195
+ }
196
+ .fc-scrollgrid-section.fc-scrollgrid-section-body {
197
+ .fc-scroller-harness {
198
+ overflow: visible;
199
+ overflow-x: hidden;
200
+ }
201
+ & > td {
202
+ border: none;
203
+ & > div {
204
+ border-radius: 0 0 24px 24px;
205
+ }
206
+ }
207
+ }
208
+ .fc-button {
209
+ background-color: transparent !important;
210
+ border: none;
211
+ & > span {
212
+ color: #888;
213
+ }
214
+ box-shadow: none !important;
215
+ }
216
+ .fc-v-event {
217
+ margin: 0;
218
+ box-shadow: none;
219
+ }
220
+ .fc-today-button {
221
+ cursor: pointer;
222
+ text-transform: capitalize;
223
+ background-color: rgb(236, 236, 236) !important;
224
+ color: #020202 !important;
225
+ border-radius: 8px;
226
+ font-weight: 600;
227
+ border-top-left-radius: 8px !important;
228
+ border-bottom-left-radius: 8px !important;
229
+ &:hover {
230
+ background-color: #020202 !important;
231
+ color: #ffffff !important;
232
+ }
233
+ }
234
+ `,De={"custom-event":"_custom-event_6x2g5_1","custom-event__title":"_custom-event__title_6x2g5_8","custom-event__time":"_custom-event__time_6x2g5_11","custom-event--open":"_custom-event--open_6x2g5_31"},qt=({event:n,onEventClick:s})=>{const[t,l]=u.useState(),c=n?._def?.extendedProps,[h,d]=u.useState(!1),[r,g]=u.useState(),[_,m]=u.useState(0),[f,v]=u.useState(null),y=u.useRef(null),j=u.useRef(null),S=`${A(n.startStr).format("HH")}:00:00`,T=A(n.startStr).format("hh:mm A"),b=()=>{s?.(n)};return{extendedProps:c,isLoading:h,isOpen:t,ref:y,popupRef:j,dataTime:S,event:n,time:T,eventStart:r,setLoading:d,handelMouseEnter:()=>{l(!0),document.querySelectorAll(`.fc-timegrid-col.fc-day:not(.fc-day-${A(n.startStr).format("ddd").toLocaleLowerCase()}) .fc-timegrid-col-events`).forEach(C=>C.setAttribute("style","z-index: unset"))},handelMouseLeave:()=>{l(!1),document.querySelectorAll(`.fc-timegrid-col.fc-day:not(.fc-day-${A(n.startStr).format("ddd").toLocaleLowerCase()}) .fc-timegrid-col-events`).forEach(C=>C.setAttribute("style",""))},handleChangeEventStart:q=>{g(q)},handleEventClick:b,handleClickAndDoubleClick:q=>{if(_&&q.timeStamp-_<250&&f)m(0),clearTimeout(f),b(),v(null);else{m(q.timeStamp);const C=setTimeout(()=>{v(null),l(!0)},251);v(C)}}}},Rt=n=>n===z.EVENT_ENUM.CONFERENCE?"#FFF9F1":n===z.EVENT_ENUM.ONE_TO_ONE?"#EFF3FC":n===z.EVENT_ENUM.CHECK_IN?"#ECF6F6":"#EFF3FC",_s=n=>n===z.EVENT_ENUM.CONFERENCE?"#FF970C":n===z.EVENT_ENUM.ONE_TO_ONE?"#316CD9":n===z.EVENT_ENUM.CHECK_IN?"#169490":"#316CD9",Et=pe.styled("div",{shouldForwardProp:n=>n!=="$disabled"&&n!=="$type"})(({$disabled:n,$type:s})=>({position:"relative",...n?{"& > .custom-event":{cursor:"context-menu"}}:{"& > .custom-event":{"&:hover":{backgroundColor:_s(s),color:"#FFFFFF"}}}})),Mt=pe.styled("div",{shouldForwardProp:n=>n!=="$type"&&n!=="$isOpen"&&n!=="$disabled"})(({$type:n,$isOpen:s,$disabled:t})=>({backgroundColor:s&&!t?_s(n):Rt(n),color:s&&!t?"#FFFFFF":"#242424"})),Bt=({type:n,disabled:s,...t})=>{const{isOpen:l,ref:c,dataTime:h,time:d,event:r,handelMouseEnter:g,handelMouseLeave:_,handleEventClick:m}=qt(t);return e.jsx(Et,{ref:c,$disabled:s,$type:n,onMouseEnter:g,onMouseLeave:_,children:e.jsxs(Mt,{$type:n,$isOpen:l,$disabled:s,className:`custom-event ${De["custom-event"]} ${l?De["custom-event--open"]:""}`,"data-time":h,onClick:m,children:[e.jsx("p",{className:`mb-0 ${De["custom-event__title"]}`,children:r.title}),e.jsx("p",{className:`mb-0 ${De["custom-event__time"]}`,children:d})]})})},Ke=4,Ft=84,ze=1,Gt=({isStudent:n,eventList:s,screenWidth:t,minHour:l,maxHour:c})=>{const h=te.useNavigate(),[d,r]=u.useState(z.CALENDAR_GRID_TYPE.timeGridWeek),[g,_]=u.useState(A().format("YYYY-MM-DD")),[m,f]=u.useState([]),v=u.useRef();function y($,k){const D=new MouseEvent(k,{bubbles:!0,cancelable:!0});$.dispatchEvent(D)}const j=()=>{const $=document.querySelector(".fc-prev-button");$&&y($,"click")},S=()=>{const $=document.querySelector(".fc-next-button");$&&y($,"click")},T=$=>{const{teacherResultId:k,studentResultId:D,sessionResult:V,studentId:U,conferenceId:I}=$._def.extendedProps;if(k||D){h(`/start-question/${V}/${n?D:k}`);return}if(U&&I){h(`/start-conference/${U}/${I}/conferenceRubric`);return}},b=()=>s?.map($=>{const k=as.format(A.utc($.startDate).local().toDate(),"yyy-MM-dd HH:mm:ss");return{id:$.location,title:$.summary,date:k,className:"event-card",extendedProps:{teacherResultId:$.sessionResult?.find(D=>!!D.isTeacherResult)?.id,studentResultId:$.sessionResult?.find(D=>!D.isTeacherResult)?.id,sessionResult:$.sessionId,studentId:$.conferenceAnswers?.studentId||$.sessionResult?.[0]?.studentId,conferenceId:$.conferenceId,actionPointId:$.actionPointId}}}),N=$=>{const k=A($).get("hours");return k>=l&&k<c},E=u.useMemo(()=>b(),[s]),O=$=>$.startsWith("1-1")?z.EVENT_ENUM.ONE_TO_ONE:$.startsWith("Conference")?z.EVENT_ENUM.CONFERENCE:$.startsWith("Check-in")?z.EVENT_ENUM.CHECK_IN:null,W=$=>{const k=A($?.date);if(!k.isValid())return"";const D=A($?.date).isSame(new Date,"day");return`${k.format("ddd DD")}${D?", today":""}`},q=($,k)=>{const D=document.querySelector(".fc-day-mon"),V=document.querySelector(".fc-day-fri"),U=document.querySelector(".toolbar-title"),I=D?.getAttribute("data-date"),J=V?.getAttribute("data-date"),Y=$||A(I,"YYYY-MM-DD"),K=k||A(J,"YYYY-MM-DD");if(Y.isValid()&&K.isValid()&&U){let w="";if(Y.month()!==K.month())if(Y.year()===K.year()){const G=`${Y.format("YYYY")} (Week ${Y.format("ww")})`;w=`${Y.format("MMMM")} - ${K.format("MMMM")} ${G}`}else w=`${Y.format("MMMM YYYY")} - ${K.format("MMMM YYYY")} (Week ${Y.format("ww")})`;else w=`${Y.format("MMMM YYYY")} (Week ${Y.format("ww")})`;w&&(U.textContent=w)}},C=()=>{const $=document.querySelectorAll(".fc-timegrid-slot.fc-timegrid-slot-lane:not(.fc-timegrid-slot-minor)"),k=document.querySelectorAll(".fc-timegrid-col.fc-day");let D=0;$.forEach(V=>{const U=V.getAttribute("data-time");let I=0;const J=Ke+ze;k.forEach(K=>{const w=K.querySelectorAll(`.custom-event[data-time="${U}"]`);let G=0;w.forEach((X,ne)=>{X?.parentElement?.parentElement?.setAttribute("style",`top: ${D+(ne===0?J:0)+G}px`),G+=X.clientHeight+Ke+(ne===0?J:0)}),G+=J,G>I&&(I=G)});const Y=I>J?I:Ft+ze;D+=Y,V?.setAttribute("style",`height: ${Y}px`)})},M=$=>{(v?.current?.getApi()).gotoDate($),_($)},L=()=>{q(),C(),d===z.CALENDAR_GRID_TYPE.timeGridDay&&F()},F=()=>{const $=document.querySelector(".header-container"),k=document.querySelector(".fc-col-header-cell");if(!$||!k)return;const D=k.getAttribute("data-date")||"";_(D);const V=A(D,"YYYY-MM-DD"),U=V.day(),I=V.add(-U+1,"day"),J=Pe.clone(I),Y=[];for(let w=0;w<=4;w++){const G=w==0?I:I.add(1,"day"),X=G.diff(A().startOf("day"),"days")===0,ne=G.format("YYYY-MM-DD");Y.push({title:`${G.format("ddd DD")}${X?", today":""}`,active:A(g,"YYYY-MM-DD").diff(G,"days")===0,onClick:()=>M(ne)})}const K=Pe.clone(I);f(Y),q(J,K)};return u.useEffect(()=>{t<=z.EXTRA_SMALL_SCREEN_WIDTH&&d!==z.CALENDAR_GRID_TYPE.timeGridDay&&(r(z.CALENDAR_GRID_TYPE.timeGridDay),v&&v.current?.getApi()?.changeView(z.CALENDAR_GRID_TYPE.timeGridDay,g)),t>z.EXTRA_SMALL_SCREEN_WIDTH&&d!==z.CALENDAR_GRID_TYPE.timeGridWeek&&(r(z.CALENDAR_GRID_TYPE.timeGridWeek),v&&v.current?.getApi()?.changeView(z.CALENDAR_GRID_TYPE.timeGridWeek,g))},[t,d]),{events:E,calendarRef:v,calendarGridType:d,dayButtons:m,setCalendarGridType:r,handleEventClick:T,mapEventList:b,convertType:O,convertDayHeaderContent:W,handleEventsDidMount:L,checkValidEvent:N,handlePrevBtnClick:j,handleNextBtnClick:S,handleGotoDate:M,setDateString:_}},Ot=pe.styled("span",{shouldForwardProp:n=>n!=="$config"&&n!=="$active"})(({$config:n,$active:s})=>({padding:"4px 12px",fontWeight:400,fontSize:"12px",lineHeight:"18px",borderRadius:"6px",cursor:"pointer",margin:"2px",backgroundColor:s?"#242424 !important":n.bgColor,transition:"background-color 0.15s ease",color:s?"#FFFFFF !important":n.color||"#242424","&:hover":{backgroundColor:n.hoverBg,color:n.hoverColor||"#FFFFFF"},display:"flex",alignItems:"center",whiteSpace:"nowrap",flexGrow:1,justifyContent:"center"})),Yt=({data:n,onClick:s,active:t})=>{const{t:l}=p.useTranslation(),c=()=>{s?.(n.value)};return e.jsx(Ot,{$config:n,$active:t,onClick:c,children:l(n.name)})},Wt={"calendar-filters":"_calendar-filters_1mcdf_1"},Ht=({showFilterAll:n,onFilter:s,filter:t})=>{const l=n?[z.filterAll,...z.calendarFilters]:z.calendarFilters,c=h=>{s?.(h)};return e.jsx("div",{className:`${Wt["calendar-filters"]}`,children:l.map((h,d)=>e.jsx(Yt,{data:h,onClick:c,active:h.value===t||!h.value&&!t},d))})},Pt="_dayButton_s09t5_1",Vt="_active_s09t5_17",Qe={dayButton:Pt,active:Vt},Jt=({title:n,active:s,onClick:t,date:l})=>{const c=()=>{t?.(l)};return e.jsx("span",{className:`${Qe.dayButton}${s?` ${Qe.active}`:""}`,onClick:c,children:n})},Ut=20,Kt=12,zt=()=>{const n=Q.useDispatch(),s=Q.useSelector(b=>b.common?.user?.roles),t=Q.useSelector(b=>b.common.user),l=t?.id,c=s.includes("Teacher")||s.includes("Assistant")||s.includes("Counselor")||s.includes("SecondaryTeacher"),[h,d]=u.useState(),[r,g]=u.useState(),[_,m]=u.useState(),f=Q.useSelector(b=>b?.common?.defaultFontSize),v=u.useMemo(()=>f==Ut?"font-large":f==Kt?"font-small":"",[f]),y=Ps.caculateHeaderFont(f),j=b=>{g(b)},S=b=>{let N=A(b.startStr).startOf("day").valueOf();m(N)},T=async()=>{if(n(p.setLoading(!0)),!!_){try{const b=await rt(l,_,s,r);d(b.data)}catch(b){n(p.setAlert({type:"danger",message:b.response?.data?.title||b.message}))}n(p.setLoading(!1))}};return u.useEffect(()=>{document.title="Home",T()},[_,r]),{user:t,filter:r,dataEvent:h,isTeacher:c,classFontSize:v,fontSizeHeader:y,getDataEvent:T,handleChangeDate:S,handleChangeFilter:j}},Qt=pe.styled(At)({"& .event-card":{width:"100%",height:"auto",position:"relative !important",left:"0% !important",marginRight:"0% !important"}}),Xt=pe.styled("div")(({theme:n})=>({padding:"48px 40px",[n.breakpoints.down("md")]:{padding:"40px 40px 36px"},[n.breakpoints.down("sm")]:{padding:"32px 0px 16px"}})),Zt=pe.styled("h2")({fontWeight:700,fontSize:"32px",lineHeight:"48px",color:"#242424"}),en=pe.styled("div")(({theme:n})=>({"& span":{cursor:"pointer",marginInline:"10px",[n.breakpoints.down("sm")]:{marginLeft:"0"},"& svg":{width:"24px! important",height:"24px !important"},"& path":{fill:" #2424248F"}}})),sn=pe.styled("div")({}),tn=n=>{const{isStudent:s,screenWidth:t}=n,{filter:l,dataEvent:c,handleChangeFilter:h,handleChangeDate:d}=zt(),{events:r,calendarRef:g,dayButtons:_,handleEventClick:m,convertType:f,convertDayHeaderContent:v,handleEventsDidMount:y,checkValidEvent:j,handlePrevBtnClick:S,handleNextBtnClick:T}=Gt({isStudent:s,eventList:c?.calendarEvents,screenWidth:t,minHour:8,maxHour:18}),b=N=>j(N.event.startStr)?e.jsx(Bt,{...N,type:f(N.event.title),screenWidth:t,onEventClick:m}):null;return e.jsxs(Qt,{children:[e.jsxs(Xt,{className:"d-flex flex-wrap justify-content-between align-items-center",children:[e.jsx(Zt,{className:"toolbar-title mb-0 col-12 col-sm-8 col-md-5"}),e.jsxs(en,{className:"col-md-2 col-sm-4 mt-4 mt-sm-0 col-12 d-flex align-items-center justify-content-start justify-content-sm-center",children:[e.jsx("span",{onClick:S,children:e.jsx(Hs.ArrowBackIcon,{})}),e.jsx("span",{onClick:T,children:e.jsx(rs.ArrowForwardIcon,{})})]}),e.jsx(sn,{className:"col-md-5 col-12 mt-4 mt-md-0 d-flex justify-content-start justify-content-md-end",children:e.jsx(Ht,{showFilterAll:!0,filter:l,onFilter:h})})]}),e.jsxs("div",{className:"calendar-wrapper",children:[t<=z.EXTRA_SMALL_SCREEN_WIDTH&&e.jsx("div",{className:"header-container",children:_.map((N,E)=>e.jsx(Jt,{...N},E))}),e.jsx(Os,{ref:g,plugins:[Ys],initialView:z.CALENDAR_GRID_TYPE.timeGridWeek,events:r,handleWindowResize:!1,headerToolbar:!1,weekends:!1,datesSet:d,allDaySlot:!1,dayHeaderContent:v,firstDay:1,eventContent:b,slotMinTime:"08:00:00",slotMaxTime:"18:00:00",slotDuration:"01:00:00",titleFormat:{month:"long",year:"numeric"},expandRows:!0,eventsSet:()=>{y?.()},contentHeight:"auto",slotLabelFormat:{hour:"numeric",separator:" ",hour12:!0}})]})]})},nn=({open:n,onClose:s,isStudent:t,screenWidth:l})=>e.jsx(de.SimpleDialog,{open:n,onClose:s,scroll:"body",fullScreen:!0,children:e.jsx(tn,{isStudent:t,screenWidth:l})}),on=n=>{const{open:s,onClose:t}=n;return e.jsx(de.SimpleDialog,{open:s,onClose:t,scroll:"body",maxWidth:"lg",children:e.jsx(ln,{})})},Xe=A().weekday(),an={startDate:A().add(-Xe+1,"day").startOf("day").valueOf(),endDate:A().add(7-Xe,"day").endOf("day").valueOf(),isConversation:!0,loadLastCheckIn:!0,sortBy:"Name",sortOrder:"ASC"},ln=()=>{const{t:n}=p.useTranslation(),[s,t]=u.useState(0),{checkInList:l}=hs({options:an,studentId:s}),[c,h]=u.useState(!1),d=te.useNavigate(),r=(g,_,m)=>{const f=`/${m?"result-session":"start-question"}/${g}/${_}?isViewLog=true`;d(f)};return e.jsxs("div",{className:`${a.home["this-week-checkIn-dialog"]}`,children:[e.jsxs("div",{className:`${a.home["this-week-checkIn-dialog__head"]}`,children:[e.jsx(i.Box,{sx:{display:"flex",justifyContent:"space-between"},children:e.jsx(i.Typography,{variant:"h5",className:`${a.home["this-week-checkIn-dialog__head__title"]}`,children:n("this_weeks_1_1s")})}),e.jsxs("div",{className:`${a.home["this-week-checkIn-dialog__head__selector"]}`,children:[e.jsx(fe.StudentSelector,{setStudentId:t,studentId:s,setIsCheckStudent:h,isDialog:!0}),!c&&e.jsxs(i.Typography,{className:`${he.myOneToOne["session-box-description"]} ${he.myOneToOne["session-description"]}`,children:[n("you_have_no_student"),"."]})]})]}),e.jsx("div",{className:`${a.home["this-week-checkIn-dialog__body"]}`,children:c&&e.jsx(us,{className:`${a.home["check-in-list"]}`,onView:r,checkInList:l,showEmptyText:!!s,isSession:!1,emptyText:n("this_student_does_nt_have_1_1_in_this_week")})})]})},rn=p.getStaticFileUrl("/images/image-default.png"),cn=({createdAt:n,startTime:s,name:t,avatar:l,onRequestCheckIn:c,isSession:h=!0})=>{const{t:d}=p.useTranslation(),r=()=>{c?.()};return e.jsx("div",{children:e.jsxs("div",{className:`${a.home["check-in-item"]}`,children:[e.jsxs("div",{className:"d-flex",style:{gap:"8px"},children:[e.jsx(i.Avatar,{alt:t?.toUpperCase(),src:p.getFileUrl(l)||rn}),e.jsxs("div",{className:"ml-2 ml-sm-3 d-flex flex-column justify-content-center",children:[e.jsx("div",{className:"d-flex align-items-baseline",children:e.jsx(i.Typography,{className:`${a.home["check-in-item__name"]}`,children:t})}),(n!==H.DATE_MIN_VALUE||!!s&&s!==H.DATE_MIN_VALUE)&&e.jsxs("div",{className:"d-flex flex-row flex-wrap",children:[e.jsx(i.Typography,{className:`${a.home["check-in-item__type"]} text-nowrap`,children:`${s&&s!==H.DATE_MIN_VALUE?d("last"):d("missed")} ${d(h?"check_in":"1-1")}:`}),e.jsxs("div",{className:`${a.home["check-in-item__info"]}`,children:[n&&(!s||s===H.DATE_MIN_VALUE)&&e.jsx(i.Typography,{className:`${a.home["check-in-item__info__time"]}`,children:p.utcToLocalTime(n,"do MMM yyyy - hh:mm a")}),!!s&&s!==H.DATE_MIN_VALUE&&e.jsx(i.Typography,{className:`${a.home["check-in-item__info__time"]}`,children:p.utcToLocalTime(s,"do MMM yyyy - hh:mm a")})]})]})]})]}),e.jsx("div",{className:`${a.home["check-in-item__action"]}`,children:e.jsx(i.Button,{className:`${a.home["check-in-item__action__btn"]}`,variant:"text",color:"primary",onClick:r,endIcon:e.jsx(ae.ArrowIcon,{}),children:d("request_check_in")})})]})})},dn=({className:n="",checkInList:s,showEmptyText:t,emptyText:l,onRequestCheckIn:c,isSession:h})=>{const{t:d}=p.useTranslation();return e.jsxs(i.Grid,{container:!0,spacing:2,className:`${oe.styles["custom-scrollbar"]} ${s.length>5?a.home["check-in-list--scroll"]:""} ${n}`,children:[s.length>0&&s.map((r,g)=>e.jsx("div",{className:`${a.home["check-in-list__item"]} w-100`,children:e.jsx(cn,{createdAt:r.createdAt||H.DATE_MIN_VALUE,startTime:r.lastCheckIn?.startTime,avatar:r.avatar||"",name:r.name||"",onRequestCheckIn:()=>c(r.sessionId,r.studentId),isSession:h})},g)),!!t&&!s.length&&e.jsx("div",{className:`${a.home["check-in-list__item"]} ${a.home["check-in-list__item--empty"]}`,children:e.jsx(i.Typography,{children:l||d("no_last_or_requested_check_ins")})})]})},hn=n=>{const{open:s,onClose:t}=n;return e.jsx(de.SimpleDialog,{open:s,onClose:t,scroll:"body",maxWidth:"lg",children:e.jsx(_n,{})})},Ze=A().weekday(),un={startDate:A().add(-Ze+1,"day").startOf("day").valueOf(),endDate:A().add(7-Ze,"day").endOf("day").valueOf(),isConversation:!1},_n=()=>{const{t:n}=p.useTranslation(),s=Q.useDispatch(),t=te.useNavigate(),l=Q.useSelector(y=>y.common?.user),c=l.roles.includes("Student"),[h,d]=u.useState(0),[r,g]=u.useState([]),_=async(y,j)=>{y?f(y):m(j)},m=async y=>{s(p.setLoading(!0));try{const j=await Ae.startSession(y,void 0,l.roles),S=j.data.sessionId,T=j.data.teacherResult.id,b=j.data.studentResult.id;t(`/start-question/${S}/${c?b:T}`)}catch(j){s(p.setAlert({type:"danger",message:j.message}))}s(p.setLoading(!1))},f=async y=>{s(p.setLoading(!0));try{await Ae.requestCheckIn(y,l.roles),s(p.setAlert({type:"success",message:"Send request check-in successfully"}))}catch(j){s(p.setAlert({type:"danger",message:j.message}))}s(p.setLoading(!1))},v=u.useCallback(async()=>{if(!c){s(p.setLoading(!0));try{const y=await Be.getStudentMissingSession({...un,studentId:h||void 0},l.roles);g(y.data?.map(j=>({studentId:j.studentId,sessionId:j.sessionId,sessionResultId:j.sessionResultId,name:j.fullName,avatar:j.profileImageFileName,startTime:j.sessionStartDate,endTime:j.sessionEndTime,createdAt:j.sessionCreatedAt,lastCheckIn:{id:j.lastSessionId,sessionResultId:j.lastSessionResultId,startTime:j.lastSessionStartTime,endTime:j.lastSessionStartTime}}))||[])}catch(y){s(p.setAlert({type:"danger",message:y.message}))}s(p.setLoading(!1))}},[h]);return u.useEffect(()=>{v()},[h]),e.jsxs("div",{className:`${a.home["this-week-checkIn-dialog"]}`,children:[e.jsxs("div",{className:`${a.home["this-week-checkIn-dialog__head"]}`,children:[e.jsxs(i.Box,{sx:{display:"flex",justifyContent:"space-between"},children:[e.jsx(i.Typography,{variant:"h5",className:`${a.home["this-week-checkIn-dialog__head__title"]}`,children:n("students_missing_a_weekly_check_in")}),e.jsxs("div",{className:`${a.home["this-week-checkIn-dialog__head__icon"]}`,children:[e.jsx("img",{src:p.getStaticFileUrl("/images/home/check-in.png"),alt:n("check-in")})," "]})]}),e.jsx("div",{className:`${a.home["this-week-checkIn-dialog__head__selector"]}`,children:e.jsx(fe.StudentSelector,{setStudentId:d,studentId:h,isDialog:!0})})]}),e.jsx("div",{className:`${a.home["this-week-checkIn-dialog__body"]}`,children:e.jsx(dn,{className:`${a.home["check-in-list"]}`,checkInList:r,onRequestCheckIn:_,showEmptyText:!0,emptyText:`${n(h?"this_student_does_nt_have_missing_check_in":"no_student_missing_weekly_check_in")}`})})]})},mn=p.getStaticFileUrl("/images/image-default.png"),gn=({endTime:n,startTime:s,isDone:t,onView:l,sessionId:c,sessionResultId:h,name:d,avatar:r,isSession:g=!0})=>{const{t:_}=p.useTranslation(),m=u.useMemo(()=>n&&n!==H.DATE_MIN_VALUE?A().diff(A.utc(n).local(),"hours"):void 0,[n]),f=()=>{l(c,h,t)};return e.jsx("div",{children:e.jsxs("div",{className:`${a.home["check-in-item"]}`,children:[e.jsxs("div",{className:"d-flex",style:{gap:"8px"},children:[e.jsx(i.Avatar,{alt:d?.toUpperCase(),src:p.getFileUrl(r)||mn}),e.jsxs("div",{className:"ml-2 ml-sm-3 d-flex flex-column justify-content-center",children:[e.jsx("div",{className:"d-flex align-items-baseline",children:e.jsx(i.Typography,{className:`${a.home["check-in-item__name"]}`,children:d})}),e.jsxs("div",{className:"d-flex flex-row flex-wrap",children:[e.jsx(i.Typography,{className:`${a.home["check-in-item__type"]} text-nowrap`,children:`${_("last")} ${_(g?"check_in":"1-1")}:`}),e.jsxs("div",{className:`${a.home["check-in-item__info"]}`,children:[!!s&&s!==H.DATE_MIN_VALUE&&e.jsx(i.Typography,{className:`${a.home["check-in-item__info__time"]}`,children:p.utcToLocalTime(s,"do MMM yyyy - hh:mm a")}),m!==void 0&&!!n&&e.jsxs("div",{className:`${a.home["check-in-item__info__note"]}`,children:[e.jsx("span",{className:`${a.home["check-in-item__info__note__icon"]}`,children:e.jsx(Ie.ErrorIcon,{})}),e.jsx(i.Typography,{className:`${a.home["check-in-item__info__note__text"]}`,children:m===0?"ended in less than one hour":`ended over ${m>24?24:m} ${m>1?"hours":"hour"} ago`})]})]})]})]})]}),e.jsx("div",{className:`${a.home["check-in-item__action"]}`,children:e.jsx(i.Button,{className:`${a.home["check-in-item__action__btn"]}`,variant:"text",color:"primary",onClick:f,children:_("view_results")})})]})})},pn=({className:n="",checkInList:s,onView:t,showEmptyText:l,emptyText:c,isSession:h})=>{const{t:d}=p.useTranslation();return e.jsxs(i.Grid,{container:!0,spacing:2,className:`${oe.styles["custom-scrollbar"]} ${s.length>5?a.home["check-in-list--scroll"]:""} ${n}`,children:[s.length>0&&s.map((r,g)=>e.jsx("div",{className:`${a.home["check-in-list__item"]} w-100`,children:e.jsx(gn,{onView:t,endTime:r.endTime||H.DATE_MIN_VALUE,startTime:r.startTime||H.DATE_MIN_VALUE,isDone:r.isDone,sessionId:r.sessionId,sessionResultId:r.sessionResultId,avatar:r.avatar||"",name:r.name||"",isSession:h})},g)),!!l&&!s.length&&e.jsx("div",{className:`${a.home["check-in-list__item"]} ${a.home["check-in-list__item--empty"]}`,children:e.jsx(i.Typography,{children:c||d("no_last_or_requested_check_ins")})})]})},xn=n=>{const{open:s,onClose:t}=n;return e.jsx(de.SimpleDialog,{open:s,onClose:t,scroll:"body",maxWidth:"lg",children:e.jsx(fn,{})})},fn=()=>{const{t:n}=p.useTranslation(),s=Q.useDispatch(),t=Q.useSelector(y=>y.common?.user),l=t.roles.includes("Student"),[c,h]=u.useState(0),[d,r]=u.useState([]),[g,_]=u.useState(!1),m=te.useNavigate(),f=u.useCallback(async()=>{if(!l)try{const y=await Be.getStudentSession({studentId:c||void 0,isConversation:!1},t.roles);r(y.data?.map(j=>{const S=j.sessionResults.find(b=>!!b.isTeacherResult),T=j.sessionResults.find(b=>!b.isTeacherResult);return{sessionId:j.sessionId,sessionResultId:S?.id,name:j.fullName,avatar:j.profileImageFileName,startTime:T?.startTime===H.DATE_MIN_VALUE?S?.startTime:T?.startTime,endTime:T?.endTime===H.DATE_MIN_VALUE?S?.endTime:T?.endTime}})||[])}catch(y){s(p.setAlert({type:"danger",message:y.message}))}},[c]),v=(y,j,S)=>{const T=`/${S?"result-session":"start-question"}/${y}/${j}`;m(T)};return u.useEffect(()=>{f()},[c]),e.jsxs("div",{className:`${a.home["this-week-checkIn-dialog"]}`,children:[e.jsxs("div",{className:`${a.home["this-week-checkIn-dialog__head"]}`,children:[e.jsx(i.Box,{sx:{display:"flex",justifyContent:"space-between"},children:e.jsx(i.Typography,{variant:"h5",className:`${a.home["this-week-checkIn-dialog__head__title"]}`,children:n("latest_check_ins")})}),e.jsx(i.Typography,{className:`${a.home["this-week-checkIn-dialog__head__content"]}`,children:n("select_a_student_and_start_a_conversation_with_the_check_in_results")}),e.jsxs("div",{className:`${a.home["this-week-checkIn-dialog__head__selector"]}`,children:[e.jsx(fe.StudentSelector,{setStudentId:h,studentId:c,setIsCheckStudent:_,isDialog:!0}),!g&&!l&&e.jsxs(i.Typography,{className:`${he.myOneToOne["session-box-description"]} ${he.myOneToOne["session-description"]}`,children:[n("you_have_no_student"),"."]})]})]}),e.jsx("div",{className:`${a.home["this-week-checkIn-dialog__body"]}`,children:!!g&&e.jsx(pn,{className:`${a.home["check-in-list"]}`,onView:v,checkInList:d,showEmptyText:!0})})]})},yn=(n,s)=>{const t=Q.useDispatch(),[l,c]=u.useState(!1),[h,d]=u.useState([]),[r,g]=u.useState({}),[_,m]=u.useState(null),[f,v]=u.useState(null),[y,j]=u.useState(!1),[S,T]=u.useState(1),[b,N]=u.useState([]),[E,O]=u.useState([]),[W,q]=u.useState(null),[C,M]=u.useState(""),[L,F]=u.useState(!1),[$,k]=u.useState(!1),D=u.useRef(null),[V,U]=u.useState(!1),I=u.useRef(null),{isRecording:J,record:Y,stop:K,tempTranscript:w}=Vs.useAudioRecorder(R=>{M(R)},D),G=async()=>{if(!(!n||!(s?.gradeLevel||s?.grade)))try{t(p.setLoading(!0));const se=(await x.getJoinedJourneysApi({academicYearId:s?.academicYearId,gradeLevel:s?.gradeLevel})).data;d(se);const ee={};for(const P of se)P.leaderboard?ee[P.id]=X(P.leaderboard):ee[P.id]=[];g(ee),se.length===0?c(!0):c(!1)}catch(B){console.error("Failed to load student journeys:",B)}finally{t(p.setLoading(!1))}},X=R=>{const B=R.slice(0,3),se=R.find(P=>P.isCurrentUser),ee=[...B];return se&&!B.some(P=>P.isCurrentUser)&&ee.push(se),ee},ne=async R=>{try{const B=await x.getLeaderboardApi({academicYearId:s?.academicYearId,schoolLevel:s?.schoolLevel,gradeLevel:s?.gradeLevel}),se=X(B.data);g(ee=>{const P={...ee};for(const Se of h)P[Se.id]=se;return P})}catch(B){console.error(`Failed to fetch leaderboard for journey ${R}`,B)}},ie=()=>{const R=I.current;if(!R)return;const B=R.scrollLeft+R.clientWidth>=R.scrollWidth-40;U(B)},me=()=>{const R=I.current;if(R){const B=R.scrollLeft+R.clientWidth>=R.scrollWidth-40;U(B)}},ve=()=>{c(!1)},ye=async R=>{try{t(p.setLoading(!0)),await x.selectJourneyApi({journeyIds:R,academicYearId:s?.academicYearId??0},{schoolLevel:s?.schoolLevel,gradeLevel:s?.gradeLevel});const se=(await x.getJoinedJourneysApi({academicYearId:s?.academicYearId,gradeLevel:s?.gradeLevel})).data;d(se);const ee={};for(const P of se)P.leaderboard?ee[P.id]=X(P.leaderboard):ee[P.id]=[];g(ee),c(!1)}catch(B){console.error("Failed to select journeys:",B)}finally{t(p.setLoading(!1))}},we=R=>{const B=I.current;if(!B)return;const se=B.getBoundingClientRect().left,ee=Array.from(B.children).filter(ue=>ue instanceof HTMLElement).map(ue=>ue.getBoundingClientRect().left-se+B.scrollLeft);if(ee.length===0)return;const P=2,Se=R==="right"?ee.find(ue=>ue>B.scrollLeft+P)??ee[ee.length-1]:[...ee].reverse().find(ue=>ue<B.scrollLeft-P)??ee[0];B.scrollTo({left:Se,behavior:"smooth"})},ke=R=>({roleTitle:R.name,journeyTag:`${R.name} Journey`,bgClass:R.slug,challengeQuestion:R.activeQuestion?.content||R.description,isDone:!!R.activeQuestion?.isCompleted}),Ce=()=>{if(F(!0),!_){q(null),M(""),F(!1);return}const R=h.find(se=>se.id.toString()===_);if(!R){F(!1);return}const B=R.activeQuestion;B?(q(B),B.isCompleted&&B.previousAnswer?M(B.previousAnswer):M("")):(q(null),M("")),F(!1)},Ne=async R=>{try{const se=(await x.getActiveQuestionApi(R,{academicYearId:s?.academicYearId})).data;d(ee=>ee.map(P=>P.id===R?{...P,activeQuestion:se}:P))}catch(B){console.error(`Failed to reload active question for journey ${R}`,B)}},Z=async()=>{if(!_||!W||$)return;const R=h.find(B=>B.id.toString()===_);if(R)try{k(!0),await x.submitJourneyResponseApi(R.id,{questionId:W.id,responseText:C,gradeLevel:s?.GradeLevel||s?.grade,academicYearId:s?.academicYearId}),await ne(R.id),await Ne(R.id),J!==!1&&K(),M(""),v(_),m(null)}catch(B){console.error("Failed to submit response in dashboard hook",B)}finally{k(!1)}},je=u.useCallback(async()=>{try{t(p.setLoading(!0));const R=s?.gradeLevel||s?.grade,B=s?.academicYearId,se=await x.getAvailableJourneysApi({gradeLevel:R,academicYearId:B});N(se.data);const ee=se.data.filter(P=>P.isJoined).map(P=>P.id);O(ee)}catch(R){console.error("Failed to fetch available journeys:",R)}finally{t(p.setLoading(!1))}},[t,s]);return u.useEffect(()=>{G()},[n,s,t]),u.useEffect(()=>{const R=setTimeout(me,100);return()=>clearTimeout(R)},[h]),u.useEffect(()=>{_&&Ce()},[_]),u.useEffect(()=>{l?je():T(1)},[l,je]),{isOpenJourneyWelcome:l,setIsOpenJourneyWelcome:c,activeJourneys:h,setActiveJourneys:d,leaderboards:r,selectedJourneyIdForShareThoughts:_,setSelectedJourneyIdForShareThoughts:m,thankYouJourneyId:f,setThankYouJourneyId:v,handleCloseJourneyWelcome:ve,handleContinueWelcome:ye,getJourneyThemeConfig:ke,isAtEnd:V,carouselRef:I,handleScroll:ie,scrollCarousel:we,isOpenEarnPoints:y,setIsOpenEarnPoints:j,activeQuestion:W,thoughts:C,setThoughts:M,loadingActiveQuestion:L,submittingShareThoughts:$,textareaRef:D,isRecording:J,record:Y,stop:K,tempTranscript:w,handleSubmitShareThoughts:Z,journeyStep:S,setJourneyStep:T,availableJourneys:b,selectedJourneyIds:E,handleStartJourneySelection:()=>{T(2)},handleToggleSelectJourney:R=>{O(B=>B.includes(R)?B.filter(se=>se!==R):[...B,R])},handleFinishJourneySelection:async()=>{await ye(E)}}},jn=({quests:n})=>e.jsxs(i.Grid,{className:`${a.home["weekly-quests__step"]}`,children:[e.jsx(i.Grid,{className:`${a.home["weekly-quests__step-item"]}`,children:n.map((s,t)=>s?e.jsx(i.Grid,{className:`${a.home["weekly-quests__step-item__item"]} ${a.home["weekly-quests__step-item__checked"]}`,children:e.jsx(Js.CheckIcon,{className:`${a.home["weekly-quests__step-item__icon"]}`})},t):e.jsx(i.Typography,{className:`${a.home["weekly-quests__step-item__item"]}`,children:t+1},t))}),e.jsx(i.Typography,{className:`${a.home["weekly-quests__step-weekly"]}`,children:`${n.filter(s=>s).length??0} / ${n.length??0} completed`})]}),vn=({description:n,icon:s,classString:t="",status:l,onCompleteTheQuest:c,source:h,onGetTitleTheQuest:d})=>{const r=d(h)??null;return e.jsxs(i.Grid,{item:!0,className:`${a.home["weekly-quests__quests__item"]} ${a.home[t]}`,children:[e.jsxs(i.Grid,{className:`${a.home["weekly-quests__quests__item-right"]} h-100 d-flex flex-column justify-content-between`,children:[e.jsxs(i.Grid,{children:[e.jsx(i.Typography,{className:`${a.home["weekly-quests__quests__item-right__title"]}`,children:r?.isPlp?"Personal Learning Plan":r?.title}),e.jsx(i.Typography,{className:`${a.home["weekly-quests__quests__item-right__description"]}`,children:n}),e.jsx(i.Typography,{hidden:H.StatusWeeklyQuest[l]!=H.StatusWeeklyQuest.Completed,className:`${a.home["weekly-quests__quests__item-right__detail"]}`,children:`Good Job! You have completed "${r?.title}" in the ${r?.in} section.`})]}),!!r&&H.StatusWeeklyQuest[l]!=H.StatusWeeklyQuest.Completed&&e.jsxs(i.Button,{onClick:()=>c(r.href,r.isPlp),className:`${a.home["weekly-quests__quests__item-right__action"]}`,children:[e.jsx(i.Typography,{className:`${a.home["weekly-quests__quests__item-right__action__content"]}`,children:"complete the quest"}),e.jsx(rs.ArrowForwardIcon,{className:`${a.home["weekly-quests__quests__item-right__action__icon"]}`})]})]}),e.jsxs(i.Grid,{className:`${a.home["weekly-quests__quests__icon"]}`,children:[e.jsx("img",{loading:"lazy",hidden:H.StatusWeeklyQuest[l]!=H.StatusWeeklyQuest.Completed,src:"images/done-quest-icon.svg",className:`${a.home["weekly-quests__quests__icon__done-icon"]}`}),e.jsx("img",{loading:"lazy",src:`/images/${s}`})]})]})},es=()=>{const{weeklyQuests:n,handleGetStepStatus:s,handleCompleteTheQuest:t,handleCheckOpenModelHomePage:l,isUnCompletedAllQuests:c,handleGetTitleTheQuest:h}=Us.useWeeklyQuest();return u.useEffect(()=>{l(n)},[n]),e.jsxs(i.Grid,{className:`${a.home["weekly-quests"]}`,children:[e.jsxs(i.Grid,{className:`${a.home["weekly-quests__header"]}`,children:[e.jsxs("div",{className:"d-flex align-items-center flex-wrap",style:{gap:"8px"},children:[e.jsx(i.Typography,{className:`${a.home["weekly-quests__header__title"]}`,children:"Weekly Quests"}),e.jsxs("span",{className:x.styles["journey-active-card__challenge-badge"],children:[e.jsx("img",{src:"/images/xp-icon.png",className:x.styles["journey-active-card__challenge-badge--icon"]}),"+20 XP"]})]}),e.jsx(jn,{quests:s(n)})]}),e.jsx(i.Grid,{hidden:!c,container:!0,spacing:2,className:`${a.home["weekly-quests__quests"]}`,children:n.map((d,r)=>e.jsx(i.Grid,{item:!0,xs:12,sm:6,children:e.jsx(vn,{source:d.source,onGetTitleTheQuest:h,description:d.title,icon:z.questIcons[r],status:d.status.toString(),classString:H.StatusWeeklyQuest[d.status]==H.StatusWeeklyQuest.Completed?"item-success":"",onCompleteTheQuest:t})},d.id))}),e.jsxs(i.Grid,{hidden:c,container:!0,className:`${a.home["weekly-quests__completed-all"]}`,children:[e.jsx("img",{loading:"lazy",src:"/images/congratulation-image.svg",className:`${a.home["weekly-quests__completed-all__image"]}`}),e.jsx(i.Typography,{className:`${a.home["weekly-quests__completed-all__title"]}`,children:"Good Job!"}),e.jsx(i.Typography,{className:`${a.home["weekly-quests__completed-all__description"]}`,children:"You have completed all of the weekly quests!"})]})]})},wn=n=>{const s=Q.useDispatch(),t=Q.useSelector(L=>L?.common.user),l=t.studentId,[c,h]=u.useState(!1),[d,r]=u.useState([]),g=te.useNavigate(),[_,m]=u.useState(!1),[f,v]=u.useState({name:""}),[y,j]=u.useState(0),S=u.useCallback(async()=>{h(!0),n&&n(L=>({...L,goals:!1,academicYears:!1}));try{const L=await Ks.getAllItem({studentId:l,roles:t.roles,academicYearId:y});r(L.data)}catch(L){s(p.setAlert({type:"danger",message:L.response?.data?.title||L.message}))}h(!1),n&&n(L=>({...L,goals:!0,academicYears:!0}))},[y]),{classFontSize:T}=zs.useFontStyles(),b=L=>{if(L.length===0)return;const F=L.filter(k=>k.status==="in-progress").length,$=L.filter(k=>k.status==="completed").length;return $===L.length?"completed":F===0&&$===0?"not-yet-started":"in-progress"},N=()=>{g("/personal-learning-plan")},E=L=>{L&&(v(L),m(!0))},O=()=>{m(!1),v({name:""})},W=L=>{if(L)return L.split(" ").map(F=>F.toLocaleLowerCase()).join("-")},q=()=>d.map(L=>({...L,status:b(L.checkPoints?.map(F=>({...F,status:W(F?.status)}))||[])})),C=u.useMemo(()=>q(),[d]),M=async()=>{h(!0),n&&n(F=>({...F,academicYears:!1}));try{var L={pageSize:-1,currentPage:1};const k=(await Qs.getAcademicYearList(L)).data.items.map(D=>({id:D.id,title:`${A(D.startTime).year()} - ${A(D.endTime).year()} (${A(D.startTime).format("MM/YYYY")} - ${A(D.endTime).format("MM/YYYY")})`,startTime:D.startTime,endTime:D.endTime,isCurrent:D.isCurrent})).find(D=>D.isCurrent);k&&j(k.id)}catch(F){s(p.setAlert({type:"danger",message:F.response?.data?.title||F.message}))}h(!1),n&&n(F=>({...F,academicYears:!0}))};return u.useEffect(()=>{y?S():M()},[y,n]),{mappedGoals:C,isLoading:c,getGoalStatus:b,handleView:N,handleViewGoal:E,openViewGoal:_,setOpenViewGoal:m,goalSelected:f,handleClose:O,classFontSize:T}},kn="_header_1yk65_11",Cn="_left_1yk65_19",Nn="_title_1yk65_26",bn="_detail_1yk65_31",Sn="_body_1yk65_38",Tn="_item_1yk65_43",In="_number_1yk65_50",Ln="_time_1yk65_61",$n="_content_1yk65_66",le={"goal-modal":"_goal-modal_1yk65_1",header:kn,left:Cn,title:Nn,detail:bn,body:Sn,item:Tn,number:In,time:Ln,content:$n,"target-time":"_target-time_1yk65_76"},Dn=({open:n,onClose:s,goal:t,goalStatus:l})=>{const{t:c}=p.useTranslation(),{name:h,detail:d,checkPoints:r,baseLineChecked:g}=t;return e.jsx(de.SimpleDialog,{open:n,onClose:s,maxWidth:"sm",scroll:"body",contentClassName:`${r?.length?"d-flex flex-column":""}`,children:e.jsxs("div",{className:le["goal-modal"],children:[e.jsxs("div",{className:le.header,children:[e.jsxs("div",{className:le.left,children:[e.jsx("div",{className:le.title,children:h}),e.jsxs("div",{className:le.detail,children:[e.jsxs("b",{children:[c("detail"),":  "]})," ",d," "]}),e.jsxs("div",{className:le.detail,children:[e.jsxs("b",{children:[c("baseline"),":  "]})," ",g]})]}),e.jsx(a.LearningPlanChip,{status:l})]}),e.jsx("div",{className:le.body,children:r?.map((_,m)=>e.jsxs("div",{className:le.item,children:[e.jsxs("div",{className:le.number,children:[c("target")," ",m+1]}),e.jsx("div",{className:le.title,children:_.text}),e.jsxs("div",{className:le.time,children:[e.jsxs("div",{className:le.content,children:[_.time&&e.jsxs("div",{className:le["target-time"],children:[e.jsx(a.FlagIcon,{}),p.utcToLocalTime(_.time,"dd-MM-yyyy")]}),_.endTime&&e.jsxs("div",{className:le["target-time"],children:[e.jsx(a.AimIcon,{}),p.utcToLocalTime(_.endTime,"dd-MM-yyyy")]})]}),_.status&&e.jsx(a.LearningPlanChip,{status:z.convertGoalStatusToCardStatus(_.status)})]})]},_.id))})]})})},ss=({setLoadingComplete:n})=>{const{t:s}=p.useTranslation(),{mappedGoals:t,isLoading:l,handleView:c,handleViewGoal:h,goalSelected:d,openViewGoal:r,handleClose:g,classFontSize:_}=wn(n);return e.jsxs("div",{className:`d-flex flex-column ${a.home[_]}`,style:{width:"100%"},children:[e.jsxs("div",{className:"d-flex justify-content-between align-items-center mb-3",children:[e.jsxs("div",{className:"d-flex align-items-center flex-wrap",style:{gap:"12px"},children:[e.jsx(i.Typography,{className:a.home["checkin-title"],children:s("my_goals")}),e.jsxs("span",{className:a.home["goals-view-all"],onClick:c,children:[s("view_all_goals"),e.jsx(ae.ArrowIcon,{fill:"#316CD9",style:{width:"12px",height:"12px"}})]})]}),e.jsx("div",{className:`${a.home["today-schedule__icon"]}`,children:e.jsx("img",{src:`${p.getStaticFileUrl("/images/personal-icon-quests.svg")}`,alt:s("my_goals")})})]}),e.jsxs("div",{className:a.home["goals-list-row"],children:[t.length>0?t.map((m,f)=>{const v=m.checkPoints?.length||0,y=m.checkPoints?.filter(S=>(S.status?S.status.toLowerCase().replace(" ","-"):"")==="completed").length||0,j=m.status||"not-yet-started";return e.jsxs("div",{onClick:()=>h(m),className:a.home["goal-item-card"],children:[e.jsxs("div",{children:[e.jsxs("div",{className:"d-flex justify-content-between align-items-center mb-2",children:[e.jsxs("span",{className:a.home["goal-item-label"],children:["Goal ",f+1]}),e.jsxs("span",{className:a.home["goal-item-progress"],children:[y,"/",v]})]}),e.jsx(i.Typography,{className:a.home["goal-item-name"],children:m.name})]}),e.jsxs("div",{className:"mt-2",children:[j==="in-progress"&&e.jsxs("div",{className:`${a.home["status-badge"]} ${a.home["status-badge--in-progress"]}`,children:[e.jsx("span",{className:a.home["status-badge__dot"]}),e.jsx("span",{children:"In Progress"})]}),j==="not-yet-started"&&e.jsxs("div",{className:`${a.home["status-badge"]} ${a.home["status-badge--not-started"]}`,children:[e.jsx("span",{className:a.home["status-badge__dots"],children:"•••"}),e.jsx("span",{children:"Not Started"})]}),j==="completed"&&e.jsxs("div",{className:`${a.home["status-badge"]} ${a.home["status-badge--completed"]}`,children:[e.jsx("span",{className:a.home["status-badge__check"],children:"✓"}),e.jsx("span",{children:"Completed"})]})]})]},m.id)}):e.jsxs(i.Typography,{style:{fontStyle:"italic",color:"#848484",fontSize:"14px",padding:"16px 0"},children:[s("no_data"),"!"]}),l&&e.jsx(is,{})]}),e.jsx(Dn,{open:r,onClose:g,goal:d,goalStatus:d?.status})]})},An=(n,s)=>{const t=n?.trim()||"";return t==="World Wonder"||s===1?"explore_the_world":t==="Pop & Art"||s===2?"stay_in_the_know":t==="Music"||s===3?"feel_the_rhythm":t==="Sports"||s===4?"move_your_body":t==="Technology"||s===5?"build_the_future":t==="Community Cosmos"||s===6?"connect_with_others":"discover"},qn=({open:n,onClose:s,step:t,availableJourneys:l,selectedIds:c,onStart:h,onToggleSelect:d,onContinue:r})=>{const{t:g}=p.useTranslation(),_=`${t===1?x.styles["journey-dialog-content-step1"]:x.styles["journey-dialog-content-step2"]} ${x.styles["journey-dialog-content-scroll"]}`;return e.jsx(de.SimpleDialog,{open:n,onClose:s,scroll:"body",maxWidth:"lg",noPaddingTop:!0,contentClassName:_,children:e.jsxs("div",{className:x.styles["journey-container"],children:[e.jsx("div",{className:x.styles["journey-header"],children:e.jsx(i.Typography,{variant:"h4",className:x.styles["journey-header__title"],children:g(t===1?"welcome_explorer":"choose_your_journeys")})}),t===1&&e.jsxs("div",{className:x.styles["journey-welcome"],children:[e.jsxs(i.Typography,{className:x.styles["journey-welcome__subtitle"],children:[g("your_daily_check_ins_are_now"),e.jsx("span",{className:x.styles["journey-welcome__highlight"],children:g("legendary_journeys")})]}),e.jsxs("div",{className:x.styles["journey-welcome__list"],children:[e.jsxs("div",{className:x.styles["journey-welcome__item"],children:[e.jsx("span",{className:x.styles["journey-welcome__emoji"],children:e.jsx("img",{src:"/images/world-wonder-icon.png",alt:"",style:{width:"28px",height:"28px",objectFit:"contain"}})}),e.jsx(i.Typography,{className:x.styles["journey-welcome__text"],children:g("pick_your_path_explore")})]}),e.jsxs("div",{className:x.styles["journey-welcome__item"],children:[e.jsx("span",{className:x.styles["journey-welcome__emoji"],children:e.jsx("img",{src:"/images/magic-icon.png",alt:"",style:{width:"28px",height:"28px",objectFit:"contain"}})}),e.jsx(i.Typography,{className:x.styles["journey-welcome__text"],children:g("earn_xp_just_for_being_you")})]}),e.jsxs("div",{className:x.styles["journey-welcome__item"],children:[e.jsx("span",{className:x.styles["journey-welcome__emoji"],children:e.jsx("img",{src:"/images/cup-icon.png",alt:"",style:{width:"28px",height:"28px",objectFit:"contain"}})}),e.jsx(i.Typography,{className:x.styles["journey-welcome__text"],children:g("grow_from_sprout_to_hero")})]})]}),e.jsx(i.Button,{variant:"contained",className:x.styles["journey-welcome__button"],onClick:h,endIcon:e.jsx(ae.ArrowIcon,{fill:"#FFF",style:{width:"20px",height:"20px"}}),children:g("start_my_journey")})]}),t===2&&e.jsxs("div",{className:x.styles["journey-choose"],children:[e.jsx(i.Typography,{className:x.styles["journey-choose__subtitle"],children:g("where_do_you_want_to_grow_today")}),e.jsx("div",{className:x.styles["journey-choose__grid"],children:l.map(m=>{const f=c.includes(m.id),v=An(m.name,m.id);return e.jsxs("div",{className:`${x.styles["journey-choose__card"]} ${f?x.styles["journey-choose__card--selected"]:""}`,onClick:()=>d(m.id),children:[e.jsx("div",{className:x.styles["journey-choose__card-check"],children:"✓"}),e.jsx("div",{className:`${x.styles["journey-choose__icon-wrapper"]} ${x.styles[m.slug]}`,children:e.jsx("img",{src:m.icon||"",alt:m.name,style:{width:"40px",height:"40px",objectFit:"contain"}})}),e.jsx(i.Typography,{variant:"h6",className:x.styles["journey-choose__card-title"],children:m.name}),e.jsx(i.Typography,{variant:"subtitle2",className:x.styles["journey-choose__card-tag"],children:g(v)}),e.jsx(i.Typography,{variant:"body2",className:x.styles["journey-choose__card-desc"],children:m.description})]},m.id)})}),c.length===0&&e.jsx(i.Typography,{className:x.styles["journey-choose__footer-text"],children:g("select_one_or_multiple_journeys_to_get_started")}),c.length>0&&e.jsx(i.Button,{variant:"contained",className:x.styles["journey-choose__action-btn"],onClick:r,endIcon:e.jsx(ae.ArrowIcon,{fill:"#FFF",style:{width:"20px",height:"20px"}}),children:`${g("continue_with")} ${c.length} ${c.length===1?g("journey"):g("journeys")}`})]})]})})},Rn=({open:n,journey:s,onClose:t,loading:l,activeQuestion:c,thoughts:h,setThoughts:d,textareaRef:r,isRecording:g,record:_,stop:m,tempTranscript:f,onSubmit:v,submitting:y=!1})=>{const{t:j}=p.useTranslation();if(!s)return null;if(l)return e.jsx(de.SimpleDialog,{open:n,onClose:t,maxWidth:"sm",children:e.jsx("div",{style:{padding:"32px",textAlign:"center"},children:e.jsx(i.Typography,{children:j("loading_challenge")})})});const S=s?{roleTitle:s.name,bgClass:s.slug,iconUrl:s.icon,challengeQuestion:c?.content||s.description}:null;return S?e.jsx(de.SimpleDialog,{open:n,onClose:t,maxWidth:"md",contentClassName:`${x.styles["share-thoughts-dialog-content"]} ${x.styles["journey-dialog-content-scroll"]}`,noPaddingTop:!0,children:e.jsxs("div",{className:`${x.styles["share-thoughts-dialog"]} ${x.styles[S.bgClass]}`,children:[e.jsx("div",{className:x.styles["share-thoughts-dialog__header"],children:e.jsxs(i.Typography,{className:x.styles["share-thoughts-dialog__title"],children:[j("daily_challenge_for")," ",e.jsx("img",{src:S.iconUrl,alt:S.roleTitle,className:x.styles["share-thoughts-dialog__title-icon"]})," ",S.roleTitle]})}),e.jsxs("div",{className:x.styles["share-thoughts-dialog__card"],children:[e.jsx(i.Typography,{className:x.styles["share-thoughts-dialog__question"],children:c?.content||S.challengeQuestion}),e.jsxs("div",{className:x.styles["share-thoughts-dialog__input-wrapper"],children:[e.jsx("textarea",{ref:r,className:x.styles["share-thoughts-dialog__textarea"],placeholder:c?.isCompleted?j("you_have_completed_all_questions_in_this_journey"):j("share_your_thoughts_here_there_are_no_wrong_answers"),value:`${h}${f}`,onChange:T=>d(T.target.value),disabled:c?.isCompleted,rows:3}),!c?.isCompleted&&(g!==!1?e.jsx("img",{src:p.getStaticFileUrl("/images/recording-dot.png"),className:x.styles["share-thoughts-dialog__mic-icon"],onClick:m,alt:"Recording"}):e.jsx("img",{src:p.getStaticFileUrl("/teacher-student/icons/icon-micro.png"),className:x.styles["share-thoughts-dialog__mic-icon"],onClick:()=>_(),alt:"Microphone"}))]}),e.jsxs("div",{className:x.styles["share-thoughts-dialog__footer"],children:[e.jsx(i.Typography,{className:x.styles["share-thoughts-dialog__footer-text"],children:c?.isCompleted?j("great_job_completing_your_journey"):j("your_thoughts_matter_take_your_time")}),e.jsxs(i.Button,{variant:"contained",className:x.styles["share-thoughts-dialog__submit-btn"],onClick:v,disabled:y||c?.isCompleted||!h.trim()&&!f.trim(),children:[y?e.jsx(i.CircularProgress,{size:16,color:"inherit"}):e.jsx("img",{src:"/images/magic-icon.png",alt:"",className:x.styles["share-thoughts-dialog__submit-btn--icon"]}),c?.isCompleted?j("completed"):j("submit_earn_xp")]})]})]})]})}):null},En=()=>{const n=te.useNavigate(),{t:s,isStudent:t,isTeacher:l,currentUser:c,dataCardTotal:h,isOpenCalendarDialog:d,currentUserId:r,isOpenOneToOneDialog:g,isOpenThisWeekCheckInDialog:_,isOpenThisWeekOneToOneDialog:m,isOpenLatestCheckInDialog:f,isOpenMissingStudentDialog:v,isCheckStudents:y,studentSelectedId:j,studentSelected:S,classFontSize:T,setStudentSelected:b,setStudentSelectedId:N,setCheckStudents:E,handleAddNewStudent:O,handleViewStudent:W,handleCloseOneToOneDialog:q,handleStartOrBookOneToOne:C,handleCloseThisWeekCheckInDialog:M,handleOpenCalendarDialog:L,handleCloseCalendarDialog:F,handleOpenThisWeekOneToOneDialog:$,handleCloseThisWeekOneToOneDialog:k,handleOpenLatestCheckInDialog:D,handleCloseLatestCheckInDialog:V,handleOpenMissingStudentDialog:U,handleCloseMissingStudentDialog:I,handleOpenThisWeekCheckInDialog:J,setLoadingComplete:Y}=St(),{isOpenJourneyWelcome:K,setIsOpenJourneyWelcome:w,activeJourneys:G,leaderboards:X,selectedJourneyIdForShareThoughts:ne,setSelectedJourneyIdForShareThoughts:ie,thankYouJourneyId:me,setThankYouJourneyId:ve,handleCloseJourneyWelcome:ye,getJourneyThemeConfig:we,isAtEnd:ke,carouselRef:Ce,handleScroll:Ne,scrollCarousel:Z,isOpenEarnPoints:je,setIsOpenEarnPoints:be,activeQuestion:Oe,thoughts:Ye,setThoughts:R,loadingActiveQuestion:B,submittingShareThoughts:se,textareaRef:ee,isRecording:P,record:Se,stop:ue,tempTranscript:Cs,handleSubmitShareThoughts:Ns,journeyStep:bs,availableJourneys:Ss,selectedJourneyIds:Ts,handleStartJourneySelection:Is,handleToggleSelectJourney:Ls,handleFinishJourneySelection:$s}=yn(t,c),Ds=A(),As=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;return e.jsxs(u.Fragment,{children:[e.jsxs(i.Grid,{container:!0,spacing:4,className:`${a.home.container} ${a.home[T]}`,children:[t&&G.length>0&&e.jsx(i.Grid,{item:!0,xs:12,children:e.jsxs("div",{className:x.styles["active-journeys-container"],children:[e.jsxs("div",{className:x.styles["greeting-section"],children:[e.jsx(i.Typography,{className:x.styles["greeting-section__title"],children:`Hi, ${c?.firstName||c?.name||"Student"} 👋`}),e.jsx(i.Typography,{className:x.styles["greeting-section__subtitle"],children:s("ready_for_an_adventure")})]}),e.jsxs("div",{className:x.styles["active-journeys-header"],children:[e.jsxs("div",{className:x.styles["active-journeys-header__left"],children:[e.jsx(i.Typography,{className:x.styles["active-journeys-header__title"],children:s("your_active_journeys")}),e.jsxs("div",{className:x.styles["active-journeys-header__links"],children:[e.jsxs("span",{className:x.styles["active-journeys-header__link"],onClick:()=>w(!0),children:[s("other_journeys")," ",e.jsx(ae.ArrowIcon,{fill:"#316CD9",className:x.styles["active-journeys-header__link--icon"]})]}),e.jsxs("span",{className:x.styles["active-journeys-header__link"],onClick:()=>be(!0),children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{marginRight:"4px"},children:e.jsx("polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"})}),s("how_do_i_earn_points")]})]})]}),G.length>1&&e.jsxs("div",{className:x.styles["active-journeys-header__arrows"],children:[e.jsx("button",{className:x.styles["active-journeys-header__arrow-btn"],onClick:()=>Z("left"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"15 18 9 12 15 6"})})}),e.jsx("button",{className:x.styles["active-journeys-header__arrow-btn"],onClick:()=>Z("right"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"9 18 15 12 9 6"})})})]})]}),e.jsx("div",{className:x.styles["active-journeys-carousel"],ref:Ce,onScroll:Ne,"data-at-end":ke?"true":"false",children:G.map(ce=>{const _e=we(ce),We=(X[ce.id]||[]).find(ge=>ge.isCurrentUser)?.totalXp||0,He=1e3,qs=Math.min(100,Math.round(We/He*100));return e.jsxs("div",{className:`${x.styles["journey-active-card"]} ${x.styles[_e.bgClass]}`,children:[e.jsxs("div",{className:x.styles["journey-active-card__left"],children:[e.jsxs("div",{className:x.styles["journey-active-card__top"],children:[e.jsx("div",{className:x.styles["journey-active-card__icon"],children:e.jsx("img",{src:ce.icon,alt:_e.roleTitle,style:{width:"40px",height:"40px",objectFit:"contain"}})}),e.jsxs("div",{className:x.styles["journey-active-card__body"],children:[e.jsxs("div",{className:x.styles["journey-active-card__meta"],children:[e.jsxs(i.Typography,{className:x.styles["journey-active-card__meta-tag"],children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{marginRight:"4px",verticalAlign:"middle"},children:[e.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),e.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),s("today_you_are")]}),e.jsx(i.Typography,{className:x.styles["journey-active-card__meta-title"],children:_e.roleTitle}),e.jsxs(i.Typography,{className:x.styles["journey-active-card__meta-subtitle"],children:[_e.journeyTag,e.jsxs("span",{onClick:()=>n(`/journey/${ce.id}`),className:x.styles["journey-active-card__meta-subtitle__action"],children:[s("view_details"),e.jsx(ae.ArrowIcon,{fill:"#316CD9",className:x.styles["journey-active-card__meta-subtitle__action--icon"]})]})]})]}),e.jsxs("div",{className:x.styles["journey-active-card__progress"],children:[e.jsxs("div",{className:x.styles["journey-active-card__progress-header"],children:[e.jsxs("span",{className:x.styles["journey-active-card__progress-header__title"],children:[e.jsx("img",{src:"/images/xp-icon.png",className:x.styles["journey-active-card__progress-header__title--icon"]}),s("xp_progress")]}),e.jsxs("span",{className:"journey-active-card__progress-header__percent",children:[We," / ",e.jsx("span",{className:"journey-active-card__progress-header__percent--total",children:He})]})]}),e.jsx("div",{className:x.styles["journey-active-card__progress-bar"],children:e.jsx("div",{className:x.styles["journey-active-card__progress-fill"],style:{width:`${qs}%`}})}),e.jsx("span",{className:x.styles["journey-active-card__progress-desc"],children:s("you_are_on_your_way")})]})]})]})," ",e.jsxs("div",{className:x.styles["journey-active-card__challenge"],children:[e.jsxs("div",{className:x.styles["journey-active-card__challenge-info"],children:[e.jsxs("div",{className:x.styles["journey-active-card__challenge-header"],children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{marginRight:"4px",verticalAlign:"middle"},children:[e.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),e.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),e.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),e.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]}),e.jsx("span",{className:x.styles["journey-active-card__challenge-header--text"],children:s("daily_challenge")}),_e.isDone?e.jsx("span",{className:x.styles["journey-active-card__challenge-badge-done"],children:e.jsx(Xs.Done,{className:x.styles["journey-active-card__challenge-badge-done--icon"]})}):e.jsxs("span",{className:x.styles["journey-active-card__challenge-badge"],children:[e.jsx("img",{src:"/images/xp-icon.png",className:x.styles["journey-active-card__challenge-badge--icon"]}),"+5 XP"]})]}),e.jsx(i.Typography,{className:x.styles["journey-active-card__challenge-question"],children:_e.challengeQuestion})]}),!_e.isDone&&e.jsxs(i.Button,{variant:"contained",className:x.styles["journey-active-card__challenge-btn"],onClick:()=>ie(ce.id.toString()),children:["SHARE YOUR THOUGHTS",e.jsx(ae.ArrowIcon,{fill:"#FFF",className:"journey-active-card__challenge-btn--icon"})]}),!_e.isDone&&e.jsx("svg",{className:x.styles["journey-active-card__challenge-help-icon"],children:e.jsx("use",{href:"/images/message-circle-question.svg"})}),_e.isDone&&e.jsx("img",{src:"/images/journey-success.png",className:x.styles["journey-active-card__done-image"]})]})]}),e.jsxs("div",{className:x.styles["journey-active-card__right"],children:[e.jsxs(i.Typography,{className:x.styles["journey-active-card__leaderboard-title"],children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{marginRight:"4px",verticalAlign:"middle"},children:[e.jsx("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),e.jsx("circle",{cx:"9",cy:"7",r:"4"}),e.jsx("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),e.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]}),s("journey_leaderboard")]}),e.jsx("div",{className:x.styles["journey-active-card__leaderboard-list"],children:(X[ce.id]||[]).map((ge,Rs)=>e.jsx("div",{className:`${x.styles["journey-active-card__leaderboard-item"]} ${ge.isCurrentUser?x.styles["item-is-you"]:""}`,children:e.jsxs("div",{className:x.styles["journey-active-card__user-info"],children:[e.jsx("span",{className:x.styles["journey-active-card__rank"],children:`#${ge.rank}`}),e.jsx("div",{className:x.styles["journey-active-card__avatar-placeholder"],children:ge.studentName.charAt(0)}),e.jsxs("div",{className:x.styles["journey-active-card__info"],children:[e.jsx("span",{className:x.styles["journey-active-card__info__username"],children:ge.isCurrentUser?e.jsx("span",{className:x.styles["journey-active-card__info__user-badge-you"],children:s("you")}):e.jsxs("span",{children:[" ",ge.studentName," "]})}),e.jsxs("span",{className:x.styles["journey-active-card__xp"],children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{marginRight:"2px",verticalAlign:"middle"},children:e.jsx("polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"})}),`${ge.totalXp} XP`]})]})]})},Rs))})]})]},ce.id)})})]})}),t?e.jsxs(e.Fragment,{children:[e.jsx(i.Grid,{item:!0,xs:12,md:5,lg:4,className:"d-flex flex-column",children:e.jsxs("div",{className:`${oe.styles["block-container"]} ${a.home["student-left-container"]}`,children:[e.jsxs("div",{style:{paddingBottom:"32px"},children:[e.jsxs("div",{className:"d-flex justify-content-between align-items-start mb-3",children:[e.jsxs("div",{className:"d-flex align-items-center flex-wrap",style:{gap:"8px"},children:[e.jsx(i.Typography,{className:a.home["checkin-title"],children:s("start_check_in")}),e.jsxs("span",{className:x.styles["journey-active-card__challenge-badge"],children:[e.jsx("img",{src:"/images/xp-icon.png",className:x.styles["journey-active-card__challenge-badge--icon"]}),"+5 XP"]})]}),e.jsx("div",{style:{flexShrink:0},children:e.jsx("img",{src:"/images/calender-icon.png",alt:s("start_check_in")})})]}),e.jsx(i.Typography,{className:a.home["checkin-content"],children:s("start_your_check-in_and_you_can_also_request_a_conversation_with_your_teacher_after")}),e.jsxs(i.Button,{variant:"contained",color:"primary",onClick:C,className:a.home["checkin-action-btn"],children:[e.jsx("span",{children:s("start")}),e.jsx(ae.ArrowIcon,{fill:"#FFF",style:{width:"16px",height:"16px"}})]})]}),e.jsx("div",{className:a.home["student-left-divider"]}),e.jsx("div",{children:e.jsx(ss,{setLoadingComplete:Y})})]})}),e.jsx(i.Grid,{item:!0,xs:12,md:7,lg:8,className:"d-flex flex-column",children:e.jsx(i.Grid,{container:!0,spacing:4,className:"flex-grow-1",children:e.jsx(i.Grid,{item:!0,xs:12,className:"d-flex flex-column",children:e.jsx("div",{className:`${oe.styles["block-container"]} ${a.home["student-left-container"]}`,children:e.jsx(es,{})})})})})]}):e.jsxs(e.Fragment,{children:[e.jsx(i.Grid,{item:!0,xs:12,lg:8,children:e.jsxs(i.Grid,{container:!0,spacing:4,children:[e.jsx(i.Grid,{item:!0,xs:12,children:e.jsxs(i.Grid,{container:!0,spacing:2,children:[e.jsx(i.Grid,{item:!0,xs:12,sm:t?12:6,lg:12,children:e.jsxs(i.Grid,{container:!0,className:`${oe.styles["block-container"]} ${a.home["home-block--left"]} flex-nowrap ${a.home["conference-block"]}`,children:[e.jsxs("div",{className:`${a.home["conference-block__main"]}`,children:[e.jsx("div",{className:`${a.home["conference-block__image"]}`,children:e.jsx("img",{src:"/images/home/calendar.png",alt:s("1_1_conversation")})}),e.jsxs("div",{className:"flex-grow-1",children:[e.jsx(i.Typography,{className:`${a.home["conference-block__title"]}`,children:s(t?"start_check_in":"start_1_1_conversation")}),e.jsx(i.Typography,{className:`${a.home["conference-block__content"]}`,children:s(t?"start_your_check-in_and_you_can_also_request_a_conversation_with_your_teacher_after":"select_a_student_and_start_a_1-1_conversation_from_a_check-in_or_ask_the_student_to_check-in_before")})]})]}),e.jsxs("div",{className:`${a.home["conference-block__groupBtn"]} flex-column flex-lg-row align-items-center algn-items-sm-start align-items-lg-center`,children:[e.jsx("div",{className:`${a.home["conference-block__middle"]}`,children:e.jsx(i.Button,{variant:"text",color:"primary",endIcon:e.jsx(ls.CalendarIcon,{}),className:`${a.home["conference-block__book-for-later"]} text-nowrap`,onClick:C,children:s("book_for_later")})}),e.jsx("div",{children:e.jsx(i.Button,{variant:"contained",color:"primary",endIcon:e.jsx(ae.ArrowIcon,{fill:"#FFF"}),className:`${a.home["conference-block__action"]} w-100`,onClick:C,children:s("start")})})]})]})}),!t&&e.jsx(i.Grid,{item:!0,xs:12,sm:6,lg:12,children:e.jsx(i.Grid,{container:!0,className:`${oe.styles["block-container"]} ${a.home["home-block--left"]} justify-content-start justify-content-lg-between ${a.home["conference-block"]}`,children:e.jsxs("div",{className:"flex-grow-1",children:[e.jsxs(i.Grid,{container:!0,className:"align-items-center flex-row-reverse flex-xl-row flex-nowrap flex-xl-wrap",children:[e.jsx("div",{className:`${a.home["conference-block__image"]} mb-auto`,children:e.jsx("img",{src:"/images/home/write.png",alt:s("view_student")})}),e.jsxs("div",{className:"d-flex justify-content-between align-items-start flex-grow-1 flex-column flex-xl-row",children:[e.jsxs("div",{className:"mb-4 mb-xl-0",children:[e.jsx(i.Typography,{className:`${a.home["conference-block__title"]}`,children:s("view_a_student")}),e.jsxs(i.Typography,{className:`${a.home["conference-block__content"]}`,children:[s("select_a_student_to_see_their_profile_and_learning_plan"),"."]})]}),e.jsx("div",{className:"ml-3 ml-xl-0 align-self-center",children:e.jsx(i.Button,{variant:"contained",startIcon:e.jsx(Es.PlusIcon,{fill:"#FFF"}),color:"primary",className:`${a.home["conference-block__action"]} text-nowrap`,onClick:O,children:s("add_new_student")})})]})]}),e.jsxs(i.Grid,{container:!0,className:"align-items-center mt-3",style:{gap:"15px"},children:[e.jsxs("div",{className:"flex-grow-1 mr-3",children:[e.jsx(fe.StudentSelector,{setStudentId:N,studentId:j,setStudentName:ce=>b(ce===-1?"":ce.toString()),setIsCheckStudent:E,setLoadingComplete:Y}),!S&&e.jsxs(i.Typography,{className:`${he.myOneToOne["session-invalid"]}`,children:[s("this_is_a_required_field"),"."]}),e.jsx(i.Typography,{children:!y&&s("you_have_no_student")})]}),e.jsx("div",{children:!!y&&e.jsx(i.Button,{variant:"text",color:"primary",endIcon:e.jsx(ae.ArrowIcon,{fill:"#316CD9"}),className:`${a.home["conference-block__book-for-later"]} ${t?"text-capitalize":"text-uppercase"}`,onClick:W,children:s("view")})})]})]})})})]})}),e.jsx(i.Grid,{item:!0,xs:12,hidden:!t,children:e.jsx("div",{className:`${oe.styles["block-container"]} ${a.home["home-block--left"]}`,children:e.jsx(es,{})})}),l&&e.jsx(e.Fragment,{children:e.jsx(i.Grid,{item:!0,xs:12,sm:t?6:12,lg:12,children:e.jsx("div",{className:`${oe.styles["block-container"]} ${a.home["home-block--right"]} h-100`,children:e.jsx(vt,{studentId:t?r:void 0,isStudent:t,setLoadingComplete:Y})})})})]})}),e.jsx(i.Grid,{item:!0,xs:12,lg:4,children:e.jsxs(i.Grid,{container:!0,spacing:3,children:[!t&&e.jsx(i.Grid,{item:!0,xs:12,sm:6,lg:12,children:e.jsxs(i.Grid,{container:!0,spacing:2,className:"mb-0",children:[e.jsx(i.Grid,{item:!0,xs:12,children:e.jsxs("div",{className:`${oe.styles["block-container"]} ${a.home["home-block--right"]} ${a.home["check-in-block"]}`,children:[e.jsxs("div",{className:`${a.home["check-in-block__wrapper"]} ${!h?.totalStudentMissingCheckIn&&a.home["check-in-block__wrapper--b-0"]}`,children:[e.jsxs(i.Grid,{container:!0,className:"justify-content-between mb-1",onClick:()=>J(),style:{cursor:"pointer"},children:[e.jsxs("div",{className:"d-flex align-items-center",children:[e.jsx(i.Typography,{className:`${a.home["check-in-block__number"]}`,children:h?.weekCheckIn||0}),e.jsxs(i.Grid,{className:`${a.home["check-in-block__text"]}`,children:[e.jsx("p",{className:"mb-0",children:s("this_week_s")}),e.jsx("p",{className:"mb-0",children:s("check_ins")})]}),e.jsx(ae.ArrowIcon,{className:`${a.home["check-in-block__icon"]}`})]}),e.jsx("div",{children:e.jsx("img",{src:"/images/home/check-in.png",alt:s("check_ins")})})]}),e.jsx(i.Button,{variant:"text",color:"primary",endIcon:e.jsx(ae.ArrowIcon,{}),className:`${a.home["conference-block__book-for-later"]} ${a.home["check-in-block__view"]}`,onClick:D,children:s("view_latest_check_ins")})]}),!!h?.totalStudentMissingCheckIn&&e.jsx("div",{className:`${a.home["check-in-block__note-wrapper"]}`,children:e.jsx(cs,{seeMoreable:!0,number:h?.totalStudentMissingCheckIn,numberText:`${s("missing_weekly_check_in")}`,onSeeMore:U,defaultText:"",isBelowNumber:!0})})]})}),e.jsx(i.Grid,{item:!0,xs:12,children:e.jsxs(i.Grid,{container:!0,className:`${oe.styles["block-container"]} ${a.home["home-block--right"]} justify-content-between`,onClick:()=>$(),style:{cursor:"pointer"},children:[e.jsxs("div",{className:"d-flex align-items-center",children:[e.jsx(i.Typography,{className:`${a.home["check-in-block__number"]}`,children:h?.weekOneToOne||0}),e.jsxs(i.Grid,{className:`${a.home["check-in-block__text"]}`,children:[e.jsx("p",{className:"mb-0",children:s("this_week_s")}),e.jsx("p",{className:"mb-0",children:s("1-1s")})]}),e.jsx(ae.ArrowIcon,{className:`${a.home["check-in-block__icon"]}`})]}),e.jsx("div",{children:e.jsx("img",{src:`${p.getStaticFileUrl("/images/home/one-to-one.png")}`,alt:s("one_to_one")})})]})})]})}),e.jsx(i.Grid,{item:!0,xs:12,sm:t?12:6,lg:12,children:e.jsxs(i.Grid,{container:!0,spacing:3,children:[e.jsx(i.Grid,{item:!0,xs:12,sm:t?6:12,lg:12,children:e.jsx("div",{className:`${oe.styles["block-container"]} ${a.home["home-block--right"]} h-100`,children:e.jsx(gt,{date:Ds,studentUserId:t?c?.id:"",teacherUserId:t&&c.mainTeacherUserId||void 0,onViewCalendar:L,setLoadingComplete:Y})})}),t&&e.jsx(i.Grid,{item:!0,xs:12,sm:t?6:12,lg:12,children:e.jsx("div",{className:`${oe.styles["block-container"]} ${a.home["home-block--right"]} h-100`,children:e.jsx(ss,{setLoadingComplete:Y})})})]})})]})})]})]}),e.jsx(ds,{open:g,onClose:q}),e.jsx(Lt,{open:_,onClose:M}),e.jsx(on,{open:m,onClose:k}),e.jsx(hn,{open:v,onClose:I}),e.jsx(xn,{open:f,onClose:V}),e.jsx(nn,{screenWidth:As,open:d,onClose:F,isStudent:t}),e.jsx(qn,{open:K,onClose:ye,step:bs,availableJourneys:Ss,selectedIds:Ts,onStart:Is,onToggleSelect:Ls,onContinue:$s}),e.jsx(x.DialogEarnPoints,{open:je,onClose:()=>be(!1)}),e.jsx(Rn,{open:!!ne,journey:G.find(ce=>ce.id.toString()===ne)||null,onClose:()=>ie(null),loading:B,submitting:se,activeQuestion:Oe,thoughts:Ye,setThoughts:R,textareaRef:ee,isRecording:P,record:Se,stop:ue,tempTranscript:Cs,onSubmit:Ns}),e.jsx(x.DialogThankYouJourney,{open:!!me,journeyId:me,onClose:()=>ve(null)})]})},Mn=n=>{const s=typeof n=="string"?n:JSON.stringify(n||["teacher"]);return p.api.get(`${p.BASE_URL}/api/Report/teacher-homepage-overview-internal`,{params:{activeRole:s}})},Bn=n=>{const s=typeof n=="string"?n:JSON.stringify(n||["teacher"]);return p.api.get(`${p.BASE_URL}/api/Report/teacher-homepage-flags-history`,{params:{activeRole:s}})};function Fn(){const n=Q.useSelector(q=>q.common?.user);let s='["teacher"]';if(n?.activeRole)s=typeof n.activeRole=="string"&&n.activeRole.startsWith("[")?n.activeRole:JSON.stringify(Array.isArray(n.activeRole)?n.activeRole:[n.activeRole.toLowerCase()]);else if(Array.isArray(n?.roles)){const q=n.roles.filter(C=>C.toLowerCase()!=="student").map(C=>C.toLowerCase());s=JSON.stringify(q.length>0?q:["teacher"])}const[t,l]=u.useState(null),[c,h]=u.useState(!0),[d,r]=u.useState(null),[g,_]=u.useState(!1),[m,f]=u.useState(!1),[v,y]=u.useState(null),[j,S]=u.useState("flags"),T=u.useCallback(async()=>{h(!0),r(null);try{const q=await Mn(s);q&&q.data&&l(q.data)}catch(q){r(q)}finally{h(!1)}},[s]);return u.useEffect(()=>{T()},[T]),{data:t,loading:c,error:d,activeRole:s,openFlagsModal:g,openJourneyModal:m,selectedJourney:v,activePanel:j,refetch:T,handleOpenFlagsModal:()=>_(!0),handleCloseFlagsModal:()=>_(!1),handleOpenJourneyModal:q=>{y(q||null),f(!0)},handleCloseJourneyModal:()=>{f(!1),y(null)},togglePanel:q=>{S(C=>C===q?"flags":q)}}}const ms=({width:n=15,height:s=15,color:t="#316CD9"})=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:s,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"M12 16v-4"}),e.jsx("path",{d:"M12 8h.01"})]}),qe=({width:n=18,height:s=18,color:t="#C44140"})=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:s,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528"})}),gs=({width:n=18,height:s=18,color:t="#0F9655"})=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:s,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z"})}),ps=({width:n=16,height:s=20,color:t="#F5D500"})=>e.jsx("svg",{width:n,height:s,viewBox:"0 0 25 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M24.2872 -0.141754C21.4658 3.28575 21.1281 7.25702 21.2999 11.6181C21.5098 16.9475 22.358 24.291 23.1786 29.5842C23.2998 30.3658 22.3867 30.8232 21.8404 30.2545C18.7939 27.0829 15.2541 23.33 12.0658 19.1775C9.28717 22.6735 7.06154 26.7226 4.6545 31.0487C4.42524 31.4608 3.88078 31.5433 3.52569 31.2194C3.11675 30.8465 2.84835 30.3374 2.77008 29.7869C1.08065 17.9028 0.131368 12.0405 2.66545e-06 -0.206989L24.2872 -0.141754Z",fill:t})}),Re=({width:n=14,height:s=14,color:t="rgba(36,36,36,0.56)"})=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:s,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1"}),e.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}),e.jsx("path",{d:"M12 11h4"}),e.jsx("path",{d:"M12 16h4"}),e.jsx("path",{d:"M8 11h.01"}),e.jsx("path",{d:"M8 16h.01"})]}),Fe=({width:n=14,height:s=14,color:t="#fff"})=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:s,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"}),e.jsx("path",{d:"M7 11h10"}),e.jsx("path",{d:"M7 15h6"}),e.jsx("path",{d:"M7 7h8"})]}),Gn=({width:n=14,height:s=14,color:t="currentColor"})=>e.jsxs("svg",{width:n,height:s,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),On=({width:n=16,height:s=16,color:t="#0F9655"})=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:s,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z"})]}),Yn=({width:n=16,height:s=16,color:t="#0F9655"})=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:s,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M21.801 10A10 10 0 1 1 17 3.335"}),e.jsx("path",{d:"m9 11 3 3L22 4"})]}),Wn=({width:n=16,height:s=16,color:t="#316CD9"})=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:s,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("circle",{cx:"12",cy:"12",r:"6"}),e.jsx("circle",{cx:"12",cy:"12",r:"2"})]}),Hn=({width:n=16,height:s=16,color:t="#316CD9"})=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:s,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 1 2 2h14a2 2 0 0 0 2-2v-7"}),e.jsx("path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z"})]}),xs=({width:n=12,height:s=12,color:t="rgba(36,36,36,0.56)"})=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:s,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M8 2v4"}),e.jsx("path",{d:"M16 2v4"}),e.jsx("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}),e.jsx("path",{d:"M3 10h18"})]}),fs=({width:n=26,height:s=26,color:t="#316CD9"})=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:s,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"8",r:"5"}),e.jsx("path",{d:"M20 21a8 8 0 0 0-16 0"})]}),Pn=({direction:n="up",width:s=16,height:t=16,color:l})=>{const c=n==="up",d=l||(c?"#0F9655":"#C44140");return e.jsx("svg",{width:s,height:t,viewBox:"0 0 24 24",fill:"none",stroke:d,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:c?e.jsxs(e.Fragment,{children:[e.jsx("polyline",{points:"23 6 13.5 15.5 8.5 10.5 1 18"}),e.jsx("polyline",{points:"17 6 23 6 23 12"})]}):e.jsxs(e.Fragment,{children:[e.jsx("polyline",{points:"23 18 13.5 8.5 8.5 13.5 1 6"}),e.jsx("polyline",{points:"17 18 23 18 23 12"})]})})},Vn=({width:n=17,height:s=17,color:t="#316CD9"})=>e.jsxs("svg",{width:n,height:s,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M3 3v18h18"}),e.jsx("path",{d:"M18 17V9"}),e.jsx("path",{d:"M13 17V5"}),e.jsx("path",{d:"M8 17v-3"})]}),Jn=({width:n=17,height:s=17,color:t="#C44140"})=>e.jsxs("svg",{width:n,height:s,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),e.jsx("circle",{cx:"9",cy:"7",r:"4"}),e.jsx("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),e.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]}),Un=({width:n=14,height:s=14,color:t="#C44140"})=>e.jsx("svg",{width:n,height:s,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})}),Kn=({width:n=14,height:s=14,color:t="#B46A00"})=>e.jsx("svg",{width:n,height:s,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})}),Le=({width:n=18,height:s=18,color:t="rgba(36,36,36,0.56)"})=>e.jsxs("svg",{width:n,height:s,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),xe=({width:n=14,height:s=14,color:t="#C44140"})=>e.jsxs("svg",{width:n,height:s,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M5 12h14"}),e.jsx("path",{d:"m12 5 7 7-7 7"})]}),ys=({width:n=26,height:s=26,color:t="#242424"})=>e.jsxs("svg",{width:n,height:s,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"m12 19-7-7 7-7"}),e.jsx("path",{d:"M19 12H5"})]}),js=({width:n=16,height:s=16,color:t="#D97706"})=>e.jsxs("svg",{width:n,height:s,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"}),e.jsx("path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0"})]}),vs=({width:n=16,height:s=16,color:t="#0284C7"})=>e.jsxs("svg",{width:n,height:s,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),zn=({width:n=16,height:s=16,color:t="#475569"})=>e.jsxs("svg",{width:n,height:s,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"7",y1:"17",x2:"17",y2:"7"}),e.jsx("polyline",{points:"7 7 17 7 17 17"})]}),Qn=({width:n=16,height:s=16,color:t="#059669"})=>e.jsxs("svg",{width:n,height:s,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),e.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]}),Xn=({width:n=18,height:s=18,color:t="#fff"})=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:s,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M12 15V3"}),e.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),e.jsx("path",{d:"m7 10 5 5 5-5"})]}),Zn=({width:n=16,height:s=16,color:t="#C44140"})=>e.jsxs("svg",{width:n,height:s,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z"}),e.jsx("line",{x1:"12",y1:"10",x2:"12",y2:"16"}),e.jsx("line",{x1:"9",y1:"13",x2:"15",y2:"13"})]}),eo=({width:n=16,height:s=16,color:t="#666666"})=>e.jsxs("svg",{width:n,height:s,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}),e.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),so=({width:n=16,height:s=16,color:t="#0F9655"})=>e.jsxs("svg",{width:n,height:s,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),to=({width:n=18,height:s=18,color:t="rgba(36,36,36,0.56)"})=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:s,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"m21 21-4.34-4.34"}),e.jsx("circle",{cx:"11",cy:"11",r:"8"})]}),no=({width:n=13,height:s=13,color:t="#C44140"})=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:s,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"M12 6v6l4 2"})]}),oo="/images/image-default.png",ts=["#BBF7D0","#FBCFE8","#FEF08A","#FED7AA","#DCFCE7","#BAE6FD","#E9D8FD"],Te=[{usStage:"Preschool / Early Childhood",usGrade:"Preschool",ukStage:"Early Years / Nursery",ukYearGroup:"Nursery",ukKeyStage:"EYFS"},{usStage:"Pre-K / Kindergarten prep",usGrade:"Pre-K",ukStage:"Reception",ukYearGroup:"Reception",ukKeyStage:"EYFS"},{usStage:"Elementary School",usGrade:"Kindergarten",ukStage:"Primary School",ukYearGroup:"Year 1",ukKeyStage:"Key Stage 1"},{usStage:"Elementary School",usGrade:"Grade 1",ukStage:"Primary School",ukYearGroup:"Year 2",ukKeyStage:"Key Stage 1"},{usStage:"Elementary School",usGrade:"Grade 2",ukStage:"Primary School",ukYearGroup:"Year 3",ukKeyStage:"Key Stage 2"},{usStage:"Elementary School",usGrade:"Grade 3",ukStage:"Primary School",ukYearGroup:"Year 4",ukKeyStage:"Key Stage 2"},{usStage:"Elementary School",usGrade:"Grade 4",ukStage:"Primary School",ukYearGroup:"Year 5",ukKeyStage:"Key Stage 2"},{usStage:"Elementary School",usGrade:"Grade 5",ukStage:"Primary School",ukYearGroup:"Year 6",ukKeyStage:"Key Stage 2"},{usStage:"Middle School",usGrade:"Grade 6",ukStage:"Secondary School",ukYearGroup:"Year 7",ukKeyStage:"Key Stage 3"},{usStage:"Middle School",usGrade:"Grade 7",ukStage:"Secondary School",ukYearGroup:"Year 8",ukKeyStage:"Key Stage 3"},{usStage:"Middle School",usGrade:"Grade 8",ukStage:"Secondary School",ukYearGroup:"Year 9",ukKeyStage:"Key Stage 3"},{usStage:"High School",usGrade:"Grade 9",ukStage:"Secondary / GCSE years",ukYearGroup:"Year 10",ukKeyStage:"Key Stage 4"},{usStage:"High School",usGrade:"Grade 10",ukStage:"Secondary / GCSE years",ukYearGroup:"Year 11",ukKeyStage:"Key Stage 4"},{usStage:"High School",usGrade:"Grade 11",ukStage:"Sixth Form / College",ukYearGroup:"Year 12",ukKeyStage:"Key Stage 5"},{usStage:"High School",usGrade:"Grade 12",ukStage:"Sixth Form / College",ukYearGroup:"Year 13",ukKeyStage:"Key Stage 5"}],ao={"world wonder":{desc:"The World Wonder Journey encourages students to explore diverse cultures, geographical concepts, and develop a sense of global citizenship through curiosity-driven activities.",subtitle:"Explore the world",activity:"Medium activity"},"pop & art":{desc:"The Pop & Art Journey inspires creative expression, artistic exploration, and appreciation for contemporary media and visual arts.",subtitle:"Stay in the know",activity:"High activity"},music:{desc:"The Music Journey engages students in rhythm, melody, and musical appreciation, fostering emotional expression and collaboration.",subtitle:"Feel the rhythm",activity:"High activity"},sports:{desc:"The Sports Journey promotes physical well-being, teamwork, healthy competition, and active lifestyle habits.",subtitle:"Move your body",activity:"High activity"},technology:{desc:"The Technology Journey empowers students to build digital literacy, problem-solving skills, and innovation for the future.",subtitle:"Build the future",activity:"High activity"},"community cosmos":{desc:"The Community Cosmos Journey fosters empathy, social connection, community involvement, and collaborative leadership.",subtitle:"Grow together",activity:"Medium activity"}},lo=[{slug:"world_wonder",text:"The World Wonder Journey encourages students to explore diverse cultures, geographical concepts, and develop a sense of global citizenship through curiosity-driven activities."},{slug:"pop_and_art",text:"The Pop & Art Journey invites students to engage with creativity, culture, and current events — expressing ideas through art and staying curious about the world around them."},{slug:"music",text:"The Music Journey helps students explore rhythm, expression, and listening — building confidence and emotional awareness through sound."},{slug:"sports",text:"The Sports Journey promotes movement, teamwork, and resilience — encouraging healthy habits and a growth mindset through physical activity."},{slug:"technology",text:"The Technology Journey develops digital fluency, problem-solving, and creativity as students build, tinker, and imagine what comes next."},{slug:"community_cosmos",text:"The Community Cosmos Journey nurtures empathy, collaboration, and belonging — helping students support one another and contribute to their community."}],ns=["#fef08a","#fed7aa","#bbf7d0","#bae6fd","#e9d5ff"],ro=[{id:"how_flags_raised",title:"How flags are raised",description:"Surveys and check-ins are scanned for safety, stress, and risk keywords. Matches raise a red flag; softer signals (missed check-ins, wellbeing dips) raise a yellow flag.",iconType:"flag",bgColor:"#FCEDEE",iconColor:"#C44140"},{id:"acknowledgement_window",title:"Acknowledgement window (2h)",description:"When a case is opened, the assigned staff member must acknowledge it within 2 hours. The SLA badge counts down and flashes red as it nears breach.",iconType:"bell",bgColor:"#FEF3C7",iconColor:"#D97706"},{id:"result_logging_window",title:"Result-logging window (48h)",description:"After acknowledgement the case moves to Under investigation. The outcome must be logged within 48 hours, then the case is closed and archived.",iconType:"search",bgColor:"#E0F2FE",iconColor:"#0284C7"},{id:"auto_escalation",title:"Auto-escalation",description:"If an acknowledgement or logging window hits zero, the case auto-escalates to the Principal and is reassigned.",iconType:"escalate",bgColor:"#F1F5F9",iconColor:"#475569"},{id:"routing_triggers",title:"Routing triggers",description:"Opening, escalating, or reassigning a case fires push and email notifications to the assigned staff and, on escalation, school leadership.",iconType:"routing",bgColor:"#D1FAE5",iconColor:"#059669"}],io="Case lifecycle & SLA workflow",co="How every safeguarding case moves from opening through to a logged outcome.",ho=[{stepNumber:1,stepLabelKey:"step_1",stepLabel:"STEP 1",titleKey:"case_opened",title:"Case opened",descKey:"case_opened_desc",description:"Educator, system, or student self-referral opens a new case and assigns it to a responsible staff member.",iconType:"folderAdd",bgColor:"#FDF2F2",iconColor:"#C44140"},{stepNumber:2,stepLabelKey:"step_2",stepLabel:"STEP 2",titleKey:"acknowledgement_window",title:"Acknowledgement window",descKey:"acknowledgement_window_desc",description:"The assigned person must acknowledge the case within the configured SLA window.",iconType:"bell",bgColor:"#FEF3E5",iconColor:"#D97706",badgeTextKey:"ack_target_2_hours",badgeText:"Ack. target · 2 hours",badgeBgColor:"#FEF3E5",badgeTextColor:"#A56F1A"},{stepNumber:3,stepLabelKey:"step_3",stepLabel:"STEP 3",titleKey:"case_acknowledged",title:"Case acknowledged",descKey:"case_acknowledged_desc",description:"Staff member acknowledges and begins working the case — conducting conversations, gathering context.",iconType:"userCheck",bgColor:"#F5F5F5",iconColor:"#666666"},{stepNumber:4,stepLabelKey:"step_4",stepLabel:"STEP 4",titleKey:"result_logging_window",title:"Result logging window",descKey:"result_logging_window_desc",description:"After acknowledgement, the staff member must log the case outcome within the configured SLA window.",iconType:"search",bgColor:"#EFF6FF",iconColor:"#316CD9",badgeTextKey:"result_target_48_hours",badgeText:"Result target · 48 hours",badgeBgColor:"#EFF6FF",badgeTextColor:"#316CD9"},{stepNumber:5,stepLabelKey:"step_5",stepLabel:"STEP 5",titleKey:"result_logged_and_closed",title:"Result logged & closed",descKey:"result_logged_and_closed_desc",description:"Outcome recorded in the audit trail. Case is resolved and archived as an immutable record.",iconType:"lockCheck",bgColor:"#E6F4EA",iconColor:"#0F9655"}],os=[{key:"flags",labelKey:"assigned_flags",subtitleKey:"assigned_flags_from_the_last_15_days",iconType:"flag",activeClass:"activeRed",iconCircleClass:"tabIconCircleRed",actionLinkClass:"tabActionLinkRed",iconColor:"#C44140"},{key:"highlights",labelKey:"student_highlights",subtitleKey:"student_highlights_from_the_last_14_days",iconType:"star",activeClass:"activeGreen",iconCircleClass:"tabIconCircleGreen",actionLinkClass:"tabActionLinkGreen",iconColor:"#0F9655"}],uo="_overviewContainer_f5oq0_1",_o="_greetingHeader_f5oq0_27",mo="_greetingTitle_f5oq0_31",go="_greetingSubtitle_f5oq0_38",po="_topLayoutGrid_f5oq0_44",xo="_bottomLayoutGrid_f5oq0_56",fo="_card_f5oq0_67",yo="_blockLoadingContainer_f5oq0_77",jo="_cardHeader_f5oq0_88",vo="_cardTitle_f5oq0_96",wo="_cardSubtitle_f5oq0_103",ko="_btnAlertsWork_f5oq0_109",Co="_popoverContainer_f5oq0_124",No="_popoverFadeIn_f5oq0_1",bo="_popoverHeader_f5oq0_151",So="_popoverTitle_f5oq0_155",To="_popoverDesc_f5oq0_162",Io="_adminBadge_f5oq0_169",Lo="_flagBlockRed_f5oq0_182",$o="_flagBlockRedHeader_f5oq0_190",Do="_flagBlockRedBody_f5oq0_195",Ao="_flagBlockYellow_f5oq0_200",qo="_flagBlockYellowHeader_f5oq0_208",Ro="_flagBlockYellowBody_f5oq0_213",Eo="_flagBlockTitleRed_f5oq0_218",Mo="_flagBlockTitleYellow_f5oq0_225",Bo="_sectionSectionLabel_f5oq0_232",Fo="_metricRow_f5oq0_245",Go="_metricPillRed_f5oq0_260",Oo="_metricPillYellow_f5oq0_269",Yo="_kpiPillsList_f5oq0_278",Wo="_kpiPillBlue_f5oq0_285",Ho="_tabsRow_f5oq0_295",Po="_tabCard_f5oq0_302",Vo="_activeRed_f5oq0_315",Jo="_activeGreen_f5oq0_320",Uo="_tabHeader_f5oq0_326",Ko="_tabIconCircleRed_f5oq0_335",zo="_tabIconCircleGreen_f5oq0_347",Qo="_tabValue_f5oq0_359",Xo="_tabActionLinkRed_f5oq0_366",Zo="_tabActionLinkGreen_f5oq0_378",ea="_tabContentContainer_f5oq0_391",sa="_tabFadeSlideIn_f5oq0_1",ta="_flagsCardBox_f5oq0_406",na="_bannerHeader_f5oq0_414",oa="_bannerTitle_f5oq0_423",aa="_bannerLink_f5oq0_434",la="_highlightsSubHeader_f5oq0_450",ra="_highlightsSubTab_f5oq0_455",ia="_studentList_f5oq0_463",ca="_highlightsListContainer_f5oq0_484",da="_studentItem_f5oq0_507",ha="_studentMeta_f5oq0_518",ua="_avatarInitialsRed_f5oq0_524",_a="_avatarInitialsYellow_f5oq0_538",ma="_avatarInitialsGreen_f5oq0_552",ga="_avatarInitialsBlue_f5oq0_566",pa="_studentDetails_f5oq0_580",xa="_studentNameRow_f5oq0_586",fa="_studentGradeTag_f5oq0_595",ya="_studentDateRow_f5oq0_602",ja="_actionBtnGroup_f5oq0_611",va="_btnOutline_f5oq0_617",wa="_btnFilledBlue_f5oq0_636",ka="_highlightCard_f5oq0_655",Ca="_highlightContent_f5oq0_670",Na="_highlightHeader_f5oq0_677",ba="_highlightName_f5oq0_683",Sa="_dateAgoBadge_f5oq0_689",Ta="_highlightTitleRow_f5oq0_698",Ia="_highlightDesc_f5oq0_708",La="_wellBeingCard_f5oq0_716",$a="_wellBeingTitle_f5oq0_723",Da="_wellBeingDesc_f5oq0_733",Aa="_btnTeal_f5oq0_740",qa="_conversationCard_f5oq0_756",Ra="_convoHeader_f5oq0_764",Ea="_btnGroupConvo_f5oq0_770",Ma="_missingConvoBox_f5oq0_795",Ba="_missingText_f5oq0_805",Fa="_btnFilledRed_f5oq0_817",Ga="_btnLogOneToOne_f5oq0_832",Oa="_lastTalkedText_f5oq0_849",Ya="_studentGradeDot_f5oq0_857",Wa="_wellnessMetricRow_f5oq0_864",Ha="_wellnessLeft_f5oq0_870",Pa="_wellnessIconImg_f5oq0_886",Va="_wellnessPillGreen_f5oq0_892",Ja="_wellnessPillDivider_f5oq0_911",Ua="_wellnessTrendingRight_f5oq0_919",Ka="_fullBtnBlue_f5oq0_925",za="_fullBtnRed_f5oq0_946",Qa="_cardHeaderInline_f5oq0_967",Xa="_linkBtnInline_f5oq0_974",Za="_journeysGrid_f5oq0_994",el="_journeyItemCard_f5oq0_1000",sl="_journeyIconTitle_f5oq0_1010",tl="_journeyCircleIcon_f5oq0_1016",nl="_journeyIconImg_f5oq0_1028",ol="_journeyItemTitle_f5oq0_1034",al="_journeyCountBadge_f5oq0_1040",ll="_modalHeader_f5oq0_1051",rl="_modalTitle_f5oq0_1058",il="_modalSubtitle_f5oq0_1065",cl="_modalCloseBtn_f5oq0_1071",dl="_modalBody_f5oq0_1090",hl="_studentCard_f5oq0_1101",ul="_studentInfo_f5oq0_1117",_l="_studentName_f5oq0_586",ml="_dialogContentZero_f5oq0_1172",gl="_modalStudentList_f5oq0_1212",pl="_studentCardBox_f5oq0_1221",xl="_studentAvatarInitials_f5oq0_1230",fl="_studentInfoCol_f5oq0_1241",yl="_studentNameText_f5oq0_1247",jl="_studentGradeSub_f5oq0_1253",vl="_badgesWrapper_f5oq0_1259",wl="_unsafeBadge_f5oq0_1267",kl="_highStressBadge_f5oq0_1279",Cl="_btnViewCheckInWhite_f5oq0_1291",Nl="_engModalHeader_f5oq0_1315",bl="_engHeaderLeft_f5oq0_1330",Sl="_engTitle_f5oq0_1336",Tl="_engSubtitle_f5oq0_1344",Il="_engHeaderRight_f5oq0_1351",Ll="_engTotalBox_f5oq0_1358",$l="_engTotalLabel_f5oq0_1369",Dl="_engTotalValue_f5oq0_1378",Al="_engJourneyList_f5oq0_1385",ql="_engJourneyRow_f5oq0_1408",Rl="_engJourneyLeft_f5oq0_1424",El="_engJourneyCircle_f5oq0_1432",Ml="_engJourneyName_f5oq0_1449",Bl="_engJourneyDesc_f5oq0_1461",Fl="_engActivityRow_f5oq0_1467",Gl="_activityDot_f5oq0_1473",Ol="_activityLabel_f5oq0_1480",Yl="_engJourneyRight_f5oq0_1486",Wl="_engStudentCount_f5oq0_1493",Hl="_engArrow_f5oq0_1503",Pl="_jpHeader_f5oq0_1513",Vl="_jpHeaderLeft_f5oq0_1520",Jl="_jpBackBtn_f5oq0_1528",Ul="_jpIconCircle_f5oq0_1544",Kl="_jpTitle_f5oq0_1562",zl="_jpDesc_f5oq0_1570",Ql="_jpEngagedRow_f5oq0_1578",Xl="_jpEngagedLabel_f5oq0_1582",Zl="_jpDivider_f5oq0_1592",er="_jpProgressSection_f5oq0_1598",sr="_jpProgressTitle_f5oq0_1602",tr="_jpStudentList_f5oq0_1609",nr="_jpStudentCard_f5oq0_1631",or="_jpStudentLeft_f5oq0_1648",ar="_jpStudentName_f5oq0_1656",lr="_jpBadgeTitle_f5oq0_1663",rr="_jpProgressCol_f5oq0_1670",ir="_jpXpHeader_f5oq0_1678",cr="_jpXpLabel_f5oq0_1685",dr="_jpXpValue_f5oq0_1694",hr="_jpProgressBar_f5oq0_1705",ur="_jpProgressFill_f5oq0_1713",_r="_slaSection_f5oq0_1721",mr="_slaDivider_f5oq0_1725",gr="_slaTitle_f5oq0_1731",pr="_slaSubtitle_f5oq0_1738",xr="_slaList_f5oq0_1745",fr="_slaItem_f5oq0_1751",yr="_slaIconCircle_f5oq0_1757",jr="_slaInfo_f5oq0_1768",vr="_slaItemTitle_f5oq0_1773",wr="_slaItemDesc_f5oq0_1781",kr="_flagsHistoryContainer_f5oq0_1791",Cr="_btnBackHome_f5oq0_1798",Nr="_flagsHistoryHeader_f5oq0_1816",br="_flagsHistoryTitle_f5oq0_1824",Sr="_flagsHistorySubtitle_f5oq0_1834",Tr="_btnExportCsv_f5oq0_1840",Ir="_flagsHistoryCard_f5oq0_1860",Lr="_flagsHistoryFilterBar_f5oq0_1867",$r="_searchBox_f5oq0_1875",Dr="_searchInput_f5oq0_1887",Ar="_btnClearSearch_f5oq0_1897",qr="_datePickerContainer_f5oq0_1906",Rr="_datePickerItem_f5oq0_1912",Er="_selectFilter_f5oq0_1958",Mr="_multiSelectDropdownBtn_f5oq0_1969",Br="_typeDropdownBtn_f5oq0_1991",Fr="_multiSelectDropdownLabel_f5oq0_1995",Gr="_multiSelectDropdownMenu_f5oq0_2004",Or="_multiSelectDropdownItem_f5oq0_2020",Yr="_dropdownItemSelected_f5oq0_2033",Wr="_dateFilterGroup_f5oq0_2045",Hr="_dateInput_f5oq0_2055",Pr="_dateToText_f5oq0_2064",Vr="_tableHeaderGrid_f5oq0_2069",Jr="_tableBodyBox_f5oq0_2079",Ur="_tableRowGrid_f5oq0_2085",Kr="_tableRowEven_f5oq0_2097",zr="_tableRowOdd_f5oq0_2101",Qr="_studentMetaCol_f5oq0_2105",Xr="_studentGradeText_f5oq0_2149",Zr="_flagTypeBadgeRed_f5oq0_2154",ei="_flagTypeBadgeYellow_f5oq0_2166",si="_flagDotRed_f5oq0_2178",ti="_flagDotYellow_f5oq0_2185",ni="_dateText_f5oq0_2192",oi="_loggedByText_f5oq0_2197",ai="_assignedText_f5oq0_2202",li="_statusCol_f5oq0_2207",ri="_closedBadge_f5oq0_2214",ii="_pendingBadge_f5oq0_2227",ci="_btnActionViewNote_f5oq0_2240",di="_btnActionLog11_f5oq0_2259",hi="_emptyFlagsText_f5oq0_2278",ui="_loadingBox_f5oq0_2285",_i="_btnInfoCircle_f5oq0_2293",mi="_caseWorkflowPopoverCard_f5oq0_2312",gi="_caseWorkflowPopoverHeader_f5oq0_2326",pi="_caseWorkflowPopoverTitle_f5oq0_2330",xi="_caseWorkflowPopoverSubtitle_f5oq0_2338",fi="_caseWorkflowTimelineContainer_f5oq0_2345",yi="_caseWorkflowStepRow_f5oq0_2350",ji="_caseWorkflowStepIconCol_f5oq0_2360",vi="_caseWorkflowStepCircle_f5oq0_2368",wi="_caseWorkflowStepContentCol_f5oq0_2379",ki="_caseWorkflowStepLabel_f5oq0_2385",Ci="_caseWorkflowStepTitle_f5oq0_2394",Ni="_caseWorkflowStepDesc_f5oq0_2402",bi="_caseWorkflowStepBadge_f5oq0_2409",o={overviewContainer:uo,greetingHeader:_o,greetingTitle:mo,greetingSubtitle:go,topLayoutGrid:po,bottomLayoutGrid:xo,card:fo,blockLoadingContainer:yo,cardHeader:jo,cardTitle:vo,cardSubtitle:wo,btnAlertsWork:ko,popoverContainer:Co,popoverFadeIn:No,popoverHeader:bo,popoverTitle:So,popoverDesc:To,adminBadge:Io,flagBlockRed:Lo,flagBlockRedHeader:$o,flagBlockRedBody:Do,flagBlockYellow:Ao,flagBlockYellowHeader:qo,flagBlockYellowBody:Ro,flagBlockTitleRed:Eo,flagBlockTitleYellow:Mo,sectionSectionLabel:Bo,metricRow:Fo,metricPillRed:Go,metricPillYellow:Oo,kpiPillsList:Yo,kpiPillBlue:Wo,tabsRow:Ho,tabCard:Po,activeRed:Vo,activeGreen:Jo,tabHeader:Uo,tabIconCircleRed:Ko,tabIconCircleGreen:zo,tabValue:Qo,tabActionLinkRed:Xo,tabActionLinkGreen:Zo,tabContentContainer:ea,tabFadeSlideIn:sa,flagsCardBox:ta,bannerHeader:na,bannerTitle:oa,bannerLink:aa,highlightsSubHeader:la,highlightsSubTab:ra,studentList:ia,highlightsListContainer:ca,studentItem:da,studentMeta:ha,avatarInitialsRed:ua,avatarInitialsYellow:_a,avatarInitialsGreen:ma,avatarInitialsBlue:ga,studentDetails:pa,studentNameRow:xa,studentGradeTag:fa,studentDateRow:ya,actionBtnGroup:ja,btnOutline:va,btnFilledBlue:wa,highlightCard:ka,highlightContent:Ca,highlightHeader:Na,highlightName:ba,dateAgoBadge:Sa,highlightTitleRow:Ta,highlightDesc:Ia,wellBeingCard:La,wellBeingTitle:$a,wellBeingDesc:Da,btnTeal:Aa,conversationCard:qa,convoHeader:Ra,btnGroupConvo:Ea,missingConvoBox:Ma,missingText:Ba,btnFilledRed:Fa,btnLogOneToOne:Ga,lastTalkedText:Oa,studentGradeDot:Ya,wellnessMetricRow:Wa,wellnessLeft:Ha,wellnessIconImg:Pa,wellnessPillGreen:Va,wellnessPillDivider:Ja,wellnessTrendingRight:Ua,fullBtnBlue:Ka,fullBtnRed:za,cardHeaderInline:Qa,linkBtnInline:Xa,journeysGrid:Za,journeyItemCard:el,journeyIconTitle:sl,journeyCircleIcon:tl,journeyIconImg:nl,journeyItemTitle:ol,journeyCountBadge:al,modalHeader:ll,modalTitle:rl,modalSubtitle:il,modalCloseBtn:cl,modalBody:dl,studentCard:hl,studentInfo:ul,studentName:_l,dialogContentZero:ml,modalStudentList:gl,studentCardBox:pl,studentAvatarInitials:xl,studentInfoCol:fl,studentNameText:yl,studentGradeSub:jl,badgesWrapper:vl,unsafeBadge:wl,highStressBadge:kl,btnViewCheckInWhite:Cl,engModalHeader:Nl,engHeaderLeft:bl,engTitle:Sl,engSubtitle:Tl,engHeaderRight:Il,engTotalBox:Ll,engTotalLabel:$l,engTotalValue:Dl,engJourneyList:Al,engJourneyRow:ql,engJourneyLeft:Rl,engJourneyCircle:El,engJourneyName:Ml,engJourneyDesc:Bl,engActivityRow:Fl,activityDot:Gl,activityLabel:Ol,engJourneyRight:Yl,engStudentCount:Wl,engArrow:Hl,jpHeader:Pl,jpHeaderLeft:Vl,jpBackBtn:Jl,jpIconCircle:Ul,jpTitle:Kl,jpDesc:zl,jpEngagedRow:Ql,jpEngagedLabel:Xl,jpDivider:Zl,jpProgressSection:er,jpProgressTitle:sr,jpStudentList:tr,jpStudentCard:nr,jpStudentLeft:or,jpStudentName:ar,jpBadgeTitle:lr,jpProgressCol:rr,jpXpHeader:ir,jpXpLabel:cr,jpXpValue:dr,jpProgressBar:hr,jpProgressFill:ur,slaSection:_r,slaDivider:mr,slaTitle:gr,slaSubtitle:pr,slaList:xr,slaItem:fr,slaIconCircle:yr,slaInfo:jr,slaItemTitle:vr,slaItemDesc:wr,flagsHistoryContainer:kr,btnBackHome:Cr,flagsHistoryHeader:Nr,flagsHistoryTitle:br,flagsHistorySubtitle:Sr,btnExportCsv:Tr,flagsHistoryCard:Ir,flagsHistoryFilterBar:Lr,searchBox:$r,searchInput:Dr,btnClearSearch:Ar,datePickerContainer:qr,datePickerItem:Rr,selectFilter:Er,multiSelectDropdownBtn:Mr,typeDropdownBtn:Br,multiSelectDropdownLabel:Fr,multiSelectDropdownMenu:Gr,multiSelectDropdownItem:Or,dropdownItemSelected:Yr,dateFilterGroup:Wr,dateInput:Hr,dateToText:Pr,tableHeaderGrid:Vr,tableBodyBox:Jr,tableRowGrid:Ur,tableRowEven:Kr,tableRowOdd:zr,studentMetaCol:Qr,studentGradeText:Xr,flagTypeBadgeRed:Zr,flagTypeBadgeYellow:ei,flagDotRed:si,flagDotYellow:ti,dateText:ni,loggedByText:oi,assignedText:ai,statusCol:li,closedBadge:ri,pendingBadge:ii,btnActionViewNote:ci,btnActionLog11:di,emptyFlagsText:hi,loadingBox:ui,btnInfoCircle:_i,caseWorkflowPopoverCard:mi,caseWorkflowPopoverHeader:gi,caseWorkflowPopoverTitle:pi,caseWorkflowPopoverSubtitle:xi,caseWorkflowTimelineContainer:fi,caseWorkflowStepRow:yi,caseWorkflowStepIconCol:ji,caseWorkflowStepCircle:vi,caseWorkflowStepContentCol:wi,caseWorkflowStepLabel:ki,caseWorkflowStepTitle:Ci,caseWorkflowStepDesc:Ni,caseWorkflowStepBadge:bi};function Ge(n,s=0){const t=(n||"").toLowerCase();return t.includes("world")||t.includes("wonder")?"#A7F3D0":t.includes("pop")||t.includes("art")?"#FBCFE8":t.includes("music")?"#FEF08A":t.includes("sport")?"#FED7AA":t.includes("tech")?"#BFE6A8":t.includes("community")||t.includes("cosmos")?"#BAE6FD":ts[s%ts.length]}function Si(n,s){const t=(n||"").toLowerCase(),l=(s||"").toLowerCase(),h=t.includes("stress")||l.includes("stress")?p.getStaticFileUrl("/images/home/stress.png"):p.getStaticFileUrl("/images/home/safety.png");return e.jsx("img",{src:h,alt:"",className:o.wellnessIconImg})}function Ti(n){const s=(n||"").toLowerCase();return s==="journey"?e.jsx(On,{width:16,height:16,color:"#0F9655"}):s==="completed_goal"?e.jsx(Yn,{width:16,height:16,color:"#0F9655"}):s==="add_goal"?e.jsx(Wn,{width:16,height:16,color:"#316CD9"}):s==="ranked_strategy"||s==="ranked_learning_strategy"?e.jsx(gs,{width:16,height:16,color:"#A56F1A"}):e.jsx(Hn,{width:16,height:16,color:"#316CD9"})}function Ii(n){switch(n){case"flag":return e.jsx(qe,{width:16,height:16,color:"#C44140"});case"bell":return e.jsx(js,{width:16,height:16,color:"#D97706"});case"search":return e.jsx(vs,{width:16,height:16,color:"#0284C7"});case"escalate":return e.jsx(zn,{width:16,height:16,color:"#475569"});case"routing":return e.jsx(Qn,{width:16,height:16,color:"#059669"});default:return e.jsx(qe,{width:16,height:16,color:"#C44140"})}}function ws(n,s){if(!n)return"";const t=n.trim(),l=t.toLowerCase();if(l==="k"||l==="kindergarten"){const d=Te.find(r=>r.usGrade.toLowerCase()==="kindergarten");return d?s?`${d.ukYearGroup} / ${d.usGrade}`:`${d.usGrade} / ${d.ukYearGroup}`:"Kindergarten"}let c=Te.find(d=>d.usGrade.toLowerCase()===l||d.ukYearGroup.toLowerCase()===l);!c&&l.startsWith("grade ")&&(c=Te.find(d=>d.usGrade.toLowerCase()===l)),!c&&l.startsWith("year ")&&(c=Te.find(d=>d.ukYearGroup.toLowerCase()===l));const h=l.replace(/^grade\s+/i,"").replace(/^year\s+/i,"").trim();return!c&&/^\d+$/.test(h)&&(c=Te.find(d=>d.usGrade.toLowerCase().replace(/^grade\s+/i,"").trim()===h)),c?s?`${c.ukYearGroup} / ${c.usGrade}`:`${c.usGrade} / ${c.ukYearGroup}`:/^\d+$/.test(h)?s?`Year ${h} / Grade ${h}`:`Grade ${h} / Year ${h}`:t}function $e(n){if(!n)return"";const s=n.trim().split(" ");return s.length===1?s[0].substring(0,2).toUpperCase():(s[0][0]+s[s.length-1][0]).toUpperCase()}function re(n,s="DD MMM YYYY"){if(!n)return"";const t=n.endsWith("Z")||n.includes("+")?A(n):A.utc(n).local();return t.isValid()?t.format(s):n}function Li(n){if(!n)return"";const s=n.endsWith("Z")||n.includes("+")?A(n):A.utc(n).local();return s.isValid()?s.fromNow():""}function $i(n,s){if(s<=0)return 0;const t=Math.round(n/s*100);return Math.min(Math.max(t,0),100)}function Di(n=!1){const t=(n?A.utc():A()).hour();return t>=5&&t<12?"Good morning":t>=12&&t<18?"Good afternoon":"Good evening"}function Ai(n){if(!n)return"";if(n.firstName)return n.firstName;const s=n.fullName||n.name||n.displayName||"";return s?s.trim().split(" ")[0]:""}function qi(n){const s=(n||"").toLowerCase();for(const[t,l]of Object.entries(ao))if(s.includes(t)||t.includes(s))return l;return null}const ks=({configs:n})=>{const{t:s}=p.useTranslation();return e.jsxs("div",{className:o.popoverContainer,children:[e.jsxs("div",{className:o.popoverHeader,children:[e.jsx("h3",{className:o.popoverTitle,children:s("what_the_flags_mean")}),e.jsx("p",{className:o.popoverDesc,children:s("two_flag_levels_are_raised_automatically")})]}),e.jsxs("div",{className:o.adminBadge,children:[e.jsx(Gn,{width:13,height:13,color:"#2563eb"}),e.jsx("span",{children:s("thresholds_and_kpis_are_set_by_your_school_admin")})]}),n&&n.length>0&&n.map((t,l)=>{const c=(t.flagName||"").toLowerCase().includes("red");return e.jsxs("div",{className:c?o.flagBlockRed:o.flagBlockYellow,children:[e.jsxs("div",{className:c?o.flagBlockRedHeader:o.flagBlockYellowHeader,children:[e.jsx("h4",{className:c?o.flagBlockTitleRed:o.flagBlockTitleYellow,children:t.flagName}),e.jsx("p",{className:o.popoverDesc,children:t.description||s(c?"critical_performance_issues_or_safety_concerns_detected":"warning_signs_or_declining_trends_requiring_attention")})]}),e.jsxs("div",{className:c?o.flagBlockRedBody:o.flagBlockYellowBody,children:[e.jsx("div",{className:o.sectionSectionLabel,children:s("metrics_label")}),t.safetyThreshold!==void 0&&t.safetyThreshold!==null&&e.jsxs("div",{className:o.metricRow,children:[e.jsx("span",{children:s("safety_label")}),t.safetyLabel&&e.jsx("span",{className:c?o.metricPillRed:o.metricPillYellow,children:t.safetyLabel}),e.jsxs("strong",{children:["<"," ",t.safetyThreshold]})]}),t.stressThreshold!==void 0&&t.stressThreshold!==null&&e.jsxs("div",{className:o.metricRow,children:[e.jsx("span",{children:s("stress_label")}),t.stressLabel&&e.jsx("span",{className:c?o.metricPillRed:o.metricPillYellow,children:t.stressLabel}),e.jsxs("strong",{children:[">"," ",t.stressThreshold]})]}),t.monitoredKpis?.some(h=>h.toLowerCase().includes("readiness"))&&e.jsxs("div",{className:o.metricRow,children:[e.jsx("span",{children:s("readiness_to_learn_label")}),t.readinessLabel&&e.jsx("span",{className:c?o.metricPillRed:o.metricPillYellow,children:t.readinessLabel})]}),t.decreaseInAnyMetric!==void 0&&t.decreaseInAnyMetric!==null&&e.jsxs("div",{className:o.metricRow,children:[e.jsx("span",{children:s("decrease_in_any_metric_label")}),e.jsx("strong",{children:t.decreaseInAnyMetric})]}),t.monitoredKpis&&t.monitoredKpis.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:o.sectionSectionLabel,children:s("monitored_kpis_label")}),e.jsx("div",{className:o.kpiPillsList,children:t.monitoredKpis.map((h,d)=>e.jsx("span",{className:o.kpiPillBlue,children:h},d))})]}),(t.recipientRoles&&t.recipientRoles.length>0||t.notificationMethods&&t.notificationMethods.length>0)&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:o.sectionSectionLabel,children:s("notifications_label")}),e.jsxs("p",{className:o.popoverDesc,children:[t.recipientRoles&&t.recipientRoles.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:s("recipients_label")})," ",t.recipientRoles.join(", "),e.jsx("br",{})]}),t.notificationMethods&&t.notificationMethods.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:s("methods_label")})," ",t.notificationMethods.join(", ")]})]})]})]})]},l)}),e.jsxs("div",{className:o.slaSection,children:[e.jsx("div",{className:o.slaDivider}),e.jsx("h3",{className:o.slaTitle,children:s("sla_policy_engine_and_escalation_matrix")}),e.jsx("p",{className:o.slaSubtitle,children:s("global_school_rules_decide_how_flags_are_raised")}),e.jsx("div",{className:o.slaList,children:ro.map(t=>e.jsxs("div",{className:o.slaItem,children:[e.jsx("div",{className:o.slaIconCircle,style:{backgroundColor:t.bgColor},children:Ii(t.iconType)}),e.jsxs("div",{className:o.slaInfo,children:[e.jsx("h4",{className:o.slaItemTitle,children:t.title}),e.jsx("p",{className:o.slaItemDesc,children:t.description})]})]},t.id))})]})]})},Ri=({items:n,onViewAllHistory:s})=>{const{t}=p.useTranslation(),l=te.useNavigate(),c=r=>{l(`/result-session/${r.sessionId}/${r.sessionResultId}?from=home`)},h=r=>{const g=r.lastInteractionDate?re(r.lastInteractionDate,"YYYY-MM-DD"):re(new Date().toISOString(),"YYYY-MM-DD"),_=encodeURIComponent(r.fullName||"");l(`/my-one-to-one/completed?date=${g}&name=${_}&session=${r.sessionId}&from=overview`)},d=r=>{const g=r.lastInteractionDate?re(r.lastInteractionDate,"YYYY-MM-DD"):re(new Date().toISOString(),"YYYY-MM-DD"),_=encodeURIComponent(r.fullName||"");l(`/my-one-to-one/completed?date=${g}&name=${_}&session=${r.sessionId||""}&from=overview`)};return e.jsxs("div",{className:o.flagsCardBox,children:[e.jsxs("div",{className:o.bannerHeader,children:[e.jsxs("span",{className:o.bannerTitle,children:[e.jsx(qe,{width:14,height:14,color:"#C44140"}),t("assigned_flags_review_or_log_a_1_1")]}),e.jsxs("button",{type:"button",className:o.bannerLink,onClick:()=>{s?s():l("/my-one-to-one/completed")},children:[e.jsx("span",{children:t("view_all_history")}),e.jsx(xe,{width:14,height:14,color:"#C44140"})]})]}),e.jsx("div",{className:o.studentList,children:n&&n.length>0?n.map((r,g)=>{const _=$e(r.fullName),m=r.flagType==="Yellow flag",f=m?o.avatarInitialsYellow:o.avatarInitialsRed,v=r.avatar?p.getFileUrl(r.avatar):"";return e.jsxs("div",{className:o.studentItem,children:[e.jsxs("div",{className:o.studentMeta,children:[v?e.jsx(i.Avatar,{src:v,alt:r.fullName,className:f,style:{width:42,height:42}}):e.jsx("div",{className:f,children:_}),e.jsxs("div",{className:o.studentDetails,children:[e.jsxs("div",{className:o.studentNameRow,children:[e.jsx("span",{children:r.fullName}),r.gradeLevel&&e.jsxs("span",{className:o.studentGradeTag,children:["• ",ws(r.gradeLevel)]})]}),e.jsxs("div",{className:o.studentDateRow,children:[e.jsx(ps,{width:14,height:18,color:m?"#F5D500":"#C44140"}),e.jsx(xs,{width:12,height:12,color:"rgba(36,36,36,0.56)"}),e.jsx("span",{children:re(r.lastInteractionDate,"DD MMM YYYY · h:mm A")})]})]})]}),e.jsxs("div",{className:o.actionBtnGroup,children:[e.jsxs("button",{type:"button",className:o.btnOutline,onClick:()=>c(r),children:[e.jsx(Re,{width:14,height:14,color:"rgba(36,36,36,0.56)"}),t("view_check_in")]}),r.hasOneToOneLogged?e.jsxs("button",{type:"button",onClick:()=>d(r),className:o.btnActionViewNote,children:[e.jsx(Re,{width:12,height:12,color:"#ffffff"}),t("view_note")||"View note"]}):e.jsxs("button",{type:"button",className:o.btnFilledBlue,onClick:()=>h(r),children:[e.jsx(Fe,{width:14,height:14,color:"#ffffff"}),t("log_1_1")]})]})]},r.studentId||g)}):e.jsx("p",{className:o.cardSubtitle,style:{padding:20},children:t("no_assigned_flags_to_display")})})]})},Ei=({items:n})=>{const{t:s}=p.useTranslation();return e.jsxs("div",{children:[e.jsx("div",{className:o.highlightsSubHeader,children:e.jsx("span",{className:o.highlightsSubTab,children:s("celebrating_student_achievements_from_the_last_14_days")})}),e.jsx("div",{className:o.highlightsListContainer,children:n&&n.length>0?n.map((t,l)=>{const c=(t.type||"").toLowerCase(),r=c==="completed_goal"||c==="journey"?o.avatarInitialsGreen:c==="add_goal"||c==="complete_plp"?o.avatarInitialsBlue:o.avatarInitialsYellow,g=t.avatarUrl?p.getFileUrl(t.avatarUrl):oo;return e.jsxs("div",{className:o.highlightCard,children:[e.jsx(i.Avatar,{src:g,alt:t.studentName,className:r,style:{width:42,height:42}}),e.jsxs("div",{className:o.highlightContent,children:[e.jsxs("div",{className:o.highlightHeader,children:[e.jsx("span",{className:o.highlightName,children:t.studentName}),e.jsx("span",{className:o.dateAgoBadge,children:Li(t.createdAt)||s("two_days_ago")})]}),e.jsxs("div",{className:o.highlightTitleRow,children:[Ti(t.type),e.jsx("span",{children:t.title})]}),e.jsx("p",{className:o.highlightDesc,children:t.description})]})]},l)}):e.jsx("p",{className:o.cardSubtitle,children:s("no_student_highlights_to_display")})})]})},Mi=({flagsSection:n,highlightsSection:s,onViewAllHistory:t})=>{const{t:l}=p.useTranslation(),[c,h]=u.useState("flags"),[d,r]=u.useState(!1),g=u.useRef(null);if(u.useEffect(()=>{const N=E=>{g.current&&!g.current.contains(E.target)&&r(!1)};return d&&document.addEventListener("mousedown",N),()=>{document.removeEventListener("mousedown",N)}},[d]),!n)return null;const _=n.items||[],m=s?.items||[],f=n.redFlagCount||0,v=n.yellowFlagCount||0,y=n.totalFlaggedStudents||f+v||_.length,j=s?.totalHighlightsCount||m.length,S=N=>{h(E=>E===N?null:N)},T=os.find(N=>N.key===c),b=l(T?T.subtitleKey:"assigned_flags_from_the_last_15_days");return e.jsxs("div",{className:o.card,children:[e.jsxs("div",{className:o.cardHeader,children:[e.jsxs("div",{children:[e.jsx("h2",{className:o.cardTitle,children:l("what_needs_attention")}),e.jsx("p",{className:o.cardSubtitle,children:b})]}),e.jsxs("div",{ref:g,style:{position:"relative"},children:[e.jsxs("button",{type:"button",className:o.btnAlertsWork,onClick:()=>r(N=>!N),children:[e.jsx(ms,{width:15,height:15,color:"#316CD9"}),e.jsx("span",{children:l("how_alerts_work")})]}),d&&e.jsx(ks,{configs:n.questionAlertsConfig})]})]}),e.jsx("div",{className:o.tabsRow,children:os.map(N=>{const E=c===N.key,O=N.key==="flags"?y:j,W=E&&o[N.activeClass]||"",q=o[N.iconCircleClass]||"",C=o[N.actionLinkClass]||"";return e.jsxs("div",{className:`${o.tabCard} ${W}`,onClick:()=>S(N.key),children:[e.jsxs("div",{className:o.tabHeader,children:[e.jsx("div",{className:q,children:N.iconType==="flag"?e.jsx(qe,{width:18,height:18,color:N.iconColor}):e.jsx(gs,{width:18,height:18,color:N.iconColor})}),e.jsx("span",{children:l(N.labelKey)})]}),e.jsx("div",{className:o.tabValue,children:O}),e.jsx("span",{className:C,children:E?e.jsxs(e.Fragment,{children:[l("hide_list")," ",e.jsx(Zs.ExpandLessIcon,{style:{fontSize:20}})]}):e.jsxs(e.Fragment,{children:[l("view_list")," ",e.jsx(et.ExpandMoreIcon,{style:{fontSize:20}})]})})]},N.key)})}),c&&e.jsx("div",{className:o.tabContentContainer,children:c==="flags"?e.jsx(Ri,{items:_,onViewAllHistory:t}):e.jsx(Ei,{items:m})},c)]})},Bi=({open:n,onClose:s,students:t=[],totalCount:l,onLogOneToOne:c})=>{const{t:h}=p.useTranslation(),d=te.useNavigate(),r=l||t.length,g=f=>{if(s(),c)c(f.studentId);else{const v=f.lastConversationDate?re(f.lastConversationDate,"YYYY-MM-DD"):re(new Date().toISOString(),"YYYY-MM-DD"),y=encodeURIComponent(f.studentName||"");d(`/my-one-to-one/completed?date=${v}&name=${y}&session=${f.sessionId}&from=overview`)}},_=f=>{const v=f.daysWithoutConversation;if(v==null||v>=999||v<0){if(!f.sessionId||!f.sessionResultId){const j=h("no_check_in_recorded");return!j||j==="no_check_in_recorded"?"No check-in recorded":j}const y=h("no_1_1_recorded");return!y||y==="no_1_1_recorded"?"No 1-1 recorded":y}if(v>=14){const y=Math.floor(v/7);return h("last_talked_weeks_ago",{weeks:y})}return h("last_talked_days_ago",{days:v})},m=f=>f?/^\d+$/.test(f.trim())?`Grade ${f.trim()}`:f:"";return e.jsxs(i.Dialog,{open:n,onClose:s,maxWidth:"sm",fullWidth:!0,PaperProps:{style:{borderRadius:24,padding:"8px 12px"}},children:[e.jsxs("div",{className:o.modalHeader,children:[e.jsxs("div",{children:[e.jsx("h2",{className:o.modalTitle,children:h("missing_a_conversation")}),e.jsxs("p",{className:o.modalSubtitle,children:[r," ",h(r===1?"student_with_no_1_1_in_the_last_month":"students_with_no_1_1_in_the_last_month")]})]}),e.jsx("button",{type:"button",className:o.modalCloseBtn,onClick:s,children:e.jsx(Le,{width:16,height:16,color:"rgba(36,36,36,0.56)"})})]}),e.jsx(i.DialogContent,{className:o.modalBody,children:e.jsx("div",{className:o.studentList,children:t&&t.length>0?t.map((f,v)=>{const y=ns[v%ns.length];return e.jsxs("div",{className:o.studentCard,children:[e.jsxs("div",{className:o.studentInfo,children:[e.jsx(i.Avatar,{src:f.avatarUrl,style:{backgroundColor:y,color:"#242424",fontWeight:600},children:$e(f.studentName)}),e.jsxs("div",{children:[e.jsxs("div",{className:o.studentName,children:[f.studentName," ",f.gradeLevel&&e.jsxs("span",{className:o.studentGradeDot,children:["· ",m(f.gradeLevel)]})]}),e.jsxs("div",{className:o.lastTalkedText,children:[e.jsx("span",{style:{marginRight:"4px"},children:"🕒"}),_(f)]})]})]}),f.sessionId&&f.sessionResultId?e.jsxs("button",{type:"button",className:o.btnLogOneToOne,onClick:()=>g(f),children:[e.jsx(Fe,{width:14,height:14,color:"#fff"})," ",h("log_1_1")]}):null]},f.studentId)}):e.jsx("p",{className:o.modalSubtitle,children:h("no_students_currently_missing_a_1_1_conversation")})})})]})},Fi=({missingConversationsSection:n})=>{const{t:s}=p.useTranslation(),[t,l]=u.useState(!1),[c,h]=u.useState(!1),d=n?.totalCount||n?.students?.length||0;return e.jsxs("div",{children:[e.jsxs("div",{className:o.conversationCard,children:[e.jsxs("div",{className:o.convoHeader,children:[e.jsxs("div",{children:[e.jsx("h3",{className:o.cardTitle,children:s("one_to_one_conversation")}),e.jsx("p",{className:o.cardSubtitle,children:s("select_a_student_and_start_a_conversation")})]}),e.jsx(xs,{width:28,height:28,color:"#316CD9"})]}),e.jsx("div",{className:o.btnGroupConvo,children:e.jsxs("button",{type:"button",className:o.btnFilledBlue,onClick:()=>l(!0),children:[e.jsx("span",{children:s("start_label")}),e.jsx(xe,{width:14,height:14,color:"#FFFFFF"})]})})]}),e.jsxs("div",{className:o.conversationCard,children:[e.jsxs("div",{className:o.convoHeader,children:[e.jsxs("div",{children:[e.jsx("h3",{className:o.cardTitle,children:s("missing_a_conversation")}),e.jsx("p",{className:o.cardSubtitle,children:s("students_with_no_1_1_in_the_last_30_days")})]}),e.jsx(fs,{width:26,height:26,color:"#316CD9"})]}),e.jsxs("div",{className:o.missingConvoBox,children:[e.jsxs("div",{className:o.missingText,children:[d," ",e.jsx("span",{children:s(d===1?"student_count_suffix":"students_count_suffix")})]}),e.jsxs("button",{type:"button",className:o.btnFilledRed,onClick:()=>h(!0),children:[e.jsx("span",{children:s("see_students")}),e.jsx(xe,{width:14,height:14,color:"#FFFFFF"})]})]})]}),e.jsx(ds,{open:t,onClose:()=>l(!1)}),e.jsx(Bi,{open:c,onClose:()=>h(!1),students:n?.students,totalCount:n?.totalCount})]})},Gi=({open:n,onClose:s,students:t=[]})=>{const{t:l}=p.useTranslation(),c=te.useNavigate(),h=d=>{c(`/result-session/${d?.sessionId}/${d?.sessionResultId}?from=home`)};return e.jsxs(i.Dialog,{open:n,onClose:s,maxWidth:"md",fullWidth:!0,PaperProps:{style:{borderRadius:24,boxShadow:"0 20px 60px rgba(0, 0, 0, 0.12)",overflow:"hidden"}},children:[e.jsxs("div",{className:o.modalHeader,children:[e.jsxs("div",{children:[e.jsx("h2",{className:o.modalTitle,children:l("unsafe_and_stressed_students")}),e.jsxs("p",{className:o.modalSubtitle,children:[t.length," ",t.length===1?l("student_flagged_for_safety_or_stress"):l("students_flagged_for_safety_or_stress")]})]}),e.jsx("button",{type:"button",className:o.modalCloseBtn,onClick:s,children:e.jsx(Le,{width:16,height:16,color:"rgba(36,36,36,0.56)"})})]}),e.jsx(i.DialogContent,{className:o.dialogContentZero,children:e.jsx("div",{className:o.modalStudentList,children:t&&t.length>0?t.map(d=>e.jsxs("div",{className:o.studentCardBox,children:[e.jsx(i.Avatar,{src:d.studentAvatar,className:o.studentAvatarInitials,children:$e(d.studentName)}),e.jsxs("div",{className:o.studentInfoCol,children:[e.jsx("div",{className:o.studentNameText,children:d.studentName}),d.gradeLevel&&e.jsxs("div",{className:o.studentGradeSub,children:["Grade ",d.gradeLevel]})]}),e.jsxs("div",{className:o.badgesWrapper,children:[d.isUnsafe&&e.jsxs("span",{className:o.unsafeBadge,children:[e.jsx(Un,{width:14,height:14,color:"#C44140"}),e.jsx("span",{children:l("unsafe")})]}),d.isHighStress&&e.jsxs("span",{className:o.highStressBadge,children:[e.jsx(Kn,{width:14,height:14,color:"#B46A00"}),e.jsx("span",{children:l("high_stress")})]})]}),e.jsxs("button",{type:"button",className:o.btnViewCheckInWhite,onClick:()=>h(d),children:[e.jsx(Re,{width:15,height:15,color:"rgba(36,36,36,0.7)"}),l("view_check_in")]})]},d.sessionId||d.studentId)):e.jsx("p",{className:o.modalSubtitle,style:{padding:"20px 0",textAlign:"center"},children:l("no_students_flagged_for_safety_or_stress")})})})]})},Oi=({studentWellnessSection:n})=>{const{t:s}=p.useTranslation(),t=te.useNavigate(),[l,c]=u.useState(!1);if(!n)return null;const h=n.wellness||[],d=n.totalAtRiskCount||(n.unhealthyStudents?n.unhealthyStudents.length:0);return e.jsxs("div",{className:o.card,children:[e.jsx("div",{className:o.cardHeader,children:e.jsxs("div",{children:[e.jsx("h2",{className:o.cardTitle,children:s("student_wellness")}),e.jsx("p",{className:o.cardSubtitle,children:s("this_months_average_vs_last_month")})]})}),e.jsx("div",{className:o.studentList,children:h&&h.length>0?h.map((r,g)=>{const _=(r.key||"").toLowerCase(),m=(r.title||"").toLowerCase(),f=_.includes("stress")||m.includes("stress"),v=r.changeVsLastMonth>=0?"up":"down",y=r.averageScore,j=r.averageScore-r.changeVsLastMonth,S=f?Math.abs(y)<=Math.abs(j):r.changeVsLastMonth>=0,T=st.getColorAnswer(r.averageScore,f);return e.jsxs("div",{className:o.wellnessMetricRow,children:[e.jsxs("div",{className:o.wellnessLeft,children:[Si(r.key,r.title),e.jsx("span",{children:r.title||r.key})]}),e.jsxs("div",{className:o.wellnessPillGreen,style:{backgroundColor:T},children:[e.jsx("span",{children:r.ratingLabel}),e.jsx("span",{className:o.wellnessPillDivider}),e.jsxs("span",{children:[r.averageScore,"%"]})]}),e.jsx("div",{className:o.wellnessTrendingRight,children:e.jsx(Pn,{direction:v,width:20,height:20,color:S?"#0F9655":"#C44140"})})]},r.key||g)}):null}),e.jsxs("button",{type:"button",className:o.fullBtnBlue,onClick:()=>t("/data-dashboard"),children:[e.jsx(Vn,{width:17,height:17,color:"#316CD9"}),e.jsx("span",{children:s("view_data_dashboard")}),e.jsx(xe,{width:14,height:14,color:"#316CD9"})]}),d>0&&e.jsxs("button",{type:"button",className:o.fullBtnRed,onClick:()=>c(!0),children:[e.jsx(Jn,{width:17,height:17,color:"#C44140"}),e.jsxs("span",{children:[s("see_all_unsafe_and_stressed_students")," (",d,")"]}),e.jsx(xe,{width:14,height:14,color:"#C44140"})]}),e.jsx(Gi,{open:l,onClose:()=>c(!1),students:n.unhealthyStudents})]})},Yi=({engagementSection:n,onOpenJourneyModal:s})=>{const{t}=p.useTranslation();if(!n)return null;const l=n.journeys||[],c=n.totalStudentsEngaged??0;return e.jsxs("div",{className:o.card,children:[e.jsxs("div",{className:o.cardHeaderInline,children:[e.jsx("h2",{className:o.cardTitle,children:t("student_journeys")}),e.jsxs("button",{type:"button",className:o.linkBtnInline,onClick:()=>s(),children:[e.jsx("span",{children:t("all_engagement",{total:c})}),e.jsx(xe,{width:18,height:18,color:"#316CD9"})]})]}),e.jsx("div",{className:o.journeysGrid,children:l&&l.length>0?l.map((h,d)=>{const r=h.icon||"",g=r?p.getStaticFileUrl(r):"",_=r.startsWith("http")||r.includes("/")||r.includes("."),m=Ge(h.name,d);return e.jsxs("div",{className:o.journeyItemCard,children:[e.jsxs("div",{className:o.journeyIconTitle,children:[e.jsx("div",{className:o.journeyCircleIcon,style:{backgroundColor:m},children:_?e.jsx("img",{src:g,alt:h.name,className:o.journeyIconImg}):e.jsx("span",{children:r||"🌍"})}),e.jsx("span",{className:o.journeyItemTitle,children:h.name})]}),e.jsxs("div",{className:o.journeyCountBadge,children:[e.jsx(fs,{width:15,height:15,color:"#64748B"}),e.jsx("span",{children:h.studentsEngagedCount||(h.students?h.students.length:0)})]})]},h.journeyId||d)}):e.jsx("p",{className:o.cardSubtitle,children:t("no_journeys_active_at_this_time")})})]})},Wi=({open:n,onClose:s,configs:t=[]})=>{const{t:l}=p.useTranslation();return e.jsxs(i.Dialog,{open:n,onClose:s,maxWidth:"md",fullWidth:!0,PaperProps:{style:{borderRadius:24,boxShadow:"0 20px 60px rgba(0, 0, 0, 0.12)",overflow:"hidden"}},children:[e.jsxs("div",{className:o.modalHeader,children:[e.jsxs("div",{children:[e.jsx("h2",{className:o.modalTitle,children:l("what_the_flags_mean")}),e.jsx("p",{className:o.modalSubtitle,children:l("automated_alert_thresholds_and_notification_rules")})]}),e.jsx("button",{type:"button",className:o.modalCloseBtn,onClick:s,children:e.jsx(Le,{width:16,height:16,color:"rgba(36,36,36,0.56)"})})]}),e.jsx(i.DialogContent,{className:o.modalBody,children:e.jsx(ks,{configs:t})})]})},Hi=({open:n,onClose:s,engagementSection:t,onSelectJourney:l})=>{const{t:c}=p.useTranslation();if(!t)return null;const h=t.journeys||[],d=t.totalStudentsEngaged||0;return e.jsxs(i.Dialog,{open:n,onClose:s,maxWidth:"md",fullWidth:!0,PaperProps:{style:{borderRadius:24,boxShadow:"0 20px 60px rgba(0, 0, 0, 0.12)",overflow:"hidden"}},children:[e.jsxs("div",{className:o.engModalHeader,children:[e.jsxs("div",{children:[e.jsx("h2",{className:o.engModalTitle,children:c("all_student_engagements")}),e.jsx("p",{className:o.engModalSubtitle,children:c("view_overall_student_participation_across_journeys")})]}),e.jsxs("div",{className:o.engHeaderRight,children:[e.jsxs("div",{className:o.engTotalBox,children:[e.jsx("span",{className:o.engTotalLabel,children:c("total_students_engaged")}),e.jsx("span",{className:o.engTotalValue,children:d})]}),e.jsx("button",{type:"button",className:o.modalCloseBtn,onClick:s,children:e.jsx(Le,{width:16,height:16,color:"rgba(36,36,36,0.56)"})})]})]}),e.jsx(i.DialogContent,{className:o.dialogContentZero,children:e.jsx("div",{className:o.engJourneyList,children:h.map((r,g)=>{const _=r.icon||"",m=_?p.getStaticFileUrl(_):"",f=_.startsWith("http")||_.includes("/")||_.includes("."),v=Ge(r.name,g),j=qi(r.name)?.subtitle||r.description||"",S=r.studentsEngagedCount||(r.students?r.students.length:0);return e.jsxs("div",{className:o.engJourneyRow,onClick:()=>l(r),children:[e.jsxs("div",{className:o.engJourneyLeft,children:[e.jsx("div",{className:o.engJourneyCircle,style:{backgroundColor:v},children:f?e.jsx("img",{src:m,alt:r.name,className:o.journeyIconImg}):e.jsx("span",{children:_||"🌍"})}),e.jsx("div",{children:e.jsxs("div",{className:o.engJourneyName,children:[e.jsx("strong",{children:r.name}),j&&e.jsxs("span",{className:o.engJourneyDesc,children:[" - ",j]})]})})]}),e.jsxs("div",{className:o.engJourneyRight,children:[e.jsxs("span",{className:o.engStudentCount,children:[c("students_engaged_label")," ",e.jsx("strong",{children:S})]}),e.jsx("span",{className:o.engArrow,children:e.jsx(xe,{width:22,height:22,color:"#316CD9"})})]})]},r.journeyId||g)})})})]})},Pi=({open:n,onClose:s,journey:t,onBack:l})=>{const{t:c}=p.useTranslation();if(!t)return null;const h=t.students||[],d=t.icon||"",r=d?p.getStaticFileUrl(d):"",g=d.startsWith("http")||d.includes("/")||d.includes("."),_=Ge(t.name,0),m=t.studentsEngagedCount||h.length,f=(t.slug||"").toLowerCase().replace(/-/g,"_"),v=lo.find(y=>y.slug===f)?.text||t.description;return e.jsxs(i.Dialog,{open:n,onClose:s,maxWidth:"md",fullWidth:!0,PaperProps:{style:{borderRadius:24,boxShadow:"0 20px 60px rgba(0, 0, 0, 0.12)",overflow:"hidden"}},children:[e.jsxs("div",{className:o.jpHeader,children:[e.jsxs("div",{className:o.jpHeaderLeft,children:[l&&e.jsx("button",{type:"button",className:o.jpBackBtn,onClick:l,children:e.jsx(ys,{width:26,height:26,color:"#242424"})}),e.jsx("div",{className:o.jpIconCircle,style:{backgroundColor:_},children:g?e.jsx("img",{src:r,alt:t.name,className:o.journeyIconImg}):e.jsx("span",{children:d||"🗺️"})}),e.jsxs("div",{children:[e.jsx("h2",{className:o.jpTitle,children:t.name.includes("Journey")?t.name:`${t.name} Journey`}),e.jsx("p",{className:o.jpDesc,children:v}),e.jsxs("div",{className:o.jpEngagedLabel,children:[c("students_engaged_label")," ",e.jsx("strong",{children:m})]})]})]}),e.jsx("button",{type:"button",className:o.modalCloseBtn,onClick:s,children:e.jsx(Le,{width:16,height:16,color:"rgba(36,36,36,0.56)"})})]}),e.jsx("div",{className:o.jpDivider}),e.jsx(i.DialogContent,{className:o.dialogContentZero,children:e.jsxs("div",{className:o.jpProgressSection,children:[e.jsx("h3",{className:o.jpProgressTitle,children:c("student_progress")}),e.jsx("div",{className:o.jpStudentList,children:h&&h.length>0?h.map(y=>{const j=$i(y.totalXp,y.maxXp||1e3),S=y.avatarUrl?p.getFileUrl(y.avatarUrl):"";return e.jsxs("div",{className:o.jpStudentCard,children:[e.jsxs("div",{className:o.jpStudentLeft,children:[e.jsx(i.Avatar,{src:S,className:o.studentAvatarInitials,children:$e(y.studentName)}),e.jsx("div",{children:e.jsx("div",{className:o.jpStudentName,children:y.studentName})})]}),e.jsxs("div",{className:o.jpProgressCol,children:[e.jsxs("div",{className:o.jpXpHeader,children:[e.jsxs("span",{className:o.jpXpLabel,children:["⚡",c("xp_progress")]}),e.jsxs("span",{className:o.jpXpValue,children:[e.jsx("strong",{children:y.totalXp})," ",e.jsxs("span",{children:["/ ",y.maxXp||1e3]})]})]}),e.jsx("div",{className:o.jpProgressBar,children:e.jsx("div",{className:o.jpProgressFill,style:{width:`${j}%`}})})]})]},y.studentId)}):e.jsx("p",{className:o.modalSubtitle,style:{padding:"20px 0",textAlign:"center"},children:c("no_students_engaged_in_this_journey_yet")})})]})})]})},Me="mario_flags_history_filters",Vi=()=>{try{const n=sessionStorage.getItem(Me);if(n)return JSON.parse(n)}catch{}return null},Ji=()=>{const[n,s]=u.useState([]),[t,l]=u.useState(!0),c=u.useMemo(()=>Vi(),[]),[h,d]=u.useState(c?.searchQuery||""),[r,g]=u.useState(c?.selectedGrades||["All grades"]),[_,m]=u.useState(c?.fromDate||""),[f,v]=u.useState(c?.toDate||""),[y,j]=u.useState(c?.selectedType||"All types");u.useEffect(()=>{try{sessionStorage.setItem(Me,JSON.stringify({searchQuery:h,selectedGrades:r,fromDate:_,toDate:f,selectedType:y}))}catch{}},[h,r,_,f,y]);const S=Q.useSelector(C=>C.common?.user);let T='["teacher"]';if(S?.activeRole)T=typeof S.activeRole=="string"&&S.activeRole.startsWith("[")?S.activeRole:JSON.stringify(Array.isArray(S.activeRole)?S.activeRole:[S.activeRole.toLowerCase()]);else if(Array.isArray(S?.roles)){const C=S.roles.filter(M=>M.toLowerCase()!=="student").map(M=>M.toLowerCase());T=JSON.stringify(C.length>0?C:["teacher"])}const b=u.useCallback(async()=>{l(!0);try{const C=await Bn(T);C&&C.data?s(C.data):s([])}catch(C){console.error("Failed to fetch flags history:",C),s([])}finally{l(!1)}},[T]);u.useEffect(()=>{b()},[b]);const N=u.useMemo(()=>{const C=new Set;return n.forEach(L=>{L.gradeLevel&&C.add(L.gradeLevel)}),["All grades",...Array.from(C).sort((L,F)=>{const $=parseInt(L.replace(/\D/g,""),10),k=parseInt(F.replace(/\D/g,""),10);return!isNaN($)&&!isNaN(k)?$-k:L.localeCompare(F,void 0,{numeric:!0,sensitivity:"base"})})]},[n]),E=u.useCallback(C=>{if(C==="All grades"){g(["All grades"]);return}g(M=>{const L=M.filter(F=>F!=="All grades");if(L.includes(C)){const F=L.filter($=>$!==C);return F.length===0?["All grades"]:F}else return[...L,C]})},[]),O=u.useMemo(()=>n.filter(C=>{if(h.trim()){const M=h.toLowerCase().trim(),L=C.fullName?C.fullName.toLowerCase().includes(M):!1,F=C.gradeLevel?C.gradeLevel.toLowerCase().includes(M):!1;if(!L&&!F)return!1}if(r.length>0&&!r.includes("All grades")){const M=C.gradeLevel?C.gradeLevel:"";if(!M||!r.includes(M))return!1}if(y!=="All types"&&C.flagType!==y)return!1;if(_||f){if(!C.lastInteractionDate)return!1;const M=new Date(C.lastInteractionDate).getTime();if(_){const L=new Date(`${_}T00:00:00`).getTime();if(M<L)return!1}if(f){const L=new Date(`${f}T23:59:59`).getTime();if(M>L)return!1}}return!0}).sort((C,M)=>{const L=C.lastInteractionDate?new Date(C.lastInteractionDate).getTime():0;return(M.lastInteractionDate?new Date(M.lastInteractionDate).getTime():0)-L}),[n,h,r,y,_,f]),W=u.useCallback(()=>{if(!O.length)return;const C=["Student","Grade","Type","Date & Time","Logged By","Status"],M=O.map(D=>[`"${(D.fullName||"").replace(/"/g,'""')}"`,`"${(D.gradeLevel||"").replace(/"/g,'""')}"`,`"${(D.flagType||"").replace(/"/g,'""')}"`,`"${D.lastInteractionDate?re(D.lastInteractionDate,"DD MMM YYYY · HH:mm A"):""}"`,`"${(D.loggedByEducatorName||"Student check-in").replace(/"/g,'""')}"`,`"${D.hasOneToOneLogged?"Closed":"Pending"}"`]),L=[C.join(","),...M.map(D=>D.join(","))].join(`
235
+ `),F=new Blob([L],{type:"text/csv;charset=utf-8;"}),$=URL.createObjectURL(F),k=document.createElement("a");k.setAttribute("href",$),k.setAttribute("download",`flags_history_${new Date().toISOString().slice(0,10)}.csv`),document.body.appendChild(k),k.click(),document.body.removeChild(k)},[O]),q=u.useCallback(()=>{d(""),g(["All grades"]),m(""),v(""),j("All types");try{sessionStorage.removeItem(Me)}catch{}},[]);return{loading:t,items:O,rawItems:n,gradeOptions:N,searchQuery:h,setSearchQuery:d,selectedGrades:r,setSelectedGrades:g,handleToggleGrade:E,fromDate:_,setFromDate:m,toDate:f,setToDate:v,selectedType:y,setSelectedType:j,handleExportCSV:W,resetFilters:q,refresh:b}},Ui=()=>{const{t:n}=p.useTranslation(),s=(t,l)=>{switch(t){case"folderAdd":return e.jsx(Zn,{width:16,height:16,color:l});case"bell":return e.jsx(js,{width:16,height:16,color:l});case"userCheck":return e.jsx(eo,{width:16,height:16,color:l});case"search":return e.jsx(vs,{width:16,height:16,color:l});case"lockCheck":return e.jsx(so,{width:16,height:16,color:l});default:return null}};return e.jsxs("div",{className:o.caseWorkflowPopoverCard,children:[e.jsxs("div",{className:o.caseWorkflowPopoverHeader,children:[e.jsx("h3",{className:o.caseWorkflowPopoverTitle,children:n("case_lifecycle_sla_workflow")||io}),e.jsx("p",{className:o.caseWorkflowPopoverSubtitle,children:n("how_every_safeguarding_case_moves")||co})]}),e.jsx("div",{className:o.caseWorkflowTimelineContainer,children:ho.map(t=>e.jsxs("div",{className:o.caseWorkflowStepRow,children:[e.jsx("div",{className:o.caseWorkflowStepIconCol,children:e.jsx("div",{className:o.caseWorkflowStepCircle,style:{backgroundColor:t.bgColor},children:s(t.iconType,t.iconColor)})}),e.jsxs("div",{className:o.caseWorkflowStepContentCol,children:[e.jsx("div",{className:o.caseWorkflowStepLabel,children:n(t.stepLabelKey)||t.stepLabel}),e.jsx("h4",{className:o.caseWorkflowStepTitle,children:n(t.titleKey)||t.title}),e.jsx("p",{className:o.caseWorkflowStepDesc,children:n(t.descKey)||t.description}),t.badgeText&&e.jsxs("div",{className:o.caseWorkflowStepBadge,style:{backgroundColor:t.badgeBgColor,color:t.badgeTextColor},children:[e.jsx("span",{style:{fontSize:13,lineHeight:1},children:"🕒"}),e.jsx("span",{children:t.badgeTextKey&&n(t.badgeTextKey)||t.badgeText})]})]})]},t.stepNumber))})]})},Ki=({onBack:n})=>{const{t:s}=p.useTranslation(),t=te.useNavigate(),[l,c]=u.useState(!1),h=u.useRef(null),[d,r]=u.useState(!1),g=u.useRef(null),[_,m]=u.useState(!1),f=u.useRef(null),{loading:v,items:y,gradeOptions:j,searchQuery:S,setSearchQuery:T,selectedGrades:b,handleToggleGrade:N,fromDate:E,setFromDate:O,toDate:W,setToDate:q,selectedType:C,setSelectedType:M,handleExportCSV:L,resetFilters:F}=Ji(),$=()=>{F(),n()},k=[{value:"All types",label:s("all_types")||"All types"},{value:"Red flag",label:s("red_flag")||"Red flag"},{value:"Yellow flag",label:s("yellow_flag")||"Yellow flag"}],D=()=>{const w=k.find(G=>G.value===C);return w?w.label:s("all_types")||"All types"};u.useEffect(()=>{const w=G=>{g.current&&!g.current.contains(G.target)&&r(!1),f.current&&!f.current.contains(G.target)&&m(!1)};return document.addEventListener("mousedown",w),()=>{document.removeEventListener("mousedown",w)}},[]);const V=w=>w==="All grades"?s("all_grades")||"All grades":w.toLowerCase().startsWith("grade")?w:w.toLowerCase()==="k"||w.toLowerCase()==="kindergarten"?"Kindergarten":`Grade ${w}`,U=w=>w.replace(/grade/gi,"").trim(),I=w=>[...w].sort((G,X)=>{const ne=parseInt(G.replace(/\D/g,""),10),ie=parseInt(X.replace(/\D/g,""),10);return!isNaN(ne)&&!isNaN(ie)?ne-ie:G.localeCompare(X,void 0,{numeric:!0,sensitivity:"base"})}),J=()=>{if(b.includes("All grades")||b.length===0)return s("all_grades")||"All grades";const w=I(b);return w.length===1?V(w[0]):`Grade ${w.map(U).join(", ")}`},Y=w=>{const G=w.lastInteractionDate?re(w.lastInteractionDate,"YYYY-MM-DD"):re(new Date().toISOString(),"YYYY-MM-DD"),X=encodeURIComponent(w.fullName||"");t(`/my-one-to-one/completed?date=${G}&name=${X}&session=${w.sessionId||""}&from=flags_history`)},K=w=>{const G=w.lastInteractionDate?re(w.lastInteractionDate,"YYYY-MM-DD"):re(new Date().toISOString(),"YYYY-MM-DD"),X=encodeURIComponent(w.fullName||"");t(`/my-one-to-one/completed?date=${G}&name=${X}&session=${w.sessionId||""}&from=flags_history`)};return e.jsxs("div",{className:o.flagsHistoryContainer,children:[e.jsxs("button",{type:"button",className:o.btnBackHome,onClick:$,children:[e.jsx(ys,{width:18,height:18,color:"rgba(36, 36, 36, 0.6)"}),s("back_to_home")||"Back to home"]}),e.jsxs("div",{className:o.flagsHistoryHeader,children:[e.jsxs("div",{children:[e.jsxs("h1",{className:o.flagsHistoryTitle,children:[s("flags_history")||"Flags history",e.jsxs("div",{ref:h,style:{position:"relative",display:"inline-flex"},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),children:[e.jsx("button",{type:"button",className:o.btnInfoCircle,onClick:()=>c(w=>!w),children:e.jsx(ms,{width:14,height:14,color:"#316CD9"})}),l&&e.jsx(Ui,{})]})]}),e.jsx("p",{className:o.flagsHistorySubtitle,children:s("every_red_and_yellow_flag_this_school_year")||"Every red and yellow flag this school year: who logged it, when, reassignments, and follow-up status."})]}),e.jsxs("button",{type:"button",className:o.btnExportCsv,onClick:L,children:[e.jsx(Xn,{width:18,height:18,color:"#ffffff"}),s("export_csv")||"Export CSV"]})]}),e.jsxs("div",{className:o.flagsHistoryCard,children:[e.jsxs("div",{className:o.flagsHistoryFilterBar,children:[e.jsxs("div",{className:o.searchBox,children:[e.jsx(to,{width:18,height:18,color:"rgba(36,36,36,0.56)"}),e.jsx("input",{type:"text",value:S,onChange:w=>T(w.target.value),placeholder:s("search_by_student")||"Search by student…",className:o.searchInput}),S&&e.jsx("button",{type:"button",onClick:()=>T(""),className:o.btnClearSearch,children:"✕"})]}),e.jsxs("div",{ref:g,style:{position:"relative"},children:[e.jsxs("button",{type:"button",className:o.multiSelectDropdownBtn,onClick:()=>r(w=>!w),children:[e.jsx("span",{className:o.multiSelectDropdownLabel,children:J()}),e.jsx("span",{style:{fontSize:10,color:"rgba(36,36,36,0.5)",flexShrink:0},children:"▼"})]}),d&&e.jsx("div",{className:o.multiSelectDropdownMenu,children:j.map(w=>{const G=b.includes(w);return e.jsxs("label",{className:o.multiSelectDropdownItem,children:[e.jsx("input",{type:"checkbox",checked:G,onChange:()=>N(w)}),e.jsx("span",{children:V(w)})]},w)})})]}),e.jsx(tt.LocalizationProvider,{dateAdapter:nt.AdapterMoment,children:e.jsxs("div",{className:o.datePickerContainer,children:[e.jsx(Ve.DatePicker,{format:"DD MMM YYYY",label:s("from")||"From",value:E?A(E):null,onChange:w=>O(w&&A(w).isValid()?A(w).format("YYYY-MM-DD"):""),slotProps:{textField:{variant:"outlined",size:"small",className:o.datePickerItem},openPickerButton:{"aria-label":"change date"}},maxDate:W?A(W):void 0}),e.jsx(Ve.DatePicker,{minDate:E?A(E):void 0,format:"DD MMM YYYY",label:s("to")||"To",value:W?A(W):null,onChange:w=>q(w&&A(w).isValid()?A(w).format("YYYY-MM-DD"):""),slotProps:{textField:{variant:"outlined",size:"small",className:o.datePickerItem},openPickerButton:{"aria-label":"change date"}}}),(E||W)&&e.jsx("button",{type:"button",onClick:()=>{O(""),q("")},className:o.btnClearSearch,title:"Clear dates",children:"✕"})]})}),e.jsxs("div",{ref:f,style:{position:"relative"},children:[e.jsxs("button",{type:"button",className:`${o.multiSelectDropdownBtn} ${o.typeDropdownBtn}`,onClick:()=>m(w=>!w),children:[e.jsx("span",{className:o.multiSelectDropdownLabel,children:D()}),e.jsx("span",{style:{fontSize:10,color:"rgba(36,36,36,0.5)",flexShrink:0},children:"▼"})]}),_&&e.jsx("div",{className:o.multiSelectDropdownMenu,children:k.map(w=>{const G=C===w.value;return e.jsx("div",{className:`${o.multiSelectDropdownItem} ${G?o.dropdownItemSelected:""}`,onClick:()=>{M(w.value),m(!1)},children:e.jsx("span",{children:w.label})},w.value)})})]})]}),e.jsxs("div",{className:o.tableHeaderGrid,children:[e.jsx("span",{children:s("student")||"Student"}),e.jsx("span",{children:s("type")||"Type"}),e.jsx("span",{children:s("date_and_time")||"Date & time"}),e.jsx("span",{children:s("logged_by")||"Logged by"}),e.jsx("span",{children:s("assigned")||"Assigned"}),e.jsx("span",{children:s("status_follow_up")||"Status / follow-up"})]}),e.jsx("div",{className:o.tableBodyBox,children:v?e.jsx("div",{className:o.loadingBox,children:e.jsx(i.CircularProgress,{size:32})}):y.length===0?e.jsx("div",{className:o.emptyFlagsText,children:s("no_flags_to_display")||"No flags match your filters."}):y.map((w,G)=>{const X=w.flagType==="Yellow flag",ne=w.avatar?p.getFileUrl(w.avatar):"",ie=$e(w.fullName),me=w.hasOneToOneLogged;return e.jsxs("div",{className:`${o.tableRowGrid} ${G%2===0?o.tableRowEven:o.tableRowOdd}`,children:[e.jsxs("div",{className:o.studentMetaCol,children:[ne?e.jsx(i.Avatar,{src:ne,sx:{width:34,height:34}}):e.jsx("div",{className:X?o.avatarInitialsYellow:o.avatarInitialsRed,children:ie}),e.jsxs("div",{style:{minWidth:0,overflow:"hidden"},children:[e.jsx("div",{className:o.studentNameText,children:w.fullName}),e.jsx("div",{className:o.studentGradeText,children:w.gradeLevel&&ws(w.gradeLevel)})]})]}),e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[e.jsxs("span",{className:X?o.flagTypeBadgeYellow:o.flagTypeBadgeRed,children:[e.jsx("span",{className:X?o.flagDotYellow:o.flagDotRed}),w.flagType]}),e.jsx(ps,{width:14,height:14,color:X?"#FFB04F":"#C44140"})]}),e.jsx("div",{className:o.dateText,children:w.lastInteractionDate?re(w.lastInteractionDate,"DD MMM YYYY · hh:mm A"):"—"}),e.jsx("div",{className:o.loggedByText,children:w.loggedByEducatorName||s("student_check_in")||"Student check-in"}),e.jsx("div",{className:o.assignedText,children:"—"}),e.jsx("div",{children:me?e.jsxs("div",{className:o.statusCol,children:[e.jsxs("span",{className:o.closedBadge,children:["✓ ",s("closed")||"Closed"]}),e.jsxs("button",{type:"button",onClick:()=>Y(w),className:o.btnActionViewNote,children:[e.jsx(Re,{width:12,height:12,color:"#ffffff"}),s("view_note")||"View note"]})]}):e.jsxs("div",{className:o.statusCol,children:[e.jsxs("span",{className:o.pendingBadge,children:[e.jsx(no,{width:13,height:13,color:"#C44140"}),s("pending")||"Pending"]}),e.jsxs("button",{type:"button",onClick:()=>K(w),className:o.btnFilledBlue,children:[e.jsx(Fe,{width:14,height:14,color:"#ffffff"}),s("log_1_1")||"Log 1:1"]})]})})]},w.sessionId||w.studentId||G)})})]})]})},zi=()=>{const n=te.useLocation(),t=u.useMemo(()=>new URLSearchParams(n.search),[n.search]).get("view"),[l,c]=u.useState(t==="flagsHistory"?"flagsHistory":"overview");u.useEffect(()=>{t==="flagsHistory"&&c("flagsHistory")},[t]);const h=Q.useSelector(C=>C.common?.user),d=Di(),r=Ai(h),g=r?`${d}, ${r}`:d,{data:_,loading:m,error:f,openFlagsModal:v,openJourneyModal:y,selectedJourney:j,handleOpenFlagsModal:S,handleCloseFlagsModal:T,handleOpenJourneyModal:b,handleCloseJourneyModal:N}=Fn(),E=C=>{b(C)},O=()=>{b()};if(l==="flagsHistory")return e.jsx(Ki,{onBack:()=>c("overview")});if(f)return e.jsx("div",{className:o.overviewContainer,children:e.jsx("p",{className:o.cardSubtitle,children:"Error loading overview data. Please try again later."})});const W=y&&!j,q=y&&!!j;return e.jsxs("div",{className:o.overviewContainer,children:[e.jsxs("div",{className:o.greetingHeader,children:[e.jsx("h1",{className:o.greetingTitle,children:g}),e.jsx("p",{className:o.greetingSubtitle,children:"Here's what's happening with your students recently"})]}),e.jsxs("div",{className:o.topLayoutGrid,children:[m?e.jsx("div",{className:o.blockLoadingContainer,style:{minHeight:340},children:e.jsx(i.CircularProgress,{size:32,style:{color:"#316CD9"}})}):e.jsx(Mi,{flagsSection:_?.flagsSection,highlightsSection:_?.highlightsSection,onOpenInfoModal:S,onViewAllHistory:()=>c("flagsHistory")}),m?e.jsx("div",{className:o.blockLoadingContainer,style:{minHeight:340},children:e.jsx(i.CircularProgress,{size:32,style:{color:"#316CD9"}})}):e.jsx(Fi,{missingConversationsSection:_?.missingConversationsSection})]}),e.jsxs("div",{className:o.bottomLayoutGrid,children:[m?e.jsx("div",{className:o.blockLoadingContainer,style:{minHeight:260},children:e.jsx(i.CircularProgress,{size:32,style:{color:"#316CD9"}})}):e.jsx(Oi,{studentWellnessSection:_?.studentWellnessSection}),m?e.jsx("div",{className:o.blockLoadingContainer,style:{minHeight:260},children:e.jsx(i.CircularProgress,{size:32,style:{color:"#316CD9"}})}):e.jsx(Yi,{engagementSection:_?.engagementSection,onOpenJourneyModal:b})]}),e.jsx(Wi,{open:v,onClose:T,configs:_?.flagsSection?.questionAlertsConfig}),e.jsx(Hi,{open:W,onClose:N,engagementSection:_?.engagementSection,onSelectJourney:E}),e.jsx(Pi,{open:q,onClose:N,journey:j,onBack:O})]})},Qi=()=>{const s=Q.useSelector(t=>t.common?.user)?.roles?.includes("Student");return e.jsx("div",{className:`${a.home["home-wrapper"]} h-100`,children:s?e.jsx(En,{}):e.jsx(zi,{})})};exports.default=Qi;