1import{u as pt,a as Se,a3 as re,j as e,n as ke,D as At,a4 as B,U as Me,_ as Dt}from"./index-ae7ec2c.BSswS0a9.js";import{a as r}from"./monaco-ae7ec2c.DBaGHQ0n.js";const at=["","èæ°æå£«","ééå¦å¾","ç½é¶æ¢é©è
","ç½é¶æå£«","é»éåé©å®¶","é»éåè
","ééç²¾è±","ä¼ è¯´ä»£ç ç¥"];function Rt({isLight:t,onChanged:n}){const{themeData:u}=pt(),{confirm:s,alert:f}=Se(t),i=r.useCallback($=>f("æç¤º",$),[f]),[g,h]=r.useState(!0),[T,N]=r.useState([]),[x,o]=r.useState(!1),[P,p]=r.useState(null),[C,A]=r.useState(null),[O,M]=r.useState(null),[K,y]=r.useState(null),S=r.useCallback(async()=>{h(!0);try{const $=await re("/teacher/classes",{method:"GET"});$?.code===200&&N($.data||[])}catch($){i("ç级å表å 载失败ï¼"+($?.message||""))}finally{h(!1)}},[i]);r.useEffect(()=>{S()},[S]);const k=t?"bg-white border border-gray-100 shadow-sm":"bg-white/5 border border-white/10",Q="rounded-lg bg-purple-600 hover:bg-purple-500 text-white px-3 py-1.5 text-sm font-medium",b=t?"rounded-lg bg-gray-100 hover:bg-gray-200 text-gray-700 px-3 py-1.5 text-sm":"rounded-lg bg-white/10 hover:bg-white/20 text-white px-3 py-1.5 text-sm";return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:`text-lg font-bold ${t?"text-gray-900":"text-white"}`,children:"æçç级"}),e.jsx("p",{className:`text-xs mt-1 ${t?"text-gray-500":"text-white/50"}`,children:"æç级è¿åº¦å®å¶åæå¦ï¼åç管çãæ°æ®çæ¿ãå®åæ´¾åç»ä¹ "})]}),e.jsx("button",{className:Q,onClick:()=>{p(null),o(!0)},children:"+ æ°å»ºç级"})]}),g?e.jsx("div",{className:`rounded-xl ${k} p-8 text-center text-sm ${t?"text-gray-500":"text-white/50"}`,children:"å è½½ä¸â¦"}):T.length===0?e.jsx("div",{className:`rounded-xl ${k} p-8 text-center text-sm ${t?"text-gray-500":"text-white/50"}`,children:"è¿æ²¡æç级ï¼ç¹å»å³ä¸è§ãæ°å»ºç级ãå¼å§åçå§ï½"}):e.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:T.map($=>e.jsxs("div",{className:`rounded-xl ${k} p-4 flex flex-col gap-3`,children:[e.jsxs("div",{children:[e.jsx("div",{className:`font-semibold ${t?"text-gray-900":"text-white"}`,children:$.name}),$.grade&&e.jsx("div",{className:`inline-block mt-1 text-xs px-2 py-0.5 rounded-full ${t?"bg-purple-100 text-purple-700":"bg-purple-500/20 text-purple-200"}`,children:$.grade}),$.description&&e.jsx("div",{className:`mt-2 text-xs ${t?"text-gray-500":"text-white/50"} line-clamp-2`,children:$.description})]}),e.jsxs("div",{className:`text-xs ${t?"text-gray-500":"text-white/50"}`,children:["æå ",$.memberCount," 人"]}),e.jsxs("div",{className:"flex flex-wrap gap-2 mt-auto",children:[e.jsx("button",{className:b,onClick:()=>z($),children:"çæ¿"}),e.jsx("button",{className:b,onClick:()=>R($),children:"æå"}),e.jsx("button",{className:b,onClick:()=>y({class:$}),children:"æ´¾ç»ä¹ "}),e.jsx("button",{className:b,onClick:()=>{p($),o(!0)},children:"ç¼è¾"}),e.jsx("button",{className:t?"rounded-lg bg-rose-100 text-rose-600 hover:bg-rose-200 px-3 py-1.5 text-sm":"rounded-lg bg-rose-500/20 text-rose-300 hover:bg-rose-500/30 px-3 py-1.5 text-sm",onClick:()=>te($),children:"å é¤"})]})]},$.id))}),x&&e.jsx(Mt,{isLight:t,target:P,onClose:()=>{o(!1),p(null)},onDone:()=>{o(!1),p(null),S(),n?.()}}),C&&e.jsx(Et,{isLight:t,data:C,onClose:()=>A(null)}),O&&e.jsx(Pt,{isLight:t,target:O,onClose:()=>M(null),onChanged:$=>{M({...O,members:$}),n?.()}}),K&&e.jsx(Ft,{isLight:t,target:K,onClose:()=>y(null),onDone:()=>{y(null),S(),n?.()}})]});async function z($){const w=await re(`/teacher/classes/${$.id}`,{method:"GET"});w?.code===200?A(w.data):i("çæ¿å 载失败")}async function R($){const w=await re(`/teacher/classes/${$.id}`,{method:"GET"});w?.code===200?M({class:$,members:(w.data.members||[]).map(X=>X.id)}):i("å 载失败")}function te($){s("å é¤ç级",`确认å é¤ç级ã${$.name}ãï¼æåå°æ¢å¤æªåçç¶æï¼å·²æ´¾åçç»ä¹ ä¿çä½ä¸åå½å±è¯¥çã`,async()=>{const w=await re(`/teacher/classes/${$.id}`,{method:"DELETE"});w?.code===200?(i("å·²å é¤"),S(),n?.()):i(w?.message||"å é¤å¤±è´¥")})}}function Mt({isLight:t,target:n,onClose:u,onDone:s}
1){const{alert:f}=Se(t),[i,g]=r.useState(n?.name||""),[h,T]=r.useState(n?.description||""),[N,x]=r.useState(n?.grade||""),[o,P]=r.useState(!1);async function p(){if(!i.trim()){f("æç¤º","请填åç级åç§°");return}P(!0);const C={name:i,description:h,grade:N},A=n?await re(`/teacher/classes/${n.id}`,{method:"PUT",body:JSON.stringify(C)}):await re("/teacher/classes",{method:"POST",body:JSON.stringify(C)});P(!1),A?.code===200?s():f("æç¤º",A?.message||"ä¿å失败")}return e.jsx(Oe,{isLight:t,title:n?"ç¼è¾ç级":"æ°å»ºç级",onClose:u,children:e.jsxs("div",{className:"space-y-3",children:[e.jsx(ie,{label:"ç级åç§°",isLight:t,children:e.jsx("input",{value:i,maxLength:100,onChange:C=>g(C.target.value),className:ue(t),placeholder:"å¦ï¼CSP-J å²åºç"})}),e.jsx(ie,{label:"年级 / çæ¬¡æ ç¾ï¼éå¡«ï¼",isLight:t,children:e.jsx("input",{value:N,maxLength:50,onChange:C=>x(C.target.value),className:ue(t),placeholder:"å¦ï¼å级 / æé«ç»"})}),e.jsx(ie,{label:"ç级ç®ä»ï¼éå¡«ï¼",isLight:t,children:e.jsx("textarea",{value:h,maxLength:1e3,onChange:C=>T(C.target.value),className:ue(t),rows:3,placeholder:"ççº§ç®æ ãè¿åº¦å®æç"})}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[e.jsx("button",{className:ht(t),onClick:u,children:"åæ¶"}),e.jsx("button",{className:"rounded-lg bg-purple-600 hover:bg-purple-500 text-white px-4 py-2 text-sm font-medium disabled:opacity-50",disabled:o,onClick:p,children:o?"ä¿åä¸â¦":"ä¿å"})]})]})})}function Et({isLight:t,data:n,onClose:u}){const s=n.dashboard||{},f=Math.max(1,...(s.stageDistribution||[]).map(x=>x.count)),i=n.members||[],[g,h]=r.useState(i[0]?.id||"");r.useEffect(()=>{i.length>0&&!i.find(x=>x.id===g)&&h(i[0].id)},[i]);const T=i.find(x=>x.id===g)||i[0],N=T?.weakTags||[];return e.jsx(Oe,{isLight:t,title:`${n.class?.name||""} · æ°æ®çæ¿`,onClose:u,wide:!0,children:e.jsxs("div",{className:"space-y-5 max-h-[70vh] overflow-y-auto pr-1",children:[e.jsx(Be,{title:`â ççº§äººæ° / 段ä½åå¸ï¼å
± ${s.total||0} 人ï¼`,isLight:t,children:(s.stageDistribution||[]).length===0?e.jsx(We,{isLight:t}):e.jsx("div",{className:"space-y-2",children:s.stageDistribution.map(x=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`w-20 text-xs ${t?"text-gray-600":"text-white/60"}`,children:x.stageName}),e.jsx("div",{className:"flex-1 h-3 rounded-full bg-black/10 overflow-hidden",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-purple-500 to-indigo-500",style:{width:`${Math.round(x.count/f*100)}%`}})}),e.jsx("div",{className:`w-8 text-right text-xs ${t?"text-gray-700":"text-white/80"}`,children:x.count})]},x.stageId))})}),e.jsx(Be,{title:"â¡ å¦åèå¼±ç¥è¯ç¹ï¼å¯åæ¢æ¥çï¼",isLight:t,children:i.length===0?e.jsx(We,{isLight:t}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:`text-xs ${t?"text-gray-500":"text-white/50"}`,children:"æ¥çå¦åï¼"}),e.jsx("select",{value:g,onChange:x=>h(x.target.value),className:`rounded-lg px-2 py-1.5 text-sm ${t?"bg-white border border-gray-200 text-gray-900":"bg-white/10 border border-white/10 text-white"}`,children:i.map(x=>e.jsxs("option",{value:x.id,children:[x.nickname,"ï¼",at[x.stageId||1]||`段ä½${x.stageId||1}`,"ï¼"]},x.id))}),T&&e.jsxs("span",{className:`text-xs ${t?"text-gray-500":"text-white/50"}`,children:["å
± ",N.length," æ¡è弱项"]})]}),N.length===0?e.jsx(We,{isLight:t}):e.jsx("div",{className:"flex flex-wrap gap-2",children:N.map((x,o)=>e.jsxs("div",{className:`rounded-lg px-3 py-1.5 text-sm ${t?"bg-amber-50 border border-amber-200":"bg-amber-500/10 border border-amber-500/20"}`,children:[e.jsxs("span",{className:t?"text-amber-700":"text-amber-300",children:[o+1,". ",x.tag]}),e.jsxs("span",{className:`ml-2 text-xs ${t?"text-gray-500":"text-white/50"}`,children:["ææ¡åº¦ ",x.mastery,"% · ç»è¿ ",x.attempted," é¢ Â· 对 ",x.correctCount]})]},x.tag))})]})}),e.jsxs(Be,{title:"â¢ å¨ / æ¥ æ´»è·ä¸ç»ä¹ 宿",isLight:t,children:[e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[e.jsx(ze,{label:"仿¥æ´»è·",value:s.daily?.activeToday??0,isLight:t}),e.jsx(ze,{label:"仿¥å®æç»ä¹ ",value:s.daily?.completedToday??0,isLight:t}),e.jsx(ze,{label:"è¿7æ¥æ´»è·",value:s.daily?.weeklyActive??0,isLight:t}),e.jsx(ze,{label:"è¿7æ¥å®æç»ä¹ ",value:s.daily?.weeklyCompleted??0,isLight:t})]}),e.jsx("div",{className:`mt-2 text-[11px] ${t?"text-gray-400":"text-white/40"}`,children:"ã宿ã= å¦åå½å¤©ç宿¯æ¥ç»ä¹ 8 é¢ï¼ä¸ç»ï¼ï¼ãæ´»è·ã= å¦åå½å¤©æè®¿é®/ç»ä¹ æ¥å¿"})]}),e.jsx(Be,{title:"⣠ç级æè¡æ¦ï¼æå / 积å / ACï¼",isLight:t,children:(s.ranking||[]).length===0?e.jsx(We,{isLight:t}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:t?"text-gray-500":"text-white/50",children:[e.jsx("th",{className:"text-left py-1 px-2",children:"#"}),e.jsx("th",{className:"text-left py-1 px-2",children:"å¦å"}),e.jsx("th",{className:"text-right py-1 px-2",children:"æå"}),e.jsx("th",{className:"text-right py-1 px-2",children:"积å"}),e.jsx("th",{className:"text-right py-1 px-2",children:"AC"})]})}),e.jsx("tbody",{children:s.ranking.map((x,o)=>e.jsxs("tr",{className:`border-t ${t?"border-gray-100":"border-white/10"}`,children:[e.jsx("td",{className:"py-1 px-2 text-xs",children:o+1}),e.jsx("td",{className:"py-1 px-2",children:x.nickname}),e.jsx("td",{className:"py-1 px-2 text-right font-semibold",children:x.totalScore}),e.jsx("td",{className:"py-1 px-2 text-right",children:x.points}),e.jsx("td",{className:"py-1 px-2 text-right",children:x.ac})]},x.id))})]})})})]})})}
1function Pt({isLight:t,target:n,onClose:u,onChanged:s}){const{alert:f,confirm:i}=Se(t),[g,h]=r.useState([]),[T,N]=r.useState(!0);new Set(n.members||[]),r.useEffect(()=>{(async()=>(N(!0),await x(),N(!1)))()},[]);async function x(){const p=await re("/teacher/students",{method:"GET"});p?.code===200&&h(p.data||[])}async function o(p){if((p.classes||[]).some(O=>O.id===n.class.id)){f("æç¤º","该å¦å已卿¬ç级");return}const A=await re(`/teacher/classes/${n.class.id}/students`,{method:"POST",body:JSON.stringify({studentId:p.id})});A?.code===200?(f("æç¤º","å·²å å
¥ç级"),s([...n.members||[],p.id]),await x()):f("æç¤º",A?.message||"æä½å¤±è´¥")}async function P(p){i("ç§»åºç级",`确认å°ã${p.nickname||"该å¦å"}ãç§»åºç级ï¼ä¿çå¸çç»å®ã`,async()=>{const C=await re(`/teacher/classes/${n.class.id}/students/${p.id}`,{method:"DELETE"});C?.code===200?(f("æç¤º","已移åºç级"),s((n.members||[]).filter(A=>A!==p.id)),await x()):f("æç¤º",C?.message||"æä½å¤±è´¥")})}return e.jsx(Oe,{isLight:t,title:`${n.class.name} · æå管ç`,onClose:u,wide:!0,children:T?e.jsx("div",{className:`p-6 text-center text-sm ${t?"text-gray-500":"text-white/50"}`,children:"å è½½ä¸â¦"}):g.length===0?e.jsx("div",{className:`p-6 text-center text-sm ${t?"text-gray-500":"text-white/50"}`,children:"ä½ è¿æ²¡æå¦åï¼å
æèå¸ç å享ç»å¦åç»å®å§ï½"}):e.jsx("div",{className:"space-y-2 max-h-[60vh] overflow-y-auto pr-1",children:g.map(p=>{const C=p.classes||[],A=C.some(M=>M.id===n.class.id),O=C.filter(M=>M.id!==n.class.id);return e.jsxs("div",{className:`flex items-center gap-3 rounded-xl p-3 ${t?"bg-white border border-gray-100":"bg-white/5 border border-white/10"}`,children:[e.jsx("div",{className:`w-10 h-10 rounded-full flex items-center justify-center text-xl ${t?"bg-purple-100":"bg-purple-500/20"}`,children:e.jsx(ke,{value:p.avatar,fallback:"ð§âð"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("div",{className:`text-sm font-semibold truncate ${t?"text-gray-900":"text-white"}`,children:p.nickname||"å¦å"}),A&&e.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded-full ${t?"bg-emerald-100 text-emerald-700":"bg-emerald-500/20 text-emerald-300"}`,children:"æ¬ç"}),O.map(M=>e.jsxs("span",{className:`text-[10px] px-1.5 py-0.5 rounded-full ${t?"bg-amber-100 text-amber-700":"bg-amber-500/20 text-amber-300"}`,children:["å·²å¨ã",M.name,"ã"]},M.id))]}),e.jsx("div",{className:`text-xs ${t?"text-gray-500":"text-white/50"}`,children:at[p.stageId||1]||`é¶æ®µ${p.stageId||1}`})]}),A?e.jsx("button",{className:t?"rounded-lg bg-rose-100 text-rose-600 hover:bg-rose-200 px-3 py-1.5 text-sm":"rounded-lg bg-rose-500/20 text-rose-300 hover:bg-rose-500/30 px-3 py-1.5 text-sm",onClick:()=>P(p),children:"ç§»åº"}):e.jsx("button",{className:"rounded-lg bg-purple-600 hover:bg-purple-500 text-white px-3 py-1.5 text-sm",onClick:()=>o(p),children:"å å
¥æ¬ç"})]},p.id)})})})}function Ft({isLight:t,target:n,onClose:u,onDone:s}){const{alert:f}=Se(t),[i,g]=r.useState(""),[h,T]=r.useState(""),[N,x]=r.useState("knowledge"),[o,P]=r.useState(""),[p,C]=r.useState(""),[A,O]=r.useState({papers:[],competitions:[]}),[M,K]=r.useState(!1),[y,S]=r.useState(1),[k,Q]=r.useState([]),[b,z]=r.useState([]),[R,te]=r.useState([]),[$,w]=r.useState(!1),[X,ce]=r.useState([]);r.useEffect(()=>{re("/teacher/tasks/options",{method:"GET"}).then(c=>{c?.code===200&&O(c.data||{papers:[],competitions:[]})})},[]);async function Y(){w(!0);const c=new URLSearchParams({stageId:String(y)});k.length>0&&c.set("tags",k.join(","));const F=await re(`/teacher/question-pool?${c.toString()}`,{method:"GET"});if(w(!1),F?.code===200){z(F.data?.tags||[]),te(F.data?.questions||[]);const se=new Set((F.data?.questions||[]).map(_=>_.id));ce(_=>_.filter(G=>se.has(G)))}else z([]),te([])}r.useEffect(()=>{if(N!=="knowledge")return;const c=setTimeout(()=>Y(),100);return()=>clearTimeout(c)},[y,k,N]);function xe(c){S(c),Q([]),ce([])}function pe(c){ce(F=>F.includes(c)?F.filter(se=>se!==c):[...F,c])}function be(){X.length===R.length?ce([]):ce(R.map(c=>c.id))}function m(c){Q(F=>F.includes(c)?F.filter(se=>se!==c):[...F,c])}async function q(){if(!i.trim()){f("æç¤º","请填åç»ä¹ æ é¢");return}if(N==="knowledge"&&X.length===0&&k.length===0){f("æç¤º","请è³å°å¾é 1 éé¢ç®ï¼æéä¸ 1 个ç¥è¯ç¹æ ç¾");return}const c={title:i,desc:h||null,targetType:N,dueAt:p||null,type:N==="knowledge"?"practice":"special"};N==="knowledge"?(X.length>0&&(c.questionIds=X),c.knowledgeTags=k):c.targetId=o,K(!0);const F=await re(`/teacher/classes/${n.class.id}/practice`,{method:"POST",body:JSON.stringify(c)});if(K(!1),F?.code===200){const se=F.data?.questionCount||0;f("æç¤º",se>0?`å·²åç级派å ${se} éé¢ç®`:"å·²åç级派åç»ä¹ "),s()}else f("æç¤º",F?.message||"æ´¾å失败")}return e.jsx(Oe,{isLight:t,title:`åã${n.class.name}ãæ´¾åç»ä¹ `,onClose:u,wide:!0,children:e.jsxs("div",{className:"space-y-3",children:[e.jsx(ie,{label:"ç»ä¹ æ é¢",isLight:t,children:e.jsx("input",{value:i,maxLength:200,onChange:c=>g(c.target.value),className:ue(t),placeholder:"å¦ï¼æ¬å¨ä¸é¡¹Â·æ¨¡æä¸æä¸¾"})}),e.jsx(ie,{label:"说æï¼éå¡«ï¼",isLight:t,children:e.jsx("textarea",{value:h,maxLength:1e3,onChange:c=>T(c.target.value),className:ue(t),rows:2})}),e.jsx(ie,{label:"æ¨éæ¹å¼",isLight:t,children:e.jsx("div",{className:"flex gap-2 flex-wrap",children:[["knowledge","éç¥è¯ç¹æ¨é"],["special_paper","æå®è¯å·"],["competition","æå®æ¯èµ"]].map(([c,F])=>e.jsx("button",{onClick:()=>x(c),className:`px-3 py-1.5 rounded-lg text-sm ${N===c?"bg-purple-600 text-white":t?"bg-gray-100 text-gray-600":"bg-white/10 text-white/60"}`,children:F},c))})}),N==="knowledge"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:e.jsx(ie,{label:"段ä½",isLight:t,children:e.jsx("select",{value:y,onChange:c=>xe(Number(c.target.value)),className:ue(t),children:at.slice(1).map((c,F)=>e.jsx("option",{value:F+1,children:`æ®µä½ ${F+1} · ${c}`},F+1))})})}),$&&e.jsx("div",{className:`text-xs ${t?"text-gray-500":"text-white/50"}`,children:"æ£å¨å è½½é¢ç®â¦"}),b.length>0&&e.jsx(ie,{label:"ç¥è¯ç¹çéï¼å¯å¤éï¼",isLight:t,children:e.jsx("div",{className:"flex flex-wrap gap-1.5",children:b.map(c=>e.jsx("button",{type:"button",onClick:()=>m(c.name),className:`px-2 py-1 rounded text-xs ${k.includes(c.name)?"bg-purple-600 text-white":t?"bg-gray-100 text-gray-600 hover:bg-gray-200":"bg-white/10 text-white/60 hover:bg-white/20"}`,children:c.name},c.name))})}),R.length>0&&e.jsx(ie,{label:`é¢ç®é¢è§ï¼å·²é ${X.length}/${R.length}ï¼`,isLight:t,children:e.jsxs("div",{className:`rounded-lg border max-h-60 overflow-y-auto ${t?"border-gray-200":"border-white/10"}`,children:[e.jsxs("div",{className:`flex items-center justify-between px-2 py-1.5 text-xs sticky top-0 ${t?"bg-gray-50 border-b border-gray-200":"bg-white/5 border-b border-white/10"}`,children:[e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:X.length===R.length&&R.length>0,onChange:be}),e.jsx("span",{children:"å
¨é/å
¨ä¸é"})]}),e.jsxs("span",{className:t?"text-gray-500":"text-white/50",children:[X.length," / ",R.length]})]}),R.map(c=>e.jsxs("label",{className:`flex items-start gap-2 px-2 py-1.5 cursor-pointer text-sm ${t?"hover:bg-gray-50 border-b border-gray-100":"hover:bg-white/5 border-b border-white/5"}`,children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:X.includes(c.id),onChange:()=>pe(c.id)}),e.jsxs("span",{className:"flex-1",children:[e.jsx("span",{className:t?"text-gray-800":"text-white/90",children:c.title}),e.jsxs("span",{className:`ml-2 text-[10px] ${t?"text-gray-500":"text-white/40"}`,children:[c.type," · ",c.difficulty," · ",c.tagList.join("ã")]})]})]},c.id))]})}),R.length===0&&!$&&e.jsx("div",{className:`text-xs ${t?"text-gray-500":"text-white/40"}`,children:"è¯¥æ®µä½ + ç¥è¯ç¹ä¸ææ é¢ç®ï¼è¯·è°æ´çéæ¡ä»¶ææ¢æ®µä½ã"})]}):e.jsx(ie,{label:N==="special_paper"?"éæ©è¯å·":"éæ©æ¯èµ",isLight:t,children:e.jsxs("select",{value:o,onChange:c=>P(c.target.value),className:ue(t),children:[e.jsx("option",{value:"",children:"â è¯·éæ© â"}),(N==="special_paper"?A.papers:A.competitions).map(c=>e.jsx("option",{value:c.id,children:c.name},c.id))]})}
1),e.jsx(ie,{label:"æªæ¢æ¶é´ï¼éå¡«ï¼",isLight:t,children:e.jsx("input",{type:"datetime-local",value:p,onChange:c=>C(c.target.value),className:ue(t)})}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[e.jsx("button",{className:ht(t),onClick:u,children:"åæ¶"}),e.jsx("button",{className:"rounded-lg bg-purple-600 hover:bg-purple-500 text-white px-4 py-2 text-sm font-medium disabled:opacity-50",disabled:M,onClick:q,children:M?"æ´¾åä¸â¦":"æ´¾å"})]})]})})}function Oe({isLight:t,title:n,onClose:u,wide:s,children:f}){return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4",children:e.jsxs("div",{className:`rounded-2xl w-full ${s?"max-w-3xl":"max-w-md"} max-h-[90vh] overflow-y-auto p-5 ${t?"bg-white":"bg-[#1b1430] border border-white/10"}`,children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:`text-lg font-bold ${t?"text-gray-900":"text-white"}`,children:n}),e.jsx("button",{onClick:u,className:`text-sm ${t?"text-gray-400 hover:text-gray-600":"text-white/50 hover:text-white"}`,children:"â"})]}),f]})})}function ie({label:t,isLight:n,children:u}){return e.jsxs("div",{children:[e.jsx("div",{className:`text-xs mb-1 ${n?"text-gray-500":"text-white/50"}`,children:t}),u]})}function Be({title:t,isLight:n,children:u}){return e.jsxs("div",{className:`rounded-xl p-3 ${n?"bg-gray-50 border border-gray-100":"bg-white/5 border border-white/10"}`,children:[e.jsx("div",{className:`text-sm font-semibold mb-2 ${n?"text-gray-800":"text-white"}`,children:t}),u]})}function ze({label:t,value:n,isLight:u}){return e.jsxs("div",{className:`rounded-lg py-3 text-center ${u?"bg-purple-50":"bg-purple-500/10"}`,children:[e.jsx("div",{className:"text-2xl font-bold text-purple-500",children:n}),e.jsx("div",{className:`text-xs mt-1 ${u?"text-gray-500":"text-white/50"}`,children:t})]})}function We({isLight:t}){return e.jsx("div",{className:`text-xs ${t?"text-gray-400":"text-white/40"}`,children:"ææ æ°æ®"})}function ue(t){return`w-full rounded-lg px-3 py-2 text-sm outline-none ${t?"bg-gray-50 border border-gray-200 text-gray-900 focus:border-purple-400":"bg-black/20 border border-white/10 text-white focus:border-purple-400"}`}function ht(t){return`rounded-lg px-3 py-2 text-sm ${t?"bg-gray-100 hover:bg-gray-200 text-gray-700":"bg-white/10 hover:bg-white/20 text-white"}`}function _t(t,n=!0){r.useEffect(()=>{if(!n)return;const u=s=>{s.key==="Escape"&&t()};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[t,n])}const Gt=["","èæ°æå£«","ééå¦å¾","ç½é¶æ¢é©è
","ç½é¶æå£«","é»éåé©å®¶","é»éåè
","ééç²¾è±","ä¼ è¯´ä»£ç ç¥"],tt={platform:"å¹³å°ä»»å¡",practice:"ç»ä¹ ä»»å¡",special:"ä¸é¡¹è®ç»ä»»å¡"};function Xt({user:t,onNavigate:n}){const{themeData:u}=pt(),s=u.isLight,{confirm:f,alert:i,dialog:g}=Se(s),h=r.useCallback(a=>i("æç¤º",a),[i]),T=r.useRef(!1),N=r.useRef(!1),x=r.useRef(!1),[o,P]=r.useState(!0),[p,C]=r.useState("none"),[A,O]=r.useState(null),[M,K]=r.useState([]),[y,S]=r.useState(null),[k,Q]=r.useState(null),[b,z]=r.useState(null),[R,te]=r.useState([]),[$,w]=r.useState([]),[X,ce]=r.useState({papers:[],competitions:[]}),[Y,xe]=r.useState(null),[pe,be]=r.useState([]),[m,q]=r.useState(null),{notifications:c}=At(),F=r.useRef(null);r.useEffect(()=>{if(!c||c.length===0)return;const a=c.find(U=>U.type==="teacher_task_like"&&U.id!==F.current);if(!a)return;F.current=a.id;const v=a.refId,V=a.payload?.points??10;v&&be(U=>U.map(D=>D.id===v?{...D,liked:!0,likePoints:V,likedAt:a.createdAt||new Date().toISOString()}:D))},[c]);const[se,_]=r.useState(!1),[G,Z]=r.useState(!1),[Ke,Ce]=r.useState(!1),[lt,Ue]=r.useState(null),[gt,rt]=r.useState(!1),[Pe,bt]=r.useState("students"),[de,fe]=r.useState({open:!1}),[Fe,ft]=r.useState("all"),[He,yt]=r.useState("all"),[Qe,jt]=r.useState("all"),[Je,wt]=r.useState(""),Ve=r.useCallback(async()=>{if(!T.current){T.current=!0,P(!0);try{const a=await B.status();a?.code===200&&(C(a.data.role),O(a.data))}catch(a){h("å 载失败ï¼"+(a?.message||"ç½ç»é误"))}finally{P(!1)}try{const[a,v]=await Promise.all([B.activities(),B.ranking()]);a?.code===200&&K(a.data||[]),v?.code===200&&S(v.data)}catch{}}},[h]),oe=r.useCallback(async()=>
1{if(!N.current){N.current=!0;try{const[a,v,V,U,D]=await Promise.all([B.me(),B.students(),B.tasks(),B.taskOptions(),B.teamDashboard()]);a?.code===200&&z(a.data),v?.code===200&&te(v.data||[]),V?.code===200&&w(V.data||[]),U?.code===200&&ce(U.data||{papers:[],competitions:[]}),D?.code===200&&Q(D.data)}catch(a){h("è®²å¸æ°æ®å 载失败ï¼"+(a?.message||""))}finally{N.current=!1}}},[h]),Te=r.useCallback(async()=>{if(!x.current){x.current=!0;try{const[a,v,V]=await Promise.all([B.myTeacher(),B.myTasks(),Me.learningStats()]);a?.code===200&&xe(a.data),v?.code===200&&be(v.data||[]),V?.code===200&&q(V.data)}catch(a){h("å¦åæ°æ®å 载失败ï¼"+(a?.message||""))}finally{x.current=!1}}},[h]);r.useEffect(()=>{let a=!1;return(async()=>a||await Ve())(),()=>{a=!0}},[]),r.useEffect(()=>{p==="teacher"&&oe(),p==="student"&&Te()},[p,oe,Te]);const vt=a=>{navigator.clipboard?.writeText(a).then(()=>h("èå¸ç å·²å¤å¶ï¼"+a),()=>h("å¤å¶å¤±è´¥ï¼è¯·æå¨å¤å¶ï¼"+a))},nt=a=>a.dueAt?new Date(a.dueAt).getTime()<Date.now():!1,Nt=a=>{if(nt(a)){h("ä»»å¡å·²æªæ¢ï¼æ æ³ç»§ç»å®æ");return}if(a.type==="practice"&&a.targetType==="competition"&&a.targetId){n("competition",{competitionId:a.targetId});return}if(a.type==="special"&&a.targetType==="special_paper"&&a.targetId){n("daily",{tab:"special",paperId:a.targetId,resumeFromPaperId:a.targetId});return}if(a.type==="practice"&&a.targetType==="knowledge"&&a.questionIds){const v=String(a.questionIds).split(/[,ï¼\s]+/).map(V=>V.trim()).filter(Boolean);if(v.length>0){n("daily",{questionIds:v});return}}if(a.type==="platform"&&a.targetType==="blog_approved"){n("blog");return}if(a.type==="platform"&&a.targetType==="daily_12"){n("daily");return}if(a.type==="platform"){h("平尿´»å¨ä»»å¡ï¼æä»»å¡è¯´æå®æå³å¯");return}h("任塿䏿¯æèªå¨è·³è½¬ï¼è¯·æå¨åå¾å¯¹åºç»ä¹ ")},$t=async a=>{fe({open:!0,taskId:a.id,loading:!0});const v=await B.taskDetails(a.id);v?.code===200?fe({open:!0,taskId:a.id,data:v.data,loading:!1}):(h(v?.message||"å 载任å¡è¯¦æ
失败"),fe({open:!1}))},kt=r.useCallback(async()=>{if(!de.taskId)return;fe(v=>({...v,loading:!0}));const a=await B.taskDetails(de.taskId);a?.code===200&&fe({open:!0,taskId:de.taskId,data:a.data,loading:!1})},[de.taskId]),St=async a=>{if(!de.taskId)return;const v=await B.likeTask(de.taskId,a);v?.code===200?(h(v.data?.points>0?"ç¹èµæåï¼å¦åè·å¾ 10 积å":"å·²ç»ç¹èµè¿"),await kt()):h(v?.message||"ç¹èµå¤±è´¥")},it=async(a,v)=>{try{const U=!!t&&t.id===a?await Me.myReportData():await B.studentReportData(a);if(U?.code!==200){h("è·åæ¥åæ°æ®å¤±è´¥");return}const D=U.data,ye=document.createElement("canvas"),J=760,je=1280;ye.width=J,ye.height=je;const l=ye.getContext("2d");if(!l)return;const d=(j,E,I,W,ae)=>{const L=Math.min(ae,I/2,W/2);l.beginPath(),l.moveTo(j+L,E),l.lineTo(j+I-L,E),l.quadraticCurveTo(j+I,E,j+I,E+L),l.lineTo(j+I,E+W-L),l.quadraticCurveTo(j+I,E+W,j+I-L,E+W),l.lineTo(j+L,E+W),l.quadraticCurveTo(j,E+W,j,E+W-L),l.lineTo(j,E+L),l.quadraticCurveTo(j,E,j+L,E),l.closePath()},ee=(j,E,I,W,ae,L=0)=>{l.save(),l.font=W,l.fillStyle=ae,L>0&&(l.shadowColor=ae,l.shadowBlur=L),l.fillText(j,E,I),l.restore()},he=l.createLinearGradient(0,0,0,je);he.addColorStop(0,"#7c3aed"),he.addColorStop(.45,"#312e81"),he.addColorStop(1,"#0f172a"),l.fillStyle=he,l.fillRect(0,0,J,je);const Ie=l.createRadialGradient(J/2,-60,20,J/2,120,420);Ie.addColorStop(0,"rgba(167, 139, 250, 0.35)"),Ie.addColorStop(1,"rgba(167, 139, 250, 0)"),l.fillStyle=Ie,l.fillRect(0,0,J,300),l.textAlign="center",ee("å¦åå¦ä¹ æ¥å",J/2,80,"bold 44px sans-serif","#ffffff",18),l.fillStyle="rgba(255,255,255,0.75)",l.font="20px sans-serif",l.fillText(D.teacher?`${D.teacher.realName} · ${D.teacher.campus}`:"æçå¦ä¹ æ¥å",J/2,118);const we=D.student.avatar;if(we&&Dt(we))try{const j=await new Promise(E=>{const I=new Image;I.onload=()=>E(I),I.onerror=()=>E(null),I.src=we});if(j){const I=J/2,W=212;l.save(),l.beginPath(),l.arc(I,W,46,0,Math.PI*2),l.closePath(),l.clip(),l.drawImage(j,I-46,W-46,92,92),l.restore()}else l.font="80px sans-serif",l.textAlign="center",l.fillText("ð§âð",J/2,230)}catch{l.font="80px sans-serif",l.textAlign="center",l.fillText("ð§âð",J/2,230)}else l.font="80px sans-serif",l.textAlign="center",l.fillText(we||"ð§âð",J/2,230);l.font="bold 36px sans-serif",l.fillStyle="#ffffff",l.fillText(D.student.nickname,J/2,285);const ct=D.stageName||`é¶æ®µ${D.stageId||1}`,_e=l.measureText(ct).width+32;l.save(),l.translate(J/2,318);const Xe=l.createLinearGradient(-_e/2,0,_e/2,0);Xe.addColorStop(0,"#f59e0b"),Xe.addColorStop(1,"#fbbf24"),l.fillStyle=Xe,d(-_e/2,-16,_e,32,16),l.fill(),l.fillStyle="#451a03",l.font="bold 16px sans-serif",l.textAlign="center",l.fillText(ct,0,6),l.restore(
1);const Ye=[{label:"å® ç©ç级",value:`Lv.${D.petLevel}`,sub:D.petId==="dragon"?"é¾ä»":D.petId==="owl"?"ç«å¤´é¹°":D.petId==="phoenix"?"å¤å°":D.petId==="qilin"?"éºéº":"å® ç©",color:"#8b5cf6"},{label:"å® ç©ç»éª",value:String(D.petExp),sub:"累计ç»éª",color:"#06b6d4"},{label:"段ä½ç§¯å",value:String(D.totalScore),sub:"å¦ä¹ 累计",color:"#f59e0b"},{label:"è¿ç»æå¡",value:`${D.streak}天`,sub:"å¦ä¹ streak",color:"#22c55e"}],ge=160,Ct=96,Tt=(J-Ye.length*ge-(Ye.length-1)*16)/2;Ye.forEach((j,E)=>{const I=Tt+E*(ge+16),W=360;l.save(),l.shadowColor=j.color,l.shadowBlur=14,l.fillStyle="rgba(255,255,255,0.08)",d(I,W,ge,Ct,16),l.fill(),l.restore(),l.fillStyle=j.color,d(I,W,ge,5,2),l.fill(),l.textAlign="center",l.fillStyle="#ffffff",l.font="bold 26px sans-serif",l.fillText(j.value,I+ge/2,W+44),l.fillStyle="rgba(255,255,255,0.55)",l.font="14px sans-serif",l.fillText(j.label,I+ge/2,W+66),l.font="12px sans-serif",l.fillText(j.sub,I+ge/2,W+83)});const me=D.stats,Ge=[{label:"çé¢",value:me.answerCount,color:"#3b82f6",max:Math.max(me.answerCount,1)},{label:"æµè¯",value:me.assessCount,color:"#8b5cf6",max:Math.max(me.assessCount,1)},{label:"ä¸é¡¹",value:me.specialCount,color:"#22c55e",max:Math.max(me.specialCount,1)},{label:"åèµ",value:me.compReg,color:"#f59e0b",max:Math.max(me.compReg,1)}],dt=Math.max(...Ge.map(j=>j.value),5),ve=500,H=70,ot=J-70,Ne=ve+260,Ze=ot-H,Ae=48,xt=(Ze-Ae*Ge.length)/(Ge.length+1);l.textAlign="left",l.fillStyle="#ffffff",l.font="bold 22px sans-serif",l.fillText("è½ååæ",H,ve-24),l.fillStyle="rgba(255,255,255,0.06)",d(H-20,ve-12,Ze+40,290,18),l.fill();for(let j=0;j<=4;j++){const E=ve+(Ne-ve)*(1-j/4);l.strokeStyle="rgba(255,255,255,0.12)",l.beginPath(),l.moveTo(H,E),l.lineTo(ot,E),l.stroke(),l.fillStyle="rgba(255,255,255,0.45)",l.font="12px sans-serif",l.textAlign="right",l.fillText(String(Math.round(dt*j/4)),H-8,E+4)}Ge.forEach((j,E)=>{const I=H+xt+E*(Ae+xt),W=(Ne-ve-20)*j.value/dt,ae=Ne-W,L=l.createLinearGradient(0,Ne,0,ae);L.addColorStop(0,j.color),L.addColorStop(1,"#ffffff"),l.fillStyle=L,l.shadowColor=j.color,l.shadowBlur=10,d(I,ae,Ae,W,8),l.fill(),l.shadowBlur=0,l.fillStyle="#ffffff",l.font="bold 16px sans-serif",l.textAlign="center",l.fillText(String(j.value),I+Ae/2,ae-8),l.fillStyle="rgba(255,255,255,0.7)",l.font="14px sans-serif",l.fillText(j.label,I+Ae/2,Ne+22)});const De=Ne+50;l.textAlign="left",l.fillStyle="#ffffff",l.font="bold 22px sans-serif",l.fillText("ä»»å¡å®ææ
åµ",H,De);const $e=Ze+40;l.fillStyle="rgba(255,255,255,0.06)",d(H-20,De+8,$e,Math.max(70,(D.taskStatus.length||1)*44+18),18),l.fill(),!D.taskStatus||D.taskStatus.length===0?(l.fillStyle="rgba(255,255,255,0.55)",l.font="16px sans-serif",l.fillText("ææ ä»»å¡",H,De+44)):D.taskStatus.slice(0,5).forEach((j,E)=>{const I=De+40+E*42,W=j.done?1:Math.min(1,Math.max(0,(j.score||0)/100));l.fillStyle="rgba(255,255,255,0.12)",d(H,I,$e-40,10,5),l.fill();const ae=l.createLinearGradient(H,0,H+$e-40,0);ae.addColorStop(0,j.done?"#22c55e":"#3b82f6"),ae.addColorStop(1,j.done?"#4ade80":"#60a5fa"),l.fillStyle=ae,d(H,I,($e-40)*W,10,5),l.fill(),l.fillStyle="#ffffff",l.font="15px sans-serif",l.fillText(`${j.done?"â
":"â³"} ${j.title}`,H,I-6),l.fillStyle="rgba(255,255,255,0.65)",l.font="12px sans-serif",l.textAlign="right",l.fillText(j.done?"已宿":`${Math.round(W*100)}%`,H+$e-40,I-6),l.textAlign="left"});const mt=De+Math.max(90,(D.taskStatus.length||1)*44+50);D.prizes&&D.prizes.length>0&&(l.fillStyle="#ffffff",l.font="bold 22px sans-serif",l.fillText("èµäºå¥é¡¹",H,mt),D.prizes.slice(0,3).forEach((j,E)=>{const I=mt+36+E*40;l.fillStyle="rgba(251, 191, 36, 0.18)",d(H,I-20,$e-40,34,12),l.fill(),l.fillStyle="#fbbf24",l.font="18px sans-serif",l.fillText("ð",H+12,I),l.fillStyle="#ffffff",l.font="16px sans-serif",l.fillText(`${j.rankLabel} +${j.points} 积å`,H+40,I)})),l.textAlign="center",l.fillStyle="rgba(255,255,255,0.45)",l.font="14px sans-serif",l.fillText(`çææ¶é´ï¼${new Date(D.generatedAt).toLocaleString()}`,J/2,je-28);const It=ye.toDataURL("image/png"),Le=document.createElement("a");Le.href=It,Le.download=`${v}-å¦ä¹ æ¥å.png`,Le.click()}catch(V){h("çææ¥å失败ï¼"+(V?.message||""))}};return o?e.jsxs("div",{className:`min-h-screen flex flex-col items-center justify-center ${s?"bg-gray-50 text-gray-400":"bg-[#0f0b1e] text-white/40"}`,children:[e.jsx("div",{className:"w-10 h-10 border-2 border-purple-400/30 border-t-purple-400 rounded-full animate-spin mb
1-4"}),e.jsx("div",{children:"æ£å¨å è½½å¸çäºèâ¦"})]}):e.jsxs("div",{className:`min-h-screen ${s?"bg-gray-50":"bg-[#0f0b1e]"}`,children:[e.jsxs("div",{className:"max-w-5xl mx-auto px-4 py-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:`text-2xl font-bold ${s?"text-gray-900":"text-white"}`,children:"ð¤ å¸çäºè"}),e.jsx("p",{className:`text-sm mt-1 ${s?"text-gray-500":"text-white/50"}`,children:"è¿æ¥è®²å¸ä¸å¦åï¼ä¸èµ·ææªå级"})]}),e.jsx(Qt,{role:p,applicationStatus:A?.application?.status,isLight:s})]}),p==="none"&&e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs(ne,{isLight:s,className:"border-purple-500/30",children:[e.jsx("div",{className:"text-3xl mb-2",children:"ð"}),e.jsx("h3",{className:`font-semibold text-lg ${s?"text-gray-900":"text-white"}`,children:"æä¸ºè®²å¸"}),e.jsx("p",{className:`text-sm mt-1 mb-4 ${s?"text-gray-500":"text-white/60"}`,children:"å¡«ååå¸ãæ ¡åºãææºå·ãçå®å§åå¹¶æäº¤ï¼å®¡æ ¸éè¿åå¯å¼é讲å¸åè½ã设置èå¸ç ã管çå¦åã"}),e.jsx("button",{onClick:()=>_(!0),className:"w-full rounded-lg bg-purple-600 hover:bg-purple-500 text-white py-2.5 font-medium",children:"ç³è¯·æä¸ºè®²å¸"})]}),e.jsxs(ne,{isLight:s,className:"border-indigo-500/30",children:[e.jsx("div",{className:"text-3xl mb-2",children:"ð§âð"}),e.jsx("h3",{className:`font-semibold text-lg ${s?"text-gray-900":"text-white"}`,children:"ææ¯å¦å"}),e.jsx("p",{className:`text-sm mt-1 mb-4 ${s?"text-gray-500":"text-white/60"}`,children:"å·²æè®²å¸èå¸ç ï¼è¾å
¥èå¸ç å³å¯æä¸ºè¯¥è®²å¸çå¦åï¼æ¥æ¶ä»»å¡ãæ¥çå¦ä¹ æ°æ®ã"}),e.jsx("button",{onClick:()=>Z(!0),className:"w-full rounded-lg bg-indigo-600 hover:bg-indigo-500 text-white py-2.5 font-medium",children:"ç»å®è®²å¸"})]})]})}),p==="applicant"&&e.jsx(ne,{isLight:s,children:A?.application?.status==="revoked"?e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:`font-semibold text-lg ${s?"text-gray-900":"text-white"}`,children:"讲å¸èº«ä»½å·²è¢«æ¤é"}),e.jsx("p",{className:`text-sm mt-2 ${s?"text-gray-600":"text-white/70"}`,children:"æ¨ç讲å¸èº«ä»½å·²è¢«ç®¡ç忤éï¼åä¸å¦åç»å®å
³ç³»å·²å
¨é¨è§£é¤ï¼æ¨å·²æ¢å¤ä¸ºæ®éç¨æ·ã"}),A.application.rejectReason&&e.jsxs("div",{className:`mt-4 rounded-xl p-4 ${s?"bg-gray-100 border border-gray-200":"bg-white/5 border border-white/10"}`,children:[e.jsx("div",{className:`text-sm font-medium ${s?"text-gray-700":"text-white/80"}`,children:"æ¤éåå "}),e.jsx("div",{className:`text-sm mt-1 ${s?"text-gray-600":"text-white/60"}`,children:A.application.rejectReason})]}),e.jsxs("div",{className:"mt-4 flex flex-wrap gap-3",children:[e.jsx("button",{onClick:()=>_(!0),className:"rounded-lg bg-purple-600 hover:bg-purple-500 text-white px-4 py-2 text-sm",children:"éæ°ç³è¯·å
¥é©»"}),e.jsx("button",{onClick:()=>Z(!0),className:"rounded-lg bg-indigo-600 hover:bg-indigo-500 text-white px-4 py-2 text-sm",children:"ç»å®è®²å¸ï¼æä¸ºå¦åï¼"})]}),e.jsx("p",{className:`text-xs mt-3 ${s?"text-gray-500":"text-white/40"}`,children:"æ¨å½åå·²æ¢å¤ä¸ºæ®éç¨æ·ï¼å¯éæ°ç³è¯·æä¸ºè®²å¸ï¼ä¹å¯ç¨å
¶ä»è®²å¸çèå¸ç ç»å®æä¸ºå
¶å¦åã"})]}):A?.application?.status==="rejected"?e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:`font-semibold text-lg ${s?"text-gray-900":"text-white"}`,children:"ç³è¯·æªéè¿"}),e.jsx("p",{className:`text-sm mt-2 ${s?"text-gray-600":"text-white/70"}`,children:"æ¨ç讲å¸å
¥é©»ç³è¯·æªéè¿å®¡æ ¸ï¼å¯è¡¥å
ææåéæ°æäº¤ã"}),e.jsxs("div",{className:`mt-4 rounded-xl p-4 ${s?"bg-rose-50 border border-rose-200":"bg-rose-500/10 border border-rose-500/30"}`,children:[e.jsx("div",{className:`text-sm font-medium ${s?"text-rose-700":"text-rose-300"}`,children:"å®¡æ ¸æªéè¿"}),e.jsxs("div",{className:`text-sm mt-1 ${s?"text-rose-600":"text-rose-200/80"}`,children:["åå ï¼",A.application.rejectReason||"ææä¸è¶³ï¼è¯·è¡¥å
åéæ°æäº¤"]})]}),e.jsxs("div",{className:"mt-4 flex flex-wrap gap-3",children:[e.jsx("button",{onClick:()=>_(!0),className:"rounded-lg bg-purple-600 hover:bg-purple-500 text-white px-4 py-2 text-sm",children:"è¡¥å
ææéæ°æäº¤"}),e.jsx("button",{onClick:()=>Z(!0),className:"rounded-lg bg-indigo-600 hover:bg-indigo-500 text-white px-4 py-2 text-sm",children:"ç»å®è®²å¸ï¼æä¸ºå¦åï¼"})]}),e.jsx("p",{className:`text-xs mt-3 ${s?"text-gray-500":"text-white/40"}`,children:"æ¨å½åæ¯æ®éç¨æ·ï¼å¯éæ°ç³è¯·æä¸ºè®²å¸ï¼ä¹å¯ç¨å
¶ä»è®²å¸çèå¸ç ç»å®æä¸ºå
¶å¦åã"})]}):e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:`font-semibold text-lg ${s?"text-gray-900":"text-white"}`,children:"ç³è¯·å®¡æ ¸ä¸"}),e.jsx("p",{className:`text-sm mt-2 ${s?"text-gray-600":"text-white/70"}`,children:"æ¨ç讲å¸å
¥é©»ç³è¯·æ£å¨å®¡æ ¸ï¼è¯·èå¿çå¾
管çåå¤çã"})]})}),p==="teacher"&&b&&e.jsxs("div",{className:"space-y-6",children:[e.jsx(ne,{isLight:s,children:e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:`text-sm ${s?"text-gray-500":"text-white/60"}`,children:"æçèå¸ç ï¼å¦å忤ç»å®ï¼"}),e.jsx("div",{className:`text-2xl font-bold tracking-widest mt-1 ${s?"text-gray-900":"text-white"}`,children:b.teacherCode}),e.jsxs("div",{className:`text-xs mt-1 ${s?"text-gray-400":"text-white/40"}`,children:[b.realName," · ",b.city," ",b.campus]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:()=>vt(b.teacherCode),className:`rounded-lg px-3 py-2 text-sm ${s?"bg-gray-100 hover:bg-gray-200 text-gray-700":"bg-white/10 hover:bg-white/20 text-white"}`,children:"å¤å¶"}),e.jsx("button",{onClick:()=>{const a=prompt("设置æ°çèå¸ç ï¼4-20 ä½åæ¯æ°åï¼",b.teacherCode);a&&(async()=>{const v=await B.setCode(a);v?.code===200?(h("èå¸ç å·²æ´æ°"),oe()):h(v?.message||"失败")})()},className:`rounded-lg px-3 py-2 text-sm ${s?"bg-gray-100 hover:bg-gray-200 text-gray-700":"bg-white/10 hover:bg-white/20 text-white"}`,children:"ä¿®æ¹"})]})]})}),e.jsx("div",{className:"flex gap-2",children:[{k:"students",label:`å¦å管çï¼${R.length}ï¼`},{k:"tasks",label:"ä»»å¡ä¸æ°æ®"},{k:"classes",label:"æçç级"}].map(a=>e.jsx("button",{onClick:()=>bt(a.k),className:`px-4 py-2 rounded-lg text-sm font-medium transition-colors ${Pe===a.k?"bg-purple-600 text-white":s?"bg-gray-100 text-gray-600 hover:bg-gray-200":"bg-white/5 text-white/60 hover:bg-white/10"}`,children:a.label},a.k))}),Pe==="students"&&e.jsx(ne,{isLight:s,children:R.length===0?e.jsx(le,{text:"è¿æ²¡æå¦åç»å®ï¼æèå¸ç å享ç»å¦åå§ï½",isLight:s}):e.jsx("div",{className:"space-y-2 max-h-[480px] overflow-y-auto pr-1",children:R.map(a=>e.jsxs("div",{role:"button",tabIndex:0,onClick:()=>Ue(a),className:`w-full text-left rounded-xl p-3 flex items-center gap-3 transition-all cursor-pointer select-none ${s?"bg-white hover:bg-purple-50 border border-gray-100 shadow-sm":"bg-white/5 hover:bg-white/10 border border-white/10"}`,children:[e.jsx("div",{className:`w-12 h-12 rounded-full flex items-center justify-center text-2xl shrink-0 ${s?"bg-purple-100":"bg-purple-500/20"}`,children:e.jsx(ke,{value:a.avatar,fallback:"ð§âð"})}),e.jsxs("div",{className:"min-w-0 shrink-0 w-[110px]",children:[e.jsx("div",{className:`text-sm font-semibold truncate ${s?"text-gray-900":"text-white"}`,children:a.nickname||"å¦å"}),e.jsx("div",{className:`inline-block mt-1 px-2 py-0.5 rounded-full text-xs font-medium ${st(a.stageId||1,s)}`,children:a.stageName||`é¶æ®µ${a.stageId||1}`}),a.remark&&e.jsxs("div",{className:`mt-1 text-[10px] leading-tight truncate max-w-[110px] ${s?"text-amber-600":"text-amber-300"}`,title:a.remark,children:["夿³¨ï¼",a.remark]}),e.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:(a.classes||[]).length>0?a.classes.map(v=>e.jsx("span",{className:`text-[10px] leading-none px-1.5 py-0.5 rounded-full ${s?"bg-purple-100 text-purple-700":"bg-purple-500/20 text-purple-200"}`,children:v.name},v.id)):e.jsx("span",{className:`text-[10px] leading-none ${s?"text-gray-400":"text-white/40"}`,children:"æªåç"})})]}),e.jsxs("div",{className:"flex-1 grid grid-cols-4 gap-2 text-center",children:[e.jsxs("div",{className:`rounded-lg py-1.5 ${s?"bg-blue-50":"bg-blue-500/10"}`,children:[e.jsx("div",{className:"text-sm font-bold text-blue-500",children:a.answerCount}),e.jsx("div",{className:`text-[10px] ${s?"text-gray-500":"text-white/50"}`,children:"çé¢"})]}),e.jsxs("div",{className:`rounded-lg py-1.5 ${s?"bg-green-50":"bg-green-500/10"}`,children:[e.jsx("div",{className:"text-sm font-bold text-green-500",children:a.specialCount}),e.jsx("div",{className:`text-[10px] ${s?"text-gray-500":"text-white/50"}`,children:"ä¸é¡¹"})]}),e.jsxs("div",{className:`rounded-lg py-1.5 ${s?"bg-amber-50":"bg-amber-500/10"}`,children:[e.jsx("div",{className:"text-sm font-bold text-amber-500",children:a.compReg}),e.jsx("div",{className:`text-[10px] ${s?"text-gray-500":"text-white/50"}`,children:"åèµ"})]}),e.jsxs("div",{className:`rounded-lg py-1.5 ${s?"bg-purple-50":"bg-purple-500/10"}`,children:[e.jsxs("div",{className:"text-sm font-bold text-purple-500 flex items-center justify-center gap-0.5",children:[e.jsx("span",{"aria-hidden":!0,
1children:"ð"}),e.jsx("span",{children:a.points??0})]}),e.jsx("div",{className:`text-[10px] ${s?"text-gray-500":"text-white/50"}`,children:"é»ç³"})]})]}),e.jsxs("div",{className:"shrink-0 text-right hidden sm:flex flex-col items-end gap-1",children:[e.jsxs("div",{className:`text-xs ${s?"text-gray-400":"text-white/50"}`,children:["Lv.",a.petLevel]}),e.jsx("div",{className:`text-xs px-2 py-1 rounded-lg ${s?"bg-purple-100 text-purple-700":"bg-purple-500/20 text-purple-200"}`,children:"æ¥ç"}),a.unbindRequested?e.jsx("button",{onClick:v=>{v.stopPropagation(),f("确认解ç»",`å¦åã${a.nickname||"该å¦å"}ãå·²ç³è¯·è§£ç»ï¼ç¡®è®¤åå
¶å°æ¢å¤æªç»å®ç¶æå¹¶å¯éæ°ç»å®å
¶ä»èå¸`,async()=>{await B.confirmUnbind(a.id),oe()})},className:`text-xs px-2 py-1 rounded-lg ${s?"bg-amber-100 text-amber-700 hover:bg-amber-200":"bg-amber-500/20 text-amber-200 hover:bg-amber-500/30"}`,children:"确认解ç»"}):e.jsx("button",{onClick:v=>{v.stopPropagation(),f("åé¤å¦å",`确认å°ã${a.nickname||"该å¦å"}ã仿¨çå¦åååä¸åé¤ï¼åé¤å该å¦åå°æ¢å¤æªç»å®ç¶æã`,async()=>{await B.removeStudent(a.id),oe()})},className:`text-xs px-2 py-1 rounded-lg ${s?"bg-rose-100 text-rose-600 hover:bg-rose-200":"bg-rose-500/20 text-rose-300 hover:bg-rose-500/30"}`,children:"åé¤"})]})]},a.id))})}),Pe==="tasks"&&(()=>{const a=Array.from(new Map($.filter(d=>d.classId).map(d=>[d.classId,{id:d.classId,name:d.className||d.classId}])).values()),v=Date.now(),V=d=>d.dueAt&&new Date(d.dueAt).getTime()<v?"overdue":d.studentCount&&d.completedCount>=d.studentCount?"done":"active",U=$.filter(d=>{if(Fe==="regular"&&d.classId||Fe==="class"&&!d.classId||He!=="all"&&d.classId!==He)return!1;const ee=V(d);return!(Qe!=="all"&&ee!==Qe||Je.trim()&&!d.title.toLowerCase().includes(Je.trim().toLowerCase()))}),D=U.length,ye=U.filter(d=>V(d)==="active").length,J=U.filter(d=>V(d)==="overdue").length,je=U.length?Math.round(U.reduce((d,ee)=>d+(ee.studentCount?ee.completedCount/ee.studentCount:0),0)/U.length*100):0,l=`rounded-lg px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-purple-500/30 ${s?"bg-white border border-gray-300 text-gray-900":"bg-white/5 border border-white/20 text-white"}`;return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:`flex flex-wrap items-center gap-2 p-3 rounded-xl ${s?"bg-gray-50":"bg-white/5"}`,children:[e.jsxs("select",{value:Fe,onChange:d=>ft(d.target.value),className:l,children:[e.jsx("option",{value:"all",children:"å
¨é¨ä»»å¡"}),e.jsx("option",{value:"regular",children:"ð 常è§ä»»å¡"}),e.jsx("option",{value:"class",children:"ð« ç级任å¡"})]}),e.jsxs("select",{value:He,onChange:d=>yt(d.target.value),className:l,disabled:Fe==="regular",children:[e.jsx("option",{value:"all",children:"å
¨é¨ç级"}),a.map(d=>e.jsx("option",{value:d.id,children:d.name},d.id))]}),e.jsxs("select",{value:Qe,onChange:d=>jt(d.target.value),className:l,children:[e.jsx("option",{value:"all",children:"å
¨é¨ç¶æ"}),e.jsx("option",{value:"active",children:"è¿è¡ä¸"}),e.jsx("option",{value:"overdue",children:"å·²æªæ¢"}),e.jsx("option",{value:"done",children:"已宿"})]}),e.jsx("input",{type:"text",placeholder:"æç´¢ä»»å¡å",value:Je,onChange:d=>wt(d.target.value),className:`${l} flex-1 min-w-[140px]`}),e.jsx("button",{onClick:()=>Ce(!0),className:"rounded-lg bg-purple-600 hover:bg-purple-500 text-white px-4 py-2 text-sm font-medium whitespace-nowrap",children:"+ åå¸ä»»å¡"})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[e.jsxs("div",{className:`rounded-xl p-4 ${s?"bg-white border border-gray-200":"bg-white/5 border border-white/10"}`,children:[e.jsx("div",{className:`text-xs ${s?"text-gray-500":"text-white/50"}`,children:"æ»ä»»å¡"}),e.jsx("div",{className:`text-2xl font-semibold mt-1 ${s?"text-gray-900":"text-white"}`,children:D})]}),e.jsxs("div",{className:`rounded-xl p-4 ${s?"bg-white border border-gray-200":"bg-white/5 border border-white/10"}`,children:[e.jsx("div",{className:`text-xs ${s?"text-gray-500":"text-white/50"}`,children:"è¿è¡ä¸"}),e.jsx("div",{className:`text-2xl font-semibold mt-1 ${s?"text-gray-900":"text-white"}`,children:ye})]}),e.jsxs("div",{className:`rounded-xl p-4 ${s?"bg-white border border-gray-200":"bg-white/5 border border-white/10"}`,children:[e.jsx("div",{className:`text-xs ${s?"text-gray-500":"text-white/50"}`,children:"å·²æªæ¢"}),e.jsx("div",{className:`text-2xl font-semibold mt-1 ${s?"text-gray-900":"text-white"}`,children:J})]}),e.jsxs("div",{className:`rounded-xl p-4 ${s?"bg-white border border-gray-200":"bg-white/5 border border-white/10"}`,children:[e.jsx("div",{className:`text-xs ${s?"text-gray-500":"text-white/50"}`,children:"å¹³å宿ç"}),e.jsxs("div",{className:`text-2xl font-semibold mt-1 ${s?"text-gray-900":"text-white"}`,children:[je,"%"]})]})]}),$.length===0?e.jsx(le,{text:"å°æªåå¸ä»»å¡",isLight:s}):U.length===0?e.jsx("div",{className:`py-10 text-center text-sm ${s?"text-gray-400":"text-white/40"}`,children:"没æç¬¦åæ¡ä»¶çä»»å¡"}):e.jsx("div",{className:"space-y-3",children:U.map(d=>{const ee=V(d),he=d.studentCount?Math.round(d.completedCount/d.studentCount*100):0,Ie=!!d.classId;return e.jsx("div",{role:"button",tabIndex:0,onClick:()=>
1$t(d),className:`cursor-pointer ${ee==="overdue"?"opacity-70":""}`,children:e.jsxs(ne,{isLight:s,children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:`text-xs rounded-full px-2 py-0.5 ${s?"bg-purple-100 text-purple-700":"bg-purple-500/20 text-purple-200"}`,children:tt[d.type]||d.type}),Ie?e.jsxs("span",{className:`text-xs rounded-full px-2 py-0.5 ${s?"bg-indigo-100 text-indigo-700":"bg-indigo-500/20 text-indigo-200"}`,children:["ð« ",d.className||"ç级任å¡"]}):e.jsx("span",{className:`text-xs rounded-full px-2 py-0.5 ${s?"bg-emerald-100 text-emerald-700":"bg-emerald-500/20 text-emerald-200"}`,children:"ð 常è§ä»»å¡"}),e.jsx("span",{className:`font-medium ${s?"text-gray-900":"text-white"}`,children:d.title}),d.targetLabel&&e.jsxs("span",{className:`text-xs rounded-full px-2 py-0.5 ${s?"bg-sky-100 text-sky-700":"bg-sky-500/20 text-sky-200"}`,children:["ð¯ ",d.targetLabel]}),e.jsx("span",{className:`text-xs font-medium ${ee==="done"?s?"text-green-600":"text-green-300":ee==="overdue"?"text-red-500":s?"text-gray-500":"text-white/50"}`,children:ee==="done"?"â
已宿":ee==="overdue"?"â¹ å·²æªæ¢":"â³ è¿è¡ä¸"})]}),d.desc&&e.jsx("p",{className:`text-sm mt-1 ${s?"text-gray-500":"text-white/60"}`,children:d.desc}),e.jsxs("div",{className:`text-xs mt-2 ${s?"text-gray-400":"text-white/40"}`,children:["宿 ",d.completedCount,"/",d.studentCount,"ï¼",he,"%ï¼",d.dueAt&&` · ${ee==="overdue"?"å·²æªæ¢":"æªæ¢"} ${new Date(d.dueAt).toLocaleString("zh-CN",{hour12:!1,month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}`,typeof d.likeCount=="number"&&d.likeCount>0&&e.jsxs("span",{className:`ml-2 inline-flex items-center gap-1 rounded-full px-2 py-0.5 ${s?"bg-amber-100 text-amber-700":"bg-amber-500/20 text-amber-200"}`,children:[e.jsx("span",{children:"ð"}),e.jsxs("span",{children:["å·²ç¹èµ ",d.likeCount," 人 · ",d.likePointsTotal??d.likeCount*10," 积å"]})]})]})]}),e.jsx("button",{onClick:we=>{we.stopPropagation(),f("å é¤ä»»å¡","ç¡®å®å é¤è¯¥ä»»å¡ï¼",async()=>{await B.deleteTask(d.id),oe()})},className:`shrink-0 text-xs ${s?"text-rose-600 hover:text-rose-700":"text-rose-300 hover:text-rose-200"}`,children:"å é¤"})]}),e.jsx("div",{className:"mt-3",children:e.jsx("div",{className:`h-2 rounded-full overflow-hidden ${s?"bg-gray-100":"bg-white/10"}`,children:e.jsx("div",{className:`h-full transition-all ${ee==="overdue"?"bg-red-400":"bg-gradient-to-r from-purple-500 to-indigo-500"}`,style:{width:`${he}%`}})})})]})},d.id)})})]})})(),Pe==="classes"&&e.jsx(Rt,{isLight:s,onChanged:oe})]}),p==="student"&&e.jsxs("div",{className:"space-y-6",children:[Y&&e.jsxs(ne,{isLight:s,className:"border-indigo-500/30",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"text-3xl",children:e.jsx(ke,{value:Y.avatar})}),e.jsxs("div",{children:[e.jsxs("div",{className:`font-semibold ${s?"text-gray-900":"text-white"}`,children:[Y.realName," èå¸"]}),e.jsxs("div",{className:`text-sm ${s?"text-gray-500":"text-white/60"}`,children:[Y.city," ",Y.campus," · èå¸ç ",Y.teacherCode]})]})]}),e.jsx("div",{className:"mt-3 flex items-center gap-2",children:Y.unbindRequested?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:`text-xs px-2 py-1 rounded-lg ${s?"bg-amber-100 text-amber-700":"bg-amber-500/20 text-amber-200"}`,children:"è§£ç»ç³è¯·å·²æäº¤ï¼çå¾
讲å¸ç¡®è®¤"}),e.jsx("button",{onClick:async()=>{await B.unbindCancel(),Te()},className:`text-xs px-2 py-1.5 rounded-lg ${s?"bg-gray-100 text-gray-600 hover:bg-gray-200":"bg-white/5 text-white/60 hover:bg-white/10"}`,children:"æ¤éç³è¯·"})]}):e.jsx("button",{onClick:async()=>{await B.unbindRequest(),Te()},className:`text-xs px-3 py-1.5 rounded-lg ${s?"bg-rose-100 text-rose-600 hover:bg-rose-200":"bg-rose-500/20 text-rose-300 hover:bg-rose-500/30"}`,children:"ç³è¯·è§£ç»"})})]}),Y?.classes&&Y.classes.length>0&&e.jsxs(ne,{isLight:s,className:"border-purple-500/30",children:[e.jsxs("div",{className:`text-sm font-medium mb-2 ${s?"text-gray-600":"text-white/70"}`,children:["ð« æçç级ï¼",Y.classes.length,"ï¼"]}),e.jsx("div",{className:"space-y-2",children:Y.classes.map(a=>e.jsxs("div",{className:`rounded-lg p-3 ${s?"bg-purple-50":"bg-purple-500/10"}`,children:[e.jsx("div",{className:`text-base font-bold ${s?"text-gray-900":"text-white"}`,children:a.name}),e.jsxs("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[a.grade&&e.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${s?"bg-purple-100 text-purple-700":"bg-purple-500/20 text-purple-200"}`,children:a.grade}),e.jsxs("span",{className:`text-xs ${s?"text-gray-500":"text-white/50"}`,children:["ç主任ï¼",Y.realName," èå¸"]})]}),a.description&&e.jsx("div",{className:`mt-2 text-sm ${s?"text-gray-600":"text-white/60"}`,children:a.description})]},a.id))})]}),m&&e.jsxs("div",{role:"button",tabIndex:0,onClick:()=>rt(!0),className:`w-full text-left rounded-xl p-3 flex items-center gap-3 transition-all cursor-pointer select-none ${s?"bg-white hover:bg-purple-50 border border-gray-100 shadow-sm":"bg-white/5 hover:bg-white/10 border border-white/10"}`,children:[e.jsx("div",{className:`w-12 h-12 rounded-full flex items-center justify-center text-2xl shrink-0 ${s?"bg-purple-100":"bg-purple-500/20"}`,children:e.jsx(ke,{value:m.user.avatar,fallback:"ð§âð"})}),e.jsxs("div",{className:"min-w-0 shrink-0 w-[110px]",children:[e.jsx("div",{className:`text-sm font-semibold truncate ${s?"text-gray-900":"text-white"}`,children:m.user.nickname||"æ"}),e.jsx("div",{className:`inline-block mt-1 px-2 py-0.5 rounded-full text-xs font-medium ${st(m.user.stageId||1,s)}`,children:Gt[m.user.stageId||1]||`é¶æ®µ${m.user.stageId||1}`})]}),e.jsxs("div",{className:"flex-1 grid grid-cols-4 gap-2 text-center",children:[e.jsxs("div",{className:`rounded-lg py-1.5 ${s?"bg-blue-50":"bg-blue-500/10"}`,children:[e.jsx("div",{className:"text-sm font-bold text-blue-500",children:m.stats.answerCount}),e.jsx("div",{className:`text-[10px] ${s?"text-gray-500":"text-white/50"}`,children:"çé¢"})]}),e.jsxs("div",{className:`rounded-lg py-1.5 ${s?"bg-green-50":"bg-green-500/10"}`,children:[e.jsx("div",{className:"text-sm font-bold text-green-500",children:m.stats.specialCount}),e.jsx("div",{className:`text-[10px] ${s?"text-gray-500":"text-white/50"}`,children:"ä¸é¡¹"})]}),e.jsxs("div",{className:`rounded-lg py-1.5 ${s?"bg-amber-50":"bg-amber-500/10"}`,children:[e.jsx("div",{className:"text-sm font-bold text-amber-500",children:m.stats.compReg}),e.jsx("div",{className:`text-[10px] ${s?"text-gray-500":"text-white/50"}`,children:"åèµ"})]}),e.jsxs("div",{className:`rounded-lg py-1.5 ${s?"bg-purple-50":"bg-purple-500/10"}`,children:[e.jsxs("div",{className:"text-sm font-bold text-purple-500 flex items-center justify-center gap-0.5",children:[e.jsx("span",{"aria-hidden":!0,
1children:"ð"}),e.jsx("span",{children:m.user.points??0})]}),e.jsx("div",{className:`text-[10px] ${s?"text-gray-500":"text-white/50"}`,children:"é»ç³"})]})]}),e.jsxs("div",{className:"shrink-0 text-right hidden sm:block",children:[e.jsxs("div",{className:`text-xs ${s?"text-gray-400":"text-white/50"}`,children:["Lv.",m.pet.petLevel]}),e.jsx("div",{className:`text-xs mt-1 px-2 py-1 rounded-lg ${s?"bg-purple-100 text-purple-700":"bg-purple-500/20 text-purple-200"}`,children:"æ¥ç"})]})]}),e.jsxs(ne,{isLight:s,children:[e.jsx("h3",{className:`font-semibold ${s?"text-gray-900":"text-white"}`,children:"æçä»»å¡"}),pe.length===0?e.jsx(le,{text:"èå¸è¿æ²¡æç»ä½ åå¸ä»»å¡",isLight:s}):e.jsx("div",{className:"mt-3 space-y-2",children:pe.map(a=>{const v=nt(a);return e.jsxs("button",{disabled:v,onClick:()=>Nt(a),className:`w-full text-left rounded-xl p-3 flex items-center justify-between transition-colors ${v?s?"bg-gray-100 opacity-70 cursor-not-allowed":"bg-white/5 opacity-60 cursor-not-allowed":a.done?s?"bg-emerald-50 hover:bg-emerald-100 ring-1 ring-emerald-200":"bg-emerald-500/10 hover:bg-emerald-500/20 ring-1 ring-emerald-500/30":s?"bg-gray-50 hover:bg-gray-100":"bg-white/5 hover:bg-white/10"}`,children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`text-xs rounded-full px-2 py-0.5 ${s?"bg-purple-100 text-purple-700":"bg-purple-500/20 text-purple-200"}`,children:tt[a.type]||a.type}),a.classId?e.jsx("span",{className:`text-xs rounded-full px-2 py-0.5 ${s?"bg-indigo-100 text-indigo-700":"bg-indigo-500/20 text-indigo-200"}`,title:a.className||"",children:"ð« ç级任å¡"}):e.jsx("span",{className:`text-xs rounded-full px-2 py-0.5 ${s?"bg-emerald-100 text-emerald-700":"bg-emerald-500/20 text-emerald-200"}`,children:"ð 常è§ä»»å¡"}),e.jsx("span",{className:`text-sm ${s?"text-gray-900":"text-white"}`,children:a.title}),a.dueAt&&e.jsxs("span",{className:`text-xs ${v?s?"text-red-500":"text-red-300":s?"text-gray-500":"text-white/50"}`,children:["â° ",v?"å·²æªæ¢":"æªæ¢"," ",new Date(a.dueAt).toLocaleString("zh-CN",{hour12:!1,month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 mt-1 flex-wrap",children:[a.targetLabel&&e.jsxs("span",{className:`text-xs rounded-full px-2 py-0.5 ${s?"bg-sky-100 text-sky-700":"bg-sky-500/20 text-sky-200"}`,children:["ð¯ ",a.targetLabel]}),a.desc&&e.jsx("span",{className:`text-xs ${s?"text-gray-400":"text-white/40"}`,children:a.desc})]})]}),e.jsxs("div",{className:"shrink-0 flex flex-col items-end gap-1 ml-3",children:[a.liked&&e.jsxs("span",{title:a.likedAt?`ç¹èµæ¶é´ï¼${new Date(a.likedAt).toLocaleString()}`:"èå¸ç¹èµ",className:`text-xs rounded-full px-2 py-0.5 font-medium inline-flex items-center gap-1 ${s?"bg-amber-100 text-amber-700":"bg-amber-500/20 text-amber-200"}`,children:[e.jsx("span",{children:"ð"}),e.jsxs("span",{children:["èå¸å·²ç¹èµ +",a.likePoints??10,"积å"]})]}),e.jsx("span",{className:`text-xs font-medium ${v?"text-red-500":a.done?"text-green-500":s?"text-gray-400":"text-white/40"}`,children:v?"â¹ å·²æªæ¢":a.done?"â
已宿 · å¯ç»§ç»":"â³ è¿è¡ä¸"})]})]},a.id)})})]})]}),e.jsxs("div",{className:"mt-8 grid md:grid-cols-2 gap-6",children:[e.jsx(ne,{isLight:s,children:p==="teacher"&&k?.students?.length?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h3",{className:`font-semibold ${s?"text-gray-900":"text-white"}`,children:"ð å¢é人åçæ¿"}),e.jsx("span",{className:`text-xs ${s?"text-gray-400":"text-white/40"}`,children:"å¦å çé¢ / ä¸é¡¹ / åèµ / 段ä½"})]}),e.jsx(Kt,{students:k.students,isLight:s,onStudentClick:a=>Ue(a)})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h3",{className:`font-semibold ${s?"text-gray-900":"text-white"}`,children:"ð£ æ´»å¨å
¥å£"}),e.jsx("span",{className:`text-xs ${s?"text-gray-400":"text-white/40"}`,children:"ç³»ç»å
¬å¼æ¯èµ/æ´»å¨"})]}),M.length===0?e.jsx(le,{text:"ææ è¿è¡ä¸çæ´»å¨",isLight:s}):e.jsx("div",{className:"space-y-2",children:M.map(a=>e.jsxs("button",{onClick:()=>n("competition",{competitionId:a.id}),className:`w-full text-left rounded-xl p-3 flex items-center gap-3 ${s?"bg-gray-50 hover:bg-gray-100":"bg-white/5 hover:bg-white/10"}`,children:[e.jsx("div",{className:"text-2xl",children:a.banner?"ð":"ð¯"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:`text-sm font-medium truncate ${s?"text-gray-900":"text-white"}`,children:a.name}),e.jsx("div",{className:`text-xs ${a.status==="ongoing"?"text-green-500":s?"text-amber-600":"text-amber-300"}`,children:a.status==="ongoing"?"è¿è¡ä¸":"å³å°å¼å§"})]})]},a.id))})]})}),e.jsxs(ne,{isLight:s,children:[e.jsx("h3",{className:`font-semibold mb-3 ${s?"text-gray-900":"text-white"}`,children:"ð æ°æ®æå"}),!y||!y.teacher?e.jsx(le,{text:"ç»å®è®²å¸å坿¥çå鍿å",isLight:s}):e.jsxs("div",{children:[e.jsxs("div",{className:`text-xs mb-2 ${s?"text-gray-400":"text-white/40"}`,children:[y.teacher.realName," èå¸çå¦åæ¦ï¼ææ®µä½ç§¯åæåºï¼"]}),e.jsx("div",{className:"space-y-1",children:y.ranking.map(a=>e.jsxs("div",{className:`flex items-center gap-3 rounded-lg px-2 py-1.5 ${s?"hover:bg-gray-50":"hover:bg-white/5"}`,children:[e.jsx("span",{className:`w-6 text-center text-sm font-bold ${a.rank<=3?"text-amber-400":s?"text-gray-400":"text-white/40"}`,children:a.rank}),e.jsx("span",{className:"text-lg",children:e.jsx(ke,{value:a.avatar})}),e.jsx("span",{className:`flex-1 text-sm truncate ${s?"text-gray-800":"text-white"}`,children:a.nickname}),e.jsxs("span",{className:`text-xs ${s?"text-gray-500":"text-white/50"}`,children:["Lv.",a.petLevel]}),e.jsx("span",{className:`text-sm font-medium ${s?"text-gray-900":"text-white"}`,children:a.totalScore})]},a.id))})]})]})]})]}),se&&e.jsx(Bt,{isLight:s,initialForm:A?.application||{},userPhone:t?.phone||"",onClose:()=>_(!1),onSuccess:()=>{_(!1),Ve(),h("ç³è¯·å·²æäº¤ï¼çå¾
管çåå®¡æ ¸")}}),G&&e.jsx(zt,{isLight:s,onClose:()=>Z(!1),onSuccess:()=>{Z(!1),Ve(),Te(),h("ç»å®æåï¼æ¨å·²æä¸ºè¯¥è®²å¸çå¦å")}}),Ke&&e.jsx(Ot,{isLight:s,taskOptions:X,onClose:()=>Ce(!1),onSuccess:()=>{Ce(!1),oe(),h("ä»»å¡å·²åå¸ï¼å°ä½ç¨äºå½åææå¦å")},onError:a=>h(a)}),lt&&e.jsx(ut,{isLight:s,student:lt,onClose:()=>Ue(null),onReportDownload:it,onRefresh:oe}
1),gt&&m&&e.jsx(ut,{isLight:s,student:m.user,selfDetail:m,readOnly:!0,onClose:()=>rt(!1),onReportDownload:it,onRefresh:()=>{}}),de.open&&e.jsx(Ut,{isLight:s,taskId:de.taskId,data:de.data,loading:de.loading,onClose:()=>fe({open:!1}),onLike:St}),g]})}function Bt({isLight:t,initialForm:n,userPhone:u,onClose:s,onSuccess:f}){const[i,g]=r.useState({city:n?.city||"",campus:n?.campus||"",phone:n?.phone||u||"",realName:n?.realName||"",note:n?.note||""}),[h,T]=r.useState(!1),[N,x]=r.useState(!1),[o,P]=r.useState(""),p=r.useRef(null),C=r.useRef(!1),A=async()=>{if(!i.city||!i.campus||!i.phone||!i.realName){P("请填å宿´ä¿¡æ¯ï¼åå¸ãæ ¡åºãææºå·ãçå®å§åï¼");return}if(P(""),!C.current){C.current=!0,T(!0);try{const y=await B.apply(i);y?.code===200?f():(C.current=!1,P(y?.message||"æäº¤å¤±è´¥"))}catch(y){C.current=!1,P("æäº¤å¤±è´¥ï¼"+(y?.message||"ç½ç»é误"))}finally{T(!1)}}},O=y=>{const S=p.current;if(!S)return;const k=` 2 3`,Q=S.selectionStart,b=S.selectionEnd,z=S.value,R=z.slice(0,Q)+k+z.slice(b);g(te=>({...te,note:R})),setTimeout(()=>{S.selectionStart=S.selectionEnd=Q+k.length,S.focus()},0)},M=async y=>{if(y.type.startsWith("image/")){x(!0);try{const S=await Ht(y),k=await B.uploadImage(S);k?.code===200&&k.data?.url?O(k.data.url):P(k?.message||"å¾çä¸ä¼ 失败")}catch(S){P("å¾çä¸ä¼ 失败ï¼"+(S?.message||""))}finally{x(!1)}}},K=async y=>{const S=Array.from(y.clipboardData.files).filter(k=>k.type.startsWith("image/"));if(S.length!==0){y.preventDefault();for(const k of S)await M(k)}};return e.jsx(Ee,{title:"æä¸ºè®²å¸ · æäº¤ç³è¯·",onClose:s,isLight:t,children:e.jsxs("div",{className:"space-y-3",children:[e.jsx(Re,{label:"åå¸",value:i.city,isLight:t,onChange:y=>g({...i,city:y}),placeholder:"å¦ï¼æå·"}),e.jsx(Re,{label:"æ ¡åº",value:i.campus,isLight:t,onChange:y=>g({...i,campus:y}),placeholder:"å¦ï¼è¥¿æ¹æ ¡åº"}),e.jsx(Re,{label:"ææºå·",value:i.phone,isLight:t,onChange:y=>g({...i,phone:y}),placeholder:"11 使æºå·"}),e.jsx(Re,{label:"çå®å§å",value:i.realName,isLight:t,onChange:y=>g({...i,realName:y}),placeholder:"请è¾å ¥çå®å§å"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("label",{className:`text-sm ${t?"text-gray-600":"text-white/70"}`,children:"夿³¨"}),e.jsxs("label",{className:`text-xs cursor-pointer ${t?"text-purple-600 hover:text-purple-700":"text-purple-300 hover:text-purple-200"}`,children:[N?"ä¸ä¼ ä¸â¦":"ð ä¸ä¼ å¾ç",e.jsx("input",{type:"file",accept:"image/*",className:"hidden",onChange:y=>{const S=y.target.files?.[0];S&&M(S),y.currentTarget.value=""},disabled:N})]})]}),e.jsx("textarea",{ref:p,className:`mt-1 w-full rounded-lg px-3 py-2 text-sm shadow-sm outline-none focus:ring-2 focus:ring-purple-500/30 ${t?"bg-white border border-gray-300 text-gray-900 placeholder:text-gray-400":"bg-white/5 border border-white/20 text-white placeholder:text-white/30"}`,rows:4,value:i.note,onChange:y=>g({...i,note:y.target.value}),onPaste:K,placeholder:"è¡¥å 说æï¼éå¡«ï¼ï¼å¯ç´æ¥ç²è´´å¾çï¼æç¹å»å³ä¸è§ä¸ä¼ å¾ç"}),e.jsx("div",{className:`text-xs mt-1 ${t?"text-gray-400":"text-white/40"}`,children:"æ¯æç´æ¥ç²è´´æªå¾/å¾ç"})]}),o&&e.jsx("div",{className:`rounded-lg px-3 py-2 text-sm ${t?"bg-rose-50 text-rose-700 border border-rose-200":"bg-rose-500/10 text-rose-200 border border-rose-500/30"}`,children:o}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{onClick:s,className:`flex-1 rounded-lg py-2.5 font-medium text-sm ${t?"bg-gray-100 text-gray-700 hover:bg-gray-200":"bg-white/10 text-white hover:bg-white/20"}`,children:"åæ¶"}),e.jsx("button",{onClick:A,disabled:h,className:"flex-1 rounded-lg bg-purple-600 hover:bg-purple-500 text-white py-2.5 font-medium text-sm disabled:opacity-50",children:h?"æäº¤ä¸â¦":"æäº¤ç³è¯·"})]})]})})}function zt({isLight:t,onClose:n,onSuccess:u}){const[s,f]=r.useState(""),[i,g]=r.useState(!1),[h,T]=r.useState(""),N=r.useRef(!1),x=async()=>{if(!s.trim()){T("请è¾å ¥èå¸ç ");return}if(T(""),!N.current){N.current=!0,g(!0);try{const o=await B.bind(s.trim());o?.code===200?u():(N.current=!1,T(o?.message||"ç»å®å¤±è´¥"))}catch(o){N.current=!1,T("ç»å®å¤±è´¥ï¼"+(o?.message||"ç½ç»é误"))}finally{g(!1)}}};return e.jsx(Ee,{title:"ææ¯å¦å · ç»å®è®²å¸",onClose:n,isLight:t,children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:`text-sm ${t?"text-gray-600":"text-white/70"}`,children:"请è¾å ¥è®²å¸æä¾çãèå¸ç ãï¼å³å¯æä¸ºè¯¥è®²å¸çå¦åã"}),e.jsx("input",{className:`w-full rounded-lg px-3 py-2.5 text-sm tracking-widest shadow-sm outline-none focus:ring-2 focus:ring-purple-500/30 ${t?"bg-white border border-gray-300 text-gray-900 placeholder:text-gray-400":"bg-white/5 border border-white/20 text-white placeholder:text-white/30"}`,value:s,onChange:o=>f(o.target.value),placeholder:"èå¸ç ï¼åºå大å°åï¼"}),h&&e.jsx("div",{className:`rounded-lg px-3 py-2 text-sm ${t?"bg-rose-50 text-rose-700 border border-rose-200":"bg-rose-500/10 text-rose-200 border border-rose-500/30"}`,children:h}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{onClick:n,className:`flex-1 rounded-lg py-2.5 font-medium text-sm ${t?"bg-gray-100 text-gray-700 hover:bg-gray-200":"bg-white/10 text-white hover:bg-white/20"}`,children:"åæ¶"}),e.jsx("button",{onClick:x,disabled:i,className:"flex-1 rounded-lg bg-purple-600 hover:bg-purple-500 text-white py-2.5 font-medium text-sm disabled:opacity-50",children:i?"ç»å®ä¸â¦":"ç»å®"})]})]})})}const et={platform:{targetType:"blog_approved",label:"å¹³å°ä»»å¡ç®æ ",optionsKey:null,placeholder:"è¯·éæ©ä»»å¡ç®æ "},practice:{targetType:"competition",label:"å ³èæ¯èµ",optionsKey:"competitions",placeholder:"è¯·éæ©æ¯èµ"},special:{targetType:"special_paper",label:"å ³èä¸é¡¹è¯å·",optionsKey:"papers",placeholder:"è¯·éæ©ä¸é¡¹è¯å·"}};function Wt(t){return t==="blog_approved"?"ç¯":t==="daily_12"?"é¢":"å"}const qt=[{targetType:"blog_approved",label:"åå¸å客并éè¿å®¡æ ¸",hint:"ç»è®¡åºé´å ï¼å叿¥~æªæ¢æ¥ï¼å¦ååå¸å客ä¸å®¡æ ¸éè¿å³ç®å®æ"},{targetType:"daily_12",label:"å®ææ¯æ¥ç»ä¹ 12 éé¢",hint:"ç»è®¡åºé´å ï¼å叿¥~æªæ¢æ¥ï¼ä»»æä¸å¤©åå®å½å¤© 12 鿝æ¥ç»ä¹ å³ç®å®æ"},{targetType:"none",label:"纯æåä»»å¡ï¼ä¸èªå¨å¤å®ï¼",hint:"ä» ä½éç¥å±ç¤ºï¼å®ææ åµéè叿å¨å¤æ"}];function Ot({isLight:t,taskOptions:n,onClose:u,onSuccess:s,onError:f}){const[i,g]=r.useState("practice"),[h,T]=r.useState(""),[N,x]=r.useState(""),[o,P]=r.useState(et.practice.targetType),[p,C]=r.useState(""),[A,O]=r.useState(""),[M,K]=r.useState(!1),[y,S]=r.useState(""),k=et[i],Q=k.optionsKey?n[k.optionsKey]:[],b=i==="platform",z=Array.isArray(n?.platformGoals)&&n.platformGoals.length>0?n.platformGoals:qt,R=z.find(w=>w.targetType===o)?.hint||"",te=w=>{g(w);const X=et[w];P(X.targetType),C(""),S("")},$=async()=>
3{if(console.log("[TeacherCenter] CreateTask submit clicked",{type:i,title:h,targetId:p,dueAt:A}),!h.trim()){S("请填å任塿 é¢");return}if(k.optionsKey&&!p){S("è¯·éæ©"+k.label.replace("å
³è",""));return}S(""),u(),K(!0);try{const w=await B.createTask({type:i,title:h.trim(),desc:N||void 0,targetType:o,targetId:k.optionsKey?p:void 0,dueAt:A||void 0});w?.code===200?(console.log("[TeacherCenter] CreateTask API success"),s()):(console.log("[TeacherCenter] CreateTask API error",w?.message),f(w?.message||"åå¸å¤±è´¥"))}catch(w){console.log("[TeacherCenter] CreateTask API exception",w?.message),f("åå¸å¤±è´¥ï¼"+(w?.message||"ç½ç»é误"))}finally{K(!1)}};return e.jsx(Ee,{title:"åå¸ä»»å¡",onClose:u,isLight:t,children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:`text-sm ${t?"text-gray-600":"text-white/70"}`,children:"ä»»å¡ç±»å"}),e.jsxs("select",{className:`mt-1 w-full rounded-lg px-3 py-2 text-sm shadow-sm outline-none focus:ring-2 focus:ring-purple-500/30 ${t?"bg-white border border-gray-300 text-gray-900":"bg-white/5 border border-white/20 text-white"}`,value:i,onChange:w=>te(w.target.value),children:[e.jsx("option",{value:"platform",children:"å¹³å°ä»»å¡"}),e.jsx("option",{value:"practice",children:"ç»ä¹ ä»»å¡"}),e.jsx("option",{value:"special",children:"ä¸é¡¹è®ç»ä»»å¡"})]}),e.jsxs("div",{className:`text-xs mt-1 ${t?"text-gray-400":"text-white/40"}`,children:[i==="platform"&&"é¢åææå¦åçå¹³å°ä»»å¡ï¼å¯ç»å®ãåå¸å客并éè¿ãæãæ¯æ¥ç»ä¹ 12 éé¢ãèªå¨å¤å®å®æ",i==="practice"&&"å
³èä¸åºæ¯èµï¼å¦ååèµå³ç®å®æ",i==="special"&&"å
³èä¸å¥ä¸é¡¹è¯å·ï¼å¦å宿å³ç®å®æ"]})]}),e.jsx(Re,{label:"任塿 é¢",value:h,isLight:t,onChange:T,placeholder:"å¦ï¼æ¬å¨ GESP ä¸çº§æ¨¡æ"}),e.jsxs("div",{children:[e.jsx("label",{className:`text-sm ${t?"text-gray-600":"text-white/70"}`,children:"ä»»å¡è¯´æ"}),e.jsx("textarea",{className:`mt-1 w-full rounded-lg px-3 py-2 text-sm shadow-sm outline-none focus:ring-2 focus:ring-purple-500/30 ${t?"bg-white border border-gray-300 text-gray-900 placeholder:text-gray-400":"bg-white/5 border border-white/20 text-white placeholder:text-white/30"}`,rows:2,value:N,onChange:w=>x(w.target.value),placeholder:"éå¡«"})]}),e.jsxs("div",{children:[e.jsx("label",{className:`text-sm ${t?"text-gray-600":"text-white/70"}`,children:k.label}),k.optionsKey?e.jsxs("select",{className:`mt-1 w-full rounded-lg px-3 py-2 text-sm shadow-sm outline-none focus:ring-2 focus:ring-purple-500/30 ${t?"bg-white border border-gray-300 text-gray-900":"bg-white/5 border border-white/20 text-white"}`,value:p,onChange:w=>C(w.target.value),children:[e.jsx("option",{value:"",children:k.placeholder}),Q.map(w=>e.jsx("option",{value:w.id,children:w.name},w.id))]}):b?e.jsxs(e.Fragment,{children:[e.jsx("select",{className:`mt-1 w-full rounded-lg px-3 py-2 text-sm shadow-sm outline-none focus:ring-2 focus:ring-purple-500/30 ${t?"bg-white border border-gray-300 text-gray-900":"bg-white/5 border border-white/20 text-white"}`,value:o,onChange:w=>{P(w.target.value),S("")},children:z.map(w=>e.jsx("option",{value:w.targetType,children:w.label},w.targetType))}),e.jsx("div",{className:`text-xs mt-1 ${t?"text-gray-400":"text-white/40"}`,children:R})]}):e.jsx("div",{className:`mt-1 rounded-lg px-3 py-2 text-sm border ${t?"bg-gray-100 border-gray-200 text-gray-500":"bg-white/5 border-white/10 text-white/40"}`,children:"æ ééæ©å
³èç»ä¹ "})]}),e.jsxs("div",{children:[e.jsx("label",{className:`text-sm ${t?"text-gray-600":"text-white/70"}`,children:"æªæ¢æ¶é´ï¼éå¡«ï¼"}),e.jsx("input",{type:"datetime-local",className:`mt-1 w-full rounded-lg px-3 py-2 text-sm shadow-sm outline-none focus:ring-2 focus:ring-purple-500/30 ${t?"bg-white border border-gray-300 text-gray-900":"bg-white/5 border border-white/20 text-white"}`,value:A,onChange:w=>O(w.target.value)})]}),y&&e.jsx("div",{className:`rounded-lg px-3 py-2 text-sm ${t?"bg-rose-50 text-rose-700 border border-rose-200":"bg-rose-500/10 text-rose-200 border border-rose-500/30"}`,children:y}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{onClick:u,className:`flex-1 rounded-lg py-2.5 font-medium text-sm ${t?"bg-gray-100 text-gray-700 hover:bg-gray-200":"bg-white/10 text-white hover:bg-white/20"}`,children:"åæ¶"}),e.jsx("button",{onClick:$,disabled:M,className:"flex-1 rounded-lg bg-purple-600 hover:bg-purple-500 text-white py-2.5 font-medium text-sm disabled:opacity-50",children:M?"åå¸ä¸â¦":"åå¸ä»»å¡"})]})]})})}function st(t,n){return{1:"bg-gray-100 text-gray-600",2:"bg-amber-100 text-amber-700",3:"bg-slate-200 text-slate-700",4:"bg-cyan-100 text-cyan-700",5:"bg-yellow-100 text-yellow-700",6:"bg-orange-100 text-orange-700",7:"bg-purple-100 text-purple-700",8:"bg-rose-100 text-rose-700"}[t]||(n?"bg-gray-100 text-gray-600":"bg-white/10 text-white/70")}function Kt({students:t,isLight:n,onStudentClick:u}){const s=t.length;if(s===0)return e.jsx(le,{text:"ææ ç»å®å¦å",isLight:n});const f=580,i=160,g=32,h=32,T=18,N=32,x=f-g-h,o=i-T-N,P=b=>s===1?g+x/2:g+x*b/(s-1),p=Math.max(1,...t.map(b=>Math.max(b.answerCount,b.specialCount,b.compReg))),C=Math.ceil(p/5)*5||5,A=Math.max(2,...t.map(b=>b.stageId||1)),O=b=>T+o*(1-b/C),M=b=>T+o*(1-b/A),K=n?"#9ca3af":"rgba(255,255,255,0.45)",y=n?"#e9ebef":"rgba(255,255,255,0.08)",S=[0,.5,1],k=[{key:"answerCount",color:"#3b82f6",label:"çé¢"},{key:"specialCount",color:"#22c55e",label:"ä¸é¡¹"},{key:"compReg",color:"#f59e0b",label:"åèµ"}
3],Q={key:"stageId",color:"#a855f7",label:"段ä½"};return e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{className:`rounded-xl p-3 ${n?"bg-gray-50/70":"bg-white/5"}`,children:[e.jsx("div",{className:`text-xs mb-2 ${n?"text-gray-400":"text-white/40"}`,children:"ð å¢éå¦ä¹ è¶å¿"}),e.jsxs("svg",{viewBox:`0 0 ${f} ${i}`,className:"w-full",style:{maxHeight:160},children:[S.map((b,z)=>{const R=T+o*b;return e.jsxs("g",{children:[e.jsx("line",{x1:g,y1:R,x2:f-h,y2:R,stroke:y,strokeWidth:1}),e.jsx("text",{x:g-4,y:R+3,textAnchor:"end",fontSize:9,fill:K,children:Math.round(C*(1-b))}),e.jsx("text",{x:f-h+4,y:R+3,textAnchor:"start",fontSize:9,fill:K,children:Math.round(A*(1-b))})]},z)}),k.map(b=>e.jsxs("g",{children:[e.jsx("polyline",{fill:"none",stroke:b.color,strokeWidth:2,points:t.map((z,R)=>`${P(R)},${O(z[b.key])}`).join(" ")}),t.map((z,R)=>e.jsx("circle",{cx:P(R),cy:O(z[b.key]),r:4,fill:b.color,stroke:n?"#fff":"#1b1430",strokeWidth:1.5},R))]},b.key)),e.jsx("g",{children:e.jsx("polyline",{fill:"none",stroke:Q.color,strokeWidth:2,strokeDasharray:"4 3",points:t.map((b,z)=>`${P(z)},${M(b[Q.key])}`).join(" ")})}),[...k,Q].map((b,z)=>e.jsxs("g",{transform:`translate(${g+x/4*z}, ${i-8})`,children:[e.jsx("rect",{x:0,y:-8,width:10,height:4,rx:2,fill:b.color}),e.jsx("text",{x:14,y:-4,fontSize:9,fill:K,children:b.label})]},b.key))]})]})})}function ut({isLight:t,student:n,onClose:u,onReportDownload:s,onRefresh:f,readOnly:i=!1,selfDetail:g=null}){const{confirm:h,alert:T,dialog:N}=Se(t),x=r.useCallback(m=>T("æç¤º",m),[T]),[o,P]=r.useState(null),[p,C]=r.useState(null),[A,O]=r.useState(!0),[M,K]=r.useState("overview"),[y,S]=r.useState(""),[k,Q]=r.useState(!1),[b,z]=r.useState(!1),[R,te]=r.useState(""),[$,w]=r.useState(!1);r.useEffect(()=>{K("overview"),C(null);let m=!1;return(async()=>{O(!0);try{if(i&&g){P(g),te(g?.remark||"");const[q,c]=await Promise.all([Me.myDetails(),Me.getMyClass()]);!m&&q?.code===200&&C(q.data),!m&&c?.code===200&&P(F=>({...F,classes:c.data.classes||[]}))}else{const[q,c]=await Promise.all([B.studentStatus(n.id),B.studentDetails(n.id)]);!m&&q?.code===200&&(P(q.data),te(q.data.remark||"")),!m&&c?.code===200&&C(c.data)}}finally{m||O(!1)}})(),()=>{m=!0}},[n.id,i,g]);const X=async()=>{w(!0);try{const m=await B.setStudentRemark(n.id,R);m?.code===200?(x("夿³¨å·²ä¿å"),P(q=>q&&{...q,remark:R}),f()):x(m?.message||"ä¿å失败")}catch(m){x(m?.message||"ä¿å失败")}finally{w(!1)}},ce=async()=>{z(!0);try{i?await Me.myExport():await B.studentExport(n.id)}catch(m){x(m?.message||"导åºå¤±è´¥")}finally{z(!1)}},Y=async()=>{if(!y||y.length<8){x("请è¾å
¥è³å° 8 ä½çæ°å¯ç ");return}h("éç½®å¦åå¯ç ","ç¡®å®å°è¯¥å¦åå¯ç é置为æå®å¯ç åï¼",async()=>{Q(!0);try{const m=await B.resetStudentPassword(n.id,y);m?.code===200?(x("å¯ç å·²éç½®"),S(""),f()):x(m?.message||"é置失败")}finally{Q(!1)}})},xe=m=>m?new Date(m).toLocaleString("zh-CN",{timeZone:"Asia/Shanghai"}):"â",pe=[{key:"answers",label:"çé¢è®°å½",count:o?.stats?.answerCount??0,icon:"â
"},{key:"assessments",label:"æµè¯è®°å½",count:o?.stats?.assessCount??0,icon:"ð"},{key:"daily",label:"æ¯æ¥ç»ä¹ ",count:o?.stats?.dailyDone??0,icon:"ð
"},{key:"specials",label:"ä¸é¡¹è®ç»",count:o?.stats?.specialCount??0,icon:"ð¯"},{key:"competitions",label:"åèµè®°å½",count:o?.stats?.compReg??0,icon:"ð"}],be=()=>{if(!p)return e.jsx("div",{className:`py-8 text-center text-sm ${t?"text-gray-400":"text-white/40"}`,children:"å è½½ä¸â¦"});const m=t?"text-gray-500":"text-white/50",q=t?"text-gray-800":"text-white",c=`rounded-lg px-3 py-2 text-sm ${t?"bg-gray-50 border border-gray-100":"bg-white/5 border border-white/10"}`;if(M==="answers"){const _=p.answers||[];return _.length?e.jsx("div",{className:"space-y-1.5",children:_.map((G,Z)=>e.jsxs("div",{className:c,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:`${q} font-medium`,children:["Q: ",G.questionId]}),e.jsx("span",{className:G.correct?t?"text-green-600":"text-green-300":t?"text-red-600":"text-red-300",children:G.correct?"æ£ç¡®":"é误"})]}),e.jsxs("div",{className:`text-xs mt-0.5 ${m}`,children:["é¾åº¦ ",G.difficulty||"â"," · ",xe(G.createdAt)]})]},Z))}):e.jsx(le,{text:"ææ çé¢è®°å½",isLight:t})}if(M==="assessments"){const _=p.assessments||[];return _.length?e.jsx("div",{className:"space-y-1.5",children:_.map((G,Z)=>e.jsxs("div",{className:c,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:`${q} font-medium`,children:["å¾å ",G.score]}),e.jsxs("span",{className:m,children:[G.correctCount,"/",G.totalCount," æ£ç¡®"]})]}),e.jsx("div",{className:`text-xs mt-0.5 ${m}`,children:xe(G.createdAt)})]},Z))}):e.jsx(le,{text:"ææ æµè¯è®°å½",isLight:t})}if(M==="daily"){const _=p.dailyLogs||[];return _.length?e.jsx("div",{className:"space-y-1.5",children:_.map((G,Z)=>{const Ke=Array.isArray(G.answered)?G.answered:[],Ce=Array.isArray(G.correct)?G.correct:[];return e.jsx("div",{className:c,children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:`${q} font-medium`,children:G.date}),e.jsxs("span",{className:m,children:["ç对 ",Ce.length,"/",Ke.length]})]})},Z)})}):e.jsx(le,{text:"ææ æ¯æ¥ç»ä¹ è®°å½",isLight:t})}if(M==="specials"){const _=p.specials||[];return _.length?e.jsx("div",{className:"space-y-1.5",children:_.map((G,Z)=>e.jsxs("div",{className:c,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:`${q} font-medium`,children:G.paperName||(G.source==="filter"?"èªç±ç»é¢":"ä¸é¡¹è¯å·")}),e.jsxs("span",{className:m,children:[G.correctCount,"/",G.questionCount," æ£ç¡®"]})]}),e.jsxs("div",{className:`text-xs mt-0.5 ${m}`,children:[G.source==="filter"?"èªç±ç»é¢":"ä¸é¡¹è¯å·"," · ",xe(G.createdAt)]})]},Z))}):e.jsx(le,{text:"ææ ä¸é¡¹è®ç»è®°å½",isLight:t})}const F=p.competitions||[],se={};
3return(p.prizes||[]).forEach(_=>{se[_.competitionId]=_}),F.length?e.jsx("div",{className:"space-y-1.5",children:F.map((_,G)=>{const Z=se[_.competitionId];return e.jsxs("div",{className:c,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:`${q} font-medium`,children:_.competitionName||_.competitionId}),Z?e.jsxs("span",{className:"text-xs rounded-full px-2 py-0.5 bg-amber-500/20 text-amber-300",children:["ð ",Z.rankLabel]}):e.jsx("span",{className:m,children:"å·²æ¥å"})]}),e.jsxs("div",{className:`text-xs mt-0.5 ${m}`,children:["æ¥å ",xe(_.createdAt)]})]},G)})}):e.jsx(le,{text:"ææ åèµè®°å½",isLight:t})};return e.jsxs(Ee,{title:`å¦å详æ
· ${n.nickname}`,onClose:u,isLight:t,wide:!0,children:[A?e.jsx("div",{className:`py-10 text-center ${t?"text-gray-400":"text-white/40"}`,children:"å è½½ä¸â¦"}):o?e.jsx("div",{className:"space-y-4",children:M==="overview"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 text-center",children:[e.jsx(qe,{label:"é»ç³",value:String(o.user.points??0),isLight:t}),e.jsx(qe,{label:"段ä½ç§¯å",value:String(o.user.totalScore),isLight:t}),e.jsx(qe,{label:"å® ç©ç级",value:`Lv.${o.pet.petLevel}`,isLight:t}),e.jsx(qe,{label:"è¿ç»æå¡",value:`${o.user.streak}天`,isLight:t})]}),e.jsxs("div",{className:`rounded-xl p-4 ${t?"bg-gray-50":"bg-white/5"}`,children:[e.jsx("div",{className:`text-sm font-medium mb-2 ${t?"text-gray-700":"text-white/90"}`,children:"å¦ä¹ æ°æ®ï¼ç¹å»æ¥çæç»ï¼"}),e.jsx("div",{className:"grid grid-cols-1 gap-2",children:pe.map(m=>e.jsxs("button",{onClick:()=>K(m.key),className:`w-full text-left rounded-lg px-3 py-2 flex items-center justify-between transition-all outline-none focus:outline-none focus-visible:outline-none ${t?"bg-white hover:bg-purple-50 border border-gray-200":"bg-white/5 hover:bg-white/10 border border-white/10"}`,children:[e.jsxs("span",{className:`text-sm ${t?"text-gray-700":"text-white/80"}`,children:[e.jsx("span",{className:"mr-2",children:m.icon}),m.label]}),e.jsxs("span",{className:`text-sm font-bold ${t?"text-purple-600":"text-purple-300"}`,children:[m.count," æ¡ âº"]})]},m.key))}),o.stats.prizes.length>0&&e.jsxs("div",{className:"mt-3",children:[e.jsx("div",{className:`text-xs mb-1 ${t?"text-gray-500":"text-white/60"}`,children:"èµäºå¥é¡¹"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:o.stats.prizes.map((m,q)=>e.jsxs("span",{className:"text-xs rounded-full px-2 py-0.5 bg-amber-500/20 text-amber-300",children:["ð ",m.rankLabel]},q))})]})]}),e.jsxs("div",{className:`rounded-xl p-4 ${t?"bg-gray-50":"bg-white/5"}`,children:[e.jsx("div",{className:`text-sm font-medium mb-2 ${t?"text-gray-700":"text-white/90"}`,children:"å·²å
¥ç级"}),o.classes&&o.classes.length>0?e.jsx("div",{className:"flex flex-wrap gap-2",children:o.classes.map(m=>e.jsx("span",{className:"text-xs rounded-full px-2.5 py-1 bg-purple-500/20 text-purple-300",children:m.name},m.id))}):e.jsx("div",{className:`text-xs ${t?"text-gray-400":"text-white/40"}`,children:"å°æªå å
¥ä»»ä½ç级"})]}),!i&&e.jsxs("div",{className:`rounded-xl p-4 ${t?"bg-gray-50":"bg-white/5"}`,children:[e.jsx("div",{className:`text-sm font-medium mb-2 ${t?"text-gray-700":"text-white/90"}`,children:"èå¸å¤æ³¨ï¼ä»
æ¨å¯è§ï¼ä¾¿äºè¯å«å¦åï¼"}),e.jsx("textarea",{className:`w-full rounded-lg px-3 py-2 text-sm shadow-sm outline-none focus:ring-2 focus:ring-purple-500/30 ${t?"bg-white border border-gray-300 text-gray-900 placeholder:text-gray-400":"bg-white/10 border border-white/20 text-white placeholder:text-white/30"}`,rows:2,value:R,onChange:m=>te(m.target.value),placeholder:"ä¾å¦ï¼å¼ ä¸ï¼ä¸çå¦çï¼çº¿ä¸è¯¾è¡¨ç°ç§¯æâ¦"}),e.jsx("div",{className:"mt-2 flex justify-end",children:e.jsx("button",{onClick:X,disabled:$,className:"rounded-lg bg-purple-600 hover:bg-purple-500 text-white px-4 py-1.5 text-sm disabled:opacity-50",children:$?"ä¿åä¸â¦":"ä¿å夿³¨"})})]}),!i&&e.jsxs("div",{className:`rounded-xl p-4 ${t?"bg-gray-50":"bg-white/5"}`,children:[e.jsx("div",{className:`text-sm font-medium mb-2 ${t?"text-gray-700":"text-white/90"}`,children:"éç½®å¦åå¯ç ï¼ä»
æ¬è®²å¸å¦åï¼"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"text",className:`flex-1 rounded-lg px-3 py-2 text-sm shadow-sm outline-none focus:ring-2 focus:ring-purple-500/30 ${t?"bg-white border border-gray-300 text-gray-900 placeholder:text-gray-400":"bg-white/10 border border-white/20 text-white placeholder:text-white/30"}`,value:y,onChange:m=>S(m.target.value),placeholder:"è¾å
¥è³å° 8 使°å¯ç "}),e.jsx("button",{onClick:Y,disabled:k,className:"rounded-lg bg-rose-600 hover:bg-rose-500 text-white px-4 py-2 text-sm disabled:opacity-50",children:k?"å¤çä¸â¦":"éç½®"})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:u,className:`flex-1 rounded-lg py-2.5 text-sm font-medium ${t?"bg-gray-100 text-gray-700 hover:bg-gray-200":"bg-white/10 text-white hover:bg-white/20"}`,children:"å
³é"}),!i&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:ce,disabled:b,className:"flex-1 rounded-lg bg-emerald-600 hover:bg-emerald-500 text-white py-2.5 text-sm font-medium disabled:opacity-50",children:b?"导åºä¸â¦":"ð¥ å¯¼åºæç»"}),e.jsx("button",{onClick:()=>s(n.id,n.nickname),className:"flex-1 rounded-lg bg-indigo-600 hover:bg-indigo-500 text-white py-2.5 text-sm font-medium",children:"ð æ¥åå¾ç"})]})]})]}):e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>K("overview"),className:`rounded-lg px-3 py-1.5 text-sm ${t?"bg-gray-100 hover:bg-gray-200 text-gray-700":"bg-white/10 hover:bg-white/20 text-white"}`,children:"â¹ è¿å"}),e.jsx("div",{className:`text-sm font-medium ${t?"text-gray-800":"text-white"}`,children:pe.find(m=>m.key===M)?.label}),!i&&e.jsx("button",{onClick:ce,disabled:b,className:"ml-auto rounded-lg px-3 py-1.5 text-sm bg-emerald-600 hover:bg-emerald-500 text-white disabled:opacity-50",children:b?"导åºä¸â¦":"ð¥ 导åº"})]}),e.jsx("div",{className:"max-h-[55vh] overflow-y-auto pr-1",children:be()})]})}):e.jsx("div",{className:`py-10 text-center ${t?"text-gray-400":"text-white/40"}`,children:"å 载失败"}),N]})}function Ut({isLight:t,taskId:n,data:u,loading:s,onClose:f,onLike:i}){const g=u?.task,h=u?.students||[],T=u?.studentCount||0,N=u?.completedCount||0,x=T?Math.round(N/T*100):0;return e.jsx(Ee,{title:g?`ä»»å¡è¯¦æ
ï¼${g.title}`:"ä»»å¡è¯¦æ
",onClose:f,isLight:t,wide:!0,children:s?e.jsx("div",{className:`py-10 text-center ${t?"text-gray-400":"text-white/40"}`,children:"å è½½ä¸â¦"}):g?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:`rounded-xl p-4 ${t?"bg-purple-50":"bg-purple-500/10"}`,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("span",{className:`text-xs rounded-full px-2 py-0.5 ${t?"bg-purple-100 text-purple-700":"bg-purple-500/20 text-purple-200"}`,children:tt[g.type]||g.type}),e.jsx("span",{className:`font-medium ${t?"text-gray-900":"text-white"}`,children:g.title}),g.targetLabel&&e.jsxs("span",{className:`text-xs rounded-full px-2 py-0.5 ${t?"bg-sky-100 text-sky-700":"bg-sky-500/20 text-sky-200"}`,children:["ð¯ ",g.targetLabel]})]}),g.desc&&e.jsx("p",{className:`text-sm ${t?"text-gray-600":"text-white/70"}`,children:g.desc}),e.jsxs("div",{className:`text-xs mt-2 ${t?"text-gray-500":"text-white/50"}`,children:["宿çï¼",N,"/",T,"ï¼",x,"%ï¼",g.dueAt&&` · æªæ¢ ${new Date(g.dueAt).toLocaleStr
3ing()}`]}),g.targetType==="blog_approved"||g.targetType==="daily_12"?e.jsxs("div",{className:`text-xs mt-1 ${t?"text-sky-600":"text-sky-300/80"}`,children:["å¤å®è§åï¼",g.targetType==="blog_approved"?"ä»»å¡å叿¥è³æªæ¢æ¥å
ï¼å¦ååå¸å客ä¸å®¡æ ¸éè¿":"ä»»å¡å叿¥è³æªæ¢æ¥å
ï¼ä»»æä¸å¤©åå®å½å¤© 12 鿝æ¥ç»ä¹ ","ï¼æªè®¾æªæ¢æ¥åç»è®¡å°ä»å¤©ï¼"]}):null,e.jsx("div",{className:"mt-2 h-2 rounded-full bg-black/10 overflow-hidden",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-purple-500 to-indigo-500",style:{width:`${x}%`}})})]}),e.jsxs("div",{children:[e.jsx("h4",{className:`text-sm font-semibold mb-2 ${t?"text-gray-700":"text-white/80"}`,children:"å¦å宿æ
åµ"}),h.length===0?e.jsx(le,{text:"ææ ç»å®å¦å",isLight:t}):e.jsx("div",{className:"space-y-2 max-h-[420px] overflow-y-auto pr-1",children:h.map(o=>e.jsxs("div",{className:`rounded-xl p-3 flex items-center gap-3 ${t?"bg-gray-50":"bg-white/5"}`,children:[e.jsx("div",{className:`w-10 h-10 rounded-full flex items-center justify-center text-xl shrink-0 ${t?"bg-purple-100":"bg-purple-500/20"}`,children:e.jsx(ke,{value:o.avatar,fallback:"ð§âð"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`text-sm font-medium truncate ${t?"text-gray-900":"text-white"}`,children:o.nickname||"å¦å"}),e.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded-full ${st(o.stageId||1,t)}`,children:o.stageName||`é¶æ®µ${o.stageId||1}`})]}),e.jsx("div",{className:`text-xs mt-1 ${t?"text-gray-500":"text-white/50"}`,children:o.done?e.jsxs("span",{className:"text-green-500",children:["â
已宿",o.score!==void 0?` · ${o.score}${Wt(g?.targetType)}`:"",o.completedAt?` · ${new Date(o.completedAt).toLocaleDateString()}`:""]}):e.jsx("span",{children:"â³ æªå®æ"})})]}),e.jsx("button",{disabled:o.liked,onClick:()=>i(o.id),className:`shrink-0 text-sm px-3 py-1.5 rounded-lg font-medium transition-colors ${o.liked?t?"bg-gray-100 text-gray-400":"bg-white/5 text-white/40":t?"bg-rose-50 text-rose-600 hover:bg-rose-100":"bg-rose-500/20 text-rose-300 hover:bg-rose-500/30"}`,children:o.liked?"å·²ç¹èµ":"ð ç¹èµ"})]},o.id))})]})]}):e.jsx("div",{className:`py-10 text-center ${t?"text-gray-400":"text-white/40"}`,children:"å 载失败"})})}function Ht(t){return new Promise((n,u)=>{const s=new FileReader;s.onload=()=>n(s.result),s.onerror=u,s.readAsDataURL(t)})}function Ee({title:t,children:n,onClose:u,isLight:s,wide:f}){return _t(u),e.jsx("div",{className:"fixed inset-0 z-[80] flex items-center justify-center bg-black/60 p-4",onClick:u,children:e.jsxs("div",{className:`w-full ${f?"max-w-2xl":"max-w-md"} max-h-[90vh] overflow-y-auto overscroll-contain rounded-2xl p-6 shadow-2xl ${s?"bg-white border-2 border-gray-200":"bg-[#1b1430] border border-white/10"}`,style:{WebkitOverflowScrolling:"touch"},onClick:i=>i.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:`text-lg font-bold ${s?"text-gray-900":"text-white"}`,children:t}),e.jsx("button",{onClick:u,className:`flex items-center justify-center w-9 h-9 rounded-full text-2xl leading-none transition-colors ${s?"text-gray-500 hover:bg-gray-100 hover:text-gray-900 border border-gray-300":"text-white/70 hover:bg-white/10 hover:text-white border border-white/20"}`,"aria-label":"å
³é",title:"å
³é (Esc)",children:"Ã"})]}),n]})})}function ne({children:t,isLight:n,className:u=""}){return e.jsx("div",{className:`rounded-2xl p-5 ${n?"bg-white border border-gray-200 shadow-sm":"bg-white/5 border border-white/10"} ${u}`,children:t})}function Re({label:t,value:n,onChange:u,placeholder:s,isLight:f}){return e.jsxs("div",{children:[e.jsx("label",{className:`text-sm ${f?"text-gray-700":"text-white/70"}`,children:t}),e.jsx("input",{className:`mt-1 w-full rounded-lg px-3 py-2 text-sm shadow-sm outline-none focus:ring-2 focus:ring-purple-500/30 ${f?"bg-white border border-gray-300 text-gray-900 placeholder:text-gray-400":"bg-white/5 border border-white/20 text-white placeholder:text-white/30"}`,value:n,onChange:i=>u(i.target.value),placeholder:s})]})}function qe({label:t,value:n,isLight:u}){return e.jsxs("div",{className:`rounded-xl p-3 ${u?"bg-gray-50":"bg-white/5"}`,children:[e.jsx("div",{className:`text-xl font-bold ${u?"text-gray-900":"text-white"}`,children:n}),e.jsx("div",{className:`text-xs mt-1 ${u?"text-gray-400":"text-white/40"}`,children:t})]})}function le({text:t,isLight:n}){return e.jsx("div",{className:`py-8 text-center text-sm ${n?"text-gray-400":"text-white/40"}`,children:t})}function Qt({role:t,applicationStatus:n,isLight:u}){if(t==="applicant"&&n&&n!=="pending"){if(n==="rejected")return e.jsx("span",{className:`text-sm rounded-full px-3 py-1 ${u?"bg-rose-100 text-rose-700":"bg-rose-500/20 text-rose-200"}`,children:"å·²æç»"});if(n==="revoked")return e.jsx("span",{className:`text-sm rounded-full px-3 py-1 ${u?"bg-gray-200 text-gray-600":"bg-white/10 text-white/60"}`,children:"å·²æ¤é"})}const s={none:{label:"æ®éç¨æ·",cls:u?"bg-gray-100 text-gray-600":"bg-white/10 text-white/60"},applicant:{label:"ç³è¯·ä¸",cls:u?"bg-amber-100 text-amber-700":"bg-amber-500/20 text-amber-300"},teacher:{label:"讲å¸",cls:u?"bg-purple-100 text-purple-700":"bg-purple-500/20 text-purple-200"},student:{label:"å¦å",cls:u?"bg-indigo-100 text-indigo-700":"bg-indigo-500/20 text-indigo-200"}},f=s[t]||s.none;return e.jsx("span",{className:`text-sm rounded-full px-3 py-1 ${f.cls}`,children:f.label})}export{Xt as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.