openlearn-next 0.3.22 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/README.md +1 -0
  2. package/dist/assets/AdminDirectoryView-DY--WM5Z.js +1 -0
  3. package/dist/assets/{BatchPickerModal-C9FH3J57.js → BatchPickerModal-BobcoTtn.js} +1 -1
  4. package/dist/assets/ClassesView-DtO0PJXQ.js +22 -0
  5. package/dist/assets/ClassroomCountdownWidget-AWnCu4JJ.js +2 -0
  6. package/dist/assets/CloudDriveModal-Dr4kDySU.js +1 -0
  7. package/dist/assets/ComputerLabView-1qWDNRQ2.js +1 -0
  8. package/dist/assets/CourseManagement-DtInD0J-.js +1 -0
  9. package/dist/assets/CourseWizardModal-B16QBckO.js +3 -0
  10. package/dist/assets/CoursewareHubPanel-CaEizhxl.js +1 -0
  11. package/dist/assets/Dashboard-D1gZ_4NI.js +8 -0
  12. package/dist/assets/{ExportWeightModal-C4d-0uTM.js → ExportWeightModal-UPsVax6L.js} +1 -1
  13. package/dist/assets/HelpTour-CMJbbGne.js +1 -0
  14. package/dist/assets/{HelpView-B9Pny6u9.js → HelpView-BryOHwLE.js} +4 -4
  15. package/dist/assets/{ImportLessonsModal-hKRuw9p4.js → ImportLessonsModal-Dnx_QR0Z.js} +1 -1
  16. package/dist/assets/{ImportModal-CVXHZ1Ei.js → ImportModal-D7L-KNhZ.js} +1 -1
  17. package/dist/assets/{InteractiveCoursewareViewer-DMMAs2k_.js → InteractiveCoursewareViewer-BYMKvIHi.js} +1 -1
  18. package/dist/assets/InteractiveWhiteboard-550JMFBu.js +77 -0
  19. package/dist/assets/LazyCourseware-CLHWQJ8g.js +2 -0
  20. package/dist/assets/LazyWhiteboard-DJWh6sdV.js +2 -0
  21. package/dist/assets/LessonEditorView-DRwi0sjA.js +1 -0
  22. package/dist/assets/LiveClassroomView-DgN2Zqe6.js +59 -0
  23. package/dist/assets/{NotificationDetailModal-1MOkBDr_.js → NotificationDetailModal-CMKHpWX1.js} +1 -1
  24. package/dist/assets/PluginView-BQVWPofY.js +66 -0
  25. package/dist/assets/{ProcessLogsModal-gZ9LILYM.js → ProcessLogsModal-DmFXg9mG.js} +1 -1
  26. package/dist/assets/QuizGeneratorModal-BeaBRn1w.js +1 -0
  27. package/dist/assets/StudentAssignmentView-Dn4Bgqr2.js +1 -0
  28. package/dist/assets/StudentLessonView-CMPqL1ia.js +1 -0
  29. package/dist/assets/StudentPreviewModal-0QSLnD9u.js +1 -0
  30. package/dist/assets/StudentView-9pjzjJgG.js +2 -0
  31. package/dist/assets/{SystemResourceLibraryModal-Ce-Dis6M.js → SystemResourceLibraryModal-COrhUd53.js} +1 -1
  32. package/dist/assets/TeacherView-mP2YucVr.js +2 -0
  33. package/dist/assets/{TimetableView-0VaTfpz3.js → TimetableView-BQG-rEb5.js} +4 -4
  34. package/dist/assets/index-C70OJPV_.js +217 -0
  35. package/dist/assets/index-CvGu7LSj.css +1 -0
  36. package/dist/assets/{index.es-CkgATcHw.js → index.es-C5eWEO4o.js} +1 -1
  37. package/dist/assets/{vendor-charts-U9fLlNC_.js → vendor-charts-qLbgF1eL.js} +1 -1
  38. package/dist/assets/{vendor-icons-30iiuCQb.js → vendor-icons-BRmhY6fg.js} +1 -1
  39. package/dist/assets/vendor-motion-BFAPOs-b.js +1 -0
  40. package/dist/assets/{vendor-pdf-Bw0ZQZtM.js → vendor-pdf-D7rGevI1.js} +3 -2
  41. package/dist/index.html +12 -13
  42. package/dist/server.cjs +4955 -623
  43. package/package.json +9 -4
  44. package/dist/assets/AdminDirectoryView-D-AOtp1o.js +0 -1
  45. package/dist/assets/ClassesView-DTuyCvYd.js +0 -19
  46. package/dist/assets/CloudDriveModal-Bi-aMuax.js +0 -1
  47. package/dist/assets/ComputerLabView-DWMtMSHV.js +0 -1
  48. package/dist/assets/CourseManagement-CeelAyst.js +0 -1
  49. package/dist/assets/CourseWizardModal-m7TDgcB2.js +0 -3
  50. package/dist/assets/CoursewareHubPanel-C4LQjt4v.js +0 -1
  51. package/dist/assets/Dashboard-CiBtG7Ge.js +0 -8
  52. package/dist/assets/HelpTour-00eT17Vg.js +0 -1
  53. package/dist/assets/InteractiveWhiteboard-jpweQ094.js +0 -77
  54. package/dist/assets/LazyCourseware-DVgyrg3r.js +0 -2
  55. package/dist/assets/LazyWhiteboard-BSzsAPXC.js +0 -2
  56. package/dist/assets/LessonEditorView-D4g48fr5.js +0 -1
  57. package/dist/assets/LiveClassroomView-HQGhVwd_.js +0 -1
  58. package/dist/assets/PluginView-D8cQ8mLM.js +0 -65
  59. package/dist/assets/QuizGeneratorModal-BFCJe1cm.js +0 -1
  60. package/dist/assets/StudentAssignmentView-C34nleZT.js +0 -1
  61. package/dist/assets/StudentLessonView-DNbu2o04.js +0 -1
  62. package/dist/assets/StudentPreviewModal-BXbKzQgo.js +0 -1
  63. package/dist/assets/StudentView-BF2WjF4_.js +0 -2
  64. package/dist/assets/TeacherView-BySyCiZG.js +0 -2
  65. package/dist/assets/index-C7jMgry5.js +0 -216
  66. package/dist/assets/index-huP36ZNf.css +0 -1
  67. package/dist/assets/vendor-motion-DjY2czvL.js +0 -1
  68. /package/dist/assets/{vendor-content-CYR4BTuT.js → purify.es-CYR4BTuT.js} +0 -0
