openlearn-next 0.4.0 → 0.4.1
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.
- package/dist/assets/{BatchPickerModal-BobcoTtn.js → BatchPickerModal-DCDKZsrS.js} +1 -1
- package/dist/assets/ClassesView-COk1pTlX.js +22 -0
- package/dist/assets/{ClassroomCountdownWidget-AWnCu4JJ.js → ClassroomCountdownWidget-CHUvYSrT.js} +1 -1
- package/dist/assets/{CloudDriveModal-Dr4kDySU.js → CloudDriveModal-DY7BSVJN.js} +1 -1
- package/dist/assets/{CourseManagement-DtInD0J-.js → CourseManagement-DA1m3Div.js} +1 -1
- package/dist/assets/{CourseWizardModal-B16QBckO.js → CourseWizardModal-yDZpcltW.js} +1 -1
- package/dist/assets/{Dashboard-D1gZ_4NI.js → Dashboard-QTNgTjoi.js} +1 -1
- package/dist/assets/{ExportWeightModal-UPsVax6L.js → ExportWeightModal-Cq3BaikE.js} +1 -1
- package/dist/assets/{HelpView-BryOHwLE.js → HelpView-DY4CA5VA.js} +1 -1
- package/dist/assets/{ImportLessonsModal-Dnx_QR0Z.js → ImportLessonsModal-DzeCcQOI.js} +1 -1
- package/dist/assets/InteractiveCoursewareViewer-D5py6E0c.js +1 -0
- package/dist/assets/{InteractiveWhiteboard-550JMFBu.js → InteractiveWhiteboard-D5YKM1I6.js} +1 -1
- package/dist/assets/{LazyCourseware-CLHWQJ8g.js → LazyCourseware-DWCx60AO.js} +2 -2
- package/dist/assets/{LazyWhiteboard-DJWh6sdV.js → LazyWhiteboard-CFn-1ATp.js} +2 -2
- package/dist/assets/LessonEditorView-CfvhQfzG.js +1 -0
- package/dist/assets/{LiveClassroomView-DgN2Zqe6.js → LiveClassroomView-CB_0PN1X.js} +2 -2
- package/dist/assets/{NotificationDetailModal-CMKHpWX1.js → NotificationDetailModal-DBg7UPZh.js} +1 -1
- package/dist/assets/{PluginView-BQVWPofY.js → PluginView-wozVlSXQ.js} +1 -1
- package/dist/assets/{QuizGeneratorModal-BeaBRn1w.js → QuizGeneratorModal-DnW-ff7D.js} +1 -1
- package/dist/assets/StudentAssignmentView-tQiAv5Xn.js +1 -0
- package/dist/assets/{StudentLessonView-CMPqL1ia.js → StudentLessonView-DRwhbGoU.js} +1 -1
- package/dist/assets/{StudentPreviewModal-0QSLnD9u.js → StudentPreviewModal-BQ_a7sQY.js} +1 -1
- package/dist/assets/{StudentView-9pjzjJgG.js → StudentView-XBaWzGO3.js} +2 -2
- package/dist/assets/{SystemResourceLibraryModal-COrhUd53.js → SystemResourceLibraryModal-Bcak0WSz.js} +1 -1
- package/dist/assets/{TeacherView-mP2YucVr.js → TeacherView-961tBSMT.js} +2 -2
- package/dist/assets/{index-C70OJPV_.js → index-BQF_s4QO.js} +27 -27
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/ClassesView-DtO0PJXQ.js +0 -22
- package/dist/assets/InteractiveCoursewareViewer-BYMKvIHi.js +0 -1
- package/dist/assets/LessonEditorView-DRwi0sjA.js +0 -1
- package/dist/assets/StudentAssignmentView-Dn4Bgqr2.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/StudentLessonView-
|
|
2
|
-
import{_ as Fe}from"./vendor-pdf-D7rGevI1.js";import{j as e,R as ve,r as S}from"./vendor-react-B0t7H3hh.js";import{m as B,A as Oe,E as ge}from"./index-C70OJPV_.js";import{f as Z,e as Xe,B as Ne,ag as ye,ah as H,ai as be,aj as et,ak as tt,m as st,C as ke,w as we,al as Ve,E as rt,am as ze,r as Se,F as ae,an as at,ao as nt,ap as it,N as te,aq as ot,ar as Be,as as qe,o as lt,a8 as dt,q as Ce,at as ct,au as xt,av as mt,aw as ht,b as ut,J as gt,Z as Me,ac as ft,ad as pt,X as _e,ax as bt,A as jt,p as Ee,af as vt,ay as yt,R as wt,U as Nt,z as Re}from"./vendor-icons-BRmhY6fg.js";import{Z as kt,_ as Ke,B as zt,$ as Ue,a as Qe,a0 as St,a1 as Ct,a2 as At,a3 as Lt,a4 as Dt,z as Tt,D as Mt,a5 as _t,a6 as Et,S as Rt,H as Wt,a7 as pe,a8 as $t,a9 as Pt,aa as Gt,ab as It,ac as Ft,ad as Ot}from"./vendor-motion-BFAPOs-b.js";import{a as me,L as je,C as ne,X as ie,Y as oe,b as le,T as de,c as ce,d as Vt,A as Bt,e as qt,B as Kt,f as Ut}from"./vendor-charts-qLbgF1eL.js";import"./vendor-utils-m0Urvtws.js";import"./vendor-pptx-C5-U7ieS.js";function Ae(s){return typeof s=="object"&&!Array.isArray(s)}function He(s,t,a,h){return s==null?[]:typeof s=="string"&&Ae(t)?kt(s,a,h):s instanceof NodeList?Array.from(s):Array.isArray(s)?s.filter(i=>i!=null):[s]}function Qt(s,t,a){return s*(t+1)+a*t}function We(s,t,a,h){return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,s+parseFloat(t)):t==="<"?a:t.startsWith("<")?Math.max(0,a+parseFloat(t.slice(1))):h.get(t)??s}function Ht(s,t,a){for(let h=0;h<s.length;h++){const i=s[h];i.at>t&&i.at<a&&(Ue(s,i),h--)}}function Yt(s,t,a,h,i,k){Ht(s,i,k);for(let x=0;x<t.length;x++)s.push({value:t[x],at:zt(i,k,h[x]),easing:Ke(a,x)})}function Jt(s,t,a=0){const h=t+1+t*a;for(let i=0;i<s.length;i++)s[i]=s[i]/h}function Zt(s,t){return s.at===t.at?s.value===null?1:t.value===null?-1:0:s.at-t.at}const Xt="easeInOut",es=20;function ts(s,{defaultTransition:t={},...a}={},h,i){const k=t.duration||.3,x=new Map,o=new Map,d={},L=new Map;let z=0,C=0,b=0;for(let D=0;D<s.length;D++){const f=s[D];if(typeof f=="string"){L.set(f,C);continue}else if(!Array.isArray(f)){L.set(f.name,We(C,f.at,z,L));continue}let[j,g,c={}]=f;c.at!==void 0&&(C=We(C,c.at,z,L));let r=0;const w=(n,y,N,_=0,$=0)=>{const M=ss(n),{delay:u=0,times:T=St(M),type:I=t.type||"keyframes",repeat:F,repeatType:l,repeatDelay:v=0,...A}=y;let{ease:E=t.ease||"easeOut",duration:p}=y;const R=typeof u=="function"?u(_,$):u,P=M.length,G=Dt(I)?I:i?.[I||"keyframes"];if(P<=2&&G){let V=100;if(P===2&&ns(M)){const O=M[1]-M[0];V=Math.abs(O)}const m={...t,...A};p!==void 0&&(m.duration=Tt(p));const W=Ct(m,V,G);E=W.ease,p=W.duration}p??(p=k);const q=C+R;T.length===1&&T[0]===0&&(T[1]=1);const K=T.length-M.length;if(K>0&&At(T,K),M.length===1&&M.unshift(null),F&&F<es){const V=p>0?v/p:0;p=Qt(p,F,v);const m=[...M],W=[...T];E=Array.isArray(E)?[...E]:[E];const O=[...E],X=l==="reverse"||l==="mirror";let Q=m,Y=O;X&&(Q=[...m].reverse(),l==="reverse"&&(Y=[...O].reverse().map(J=>typeof J=="function"?Lt(J):J)));for(let J=0;J<F;J++){const Le=X&&J%2===0,De=Le?Q:m,Ze=Le?Y:O,Te=(J+1)*(1+V);V>0&&(M.push(M[M.length-1]),T.push(Te),E.push("linear")),M.push(...De);for(let xe=0;xe<De.length;xe++)T.push(W[xe]+Te),E.push(xe===0?"linear":Ke(Ze,xe-1))}Jt(T,F,V)}const U=q+p;Yt(N,M,E,T,q,U),r=Math.max(R+p,r),b=Math.max(U,b)};if(Qe(j)){const n=$e(j,o);w(g,c,Pe("default",n))}else{const n=He(j,g,h,d),y=n.length;for(let N=0;N<y;N++){g=g,c=c;const _=n[N],$=$e(_,o);for(const M in g)w(g[M],rs(c,M),Pe(M,$),N,y)}}z=C,C+=r}return o.forEach((D,f)=>{for(const j in D){const g=D[j];g.sort(Zt);const c=[],r=[],w=[];for(let _=0;_<g.length;_++){const{at:$,value:M,easing:u}=g[_];c.push(M),r.push(Mt(0,b,$)),w.push(u||"easeOut")}r[0]!==0&&(r.unshift(0),c.unshift(c[0]),w.unshift(Xt)),r[r.length-1]!==1&&(r.push(1),c.push(null)),x.has(f)||x.set(f,{keyframes:{},transition:{}});const n=x.get(f);n.keyframes[j]=c;const{type:y,...N}=t;n.transition[j]={...N,duration:b,ease:w,times:r,...a}}}),x}function $e(s,t){return!t.has(s)&&t.set(s,{}),t.get(s)}function Pe(s,t){return t[s]||(t[s]=[]),t[s]}function ss(s){return Array.isArray(s)?s:[s]}function rs(s,t){return s&&s[t]?{...s,...s[t]}:{...s}}const as=s=>typeof s=="number",ns=s=>s.every(as);function is(s){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},a=_t(s)&&!Et(s)?new Rt(t):new Wt(t);a.mount(s),pe.set(s,a)}function os(s){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},a=new $t(t);a.mount(s),pe.set(s,a)}function ls(s,t){return Qe(s)||typeof s=="number"||typeof s=="string"&&!Ae(t)}function Ye(s,t,a,h){const i=[];if(ls(s,t))i.push(Pt(s,Ae(t)&&t.default||t,a&&(a.default||a)));else{if(s==null)return i;const k=He(s,t,h),x=k.length;for(let o=0;o<x;o++){const d=k[o],L=d instanceof Element?is:os;pe.has(d)||L(d);const z=pe.get(d),C={...a};"delay"in C&&typeof C.delay=="function"&&(C.delay=C.delay(o,x)),i.push(...Gt(z,{...t,transition:C},{}))}}return i}function ds(s,t,a){const h=[],i=s.map(x=>{if(Array.isArray(x)&&typeof x[0]=="function"){const o=x[0],d=It(0);return d.on("change",o),x.length===1?[d,[0,1]]:x.length===2?[d,[0,1],x[1]]:[d,x[1],x[2]]}return x});return ts(i,t,a,{spring:Ft}).forEach(({keyframes:x,transition:o},d)=>{h.push(...Ye(d,x,o))}),h}function cs(s){return Array.isArray(s)&&s.some(Array.isArray)}function xs(s={}){const{scope:t,reduceMotion:a,skipAnimations:h}=s;function i(k,x,o){let d=[],L;const z={};if(a!==void 0&&(z.reduceMotion=a),h!==void 0&&(z.skipAnimations=h),cs(k)){const{onComplete:b,...D}=x||{};typeof b=="function"&&(L=b),d=ds(k,{...z,...D},t)}else{const{onComplete:b,...D}=o||{};typeof b=="function"&&(L=b),d=Ye(k,x,{...z,...D},t)}const C=new Ot(d);return L&&C.finished.then(L),t&&(t.animations.push(C),C.finished.then(()=>{Ue(t.animations,C)})),C}return i}const ms=xs();function hs(s){const{students:t,activeStudentId:a}=s;return e.jsxs("div",{className:"flex items-center gap-4 border-b border-gray-200 pb-4",children:[e.jsx("div",{className:"h-16 w-16 bg-indigo-600 rounded-full flex items-center justify-center text-white text-2xl font-bold shadow-lg",children:t.find(h=>h.id===a)?.name.charAt(0).toUpperCase()}),e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-gray-800",children:["Welcome, ",t.find(h=>h.id===a)?.name]}),e.jsx("p",{className:"text-gray-500",children:"Here is your learning summary."})]})]})}function us(s){const{studentDashboardData:t,readNotifications:a,setReadNotifications:h,activeStudentId:i,addToast:k,lang:x}=s,d=(t?.rollcalls||[]).filter(L=>!a.has(L.id));return d.length===0?null:e.jsx("div",{className:"space-y-4",children:d.map(L=>e.jsxs(B.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},className:"bg-amber-500 rounded-2xl p-6 text-white shadow-xl relative overflow-hidden",children:[e.jsx("div",{className:"absolute -right-10 -bottom-10 w-40 h-40 bg-white/10 rounded-full blur-2xl animate-pulse"}),e.jsx("div",{className:"absolute -left-10 -top-10 w-32 h-32 bg-yellow-300/20 rounded-full blur-xl"}),e.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between gap-4 relative z-10",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"p-3 bg-white/20 backdrop-blur-md rounded-xl animate-bounce shrink-0",children:e.jsx(Z,{className:"h-6 w-6 text-yellow-100"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold tracking-tight",children:x==="zh"?"⚡️ 闪电提问点名中,请立即回应!":"⚡️ Active Classroom Roll Call Alarm!"}),e.jsx("p",{className:"text-yellow-50 text-sm mt-1 max-w-xl font-medium",children:x==="zh"?`您刚才在课程"${L.lesson_title||"课堂"}"中被老师随机选中。大屏已同步闪烁您的姓名,请点击右侧按钮确认专注参与!`:`You have been randomly selected by the teacher in lesson "${L.lesson_title||"Class"}". Please click the button to confirm your presence and active attention!`})]})]}),e.jsxs("button",{onClick:async()=>{try{await fetch(`/api/students/${i}/read_notifications`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({notificationId:L.id})}),h(z=>{const C=new Set(z);return C.add(L.id),C}),k(x==="zh"?"已确认参与状态":"Presence confirmed",x==="zh"?"成功!已安全同步并确认在线。":"Successfully synchronized and confirmed active presence.","success")}catch(z){console.error("Failed to acknowledge rollcall",z)}},className:"px-5 py-2.5 bg-slate-900 hover:bg-slate-800 text-white font-bold text-xs uppercase tracking-wider rounded-xl shadow-lg ring-2 ring-white/20 active:scale-95 transition-all flex items-center gap-2 cursor-pointer shrink-0",children:[e.jsx(Xe,{size:14}),e.jsx("span",{children:x==="zh"?"🙋♂️ 我已就位 / 确认听讲":"🙋♂️ Present & Alert"})]})]})]},L.id))})}function gs(s){const{progress:t,setSelectedLesson:a,setStudentViewStatus:h}=s;return e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 shadow-sm flex flex-col",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 flex items-center gap-2",children:[e.jsx(Ne,{size:18,className:"text-teal-500"}),e.jsx("h3",{className:"font-semibold text-gray-800",children:"My Independent Courses"})]}),e.jsx("div",{className:"p-4",children:t&&t.length===0?e.jsx("div",{className:"text-center p-8 text-gray-400 italic text-sm",children:"No courses assigned yet."}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:t?.map(i=>e.jsxs("div",{className:"flex flex-col p-4 rounded-xl border border-gray-100 bg-gray-50 hover:border-teal-200 hover:shadow-sm transition-all focus:outline-none",children:[e.jsxs("div",{className:"flex justify-between items-start mb-3",children:[e.jsx("div",{className:"font-semibold text-gray-800 text-lg",children:i.lesson_title}),i.completed===1&&e.jsx("span",{className:"bg-green-100 text-green-800 text-xs px-1.5 py-0.5 rounded uppercase font-bold",children:"Completed"})]}),e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"flex-1 h-2 bg-gray-200 rounded-full overflow-hidden shrink-0",children:e.jsx("div",{className:`h-full ${i.progress_percent===100?"bg-green-500":"bg-teal-500"}`,style:{width:`${i.progress_percent}%`}})}),e.jsxs("span",{className:"text-xs text-gray-500 font-medium shrink-0",children:[i.progress_percent,"%"]})]}),e.jsx("button",{onClick:()=>{a(i.lesson_id),h("lesson")},className:"w-full flex justify-center items-center gap-2 bg-teal-500 hover:bg-teal-600 text-white px-4 py-2 rounded-lg text-sm font-semibold shadow-sm transition-colors mt-auto",children:i.progress_percent===0?e.jsxs(e.Fragment,{children:[e.jsx(ye,{size:16})," Start Learning"]}):e.jsxs(e.Fragment,{children:[e.jsx(ye,{size:16})," Continue"]})})]},i.lesson_id))})})]})}function he({value:s,duration:t=1}){const[a,h]=ve.useState(0);return ve.useEffect(()=>{const i=ms(a,s,{duration:t,ease:"easeOut",onUpdate:k=>h(Math.round(k))});return()=>i.stop()},[s,t]),e.jsx(e.Fragment,{children:a})}function fs(s){const{studentDashboardData:t}=s;return e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[e.jsxs(B.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.4,delay:.05},className:"bg-white p-4 rounded-xl border border-gray-200 shadow-sm flex flex-col items-center justify-center hover:border-indigo-300 hover:shadow-md transition-all duration-300",children:[e.jsx("span",{className:"text-3xl font-bold text-indigo-600",children:e.jsx(he,{value:t.classes?.length||0})}),e.jsx("span",{className:"text-sm font-medium text-gray-500 mt-1 uppercase tracking-wider text-center select-none",children:"Enrolled Classes"})]}),e.jsxs(B.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.4,delay:.1},className:"bg-white p-4 rounded-xl border border-gray-200 shadow-sm flex flex-col items-center justify-center hover:border-teal-300 hover:shadow-md transition-all duration-300",children:[e.jsx("span",{className:"text-3xl font-bold text-teal-600",children:e.jsx(he,{value:t.assignments?.filter(a=>a.submission_status==="graded").length||0})}),e.jsx("span",{className:"text-sm font-medium text-gray-500 mt-1 uppercase tracking-wider text-center select-none",children:"Completed Assignments"})]}),e.jsxs(B.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.4,delay:.15},className:"bg-white p-4 rounded-xl border border-gray-200 shadow-sm flex flex-col items-center justify-center hover:border-amber-300 hover:shadow-md transition-all duration-300",children:[e.jsx("span",{className:"text-3xl font-bold text-amber-500",children:e.jsx(he,{value:t.assignments?.filter(a=>!a.submission_status).length||0})}),e.jsx("span",{className:"text-sm font-medium text-gray-500 mt-1 uppercase tracking-wider text-center select-none",children:"Pending Assignments"})]}),e.jsxs(B.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.4,delay:.2},className:"bg-white p-4 rounded-xl border border-gray-200 shadow-sm flex flex-col items-center justify-center hover:border-pink-300 hover:shadow-md transition-all duration-300",children:[e.jsx("span",{className:"text-3xl font-bold text-pink-600",children:e.jsx(he,{value:t.schedules?.length||0})}),e.jsx("span",{className:"text-sm font-medium text-gray-500 mt-1 uppercase tracking-wider text-center select-none",children:"Upcoming Lessons"})]})]})}const ps=[{weekKey:"W1",weekLabel:"Week 1",dateRange:"Apr 06 - Apr 12",averageScore:74.5,assignmentsCount:2,highestScore:78,lowestScore:71,targetScore:80,trendDiff:null,status:"average"},{weekKey:"W2",weekLabel:"Week 2",dateRange:"Apr 13 - Apr 19",averageScore:78,assignmentsCount:3,highestScore:82,lowestScore:75,targetScore:80,trendDiff:3.5,status:"good"},{weekKey:"W3",weekLabel:"Week 3",dateRange:"Apr 20 - Apr 26",averageScore:81.5,assignmentsCount:3,highestScore:86,lowestScore:77,targetScore:80,trendDiff:3.5,status:"good"},{weekKey:"W4",weekLabel:"Week 4",dateRange:"Apr 27 - May 03",averageScore:79,assignmentsCount:4,highestScore:84,lowestScore:72,targetScore:80,trendDiff:-2.5,status:"average"},{weekKey:"W5",weekLabel:"Week 5",dateRange:"May 04 - May 10",averageScore:85,assignmentsCount:3,highestScore:90,lowestScore:80,targetScore:80,trendDiff:6,status:"excellent"},{weekKey:"W6",weekLabel:"Week 6",dateRange:"May 11 - May 17",averageScore:88.5,assignmentsCount:4,highestScore:93,lowestScore:84,targetScore:80,trendDiff:3.5,status:"excellent"},{weekKey:"W7",weekLabel:"Week 7",dateRange:"May 18 - May 24",averageScore:91,assignmentsCount:3,highestScore:95,lowestScore:87,targetScore:80,trendDiff:2.5,status:"excellent"},{weekKey:"W8",weekLabel:"Week 8",dateRange:"May 25 - May 31",averageScore:93.5,assignmentsCount:4,highestScore:98,lowestScore:89,targetScore:80,trendDiff:2.5,status:"excellent"}];function Je({assignments:s=[],lang:t="en"}){const[a,h]=S.useState("all"),[i,k]=S.useState("all"),[x,o]=S.useState(!0),[d,L]=S.useState(!0),[z,C]=S.useState(!0),b=S.useMemo(()=>{const c=new Set;return s.forEach(r=>{r.class_name&&c.add(r.class_name)}),Array.from(c)},[s]),{weeklyData:D,isDemoData:f,stats:j}=S.useMemo(()=>{const c=s.filter(p=>p.submission_status==="graded"&&typeof p.score=="number"&&p.score!==null),r=a==="all"?c:c.filter(p=>p.class_name===a);if(r.length<2){if(!z)return{weeklyData:[],isDemoData:!1,stats:{currentAvg:0,highestWeeklyAvg:0,totalSubmissions:0,growthTrend:0,targetMetRate:0}};let p=ps.map((m,W)=>t==="zh"?{...m,weekLabel:`第 ${W+1} 周`}:m);i==="4weeks"?p=p.slice(-4):i==="8weeks"&&(p=p.slice(-8));const R=p.reduce((m,W)=>m+W.assignmentsCount,0),P=p.length>0?p[p.length-1].averageScore:0,G=Math.max(...p.map(m=>m.averageScore)),q=p[0]?.averageScore||P,K=Number((P-q).toFixed(1)),U=p.filter(m=>m.averageScore>=80).length,V=Math.round(U/p.length*100);return{weeklyData:p,isDemoData:!0,stats:{currentAvg:P,highestWeeklyAvg:G,totalSubmissions:R,growthTrend:K,targetMetRate:V}}}const w=[...r].sort((p,R)=>{const P=p.graded_at||p.submitted_at||p.created_at||0,G=R.graded_at||R.submitted_at||R.created_at||0;return P-G}),n=w[0].graded_at||w[0].submitted_at||w[0].created_at||Date.now(),y=10080*60*1e3,N=new Map;w.forEach(p=>{const R=p.graded_at||p.submitted_at||p.created_at||n,P=Math.max(0,Math.floor((R-n)/y)),G=N.get(P)||{scores:[],count:0,minTime:R,maxTime:R};G.scores.push(p.score),G.count+=1,G.minTime=Math.min(G.minTime,R),G.maxTime=Math.max(G.maxTime,R),N.set(P,G)});const _=Array.from(N.keys()).sort((p,R)=>p-R);let $=null;const M=_.map((p,R)=>{const P=N.get(p),G=Number((P.scores.reduce((Q,Y)=>Q+Y,0)/P.scores.length).toFixed(1)),q=Math.max(...P.scores),K=Math.min(...P.scores),U=$!==null?Number((G-$).toFixed(1)):null;$=G;const V=new Date(P.minTime),m=new Date(P.maxTime+8640*60*1e3),W=t==="zh"?`${V.getMonth()+1}月${V.getDate()}日 - ${m.getMonth()+1}月${m.getDate()}日`:`${V.toLocaleDateString("en-US",{month:"short",day:"numeric"})} - ${m.toLocaleDateString("en-US",{month:"short",day:"numeric"})}`,O=G>=85?"excellent":G>=75?"good":G>=60?"average":"needs_work",X=t==="zh"?`第 ${R+1} 周`:`Week ${R+1}`;return{weekKey:`W${R+1}`,weekLabel:X,dateRange:W,averageScore:G,assignmentsCount:P.count,highestScore:q,lowestScore:K,targetScore:80,trendDiff:U,status:O}});let u=M;i==="4weeks"?u=M.slice(-4):i==="8weeks"&&(u=M.slice(-8));const T=u.reduce((p,R)=>p+R.assignmentsCount,0),I=u.length>0?u[u.length-1].averageScore:0,F=u.length>0?Math.max(...u.map(p=>p.averageScore)):0,l=u[0]?.averageScore||I,v=Number((I-l).toFixed(1)),A=u.filter(p=>p.averageScore>=80).length,E=u.length>0?Math.round(A/u.length*100):0;return{weeklyData:u,isDemoData:!1,stats:{currentAvg:I,highestWeeklyAvg:F,totalSubmissions:T,growthTrend:v,targetMetRate:E}}},[s,a,i,t,z]),g={title:t==="zh"?"每周学业进展趋势 (Weekly Progress)":"Weekly Progress Trend",badge:t==="zh"?"阶段成长分析":"Academic Growth",subtitle:t==="zh"?"按周追踪学业平均表现、作业完成密度与目标达成演进曲线":"Track weekly average score trajectory, coursework completion density, and milestone progression over time",classFilter:t==="zh"?"筛选课程:":"Class Filter:",allClasses:t==="zh"?"全学科综合":"All Subjects",scope4:t==="zh"?"最近4周":"Last 4 Weeks",scope8:t==="zh"?"最近8周":"Last 8 Weeks",scopeAll:t==="zh"?"全部学期":"Full Semester",targetLineToggle:t==="zh"?"目标基准线 (80%)":"Target Goal (80%)",demoBadge:t==="zh"?"演示样本数据":"Sample Trend Preview",statCurrent:t==="zh"?"最新周均分":"Current Week Avg",statPeak:t==="zh"?"最高周表现":"Peak Week Avg",statTargetRate:t==="zh"?"达标达标率":"Target Goal Met",statSubmissions:t==="zh"?"统计作业总数":"Completed Works",emptyTitle:t==="zh"?"暂无足够周次的作业评定数据":"Awaiting Weekly Graded Records",emptyDesc:t==="zh"?"当你在不同周次完成作业并获得评分后,系统将自动汇总每周均分并生成学业成长曲线。":"Once your coursework receives weekly evaluations, the progress motor groups them by week to visualize your trajectory.",enableSampleBtn:t==="zh"?"查看演示成长曲线":"Preview Sample Growth Trajectory",tooltipScore:t==="zh"?"周均分":"Weekly Average",tooltipWorks:t==="zh"?"完成作业数":"Completed Tasks",tooltipRange:t==="zh"?"最高/最低":"High / Low"};return e.jsxs("div",{className:"bg-white border border-gray-200 rounded-2xl shadow-sm hover:shadow-md transition-all overflow-hidden flex flex-col font-sans mb-6",id:"weekly-progress-trend-card",children:[e.jsxs("div",{className:"p-5 border-b border-gray-100 bg-linear-to-r from-indigo-50/20 via-white to-sky-50/20 flex flex-col md:flex-row md:items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"p-2.5 bg-indigo-50 text-indigo-600 rounded-xl mt-0.5 shadow-2xs",children:e.jsx(H,{size:20,className:"stroke-[2.5]"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"font-extrabold text-gray-950 text-base flex items-center gap-1.5",children:g.title}),e.jsxs("span",{className:"inline-flex items-center gap-1 bg-indigo-50 text-indigo-700 border border-indigo-200/60 rounded-full px-2 py-0.5 text-xs font-bold",children:[e.jsx(Z,{size:11,className:"text-indigo-500"}),g.badge]}),f&&e.jsxs("span",{className:"inline-flex items-center gap-1 bg-amber-50 text-amber-700 border border-amber-200/60 rounded-full px-2 py-0.5 text-xs font-semibold",children:[e.jsx(be,{size:11}),g.demoBadge]})]}),e.jsx("p",{className:"text-gray-500 text-xs mt-0.5",children:g.subtitle})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2.5 self-start md:self-center",children:[b.length>0&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-xs font-medium text-gray-500 hidden sm:inline",children:g.classFilter}),e.jsxs("select",{value:a,onChange:c=>h(c.target.value),className:"bg-white border border-gray-200 text-xs text-gray-700 font-semibold rounded-lg px-2 py-1.5 focus:outline-none focus:ring-1 focus:ring-indigo-500 shadow-2xs",children:[e.jsx("option",{value:"all",children:g.allClasses}),b.map((c,r)=>e.jsx("option",{value:c,children:c},r))]})]}),e.jsxs("div",{className:"inline-flex p-0.5 bg-gray-100/80 rounded-lg border border-gray-200 text-xs font-medium",children:[e.jsx("button",{onClick:()=>k("4weeks"),className:`px-2.5 py-1 rounded-md transition-all ${i==="4weeks"?"bg-white text-indigo-700 font-bold shadow-2xs":"text-gray-600 hover:text-gray-900"}`,children:g.scope4}),e.jsx("button",{onClick:()=>k("8weeks"),className:`px-2.5 py-1 rounded-md transition-all ${i==="8weeks"?"bg-white text-indigo-700 font-bold shadow-2xs":"text-gray-600 hover:text-gray-900"}`,children:g.scope8}),e.jsx("button",{onClick:()=>k("all"),className:`px-2.5 py-1 rounded-md transition-all ${i==="all"?"bg-white text-indigo-700 font-bold shadow-2xs":"text-gray-600 hover:text-gray-900"}`,children:g.scopeAll})]}),e.jsxs("button",{onClick:()=>o(!x),className:`px-2.5 py-1 text-xs font-semibold rounded-lg border flex items-center gap-1.5 transition-all cursor-pointer ${x?"bg-emerald-50 border-emerald-200 text-emerald-700":"bg-white border-gray-200 text-gray-500 hover:text-gray-800"}`,title:"Toggle 80% Benchmark Line",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${x?"bg-emerald-500":"bg-gray-300"}`}),g.targetLineToggle]})]})]}),e.jsxs("div",{className:"px-5 py-3 border-b border-gray-100 bg-slate-50/40 grid grid-cols-2 sm:grid-cols-4 gap-3.5 select-none",children:[e.jsxs("div",{className:"p-3 bg-white border border-gray-100 rounded-xl shadow-2xs flex flex-col justify-center",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs font-semibold text-gray-500",children:[e.jsx("span",{children:g.statCurrent}),e.jsxs("span",{className:`inline-flex items-center text-xs font-bold ${j.growthTrend>0?"text-emerald-600":j.growthTrend<0?"text-rose-600":"text-gray-500"}`,children:[j.growthTrend>0?e.jsx(et,{size:13}):j.growthTrend<0?e.jsx(tt,{size:13}):e.jsx(st,{size:13}),j.growthTrend>0?`+${j.growthTrend}%`:`${j.growthTrend}%`]})]}),e.jsx("span",{className:"text-xl font-black text-indigo-950 font-mono mt-0.5",children:j.currentAvg>0?`${j.currentAvg}%`:"—"})]}),e.jsxs("div",{className:"p-3 bg-white border border-gray-100 rounded-xl shadow-2xs flex flex-col justify-center",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-500",children:g.statPeak}),e.jsx("span",{className:"text-xl font-black text-emerald-950 font-mono mt-0.5",children:j.highestWeeklyAvg>0?`${j.highestWeeklyAvg}%`:"—"})]}),e.jsxs("div",{className:"p-3 bg-white border border-gray-100 rounded-xl shadow-2xs flex flex-col justify-center",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-500",children:g.statTargetRate}),e.jsx("span",{className:"text-xl font-black text-teal-950 font-mono mt-0.5",children:D.length>0?`${j.targetMetRate}%`:"—"})]}),e.jsxs("div",{className:"p-3 bg-white border border-gray-100 rounded-xl shadow-2xs flex flex-col justify-center",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-500",children:g.statSubmissions}),e.jsx("span",{className:"text-xl font-black text-slate-900 font-mono mt-0.5",children:j.totalSubmissions})]})]}),e.jsx("div",{className:"p-5",children:D.length===0?e.jsxs("div",{className:"text-center py-12 bg-slate-50/50 rounded-xl border border-dashed border-slate-200",children:[e.jsx(ke,{size:32,className:"mx-auto text-slate-300 mb-2"}),e.jsx("h4",{className:"text-gray-800 text-sm font-bold",children:g.emptyTitle}),e.jsx("p",{className:"text-gray-400 text-xs mt-1 px-4 max-w-md mx-auto",children:g.emptyDesc}),e.jsxs("button",{onClick:()=>C(!0),className:"mt-4 px-3.5 py-1.5 bg-indigo-50 hover:bg-indigo-100 text-indigo-700 border border-indigo-200 rounded-lg text-xs font-bold transition-colors inline-flex items-center gap-1.5 cursor-pointer",children:[e.jsx(Z,{size:13}),g.enableSampleBtn]})]}):e.jsx("div",{className:"w-full h-[280px]",children:e.jsx(me,{width:"100%",height:"100%",children:e.jsxs(je,{data:D,margin:{top:15,right:20,left:-20,bottom:5},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"indigoScoreGrad",x1:"0",y1:"0",x2:"1",y2:"0",children:[e.jsx("stop",{offset:"0%",stopColor:"#6366f1"}),e.jsx("stop",{offset:"50%",stopColor:"#818cf8"}),e.jsx("stop",{offset:"100%",stopColor:"#a855f7"})]})}),d&&e.jsx(ne,{strokeDasharray:"3 3",vertical:!1,stroke:"#f1f5f9"}),e.jsx(ie,{dataKey:"weekLabel",tick:{fontSize:11,fill:"#64748b",fontWeight:"bold"},axisLine:{stroke:"#e2e8f0"},tickLine:!1}),e.jsx(oe,{domain:[0,100],ticks:[0,20,40,60,80,100],tick:{fontSize:11,fill:"#64748b",fontWeight:"bold"},axisLine:{stroke:"#e2e8f0"},tickLine:!1,tickFormatter:c=>`${c}%`}),x&&e.jsx(le,{y:80,stroke:"#10b981",strokeDasharray:"4 4",strokeWidth:1.5,label:{value:t==="zh"?"目标 80%":"Target 80%",fill:"#059669",fontSize:10,fontWeight:700,position:"insideTopRight"}}),e.jsx(de,{content:({active:c,payload:r})=>{if(!c||!r||!r.length)return null;const w=r[0].payload;return e.jsxs("div",{className:"bg-slate-900 text-white rounded-xl p-3 shadow-xl border border-slate-700/80 text-xs min-w-[200px] z-50",children:[e.jsxs("div",{className:"flex items-center justify-between pb-1.5 border-b border-slate-800",children:[e.jsx("span",{className:"font-extrabold text-indigo-300",children:w.weekLabel}),e.jsx("span",{className:"text-[11px] text-slate-400 font-mono",children:w.dateRange})]}),e.jsxs("div",{className:"py-2 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-slate-300",children:[g.tooltipScore,":"]}),e.jsxs("span",{className:"font-extrabold text-emerald-400 font-mono text-sm",children:[w.averageScore,"%"]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-slate-300",children:[g.tooltipWorks,":"]}),e.jsx("span",{className:"font-semibold text-slate-200",children:w.assignmentsCount})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-slate-300",children:[g.tooltipRange,":"]}),e.jsxs("span",{className:"text-slate-400 font-mono text-[11px]",children:[w.highestScore,"% / ",w.lowestScore,"%"]})]}),w.trendDiff!==null&&e.jsxs("div",{className:"flex items-center justify-between pt-1 border-t border-slate-800",children:[e.jsxs("span",{className:"text-slate-400",children:[t==="zh"?"较上周变化":"Vs. Previous Week",":"]}),e.jsx("span",{className:`font-bold flex items-center gap-0.5 ${w.trendDiff>0?"text-emerald-400":w.trendDiff<0?"text-rose-400":"text-slate-400"}`,children:w.trendDiff>0?`+${w.trendDiff}%`:`${w.trendDiff}%`})]})]})]})}}),e.jsx(ce,{type:"monotone",dataKey:"averageScore",name:t==="zh"?"周平均得分":"Weekly Average Score",stroke:"url(#indigoScoreGrad)",strokeWidth:3,dot:{r:4.5,fill:"#6366f1",stroke:"#ffffff",strokeWidth:2},activeDot:{r:7,stroke:"#a855f7",strokeWidth:2.5,fill:"#ffffff"},animationDuration:800}),x&&e.jsx(ce,{type:"monotone",dataKey:"targetScore",name:t==="zh"?"学术目标线 (80%)":"Target Benchmark (80%)",stroke:"#10b981",strokeDasharray:"4 4",strokeWidth:1.5,dot:!1}),e.jsx(Vt,{wrapperStyle:{paddingTop:10,fontSize:11},formatter:c=>e.jsx("span",{className:"text-gray-600 font-medium",children:c})})]})})})})]})}function bs({assignments:s=[],lang:t="en"}){const[a,h]=S.useState("all"),[i,k]=S.useState("monotone"),[x,o]=S.useState(!0),[d,L]=S.useState(!0),[z,C]=S.useState(!0),b=S.useMemo(()=>s.filter(r=>r.submission_status==="graded"&&typeof r.score=="number"&&r.score!==null).map(r=>({...r,resolvedScore:r.score,eventTime:r.submitted_at||r.created_at||Date.now()})).sort((r,w)=>r.eventTime-w.eventTime),[s]),D=S.useMemo(()=>{const r=new Map;return b.forEach(w=>{w.class_name&&r.set(w.class_name,w.class_name)}),Array.from(r.values())},[b]),f=S.useMemo(()=>a==="all"?b:b.filter(r=>r.class_name===a),[b,a]),j=S.useMemo(()=>f.map((r,w)=>{const n=r.eventTime?new Date(r.eventTime):null,y=n?n.toLocaleDateString(t==="zh"?"zh-CN":"en-US",{month:"short",day:"numeric"}):`${t==="zh"?"测验":"Quiz"} #${w+1}`,N=n?n.toLocaleDateString(t==="zh"?"zh-CN":"en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}):"N/A";return{id:r.id,index:w+1,title:r.title.replace("MCQ Evaluation: ","").replace("评估: ",""),fullTitle:r.title,score:r.resolvedScore,className:r.class_name,dateLabel:y,fullDateLabel:N,feedback:r.feedback||(t==="zh"?"优秀!继续加油。":"Excellent work! Keep it up.")}}),[f,t]),g=S.useMemo(()=>{if(j.length===0)return{average:0,highest:0,lowest:0,total:0,passingCount:0,passRate:0};const r=j.map(u=>u.score),w=r.reduce((u,T)=>u+T,0),n=Math.round(w/r.length),y=Math.max(...r),N=Math.min(...r),_=r.length,$=r.filter(u=>u>=60).length,M=Math.round($/_*100);return{average:n,highest:y,lowest:N,total:_,passingCount:$,passRate:M}},[j]),c={title:t==="zh"?"学期成绩表现趋势":"Semester Grade Performance Trend",subtitle:t==="zh"?"全学期已评分测验与交互式作业的 chronological 成绩趋势分析":"Chronological grade analysis of graded quizzes and assignments across the semester",classFilter:t==="zh"?"选择班级:":"Class Filter:",allClasses:t==="zh"?"全部班级":"All Classes",chartStyle:t==="zh"?"曲线样式:":"Line Smoothing:",monotone:t==="zh"?"平滑曲线":"Smooth",linear:t==="zh"?"折线":"Straight",averageScore:t==="zh"?"已选平均成绩":"Selected Average",highestScore:t==="zh"?"最高成绩":"Highest Grade",lowestScore:t==="zh"?"最低成绩":"Lowest Grade",passRate:t==="zh"?"及格率":"Passing Rate",gradedCount:t==="zh"?"评阅作业数":"Graded Works",passingBenchmark:t==="zh"?"及格线 (60%)":"Passing Benchmark (60%)",emptyTitle:t==="zh"?"无学期评阅成绩":"No Graded Academic Data Only",emptyDesc:t==="zh"?"当前学期尚未有已评分的测验。当物理、历史或数学老师评估并评定你的白板作业或选择题测试后,由于底层的自适应评估引擎同步,此处会自动渲染出成绩波动趋势。":"You do not have any graded assignments or quizzes yet in this semester. Once teachers complete grading your interactive assignments, your chronological performance trajectory line will outline your academic development.",referenceLines:t==="zh"?"显示辅助线:":"Toggle Reference Lines:",avgLineLabel:t==="zh"?"选区平均":"Current Avg",gridLines:t==="zh"?"网格":"Grid",averageLine:t==="zh"?"平均成绩线":"Average Line",passLine:t==="zh"?"及格基准线":"Passing Benchmark",feedbackTitle:t==="zh"?"名师评语批注:":"Teacher Feedback Remark:"};return b.length===0?e.jsx("div",{className:"bg-white border border-gray-200 rounded-2xl p-8 shadow-sm hover:shadow-md transition-all",children:e.jsxs("div",{className:"max-w-md mx-auto text-center py-8",children:[e.jsx("div",{className:"inline-flex p-3.5 bg-indigo-50 text-indigo-600 rounded-full mb-4",children:e.jsx(we,{className:"w-7 h-7 animate-pulse"})}),e.jsx("h3",{className:"font-bold text-gray-800 text-lg",children:c.emptyTitle}),e.jsx("p",{className:"text-gray-500 text-xs mt-3 leading-relaxed",children:c.emptyDesc})]})}):e.jsxs("div",{className:"bg-white border border-gray-200 rounded-2xl shadow-sm hover:shadow-md transition-all overflow-hidden flex flex-col font-sans",id:"semester-grade-trend-container",children:[e.jsxs("div",{className:"p-5 border-b border-gray-100 bg-gray-50/50 flex flex-col md:flex-row md:items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"p-2.5 bg-indigo-50 text-indigo-600 rounded-xl mt-0.5 shadow-sm",children:e.jsx(H,{size:20,className:"stroke-[2.5]"})}),e.jsxs("div",{children:[e.jsxs("h3",{className:"font-extrabold text-gray-900 text-base flex items-center gap-2",children:[e.jsx("span",{children:c.title}),e.jsxs("span",{className:"inline-flex items-center gap-0.5 bg-emerald-50 text-emerald-700 border border-emerald-100 rounded-full px-2 py-0.5 text-xs font-bold",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 animate-pulse"}),t==="zh"?"学期分析":"Semester Trend"]})]}),e.jsx("p",{className:"text-gray-500 text-xs mt-0.5",children:c.subtitle})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("span",{className:"text-xs font-bold text-gray-500 flex items-center gap-1",children:[e.jsx(Ve,{size:12,className:"text-gray-400"}),c.classFilter]}),e.jsxs("select",{value:a,onChange:r=>h(r.target.value),className:"bg-white border border-gray-200 text-xs text-gray-700 rounded-lg px-2.5 py-1.5 shadow-2xs focus:outline-none focus:ring-1 focus:ring-indigo-500 font-semibold",id:"class-filter-select",children:[e.jsx("option",{value:"all",children:c.allClasses}),D.map((r,w)=>e.jsx("option",{value:r,children:r},w))]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("span",{className:"text-xs font-bold text-gray-500 flex items-center gap-1",children:[e.jsx(rt,{size:12,className:"text-gray-400"}),c.chartStyle]}),e.jsxs("div",{className:"inline-flex border border-gray-200 rounded-lg p-0.5 bg-white shadow-2xs",children:[e.jsx("button",{onClick:()=>k("monotone"),className:`px-2 py-1 text-xs font-bold rounded-md transition-all ${i==="monotone"?"bg-indigo-600 text-white":"text-gray-500 hover:text-gray-800"}`,children:c.monotone}),e.jsx("button",{onClick:()=>k("linear"),className:`px-2 py-1 text-xs font-bold rounded-md transition-all ${i==="linear"?"bg-indigo-600 text-white":"text-gray-500 hover:text-gray-800"}`,children:c.linear})]})]})]})]}),e.jsxs("div",{className:"px-5 py-4 border-b border-gray-100 bg-white grid grid-cols-2 md:grid-cols-5 gap-3.5",children:[e.jsxs("div",{className:"bg-indigo-50/20 border border-indigo-100/40 p-3.5 rounded-xl flex items-center gap-3",children:[e.jsx("div",{className:"p-2.5 bg-indigo-50 text-indigo-600 rounded-lg shadow-2xs",children:e.jsx(H,{size:16})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:c.averageScore}),e.jsxs("div",{className:"text-base font-extrabold text-indigo-950 font-mono mt-0.5",children:[g.average,"%"]})]})]}),e.jsxs("div",{className:"bg-emerald-50/20 border border-emerald-100/40 p-3.5 rounded-xl flex items-center gap-3",children:[e.jsx("div",{className:"p-2.5 bg-emerald-50 text-emerald-600 rounded-lg shadow-2xs",children:e.jsx(ze,{size:16})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:c.highestScore}),e.jsxs("div",{className:"text-base font-extrabold text-emerald-950 font-mono mt-0.5",children:[g.highest,"%"]})]})]}),e.jsxs("div",{className:"bg-rose-50/20 border border-rose-100/40 p-3.5 rounded-xl flex items-center gap-3",children:[e.jsx("div",{className:"p-2.5 bg-rose-50 text-rose-600 rounded-lg shadow-2xs",children:e.jsx(ke,{size:16})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:c.lowestScore}),e.jsxs("div",{className:"text-base font-extrabold text-rose-950 font-mono mt-0.5",children:[g.lowest,"%"]})]})]}),e.jsxs("div",{className:"bg-amber-50/15 border border-amber-100/40 p-3.5 rounded-xl flex items-center gap-3",children:[e.jsx("div",{className:"p-2.5 bg-amber-50 text-amber-600 rounded-lg shadow-2xs",children:e.jsx(Se,{size:16})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:c.passRate}),e.jsxs("div",{className:"text-base font-extrabold text-amber-950 font-mono mt-0.5",children:[g.passRate,"%"]})]})]}),e.jsxs("div",{className:"bg-sky-50/20 border border-sky-100/40 p-3.5 rounded-xl flex items-center gap-3 col-span-2 md:col-span-1",children:[e.jsx("div",{className:"p-2.5 bg-sky-50 text-sky-600 rounded-lg shadow-2xs",children:e.jsx(Ne,{size:16})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:c.gradedCount}),e.jsx("div",{className:"text-base font-extrabold text-sky-950 font-mono mt-0.5",children:g.total})]})]})]}),e.jsxs("div",{className:"p-5 grid grid-cols-1 lg:grid-cols-12 gap-6 items-stretch",children:[e.jsxs("div",{className:"lg:col-span-9 flex flex-col justify-between",id:"semester-grade-chart-wrapper",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 mb-3",children:[e.jsxs("div",{className:"text-xs font-bold text-indigo-900 flex items-center gap-1",children:[e.jsx(be,{size:13,className:"text-indigo-500"}),e.jsx("span",{children:t==="zh"?"学期表现时间轴(按提交时间排序)":"Academic Performance Timeline (Chronological)"})]}),e.jsxs("div",{className:"flex items-center gap-3 text-xs text-gray-600 font-semibold self-end",children:[e.jsx("span",{className:"text-gray-400 text-xs uppercase font-bold",children:c.referenceLines}),e.jsxs("label",{className:"flex items-center gap-1 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:d,onChange:r=>L(r.target.checked),className:"rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"}),e.jsx("span",{children:c.gridLines})]}),e.jsxs("label",{className:"flex items-center gap-1 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:d,onChange:r=>L(r.target.checked),className:"rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"}),e.jsx("span",{children:c.averageLine})]}),e.jsxs("label",{className:"flex items-center gap-1 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:z,onChange:r=>C(r.target.checked),className:"rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"}),e.jsx("span",{children:c.passLine})]})]})]}),e.jsx("div",{className:"h-[280px] w-full bg-slate-50/30 border border-slate-100 p-2.5 rounded-xl shadow-2xs relative",children:j.length===0?e.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-xs text-gray-400 italic",children:t==="zh"?"无该筛选条件下的成绩数据":"No grade data available for this selection"}):e.jsx(me,{width:"100%",height:"100%",children:e.jsxs(je,{data:j,margin:{top:15,right:15,left:-22,bottom:5},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"lineColorGrad",x1:"0",y1:"0",x2:"1",y2:"0",children:[e.jsx("stop",{offset:"0%",stopColor:"#4f46e5"}),e.jsx("stop",{offset:"50%",stopColor:"#8b5cf6"}),e.jsx("stop",{offset:"100%",stopColor:"#ec4899"})]})}),x&&e.jsx(ne,{strokeDasharray:"3 3",vertical:!1,stroke:"#f1f5f9"}),e.jsx(ie,{dataKey:"dateLabel",tick:{fontSize:12,fill:"#64748b",fontWeight:"bold"},axisLine:{stroke:"#e2e8f0"},tickLine:!1}),e.jsx(oe,{domain:[0,100],tick:{fontSize:12,fill:"#64748b",fontWeight:"bold"},axisLine:{stroke:"#e2e8f0"},tickLine:!1}),e.jsx(de,{content:({active:r,payload:w})=>{if(r&&w&&w.length){const n=w[0].payload;return e.jsxs("div",{className:"p-3.5 bg-white/95 border border-indigo-100 rounded-xl shadow-xl max-w-[270px] backdrop-blur-xs transition-all ring-4 ring-indigo-550/10",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-gray-100 pb-1.5 mb-1.5",children:[e.jsxs("span",{className:"text-xs text-gray-450 font-extrabold uppercase font-mono",children:["Quiz #",n.index," · ",n.className]}),e.jsxs("span",{className:"inline-flex items-center bg-indigo-50 text-indigo-700 px-2 py-0.5 rounded-full text-xs font-extrabold font-mono border border-indigo-100 shadow-2xs",children:[n.score,"%"]})]}),e.jsx("p",{className:"text-xs font-black text-slate-800 leading-snug",children:n.fullTitle}),e.jsx("p",{className:"text-xs text-slate-400 mt-1 leading-normal font-medium",children:n.fullDateLabel}),e.jsxs("div",{className:"mt-2 bg-gradient-to-r from-violet-50/50 to-indigo-50/40 p-2 rounded-lg border border-violet-100/50",children:[e.jsx("span",{className:"text-xs font-black text-violet-850 uppercase block tracking-wider mb-0.5",children:c.feedbackTitle}),e.jsxs("p",{className:"text-xs text-slate-700 italic font-sans leading-normal",children:['"',n.feedback,'"']})]})]})}return null}}),z&&e.jsx(le,{y:60,stroke:"#f43f5e",strokeWidth:1,strokeDasharray:"4 4",label:{value:c.passingBenchmark,fill:"#f43f5e",fontSize:12,fontWeight:"bold",position:"top",offset:3}}),d&&g.total>0&&e.jsx(le,{y:g.average,stroke:"#4f46e5",strokeWidth:1,strokeDasharray:"3 3",label:{value:`${c.avgLineLabel} (${g.average}%)`,fill:"#4f46e5",fontSize:12,fontWeight:"bold",position:"bottom",offset:3}}),e.jsx(ce,{type:i,dataKey:"score",stroke:"url(#lineColorGrad)",strokeWidth:3,dot:{r:5,stroke:"#ffffff",strokeWidth:2,fill:"#4f46e5"},activeDot:{r:7,stroke:"#ffffff",strokeWidth:2,fill:"#ec4899"},animationDuration:1e3})]})})})]}),e.jsx("div",{className:"lg:col-span-3 flex flex-col justify-between border-t border-gray-100 lg:border-t-0 lg:border-l lg:border-gray-100 pt-5 lg:pt-0 lg:pl-5",children:e.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[e.jsx("div",{className:"text-xs font-extrabold uppercase text-gray-450 tracking-wider mb-3",children:t==="zh"?"成绩优异榜":"Semester Milestones"}),e.jsx("div",{className:"space-y-2.5 overflow-y-auto max-h-[265px] pr-1 scrollbar-thin",children:j.length===0?e.jsx("div",{className:"text-center p-6 text-xs text-gray-400 italic",children:t==="zh"?"没有评分记录":"No milestone records"}):[...j].sort((r,w)=>w.score-r.score).slice(0,4).map((r,w)=>{const n=w===0;return e.jsxs("div",{className:`p-2.5 rounded-xl border flex items-center justify-between gap-3 transition-colors ${n?"border-yellow-200 bg-yellow-50/35 hover:bg-yellow-50/50":r.score>=80?"border-emerald-100 bg-emerald-50/20 hover:bg-emerald-50/35":"border-slate-100 bg-slate-50/30 hover:bg-slate-50/60"}`,children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.jsx("span",{className:"text-xs font-extrabold px-1.5 py-0.5 rounded uppercase font-mono leading-none tracking-wider bg-white shadow-3xs text-slate-500",children:n?"🏆 TOP":`#${w+1}`}),e.jsx("span",{className:"text-xs text-indigo-600 font-bold max-w-[80px] truncate",title:r.className,children:r.className})]}),e.jsx("h5",{className:"font-extrabold text-xs text-slate-800 leading-snug truncate mt-1",title:r.fullTitle,children:r.title})]}),e.jsxs("div",{className:`px-2 py-1 rounded-lg border font-mono font-bold text-center text-xs shrink-0 shadow-3xs bg-white ${r.score>=85?"text-emerald-700 border-emerald-150":r.score>=60?"text-indigo-700 border-indigo-150":"text-rose-700 border-rose-150"}`,children:[r.score,"%"]})]},r.id)})}),g.total>0&&e.jsx("div",{className:"mt-4 p-3 bg-gradient-to-r from-indigo-500/10 to-purple-500/10 rounded-2xl border border-indigo-100/50 text-xs text-slate-700 leading-relaxed font-medium",children:t==="zh"?e.jsxs(e.Fragment,{children:["在本学期中,你已完成了 ",e.jsx("span",{className:"font-bold text-indigo-805 font-mono",children:g.total})," ","次正式学习质量评测。全科平均通过率为"," ",e.jsxs("span",{className:"font-bold text-emerald-700 font-mono",children:[g.passRate,"%"]}),"。建议继续针对得分低于 60% 的章节进行自主微课回顾和重新作答。"]}):e.jsxs(e.Fragment,{children:["You participated in ",e.jsx("span",{className:"font-bold text-indigo-805 font-mono",children:g.total})," ","scholastic assessments this semester with an average competency score of"," ",e.jsxs("span",{className:"font-bold text-indigo-700 font-mono",children:[g.average,"%"]}),". Your grade profile shows an active rate of ",e.jsxs("span",{className:"font-bold text-teal-700 font-mono",children:[g.passRate,"%"]})," ","above passing grade threshold."]})})]})})]})]})}function js({assignments:s=[],lang:t="en"}){const[a,h]=S.useState("3months"),[i,k]=S.useState("all"),[x,o]=S.useState(!0),[d,L]=S.useState(!0),{filteredAssignments:z,dateRangeLabel:C,stats:b}=S.useMemo(()=>{const f=s.filter(l=>l.submission_status==="graded"&&typeof l.score=="number"&&l.score!==null).map(l=>{const v=l.score,A=l.graded_at||l.submitted_at||l.created_at||Date.now();return{...l,resolvedScore:v,actionTime:A}}).sort((l,v)=>l.actionTime-v.actionTime),j=Date.now(),g=2160*60*60*1e3,c=j-g;let r=f;i!=="all"&&(r=f.filter(l=>l.class_name===i));const w=a==="3months"?r.filter(l=>l.actionTime>=c):r,n=new Date(c).toLocaleDateString(t==="zh"?"zh-CN":"en-US",{month:"short",day:"numeric",year:"numeric"}),y=new Date(j).toLocaleDateString(t==="zh"?"zh-CN":"en-US",{month:"short",day:"numeric",year:"numeric"}),N=t==="zh"?`学段范围: ${n} 至 ${y} (最近 90 天)`:`Date Range: ${n} to ${y} (Last 90 Days)`,_=w.map((l,v)=>{const A=new Date(l.actionTime),E=A.toLocaleDateString(t==="zh"?"zh-CN":"en-US",{month:"short",day:"numeric"}),p=A.toLocaleDateString(t==="zh"?"zh-CN":"en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"});return{id:l.id,index:v+1,title:l.title.replace("MCQ Evaluation: ","").replace("评估: ",""),fullTitle:l.title,score:l.resolvedScore,className:l.class_name,dateLabel:E,fullDateLabel:p,feedback:l.feedback||(t==="zh"?"无":"No comments provided"),gradedAtStr:l.graded_at?new Date(l.graded_at).toLocaleString(t==="zh"?"zh-CN":"en-US"):""}}),$=_.map(l=>l.score),M=$.reduce((l,v)=>l+v,0),u=$.length>0?Math.round(M/$.length):0,T=$.length>0?Math.max(...$):0,I=$.length,F=$.filter(l=>l>=60).length;return{filteredAssignments:_,dateRangeLabel:N,stats:{average:u,highest:T,total:I,passing:F}}},[s,a,i,t]),D=S.useMemo(()=>{const f=new Set;return s.forEach(j=>{j.submission_status==="graded"&&j.class_name&&f.add(j.class_name)}),Array.from(f)},[s]);return e.jsxs("div",{className:"bg-white border border-gray-200 rounded-2xl shadow-sm hover:shadow-md transition-all overflow-hidden flex flex-col font-sans mb-6",id:"three-months-performance-line-chart",children:[e.jsxs("div",{className:"p-5 border-b border-gray-100 bg-linear-to-r from-rose-50/20 via-white to-pink-50/15 flex flex-col md:flex-row md:items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"p-2.5 bg-rose-50 text-rose-600 rounded-xl mt-0.5 shadow-xs",children:e.jsx(ae,{size:20,className:"stroke-[2.5]"})}),e.jsxs("div",{children:[e.jsxs("h3",{className:"font-extrabold text-gray-950 text-base flex items-center gap-2",children:[e.jsx("span",{children:t==="zh"?"近3个月作业成绩分析":"Recent 3-Month Progress Chart"}),e.jsx("span",{className:"inline-flex items-center gap-0.5 bg-rose-50 text-rose-700 border border-rose-100 rounded-full px-2 py-0.5 text-xs font-bold",children:t==="zh"?"90天回顾":"90 Days Review"})]}),e.jsx("p",{className:"text-gray-500 text-xs mt-0.5",children:C})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("span",{className:"text-xs font-bold text-gray-500 flex items-center gap-1",children:[e.jsx(at,{size:12,className:"text-gray-400"}),t==="zh"?"过滤范围:":"Scope:"]}),e.jsxs("div",{className:"inline-flex border border-gray-200 rounded-lg p-0.5 bg-white shadow-2xs",children:[e.jsx("button",{onClick:()=>h("3months"),className:`px-2.5 py-1 text-xs font-bold rounded-md transition-all cursor-pointer ${a==="3months"?"bg-rose-600 text-white":"text-gray-500 hover:text-gray-800"}`,children:t==="zh"?"近 3 个月":"Last 3 Months"}),e.jsx("button",{onClick:()=>h("all"),className:`px-2.5 py-1 text-xs font-bold rounded-md transition-all cursor-pointer ${a==="all"?"bg-rose-600 text-white":"text-gray-500 hover:text-gray-800"}`,children:t==="zh"?"全部记录":"All Graded"})]})]}),D.length>0&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("span",{className:"text-xs font-bold text-gray-500 flex items-center gap-1",children:[e.jsx(Ve,{size:12,className:"text-gray-400"}),t==="zh"?"班级:":"Class:"]}),e.jsxs("select",{value:i,onChange:f=>k(f.target.value),className:"bg-white border border-gray-200 text-xs text-gray-700 rounded-lg px-2 py-1 focus:outline-none focus:ring-1 focus:ring-rose-500 font-semibold shadow-2xs",children:[e.jsx("option",{value:"all",children:t==="zh"?"全部班级":"All Classes"}),D.map((f,j)=>e.jsx("option",{value:f,children:f},j))]})]})]})]}),e.jsxs("div",{className:"px-5 py-3.5 border-b border-gray-100 bg-white grid grid-cols-2 md:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"p-3 bg-rose-50/10 rounded-xl border border-rose-100/30 flex flex-col",children:[e.jsx("span",{className:"text-xs font-bold text-gray-450 uppercase tracking-wider",children:t==="zh"?"平均成绩":"Avg. Score"}),e.jsxs("span",{className:"text-xl font-extrabold text-rose-950 font-mono mt-0.5",children:[b.average,"%"]})]}),e.jsxs("div",{className:"p-3 bg-amber-50/10 rounded-xl border border-amber-100/30 flex flex-col",children:[e.jsx("span",{className:"text-xs font-bold text-gray-450 uppercase tracking-wider",children:t==="zh"?"最高分数":"Peak Score"}),e.jsxs("span",{className:"text-xl font-extrabold text-amber-950 font-mono mt-0.5",children:[b.highest,"%"]})]}),e.jsxs("div",{className:"p-3 bg-indigo-50/10 rounded-xl border border-indigo-100/30 flex flex-col",children:[e.jsx("span",{className:"text-xs font-bold text-gray-450 uppercase tracking-wider",children:t==="zh"?"作业评阅数":"Graded Count"}),e.jsx("span",{className:"text-xl font-extrabold text-indigo-950 font-mono mt-0.5",children:b.total})]}),e.jsxs("div",{className:"p-3 bg-emerald-50/10 rounded-xl border border-emerald-100/30 flex flex-col",children:[e.jsx("span",{className:"text-xs font-bold text-gray-450 uppercase tracking-wider",children:t==="zh"?"及格件数":"Passing Works"}),e.jsx("span",{className:"text-xl font-extrabold text-emerald-950 font-mono mt-0.5",children:b.passing})]})]}),e.jsx("div",{className:"p-5",children:z.length===0?e.jsxs("div",{className:"text-center py-10 bg-slate-50/50 rounded-xl border border-dashed border-slate-200",children:[e.jsx(ke,{size:28,className:"mx-auto text-slate-300 mb-2"}),e.jsx("h4",{className:"text-gray-800 text-xs font-bold",children:t==="zh"?"近3个月没有已评分的作业记录":"No Graded Submissions in the past 3 months"}),e.jsx("p",{className:"text-gray-400 text-xs mt-1 px-4 max-w-sm mx-auto",children:t==="zh"?"暂无符合检索时间窗的评语或测验成绩。您可以点击“全部记录”进行查询,或交办新作业让名师或AI进行极速评分。":'No performance updates were logged during this period. Try switching to "All Graded" to see historic trends, or complete pending tasks now!'})]}):e.jsx("div",{className:"h-[240px] w-full relative",children:e.jsx(me,{width:"100%",height:"100%",children:e.jsxs(je,{data:z,margin:{top:15,right:15,left:-22,bottom:5},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"roseLineGrad",x1:"0",y1:"0",x2:"1",y2:"0",children:[e.jsx("stop",{offset:"0%",stopColor:"#f43f5e"}),e.jsx("stop",{offset:"60%",stopColor:"#ec4899"}),e.jsx("stop",{offset:"100%",stopColor:"#d946ef"})]})}),x&&e.jsx(ne,{strokeDasharray:"3 3",vertical:!1,stroke:"#f1f5f9"}),e.jsx(ie,{dataKey:"dateLabel",tick:{fontSize:12,fill:"#64748b",fontWeight:"bold"},axisLine:{stroke:"#e2e8f0"},tickLine:!1}),e.jsx(oe,{domain:[0,100],tick:{fontSize:12,fill:"#64748b",fontWeight:"bold"},axisLine:{stroke:"#e2e8f0"},tickLine:!1}),e.jsx(de,{content:({active:f,payload:j})=>{if(f&&j&&j.length){const g=j[0].payload;return e.jsxs("div",{className:"p-3 bg-white/95 border border-rose-100 rounded-xl shadow-xl max-w-[260px] backdrop-blur-xs font-sans",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-gray-100 pb-1 mb-1 border-opacity-50",children:[e.jsx("span",{className:"text-xs text-gray-400 font-bold uppercase font-mono",children:g.className}),e.jsxs("span",{className:"inline-flex items-center bg-rose-50 text-rose-700 px-2 py-0.5 rounded-full text-xs font-bold font-mono border border-rose-100",children:[g.score,"%"]})]}),e.jsx("p",{className:"text-xs font-bold text-slate-800 leading-snug",children:g.fullTitle}),e.jsx("p",{className:"text-xs text-slate-400 mt-1",children:g.fullDateLabel}),g.gradedAtStr&&e.jsx("p",{className:"text-xs text-rose-500 font-mono mt-0.5",children:t==="zh"?`测评时间: ${g.gradedAtStr}`:`Reviewed: ${g.gradedAtStr}`}),g.feedback&&e.jsxs("div",{className:"mt-2 bg-rose-50/40 p-1.5 rounded border border-rose-100/50",children:[e.jsx("span",{className:"text-xs font-bold text-rose-800 uppercase block tracking-wider mb-0.5",children:t==="zh"?"随堂反馈意见":"FEEDBACK"}),e.jsxs("p",{className:"text-xs text-slate-600 italic",children:['"',g.feedback,'"']})]})]})}return null}}),d&&b.total>0&&e.jsx(le,{y:b.average,stroke:"#db2777",strokeWidth:1.2,strokeDasharray:"4 4",label:{value:t==="zh"?`近期平均 (${b.average}%)`:`Recent Avg (${b.average}%)`,fill:"#db2777",fontSize:12,fontWeight:"bold",position:"top",offset:3}}),e.jsx(ce,{type:"monotone",dataKey:"score",stroke:"url(#roseLineGrad)",strokeWidth:3.5,dot:{r:5,stroke:"#ffffff",strokeWidth:2,fill:"#ec4899"},activeDot:{r:7,stroke:"#ffffff",strokeWidth:2,fill:"#f43f5e"}})]})})})})]})}function vs({assignments:s=[],lang:t="en"}){const[a,h]=S.useState("all"),[i,k]=S.useState(!0),[x,o]=S.useState(!0),{trajectoryData:d,availableClasses:L,stats:z,trendDirection:C}=S.useMemo(()=>{const D=s.filter(u=>u.submission_status==="graded"&&typeof u.score=="number"&&u.score!==null).map(u=>{const T=u.score,I=u.graded_at||u.submitted_at||u.created_at||Date.now();return{...u,resolvedScore:T,timeVal:I}}).sort((u,T)=>u.timeVal-T.timeVal),f=new Set;D.forEach(u=>{u.class_name&&f.add(u.class_name)});const j=a==="all"?D:D.filter(u=>u.class_name===a);let g=0;const c=j.map((u,T)=>{g+=u.resolvedScore;const I=Math.round(g/(T+1)*10)/10,F=new Date(u.timeVal),l=F.toLocaleDateString(t==="zh"?"zh-CN":"en-US",{month:"short",day:"numeric"}),v=F.toLocaleDateString(t==="zh"?"zh-CN":"en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"});return{id:u.id,index:T+1,title:u.title.replace("MCQ Evaluation: ","").replace("评估: ",""),fullTitle:u.title,score:u.resolvedScore,runningAverage:I,className:u.class_name,dateLabel:l,fullDateLabel:v,feedback:u.feedback||""}}),r=c.length,w=r>0?c[0].runningAverage:0,n=r>0?c[r-1].runningAverage:0,y=Math.round((n-w)*10)/10;let N="stable";y>1.5?N="upward":y<-1.5&&(N="downward");const _=c.map(u=>u.runningAverage),$=_.length>0?Math.max(..._):0,M=_.length>0?Math.min(..._):0;return{trajectoryData:c,availableClasses:Array.from(f),stats:{startingAvg:w,currentAvg:n,growthPercentage:y,peakAvg:$,valleyAvg:M,totalGraded:r},trendDirection:N}},[s,a,t]),b={title:t==="zh"?"学术成长轨迹与平均分演变":"Academic Growth & Cumulative Average Trajectory",subtitle:t==="zh"?"追踪在校作业评分的累积移动平均线,体现核心学力成长趋势":"Tracks cumulative moving average of evaluated coursework to outline long-term proficiency",classFilter:t==="zh"?"班级:":"Class:",allClasses:t==="zh"?"全学科":"All Subjects",statsStart:t==="zh"?"起始基准分":"Base Score",statsCurrent:t==="zh"?"当前累积平均":"Cumulative Avg",statsNet:t==="zh"?"学术增长劲头":"Net Trajectory",statsPeak:t==="zh"?"累积峰值高度":"Trajectory Peak",emptyTitle:t==="zh"?"待评阅作业以构建成长曲线":"Awaiting Data for Growth Map",emptyDesc:t==="zh"?"当你的作业通过评阅且录入成绩后,成长轨迹分析引擎将自动计算每次评分后的全局累积分,从而绘制出能体现学习毅力与知识掌握成熟度的进展曲线。":"Once your work receives evaluations, our trajectory motor calculates a progressive running average to render a true representation of your academic journey.",layerIndividual:t==="zh"?"显示单项原始成绩":"Show Single Assignment Scores",trajLabel:t==="zh"?"学术成长轨迹 (累积平均)":"Academic Growth (Running Avg)",rawLabel:t==="zh"?"单次作业得分":"Single Work Score",recommendationTitle:t==="zh"?"自适应成长评估与建议":"Adaptive Progress Evaluation"};return d.length===0?e.jsx("div",{className:"bg-white border border-gray-200 rounded-2xl p-6 shadow-xs hover:shadow-md transition-all font-sans mb-6",children:e.jsxs("div",{className:"max-w-md mx-auto text-center py-6",children:[e.jsx("div",{className:"inline-flex p-3 bg-rose-50 text-rose-500 rounded-full mb-3",children:e.jsx(nt,{className:"w-6 h-6 animate-spin text-rose-600"})}),e.jsx("h3",{className:"font-extrabold text-gray-900 text-sm",children:b.emptyTitle}),e.jsx("p",{className:"text-gray-400 text-xs mt-2 leading-relaxed",children:b.emptyDesc})]})}):e.jsxs("div",{className:"bg-white border border-gray-200 rounded-2xl shadow-sm hover:shadow-md transition-all overflow-hidden flex flex-col font-sans mb-6",id:"academic-growth-trajectory-card",children:[e.jsxs("div",{className:"p-5 border-b border-gray-100 bg-linear-to-r from-emerald-50/10 via-white to-teal-50/10 flex flex-col md:flex-row md:items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"p-2.5 bg-emerald-50 text-emerald-600 rounded-xl mt-0.5 shadow-2xs",children:e.jsx(H,{size:20,className:"stroke-[2.5]"})}),e.jsxs("div",{children:[e.jsxs("h3",{className:"font-extrabold text-gray-950 text-base flex items-center gap-1.5",children:[e.jsx("span",{children:b.title}),e.jsxs("span",{className:"inline-flex items-center gap-1 bg-emerald-555 bg-emerald-100 text-emerald-800 border border-emerald-200/50 rounded-full px-2 py-0.5 text-xs font-black uppercase",children:[e.jsx(Z,{size:8,className:"animate-spin text-emerald-600"}),t==="zh"?"能力演进":"Trajectory"]})]}),e.jsx("p",{className:"text-gray-500 text-xs mt-0.5",children:b.subtitle})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3 self-center",children:[L.length>0&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs font-bold text-gray-500",children:b.classFilter}),e.jsxs("select",{value:a,onChange:D=>h(D.target.value),className:"bg-white border border-gray-200 text-xs text-gray-700 font-bold rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-1 focus:ring-emerald-500 shadow-2xs",children:[e.jsx("option",{value:"all",children:b.allClasses}),L.map((D,f)=>e.jsx("option",{value:D,children:D},f))]})]}),e.jsxs("button",{onClick:()=>k(!i),className:`px-3 py-1.5 text-xs font-bold rounded-lg border flex items-center gap-1.5 cursor-pointer transition-all ${i?"bg-emerald-50 border-emerald-200 text-emerald-700 font-bold":"bg-white border-gray-200 text-gray-500 hover:text-gray-700"}`,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${i?"bg-emerald-500 animate-pulse":"bg-gray-300"}`}),b.layerIndividual]})]})]}),e.jsxs("div",{className:"px-5 py-3.5 border-b border-gray-100 bg-linear-to-b from-gray-50/30 to-white grid grid-cols-2 md:grid-cols-4 gap-4 select-none",children:[e.jsxs("div",{className:"p-3 bg-white hover:bg-slate-50 border border-gray-100 rounded-xl shadow-3xs flex flex-col justify-center",children:[e.jsx("span",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:b.statsStart}),e.jsxs("span",{className:"text-lg font-black text-slate-800 font-mono mt-0.5",children:[z.startingAvg,"%"]})]}),e.jsxs("div",{className:"p-3 bg-white hover:bg-slate-50 border border-gray-100 rounded-xl shadow-3xs flex flex-col justify-center",children:[e.jsx("span",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:b.statsCurrent}),e.jsxs("span",{className:"text-lg font-black text-emerald-800 font-mono mt-0.5",children:[z.currentAvg,"%"]})]}),e.jsxs("div",{className:"p-3 bg-white hover:bg-slate-50 border border-gray-100 rounded-xl shadow-3xs flex flex-col justify-center",children:[e.jsx("span",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:b.statsNet}),e.jsxs("div",{className:"flex items-center gap-1 mt-0.5",children:[e.jsxs("span",{className:`text-lg font-black font-mono ${z.growthPercentage>=0?"text-emerald-600":"text-red-500"}`,children:[z.growthPercentage>=0?`+${z.growthPercentage}`:z.growthPercentage,"%"]}),z.growthPercentage>0&&e.jsx(H,{size:14,className:"text-emerald-500 shrink-0"}),z.growthPercentage<0&&e.jsx(it,{size:14,className:"text-red-400 shrink-0"})]})]}),e.jsxs("div",{className:"p-3 bg-white hover:bg-slate-50 border border-gray-100 rounded-xl shadow-3xs flex flex-col justify-center",children:[e.jsx("span",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:b.statsPeak}),e.jsxs("span",{className:"text-lg font-black text-rose-800 font-mono mt-0.5",children:[z.peakAvg,"%"]})]})]}),e.jsxs("div",{className:"p-5 grid grid-cols-1 lg:grid-cols-12 gap-6 items-stretch",children:[e.jsx("div",{className:"lg:col-span-9 flex flex-col justify-between",id:"growth-canvas-container",children:e.jsx("div",{className:"h-[250px] w-full relative bg-slate-50/20 border border-slate-100 p-2 rounded-xl",children:e.jsx(me,{width:"100%",height:"100%",children:e.jsxs(je,{data:d,margin:{top:15,right:15,left:-22,bottom:5},children:[e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"growthGrad",x1:"0",y1:"0",x2:"1",y2:"0",children:[e.jsx("stop",{offset:"0%",stopColor:"#10b981"}),e.jsx("stop",{offset:"50%",stopColor:"#06b6d4"}),e.jsx("stop",{offset:"100%",stopColor:"#3b82f6"})]}),e.jsxs("linearGradient",{id:"scoreAuxGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"#94a3b8"}),e.jsx("stop",{offset:"100%",stopColor:"#cbd5e1"})]})]}),x&&e.jsx(ne,{strokeDasharray:"3 3",vertical:!1,stroke:"#f1f5f9"}),e.jsx(ie,{dataKey:"dateLabel",tick:{fontSize:12,fill:"#64748b",fontWeight:"bold"},axisLine:{stroke:"#e2e8f0"},tickLine:!1}),e.jsx(oe,{domain:[0,100],tick:{fontSize:12,fill:"#64748b",fontWeight:"bold"},axisLine:{stroke:"#e2e8f0"},tickLine:!1}),e.jsx(de,{content:({active:D,payload:f})=>{if(D&&f&&f.length){const j=f[0].payload;return e.jsxs("div",{className:"p-3.5 bg-white/95 border border-emerald-100 rounded-xl shadow-xl max-w-[270px] backdrop-blur-xs font-sans",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-slate-100 pb-1.5 mb-1.5",children:[e.jsx("span",{className:"text-xs text-slate-400 font-extrabold uppercase font-mono",children:j.className}),e.jsxs("span",{className:"bg-emerald-50 text-emerald-800 px-2 py-0.5 rounded-full text-xs font-black border border-emerald-100 font-mono",children:[j.runningAverage,"% Avg"]})]}),e.jsx("p",{className:"text-xs font-black text-slate-800 leading-tight",children:j.fullTitle}),e.jsx("p",{className:"text-xs text-slate-400 mt-1",children:j.fullDateLabel}),e.jsxs("div",{className:"mt-2.5 pt-2 border-t border-slate-100 grid grid-cols-2 gap-1.5",children:[e.jsxs("div",{className:"bg-slate-50 p-1 rounded border border-slate-100 text-center",children:[e.jsx("span",{className:"block text-xs text-gray-400 uppercase font-black",children:t==="zh"?"当次得分":"SESS SCORE"}),e.jsxs("span",{className:"text-xs font-bold font-mono text-indigo-700",children:[j.score,"%"]})]}),e.jsxs("div",{className:"bg-emerald-50/50 p-1 rounded border border-emerald-100/50 text-center",children:[e.jsx("span",{className:"block text-xs text-emerald-600 uppercase font-black",children:t==="zh"?"累积移动平均":"RUNNING AVG"}),e.jsxs("span",{className:"text-xs font-black font-mono text-emerald-800",children:[j.runningAverage,"%"]})]})]}),j.feedback&&e.jsx("div",{className:"mt-2 bg-emerald-50/20 p-1.5 rounded-lg border border-emerald-100/30",children:e.jsxs("p",{className:"text-xs text-emerald-800 italic truncate font-sans",children:['"',j.feedback,'"']})})]})}return null}}),e.jsx(ce,{type:"monotone",name:b.trajLabel,dataKey:"runningAverage",stroke:"url(#growthGrad)",strokeWidth:4.5,dot:{r:4,stroke:"#ffffff",strokeWidth:2,fill:"#06b6d4"},activeDot:{r:6,stroke:"#ffffff",strokeWidth:2.5,fill:"#10b981"},animationDuration:1200}),i&&e.jsx(ce,{type:"monotone",name:b.rawLabel,dataKey:"score",stroke:"url(#scoreAuxGrad)",strokeWidth:1.5,strokeDasharray:"4 3",dot:{r:3,stroke:"#f8fafc",strokeWidth:1,fill:"#94a3b8"},activeDot:{r:4,stroke:"#ffffff",strokeWidth:2,fill:"#475569"},animationDuration:800,opacity:.65})]})})})}),e.jsx("div",{className:"lg:col-span-3 flex flex-col justify-between border-t lg:border-t-0 lg:border-l border-gray-100 pt-5 lg:pt-0 lg:pl-5 min-w-0",children:e.jsxs("div",{className:"flex flex-col h-full justify-between",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"text-xs font-extrabold uppercase text-gray-400 tracking-wider flex items-center gap-1 mb-2.5",children:[e.jsx(Z,{size:11,className:"text-emerald-500 shrink-0"}),b.recommendationTitle]}),e.jsxs("div",{className:"p-4 rounded-xl border border-dashed border-gray-200 bg-linear-to-b from-white to-gray-50/30",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2 font-black text-xs",children:[C==="upward"&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-emerald-500 shrink-0 animate-ping"}),e.jsx("span",{className:"text-emerald-700",children:t==="zh"?"学术成长极强":"Excellent Growth"})]}),C==="stable"&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-indigo-400 shrink-0"}),e.jsx("span",{className:"text-indigo-700",children:t==="zh"?"平稳巩固上升":"Steady Progress"})]}),C==="downward"&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-rose-400 shrink-0 shadow-lg animate-pulse"}),e.jsx("span",{className:"text-rose-700",children:t==="zh"?"关注诊断警示":"Diagnostic Alert"})]})]}),e.jsx("p",{className:"text-xs text-gray-650 leading-relaxed font-sans",children:t==="zh"?e.jsxs(e.Fragment,{children:[C==="upward"&&"你的学术成长曲线呈现出非常健康的向上拉升趋势!这表明随着上课次数的增加,你的整体知识体系越来越巩固,学习耐力和答题准确率已经取得了决定性突破。",C==="stable"&&"累积分数轨迹进入成熟的常态化稳定期。这反映出你表现相当均衡稳定。建议在保持住基础大盘的同时,试着探索更具挑战性的选拔赛或是高阶人工智能随堂测验来寻找新的学术突破。",C==="downward"&&"近期累积平均分受某几次偶发失常作业的影响,增长势头有所受挫。请无需气馁,建议你到作业区查看教师留下的批注建议,利用微课复习针对差错进行重新作答。"]}):e.jsxs(e.Fragment,{children:[C==="upward"&&"Your academic trajectory maps a highly competent upward lift. This strongly correlates with refined endurance, improved error resolution over consecutive modules, and a progressive understanding of core material.",C==="stable"&&"Your running average sits in an equilibrium band. Your output exhibits solid consistency. Start aiming for advanced peer reviews or high-level AI topics to challenge your plateau and break into the higher bracket.",C==="downward"&&"The moving average shows a slight descent due to standard deviations in recent assignments. Review the feedback timeline to recalibrate your core subjects and raise your general competency."]})})]})]}),e.jsxs("div",{className:"mt-4 pt-3.5 border-t border-gray-100 space-y-2 select-none",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs font-bold text-gray-450",children:[e.jsx(te,{size:10,className:"text-emerald-500"}),e.jsxs("span",{children:[t==="zh"?"总评测样本数: ":"Assessments count: ",e.jsx("span",{className:"text-slate-800 font-mono",children:z.totalGraded})]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs font-bold text-gray-450",children:[e.jsx(te,{size:10,className:"text-emerald-500"}),e.jsxs("span",{children:[t==="zh"?"学力波动幅度: ":"Fluctuation envelope: ",e.jsxs("span",{className:"text-slate-800 font-mono",children:[(z.peakAvg-z.valleyAvg).toFixed(1),"%"]})]})]})]})]})})]})]})}function ys({assignments:s}){const[t,a]=S.useState("area"),[h,i]=S.useState(null),k=(s||[]).filter(n=>n.submission_status==="graded").sort((n,y)=>(n.submitted_at||0)-(y.submitted_at||0));if(k.length===0)return e.jsx("div",{className:"bg-white border border-gray-200 rounded-xl p-8 hover:shadow-md transition-all",children:e.jsxs("div",{className:"max-w-md mx-auto text-center py-6",children:[e.jsx("div",{className:"inline-flex p-3 bg-indigo-50 text-indigo-600 rounded-full mb-3",children:e.jsx(we,{className:"w-6 h-6 animate-pulse"})}),e.jsx("h3",{className:"font-semibold text-gray-800 text-base",children:"Graded Performance Timeline"}),e.jsx("p",{className:"text-gray-500 text-xs mt-2 leading-relaxed",children:"Your interactive learning timeline and performance chart will generate automatically here once teachers grade your MCQ quizzes or interactive submissions. Complete more tasks to build your historical growth profile!"})]})});const x=k.map(n=>n.score||0),o=Math.max(...x),d=Math.round(x.reduce((n,y)=>n+y,0)/x.length),L=k.length,z=k.filter(n=>(n.score||0)>=70).length,C=Math.round(z/L*100);let b="Solidly Consistent",D="Maintaining stable grades",f=0,j="text-blue-700 border-blue-200 bg-blue-50/50";if(x.length>=2){const n=Math.ceil(x.length/2),y=x.slice(0,n),N=x.slice(x.length%2===0?n:n-1),_=y.reduce((M,u)=>M+u,0)/y.length,$=N.reduce((M,u)=>M+u,0)/N.length;f=Math.round($-_),f>15?(b="Stellar Acceleration",D=`Surging upward by +${f}%!`,j="text-green-800 border-green-300 bg-green-55/60 animate-bounce"):f>3?(b="Steadily Improving",D=`Gained a +${f}% grade boost`,j="text-emerald-700 border-emerald-200 bg-emerald-50/70"):f<-10?(b="Support Recommended",D=`Recent grades dropped by ${f}%`,j="text-rose-700 border-rose-200 bg-rose-50/70"):f<-3?(b="Needs Targeted Review",D=`Slight dip of ${f}% noticed`,j="text-amber-700 border-amber-200 bg-amber-50/70"):(b="Solidly Consistent",D="Maintaining very stable performance",j="text-indigo-700 border-indigo-200 bg-indigo-50/70")}const g=k.map((n,y)=>({index:y,id:n.id,title:n.title.replace("MCQ Evaluation: ","").substring(0,20)+(n.title.length>20?"...":""),fullTitle:n.title,score:n.score||0,className:n.class_name,dateStr:n.submitted_at?new Date(n.submitted_at).toLocaleDateString(void 0,{month:"short",day:"numeric"}):`Quiz #${y+1}`,fullDate:n.submitted_at?new Date(n.submitted_at).toLocaleDateString(void 0,{month:"long",day:"numeric",year:"numeric"}):"N/A",feedback:n.feedback||"Excellent execution!",gradedAt:n.graded_at?new Date(n.graded_at).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):""})),c=h!==null?h:g.length-1,r=g[c];k[c];const w=n=>n>=90?{bg:"bg-green-50 text-green-700 border-green-200",text:"text-green-600",ring:"ring-green-400"}:n>=75?{bg:"bg-blue-50 text-blue-700 border-blue-200",text:"text-blue-600",ring:"ring-blue-400"}:n>=60?{bg:"bg-amber-50 text-amber-700 border-amber-200",text:"text-amber-600",ring:"ring-amber-400"}:{bg:"bg-red-50 text-red-700 border-red-200",text:"text-red-600",ring:"ring-red-400"};return e.jsxs("div",{className:"bg-white border border-gray-200 rounded-2xl shadow-sm overflow-hidden flex flex-col font-sans",children:[e.jsxs("div",{className:"p-4 sm:p-5 border-b border-gray-100 flex flex-col sm:flex-row sm:items-center justify-between gap-3 bg-gray-50/50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-indigo-50 text-indigo-650 rounded-lg",children:e.jsx(H,{size:18,className:"animate-pulse"})}),e.jsxs("div",{children:[e.jsxs("h3",{className:"font-bold text-gray-800 text-sm sm:text-base flex items-center gap-1.5",children:[e.jsx("span",{children:"Performance Analytics & Historical Growth Timeline"}),e.jsxs("span",{className:"text-xs bg-indigo-100 text-indigo-800 font-bold px-1.5 py-0.5 rounded-full inline-flex items-center gap-1",children:[e.jsx(Z,{size:8})," Auto-Updated"]})]}),e.jsx("p",{className:"text-gray-500 text-xs",children:"Track chronological objective proficiency across classes"})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 bg-white p-1 rounded-lg border border-gray-200 self-start sm:self-center",children:[e.jsxs("button",{onClick:()=>a("area"),className:`px-2.5 py-1 text-xs font-semibold rounded-md transition-all flex items-center gap-1 ${t==="area"?"bg-indigo-600 text-white shadow-sm":"text-gray-600 hover:bg-gray-100"}`,children:[e.jsx(ot,{size:12}),e.jsx("span",{children:"Trend Area"})]}),e.jsxs("button",{onClick:()=>a("bar"),className:`px-2.5 py-1 text-xs font-semibold rounded-md transition-all flex items-center gap-1 ${t==="bar"?"bg-indigo-600 text-white shadow-sm":"text-gray-600 hover:bg-gray-100"}`,children:[e.jsx(Be,{size:12}),e.jsx("span",{children:"Bars"})]})]})]}),e.jsxs("div",{className:"p-4 sm:p-6 space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"p-3 bg-indigo-50/40 rounded-xl border border-indigo-100/60 flex items-center gap-2.5",children:[e.jsx("div",{className:"p-2 rounded-lg bg-indigo-100 text-indigo-600",children:e.jsx(H,{size:16})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs uppercase font-bold text-gray-400 tracking-wider",children:"Average"}),e.jsxs("div",{className:"text-lg font-bold text-indigo-950 font-mono",children:[d,"%"]})]})]}),e.jsxs("div",{className:"p-3 bg-emerald-50/40 rounded-xl border border-emerald-100/60 flex items-center gap-2.5",children:[e.jsx("div",{className:"p-2 rounded-lg bg-emerald-100 text-emerald-600",children:e.jsx(ze,{size:16})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs uppercase font-bold text-gray-400 tracking-wider",children:"Highest Score"}),e.jsxs("div",{className:"text-lg font-bold text-emerald-950 font-mono",children:[o,"%"]})]})]}),e.jsxs("div",{className:"p-3 bg-cyan-50/40 rounded-xl border border-cyan-100/60 flex items-center gap-2.5",children:[e.jsx("div",{className:"p-2 rounded-lg bg-cyan-100 text-cyan-600",children:e.jsx(we,{size:16})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs uppercase font-bold text-gray-400 tracking-wider",children:"Completed"}),e.jsxs("div",{className:"text-lg font-bold text-cyan-950 font-mono",children:[L," Quizzes"]})]})]}),e.jsxs("div",{className:"p-3 bg-amber-50/40 rounded-xl border border-amber-100/60 flex items-center gap-2.5",children:[e.jsx("div",{className:"p-2 rounded-lg bg-amber-100 text-amber-600",children:e.jsx(qe,{size:16})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs uppercase font-bold text-gray-400 tracking-wider",children:"Passing Rate"}),e.jsxs("div",{className:"text-lg font-bold text-amber-950 font-mono",children:[C,"%"]})]})]})]}),x.length>=2&&e.jsxs("div",{className:`p-4 rounded-xl border flex flex-col md:flex-row md:items-center justify-between gap-4 transition-all ${j}`,children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"p-2 rounded-lg bg-white/95 text-indigo-650 shrink-0 border border-indigo-100 shadow-xs",children:e.jsx(H,{size:18,className:f>0?"text-emerald-600 animate-pulse":"text-indigo-600"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs uppercase font-bold tracking-wider opacity-75",children:"Learning Curve & Trajectory"}),e.jsxs("h4",{className:"text-sm font-extrabold mt-0.5 flex items-center gap-2 text-slate-900",children:[e.jsx("span",{children:b}),f!==0&&e.jsx("span",{className:`inline-flex items-center text-xs px-2 py-0.5 rounded-full font-bold ${f>0?"bg-emerald-100/80 text-emerald-850 border border-emerald-250":"bg-rose-100/80 text-rose-850 border border-rose-250"}`,children:f>0?`▲ +${f}% Growth`:`▼ ${f}% Drop`})]}),e.jsx("p",{className:"text-xs text-slate-600 mt-1 leading-snug",children:D})]})]}),e.jsxs("div",{className:"text-xs font-semibold px-3 py-2 bg-white/95 rounded-lg shadow-3xs border border-slate-100 text-slate-700 md:self-center",children:[e.jsx("div",{className:"text-slate-400 font-bold uppercase text-xs mb-0.5 tracking-wider",children:"Growth Comparison"}),e.jsxs("span",{className:"font-bold text-indigo-900",children:[Math.round(x.slice(0,Math.ceil(x.length/2)).reduce((n,y)=>n+y,0)/Math.ceil(x.length/2)),"%"]})," ","Earliest Avg",e.jsx("span",{className:"text-slate-400 mx-1",children:"→"}),e.jsxs("span",{className:"font-bold text-emerald-700",children:[Math.round(x.slice(Math.ceil(x.length/2)).reduce((n,y)=>n+y,0)/x.slice(Math.ceil(x.length/2)).length)||x[x.length-1],"%"]})," ","Recent Avg"]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-6 min-h-0",children:[e.jsxs("div",{className:"lg:col-span-8 flex flex-col justify-between",children:[e.jsx("div",{className:"mb-2 text-xs font-semibold uppercase text-gray-400 tracking-wider",children:"Chronological Progress Chart"}),e.jsx("div",{className:"h-[250px] w-full mt-3",children:e.jsx(me,{width:"100%",height:"100%",children:t==="area"?e.jsxs(Bt,{data:g,margin:{top:10,right:10,left:-20,bottom:5},onClick:n=>{n&&typeof n.activeTooltipIndex=="number"&&i(n.activeTooltipIndex)},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"scoreColorGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",stopColor:"#4f46e5",stopOpacity:.25}),e.jsx("stop",{offset:"95%",stopColor:"#4f46e5",stopOpacity:.01})]})}),e.jsx(ne,{strokeDasharray:"3 3",vertical:!1,stroke:"#f1f5f9"}),e.jsx(ie,{dataKey:"dateStr",tick:{fontSize:12,fill:"#64748b"},axisLine:!1,tickLine:!1}),e.jsx(oe,{domain:[0,100],tick:{fontSize:12,fill:"#64748b"},axisLine:!1,tickLine:!1}),e.jsx(de,{cursor:{stroke:"#e2e8f0",strokeWidth:1},content:({active:n,payload:y})=>{if(n&&y&&y.length){const N=y[0].payload,_=c===N.index;return e.jsxs("div",{className:`p-3 bg-white border rounded-xl shadow-xl border-gray-100 max-w-xs transition-all ${_?"ring-2 ring-indigo-500":""}`,children:[e.jsx("p",{className:"text-xs text-gray-400 font-bold uppercase",children:N.fullDate}),e.jsx("p",{className:"text-xs font-bold text-gray-800 leading-snug mt-0.5",children:N.fullTitle}),e.jsxs("div",{className:"flex items-center justify-between gap-4 mt-2",children:[e.jsx("span",{className:"text-xs text-gray-500 bg-gray-50 border px-1.5 py-0.5 rounded font-medium",children:N.className}),e.jsxs("span",{className:"text-xs font-bold text-indigo-600 font-mono",children:[N.score,"%"]})]}),e.jsx("p",{className:"text-xs text-gray-400 italic mt-1 bg-gray-50 p-1 rounded",children:"Click node to pin details below"})]})}return null}}),e.jsx(le,{y:70,stroke:"#cbd5e1",strokeDasharray:"4 4",label:{value:"Passing Benchmark (70%)",fill:"#94a3b8",fontSize:12,position:"top"}}),e.jsx(qt,{type:"monotone",dataKey:"score",stroke:"#4f46e5",strokeWidth:2.5,fillOpacity:1,fill:"url(#scoreColorGrad)",activeDot:{r:6,fill:"#4f46e5",stroke:"#fff",strokeWidth:2}})]}):e.jsxs(Kt,{data:g,margin:{top:10,right:10,left:-20,bottom:5},onClick:n=>{n&&typeof n.activeTooltipIndex=="number"&&i(n.activeTooltipIndex)},children:[e.jsx(ne,{strokeDasharray:"3 3",vertical:!1,stroke:"#f1f5f9"}),e.jsx(ie,{dataKey:"dateStr",tick:{fontSize:12,fill:"#64748b"},axisLine:!1,tickLine:!1}),e.jsx(oe,{domain:[0,100],tick:{fontSize:12,fill:"#64748b"},axisLine:!1,tickLine:!1}),e.jsx(de,{cursor:{fill:"rgba(79, 70, 229, 0.04)"},content:({active:n,payload:y})=>{if(n&&y&&y.length){const N=y[0].payload;return e.jsxs("div",{className:"p-3 bg-white border border-gray-150 rounded-xl shadow-xl max-w-xs",children:[e.jsx("p",{className:"text-xs text-gray-400 font-bold uppercase",children:N.fullDate}),e.jsx("p",{className:"text-xs font-bold text-gray-800 leading-snug mt-0.5",children:N.fullTitle}),e.jsxs("div",{className:"flex items-center justify-between gap-4 mt-2",children:[e.jsx("span",{className:"text-xs text-gray-500 bg-gray-50 border px-1.5 py-0.5 rounded font-medium",children:N.className}),e.jsxs("span",{className:"text-xs font-bold text-indigo-600 font-mono",children:[N.score,"%"]})]})]})}return null}}),e.jsx(le,{y:70,stroke:"#cbd5e1",strokeDasharray:"4 4",label:{value:"Benchmark",fill:"#94a3b8",fontSize:12}}),e.jsx(Ut,{dataKey:"score",fill:"#4f46e5",radius:[4,4,0,0],maxBarSize:45})]})})}),e.jsxs("div",{className:"mt-4 p-3 bg-gray-50 rounded-xl border border-gray-150 text-xs",children:[e.jsxs("div",{className:"flex justify-between items-center mb-1",children:[e.jsxs("span",{className:"font-semibold text-gray-650 flex items-center gap-1",children:[e.jsx(lt,{size:12}),e.jsx("span",{children:"Selected Node Objective Grade Evaluation:"})]}),e.jsxs("span",{className:"text-xs font-mono text-gray-400 font-semibold uppercase",children:["Quiz ",c+1," of ",L]})]}),e.jsxs("div",{className:"flex items-start justify-between gap-3 mt-1.5",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-bold text-gray-850 leading-relaxed text-xs",children:r.fullTitle}),e.jsxs("p",{className:"text-xs text-gray-500 leading-normal flex items-center flex-wrap gap-1.5",children:[e.jsxs("span",{children:[r.className," · Submitted on ",r.fullDate]}),r.gradedAt&&e.jsxs("span",{className:"inline-flex items-center gap-0.5 text-emerald-650 bg-emerald-50 px-1.5 py-0.5 rounded border border-emerald-100 font-medium",children:[e.jsx(ae,{size:10})," Graded: ",r.gradedAt]})]})]}),e.jsxs("div",{className:`px-2.5 py-1 rounded-lg border font-mono font-bold text-center shrink-0 ${w(r.score).bg}`,children:[e.jsx("div",{className:"text-xs uppercase tracking-wider font-bold opacity-75",children:"Score"}),e.jsxs("div",{className:"text-sm font-black leading-none",children:[r.score,"%"]})]})]})]})]}),e.jsxs("div",{className:"lg:col-span-4 flex flex-col",children:[e.jsxs("div",{className:"mb-2 text-xs font-semibold uppercase text-gray-400 tracking-wider flex items-center justify-between",children:[e.jsx("span",{children:"Interactive Evaluation Log"}),e.jsx("span",{className:"text-xs lowercase bg-amber-50 text-amber-700 px-1 py-0.5 rounded border border-amber-100 font-mono",children:"recent first"})]}),e.jsx("div",{className:"flex-1 overflow-y-auto max-h-[300px] lg:max-h-[340px] pr-1.5 space-y-3 scrollbar-thin mt-3",children:e.jsx(Oe,{initial:!1,children:[...g].reverse().map(n=>{const y=c===n.index,N=w(n.score);return e.jsxs(B.div,{onClick:()=>i(n.index),whileHover:{scale:1.01},className:`p-3 rounded-xl border cursor-pointer transition-all ${y?"border-indigo-600 bg-indigo-50/20 ring-2 ring-indigo-100/50 shadow-sm":"border-gray-150 hover:border-gray-300 bg-white hover:bg-gray-50/50"}`,children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.jsxs("span",{className:"text-xs font-bold text-gray-400 font-mono uppercase",children:["#",n.index+1]}),e.jsx("span",{className:"text-xs text-gray-500 font-medium font-sans",children:n.dateStr}),e.jsx("span",{className:"text-xs font-bold text-indigo-700 px-1.5 py-0.5 bg-indigo-50 rounded bg-indigo-50/50 ml-auto border border-indigo-100",children:n.className})]}),e.jsx("h4",{className:"font-bold text-xs text-gray-800 leading-snug line-clamp-1 py-0.5",children:n.fullTitle})]}),e.jsxs("div",{className:`px-1.5 py-0.5 rounded font-bold font-mono text-xs border shrink-0 ${N.bg}`,children:[n.score,"%"]})]}),e.jsx("div",{className:`text-xs text-gray-500 mt-2 bg-gray-50/80 p-1.5 rounded-lg border border-gray-100 ${y?"block":"line-clamp-1"}`,children:e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-start gap-1",children:[e.jsx(dt,{size:10,className:"text-teal-600 shrink-0 mt-0.5"}),e.jsxs("span",{className:"leading-snug text-slate-700 italic",children:['"',n.feedback,'"']})]}),n.gradedAt&&y&&e.jsxs("div",{className:"text-xs text-gray-400 mt-1 flex items-center justify-end gap-0.5 font-mono italic border-t border-gray-250/50 pt-1",children:[e.jsx(ae,{size:9})," Graded: ",n.gradedAt]})]})})]},n.id)})})})]})]})]})]})}function ws(s){const{assignments:t,lang:a,hideWeeklyTrend:h=!1}=s;return e.jsxs(e.Fragment,{children:[!h&&e.jsx(B.div,{initial:{opacity:0,y:15},animate:{opacity:1,y:0},transition:{duration:.5,delay:.05,ease:"easeOut"},children:e.jsx(Je,{assignments:t,lang:a})}),e.jsx(B.div,{initial:{opacity:0,y:15},animate:{opacity:1,y:0},transition:{duration:.5,delay:.1,ease:"easeOut"},children:e.jsx(bs,{assignments:t,lang:a})}),e.jsx(B.div,{initial:{opacity:0,y:15},animate:{opacity:1,y:0},transition:{duration:.5,delay:.2,ease:"easeOut"},children:e.jsx(js,{assignments:t,lang:a})}),e.jsx(B.div,{initial:{opacity:0,y:15},animate:{opacity:1,y:0},transition:{duration:.5,delay:.25,ease:"easeOut"},children:e.jsx(vs,{assignments:t,lang:a})}),e.jsx(B.div,{initial:{opacity:0,y:15},animate:{opacity:1,y:0},transition:{duration:.5,delay:.3,ease:"easeOut"},children:e.jsx(ys,{assignments:t})})]})}function Ns(s){const{schedules:t,setSelectedLesson:a,setStudentViewStatus:h}=s;return e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 shadow-sm flex flex-col",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 flex items-center gap-2",children:[e.jsx(be,{size:18,className:"text-pink-500"}),e.jsx("h3",{className:"font-semibold text-gray-800",children:"My Schedule"})]}),e.jsx("div",{className:"p-4 flex-1",children:t.length===0?e.jsx("div",{className:"text-center p-8 text-gray-400 italic text-sm",children:"No upcoming classes."}):e.jsx("div",{className:"space-y-3",children:t.map(i=>e.jsxs("div",{className:"flex flex-col p-3 rounded-lg border border-pink-100 bg-pink-50/30",children:[e.jsxs("div",{className:"flex justify-between items-start mb-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-gray-800",children:i.lesson_title}),e.jsx("div",{className:"text-xs text-gray-500",children:i.class_name})]}),e.jsx("div",{className:"bg-pink-100 text-pink-700 px-2 py-1 inline-block rounded text-xs font-bold font-mono tracking-tight",children:i.scheduled_date})]}),e.jsxs("div",{className:"flex justify-between items-end mt-2",children:[i.attendance_status?e.jsxs("div",{className:"text-xs text-gray-600 font-medium",children:["Attendance:"," ",e.jsx("span",{className:`uppercase font-bold ${i.attendance_status==="present"?"text-green-600":i.attendance_status==="late"?"text-amber-600":"text-red-600"}`,children:i.attendance_status})]}):e.jsx("div",{className:"text-xs text-gray-400 italic",children:"Attendance not yet recorded."}),e.jsxs("button",{onClick:()=>{a(i.lesson_id),h("lesson")},className:"flex items-center gap-1 bg-pink-500 hover:bg-pink-600 text-white px-3 py-1.5 rounded text-xs font-semibold shadow-sm transition-colors",children:[e.jsx(ye,{size:14})," Join Class"]})]})]},i.id))})})]})}function ks(s){const{assignments:t,setSelectedAssignment:a,setStudentViewStatus:h,setQuizStudentAnswers:i,setSubAssignmentTab:k,lang:x}=s;return e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 shadow-sm flex flex-col",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 flex items-center gap-2",children:[e.jsx(Ce,{size:18,className:"text-indigo-500"}),e.jsx("h3",{className:"font-semibold text-gray-800",children:"My Assignments"})]}),e.jsx("div",{className:"p-4 flex-1",children:t.length===0?e.jsx("div",{className:"text-center p-8 text-gray-400 italic text-sm",children:"No assignments given."}):e.jsx("div",{className:"space-y-3",children:t.map(o=>e.jsxs("div",{className:"flex flex-col p-3 rounded-lg border border-gray-100 bg-gray-50 hover:bg-gray-100 transition-colors",children:[e.jsxs("div",{className:"flex justify-between items-start mb-1",children:[e.jsx("div",{className:"font-semibold text-indigo-900",children:o.title}),!o.submission_status&&e.jsx("span",{className:"bg-amber-100 text-amber-800 text-xs px-1.5 py-0.5 rounded uppercase font-bold",children:"Pending"}),o.submission_status==="submitted"&&e.jsx("span",{className:"bg-blue-100 text-blue-800 text-xs px-1.5 py-0.5 rounded uppercase font-bold",children:"Awaiting Grade"}),o.submission_status==="graded"&&e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 relative group/ast-badge",children:[o.graded_at&&e.jsxs("div",{className:"text-gray-400 hover:text-indigo-600 transition-colors cursor-help p-0.5",children:[e.jsx(ae,{size:11}),e.jsxs("div",{className:"absolute right-0 bottom-full mb-1.5 hidden group-hover/ast-badge:block bg-gray-900 text-white text-xs p-2 rounded-xl shadow-xl z-25 whitespace-nowrap font-sans font-normal normal-case",children:[x==="zh"?`评审反馈时间: ${new Date(o.graded_at).toLocaleString("zh-CN",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}`:`Feedback Hour: ${new Date(o.graded_at).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}`,e.jsx("div",{className:"absolute top-full right-2 -mt-1 border-4 border-transparent border-t-gray-900"})]})]}),e.jsxs("span",{className:"bg-green-100 text-green-800 text-xs px-1.5 py-0.5 rounded uppercase font-bold text-center",children:["Score: ",o.score,"%"]})]})]}),e.jsxs("div",{className:"text-xs text-gray-500 mb-2",children:[o.class_name," · ",e.jsx("span",{className:"text-gray-400 italic",children:o.content})]}),o.submission_status==="graded"&&o.feedback&&e.jsxs("div",{className:"mt-2 bg-green-50 p-2.5 rounded-lg border border-green-100 flex flex-col gap-1 text-xs text-green-800",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-green-100/50 pb-1 mb-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1 font-semibold",children:[e.jsx(Se,{size:13,className:"shrink-0 text-green-600"}),e.jsx("span",{children:x==="zh"?"教师评审意见":"Teacher Feedback"})]}),o.graded_at&&e.jsxs("div",{className:"flex items-center gap-1 text-xs text-green-600 font-mono bg-white/70 px-1.5 py-0.5 rounded border border-green-100/50 relative group/ast-time cursor-help",children:[e.jsx(ae,{size:10,className:"inline"}),e.jsx("span",{children:new Date(o.graded_at).toLocaleDateString(x==="zh"?"zh-CN":"en-US",{month:"short",day:"numeric"})}),e.jsxs("div",{className:"absolute right-0 bottom-full mb-1.5 hidden group-hover/ast-time:block bg-gray-900 text-white text-xs p-2 rounded-lg shadow-xl z-20 whitespace-nowrap font-sans font-normal text-left",children:[x==="zh"?`评审反馈于: ${new Date(o.graded_at).toLocaleString("zh-CN")}`:`Feedback provided on: ${new Date(o.graded_at).toLocaleString("en-US")}`,e.jsx("div",{className:"absolute top-full right-3 -mt-1 border-4 border-transparent border-t-gray-900"})]})]})]}),e.jsx("span",{className:"leading-snug bg-green-50/20 rounded p-1 text-xs text-gray-700 whitespace-pre-wrap",children:o.feedback})]}),!o.submission_status&&e.jsx("div",{className:"mt-2 text-right flex items-center justify-end gap-2",children:e.jsxs("button",{onClick:()=>{a(o),h("assignment"),i({}),k("quiz")},className:"px-3 py-1.5 bg-indigo-100 text-indigo-700 hover:bg-indigo-200 text-xs rounded shadow-sm focus:outline-none transition-colors font-medium flex items-center gap-1.5",children:[e.jsx(ct,{size:14})," Open Canvas"]})}),o.submission_status&&e.jsx("div",{className:"mt-2 text-right",children:e.jsxs("button",{onClick:()=>{if(a(o),h("assignment"),k("quiz"),o.submission_content)try{i(JSON.parse(o.submission_content))}catch{i({})}else i({})},className:"px-3 py-1.5 bg-gray-100 text-gray-700 hover:bg-gray-200 text-xs rounded shadow-sm focus:outline-none transition-colors font-medium flex items-center gap-1.5 ml-auto",children:[e.jsx(qe,{size:14})," View Submission"]})})]},o.id))})})]})}const zs={third:"lg:col-span-4 col-span-1",half:"lg:col-span-6 col-span-1","two-thirds":"lg:col-span-8 col-span-1",full:"lg:col-span-12 col-span-1"},Ss={third:{zh:"1/3 窄栏",en:"1/3 Narrow"},half:{zh:"1/2 半宽",en:"1/2 Half"},"two-thirds":{zh:"2/3 宽栏",en:"2/3 Wide"},full:{zh:"整行全宽",en:"Full Width"}},fe=[{id:"quick-stats",size:"full",visible:!0},{id:"progress-trends",size:"two-thirds",visible:!0},{id:"upcoming-assignments",size:"third",visible:!0},{id:"course-progress",size:"half",visible:!0},{id:"schedules",size:"half",visible:!0},{id:"academic-trajectory",size:"full",visible:!0},{id:"extension-views",size:"full",visible:!0}],Ge={default:{label:{zh:"默认布局 (推荐)",en:"Default (Balanced)"},layout:fe},assignments_focus:{label:{zh:"作业攻坚模式",en:"Assignments Focus"},layout:[{id:"quick-stats",size:"full",visible:!0},{id:"upcoming-assignments",size:"full",visible:!0},{id:"progress-trends",size:"half",visible:!0},{id:"schedules",size:"half",visible:!0},{id:"course-progress",size:"half",visible:!0},{id:"academic-trajectory",size:"half",visible:!0},{id:"extension-views",size:"full",visible:!0}]},analytics_focus:{label:{zh:"学情走势大屏",en:"Progress Trends Focus"},layout:[{id:"progress-trends",size:"full",visible:!0},{id:"quick-stats",size:"full",visible:!0},{id:"academic-trajectory",size:"full",visible:!0},{id:"upcoming-assignments",size:"half",visible:!0},{id:"schedules",size:"half",visible:!0},{id:"course-progress",size:"full",visible:!0},{id:"extension-views",size:"full",visible:!0}]},symmetric_compact:{label:{zh:"双列紧凑并排",en:"Two-Column Compact"},layout:[{id:"quick-stats",size:"full",visible:!0},{id:"progress-trends",size:"half",visible:!0},{id:"upcoming-assignments",size:"half",visible:!0},{id:"course-progress",size:"half",visible:!0},{id:"schedules",size:"half",visible:!0},{id:"academic-trajectory",size:"full",visible:!0},{id:"extension-views",size:"full",visible:!0}]}};function ee({id:s,title:t,subtitle:a,icon:h,size:i,onResize:k,onMoveLeft:x,onMoveRight:o,isFirst:d=!1,isLast:L=!1,collapsed:z=!1,onToggleCollapse:C,lang:b="zh",children:D,onDragStart:f,onDragOver:j,onDrop:g,isDragging:c=!1,headerRightExtra:r}){const[w,n]=S.useState(!1),y=()=>{k({third:"half",half:"two-thirds","two-thirds":"full",full:"half"}[i])},N=zs[i]||"lg:col-span-6 col-span-1";return e.jsxs("div",{id:`widget-${s}`,"data-widget-id":s,"data-widget-size":i,draggable:!0,onDragStart:_=>f?.(_,s),onDragOver:_=>{_.preventDefault(),n(!0),j?.(_)},onDragLeave:()=>n(!1),onDrop:_=>{_.preventDefault(),n(!1),g?.(_,s)},className:`group/widget relative flex flex-col bg-white rounded-2xl border transition-all duration-200 ${N} ${w?"border-indigo-500 ring-2 ring-indigo-500/30 scale-[1.008] shadow-md z-10":c?"opacity-40 border-dashed border-indigo-400":"border-slate-200/90 shadow-2xs hover:shadow-xs hover:border-slate-300"}`,children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-slate-100 bg-slate-50/70 rounded-t-2xl select-none",children:[e.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[e.jsx("div",{className:"cursor-grab active:cursor-grabbing text-slate-400 hover:text-indigo-600 transition-colors p-0.5 rounded hover:bg-slate-200/60",title:b==="zh"?"按住可拖动排序":"Drag to reorder",children:e.jsx(xt,{size:16})}),h&&e.jsx("div",{className:"text-indigo-600 shrink-0",children:h}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h3",{className:"text-sm font-bold text-slate-800 tracking-tight truncate flex items-center gap-2",children:[e.jsx("span",{children:t}),i==="full"&&e.jsx("span",{className:"hidden sm:inline-block text-2xs font-semibold px-1.5 py-0.2 rounded bg-indigo-50 text-indigo-600 border border-indigo-100/80",children:b==="zh"?"全宽":"Full"})]}),a&&e.jsx("p",{className:"text-2xs text-slate-450 truncate",children:a})]})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[r,e.jsxs("div",{className:"hidden sm:flex items-center bg-slate-200/60 p-0.5 rounded-lg border border-slate-200 text-2xs font-bold text-slate-600",children:[e.jsx("button",{type:"button",onClick:()=>k("third"),title:b==="zh"?"缩放为 1/3 窄栏":"Set to 1/3 width",className:`px-1.5 py-0.5 rounded transition-all cursor-pointer ${i==="third"?"bg-white text-indigo-700 shadow-2xs":"hover:text-slate-900"}`,children:"1/3"}),e.jsx("button",{type:"button",onClick:()=>k("half"),title:b==="zh"?"缩放为 1/2 半宽":"Set to 1/2 width",className:`px-1.5 py-0.5 rounded transition-all cursor-pointer ${i==="half"?"bg-white text-indigo-700 shadow-2xs":"hover:text-slate-900"}`,children:"1/2"}),e.jsx("button",{type:"button",onClick:()=>k("two-thirds"),title:b==="zh"?"缩放为 2/3 宽栏":"Set to 2/3 width",className:`px-1.5 py-0.5 rounded transition-all cursor-pointer ${i==="two-thirds"?"bg-white text-indigo-700 shadow-2xs":"hover:text-slate-900"}`,children:"2/3"}),e.jsx("button",{type:"button",onClick:()=>k("full"),title:b==="zh"?"缩放为整行全宽":"Set to full width",className:`px-1.5 py-0.5 rounded transition-all cursor-pointer ${i==="full"?"bg-white text-indigo-700 shadow-2xs":"hover:text-slate-900"}`,children:"Full"})]}),e.jsx("button",{type:"button",onClick:y,title:b==="zh"?`切换尺寸 (当前: ${Ss[i]?.zh})`:`Resize (Current: ${i})`,className:"sm:hidden p-1.5 text-slate-500 hover:text-indigo-600 hover:bg-slate-200/50 rounded-lg transition-colors cursor-pointer",children:e.jsx(mt,{size:14})}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("button",{type:"button",onClick:x,disabled:d,title:b==="zh"?"向前移动卡片":"Move forward",className:"p-1.5 text-slate-500 hover:text-indigo-600 disabled:opacity-30 disabled:pointer-events-none hover:bg-slate-200/50 rounded-lg transition-colors cursor-pointer",children:e.jsx(ht,{size:15})}),e.jsx("button",{type:"button",onClick:o,disabled:L,title:b==="zh"?"向后移动卡片":"Move backward",className:"p-1.5 text-slate-500 hover:text-indigo-600 disabled:opacity-30 disabled:pointer-events-none hover:bg-slate-200/50 rounded-lg transition-colors cursor-pointer",children:e.jsx(te,{size:15})})]}),C&&e.jsx("button",{type:"button",onClick:C,title:z?b==="zh"?"展开卡片":"Expand":b==="zh"?"收起卡片":"Collapse",className:"p-1.5 text-slate-500 hover:text-slate-800 hover:bg-slate-200/50 rounded-lg transition-colors cursor-pointer",children:z?e.jsx(ut,{size:15}):e.jsx(gt,{size:15})})]})]}),!z&&e.jsx("div",{className:"p-4 flex-1 flex flex-col",children:D}),z&&e.jsx("div",{onClick:C,className:"p-3 text-center text-xs font-semibold text-slate-400 hover:text-indigo-600 hover:bg-slate-50 transition-colors cursor-pointer rounded-b-2xl select-none",children:b==="zh"?"卡片已收起 · 点击展开查看完整详情":"Card is collapsed · Click to expand"})]})}class se{constructor(){this.customBreakpoints=new Map,this.subscribers=new Set,this.isListening=!1,this.cachedInfo=null,this.resizeTimer=null,this.handleWindowResize=()=>{this.resizeTimer&&clearTimeout(this.resizeTimer),this.resizeTimer=setTimeout(()=>{const t=this.getSnapshot();this.cachedInfo=t;for(const a of this.subscribers)try{a(t)}catch(h){console.warn("[ScreenResizeObserverManager] Error invoking subscriber:",h)}typeof window<"u"&&window.dispatchEvent(new CustomEvent("openlearn:screen:resize",{detail:t}))},100)}}static getInstance(){return se.instance||(se.instance=new se),se.instance}registerCustomBreakpoint(t,a){return this.customBreakpoints.set(t,a),()=>{this.customBreakpoints.delete(t)}}subscribe(t){this.subscribers.add(t),this.ensureListening();const a=this.getSnapshot();try{t(a)}catch(h){console.warn("[ScreenResizeObserverManager] Error in initial subscriber callback:",h)}return()=>{this.subscribers.delete(t),this.subscribers.size===0&&this.isListening&&this.stopListening()}}evaluateCustomBreakpoints(t,a){const h={};for(const[i,k]of this.customBreakpoints.entries())try{h[i]=k(t,a)}catch{h[i]=!1}return h}getSnapshot(t=768,a=1024){const h=typeof window<"u"?window.innerWidth:1024,i=typeof window<"u"?window.innerHeight:768;return this.calculateInfo(h,i,t,a)}calculateInfo(t,a,h=768,i=1024){const k=t<h,x=t>=h&&t<i,o=t>=i,d=t<640;let L="md";t<640?L="xs":t<768?L="sm":t<1024?L="md":t<1280?L="lg":t<1536?L="xl":L="2xl";const z=t>=a?"landscape":"portrait",C=this.evaluateCustomBreakpoints(t,a);return{width:t,height:a,isMobile:k,isTablet:x,isDesktop:o,isSmallScreen:d,screenSize:L,orientation:z,customMatches:C}}ensureListening(){this.isListening||typeof window>"u"||(this.isListening=!0,window.addEventListener("resize",this.handleWindowResize,{passive:!0}),window.addEventListener("orientationchange",this.handleWindowResize,{passive:!0}))}stopListening(){!this.isListening||typeof window>"u"||(this.isListening=!1,window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("orientationchange",this.handleWindowResize))}}const Ie=se.getInstance();function Cs(s={}){const{mobileBreakpoint:t=768,tabletBreakpoint:a=1024,debounceMs:h=100,initialWidth:i,initialHeight:k,onResize:x,onMobileEnter:o,onMobileLeave:d}=s,L=()=>{const g=typeof i=="number"?i:typeof window<"u"?window.innerWidth:1024,c=typeof k=="number"?k:typeof window<"u"?window.innerHeight:768;return Ie.calculateInfo(g,c,t,a)},[z,C]=S.useState(L),b=S.useRef(z.isMobile),D=S.useRef(x),f=S.useRef(o),j=S.useRef(d);return D.current=x,f.current=o,j.current=d,S.useEffect(()=>{if(typeof window>"u")return;let g=null;const c=()=>{const w=window.innerWidth,n=window.innerHeight,y=Ie.calculateInfo(w,n,t,a);C(y),D.current?.(y),!b.current&&y.isMobile?f.current?.(y):b.current&&!y.isMobile&&j.current?.(y),b.current=y.isMobile},r=()=>{h<=0?c():(g&&clearTimeout(g),g=setTimeout(c,h))};return window.addEventListener("resize",r,{passive:!0}),window.addEventListener("orientationchange",r,{passive:!0}),c(),()=>{g&&clearTimeout(g),window.removeEventListener("resize",r),window.removeEventListener("orientationchange",r)}},[t,a,h]),z}class re{constructor(){this.actions=new Map,this.listeners=new Set,this.compactModeListeners=new Set,this.isCompact=!1}static getInstance(){return re.instance||(re.instance=new re),re.instance}registerAction(t){return this.actions.set(t.id,t),this.notifyActionChange(),()=>{this.unregisterAction(t.id)}}unregisterAction(t){this.actions.delete(t)&&this.notifyActionChange()}getActions(){return Array.from(this.actions.values()).sort((t,a)=>(a.priority??0)-(t.priority??0))}subscribe(t){this.listeners.add(t);try{t(this.getActions())}catch(a){console.warn("[StudentQuickActionsRegistry] Subscriber initial call failed:",a)}return()=>{this.listeners.delete(t)}}setCompactMode(t){if(this.isCompact!==t){this.isCompact=t;for(const a of this.compactModeListeners)try{a(t)}catch(h){console.warn("[StudentQuickActionsRegistry] Compact listener error:",h)}}}getCompactMode(){return this.isCompact}onCompactModeChange(t){return this.compactModeListeners.add(t),()=>{this.compactModeListeners.delete(t)}}collapseMenu(t="programmatic"){typeof window<"u"&&window.dispatchEvent(new CustomEvent("openlearn:student_quick_actions:collapse",{detail:{reason:t}}))}openMenu(){typeof window<"u"&&window.dispatchEvent(new CustomEvent("openlearn:student_quick_actions:open"))}notifyActionChange(){const t=this.getActions();for(const a of this.listeners)try{a(t)}catch(h){console.warn("[StudentQuickActionsRegistry] Listener error:",h)}typeof window<"u"&&window.dispatchEvent(new CustomEvent("openlearn:student_quick_actions:changed",{detail:{actions:t}}))}}const ue=re.getInstance();function As(s){if(!s)return e.jsx(Z,{size:18});if(typeof s!="string")return s;const t=vt[s];return t?e.jsx(t,{size:18}):e.jsx("span",{className:"text-sm font-bold",children:s})}function Ls(s){switch(s){case"rose":return"bg-rose-100 text-rose-700 border-rose-200";case"amber":return"bg-amber-100 text-amber-800 border-amber-200";case"emerald":return"bg-emerald-100 text-emerald-800 border-emerald-200";case"blue":return"bg-blue-100 text-blue-700 border-blue-200";case"slate":return"bg-slate-100 text-slate-700 border-slate-200";case"indigo":default:return"bg-indigo-100 text-indigo-700 border-indigo-200"}}function Ds({studentDashboardData:s,activeStudentId:t,readNotifications:a,setReadNotifications:h,setSelectedLesson:i,setStudentViewStatus:k,setSelectedAssignment:x,addToast:o,lang:d="zh",onExpandWidget:L,compactMode:z,autoCollapseOnMobile:C=!0,mobileBreakpoint:b=768,pluginActions:D,onCompactChange:f,customFabRenderer:j,enablePluginRegistry:g=!0}){const[c,r]=S.useState(!1),[w,n]=S.useState("menu"),[y,N]=S.useState(null),[_,$]=S.useState([]),M=S.useRef(null),u=Cs({mobileBreakpoint:b,debounceMs:50,onMobileEnter:()=>{C&&(r(!1),ue.collapseMenu("auto_collapse_on_mobile_enter"))}}),T=S.useMemo(()=>typeof z=="boolean"?z:y!==null?y:u.isMobile,[z,y,u.isMobile]);S.useEffect(()=>{f?.(T),ue.setCompactMode(T),typeof window<"u"&&window.dispatchEvent(new CustomEvent("openlearn:student_quick_actions:compact_changed",{detail:{isCompact:T,isMobile:u.isMobile,width:u.width,height:u.height}}))},[T,u.isMobile,u.width,u.height,f]),S.useEffect(()=>g?ue.subscribe(W=>{$(W)}):void 0,[g]),S.useEffect(()=>{const m=()=>r(!1),W=()=>r(!0),O=()=>N(Q=>Q===null?!u.isMobile:!Q),X=Q=>{const Y=Q;Y.detail&&Y.detail.id&&ue.registerAction(Y.detail)};return window.addEventListener("openlearn:student_quick_actions:collapse",m),window.addEventListener("openlearn:student_quick_actions:open",W),window.addEventListener("openlearn:student_quick_actions:toggle_compact",O),window.addEventListener("openlearn:student_quick_action:register",X),()=>{window.removeEventListener("openlearn:student_quick_actions:collapse",m),window.removeEventListener("openlearn:student_quick_actions:open",W),window.removeEventListener("openlearn:student_quick_actions:toggle_compact",O),window.removeEventListener("openlearn:student_quick_action:register",X)}},[u.isMobile]);const I=s?.schedules||[],F=s?.assignments||[],l=s?.rollcalls||[],v=s?.progress||[],A=S.useMemo(()=>l.filter(m=>!a.has(m.id)),[l,a]),E=S.useMemo(()=>F.filter(m=>!m.submission_status),[F]),p=S.useMemo(()=>I.length>0?I.find(m=>m.attendance_status==="present"||m.status==="scheduled")||I[0]:v.length>0?{lesson_id:v[0].lesson_id,lesson_title:v[0].lesson_title,class_name:d==="zh"?"正在进行的课程":"In-progress course"}:null,[I,v,d]),R=S.useMemo(()=>{const m=new Map;for(const W of _)m.set(W.id,W);if(D)for(const W of D)m.set(W.id,W);return Array.from(m.values()).filter(W=>!(W.visibleOnMobile===!1&&T)).sort((W,O)=>(O.priority??0)-(W.priority??0))},[_,D,T]),P=A.length+E.length+(p?1:0);S.useEffect(()=>{function m(W){M.current&&!M.current.contains(W.target)&&r(!1)}return c&&document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m)}},[c]),S.useEffect(()=>{function m(W){W.key==="Escape"&&c&&r(!1)}return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[c]);const G=()=>{const m=p?.lesson_id||(v[0]?.lesson_id??null);m?(i(m),k("lesson"),r(!1),o?.(d==="zh"?"已进入面授课堂":"Joining Live Session",d==="zh"?`已成功接入「${p?.lesson_title||"面授课程"}」实时白板与互动系统`:`Connected to "${p?.lesson_title||"Classroom"}"`,"success")):o?.(d==="zh"?"暂无可接入的课堂":"No Live Session",d==="zh"?"当前暂无正在进行的课节,请查看课表安排":"No ongoing classroom session scheduled","info")},q=()=>{r(!1),L?.("upcoming-assignments");const m=document.getElementById("widget-upcoming-assignments");m?(m.scrollIntoView({behavior:"smooth",block:"center"}),m.classList.add("ring-4","ring-indigo-500/40"),setTimeout(()=>{m.classList.remove("ring-4","ring-indigo-500/40")},2e3)):E.length>0&&(x(E[0]),k("assignment"))},K=m=>{x(m),k("assignment"),r(!1)},U=async m=>{try{t&&await fetch(`/api/students/${t}/read_notifications`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({notificationId:m})})}catch{}h(W=>{const O=new Set(W);return O.add(m),O}),o?.(d==="zh"?"点名确认成功":"Roll Call Confirmed",d==="zh"?"已向教师端大屏同步您的参与状态":"Attendance signal sent to teacher","success")},V=m=>{if(!m.disabled){if(r(!1),m.onClick)m.onClick({activeStudentId:t,lessonId:p?.lesson_id,assignments:F,schedules:I,rollcalls:l,lang:d});else if(m.commandType)try{window.openlearn?.commandBus?.execute({type:m.commandType,payload:m.commandPayload,actorId:t})}catch(W){console.warn("[StudentQuickActions] Failed to dispatch plugin command:",W)}}};return e.jsxs("div",{ref:M,id:"student-quick-actions-container","data-compact":T?"true":"false","data-is-mobile":u.isMobile?"true":"false",className:"fixed bottom-6 right-6 z-50 flex flex-col items-end pointer-events-auto",children:[e.jsx(Oe,{children:c&&e.jsxs(B.div,{initial:{opacity:0,scale:.9,y:15},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:15},transition:{type:"spring",damping:25,stiffness:350},className:"mb-3 w-[calc(100vw-2.5rem)] max-w-[340px] sm:w-[380px] bg-white/95 backdrop-blur-md rounded-2xl border border-slate-200/90 shadow-2xl overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 bg-gradient-to-r from-slate-900 to-indigo-950 text-white",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg bg-indigo-500/30 flex items-center justify-center text-indigo-300 shrink-0",children:e.jsx(Me,{size:16})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("h4",{className:"text-xs font-black uppercase tracking-wider text-slate-100 truncate",children:d==="zh"?"学生快捷指令 (Quick Actions)":"Quick Actions"}),T&&e.jsx("span",{className:"text-[9px] font-extrabold px-1.5 py-0.2 rounded bg-indigo-500/40 text-indigo-200 shrink-0",children:d==="zh"?"紧凑":"Compact"})]}),e.jsx("p",{className:"text-2xs text-slate-400 truncate",children:d==="zh"?"一键直达课堂、作业与插件扩展":"Fast navigation & plugin actions"})]})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0 ml-2",children:[e.jsx("button",{type:"button",onClick:()=>N(m=>m===null?!u.isMobile:!m),className:"p-1 rounded-lg text-slate-400 hover:text-white hover:bg-white/10 transition-colors cursor-pointer",title:T?d==="zh"?"恢复标准模式":"Expanded FAB":d==="zh"?"切换紧凑图标模式":"Compact FAB",children:T?e.jsx(ft,{size:13}):e.jsx(pt,{size:13})}),e.jsx("button",{type:"button",onClick:()=>r(!1),className:"p-1 rounded-lg text-slate-400 hover:text-white hover:bg-white/10 transition-colors cursor-pointer",title:d==="zh"?"关闭":"Close",children:e.jsx(_e,{size:16})})]})]}),w==="menu"?e.jsxs("div",{className:"p-3.5 flex flex-col gap-2.5 max-h-[460px] overflow-y-auto",children:[e.jsxs("div",{id:"qa-action-join-live",onClick:G,className:"group/item flex items-center justify-between p-3 rounded-xl border border-slate-200/80 bg-slate-50/70 hover:bg-indigo-50/60 hover:border-indigo-300 transition-all cursor-pointer shadow-3xs",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsxs("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-tr from-rose-500 to-orange-400 text-white flex items-center justify-center shrink-0 shadow-xs relative",children:[e.jsx(bt,{size:18,className:"animate-pulse"}),e.jsxs("span",{className:"absolute -top-1 -right-1 flex h-2.5 w-2.5",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-rose-400 opacity-75"}),e.jsx("span",{className:"relative inline-flex rounded-full h-2.5 w-2.5 bg-rose-500"})]})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs font-black text-slate-800 tracking-tight group-hover/item:text-indigo-900 transition-colors",children:d==="zh"?"进入实时课堂":"Join Live Session"}),e.jsx("span",{className:"text-2xs font-extrabold px-1.5 py-0.2 rounded bg-rose-100 text-rose-700",children:"LIVE"})]}),e.jsx("p",{className:"text-2xs text-slate-500 truncate mt-0.5",children:p?p.lesson_title||p.title||"当前课堂":d==="zh"?"点击接入今日课堂与互动白板":"Connect to live interactive lesson"})]})]}),e.jsx(te,{size:16,className:"text-slate-400 group-hover/item:text-indigo-600 group-hover/item:translate-x-0.5 transition-all shrink-0"})]}),e.jsxs("div",{id:"qa-action-view-assignments",onClick:q,className:"group/item flex items-center justify-between p-3 rounded-xl border border-slate-200/80 bg-slate-50/70 hover:bg-teal-50/60 hover:border-teal-300 transition-all cursor-pointer shadow-3xs",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-tr from-teal-500 to-emerald-400 text-white flex items-center justify-center shrink-0 shadow-xs",children:e.jsx(Ce,{size:18})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs font-black text-slate-800 tracking-tight group-hover/item:text-teal-900 transition-colors",children:d==="zh"?"查看待办作业":"View Latest Assignments"}),E.length>0&&e.jsxs("span",{className:"text-2xs font-extrabold px-1.5 py-0.2 rounded bg-amber-100 text-amber-800",children:[E.length," ",d==="zh"?"待提交":"pending"]})]}),e.jsx("p",{className:"text-2xs text-slate-500 truncate mt-0.5",children:E.length>0?`${E[0].title} · ${d==="zh"?"未提交":"pending"}`:d==="zh"?"全部作业已完成或待批改":"All assignments submitted"})]})]}),e.jsx(te,{size:16,className:"text-slate-400 group-hover/item:text-teal-600 group-hover/item:translate-x-0.5 transition-all shrink-0"})]}),E.length>0&&e.jsxs("div",{className:"bg-amber-50/70 border border-amber-200/70 rounded-xl p-2.5 flex items-center justify-between text-2xs",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-amber-900 font-semibold truncate mr-2",children:[e.jsx(ae,{size:12,className:"text-amber-600 shrink-0"}),e.jsx("span",{className:"truncate",children:E[0].title})]}),e.jsxs("button",{type:"button",onClick:()=>K(E[0]),className:"px-2 py-1 bg-amber-600 hover:bg-amber-700 text-white rounded-lg font-bold shrink-0 transition-colors cursor-pointer flex items-center gap-1 shadow-2xs",children:[e.jsx("span",{children:d==="zh"?"直接答题":"Open"}),e.jsx(jt,{size:10})]})]}),e.jsxs("div",{id:"qa-action-check-notifications",onClick:()=>n("notifications"),className:"group/item flex items-center justify-between p-3 rounded-xl border border-slate-200/80 bg-slate-50/70 hover:bg-blue-50/60 hover:border-blue-300 transition-all cursor-pointer shadow-3xs",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsxs("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-tr from-blue-500 to-indigo-500 text-white flex items-center justify-center shrink-0 shadow-xs relative",children:[e.jsx(Ee,{size:18}),A.length>0&&e.jsx("span",{className:"absolute -top-1 -right-1 flex h-3 w-3 items-center justify-center rounded-full bg-rose-500 text-white text-[9px] font-black",children:A.length})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs font-black text-slate-800 tracking-tight group-hover/item:text-blue-900 transition-colors",children:d==="zh"?"检查消息与点名":"Check Notifications"}),A.length>0?e.jsx("span",{className:"text-2xs font-extrabold px-1.5 py-0.2 rounded bg-rose-100 text-rose-700 animate-pulse",children:d==="zh"?"提问点名待应答":"Roll Call Alarm"}):e.jsx("span",{className:"text-2xs font-medium text-slate-400",children:d==="zh"?"无未读":"All clear"})]}),e.jsx("p",{className:"text-2xs text-slate-500 truncate mt-0.5",children:A.length>0?d==="zh"?`有 ${A.length} 条课堂点名提问等待回应`:`${A.length} active roll-call alarms`:d==="zh"?"查看历史点名出勤与批改反馈":"View notifications & alerts"})]})]}),e.jsx(te,{size:16,className:"text-slate-400 group-hover/item:text-blue-600 group-hover/item:translate-x-0.5 transition-all shrink-0"})]}),R.length>0&&e.jsxs("div",{className:"flex flex-col gap-2 pt-1 border-t border-slate-100",children:[e.jsx("span",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-wider",children:d==="zh"?"插件扩展指令":"Plugin Actions"}),R.map(m=>m.customRenderer?e.jsx(ve.Fragment,{children:m.customRenderer(m,{activeStudentId:t,lessonId:p?.lesson_id,lang:d,closeMenu:()=>r(!1)})},m.id):e.jsxs("div",{id:`qa-action-plugin-${m.id}`,onClick:()=>V(m),className:`group/item flex items-center justify-between p-3 rounded-xl border border-slate-200/80 bg-slate-50/70 hover:bg-indigo-50/60 hover:border-indigo-300 transition-all cursor-pointer shadow-3xs ${m.disabled?"opacity-50 pointer-events-none":""}`,children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-tr from-indigo-500 to-purple-500 text-white flex items-center justify-center shrink-0 shadow-xs",children:As(m.icon)}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs font-black text-slate-800 tracking-tight group-hover/item:text-indigo-900 transition-colors truncate",children:m.title}),m.badge&&e.jsx("span",{className:`text-[9px] font-extrabold px-1.5 py-0.2 rounded border ${Ls(m.badgeVariant)}`,children:m.badge})]}),m.description&&e.jsx("p",{className:"text-2xs text-slate-500 truncate mt-0.5",children:m.description})]})]}),e.jsx(te,{size:16,className:"text-slate-400 group-hover/item:text-indigo-600 group-hover/item:translate-x-0.5 transition-all shrink-0"})]},m.id))]}),e.jsx(ge,{slot:"student.quick_actions.item",slotProps:{studentId:t,lessonId:p?.lesson_id,lang:d,isCompact:T,closeMenu:()=>r(!1)}}),e.jsx(ge,{slot:"student.quick_actions.action",slotProps:{studentId:t,lang:d,isCompact:T}})]}):e.jsxs("div",{className:"p-3.5 flex flex-col gap-3 max-h-[360px] overflow-y-auto",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-slate-100 pb-2",children:[e.jsxs("span",{className:"text-xs font-bold text-slate-700 flex items-center gap-1.5",children:[e.jsx(Ee,{size:13,className:"text-indigo-600"}),e.jsx("span",{children:d==="zh"?"消息与点名通知清单":"Notifications & Alarms"})]}),e.jsx("button",{type:"button",onClick:()=>n("menu"),className:"text-2xs font-bold text-indigo-600 hover:text-indigo-800 transition-colors cursor-pointer",children:d==="zh"?"返回主菜单":"Back to menu"})]}),A.length>0?e.jsxs("div",{className:"space-y-2",children:[e.jsx("span",{className:"text-2xs font-bold text-rose-600 uppercase tracking-wider",children:d==="zh"?"🔴 紧急课堂点名":"Urgent Roll Calls"}),A.map(m=>e.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/30 rounded-xl p-2.5 flex flex-col gap-2",children:[e.jsx("div",{className:"flex items-start justify-between gap-2",children:e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-bold text-amber-900",children:d==="zh"?"⚡️ 老师向您发起了随堂提问点名":"Teacher Roll Call Alarm"}),e.jsx("div",{className:"text-2xs text-amber-800 mt-0.5",children:m.lesson_title||(d==="zh"?"面授课堂":"Classroom")})]})}),e.jsxs("button",{type:"button",onClick:()=>U(m.id),className:"w-full py-1.5 bg-amber-600 hover:bg-amber-700 text-white rounded-lg text-2xs font-extrabold flex items-center justify-center gap-1 shadow-2xs transition-colors cursor-pointer",children:[e.jsx(Se,{size:12}),e.jsx("span",{children:d==="zh"?"立即确认签到回应":"Confirm Presence"})]})]},m.id))]}):e.jsx("div",{className:"text-center py-6 text-slate-400 text-xs italic",children:d==="zh"?"🎉 太棒了,当前没有未处理的点名与紧急通知":"No unread roll-call alarms."}),e.jsxs("div",{className:"space-y-1.5 border-t border-slate-100 pt-2",children:[e.jsx("span",{className:"text-2xs font-bold text-slate-450 uppercase tracking-wider block",children:d==="zh"?"最新作业评定情况":"Recent Graded Work"}),F.slice(0,3).map(m=>e.jsxs("div",{className:"flex items-center justify-between text-2xs p-2 rounded-lg bg-slate-50 border border-slate-200/60",children:[e.jsx("span",{className:"font-semibold text-slate-700 truncate max-w-[170px]",children:m.title}),m.submission_status==="graded"?e.jsxs("span",{className:"font-bold text-emerald-600 bg-emerald-100/60 px-1.5 py-0.5 rounded",children:[m.score,"%"]}):e.jsx("span",{className:"text-amber-700 bg-amber-100/60 px-1.5 py-0.5 rounded font-medium",children:m.submission_status?"已交":"未交"})]},m.id))]})]}),e.jsxs("div",{className:"px-4 py-2 bg-slate-50 border-t border-slate-100 flex items-center justify-between text-2xs text-slate-450",children:[e.jsx("span",{children:d==="zh"?"快捷键 Esc 退出菜单":"Press Esc to close"}),e.jsx("span",{className:"font-mono text-indigo-600 font-bold",children:"OpenLearn"})]})]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ge,{slot:"student.quick_actions.fab",slotProps:{isCompact:T,isOpen:c,urgentCount:P,screenInfo:u}}),j?j({isCompact:T,isOpen:c,toggle:()=>r(!c),urgentCount:P,screenInfo:u}):e.jsxs("button",{id:"student-quick-actions-fab-btn",type:"button",onClick:()=>r(!c),"data-compact":T?"true":"false","data-is-mobile":u.isMobile?"true":"false",className:`group relative flex items-center justify-center transition-all duration-200 cursor-pointer border border-white/20 shadow-lg hover:shadow-xl active:scale-95 bg-gradient-to-r from-indigo-600 via-indigo-700 to-teal-600 hover:from-indigo-700 hover:to-teal-700 text-white ${T?"w-11 h-11 p-0 rounded-full":"gap-2 px-4 py-3 rounded-full"}`,title:d==="zh"?T?"快捷操作 (点击展开)":"学生快捷操作菜单 (Quick Actions)":T?"Quick Actions":"Student Quick Actions",children:[P>0&&e.jsx("span",{className:`absolute flex items-center justify-center rounded-full bg-rose-500 text-white font-black shadow-sm ring-2 ring-white ${T?"-top-1 -right-1 h-4 w-4 text-[9px]":"-top-1.5 -left-1.5 h-5 w-5 text-[10px]"}`,children:P}),c?e.jsx(_e,{size:18,className:"text-white"}):e.jsx(Me,{size:18,className:"text-amber-300 animate-pulse"}),!T&&e.jsx("span",{className:"text-xs font-extrabold tracking-tight hidden sm:inline-block",children:c?d==="zh"?"关闭指令":"Close":d==="zh"?"快捷指令":"Quick Actions"})]})]})]})}function Ts(s){const{students:t,activeStudentId:a,studentDashboardData:h,readNotifications:i,setReadNotifications:k,addToast:x,lang:o,setSelectedLesson:d,setStudentViewStatus:L,setSelectedAssignment:z,setQuizStudentAnswers:C,setSubAssignmentTab:b}=s,D=`student_dashboard_layout_v2_${a||"default"}`,[f,j]=S.useState(()=>{try{const l=localStorage.getItem(D);if(l){const v=JSON.parse(l);if(Array.isArray(v)&&v.length>0){const A=new Set(v.map(p=>p.id)),E=fe.filter(p=>!A.has(p.id));return[...v,...E]}}}catch{}return fe}),[g,c]=S.useState("default"),[r,w]=S.useState(null),n=S.useCallback(l=>{j(l);try{localStorage.setItem(D,JSON.stringify(l))}catch{}},[D]),y=(l,v)=>{const A=f.map(E=>E.id===l?{...E,size:v}:E);n(A),x?.(o==="zh"?"组件尺寸已调整":"Widget Resized",o==="zh"?`已将组件调整为 ${v} 栅格宽度`:`Widget resized to ${v}`,"info")},N=(l,v)=>{const A=f.findIndex(P=>P.id===l);if(A===-1)return;const E=v==="left"?A-1:A+1;if(E<0||E>=f.length)return;const p=[...f],[R]=p.splice(A,1);p.splice(E,0,R),n(p)},_=l=>{const v=f.map(A=>A.id===l?{...A,collapsed:!A.collapsed}:A);n(v)},$=l=>{const v=f.find(A=>A.id===l);v&&v.collapsed&&_(l)},M=(l,v)=>{w(v),l.dataTransfer.setData("text/plain",v),l.dataTransfer.effectAllowed="move"},u=(l,v)=>{const A=r||l.dataTransfer.getData("text/plain");if(!A||A===v){w(null);return}const E=f.findIndex(R=>R.id===A),p=f.findIndex(R=>R.id===v);if(E!==-1&&p!==-1){const R=[...f],[P]=R.splice(E,1);R.splice(p,0,P),n(R),x?.(o==="zh"?"布局已重排":"Layout Reordered",o==="zh"?"已成功调整组件展示次序并保存":"Widget order updated and saved","success")}w(null)},T=l=>{const v=Ge[l];v&&(c(l),n(v.layout),x?.(o==="zh"?"预设布局已应用":"Preset Applied",o==="zh"?`已切换至「${v.label.zh}」`:`Switched to ${v.label.en}`,"success"))},I=()=>{c("default"),n(fe),x?.(o==="zh"?"已恢复默认布局":"Layout Reset",o==="zh"?"学生仪表盘已重置为标准栅格排版":"Dashboard reset to default grid layout","info")},F=(l,v)=>{switch(l.id){case"quick-stats":return e.jsx(ee,{id:"quick-stats",title:o==="zh"?"学情概览看板 (Quick Stats)":"Learning Quick Stats",subtitle:o==="zh"?"总作业量、平均得分率与出勤概览":"Overview of assignments, score & attendance",icon:e.jsx(Be,{size:18,className:"text-blue-600"}),size:l.size,collapsed:l.collapsed,onResize:A=>y("quick-stats",A),onMoveLeft:()=>N("quick-stats","left"),onMoveRight:()=>N("quick-stats","right"),isFirst:v===0,isLast:v===f.length-1,onToggleCollapse:()=>_("quick-stats"),lang:o,onDragStart:M,onDrop:u,isDragging:r==="quick-stats",children:e.jsx(fs,{studentDashboardData:h})},l.id);case"progress-trends":return e.jsx(ee,{id:"progress-trends",title:o==="zh"?"周度学习进度走势 (Progress Trends)":"Progress Trends",subtitle:o==="zh"?"成绩走势、历史周均分与目标线":"Weekly score trends, targets & analytics",icon:e.jsx(H,{size:18,className:"text-teal-600"}),size:l.size,collapsed:l.collapsed,onResize:A=>y("progress-trends",A),onMoveLeft:()=>N("progress-trends","left"),onMoveRight:()=>N("progress-trends","right"),isFirst:v===0,isLast:v===f.length-1,onToggleCollapse:()=>_("progress-trends"),lang:o,onDragStart:M,onDrop:u,isDragging:r==="progress-trends",children:e.jsx(Je,{assignments:h.assignments,lang:o})},l.id);case"upcoming-assignments":return e.jsx(ee,{id:"upcoming-assignments",title:o==="zh"?"待办与已交作业 (Upcoming Assignments)":"Upcoming Assignments",subtitle:o==="zh"?"包含未交作业提醒、待批改与成绩反馈":"Pending & graded assignments",icon:e.jsx(Ce,{size:18,className:"text-indigo-600"}),size:l.size,collapsed:l.collapsed,onResize:A=>y("upcoming-assignments",A),onMoveLeft:()=>N("upcoming-assignments","left"),onMoveRight:()=>N("upcoming-assignments","right"),isFirst:v===0,isLast:v===f.length-1,onToggleCollapse:()=>_("upcoming-assignments"),lang:o,onDragStart:M,onDrop:u,isDragging:r==="upcoming-assignments",children:e.jsx(ks,{assignments:h.assignments,setSelectedAssignment:z,setStudentViewStatus:L,setQuizStudentAnswers:C,setSubAssignmentTab:b,lang:o})},l.id);case"course-progress":return e.jsx(ee,{id:"course-progress",title:o==="zh"?"课程学习进度 (Course Progress)":"Course Progress",subtitle:o==="zh"?"正在进行的课程完成百分比与快捷进入":"Active courses progression",icon:e.jsx(Ne,{size:18,className:"text-emerald-600"}),size:l.size,collapsed:l.collapsed,onResize:A=>y("course-progress",A),onMoveLeft:()=>N("course-progress","left"),onMoveRight:()=>N("course-progress","right"),isFirst:v===0,isLast:v===f.length-1,onToggleCollapse:()=>_("course-progress"),lang:o,onDragStart:M,onDrop:u,isDragging:r==="course-progress",children:e.jsx(gs,{progress:h.progress,setSelectedLesson:d,setStudentViewStatus:L})},l.id);case"schedules":return e.jsx(ee,{id:"schedules",title:o==="zh"?"课表与出勤日程 (My Schedule)":"Class Schedule & Timetable",subtitle:o==="zh"?"今日授课计划与历史出勤记录":"Daily class timetable & attendance",icon:e.jsx(be,{size:18,className:"text-pink-600"}),size:l.size,collapsed:l.collapsed,onResize:A=>y("schedules",A),onMoveLeft:()=>N("schedules","left"),onMoveRight:()=>N("schedules","right"),isFirst:v===0,isLast:v===f.length-1,onToggleCollapse:()=>_("schedules"),lang:o,onDragStart:M,onDrop:u,isDragging:r==="schedules",children:e.jsx(Ns,{schedules:h.schedules,setSelectedLesson:d,setStudentViewStatus:L})},l.id);case"academic-trajectory":return e.jsx(ee,{id:"academic-trajectory",title:o==="zh"?"长期学业成长轨迹与评定历史":"Academic Growth Trajectory & History",subtitle:o==="zh"?"学期绩点走势、近3月表现与评分时间轴":"Semester grade trends & evaluation timeline",icon:e.jsx(ze,{size:18,className:"text-purple-600"}),size:l.size,collapsed:l.collapsed,onResize:A=>y("academic-trajectory",A),onMoveLeft:()=>N("academic-trajectory","left"),onMoveRight:()=>N("academic-trajectory","right"),isFirst:v===0,isLast:v===f.length-1,onToggleCollapse:()=>_("academic-trajectory"),lang:o,onDragStart:M,onDrop:u,isDragging:r==="academic-trajectory",children:e.jsx(ws,{assignments:h.assignments,lang:o,hideWeeklyTrend:!0})},l.id);case"extension-views":return e.jsx(ee,{id:"extension-views",title:o==="zh"?"扩展应用视图 (Plugin Extensions)":"Plugin Extensions",subtitle:o==="zh"?"由教育插件系统注册的自定义组件":"Custom components from plugin registry",icon:e.jsx(Z,{size:18,className:"text-amber-600"}),size:l.size,collapsed:l.collapsed,onResize:A=>y("extension-views",A),onMoveLeft:()=>N("extension-views","left"),onMoveRight:()=>N("extension-views","right"),isFirst:v===0,isLast:v===f.length-1,onToggleCollapse:()=>_("extension-views"),lang:o,onDragStart:M,onDrop:u,isDragging:r==="extension-views",children:e.jsx(ge,{slot:"student.view",slotProps:{studentId:a}})},l.id);default:return null}};return e.jsxs("div",{className:"space-y-6",children:[e.jsx(hs,{students:t,activeStudentId:a}),e.jsx(us,{studentDashboardData:h,readNotifications:i,setReadNotifications:k,activeStudentId:a,addToast:x,lang:o}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 p-3.5 bg-slate-50 border border-slate-200/80 rounded-2xl shadow-3xs",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-8 h-8 rounded-xl bg-indigo-500/10 text-indigo-600 flex items-center justify-center shrink-0",children:e.jsx(yt,{size:16})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-black text-slate-800 tracking-tight",children:o==="zh"?"模块化自适应栅格工作台":"Modular CSS Grid Dashboard"}),e.jsxs("span",{className:"text-2xs font-bold px-2 py-0.5 rounded-full bg-indigo-50 text-indigo-600 border border-indigo-100",children:[f.length," ",o==="zh"?"个自适应组件":"Widgets"]})]}),e.jsx("p",{className:"text-2xs text-slate-455",children:o==="zh"?"支持自由拖拽排序、切换 1/3~整行 宽度以及一键折叠展开":"Drag to reorder, resize from 1/3 to full width, or collapse widgets"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap w-full sm:w-auto justify-end",children:[e.jsx("div",{className:"flex items-center bg-white p-0.5 rounded-xl border border-slate-200 text-xs font-bold text-slate-600 shadow-3xs",children:Object.entries(Ge).map(([l,v])=>e.jsx("button",{type:"button",onClick:()=>T(l),className:`px-2.5 py-1 rounded-lg transition-all cursor-pointer text-2xs ${g===l?"bg-indigo-600 text-white shadow-2xs font-extrabold":"hover:text-slate-900 text-slate-600"}`,children:o==="zh"?v.label.zh:v.label.en},l))}),e.jsx("button",{type:"button",onClick:I,title:o==="zh"?"恢复默认布局":"Reset to default layout",className:"p-2 text-slate-500 hover:text-indigo-600 hover:bg-white rounded-xl border border-transparent hover:border-slate-200 transition-all cursor-pointer shadow-3xs",children:e.jsx(wt,{size:14})})]})]}),e.jsx("div",{id:"student-dashboard-modular-grid",className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-12 gap-6 items-start",children:f.filter(l=>l.visible).map((l,v)=>F(l,v))}),e.jsx(Ds,{studentDashboardData:h,activeStudentId:a,readNotifications:i,setReadNotifications:k,setSelectedLesson:d,setStudentViewStatus:L,setSelectedAssignment:z,addToast:x,lang:o,onExpandWidget:$})]})}const Ms=S.lazy(()=>Fe(()=>import("./StudentLessonView-CMPqL1ia.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])).then(s=>({default:s.StudentLessonView}))),_s=S.lazy(()=>Fe(()=>import("./StudentAssignmentView-Dn4Bgqr2.js"),__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,10])).then(s=>({default:s.StudentAssignmentView})));function Os(s){const{students:t,activeStudentId:a,isStudentLocked:h=!1,studentViewStatus:i,studentDashboardData:k,readNotifications:x,setReadNotifications:o,addToast:d,lang:L,setSelectedLesson:z,setStudentViewStatus:C,setSelectedAssignment:b,setQuizStudentAnswers:D,setSubAssignmentTab:f,lessons:j,selectedLesson:g,studentFullscreenPanel:c,setStudentFullscreenPanel:r,timelineSegments:w,activeSegmentId:n,setActiveSegmentId:y,localProgressPercent:N,setLocalProgressPercent:_,updateStudentProgress:$,isStudentLessonContentCollapsed:M,setIsStudentLessonContentCollapsed:u,studentLessonTab:T,setStudentLessonTab:I,elements:F,activeRole:l,fetchElements:v,currentVfsParent:A,setCurrentVfsParent:E,vfsNodes:p,studentSelectedCourseware:R,setStudentSelectedCourseware:P,selectedAssignment:G,quizStudentAnswers:q,submitQuizAssignment:K,subAssignmentTab:U}=s;return e.jsx("div",{className:"flex-1 p-6 overflow-y-auto w-full max-w-full space-y-6",children:a?k?e.jsx(S.Suspense,{fallback:e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center min-h-[400px] text-slate-400 gap-3",children:[e.jsx(Re,{className:"w-8 h-8 animate-spin text-indigo-500"}),e.jsx("span",{className:"text-sm font-medium",children:"加载内容中..."})]}),children:i==="lesson"?e.jsx(Ms,{students:t,activeStudentId:a,isStudentLocked:h,setStudentViewStatus:C,setSelectedLesson:z,lessons:j,selectedLesson:g,studentFullscreenPanel:c,setStudentFullscreenPanel:r,timelineSegments:w,lang:L,activeSegmentId:n,setActiveSegmentId:y,localProgressPercent:N,setLocalProgressPercent:_,updateStudentProgress:$,isStudentLessonContentCollapsed:M,setIsStudentLessonContentCollapsed:u,studentLessonTab:T,setStudentLessonTab:I,elements:F,activeRole:l,fetchElements:v,currentVfsParent:A,setCurrentVfsParent:E,vfsNodes:p,studentSelectedCourseware:R,setStudentSelectedCourseware:P,addToast:d}):i==="assignment"&&G?e.jsx(_s,{selectedAssignment:G,setStudentViewStatus:C,setSelectedAssignment:b,quizStudentAnswers:q,submitQuizAssignment:K,subAssignmentTab:U,setSubAssignmentTab:f,setQuizStudentAnswers:D,elements:F,activeRole:l,activeStudentId:a,fetchElements:v}):e.jsx(Ts,{students:t,activeStudentId:a,studentDashboardData:k,readNotifications:x,setReadNotifications:o,addToast:d,lang:L,setSelectedLesson:z,setStudentViewStatus:C,setSelectedAssignment:b,setQuizStudentAnswers:D,setSubAssignmentTab:f})}):e.jsx("div",{className:"flex items-center justify-center h-full text-gray-400",children:e.jsx(Re,{size:32,className:"animate-spin"})}):e.jsxs("div",{className:"bg-surface border border-theme rounded-xl p-12 text-center text-muted flex flex-col items-center justify-center",children:[e.jsx(Nt,{size:48,className:"text-muted/40 mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-main",children:"No Student Selected"}),e.jsx("p",{className:"mt-2 text-sm",children:"Please select a student from the top navigation bar to view their dashboard."})]})})}export{Os as StudentView};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/StudentLessonView-DRwhbGoU.js","assets/vendor-react-B0t7H3hh.js","assets/vendor-utils-m0Urvtws.js","assets/vendor-icons-BRmhY6fg.js","assets/index-BQF_s4QO.js","assets/vendor-pdf-D7rGevI1.js","assets/vendor-motion-BFAPOs-b.js","assets/vendor-pptx-C5-U7ieS.js","assets/vendor-charts-qLbgF1eL.js","assets/index-CvGu7LSj.css","assets/LazyWhiteboard-CFn-1ATp.js","assets/LazyCourseware-DWCx60AO.js","assets/StudentAssignmentView-tQiAv5Xn.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as Fe}from"./vendor-pdf-D7rGevI1.js";import{j as e,R as ve,r as S}from"./vendor-react-B0t7H3hh.js";import{m as B,A as Oe,E as ge}from"./index-BQF_s4QO.js";import{f as Z,e as Xe,B as Ne,ag as ye,ah as H,ai as be,aj as et,ak as tt,m as st,C as ke,w as we,al as Ve,E as rt,am as ze,r as Se,F as ae,an as at,ao as nt,ap as it,N as te,aq as ot,ar as Be,as as qe,o as lt,a8 as dt,q as Ce,at as ct,au as xt,av as mt,aw as ht,b as ut,J as gt,Z as Me,ac as ft,ad as pt,X as _e,ax as bt,A as jt,p as Ee,af as vt,ay as yt,R as wt,U as Nt,z as Re}from"./vendor-icons-BRmhY6fg.js";import{Z as kt,_ as Ke,B as zt,$ as Ue,a as Qe,a0 as St,a1 as Ct,a2 as At,a3 as Lt,a4 as Dt,z as Tt,D as Mt,a5 as _t,a6 as Et,S as Rt,H as Wt,a7 as pe,a8 as $t,a9 as Pt,aa as Gt,ab as It,ac as Ft,ad as Ot}from"./vendor-motion-BFAPOs-b.js";import{a as me,L as je,C as ne,X as ie,Y as oe,b as le,T as de,c as ce,d as Vt,A as Bt,e as qt,B as Kt,f as Ut}from"./vendor-charts-qLbgF1eL.js";import"./vendor-utils-m0Urvtws.js";import"./vendor-pptx-C5-U7ieS.js";function Ae(s){return typeof s=="object"&&!Array.isArray(s)}function He(s,t,a,h){return s==null?[]:typeof s=="string"&&Ae(t)?kt(s,a,h):s instanceof NodeList?Array.from(s):Array.isArray(s)?s.filter(i=>i!=null):[s]}function Qt(s,t,a){return s*(t+1)+a*t}function We(s,t,a,h){return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,s+parseFloat(t)):t==="<"?a:t.startsWith("<")?Math.max(0,a+parseFloat(t.slice(1))):h.get(t)??s}function Ht(s,t,a){for(let h=0;h<s.length;h++){const i=s[h];i.at>t&&i.at<a&&(Ue(s,i),h--)}}function Yt(s,t,a,h,i,k){Ht(s,i,k);for(let x=0;x<t.length;x++)s.push({value:t[x],at:zt(i,k,h[x]),easing:Ke(a,x)})}function Jt(s,t,a=0){const h=t+1+t*a;for(let i=0;i<s.length;i++)s[i]=s[i]/h}function Zt(s,t){return s.at===t.at?s.value===null?1:t.value===null?-1:0:s.at-t.at}const Xt="easeInOut",es=20;function ts(s,{defaultTransition:t={},...a}={},h,i){const k=t.duration||.3,x=new Map,o=new Map,d={},L=new Map;let z=0,C=0,b=0;for(let D=0;D<s.length;D++){const f=s[D];if(typeof f=="string"){L.set(f,C);continue}else if(!Array.isArray(f)){L.set(f.name,We(C,f.at,z,L));continue}let[j,g,c={}]=f;c.at!==void 0&&(C=We(C,c.at,z,L));let r=0;const w=(n,y,N,_=0,$=0)=>{const M=ss(n),{delay:u=0,times:T=St(M),type:I=t.type||"keyframes",repeat:F,repeatType:l,repeatDelay:v=0,...A}=y;let{ease:E=t.ease||"easeOut",duration:p}=y;const R=typeof u=="function"?u(_,$):u,P=M.length,G=Dt(I)?I:i?.[I||"keyframes"];if(P<=2&&G){let V=100;if(P===2&&ns(M)){const O=M[1]-M[0];V=Math.abs(O)}const m={...t,...A};p!==void 0&&(m.duration=Tt(p));const W=Ct(m,V,G);E=W.ease,p=W.duration}p??(p=k);const q=C+R;T.length===1&&T[0]===0&&(T[1]=1);const K=T.length-M.length;if(K>0&&At(T,K),M.length===1&&M.unshift(null),F&&F<es){const V=p>0?v/p:0;p=Qt(p,F,v);const m=[...M],W=[...T];E=Array.isArray(E)?[...E]:[E];const O=[...E],X=l==="reverse"||l==="mirror";let Q=m,Y=O;X&&(Q=[...m].reverse(),l==="reverse"&&(Y=[...O].reverse().map(J=>typeof J=="function"?Lt(J):J)));for(let J=0;J<F;J++){const Le=X&&J%2===0,De=Le?Q:m,Ze=Le?Y:O,Te=(J+1)*(1+V);V>0&&(M.push(M[M.length-1]),T.push(Te),E.push("linear")),M.push(...De);for(let xe=0;xe<De.length;xe++)T.push(W[xe]+Te),E.push(xe===0?"linear":Ke(Ze,xe-1))}Jt(T,F,V)}const U=q+p;Yt(N,M,E,T,q,U),r=Math.max(R+p,r),b=Math.max(U,b)};if(Qe(j)){const n=$e(j,o);w(g,c,Pe("default",n))}else{const n=He(j,g,h,d),y=n.length;for(let N=0;N<y;N++){g=g,c=c;const _=n[N],$=$e(_,o);for(const M in g)w(g[M],rs(c,M),Pe(M,$),N,y)}}z=C,C+=r}return o.forEach((D,f)=>{for(const j in D){const g=D[j];g.sort(Zt);const c=[],r=[],w=[];for(let _=0;_<g.length;_++){const{at:$,value:M,easing:u}=g[_];c.push(M),r.push(Mt(0,b,$)),w.push(u||"easeOut")}r[0]!==0&&(r.unshift(0),c.unshift(c[0]),w.unshift(Xt)),r[r.length-1]!==1&&(r.push(1),c.push(null)),x.has(f)||x.set(f,{keyframes:{},transition:{}});const n=x.get(f);n.keyframes[j]=c;const{type:y,...N}=t;n.transition[j]={...N,duration:b,ease:w,times:r,...a}}}),x}function $e(s,t){return!t.has(s)&&t.set(s,{}),t.get(s)}function Pe(s,t){return t[s]||(t[s]=[]),t[s]}function ss(s){return Array.isArray(s)?s:[s]}function rs(s,t){return s&&s[t]?{...s,...s[t]}:{...s}}const as=s=>typeof s=="number",ns=s=>s.every(as);function is(s){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},a=_t(s)&&!Et(s)?new Rt(t):new Wt(t);a.mount(s),pe.set(s,a)}function os(s){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},a=new $t(t);a.mount(s),pe.set(s,a)}function ls(s,t){return Qe(s)||typeof s=="number"||typeof s=="string"&&!Ae(t)}function Ye(s,t,a,h){const i=[];if(ls(s,t))i.push(Pt(s,Ae(t)&&t.default||t,a&&(a.default||a)));else{if(s==null)return i;const k=He(s,t,h),x=k.length;for(let o=0;o<x;o++){const d=k[o],L=d instanceof Element?is:os;pe.has(d)||L(d);const z=pe.get(d),C={...a};"delay"in C&&typeof C.delay=="function"&&(C.delay=C.delay(o,x)),i.push(...Gt(z,{...t,transition:C},{}))}}return i}function ds(s,t,a){const h=[],i=s.map(x=>{if(Array.isArray(x)&&typeof x[0]=="function"){const o=x[0],d=It(0);return d.on("change",o),x.length===1?[d,[0,1]]:x.length===2?[d,[0,1],x[1]]:[d,x[1],x[2]]}return x});return ts(i,t,a,{spring:Ft}).forEach(({keyframes:x,transition:o},d)=>{h.push(...Ye(d,x,o))}),h}function cs(s){return Array.isArray(s)&&s.some(Array.isArray)}function xs(s={}){const{scope:t,reduceMotion:a,skipAnimations:h}=s;function i(k,x,o){let d=[],L;const z={};if(a!==void 0&&(z.reduceMotion=a),h!==void 0&&(z.skipAnimations=h),cs(k)){const{onComplete:b,...D}=x||{};typeof b=="function"&&(L=b),d=ds(k,{...z,...D},t)}else{const{onComplete:b,...D}=o||{};typeof b=="function"&&(L=b),d=Ye(k,x,{...z,...D},t)}const C=new Ot(d);return L&&C.finished.then(L),t&&(t.animations.push(C),C.finished.then(()=>{Ue(t.animations,C)})),C}return i}const ms=xs();function hs(s){const{students:t,activeStudentId:a}=s;return e.jsxs("div",{className:"flex items-center gap-4 border-b border-gray-200 pb-4",children:[e.jsx("div",{className:"h-16 w-16 bg-indigo-600 rounded-full flex items-center justify-center text-white text-2xl font-bold shadow-lg",children:t.find(h=>h.id===a)?.name.charAt(0).toUpperCase()}),e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-gray-800",children:["Welcome, ",t.find(h=>h.id===a)?.name]}),e.jsx("p",{className:"text-gray-500",children:"Here is your learning summary."})]})]})}function us(s){const{studentDashboardData:t,readNotifications:a,setReadNotifications:h,activeStudentId:i,addToast:k,lang:x}=s,d=(t?.rollcalls||[]).filter(L=>!a.has(L.id));return d.length===0?null:e.jsx("div",{className:"space-y-4",children:d.map(L=>e.jsxs(B.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},className:"bg-amber-500 rounded-2xl p-6 text-white shadow-xl relative overflow-hidden",children:[e.jsx("div",{className:"absolute -right-10 -bottom-10 w-40 h-40 bg-white/10 rounded-full blur-2xl animate-pulse"}),e.jsx("div",{className:"absolute -left-10 -top-10 w-32 h-32 bg-yellow-300/20 rounded-full blur-xl"}),e.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between gap-4 relative z-10",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"p-3 bg-white/20 backdrop-blur-md rounded-xl animate-bounce shrink-0",children:e.jsx(Z,{className:"h-6 w-6 text-yellow-100"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold tracking-tight",children:x==="zh"?"⚡️ 闪电提问点名中,请立即回应!":"⚡️ Active Classroom Roll Call Alarm!"}),e.jsx("p",{className:"text-yellow-50 text-sm mt-1 max-w-xl font-medium",children:x==="zh"?`您刚才在课程"${L.lesson_title||"课堂"}"中被老师随机选中。大屏已同步闪烁您的姓名,请点击右侧按钮确认专注参与!`:`You have been randomly selected by the teacher in lesson "${L.lesson_title||"Class"}". Please click the button to confirm your presence and active attention!`})]})]}),e.jsxs("button",{onClick:async()=>{try{await fetch(`/api/students/${i}/read_notifications`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({notificationId:L.id})}),h(z=>{const C=new Set(z);return C.add(L.id),C}),k(x==="zh"?"已确认参与状态":"Presence confirmed",x==="zh"?"成功!已安全同步并确认在线。":"Successfully synchronized and confirmed active presence.","success")}catch(z){console.error("Failed to acknowledge rollcall",z)}},className:"px-5 py-2.5 bg-slate-900 hover:bg-slate-800 text-white font-bold text-xs uppercase tracking-wider rounded-xl shadow-lg ring-2 ring-white/20 active:scale-95 transition-all flex items-center gap-2 cursor-pointer shrink-0",children:[e.jsx(Xe,{size:14}),e.jsx("span",{children:x==="zh"?"🙋♂️ 我已就位 / 确认听讲":"🙋♂️ Present & Alert"})]})]})]},L.id))})}function gs(s){const{progress:t,setSelectedLesson:a,setStudentViewStatus:h}=s;return e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 shadow-sm flex flex-col",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 flex items-center gap-2",children:[e.jsx(Ne,{size:18,className:"text-teal-500"}),e.jsx("h3",{className:"font-semibold text-gray-800",children:"My Independent Courses"})]}),e.jsx("div",{className:"p-4",children:t&&t.length===0?e.jsx("div",{className:"text-center p-8 text-gray-400 italic text-sm",children:"No courses assigned yet."}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:t?.map(i=>e.jsxs("div",{className:"flex flex-col p-4 rounded-xl border border-gray-100 bg-gray-50 hover:border-teal-200 hover:shadow-sm transition-all focus:outline-none",children:[e.jsxs("div",{className:"flex justify-between items-start mb-3",children:[e.jsx("div",{className:"font-semibold text-gray-800 text-lg",children:i.lesson_title}),i.completed===1&&e.jsx("span",{className:"bg-green-100 text-green-800 text-xs px-1.5 py-0.5 rounded uppercase font-bold",children:"Completed"})]}),e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"flex-1 h-2 bg-gray-200 rounded-full overflow-hidden shrink-0",children:e.jsx("div",{className:`h-full ${i.progress_percent===100?"bg-green-500":"bg-teal-500"}`,style:{width:`${i.progress_percent}%`}})}),e.jsxs("span",{className:"text-xs text-gray-500 font-medium shrink-0",children:[i.progress_percent,"%"]})]}),e.jsx("button",{onClick:()=>{a(i.lesson_id),h("lesson")},className:"w-full flex justify-center items-center gap-2 bg-teal-500 hover:bg-teal-600 text-white px-4 py-2 rounded-lg text-sm font-semibold shadow-sm transition-colors mt-auto",children:i.progress_percent===0?e.jsxs(e.Fragment,{children:[e.jsx(ye,{size:16})," Start Learning"]}):e.jsxs(e.Fragment,{children:[e.jsx(ye,{size:16})," Continue"]})})]},i.lesson_id))})})]})}function he({value:s,duration:t=1}){const[a,h]=ve.useState(0);return ve.useEffect(()=>{const i=ms(a,s,{duration:t,ease:"easeOut",onUpdate:k=>h(Math.round(k))});return()=>i.stop()},[s,t]),e.jsx(e.Fragment,{children:a})}function fs(s){const{studentDashboardData:t}=s;return e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[e.jsxs(B.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.4,delay:.05},className:"bg-white p-4 rounded-xl border border-gray-200 shadow-sm flex flex-col items-center justify-center hover:border-indigo-300 hover:shadow-md transition-all duration-300",children:[e.jsx("span",{className:"text-3xl font-bold text-indigo-600",children:e.jsx(he,{value:t.classes?.length||0})}),e.jsx("span",{className:"text-sm font-medium text-gray-500 mt-1 uppercase tracking-wider text-center select-none",children:"Enrolled Classes"})]}),e.jsxs(B.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.4,delay:.1},className:"bg-white p-4 rounded-xl border border-gray-200 shadow-sm flex flex-col items-center justify-center hover:border-teal-300 hover:shadow-md transition-all duration-300",children:[e.jsx("span",{className:"text-3xl font-bold text-teal-600",children:e.jsx(he,{value:t.assignments?.filter(a=>a.submission_status==="graded").length||0})}),e.jsx("span",{className:"text-sm font-medium text-gray-500 mt-1 uppercase tracking-wider text-center select-none",children:"Completed Assignments"})]}),e.jsxs(B.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.4,delay:.15},className:"bg-white p-4 rounded-xl border border-gray-200 shadow-sm flex flex-col items-center justify-center hover:border-amber-300 hover:shadow-md transition-all duration-300",children:[e.jsx("span",{className:"text-3xl font-bold text-amber-500",children:e.jsx(he,{value:t.assignments?.filter(a=>!a.submission_status).length||0})}),e.jsx("span",{className:"text-sm font-medium text-gray-500 mt-1 uppercase tracking-wider text-center select-none",children:"Pending Assignments"})]}),e.jsxs(B.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.4,delay:.2},className:"bg-white p-4 rounded-xl border border-gray-200 shadow-sm flex flex-col items-center justify-center hover:border-pink-300 hover:shadow-md transition-all duration-300",children:[e.jsx("span",{className:"text-3xl font-bold text-pink-600",children:e.jsx(he,{value:t.schedules?.length||0})}),e.jsx("span",{className:"text-sm font-medium text-gray-500 mt-1 uppercase tracking-wider text-center select-none",children:"Upcoming Lessons"})]})]})}const ps=[{weekKey:"W1",weekLabel:"Week 1",dateRange:"Apr 06 - Apr 12",averageScore:74.5,assignmentsCount:2,highestScore:78,lowestScore:71,targetScore:80,trendDiff:null,status:"average"},{weekKey:"W2",weekLabel:"Week 2",dateRange:"Apr 13 - Apr 19",averageScore:78,assignmentsCount:3,highestScore:82,lowestScore:75,targetScore:80,trendDiff:3.5,status:"good"},{weekKey:"W3",weekLabel:"Week 3",dateRange:"Apr 20 - Apr 26",averageScore:81.5,assignmentsCount:3,highestScore:86,lowestScore:77,targetScore:80,trendDiff:3.5,status:"good"},{weekKey:"W4",weekLabel:"Week 4",dateRange:"Apr 27 - May 03",averageScore:79,assignmentsCount:4,highestScore:84,lowestScore:72,targetScore:80,trendDiff:-2.5,status:"average"},{weekKey:"W5",weekLabel:"Week 5",dateRange:"May 04 - May 10",averageScore:85,assignmentsCount:3,highestScore:90,lowestScore:80,targetScore:80,trendDiff:6,status:"excellent"},{weekKey:"W6",weekLabel:"Week 6",dateRange:"May 11 - May 17",averageScore:88.5,assignmentsCount:4,highestScore:93,lowestScore:84,targetScore:80,trendDiff:3.5,status:"excellent"},{weekKey:"W7",weekLabel:"Week 7",dateRange:"May 18 - May 24",averageScore:91,assignmentsCount:3,highestScore:95,lowestScore:87,targetScore:80,trendDiff:2.5,status:"excellent"},{weekKey:"W8",weekLabel:"Week 8",dateRange:"May 25 - May 31",averageScore:93.5,assignmentsCount:4,highestScore:98,lowestScore:89,targetScore:80,trendDiff:2.5,status:"excellent"}];function Je({assignments:s=[],lang:t="en"}){const[a,h]=S.useState("all"),[i,k]=S.useState("all"),[x,o]=S.useState(!0),[d,L]=S.useState(!0),[z,C]=S.useState(!0),b=S.useMemo(()=>{const c=new Set;return s.forEach(r=>{r.class_name&&c.add(r.class_name)}),Array.from(c)},[s]),{weeklyData:D,isDemoData:f,stats:j}=S.useMemo(()=>{const c=s.filter(p=>p.submission_status==="graded"&&typeof p.score=="number"&&p.score!==null),r=a==="all"?c:c.filter(p=>p.class_name===a);if(r.length<2){if(!z)return{weeklyData:[],isDemoData:!1,stats:{currentAvg:0,highestWeeklyAvg:0,totalSubmissions:0,growthTrend:0,targetMetRate:0}};let p=ps.map((m,W)=>t==="zh"?{...m,weekLabel:`第 ${W+1} 周`}:m);i==="4weeks"?p=p.slice(-4):i==="8weeks"&&(p=p.slice(-8));const R=p.reduce((m,W)=>m+W.assignmentsCount,0),P=p.length>0?p[p.length-1].averageScore:0,G=Math.max(...p.map(m=>m.averageScore)),q=p[0]?.averageScore||P,K=Number((P-q).toFixed(1)),U=p.filter(m=>m.averageScore>=80).length,V=Math.round(U/p.length*100);return{weeklyData:p,isDemoData:!0,stats:{currentAvg:P,highestWeeklyAvg:G,totalSubmissions:R,growthTrend:K,targetMetRate:V}}}const w=[...r].sort((p,R)=>{const P=p.graded_at||p.submitted_at||p.created_at||0,G=R.graded_at||R.submitted_at||R.created_at||0;return P-G}),n=w[0].graded_at||w[0].submitted_at||w[0].created_at||Date.now(),y=10080*60*1e3,N=new Map;w.forEach(p=>{const R=p.graded_at||p.submitted_at||p.created_at||n,P=Math.max(0,Math.floor((R-n)/y)),G=N.get(P)||{scores:[],count:0,minTime:R,maxTime:R};G.scores.push(p.score),G.count+=1,G.minTime=Math.min(G.minTime,R),G.maxTime=Math.max(G.maxTime,R),N.set(P,G)});const _=Array.from(N.keys()).sort((p,R)=>p-R);let $=null;const M=_.map((p,R)=>{const P=N.get(p),G=Number((P.scores.reduce((Q,Y)=>Q+Y,0)/P.scores.length).toFixed(1)),q=Math.max(...P.scores),K=Math.min(...P.scores),U=$!==null?Number((G-$).toFixed(1)):null;$=G;const V=new Date(P.minTime),m=new Date(P.maxTime+8640*60*1e3),W=t==="zh"?`${V.getMonth()+1}月${V.getDate()}日 - ${m.getMonth()+1}月${m.getDate()}日`:`${V.toLocaleDateString("en-US",{month:"short",day:"numeric"})} - ${m.toLocaleDateString("en-US",{month:"short",day:"numeric"})}`,O=G>=85?"excellent":G>=75?"good":G>=60?"average":"needs_work",X=t==="zh"?`第 ${R+1} 周`:`Week ${R+1}`;return{weekKey:`W${R+1}`,weekLabel:X,dateRange:W,averageScore:G,assignmentsCount:P.count,highestScore:q,lowestScore:K,targetScore:80,trendDiff:U,status:O}});let u=M;i==="4weeks"?u=M.slice(-4):i==="8weeks"&&(u=M.slice(-8));const T=u.reduce((p,R)=>p+R.assignmentsCount,0),I=u.length>0?u[u.length-1].averageScore:0,F=u.length>0?Math.max(...u.map(p=>p.averageScore)):0,l=u[0]?.averageScore||I,v=Number((I-l).toFixed(1)),A=u.filter(p=>p.averageScore>=80).length,E=u.length>0?Math.round(A/u.length*100):0;return{weeklyData:u,isDemoData:!1,stats:{currentAvg:I,highestWeeklyAvg:F,totalSubmissions:T,growthTrend:v,targetMetRate:E}}},[s,a,i,t,z]),g={title:t==="zh"?"每周学业进展趋势 (Weekly Progress)":"Weekly Progress Trend",badge:t==="zh"?"阶段成长分析":"Academic Growth",subtitle:t==="zh"?"按周追踪学业平均表现、作业完成密度与目标达成演进曲线":"Track weekly average score trajectory, coursework completion density, and milestone progression over time",classFilter:t==="zh"?"筛选课程:":"Class Filter:",allClasses:t==="zh"?"全学科综合":"All Subjects",scope4:t==="zh"?"最近4周":"Last 4 Weeks",scope8:t==="zh"?"最近8周":"Last 8 Weeks",scopeAll:t==="zh"?"全部学期":"Full Semester",targetLineToggle:t==="zh"?"目标基准线 (80%)":"Target Goal (80%)",demoBadge:t==="zh"?"演示样本数据":"Sample Trend Preview",statCurrent:t==="zh"?"最新周均分":"Current Week Avg",statPeak:t==="zh"?"最高周表现":"Peak Week Avg",statTargetRate:t==="zh"?"达标达标率":"Target Goal Met",statSubmissions:t==="zh"?"统计作业总数":"Completed Works",emptyTitle:t==="zh"?"暂无足够周次的作业评定数据":"Awaiting Weekly Graded Records",emptyDesc:t==="zh"?"当你在不同周次完成作业并获得评分后,系统将自动汇总每周均分并生成学业成长曲线。":"Once your coursework receives weekly evaluations, the progress motor groups them by week to visualize your trajectory.",enableSampleBtn:t==="zh"?"查看演示成长曲线":"Preview Sample Growth Trajectory",tooltipScore:t==="zh"?"周均分":"Weekly Average",tooltipWorks:t==="zh"?"完成作业数":"Completed Tasks",tooltipRange:t==="zh"?"最高/最低":"High / Low"};return e.jsxs("div",{className:"bg-white border border-gray-200 rounded-2xl shadow-sm hover:shadow-md transition-all overflow-hidden flex flex-col font-sans mb-6",id:"weekly-progress-trend-card",children:[e.jsxs("div",{className:"p-5 border-b border-gray-100 bg-linear-to-r from-indigo-50/20 via-white to-sky-50/20 flex flex-col md:flex-row md:items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"p-2.5 bg-indigo-50 text-indigo-600 rounded-xl mt-0.5 shadow-2xs",children:e.jsx(H,{size:20,className:"stroke-[2.5]"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"font-extrabold text-gray-950 text-base flex items-center gap-1.5",children:g.title}),e.jsxs("span",{className:"inline-flex items-center gap-1 bg-indigo-50 text-indigo-700 border border-indigo-200/60 rounded-full px-2 py-0.5 text-xs font-bold",children:[e.jsx(Z,{size:11,className:"text-indigo-500"}),g.badge]}),f&&e.jsxs("span",{className:"inline-flex items-center gap-1 bg-amber-50 text-amber-700 border border-amber-200/60 rounded-full px-2 py-0.5 text-xs font-semibold",children:[e.jsx(be,{size:11}),g.demoBadge]})]}),e.jsx("p",{className:"text-gray-500 text-xs mt-0.5",children:g.subtitle})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2.5 self-start md:self-center",children:[b.length>0&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-xs font-medium text-gray-500 hidden sm:inline",children:g.classFilter}),e.jsxs("select",{value:a,onChange:c=>h(c.target.value),className:"bg-white border border-gray-200 text-xs text-gray-700 font-semibold rounded-lg px-2 py-1.5 focus:outline-none focus:ring-1 focus:ring-indigo-500 shadow-2xs",children:[e.jsx("option",{value:"all",children:g.allClasses}),b.map((c,r)=>e.jsx("option",{value:c,children:c},r))]})]}),e.jsxs("div",{className:"inline-flex p-0.5 bg-gray-100/80 rounded-lg border border-gray-200 text-xs font-medium",children:[e.jsx("button",{onClick:()=>k("4weeks"),className:`px-2.5 py-1 rounded-md transition-all ${i==="4weeks"?"bg-white text-indigo-700 font-bold shadow-2xs":"text-gray-600 hover:text-gray-900"}`,children:g.scope4}),e.jsx("button",{onClick:()=>k("8weeks"),className:`px-2.5 py-1 rounded-md transition-all ${i==="8weeks"?"bg-white text-indigo-700 font-bold shadow-2xs":"text-gray-600 hover:text-gray-900"}`,children:g.scope8}),e.jsx("button",{onClick:()=>k("all"),className:`px-2.5 py-1 rounded-md transition-all ${i==="all"?"bg-white text-indigo-700 font-bold shadow-2xs":"text-gray-600 hover:text-gray-900"}`,children:g.scopeAll})]}),e.jsxs("button",{onClick:()=>o(!x),className:`px-2.5 py-1 text-xs font-semibold rounded-lg border flex items-center gap-1.5 transition-all cursor-pointer ${x?"bg-emerald-50 border-emerald-200 text-emerald-700":"bg-white border-gray-200 text-gray-500 hover:text-gray-800"}`,title:"Toggle 80% Benchmark Line",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${x?"bg-emerald-500":"bg-gray-300"}`}),g.targetLineToggle]})]})]}),e.jsxs("div",{className:"px-5 py-3 border-b border-gray-100 bg-slate-50/40 grid grid-cols-2 sm:grid-cols-4 gap-3.5 select-none",children:[e.jsxs("div",{className:"p-3 bg-white border border-gray-100 rounded-xl shadow-2xs flex flex-col justify-center",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs font-semibold text-gray-500",children:[e.jsx("span",{children:g.statCurrent}),e.jsxs("span",{className:`inline-flex items-center text-xs font-bold ${j.growthTrend>0?"text-emerald-600":j.growthTrend<0?"text-rose-600":"text-gray-500"}`,children:[j.growthTrend>0?e.jsx(et,{size:13}):j.growthTrend<0?e.jsx(tt,{size:13}):e.jsx(st,{size:13}),j.growthTrend>0?`+${j.growthTrend}%`:`${j.growthTrend}%`]})]}),e.jsx("span",{className:"text-xl font-black text-indigo-950 font-mono mt-0.5",children:j.currentAvg>0?`${j.currentAvg}%`:"—"})]}),e.jsxs("div",{className:"p-3 bg-white border border-gray-100 rounded-xl shadow-2xs flex flex-col justify-center",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-500",children:g.statPeak}),e.jsx("span",{className:"text-xl font-black text-emerald-950 font-mono mt-0.5",children:j.highestWeeklyAvg>0?`${j.highestWeeklyAvg}%`:"—"})]}),e.jsxs("div",{className:"p-3 bg-white border border-gray-100 rounded-xl shadow-2xs flex flex-col justify-center",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-500",children:g.statTargetRate}),e.jsx("span",{className:"text-xl font-black text-teal-950 font-mono mt-0.5",children:D.length>0?`${j.targetMetRate}%`:"—"})]}),e.jsxs("div",{className:"p-3 bg-white border border-gray-100 rounded-xl shadow-2xs flex flex-col justify-center",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-500",children:g.statSubmissions}),e.jsx("span",{className:"text-xl font-black text-slate-900 font-mono mt-0.5",children:j.totalSubmissions})]})]}),e.jsx("div",{className:"p-5",children:D.length===0?e.jsxs("div",{className:"text-center py-12 bg-slate-50/50 rounded-xl border border-dashed border-slate-200",children:[e.jsx(ke,{size:32,className:"mx-auto text-slate-300 mb-2"}),e.jsx("h4",{className:"text-gray-800 text-sm font-bold",children:g.emptyTitle}),e.jsx("p",{className:"text-gray-400 text-xs mt-1 px-4 max-w-md mx-auto",children:g.emptyDesc}),e.jsxs("button",{onClick:()=>C(!0),className:"mt-4 px-3.5 py-1.5 bg-indigo-50 hover:bg-indigo-100 text-indigo-700 border border-indigo-200 rounded-lg text-xs font-bold transition-colors inline-flex items-center gap-1.5 cursor-pointer",children:[e.jsx(Z,{size:13}),g.enableSampleBtn]})]}):e.jsx("div",{className:"w-full h-[280px]",children:e.jsx(me,{width:"100%",height:"100%",children:e.jsxs(je,{data:D,margin:{top:15,right:20,left:-20,bottom:5},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"indigoScoreGrad",x1:"0",y1:"0",x2:"1",y2:"0",children:[e.jsx("stop",{offset:"0%",stopColor:"#6366f1"}),e.jsx("stop",{offset:"50%",stopColor:"#818cf8"}),e.jsx("stop",{offset:"100%",stopColor:"#a855f7"})]})}),d&&e.jsx(ne,{strokeDasharray:"3 3",vertical:!1,stroke:"#f1f5f9"}),e.jsx(ie,{dataKey:"weekLabel",tick:{fontSize:11,fill:"#64748b",fontWeight:"bold"},axisLine:{stroke:"#e2e8f0"},tickLine:!1}),e.jsx(oe,{domain:[0,100],ticks:[0,20,40,60,80,100],tick:{fontSize:11,fill:"#64748b",fontWeight:"bold"},axisLine:{stroke:"#e2e8f0"},tickLine:!1,tickFormatter:c=>`${c}%`}),x&&e.jsx(le,{y:80,stroke:"#10b981",strokeDasharray:"4 4",strokeWidth:1.5,label:{value:t==="zh"?"目标 80%":"Target 80%",fill:"#059669",fontSize:10,fontWeight:700,position:"insideTopRight"}}),e.jsx(de,{content:({active:c,payload:r})=>{if(!c||!r||!r.length)return null;const w=r[0].payload;return e.jsxs("div",{className:"bg-slate-900 text-white rounded-xl p-3 shadow-xl border border-slate-700/80 text-xs min-w-[200px] z-50",children:[e.jsxs("div",{className:"flex items-center justify-between pb-1.5 border-b border-slate-800",children:[e.jsx("span",{className:"font-extrabold text-indigo-300",children:w.weekLabel}),e.jsx("span",{className:"text-[11px] text-slate-400 font-mono",children:w.dateRange})]}),e.jsxs("div",{className:"py-2 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-slate-300",children:[g.tooltipScore,":"]}),e.jsxs("span",{className:"font-extrabold text-emerald-400 font-mono text-sm",children:[w.averageScore,"%"]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-slate-300",children:[g.tooltipWorks,":"]}),e.jsx("span",{className:"font-semibold text-slate-200",children:w.assignmentsCount})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-slate-300",children:[g.tooltipRange,":"]}),e.jsxs("span",{className:"text-slate-400 font-mono text-[11px]",children:[w.highestScore,"% / ",w.lowestScore,"%"]})]}),w.trendDiff!==null&&e.jsxs("div",{className:"flex items-center justify-between pt-1 border-t border-slate-800",children:[e.jsxs("span",{className:"text-slate-400",children:[t==="zh"?"较上周变化":"Vs. Previous Week",":"]}),e.jsx("span",{className:`font-bold flex items-center gap-0.5 ${w.trendDiff>0?"text-emerald-400":w.trendDiff<0?"text-rose-400":"text-slate-400"}`,children:w.trendDiff>0?`+${w.trendDiff}%`:`${w.trendDiff}%`})]})]})]})}}),e.jsx(ce,{type:"monotone",dataKey:"averageScore",name:t==="zh"?"周平均得分":"Weekly Average Score",stroke:"url(#indigoScoreGrad)",strokeWidth:3,dot:{r:4.5,fill:"#6366f1",stroke:"#ffffff",strokeWidth:2},activeDot:{r:7,stroke:"#a855f7",strokeWidth:2.5,fill:"#ffffff"},animationDuration:800}),x&&e.jsx(ce,{type:"monotone",dataKey:"targetScore",name:t==="zh"?"学术目标线 (80%)":"Target Benchmark (80%)",stroke:"#10b981",strokeDasharray:"4 4",strokeWidth:1.5,dot:!1}),e.jsx(Vt,{wrapperStyle:{paddingTop:10,fontSize:11},formatter:c=>e.jsx("span",{className:"text-gray-600 font-medium",children:c})})]})})})})]})}function bs({assignments:s=[],lang:t="en"}){const[a,h]=S.useState("all"),[i,k]=S.useState("monotone"),[x,o]=S.useState(!0),[d,L]=S.useState(!0),[z,C]=S.useState(!0),b=S.useMemo(()=>s.filter(r=>r.submission_status==="graded"&&typeof r.score=="number"&&r.score!==null).map(r=>({...r,resolvedScore:r.score,eventTime:r.submitted_at||r.created_at||Date.now()})).sort((r,w)=>r.eventTime-w.eventTime),[s]),D=S.useMemo(()=>{const r=new Map;return b.forEach(w=>{w.class_name&&r.set(w.class_name,w.class_name)}),Array.from(r.values())},[b]),f=S.useMemo(()=>a==="all"?b:b.filter(r=>r.class_name===a),[b,a]),j=S.useMemo(()=>f.map((r,w)=>{const n=r.eventTime?new Date(r.eventTime):null,y=n?n.toLocaleDateString(t==="zh"?"zh-CN":"en-US",{month:"short",day:"numeric"}):`${t==="zh"?"测验":"Quiz"} #${w+1}`,N=n?n.toLocaleDateString(t==="zh"?"zh-CN":"en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}):"N/A";return{id:r.id,index:w+1,title:r.title.replace("MCQ Evaluation: ","").replace("评估: ",""),fullTitle:r.title,score:r.resolvedScore,className:r.class_name,dateLabel:y,fullDateLabel:N,feedback:r.feedback||(t==="zh"?"优秀!继续加油。":"Excellent work! Keep it up.")}}),[f,t]),g=S.useMemo(()=>{if(j.length===0)return{average:0,highest:0,lowest:0,total:0,passingCount:0,passRate:0};const r=j.map(u=>u.score),w=r.reduce((u,T)=>u+T,0),n=Math.round(w/r.length),y=Math.max(...r),N=Math.min(...r),_=r.length,$=r.filter(u=>u>=60).length,M=Math.round($/_*100);return{average:n,highest:y,lowest:N,total:_,passingCount:$,passRate:M}},[j]),c={title:t==="zh"?"学期成绩表现趋势":"Semester Grade Performance Trend",subtitle:t==="zh"?"全学期已评分测验与交互式作业的 chronological 成绩趋势分析":"Chronological grade analysis of graded quizzes and assignments across the semester",classFilter:t==="zh"?"选择班级:":"Class Filter:",allClasses:t==="zh"?"全部班级":"All Classes",chartStyle:t==="zh"?"曲线样式:":"Line Smoothing:",monotone:t==="zh"?"平滑曲线":"Smooth",linear:t==="zh"?"折线":"Straight",averageScore:t==="zh"?"已选平均成绩":"Selected Average",highestScore:t==="zh"?"最高成绩":"Highest Grade",lowestScore:t==="zh"?"最低成绩":"Lowest Grade",passRate:t==="zh"?"及格率":"Passing Rate",gradedCount:t==="zh"?"评阅作业数":"Graded Works",passingBenchmark:t==="zh"?"及格线 (60%)":"Passing Benchmark (60%)",emptyTitle:t==="zh"?"无学期评阅成绩":"No Graded Academic Data Only",emptyDesc:t==="zh"?"当前学期尚未有已评分的测验。当物理、历史或数学老师评估并评定你的白板作业或选择题测试后,由于底层的自适应评估引擎同步,此处会自动渲染出成绩波动趋势。":"You do not have any graded assignments or quizzes yet in this semester. Once teachers complete grading your interactive assignments, your chronological performance trajectory line will outline your academic development.",referenceLines:t==="zh"?"显示辅助线:":"Toggle Reference Lines:",avgLineLabel:t==="zh"?"选区平均":"Current Avg",gridLines:t==="zh"?"网格":"Grid",averageLine:t==="zh"?"平均成绩线":"Average Line",passLine:t==="zh"?"及格基准线":"Passing Benchmark",feedbackTitle:t==="zh"?"名师评语批注:":"Teacher Feedback Remark:"};return b.length===0?e.jsx("div",{className:"bg-white border border-gray-200 rounded-2xl p-8 shadow-sm hover:shadow-md transition-all",children:e.jsxs("div",{className:"max-w-md mx-auto text-center py-8",children:[e.jsx("div",{className:"inline-flex p-3.5 bg-indigo-50 text-indigo-600 rounded-full mb-4",children:e.jsx(we,{className:"w-7 h-7 animate-pulse"})}),e.jsx("h3",{className:"font-bold text-gray-800 text-lg",children:c.emptyTitle}),e.jsx("p",{className:"text-gray-500 text-xs mt-3 leading-relaxed",children:c.emptyDesc})]})}):e.jsxs("div",{className:"bg-white border border-gray-200 rounded-2xl shadow-sm hover:shadow-md transition-all overflow-hidden flex flex-col font-sans",id:"semester-grade-trend-container",children:[e.jsxs("div",{className:"p-5 border-b border-gray-100 bg-gray-50/50 flex flex-col md:flex-row md:items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"p-2.5 bg-indigo-50 text-indigo-600 rounded-xl mt-0.5 shadow-sm",children:e.jsx(H,{size:20,className:"stroke-[2.5]"})}),e.jsxs("div",{children:[e.jsxs("h3",{className:"font-extrabold text-gray-900 text-base flex items-center gap-2",children:[e.jsx("span",{children:c.title}),e.jsxs("span",{className:"inline-flex items-center gap-0.5 bg-emerald-50 text-emerald-700 border border-emerald-100 rounded-full px-2 py-0.5 text-xs font-bold",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 animate-pulse"}),t==="zh"?"学期分析":"Semester Trend"]})]}),e.jsx("p",{className:"text-gray-500 text-xs mt-0.5",children:c.subtitle})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("span",{className:"text-xs font-bold text-gray-500 flex items-center gap-1",children:[e.jsx(Ve,{size:12,className:"text-gray-400"}),c.classFilter]}),e.jsxs("select",{value:a,onChange:r=>h(r.target.value),className:"bg-white border border-gray-200 text-xs text-gray-700 rounded-lg px-2.5 py-1.5 shadow-2xs focus:outline-none focus:ring-1 focus:ring-indigo-500 font-semibold",id:"class-filter-select",children:[e.jsx("option",{value:"all",children:c.allClasses}),D.map((r,w)=>e.jsx("option",{value:r,children:r},w))]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("span",{className:"text-xs font-bold text-gray-500 flex items-center gap-1",children:[e.jsx(rt,{size:12,className:"text-gray-400"}),c.chartStyle]}),e.jsxs("div",{className:"inline-flex border border-gray-200 rounded-lg p-0.5 bg-white shadow-2xs",children:[e.jsx("button",{onClick:()=>k("monotone"),className:`px-2 py-1 text-xs font-bold rounded-md transition-all ${i==="monotone"?"bg-indigo-600 text-white":"text-gray-500 hover:text-gray-800"}`,children:c.monotone}),e.jsx("button",{onClick:()=>k("linear"),className:`px-2 py-1 text-xs font-bold rounded-md transition-all ${i==="linear"?"bg-indigo-600 text-white":"text-gray-500 hover:text-gray-800"}`,children:c.linear})]})]})]})]}),e.jsxs("div",{className:"px-5 py-4 border-b border-gray-100 bg-white grid grid-cols-2 md:grid-cols-5 gap-3.5",children:[e.jsxs("div",{className:"bg-indigo-50/20 border border-indigo-100/40 p-3.5 rounded-xl flex items-center gap-3",children:[e.jsx("div",{className:"p-2.5 bg-indigo-50 text-indigo-600 rounded-lg shadow-2xs",children:e.jsx(H,{size:16})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:c.averageScore}),e.jsxs("div",{className:"text-base font-extrabold text-indigo-950 font-mono mt-0.5",children:[g.average,"%"]})]})]}),e.jsxs("div",{className:"bg-emerald-50/20 border border-emerald-100/40 p-3.5 rounded-xl flex items-center gap-3",children:[e.jsx("div",{className:"p-2.5 bg-emerald-50 text-emerald-600 rounded-lg shadow-2xs",children:e.jsx(ze,{size:16})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:c.highestScore}),e.jsxs("div",{className:"text-base font-extrabold text-emerald-950 font-mono mt-0.5",children:[g.highest,"%"]})]})]}),e.jsxs("div",{className:"bg-rose-50/20 border border-rose-100/40 p-3.5 rounded-xl flex items-center gap-3",children:[e.jsx("div",{className:"p-2.5 bg-rose-50 text-rose-600 rounded-lg shadow-2xs",children:e.jsx(ke,{size:16})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:c.lowestScore}),e.jsxs("div",{className:"text-base font-extrabold text-rose-950 font-mono mt-0.5",children:[g.lowest,"%"]})]})]}),e.jsxs("div",{className:"bg-amber-50/15 border border-amber-100/40 p-3.5 rounded-xl flex items-center gap-3",children:[e.jsx("div",{className:"p-2.5 bg-amber-50 text-amber-600 rounded-lg shadow-2xs",children:e.jsx(Se,{size:16})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:c.passRate}),e.jsxs("div",{className:"text-base font-extrabold text-amber-950 font-mono mt-0.5",children:[g.passRate,"%"]})]})]}),e.jsxs("div",{className:"bg-sky-50/20 border border-sky-100/40 p-3.5 rounded-xl flex items-center gap-3 col-span-2 md:col-span-1",children:[e.jsx("div",{className:"p-2.5 bg-sky-50 text-sky-600 rounded-lg shadow-2xs",children:e.jsx(Ne,{size:16})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:c.gradedCount}),e.jsx("div",{className:"text-base font-extrabold text-sky-950 font-mono mt-0.5",children:g.total})]})]})]}),e.jsxs("div",{className:"p-5 grid grid-cols-1 lg:grid-cols-12 gap-6 items-stretch",children:[e.jsxs("div",{className:"lg:col-span-9 flex flex-col justify-between",id:"semester-grade-chart-wrapper",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 mb-3",children:[e.jsxs("div",{className:"text-xs font-bold text-indigo-900 flex items-center gap-1",children:[e.jsx(be,{size:13,className:"text-indigo-500"}),e.jsx("span",{children:t==="zh"?"学期表现时间轴(按提交时间排序)":"Academic Performance Timeline (Chronological)"})]}),e.jsxs("div",{className:"flex items-center gap-3 text-xs text-gray-600 font-semibold self-end",children:[e.jsx("span",{className:"text-gray-400 text-xs uppercase font-bold",children:c.referenceLines}),e.jsxs("label",{className:"flex items-center gap-1 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:d,onChange:r=>L(r.target.checked),className:"rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"}),e.jsx("span",{children:c.gridLines})]}),e.jsxs("label",{className:"flex items-center gap-1 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:d,onChange:r=>L(r.target.checked),className:"rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"}),e.jsx("span",{children:c.averageLine})]}),e.jsxs("label",{className:"flex items-center gap-1 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:z,onChange:r=>C(r.target.checked),className:"rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"}),e.jsx("span",{children:c.passLine})]})]})]}),e.jsx("div",{className:"h-[280px] w-full bg-slate-50/30 border border-slate-100 p-2.5 rounded-xl shadow-2xs relative",children:j.length===0?e.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-xs text-gray-400 italic",children:t==="zh"?"无该筛选条件下的成绩数据":"No grade data available for this selection"}):e.jsx(me,{width:"100%",height:"100%",children:e.jsxs(je,{data:j,margin:{top:15,right:15,left:-22,bottom:5},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"lineColorGrad",x1:"0",y1:"0",x2:"1",y2:"0",children:[e.jsx("stop",{offset:"0%",stopColor:"#4f46e5"}),e.jsx("stop",{offset:"50%",stopColor:"#8b5cf6"}),e.jsx("stop",{offset:"100%",stopColor:"#ec4899"})]})}),x&&e.jsx(ne,{strokeDasharray:"3 3",vertical:!1,stroke:"#f1f5f9"}),e.jsx(ie,{dataKey:"dateLabel",tick:{fontSize:12,fill:"#64748b",fontWeight:"bold"},axisLine:{stroke:"#e2e8f0"},tickLine:!1}),e.jsx(oe,{domain:[0,100],tick:{fontSize:12,fill:"#64748b",fontWeight:"bold"},axisLine:{stroke:"#e2e8f0"},tickLine:!1}),e.jsx(de,{content:({active:r,payload:w})=>{if(r&&w&&w.length){const n=w[0].payload;return e.jsxs("div",{className:"p-3.5 bg-white/95 border border-indigo-100 rounded-xl shadow-xl max-w-[270px] backdrop-blur-xs transition-all ring-4 ring-indigo-550/10",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-gray-100 pb-1.5 mb-1.5",children:[e.jsxs("span",{className:"text-xs text-gray-450 font-extrabold uppercase font-mono",children:["Quiz #",n.index," · ",n.className]}),e.jsxs("span",{className:"inline-flex items-center bg-indigo-50 text-indigo-700 px-2 py-0.5 rounded-full text-xs font-extrabold font-mono border border-indigo-100 shadow-2xs",children:[n.score,"%"]})]}),e.jsx("p",{className:"text-xs font-black text-slate-800 leading-snug",children:n.fullTitle}),e.jsx("p",{className:"text-xs text-slate-400 mt-1 leading-normal font-medium",children:n.fullDateLabel}),e.jsxs("div",{className:"mt-2 bg-gradient-to-r from-violet-50/50 to-indigo-50/40 p-2 rounded-lg border border-violet-100/50",children:[e.jsx("span",{className:"text-xs font-black text-violet-850 uppercase block tracking-wider mb-0.5",children:c.feedbackTitle}),e.jsxs("p",{className:"text-xs text-slate-700 italic font-sans leading-normal",children:['"',n.feedback,'"']})]})]})}return null}}),z&&e.jsx(le,{y:60,stroke:"#f43f5e",strokeWidth:1,strokeDasharray:"4 4",label:{value:c.passingBenchmark,fill:"#f43f5e",fontSize:12,fontWeight:"bold",position:"top",offset:3}}),d&&g.total>0&&e.jsx(le,{y:g.average,stroke:"#4f46e5",strokeWidth:1,strokeDasharray:"3 3",label:{value:`${c.avgLineLabel} (${g.average}%)`,fill:"#4f46e5",fontSize:12,fontWeight:"bold",position:"bottom",offset:3}}),e.jsx(ce,{type:i,dataKey:"score",stroke:"url(#lineColorGrad)",strokeWidth:3,dot:{r:5,stroke:"#ffffff",strokeWidth:2,fill:"#4f46e5"},activeDot:{r:7,stroke:"#ffffff",strokeWidth:2,fill:"#ec4899"},animationDuration:1e3})]})})})]}),e.jsx("div",{className:"lg:col-span-3 flex flex-col justify-between border-t border-gray-100 lg:border-t-0 lg:border-l lg:border-gray-100 pt-5 lg:pt-0 lg:pl-5",children:e.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[e.jsx("div",{className:"text-xs font-extrabold uppercase text-gray-450 tracking-wider mb-3",children:t==="zh"?"成绩优异榜":"Semester Milestones"}),e.jsx("div",{className:"space-y-2.5 overflow-y-auto max-h-[265px] pr-1 scrollbar-thin",children:j.length===0?e.jsx("div",{className:"text-center p-6 text-xs text-gray-400 italic",children:t==="zh"?"没有评分记录":"No milestone records"}):[...j].sort((r,w)=>w.score-r.score).slice(0,4).map((r,w)=>{const n=w===0;return e.jsxs("div",{className:`p-2.5 rounded-xl border flex items-center justify-between gap-3 transition-colors ${n?"border-yellow-200 bg-yellow-50/35 hover:bg-yellow-50/50":r.score>=80?"border-emerald-100 bg-emerald-50/20 hover:bg-emerald-50/35":"border-slate-100 bg-slate-50/30 hover:bg-slate-50/60"}`,children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.jsx("span",{className:"text-xs font-extrabold px-1.5 py-0.5 rounded uppercase font-mono leading-none tracking-wider bg-white shadow-3xs text-slate-500",children:n?"🏆 TOP":`#${w+1}`}),e.jsx("span",{className:"text-xs text-indigo-600 font-bold max-w-[80px] truncate",title:r.className,children:r.className})]}),e.jsx("h5",{className:"font-extrabold text-xs text-slate-800 leading-snug truncate mt-1",title:r.fullTitle,children:r.title})]}),e.jsxs("div",{className:`px-2 py-1 rounded-lg border font-mono font-bold text-center text-xs shrink-0 shadow-3xs bg-white ${r.score>=85?"text-emerald-700 border-emerald-150":r.score>=60?"text-indigo-700 border-indigo-150":"text-rose-700 border-rose-150"}`,children:[r.score,"%"]})]},r.id)})}),g.total>0&&e.jsx("div",{className:"mt-4 p-3 bg-gradient-to-r from-indigo-500/10 to-purple-500/10 rounded-2xl border border-indigo-100/50 text-xs text-slate-700 leading-relaxed font-medium",children:t==="zh"?e.jsxs(e.Fragment,{children:["在本学期中,你已完成了 ",e.jsx("span",{className:"font-bold text-indigo-805 font-mono",children:g.total})," ","次正式学习质量评测。全科平均通过率为"," ",e.jsxs("span",{className:"font-bold text-emerald-700 font-mono",children:[g.passRate,"%"]}),"。建议继续针对得分低于 60% 的章节进行自主微课回顾和重新作答。"]}):e.jsxs(e.Fragment,{children:["You participated in ",e.jsx("span",{className:"font-bold text-indigo-805 font-mono",children:g.total})," ","scholastic assessments this semester with an average competency score of"," ",e.jsxs("span",{className:"font-bold text-indigo-700 font-mono",children:[g.average,"%"]}),". Your grade profile shows an active rate of ",e.jsxs("span",{className:"font-bold text-teal-700 font-mono",children:[g.passRate,"%"]})," ","above passing grade threshold."]})})]})})]})]})}function js({assignments:s=[],lang:t="en"}){const[a,h]=S.useState("3months"),[i,k]=S.useState("all"),[x,o]=S.useState(!0),[d,L]=S.useState(!0),{filteredAssignments:z,dateRangeLabel:C,stats:b}=S.useMemo(()=>{const f=s.filter(l=>l.submission_status==="graded"&&typeof l.score=="number"&&l.score!==null).map(l=>{const v=l.score,A=l.graded_at||l.submitted_at||l.created_at||Date.now();return{...l,resolvedScore:v,actionTime:A}}).sort((l,v)=>l.actionTime-v.actionTime),j=Date.now(),g=2160*60*60*1e3,c=j-g;let r=f;i!=="all"&&(r=f.filter(l=>l.class_name===i));const w=a==="3months"?r.filter(l=>l.actionTime>=c):r,n=new Date(c).toLocaleDateString(t==="zh"?"zh-CN":"en-US",{month:"short",day:"numeric",year:"numeric"}),y=new Date(j).toLocaleDateString(t==="zh"?"zh-CN":"en-US",{month:"short",day:"numeric",year:"numeric"}),N=t==="zh"?`学段范围: ${n} 至 ${y} (最近 90 天)`:`Date Range: ${n} to ${y} (Last 90 Days)`,_=w.map((l,v)=>{const A=new Date(l.actionTime),E=A.toLocaleDateString(t==="zh"?"zh-CN":"en-US",{month:"short",day:"numeric"}),p=A.toLocaleDateString(t==="zh"?"zh-CN":"en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"});return{id:l.id,index:v+1,title:l.title.replace("MCQ Evaluation: ","").replace("评估: ",""),fullTitle:l.title,score:l.resolvedScore,className:l.class_name,dateLabel:E,fullDateLabel:p,feedback:l.feedback||(t==="zh"?"无":"No comments provided"),gradedAtStr:l.graded_at?new Date(l.graded_at).toLocaleString(t==="zh"?"zh-CN":"en-US"):""}}),$=_.map(l=>l.score),M=$.reduce((l,v)=>l+v,0),u=$.length>0?Math.round(M/$.length):0,T=$.length>0?Math.max(...$):0,I=$.length,F=$.filter(l=>l>=60).length;return{filteredAssignments:_,dateRangeLabel:N,stats:{average:u,highest:T,total:I,passing:F}}},[s,a,i,t]),D=S.useMemo(()=>{const f=new Set;return s.forEach(j=>{j.submission_status==="graded"&&j.class_name&&f.add(j.class_name)}),Array.from(f)},[s]);return e.jsxs("div",{className:"bg-white border border-gray-200 rounded-2xl shadow-sm hover:shadow-md transition-all overflow-hidden flex flex-col font-sans mb-6",id:"three-months-performance-line-chart",children:[e.jsxs("div",{className:"p-5 border-b border-gray-100 bg-linear-to-r from-rose-50/20 via-white to-pink-50/15 flex flex-col md:flex-row md:items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"p-2.5 bg-rose-50 text-rose-600 rounded-xl mt-0.5 shadow-xs",children:e.jsx(ae,{size:20,className:"stroke-[2.5]"})}),e.jsxs("div",{children:[e.jsxs("h3",{className:"font-extrabold text-gray-950 text-base flex items-center gap-2",children:[e.jsx("span",{children:t==="zh"?"近3个月作业成绩分析":"Recent 3-Month Progress Chart"}),e.jsx("span",{className:"inline-flex items-center gap-0.5 bg-rose-50 text-rose-700 border border-rose-100 rounded-full px-2 py-0.5 text-xs font-bold",children:t==="zh"?"90天回顾":"90 Days Review"})]}),e.jsx("p",{className:"text-gray-500 text-xs mt-0.5",children:C})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("span",{className:"text-xs font-bold text-gray-500 flex items-center gap-1",children:[e.jsx(at,{size:12,className:"text-gray-400"}),t==="zh"?"过滤范围:":"Scope:"]}),e.jsxs("div",{className:"inline-flex border border-gray-200 rounded-lg p-0.5 bg-white shadow-2xs",children:[e.jsx("button",{onClick:()=>h("3months"),className:`px-2.5 py-1 text-xs font-bold rounded-md transition-all cursor-pointer ${a==="3months"?"bg-rose-600 text-white":"text-gray-500 hover:text-gray-800"}`,children:t==="zh"?"近 3 个月":"Last 3 Months"}),e.jsx("button",{onClick:()=>h("all"),className:`px-2.5 py-1 text-xs font-bold rounded-md transition-all cursor-pointer ${a==="all"?"bg-rose-600 text-white":"text-gray-500 hover:text-gray-800"}`,children:t==="zh"?"全部记录":"All Graded"})]})]}),D.length>0&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("span",{className:"text-xs font-bold text-gray-500 flex items-center gap-1",children:[e.jsx(Ve,{size:12,className:"text-gray-400"}),t==="zh"?"班级:":"Class:"]}),e.jsxs("select",{value:i,onChange:f=>k(f.target.value),className:"bg-white border border-gray-200 text-xs text-gray-700 rounded-lg px-2 py-1 focus:outline-none focus:ring-1 focus:ring-rose-500 font-semibold shadow-2xs",children:[e.jsx("option",{value:"all",children:t==="zh"?"全部班级":"All Classes"}),D.map((f,j)=>e.jsx("option",{value:f,children:f},j))]})]})]})]}),e.jsxs("div",{className:"px-5 py-3.5 border-b border-gray-100 bg-white grid grid-cols-2 md:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"p-3 bg-rose-50/10 rounded-xl border border-rose-100/30 flex flex-col",children:[e.jsx("span",{className:"text-xs font-bold text-gray-450 uppercase tracking-wider",children:t==="zh"?"平均成绩":"Avg. Score"}),e.jsxs("span",{className:"text-xl font-extrabold text-rose-950 font-mono mt-0.5",children:[b.average,"%"]})]}),e.jsxs("div",{className:"p-3 bg-amber-50/10 rounded-xl border border-amber-100/30 flex flex-col",children:[e.jsx("span",{className:"text-xs font-bold text-gray-450 uppercase tracking-wider",children:t==="zh"?"最高分数":"Peak Score"}),e.jsxs("span",{className:"text-xl font-extrabold text-amber-950 font-mono mt-0.5",children:[b.highest,"%"]})]}),e.jsxs("div",{className:"p-3 bg-indigo-50/10 rounded-xl border border-indigo-100/30 flex flex-col",children:[e.jsx("span",{className:"text-xs font-bold text-gray-450 uppercase tracking-wider",children:t==="zh"?"作业评阅数":"Graded Count"}),e.jsx("span",{className:"text-xl font-extrabold text-indigo-950 font-mono mt-0.5",children:b.total})]}),e.jsxs("div",{className:"p-3 bg-emerald-50/10 rounded-xl border border-emerald-100/30 flex flex-col",children:[e.jsx("span",{className:"text-xs font-bold text-gray-450 uppercase tracking-wider",children:t==="zh"?"及格件数":"Passing Works"}),e.jsx("span",{className:"text-xl font-extrabold text-emerald-950 font-mono mt-0.5",children:b.passing})]})]}),e.jsx("div",{className:"p-5",children:z.length===0?e.jsxs("div",{className:"text-center py-10 bg-slate-50/50 rounded-xl border border-dashed border-slate-200",children:[e.jsx(ke,{size:28,className:"mx-auto text-slate-300 mb-2"}),e.jsx("h4",{className:"text-gray-800 text-xs font-bold",children:t==="zh"?"近3个月没有已评分的作业记录":"No Graded Submissions in the past 3 months"}),e.jsx("p",{className:"text-gray-400 text-xs mt-1 px-4 max-w-sm mx-auto",children:t==="zh"?"暂无符合检索时间窗的评语或测验成绩。您可以点击“全部记录”进行查询,或交办新作业让名师或AI进行极速评分。":'No performance updates were logged during this period. Try switching to "All Graded" to see historic trends, or complete pending tasks now!'})]}):e.jsx("div",{className:"h-[240px] w-full relative",children:e.jsx(me,{width:"100%",height:"100%",children:e.jsxs(je,{data:z,margin:{top:15,right:15,left:-22,bottom:5},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"roseLineGrad",x1:"0",y1:"0",x2:"1",y2:"0",children:[e.jsx("stop",{offset:"0%",stopColor:"#f43f5e"}),e.jsx("stop",{offset:"60%",stopColor:"#ec4899"}),e.jsx("stop",{offset:"100%",stopColor:"#d946ef"})]})}),x&&e.jsx(ne,{strokeDasharray:"3 3",vertical:!1,stroke:"#f1f5f9"}),e.jsx(ie,{dataKey:"dateLabel",tick:{fontSize:12,fill:"#64748b",fontWeight:"bold"},axisLine:{stroke:"#e2e8f0"},tickLine:!1}),e.jsx(oe,{domain:[0,100],tick:{fontSize:12,fill:"#64748b",fontWeight:"bold"},axisLine:{stroke:"#e2e8f0"},tickLine:!1}),e.jsx(de,{content:({active:f,payload:j})=>{if(f&&j&&j.length){const g=j[0].payload;return e.jsxs("div",{className:"p-3 bg-white/95 border border-rose-100 rounded-xl shadow-xl max-w-[260px] backdrop-blur-xs font-sans",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-gray-100 pb-1 mb-1 border-opacity-50",children:[e.jsx("span",{className:"text-xs text-gray-400 font-bold uppercase font-mono",children:g.className}),e.jsxs("span",{className:"inline-flex items-center bg-rose-50 text-rose-700 px-2 py-0.5 rounded-full text-xs font-bold font-mono border border-rose-100",children:[g.score,"%"]})]}),e.jsx("p",{className:"text-xs font-bold text-slate-800 leading-snug",children:g.fullTitle}),e.jsx("p",{className:"text-xs text-slate-400 mt-1",children:g.fullDateLabel}),g.gradedAtStr&&e.jsx("p",{className:"text-xs text-rose-500 font-mono mt-0.5",children:t==="zh"?`测评时间: ${g.gradedAtStr}`:`Reviewed: ${g.gradedAtStr}`}),g.feedback&&e.jsxs("div",{className:"mt-2 bg-rose-50/40 p-1.5 rounded border border-rose-100/50",children:[e.jsx("span",{className:"text-xs font-bold text-rose-800 uppercase block tracking-wider mb-0.5",children:t==="zh"?"随堂反馈意见":"FEEDBACK"}),e.jsxs("p",{className:"text-xs text-slate-600 italic",children:['"',g.feedback,'"']})]})]})}return null}}),d&&b.total>0&&e.jsx(le,{y:b.average,stroke:"#db2777",strokeWidth:1.2,strokeDasharray:"4 4",label:{value:t==="zh"?`近期平均 (${b.average}%)`:`Recent Avg (${b.average}%)`,fill:"#db2777",fontSize:12,fontWeight:"bold",position:"top",offset:3}}),e.jsx(ce,{type:"monotone",dataKey:"score",stroke:"url(#roseLineGrad)",strokeWidth:3.5,dot:{r:5,stroke:"#ffffff",strokeWidth:2,fill:"#ec4899"},activeDot:{r:7,stroke:"#ffffff",strokeWidth:2,fill:"#f43f5e"}})]})})})})]})}function vs({assignments:s=[],lang:t="en"}){const[a,h]=S.useState("all"),[i,k]=S.useState(!0),[x,o]=S.useState(!0),{trajectoryData:d,availableClasses:L,stats:z,trendDirection:C}=S.useMemo(()=>{const D=s.filter(u=>u.submission_status==="graded"&&typeof u.score=="number"&&u.score!==null).map(u=>{const T=u.score,I=u.graded_at||u.submitted_at||u.created_at||Date.now();return{...u,resolvedScore:T,timeVal:I}}).sort((u,T)=>u.timeVal-T.timeVal),f=new Set;D.forEach(u=>{u.class_name&&f.add(u.class_name)});const j=a==="all"?D:D.filter(u=>u.class_name===a);let g=0;const c=j.map((u,T)=>{g+=u.resolvedScore;const I=Math.round(g/(T+1)*10)/10,F=new Date(u.timeVal),l=F.toLocaleDateString(t==="zh"?"zh-CN":"en-US",{month:"short",day:"numeric"}),v=F.toLocaleDateString(t==="zh"?"zh-CN":"en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"});return{id:u.id,index:T+1,title:u.title.replace("MCQ Evaluation: ","").replace("评估: ",""),fullTitle:u.title,score:u.resolvedScore,runningAverage:I,className:u.class_name,dateLabel:l,fullDateLabel:v,feedback:u.feedback||""}}),r=c.length,w=r>0?c[0].runningAverage:0,n=r>0?c[r-1].runningAverage:0,y=Math.round((n-w)*10)/10;let N="stable";y>1.5?N="upward":y<-1.5&&(N="downward");const _=c.map(u=>u.runningAverage),$=_.length>0?Math.max(..._):0,M=_.length>0?Math.min(..._):0;return{trajectoryData:c,availableClasses:Array.from(f),stats:{startingAvg:w,currentAvg:n,growthPercentage:y,peakAvg:$,valleyAvg:M,totalGraded:r},trendDirection:N}},[s,a,t]),b={title:t==="zh"?"学术成长轨迹与平均分演变":"Academic Growth & Cumulative Average Trajectory",subtitle:t==="zh"?"追踪在校作业评分的累积移动平均线,体现核心学力成长趋势":"Tracks cumulative moving average of evaluated coursework to outline long-term proficiency",classFilter:t==="zh"?"班级:":"Class:",allClasses:t==="zh"?"全学科":"All Subjects",statsStart:t==="zh"?"起始基准分":"Base Score",statsCurrent:t==="zh"?"当前累积平均":"Cumulative Avg",statsNet:t==="zh"?"学术增长劲头":"Net Trajectory",statsPeak:t==="zh"?"累积峰值高度":"Trajectory Peak",emptyTitle:t==="zh"?"待评阅作业以构建成长曲线":"Awaiting Data for Growth Map",emptyDesc:t==="zh"?"当你的作业通过评阅且录入成绩后,成长轨迹分析引擎将自动计算每次评分后的全局累积分,从而绘制出能体现学习毅力与知识掌握成熟度的进展曲线。":"Once your work receives evaluations, our trajectory motor calculates a progressive running average to render a true representation of your academic journey.",layerIndividual:t==="zh"?"显示单项原始成绩":"Show Single Assignment Scores",trajLabel:t==="zh"?"学术成长轨迹 (累积平均)":"Academic Growth (Running Avg)",rawLabel:t==="zh"?"单次作业得分":"Single Work Score",recommendationTitle:t==="zh"?"自适应成长评估与建议":"Adaptive Progress Evaluation"};return d.length===0?e.jsx("div",{className:"bg-white border border-gray-200 rounded-2xl p-6 shadow-xs hover:shadow-md transition-all font-sans mb-6",children:e.jsxs("div",{className:"max-w-md mx-auto text-center py-6",children:[e.jsx("div",{className:"inline-flex p-3 bg-rose-50 text-rose-500 rounded-full mb-3",children:e.jsx(nt,{className:"w-6 h-6 animate-spin text-rose-600"})}),e.jsx("h3",{className:"font-extrabold text-gray-900 text-sm",children:b.emptyTitle}),e.jsx("p",{className:"text-gray-400 text-xs mt-2 leading-relaxed",children:b.emptyDesc})]})}):e.jsxs("div",{className:"bg-white border border-gray-200 rounded-2xl shadow-sm hover:shadow-md transition-all overflow-hidden flex flex-col font-sans mb-6",id:"academic-growth-trajectory-card",children:[e.jsxs("div",{className:"p-5 border-b border-gray-100 bg-linear-to-r from-emerald-50/10 via-white to-teal-50/10 flex flex-col md:flex-row md:items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"p-2.5 bg-emerald-50 text-emerald-600 rounded-xl mt-0.5 shadow-2xs",children:e.jsx(H,{size:20,className:"stroke-[2.5]"})}),e.jsxs("div",{children:[e.jsxs("h3",{className:"font-extrabold text-gray-950 text-base flex items-center gap-1.5",children:[e.jsx("span",{children:b.title}),e.jsxs("span",{className:"inline-flex items-center gap-1 bg-emerald-555 bg-emerald-100 text-emerald-800 border border-emerald-200/50 rounded-full px-2 py-0.5 text-xs font-black uppercase",children:[e.jsx(Z,{size:8,className:"animate-spin text-emerald-600"}),t==="zh"?"能力演进":"Trajectory"]})]}),e.jsx("p",{className:"text-gray-500 text-xs mt-0.5",children:b.subtitle})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3 self-center",children:[L.length>0&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs font-bold text-gray-500",children:b.classFilter}),e.jsxs("select",{value:a,onChange:D=>h(D.target.value),className:"bg-white border border-gray-200 text-xs text-gray-700 font-bold rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-1 focus:ring-emerald-500 shadow-2xs",children:[e.jsx("option",{value:"all",children:b.allClasses}),L.map((D,f)=>e.jsx("option",{value:D,children:D},f))]})]}),e.jsxs("button",{onClick:()=>k(!i),className:`px-3 py-1.5 text-xs font-bold rounded-lg border flex items-center gap-1.5 cursor-pointer transition-all ${i?"bg-emerald-50 border-emerald-200 text-emerald-700 font-bold":"bg-white border-gray-200 text-gray-500 hover:text-gray-700"}`,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${i?"bg-emerald-500 animate-pulse":"bg-gray-300"}`}),b.layerIndividual]})]})]}),e.jsxs("div",{className:"px-5 py-3.5 border-b border-gray-100 bg-linear-to-b from-gray-50/30 to-white grid grid-cols-2 md:grid-cols-4 gap-4 select-none",children:[e.jsxs("div",{className:"p-3 bg-white hover:bg-slate-50 border border-gray-100 rounded-xl shadow-3xs flex flex-col justify-center",children:[e.jsx("span",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:b.statsStart}),e.jsxs("span",{className:"text-lg font-black text-slate-800 font-mono mt-0.5",children:[z.startingAvg,"%"]})]}),e.jsxs("div",{className:"p-3 bg-white hover:bg-slate-50 border border-gray-100 rounded-xl shadow-3xs flex flex-col justify-center",children:[e.jsx("span",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:b.statsCurrent}),e.jsxs("span",{className:"text-lg font-black text-emerald-800 font-mono mt-0.5",children:[z.currentAvg,"%"]})]}),e.jsxs("div",{className:"p-3 bg-white hover:bg-slate-50 border border-gray-100 rounded-xl shadow-3xs flex flex-col justify-center",children:[e.jsx("span",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:b.statsNet}),e.jsxs("div",{className:"flex items-center gap-1 mt-0.5",children:[e.jsxs("span",{className:`text-lg font-black font-mono ${z.growthPercentage>=0?"text-emerald-600":"text-red-500"}`,children:[z.growthPercentage>=0?`+${z.growthPercentage}`:z.growthPercentage,"%"]}),z.growthPercentage>0&&e.jsx(H,{size:14,className:"text-emerald-500 shrink-0"}),z.growthPercentage<0&&e.jsx(it,{size:14,className:"text-red-400 shrink-0"})]})]}),e.jsxs("div",{className:"p-3 bg-white hover:bg-slate-50 border border-gray-100 rounded-xl shadow-3xs flex flex-col justify-center",children:[e.jsx("span",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:b.statsPeak}),e.jsxs("span",{className:"text-lg font-black text-rose-800 font-mono mt-0.5",children:[z.peakAvg,"%"]})]})]}),e.jsxs("div",{className:"p-5 grid grid-cols-1 lg:grid-cols-12 gap-6 items-stretch",children:[e.jsx("div",{className:"lg:col-span-9 flex flex-col justify-between",id:"growth-canvas-container",children:e.jsx("div",{className:"h-[250px] w-full relative bg-slate-50/20 border border-slate-100 p-2 rounded-xl",children:e.jsx(me,{width:"100%",height:"100%",children:e.jsxs(je,{data:d,margin:{top:15,right:15,left:-22,bottom:5},children:[e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"growthGrad",x1:"0",y1:"0",x2:"1",y2:"0",children:[e.jsx("stop",{offset:"0%",stopColor:"#10b981"}),e.jsx("stop",{offset:"50%",stopColor:"#06b6d4"}),e.jsx("stop",{offset:"100%",stopColor:"#3b82f6"})]}),e.jsxs("linearGradient",{id:"scoreAuxGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"#94a3b8"}),e.jsx("stop",{offset:"100%",stopColor:"#cbd5e1"})]})]}),x&&e.jsx(ne,{strokeDasharray:"3 3",vertical:!1,stroke:"#f1f5f9"}),e.jsx(ie,{dataKey:"dateLabel",tick:{fontSize:12,fill:"#64748b",fontWeight:"bold"},axisLine:{stroke:"#e2e8f0"},tickLine:!1}),e.jsx(oe,{domain:[0,100],tick:{fontSize:12,fill:"#64748b",fontWeight:"bold"},axisLine:{stroke:"#e2e8f0"},tickLine:!1}),e.jsx(de,{content:({active:D,payload:f})=>{if(D&&f&&f.length){const j=f[0].payload;return e.jsxs("div",{className:"p-3.5 bg-white/95 border border-emerald-100 rounded-xl shadow-xl max-w-[270px] backdrop-blur-xs font-sans",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-slate-100 pb-1.5 mb-1.5",children:[e.jsx("span",{className:"text-xs text-slate-400 font-extrabold uppercase font-mono",children:j.className}),e.jsxs("span",{className:"bg-emerald-50 text-emerald-800 px-2 py-0.5 rounded-full text-xs font-black border border-emerald-100 font-mono",children:[j.runningAverage,"% Avg"]})]}),e.jsx("p",{className:"text-xs font-black text-slate-800 leading-tight",children:j.fullTitle}),e.jsx("p",{className:"text-xs text-slate-400 mt-1",children:j.fullDateLabel}),e.jsxs("div",{className:"mt-2.5 pt-2 border-t border-slate-100 grid grid-cols-2 gap-1.5",children:[e.jsxs("div",{className:"bg-slate-50 p-1 rounded border border-slate-100 text-center",children:[e.jsx("span",{className:"block text-xs text-gray-400 uppercase font-black",children:t==="zh"?"当次得分":"SESS SCORE"}),e.jsxs("span",{className:"text-xs font-bold font-mono text-indigo-700",children:[j.score,"%"]})]}),e.jsxs("div",{className:"bg-emerald-50/50 p-1 rounded border border-emerald-100/50 text-center",children:[e.jsx("span",{className:"block text-xs text-emerald-600 uppercase font-black",children:t==="zh"?"累积移动平均":"RUNNING AVG"}),e.jsxs("span",{className:"text-xs font-black font-mono text-emerald-800",children:[j.runningAverage,"%"]})]})]}),j.feedback&&e.jsx("div",{className:"mt-2 bg-emerald-50/20 p-1.5 rounded-lg border border-emerald-100/30",children:e.jsxs("p",{className:"text-xs text-emerald-800 italic truncate font-sans",children:['"',j.feedback,'"']})})]})}return null}}),e.jsx(ce,{type:"monotone",name:b.trajLabel,dataKey:"runningAverage",stroke:"url(#growthGrad)",strokeWidth:4.5,dot:{r:4,stroke:"#ffffff",strokeWidth:2,fill:"#06b6d4"},activeDot:{r:6,stroke:"#ffffff",strokeWidth:2.5,fill:"#10b981"},animationDuration:1200}),i&&e.jsx(ce,{type:"monotone",name:b.rawLabel,dataKey:"score",stroke:"url(#scoreAuxGrad)",strokeWidth:1.5,strokeDasharray:"4 3",dot:{r:3,stroke:"#f8fafc",strokeWidth:1,fill:"#94a3b8"},activeDot:{r:4,stroke:"#ffffff",strokeWidth:2,fill:"#475569"},animationDuration:800,opacity:.65})]})})})}),e.jsx("div",{className:"lg:col-span-3 flex flex-col justify-between border-t lg:border-t-0 lg:border-l border-gray-100 pt-5 lg:pt-0 lg:pl-5 min-w-0",children:e.jsxs("div",{className:"flex flex-col h-full justify-between",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"text-xs font-extrabold uppercase text-gray-400 tracking-wider flex items-center gap-1 mb-2.5",children:[e.jsx(Z,{size:11,className:"text-emerald-500 shrink-0"}),b.recommendationTitle]}),e.jsxs("div",{className:"p-4 rounded-xl border border-dashed border-gray-200 bg-linear-to-b from-white to-gray-50/30",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2 font-black text-xs",children:[C==="upward"&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-emerald-500 shrink-0 animate-ping"}),e.jsx("span",{className:"text-emerald-700",children:t==="zh"?"学术成长极强":"Excellent Growth"})]}),C==="stable"&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-indigo-400 shrink-0"}),e.jsx("span",{className:"text-indigo-700",children:t==="zh"?"平稳巩固上升":"Steady Progress"})]}),C==="downward"&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-rose-400 shrink-0 shadow-lg animate-pulse"}),e.jsx("span",{className:"text-rose-700",children:t==="zh"?"关注诊断警示":"Diagnostic Alert"})]})]}),e.jsx("p",{className:"text-xs text-gray-650 leading-relaxed font-sans",children:t==="zh"?e.jsxs(e.Fragment,{children:[C==="upward"&&"你的学术成长曲线呈现出非常健康的向上拉升趋势!这表明随着上课次数的增加,你的整体知识体系越来越巩固,学习耐力和答题准确率已经取得了决定性突破。",C==="stable"&&"累积分数轨迹进入成熟的常态化稳定期。这反映出你表现相当均衡稳定。建议在保持住基础大盘的同时,试着探索更具挑战性的选拔赛或是高阶人工智能随堂测验来寻找新的学术突破。",C==="downward"&&"近期累积平均分受某几次偶发失常作业的影响,增长势头有所受挫。请无需气馁,建议你到作业区查看教师留下的批注建议,利用微课复习针对差错进行重新作答。"]}):e.jsxs(e.Fragment,{children:[C==="upward"&&"Your academic trajectory maps a highly competent upward lift. This strongly correlates with refined endurance, improved error resolution over consecutive modules, and a progressive understanding of core material.",C==="stable"&&"Your running average sits in an equilibrium band. Your output exhibits solid consistency. Start aiming for advanced peer reviews or high-level AI topics to challenge your plateau and break into the higher bracket.",C==="downward"&&"The moving average shows a slight descent due to standard deviations in recent assignments. Review the feedback timeline to recalibrate your core subjects and raise your general competency."]})})]})]}),e.jsxs("div",{className:"mt-4 pt-3.5 border-t border-gray-100 space-y-2 select-none",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs font-bold text-gray-450",children:[e.jsx(te,{size:10,className:"text-emerald-500"}),e.jsxs("span",{children:[t==="zh"?"总评测样本数: ":"Assessments count: ",e.jsx("span",{className:"text-slate-800 font-mono",children:z.totalGraded})]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs font-bold text-gray-450",children:[e.jsx(te,{size:10,className:"text-emerald-500"}),e.jsxs("span",{children:[t==="zh"?"学力波动幅度: ":"Fluctuation envelope: ",e.jsxs("span",{className:"text-slate-800 font-mono",children:[(z.peakAvg-z.valleyAvg).toFixed(1),"%"]})]})]})]})]})})]})]})}function ys({assignments:s}){const[t,a]=S.useState("area"),[h,i]=S.useState(null),k=(s||[]).filter(n=>n.submission_status==="graded").sort((n,y)=>(n.submitted_at||0)-(y.submitted_at||0));if(k.length===0)return e.jsx("div",{className:"bg-white border border-gray-200 rounded-xl p-8 hover:shadow-md transition-all",children:e.jsxs("div",{className:"max-w-md mx-auto text-center py-6",children:[e.jsx("div",{className:"inline-flex p-3 bg-indigo-50 text-indigo-600 rounded-full mb-3",children:e.jsx(we,{className:"w-6 h-6 animate-pulse"})}),e.jsx("h3",{className:"font-semibold text-gray-800 text-base",children:"Graded Performance Timeline"}),e.jsx("p",{className:"text-gray-500 text-xs mt-2 leading-relaxed",children:"Your interactive learning timeline and performance chart will generate automatically here once teachers grade your MCQ quizzes or interactive submissions. Complete more tasks to build your historical growth profile!"})]})});const x=k.map(n=>n.score||0),o=Math.max(...x),d=Math.round(x.reduce((n,y)=>n+y,0)/x.length),L=k.length,z=k.filter(n=>(n.score||0)>=70).length,C=Math.round(z/L*100);let b="Solidly Consistent",D="Maintaining stable grades",f=0,j="text-blue-700 border-blue-200 bg-blue-50/50";if(x.length>=2){const n=Math.ceil(x.length/2),y=x.slice(0,n),N=x.slice(x.length%2===0?n:n-1),_=y.reduce((M,u)=>M+u,0)/y.length,$=N.reduce((M,u)=>M+u,0)/N.length;f=Math.round($-_),f>15?(b="Stellar Acceleration",D=`Surging upward by +${f}%!`,j="text-green-800 border-green-300 bg-green-55/60 animate-bounce"):f>3?(b="Steadily Improving",D=`Gained a +${f}% grade boost`,j="text-emerald-700 border-emerald-200 bg-emerald-50/70"):f<-10?(b="Support Recommended",D=`Recent grades dropped by ${f}%`,j="text-rose-700 border-rose-200 bg-rose-50/70"):f<-3?(b="Needs Targeted Review",D=`Slight dip of ${f}% noticed`,j="text-amber-700 border-amber-200 bg-amber-50/70"):(b="Solidly Consistent",D="Maintaining very stable performance",j="text-indigo-700 border-indigo-200 bg-indigo-50/70")}const g=k.map((n,y)=>({index:y,id:n.id,title:n.title.replace("MCQ Evaluation: ","").substring(0,20)+(n.title.length>20?"...":""),fullTitle:n.title,score:n.score||0,className:n.class_name,dateStr:n.submitted_at?new Date(n.submitted_at).toLocaleDateString(void 0,{month:"short",day:"numeric"}):`Quiz #${y+1}`,fullDate:n.submitted_at?new Date(n.submitted_at).toLocaleDateString(void 0,{month:"long",day:"numeric",year:"numeric"}):"N/A",feedback:n.feedback||"Excellent execution!",gradedAt:n.graded_at?new Date(n.graded_at).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):""})),c=h!==null?h:g.length-1,r=g[c];k[c];const w=n=>n>=90?{bg:"bg-green-50 text-green-700 border-green-200",text:"text-green-600",ring:"ring-green-400"}:n>=75?{bg:"bg-blue-50 text-blue-700 border-blue-200",text:"text-blue-600",ring:"ring-blue-400"}:n>=60?{bg:"bg-amber-50 text-amber-700 border-amber-200",text:"text-amber-600",ring:"ring-amber-400"}:{bg:"bg-red-50 text-red-700 border-red-200",text:"text-red-600",ring:"ring-red-400"};return e.jsxs("div",{className:"bg-white border border-gray-200 rounded-2xl shadow-sm overflow-hidden flex flex-col font-sans",children:[e.jsxs("div",{className:"p-4 sm:p-5 border-b border-gray-100 flex flex-col sm:flex-row sm:items-center justify-between gap-3 bg-gray-50/50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-indigo-50 text-indigo-650 rounded-lg",children:e.jsx(H,{size:18,className:"animate-pulse"})}),e.jsxs("div",{children:[e.jsxs("h3",{className:"font-bold text-gray-800 text-sm sm:text-base flex items-center gap-1.5",children:[e.jsx("span",{children:"Performance Analytics & Historical Growth Timeline"}),e.jsxs("span",{className:"text-xs bg-indigo-100 text-indigo-800 font-bold px-1.5 py-0.5 rounded-full inline-flex items-center gap-1",children:[e.jsx(Z,{size:8})," Auto-Updated"]})]}),e.jsx("p",{className:"text-gray-500 text-xs",children:"Track chronological objective proficiency across classes"})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 bg-white p-1 rounded-lg border border-gray-200 self-start sm:self-center",children:[e.jsxs("button",{onClick:()=>a("area"),className:`px-2.5 py-1 text-xs font-semibold rounded-md transition-all flex items-center gap-1 ${t==="area"?"bg-indigo-600 text-white shadow-sm":"text-gray-600 hover:bg-gray-100"}`,children:[e.jsx(ot,{size:12}),e.jsx("span",{children:"Trend Area"})]}),e.jsxs("button",{onClick:()=>a("bar"),className:`px-2.5 py-1 text-xs font-semibold rounded-md transition-all flex items-center gap-1 ${t==="bar"?"bg-indigo-600 text-white shadow-sm":"text-gray-600 hover:bg-gray-100"}`,children:[e.jsx(Be,{size:12}),e.jsx("span",{children:"Bars"})]})]})]}),e.jsxs("div",{className:"p-4 sm:p-6 space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"p-3 bg-indigo-50/40 rounded-xl border border-indigo-100/60 flex items-center gap-2.5",children:[e.jsx("div",{className:"p-2 rounded-lg bg-indigo-100 text-indigo-600",children:e.jsx(H,{size:16})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs uppercase font-bold text-gray-400 tracking-wider",children:"Average"}),e.jsxs("div",{className:"text-lg font-bold text-indigo-950 font-mono",children:[d,"%"]})]})]}),e.jsxs("div",{className:"p-3 bg-emerald-50/40 rounded-xl border border-emerald-100/60 flex items-center gap-2.5",children:[e.jsx("div",{className:"p-2 rounded-lg bg-emerald-100 text-emerald-600",children:e.jsx(ze,{size:16})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs uppercase font-bold text-gray-400 tracking-wider",children:"Highest Score"}),e.jsxs("div",{className:"text-lg font-bold text-emerald-950 font-mono",children:[o,"%"]})]})]}),e.jsxs("div",{className:"p-3 bg-cyan-50/40 rounded-xl border border-cyan-100/60 flex items-center gap-2.5",children:[e.jsx("div",{className:"p-2 rounded-lg bg-cyan-100 text-cyan-600",children:e.jsx(we,{size:16})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs uppercase font-bold text-gray-400 tracking-wider",children:"Completed"}),e.jsxs("div",{className:"text-lg font-bold text-cyan-950 font-mono",children:[L," Quizzes"]})]})]}),e.jsxs("div",{className:"p-3 bg-amber-50/40 rounded-xl border border-amber-100/60 flex items-center gap-2.5",children:[e.jsx("div",{className:"p-2 rounded-lg bg-amber-100 text-amber-600",children:e.jsx(qe,{size:16})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs uppercase font-bold text-gray-400 tracking-wider",children:"Passing Rate"}),e.jsxs("div",{className:"text-lg font-bold text-amber-950 font-mono",children:[C,"%"]})]})]})]}),x.length>=2&&e.jsxs("div",{className:`p-4 rounded-xl border flex flex-col md:flex-row md:items-center justify-between gap-4 transition-all ${j}`,children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"p-2 rounded-lg bg-white/95 text-indigo-650 shrink-0 border border-indigo-100 shadow-xs",children:e.jsx(H,{size:18,className:f>0?"text-emerald-600 animate-pulse":"text-indigo-600"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs uppercase font-bold tracking-wider opacity-75",children:"Learning Curve & Trajectory"}),e.jsxs("h4",{className:"text-sm font-extrabold mt-0.5 flex items-center gap-2 text-slate-900",children:[e.jsx("span",{children:b}),f!==0&&e.jsx("span",{className:`inline-flex items-center text-xs px-2 py-0.5 rounded-full font-bold ${f>0?"bg-emerald-100/80 text-emerald-850 border border-emerald-250":"bg-rose-100/80 text-rose-850 border border-rose-250"}`,children:f>0?`▲ +${f}% Growth`:`▼ ${f}% Drop`})]}),e.jsx("p",{className:"text-xs text-slate-600 mt-1 leading-snug",children:D})]})]}),e.jsxs("div",{className:"text-xs font-semibold px-3 py-2 bg-white/95 rounded-lg shadow-3xs border border-slate-100 text-slate-700 md:self-center",children:[e.jsx("div",{className:"text-slate-400 font-bold uppercase text-xs mb-0.5 tracking-wider",children:"Growth Comparison"}),e.jsxs("span",{className:"font-bold text-indigo-900",children:[Math.round(x.slice(0,Math.ceil(x.length/2)).reduce((n,y)=>n+y,0)/Math.ceil(x.length/2)),"%"]})," ","Earliest Avg",e.jsx("span",{className:"text-slate-400 mx-1",children:"→"}),e.jsxs("span",{className:"font-bold text-emerald-700",children:[Math.round(x.slice(Math.ceil(x.length/2)).reduce((n,y)=>n+y,0)/x.slice(Math.ceil(x.length/2)).length)||x[x.length-1],"%"]})," ","Recent Avg"]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-6 min-h-0",children:[e.jsxs("div",{className:"lg:col-span-8 flex flex-col justify-between",children:[e.jsx("div",{className:"mb-2 text-xs font-semibold uppercase text-gray-400 tracking-wider",children:"Chronological Progress Chart"}),e.jsx("div",{className:"h-[250px] w-full mt-3",children:e.jsx(me,{width:"100%",height:"100%",children:t==="area"?e.jsxs(Bt,{data:g,margin:{top:10,right:10,left:-20,bottom:5},onClick:n=>{n&&typeof n.activeTooltipIndex=="number"&&i(n.activeTooltipIndex)},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"scoreColorGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",stopColor:"#4f46e5",stopOpacity:.25}),e.jsx("stop",{offset:"95%",stopColor:"#4f46e5",stopOpacity:.01})]})}),e.jsx(ne,{strokeDasharray:"3 3",vertical:!1,stroke:"#f1f5f9"}),e.jsx(ie,{dataKey:"dateStr",tick:{fontSize:12,fill:"#64748b"},axisLine:!1,tickLine:!1}),e.jsx(oe,{domain:[0,100],tick:{fontSize:12,fill:"#64748b"},axisLine:!1,tickLine:!1}),e.jsx(de,{cursor:{stroke:"#e2e8f0",strokeWidth:1},content:({active:n,payload:y})=>{if(n&&y&&y.length){const N=y[0].payload,_=c===N.index;return e.jsxs("div",{className:`p-3 bg-white border rounded-xl shadow-xl border-gray-100 max-w-xs transition-all ${_?"ring-2 ring-indigo-500":""}`,children:[e.jsx("p",{className:"text-xs text-gray-400 font-bold uppercase",children:N.fullDate}),e.jsx("p",{className:"text-xs font-bold text-gray-800 leading-snug mt-0.5",children:N.fullTitle}),e.jsxs("div",{className:"flex items-center justify-between gap-4 mt-2",children:[e.jsx("span",{className:"text-xs text-gray-500 bg-gray-50 border px-1.5 py-0.5 rounded font-medium",children:N.className}),e.jsxs("span",{className:"text-xs font-bold text-indigo-600 font-mono",children:[N.score,"%"]})]}),e.jsx("p",{className:"text-xs text-gray-400 italic mt-1 bg-gray-50 p-1 rounded",children:"Click node to pin details below"})]})}return null}}),e.jsx(le,{y:70,stroke:"#cbd5e1",strokeDasharray:"4 4",label:{value:"Passing Benchmark (70%)",fill:"#94a3b8",fontSize:12,position:"top"}}),e.jsx(qt,{type:"monotone",dataKey:"score",stroke:"#4f46e5",strokeWidth:2.5,fillOpacity:1,fill:"url(#scoreColorGrad)",activeDot:{r:6,fill:"#4f46e5",stroke:"#fff",strokeWidth:2}})]}):e.jsxs(Kt,{data:g,margin:{top:10,right:10,left:-20,bottom:5},onClick:n=>{n&&typeof n.activeTooltipIndex=="number"&&i(n.activeTooltipIndex)},children:[e.jsx(ne,{strokeDasharray:"3 3",vertical:!1,stroke:"#f1f5f9"}),e.jsx(ie,{dataKey:"dateStr",tick:{fontSize:12,fill:"#64748b"},axisLine:!1,tickLine:!1}),e.jsx(oe,{domain:[0,100],tick:{fontSize:12,fill:"#64748b"},axisLine:!1,tickLine:!1}),e.jsx(de,{cursor:{fill:"rgba(79, 70, 229, 0.04)"},content:({active:n,payload:y})=>{if(n&&y&&y.length){const N=y[0].payload;return e.jsxs("div",{className:"p-3 bg-white border border-gray-150 rounded-xl shadow-xl max-w-xs",children:[e.jsx("p",{className:"text-xs text-gray-400 font-bold uppercase",children:N.fullDate}),e.jsx("p",{className:"text-xs font-bold text-gray-800 leading-snug mt-0.5",children:N.fullTitle}),e.jsxs("div",{className:"flex items-center justify-between gap-4 mt-2",children:[e.jsx("span",{className:"text-xs text-gray-500 bg-gray-50 border px-1.5 py-0.5 rounded font-medium",children:N.className}),e.jsxs("span",{className:"text-xs font-bold text-indigo-600 font-mono",children:[N.score,"%"]})]})]})}return null}}),e.jsx(le,{y:70,stroke:"#cbd5e1",strokeDasharray:"4 4",label:{value:"Benchmark",fill:"#94a3b8",fontSize:12}}),e.jsx(Ut,{dataKey:"score",fill:"#4f46e5",radius:[4,4,0,0],maxBarSize:45})]})})}),e.jsxs("div",{className:"mt-4 p-3 bg-gray-50 rounded-xl border border-gray-150 text-xs",children:[e.jsxs("div",{className:"flex justify-between items-center mb-1",children:[e.jsxs("span",{className:"font-semibold text-gray-650 flex items-center gap-1",children:[e.jsx(lt,{size:12}),e.jsx("span",{children:"Selected Node Objective Grade Evaluation:"})]}),e.jsxs("span",{className:"text-xs font-mono text-gray-400 font-semibold uppercase",children:["Quiz ",c+1," of ",L]})]}),e.jsxs("div",{className:"flex items-start justify-between gap-3 mt-1.5",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-bold text-gray-850 leading-relaxed text-xs",children:r.fullTitle}),e.jsxs("p",{className:"text-xs text-gray-500 leading-normal flex items-center flex-wrap gap-1.5",children:[e.jsxs("span",{children:[r.className," · Submitted on ",r.fullDate]}),r.gradedAt&&e.jsxs("span",{className:"inline-flex items-center gap-0.5 text-emerald-650 bg-emerald-50 px-1.5 py-0.5 rounded border border-emerald-100 font-medium",children:[e.jsx(ae,{size:10})," Graded: ",r.gradedAt]})]})]}),e.jsxs("div",{className:`px-2.5 py-1 rounded-lg border font-mono font-bold text-center shrink-0 ${w(r.score).bg}`,children:[e.jsx("div",{className:"text-xs uppercase tracking-wider font-bold opacity-75",children:"Score"}),e.jsxs("div",{className:"text-sm font-black leading-none",children:[r.score,"%"]})]})]})]})]}),e.jsxs("div",{className:"lg:col-span-4 flex flex-col",children:[e.jsxs("div",{className:"mb-2 text-xs font-semibold uppercase text-gray-400 tracking-wider flex items-center justify-between",children:[e.jsx("span",{children:"Interactive Evaluation Log"}),e.jsx("span",{className:"text-xs lowercase bg-amber-50 text-amber-700 px-1 py-0.5 rounded border border-amber-100 font-mono",children:"recent first"})]}),e.jsx("div",{className:"flex-1 overflow-y-auto max-h-[300px] lg:max-h-[340px] pr-1.5 space-y-3 scrollbar-thin mt-3",children:e.jsx(Oe,{initial:!1,children:[...g].reverse().map(n=>{const y=c===n.index,N=w(n.score);return e.jsxs(B.div,{onClick:()=>i(n.index),whileHover:{scale:1.01},className:`p-3 rounded-xl border cursor-pointer transition-all ${y?"border-indigo-600 bg-indigo-50/20 ring-2 ring-indigo-100/50 shadow-sm":"border-gray-150 hover:border-gray-300 bg-white hover:bg-gray-50/50"}`,children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.jsxs("span",{className:"text-xs font-bold text-gray-400 font-mono uppercase",children:["#",n.index+1]}),e.jsx("span",{className:"text-xs text-gray-500 font-medium font-sans",children:n.dateStr}),e.jsx("span",{className:"text-xs font-bold text-indigo-700 px-1.5 py-0.5 bg-indigo-50 rounded bg-indigo-50/50 ml-auto border border-indigo-100",children:n.className})]}),e.jsx("h4",{className:"font-bold text-xs text-gray-800 leading-snug line-clamp-1 py-0.5",children:n.fullTitle})]}),e.jsxs("div",{className:`px-1.5 py-0.5 rounded font-bold font-mono text-xs border shrink-0 ${N.bg}`,children:[n.score,"%"]})]}),e.jsx("div",{className:`text-xs text-gray-500 mt-2 bg-gray-50/80 p-1.5 rounded-lg border border-gray-100 ${y?"block":"line-clamp-1"}`,children:e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-start gap-1",children:[e.jsx(dt,{size:10,className:"text-teal-600 shrink-0 mt-0.5"}),e.jsxs("span",{className:"leading-snug text-slate-700 italic",children:['"',n.feedback,'"']})]}),n.gradedAt&&y&&e.jsxs("div",{className:"text-xs text-gray-400 mt-1 flex items-center justify-end gap-0.5 font-mono italic border-t border-gray-250/50 pt-1",children:[e.jsx(ae,{size:9})," Graded: ",n.gradedAt]})]})})]},n.id)})})})]})]})]})]})}function ws(s){const{assignments:t,lang:a,hideWeeklyTrend:h=!1}=s;return e.jsxs(e.Fragment,{children:[!h&&e.jsx(B.div,{initial:{opacity:0,y:15},animate:{opacity:1,y:0},transition:{duration:.5,delay:.05,ease:"easeOut"},children:e.jsx(Je,{assignments:t,lang:a})}),e.jsx(B.div,{initial:{opacity:0,y:15},animate:{opacity:1,y:0},transition:{duration:.5,delay:.1,ease:"easeOut"},children:e.jsx(bs,{assignments:t,lang:a})}),e.jsx(B.div,{initial:{opacity:0,y:15},animate:{opacity:1,y:0},transition:{duration:.5,delay:.2,ease:"easeOut"},children:e.jsx(js,{assignments:t,lang:a})}),e.jsx(B.div,{initial:{opacity:0,y:15},animate:{opacity:1,y:0},transition:{duration:.5,delay:.25,ease:"easeOut"},children:e.jsx(vs,{assignments:t,lang:a})}),e.jsx(B.div,{initial:{opacity:0,y:15},animate:{opacity:1,y:0},transition:{duration:.5,delay:.3,ease:"easeOut"},children:e.jsx(ys,{assignments:t})})]})}function Ns(s){const{schedules:t,setSelectedLesson:a,setStudentViewStatus:h}=s;return e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 shadow-sm flex flex-col",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 flex items-center gap-2",children:[e.jsx(be,{size:18,className:"text-pink-500"}),e.jsx("h3",{className:"font-semibold text-gray-800",children:"My Schedule"})]}),e.jsx("div",{className:"p-4 flex-1",children:t.length===0?e.jsx("div",{className:"text-center p-8 text-gray-400 italic text-sm",children:"No upcoming classes."}):e.jsx("div",{className:"space-y-3",children:t.map(i=>e.jsxs("div",{className:"flex flex-col p-3 rounded-lg border border-pink-100 bg-pink-50/30",children:[e.jsxs("div",{className:"flex justify-between items-start mb-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-gray-800",children:i.lesson_title}),e.jsx("div",{className:"text-xs text-gray-500",children:i.class_name})]}),e.jsx("div",{className:"bg-pink-100 text-pink-700 px-2 py-1 inline-block rounded text-xs font-bold font-mono tracking-tight",children:i.scheduled_date})]}),e.jsxs("div",{className:"flex justify-between items-end mt-2",children:[i.attendance_status?e.jsxs("div",{className:"text-xs text-gray-600 font-medium",children:["Attendance:"," ",e.jsx("span",{className:`uppercase font-bold ${i.attendance_status==="present"?"text-green-600":i.attendance_status==="late"?"text-amber-600":"text-red-600"}`,children:i.attendance_status})]}):e.jsx("div",{className:"text-xs text-gray-400 italic",children:"Attendance not yet recorded."}),e.jsxs("button",{onClick:()=>{a(i.lesson_id),h("lesson")},className:"flex items-center gap-1 bg-pink-500 hover:bg-pink-600 text-white px-3 py-1.5 rounded text-xs font-semibold shadow-sm transition-colors",children:[e.jsx(ye,{size:14})," Join Class"]})]})]},i.id))})})]})}function ks(s){const{assignments:t,setSelectedAssignment:a,setStudentViewStatus:h,setQuizStudentAnswers:i,setSubAssignmentTab:k,lang:x}=s;return e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 shadow-sm flex flex-col",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 flex items-center gap-2",children:[e.jsx(Ce,{size:18,className:"text-indigo-500"}),e.jsx("h3",{className:"font-semibold text-gray-800",children:"My Assignments"})]}),e.jsx("div",{className:"p-4 flex-1",children:t.length===0?e.jsx("div",{className:"text-center p-8 text-gray-400 italic text-sm",children:"No assignments given."}):e.jsx("div",{className:"space-y-3",children:t.map(o=>e.jsxs("div",{className:"flex flex-col p-3 rounded-lg border border-gray-100 bg-gray-50 hover:bg-gray-100 transition-colors",children:[e.jsxs("div",{className:"flex justify-between items-start mb-1",children:[e.jsx("div",{className:"font-semibold text-indigo-900",children:o.title}),!o.submission_status&&e.jsx("span",{className:"bg-amber-100 text-amber-800 text-xs px-1.5 py-0.5 rounded uppercase font-bold",children:"Pending"}),o.submission_status==="submitted"&&e.jsx("span",{className:"bg-blue-100 text-blue-800 text-xs px-1.5 py-0.5 rounded uppercase font-bold",children:"Awaiting Grade"}),o.submission_status==="graded"&&e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 relative group/ast-badge",children:[o.graded_at&&e.jsxs("div",{className:"text-gray-400 hover:text-indigo-600 transition-colors cursor-help p-0.5",children:[e.jsx(ae,{size:11}),e.jsxs("div",{className:"absolute right-0 bottom-full mb-1.5 hidden group-hover/ast-badge:block bg-gray-900 text-white text-xs p-2 rounded-xl shadow-xl z-25 whitespace-nowrap font-sans font-normal normal-case",children:[x==="zh"?`评审反馈时间: ${new Date(o.graded_at).toLocaleString("zh-CN",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}`:`Feedback Hour: ${new Date(o.graded_at).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}`,e.jsx("div",{className:"absolute top-full right-2 -mt-1 border-4 border-transparent border-t-gray-900"})]})]}),e.jsxs("span",{className:"bg-green-100 text-green-800 text-xs px-1.5 py-0.5 rounded uppercase font-bold text-center",children:["Score: ",o.score,"%"]})]})]}),e.jsxs("div",{className:"text-xs text-gray-500 mb-2",children:[o.class_name," · ",e.jsx("span",{className:"text-gray-400 italic",children:o.content})]}),o.submission_status==="graded"&&o.feedback&&e.jsxs("div",{className:"mt-2 bg-green-50 p-2.5 rounded-lg border border-green-100 flex flex-col gap-1 text-xs text-green-800",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-green-100/50 pb-1 mb-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1 font-semibold",children:[e.jsx(Se,{size:13,className:"shrink-0 text-green-600"}),e.jsx("span",{children:x==="zh"?"教师评审意见":"Teacher Feedback"})]}),o.graded_at&&e.jsxs("div",{className:"flex items-center gap-1 text-xs text-green-600 font-mono bg-white/70 px-1.5 py-0.5 rounded border border-green-100/50 relative group/ast-time cursor-help",children:[e.jsx(ae,{size:10,className:"inline"}),e.jsx("span",{children:new Date(o.graded_at).toLocaleDateString(x==="zh"?"zh-CN":"en-US",{month:"short",day:"numeric"})}),e.jsxs("div",{className:"absolute right-0 bottom-full mb-1.5 hidden group-hover/ast-time:block bg-gray-900 text-white text-xs p-2 rounded-lg shadow-xl z-20 whitespace-nowrap font-sans font-normal text-left",children:[x==="zh"?`评审反馈于: ${new Date(o.graded_at).toLocaleString("zh-CN")}`:`Feedback provided on: ${new Date(o.graded_at).toLocaleString("en-US")}`,e.jsx("div",{className:"absolute top-full right-3 -mt-1 border-4 border-transparent border-t-gray-900"})]})]})]}),e.jsx("span",{className:"leading-snug bg-green-50/20 rounded p-1 text-xs text-gray-700 whitespace-pre-wrap",children:o.feedback})]}),!o.submission_status&&e.jsx("div",{className:"mt-2 text-right flex items-center justify-end gap-2",children:e.jsxs("button",{onClick:()=>{a(o),h("assignment"),i({}),k("quiz")},className:"px-3 py-1.5 bg-indigo-100 text-indigo-700 hover:bg-indigo-200 text-xs rounded shadow-sm focus:outline-none transition-colors font-medium flex items-center gap-1.5",children:[e.jsx(ct,{size:14})," Open Canvas"]})}),o.submission_status&&e.jsx("div",{className:"mt-2 text-right",children:e.jsxs("button",{onClick:()=>{if(a(o),h("assignment"),k("quiz"),o.submission_content)try{i(JSON.parse(o.submission_content))}catch{i({})}else i({})},className:"px-3 py-1.5 bg-gray-100 text-gray-700 hover:bg-gray-200 text-xs rounded shadow-sm focus:outline-none transition-colors font-medium flex items-center gap-1.5 ml-auto",children:[e.jsx(qe,{size:14})," View Submission"]})})]},o.id))})})]})}const zs={third:"lg:col-span-4 col-span-1",half:"lg:col-span-6 col-span-1","two-thirds":"lg:col-span-8 col-span-1",full:"lg:col-span-12 col-span-1"},Ss={third:{zh:"1/3 窄栏",en:"1/3 Narrow"},half:{zh:"1/2 半宽",en:"1/2 Half"},"two-thirds":{zh:"2/3 宽栏",en:"2/3 Wide"},full:{zh:"整行全宽",en:"Full Width"}},fe=[{id:"quick-stats",size:"full",visible:!0},{id:"progress-trends",size:"two-thirds",visible:!0},{id:"upcoming-assignments",size:"third",visible:!0},{id:"course-progress",size:"half",visible:!0},{id:"schedules",size:"half",visible:!0},{id:"academic-trajectory",size:"full",visible:!0},{id:"extension-views",size:"full",visible:!0}],Ge={default:{label:{zh:"默认布局 (推荐)",en:"Default (Balanced)"},layout:fe},assignments_focus:{label:{zh:"作业攻坚模式",en:"Assignments Focus"},layout:[{id:"quick-stats",size:"full",visible:!0},{id:"upcoming-assignments",size:"full",visible:!0},{id:"progress-trends",size:"half",visible:!0},{id:"schedules",size:"half",visible:!0},{id:"course-progress",size:"half",visible:!0},{id:"academic-trajectory",size:"half",visible:!0},{id:"extension-views",size:"full",visible:!0}]},analytics_focus:{label:{zh:"学情走势大屏",en:"Progress Trends Focus"},layout:[{id:"progress-trends",size:"full",visible:!0},{id:"quick-stats",size:"full",visible:!0},{id:"academic-trajectory",size:"full",visible:!0},{id:"upcoming-assignments",size:"half",visible:!0},{id:"schedules",size:"half",visible:!0},{id:"course-progress",size:"full",visible:!0},{id:"extension-views",size:"full",visible:!0}]},symmetric_compact:{label:{zh:"双列紧凑并排",en:"Two-Column Compact"},layout:[{id:"quick-stats",size:"full",visible:!0},{id:"progress-trends",size:"half",visible:!0},{id:"upcoming-assignments",size:"half",visible:!0},{id:"course-progress",size:"half",visible:!0},{id:"schedules",size:"half",visible:!0},{id:"academic-trajectory",size:"full",visible:!0},{id:"extension-views",size:"full",visible:!0}]}};function ee({id:s,title:t,subtitle:a,icon:h,size:i,onResize:k,onMoveLeft:x,onMoveRight:o,isFirst:d=!1,isLast:L=!1,collapsed:z=!1,onToggleCollapse:C,lang:b="zh",children:D,onDragStart:f,onDragOver:j,onDrop:g,isDragging:c=!1,headerRightExtra:r}){const[w,n]=S.useState(!1),y=()=>{k({third:"half",half:"two-thirds","two-thirds":"full",full:"half"}[i])},N=zs[i]||"lg:col-span-6 col-span-1";return e.jsxs("div",{id:`widget-${s}`,"data-widget-id":s,"data-widget-size":i,draggable:!0,onDragStart:_=>f?.(_,s),onDragOver:_=>{_.preventDefault(),n(!0),j?.(_)},onDragLeave:()=>n(!1),onDrop:_=>{_.preventDefault(),n(!1),g?.(_,s)},className:`group/widget relative flex flex-col bg-white rounded-2xl border transition-all duration-200 ${N} ${w?"border-indigo-500 ring-2 ring-indigo-500/30 scale-[1.008] shadow-md z-10":c?"opacity-40 border-dashed border-indigo-400":"border-slate-200/90 shadow-2xs hover:shadow-xs hover:border-slate-300"}`,children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-slate-100 bg-slate-50/70 rounded-t-2xl select-none",children:[e.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[e.jsx("div",{className:"cursor-grab active:cursor-grabbing text-slate-400 hover:text-indigo-600 transition-colors p-0.5 rounded hover:bg-slate-200/60",title:b==="zh"?"按住可拖动排序":"Drag to reorder",children:e.jsx(xt,{size:16})}),h&&e.jsx("div",{className:"text-indigo-600 shrink-0",children:h}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h3",{className:"text-sm font-bold text-slate-800 tracking-tight truncate flex items-center gap-2",children:[e.jsx("span",{children:t}),i==="full"&&e.jsx("span",{className:"hidden sm:inline-block text-2xs font-semibold px-1.5 py-0.2 rounded bg-indigo-50 text-indigo-600 border border-indigo-100/80",children:b==="zh"?"全宽":"Full"})]}),a&&e.jsx("p",{className:"text-2xs text-slate-450 truncate",children:a})]})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[r,e.jsxs("div",{className:"hidden sm:flex items-center bg-slate-200/60 p-0.5 rounded-lg border border-slate-200 text-2xs font-bold text-slate-600",children:[e.jsx("button",{type:"button",onClick:()=>k("third"),title:b==="zh"?"缩放为 1/3 窄栏":"Set to 1/3 width",className:`px-1.5 py-0.5 rounded transition-all cursor-pointer ${i==="third"?"bg-white text-indigo-700 shadow-2xs":"hover:text-slate-900"}`,children:"1/3"}),e.jsx("button",{type:"button",onClick:()=>k("half"),title:b==="zh"?"缩放为 1/2 半宽":"Set to 1/2 width",className:`px-1.5 py-0.5 rounded transition-all cursor-pointer ${i==="half"?"bg-white text-indigo-700 shadow-2xs":"hover:text-slate-900"}`,children:"1/2"}),e.jsx("button",{type:"button",onClick:()=>k("two-thirds"),title:b==="zh"?"缩放为 2/3 宽栏":"Set to 2/3 width",className:`px-1.5 py-0.5 rounded transition-all cursor-pointer ${i==="two-thirds"?"bg-white text-indigo-700 shadow-2xs":"hover:text-slate-900"}`,children:"2/3"}),e.jsx("button",{type:"button",onClick:()=>k("full"),title:b==="zh"?"缩放为整行全宽":"Set to full width",className:`px-1.5 py-0.5 rounded transition-all cursor-pointer ${i==="full"?"bg-white text-indigo-700 shadow-2xs":"hover:text-slate-900"}`,children:"Full"})]}),e.jsx("button",{type:"button",onClick:y,title:b==="zh"?`切换尺寸 (当前: ${Ss[i]?.zh})`:`Resize (Current: ${i})`,className:"sm:hidden p-1.5 text-slate-500 hover:text-indigo-600 hover:bg-slate-200/50 rounded-lg transition-colors cursor-pointer",children:e.jsx(mt,{size:14})}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("button",{type:"button",onClick:x,disabled:d,title:b==="zh"?"向前移动卡片":"Move forward",className:"p-1.5 text-slate-500 hover:text-indigo-600 disabled:opacity-30 disabled:pointer-events-none hover:bg-slate-200/50 rounded-lg transition-colors cursor-pointer",children:e.jsx(ht,{size:15})}),e.jsx("button",{type:"button",onClick:o,disabled:L,title:b==="zh"?"向后移动卡片":"Move backward",className:"p-1.5 text-slate-500 hover:text-indigo-600 disabled:opacity-30 disabled:pointer-events-none hover:bg-slate-200/50 rounded-lg transition-colors cursor-pointer",children:e.jsx(te,{size:15})})]}),C&&e.jsx("button",{type:"button",onClick:C,title:z?b==="zh"?"展开卡片":"Expand":b==="zh"?"收起卡片":"Collapse",className:"p-1.5 text-slate-500 hover:text-slate-800 hover:bg-slate-200/50 rounded-lg transition-colors cursor-pointer",children:z?e.jsx(ut,{size:15}):e.jsx(gt,{size:15})})]})]}),!z&&e.jsx("div",{className:"p-4 flex-1 flex flex-col",children:D}),z&&e.jsx("div",{onClick:C,className:"p-3 text-center text-xs font-semibold text-slate-400 hover:text-indigo-600 hover:bg-slate-50 transition-colors cursor-pointer rounded-b-2xl select-none",children:b==="zh"?"卡片已收起 · 点击展开查看完整详情":"Card is collapsed · Click to expand"})]})}class se{constructor(){this.customBreakpoints=new Map,this.subscribers=new Set,this.isListening=!1,this.cachedInfo=null,this.resizeTimer=null,this.handleWindowResize=()=>{this.resizeTimer&&clearTimeout(this.resizeTimer),this.resizeTimer=setTimeout(()=>{const t=this.getSnapshot();this.cachedInfo=t;for(const a of this.subscribers)try{a(t)}catch(h){console.warn("[ScreenResizeObserverManager] Error invoking subscriber:",h)}typeof window<"u"&&window.dispatchEvent(new CustomEvent("openlearn:screen:resize",{detail:t}))},100)}}static getInstance(){return se.instance||(se.instance=new se),se.instance}registerCustomBreakpoint(t,a){return this.customBreakpoints.set(t,a),()=>{this.customBreakpoints.delete(t)}}subscribe(t){this.subscribers.add(t),this.ensureListening();const a=this.getSnapshot();try{t(a)}catch(h){console.warn("[ScreenResizeObserverManager] Error in initial subscriber callback:",h)}return()=>{this.subscribers.delete(t),this.subscribers.size===0&&this.isListening&&this.stopListening()}}evaluateCustomBreakpoints(t,a){const h={};for(const[i,k]of this.customBreakpoints.entries())try{h[i]=k(t,a)}catch{h[i]=!1}return h}getSnapshot(t=768,a=1024){const h=typeof window<"u"?window.innerWidth:1024,i=typeof window<"u"?window.innerHeight:768;return this.calculateInfo(h,i,t,a)}calculateInfo(t,a,h=768,i=1024){const k=t<h,x=t>=h&&t<i,o=t>=i,d=t<640;let L="md";t<640?L="xs":t<768?L="sm":t<1024?L="md":t<1280?L="lg":t<1536?L="xl":L="2xl";const z=t>=a?"landscape":"portrait",C=this.evaluateCustomBreakpoints(t,a);return{width:t,height:a,isMobile:k,isTablet:x,isDesktop:o,isSmallScreen:d,screenSize:L,orientation:z,customMatches:C}}ensureListening(){this.isListening||typeof window>"u"||(this.isListening=!0,window.addEventListener("resize",this.handleWindowResize,{passive:!0}),window.addEventListener("orientationchange",this.handleWindowResize,{passive:!0}))}stopListening(){!this.isListening||typeof window>"u"||(this.isListening=!1,window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("orientationchange",this.handleWindowResize))}}const Ie=se.getInstance();function Cs(s={}){const{mobileBreakpoint:t=768,tabletBreakpoint:a=1024,debounceMs:h=100,initialWidth:i,initialHeight:k,onResize:x,onMobileEnter:o,onMobileLeave:d}=s,L=()=>{const g=typeof i=="number"?i:typeof window<"u"?window.innerWidth:1024,c=typeof k=="number"?k:typeof window<"u"?window.innerHeight:768;return Ie.calculateInfo(g,c,t,a)},[z,C]=S.useState(L),b=S.useRef(z.isMobile),D=S.useRef(x),f=S.useRef(o),j=S.useRef(d);return D.current=x,f.current=o,j.current=d,S.useEffect(()=>{if(typeof window>"u")return;let g=null;const c=()=>{const w=window.innerWidth,n=window.innerHeight,y=Ie.calculateInfo(w,n,t,a);C(y),D.current?.(y),!b.current&&y.isMobile?f.current?.(y):b.current&&!y.isMobile&&j.current?.(y),b.current=y.isMobile},r=()=>{h<=0?c():(g&&clearTimeout(g),g=setTimeout(c,h))};return window.addEventListener("resize",r,{passive:!0}),window.addEventListener("orientationchange",r,{passive:!0}),c(),()=>{g&&clearTimeout(g),window.removeEventListener("resize",r),window.removeEventListener("orientationchange",r)}},[t,a,h]),z}class re{constructor(){this.actions=new Map,this.listeners=new Set,this.compactModeListeners=new Set,this.isCompact=!1}static getInstance(){return re.instance||(re.instance=new re),re.instance}registerAction(t){return this.actions.set(t.id,t),this.notifyActionChange(),()=>{this.unregisterAction(t.id)}}unregisterAction(t){this.actions.delete(t)&&this.notifyActionChange()}getActions(){return Array.from(this.actions.values()).sort((t,a)=>(a.priority??0)-(t.priority??0))}subscribe(t){this.listeners.add(t);try{t(this.getActions())}catch(a){console.warn("[StudentQuickActionsRegistry] Subscriber initial call failed:",a)}return()=>{this.listeners.delete(t)}}setCompactMode(t){if(this.isCompact!==t){this.isCompact=t;for(const a of this.compactModeListeners)try{a(t)}catch(h){console.warn("[StudentQuickActionsRegistry] Compact listener error:",h)}}}getCompactMode(){return this.isCompact}onCompactModeChange(t){return this.compactModeListeners.add(t),()=>{this.compactModeListeners.delete(t)}}collapseMenu(t="programmatic"){typeof window<"u"&&window.dispatchEvent(new CustomEvent("openlearn:student_quick_actions:collapse",{detail:{reason:t}}))}openMenu(){typeof window<"u"&&window.dispatchEvent(new CustomEvent("openlearn:student_quick_actions:open"))}notifyActionChange(){const t=this.getActions();for(const a of this.listeners)try{a(t)}catch(h){console.warn("[StudentQuickActionsRegistry] Listener error:",h)}typeof window<"u"&&window.dispatchEvent(new CustomEvent("openlearn:student_quick_actions:changed",{detail:{actions:t}}))}}const ue=re.getInstance();function As(s){if(!s)return e.jsx(Z,{size:18});if(typeof s!="string")return s;const t=vt[s];return t?e.jsx(t,{size:18}):e.jsx("span",{className:"text-sm font-bold",children:s})}function Ls(s){switch(s){case"rose":return"bg-rose-100 text-rose-700 border-rose-200";case"amber":return"bg-amber-100 text-amber-800 border-amber-200";case"emerald":return"bg-emerald-100 text-emerald-800 border-emerald-200";case"blue":return"bg-blue-100 text-blue-700 border-blue-200";case"slate":return"bg-slate-100 text-slate-700 border-slate-200";case"indigo":default:return"bg-indigo-100 text-indigo-700 border-indigo-200"}}function Ds({studentDashboardData:s,activeStudentId:t,readNotifications:a,setReadNotifications:h,setSelectedLesson:i,setStudentViewStatus:k,setSelectedAssignment:x,addToast:o,lang:d="zh",onExpandWidget:L,compactMode:z,autoCollapseOnMobile:C=!0,mobileBreakpoint:b=768,pluginActions:D,onCompactChange:f,customFabRenderer:j,enablePluginRegistry:g=!0}){const[c,r]=S.useState(!1),[w,n]=S.useState("menu"),[y,N]=S.useState(null),[_,$]=S.useState([]),M=S.useRef(null),u=Cs({mobileBreakpoint:b,debounceMs:50,onMobileEnter:()=>{C&&(r(!1),ue.collapseMenu("auto_collapse_on_mobile_enter"))}}),T=S.useMemo(()=>typeof z=="boolean"?z:y!==null?y:u.isMobile,[z,y,u.isMobile]);S.useEffect(()=>{f?.(T),ue.setCompactMode(T),typeof window<"u"&&window.dispatchEvent(new CustomEvent("openlearn:student_quick_actions:compact_changed",{detail:{isCompact:T,isMobile:u.isMobile,width:u.width,height:u.height}}))},[T,u.isMobile,u.width,u.height,f]),S.useEffect(()=>g?ue.subscribe(W=>{$(W)}):void 0,[g]),S.useEffect(()=>{const m=()=>r(!1),W=()=>r(!0),O=()=>N(Q=>Q===null?!u.isMobile:!Q),X=Q=>{const Y=Q;Y.detail&&Y.detail.id&&ue.registerAction(Y.detail)};return window.addEventListener("openlearn:student_quick_actions:collapse",m),window.addEventListener("openlearn:student_quick_actions:open",W),window.addEventListener("openlearn:student_quick_actions:toggle_compact",O),window.addEventListener("openlearn:student_quick_action:register",X),()=>{window.removeEventListener("openlearn:student_quick_actions:collapse",m),window.removeEventListener("openlearn:student_quick_actions:open",W),window.removeEventListener("openlearn:student_quick_actions:toggle_compact",O),window.removeEventListener("openlearn:student_quick_action:register",X)}},[u.isMobile]);const I=s?.schedules||[],F=s?.assignments||[],l=s?.rollcalls||[],v=s?.progress||[],A=S.useMemo(()=>l.filter(m=>!a.has(m.id)),[l,a]),E=S.useMemo(()=>F.filter(m=>!m.submission_status),[F]),p=S.useMemo(()=>I.length>0?I.find(m=>m.attendance_status==="present"||m.status==="scheduled")||I[0]:v.length>0?{lesson_id:v[0].lesson_id,lesson_title:v[0].lesson_title,class_name:d==="zh"?"正在进行的课程":"In-progress course"}:null,[I,v,d]),R=S.useMemo(()=>{const m=new Map;for(const W of _)m.set(W.id,W);if(D)for(const W of D)m.set(W.id,W);return Array.from(m.values()).filter(W=>!(W.visibleOnMobile===!1&&T)).sort((W,O)=>(O.priority??0)-(W.priority??0))},[_,D,T]),P=A.length+E.length+(p?1:0);S.useEffect(()=>{function m(W){M.current&&!M.current.contains(W.target)&&r(!1)}return c&&document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m)}},[c]),S.useEffect(()=>{function m(W){W.key==="Escape"&&c&&r(!1)}return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[c]);const G=()=>{const m=p?.lesson_id||(v[0]?.lesson_id??null);m?(i(m),k("lesson"),r(!1),o?.(d==="zh"?"已进入面授课堂":"Joining Live Session",d==="zh"?`已成功接入「${p?.lesson_title||"面授课程"}」实时白板与互动系统`:`Connected to "${p?.lesson_title||"Classroom"}"`,"success")):o?.(d==="zh"?"暂无可接入的课堂":"No Live Session",d==="zh"?"当前暂无正在进行的课节,请查看课表安排":"No ongoing classroom session scheduled","info")},q=()=>{r(!1),L?.("upcoming-assignments");const m=document.getElementById("widget-upcoming-assignments");m?(m.scrollIntoView({behavior:"smooth",block:"center"}),m.classList.add("ring-4","ring-indigo-500/40"),setTimeout(()=>{m.classList.remove("ring-4","ring-indigo-500/40")},2e3)):E.length>0&&(x(E[0]),k("assignment"))},K=m=>{x(m),k("assignment"),r(!1)},U=async m=>{try{t&&await fetch(`/api/students/${t}/read_notifications`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({notificationId:m})})}catch{}h(W=>{const O=new Set(W);return O.add(m),O}),o?.(d==="zh"?"点名确认成功":"Roll Call Confirmed",d==="zh"?"已向教师端大屏同步您的参与状态":"Attendance signal sent to teacher","success")},V=m=>{if(!m.disabled){if(r(!1),m.onClick)m.onClick({activeStudentId:t,lessonId:p?.lesson_id,assignments:F,schedules:I,rollcalls:l,lang:d});else if(m.commandType)try{window.openlearn?.commandBus?.execute({type:m.commandType,payload:m.commandPayload,actorId:t})}catch(W){console.warn("[StudentQuickActions] Failed to dispatch plugin command:",W)}}};return e.jsxs("div",{ref:M,id:"student-quick-actions-container","data-compact":T?"true":"false","data-is-mobile":u.isMobile?"true":"false",className:"fixed bottom-6 right-6 z-50 flex flex-col items-end pointer-events-auto",children:[e.jsx(Oe,{children:c&&e.jsxs(B.div,{initial:{opacity:0,scale:.9,y:15},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:15},transition:{type:"spring",damping:25,stiffness:350},className:"mb-3 w-[calc(100vw-2.5rem)] max-w-[340px] sm:w-[380px] bg-white/95 backdrop-blur-md rounded-2xl border border-slate-200/90 shadow-2xl overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 bg-gradient-to-r from-slate-900 to-indigo-950 text-white",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg bg-indigo-500/30 flex items-center justify-center text-indigo-300 shrink-0",children:e.jsx(Me,{size:16})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("h4",{className:"text-xs font-black uppercase tracking-wider text-slate-100 truncate",children:d==="zh"?"学生快捷指令 (Quick Actions)":"Quick Actions"}),T&&e.jsx("span",{className:"text-[9px] font-extrabold px-1.5 py-0.2 rounded bg-indigo-500/40 text-indigo-200 shrink-0",children:d==="zh"?"紧凑":"Compact"})]}),e.jsx("p",{className:"text-2xs text-slate-400 truncate",children:d==="zh"?"一键直达课堂、作业与插件扩展":"Fast navigation & plugin actions"})]})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0 ml-2",children:[e.jsx("button",{type:"button",onClick:()=>N(m=>m===null?!u.isMobile:!m),className:"p-1 rounded-lg text-slate-400 hover:text-white hover:bg-white/10 transition-colors cursor-pointer",title:T?d==="zh"?"恢复标准模式":"Expanded FAB":d==="zh"?"切换紧凑图标模式":"Compact FAB",children:T?e.jsx(ft,{size:13}):e.jsx(pt,{size:13})}),e.jsx("button",{type:"button",onClick:()=>r(!1),className:"p-1 rounded-lg text-slate-400 hover:text-white hover:bg-white/10 transition-colors cursor-pointer",title:d==="zh"?"关闭":"Close",children:e.jsx(_e,{size:16})})]})]}),w==="menu"?e.jsxs("div",{className:"p-3.5 flex flex-col gap-2.5 max-h-[460px] overflow-y-auto",children:[e.jsxs("div",{id:"qa-action-join-live",onClick:G,className:"group/item flex items-center justify-between p-3 rounded-xl border border-slate-200/80 bg-slate-50/70 hover:bg-indigo-50/60 hover:border-indigo-300 transition-all cursor-pointer shadow-3xs",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsxs("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-tr from-rose-500 to-orange-400 text-white flex items-center justify-center shrink-0 shadow-xs relative",children:[e.jsx(bt,{size:18,className:"animate-pulse"}),e.jsxs("span",{className:"absolute -top-1 -right-1 flex h-2.5 w-2.5",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-rose-400 opacity-75"}),e.jsx("span",{className:"relative inline-flex rounded-full h-2.5 w-2.5 bg-rose-500"})]})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs font-black text-slate-800 tracking-tight group-hover/item:text-indigo-900 transition-colors",children:d==="zh"?"进入实时课堂":"Join Live Session"}),e.jsx("span",{className:"text-2xs font-extrabold px-1.5 py-0.2 rounded bg-rose-100 text-rose-700",children:"LIVE"})]}),e.jsx("p",{className:"text-2xs text-slate-500 truncate mt-0.5",children:p?p.lesson_title||p.title||"当前课堂":d==="zh"?"点击接入今日课堂与互动白板":"Connect to live interactive lesson"})]})]}),e.jsx(te,{size:16,className:"text-slate-400 group-hover/item:text-indigo-600 group-hover/item:translate-x-0.5 transition-all shrink-0"})]}),e.jsxs("div",{id:"qa-action-view-assignments",onClick:q,className:"group/item flex items-center justify-between p-3 rounded-xl border border-slate-200/80 bg-slate-50/70 hover:bg-teal-50/60 hover:border-teal-300 transition-all cursor-pointer shadow-3xs",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-tr from-teal-500 to-emerald-400 text-white flex items-center justify-center shrink-0 shadow-xs",children:e.jsx(Ce,{size:18})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs font-black text-slate-800 tracking-tight group-hover/item:text-teal-900 transition-colors",children:d==="zh"?"查看待办作业":"View Latest Assignments"}),E.length>0&&e.jsxs("span",{className:"text-2xs font-extrabold px-1.5 py-0.2 rounded bg-amber-100 text-amber-800",children:[E.length," ",d==="zh"?"待提交":"pending"]})]}),e.jsx("p",{className:"text-2xs text-slate-500 truncate mt-0.5",children:E.length>0?`${E[0].title} · ${d==="zh"?"未提交":"pending"}`:d==="zh"?"全部作业已完成或待批改":"All assignments submitted"})]})]}),e.jsx(te,{size:16,className:"text-slate-400 group-hover/item:text-teal-600 group-hover/item:translate-x-0.5 transition-all shrink-0"})]}),E.length>0&&e.jsxs("div",{className:"bg-amber-50/70 border border-amber-200/70 rounded-xl p-2.5 flex items-center justify-between text-2xs",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-amber-900 font-semibold truncate mr-2",children:[e.jsx(ae,{size:12,className:"text-amber-600 shrink-0"}),e.jsx("span",{className:"truncate",children:E[0].title})]}),e.jsxs("button",{type:"button",onClick:()=>K(E[0]),className:"px-2 py-1 bg-amber-600 hover:bg-amber-700 text-white rounded-lg font-bold shrink-0 transition-colors cursor-pointer flex items-center gap-1 shadow-2xs",children:[e.jsx("span",{children:d==="zh"?"直接答题":"Open"}),e.jsx(jt,{size:10})]})]}),e.jsxs("div",{id:"qa-action-check-notifications",onClick:()=>n("notifications"),className:"group/item flex items-center justify-between p-3 rounded-xl border border-slate-200/80 bg-slate-50/70 hover:bg-blue-50/60 hover:border-blue-300 transition-all cursor-pointer shadow-3xs",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsxs("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-tr from-blue-500 to-indigo-500 text-white flex items-center justify-center shrink-0 shadow-xs relative",children:[e.jsx(Ee,{size:18}),A.length>0&&e.jsx("span",{className:"absolute -top-1 -right-1 flex h-3 w-3 items-center justify-center rounded-full bg-rose-500 text-white text-[9px] font-black",children:A.length})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs font-black text-slate-800 tracking-tight group-hover/item:text-blue-900 transition-colors",children:d==="zh"?"检查消息与点名":"Check Notifications"}),A.length>0?e.jsx("span",{className:"text-2xs font-extrabold px-1.5 py-0.2 rounded bg-rose-100 text-rose-700 animate-pulse",children:d==="zh"?"提问点名待应答":"Roll Call Alarm"}):e.jsx("span",{className:"text-2xs font-medium text-slate-400",children:d==="zh"?"无未读":"All clear"})]}),e.jsx("p",{className:"text-2xs text-slate-500 truncate mt-0.5",children:A.length>0?d==="zh"?`有 ${A.length} 条课堂点名提问等待回应`:`${A.length} active roll-call alarms`:d==="zh"?"查看历史点名出勤与批改反馈":"View notifications & alerts"})]})]}),e.jsx(te,{size:16,className:"text-slate-400 group-hover/item:text-blue-600 group-hover/item:translate-x-0.5 transition-all shrink-0"})]}),R.length>0&&e.jsxs("div",{className:"flex flex-col gap-2 pt-1 border-t border-slate-100",children:[e.jsx("span",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-wider",children:d==="zh"?"插件扩展指令":"Plugin Actions"}),R.map(m=>m.customRenderer?e.jsx(ve.Fragment,{children:m.customRenderer(m,{activeStudentId:t,lessonId:p?.lesson_id,lang:d,closeMenu:()=>r(!1)})},m.id):e.jsxs("div",{id:`qa-action-plugin-${m.id}`,onClick:()=>V(m),className:`group/item flex items-center justify-between p-3 rounded-xl border border-slate-200/80 bg-slate-50/70 hover:bg-indigo-50/60 hover:border-indigo-300 transition-all cursor-pointer shadow-3xs ${m.disabled?"opacity-50 pointer-events-none":""}`,children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-tr from-indigo-500 to-purple-500 text-white flex items-center justify-center shrink-0 shadow-xs",children:As(m.icon)}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs font-black text-slate-800 tracking-tight group-hover/item:text-indigo-900 transition-colors truncate",children:m.title}),m.badge&&e.jsx("span",{className:`text-[9px] font-extrabold px-1.5 py-0.2 rounded border ${Ls(m.badgeVariant)}`,children:m.badge})]}),m.description&&e.jsx("p",{className:"text-2xs text-slate-500 truncate mt-0.5",children:m.description})]})]}),e.jsx(te,{size:16,className:"text-slate-400 group-hover/item:text-indigo-600 group-hover/item:translate-x-0.5 transition-all shrink-0"})]},m.id))]}),e.jsx(ge,{slot:"student.quick_actions.item",slotProps:{studentId:t,lessonId:p?.lesson_id,lang:d,isCompact:T,closeMenu:()=>r(!1)}}),e.jsx(ge,{slot:"student.quick_actions.action",slotProps:{studentId:t,lang:d,isCompact:T}})]}):e.jsxs("div",{className:"p-3.5 flex flex-col gap-3 max-h-[360px] overflow-y-auto",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-slate-100 pb-2",children:[e.jsxs("span",{className:"text-xs font-bold text-slate-700 flex items-center gap-1.5",children:[e.jsx(Ee,{size:13,className:"text-indigo-600"}),e.jsx("span",{children:d==="zh"?"消息与点名通知清单":"Notifications & Alarms"})]}),e.jsx("button",{type:"button",onClick:()=>n("menu"),className:"text-2xs font-bold text-indigo-600 hover:text-indigo-800 transition-colors cursor-pointer",children:d==="zh"?"返回主菜单":"Back to menu"})]}),A.length>0?e.jsxs("div",{className:"space-y-2",children:[e.jsx("span",{className:"text-2xs font-bold text-rose-600 uppercase tracking-wider",children:d==="zh"?"🔴 紧急课堂点名":"Urgent Roll Calls"}),A.map(m=>e.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/30 rounded-xl p-2.5 flex flex-col gap-2",children:[e.jsx("div",{className:"flex items-start justify-between gap-2",children:e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-bold text-amber-900",children:d==="zh"?"⚡️ 老师向您发起了随堂提问点名":"Teacher Roll Call Alarm"}),e.jsx("div",{className:"text-2xs text-amber-800 mt-0.5",children:m.lesson_title||(d==="zh"?"面授课堂":"Classroom")})]})}),e.jsxs("button",{type:"button",onClick:()=>U(m.id),className:"w-full py-1.5 bg-amber-600 hover:bg-amber-700 text-white rounded-lg text-2xs font-extrabold flex items-center justify-center gap-1 shadow-2xs transition-colors cursor-pointer",children:[e.jsx(Se,{size:12}),e.jsx("span",{children:d==="zh"?"立即确认签到回应":"Confirm Presence"})]})]},m.id))]}):e.jsx("div",{className:"text-center py-6 text-slate-400 text-xs italic",children:d==="zh"?"🎉 太棒了,当前没有未处理的点名与紧急通知":"No unread roll-call alarms."}),e.jsxs("div",{className:"space-y-1.5 border-t border-slate-100 pt-2",children:[e.jsx("span",{className:"text-2xs font-bold text-slate-450 uppercase tracking-wider block",children:d==="zh"?"最新作业评定情况":"Recent Graded Work"}),F.slice(0,3).map(m=>e.jsxs("div",{className:"flex items-center justify-between text-2xs p-2 rounded-lg bg-slate-50 border border-slate-200/60",children:[e.jsx("span",{className:"font-semibold text-slate-700 truncate max-w-[170px]",children:m.title}),m.submission_status==="graded"?e.jsxs("span",{className:"font-bold text-emerald-600 bg-emerald-100/60 px-1.5 py-0.5 rounded",children:[m.score,"%"]}):e.jsx("span",{className:"text-amber-700 bg-amber-100/60 px-1.5 py-0.5 rounded font-medium",children:m.submission_status?"已交":"未交"})]},m.id))]})]}),e.jsxs("div",{className:"px-4 py-2 bg-slate-50 border-t border-slate-100 flex items-center justify-between text-2xs text-slate-450",children:[e.jsx("span",{children:d==="zh"?"快捷键 Esc 退出菜单":"Press Esc to close"}),e.jsx("span",{className:"font-mono text-indigo-600 font-bold",children:"OpenLearn"})]})]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ge,{slot:"student.quick_actions.fab",slotProps:{isCompact:T,isOpen:c,urgentCount:P,screenInfo:u}}),j?j({isCompact:T,isOpen:c,toggle:()=>r(!c),urgentCount:P,screenInfo:u}):e.jsxs("button",{id:"student-quick-actions-fab-btn",type:"button",onClick:()=>r(!c),"data-compact":T?"true":"false","data-is-mobile":u.isMobile?"true":"false",className:`group relative flex items-center justify-center transition-all duration-200 cursor-pointer border border-white/20 shadow-lg hover:shadow-xl active:scale-95 bg-gradient-to-r from-indigo-600 via-indigo-700 to-teal-600 hover:from-indigo-700 hover:to-teal-700 text-white ${T?"w-11 h-11 p-0 rounded-full":"gap-2 px-4 py-3 rounded-full"}`,title:d==="zh"?T?"快捷操作 (点击展开)":"学生快捷操作菜单 (Quick Actions)":T?"Quick Actions":"Student Quick Actions",children:[P>0&&e.jsx("span",{className:`absolute flex items-center justify-center rounded-full bg-rose-500 text-white font-black shadow-sm ring-2 ring-white ${T?"-top-1 -right-1 h-4 w-4 text-[9px]":"-top-1.5 -left-1.5 h-5 w-5 text-[10px]"}`,children:P}),c?e.jsx(_e,{size:18,className:"text-white"}):e.jsx(Me,{size:18,className:"text-amber-300 animate-pulse"}),!T&&e.jsx("span",{className:"text-xs font-extrabold tracking-tight hidden sm:inline-block",children:c?d==="zh"?"关闭指令":"Close":d==="zh"?"快捷指令":"Quick Actions"})]})]})]})}function Ts(s){const{students:t,activeStudentId:a,studentDashboardData:h,readNotifications:i,setReadNotifications:k,addToast:x,lang:o,setSelectedLesson:d,setStudentViewStatus:L,setSelectedAssignment:z,setQuizStudentAnswers:C,setSubAssignmentTab:b}=s,D=`student_dashboard_layout_v2_${a||"default"}`,[f,j]=S.useState(()=>{try{const l=localStorage.getItem(D);if(l){const v=JSON.parse(l);if(Array.isArray(v)&&v.length>0){const A=new Set(v.map(p=>p.id)),E=fe.filter(p=>!A.has(p.id));return[...v,...E]}}}catch{}return fe}),[g,c]=S.useState("default"),[r,w]=S.useState(null),n=S.useCallback(l=>{j(l);try{localStorage.setItem(D,JSON.stringify(l))}catch{}},[D]),y=(l,v)=>{const A=f.map(E=>E.id===l?{...E,size:v}:E);n(A),x?.(o==="zh"?"组件尺寸已调整":"Widget Resized",o==="zh"?`已将组件调整为 ${v} 栅格宽度`:`Widget resized to ${v}`,"info")},N=(l,v)=>{const A=f.findIndex(P=>P.id===l);if(A===-1)return;const E=v==="left"?A-1:A+1;if(E<0||E>=f.length)return;const p=[...f],[R]=p.splice(A,1);p.splice(E,0,R),n(p)},_=l=>{const v=f.map(A=>A.id===l?{...A,collapsed:!A.collapsed}:A);n(v)},$=l=>{const v=f.find(A=>A.id===l);v&&v.collapsed&&_(l)},M=(l,v)=>{w(v),l.dataTransfer.setData("text/plain",v),l.dataTransfer.effectAllowed="move"},u=(l,v)=>{const A=r||l.dataTransfer.getData("text/plain");if(!A||A===v){w(null);return}const E=f.findIndex(R=>R.id===A),p=f.findIndex(R=>R.id===v);if(E!==-1&&p!==-1){const R=[...f],[P]=R.splice(E,1);R.splice(p,0,P),n(R),x?.(o==="zh"?"布局已重排":"Layout Reordered",o==="zh"?"已成功调整组件展示次序并保存":"Widget order updated and saved","success")}w(null)},T=l=>{const v=Ge[l];v&&(c(l),n(v.layout),x?.(o==="zh"?"预设布局已应用":"Preset Applied",o==="zh"?`已切换至「${v.label.zh}」`:`Switched to ${v.label.en}`,"success"))},I=()=>{c("default"),n(fe),x?.(o==="zh"?"已恢复默认布局":"Layout Reset",o==="zh"?"学生仪表盘已重置为标准栅格排版":"Dashboard reset to default grid layout","info")},F=(l,v)=>{switch(l.id){case"quick-stats":return e.jsx(ee,{id:"quick-stats",title:o==="zh"?"学情概览看板 (Quick Stats)":"Learning Quick Stats",subtitle:o==="zh"?"总作业量、平均得分率与出勤概览":"Overview of assignments, score & attendance",icon:e.jsx(Be,{size:18,className:"text-blue-600"}),size:l.size,collapsed:l.collapsed,onResize:A=>y("quick-stats",A),onMoveLeft:()=>N("quick-stats","left"),onMoveRight:()=>N("quick-stats","right"),isFirst:v===0,isLast:v===f.length-1,onToggleCollapse:()=>_("quick-stats"),lang:o,onDragStart:M,onDrop:u,isDragging:r==="quick-stats",children:e.jsx(fs,{studentDashboardData:h})},l.id);case"progress-trends":return e.jsx(ee,{id:"progress-trends",title:o==="zh"?"周度学习进度走势 (Progress Trends)":"Progress Trends",subtitle:o==="zh"?"成绩走势、历史周均分与目标线":"Weekly score trends, targets & analytics",icon:e.jsx(H,{size:18,className:"text-teal-600"}),size:l.size,collapsed:l.collapsed,onResize:A=>y("progress-trends",A),onMoveLeft:()=>N("progress-trends","left"),onMoveRight:()=>N("progress-trends","right"),isFirst:v===0,isLast:v===f.length-1,onToggleCollapse:()=>_("progress-trends"),lang:o,onDragStart:M,onDrop:u,isDragging:r==="progress-trends",children:e.jsx(Je,{assignments:h.assignments,lang:o})},l.id);case"upcoming-assignments":return e.jsx(ee,{id:"upcoming-assignments",title:o==="zh"?"待办与已交作业 (Upcoming Assignments)":"Upcoming Assignments",subtitle:o==="zh"?"包含未交作业提醒、待批改与成绩反馈":"Pending & graded assignments",icon:e.jsx(Ce,{size:18,className:"text-indigo-600"}),size:l.size,collapsed:l.collapsed,onResize:A=>y("upcoming-assignments",A),onMoveLeft:()=>N("upcoming-assignments","left"),onMoveRight:()=>N("upcoming-assignments","right"),isFirst:v===0,isLast:v===f.length-1,onToggleCollapse:()=>_("upcoming-assignments"),lang:o,onDragStart:M,onDrop:u,isDragging:r==="upcoming-assignments",children:e.jsx(ks,{assignments:h.assignments,setSelectedAssignment:z,setStudentViewStatus:L,setQuizStudentAnswers:C,setSubAssignmentTab:b,lang:o})},l.id);case"course-progress":return e.jsx(ee,{id:"course-progress",title:o==="zh"?"课程学习进度 (Course Progress)":"Course Progress",subtitle:o==="zh"?"正在进行的课程完成百分比与快捷进入":"Active courses progression",icon:e.jsx(Ne,{size:18,className:"text-emerald-600"}),size:l.size,collapsed:l.collapsed,onResize:A=>y("course-progress",A),onMoveLeft:()=>N("course-progress","left"),onMoveRight:()=>N("course-progress","right"),isFirst:v===0,isLast:v===f.length-1,onToggleCollapse:()=>_("course-progress"),lang:o,onDragStart:M,onDrop:u,isDragging:r==="course-progress",children:e.jsx(gs,{progress:h.progress,setSelectedLesson:d,setStudentViewStatus:L})},l.id);case"schedules":return e.jsx(ee,{id:"schedules",title:o==="zh"?"课表与出勤日程 (My Schedule)":"Class Schedule & Timetable",subtitle:o==="zh"?"今日授课计划与历史出勤记录":"Daily class timetable & attendance",icon:e.jsx(be,{size:18,className:"text-pink-600"}),size:l.size,collapsed:l.collapsed,onResize:A=>y("schedules",A),onMoveLeft:()=>N("schedules","left"),onMoveRight:()=>N("schedules","right"),isFirst:v===0,isLast:v===f.length-1,onToggleCollapse:()=>_("schedules"),lang:o,onDragStart:M,onDrop:u,isDragging:r==="schedules",children:e.jsx(Ns,{schedules:h.schedules,setSelectedLesson:d,setStudentViewStatus:L})},l.id);case"academic-trajectory":return e.jsx(ee,{id:"academic-trajectory",title:o==="zh"?"长期学业成长轨迹与评定历史":"Academic Growth Trajectory & History",subtitle:o==="zh"?"学期绩点走势、近3月表现与评分时间轴":"Semester grade trends & evaluation timeline",icon:e.jsx(ze,{size:18,className:"text-purple-600"}),size:l.size,collapsed:l.collapsed,onResize:A=>y("academic-trajectory",A),onMoveLeft:()=>N("academic-trajectory","left"),onMoveRight:()=>N("academic-trajectory","right"),isFirst:v===0,isLast:v===f.length-1,onToggleCollapse:()=>_("academic-trajectory"),lang:o,onDragStart:M,onDrop:u,isDragging:r==="academic-trajectory",children:e.jsx(ws,{assignments:h.assignments,lang:o,hideWeeklyTrend:!0})},l.id);case"extension-views":return e.jsx(ee,{id:"extension-views",title:o==="zh"?"扩展应用视图 (Plugin Extensions)":"Plugin Extensions",subtitle:o==="zh"?"由教育插件系统注册的自定义组件":"Custom components from plugin registry",icon:e.jsx(Z,{size:18,className:"text-amber-600"}),size:l.size,collapsed:l.collapsed,onResize:A=>y("extension-views",A),onMoveLeft:()=>N("extension-views","left"),onMoveRight:()=>N("extension-views","right"),isFirst:v===0,isLast:v===f.length-1,onToggleCollapse:()=>_("extension-views"),lang:o,onDragStart:M,onDrop:u,isDragging:r==="extension-views",children:e.jsx(ge,{slot:"student.view",slotProps:{studentId:a}})},l.id);default:return null}};return e.jsxs("div",{className:"space-y-6",children:[e.jsx(hs,{students:t,activeStudentId:a}),e.jsx(us,{studentDashboardData:h,readNotifications:i,setReadNotifications:k,activeStudentId:a,addToast:x,lang:o}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 p-3.5 bg-slate-50 border border-slate-200/80 rounded-2xl shadow-3xs",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-8 h-8 rounded-xl bg-indigo-500/10 text-indigo-600 flex items-center justify-center shrink-0",children:e.jsx(yt,{size:16})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-black text-slate-800 tracking-tight",children:o==="zh"?"模块化自适应栅格工作台":"Modular CSS Grid Dashboard"}),e.jsxs("span",{className:"text-2xs font-bold px-2 py-0.5 rounded-full bg-indigo-50 text-indigo-600 border border-indigo-100",children:[f.length," ",o==="zh"?"个自适应组件":"Widgets"]})]}),e.jsx("p",{className:"text-2xs text-slate-455",children:o==="zh"?"支持自由拖拽排序、切换 1/3~整行 宽度以及一键折叠展开":"Drag to reorder, resize from 1/3 to full width, or collapse widgets"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap w-full sm:w-auto justify-end",children:[e.jsx("div",{className:"flex items-center bg-white p-0.5 rounded-xl border border-slate-200 text-xs font-bold text-slate-600 shadow-3xs",children:Object.entries(Ge).map(([l,v])=>e.jsx("button",{type:"button",onClick:()=>T(l),className:`px-2.5 py-1 rounded-lg transition-all cursor-pointer text-2xs ${g===l?"bg-indigo-600 text-white shadow-2xs font-extrabold":"hover:text-slate-900 text-slate-600"}`,children:o==="zh"?v.label.zh:v.label.en},l))}),e.jsx("button",{type:"button",onClick:I,title:o==="zh"?"恢复默认布局":"Reset to default layout",className:"p-2 text-slate-500 hover:text-indigo-600 hover:bg-white rounded-xl border border-transparent hover:border-slate-200 transition-all cursor-pointer shadow-3xs",children:e.jsx(wt,{size:14})})]})]}),e.jsx("div",{id:"student-dashboard-modular-grid",className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-12 gap-6 items-start",children:f.filter(l=>l.visible).map((l,v)=>F(l,v))}),e.jsx(Ds,{studentDashboardData:h,activeStudentId:a,readNotifications:i,setReadNotifications:k,setSelectedLesson:d,setStudentViewStatus:L,setSelectedAssignment:z,addToast:x,lang:o,onExpandWidget:$})]})}const Ms=S.lazy(()=>Fe(()=>import("./StudentLessonView-DRwhbGoU.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])).then(s=>({default:s.StudentLessonView}))),_s=S.lazy(()=>Fe(()=>import("./StudentAssignmentView-tQiAv5Xn.js"),__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,10])).then(s=>({default:s.StudentAssignmentView})));function Os(s){const{students:t,activeStudentId:a,isStudentLocked:h=!1,studentViewStatus:i,studentDashboardData:k,readNotifications:x,setReadNotifications:o,addToast:d,lang:L,setSelectedLesson:z,setStudentViewStatus:C,setSelectedAssignment:b,setQuizStudentAnswers:D,setSubAssignmentTab:f,lessons:j,selectedLesson:g,studentFullscreenPanel:c,setStudentFullscreenPanel:r,timelineSegments:w,activeSegmentId:n,setActiveSegmentId:y,localProgressPercent:N,setLocalProgressPercent:_,updateStudentProgress:$,isStudentLessonContentCollapsed:M,setIsStudentLessonContentCollapsed:u,studentLessonTab:T,setStudentLessonTab:I,elements:F,activeRole:l,fetchElements:v,currentVfsParent:A,setCurrentVfsParent:E,vfsNodes:p,studentSelectedCourseware:R,setStudentSelectedCourseware:P,selectedAssignment:G,quizStudentAnswers:q,submitQuizAssignment:K,subAssignmentTab:U}=s;return e.jsx("div",{className:"flex-1 p-6 overflow-y-auto w-full max-w-full space-y-6",children:a?k?e.jsx(S.Suspense,{fallback:e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center min-h-[400px] text-slate-400 gap-3",children:[e.jsx(Re,{className:"w-8 h-8 animate-spin text-indigo-500"}),e.jsx("span",{className:"text-sm font-medium",children:"加载内容中..."})]}),children:i==="lesson"?e.jsx(Ms,{students:t,activeStudentId:a,isStudentLocked:h,setStudentViewStatus:C,setSelectedLesson:z,lessons:j,selectedLesson:g,studentFullscreenPanel:c,setStudentFullscreenPanel:r,timelineSegments:w,lang:L,activeSegmentId:n,setActiveSegmentId:y,localProgressPercent:N,setLocalProgressPercent:_,updateStudentProgress:$,isStudentLessonContentCollapsed:M,setIsStudentLessonContentCollapsed:u,studentLessonTab:T,setStudentLessonTab:I,elements:F,activeRole:l,fetchElements:v,currentVfsParent:A,setCurrentVfsParent:E,vfsNodes:p,studentSelectedCourseware:R,setStudentSelectedCourseware:P,addToast:d}):i==="assignment"&&G?e.jsx(_s,{selectedAssignment:G,setStudentViewStatus:C,setSelectedAssignment:b,quizStudentAnswers:q,submitQuizAssignment:K,subAssignmentTab:U,setSubAssignmentTab:f,setQuizStudentAnswers:D,elements:F,activeRole:l,activeStudentId:a,fetchElements:v}):e.jsx(Ts,{students:t,activeStudentId:a,studentDashboardData:k,readNotifications:x,setReadNotifications:o,addToast:d,lang:L,setSelectedLesson:z,setStudentViewStatus:C,setSelectedAssignment:b,setQuizStudentAnswers:D,setSubAssignmentTab:f})}):e.jsx("div",{className:"flex items-center justify-center h-full text-gray-400",children:e.jsx(Re,{size:32,className:"animate-spin"})}):e.jsxs("div",{className:"bg-surface border border-theme rounded-xl p-12 text-center text-muted flex flex-col items-center justify-center",children:[e.jsx(Nt,{size:48,className:"text-muted/40 mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-main",children:"No Student Selected"}),e.jsx("p",{className:"mt-2 text-sm",children:"Please select a student from the top navigation bar to view their dashboard."})]})})}export{Os as StudentView};
|