mario-teacher-student-client 2.2.6-release → 2.2.8-release

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"),o=require("./LearningPlanChip-fJNgsJiX.cjs"),ae=require("./styles.module-qEnh_9p1.cjs"),os=require("date-fns"),p=require("mario-core"),oe=require("./ArrowIcon-F5L7sPU_.cjs"),Es=require("./PlusIcon-BupcXmKx.cjs"),ye=require("./StudentSelector-BTWOd-_R.cjs"),Ie=require("./Error-B1W3Ilwy.cjs"),Bs=require("./CheckCircle-B93hTHH7.cjs"),Fs=require("./useChartOneToOne-BV5FDATD.cjs"),Gs=require("./utils-Bkd9m9N7.cjs"),de=require("./SimpleDialog-Cv1oQ1wV.cjs"),P=require("./constants-BJ-bWPpG.cjs"),ls=require("./CalendarIcon-DcA4xF5x.cjs"),he=require("./myOneToOne.module-Bn2RaIiP.cjs"),Ae=require("./OneToOne-sN0TScKJ.cjs"),Os=require("./StudentSupporterSelector-CBZLoTCi.cjs"),Fe=require("./useStudentList-CtKHls5N.cjs"),Ys=require("@fullcalendar/react"),Ws=require("@fullcalendar/timegrid"),Hs=require("@emotion/styled"),z=require("./constants-BvFRR4A_.cjs"),pe=require("./styled-lvsUm6Nd.cjs"),qe=require("lodash"),Ps=require("./ArrowBack-7VCmUcq8.cjs"),rs=require("./ArrowForward-YavAssQw.cjs"),qs=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("./ConfirmStartWellBeing-BJy0P06m.cjs"),tt=require("./useMyWellBeing-B2oOB61C.cjs"),nt=require("./constants-CANl_Dur.cjs"),at=require("./useMobilePicker-Brs_CiL1.cjs"),ot=require("./AdapterMoment-B-q0UCj0.cjs"),Ve=require("./DatePicker-DDrDhIgn.cjs"),lt={position:"absolute",top:"100px",left:"50%",zIndex:1e3,transform:"translate(-50%, 0)"},is=()=>e.jsxs("div",{style:lt,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..."})})]}),rt=`${p.BASE_URL}/api/GoogleCalendar/eventCalendarDashboard`,it=`${p.BASE_URL}/api/GoogleCalendar/eventTotalCardDashboard`,ct=(n,s,t,l)=>p.api.get(`${rt}`,{params:{userId:n,startDate:s,roles:t,type:l}}),dt=(n,s,t)=>p.api.get(`${p.BASE_URL}/api/GoogleCalendar/eventCalendarToDay`,{params:{startDate:n,teacherUserId:s,roles:t}}),ht=n=>p.api.get(`${it}`,{params:n}),ut=20,_t=12,mt=(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(()=>_==ut?"font-large":_==_t?"font-small":"",[_]),y=u.useCallback(async()=>{g(!0),t&&t(v=>({...v,todaySchedule:!1}));try{const v=await dt(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(()=>{y()},[l]),{isLoading:r,response:h,classFontSize:m}},gt=({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"})}),pt=292,xt=({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:y}=mt(g,t,h),v=u.useRef(null),[f,j]=u.useState([]),S=N=>`${o.home[`today-schedule__list-item--${`${N.summary.startsWith("1-1 Conversation")?"conversation":N.summary.startsWith("Conference")?"conference":"check-in"}`}`]}`,T=N=>{const{studentId:b,sessionId:E,conferenceId:Y,teacherResultId:H,studentResultId:R}=N;if(H||R){r(`/start-question/${E}/${c?R:H}`);return}if(Y){r(`/start-conference/${b}/${Y}/conferenceRubric`);return}};return u.useEffect(()=>{if(_){const N=_.sort((b,E)=>os.compareAsc(new Date(b.startDate),new Date(E.startDate))).map(b=>({text:p.utcToLocalTime(b.startDate,"h:mm a"),summary:`${b.summary}`,time:parseInt(p.utcToLocalTime(b.startDate,"H")),location:b.location,sessionId:b.sessionId,conferenceId:b.conferenceId,teacherResultId:b.sessionResult?.find(E=>!!E.isTeacherResult)?.id,studentResultId:b.sessionResult?.find(E=>!E.isTeacherResult)?.id,studentId:b.conferenceAnswers?.studentId||b.sessionResult?.[0]?.studentId}));j(N)}},[_,n]),e.jsxs("div",{className:`${o.home["today-schedule"]} ${o.home[y]} h-100 d-flex flex-column`,children:[e.jsx(i.Typography,{className:`${o.home["today-schedule__title"]} text-capitalize`,children:d("today_schedule")}),e.jsx("div",{className:`${o.home["today-schedule__view"]}`,children:e.jsx(i.Button,{variant:"text",color:"primary",endIcon:e.jsx(gt,{}),className:`${o.home["today-schedule__view__btn"]}`,onClick:l,children:e.jsx(i.Typography,{className:`${o.home["today-schedule__view__text"]}`,children:d("view_calendar")})})}),e.jsxs(i.List,{ref:v,className:`position-relative ${o.home["today-schedule__list"]} flex-grow-1 ${v.current?.scrollHeight&&v.current?.scrollHeight>pt?`${o.home["today-schedule__list--scroll"]} ${ae.styles["custom-scrollbar"]}`:""} ${m?o.home["today-schedule__list--loading"]:""}`,children:[f.length>0?f.map((N,b)=>e.jsxs(i.ListItem,{className:`${o.home["today-schedule__list-item"]} ${S(N)}`,onClick:()=>T(N),children:[e.jsx(i.Typography,{className:`${o.home["today-schedule__list-item__time"]}`,children:N.text}),e.jsx(i.Typography,{className:`${o.home["today-schedule__list-item__content"]}`,children:N.summary})]},b)):e.jsxs(i.ListItem,{className:`${o.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:`${o.home["student-wellness__note"]} ${t?o.home["student-wellness__note--danger"]:""} ${g}`,children:[e.jsx("span",{className:`${o.home["student-wellness__note__icon"]}`,children:t?e.jsx(Ie.ErrorIcon,{className:`${o.home["student-wellness__note__icon--danger"]}`}):e.jsx(Bs.CheckCircleIcon,{className:`${o.home["student-wellness__note__icon--success"]}`})}),e.jsxs("div",{children:[!t&&e.jsxs(i.Typography,{children:[d,"."]}),!!n&&e.jsx(i.Typography,{className:`${o.home["student-wellness__item__info"]}`,children:e.jsxs("span",{children:[e.jsx("span",{className:` ${o.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:`${o.home["student-wellness__item__info__students"]} mb-0`,onClick:r,children:["(",_("see_them"),")"]}),!!t&&h&&e.jsx(i.Typography,{className:`${o.home["student-wellness__item__info"]} d-block`,children:e.jsxs("span",{children:[e.jsx("span",{className:`text-nowrap ${o.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:`${o.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:y})=>{const{t:v}=p.useTranslation(),f=()=>{g?.()};return e.jsxs("div",{className:`${o.home["student-wellness__item"]} h-100 d-flex flex-column`,children:[_&&e.jsxs(i.Grid,{container:!0,className:`${o.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:`${o.home["student-wellness__item__name"]}`,children:n}),e.jsx("div",{className:`${o.home["student-wellness__item__image"]} d-block d-lg-none`,children:e.jsx("img",{src:s,alt:n})})]}),e.jsxs("div",{className:`${o.home["student-wellness__item__info"]} ${o.home[`student-wellness__item__info--${l>=0?"increase":"decrease"}`]} flex-wrap`,children:[e.jsx("span",{className:`${o.home["student-wellness__item__info__percent"]} ${o.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:`${o.home["student-wellness__item__info__icon"]} ${n.includes("Stress")&&o.home.stress}`,children:e.jsx(Je,{style:{transform:`rotate(${l>=0?"0deg":"180deg"})`}})}),e.jsx("span",{className:`${o.home["student-wellness__item__info__percent-diff"]} ${o.home["student-wellness__item__info__percent--bold"]} ${n.includes("Stress")&&o.home.stress}`,children:`${Math.abs(l).toFixed(2)}%`})]}),e.jsx("span",{className:"text-nowrap",children:v("vs_last_month")})]})]})]}),e.jsx("div",{className:`${o.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:`${o.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:`${o.home["student-wellness__item__name"]}`,children:n}),e.jsx("div",{className:`${o.home["student-wellness__item__image"]}`,children:e.jsx("img",{src:s,alt:n})})]}),e.jsxs("div",{className:`${o.home["student-wellness__item__info"]} ${o.home[`student-wellness__item__info--${l>=0?"increase":"decrease"}`]} d-block`,children:[e.jsx("p",{className:`${o.home["student-wellness__item__info__percent"]} ${o.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:`${o.home["student-wellness__item__info__icon"]} ml-0`,children:e.jsx(Je,{style:{transform:`rotate(${l>=0?"0deg":"180deg"})`}})}),e.jsx("span",{className:`${o.home["student-wellness__item__info__percent-diff"]} ${o.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:f,defaultText:y,seeMoreable:!0})]})},yt="/images/image-default.png",ft=({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(),y=()=>{t(l,c,!0)},v=u.useMemo(()=>n&&n!==P.DATE_MIN_VALUE?A().diff(A.utc(n).local(),"hours"):void 0,[n]);return e.jsx("div",{children:e.jsxs("div",{className:`${o.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)||yt}),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:`${o.home["check-in-item__name"]}`,children:h}),!!r&&e.jsx("span",{className:`${o.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:`${o.home["check-in-item__type"]} text-nowrap`,children:`${m(_?"check_in_flagged":"last_1_1")}:`}),e.jsxs("div",{className:`${o.home["check-in-item__info"]}`,children:[!!s&&s!==P.DATE_MIN_VALUE&&e.jsx(i.Typography,{className:`${o.home["check-in-item__info__time"]}`,children:p.utcToLocalTime(s,"do MMM yyyy - hh:mm a")}),v!==void 0&&!!n&&e.jsxs("div",{className:`${o.home["check-in-item__info__note"]}`,children:[e.jsx("span",{className:`${o.home["check-in-item__info__note__icon"]}`,children:e.jsx(Ie.ErrorIcon,{})}),e.jsx(i.Typography,{className:`${o.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:`${o.home["check-in-item__percent"]} ${r>0?o.home["check-in-item__percent--success"]:""}`,children:[e.jsx("span",{className:`${o.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:`${o.home["check-in-item__action"]}`,children:e.jsx(i.Button,{className:`${o.home["check-in-item__action__btn"]}`,variant:"text",color:"primary",onClick:y,children:m("view_results")})})]})})},jt=({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:`${ae.styles["custom-scrollbar"]} ${s.length>5?o.home["check-in-list--scroll"]:""} ${n}`,children:[s.length>0&&s.map((d,r)=>e.jsx("div",{className:`${o.home["check-in-list__item"]} w-100`,children:e.jsx(ft,{onView:t,endTime:d.endTime||P.DATE_MIN_VALUE,startTime:d.startTime||P.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:`${o.home["check-in-list__item"]} ${o.home["check-in-list__item--empty"]}`,children:e.jsx(i.Typography,{children:c||h("no_last_or_requested_check_ins")})})]})},vt=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(wt,{checkIns:l,subject:c})})},wt=({checkIns:n,subject:s})=>{const{t}=p.useTranslation(),[l,c]=u.useState(0),h=te.useNavigate(),d=(_,m)=>{const y=`/start-question/${_}/${m}`;h(y)},r=()=>n.filter(_=>_.studentId==l||!l),g=u.useMemo(()=>r(),[n,l]);return e.jsxs("div",{className:`${o.home["this-week-checkIn-dialog"]}`,children:[e.jsxs("div",{className:`${o.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:`${o.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:`${o.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:`${o.home["this-week-checkIn-dialog__head__selector"]}`,children:e.jsx(ye.StudentSelector,{setStudentId:c,studentId:l,isDialog:!0})})]}),e.jsx("div",{className:`${o.home["this-week-checkIn-dialog__body"]}`,children:e.jsx(jt,{className:`${o.home["check-in-list"]}`,onView:d,checkInList:g})})]})},kt=({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,y]=u.useState(""),{avgQuestionLastMonth:v,stressData:f,safetyData:j,preparednessData:S,studentSkillQuestion:T,getDataStudentSkillServices:N,getDataOneToOne:b}=Fs.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 N(),await b(h),t&&t(I=>({...I,dataCheckIns:!0}))},Y=()=>{c("/data-dashboard")},H=()=>{_(!1),r(void 0)},R=()=>_(!0),C=(I,J)=>{r(I),y(J),R()},B=(I,J)=>!I||!I?.data?.length?0:Gs.handleAveraged(I.data,J)??0,L=I=>{if(!I||!I?.data?.length)return 0;const W=I.data.reduce((w,O)=>w+O,0)/I.data.length,K=v.find(w=>w.questionText.toLocaleLowerCase().includes(I.name.toLocaleLowerCase()));return K?K.avgQuestionResponse-K.avgQuestionResponseLastMonth:W},G=u.useMemo(()=>B(j?.[0]),[j]),D=u.useMemo(()=>B(f?.[0]),[f]),k=u.useMemo(()=>L(j?.[0]),[j,v]),$=u.useMemo(()=>L(f?.[0]),[f,v]),V=()=>d?.map(I=>{const J=I.sessionResults?.find(K=>!!K.isTeacherResult),W=I.sessionResults?.find(K=>!K.isTeacherResult);return{startTime:W?.startTime||P.DATE_MIN_VALUE,endTime:W?.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:`${o.home["student-wellness"]}`,children:[e.jsxs(i.Grid,{container:!0,className:`${o.home["student-wellness__head"]}`,children:[e.jsx(i.Typography,{className:`${o.home["student-wellness__title"]}`,children:l("student_wellness")}),e.jsx(i.Button,{variant:"text",color:"primary",endIcon:e.jsx(oe.ArrowIcon,{fill:"#316CD9"}),className:`${o.home["student-wellness__view-btn"]}`,onClick:Y,children:l("view_data_dashboard")})]}),e.jsx(i.Grid,{container:!0,children:e.jsx(i.Typography,{variant:"h4",component:"h4",className:`${o.home["student-wellness__sub-title"]}`,children:"This Month's Average vs. Last Month"})}),e.jsxs(i.Grid,{container:!0,spacing:1,className:`${o.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:G,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:D,diffPercent:$,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:B(I),diffPercent:L(I),showMore:!1,isStudent:s})},I?.name))]}),!s&&g&&e.jsx(vt,{open:g,onClose:H,subject:m,checkIns:U})]})},Ct=({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),y=te.useNavigate(),v=u.useMemo(()=>{const T=m?.endTime;return T&&T!==P.DATE_MIN_VALUE?A().diff(A.utc(T).local(),"hours"):void 0},[m]),f=()=>{_?.id&&s(n.id,p.utcToLocalTime(r),n.studentProfile.name)},j=()=>{m&&y(`/view-session/${n.id}/${m.id}?from=home`)},S=()=>{_?.id&&t(n.id,_.id,_.isDone)};return e.jsx("div",{children:e.jsxs("div",{className:`${o.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:`${o.home["check-in-item__type"]} text-nowrap`,children:`${l(d?"last_check_in":g?"todays_1_1":"todays_check_in")}:`}),e.jsxs("div",{className:`${o.home["check-in-item__info"]}`,children:[e.jsx(i.Typography,{className:`${o.home["check-in-item__info__time"]}`,children:p.utcToLocalTime(r,"do MMM yyyy - hh:mm a")}),v!==void 0&&e.jsxs("div",{className:`${o.home["check-in-item__info__note"]}`,children:[e.jsx("span",{className:`${o.home["check-in-item__info__note__icon"]}`,children:e.jsx(Ie.ErrorIcon,{})}),e.jsx(i.Typography,{className:`${o.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:`${o.home["check-in-item__action"]}`,children:h&&!m?.isDone&&!g?e.jsx(i.Button,{className:`${o.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:`${o.home["check-in-item__action__btn"]}`,variant:"text",color:"primary",onClick:j,children:l("view_check_in")}):e.jsx(i.Button,{className:`${o.home["check-in-item__action__btn"]}`,variant:"text",color:"primary",onClick:f,children:l("start")+" "+l("1-1")})})]})})},bt=({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(y=>!y.isTeacherResult&&y.isDone)&&!m.isOneToOneConversation))},[s]),e.jsxs(i.Grid,{container:!0,spacing:2,className:`${ae.styles["custom-scrollbar"]} ${s.length>5?o.home["check-in-list--scroll"]:""} ${n}`,children:[s.length>0&&s.map((m,y)=>e.jsx("div",{className:`${o.home["check-in-list__item"]} w-100`,children:e.jsx(Ct,{onView:t,item:m,onRequestOneToOne:d})},y)),!!l&&!s.length&&e.jsxs("div",{className:`${o.home["check-in-list__item"]} ${o.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(oe.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(Nt,{})})},Nt=()=>{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,y]=u.useState(0),[v,f]=u.useState(!1),[j,S]=u.useState(!1),[T,N]=u.useState([]),[b,E]=u.useState(),Y=k=>{r(k?.toString()||"")},H=k=>{_(k??void 0)},R=u.useCallback(async()=>{if(!t)try{const k=await Fe.getLastOrTodaySession({studentId:m||void 0},n.roles);N(k.data)}catch(k){h(p.setAlert({type:"danger",message:k.message}))}},[m]),C=(k,$,V)=>{const U=`/my-one-to-one/completed?date=${$}&name=${V}&session=${k}`;c(U)},B=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,b),$=k.data.sessionId,V=k.data.teacherResult.id,U=k.data.studentResult.id;c(`/start-question/${$}/${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}`)},G=async(k,$,V)=>{h(p.setLoading(!0));try{c(`/${V?"result-session":"start-question"}/${k}/${$}?isOneToOne=true`)}catch(U){h(p.setAlert({type:"danger",message:U.message}))}h(p.setLoading(!1))},D=()=>{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=${b}`:`/book-session/${m}`)}catch(k){h(p.setAlert({type:"danger",message:k.message}))}};return u.useEffect(()=>{!t&&m&&R()},[m,t]),e.jsxs("div",{className:`${o.home["one-to-one-dialog"]}`,children:[e.jsxs("div",{className:`${o.home["one-to-one-dialog__head"]}`,children:[e.jsx(i.Typography,{variant:"h5",className:`${o.home["one-to-one-dialog__head__title"]}`,children:l(t?"start_check_in_homepage":"start_1_1_conversation")}),e.jsx(i.Typography,{className:`${o.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:`${o.home["one-to-one-dialog__head__selector"]}`,children:[t?e.jsx(Os.StudentSupporterSelector,{isTeacherStart:g,setIsTeacherStart:H,setTeacherName:Y,setIsCheckTeacher:S,teacherEmailStart:b,setTeacherEmailStart:E}):e.jsx(ye.StudentSelector,{setStudentId:y,studentId:m,setStudentName:Y,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:`${o.home["one-to-one-dialog__body"]}`,children:!!m&&!t&&e.jsx(bt,{className:`${o.home["check-in-list"]}`,onView:C,onRequestOneToOne:G,checkInList:T,showEmptyText:!0,setTodayCheckIn:f,isStudent:t,onStartCheckIn:L})}),j&&e.jsxs("div",{className:`${o.home["one-to-one-dialog__footer"]}`,children:[!v&&e.jsx(i.Button,{variant:"contained",color:"primary",endIcon:e.jsx(oe.ArrowIcon,{fill:"#FFFFFF"}),onClick:B,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:`${o.home["one-to-one-dialog__footer__book-btn"]}`,onClick:D,children:l("book_for_later")})]})]})},St=12,Tt=20,It=()=>{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,y]=u.useState(!1),[v,f]=u.useState(!1),[j,S]=u.useState(!1),[T,N]=u.useState(!1),[b,E]=u.useState(!1),[Y,H]=u.useState(),[R,C]=u.useState("0"),[B,L]=u.useState(),[G,D]=u.useState(),[k,$]=u.useState({events:!1,goals:!1,academicYears:!1,dataCheckIns:!1,todaySchedule:!1,listStudent:!1});u.useEffect(()=>{t?$(Z=>({...Z,dataCheckIns:!0,events:!0,listStudent:!0,todaySchedule:!0})):($(Z=>({...Z,weeklyQuests:!0,goals:!0,academicYears:!0})),l||$(Z=>({...Z,dataCheckIns:!0})))},[t]);const V=Q.useSelector(Z=>Z.common?.defaultFontSize),U=()=>{_(!0)},I=()=>{_(!1)},J=()=>{y(!0)},W=()=>{y(!1)},K=()=>{f(!0)},w=()=>{f(!1)},O=()=>{S(!0)},X=()=>{S(!1)},ne=()=>{N(!0)},ie=()=>{N(!1)},me=()=>{E(!0)},ve=()=>{E(!1)},fe=()=>{U()},we=()=>{h("/student-detail/create")},ke=()=>{try{if(!R||R==="0")throw C(""),t?new Error(d("please_select_a_teacher")):new Error(d("please_select_a_student"));h(`/student-detail/overview/${Y}`)}catch(Z){r(p.setAlert({type:"danger",message:Z.message}))}},Ce=async()=>{$(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},Ne=await ht(je);D(Ne.data)}catch(Z){r(p.setAlert({type:"danger",message:Z.message}))}$(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 be=u.useMemo(()=>V==Tt?"font-large":V==St?"font-small":"",[V]);return{t:d,isStudent:t,isTeacher:l,currentUser:n,dataCardTotal:G,isOpenCalendarDialog:b,currentUserId:s,isOpenOneToOneDialog:g,isOpenThisWeekCheckInDialog:m,isOpenThisWeekOneToOneDialog:v,isOpenLatestCheckInDialog:j,isOpenMissingStudentDialog:T,studentSelectedId:Y,isCheckStudents:B,studentSelected:R,classFontSize:be,setStudentSelectedId:H,setCheckStudents:L,setStudentSelected:C,handleAddNewStudent:we,handleViewStudent:ke,handleCloseOneToOneDialog:I,handleStartOrBookOneToOne:fe,handleCloseThisWeekCheckInDialog:W,handleOpenCalendarDialog:me,handleCloseCalendarDialog:ve,handleOpenThisWeekOneToOneDialog:K,handleCloseThisWeekOneToOneDialog:w,handleOpenLatestCheckInDialog:O,handleCloseLatestCheckInDialog:X,handleOpenMissingStudentDialog:ne,handleCloseMissingStudentDialog:ie,handleOpenThisWeekCheckInDialog:J,setLoadingComplete:$}},hs=n=>{const{studentId:s,options:t,requireStudent:l}=n,c=Q.useSelector(f=>f.common?.user),h=c.roles.includes("Student"),[d,r]=u.useState(!1),g=Q.useDispatch(),[_,m]=u.useState([]),y=f=>f.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 f=await Ae.getSessionOneToOne({...t,roles:c.roles,studentId:s||void 0,isDone:!0});m(y(f.data.items||[]))}catch(f){g(p.setAlert({type:"danger",message:f.response?.data?.title||f.message}))}r(!1)}},[s,t]);return u.useEffect(()=>{!t||!s&&l?m([]):v()},[s,JSON.stringify(t),l]),{checkInList:_,isLoading:d}},Lt=p.getStaticFileUrl("/images/image-default.png"),Dt=({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!==P.DATE_MIN_VALUE?A().diff(A.utc(n).local(),"hours"):void 0,[n]),y=()=>{l(c,h,t)};return e.jsx("div",{children:e.jsxs("div",{className:`${o.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)||Lt}),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:`${o.home["check-in-item__name"]}`,children:d})}),e.jsxs("div",{className:"d-flex flex-row flex-wrap",children:[e.jsx(i.Typography,{className:`${o.home["check-in-item__type"]} text-nowrap`,children:`${_(g?"check_in":"1-1")}:`}),e.jsxs("div",{className:`${o.home["check-in-item__info"]}`,children:[!!s&&s!==P.DATE_MIN_VALUE&&e.jsx(i.Typography,{className:`${o.home["check-in-item__info__time"]}`,children:p.utcToLocalTime(s,"do MMM yyyy - hh:mm a")}),m!==void 0&&!!n&&e.jsxs("div",{className:`${o.home["check-in-item__info__note"]}`,children:[e.jsx("span",{className:`${o.home["check-in-item__info__note__icon"]}`,children:e.jsx(Ie.ErrorIcon,{})}),e.jsx(i.Typography,{className:`${o.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:`${o.home["check-in-item__action"]}`,children:e.jsx(i.Button,{className:`${o.home["check-in-item__action__btn"]}`,variant:"text",color:"primary",onClick:y,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:`${ae.styles["custom-scrollbar"]} ${s.length>5?o.home["check-in-list--scroll"]:""} ${n}`,children:[s.length>0&&s.map((r,g)=>e.jsx("div",{className:`${o.home["check-in-list__item"]} w-100`,children:e.jsx(Dt,{onView:t,endTime:r.endTime||P.DATE_MIN_VALUE,startTime:r.startTime||P.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:`${o.home["check-in-list__item"]} ${o.home["check-in-list__item--empty"]}`,children:e.jsx(i.Typography,{children:c||d("no_last_or_requested_check_ins")})})]})},$t=n=>{const{open:s,onClose:t}=n;return e.jsx(de.SimpleDialog,{open:s,onClose:t,scroll:"body",maxWidth:"lg",children:e.jsx(Rt,{})})},Ue=A().weekday(),At={startDate:A().add(-Ue+1,"day").startOf("day").valueOf(),endDate:A().add(7-Ue,"day").endOf("day").valueOf(),loadLastCheckIn:!0,sortBy:"Name",sortOrder:"ASC"},Rt=()=>{const{t:n}=p.useTranslation(),[s,t]=u.useState(0),{checkInList:l}=hs({options:At,studentId:s}),[c,h]=u.useState(!1),d=te.useNavigate(),r=(g,_,m)=>{const y=`/${m?"result-session":"start-question"}/${g}/${_}`;d(y)};return e.jsxs("div",{className:`${o.home["this-week-checkIn-dialog"]}`,children:[e.jsxs("div",{className:`${o.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:`${o.home["this-week-checkIn-dialog__head__title"]}`,children:n("this_weeks_check_ins")})}),e.jsxs("div",{className:`${o.home["this-week-checkIn-dialog__head__selector"]}`,children:[e.jsx(ye.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:`${o.home["this-week-checkIn-dialog__body"]}`,children:c&&e.jsx(us,{className:`${o.home["check-in-list"]}`,onView:r,checkInList:l,showEmptyText:!!s,emptyText:n("this_student_does_nt_have_check_in_in_this_week")})})]})},Mt=Hs.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
+ `,$e={"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"},Et=({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),[y,v]=u.useState(null),f=u.useRef(null),j=u.useRef(null),S=`${A(n.startStr).format("HH")}:00:00`,T=A(n.startStr).format("hh:mm A"),N=()=>{s?.(n)};return{extendedProps:c,isLoading:h,isOpen:t,ref:f,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:R=>{g(R)},handleEventClick:N,handleClickAndDoubleClick:R=>{if(_&&R.timeStamp-_<250&&y)m(0),clearTimeout(y),N(),v(null);else{m(R.timeStamp);const C=setTimeout(()=>{v(null),l(!0)},251);v(C)}}}},Bt=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",Ft=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"}}}})),Gt=pe.styled("div",{shouldForwardProp:n=>n!=="$type"&&n!=="$isOpen"&&n!=="$disabled"})(({$type:n,$isOpen:s,$disabled:t})=>({backgroundColor:s&&!t?_s(n):Bt(n),color:s&&!t?"#FFFFFF":"#242424"})),Ot=({type:n,disabled:s,...t})=>{const{isOpen:l,ref:c,dataTime:h,time:d,event:r,handelMouseEnter:g,handelMouseLeave:_,handleEventClick:m}=Et(t);return e.jsx(Ft,{ref:c,$disabled:s,$type:n,onMouseEnter:g,onMouseLeave:_,children:e.jsxs(Gt,{$type:n,$isOpen:l,$disabled:s,className:`custom-event ${$e["custom-event"]} ${l?$e["custom-event--open"]:""}`,"data-time":h,onClick:m,children:[e.jsx("p",{className:`mb-0 ${$e["custom-event__title"]}`,children:r.title}),e.jsx("p",{className:`mb-0 ${$e["custom-event__time"]}`,children:d})]})})},Ke=4,Yt=84,ze=1,Wt=({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,y]=u.useState([]),v=u.useRef();function f(D,k){const $=new MouseEvent(k,{bubbles:!0,cancelable:!0});D.dispatchEvent($)}const j=()=>{const D=document.querySelector(".fc-prev-button");D&&f(D,"click")},S=()=>{const D=document.querySelector(".fc-next-button");D&&f(D,"click")},T=D=>{const{teacherResultId:k,studentResultId:$,sessionResult:V,studentId:U,conferenceId:I}=D._def.extendedProps;if(k||$){h(`/start-question/${V}/${n?$:k}`);return}if(U&&I){h(`/start-conference/${U}/${I}/conferenceRubric`);return}},N=()=>s?.map(D=>{const k=os.format(A.utc(D.startDate).local().toDate(),"yyy-MM-dd HH:mm:ss");return{id:D.location,title:D.summary,date:k,className:"event-card",extendedProps:{teacherResultId:D.sessionResult?.find($=>!!$.isTeacherResult)?.id,studentResultId:D.sessionResult?.find($=>!$.isTeacherResult)?.id,sessionResult:D.sessionId,studentId:D.conferenceAnswers?.studentId||D.sessionResult?.[0]?.studentId,conferenceId:D.conferenceId,actionPointId:D.actionPointId}}}),b=D=>{const k=A(D).get("hours");return k>=l&&k<c},E=u.useMemo(()=>N(),[s]),Y=D=>D.startsWith("1-1")?z.EVENT_ENUM.ONE_TO_ONE:D.startsWith("Conference")?z.EVENT_ENUM.CONFERENCE:D.startsWith("Check-in")?z.EVENT_ENUM.CHECK_IN:null,H=D=>{const k=A(D?.date);if(!k.isValid())return"";const $=A(D?.date).isSame(new Date,"day");return`${k.format("ddd DD")}${$?", today":""}`},R=(D,k)=>{const $=document.querySelector(".fc-day-mon"),V=document.querySelector(".fc-day-fri"),U=document.querySelector(".toolbar-title"),I=$?.getAttribute("data-date"),J=V?.getAttribute("data-date"),W=D||A(I,"YYYY-MM-DD"),K=k||A(J,"YYYY-MM-DD");if(W.isValid()&&K.isValid()&&U){let w="";if(W.month()!==K.month())if(W.year()===K.year()){const O=`${W.format("YYYY")} (Week ${W.format("ww")})`;w=`${W.format("MMMM")} - ${K.format("MMMM")} ${O}`}else w=`${W.format("MMMM YYYY")} - ${K.format("MMMM YYYY")} (Week ${W.format("ww")})`;else w=`${W.format("MMMM YYYY")} (Week ${W.format("ww")})`;w&&(U.textContent=w)}},C=()=>{const D=document.querySelectorAll(".fc-timegrid-slot.fc-timegrid-slot-lane:not(.fc-timegrid-slot-minor)"),k=document.querySelectorAll(".fc-timegrid-col.fc-day");let $=0;D.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 O=0;w.forEach((X,ne)=>{X?.parentElement?.parentElement?.setAttribute("style",`top: ${$+(ne===0?J:0)+O}px`),O+=X.clientHeight+Ke+(ne===0?J:0)}),O+=J,O>I&&(I=O)});const W=I>J?I:Yt+ze;$+=W,V?.setAttribute("style",`height: ${W}px`)})},B=D=>{(v?.current?.getApi()).gotoDate(D),_(D)},L=()=>{R(),C(),d===z.CALENDAR_GRID_TYPE.timeGridDay&&G()},G=()=>{const D=document.querySelector(".header-container"),k=document.querySelector(".fc-col-header-cell");if(!D||!k)return;const $=k.getAttribute("data-date")||"";_($);const V=A($,"YYYY-MM-DD"),U=V.day(),I=V.add(-U+1,"day"),J=qe.clone(I),W=[];for(let w=0;w<=4;w++){const O=w==0?I:I.add(1,"day"),X=O.diff(A().startOf("day"),"days")===0,ne=O.format("YYYY-MM-DD");W.push({title:`${O.format("ddd DD")}${X?", today":""}`,active:A(g,"YYYY-MM-DD").diff(O,"days")===0,onClick:()=>B(ne)})}const K=qe.clone(I);y(W),R(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:N,convertType:Y,convertDayHeaderContent:H,handleEventsDidMount:L,checkValidEvent:b,handlePrevBtnClick:j,handleNextBtnClick:S,handleGotoDate:B,setDateString:_}},Ht=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"})),Pt=({data:n,onClick:s,active:t})=>{const{t:l}=p.useTranslation(),c=()=>{s?.(n.value)};return e.jsx(Ht,{$config:n,$active:t,onClick:c,children:l(n.name)})},qt={"calendar-filters":"_calendar-filters_1mcdf_1"},Vt=({showFilterAll:n,onFilter:s,filter:t})=>{const l=n?[z.filterAll,...z.calendarFilters]:z.calendarFilters,c=h=>{s?.(h)};return e.jsx("div",{className:`${qt["calendar-filters"]}`,children:l.map((h,d)=>e.jsx(Pt,{data:h,onClick:c,active:h.value===t||!h.value&&!t},d))})},Jt="_dayButton_s09t5_1",Ut="_active_s09t5_17",Qe={dayButton:Jt,active:Ut},Kt=({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})},zt=20,Qt=12,Xt=()=>{const n=Q.useDispatch(),s=Q.useSelector(N=>N.common?.user?.roles),t=Q.useSelector(N=>N.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(),y=Q.useSelector(N=>N?.common?.defaultFontSize),v=u.useMemo(()=>y==zt?"font-large":y==Qt?"font-small":"",[y]),f=qs.caculateHeaderFont(y),j=N=>{g(N)},S=N=>{let b=A(N.startStr).startOf("day").valueOf();m(b)},T=async()=>{if(n(p.setLoading(!0)),!!_){try{const N=await ct(l,_,s,r);d(N.data)}catch(N){n(p.setAlert({type:"danger",message:N.response?.data?.title||N.message}))}n(p.setLoading(!1))}};return u.useEffect(()=>{document.title="Home",T()},[_,r]),{user:t,filter:r,dataEvent:h,isTeacher:c,classFontSize:v,fontSizeHeader:f,getDataEvent:T,handleChangeDate:S,handleChangeFilter:j}},Zt=pe.styled(Mt)({"& .event-card":{width:"100%",height:"auto",position:"relative !important",left:"0% !important",marginRight:"0% !important"}}),en=pe.styled("div")(({theme:n})=>({padding:"48px 40px",[n.breakpoints.down("md")]:{padding:"40px 40px 36px"},[n.breakpoints.down("sm")]:{padding:"32px 0px 16px"}})),sn=pe.styled("h2")({fontWeight:700,fontSize:"32px",lineHeight:"48px",color:"#242424"}),tn=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"}}})),nn=pe.styled("div")({}),an=n=>{const{isStudent:s,screenWidth:t}=n,{filter:l,dataEvent:c,handleChangeFilter:h,handleChangeDate:d}=Xt(),{events:r,calendarRef:g,dayButtons:_,handleEventClick:m,convertType:y,convertDayHeaderContent:v,handleEventsDidMount:f,checkValidEvent:j,handlePrevBtnClick:S,handleNextBtnClick:T}=Wt({isStudent:s,eventList:c?.calendarEvents,screenWidth:t,minHour:8,maxHour:18}),N=b=>j(b.event.startStr)?e.jsx(Ot,{...b,type:y(b.event.title),screenWidth:t,onEventClick:m}):null;return e.jsxs(Zt,{children:[e.jsxs(en,{className:"d-flex flex-wrap justify-content-between align-items-center",children:[e.jsx(sn,{className:"toolbar-title mb-0 col-12 col-sm-8 col-md-5"}),e.jsxs(tn,{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(Ps.ArrowBackIcon,{})}),e.jsx("span",{onClick:T,children:e.jsx(rs.ArrowForwardIcon,{})})]}),e.jsx(nn,{className:"col-md-5 col-12 mt-4 mt-md-0 d-flex justify-content-start justify-content-md-end",children:e.jsx(Vt,{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((b,E)=>e.jsx(Kt,{...b},E))}),e.jsx(Ys,{ref:g,plugins:[Ws],initialView:z.CALENDAR_GRID_TYPE.timeGridWeek,events:r,handleWindowResize:!1,headerToolbar:!1,weekends:!1,datesSet:d,allDaySlot:!1,dayHeaderContent:v,firstDay:1,eventContent:N,slotMinTime:"08:00:00",slotMaxTime:"18:00:00",slotDuration:"01:00:00",titleFormat:{month:"long",year:"numeric"},expandRows:!0,eventsSet:()=>{f?.()},contentHeight:"auto",slotLabelFormat:{hour:"numeric",separator:" ",hour12:!0}})]})]})},on=({open:n,onClose:s,isStudent:t,screenWidth:l})=>e.jsx(de.SimpleDialog,{open:n,onClose:s,scroll:"body",fullScreen:!0,children:e.jsx(an,{isStudent:t,screenWidth:l})}),ln=n=>{const{open:s,onClose:t}=n;return e.jsx(de.SimpleDialog,{open:s,onClose:t,scroll:"body",maxWidth:"lg",children:e.jsx(cn,{})})},Xe=A().weekday(),rn={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"},cn=()=>{const{t:n}=p.useTranslation(),[s,t]=u.useState(0),{checkInList:l}=hs({options:rn,studentId:s}),[c,h]=u.useState(!1),d=te.useNavigate(),r=(g,_,m)=>{const y=`/${m?"result-session":"start-question"}/${g}/${_}?isViewLog=true`;d(y)};return e.jsxs("div",{className:`${o.home["this-week-checkIn-dialog"]}`,children:[e.jsxs("div",{className:`${o.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:`${o.home["this-week-checkIn-dialog__head__title"]}`,children:n("this_weeks_1_1s")})}),e.jsxs("div",{className:`${o.home["this-week-checkIn-dialog__head__selector"]}`,children:[e.jsx(ye.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:`${o.home["this-week-checkIn-dialog__body"]}`,children:c&&e.jsx(us,{className:`${o.home["check-in-list"]}`,onView:r,checkInList:l,showEmptyText:!!s,isSession:!1,emptyText:n("this_student_does_nt_have_1_1_in_this_week")})})]})},dn=p.getStaticFileUrl("/images/image-default.png"),hn=({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:`${o.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)||dn}),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:`${o.home["check-in-item__name"]}`,children:t})}),(n!==P.DATE_MIN_VALUE||!!s&&s!==P.DATE_MIN_VALUE)&&e.jsxs("div",{className:"d-flex flex-row flex-wrap",children:[e.jsx(i.Typography,{className:`${o.home["check-in-item__type"]} text-nowrap`,children:`${s&&s!==P.DATE_MIN_VALUE?d("last"):d("missed")} ${d(h?"check_in":"1-1")}:`}),e.jsxs("div",{className:`${o.home["check-in-item__info"]}`,children:[n&&(!s||s===P.DATE_MIN_VALUE)&&e.jsx(i.Typography,{className:`${o.home["check-in-item__info__time"]}`,children:p.utcToLocalTime(n,"do MMM yyyy - hh:mm a")}),!!s&&s!==P.DATE_MIN_VALUE&&e.jsx(i.Typography,{className:`${o.home["check-in-item__info__time"]}`,children:p.utcToLocalTime(s,"do MMM yyyy - hh:mm a")})]})]})]})]}),e.jsx("div",{className:`${o.home["check-in-item__action"]}`,children:e.jsx(i.Button,{className:`${o.home["check-in-item__action__btn"]}`,variant:"text",color:"primary",onClick:r,endIcon:e.jsx(oe.ArrowIcon,{}),children:d("request_check_in")})})]})})},un=({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:`${ae.styles["custom-scrollbar"]} ${s.length>5?o.home["check-in-list--scroll"]:""} ${n}`,children:[s.length>0&&s.map((r,g)=>e.jsx("div",{className:`${o.home["check-in-list__item"]} w-100`,children:e.jsx(hn,{createdAt:r.createdAt||P.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:`${o.home["check-in-list__item"]} ${o.home["check-in-list__item--empty"]}`,children:e.jsx(i.Typography,{children:l||d("no_last_or_requested_check_ins")})})]})},_n=n=>{const{open:s,onClose:t}=n;return e.jsx(de.SimpleDialog,{open:s,onClose:t,scroll:"body",maxWidth:"lg",children:e.jsx(gn,{})})},Ze=A().weekday(),mn={startDate:A().add(-Ze+1,"day").startOf("day").valueOf(),endDate:A().add(7-Ze,"day").endOf("day").valueOf(),isConversation:!1},gn=()=>{const{t:n}=p.useTranslation(),s=Q.useDispatch(),t=te.useNavigate(),l=Q.useSelector(f=>f.common?.user),c=l.roles.includes("Student"),[h,d]=u.useState(0),[r,g]=u.useState([]),_=async(f,j)=>{f?y(f):m(j)},m=async f=>{s(p.setLoading(!0));try{const j=await Ae.startSession(f,void 0,l.roles),S=j.data.sessionId,T=j.data.teacherResult.id,N=j.data.studentResult.id;t(`/start-question/${S}/${c?N:T}`)}catch(j){s(p.setAlert({type:"danger",message:j.message}))}s(p.setLoading(!1))},y=async f=>{s(p.setLoading(!0));try{await Ae.requestCheckIn(f,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 f=await Fe.getStudentMissingSession({...mn,studentId:h||void 0},l.roles);g(f.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(f){s(p.setAlert({type:"danger",message:f.message}))}s(p.setLoading(!1))}},[h]);return u.useEffect(()=>{v()},[h]),e.jsxs("div",{className:`${o.home["this-week-checkIn-dialog"]}`,children:[e.jsxs("div",{className:`${o.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:`${o.home["this-week-checkIn-dialog__head__title"]}`,children:n("students_missing_a_weekly_check_in")}),e.jsxs("div",{className:`${o.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:`${o.home["this-week-checkIn-dialog__head__selector"]}`,children:e.jsx(ye.StudentSelector,{setStudentId:d,studentId:h,isDialog:!0})})]}),e.jsx("div",{className:`${o.home["this-week-checkIn-dialog__body"]}`,children:e.jsx(un,{className:`${o.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")}`})})]})},pn=p.getStaticFileUrl("/images/image-default.png"),xn=({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!==P.DATE_MIN_VALUE?A().diff(A.utc(n).local(),"hours"):void 0,[n]),y=()=>{l(c,h,t)};return e.jsx("div",{children:e.jsxs("div",{className:`${o.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)||pn}),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:`${o.home["check-in-item__name"]}`,children:d})}),e.jsxs("div",{className:"d-flex flex-row flex-wrap",children:[e.jsx(i.Typography,{className:`${o.home["check-in-item__type"]} text-nowrap`,children:`${_("last")} ${_(g?"check_in":"1-1")}:`}),e.jsxs("div",{className:`${o.home["check-in-item__info"]}`,children:[!!s&&s!==P.DATE_MIN_VALUE&&e.jsx(i.Typography,{className:`${o.home["check-in-item__info__time"]}`,children:p.utcToLocalTime(s,"do MMM yyyy - hh:mm a")}),m!==void 0&&!!n&&e.jsxs("div",{className:`${o.home["check-in-item__info__note"]}`,children:[e.jsx("span",{className:`${o.home["check-in-item__info__note__icon"]}`,children:e.jsx(Ie.ErrorIcon,{})}),e.jsx(i.Typography,{className:`${o.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:`${o.home["check-in-item__action"]}`,children:e.jsx(i.Button,{className:`${o.home["check-in-item__action__btn"]}`,variant:"text",color:"primary",onClick:y,children:_("view_results")})})]})})},yn=({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:`${ae.styles["custom-scrollbar"]} ${s.length>5?o.home["check-in-list--scroll"]:""} ${n}`,children:[s.length>0&&s.map((r,g)=>e.jsx("div",{className:`${o.home["check-in-list__item"]} w-100`,children:e.jsx(xn,{onView:t,endTime:r.endTime||P.DATE_MIN_VALUE,startTime:r.startTime||P.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:`${o.home["check-in-list__item"]} ${o.home["check-in-list__item--empty"]}`,children:e.jsx(i.Typography,{children:c||d("no_last_or_requested_check_ins")})})]})},fn=n=>{const{open:s,onClose:t}=n;return e.jsx(de.SimpleDialog,{open:s,onClose:t,scroll:"body",maxWidth:"lg",children:e.jsx(jn,{})})},jn=()=>{const{t:n}=p.useTranslation(),s=Q.useDispatch(),t=Q.useSelector(f=>f.common?.user),l=t.roles.includes("Student"),[c,h]=u.useState(0),[d,r]=u.useState([]),[g,_]=u.useState(!1),m=te.useNavigate(),y=u.useCallback(async()=>{if(!l)try{const f=await Fe.getStudentSession({studentId:c||void 0,isConversation:!1},t.roles);r(f.data?.map(j=>{const S=j.sessionResults.find(N=>!!N.isTeacherResult),T=j.sessionResults.find(N=>!N.isTeacherResult);return{sessionId:j.sessionId,sessionResultId:S?.id,name:j.fullName,avatar:j.profileImageFileName,startTime:T?.startTime===P.DATE_MIN_VALUE?S?.startTime:T?.startTime,endTime:T?.endTime===P.DATE_MIN_VALUE?S?.endTime:T?.endTime}})||[])}catch(f){s(p.setAlert({type:"danger",message:f.message}))}},[c]),v=(f,j,S)=>{const T=`/${S?"result-session":"start-question"}/${f}/${j}`;m(T)};return u.useEffect(()=>{y()},[c]),e.jsxs("div",{className:`${o.home["this-week-checkIn-dialog"]}`,children:[e.jsxs("div",{className:`${o.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:`${o.home["this-week-checkIn-dialog__head__title"]}`,children:n("latest_check_ins")})}),e.jsx(i.Typography,{className:`${o.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:`${o.home["this-week-checkIn-dialog__head__selector"]}`,children:[e.jsx(ye.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:`${o.home["this-week-checkIn-dialog__body"]}`,children:!!g&&e.jsx(yn,{className:`${o.home["check-in-list"]}`,onView:v,checkInList:d,showEmptyText:!0})})]})},vn=(n,s)=>{const t=Q.useDispatch(),[l,c]=u.useState(!1),[h,d]=u.useState([]),[r,g]=u.useState({}),[_,m]=u.useState(null),[y,v]=u.useState(null),[f,j]=u.useState(!1),[S,T]=u.useState(1),[N,b]=u.useState([]),[E,Y]=u.useState([]),[H,R]=u.useState(null),[C,B]=u.useState(""),[L,G]=u.useState(!1),[D,k]=u.useState(!1),$=u.useRef(null),[V,U]=u.useState(!1),I=u.useRef(null),{isRecording:J,record:W,stop:K,tempTranscript:w}=Vs.useAudioRecorder(M=>{B(M)},$),O=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 q of se)q.leaderboard?ee[q.id]=X(q.leaderboard):ee[q.id]=[];g(ee),se.length===0?c(!0):c(!1)}catch(F){console.error("Failed to load student journeys:",F)}finally{t(p.setLoading(!1))}},X=M=>{const F=M.slice(0,3),se=M.find(q=>q.isCurrentUser),ee=[...F];return se&&!F.some(q=>q.isCurrentUser)&&ee.push(se),ee},ne=async M=>{try{const F=await x.getLeaderboardApi({academicYearId:s?.academicYearId,schoolLevel:s?.schoolLevel,gradeLevel:s?.gradeLevel}),se=X(F.data);g(ee=>{const q={...ee};for(const Se of h)q[Se.id]=se;return q})}catch(F){console.error(`Failed to fetch leaderboard for journey ${M}`,F)}},ie=()=>{const M=I.current;if(!M)return;const F=M.scrollLeft+M.clientWidth>=M.scrollWidth-40;U(F)},me=()=>{const M=I.current;if(M){const F=M.scrollLeft+M.clientWidth>=M.scrollWidth-40;U(F)}},ve=()=>{c(!1)},fe=async M=>{try{t(p.setLoading(!0)),await x.selectJourneyApi({journeyIds:M,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 q of se)q.leaderboard?ee[q.id]=X(q.leaderboard):ee[q.id]=[];g(ee),c(!1)}catch(F){console.error("Failed to select journeys:",F)}finally{t(p.setLoading(!1))}},we=M=>{const F=I.current;if(!F)return;const se=F.getBoundingClientRect().left,ee=Array.from(F.children).filter(ue=>ue instanceof HTMLElement).map(ue=>ue.getBoundingClientRect().left-se+F.scrollLeft);if(ee.length===0)return;const q=2,Se=M==="right"?ee.find(ue=>ue>F.scrollLeft+q)??ee[ee.length-1]:[...ee].reverse().find(ue=>ue<F.scrollLeft-q)??ee[0];F.scrollTo({left:Se,behavior:"smooth"})},ke=M=>({roleTitle:M.name,journeyTag:`${M.name} Journey`,bgClass:M.slug,challengeQuestion:M.activeQuestion?.content||M.description,isDone:!!M.activeQuestion?.isCompleted}),Ce=()=>{if(G(!0),!_){R(null),B(""),G(!1);return}const M=h.find(se=>se.id.toString()===_);if(!M){G(!1);return}const F=M.activeQuestion;F?(R(F),F.isCompleted&&F.previousAnswer?B(F.previousAnswer):B("")):(R(null),B("")),G(!1)},be=async M=>{try{const se=(await x.getActiveQuestionApi(M,{academicYearId:s?.academicYearId})).data;d(ee=>ee.map(q=>q.id===M?{...q,activeQuestion:se}:q))}catch(F){console.error(`Failed to reload active question for journey ${M}`,F)}},Z=async()=>{if(!_||!H||D)return;const M=h.find(F=>F.id.toString()===_);if(M)try{k(!0),await x.submitJourneyResponseApi(M.id,{questionId:H.id,responseText:C,gradeLevel:s?.GradeLevel||s?.grade,academicYearId:s?.academicYearId}),await ne(M.id),await be(M.id),J!==!1&&K(),B(""),v(_),m(null)}catch(F){console.error("Failed to submit response in dashboard hook",F)}finally{k(!1)}},je=u.useCallback(async()=>{try{t(p.setLoading(!0));const M=s?.gradeLevel||s?.grade,F=s?.academicYearId,se=await x.getAvailableJourneysApi({gradeLevel:M,academicYearId:F});b(se.data);const ee=se.data.filter(q=>q.isJoined).map(q=>q.id);Y(ee)}catch(M){console.error("Failed to fetch available journeys:",M)}finally{t(p.setLoading(!1))}},[t,s]);return u.useEffect(()=>{O()},[n,s,t]),u.useEffect(()=>{const M=setTimeout(me,100);return()=>clearTimeout(M)},[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:y,setThankYouJourneyId:v,handleCloseJourneyWelcome:ve,handleContinueWelcome:fe,getJourneyThemeConfig:ke,isAtEnd:V,carouselRef:I,handleScroll:ie,scrollCarousel:we,isOpenEarnPoints:f,setIsOpenEarnPoints:j,activeQuestion:H,thoughts:C,setThoughts:B,loadingActiveQuestion:L,submittingShareThoughts:D,textareaRef:$,isRecording:J,record:W,stop:K,tempTranscript:w,handleSubmitShareThoughts:Z,journeyStep:S,setJourneyStep:T,availableJourneys:N,selectedJourneyIds:E,handleStartJourneySelection:()=>{T(2)},handleToggleSelectJourney:M=>{Y(F=>F.includes(M)?F.filter(se=>se!==M):[...F,M])},handleFinishJourneySelection:async()=>{await fe(E)}}},wn=({quests:n})=>e.jsxs(i.Grid,{className:`${o.home["weekly-quests__step"]}`,children:[e.jsx(i.Grid,{className:`${o.home["weekly-quests__step-item"]}`,children:n.map((s,t)=>s?e.jsx(i.Grid,{className:`${o.home["weekly-quests__step-item__item"]} ${o.home["weekly-quests__step-item__checked"]}`,children:e.jsx(Js.CheckIcon,{className:`${o.home["weekly-quests__step-item__icon"]}`})},t):e.jsx(i.Typography,{className:`${o.home["weekly-quests__step-item__item"]}`,children:t+1},t))}),e.jsx(i.Typography,{className:`${o.home["weekly-quests__step-weekly"]}`,children:`${n.filter(s=>s).length??0} / ${n.length??0} completed`})]}),kn=({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:`${o.home["weekly-quests__quests__item"]} ${o.home[t]}`,children:[e.jsxs(i.Grid,{className:`${o.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:`${o.home["weekly-quests__quests__item-right__title"]}`,children:r?.isPlp?"Personal Learning Plan":r?.title}),e.jsx(i.Typography,{className:`${o.home["weekly-quests__quests__item-right__description"]}`,children:n}),e.jsx(i.Typography,{hidden:P.StatusWeeklyQuest[l]!=P.StatusWeeklyQuest.Completed,className:`${o.home["weekly-quests__quests__item-right__detail"]}`,children:`Good Job! You have completed "${r?.title}" in the ${r?.in} section.`})]}),!!r&&P.StatusWeeklyQuest[l]!=P.StatusWeeklyQuest.Completed&&e.jsxs(i.Button,{onClick:()=>c(r.href,r.isPlp),className:`${o.home["weekly-quests__quests__item-right__action"]}`,children:[e.jsx(i.Typography,{className:`${o.home["weekly-quests__quests__item-right__action__content"]}`,children:"complete the quest"}),e.jsx(rs.ArrowForwardIcon,{className:`${o.home["weekly-quests__quests__item-right__action__icon"]}`})]})]}),e.jsxs(i.Grid,{className:`${o.home["weekly-quests__quests__icon"]}`,children:[e.jsx("img",{loading:"lazy",hidden:P.StatusWeeklyQuest[l]!=P.StatusWeeklyQuest.Completed,src:"images/done-quest-icon.svg",className:`${o.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:`${o.home["weekly-quests"]}`,children:[e.jsxs(i.Grid,{className:`${o.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:`${o.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(wn,{quests:s(n)})]}),e.jsx(i.Grid,{hidden:!c,container:!0,spacing:2,className:`${o.home["weekly-quests__quests"]}`,children:n.map((d,r)=>e.jsx(i.Grid,{item:!0,xs:12,sm:6,children:e.jsx(kn,{source:d.source,onGetTitleTheQuest:h,description:d.title,icon:z.questIcons[r],status:d.status.toString(),classString:P.StatusWeeklyQuest[d.status]==P.StatusWeeklyQuest.Completed?"item-success":"",onCompleteTheQuest:t})},d.id))}),e.jsxs(i.Grid,{hidden:c,container:!0,className:`${o.home["weekly-quests__completed-all"]}`,children:[e.jsx("img",{loading:"lazy",src:"/images/congratulation-image.svg",className:`${o.home["weekly-quests__completed-all__image"]}`}),e.jsx(i.Typography,{className:`${o.home["weekly-quests__completed-all__title"]}`,children:"Good Job!"}),e.jsx(i.Typography,{className:`${o.home["weekly-quests__completed-all__description"]}`,children:"You have completed all of the weekly quests!"})]})]})},Cn=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),[y,v]=u.useState({name:""}),[f,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:f});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}))},[f]),{classFontSize:T}=zs.useFontStyles(),N=L=>{if(L.length===0)return;const G=L.filter(k=>k.status==="in-progress").length,D=L.filter(k=>k.status==="completed").length;return D===L.length?"completed":G===0&&D===0?"not-yet-started":"in-progress"},b=()=>{g("/personal-learning-plan")},E=L=>{L&&(v(L),m(!0))},Y=()=>{m(!1),v({name:""})},H=L=>{if(L)return L.split(" ").map(G=>G.toLocaleLowerCase()).join("-")},R=()=>d.map(L=>({...L,status:N(L.checkPoints?.map(G=>({...G,status:H(G?.status)}))||[])})),C=u.useMemo(()=>R(),[d]),B=async()=>{h(!0),n&&n(G=>({...G,academicYears:!1}));try{var L={pageSize:-1,currentPage:1};const k=(await Qs.getAcademicYearList(L)).data.items.map($=>({id:$.id,title:`${A($.startTime).year()} - ${A($.endTime).year()} (${A($.startTime).format("MM/YYYY")} - ${A($.endTime).format("MM/YYYY")})`,startTime:$.startTime,endTime:$.endTime,isCurrent:$.isCurrent})).find($=>$.isCurrent);k&&j(k.id)}catch(G){s(p.setAlert({type:"danger",message:G.response?.data?.title||G.message}))}h(!1),n&&n(G=>({...G,academicYears:!0}))};return u.useEffect(()=>{f?S():B()},[f,n]),{mappedGoals:C,isLoading:c,getGoalStatus:N,handleView:b,handleViewGoal:E,openViewGoal:_,setOpenViewGoal:m,goalSelected:y,handleClose:Y,classFontSize:T}},bn="_header_1yk65_11",Nn="_left_1yk65_19",Sn="_title_1yk65_26",Tn="_detail_1yk65_31",In="_body_1yk65_38",Ln="_item_1yk65_43",Dn="_number_1yk65_50",$n="_time_1yk65_61",An="_content_1yk65_66",le={"goal-modal":"_goal-modal_1yk65_1",header:bn,left:Nn,title:Sn,detail:Tn,body:In,item:Ln,number:Dn,time:$n,content:An,"target-time":"_target-time_1yk65_76"},Rn=({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(o.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(o.FlagIcon,{}),p.utcToLocalTime(_.time,"dd-MM-yyyy")]}),_.endTime&&e.jsxs("div",{className:le["target-time"],children:[e.jsx(o.AimIcon,{}),p.utcToLocalTime(_.endTime,"dd-MM-yyyy")]})]}),_.status&&e.jsx(o.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:_}=Cn(n);return e.jsxs("div",{className:`d-flex flex-column ${o.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:o.home["checkin-title"],children:s("my_goals")}),e.jsxs("span",{className:o.home["goals-view-all"],onClick:c,children:[s("view_all_goals"),e.jsx(oe.ArrowIcon,{fill:"#316CD9",style:{width:"12px",height:"12px"}})]})]}),e.jsx("div",{className:`${o.home["today-schedule__icon"]}`,children:e.jsx("img",{src:`${p.getStaticFileUrl("/images/personal-icon-quests.svg")}`,alt:s("my_goals")})})]}),e.jsxs("div",{className:o.home["goals-list-row"],children:[t.length>0?t.map((m,y)=>{const v=m.checkPoints?.length||0,f=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:o.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:o.home["goal-item-label"],children:["Goal ",y+1]}),e.jsxs("span",{className:o.home["goal-item-progress"],children:[f,"/",v]})]}),e.jsx(i.Typography,{className:o.home["goal-item-name"],children:m.name})]}),e.jsxs("div",{className:"mt-2",children:[j==="in-progress"&&e.jsxs("div",{className:`${o.home["status-badge"]} ${o.home["status-badge--in-progress"]}`,children:[e.jsx("span",{className:o.home["status-badge__dot"]}),e.jsx("span",{children:"In Progress"})]}),j==="not-yet-started"&&e.jsxs("div",{className:`${o.home["status-badge"]} ${o.home["status-badge--not-started"]}`,children:[e.jsx("span",{className:o.home["status-badge__dots"],children:"•••"}),e.jsx("span",{children:"Not Started"})]}),j==="completed"&&e.jsxs("div",{className:`${o.home["status-badge"]} ${o.home["status-badge--completed"]}`,children:[e.jsx("span",{className:o.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(Rn,{open:r,onClose:g,goal:d,goalStatus:d?.status})]})},Mn=(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"},En=({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(oe.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 y=c.includes(m.id),v=Mn(m.name,m.id);return e.jsxs("div",{className:`${x.styles["journey-choose__card"]} ${y?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(oe.ArrowIcon,{fill:"#FFF",style:{width:"20px",height:"20px"}}),children:`${g("continue_with")} ${c.length} ${c.length===1?g("journey"):g("journeys")}`})]})]})})},Bn=({open:n,journey:s,onClose:t,loading:l,activeQuestion:c,thoughts:h,setThoughts:d,textareaRef:r,isRecording:g,record:_,stop:m,tempTranscript:y,onSubmit:v,submitting:f=!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}${y}`,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:f||c?.isCompleted||!h.trim()&&!y.trim(),children:[f?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},Fn=()=>{const n=te.useNavigate(),{t:s,isStudent:t,isTeacher:l,currentUser:c,dataCardTotal:h,isOpenCalendarDialog:d,currentUserId:r,isOpenOneToOneDialog:g,isOpenThisWeekCheckInDialog:_,isOpenThisWeekOneToOneDialog:m,isOpenLatestCheckInDialog:y,isOpenMissingStudentDialog:v,isCheckStudents:f,studentSelectedId:j,studentSelected:S,classFontSize:T,setStudentSelected:N,setStudentSelectedId:b,setCheckStudents:E,handleAddNewStudent:Y,handleViewStudent:H,handleCloseOneToOneDialog:R,handleStartOrBookOneToOne:C,handleCloseThisWeekCheckInDialog:B,handleOpenCalendarDialog:L,handleCloseCalendarDialog:G,handleOpenThisWeekOneToOneDialog:D,handleCloseThisWeekOneToOneDialog:k,handleOpenLatestCheckInDialog:$,handleCloseLatestCheckInDialog:V,handleOpenMissingStudentDialog:U,handleCloseMissingStudentDialog:I,handleOpenThisWeekCheckInDialog:J,setLoadingComplete:W}=It(),{isOpenJourneyWelcome:K,setIsOpenJourneyWelcome:w,activeJourneys:O,leaderboards:X,selectedJourneyIdForShareThoughts:ne,setSelectedJourneyIdForShareThoughts:ie,thankYouJourneyId:me,setThankYouJourneyId:ve,handleCloseJourneyWelcome:fe,getJourneyThemeConfig:we,isAtEnd:ke,carouselRef:Ce,handleScroll:be,scrollCarousel:Z,isOpenEarnPoints:je,setIsOpenEarnPoints:Ne,activeQuestion:Ye,thoughts:We,setThoughts:M,loadingActiveQuestion:F,submittingShareThoughts:se,textareaRef:ee,isRecording:q,record:Se,stop:ue,tempTranscript:Cs,handleSubmitShareThoughts:bs,journeyStep:Ns,availableJourneys:Ss,selectedJourneyIds:Ts,handleStartJourneySelection:Is,handleToggleSelectJourney:Ls,handleFinishJourneySelection:Ds}=vn(t,c),$s=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:`${o.home.container} ${o.home[T]}`,children:[t&&O.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(oe.ArrowIcon,{fill:"#316CD9",className:x.styles["active-journeys-header__link--icon"]})]}),e.jsxs("span",{className:x.styles["active-journeys-header__link"],onClick:()=>Ne(!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")]})]})]}),O.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:be,"data-at-end":ke?"true":"false",children:O.map(ce=>{const _e=we(ce),He=(X[ce.id]||[]).find(ge=>ge.isCurrentUser)?.totalXp||0,Pe=1e3,Rs=Math.min(100,Math.round(He/Pe*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(oe.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:[He," / ",e.jsx("span",{className:"journey-active-card__progress-header__percent--total",children:Pe})]})]}),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:`${Rs}%`}})}),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(oe.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,Ms)=>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`]})]})]})},Ms))})]})]},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:`${ae.styles["block-container"]} ${o.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:o.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:o.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:o.home["checkin-action-btn"],children:[e.jsx("span",{children:s("start")}),e.jsx(oe.ArrowIcon,{fill:"#FFF",style:{width:"16px",height:"16px"}})]})]}),e.jsx("div",{className:o.home["student-left-divider"]}),e.jsx("div",{children:e.jsx(ss,{setLoadingComplete:W})})]})}),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:`${ae.styles["block-container"]} ${o.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:`${ae.styles["block-container"]} ${o.home["home-block--left"]} flex-nowrap ${o.home["conference-block"]}`,children:[e.jsxs("div",{className:`${o.home["conference-block__main"]}`,children:[e.jsx("div",{className:`${o.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:`${o.home["conference-block__title"]}`,children:s(t?"start_check_in":"start_1_1_conversation")}),e.jsx(i.Typography,{className:`${o.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:`${o.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:`${o.home["conference-block__middle"]}`,children:e.jsx(i.Button,{variant:"text",color:"primary",endIcon:e.jsx(ls.CalendarIcon,{}),className:`${o.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(oe.ArrowIcon,{fill:"#FFF"}),className:`${o.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:`${ae.styles["block-container"]} ${o.home["home-block--left"]} justify-content-start justify-content-lg-between ${o.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:`${o.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:`${o.home["conference-block__title"]}`,children:s("view_a_student")}),e.jsxs(i.Typography,{className:`${o.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:`${o.home["conference-block__action"]} text-nowrap`,onClick:Y,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(ye.StudentSelector,{setStudentId:b,studentId:j,setStudentName:ce=>N(ce===-1?"":ce.toString()),setIsCheckStudent:E,setLoadingComplete:W}),!S&&e.jsxs(i.Typography,{className:`${he.myOneToOne["session-invalid"]}`,children:[s("this_is_a_required_field"),"."]}),e.jsx(i.Typography,{children:!f&&s("you_have_no_student")})]}),e.jsx("div",{children:!!f&&e.jsx(i.Button,{variant:"text",color:"primary",endIcon:e.jsx(oe.ArrowIcon,{fill:"#316CD9"}),className:`${o.home["conference-block__book-for-later"]} ${t?"text-capitalize":"text-uppercase"}`,onClick:H,children:s("view")})})]})]})})})]})}),e.jsx(i.Grid,{item:!0,xs:12,hidden:!t,children:e.jsx("div",{className:`${ae.styles["block-container"]} ${o.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:`${ae.styles["block-container"]} ${o.home["home-block--right"]} h-100`,children:e.jsx(kt,{studentId:t?r:void 0,isStudent:t,setLoadingComplete:W})})})})]})}),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:`${ae.styles["block-container"]} ${o.home["home-block--right"]} ${o.home["check-in-block"]}`,children:[e.jsxs("div",{className:`${o.home["check-in-block__wrapper"]} ${!h?.totalStudentMissingCheckIn&&o.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:`${o.home["check-in-block__number"]}`,children:h?.weekCheckIn||0}),e.jsxs(i.Grid,{className:`${o.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(oe.ArrowIcon,{className:`${o.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(oe.ArrowIcon,{}),className:`${o.home["conference-block__book-for-later"]} ${o.home["check-in-block__view"]}`,onClick:$,children:s("view_latest_check_ins")})]}),!!h?.totalStudentMissingCheckIn&&e.jsx("div",{className:`${o.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:`${ae.styles["block-container"]} ${o.home["home-block--right"]} justify-content-between`,onClick:()=>D(),style:{cursor:"pointer"},children:[e.jsxs("div",{className:"d-flex align-items-center",children:[e.jsx(i.Typography,{className:`${o.home["check-in-block__number"]}`,children:h?.weekOneToOne||0}),e.jsxs(i.Grid,{className:`${o.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(oe.ArrowIcon,{className:`${o.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:`${ae.styles["block-container"]} ${o.home["home-block--right"]} h-100`,children:e.jsx(xt,{date:$s,studentUserId:t?c?.id:"",teacherUserId:t&&c.mainTeacherUserId||void 0,onViewCalendar:L,setLoadingComplete:W})})}),t&&e.jsx(i.Grid,{item:!0,xs:12,sm:t?6:12,lg:12,children:e.jsx("div",{className:`${ae.styles["block-container"]} ${o.home["home-block--right"]} h-100`,children:e.jsx(ss,{setLoadingComplete:W})})})]})})]})})]})]}),e.jsx(ds,{open:g,onClose:R}),e.jsx($t,{open:_,onClose:B}),e.jsx(ln,{open:m,onClose:k}),e.jsx(_n,{open:v,onClose:I}),e.jsx(fn,{open:y,onClose:V}),e.jsx(on,{screenWidth:As,open:d,onClose:G,isStudent:t}),e.jsx(En,{open:K,onClose:fe,step:Ns,availableJourneys:Ss,selectedIds:Ts,onStart:Is,onToggleSelect:Ls,onContinue:Ds}),e.jsx(x.DialogEarnPoints,{open:je,onClose:()=>Ne(!1)}),e.jsx(Bn,{open:!!ne,journey:O.find(ce=>ce.id.toString()===ne)||null,onClose:()=>ie(null),loading:F,submitting:se,activeQuestion:Ye,thoughts:We,setThoughts:M,textareaRef:ee,isRecording:q,record:Se,stop:ue,tempTranscript:Cs,onSubmit:bs}),e.jsx(x.DialogThankYouJourney,{open:!!me,journeyId:me,onClose:()=>ve(null)})]})},Gn=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}})},On=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 Yn(){const n=Q.useSelector(R=>R.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 R=n.roles.filter(C=>C.toLowerCase()!=="student").map(C=>C.toLowerCase());s=JSON.stringify(R.length>0?R:["teacher"])}const[t,l]=u.useState(null),[c,h]=u.useState(!0),[d,r]=u.useState(null),[g,_]=u.useState(!1),[m,y]=u.useState(!1),[v,f]=u.useState(null),[j,S]=u.useState("flags"),T=u.useCallback(async()=>{h(!0),r(null);try{const R=await Gn(s);R&&R.data&&l(R.data)}catch(R){r(R)}finally{h(!1)}},[s]);return u.useEffect(()=>{T(),document.title="Home page"},[T]),{data:t,loading:c,error:d,activeRole:s,openFlagsModal:g,openJourneyModal:m,selectedJourney:v,activePanel:j,refetch:T,handleOpenFlagsModal:()=>_(!0),handleCloseFlagsModal:()=>_(!1),handleOpenJourneyModal:R=>{f(R||null),y(!0)},handleCloseJourneyModal:()=>{y(!1),f(null)},togglePanel:R=>{S(C=>C===R?"flags":R)}}}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"})]}),Re=({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})}),Me=({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"})]}),Ge=({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"})]}),Wn=({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"})]}),Hn=({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"})]}),Pn=({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"})]}),qn=({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"})]}),Vn=({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"})]}),ys=({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"})]}),Jn=({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"})]})})},Un=({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"})]}),Kn=({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"})]}),zn=({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"})}),Qn=({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"})]}),fs=({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"})]}),Xn=({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"})]}),Zn=({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"})]}),ea=({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"})]}),sa=({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"})]}),ta=({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"})]}),na=({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"})]}),aa=({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"})]}),oa=({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"})]}),la="/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"}],ra={"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"}},ia=[{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"],ca=[{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"}],da="Case lifecycle & SLA workflow",ha="How every safeguarding case moves from opening through to a logged outcome.",ua=[{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"}],as=[{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"}],_a="_overviewContainer_16udt_1",ma="_greetingHeader_16udt_27",ga="_greetingTitle_16udt_31",pa="_greetingSubtitle_16udt_38",xa="_topLayoutGrid_16udt_44",ya="_bottomLayoutGrid_16udt_56",fa="_card_16udt_67",ja="_blockLoadingContainer_16udt_77",va="_cardHeader_16udt_88",wa="_cardTitle_16udt_96",ka="_cardSubtitle_16udt_103",Ca="_btnAlertsWork_16udt_109",ba="_popoverContainer_16udt_124",Na="_popoverFadeIn_16udt_1",Sa="_popoverHeader_16udt_151",Ta="_popoverTitle_16udt_155",Ia="_popoverDesc_16udt_162",La="_adminBadge_16udt_169",Da="_flagBlockRed_16udt_182",$a="_flagBlockRedHeader_16udt_190",Aa="_flagBlockRedBody_16udt_195",Ra="_flagBlockYellow_16udt_200",Ma="_flagBlockYellowHeader_16udt_208",Ea="_flagBlockYellowBody_16udt_213",Ba="_flagBlockTitleRed_16udt_218",Fa="_flagBlockTitleYellow_16udt_225",Ga="_sectionSectionLabel_16udt_232",Oa="_metricRow_16udt_245",Ya="_metricPillRed_16udt_260",Wa="_metricPillYellow_16udt_269",Ha="_kpiPillsList_16udt_278",Pa="_kpiPillBlue_16udt_285",qa="_tabsRow_16udt_295",Va="_tabCard_16udt_302",Ja="_activeRed_16udt_315",Ua="_activeGreen_16udt_320",Ka="_tabHeader_16udt_326",za="_tabIconCircleRed_16udt_335",Qa="_tabIconCircleGreen_16udt_347",Xa="_tabValue_16udt_359",Za="_tabActionLinkRed_16udt_366",eo="_tabActionLinkGreen_16udt_378",so="_tabContentContainer_16udt_391",to="_tabFadeSlideIn_16udt_1",no="_flagsCardBox_16udt_406",ao="_bannerHeader_16udt_414",oo="_bannerTitle_16udt_423",lo="_bannerLink_16udt_434",ro="_highlightsSubHeader_16udt_450",io="_highlightsSubTab_16udt_455",co="_studentList_16udt_463",ho="_highlightsListContainer_16udt_484",uo="_studentItem_16udt_507",_o="_studentMeta_16udt_518",mo="_avatarInitialsRed_16udt_524",go="_avatarInitialsYellow_16udt_538",po="_avatarInitialsGreen_16udt_552",xo="_avatarInitialsBlue_16udt_566",yo="_studentDetails_16udt_580",fo="_studentNameRow_16udt_586",jo="_studentGradeTag_16udt_595",vo="_studentDateRow_16udt_602",wo="_actionBtnGroup_16udt_611",ko="_btnOutline_16udt_617",Co="_btnFilledBlue_16udt_636",bo="_highlightCard_16udt_655",No="_highlightContent_16udt_670",So="_highlightHeader_16udt_677",To="_highlightName_16udt_683",Io="_dateAgoBadge_16udt_689",Lo="_highlightTitleRow_16udt_698",Do="_highlightDesc_16udt_708",$o="_wellBeingCard_16udt_716",Ao="_wellBeingTitle_16udt_723",Ro="_wellBeingDesc_16udt_733",Mo="_btnTeal_16udt_740",Eo="_conversationCard_16udt_756",Bo="_convoHeader_16udt_764",Fo="_btnGroupConvo_16udt_770",Go="_missingConvoBox_16udt_795",Oo="_missingText_16udt_805",Yo="_btnFilledRed_16udt_817",Wo="_btnLogOneToOne_16udt_832",Ho="_lastTalkedText_16udt_849",Po="_studentGradeDot_16udt_857",qo="_wellnessMetricRow_16udt_864",Vo="_wellnessLeft_16udt_870",Jo="_wellnessIconImg_16udt_886",Uo="_wellnessPillGreen_16udt_892",Ko="_wellnessPillDivider_16udt_911",zo="_wellnessTrendingRight_16udt_919",Qo="_fullBtnBlue_16udt_925",Xo="_fullBtnRed_16udt_946",Zo="_cardHeaderInline_16udt_967",el="_linkBtnInline_16udt_974",sl="_journeysGrid_16udt_994",tl="_journeyItemCard_16udt_1000",nl="_journeyIconTitle_16udt_1010",al="_journeyCircleIcon_16udt_1016",ol="_journeyIconImg_16udt_1028",ll="_journeyItemTitle_16udt_1034",rl="_journeyCountBadge_16udt_1040",il="_modalHeader_16udt_1051",cl="_modalTitle_16udt_1058",dl="_modalSubtitle_16udt_1065",hl="_modalCloseBtn_16udt_1071",ul="_modalBody_16udt_1090",_l="_studentCard_16udt_1101",ml="_studentInfo_16udt_1117",gl="_studentName_16udt_586",pl="_dialogContentZero_16udt_1172",xl="_modalStudentList_16udt_1212",yl="_studentCardBox_16udt_1221",fl="_studentAvatarInitials_16udt_1230",jl="_studentInfoCol_16udt_1241",vl="_studentNameText_16udt_1247",wl="_studentGradeSub_16udt_1253",kl="_badgesWrapper_16udt_1259",Cl="_unsafeBadge_16udt_1267",bl="_highStressBadge_16udt_1279",Nl="_btnViewCheckInWhite_16udt_1291",Sl="_engModalHeader_16udt_1315",Tl="_engHeaderLeft_16udt_1330",Il="_engTitle_16udt_1336",Ll="_engSubtitle_16udt_1344",Dl="_engHeaderRight_16udt_1351",$l="_engTotalBox_16udt_1358",Al="_engTotalLabel_16udt_1369",Rl="_engTotalValue_16udt_1378",Ml="_engJourneyList_16udt_1385",El="_engJourneyRow_16udt_1408",Bl="_engJourneyLeft_16udt_1424",Fl="_engJourneyCircle_16udt_1432",Gl="_engJourneyName_16udt_1449",Ol="_engJourneyDesc_16udt_1461",Yl="_engActivityRow_16udt_1467",Wl="_activityDot_16udt_1473",Hl="_activityLabel_16udt_1480",Pl="_engJourneyRight_16udt_1486",ql="_engStudentCount_16udt_1493",Vl="_engArrow_16udt_1504",Jl="_jpHeader_16udt_1514",Ul="_jpHeaderLeft_16udt_1521",Kl="_jpBackBtn_16udt_1529",zl="_jpIconCircle_16udt_1545",Ql="_jpTitle_16udt_1563",Xl="_jpDesc_16udt_1571",Zl="_jpEngagedRow_16udt_1579",er="_jpEngagedLabel_16udt_1583",sr="_jpDivider_16udt_1593",tr="_jpProgressSection_16udt_1599",nr="_jpProgressTitle_16udt_1603",ar="_jpStudentList_16udt_1610",or="_jpStudentCard_16udt_1632",lr="_jpStudentLeft_16udt_1649",rr="_jpStudentName_16udt_1657",ir="_jpBadgeTitle_16udt_1664",cr="_jpProgressCol_16udt_1671",dr="_jpXpHeader_16udt_1679",hr="_jpXpLabel_16udt_1686",ur="_jpXpValue_16udt_1695",_r="_jpProgressBar_16udt_1706",mr="_jpProgressFill_16udt_1714",gr="_slaSection_16udt_1722",pr="_slaDivider_16udt_1726",xr="_slaTitle_16udt_1732",yr="_slaSubtitle_16udt_1739",fr="_slaList_16udt_1746",jr="_slaItem_16udt_1752",vr="_slaIconCircle_16udt_1758",wr="_slaInfo_16udt_1769",kr="_slaItemTitle_16udt_1774",Cr="_slaItemDesc_16udt_1782",br="_flagsHistoryContainer_16udt_1792",Nr="_btnBackHome_16udt_1799",Sr="_flagsHistoryHeader_16udt_1817",Tr="_flagsHistoryTitle_16udt_1825",Ir="_flagsHistorySubtitle_16udt_1835",Lr="_btnExportCsv_16udt_1841",Dr="_flagsHistoryCard_16udt_1861",$r="_flagsHistoryFilterBar_16udt_1868",Ar="_searchBox_16udt_1876",Rr="_searchInput_16udt_1888",Mr="_btnClearSearch_16udt_1898",Er="_datePickerContainer_16udt_1907",Br="_datePickerItem_16udt_1913",Fr="_selectFilter_16udt_1959",Gr="_multiSelectDropdownBtn_16udt_1970",Or="_typeDropdownBtn_16udt_1992",Yr="_multiSelectDropdownLabel_16udt_1996",Wr="_multiSelectDropdownMenu_16udt_2005",Hr="_multiSelectDropdownItem_16udt_2021",Pr="_dropdownItemSelected_16udt_2034",qr="_dateFilterGroup_16udt_2046",Vr="_dateInput_16udt_2056",Jr="_dateToText_16udt_2065",Ur="_tableHeaderGrid_16udt_2070",Kr="_tableBodyBox_16udt_2080",zr="_tableRowGrid_16udt_2086",Qr="_tableRowEven_16udt_2098",Xr="_tableRowOdd_16udt_2102",Zr="_studentMetaCol_16udt_2106",ei="_studentGradeText_16udt_2150",si="_flagTypeBadgeRed_16udt_2155",ti="_flagTypeBadgeYellow_16udt_2167",ni="_flagDotRed_16udt_2179",ai="_flagDotYellow_16udt_2186",oi="_dateText_16udt_2193",li="_loggedByText_16udt_2198",ri="_assignedText_16udt_2203",ii="_statusCol_16udt_2208",ci="_closedBadge_16udt_2215",di="_pendingBadge_16udt_2228",hi="_btnActionViewNote_16udt_2241",ui="_btnActionLog11_16udt_2260",_i="_btnInactiveDisabled_16udt_2279",mi="_btnInactiveDisabledRounded_16udt_2296",gi="_emptyFlagsText_16udt_2313",pi="_loadingBox_16udt_2320",xi="_btnInfoCircle_16udt_2328",yi="_caseWorkflowPopoverCard_16udt_2347",fi="_caseWorkflowPopoverHeader_16udt_2361",ji="_caseWorkflowPopoverTitle_16udt_2365",vi="_caseWorkflowPopoverSubtitle_16udt_2373",wi="_caseWorkflowTimelineContainer_16udt_2380",ki="_caseWorkflowStepRow_16udt_2385",Ci="_caseWorkflowStepIconCol_16udt_2395",bi="_caseWorkflowStepCircle_16udt_2403",Ni="_caseWorkflowStepContentCol_16udt_2414",Si="_caseWorkflowStepLabel_16udt_2420",Ti="_caseWorkflowStepTitle_16udt_2429",Ii="_caseWorkflowStepDesc_16udt_2437",Li="_caseWorkflowStepBadge_16udt_2444",Di="_headerWrapper_16udt_2466",$i="_iconContainer_16udt_2472",Ai="_cardDescription_16udt_2490",Ri="_logCheckInBtn_16udt_2497",a={overviewContainer:_a,greetingHeader:ma,greetingTitle:ga,greetingSubtitle:pa,topLayoutGrid:xa,bottomLayoutGrid:ya,card:fa,blockLoadingContainer:ja,cardHeader:va,cardTitle:wa,cardSubtitle:ka,btnAlertsWork:Ca,popoverContainer:ba,popoverFadeIn:Na,popoverHeader:Sa,popoverTitle:Ta,popoverDesc:Ia,adminBadge:La,flagBlockRed:Da,flagBlockRedHeader:$a,flagBlockRedBody:Aa,flagBlockYellow:Ra,flagBlockYellowHeader:Ma,flagBlockYellowBody:Ea,flagBlockTitleRed:Ba,flagBlockTitleYellow:Fa,sectionSectionLabel:Ga,metricRow:Oa,metricPillRed:Ya,metricPillYellow:Wa,kpiPillsList:Ha,kpiPillBlue:Pa,tabsRow:qa,tabCard:Va,activeRed:Ja,activeGreen:Ua,tabHeader:Ka,tabIconCircleRed:za,tabIconCircleGreen:Qa,tabValue:Xa,tabActionLinkRed:Za,tabActionLinkGreen:eo,tabContentContainer:so,tabFadeSlideIn:to,flagsCardBox:no,bannerHeader:ao,bannerTitle:oo,bannerLink:lo,highlightsSubHeader:ro,highlightsSubTab:io,studentList:co,highlightsListContainer:ho,studentItem:uo,studentMeta:_o,avatarInitialsRed:mo,avatarInitialsYellow:go,avatarInitialsGreen:po,avatarInitialsBlue:xo,studentDetails:yo,studentNameRow:fo,studentGradeTag:jo,studentDateRow:vo,actionBtnGroup:wo,btnOutline:ko,btnFilledBlue:Co,highlightCard:bo,highlightContent:No,highlightHeader:So,highlightName:To,dateAgoBadge:Io,highlightTitleRow:Lo,highlightDesc:Do,wellBeingCard:$o,wellBeingTitle:Ao,wellBeingDesc:Ro,btnTeal:Mo,conversationCard:Eo,convoHeader:Bo,btnGroupConvo:Fo,missingConvoBox:Go,missingText:Oo,btnFilledRed:Yo,btnLogOneToOne:Wo,lastTalkedText:Ho,studentGradeDot:Po,wellnessMetricRow:qo,wellnessLeft:Vo,wellnessIconImg:Jo,wellnessPillGreen:Uo,wellnessPillDivider:Ko,wellnessTrendingRight:zo,fullBtnBlue:Qo,fullBtnRed:Xo,cardHeaderInline:Zo,linkBtnInline:el,journeysGrid:sl,journeyItemCard:tl,journeyIconTitle:nl,journeyCircleIcon:al,journeyIconImg:ol,journeyItemTitle:ll,journeyCountBadge:rl,modalHeader:il,modalTitle:cl,modalSubtitle:dl,modalCloseBtn:hl,modalBody:ul,studentCard:_l,studentInfo:ml,studentName:gl,dialogContentZero:pl,modalStudentList:xl,studentCardBox:yl,studentAvatarInitials:fl,studentInfoCol:jl,studentNameText:vl,studentGradeSub:wl,badgesWrapper:kl,unsafeBadge:Cl,highStressBadge:bl,btnViewCheckInWhite:Nl,engModalHeader:Sl,engHeaderLeft:Tl,engTitle:Il,engSubtitle:Ll,engHeaderRight:Dl,engTotalBox:$l,engTotalLabel:Al,engTotalValue:Rl,engJourneyList:Ml,engJourneyRow:El,engJourneyLeft:Bl,engJourneyCircle:Fl,engJourneyName:Gl,engJourneyDesc:Ol,engActivityRow:Yl,activityDot:Wl,activityLabel:Hl,engJourneyRight:Pl,engStudentCount:ql,engArrow:Vl,jpHeader:Jl,jpHeaderLeft:Ul,jpBackBtn:Kl,jpIconCircle:zl,jpTitle:Ql,jpDesc:Xl,jpEngagedRow:Zl,jpEngagedLabel:er,jpDivider:sr,jpProgressSection:tr,jpProgressTitle:nr,jpStudentList:ar,jpStudentCard:or,jpStudentLeft:lr,jpStudentName:rr,jpBadgeTitle:ir,jpProgressCol:cr,jpXpHeader:dr,jpXpLabel:hr,jpXpValue:ur,jpProgressBar:_r,jpProgressFill:mr,slaSection:gr,slaDivider:pr,slaTitle:xr,slaSubtitle:yr,slaList:fr,slaItem:jr,slaIconCircle:vr,slaInfo:wr,slaItemTitle:kr,slaItemDesc:Cr,flagsHistoryContainer:br,btnBackHome:Nr,flagsHistoryHeader:Sr,flagsHistoryTitle:Tr,flagsHistorySubtitle:Ir,btnExportCsv:Lr,flagsHistoryCard:Dr,flagsHistoryFilterBar:$r,searchBox:Ar,searchInput:Rr,btnClearSearch:Mr,datePickerContainer:Er,datePickerItem:Br,selectFilter:Fr,multiSelectDropdownBtn:Gr,typeDropdownBtn:Or,multiSelectDropdownLabel:Yr,multiSelectDropdownMenu:Wr,multiSelectDropdownItem:Hr,dropdownItemSelected:Pr,dateFilterGroup:qr,dateInput:Vr,dateToText:Jr,tableHeaderGrid:Ur,tableBodyBox:Kr,tableRowGrid:zr,tableRowEven:Qr,tableRowOdd:Xr,studentMetaCol:Zr,studentGradeText:ei,flagTypeBadgeRed:si,flagTypeBadgeYellow:ti,flagDotRed:ni,flagDotYellow:ai,dateText:oi,loggedByText:li,assignedText:ri,statusCol:ii,closedBadge:ci,pendingBadge:di,btnActionViewNote:hi,btnActionLog11:ui,btnInactiveDisabled:_i,btnInactiveDisabledRounded:mi,emptyFlagsText:gi,loadingBox:pi,btnInfoCircle:xi,caseWorkflowPopoverCard:yi,caseWorkflowPopoverHeader:fi,caseWorkflowPopoverTitle:ji,caseWorkflowPopoverSubtitle:vi,caseWorkflowTimelineContainer:wi,caseWorkflowStepRow:ki,caseWorkflowStepIconCol:Ci,caseWorkflowStepCircle:bi,caseWorkflowStepContentCol:Ni,caseWorkflowStepLabel:Si,caseWorkflowStepTitle:Ti,caseWorkflowStepDesc:Ii,caseWorkflowStepBadge:Li,headerWrapper:Di,iconContainer:$i,cardDescription:Ai,logCheckInBtn:Ri};function Oe(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 Mi(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:a.wellnessIconImg})}function Ei(n){const s=(n||"").toLowerCase();return s==="journey"?e.jsx(Hn,{width:16,height:16,color:"#0F9655"}):s==="completed_goal"?e.jsx(Pn,{width:16,height:16,color:"#0F9655"}):s==="add_goal"?e.jsx(qn,{width:16,height:16,color:"#316CD9"}):s==="ranked_strategy"||s==="ranked_learning_strategy"?e.jsx(gs,{width:16,height:16,color:"#A56F1A"}):e.jsx(Vn,{width:16,height:16,color:"#316CD9"})}function Bi(n){switch(n){case"flag":return e.jsx(Re,{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(Xn,{width:16,height:16,color:"#475569"});case"routing":return e.jsx(Zn,{width:16,height:16,color:"#059669"});default:return e.jsx(Re,{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 De(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 Fi(n){if(!n)return"";const s=n.endsWith("Z")||n.includes("+")?A(n):A.utc(n).local();return s.isValid()?s.fromNow():""}function Gi(n,s){if(s<=0)return 0;const t=Math.round(n/s*100);return Math.min(Math.max(t,0),100)}function Oi(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 Yi(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 Wi(n){const s=(n||"").toLowerCase();for(const[t,l]of Object.entries(ra))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:a.popoverContainer,children:[e.jsxs("div",{className:a.popoverHeader,children:[e.jsx("h3",{className:a.popoverTitle,children:s("what_the_flags_mean")}),e.jsx("p",{className:a.popoverDesc,children:s("two_flag_levels_are_raised_automatically")})]}),e.jsxs("div",{className:a.adminBadge,children:[e.jsx(Wn,{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?a.flagBlockRed:a.flagBlockYellow,children:[e.jsxs("div",{className:c?a.flagBlockRedHeader:a.flagBlockYellowHeader,children:[e.jsx("h4",{className:c?a.flagBlockTitleRed:a.flagBlockTitleYellow,children:t.flagName}),e.jsx("p",{className:a.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?a.flagBlockRedBody:a.flagBlockYellowBody,children:[e.jsx("div",{className:a.sectionSectionLabel,children:s("metrics_label")}),t.safetyThreshold!==void 0&&t.safetyThreshold!==null&&e.jsxs("div",{className:a.metricRow,children:[e.jsx("span",{children:s("safety_label")}),t.safetyLabel&&e.jsx("span",{className:c?a.metricPillRed:a.metricPillYellow,children:t.safetyLabel}),e.jsxs("strong",{children:["<"," ",t.safetyThreshold]})]}),t.stressThreshold!==void 0&&t.stressThreshold!==null&&e.jsxs("div",{className:a.metricRow,children:[e.jsx("span",{children:s("stress_label")}),t.stressLabel&&e.jsx("span",{className:c?a.metricPillRed:a.metricPillYellow,children:t.stressLabel}),e.jsxs("strong",{children:[">"," ",t.stressThreshold]})]}),t.monitoredKpis?.some(h=>h.toLowerCase().includes("readiness"))&&e.jsxs("div",{className:a.metricRow,children:[e.jsx("span",{children:s("readiness_to_learn_label")}),t.readinessLabel&&e.jsx("span",{className:c?a.metricPillRed:a.metricPillYellow,children:t.readinessLabel})]}),t.decreaseInAnyMetric!==void 0&&t.decreaseInAnyMetric!==null&&e.jsxs("div",{className:a.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:a.sectionSectionLabel,children:s("monitored_kpis_label")}),e.jsx("div",{className:a.kpiPillsList,children:t.monitoredKpis.map((h,d)=>e.jsx("span",{className:a.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:a.sectionSectionLabel,children:s("notifications_label")}),e.jsxs("p",{className:a.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:a.slaSection,children:[e.jsx("div",{className:a.slaDivider}),e.jsx("h3",{className:a.slaTitle,children:s("sla_policy_engine_and_escalation_matrix")}),e.jsx("p",{className:a.slaSubtitle,children:s("global_school_rules_decide_how_flags_are_raised")}),e.jsx("div",{className:a.slaList,children:ca.map(t=>e.jsxs("div",{className:a.slaItem,children:[e.jsx("div",{className:a.slaIconCircle,style:{backgroundColor:t.bgColor},children:Bi(t.iconType)}),e.jsxs("div",{className:a.slaInfo,children:[e.jsx("h4",{className:a.slaItemTitle,children:t.title}),e.jsx("p",{className:a.slaItemDesc,children:t.description})]})]},t.id))})]})]})},Hi=({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:a.flagsCardBox,children:[e.jsxs("div",{className:a.bannerHeader,children:[e.jsxs("span",{className:a.bannerTitle,children:[e.jsx(Re,{width:14,height:14,color:"#C44140"}),t("assigned_flags_review_or_log_a_1_1")]}),e.jsxs("button",{type:"button",className:a.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:a.studentList,children:n&&n.length>0?n.map((r,g)=>{const _=De(r.fullName),m=r.flagType==="Yellow flag",y=m?a.avatarInitialsYellow:a.avatarInitialsRed,v=r.avatar?p.getFileUrl(r.avatar):"";return e.jsxs("div",{className:a.studentItem,children:[e.jsxs("div",{className:a.studentMeta,children:[v?e.jsx(i.Avatar,{src:v,alt:r.fullName,className:y,style:{width:42,height:42}}):e.jsx("div",{className:y,children:_}),e.jsxs("div",{className:a.studentDetails,children:[e.jsxs("div",{className:a.studentNameRow,children:[e.jsx("span",{children:r.fullName}),r.gradeLevel&&e.jsxs("span",{className:a.studentGradeTag,children:["• ",ws(r.gradeLevel)]})]}),e.jsxs("div",{className:a.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.jsx("div",{className:a.actionBtnGroup,children:r.isActive===!1?e.jsx("button",{type:"button",disabled:!0,className:a.btnInactiveDisabled,children:t("inactive")||"Inactive"}):e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:a.btnOutline,onClick:()=>c(r),children:[e.jsx(Me,{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:a.btnActionViewNote,children:[e.jsx(Me,{width:12,height:12,color:"#ffffff"}),t("view_note")||"View note"]}):e.jsxs("button",{type:"button",className:a.btnFilledBlue,onClick:()=>h(r),children:[e.jsx(Ge,{width:14,height:14,color:"#ffffff"}),t("log_1_1")]})]})})]},r.studentId||g)}):e.jsx("p",{className:a.cardSubtitle,style:{padding:20},children:t("no_assigned_flags_to_display")})})]})},Pi=({items:n})=>{const{t:s}=p.useTranslation();return e.jsxs("div",{children:[e.jsx("div",{className:a.highlightsSubHeader,children:e.jsx("span",{className:a.highlightsSubTab,children:s("celebrating_student_achievements_from_the_last_14_days")})}),e.jsx("div",{className:a.highlightsListContainer,children:n&&n.length>0?n.map((t,l)=>{const c=(t.type||"").toLowerCase(),r=c==="completed_goal"||c==="journey"?a.avatarInitialsGreen:c==="add_goal"||c==="complete_plp"?a.avatarInitialsBlue:a.avatarInitialsYellow,g=t.avatarUrl?p.getFileUrl(t.avatarUrl):la;return e.jsxs("div",{className:a.highlightCard,children:[e.jsx(i.Avatar,{src:g,alt:t.studentName,className:r,style:{width:42,height:42}}),e.jsxs("div",{className:a.highlightContent,children:[e.jsxs("div",{className:a.highlightHeader,children:[e.jsx("span",{className:a.highlightName,children:t.studentName}),e.jsx("span",{className:a.dateAgoBadge,children:Fi(t.createdAt)||s("two_days_ago")})]}),e.jsxs("div",{className:a.highlightTitleRow,children:[Ei(t.type),e.jsx("span",{children:t.title})]}),e.jsx("p",{className:a.highlightDesc,children:t.description})]})]},l)}):e.jsx("p",{className:a.cardSubtitle,children:s("no_student_highlights_to_display")})})]})},qi=({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 b=E=>{g.current&&!g.current.contains(E.target)&&r(!1)};return d&&document.addEventListener("mousedown",b),()=>{document.removeEventListener("mousedown",b)}},[d]),!n)return null;const _=n.items||[],m=s?.items||[],y=n.redFlagCount||0,v=n.yellowFlagCount||0,f=n.totalFlaggedStudents||y+v||_.length,j=s?.totalHighlightsCount||m.length,S=b=>{h(E=>E===b?null:b)},T=as.find(b=>b.key===c),N=l(T?T.subtitleKey:"assigned_flags_from_the_last_15_days");return e.jsxs("div",{className:a.card,children:[e.jsxs("div",{className:a.cardHeader,children:[e.jsxs("div",{children:[e.jsx("h2",{className:a.cardTitle,children:l("what_needs_attention")}),e.jsx("p",{className:a.cardSubtitle,children:N})]}),e.jsxs("div",{ref:g,style:{position:"relative"},children:[e.jsxs("button",{type:"button",className:a.btnAlertsWork,onClick:()=>r(b=>!b),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:a.tabsRow,children:as.map(b=>{const E=c===b.key,Y=b.key==="flags"?f:j,H=E&&a[b.activeClass]||"",R=a[b.iconCircleClass]||"",C=a[b.actionLinkClass]||"";return e.jsxs("div",{className:`${a.tabCard} ${H}`,onClick:()=>S(b.key),children:[e.jsxs("div",{className:a.tabHeader,children:[e.jsx("div",{className:R,children:b.iconType==="flag"?e.jsx(Re,{width:18,height:18,color:b.iconColor}):e.jsx(gs,{width:18,height:18,color:b.iconColor})}),e.jsx("span",{children:l(b.labelKey)})]}),e.jsx("div",{className:a.tabValue,children:Y}),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}})]})})]},b.key)})}),c&&e.jsx("div",{className:a.tabContentContainer,children:c==="flags"?e.jsx(Hi,{items:_,onViewAllHistory:t}):e.jsx(Pi,{items:m})},c)]})},Vi=({open:n,onClose:s,students:t=[],totalCount:l,onLogOneToOne:c})=>{const{t:h}=p.useTranslation(),d=te.useNavigate(),r=l||t.length,g=y=>{if(s(),c)c(y.studentId);else{const v=y.lastConversationDate?re(y.lastConversationDate,"YYYY-MM-DD"):re(new Date().toISOString(),"YYYY-MM-DD"),f=encodeURIComponent(y.studentName||"");d(`/my-one-to-one/completed?date=${v}&name=${f}&session=${y.sessionId}&from=overview`)}},_=y=>{const v=y.daysWithoutConversation;if(v==null||v>=999||v<0){if(!y.sessionId||!y.sessionResultId){const j=h("no_check_in_recorded");return!j||j==="no_check_in_recorded"?"No check-in recorded":j}const f=h("no_1_1_recorded");return!f||f==="no_1_1_recorded"?"No 1-1 recorded":f}if(v>=14){const f=Math.floor(v/7);return h("last_talked_weeks_ago",{weeks:f})}return h("last_talked_days_ago",{days:v})},m=y=>y?/^\d+$/.test(y.trim())?`Grade ${y.trim()}`:y:"";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:a.modalHeader,children:[e.jsxs("div",{children:[e.jsx("h2",{className:a.modalTitle,children:h("missing_a_conversation")}),e.jsxs("p",{className:a.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:a.modalCloseBtn,onClick:s,children:e.jsx(Le,{width:16,height:16,color:"rgba(36,36,36,0.56)"})})]}),e.jsx(i.DialogContent,{className:a.modalBody,children:e.jsx("div",{className:a.studentList,children:t&&t.length>0?t.map((y,v)=>{const f=ns[v%ns.length];return e.jsxs("div",{className:a.studentCard,children:[e.jsxs("div",{className:a.studentInfo,children:[e.jsx(i.Avatar,{src:y.avatarUrl,style:{backgroundColor:f,color:"#242424",fontWeight:600},children:De(y.studentName)}),e.jsxs("div",{children:[e.jsxs("div",{className:a.studentName,children:[y.studentName," ",y.gradeLevel&&e.jsxs("span",{className:a.studentGradeDot,children:["· ",m(y.gradeLevel)]})]}),e.jsxs("div",{className:a.lastTalkedText,children:[e.jsx("span",{style:{marginRight:"4px"},children:"🕒"}),_(y)]})]})]}),y.isActive===!1?e.jsx("button",{type:"button",disabled:!0,className:a.btnInactiveDisabled,children:h("inactive")||"Inactive"}):y.sessionId&&y.sessionResultId?e.jsxs("button",{type:"button",className:a.btnLogOneToOne,onClick:()=>g(y),children:[e.jsx(Ge,{width:14,height:14,color:"#fff"})," ",h("log_1_1")]}):null]},y.studentId)}):e.jsx("p",{className:a.modalSubtitle,children:h("no_students_currently_missing_a_1_1_conversation")})})})]})},Ji=()=>{const{t:n,handleBookWellBeing:s,handleToggleModelStartCheckIn:t,openModelStartCheckIn:l}=tt.useMyWellBeing();return e.jsxs("div",{className:a.staffWellBeing,children:[e.jsxs("div",{className:a.wellBeingCard,children:[e.jsxs("div",{className:a.headerWrapper,children:[e.jsx("div",{className:a.iconContainer,children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#2E7D99",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"}),e.jsx("path",{d:"M12 5 9.04 7.96a2.17 2.17 0 0 0 0 3.08v0c.82.82 2.13.85 3 .07l2.07-1.9a2.82 2.82 0 0 1 3.9 0l.96.96"})]})}),e.jsx("h2",{className:a.cardTitle,children:n("your_well_being")})]}),e.jsx("p",{className:a.cardDescription,children:n("well_being_desc")}),e.jsxs("button",{type:"button",onClick:()=>t(),className:a.logCheckInBtn,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",children:[e.jsx("path",{d:"M17 3a2.85 2.85 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"}),e.jsx("path",{d:"m15 5 4 4"})]}),n("log_my_check_in")]})]}),e.jsx(st.ConfirmStartWellBeing,{open:l,onToggle:t,onConfirm:s})]})},Ui=({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:a.conversationCard,children:[e.jsxs("div",{className:a.convoHeader,children:[e.jsxs("div",{children:[e.jsx("h3",{className:a.cardTitle,children:s("one_to_one_conversation")}),e.jsx("p",{className:a.cardSubtitle,children:s("select_a_student_and_start_a_conversation")})]}),e.jsx(xs,{width:28,height:28,color:"#316CD9"})]}),e.jsx("div",{className:a.btnGroupConvo,children:e.jsxs("button",{type:"button",className:a.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:a.conversationCard,children:[e.jsxs("div",{className:a.convoHeader,children:[e.jsxs("div",{children:[e.jsx("h3",{className:a.cardTitle,children:s("missing_a_conversation")}),e.jsx("p",{className:a.cardSubtitle,children:s("students_with_no_1_1_in_the_last_30_days")})]}),e.jsx(ys,{width:26,height:26,color:"#316CD9"})]}),e.jsxs("div",{className:a.missingConvoBox,children:[e.jsxs("div",{className:a.missingText,children:[d," ",e.jsx("span",{children:s(d===1?"student_count_suffix":"students_count_suffix")})]}),e.jsxs("button",{type:"button",className:a.btnFilledRed,onClick:()=>h(!0),children:[e.jsx("span",{children:s("see_students")}),e.jsx(xe,{width:14,height:14,color:"#FFFFFF"})]})]})]}),e.jsx(Ji,{}),e.jsx(ds,{open:t,onClose:()=>l(!1)}),e.jsx(Vi,{open:c,onClose:()=>h(!1),students:n?.students,totalCount:n?.totalCount})]})},Ki=({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:a.modalHeader,children:[e.jsxs("div",{children:[e.jsx("h2",{className:a.modalTitle,children:l("unsafe_and_stressed_students")}),e.jsxs("p",{className:a.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:a.modalCloseBtn,onClick:s,children:e.jsx(Le,{width:16,height:16,color:"rgba(36,36,36,0.56)"})})]}),e.jsx(i.DialogContent,{className:a.dialogContentZero,children:e.jsx("div",{className:a.modalStudentList,children:t&&t.length>0?t.map(d=>e.jsxs("div",{className:a.studentCardBox,children:[e.jsx(i.Avatar,{src:d.studentAvatar,className:a.studentAvatarInitials,children:De(d.studentName)}),e.jsxs("div",{className:a.studentInfoCol,children:[e.jsx("div",{className:a.studentNameText,children:d.studentName}),d.gradeLevel&&e.jsxs("div",{className:a.studentGradeSub,children:["Grade ",d.gradeLevel]})]}),e.jsxs("div",{className:a.badgesWrapper,children:[d.isUnsafe&&e.jsxs("span",{className:a.unsafeBadge,children:[e.jsx(zn,{width:14,height:14,color:"#C44140"}),e.jsx("span",{children:l("unsafe")})]}),d.isHighStress&&e.jsxs("span",{className:a.highStressBadge,children:[e.jsx(Qn,{width:14,height:14,color:"#B46A00"}),e.jsx("span",{children:l("high_stress")})]})]}),d.isActive===!1?e.jsx("button",{type:"button",disabled:!0,className:a.btnInactiveDisabledRounded,children:l("inactive")||"Inactive"}):e.jsxs("button",{type:"button",className:a.btnViewCheckInWhite,onClick:()=>h(d),children:[e.jsx(Me,{width:15,height:15,color:"rgba(36,36,36,0.7)"}),l("view_check_in")]})]},d.sessionId||d.studentId)):e.jsx("p",{className:a.modalSubtitle,style:{padding:"20px 0",textAlign:"center"},children:l("no_students_flagged_for_safety_or_stress")})})})]})},zi=({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:a.card,children:[e.jsx("div",{className:a.cardHeader,children:e.jsxs("div",{children:[e.jsx("h2",{className:a.cardTitle,children:s("student_wellness")}),e.jsx("p",{className:a.cardSubtitle,children:s("this_months_average_vs_last_month")})]})}),e.jsx("div",{className:a.studentList,children:h&&h.length>0?h.map((r,g)=>{const _=(r.key||"").toLowerCase(),m=(r.title||"").toLowerCase(),y=_.includes("stress")||m.includes("stress"),v=r.changeVsLastMonth>=0?"up":"down",f=r.averageScore,j=r.averageScore-r.changeVsLastMonth,S=y?Math.abs(f)<=Math.abs(j):r.changeVsLastMonth>=0,T=nt.getColorAnswer(r.averageScore,y);return e.jsxs("div",{className:a.wellnessMetricRow,children:[e.jsxs("div",{className:a.wellnessLeft,children:[Mi(r.key,r.title),e.jsx("span",{children:r.title||r.key})]}),e.jsxs("div",{className:a.wellnessPillGreen,style:{backgroundColor:T},children:[e.jsx("span",{children:r.ratingLabel}),e.jsx("span",{className:a.wellnessPillDivider}),e.jsxs("span",{children:[r.averageScore,"%"]})]}),e.jsx("div",{className:a.wellnessTrendingRight,children:e.jsx(Jn,{direction:v,width:20,height:20,color:S?"#0F9655":"#C44140"})})]},r.key||g)}):null}),e.jsxs("button",{type:"button",className:a.fullBtnBlue,onClick:()=>t("/data-dashboard"),children:[e.jsx(Un,{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:a.fullBtnRed,onClick:()=>c(!0),children:[e.jsx(Kn,{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(Ki,{open:l,onClose:()=>c(!1),students:n.unhealthyStudents})]})},Qi=({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:a.card,children:[e.jsxs("div",{className:a.cardHeaderInline,children:[e.jsx("h2",{className:a.cardTitle,children:t("student_journeys")}),e.jsxs("button",{type:"button",className:a.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:a.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=Oe(h.name,d);return e.jsxs("div",{className:a.journeyItemCard,children:[e.jsxs("div",{className:a.journeyIconTitle,children:[e.jsx("div",{className:a.journeyCircleIcon,style:{backgroundColor:m},children:_?e.jsx("img",{src:g,alt:h.name,className:a.journeyIconImg}):e.jsx("span",{children:r||"🌍"})}),e.jsx("span",{className:a.journeyItemTitle,children:h.name})]}),e.jsxs("div",{className:a.journeyCountBadge,children:[e.jsx(ys,{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:a.cardSubtitle,children:t("no_journeys_active_at_this_time")})})]})},Xi=({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:a.modalHeader,children:[e.jsxs("div",{children:[e.jsx("h2",{className:a.modalTitle,children:l("what_the_flags_mean")}),e.jsx("p",{className:a.modalSubtitle,children:l("automated_alert_thresholds_and_notification_rules")})]}),e.jsx("button",{type:"button",className:a.modalCloseBtn,onClick:s,children:e.jsx(Le,{width:16,height:16,color:"rgba(36,36,36,0.56)"})})]}),e.jsx(i.DialogContent,{className:a.modalBody,children:e.jsx(ks,{configs:t})})]})},Zi=({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:a.engModalHeader,children:[e.jsxs("div",{children:[e.jsx("h2",{className:a.engModalTitle,children:c("all_student_engagements")}),e.jsx("p",{className:a.engModalSubtitle,children:c("view_overall_student_participation_across_journeys")})]}),e.jsxs("div",{className:a.engHeaderRight,children:[e.jsxs("div",{className:a.engTotalBox,children:[e.jsx("span",{className:a.engTotalLabel,children:c("total_students_engaged")}),e.jsx("span",{className:a.engTotalValue,children:d})]}),e.jsx("button",{type:"button",className:a.modalCloseBtn,onClick:s,children:e.jsx(Le,{width:16,height:16,color:"rgba(36,36,36,0.56)"})})]})]}),e.jsx(i.DialogContent,{className:a.dialogContentZero,children:e.jsx("div",{className:a.engJourneyList,children:h.map((r,g)=>{const _=r.icon||"",m=_?p.getStaticFileUrl(_):"",y=_.startsWith("http")||_.includes("/")||_.includes("."),v=Oe(r.name,g),j=Wi(r.name)?.subtitle||r.description||"",S=r.studentsEngagedCount||(r.students?r.students.length:0);return e.jsxs("div",{className:a.engJourneyRow,onClick:()=>l(r),children:[e.jsxs("div",{className:a.engJourneyLeft,children:[e.jsx("div",{className:a.engJourneyCircle,style:{backgroundColor:v},children:y?e.jsx("img",{src:m,alt:r.name,className:a.journeyIconImg}):e.jsx("span",{children:_||"🌍"})}),e.jsx("div",{children:e.jsxs("div",{className:a.engJourneyName,children:[e.jsx("strong",{children:r.name}),j&&e.jsxs("span",{className:a.engJourneyDesc,children:[" - ",j]})]})})]}),e.jsxs("div",{className:a.engJourneyRight,children:[e.jsxs("span",{className:a.engStudentCount,children:[c("students_engaged_label")," ",e.jsx("strong",{children:S})]}),e.jsx("span",{className:a.engArrow,children:e.jsx(xe,{width:22,height:22,color:"#316CD9"})})]})]},r.journeyId||g)})})})]})},ec=({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("."),_=Oe(t.name,0),m=t.studentsEngagedCount||h.length,y=(t.slug||"").toLowerCase().replace(/-/g,"_"),v=ia.find(f=>f.slug===y)?.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:a.jpHeader,children:[e.jsxs("div",{className:a.jpHeaderLeft,children:[l&&e.jsx("button",{type:"button",className:a.jpBackBtn,onClick:l,children:e.jsx(fs,{width:26,height:26,color:"#242424"})}),e.jsx("div",{className:a.jpIconCircle,style:{backgroundColor:_},children:g?e.jsx("img",{src:r,alt:t.name,className:a.journeyIconImg}):e.jsx("span",{children:d||"🗺️"})}),e.jsxs("div",{children:[e.jsx("h2",{className:a.jpTitle,children:t.name.includes("Journey")?t.name:`${t.name} Journey`}),e.jsx("p",{className:a.jpDesc,children:v}),e.jsxs("div",{className:a.jpEngagedLabel,children:[c("students_engaged_label")," ",e.jsx("strong",{children:m})]})]})]}),e.jsx("button",{type:"button",className:a.modalCloseBtn,onClick:s,children:e.jsx(Le,{width:16,height:16,color:"rgba(36,36,36,0.56)"})})]}),e.jsx("div",{className:a.jpDivider}),e.jsx(i.DialogContent,{className:a.dialogContentZero,children:e.jsxs("div",{className:a.jpProgressSection,children:[e.jsx("h3",{className:a.jpProgressTitle,children:c("student_progress")}),e.jsx("div",{className:a.jpStudentList,children:h&&h.length>0?h.map(f=>{const j=Gi(f.totalXp,f.maxXp||1e3),S=f.avatarUrl?p.getFileUrl(f.avatarUrl):"";return e.jsxs("div",{className:a.jpStudentCard,children:[e.jsxs("div",{className:a.jpStudentLeft,children:[e.jsx(i.Avatar,{src:S,className:a.studentAvatarInitials,children:De(f.studentName)}),e.jsx("div",{children:e.jsx("div",{className:a.jpStudentName,children:f.studentName})})]}),e.jsxs("div",{className:a.jpProgressCol,children:[e.jsxs("div",{className:a.jpXpHeader,children:[e.jsxs("span",{className:a.jpXpLabel,children:["⚡",c("xp_progress")]}),e.jsxs("span",{className:a.jpXpValue,children:[e.jsx("strong",{children:f.totalXp})," ",e.jsxs("span",{children:["/ ",f.maxXp||1e3]})]})]}),e.jsx("div",{className:a.jpProgressBar,children:e.jsx("div",{className:a.jpProgressFill,style:{width:`${j}%`}})})]})]},f.studentId)}):e.jsx("p",{className:a.modalSubtitle,style:{padding:"20px 0",textAlign:"center"},children:c("no_students_engaged_in_this_journey_yet")})})]})})]})},Be="mario_flags_history_filters",sc=()=>{try{const n=sessionStorage.getItem(Be);if(n)return JSON.parse(n)}catch{}return null},tc=()=>{const[n,s]=u.useState([]),[t,l]=u.useState(!0),c=u.useMemo(()=>sc(),[]),[h,d]=u.useState(c?.searchQuery||""),[r,g]=u.useState(c?.selectedGrades||["All grades"]),[_,m]=u.useState(c?.fromDate||""),[y,v]=u.useState(c?.toDate||""),[f,j]=u.useState(c?.selectedType||"All types");u.useEffect(()=>{try{sessionStorage.setItem(Be,JSON.stringify({searchQuery:h,selectedGrades:r,fromDate:_,toDate:y,selectedType:f}))}catch{}},[h,r,_,y,f]);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(B=>B.toLowerCase()!=="student").map(B=>B.toLowerCase());T=JSON.stringify(C.length>0?C:["teacher"])}const N=u.useCallback(async()=>{l(!0);try{const C=await On(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(()=>{N()},[N]);const b=u.useMemo(()=>{const C=new Set;return n.forEach(L=>{L.gradeLevel&&C.add(L.gradeLevel)}),["All grades",...Array.from(C).sort((L,G)=>{const D=parseInt(L.replace(/\D/g,""),10),k=parseInt(G.replace(/\D/g,""),10);return!isNaN(D)&&!isNaN(k)?D-k:L.localeCompare(G,void 0,{numeric:!0,sensitivity:"base"})})]},[n]),E=u.useCallback(C=>{if(C==="All grades"){g(["All grades"]);return}g(B=>{const L=B.filter(G=>G!=="All grades");if(L.includes(C)){const G=L.filter(D=>D!==C);return G.length===0?["All grades"]:G}else return[...L,C]})},[]),Y=u.useMemo(()=>n.filter(C=>{if(h.trim()){const B=h.toLowerCase().trim(),L=C.fullName?C.fullName.toLowerCase().includes(B):!1,G=C.gradeLevel?C.gradeLevel.toLowerCase().includes(B):!1;if(!L&&!G)return!1}if(r.length>0&&!r.includes("All grades")){const B=C.gradeLevel?C.gradeLevel:"";if(!B||!r.includes(B))return!1}if(f!=="All types"&&C.flagType!==f)return!1;if(_||y){if(!C.lastInteractionDate)return!1;const B=new Date(C.lastInteractionDate).getTime();if(_){const L=new Date(`${_}T00:00:00`).getTime();if(B<L)return!1}if(y){const L=new Date(`${y}T23:59:59`).getTime();if(B>L)return!1}}return!0}).sort((C,B)=>{const L=C.lastInteractionDate?new Date(C.lastInteractionDate).getTime():0;return(B.lastInteractionDate?new Date(B.lastInteractionDate).getTime():0)-L}),[n,h,r,f,_,y]),H=u.useCallback(()=>{if(!Y.length)return;const C=["Student","Grade","Type","Date & Time","Logged By","Status"],B=Y.map($=>[`"${($.fullName||"").replace(/"/g,'""')}"`,`"${($.gradeLevel||"").replace(/"/g,'""')}"`,`"${($.flagType||"").replace(/"/g,'""')}"`,`"${$.lastInteractionDate?re($.lastInteractionDate,"DD MMM YYYY · HH:mm A"):""}"`,`"${($.loggedByEducatorName||"Student check-in").replace(/"/g,'""')}"`,`"${$.hasOneToOneLogged?"Closed":"Pending"}"`]),L=[C.join(","),...B.map($=>$.join(","))].join(`
235
+ `),G=new Blob([L],{type:"text/csv;charset=utf-8;"}),D=URL.createObjectURL(G),k=document.createElement("a");k.setAttribute("href",D),k.setAttribute("download",`flags_history_${new Date().toISOString().slice(0,10)}.csv`),document.body.appendChild(k),k.click(),document.body.removeChild(k)},[Y]),R=u.useCallback(()=>{d(""),g(["All grades"]),m(""),v(""),j("All types");try{sessionStorage.removeItem(Be)}catch{}},[]);return{loading:t,items:Y,rawItems:n,gradeOptions:b,searchQuery:h,setSearchQuery:d,selectedGrades:r,setSelectedGrades:g,handleToggleGrade:E,fromDate:_,setFromDate:m,toDate:y,setToDate:v,selectedType:f,setSelectedType:j,handleExportCSV:H,resetFilters:R,refresh:N}},nc=()=>{const{t:n}=p.useTranslation(),s=(t,l)=>{switch(t){case"folderAdd":return e.jsx(sa,{width:16,height:16,color:l});case"bell":return e.jsx(js,{width:16,height:16,color:l});case"userCheck":return e.jsx(ta,{width:16,height:16,color:l});case"search":return e.jsx(vs,{width:16,height:16,color:l});case"lockCheck":return e.jsx(na,{width:16,height:16,color:l});default:return null}};return e.jsxs("div",{className:a.caseWorkflowPopoverCard,children:[e.jsxs("div",{className:a.caseWorkflowPopoverHeader,children:[e.jsx("h3",{className:a.caseWorkflowPopoverTitle,children:n("case_lifecycle_sla_workflow")||da}),e.jsx("p",{className:a.caseWorkflowPopoverSubtitle,children:n("how_every_safeguarding_case_moves")||ha})]}),e.jsx("div",{className:a.caseWorkflowTimelineContainer,children:ua.map(t=>e.jsxs("div",{className:a.caseWorkflowStepRow,children:[e.jsx("div",{className:a.caseWorkflowStepIconCol,children:e.jsx("div",{className:a.caseWorkflowStepCircle,style:{backgroundColor:t.bgColor},children:s(t.iconType,t.iconColor)})}),e.jsxs("div",{className:a.caseWorkflowStepContentCol,children:[e.jsx("div",{className:a.caseWorkflowStepLabel,children:n(t.stepLabelKey)||t.stepLabel}),e.jsx("h4",{className:a.caseWorkflowStepTitle,children:n(t.titleKey)||t.title}),e.jsx("p",{className:a.caseWorkflowStepDesc,children:n(t.descKey)||t.description}),t.badgeText&&e.jsxs("div",{className:a.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))})]})},ac=({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),y=u.useRef(null),{loading:v,items:f,gradeOptions:j,searchQuery:S,setSearchQuery:T,selectedGrades:N,handleToggleGrade:b,fromDate:E,setFromDate:Y,toDate:H,setToDate:R,selectedType:C,setSelectedType:B,handleExportCSV:L,resetFilters:G}=tc(),D=()=>{G(),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"}],$=()=>{const w=k.find(O=>O.value===C);return w?w.label:s("all_types")||"All types"};u.useEffect(()=>{const w=O=>{g.current&&!g.current.contains(O.target)&&r(!1),y.current&&!y.current.contains(O.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((O,X)=>{const ne=parseInt(O.replace(/\D/g,""),10),ie=parseInt(X.replace(/\D/g,""),10);return!isNaN(ne)&&!isNaN(ie)?ne-ie:O.localeCompare(X,void 0,{numeric:!0,sensitivity:"base"})}),J=()=>{if(N.includes("All grades")||N.length===0)return s("all_grades")||"All grades";const w=I(N);return w.length===1?V(w[0]):`Grade ${w.map(U).join(", ")}`},W=w=>{const O=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=${O}&name=${X}&session=${w.sessionId||""}&from=flags_history`)},K=w=>{const O=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=${O}&name=${X}&session=${w.sessionId||""}&from=flags_history`)};return e.jsxs("div",{className:a.flagsHistoryContainer,children:[e.jsxs("button",{type:"button",className:a.btnBackHome,onClick:D,children:[e.jsx(fs,{width:18,height:18,color:"rgba(36, 36, 36, 0.6)"}),s("back_to_home")||"Back to home"]}),e.jsxs("div",{className:a.flagsHistoryHeader,children:[e.jsxs("div",{children:[e.jsxs("h1",{className:a.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:a.btnInfoCircle,onClick:()=>c(w=>!w),children:e.jsx(ms,{width:14,height:14,color:"#316CD9"})}),l&&e.jsx(nc,{})]})]}),e.jsx("p",{className:a.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:a.btnExportCsv,onClick:L,children:[e.jsx(ea,{width:18,height:18,color:"#ffffff"}),s("export_csv")||"Export CSV"]})]}),e.jsxs("div",{className:a.flagsHistoryCard,children:[e.jsxs("div",{className:a.flagsHistoryFilterBar,children:[e.jsxs("div",{className:a.searchBox,children:[e.jsx(aa,{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:a.searchInput}),S&&e.jsx("button",{type:"button",onClick:()=>T(""),className:a.btnClearSearch,children:"✕"})]}),e.jsxs("div",{ref:g,style:{position:"relative"},children:[e.jsxs("button",{type:"button",className:a.multiSelectDropdownBtn,onClick:()=>r(w=>!w),children:[e.jsx("span",{className:a.multiSelectDropdownLabel,children:J()}),e.jsx("span",{style:{fontSize:10,color:"rgba(36,36,36,0.5)",flexShrink:0},children:"▼"})]}),d&&e.jsx("div",{className:a.multiSelectDropdownMenu,children:j.map(w=>{const O=N.includes(w);return e.jsxs("label",{className:a.multiSelectDropdownItem,children:[e.jsx("input",{type:"checkbox",checked:O,onChange:()=>b(w)}),e.jsx("span",{children:V(w)})]},w)})})]}),e.jsx(at.LocalizationProvider,{dateAdapter:ot.AdapterMoment,children:e.jsxs("div",{className:a.datePickerContainer,children:[e.jsx(Ve.DatePicker,{format:"DD MMM YYYY",label:s("from")||"From",value:E?A(E):null,onChange:w=>Y(w&&A(w).isValid()?A(w).format("YYYY-MM-DD"):""),slotProps:{textField:{variant:"outlined",size:"small",className:a.datePickerItem},openPickerButton:{"aria-label":"change date"}},maxDate:H?A(H):void 0}),e.jsx(Ve.DatePicker,{minDate:E?A(E):void 0,format:"DD MMM YYYY",label:s("to")||"To",value:H?A(H):null,onChange:w=>R(w&&A(w).isValid()?A(w).format("YYYY-MM-DD"):""),slotProps:{textField:{variant:"outlined",size:"small",className:a.datePickerItem},openPickerButton:{"aria-label":"change date"}}}),(E||H)&&e.jsx("button",{type:"button",onClick:()=>{Y(""),R("")},className:a.btnClearSearch,title:"Clear dates",children:"✕"})]})}),e.jsxs("div",{ref:y,style:{position:"relative"},children:[e.jsxs("button",{type:"button",className:`${a.multiSelectDropdownBtn} ${a.typeDropdownBtn}`,onClick:()=>m(w=>!w),children:[e.jsx("span",{className:a.multiSelectDropdownLabel,children:$()}),e.jsx("span",{style:{fontSize:10,color:"rgba(36,36,36,0.5)",flexShrink:0},children:"▼"})]}),_&&e.jsx("div",{className:a.multiSelectDropdownMenu,children:k.map(w=>{const O=C===w.value;return e.jsx("div",{className:`${a.multiSelectDropdownItem} ${O?a.dropdownItemSelected:""}`,onClick:()=>{B(w.value),m(!1)},children:e.jsx("span",{children:w.label})},w.value)})})]})]}),e.jsxs("div",{className:a.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:a.tableBodyBox,children:v?e.jsx("div",{className:a.loadingBox,children:e.jsx(i.CircularProgress,{size:32})}):f.length===0?e.jsx("div",{className:a.emptyFlagsText,children:s("no_flags_to_display")||"No flags match your filters."}):f.map((w,O)=>{const X=w.flagType==="Yellow flag",ne=w.avatar?p.getFileUrl(w.avatar):"",ie=De(w.fullName),me=w.hasOneToOneLogged;return e.jsxs("div",{className:`${a.tableRowGrid} ${O%2===0?a.tableRowEven:a.tableRowOdd}`,children:[e.jsxs("div",{className:a.studentMetaCol,children:[ne?e.jsx(i.Avatar,{src:ne,sx:{width:34,height:34}}):e.jsx("div",{className:X?a.avatarInitialsYellow:a.avatarInitialsRed,children:ie}),e.jsxs("div",{style:{minWidth:0,overflow:"hidden"},children:[e.jsx("div",{className:a.studentNameText,children:w.fullName}),e.jsx("div",{className:a.studentGradeText,children:w.gradeLevel&&ws(w.gradeLevel)})]})]}),e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[e.jsxs("span",{className:X?a.flagTypeBadgeYellow:a.flagTypeBadgeRed,children:[e.jsx("span",{className:X?a.flagDotYellow:a.flagDotRed}),w.flagType]}),e.jsx(ps,{width:14,height:14,color:X?"#FFB04F":"#C44140"})]}),e.jsx("div",{className:a.dateText,children:w.lastInteractionDate?re(w.lastInteractionDate,"DD MMM YYYY · hh:mm A"):"—"}),e.jsx("div",{className:a.loggedByText,children:w.loggedByEducatorName||s("student_check_in")||"Student check-in"}),e.jsx("div",{className:a.assignedText,children:"—"}),e.jsx("div",{children:w.isActive===!1?e.jsx("div",{className:a.statusCol,children:e.jsx("button",{type:"button",disabled:!0,className:a.btnInactiveDisabled,children:s("inactive")||"Inactive"})}):me?e.jsxs("div",{className:a.statusCol,children:[e.jsxs("span",{className:a.closedBadge,children:["✓ ",s("closed")||"Closed"]}),e.jsxs("button",{type:"button",onClick:()=>W(w),className:a.btnActionViewNote,children:[e.jsx(Me,{width:12,height:12,color:"#ffffff"}),s("view_note")||"View note"]})]}):e.jsxs("div",{className:a.statusCol,children:[e.jsxs("span",{className:a.pendingBadge,children:[e.jsx(oa,{width:13,height:13,color:"#C44140"}),s("pending")||"Pending"]}),e.jsxs("button",{type:"button",onClick:()=>K(w),className:a.btnFilledBlue,children:[e.jsx(Ge,{width:14,height:14,color:"#ffffff"}),s("log_1_1")||"Log 1:1"]})]})})]},w.sessionId||w.studentId||O)})})]})]})},oc=()=>{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=Oi(),r=Yi(h),g=r?`${d}, ${r}`:d,{data:_,loading:m,error:y,openFlagsModal:v,openJourneyModal:f,selectedJourney:j,handleOpenFlagsModal:S,handleCloseFlagsModal:T,handleOpenJourneyModal:N,handleCloseJourneyModal:b}=Yn(),E=C=>{N(C)},Y=()=>{N()};if(l==="flagsHistory")return e.jsx(ac,{onBack:()=>c("overview")});if(y)return e.jsx("div",{className:a.overviewContainer,children:e.jsx("p",{className:a.cardSubtitle,children:"Error loading overview data. Please try again later."})});const H=f&&!j,R=f&&!!j;return e.jsxs("div",{className:a.overviewContainer,children:[e.jsxs("div",{className:a.greetingHeader,children:[e.jsx("h1",{className:a.greetingTitle,children:g}),e.jsx("p",{className:a.greetingSubtitle,children:"Here's what's happening with your students recently"})]}),e.jsxs("div",{className:a.topLayoutGrid,children:[m?e.jsx("div",{className:a.blockLoadingContainer,style:{minHeight:340},children:e.jsx(i.CircularProgress,{size:32,style:{color:"#316CD9"}})}):e.jsx(qi,{flagsSection:_?.flagsSection,highlightsSection:_?.highlightsSection,onOpenInfoModal:S,onViewAllHistory:()=>c("flagsHistory")}),m?e.jsx("div",{className:a.blockLoadingContainer,style:{minHeight:340},children:e.jsx(i.CircularProgress,{size:32,style:{color:"#316CD9"}})}):e.jsx(Ui,{missingConversationsSection:_?.missingConversationsSection})]}),e.jsxs("div",{className:a.bottomLayoutGrid,children:[m?e.jsx("div",{className:a.blockLoadingContainer,style:{minHeight:260},children:e.jsx(i.CircularProgress,{size:32,style:{color:"#316CD9"}})}):e.jsx(zi,{studentWellnessSection:_?.studentWellnessSection}),m?e.jsx("div",{className:a.blockLoadingContainer,style:{minHeight:260},children:e.jsx(i.CircularProgress,{size:32,style:{color:"#316CD9"}})}):e.jsx(Qi,{engagementSection:_?.engagementSection,onOpenJourneyModal:N})]}),e.jsx(Xi,{open:v,onClose:T,configs:_?.flagsSection?.questionAlertsConfig}),e.jsx(Zi,{open:H,onClose:b,engagementSection:_?.engagementSection,onSelectJourney:E}),e.jsx(ec,{open:R,onClose:b,journey:j,onBack:Y})]})},lc=()=>{const s=Q.useSelector(t=>t.common?.user)?.roles?.includes("Student");return e.jsx("div",{className:`${o.home["home-wrapper"]} h-100`,children:s?e.jsx(Fn,{}):e.jsx(oc,{})})};exports.default=lc;