@@ -1,3 +0,0 @@
1
- import{j as e,r as f}from"./vendor-react-B0t7H3hh.js";import{m as D,M as P}from"./index-C7jMgry5.js";import{B as y,f as j,w as W,n as L,r as I,t as v,a5 as E,z as M}from"./vendor-icons-30iiuCQb.js";import"./vendor-utils-m0Urvtws.js";import"./vendor-pdf-Bw0ZQZtM.js";import"./vendor-motion-DjY2czvL.js";import"./vendor-pptx-C5-U7ieS.js";import"./vendor-charts-U9fLlNC_.js";function Q(z){const{isCourseWizardOpen:w,setIsCourseWizardOpen:N,lang:t,wizardStep:o,setWizardStep:p,wizardIsSubmitting:x,wizardCourseTitle:g,setWizardCourseTitle:C,wizardCourseDescription:u,setWizardCourseDescription:k,wizardCourseCategory:n,setWizardCourseCategory:S,wizardCourseTimeline:i,setWizardCourseTimeline:c,wizardCourseContent:m,setWizardCourseContent:h,addToast:b,generateTemplateContent:T,handleDeployWizardCourse:A}=z;return e.jsx(e.Fragment,{children:w&&e.jsx("div",{className:"fixed inset-0 bg-gray-900/50 backdrop-blur-sm flex items-center justify-center p-4 md:p-6 z-50 overflow-y-auto text-gray-850",children:e.jsxs(D.div,{initial:{opacity:0,y:15,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.98},className:"bg-white border text-gray-900 border-gray-250 rounded-2xl shadow-2xl w-full max-w-4xl flex flex-col overflow-hidden max-h-[92vh] font-sans text-left",children:[e.jsxs("div",{className:"p-4 md:p-5 border-b border-gray-100 flex items-center justify-between bg-slate-50 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-indigo-50 border border-indigo-100 rounded-lg text-indigo-650",children:e.jsx(y,{size:20,className:"animate-pulse"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-bold text-gray-850 text-base md:text-lg",children:t==="zh"?"⭐ 互动课程发布与时间轴向导":"⭐ Course Design Guide & Wizard"}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:t==="zh"?"遵循系统设计法,逐步构建您的学科专属教案与课堂时间轴流程。":"Follow best practices to define curriculum content, timeline segments, and deploy."})]})]}),e.jsx("button",{onClick:()=>N(!1),className:"text-gray-400 hover:text-gray-650 font-bold p-1 rounded-lg hover:bg-gray-150 transition-all text-xl leading-none",children:"×"})]}),e.jsx("div",{className:"px-6 py-4.5 border-b border-gray-50 bg-slate-50/50 flex items-center justify-between gap-2 shrink-0 select-none",children:[{step:1,zh:"1内容选题",en:"1 Background"},{step:2,zh:"2课堂脉络",en:"2 Timeslots"},{step:3,zh:"3编写大纲",en:"3 Syllabus"},{step:4,zh:"4总览部署",en:"4 Deploy"}].map((r,a)=>{const l=o===r.step,s=o>r.step;return e.jsxs(f.Fragment,{children:[e.jsxs("div",{onClick:()=>!x&&p(r.step),className:`flex items-center gap-2 cursor-pointer transition-all ${l?"text-indigo-650 font-boldScale":s?"text-emerald-600 font-medium":"text-gray-400 hover:text-gray-600"}`,children:[e.jsx("div",{className:`w-5 h-5 rounded-full flex items-center justify-center text-xs border ${l?"bg-indigo-600 border-indigo-600 text-white shadow-xs font-bold":s?"bg-emerald-50 border-emerald-500 text-emerald-600 font-bold":"bg-white border-gray-250 text-gray-500"}`,children:s?"✓":r.step}),e.jsx("span",{className:"text-xs font-semibold hidden sm:inline",children:t==="zh"?r.zh:r.en})]}),a<3&&e.jsx("div",{className:`flex-1 h-0.5 max-w-[40px] md:max-w-none transition-all ${o>r.step?"bg-emerald-500":"bg-gray-200"}`})]},r.step)})}),e.jsxs("div",{className:"flex-grow overflow-y-auto p-5 md:p-6 space-y-5",children:[o===1&&e.jsxs("div",{className:"space-y-4 animate-in fade-in duration-200 text-left",children:[e.jsxs("div",{className:"bg-indigo-50/70 py-3.5 px-4.5 rounded-xl border border-indigo-100 text-xs text-indigo-750 font-sans leading-relaxed flex items-start gap-2",children:[e.jsx(j,{size:16,className:"text-indigo-500 shrink-0 mt-0.5 animate-bounce"}),e.jsxs("div",{children:[e.jsx("strong",{children:t==="zh"?"设计理念:":"Instructional ConceptTip:"}),e.jsx("p",{className:"mt-0.5",children:t==="zh"?"一个高品质的课程往往始于明确的选题背景。选择适当的学科科目分类,系统不仅会按您的选择在后续步骤推荐量身定做的教案摸板,还可以一键预装适合该学科的课堂互动时间轴模板。":"Selecting a clear title and specific subject category helps pre-populate customized Markdown content outlines and specialized scheduling presets."})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 font-sans",children:[e.jsxs("div",{className:"md:col-span-2 space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider mb-2",children:t==="zh"?"📍 课程/课件名称 *":"📍 Course Title *"}),e.jsx("input",{type:"text",required:!0,value:g,onChange:r=>C(r.target.value),placeholder:t==="zh"?"例:西方哲学:康德的三大批判、Python编程入门、高中物理电路并联原理":"e.g. Introduction to regressions, Western Philosophies, Lever Principles",className:"w-full px-4 py-3 border border-gray-250 rounded-xl focus:outline-none focus:ring-2 focus:ring-indigo-500 text-gray-800 text-sm shadow-xs"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider mb-2",children:t==="zh"?"🎯 课程设计简介与要点说明 (Objectives)":"🎯 Description & Lesson Objectives"}),e.jsx("textarea",{rows:4,value:u,onChange:r=>k(r.target.value),placeholder:t==="zh"?"在此处编写您的授课背景、面向学段及最关键的 2-3 个核心教学总目标。":"Write a short description stating learning outcomes and student prerequisite goals.",className:"w-full p-4 border border-gray-255 rounded-xl focus:outline-none focus:ring-2 focus:ring-indigo-500 text-gray-800 text-sm shadow-xs resize-none"})]})]}),e.jsxs("div",{className:"col-span-1 border-l border-gray-100 md:pl-6 space-y-4 text-left",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider mb-2",children:t==="zh"?"🎨 学部科目分类":"🎨 Subject Category"}),e.jsxs("select",{value:n,onChange:r=>{S(r.target.value)},className:"w-full bg-white border border-gray-250 text-gray-755 font-bold px-3 py-2.5 rounded-xl focus:outline-none focus:ring-2 focus:ring-indigo-500 shadow-xs text-sm cursor-pointer",children:[e.jsx("option",{value:"Mathematics",children:t==="zh"?"📐 基础数学与几何":"📐 Mathematics"}),e.jsx("option",{value:"ComputerScience",children:t==="zh"?"💻 计算机软件与人工智能":"💻 Computer Science"}),e.jsx("option",{value:"Literature",children:t==="zh"?"✍️ 语言文字与阅读理解":"✍️ Literature & Writing"}),e.jsx("option",{value:"Physics",children:t==="zh"?"⚡ 物理实验与自然探索":"⚡ Physics & Science"}),e.jsx("option",{value:"History",children:t==="zh"?"🏛️ 历史脉络与人地分析":"🏛️ History & Humanities"}),e.jsx("option",{value:"Art",children:t==="zh"?"🎨 交互设计与先锋创意艺术":"🎨 Visual Arts & Design"}),e.jsx("option",{value:"Other",children:t==="zh"?"🔮 交叉素养与综合学习":"🔮 General & Other"})]})]}),e.jsxs("div",{className:"bg-slate-50 p-4 rounded-xl border border-gray-100 space-y-2 select-none text-left",children:[e.jsx("span",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider block",children:t==="zh"?"科目时间轴专家建议":"SUBJECT HEURISTICS"}),e.jsxs("div",{className:"text-xs text-gray-600 leading-relaxed font-sans mt-1",children:[n==="Mathematics"&&(t==="zh"?"💡 数学:偏向理论推演。推荐 20分公式精讲 + 15分黑板实践互动,强化基础。":"💡 Math recommends: 20m Core Lecture + 15m Practice for theorem grounding."),n==="ComputerScience"&&(t==="zh"?"💡 计算机:偏重编码体验。推荐 15分白板代码推演 + 20分终端实验与分享。":"💡 CS recommends: 15m Algorithms + 20m Interactive workshops on virtual boards."),n==="Literature"&&(t==="zh"?"💡 语文文学:注重文本深度。推荐 10分范文研习 + 20分分组思辨,提升理解。":"💡 Lit recommends: 10m Reading Analysis + 20m Collaborative Discussions."),n==="Physics"&&(t==="zh"?"💡 科学类:逻辑导向。推荐 10分虚拟视频实验 + 20分机理讲解 + 10分钟随堂答卷。":"💡 Science recommends: 10m virtual showcase + 20m principles + 10m evaluation."),n==="History"&&(t==="zh"?"💡 历史人文:情景引入。推荐 15分人文画卷重塑 + 15分史实论驳辩论。":"💡 History recommends: 15m Context Mapping + 15m Interactive Debate panels."),n==="Art"&&(t==="zh"?"💡 视觉创意:自由度高。推荐 10分美术鉴赏 + 25分白板手绘画布互动体验。":"💡 Art recommends: 10m Aesthetics inspiration + 25m real-time board drawing."),n==="Other"&&(t==="zh"?"💡 其他科目:均分各小节时间,循序渐进,打造完整的教学循环闭环。":"💡 Generic: Divide evenly into sequential warm-up, core presentation and quiz.")]})]})]})]})]}),o===2&&e.jsxs("div",{className:"space-y-5 animate-in fade-in duration-200 text-left font-sans",children:[e.jsxs("div",{className:"bg-emerald-50/40 py-3.5 px-4.5 rounded-xl border border-emerald-100 text-xs text-emerald-850 leading-relaxed flex items-start gap-2 text-left",children:[e.jsx(W,{size:16,className:"text-emerald-555 shrink-0 mt-0.5 animate-pulse"}),e.jsxs("div",{children:[e.jsx("strong",{children:t==="zh"?"专家课堂时间轴预设:":"Dynamic Class Presets:"}),e.jsx("p",{className:"mt-0.5",children:t==="zh"?"好的教授节奏必须动静相宜。以下提供三种国际领先的精品课件时间节点设计,点击即可一键刷装配置。您也可以在下方自由增删和重新指定每个环节的长短!":"Curating temporal context maximizes classroom retention. Load from predefined templates or tweak the active steps on the dynamic table."})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider mb-2",children:t==="zh"?"💡 点击应用典型课堂框架模板 (Quick Apply)":"💡 Click to Auto-Apply Structure Presets"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[{id:"preset_standard",title:t==="zh"?"经典 5-20-15-5 讲授模式":"Traditional Dual-Lecture Paradigm",desc:t==="zh"?"由浅入深:先通过场景导入,后精讲,接着在白板配合大屏进行演练。":"Perfect dynamic for most standard classes.",segments:[{id:"seg-preset-1",title:"Course Orientation / 课堂导入",type:"intro",duration:"5m",color:"bg-blue-50 text-blue-700 border-blue-200 hover:bg-blue-100",notes:"Warm up topic"},{id:"seg-preset-2",title:"Subject Core Lecture / 核心理论精讲",type:"lecture",duration:"20m",color:"bg-indigo-50 text-indigo-700 border-indigo-200 hover:bg-indigo-100",notes:"Main content slide"},{id:"seg-preset-3",title:"Interactive Lab Work / 随堂协同演练",type:"practice",duration:"15m",color:"bg-green-50 text-green-700 border-green-200 hover:bg-green-100",notes:"Exercises & questions"},{id:"seg-preset-4",title:"Wrap up / 课堂成果总结与答疑",type:"summary",duration:"5m",color:"bg-purple-50 text-purple-700 border-purple-200 hover:bg-purple-100",notes:"Check answer notes"}]},{id:"preset_seminar",title:t==="zh"?"主题讨论工作坊模式":"Active Discussion Workshop",desc:t==="zh"?"协同探究:教师5分钟破冰,学生15分钟小组演练,15分钟对决汇报,10分钟定级。":"Discussion and presentation heavy layout.",segments:[{id:"seg-preset-5",title:"Debate Scenario Brief / 讨论情境简述",type:"intro",duration:"5m",color:"bg-amber-50 text-amber-700 border-amber-200 hover:bg-amber-100",notes:"Define debate metrics"},{id:"seg-preset-6",title:"Cooperative Ideation / 精英白板协作设计",type:"practice",duration:"15m",color:"bg-green-50 text-green-700 border-green-200 hover:bg-green-100",notes:"Joint workspace analysis"},{id:"seg-preset-7",title:"Student Team Presentation / 各小组交互汇报",type:"lecture",duration:"15m",color:"bg-indigo-50 text-indigo-700 border-indigo-200 hover:bg-indigo-100",notes:"Group screen sharing"},{id:"seg-preset-8",title:"Review & Grade Feedback / 教师深度对标点评",type:"summary",duration:"10m",color:"bg-purple-50 text-purple-700 border-purple-200 hover:bg-purple-100",notes:"Score reviews"}]},{id:"preset_flipped",title:t==="zh"?"翻转课堂高强度训练":"Targeted Problem-Solving Sprint",desc:t==="zh"?"应试/解惑突破:10分钟温习,15分钟重难盲点攻坚,15分钟专项题演习。":"Perfect for exams and targeted training courses.",segments:[{id:"seg-preset-9",title:"Blind Spot Evaluation / 温史自学效果自测",type:"intro",duration:"10m",color:"bg-blue-50 text-blue-700 border-blue-200 hover:bg-blue-100",notes:"Scan quiz"},{id:"seg-preset-10",title:"Advanced Principle Explores / 重难考点极限拆解",type:"lecture",duration:"15m",color:"bg-rose-50 text-rose-700 border-rose-200 hover:bg-rose-100",notes:"Analyse weak metrics"},{id:"seg-preset-11",title:"Mock Solving Battle / 核心精选题实操对抗",type:"practice",duration:"15m",color:"bg-emerald-50 text-emerald-700 border-emerald-200 hover:bg-emerald-100",notes:"Sprint workout"},{id:"seg-preset-12",title:"Anchor Recap / 知识网架构网节点固化",type:"summary",duration:"5m",color:"bg-purple-50 text-purple-700 border-purple-200 hover:bg-purple-100",notes:"Highlight checklist"}]}].map(r=>e.jsxs("button",{type:"button",onClick:()=>{c(r.segments),b(t==="zh"?"预设已刷装":"Preset Configured",t==="zh"?`已将《${r.title}》应用到您当前设计的课程中。`:`Assigned "${r.title}" timeslots.`,"success")},className:"bg-white border rounded-xl p-3 text-left transition-all hover:bg-indigo-50/20 hover:border-indigo-400 cursor-pointer active:scale-98",children:[e.jsx("div",{className:"font-bold text-gray-800 text-xs sm:text-sm",children:r.title}),e.jsx("div",{className:"text-xs text-gray-400 mt-1.5 leading-relaxed",children:r.desc})]},r.id))})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2 select-none",children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider",children:t==="zh"?"📌 流程时间卡编辑 (拖拽或直接对表格字段赋值)":"📌 Custom Timeslot Table (Edit fields directly)"}),e.jsxs("button",{type:"button",onClick:()=>{const r={id:`seg-w-custom-${Date.now()}`,title:t==="zh"?`自理授课阶段 ${i.length+1}`:`Interactive Step ${i.length+1}`,type:"practice",duration:"10m",color:"bg-slate-50 text-slate-700 border-slate-200 hover:bg-slate-100",notes:""};c([...i,r])},className:"flex items-center gap-1 text-xs font-bold text-indigo-600 hover:text-indigo-800 cursor-pointer",children:[e.jsx(L,{size:12})," ",t==="zh"?"增设阶段":"Append Phase"]})]}),e.jsx("div",{className:"space-y-2 border border-gray-150 rounded-xl p-3.5 bg-gray-50/50",children:i.map((r,a)=>e.jsxs("div",{className:"flex flex-col sm:flex-row items-center gap-3 bg-white border border-gray-200 rounded-lg p-2.5 shadow-xs",children:[e.jsxs("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:[e.jsx("span",{className:"w-5 h-5 rounded-full bg-slate-100 flex items-center justify-center text-xs text-gray-500 font-bold shrink-0",children:a+1}),e.jsx("input",{type:"text",value:r.title,onChange:l=>{const s=[...i];s[a].title=l.target.value,c(s)},className:"font-bold text-xs text-gray-800 bg-transparent border-b border-transparent hover:border-gray-200 focus:border-indigo-500 py-0.5 px-1 focus:outline-none focus:bg-gray-50/50 rounded flex-1 sm:w-56",placeholder:"Phase Title"})]}),e.jsxs("div",{className:"flex items-center gap-2.5 w-full sm:w-auto justify-end sm:ml-auto",children:[e.jsxs("div",{className:"flex items-center gap-1 bg-slate-50 border border-gray-200 rounded px-2 py-0.5 shrink-0",children:[e.jsx("span",{className:"text-xs font-bold text-gray-400",children:"时长:"}),e.jsx("input",{type:"text",value:r.duration,onChange:l=>{const s=[...i];s[a].duration=l.target.value,c(s)},className:"w-8 text-xs text-gray-800 font-extrabold bg-transparent text-center focus:outline-none"})]}),e.jsxs("select",{value:r.type,onChange:l=>{const s=l.target.value,d=[...i];d[a].type=s,s==="intro"?d[a].color="bg-blue-50 text-blue-700 border-blue-200 hover:bg-blue-100":s==="lecture"?d[a].color="bg-indigo-50 text-indigo-700 border-indigo-200 hover:bg-indigo-100":s==="practice"?d[a].color="bg-green-50 text-green-700 border-green-200 hover:bg-green-100":s==="summary"?d[a].color="bg-purple-50 text-purple-700 border-purple-200 hover:bg-purple-100":d[a].color="bg-gray-50 text-gray-700 border-gray-205 hover:bg-gray-100",c(d)},className:"bg-slate-50 border border-gray-200 text-xs font-bold text-gray-600 rounded p-1 focus:outline-none cursor-pointer",children:[e.jsx("option",{value:"intro",children:t==="zh"?"温习 / 导入":"Warm-up / Intro"}),e.jsx("option",{value:"lecture",children:t==="zh"?"主体 / 精讲":"Core Lecture"}),e.jsx("option",{value:"practice",children:t==="zh"?"交互白板练习":"Practice Workshop"}),e.jsx("option",{value:"summary",children:t==="zh"?"总结 / 定级":"Wrap-up / Recap"})]}),e.jsx("button",{type:"button",onClick:()=>{if(i.length<=1){alert(t==="zh"?"请保留至少一个核心环节!":"At least one segment must exist.");return}const l=i.filter((s,d)=>d!==a);c(l)},className:"text-gray-400 hover:text-rose-600 font-bold p-1 cursor-pointer text-sm select-none",title:"Delete this segment",children:"×"})]})]},r.id))}),e.jsxs("div",{className:"mt-2 text-xs text-right text-gray-500 font-mono select-none",children:[t==="zh"?"📈 环节累加公式:":"📈 Dynamic aggregation formula: ",e.jsx("span",{className:"text-gray-800 font-semibold",children:i.map(r=>r.duration).join(" + ")})]})]})]}),o===3&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 animate-in fade-in duration-200 font-sans text-left",children:[e.jsxs("div",{className:"space-y-3 flex flex-col h-full min-h-[360px] text-left",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-2",children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider select-none shrink-0",children:t==="zh"?"✏️ 使用 Markdown 语法编写课时材料":"✏️ Lesson Materials (Markdown)"}),e.jsxs("button",{type:"button",onClick:()=>{const r=T(g,n);h(r),b(t==="zh"?"大纲模板生成成功":"Curriculum Loaded",t==="zh"?"针对所选择的模型和属性已一键刷装教案模板框架。":"Prepopulated Markdown structure.","success")},className:"flex items-center gap-1 text-xs bg-indigo-50 border border-indigo-100 text-indigo-755 hover:bg-indigo-100 px-3 py-1 rounded-lg transition-colors font-bold cursor-pointer",children:[e.jsx(j,{size:13,className:"text-indigo-500 animate-spin"}),t==="zh"?"✨ 一键生成专家级教学大纲模版":"✨ Autofill Outline Template"]})]}),e.jsx("textarea",{rows:14,value:m,onChange:r=>h(r.target.value),placeholder:t==="zh"?`# 西方哲学三大经典原理
2
-
3
- 在此输入您的具体内容讲解、白板图形绘制节点、以及课后实践任务大纲...`:"# Course curriculum content",className:"w-full flex-grow p-4 bg-slate-900 text-slate-100 border border-slate-700 rounded-xl focus:outline-none focus:ring-2 focus:ring-indigo-500 font-mono text-xs shadow-inner leading-relaxed text-left"})]}),e.jsxs("div",{className:"space-y-3 flex flex-col h-full border border-gray-150 rounded-xl bg-slate-50/50 p-4 text-left",children:[e.jsxs("span",{className:"block text-xs font-bold text-gray-400 uppercase tracking-wider select-none shrink-0",children:["🖥️ ",t==="zh"?"大纲资料实时交互渲染":"Syllabus Live Context rendering"]}),e.jsx("div",{className:"flex-grow overflow-y-auto bg-white border border-gray-150 rounded-lg p-4 text-xs font-sans text-gray-700 max-h-[380px] overflow-x-hidden text-left select-text",children:m.trim()?e.jsx("div",{className:"markdown-body",children:e.jsx(P,{children:m})}):e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-400 italic py-16",children:[e.jsx(y,{size:32,className:"mb-2 opacity-20 text-indigo-500"}),e.jsx("span",{children:t==="zh"?"教案空无内容,等待输入或一键填充模板...":"Waiting for materials..."})]})})]})]}),o===4&&e.jsxs("div",{className:"space-y-6 animate-in fade-in duration-200 text-center font-sans max-w-xl mx-auto py-3",children:[e.jsx("div",{className:"inline-flex p-3 bg-emerald-50 border border-emerald-100 text-emerald-500 rounded-full",children:e.jsx(I,{size:36,className:"animate-pulse text-emerald-555"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-extrabold text-gray-800 text-base md:text-lg",children:t==="zh"?"🚀 互动课程已精心筹备成功!":"🚀 Materials Generated successfully!"}),e.jsx("p",{className:"text-xs text-gray-400 mt-1",children:t==="zh"?"设计与时间轴逻辑全部检验合格。请在下方核验新课卡片,确认无误一键部署入 SQLite 内核数据库。":"Curriculum parameters are ready to boot inside the Secure Host."})]}),e.jsxs("div",{className:"border border-indigo-200 rounded-2xl p-5 bg-linear-to-b from-indigo-50/20 to-white shadow-md text-left space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-indigo-50 pb-3 gap-2",children:[e.jsx("div",{className:"font-bold text-indigo-950 text-base sm:text-lg truncate",children:g||(t==="zh"?"未指定课程主题":"Blank Topic")}),e.jsx("span",{className:"inline-flex px-2 py-0.5 rounded text-xs font-extrabold bg-indigo-50 text-indigo-800 uppercase tracking-wide border border-indigo-150 shrink-0",children:n})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-xs",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400 block tracking-wider text-xs font-bold",children:t==="zh"?"教研环节数":"TOTAL STEPS"}),e.jsxs("span",{className:"text-gray-800 font-extrabold text-sm block mt-1",children:[i.length," ",t==="zh"?"项教学环节":"slots"]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400 block tracking-wider text-xs font-bold",children:t==="zh"?"发布载体引擎":"STORAGE MEDIUM"}),e.jsxs("div",{className:"flex items-center gap-1 text-emerald-650 font-extrabold text-sm mt-1",children:[e.jsx(v,{size:11,className:"text-emerald-500"}),e.jsx("span",{children:"SQLite DB"})]})]})]}),e.jsx("div",{className:"bg-slate-50 border border-gray-150 p-3 rounded-lg text-xs text-gray-600 line-clamp-2 italic leading-relaxed text-left",children:u||(t==="zh"?"无科目描述内容":"No description written.")}),e.jsxs("div",{className:"space-y-1.5 select-none",children:[e.jsx("span",{className:"text-xs font-extrabold text-gray-400 uppercase tracking-wider block",children:t==="zh"?"教学时间轴环流预览":"TIMELINE PROGRESS OVERVIEW"}),e.jsx("div",{className:"flex items-center gap-1 w-full overflow-x-auto py-1",children:i.map((r,a)=>e.jsxs(f.Fragment,{children:[e.jsxs("div",{className:`px-2 py-1 text-xs font-bold rounded border truncate max-w-[120px] ${r.color.split(" ")[0]}`,children:[r.title.split(" / ")[0]," (",r.duration,")"]}),a<i.length-1&&e.jsx(E,{size:11,className:"text-gray-300"})]},r.id))})]})]})]})]}),e.jsxs("div",{className:"p-4 border-t border-gray-105 bg-slate-50 flex justify-between items-center shrink-0",children:[e.jsx("span",{className:"text-xs font-bold font-mono text-gray-400 uppercase select-none",children:t==="zh"?"⚙️ SQLITE 写入预检通过":"⚙️ SQLITE VERIFICATION SUCCESS"}),e.jsxs("div",{className:"flex items-center gap-2",children:[o>1&&e.jsx("button",{type:"button",onClick:()=>p(r=>r-1),disabled:x,className:"px-4 py-2 text-xs font-semibold border border-gray-200 text-gray-700 bg-white hover:bg-gray-50 rounded-lg transition-colors cursor-pointer select-none",children:t==="zh"?"上一步":"Back"}),o<4?e.jsx("button",{type:"button",onClick:()=>{if(o===1&&!g.trim()){alert(t==="zh"?"请输入课程课题名称!":"Please type course title to proceed.");return}p(r=>r+1)},className:"px-4.5 py-2 text-xs font-bold bg-indigo-600 hover:bg-indigo-700 text-white rounded-lg shadow-sm flex items-center gap-1 cursor-pointer select-none",children:t==="zh"?"继续前进":"Continue"}):e.jsx("button",{type:"button",onClick:A,disabled:x,className:"px-5 py-2 text-xs font-bold bg-emerald-600 hover:bg-emerald-700 text-white rounded-lg shadow-md flex items-center gap-1.5 cursor-pointer disabled:opacity-50 select-none animate-bounce",children:x?e.jsxs(e.Fragment,{children:[e.jsx(M,{size:13,className:"animate-spin"}),e.jsx("span",{children:t==="zh"?"写入底库中...":"Deploying..."})]}):e.jsxs(e.Fragment,{children:[e.jsx(v,{size:13}),e.jsx("span",{children:t==="zh"?"部署并激活新课程":"Deploy & Activate"})]})})]})]})]})})})}export{Q as CourseWizardModal};
@@ -1 +0,0 @@
1
- import{r as a,j as e}from"./vendor-react-B0t7H3hh.js";import{O as T,X as M,au as R,a6 as V,d as O,V as q,r as X,E as B,av as G,s as J,T as K}from"./vendor-icons-30iiuCQb.js";import"./vendor-utils-m0Urvtws.js";const Q="@courseware-hub/plugin",W=h=>`${Q}.${h}`;function ce({onClose:h,lang:m}){const[p,k]=a.useState([]),[_,b]=a.useState(!1),[u,z]=a.useState(""),[g,P]=a.useState(""),[y,j]=a.useState(!1),[U,f]=a.useState(null),[n,D]=a.useState(null),[N,E]=a.useState([]),[Y,Z]=a.useState(null),[c,v]=a.useState(""),[w,S]=a.useState(60),[d,C]=a.useState(""),[ee,se]=a.useState(null),[te,ae]=a.useState(""),[re,le]=a.useState(60),i=a.useCallback(async(s,r)=>{const l=await fetch("/api/commands",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({commandType:W(s),payload:r??{}})});if(!l.ok){const $=await l.json();throw new Error($.error||"Command failed")}return(await l.json()).result},[]),o=a.useCallback(async()=>{b(!0);try{const s=await i("courseware.query",{status:g||void 0,search:u||void 0,limit:100});k(s?.items??[])}catch(s){console.error("Fetch courseware list failed:",s)}finally{b(!1)}},[i,g,u]);a.useEffect(()=>{o()},[o]);const L=async()=>{if(!(!c.trim()||!d.trim())){j(!0);try{await i("courseware.upload",{title:c.trim(),html_content:d,pass_score:w}),v(""),C(""),S(60),await o()}catch(s){alert(s.message)}finally{j(!1)}}},F=s=>{const r=s.target.files?.[0];if(!r)return;const l=new FileReader;l.onload=x=>C(x.target?.result??""),l.readAsText(r)},H=async(s,r)=>{const l=r==="published"?"draft":"published";try{await i("courseware.publish",{id:s,status:l}),await o()}catch(x){alert(x.message)}},I=async(s,r)=>{if(confirm(m==="zh"?`确认删除课件「${r}」及其所有版本和成绩数据?`:`Delete "${r}" and all versions/scores?`))try{await i("courseware.delete",{id:s}),await o()}catch(l){alert(l.message)}},A=async s=>{try{const r=await i("courseware.get_detail",{id:s}),l=await i("courseware.query_scores",{courseware_id:s});D(r),E(l?.items??[]),f(s)}catch(r){alert(r.message)}},t=(s,r)=>m==="zh"?s:r;return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm",children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-2xl border border-gray-200 w-[90vw] max-w-5xl h-[85vh] flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-indigo-50 text-indigo-600 rounded-xl",children:e.jsx(T,{size:20})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-gray-800",children:t("课件管理","Courseware Hub")}),e.jsx("p",{className:"text-xs text-gray-400",children:t("上传 HTML 课件 · 成绩采集 · 版本管理","Upload · Score Collection · Versioning")})]})]}),e.jsx("button",{onClick:h,className:"p-2 hover:bg-gray-100 rounded-lg transition-colors",children:e.jsx(M,{size:18,className:"text-gray-400"})})]}),U?e.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[e.jsxs("button",{onClick:()=>f(null),className:"text-sm text-indigo-600 hover:underline mb-4 inline-flex items-center gap-1",children:["← ",t("返回列表","Back to list")]}),n&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-gray-50 rounded-xl p-5 border border-gray-100",children:[e.jsx("h3",{className:"font-bold text-gray-800 mb-3",children:n.title}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-2 text-sm",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"text-gray-400",children:[t("版本","Version"),":"]})," ",e.jsx("span",{className:"font-mono text-gray-700",children:n.version})]}),e.jsxs("div",{children:[e.jsxs("span",{className:"text-gray-400",children:[t("状态","Status"),":"]})," ",e.jsx("span",{className:`font-bold ${n.status==="published"?"text-green-600":"text-amber-600"}`,children:n.status})]}),e.jsxs("div",{children:[e.jsxs("span",{className:"text-gray-400",children:[t("及格线","Pass Score"),":"]})," ",e.jsx("span",{className:"font-mono",children:n.pass_score})]}),e.jsxs("div",{children:[e.jsxs("span",{className:"text-gray-400",children:[t("提交数","Submissions"),":"]})," ",e.jsx("span",{className:"font-mono",children:n.stats?.submissions??0})]}),e.jsxs("div",{children:[e.jsxs("span",{className:"text-gray-400",children:[t("平均分","Avg Score"),":"]})," ",e.jsx("span",{className:"font-mono text-indigo-600 font-bold",children:n.stats?.avg_score??"-"})]}),e.jsxs("div",{children:[e.jsxs("span",{className:"text-gray-400",children:[t("通过率","Pass Rate"),":"]})," ",e.jsxs("span",{className:"font-mono",children:[n.stats?.pass_rate??"-","%"]})]})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-bold text-gray-700 mb-3",children:t("成绩列表","Score List")}),N.length===0?e.jsx("p",{className:"text-sm text-gray-400 italic",children:t("暂无成绩记录","No scores yet")}):e.jsx("div",{className:"overflow-x-auto border border-gray-200 rounded-xl",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-gray-50 text-gray-500 text-xs uppercase",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-2 text-left",children:t("学生","Student")}),e.jsx("th",{className:"px-4 py-2 text-right",children:t("分数","Score")}),e.jsx("th",{className:"px-4 py-2 text-right",children:t("用时(秒)","Time(s)")}),e.jsx("th",{className:"px-4 py-2 text-right",children:t("提交时间","Submitted")})]})}),e.jsx("tbody",{className:"divide-y divide-gray-100",children:N.map(s=>e.jsxs("tr",{className:"hover:bg-gray-50",children:[e.jsx("td",{className:"px-4 py-2 font-medium text-gray-700",children:s.student_name||s.student_id}),e.jsxs("td",{className:`px-4 py-2 text-right font-mono font-bold ${s.score>=(n?.pass_score??60)?"text-green-600":"text-red-500"}`,children:[s.score,"/",s.total]}),e.jsx("td",{className:"px-4 py-2 text-right text-gray-500",children:s.time_spent}),e.jsx("td",{className:"px-4 py-2 text-right text-gray-400 text-xs",children:new Date(s.submitted_at).toLocaleString()})]},s.id))})]})})]})]})]}):e.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[e.jsxs("div",{className:"px-6 py-3 border-b border-gray-100 flex items-center gap-3 shrink-0 flex-wrap",children:[e.jsxs("div",{className:"relative flex-1 min-w-[200px]",children:[e.jsx(R,{size:14,className:"absolute left-3 top-2.5 text-gray-400"}),e.jsx("input",{value:u,onChange:s=>z(s.target.value),placeholder:t("搜索课件...","Search courseware..."),className:"w-full pl-9 pr-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-1 focus:ring-indigo-500 outline-none"})]}),e.jsxs("select",{value:g,onChange:s=>P(s.target.value),className:"text-sm border border-gray-200 rounded-lg px-3 py-2 outline-none focus:ring-1 focus:ring-indigo-500 bg-white",children:[e.jsx("option",{value:"",children:t("全部状态","All Status")}),e.jsx("option",{value:"published",children:t("已发布","Published")}),e.jsx("option",{value:"draft",children:t("草稿","Draft")}),e.jsx("option",{value:"archived",children:t("已归档","Archived")})]}),e.jsx("button",{onClick:o,className:"p-2 hover:bg-gray-100 rounded-lg transition-colors",title:t("刷新","Refresh"),children:e.jsx(V,{size:16,className:"text-gray-400"})})]}),e.jsx("div",{className:"px-6 py-4 border-b border-gray-100 bg-indigo-50/30 shrink-0",children:e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsxs("span",{className:"text-sm font-bold text-gray-600 shrink-0",children:[t("上传课件","Upload"),":"]}),e.jsx("input",{value:c,onChange:s=>v(s.target.value),placeholder:t("课件标题","Title"),className:"text-sm border border-gray-200 rounded-lg px-3 py-2 w-40 outline-none focus:ring-1 focus:ring-indigo-500"}),e.jsx("input",{type:"number",value:w,onChange:s=>S(Number(s.target.value)),placeholder:t("及格线","Pass"),className:"text-sm border border-gray-200 rounded-lg px-3 py-2 w-20 outline-none focus:ring-1 focus:ring-indigo-500"}),e.jsxs("label",{className:"text-sm px-3 py-2 border border-dashed border-gray-300 rounded-lg cursor-pointer hover:border-indigo-400 hover:bg-white transition-colors text-gray-500",children:[e.jsx(O,{size:14,className:"inline mr-1"}),d?t("已选择文件","File selected"):t("选择 HTML","Select HTML"),e.jsx("input",{type:"file",accept:".html,.htm",onChange:F,className:"hidden"})]}),e.jsx("button",{onClick:L,disabled:y||!c.trim()||!d.trim(),className:"px-4 py-2 bg-indigo-600 text-white text-sm font-bold rounded-lg hover:bg-indigo-700 disabled:opacity-40 transition-colors",children:y?t("上传中...","Uploading..."):t("上传","Upload")})]})}),e.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:_?e.jsx("div",{className:"text-center py-12 text-gray-400",children:t("加载中...","Loading...")}):p.length===0?e.jsxs("div",{className:"text-center py-12 text-gray-400",children:[e.jsx(T,{size:40,className:"mx-auto mb-3 opacity-30"}),e.jsx("p",{children:t("暂无课件,请上传您的第一个 HTML 课件","No courseware yet. Upload your first HTML courseware.")})]}):e.jsx("div",{className:"grid gap-4",children:p.map(s=>e.jsx("div",{className:"bg-white border border-gray-200 rounded-xl p-4 hover:border-indigo-200 transition-colors shadow-sm",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h4",{className:"font-bold text-gray-800 truncate",children:s.title}),e.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-bold ${s.status==="published"?"bg-green-50 text-green-650 border border-green-200":s.status==="archived"?"bg-gray-50 text-gray-500 border border-gray-200":"bg-amber-50 text-amber-650 border border-amber-200"}`,children:s.status==="published"?t("已发布","Published"):s.status==="archived"?t("已归档","Archived"):t("草稿","Draft")}),e.jsxs("span",{className:"text-xs text-gray-400 font-mono",children:["v",s.version]})]}),s.description&&e.jsx("p",{className:"text-xs text-gray-400 line-clamp-2 mb-2",children:s.description}),e.jsxs("div",{className:"flex items-center gap-4 text-xs text-gray-400",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(q,{size:12}),t("提交","Subs"),": ",s.stats?.submissions??0]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(X,{size:12}),t("均分","Avg"),": ",s.stats?.avg_score??"-"]}),s.security_warnings?.length>0&&e.jsxs("span",{className:"text-amber-500 flex items-center gap-1",title:s.security_warnings.join(", "),children:["⚠ ",s.security_warnings.length]})]})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[e.jsx("button",{onClick:()=>A(s.id),className:"p-1.5 hover:bg-gray-100 rounded-lg transition-colors",title:t("详情","Details"),children:e.jsx(B,{size:15,className:"text-gray-400"})}),e.jsx("button",{onClick:()=>H(s.id,s.status),className:"p-1.5 hover:bg-gray-100 rounded-lg transition-colors",title:s.status==="published"?t("下架","Unpublish"):t("发布","Publish"),children:s.status==="published"?e.jsx(G,{size:15,className:"text-amber-500"}):e.jsx(J,{size:15,className:"text-green-500"})}),e.jsx("button",{onClick:()=>I(s.id,s.title),className:"p-1.5 hover:bg-red-50 rounded-lg transition-colors",title:t("删除","Delete"),children:e.jsx(K,{size:15,className:"text-red-400"})})]})]})},s.id))})})]})]})})}export{ce as CoursewareHubPanel};
@@ -1,8 +0,0 @@
1
- import{r as c,j as e}from"./vendor-react-B0t7H3hh.js";import{A as V,m as O,E as X}from"./index-C7jMgry5.js";import{aA as J,X as H,af as R,$ as K,B as E,aB as Y,r as Z,U as Q,f as ee,O as se,z as te,aC as le,n as ae,ar as ne,aD as re,b as U,aE as G,e as ie,w as oe}from"./vendor-icons-30iiuCQb.js";import"./vendor-utils-m0Urvtws.js";import"./vendor-pdf-Bw0ZQZtM.js";import"./vendor-motion-DjY2czvL.js";import"./vendor-pptx-C5-U7ieS.js";import"./vendor-charts-U9fLlNC_.js";function de({classes:x,lessons:n,lang:g,onScheduleClass:z,onGenerateAssignment:A,onCreateLesson:q}){const[m,v]=c.useState(!1),[r,h]=c.useState("menu"),[y,N]=c.useState(""),[w,p]=c.useState(""),[C,T]=c.useState(""),[k,L]=c.useState(""),[D,F]=c.useState(""),[P,M]=c.useState(""),[S,I]=c.useState(""),[_,f]=c.useState(!1),[$,l]=c.useState(!1),[o,i]=c.useState(null),s={zh:{quickActions:"快捷操作指令",quickDesc:"无需切换页面,在此直接向教育总线或班级下发运行调度命令。",scheduleClass:"排课计划调度",scheduleDesc:"为班级分配课程段并指定授课时间",generateAssignment:"生成 AI 测验任务",generateDesc:"利用代理模型为班级定制专属能力题目",createLesson:"注册教学课件",createDesc:"发布新的富文本 Markdown 教材大纲",back:"返回上级",confirm:"确认并下发指令",classSelect:"选择目标班级",lessonSelect:"选择关联课件",dateSelect:"授课日期选择",assignmentTopic:"测验主题方向 / 核心知识点",assignmentTopicPlaceholder:"例: 一元二次方程,光合作用,牛顿运动定律等...",lessonTitle:"课件名称(大纲标题)",lessonTitlePlaceholder:"例: 量子力学初步 / 物理实验基础",lessonContent:"详细授课内容 (Markdown 支持)",successScheduled:"排课成功!总线已捕获日程数据。",successAssignment:"AI 测验任务成功生成,稍后同步。",successLesson:"新课件发布成功!画板白板可直接拖拽加载。",emptyClasses:"未检测到活跃班级",emptyLessons:"未检测到可用课件",loadingBus:"内核微服务运行中...",genericError:"网络或核指令总线调用失败,请重试"},en:{quickActions:"Quick Actions",quickDesc:"Deploy scheduler and class orchestration bus commands instantly from here.",scheduleClass:"Schedule Lesson Period",scheduleDesc:"Assign a lesson package and scheduled date to an active class",generateAssignment:"Generate AI Assignment",generateDesc:"Deploy agent workflows to design tailored student test cases",createLesson:"Register Lesson Curriculum",createDesc:"Publish new rich Markdown-based whiteboard syllabus",back:"Back",confirm:"Execute Command",classSelect:"Select Class",lessonSelect:"Select Lesson Template",dateSelect:"Choose Scheduled Date",assignmentTopic:"Assignment Topic / Target Knowledge",assignmentTopicPlaceholder:"e.g., Quadratic equations, Photosynthesis, Newtonian gravity...",lessonTitle:"Lesson Curriculum Title",lessonTitlePlaceholder:"e.g., Intro to Quantum Mechanics",lessonContent:"Whiteboard Curriculum Content (Markdown)",successScheduled:"Success! Dynamic class schedule updated.",successAssignment:"Success! AI is compiling custom quiz structures.",successLesson:"Success! Ready to orchestrate inside classroom sandbox.",emptyClasses:"No classes discovered",emptyLessons:"No lessons discovered",loadingBus:"Interfacing core services...",genericError:"System bus execute command failure, please retry"}}[g],a=()=>{N(""),p(""),T(""),L(""),F(""),M(""),I(""),i(null),l(!1),f(!1)},d=()=>{switch(r){case"schedule":return s.successScheduled;case"assignment":return s.successAssignment;case"lesson":return s.successLesson;default:return""}},b=t=>{a(),h(t),x.length>0&&(N(x[0].id),L(x[0].id)),n.length>0&&p(n[0].id),t==="lesson"&&I(`# 新课件名称
2
-
3
- ## 教学目标
4
- - 掌握核心考点
5
- - 熟练完成基础物理实验
6
-
7
- ## 课堂探究
8
- 这里写课本的主要讲授要点。`)},j=async t=>{t.preventDefault(),f(!0),i(null);try{let u=!1;if(r==="schedule"){if(!y||!w||!C){i("Please complete all form fields."),f(!1);return}u=await z(y,w,C)}else if(r==="assignment"){if(!k||!D.trim()){i("Please specify target class and a valid topic."),f(!1);return}u=await A(k,D.trim())}else if(r==="lesson"){if(!P.trim()||!S.trim()){i("Title and Content can not be empty."),f(!1);return}u=await q(P.trim(),S.trim())}u?(l(!0),setTimeout(()=>{l(!1),h("menu")},2200)):i(s.genericError)}catch(u){i(u.message||s.genericError)}finally{f(!1)}};return e.jsxs("div",{id:"quick-actions-fab-container",className:"absolute bottom-8 right-8 z-40 flex flex-col items-end",children:[e.jsx(V,{children:m&&e.jsxs(O.div,{initial:{opacity:0,y:15,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:15,scale:.95},transition:{duration:.18},className:"mb-4 w-[360px] sm:w-[420px] bg-white border border-gray-200 rounded-2xl shadow-xl overflow-hidden flex flex-col focus:outline-none",id:"quick-actions-popup-card",children:[e.jsxs("div",{className:"bg-indigo-600 px-5 py-4 text-white flex items-center justify-between shadow-inner",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(J,{size:18,className:"animate-pulse"}),e.jsx("h3",{className:"font-bold text-sm tracking-wide",children:s.quickActions})]}),e.jsx("button",{onClick:()=>{v(!1),h("menu")},className:"text-white/80 hover:text-white hover:bg-white/15 p-1 rounded-full transition-all focus:outline-none",title:"Close Portal",children:e.jsx(H,{size:16})})]}),e.jsxs("div",{className:"p-5 max-h-[480px] overflow-y-auto bg-gray-50/50",children:[r==="menu"&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-xs text-gray-500 leading-relaxed font-medium bg-indigo-50/50 border border-indigo-100 p-2.5 rounded-lg mb-4",children:s.quickDesc}),e.jsxs("div",{onClick:()=>b("schedule"),className:"flex items-start gap-3.5 p-3.5 bg-white border border-gray-200 hover:border-indigo-400 hover:shadow-md rounded-xl cursor-pointer transition-all hover:scale-101 group",id:"action-schedule-class",children:[e.jsx("div",{className:"p-2.5 bg-indigo-50 text-indigo-600 rounded-lg group-hover:bg-indigo-600 group-hover:text-white transition-colors duration-200",children:e.jsx(R,{size:18})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"text-xs font-bold text-gray-800 flex items-center gap-1 group-hover:text-indigo-600 transition-colors uppercase tracking-wider",children:s.scheduleClass}),e.jsx("p",{className:"text-xs text-gray-500 mt-1 leading-relaxed",children:s.scheduleDesc})]})]}),e.jsxs("div",{onClick:()=>b("assignment"),className:"flex items-start gap-3.5 p-3.5 bg-white border border-gray-200 hover:border-purple-400 hover:shadow-md rounded-xl cursor-pointer transition-all hover:scale-101 group",id:"action-generate-assignment",children:[e.jsx("div",{className:"p-2.5 bg-purple-50 text-purple-600 rounded-lg group-hover:bg-purple-600 group-hover:text-white transition-colors duration-200",children:e.jsx(K,{size:18})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"text-xs font-bold text-gray-800 flex items-center gap-1 group-hover:text-purple-600 transition-colors uppercase tracking-wider",children:s.generateAssignment}),e.jsx("p",{className:"text-xs text-gray-500 mt-1 leading-relaxed",children:s.generateDesc})]})]}),e.jsxs("div",{onClick:()=>b("lesson"),className:"flex items-start gap-3.5 p-3.5 bg-white border border-gray-200 hover:border-emerald-400 hover:shadow-md rounded-xl cursor-pointer transition-all hover:scale-101 group",id:"action-create-lesson",children:[e.jsx("div",{className:"p-2.5 bg-emerald-50 text-emerald-600 rounded-lg group-hover:bg-emerald-600 group-hover:text-white transition-colors duration-200",children:e.jsx(E,{size:18})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"text-xs font-bold text-gray-800 flex items-center gap-1 group-hover:text-emerald-600 transition-colors uppercase tracking-wider",children:s.createLesson}),e.jsx("p",{className:"text-xs text-gray-500 mt-1 leading-relaxed",children:s.createDesc})]})]})]}),r!=="menu"&&e.jsxs("div",{className:"relative",children:[e.jsxs("button",{onClick:()=>h("menu"),className:"flex items-center gap-1.5 text-xs text-gray-500 hover:text-indigo-600 font-semibold mb-4 cursor-pointer focus:outline-none",id:"action-back-button",children:[e.jsx(Y,{size:14}),e.jsx("span",{children:s.back})]}),$?e.jsxs(O.div,{initial:{scale:.95},animate:{scale:1},className:"flex flex-col items-center justify-center py-10 text-center",children:[e.jsx(Z,{size:48,className:"text-green-500 animate-bounce mb-3"}),e.jsx("h4",{className:"font-bold text-green-800 text-sm",children:d()}),e.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Returning to action console..."})]}):e.jsxs("form",{onSubmit:j,className:"space-y-4",children:[o&&e.jsxs("div",{className:"p-3 bg-red-50 border border-red-200 rounded-lg text-red-600 text-xs font-semibold",children:["⚠️ ",o]}),r==="schedule"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600 flex items-center gap-1",children:[e.jsx(Q,{size:12})," ",s.classSelect]}),x.length===0?e.jsx("p",{className:"text-xs italic text-red-500",children:s.emptyClasses}):e.jsx("select",{value:y,onChange:t=>N(t.target.value),className:"w-full bg-white border border-gray-200 rounded-lg p-2.5 text-xs focus:ring-2 focus:ring-indigo-500 text-gray-700 font-medium",children:x.map(t=>e.jsx("option",{value:t.id,children:t.name},t.id))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600 flex items-center gap-1",children:[e.jsx(E,{size:12})," ",s.lessonSelect]}),n.length===0?e.jsx("p",{className:"text-xs italic text-red-500",children:s.emptyLessons}):e.jsx("select",{value:w,onChange:t=>p(t.target.value),className:"w-full bg-white border border-gray-200 rounded-lg p-2.5 text-xs focus:ring-2 focus:ring-indigo-500 text-gray-700 font-medium",children:n.map(t=>e.jsx("option",{value:t.id,children:t.title},t.id))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600 flex items-center gap-1",children:[e.jsx(R,{size:12})," ",s.dateSelect]}),e.jsx("input",{type:"date",value:C,onChange:t=>T(t.target.value),className:"w-full bg-white border border-gray-200 rounded-lg p-2.5 text-xs focus:ring-2 focus:ring-indigo-500 text-gray-700 font-medium",required:!0})]})]}),r==="assignment"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600 flex items-center gap-1",children:[e.jsx(Q,{size:12})," ",s.classSelect]}),x.length===0?e.jsx("p",{className:"text-xs italic text-red-500",children:s.emptyClasses}):e.jsx("select",{value:k,onChange:t=>L(t.target.value),className:"w-full bg-white border border-gray-200 rounded-lg p-2.5 text-xs focus:ring-2 focus:ring-indigo-500 text-gray-700 font-medium",children:x.map(t=>e.jsx("option",{value:t.id,children:t.name},t.id))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600 flex items-center gap-1",children:[e.jsx(ee,{size:12})," ",s.assignmentTopic]}),e.jsx("input",{type:"text",value:D,onChange:t=>F(t.target.value),placeholder:s.assignmentTopicPlaceholder,className:"w-full bg-white border border-gray-200 rounded-lg p-2.5 text-xs focus:ring-2 focus:ring-indigo-500 text-gray-700 font-medium",required:!0})]})]}),r==="lesson"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600 flex items-center gap-1",children:[e.jsx(se,{size:12})," ",s.lessonTitle]}),e.jsx("input",{type:"text",value:P,onChange:t=>M(t.target.value),placeholder:s.lessonTitlePlaceholder,className:"w-full bg-white border border-gray-200 rounded-lg p-2.5 text-xs focus:ring-2 focus:ring-indigo-500 text-gray-700 font-medium",required:!0})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600 flex items-center gap-1",children:[e.jsx(E,{size:12})," ",s.lessonContent]}),e.jsx("textarea",{value:S,onChange:t=>I(t.target.value),rows:5,className:"w-full bg-white border border-gray-200 rounded-lg p-2.5 text-xs focus:ring-2 focus:ring-indigo-500 font-mono text-gray-700",required:!0})]})]}),e.jsx("button",{type:"submit",disabled:_||r==="schedule"&&(x.length===0||n.length===0)||r==="assignment"&&x.length===0,className:"w-full bg-indigo-600 hover:bg-indigo-700 text-white font-bold text-xs py-2.5 px-4 rounded-xl flex items-center justify-center gap-2 cursor-pointer transition-all shadow-md active:scale-98 disabled:opacity-50",children:_?e.jsxs(e.Fragment,{children:[e.jsx(te,{size:14,className:"animate-spin"}),e.jsx("span",{children:s.loadingBus})]}):e.jsxs(e.Fragment,{children:[e.jsx(le,{size:13}),e.jsx("span",{children:s.confirm})]})})]})]})]})]})}),e.jsxs("button",{onClick:()=>{v(!m),h("menu")},className:"w-14 h-14 bg-indigo-600 hover:bg-indigo-700 text-white rounded-full flex items-center justify-center shadow-lg hover:shadow-indigo-200 hover:shadow-2xl transition-all duration-250 cursor-pointer active:scale-95 focus:outline-none relative group",title:"Trigger Education OS Quick Scheduler Command Panel",id:"quick-actions-fab-button",children:[e.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-purple-400 opacity-20 group-hover:animate-ping"}),e.jsx(O.div,{animate:{rotate:m?135:0},transition:{duration:.2},className:"flex items-center justify-center text-white",children:e.jsx(ae,{size:24,strokeWidth:2.8})})]})]})}function be(x){const{lang:n,t:g,lessons:z,classes:A,students:q,todaySchedules:m,approvals:v,processes:r,isApprovalsCollapsed:h,setIsApprovalsCollapsed:y,isProcessesCollapsed:N,setIsProcessesCollapsed:w,scoreOverrides:p,setScoreOverrides:C,handleApprove:T,handleReject:k,showLogs:L,setShowLogs:D,processLogsContent:F,showProcessLogs:P,fetchProcessLogs:M,setShowProcessLogs:S,addToast:I,handleQuickScheduleClass:_,handleQuickGenerateAssignment:f,handleQuickCreateLesson:$}=x;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex-1 flex flex-col gap-6 h-full overflow-y-auto pr-2",children:[(()=>{const l=a=>{if(a.status==="cancelled"||a.status==="holiday")return!1;if(!a.time_slot)return!0;try{const d=a.time_slot.split("-");if(d.length<2)return!0;const b=d[1].trim(),[j,t]=b.split(":").map(Number),u=new Date,B=u.getHours(),W=u.getMinutes();return!(B>j||B===j&&W>=t)}catch{return!0}},o=m.filter(l),i=m.length-o.length;m.filter(a=>a.status==="cancelled"||a.status==="holiday");const s=o[0];return e.jsxs("div",{className:"bg-white border border-slate-200/80 rounded-2xl p-5 text-slate-800 shadow-sm flex flex-col md:flex-row justify-between items-stretch gap-6 transition-all duration-300",children:[e.jsx("div",{className:"flex-1 flex flex-col justify-between bg-slate-50/50 rounded-xl p-4.5 border border-slate-200/60 min-h-[160px]",children:s?e.jsxs("div",{className:"flex-1 flex flex-col justify-between",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"bg-amber-400 text-slate-950 text-xs font-extrabold px-2.5 py-0.5 rounded-full uppercase tracking-wider animate-pulse shadow-xs",children:n==="zh"?"下一堂面授课":"NEXT CLASS"}),e.jsx("span",{className:"font-mono text-xs text-indigo-700 font-bold bg-indigo-50 px-2 py-0.5 rounded-md border border-indigo-100/30",children:s.time_slot})]}),e.jsx("h3",{className:"text-lg md:text-xl font-extrabold tracking-tight mt-3 text-slate-800 line-clamp-2",title:s.lesson_title,children:s.lesson_title}),e.jsxs("p",{className:"text-xs text-slate-500 mt-2 font-medium",children:["📍 ",s.class_name," ",s.classroom&&` | 教室: ${s.classroom}`," ",s.teacher_name&&` | 教师: ${s.teacher_name}`]})]}),s.notes&&e.jsxs("div",{className:"mt-3 text-xs italic text-indigo-700 bg-indigo-50/60 p-2 rounded-lg border border-indigo-100/40 truncate",title:s.notes,children:["* ",s.notes]})]}):e.jsxs("div",{className:"flex-1 flex flex-col justify-center items-center text-center py-6 select-none",children:[e.jsx("span",{className:"text-3xl animate-bounce",children:"☕"}),e.jsx("h3",{className:"text-base font-extrabold text-slate-850 mt-2",children:n==="zh"?"今日课程已全部结束":"All Classes Finished"}),e.jsx("p",{className:"text-xs text-slate-455 mt-1 max-w-[280px]",children:n==="zh"?"接下来暂无排定课次,您可以休息调整。":"No remaining schedules today. Take a rest!"})]})}),e.jsxs("div",{className:"w-full md:w-[300px] lg:w-[350px] flex flex-col gap-3",children:[e.jsxs("div",{className:"flex justify-between items-center border-b border-slate-200/80 pb-2",children:[e.jsxs("span",{className:"text-xs uppercase font-extrabold tracking-wider text-indigo-600 flex items-center gap-1.5",children:["📅 ",n==="zh"?"今日面授排课流":"TODAY'S SCHEDULES"]}),e.jsx("span",{className:"text-xs text-slate-500 font-medium",children:n==="zh"?`共 ${m.length} 节 | 已下课 ${i} 节`:`Total ${m.length} | Done ${i}`})]}),m.length===0?e.jsxs("div",{className:"flex-1 flex items-center justify-center text-xs font-bold text-slate-450 py-6",children:["☕ ",n==="zh"?"今日暂无排定课次":"No schedules configured."]}):e.jsx("div",{className:"space-y-2 max-h-[150px] overflow-y-auto pr-1",children:m.map(a=>{const d=s&&a.id===s.id,b=o.some(u=>u.id===a.id)&&!d,j=a.status==="cancelled"||a.status==="holiday",t=!d&&!b&&!j;return e.jsxs("div",{className:`flex items-center justify-between text-xs py-1 border-b border-slate-100 last:border-b-0 ${t?"opacity-50":j?"opacity-35 line-through":""}`,children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"font-mono text-xs text-slate-500 shrink-0",children:a.time_slot}),e.jsx("span",{className:`font-bold truncate max-w-[120px] lg:max-w-[150px] ${d?"text-indigo-650":"text-slate-700"}`,title:a.lesson_title,children:a.lesson_title}),e.jsxs("span",{className:"text-xs text-slate-455 truncate max-w-[60px] lg:max-w-[80px]",children:["(",a.class_name,")"]})]}),e.jsxs("div",{className:"shrink-0 ml-2",children:[d&&e.jsx("span",{className:"bg-amber-400 text-slate-950 font-extrabold text-xs px-1.5 py-0.5 rounded uppercase scale-90 inline-block animate-pulse shadow-xs",children:"进行"}),t&&e.jsx("span",{className:"bg-slate-100 text-slate-500 text-xs px-1.5 py-0.5 rounded font-bold",children:"已完"}),b&&e.jsx("span",{className:"bg-indigo-50 text-indigo-700 text-xs px-1.5 py-0.5 rounded font-medium border border-indigo-100/50",children:"待上"}),j&&e.jsx("span",{className:"bg-rose-50 text-rose-600 text-xs px-1.5 py-0.5 rounded font-bold border border-rose-100/50",children:"停课"})]})]},a.id)})})]})]})})(),e.jsx(X,{slot:"teacher.dashboard.widget"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-5",children:[e.jsxs("div",{className:"bg-gradient-to-br from-indigo-50/60 to-indigo-100/10 border border-indigo-100/60 rounded-2xl p-5 shadow-xs flex items-center justify-between hover:shadow-sm hover:-translate-y-0.5 transition-all duration-300",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-xs font-bold text-indigo-655 uppercase tracking-wider",children:n==="zh"?"课程数量":"Total Courses"}),e.jsx("span",{className:"text-3xl font-extrabold text-slate-800 tracking-tight leading-none mt-1",children:z.length})]}),e.jsx("div",{className:"p-3 bg-indigo-500/10 text-indigo-600 rounded-xl",children:e.jsx(E,{size:24})})]}),e.jsxs("div",{className:"bg-gradient-to-br from-pink-50/60 to-pink-100/10 border border-pink-100/60 rounded-2xl p-5 shadow-xs flex items-center justify-between hover:shadow-sm hover:-translate-y-0.5 transition-all duration-300",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-xs font-bold text-pink-600 uppercase tracking-wider",children:n==="zh"?"班级数量":"Total Classes"}),e.jsx("span",{className:"text-3xl font-extrabold text-slate-800 tracking-tight leading-none mt-1",children:A.length})]}),e.jsx("div",{className:"p-3 bg-pink-500/10 text-pink-600 rounded-xl",children:e.jsx(ne,{size:24})})]}),e.jsxs("div",{className:"bg-gradient-to-br from-emerald-50/60 to-emerald-100/10 border border-emerald-100/60 rounded-2xl p-5 shadow-xs flex items-center justify-between hover:shadow-sm hover:-translate-y-0.5 transition-all duration-300",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-xs font-bold text-emerald-650 uppercase tracking-wider",children:n==="zh"?"学生数量":"Total Students"}),e.jsx("span",{className:"text-3xl font-extrabold text-slate-800 tracking-tight leading-none mt-1",children:q.length})]}),e.jsx("div",{className:"p-3 bg-emerald-500/10 text-emerald-600 rounded-xl",children:e.jsx(Q,{size:24})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 items-start",children:[e.jsxs("div",{className:"bg-white border border-rose-100 rounded-2xl shadow-sm flex flex-col transition-all duration-300",children:[e.jsxs("div",{onClick:()=>y(!h),className:"p-4 border-b border-rose-50 flex items-center justify-between cursor-pointer select-none hover:bg-rose-50/20 rounded-t-2xl transition-colors",children:[e.jsxs("h3",{className:"font-extrabold text-sm md:text-base text-rose-700 flex items-center gap-2",children:[e.jsx(re,{size:18}),g.approvals,v.length>0&&e.jsx("span",{className:"bg-rose-100 text-rose-700 text-xs px-2 py-0.5 rounded-full font-bold ml-1",children:v.length})]}),e.jsx("div",{className:"text-rose-400 hover:text-rose-600 transition-colors",children:h?e.jsx(U,{size:18}):e.jsx(G,{size:18})})]}),!h&&e.jsx("div",{className:"flex-1 overflow-y-auto p-3 max-h-[350px]",children:v.length===0?e.jsx("div",{className:"text-center p-8 text-xs md:text-sm text-slate-400 font-medium",children:g.noApprovals}):v.map(l=>{let o={};try{o=JSON.parse(l.payload||"{}")}catch{}const i=l.command_type==="ai.apply_grade",s=p[l.id]!==void 0?p[l.id]:o.score||0;return e.jsxs("div",{className:"w-full p-4 rounded-xl text-sm bg-slate-55 border border-slate-100 mb-3 shadow-3xs flex flex-col gap-3 hover:border-rose-150 transition-colors",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-extrabold text-slate-800 mb-1",children:l.command_type==="ai.apply_grade"?"🎓 Evaluate Submission":l.command_type}),e.jsx("div",{className:"text-xs text-slate-500 font-mono mb-2 line-clamp-2 bg-white border border-slate-100 p-2 rounded-lg",title:l.payload,children:i?`Feedback: ${o.feedback}`:l.payload})]}),i&&e.jsxs("div",{className:"bg-white border border-slate-150 p-2 rounded-xl flex items-center justify-between gap-3",children:[e.jsx("label",{className:"text-xs font-bold text-slate-700",children:"Modify Score:"}),e.jsx("input",{type:"number",className:"w-20 border border-slate-200 rounded-lg px-2 py-1 text-xs focus:ring-2 focus:ring-indigo-500 outline-none transition-all",value:s,onChange:a=>C(d=>({...d,[l.id]:parseInt(a.target.value)||0}))})]}),e.jsxs("div",{className:"flex gap-2 justify-end mt-1",children:[e.jsxs("button",{onClick:()=>T(l.id,i&&p[l.id]!==void 0?{score:p[l.id]}:void 0),className:"p-1.5 px-3.5 bg-rose-600 hover:bg-rose-700 text-white rounded-lg font-bold text-xs flex items-center gap-1.5 shadow-sm transition-all animate-none",children:[e.jsx(ie,{size:14})," ",g.approve]}),e.jsxs("button",{onClick:()=>k(l.id),className:"p-1.5 px-3.5 bg-slate-100 hover:bg-slate-200 text-slate-750 rounded-lg font-bold text-xs flex items-center gap-1.5 shadow-3xs transition-all",children:[e.jsx(H,{size:14})," ",g.reject]})]})]},l.id)})})]}),e.jsxs("div",{className:"bg-white border border-slate-200/60 rounded-2xl shadow-sm flex flex-col transition-all duration-300",children:[e.jsxs("div",{onClick:()=>w(!N),className:"p-4 border-b border-slate-100 flex items-center justify-between cursor-pointer select-none hover:bg-slate-50/20 rounded-t-2xl transition-colors",children:[e.jsxs("h3",{className:"font-extrabold text-sm md:text-base text-slate-700 flex items-center gap-2",children:[e.jsx(oe,{size:18,className:"text-indigo-500"}),g.processes,r.length>0&&e.jsx("span",{className:"bg-indigo-50 text-indigo-700 text-xs px-2 py-0.5 rounded-full font-bold ml-1",children:r.length})]}),e.jsx("div",{className:"text-slate-400 hover:text-slate-650 transition-colors",children:N?e.jsx(U,{size:18}):e.jsx(G,{size:18})})]}),!N&&e.jsx("div",{className:"flex-1 overflow-y-auto p-3 max-h-[350px]",children:r.length===0?e.jsx("div",{className:"text-center p-8 text-xs md:text-sm text-slate-400 font-medium",children:g.noProcesses}):r.map(l=>e.jsxs("div",{className:"w-full p-4 rounded-xl text-sm bg-slate-50 border border-slate-100 mb-3 shadow-3xs flex flex-col gap-2.5 hover:border-indigo-150 transition-colors",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"font-extrabold text-slate-800 truncate",title:l.name,children:l.name}),e.jsx("span",{className:`text-xs uppercase px-2 py-0.5 rounded-full font-bold ${l.status==="running"?"bg-blue-100 text-blue-700":l.status==="completed"?"bg-emerald-100 text-emerald-700":l.status==="failed"?"bg-rose-100 text-rose-700":"bg-slate-200 text-slate-700"}`,children:l.status})]}),e.jsxs("div",{className:"flex justify-between items-center mt-1",children:[e.jsxs("span",{className:"text-xs text-slate-400 font-mono",children:["PID: ",l.id]}),e.jsx("button",{onClick:()=>S(l.id),className:"text-xs font-bold text-indigo-650 hover:text-indigo-850 transition-colors",children:g.processLogs})]})]},l.id))})]})]})]}),e.jsx(de,{classes:A,lessons:z,lang:n,onScheduleClass:_,onGenerateAssignment:async(l,o)=>!!await f(l,o,o),onCreateLesson:async(l,o)=>!!await $(l,o)})]})}export{be as Dashboard};
@@ -1 +0,0 @@
1
- import{r,j as e}from"./vendor-react-B0t7H3hh.js";import{f as b,X as R,J as T,ao as W,a5 as B}from"./vendor-icons-30iiuCQb.js";import"./vendor-utils-m0Urvtws.js";function A({isOpen:x,onClose:l,lang:s,onSeedSuccess:z,onJumpTab:N}){const[n,h]=r.useState(0),[v,w]=r.useState(!1),[F,y]=r.useState(null),[I,S]=r.useState(null),[k,p]=r.useState({display:"none"}),[C,m]=r.useState({display:"none"}),L=r.useRef(null),d=[{targetId:"",title:s==="zh"?"欢迎来到 OpenLearn Next V2 平台!":"Welcome to OpenLearn Next V2!",content:s==="zh"?"本平台为数字课堂提供智能白板与教学插件生态托管。下面我们将通过 4 步带您快速完成初始化并体验一堂数字互动课程。":"Welcome! This platform provides interactive whiteboards and educational plugin hosting. Let's set up your first class in 4 quick steps."},{targetId:"nav_btn_admin_directory",title:s==="zh"?"第 1 步:一键初始化示例课程":"Step 1: Initialize Example Class",content:s==="zh"?"在开始授课前,我们需要一个授课班级。请点击下方的按钮,系统将自动在数据库中为您建立示例班级、添加 5 名演示学生(小明、小红等),并自动排定一节今日的白板创意编程示范课!":"Before teaching, we need a classroom session. Click the button below to seed a demo class, add 5 sample students (Xiao Ming, Xiao Hong, etc.), and schedule today's creative programming class!",actionable:!0},{targetId:"navigation_sidebar",title:s==="zh"?"第 2 步:了解系统导航菜单":"Step 2: Tour System Navigation",content:s==="zh"?"初始化成功后,您可以在「系统导航」的「班级管理」中查看学生名册及座位表,或在「课程管理」中编辑白板教案。在「插件中心」中,您还可以安装/停用丰富的第三方小工具。":'After setup, explore the sidebar! Use "Classes & Students" to manage student profiles, "Courses" to edit whiteboards, and "Plugins" to manage tools.'},{targetId:"nav_btn_live_class",title:s==="zh"?"第 3 步:进入互动课堂开启体验":"Step 3: Launch Live Classroom",content:s==="zh"?"一切就绪!点击下方的「一键开课并进入课堂」,系统将为您自动进入示范课堂并展开互动白板。您可以在白板上下发测验、进行实时统计,学生端也将实时接收广播。":'All set! Click "Launch Classroom" to enter the live room. You can draw on the whiteboard, push quizzes, and view live stats, while student clients auto-sync.'}],E=async()=>{w(!0);try{const i=await fetch("/api/admin/seed-demo",{method:"POST"});if(i.ok){const t=await i.json();t.success&&(S({classId:t.classId,className:"人工智能与创意编程示范班"}),z({classId:t.classId,scheduleId:t.scheduleId,lessonId:t.lessonId}),setTimeout(()=>{h(2)},1500))}else{const t=await i.json().catch(()=>({error:"未知错误"}));y(s==="zh"?`初始化失败:${t.error||"请检查服务器日志"}`:`Failed: ${t.error||"Check server logs"}`)}}catch(i){console.error("Failed to seed demo data:",i),y(s==="zh"?`网络错误:${i.message||"请检查服务器是否运行"}`:`Network error: ${i.message||"Check if server is running"}`)}finally{w(!1)}},_=()=>{localStorage.setItem("edu_os_tour_completed","true"),N("live_class"),l()};if(r.useEffect(()=>{if(!x)return;const i=d[n];if(!i||!i.targetId){p({display:"none"}),m({position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1e4,width:"420px",maxWidth:"90vw"});return}const t=()=>{const j=document.getElementById(i.targetId);if(!j){p({display:"none"}),m({position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1e4,width:"420px",maxWidth:"90vw"});return}const o=j.getBoundingClientRect(),c=6;p({display:"block",position:"fixed",top:`${o.top-c}px`,left:`${o.left-c}px`,width:`${o.width+c*2}px`,height:`${o.height+c*2}px`,boxShadow:"0 0 0 9999px rgba(15, 23, 42, 0.65)",border:"2px dashed #6366f1",borderRadius:"12px",zIndex:9999,pointerEvents:"none",transition:"all 0.25s cubic-bezier(0.4, 0, 0.2, 1)"});const u=360;let f=o.left+o.width+16,g=o.top;f+u>window.innerWidth&&(f=Math.max(16,o.left-u-16)),g+240>window.innerHeight&&(g=Math.max(16,window.innerHeight-250)),m({display:"block",position:"fixed",top:`${g}px`,left:`${f}px`,width:`${u}px`,zIndex:1e4,transition:"all 0.25s cubic-bezier(0.4, 0, 0.2, 1)"})};t(),window.addEventListener("resize",t),window.addEventListener("scroll",t,!0);const $=setInterval(t,300);return()=>{window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0),clearInterval($)}},[x,n]),!x)return null;const a=d[n];return e.jsxs("div",{className:"fixed inset-0 overflow-hidden select-none",style:{zIndex:9998},children:[a&&!a.targetId&&e.jsx("div",{className:"fixed inset-0 bg-slate-900/65 backdrop-blur-2xs transition-opacity",onClick:l}),e.jsx("div",{style:k}),e.jsxs("div",{ref:L,style:C,className:"bg-white rounded-2xl border border-slate-150/60 shadow-2xl p-5 md:p-6 text-gray-900 font-sans flex flex-col justify-between",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-start mb-3",children:[e.jsxs("h3",{className:"font-extrabold text-sm md:text-base text-gray-900 flex items-center gap-1.5 leading-tight",children:[e.jsx(b,{size:16,className:"text-indigo-500 animate-pulse shrink-0"}),a.title]}),e.jsx("button",{onClick:l,className:"text-gray-400 hover:text-gray-600 rounded-lg p-0.5 transition-colors cursor-pointer",children:e.jsx(R,{size:16})})]}),e.jsx("p",{className:"text-xs md:text-sm text-gray-600 leading-relaxed font-medium mb-5 whitespace-pre-wrap",children:a.content}),a.actionable&&e.jsx("div",{className:"bg-slate-50 border border-slate-200/80 rounded-xl p-3.5 mb-5 flex flex-col items-center justify-center",children:I?e.jsxs("div",{className:"flex items-center gap-2 text-emerald-600 text-xs font-bold animate-bounce",children:[e.jsx(T,{size:12,className:"fill-emerald-600"}),s==="zh"?"示范课程与学生名册初始化成功!":"Demo classes successfully initialized!"]}):e.jsx("button",{onClick:E,disabled:v,className:"w-full flex items-center justify-center gap-1.5 py-2.5 px-4 bg-indigo-600 hover:bg-indigo-700 text-white font-bold text-xs md:text-sm rounded-lg hover:shadow-md transition-all cursor-pointer disabled:bg-indigo-400",children:v?e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsxs("svg",{className:"animate-spin h-4 w-4 text-white",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),s==="zh"?"正在创建数据库记录...":"Initializing DB records..."]}):e.jsxs(e.Fragment,{children:[e.jsx(b,{size:14,className:"animate-pulse"}),s==="zh"?"一键初始化示范数据":"Initialize Example Data"]})})})]}),e.jsxs("div",{className:"flex items-center justify-between border-t border-slate-100 pt-4 shrink-0",children:[e.jsx("div",{className:"flex items-center gap-1.5",children:d.map((i,t)=>e.jsx("div",{className:`h-1.5 rounded-full transition-all duration-300 ${t===n?"w-4 bg-indigo-600":"w-1.5 bg-slate-200"}`},t))}),e.jsxs("div",{className:"flex items-center gap-2",children:[n>0?e.jsxs("button",{onClick:()=>h(i=>i-1),className:"flex items-center gap-1 px-3 py-1.5 border border-slate-200 rounded-lg text-xs font-semibold text-slate-600 hover:bg-slate-50 transition-colors cursor-pointer",children:[e.jsx(W,{size:12}),s==="zh"?"上一步":"Back"]}):e.jsx("button",{onClick:l,className:"px-3 py-1.5 border border-slate-200 rounded-lg text-xs font-semibold text-slate-500 hover:bg-slate-50 transition-colors cursor-pointer",children:s==="zh"?"跳过向导":"Skip Tour"}),n<d.length-1?e.jsxs("button",{onClick:()=>h(i=>i+1),className:"flex items-center gap-1 px-3 py-1.5 bg-slate-900 text-white rounded-lg text-xs font-semibold hover:bg-slate-800 transition-colors cursor-pointer",children:[s==="zh"?"下一步":"Next",e.jsx(B,{size:12})]}):e.jsxs("button",{onClick:_,className:"flex items-center gap-1 px-4 py-1.5 bg-indigo-600 hover:bg-indigo-700 text-white rounded-lg text-xs font-bold shadow-sm transition-colors cursor-pointer",children:[s==="zh"?"结束引导并开课":"Launch Classroom",e.jsx(b,{size:12})]})]})]})]})]})}export{A as HelpTour};