openlearn-next 0.7.8 → 0.7.10

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 (50) hide show
  1. package/README.md +4 -2
  2. package/cli-data.mjs +1 -1
  3. package/dist/assets/{ActivityWorkspaceWidget-BXS1IamH.js → ActivityWorkspaceWidget-BU88GGUG.js} +1 -1
  4. package/dist/assets/{AdminDirectoryView-479SfYyD.js → AdminDirectoryView-Cdsk9Mdr.js} +1 -1
  5. package/dist/assets/{AssessmentCenter-CJ-pchOQ.js → AssessmentCenter-BoSWbJMt.js} +1 -1
  6. package/dist/assets/{AssignmentFilePreview-wjnrKjsp.js → AssignmentFilePreview-D_POvLmv.js} +1 -1
  7. package/dist/assets/{BatchPickerModal-JvoD-1pF.js → BatchPickerModal-DiHd_6Tg.js} +1 -1
  8. package/dist/assets/{ClassesView-CB8q2kW0.js → ClassesView-CWKqzWH0.js} +1 -1
  9. package/dist/assets/{ClassroomCountdownWidget-BqzBpAvi.js → ClassroomCountdownWidget-B5-KUVU8.js} +1 -1
  10. package/dist/assets/{CloudDriveModal-DHxOnL4m.js → CloudDriveModal-CjcvdDiw.js} +1 -1
  11. package/dist/assets/{ComputerLabView-BEDe7WiU.js → ComputerLabView-CNTcmWAh.js} +1 -1
  12. package/dist/assets/CourseManagement-ha_iSnLU.js +1 -0
  13. package/dist/assets/{CourseWizardModal-D3UPFtT_.js → CourseWizardModal-oVT9mYSG.js} +1 -1
  14. package/dist/assets/{CoursewareHubPanel-CqJqcZGs.js → CoursewareHubPanel-BuKp0mmW.js} +1 -1
  15. package/dist/assets/{Dashboard-C3BaEHIG.js → Dashboard-Vb9coh9_.js} +1 -1
  16. package/dist/assets/{ExportWeightModal-iF0pVevG.js → ExportWeightModal-BEesz6rd.js} +1 -1
  17. package/dist/assets/{HelpTour-6ChRqWnB.js → HelpTour-D3QcGDUz.js} +1 -1
  18. package/dist/assets/{HelpView-D3iYhzBz.js → HelpView--Um9DFYx.js} +1 -1
  19. package/dist/assets/ImportLessonsModal-DXGopj4j.js +1 -0
  20. package/dist/assets/{ImportModal-DAHGdI9h.js → ImportModal-h5ShIMzO.js} +1 -1
  21. package/dist/assets/{InteractiveCoursewareViewer-DX9xnk6j.js → InteractiveCoursewareViewer-DzgF9_LU.js} +1 -1
  22. package/dist/assets/{InteractiveWhiteboard-41mi9keH.js → InteractiveWhiteboard-DJqgP_tU.js} +7 -7
  23. package/dist/assets/{LazyCourseware-DKyUHXaE.js → LazyCourseware-6yb_QiYS.js} +2 -2
  24. package/dist/assets/{LazyWhiteboard-fXS2P44c.js → LazyWhiteboard-CsF9GB6J.js} +2 -2
  25. package/dist/assets/LessonEditorView-CZTZ7Q0B.js +1 -0
  26. package/dist/assets/{LiveClassroomView-m0hKdcVK.js → LiveClassroomView-D2ugupT9.js} +1 -1
  27. package/dist/assets/{NotificationDetailModal-C2tg_IoJ.js → NotificationDetailModal-mUeIQP4R.js} +1 -1
  28. package/dist/assets/{PluginView-BPRUpCjV.js → PluginView-CT3-zS2n.js} +1 -1
  29. package/dist/assets/{ProcessLogsModal-CULHzXp7.js → ProcessLogsModal-DmsOrZnV.js} +1 -1
  30. package/dist/assets/{QuizGeneratorModal-CYxngpW9.js → QuizGeneratorModal-ViKxNX5Q.js} +1 -1
  31. package/dist/assets/{StudentAssignmentEvalPanel-Dfe4IOs5.js → StudentAssignmentEvalPanel-BRxHMABY.js} +1 -1
  32. package/dist/assets/{StudentAssignmentView-IfRo3yJk.js → StudentAssignmentView-g-ewJIS3.js} +1 -1
  33. package/dist/assets/{StudentLessonView-Dw2uxBhq.js → StudentLessonView-Dbvr3Xlo.js} +1 -1
  34. package/dist/assets/{StudentView-DVYUSrVU.js → StudentView-20vfEk4v.js} +2 -2
  35. package/dist/assets/{SystemResourceLibraryModal-BhbpfIBt.js → SystemResourceLibraryModal-CDKeaKf8.js} +1 -1
  36. package/dist/assets/{TeacherView-CZjIejet.js → TeacherView-KIKuhXGF.js} +2 -2
  37. package/dist/assets/{TimetableView-CupOIfEy.js → TimetableView-7V2AwWml.js} +1 -1
  38. package/dist/assets/{index-BDFyco9S.css → index-C4cHQZyx.css} +1 -1
  39. package/dist/assets/index-XduPa2-x.js +131 -0
  40. package/dist/assets/{pluginParsers-C9W6GBVx.js → pluginParsers-BO6U1E-h.js} +1 -1
  41. package/dist/assets/{student-workspace-CsbA8Cs4.js → student-workspace-DstiW0pM.js} +1 -1
  42. package/dist/assets/{vendor-icons-DaYNfRAc.js → vendor-icons-DLOPlM4i.js} +1 -1
  43. package/dist/env-validation.cjs +14 -6
  44. package/dist/index.html +3 -3
  45. package/dist/server.cjs +1489 -867
  46. package/package.json +2 -2
  47. package/dist/assets/CourseManagement-BjxQC6sq.js +0 -1
  48. package/dist/assets/ImportLessonsModal-BOwj7ezj.js +0 -1
  49. package/dist/assets/LessonEditorView-Dx-hOKtt.js +0 -1
  50. package/dist/assets/index-BiHQqzdm.js +0 -131
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openlearn-next",
3
- "version": "0.7.8",
3
+ "version": "0.7.10",
4
4
  "private": false,
5
5
  "description": "A plugin-driven Educational OS / LMS platform with AI agent teaching assistant",
6
6
  "keywords": [
@@ -85,7 +85,7 @@
85
85
  },
86
86
  "dependencies": {
87
87
  "@google/genai": "^2.4.0",
88
- "@openlearn/plugin-sdk": "3.7.5",
88
+ "@openlearn/plugin-sdk": "3.8.0",
89
89
  "bcryptjs": "^3.0.3",
90
90
  "better-sqlite3": "^12.11.1",
91
91
  "chokidar": "^5.0.0",
@@ -1 +0,0 @@
1
- import{r as i,j as e}from"./vendor-react-DHoBZpn2.js";import{b as ee,E as y}from"./index-BiHQqzdm.js";import{B as j,ac as se,aW as te,an as _,a$ as D,X as re,a2 as ae,U as T,b$ as ne,c0 as ie,x as oe,y as le,ai as de,af as I,T as ce,c as O}from"./vendor-icons-DaYNfRAc.js";import"./vendor-utils-BxOuk3id.js";import"./vendor-pdf-DVWGghIL.js";import"./vendor-motion-BFAPOs-b.js";import"./vendor-charts-skggaP9D.js";function xe(s){if(typeof s!="string")return"";let a=s;return a=a.replace(/<(think|thinking|reasoning|analysis)(?:\s+[^>]*)?>[\s\S]*?<\/\1>/gi,""),a=a.replace(/<(think|thinking|reasoning|analysis)(?:\s+[^>]*)?>[\s\S]*$/gi,""),a=a.replace(/```(?:think|thinking|reasoning|analysis)[\s\S]*?```/gi,""),a=a.replace(/^```(?:json|markdown|md)?\s*/i,"").replace(/```\s*$/i,""),a.trim()}function me(s,a=160){if(!s||typeof s!="string")return"";let r=xe(s);return r?(r=r.replace(/```[\s\S]*?```/g," "),r=r.replace(/!\[.*?\]\(.*?\)/g,""),r=r.replace(/\[(.*?)\]\(.*?\)/g,"$1"),r=r.replace(/^#+\s+/gm,""),r=r.replace(/^\s*[-*+]\s+/gm,""),r=r.replace(/^\s*\d+\.\s+/gm,""),r=r.replace(/^\s*>\s+/gm,""),r=r.replace(/\*\*([^*]+)\*\*/g,"$1"),r=r.replace(/\*([^*]+)\*/g,"$1"),r=r.replace(/__([^_]+)__/g,"$1"),r=r.replace(/_([^_]+)_/g,"$1"),r=r.replace(/~~(.*?)~~/g,"$1"),r=r.replace(/`([^`]+)`/g,"$1"),r=r.replace(/\s+/g," ").trim(),r.length<=a?r:r.slice(0,a).trimEnd()+"..."):""}function ve(){const{lang:s,session:a,lessons:r,lessonsSearchQuery:g,setLessonsSearchQuery:h,lessonsSortOrder:E,setLessonsSortOrder:A,filteredAndSortedLessons:u,isImportLessonsOpen:ge,setIsImportLessonsOpen:P,isCourseWizardOpen:he,setIsCourseWizardOpen:F,onViewCourse:N,onDeleteCourse:M,onCopyCourse:R,filterEnrollment:v,setFilterEnrollment:W,filterHasContent:C,setFilterHasContent:U,filterThisMonth:w,setFilterThisMonth:B,copyingLessonId:H,fetchLessons:Q,downloadCourseTemplate:V}=ee(),X=()=>P(!0),z=()=>F(!0),n=a,Z=n?.username==="admin"||n?.userId==="usr_admin"||n?.role==="administrator"||n?.subRole==="administrator",[p,J]=i.useState(!1),[o,b]=i.useState(null),[l,d]=i.useState(null),[k,S]=i.useState(!1),[q,$]=i.useState(!1),[x,L]=i.useState(null),G=t=>{navigator.clipboard.writeText(t).then(()=>{L(t),setTimeout(()=>L(null),1500)})},K=async t=>{b(t),d(null),$(!0);try{const m=await fetch(`/api/lessons/${t.id}/stats`);if(m.ok){const c=await m.json();d(c)}}catch{d({whiteboardCount:0,scheduleCount:0,enrollmentCount:0,assignmentCount:0})}finally{$(!1)}},Y=async()=>{if(o){S(!0);try{await M(o.id),b(null),d(null)}finally{S(!1)}}};return e.jsxs("div",{className:"flex-1 flex flex-col gap-6 h-full overflow-y-auto",children:[e.jsxs("div",{className:"flex-1 bg-white border border-gray-200 rounded-xl shadow-sm flex flex-col min-h-0",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 flex items-center justify-between shrink-0",children:[e.jsxs("h3",{className:"font-medium text-gray-700 flex items-center gap-2",children:[e.jsx(j,{size:16,className:"text-gray-400"}),s==="zh"?"课程与教学环节管理 (SQLite)":"Courses & Lessons Management"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{id:"import-lessons-csv-btn",onClick:X,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs bg-indigo-50 hover:bg-indigo-100 text-indigo-700 border border-indigo-200 font-semibold rounded-lg shadow-3xs transition-all hover:shadow-xs hover:-translate-y-0.5 cursor-pointer",children:[e.jsx(se,{size:14}),s==="zh"?"批量导入课程":"Import Lessons"]}),e.jsxs("button",{id:"download-course-template-btn",onClick:()=>void V(),title:s==="zh"?"下载自包含的课程模板(教学环节 + 全部预设组件 + PDF/PPTX 课件附件)":"Download a self-contained course template (segments + every preset component + PDF/PPTX assets)",className:"flex items-center gap-1.5 px-3 py-1.5 text-xs bg-emerald-50 hover:bg-emerald-100 text-emerald-700 border border-emerald-200 font-semibold rounded-lg shadow-3xs transition-all hover:shadow-xs hover:-translate-y-0.5 cursor-pointer",children:[e.jsx(te,{size:14}),s==="zh"?"下载课程模板":"Course Template"]}),e.jsxs("button",{id:"add-course-wizard-btn",onClick:z,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs bg-indigo-600 hover:bg-indigo-700 text-white font-semibold rounded-lg shadow-sm transition-all hover:shadow-md hover:-translate-y-0.5 cursor-pointer",children:[e.jsx(_,{size:14}),s==="zh"?"手动添加课程 (向导)":"Add Course Wizard"]}),e.jsx(y,{slot:"course.list.toolbar.action",slotProps:{lang:s,onRefresh:Q}})]})]}),r.length>0&&e.jsxs("div",{className:"px-5 py-3.5 border-b border-gray-100 bg-gray-50/50 flex flex-col sm:flex-row items-center justify-between gap-3 shrink-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3 w-full sm:w-auto",children:[e.jsxs("div",{className:"relative w-full sm:w-64",children:[e.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-gray-400",children:e.jsx(D,{size:14})}),e.jsx("input",{type:"text",placeholder:"Search courses by title...",value:g,onChange:t=>h(t.target.value),className:"w-full pl-9 pr-8 py-1.5 text-xs bg-white border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500 text-gray-800 shadow-sm"}),g&&e.jsx("button",{onClick:()=>h(""),className:"absolute inset-y-0 right-0 flex items-center pr-2.5 text-gray-400 hover:text-gray-600",children:e.jsx(re,{size:12,className:"bg-gray-100 hover:bg-gray-200 rounded-full p-0.5"})})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs font-bold text-subtle uppercase tracking-wider",children:s==="zh"?"排序方式:":"Sort by:"}),e.jsxs("select",{"aria-label":s==="zh"?"课程排序方式":"Course sort order",value:E,onChange:t=>A(t.target.value),className:"bg-white border border-gray-200 text-xs text-gray-755 font-bold px-2.5 py-1.5 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500 shadow-sm",id:"courses-sort-select",children:[e.jsx("option",{value:"recent",children:s==="zh"?"最新创建":"Most Recent"}),e.jsx("option",{value:"alphabetical",children:s==="zh"?"按名称 (A-Z)":"Alphabetical (A-Z)"}),e.jsx("option",{value:"enrollment",children:s==="zh"?"学生选课人次":"Student Enrollment Count"})]})]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("button",{onClick:()=>J(!p),className:`px-2 py-1 text-xs font-bold rounded-md border transition-all cursor-pointer ${p?"bg-indigo-600 text-white border-indigo-600 shadow-2xs":"bg-white text-gray-600 border-gray-200 hover:border-gray-300"}`,title:s==="zh"?"只看我创建的课程":"Only show courses created by me",children:[e.jsx(ae,{size:11,className:"inline mr-0.5 -mt-0.5"}),s==="zh"?"我的备课":"My Courses"]}),e.jsxs("button",{onClick:()=>W(!v),className:`px-2 py-1 text-xs font-bold rounded-md border transition-all cursor-pointer ${v?"bg-emerald-50 text-emerald-700 border-emerald-200":"bg-white text-gray-500 border-gray-200 hover:border-gray-300"}`,children:[e.jsx(T,{size:11,className:"inline mr-0.5 -mt-0.5"}),s==="zh"?"有人选":"Enrolled"]}),e.jsxs("button",{onClick:()=>U(!C),className:`px-2 py-1 text-xs font-bold rounded-md border transition-all cursor-pointer ${C?"bg-indigo-50 text-indigo-700 border-indigo-200":"bg-white text-gray-500 border-gray-200 hover:border-gray-300"}`,children:[e.jsx(j,{size:11,className:"inline mr-0.5 -mt-0.5"}),s==="zh"?"有内容":"Has Content"]}),e.jsx("button",{onClick:()=>B(!w),className:`px-2 py-1 text-xs font-bold rounded-md border transition-all cursor-pointer ${w?"bg-amber-50 text-amber-700 border-amber-200":"bg-white text-gray-500 border-gray-200 hover:border-gray-300"}`,children:s==="zh"?"本月":"This Month"})]}),e.jsxs("div",{className:"text-xs font-semibold text-gray-500",children:["Found ",e.jsx("span",{className:"text-indigo-650 font-bold",children:u.length})," of"," ",e.jsx("span",{className:"text-gray-700 font-bold",children:r.length})," course",r.length===1?"":"s"]})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:r.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-400 min-h-[300px]",children:[e.jsx(j,{size:48,className:"mb-4 opacity-30 text-indigo-500"}),e.jsx("h3",{className:"text-lg font-bold text-gray-800",children:s==="zh"?"暂无可用课程":"No Courses Available"}),e.jsx("p",{className:"mt-2 text-sm text-gray-500 text-center max-w-xs",children:s==="zh"?"系统中暂未部署任何课程。请通过下方按钮启动添加向导指南。":"There are no courses active in the system yet. Build your first curriculum!"}),e.jsxs("button",{id:"empty-add-course-btn",onClick:z,className:"mt-5 flex items-center gap-2 px-5 py-2.5 bg-indigo-600 hover:bg-indigo-700 text-white font-bold rounded-xl shadow-md transition-all cursor-pointer",children:[e.jsx(_,{size:16}),s==="zh"?"使用向导指南来创建新课程":"Create Course via Wizard"]})]}):u.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-12 text-gray-450 text-center",children:[e.jsx(D,{size:44,className:"mb-3 opacity-30 text-gray-450"}),e.jsxs("h4",{className:"font-semibold text-gray-700 text-sm",children:['No Courses Match "',g,'"']}),e.jsx("p",{className:"text-xs text-gray-500 mt-1 max-w-xs",children:"Double-check the spelling or try searching for another curriculum keyword."}),e.jsx("button",{onClick:()=>h(""),className:"mt-3 text-xs bg-indigo-50 hover:bg-indigo-100 text-indigo-700 border border-indigo-200 font-semibold px-3 py-1.5 rounded-lg transition-colors",children:"Clear Search Filter"})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4",children:u.filter(t=>p?!t.creator_id||t.creator_id===n?.userId||t.creator_id===n?.username:!0).map(t=>{const m=H===t.id,c=!t.creator_id||t.creator_id===n?.userId||t.creator_id===n?.username,f=Z||c;return e.jsxs("div",{className:`border border-gray-200 hover:border-indigo-300 rounded-xl p-4 flex flex-col bg-gray-50/50 hover:shadow-md transition-all ${m?"opacity-60 pointer-events-none":""}`,children:[e.jsxs("div",{className:"flex items-center justify-between mb-2 gap-2",children:[e.jsx("div",{className:"font-semibold text-gray-800 text-lg truncate cursor-pointer hover:text-indigo-600 transition-colors",title:t.title,onClick:()=>N(t.id),children:t.title}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx(y,{slot:"course.card.badge",slotProps:{course:t}}),t.creator_name?e.jsxs("span",{className:`text-xs font-medium px-1.5 py-0.5 rounded border flex items-center gap-0.5 ${c?"bg-indigo-50 text-indigo-700 border-indigo-200 font-semibold":"bg-slate-100 text-slate-600 border-slate-200"}`,title:s==="zh"?`创建教师: ${t.creator_name}`:`Created by: ${t.creator_name}`,children:[c?"👑 ":"👤 ",t.creator_name]}):null,e.jsxs("span",{className:"inline-flex items-center gap-1 bg-indigo-50 text-indigo-700 px-1.5 py-0.5 border border-indigo-100 rounded text-xs font-bold",children:[e.jsx(T,{size:10,className:"text-indigo-500"}),t.enrollment_count||0]})]})]}),e.jsx("div",{className:"text-sm text-gray-500 line-clamp-3 mb-4 flex-1 leading-relaxed",children:me(t.content)||e.jsx("span",{className:"italic text-gray-400",children:s==="zh"?"暂无课程大纲与简介":"No outline or summary available."})}),e.jsxs("div",{className:"flex justify-between items-center mt-auto",children:[e.jsxs("button",{onClick:()=>G(t.id),className:`flex items-center gap-1 text-xs rounded px-1.5 py-0.5 transition-all cursor-pointer ${x===t.id?"text-emerald-700 bg-emerald-50 border border-emerald-200":"text-subtle hover:text-indigo-600 hover:bg-indigo-50 border border-transparent"}`,title:x===t.id?s==="zh"?"已复制!":"Copied!":s==="zh"?"复制课程 ID":"Copy Course ID",children:[x===t.id?e.jsx(ne,{size:12}):e.jsx(ie,{size:12}),e.jsx("span",{className:"font-mono",children:x===t.id?s==="zh"?"已复制!":"Copied!":`${t.id.substring(0,8)}…`})]}),e.jsxs("div",{className:"flex items-center gap-0.5",children:[e.jsx("button",{onClick:()=>N(t.id),className:"p-1.5 text-gray-400 hover:text-indigo-600 hover:bg-indigo-50 rounded transition-colors cursor-pointer",title:f?s==="zh"?"查看与编辑":"View & Edit":s==="zh"?"查看只读 (他人课程)":"View Read-Only",children:f?e.jsx(oe,{size:15}):e.jsx(le,{size:15})}),e.jsx("button",{onClick:()=>R(t.id),className:"p-1.5 text-gray-400 hover:text-emerald-600 hover:bg-emerald-50 rounded transition-colors cursor-pointer",title:s==="zh"?"克隆为我的备课":"Clone Course",children:e.jsx(de,{size:14})}),f?e.jsx("button",{onClick:()=>K(t),className:"p-1.5 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded transition-colors cursor-pointer",title:s==="zh"?"删除课程":"Delete Course",children:e.jsx(I,{size:14})}):e.jsx("span",{className:"p-1.5 text-gray-300 cursor-not-allowed",title:s==="zh"?"仅创建教师或管理员可删除":"Only creator or admin can delete",children:e.jsx(I,{size:14})}),e.jsx(y,{slot:"course.card.action",slotProps:{course:t,lang:s}})]})]})]},t.id)})})})]}),o&&e.jsx("div",{className:"fixed inset-0 bg-black/40 backdrop-blur-[2px] flex items-center justify-center z-[9999] p-4",children:e.jsxs("div",{className:"bg-white rounded-xl shadow-2xl max-w-md w-full border border-gray-100 overflow-hidden",children:[e.jsxs("div",{className:"px-5 py-4 border-b border-gray-100 bg-red-50 flex items-center gap-2",children:[e.jsx(ce,{size:18,className:"text-red-600"}),e.jsx("h3",{className:"font-bold text-red-800 text-sm",children:s==="zh"?"确认删除课程":"Confirm Course Deletion"})]}),e.jsxs("div",{className:"p-5 space-y-3",children:[e.jsx("p",{className:"text-sm text-gray-700",children:s==="zh"?e.jsxs(e.Fragment,{children:["确定要删除课程 ",e.jsx("span",{className:"font-bold text-red-600",children:o.title})," 吗?"]}):e.jsxs(e.Fragment,{children:["Are you sure you want to delete ",e.jsx("span",{className:"font-bold text-red-600",children:o.title}),"?"]})}),e.jsx("p",{className:"text-xs text-red-600 font-medium",children:s==="zh"?"此操作不可撤销,将删除课程的所有关联数据。":"This action is irreversible and will delete all associated data."}),q?e.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500 py-2",children:[e.jsx(O,{size:14,className:"animate-spin"}),s==="zh"?"正在统计关联数据...":"Counting related data..."]}):l?e.jsxs("div",{className:"bg-gray-50 rounded-lg p-3 space-y-1.5 text-xs",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:s==="zh"?"白板元素":"Whiteboard Elements"}),e.jsx("span",{className:"font-bold text-gray-800",children:l.whiteboardCount})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:s==="zh"?"排课记录":"Schedules"}),e.jsx("span",{className:"font-bold text-gray-800",children:l.scheduleCount})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:s==="zh"?"选课学生":"Enrollments"}),e.jsx("span",{className:"font-bold text-gray-800",children:l.enrollmentCount})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:s==="zh"?"作业任务":"Assignments"}),e.jsx("span",{className:"font-bold text-gray-800",children:l.assignmentCount})]})]}):null]}),e.jsxs("div",{className:"px-5 py-3 border-t border-gray-100 bg-gray-50 flex justify-end gap-2",children:[e.jsx("button",{onClick:()=>{b(null),d(null)},className:"px-4 py-2 text-xs font-medium text-gray-600 hover:bg-gray-100 border border-gray-200 rounded-lg transition-colors cursor-pointer",children:s==="zh"?"取消":"Cancel"}),e.jsxs("button",{onClick:Y,disabled:k,className:"px-4 py-2 text-xs font-bold text-white bg-red-600 hover:bg-red-700 rounded-lg transition-colors cursor-pointer disabled:opacity-50 flex items-center gap-1.5",children:[k&&e.jsx(O,{size:12,className:"animate-spin"}),s==="zh"?"确认删除":"Confirm Delete"]})]})]})})]})}export{ve as CourseManagement};
@@ -1 +0,0 @@
1
- import{j as e}from"./vendor-react-DHoBZpn2.js";import{m as $,C as P}from"./index-BiHQqzdm.js";import{ac as b,J as D,aW as T,aX as O,c as u,h as V,ad as f}from"./vendor-icons-DaYNfRAc.js";import"./vendor-utils-BxOuk3id.js";import"./vendor-pdf-DVWGghIL.js";import"./vendor-motion-BFAPOs-b.js";import"./vendor-charts-skggaP9D.js";const j=Math.round(P/(1024*1024));function _(y){const{isImportLessonsOpen:N,setIsImportLessonsOpen:o,lang:s,importStatus:a,setIsDraggingImport:m,handleCSVFileChange:F,handleImportFileChange:h,downloadCsvTemplate:v,downloadCourseTemplate:w,packagePreview:t,handlePackageImportSubmit:p,packageDuplicate:n=null,handlePackageDuplicateDismiss:k=()=>{},isDraggingImport:C,previewImportData:l,setPreviewImportData:g,setImportStatus:d,importProgress:i,importProgressTotal:c,importErrorMsg:z,setImportErrorMsg:S,handleCSVImportSubmit:I}=y;return e.jsx(e.Fragment,{children:N&&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($.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-2xl flex flex-col overflow-hidden max-h-[90vh] 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(b,{size:20,className:"animate-pulse"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-bold text-gray-850 text-base md:text-lg",children:s==="zh"?"批量导入课程":"Bulk-Import Courses"}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:s==="zh"?"CSV 为「简易导入」(仅标题与正文);需要教学环节 + 白板组件 + 课件附件的完整课程请用课程包 JSON。":'CSV is a "quick import" (title and body only). For a complete lesson — segments, whiteboard components and assets — use a course package JSON.'})]})]}),e.jsx("button",{onClick:()=>{a!=="importing"&&o(!1)},disabled:a==="importing",className:"text-gray-400 hover:text-gray-650 font-bold p-1 rounded-lg hover:bg-gray-150 transition-all text-xl leading-none disabled:opacity-40",children:"×"})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-5",children:[a==="idle"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"p-4 bg-indigo-50/50 border border-indigo-100 rounded-xl",children:[e.jsxs("h4",{className:"text-xs font-bold text-indigo-850 uppercase tracking-wide flex items-center gap-2",children:[e.jsx("span",{children:"📌"}),s==="zh"?"简易导入(CSV)":"Quick import (CSV)",e.jsx("span",{className:"text-[10px] font-mono font-normal normal-case tracking-normal text-indigo-700 bg-indigo-100 border border-indigo-200 rounded px-1.5 py-0.5","data-testid":"csv-simple-import-badge",children:s==="zh"?"仅标题 + 正文":"title + body only"})]}),e.jsx("p",{className:"text-xs text-indigo-900 mt-1 leading-relaxed",children:s==="zh"?"CSV 文件的首行必须定义列标题(不区分大小写、无多余空格),包含以下两项必需内容:":"Your CSV file must include exactly these header columns on the first row (case-insensitive):"}),e.jsxs("ul",{className:"list-disc pl-5 mt-2 text-xs text-indigo-950 space-y-1",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"title"}),":"," ",s==="zh"?'课程名 (非空,例如 "代数几何")':'Course title (Required, e.g. "Linear Algebra")']}),e.jsxs("li",{children:[e.jsx("strong",{children:"content"}),":"," ",s==="zh"?"教学大纲 / Markdown 格式的课堂细目":"Syllabus content supporting rich markdown."]})]}),e.jsxs("div",{className:"mt-3.5 flex flex-wrap gap-2 justify-start",children:[e.jsxs("button",{onClick:v,className:"flex items-center gap-1 p-2 text-xs font-bold text-indigo-700 bg-white border border-indigo-200 rounded-lg shadow-3xs hover:bg-indigo-50 hover:-translate-y-0.5 hover:shadow-xs transition-all cursor-pointer",children:[e.jsx(D,{size:12}),s==="zh"?"获取标准 CSV 模板":"Download Template CSV"]}),e.jsxs("button",{onClick:w,"data-testid":"download-course-package-template-btn",className:"flex items-center gap-1 p-2 text-xs font-bold text-emerald-700 bg-white border border-emerald-200 rounded-lg shadow-3xs hover:bg-emerald-50 hover:-translate-y-0.5 hover:shadow-xs transition-all cursor-pointer",children:[e.jsx(T,{size:12}),s==="zh"?"下载课程模板(JSON)":"Download Course Template (JSON)"]})]}),e.jsx("p",{className:"text-[11px] text-indigo-800/80 mt-2.5 leading-relaxed",children:s==="zh"?"课程模板是一个自包含的 JSON 文件:包含教学环节、全部预设组件的白板元素,以及内嵌的 PDF / PPTX 课件附件 —— 拖回本对话框即可导入成一节完整的课。完整课程统一走这条通道,CSV 只做批量建空壳。":"The course template is a self-contained JSON file: teaching segments, whiteboard elements for every preset component, and embedded PDF/PPTX assets — drop it back here to import a complete lesson. Complete lessons go through this path; CSV only creates shells in bulk."})]}),e.jsxs("div",{onDragOver:r=>{r.preventDefault(),m(!0)},onDragLeave:()=>m(!1),onDrop:r=>{r.preventDefault(),m(!1),r.dataTransfer.files&&r.dataTransfer.files[0]&&h(r.dataTransfer.files[0])},onClick:()=>{document.getElementById("import-csv-file-picker")?.click()},className:`border-2 border-dashed rounded-2xl p-8 text-center cursor-pointer transition-all flex flex-col items-center justify-center min-h-[180px] ${C?"border-indigo-500 bg-indigo-50/70 scale-[1.01]":"border-gray-250 bg-gray-50/50 hover:bg-gray-50 hover:border-indigo-400"}`,children:[e.jsx("input",{id:"import-csv-file-picker",type:"file",accept:".csv,.json",className:"hidden",onChange:r=>{r.target.files&&r.target.files[0]&&h(r.target.files[0])}}),e.jsx("div",{className:"p-3 bg-gray-100 border border-gray-200 rounded-full text-indigo-600 mb-3 group-hover:scale-105 transition-all",children:e.jsx(b,{size:24})}),e.jsx("span",{className:"text-sm font-bold text-gray-800",children:s==="zh"?"选择 CSV / 课程包 JSON 文件,或拖放至此处":"Click to select or drag and drop a CSV / course-package JSON file here"}),e.jsx("span",{className:"text-xs text-gray-400 mt-1",children:s==="zh"?`CSV(简易导入)或课程包 JSON(完整课程),单文件最大 ${j}MB`:`CSV (quick import) or course-package JSON (full lesson), up to ${j}MB`})]})]}),a==="parsing"&&t&&e.jsxs("div",{className:"space-y-4","data-testid":"course-package-preview",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs font-bold text-emerald-600 bg-emerald-50 border border-emerald-200 px-2.5 py-1 rounded-full",children:["✓"," ",s==="zh"?`课程包解析成功:${t.segments} 个教学环节 · ${t.elements} 个白板元素`:`Course package parsed: ${t.segments} segments · ${t.elements} elements`]}),e.jsx("button",{onClick:()=>{g([]),d("idle")},className:"text-xs text-indigo-600 hover:text-indigo-800 font-semibold",children:s==="zh"?"重新上传":"Upload Different File"})]}),e.jsxs("div",{className:"p-4 bg-white border border-gray-200 rounded-xl shadow-3xs",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"p-2 bg-emerald-50 border border-emerald-100 rounded-lg text-emerald-600",children:e.jsx(O,{size:18})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h4",{className:"text-sm font-bold text-gray-800 truncate",title:t.title,children:t.title}),t.metaName&&e.jsx("p",{className:"text-[11px] text-gray-500 mt-0.5 truncate",children:t.metaName}),e.jsx("p",{className:"text-[11px] text-gray-400 mt-0.5 font-mono truncate",children:t.fileName})]})]}),e.jsxs("dl",{className:"grid grid-cols-3 gap-2 mt-3",children:[e.jsxs("div",{className:"p-2 bg-gray-50 border border-gray-150 rounded-lg",children:[e.jsx("dt",{className:"text-[10px] text-gray-500 font-semibold",children:s==="zh"?"教学环节":"Segments"}),e.jsx("dd",{className:"text-base font-bold text-gray-800",children:t.segments})]}),e.jsxs("div",{className:"p-2 bg-gray-50 border border-gray-150 rounded-lg",children:[e.jsx("dt",{className:"text-[10px] text-gray-500 font-semibold",children:s==="zh"?"白板元素":"Elements"}),e.jsx("dd",{className:"text-base font-bold text-gray-800",children:t.elements})]}),e.jsxs("div",{className:"p-2 bg-gray-50 border border-gray-150 rounded-lg",children:[e.jsx("dt",{className:"text-[10px] text-gray-500 font-semibold",children:s==="zh"?"课件附件":"Assets"}),e.jsx("dd",{className:"text-base font-bold text-gray-800",children:t.assets})]})]}),t.componentTypes.length>0&&e.jsxs("div",{className:"mt-3",children:[e.jsx("p",{className:"text-[10px] text-gray-500 font-semibold mb-1.5",children:s==="zh"?"覆盖的预设组件":"Covered components"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:t.componentTypes.map(r=>e.jsx("span",{className:"px-1.5 py-0.5 rounded bg-indigo-50 border border-indigo-100 text-[10px] font-mono text-indigo-700",children:r},r))})]})]}),e.jsxs("div",{className:"bg-amber-50 border border-amber-100 text-amber-900 text-xs rounded-xl p-3 flex gap-2.5 items-start",children:[e.jsx("span",{className:"text-base leading-none",children:"⚠️"}),e.jsx("p",{className:"leading-relaxed",children:s==="zh"?"导入将以单个事务写入:教学环节、白板元素与课件附件要么全部成功,要么全部回滚,不会留下半截课程。":"The import runs as a single transaction: segments, whiteboard elements and assets are either all written or all rolled back."})]})]}),a==="parsing"&&!t&&l.length>0&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs font-bold text-emerald-600 bg-emerald-50 border border-emerald-200 px-2.5 py-1 rounded-full",children:["✓"," ",s==="zh"?`解析成功:查找到 ${l.length} 门课程`:`Parsed Successfully: Found ${l.length} records`]}),e.jsx("button",{onClick:()=>{g([]),d("idle")},className:"text-xs text-indigo-600 hover:text-indigo-800 font-semibold",children:s==="zh"?"重新上传":"Upload Different File"})]}),e.jsx("div",{className:"border border-gray-200 rounded-xl overflow-hidden shadow-3xs max-h-[300px] overflow-y-auto",children:e.jsxs("table",{className:"w-full text-left text-xs border-collapse",children:[e.jsx("thead",{className:"bg-gray-50 text-gray-600 border-b border-gray-200 font-bold",children:e.jsxs("tr",{children:[e.jsx("th",{className:"p-3 w-1/4",children:s==="zh"?"课程名称":"Course Title"}),e.jsx("th",{className:"p-3 w-3/4",children:s==="zh"?"大纲简介片段":"Syllabus Preview"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-100 bg-white",children:l.map((r,x)=>e.jsxs("tr",{className:"hover:bg-slate-50/50",children:[e.jsx("td",{className:"p-3 font-semibold text-gray-800 align-top truncate max-w-[150px]",title:r.title,children:r.title}),e.jsx("td",{className:"p-3 text-gray-500 font-mono text-xs leading-relaxed break-words col-span-2",children:r.content.length>150?r.content.substring(0,150)+"...":r.content||e.jsx("em",{className:"text-gray-300 italic",children:"None"})})]},x))})]})}),e.jsxs("div",{className:"bg-amber-50 border border-amber-100 text-amber-900 text-xs rounded-xl p-3 flex gap-2.5 items-start",children:[e.jsx("span",{className:"text-base leading-none",children:"⚠️"}),e.jsx("p",{className:"leading-relaxed",children:s==="zh"?'请确认课程名称没有与系统已有的课程同名。确认无误后点击下方"开始导入"写入 SQLite。':"Please ensure column details are accurate. Clicking Import will instantly commit all parsed courses into the server SQLite backend."})]})]}),a==="importing"&&t&&e.jsxs("div",{className:"py-8 flex flex-col items-center justify-center space-y-4",children:[e.jsx("div",{className:"relative w-20 h-20 flex items-center justify-center",children:e.jsx(u,{size:36,className:"text-indigo-600 animate-spin"})}),e.jsxs("div",{className:"text-center",children:[e.jsx("h3",{className:"font-bold text-gray-800 text-sm",children:s==="zh"?"正在导入课程包":"Importing course package"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:s==="zh"?`正在写入 ${t.segments} 个教学环节、${t.elements} 个白板元素与 ${t.assets} 份课件附件...`:`Writing ${t.segments} segments, ${t.elements} elements and ${t.assets} assets...`})]}),e.jsx("div",{className:"w-full max-w-md bg-gray-50 rounded-xl p-3 border border-gray-150 font-mono text-xs text-gray-400",children:e.jsx("div",{children:"[API] POST /api/course-packages/import -> single transaction..."})})]}),a==="importing"&&!t&&e.jsxs("div",{className:"py-8 flex flex-col items-center justify-center space-y-4",children:[e.jsxs("div",{className:"relative w-20 h-20 flex items-center justify-center",children:[e.jsx(u,{size:36,className:"text-indigo-600 animate-spin"}),e.jsxs("span",{className:"absolute text-xs font-extrabold text-indigo-700",children:[Math.round(i/c*100),"%"]})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("h3",{className:"font-bold text-gray-800 text-sm",children:s==="zh"?"正在写入数据库":"Populating Database Records"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:s==="zh"?`正在导入第 ${i} / ${c} 项...`:`Importing item ${i} of ${c}...`})]}),e.jsx("div",{className:"w-full max-w-sm bg-gray-100 h-2 rounded-full overflow-hidden border border-gray-200",children:e.jsx("div",{className:"bg-indigo-600 h-full transition-all duration-300 rounded-full",style:{width:`${i/c*100}%`}})}),e.jsxs("div",{className:"w-full max-w-md bg-gray-50 rounded-xl p-3 border border-gray-150 font-mono text-xs text-gray-400 max-h-[140px] overflow-y-auto",children:[e.jsx("div",{children:"[API] POST /api/lessons -> one request per course (no cross-course transaction)"}),l.slice(0,i).map((r,x)=>e.jsx("div",{className:"text-indigo-600 font-bold mt-1",children:`✓ [${x+1}] "${r.title}" -> status 200 (Success)`},x))]})]}),a==="success"&&e.jsxs("div",{className:"py-8 text-center flex flex-col items-center justify-center space-y-4",children:[e.jsx("div",{className:"w-16 h-16 bg-emerald-50 rounded-full flex items-center justify-center border border-emerald-200 text-emerald-600 animate-bounce",children:e.jsx(V,{size:32})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-gray-800 text-base",children:s==="zh"?"🎉 批量导入大功告成":"🎉 Bulk-Import Complete"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1 max-w-md mx-auto",children:t?s==="zh"?`课程包已导入:${t.segments} 个教学环节、${t.elements} 个白板元素、${t.assets} 份课件附件均已写入。`:`Course package imported: ${t.segments} segments, ${t.elements} elements and ${t.assets} assets written.`:s==="zh"?`所有 ${l.length} 门学科教案数据已顺畅写入系统底层 SQLite 数据仓库,现在已可以用于备课。`:`All ${l.length} curriculum lessons records have been successfully saved into security logs and SQLite storage.`})]})]}),a==="error"&&e.jsxs("div",{className:"space-y-4",children:[n?e.jsxs("div",{className:"p-4 bg-amber-50 border border-amber-100 rounded-xl flex gap-3 items-start","data-testid":"course-package-duplicate-notice",children:[e.jsx("span",{className:"text-amber-600 font-bold text-lg leading-none",children:"⧉"}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-bold text-amber-850",children:s==="zh"?"该课程包已经导入过了":"This course package was already imported"}),e.jsx("p",{className:"text-xs text-amber-900 mt-1 leading-relaxed",children:s==="zh"?e.jsxs(e.Fragment,{children:["已存在课程「",n.lessonTitle,"」",n.hasDeclaredId?"(同一个课程包 id)":"(内容完全相同)",", 再次导入会得到两节内容相同的课程。"]}):e.jsxs(e.Fragment,{children:['A lesson named "',n.lessonTitle,'" already exists',n.hasDeclaredId?" (same course-package id)":" (identical content)",". Importing again would create two lessons with the same content."]})})]})]}):e.jsxs("div",{className:"p-4 bg-rose-50 border border-rose-100 rounded-xl flex gap-3 items-start",children:[e.jsx("span",{className:"text-rose-600 font-bold text-lg leading-none",children:"⚠️"}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-bold text-rose-850",children:s==="zh"?"数据导入或解析中断":"Import or Parsing Error"}),e.jsx("p",{className:"text-xs text-rose-900 mt-1 leading-relaxed",children:z||(s==="zh"?"未知异常或文件破损。":"An unknown exception or corrupted CSV formatting occurred.")})]})]}),e.jsx("div",{className:"flex gap-3 justify-end",children:n?e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:k,"data-testid":"course-package-duplicate-cancel",className:"px-4 py-2 text-xs font-bold text-gray-700 bg-white border border-gray-250 cursor-pointer hover:bg-gray-50 rounded-lg transition-all",children:s==="zh"?"取消":"Cancel"}),e.jsx("button",{onClick:()=>p(!0),"data-testid":"course-package-duplicate-force",className:"px-4 py-2 text-xs font-bold text-white bg-amber-600 cursor-pointer hover:bg-amber-700 rounded-lg transition-all",children:s==="zh"?"仍然导入副本":"Import as a Copy Anyway"})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>{d("idle"),S("")},className:"px-4 py-2 text-xs font-bold text-gray-700 bg-white border border-gray-250 cursor-pointer hover:bg-gray-50 rounded-lg transition-all",children:s==="zh"?"返回重试":"Go Back & Retry"}),e.jsx("button",{onClick:()=>o(!1),className:"px-4 py-2 text-xs font-bold text-white bg-indigo-600 cursor-pointer hover:bg-indigo-700 rounded-lg transition-all",children:s==="zh"?"关闭窗口":"Close"})]})})]})]}),a!=="idle"&&a!=="error"&&e.jsxs("div",{className:"p-4 md:p-5 border-t border-gray-100 flex items-center justify-between bg-slate-50 shrink-0",children:[e.jsx("button",{onClick:()=>{g([]),d("idle")},disabled:a==="importing",className:"px-4 py-2 text-xs font-bold text-gray-650 bg-white border border-gray-200 hover:bg-gray-100 rounded-lg transition-all disabled:opacity-40 cursor-pointer",children:s==="zh"?"重置重选":"Reset & Clear"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>o(!1),disabled:a==="importing",className:"px-4 py-2 text-xs font-bold text-gray-600 hover:text-gray-800 transition-all disabled:opacity-40 cursor-pointer",children:s==="zh"?"取消":"Cancel"}),a==="parsing"&&t&&e.jsxs("button",{onClick:()=>p(!1),"data-testid":"import-course-package-btn",className:"px-4 py-2 text-xs font-bold text-white bg-indigo-600 hover:bg-indigo-700 rounded-lg shadow-sm transition-all flex items-center gap-1 cursor-pointer",children:[e.jsx(f,{size:12}),s==="zh"?"导入课程包":"Import Course Package"]}),a==="parsing"&&!t&&e.jsxs("button",{onClick:I,className:"px-4 py-2 text-xs font-bold text-white bg-indigo-600 hover:bg-indigo-700 rounded-lg shadow-sm transition-all flex items-center gap-1 cursor-pointer",children:[e.jsx(f,{size:12}),s==="zh"?`开始导入 (${l.length} 类)`:`Proceed and Import (${l.length})`]}),a==="success"&&e.jsx("button",{onClick:()=>o(!1),className:"px-4 py-2 text-xs font-bold text-white bg-indigo-600 hover:bg-indigo-700 rounded-lg shadow-sm transition-all cursor-pointer",children:s==="zh"?"完成":"Done"})]})]})]})})})}export{_ as ImportLessonsModal};
@@ -1 +0,0 @@
1
- import{j as e,r as p,R as ne}from"./vendor-react-DHoBZpn2.js";import{n as Y,d as $e,p as Pe,q as Ae,v as ue,w as Re,x as Le,y as _e,z as Me,B as Se,F as Fe,G as Qe,E as G,H as ge,I as Oe,J as qe,e as Ce,K as Ze,S as Be,j as ie,L as oe,O as Ge,b as We,Q as He,R as ye}from"./index-BiHQqzdm.js";import{L as Ue}from"./LazyWhiteboard-fXS2P44c.js";import{P as Je,t as Ie,b9 as Ke,aU as ve,ba as je,bb as Ve,aa as we,an as me,x as Ye,af as pe,a$ as Xe,X as Ee,a4 as xe,V as Te,k as et,bc as tt,aR as st,h as De,aZ as rt,L as at,ae as nt,D as Ne,i as it,ab as ot,au as lt,c as ke,as as ct,T as dt,ai as ut,aQ as ht}from"./vendor-icons-DaYNfRAc.js";import{r as mt}from"./timeline-duration-BgdJCSrW.js";import"./vendor-utils-BxOuk3id.js";import"./vendor-pdf-DVWGghIL.js";import"./vendor-motion-BFAPOs-b.js";import"./vendor-charts-skggaP9D.js";function ze({config:s,lang:t,onActivate:n,disabled:u=!1,isFavorite:m=!1,onToggleFavorite:a}){const i=s.icon||Je,N=Y[s.color]||Y.indigo;return e.jsxs("div",{draggable:!u,onDragStart:f=>{if(u){f.preventDefault();return}const v={type:s.type,...s.defaultData},h=JSON.stringify(v);f.dataTransfer.effectAllowed="copy",f.dataTransfer.setData("application/json",h),f.dataTransfer.setData("text/plain",h)},onClick:()=>!u&&n(s.type),title:u?t==="zh"?"当前为只读模式":"Read-only mode":t==="zh"?"点击编辑并添加到画板,或拖拽到画板":"Click to edit & add, or drag onto the board","aria-disabled":u,className:`group relative bg-surface border border-theme rounded-xl p-2.5 shadow-sm transition-all duration-200 ${u?"opacity-60 cursor-not-allowed":"cursor-grab active:cursor-grabbing hover:shadow-md hover:-translate-y-0.5"} ${N.cardHoverBorder} ${N.cardHoverRing} ${N.cardHoverShadow} flex flex-col justify-between min-h-[92px]`,children:[e.jsxs("div",{className:"flex items-center justify-between gap-1",children:[e.jsx("div",{className:`p-2 rounded-lg ${N.iconBg} ${N.iconText} transition-transform group-hover:scale-105 shrink-0`,children:e.jsx(i,{size:16})}),a&&e.jsx("button",{type:"button",onClick:f=>{f.stopPropagation(),a(s.type,f)},className:`p-1 rounded-md transition-colors ${m?"text-amber-400 opacity-100":"text-slate-300 opacity-0 group-hover:opacity-100 hover:text-amber-400 hover:bg-surface-secondary"}`,title:m?t==="zh"?"取消收藏":"Remove favorite":t==="zh"?"收藏组件":"Add favorite",children:e.jsx(Ie,{size:13,className:m?"fill-amber-400":""})})]}),e.jsxs("div",{className:"flex flex-col min-w-0 mt-1.5",children:[e.jsx("span",{className:"font-semibold text-xs text-main truncate group-hover:text-primary-theme transition-colors",children:t==="zh"?s.labelZh:s.labelEn}),e.jsx("span",{className:"text-xs text-muted leading-tight mt-0.5 truncate",children:t==="zh"?s.descriptionZh:s.descriptionEn})]}),e.jsx("div",{className:"absolute top-1.5 right-1.5 opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none",children:e.jsx("span",{className:"text-xs font-bold text-indigo-500 bg-indigo-50 px-1 py-0.5 rounded border border-indigo-100",children:"+ Drag"})})]})}class pt{constructor(){this.items=new Map,this.providers=new Map,this.recents=[],this.favorites=new Set}registerItem(t){if(!t||!t.id)throw new Error("QuickInsertRegistry Error: QuickInsertItemDescriptor must have a valid ID.");this.items.set(t.id,t)}registerProvider(t){if(!t||!t.id)throw new Error("QuickInsertRegistry Error: QuickInsertProvider must have a valid ID.");this.providers.set(t.id,t);const n=t.getItems();for(const u of n)this.registerItem(u)}unregisterItem(t){return this.recents=this.recents.filter(n=>n!==t),this.favorites.delete(t),this.items.delete(t)}getItem(t){return this.items.get(t)}search(t="",n){const m=(t.startsWith("/")?t.slice(1):t).trim().toLowerCase(),a=Array.from(this.items.values());return Object.freeze(a.filter(i=>{if(n&&i.category!==n)return!1;if(!m)return!0;const N=i.title.toLowerCase().includes(m),f=i.description?.toLowerCase().includes(m)??!1,v=i.keywords?.some(h=>h.toLowerCase().includes(m))??!1;return N||f||v}))}async executeItem(t,n){const u=this.items.get(t);if(!u)throw new Error(`QuickInsertRegistry Error: Item '${t}' not found.`);this.recents=[t,...this.recents.filter(m=>m!==t)].slice(0,10),await u.execute(n)}getRecents(){const t=this.recents.map(n=>this.items.get(n)).filter(n=>n!==void 0);return Object.freeze(t)}getFavorites(){const t=Array.from(this.favorites).map(n=>this.items.get(n)).filter(n=>n!==void 0);return Object.freeze(t)}toggleFavorite(t){this.favorites.has(t)?this.favorites.delete(t):this.items.has(t)&&this.favorites.add(t)}listAll(){return Object.freeze(Array.from(this.items.values()))}clear(){this.items.clear(),this.providers.clear(),this.recents=[],this.favorites.clear()}}const xt=["Media","Shape","Tool","AI","Widget","Plugin"],he=new pt,ft=({isOpen:s,onClose:t,registry:n=he,initialQuery:u="/"})=>{const[m,a]=p.useState(u),[i,N]=p.useState("All"),[f,v]=p.useState(0),h=$e(o=>o.extensionPoints),b=p.useMemo(()=>{const o=i==="All"?void 0:i,w=n.search(m,o),y=(h.get("quick_insert.item")??[]).map(x=>{const S=Pe(x.slotProps),P=Ae(S.category,xt,"Plugin"),_=ue(S,"title"),M=ue(S,"commandType"),g=Re(S.payload);return{id:x.id,title:x.label||_||x.id,description:ue(S,"description"),icon:typeof x.icon=="string"?x.icon:void 0,category:P,keywords:Me(S.keywords),execute:async j=>{if(M){const C=await Le.post("/api/plugins/execute-command",{type:M,payload:g??j});C.success||_e.getState().addToast({id:`plugin-cmd-error-${Date.now()}`,type:"error",title:"插件命令执行失败",message:C.error||`命令 ${M} 未能执行`})}}}}).filter(x=>{if(o&&x.category!==o)return!1;const P=(m.startsWith("/")?m.slice(1):m).trim().toLowerCase();if(!P)return!0;const _=x.title.toLowerCase().includes(P),M=x.description?.toLowerCase().includes(P)??!1,g=x.keywords?.some(j=>j.toLowerCase().includes(P))??!1;return _||M||g});return[...w,...y]},[n,m,i,h]),k=p.useCallback(o=>{if(o.key==="ArrowDown")o.preventDefault(),v(w=>w+1<b.length?w+1:0);else if(o.key==="ArrowUp")o.preventDefault(),v(w=>w-1>=0?w-1:b.length-1);else if(o.key==="Enter"){o.preventDefault();const w=b[f];w&&(n.getItem?.(w.id)?n.executeItem(w.id):w.execute(),t())}else o.key==="Escape"&&(o.preventDefault(),t())},[b,f,n,t]);return p.useEffect(()=>{v(0)},[m,i]),s?e.jsx("div",{className:"quick-insert-backdrop fixed inset-0 bg-slate-950/40 backdrop-blur-xs z-50 flex items-center justify-center",onClick:t,"data-testid":"quick-insert-backdrop",children:e.jsxs("div",{className:"quick-insert-container w-full max-w-lg bg-slate-900 border border-slate-800 rounded-xl shadow-2xl overflow-hidden flex flex-col",onClick:o=>o.stopPropagation(),"data-testid":"quick-insert-modal",children:[e.jsxs("div",{className:"flex items-center px-4 py-3 border-b border-slate-800 bg-slate-900/90",children:[e.jsx("span",{className:"text-indigo-400 font-mono font-bold text-lg mr-2",children:"/"}),e.jsx("input",{type:"text",className:"w-full bg-transparent text-slate-100 placeholder-slate-400 outline-none text-sm font-medium",placeholder:"Type a command or filter...",value:m.startsWith("/")?m.slice(1):m,onChange:o=>a("/"+o.target.value),onKeyDown:k,autoFocus:!0,"data-testid":"quick-insert-search-input"}),e.jsx("kbd",{className:"text-xs bg-slate-800 text-slate-400 px-2 py-0.5 rounded border border-slate-700 font-mono",children:"ESC"})]}),e.jsx("div",{className:"flex items-center space-x-1 px-3 py-1.5 border-b border-slate-800 bg-slate-900/50 overflow-x-auto",children:["All","Media","Shape","Tool","AI","Widget","Plugin"].map(o=>e.jsx("button",{className:`px-2 py-0.5 text-xs rounded-md transition-colors font-medium ${i===o?"bg-indigo-600 text-white":"text-slate-400 hover:bg-slate-800 hover:text-slate-200"}`,onClick:()=>N(o),children:o},o))}),e.jsx("div",{className:"max-h-80 overflow-y-auto p-2 divide-y divide-slate-800/40",children:b.length===0?e.jsx("div",{className:"py-6 text-center text-slate-500 text-sm",children:"No insertable items match slash command."}):b.map((o,w)=>e.jsxs("div",{className:`flex items-center justify-between px-3 py-2 rounded-lg cursor-pointer transition-colors ${w===f?"bg-indigo-600/20 text-white":"text-slate-300 hover:bg-slate-800/60"}`,onClick:()=>{n.getItem?.(o.id)?n.executeItem(o.id):o.execute(),t()},"data-testid":`quick-insert-item-${o.id}`,children:[e.jsxs("div",{className:"flex items-center space-x-2.5",children:[e.jsx("span",{className:"text-xs font-semibold px-2 py-0.5 rounded bg-slate-800 text-indigo-400 border border-slate-700",children:o.category}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-slate-100",children:o.title}),o.description&&e.jsx("div",{className:"text-xs text-slate-400",children:o.description})]})]}),o.shortcut&&e.jsx("kbd",{className:"text-xs font-mono text-slate-400 bg-slate-800 px-1.5 py-0.5 rounded border border-slate-700",children:o.shortcut})]},o.id))})]})}):null},bt={present:"Media",media:"Media",interact:"Tool",tool:"Tool",ai:"AI",widget:"Widget"};function gt(s){return Se.map(t=>{const n=s.lang==="zh"?t.labelZh:t.labelEn,u=s.lang==="zh"?t.descriptionZh:t.descriptionEn;return{id:`builtin.quickInsert.${t.type}`,title:n,description:u,category:bt[t.group]??"Widget",keywords:[t.type,...s.lang==="zh"?[t.labelZh]:[t.labelEn]],execute:()=>{s.readOnly||s.onActivate(t.type)}}})}function yt(s,t){for(const n of gt(t))s.registerItem(n)}function vt({lang:s,onActivate:t,readOnly:n=!1,collapsed:u,onToggleCollapse:m,pages:a,currentPage:i=0,onSwitchPage:N,onAddPage:f,onDeletePage:v,onRenamePage:h,dragState:b,onHoverDropTarget:k}){const[o,w]=p.useState(!1),c=u!==void 0?u:o,y=()=>{const l=!c;w(l),m&&m(l)},[x,S]=p.useState(""),[P,_]=p.useState(!1),[M,g]=p.useState(""),[j,C]=p.useState(!1),[F,Q]=p.useState(null),[A,Z]=p.useState(""),[E,T]=p.useState("all"),[J,W]=p.useState(()=>{try{const l=localStorage.getItem("openlearn_palette_favs");return l?JSON.parse(l):[]}catch{return[]}}),[X,R]=p.useState(()=>{try{const l=localStorage.getItem("openlearn_palette_recent");return l?JSON.parse(l):[]}catch{return[]}}),[le,ce]=p.useState({}),H=l=>{n||(R(r=>{const d=[l,...r.filter(z=>z!==l)].slice(0,6);try{localStorage.setItem("openlearn_palette_recent",JSON.stringify(d))}catch{}return d}),t(l))},te=(l,r)=>{r.stopPropagation(),W(d=>{const I=d.includes(l)?d.filter($=>$!==l):[...d,l];try{localStorage.setItem("openlearn_palette_favs",JSON.stringify(I))}catch{}return I})},de=l=>{ce(r=>({...r,[l]:!r[l]}))},se=p.useRef(H);se.current=H,p.useEffect(()=>{yt(he,{lang:s,onActivate:l=>se.current(l),readOnly:n})},[s,n]);const V=Fe(),re=[...Se,...V],B=re.filter(l=>{if(x.trim()){const r=x.toLowerCase(),d=l.labelZh.toLowerCase().includes(r)||l.descriptionZh.toLowerCase().includes(r),z=l.labelEn.toLowerCase().includes(r)||l.descriptionEn.toLowerCase().includes(r);if(!d&&!z)return!1}return E==="favorites"?J.includes(l.type):E==="recent"?X.includes(l.type):!0}),U=ne.useRef(null),K=ne.useRef(null),O=ne.useRef(null),D=ne.useRef(null),[q,ee]=p.useState(null);return p.useEffect(()=>{if(!b){D.current&&(clearTimeout(D.current),D.current=null),O.current&&(clearTimeout(O.current),O.current=null),ee(null),k?.(null);return}const{clientX:l,clientY:r}=b;if(U.current){const d=U.current.getBoundingClientRect(),z=l>=d.left&&l<=d.right&&r>=d.top&&r<=d.bottom;z&&c?O.current||(O.current=setTimeout(()=>{w(!1),m?.(!1),O.current=null},250)):!z&&O.current&&(clearTimeout(O.current),O.current=null)}if(K.current){const d=K.current.getBoundingClientRect(),z=l>=d.left&&l<=d.right&&r>=d.top&&r<=d.bottom;if(z&&j?D.current||(D.current=setTimeout(()=>{C(!1),D.current=null},250)):!z&&D.current&&(clearTimeout(D.current),D.current=null),!j&&a&&a.length>0){let I=null;K.current.querySelectorAll("[data-page-index]").forEach(fe=>{const ae=fe.getBoundingClientRect();if(l>=ae.left&&l<=ae.right&&r>=ae.top&&r<=ae.bottom){const be=fe.getAttribute("data-page-index");be!==null&&(I=parseInt(be,10))}}),I!==null&&I!==b.initialPage?(ee(I),k?.({type:"page",pageIndex:I})):(ee(null),k?.(null))}}},[b,c,j,a,m,k]),c?e.jsxs("div",{ref:U,className:`w-14 shrink-0 border-r border-theme bg-surface-secondary/40 backdrop-blur-md p-2 flex flex-col items-center gap-3 select-none transition-all duration-300 ${b?"ring-2 ring-primary-theme/50 bg-primary-theme/10":""}`,children:[e.jsx("button",{type:"button",onClick:y,className:"w-10 h-10 rounded-xl bg-surface hover:bg-surface-secondary border border-theme text-muted hover:text-main flex items-center justify-center transition-all cursor-pointer shadow-2xs hover:scale-105",title:s==="zh"?"展开备课组件库 (Ctrl+B)":"Expand Component Palette",children:e.jsx(Ke,{size:16})}),e.jsx("div",{className:"w-8 h-px bg-border/60 my-0.5"}),a&&a.length>0&&e.jsxs("button",{type:"button",onClick:y,className:"w-10 h-10 rounded-xl bg-surface hover:bg-primary-theme/10 border border-theme text-primary-theme flex items-center justify-center transition-all cursor-pointer shadow-2xs group relative",title:`${s==="zh"?"页面大纲":"Outline"} (P${i+1}/${a.length}) - ${s==="zh"?"点击展开":"Click to expand"}`,children:[e.jsx(ve,{size:16}),e.jsx("span",{className:"absolute -top-1 -right-1 text-[9px] bg-primary-theme text-white rounded-full w-4 h-4 flex items-center justify-center font-bold",children:i+1})]}),e.jsx("div",{className:"flex flex-col gap-2 overflow-y-auto max-h-[calc(100vh-220px)] p-0.5",children:re.slice(0,8).map(l=>{const r=l.icon||je;return e.jsx("button",{type:"button",onClick:()=>H(l.type),disabled:n,"aria-disabled":n,className:`w-10 h-10 rounded-xl bg-surface border border-theme text-main flex items-center justify-center transition-all shadow-2xs group relative ${n?"opacity-50 cursor-not-allowed":"hover:bg-primary-theme/10 hover:border-primary-theme cursor-pointer"}`,title:`${s==="zh"?l.labelZh:l.labelEn} - ${s==="zh"?"点击配置":"Configure"}`,children:e.jsx(r,{size:16,className:"text-primary-theme transition-transform group-hover:scale-110"})},l.type)})})]}):e.jsxs("div",{ref:U,className:`w-[260px] shrink-0 border-r border-theme bg-surface-secondary/40 backdrop-blur-md p-3.5 overflow-y-auto flex flex-col gap-3.5 font-sans select-none text-main transition-all duration-300 ${b&&q!==null?"ring-1 ring-primary-theme/30":""}`,children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-theme/60 pb-2.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg bg-primary-theme/10 text-primary-theme flex items-center justify-center",children:e.jsx(je,{size:15})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-xs font-black text-main uppercase tracking-wider",children:s==="zh"?"备课组件画板":"Palette"}),e.jsxs("span",{className:"text-[10px] text-muted",children:[B.length," ",s==="zh"?"个可用组件":"components"]})]})]}),e.jsx("button",{type:"button",onClick:y,className:"p-1.5 rounded-lg text-muted hover:text-main hover:bg-surface border border-theme/50 transition-colors cursor-pointer",title:s==="zh"?"收起组件面板以扩大画布":"Collapse Palette",children:e.jsx(Ve,{size:14})})]}),a&&a.length>0&&e.jsxs("div",{ref:K,className:`bg-surface rounded-xl border border-theme p-2.5 flex flex-col gap-2 shadow-2xs transition-all duration-200 ${q!==null?"border-primary-theme shadow-md ring-1 ring-primary-theme/30":""}`,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("button",{type:"button",onClick:()=>C(l=>!l),className:"flex items-center gap-1.5 text-xs font-bold text-main hover:text-primary-theme transition-colors cursor-pointer",children:[e.jsx(ve,{size:14,className:"text-primary-theme"}),e.jsxs("span",{children:[s==="zh"?"页面大纲":"Outline"," (",a.length,")"]}),e.jsx(we,{size:13,className:`text-muted transition-transform duration-200 ${j?"-rotate-90":""}`})]}),!n&&f&&e.jsx("button",{type:"button",onClick:()=>f(),className:"p-1 rounded-md text-muted hover:text-primary-theme hover:bg-primary-theme/10 transition-colors cursor-pointer",title:s==="zh"?"新建白板页面":"Add page",children:e.jsx(me,{size:13})})]}),j?e.jsxs("div",{onClick:()=>C(!1),className:`flex items-center justify-between text-2xs px-2 py-1 bg-surface-secondary/70 rounded-lg text-muted hover:text-main cursor-pointer transition-colors ${b?"border border-dashed border-primary-theme/60 bg-primary-theme/10 text-primary-theme font-medium animate-pulse":""}`,children:[e.jsx("span",{className:"truncate max-w-[170px]",children:b?s==="zh"?"🎯 悬停自动展开页面大纲":"🎯 Hover to expand outline":`${s==="zh"?"当前":"Current"}: ${a[i]?.title||`P${i+1}`}`}),e.jsx("span",{className:"text-[10px] text-primary-theme font-medium",children:s==="zh"?"展开":"Expand"})]}):e.jsx("div",{className:"flex flex-col gap-1 max-h-48 overflow-y-auto pr-0.5 no-scrollbar",children:a.map((l,r)=>{const d=r===i,z=F===r,I=q===r;return e.jsxs("div",{"data-page-index":r,onClick:()=>{z||N?.(r)},className:`group flex items-center justify-between px-2.5 py-1.5 rounded-lg text-xs transition-all cursor-pointer ${I?"ring-2 ring-primary-theme ring-offset-1 border-dashed border-2 border-primary-theme bg-primary-theme/15 animate-pulse":d?"bg-primary-theme text-white font-semibold shadow-xs":"bg-surface hover:bg-surface-secondary text-main border border-theme/40"}`,children:[e.jsxs("div",{className:"flex items-center gap-1.5 truncate min-w-0 flex-1",children:[e.jsxs("span",{className:`text-[10px] px-1 py-0.2 rounded font-mono shrink-0 ${I?"bg-primary-theme text-white font-bold":d?"bg-white/20 text-white":"bg-surface-secondary text-muted"}`,children:["P",r+1]}),z?e.jsx("input",{type:"text",autoFocus:!0,value:A,onChange:$=>Z($.target.value),onKeyDown:$=>{$.key==="Enter"&&(A.trim()&&h?.(r,A.trim()),Q(null)),$.key==="Escape"&&Q(null)},onBlur:()=>{A.trim()&&h?.(r,A.trim()),Q(null)},className:"px-1.5 py-0.5 text-xs bg-surface border border-primary-theme rounded text-main outline-none w-full",onClick:$=>$.stopPropagation()}):e.jsx("span",{className:"truncate",children:l.title})]}),I&&e.jsxs("span",{className:"text-[10px] font-bold text-primary-theme animate-bounce shrink-0 flex items-center gap-1 pl-1",children:[e.jsx("span",{children:"📥"}),e.jsx("span",{children:s==="zh"?"松开移入":"Drop"})]}),!n&&!z&&e.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity ml-1 shrink-0",onClick:$=>$.stopPropagation(),children:[h&&e.jsx("button",{type:"button",onClick:()=>{Q(r),Z(l.title)},className:`p-0.5 rounded hover:bg-black/10 cursor-pointer ${d?"text-white":"text-muted hover:text-main"}`,title:"重命名",children:e.jsx(Ye,{size:11})}),a.length>1&&v&&e.jsx("button",{type:"button",onClick:()=>{window.confirm(`确定删除页面"${l.title}"吗?页面内的组件也将被清理。`)&&v(r)},className:`p-0.5 rounded hover:bg-rose-500/20 text-rose-500 cursor-pointer ${d?"text-white hover:bg-white/20":""}`,title:"删除此页",children:e.jsx(pe,{size:11})})]})]},l.id||r)})})]}),e.jsxs("div",{className:"relative",children:[e.jsx(Xe,{size:13,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted"}),e.jsx("input",{type:"text",value:x,onChange:l=>{const r=l.target.value;if(r.startsWith("/")){g(r),_(!0),S("");return}S(r)},placeholder:s==="zh"?"搜索画板组件...(输入 / 快速插入)":"Search components... (type / to quick insert)",className:"w-full pl-8 pr-7 py-1.5 bg-surface border border-theme rounded-xl text-xs text-main placeholder-muted outline-none focus:border-primary-theme focus:ring-1 focus:ring-primary-theme transition-all shadow-2xs"}),x&&e.jsx("button",{onClick:()=>S(""),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted hover:text-main cursor-pointer",children:e.jsx(Ee,{size:12})})]}),e.jsxs("div",{className:"flex items-center gap-1 bg-surface border border-theme p-1 rounded-xl shadow-2xs",children:[e.jsx("button",{type:"button",onClick:()=>T("all"),className:`flex-1 py-1 text-xs rounded-lg transition-all cursor-pointer ${E==="all"?"bg-surface-secondary text-main font-bold shadow-2xs":"text-muted hover:text-main font-medium"}`,children:s==="zh"?"全部":"All"}),e.jsxs("button",{type:"button",onClick:()=>T("favorites"),className:`flex-1 py-1 text-xs rounded-lg transition-all flex items-center justify-center gap-1 cursor-pointer ${E==="favorites"?"bg-amber-500/10 text-amber-600 font-bold border border-amber-500/20 shadow-2xs":"text-muted hover:text-amber-500 font-medium"}`,children:[e.jsx(Ie,{size:11,className:E==="favorites"?"fill-amber-500":""}),e.jsx("span",{children:s==="zh"?"常用":"Favs"})]}),e.jsxs("button",{type:"button",onClick:()=>T("recent"),className:`flex-1 py-1 text-xs rounded-lg transition-all flex items-center justify-center gap-1 cursor-pointer ${E==="recent"?"bg-primary-theme/10 text-primary-theme font-bold border border-primary-theme/20 shadow-2xs":"text-muted hover:text-primary-theme font-medium"}`,children:[e.jsx(xe,{size:11}),e.jsx("span",{children:s==="zh"?"最近":"Recent"})]})]}),e.jsxs("div",{className:"flex-1 flex flex-col gap-3 overflow-y-auto pr-0.5",children:[B.length===0?e.jsxs("div",{className:"text-center py-8 text-muted text-xs",children:[e.jsx(Te,{size:24,className:"mx-auto mb-2 opacity-30 text-primary-theme"}),e.jsx("p",{className:"font-bold text-main",children:s==="zh"?"未找到相关组件":"No components found"}),e.jsx("p",{className:"text-[11px] mt-1 text-muted",children:E!=="all"?s==="zh"?"尝试切换回「全部」标签":"Try switching to All tab":s==="zh"?"请更换关键词重新搜索":"Try a different keyword"})]}):E!=="all"||x.trim()?e.jsx("div",{className:"grid grid-cols-2 gap-2",children:B.map(l=>e.jsx(ze,{config:l,lang:s,onActivate:H,disabled:n,isFavorite:J.includes(l.type),onToggleFavorite:te},l.type))}):(()=>{const l=[...Qe];return B.forEach(r=>{l.some(d=>d.id===r.group)||l.push({id:r.group,labelZh:r.group,labelEn:r.group})}),l.map(r=>{const d=B.filter($=>$.group===r.id);if(d.length===0)return null;const z=Y[d[0].color]||Y.indigo,I=le[r.id];return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("button",{type:"button",onClick:()=>de(r.id),className:"flex items-center justify-between px-1.5 py-1 text-left rounded-lg transition-colors cursor-pointer hover:bg-surface-secondary/60",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${z.groupAccent}`}),e.jsx("span",{className:`text-[11px] font-black uppercase tracking-wider ${z.groupText}`,children:s==="zh"?r.labelZh:r.labelEn})]}),e.jsxs("div",{className:"flex items-center gap-1 text-muted",children:[e.jsxs("span",{className:"text-[10px] font-mono opacity-80",children:["(",d.length,")"]}),I?e.jsx(et,{size:12}):e.jsx(we,{size:12})]})]}),!I&&e.jsx("div",{className:"grid grid-cols-2 gap-2",children:d.map($=>e.jsx(ze,{config:$,lang:s,onActivate:H,disabled:n,isFavorite:J.includes($.type),onToggleFavorite:te},$.type))})]},r.id)})})(),e.jsx(G,{slot:"editor.palette_item",slotProps:{lang:s,onActivate:H,readOnly:n}})]}),e.jsx(ft,{isOpen:P,onClose:()=>{_(!1),g("")},registry:he,initialQuery:M})]})}function jt({lang:s,segments:t,activeSegmentId:n,setActiveSegmentId:u,draggedSegmentIdx:m,setDraggedSegmentIdx:a,selectedLesson:i,saveTimeline:N,readOnly:f=!1,editorPanelsExpanded:v,setEditorPanelsExpanded:h,dragState:b,onHoverDropTarget:k}){const o=t.findIndex(g=>g.id===n),w=t.length>1&&o>=0?o/(t.length-1):0,c=o>=0?ge(t[o].color):null,y=p.useRef(null),[x,S]=p.useState(null);p.useEffect(()=>{if(!b){S(null),k?.(null);return}const{clientX:g,clientY:j}=b;if(y.current&&t&&t.length>0){let C=null;y.current.querySelectorAll("[data-segment-id]").forEach(Q=>{const A=Q.getBoundingClientRect();if(g>=A.left&&g<=A.right&&j>=A.top&&j<=A.bottom){const Z=Q.getAttribute("data-segment-id");Z&&(C=Z)}}),C!==null&&C!==b.initialSegmentId?(S(C),k?.({type:"segment",segmentId:C})):(S(null),k?.(null))}},[b,t,k]);const P=t.reduce((g,j)=>{const{seconds:C}=mt(j,{fallbackSeconds:600});return C==null||!Number.isFinite(C)?g:g+Math.round(C/60)},0),_=g=>{if(f)return;if(m===null||m===g){a(null);return}const j=[...t],[C]=j.splice(m,1);j.splice(g,0,C),a(null),i&&N(i,j)},M=()=>{if(f||!i)return;const g="seg-"+Math.random().toString(36).slice(2,9),j={id:g,title:s==="zh"?`新环节 ${t.length+1}`:`Segment ${t.length+1}`,notes:"",type:"lecture",duration:"10m",color:qe};N(i,[...t,j]),u(g),h(!0)};return e.jsxs("div",{ref:y,className:`sticky top-0 z-30 flex items-center justify-between gap-3 px-3.5 py-2 border-b border-theme bg-surface/95 backdrop-blur-md shrink-0 select-none overflow-x-auto text-main shadow-2xs transition-all ${b?"ring-1 ring-primary-theme/30":""}`,children:[e.jsxs("div",{className:"flex items-center gap-2 shrink-0 border-r border-theme pr-3",children:[e.jsx("div",{className:"w-6 h-6 rounded-lg bg-primary-theme/10 text-primary-theme flex items-center justify-center",children:e.jsx(tt,{size:14})}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-xs font-black uppercase tracking-wider text-main whitespace-nowrap",children:s==="zh"?"教学流程":"Lesson Flow"}),e.jsxs("span",{className:"text-[10px] font-mono text-muted flex items-center gap-0.5",children:[e.jsx(xe,{size:9}),e.jsxs("span",{children:[P," min"]})]})]})]}),e.jsxs("div",{className:"relative flex items-center gap-2 py-0.5 min-w-0 flex-1",children:[e.jsx("div",{className:"absolute left-3 right-3 top-1/2 h-0.5 -translate-y-1/2 bg-border/80 rounded-full"}),o>=0&&e.jsx("div",{className:`absolute left-3 top-1/2 h-0.5 -translate-y-1/2 rounded-full transition-all duration-300 ${c?.rail||"bg-primary-theme"}`,style:{width:`calc(${w*100}% - 0.5rem)`}}),t.map((g,j)=>{const C=g.id===n,F=o>=0&&j<o,Q=m===j,A=x===g.id,Z=Oe(g.type),E=ge(g.color),T=Z.icon,J=A?"ring-2 ring-primary-theme ring-offset-2 border-dashed border-2 border-primary-theme bg-primary-theme/20 shadow-md scale-108 animate-pulse text-primary-theme font-bold":C?E.solid+" shadow-md ring-2 ring-primary-theme/30 scale-105":F?"bg-surface-secondary/90 text-main/80 border-primary-theme/30":E.color;return e.jsxs("div",{"data-segment-id":g.id,draggable:!f,onDragStart:W=>{if(f){W.preventDefault();return}a(j),W.dataTransfer.effectAllowed="move"},onDragOver:W=>!f&&W.preventDefault(),onDrop:()=>_(j),onClick:()=>u(g.id),"aria-disabled":f,className:`relative z-10 flex items-center gap-1.5 px-2.5 py-1 rounded-xl text-xs font-semibold ${f?"cursor-pointer":"cursor-grab"} transition-all duration-200 border border-theme/60 shadow-2xs group ${J} ${Q?"opacity-40 scale-95":"hover:scale-102"}`,children:[e.jsx(st,{size:11,className:"opacity-0 group-hover:opacity-60 -ml-0.5 text-muted cursor-grab"}),e.jsx("span",{className:"text-[10px] font-mono font-bold opacity-75",children:j+1}),e.jsx(T,{size:12,className:"shrink-0"}),e.jsx("span",{className:"truncate max-w-[90px]",children:g.title}),e.jsxs("span",{className:"text-[10px] font-mono opacity-60",children:["(",g.duration||"10m",")"]}),F&&e.jsx(De,{size:11,className:"text-emerald-500 shrink-0 ml-0.5"}),e.jsx(G,{slot:"editor.timeline.node_badge",slotProps:{segment:g,idx:j,isActive:C,isCompleted:F,lang:s}}),A&&e.jsxs("span",{className:"text-[10px] font-bold text-primary-theme animate-bounce flex items-center gap-0.5 ml-1",children:[e.jsx("span",{children:"📥"}),e.jsx("span",{children:s==="zh"?"移入此环节":"Move here"})]})]},g.id)}),i&&!f&&e.jsxs("button",{type:"button",onClick:M,className:"relative z-10 flex items-center gap-1 px-2 py-1 rounded-xl text-xs font-medium text-muted hover:text-primary-theme bg-surface hover:bg-surface-secondary border border-dashed border-theme hover:border-primary-theme transition-all cursor-pointer shadow-2xs",title:s==="zh"?"追加新环节":"Add new segment",children:[e.jsx(me,{size:12}),e.jsx("span",{className:"hidden sm:inline",children:s==="zh"?"加环节":"Add"})]})]}),e.jsxs("button",{type:"button",onClick:()=>h(g=>!g),"aria-expanded":v,className:`px-3 py-1 text-xs font-bold rounded-xl border transition-all flex items-center gap-1.5 cursor-pointer shrink-0 ${v?"bg-primary-theme text-white border-primary-theme shadow-md shadow-primary-theme/30 ring-2 ring-primary-theme/30 scale-102":"bg-surface hover:bg-surface-secondary text-muted hover:text-main border-theme shadow-2xs"}`,title:s==="zh"?"展开/收起环节设置面板":"Toggle Segment Settings",children:[e.jsx(rt,{size:13,className:v?"rotate-90 transition-transform text-white":""}),e.jsx("span",{children:s==="zh"?"环节参数":"Settings"}),v&&e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-white animate-ping ml-0.5"})]})]})}const wt=[{type:"quiz_completed",labelZh:"完成练习",labelEn:"Quiz completed"},{type:"quiz_accuracy",labelZh:"练习正确率",labelEn:"Quiz accuracy"},{type:"assignment_submitted",labelZh:"已提交作业",labelEn:"Assignment submitted"},{type:"dwell_seconds",labelZh:"停留时长",labelEn:"Dwell time"},{type:"checked_in",labelZh:"已签到",labelEn:"Checked in"}];function Nt(s){const t=[];for(const n of s){if(n.status!=="active")continue;let u={};try{u=JSON.parse(n.manifest)}catch{continue}const m=u.contributes?.["segment.gate_type"];if(Array.isArray(m))for(const a of m){if(!a||typeof a!="object")continue;const i=a.id,N=a.commandType;typeof i!="string"||typeof N!="string"||t.push(a)}}return t}function kt(s){return Array.isArray(s)?s.filter(t=>t&&typeof t=="object"&&typeof t.type=="string"):[]}function zt({lang:s,segment:t,readOnly:n=!1,onPatch:u}){const m=Ce(h=>h.plugins),a=Nt(m),i=kt(t.gates),N=[...wt.map(h=>({type:h.type,label:s==="zh"?h.labelZh:h.labelEn})),...a.map(h=>({type:h.id,label:(s==="zh"?h.labelZh:h.labelEn)||h.id}))],f=h=>u({gates:h}),v=(h,b)=>{const k=i.map((o,w)=>w===h?{...o,...b,params:{...o.params||{},...b.params||{}}}:o);f(k)};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-xl p-2.5 bg-indigo-500/5 border border-indigo-500/20",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("span",{className:"text-[11px] font-bold text-indigo-700 dark:text-indigo-300 flex items-center gap-1.5",children:[e.jsx(at,{size:12}),e.jsx("span",{children:s==="zh"?"进入条件":"Entry conditions"})]}),!n&&e.jsxs("button",{type:"button",onClick:()=>f([...i,{type:"quiz_completed",params:{}}]),className:"text-[11px] font-bold text-indigo-700 flex items-center gap-1 cursor-pointer",children:[e.jsx(me,{size:12}),s==="zh"?"添加条件":"Add condition"]})]}),e.jsx("p",{className:"text-[10px] text-muted leading-snug",children:s==="zh"?"课级 progress_mode 已废弃。条件写在本环节上,全部满足后学生才能看到这一环节。全班仍跟随教师的当前环节。":"Lesson-level progress_mode is deprecated. Students see this segment only after every condition below is met. The class still shares one current segment."}),i.length===0&&e.jsx("p",{className:"text-[11px] text-muted",children:s==="zh"?"未设置条件,跟随课堂即可进入。":"No conditions. Following the class is enough."}),i.map((h,b)=>e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-4 gap-2 items-end",children:[e.jsxs("label",{className:"flex flex-col gap-1 sm:col-span-2",children:[e.jsx("span",{className:"text-[10px] font-bold text-muted",children:s==="zh"?"条件类型":"Type"}),e.jsxs("select",{"aria-label":s==="zh"?"条件类型":"Condition type",value:h.type,disabled:n,onChange:k=>{const o=i.map((w,c)=>c===b?{type:k.target.value,params:{}}:w);f(o)},className:"border border-theme/80 px-2 py-1.5 rounded-xl bg-surface text-xs",children:[N.map(k=>e.jsx("option",{value:k.type,children:k.label},k.type)),!N.some(k=>k.type===h.type)&&e.jsx("option",{value:h.type,children:h.type})]})]}),e.jsx(Ct,{lang:s,gate:h,readOnly:n,onChange:k=>v(b,{params:k})}),!n&&e.jsxs("button",{type:"button",onClick:()=>f(i.filter((k,o)=>o!==b)),className:"px-2 py-1.5 text-xs text-rose-600 border border-rose-200 rounded-xl cursor-pointer flex items-center justify-center gap-1",children:[e.jsx(pe,{size:12}),s==="zh"?"移除":"Remove"]})]},`${h.type}-${b}`))]})}function St(s,t){const n=s?.[t];return typeof n=="string"||typeof n=="number"?String(n):""}function Ct({lang:s,gate:t,readOnly:n,onChange:u}){const m=t.params||{},a=(i,N,f,v=!1)=>e.jsxs("label",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-[10px] font-bold text-muted",children:N}),e.jsx("input",{value:St(m,i),disabled:n,placeholder:f,onChange:h=>{if(!v){u({[i]:h.target.value});return}const b=Number(h.target.value);u({[i]:h.target.value.trim()===""||!Number.isFinite(b)?h.target.value:b})},className:"border border-theme/80 px-2 py-1.5 rounded-xl bg-surface text-xs"})]});return t.type==="checked_in"?e.jsx("div",{}):t.type==="quiz_accuracy"?e.jsxs(e.Fragment,{children:[a("minScore",s==="zh"?"最低分":"Min score","60",!0),a("elementId",s==="zh"?"题目 ID":"Element ID","")]}):t.type==="dwell_seconds"?a("seconds",s==="zh"?"秒":"Seconds","60",!0):t.type==="assignment_submitted"?a("assignmentId",s==="zh"?"作业 ID":"Assignment ID",""):t.type==="quiz_completed"?a("elementId",s==="zh"?"题目 ID":"Element ID",""):a("segmentId",s==="zh"?"环节 ID":"Segment ID","")}function It({lang:s,segment:t,readOnly:n=!1,onPatch:u,onDelete:m}){const a=Ze();return e.jsxs("div",{className:"relative mx-3 sm:mx-4 my-3 rounded-2xl bg-surface/98 backdrop-blur-xl border-2 border-primary-theme/50 dark:border-primary-theme/60 shadow-2xl shadow-primary-theme/20 ring-4 ring-primary-theme/15 overflow-hidden shrink-0 text-main animate-in fade-in-0 zoom-in-[0.98] slide-in-from-top-3 duration-300 ease-out transition-all",children:[e.jsx("div",{className:"pointer-events-none absolute -top-12 -left-12 w-64 h-32 bg-primary-theme/15 rounded-full blur-2xl opacity-60"}),e.jsx("div",{className:"pointer-events-none absolute -bottom-12 -right-12 w-64 h-32 bg-indigo-500/10 rounded-full blur-2xl opacity-60"}),e.jsx("div",{className:"relative h-1.5 w-full bg-gradient-to-r from-primary-theme via-indigo-500 to-sky-400 shadow-sm shadow-primary-theme/30",children:e.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/40 to-transparent animate-pulse"})}),e.jsxs("div",{className:"p-3.5 sm:p-4 flex flex-col gap-3.5 relative z-1",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 pb-2.5 border-b border-primary-theme/15",children:[e.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[e.jsxs("div",{className:"relative w-8 h-8 rounded-xl bg-gradient-to-br from-primary-theme/25 to-primary-theme/10 text-primary-theme flex items-center justify-center shrink-0 border border-primary-theme/40 shadow-xs",children:[e.jsx(nt,{size:15}),e.jsxs("span",{className:"absolute -top-1 -right-1 flex h-3 w-3",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary-theme opacity-80"}),e.jsx("span",{className:"relative inline-flex rounded-full h-3 w-3 bg-primary-theme ring-2 ring-surface shadow-xs"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 truncate",children:[e.jsxs("span",{className:"text-xs sm:text-sm font-black text-main tracking-tight truncate flex items-center gap-1.5",children:[e.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-primary-theme animate-pulse"}),s==="zh"?`环节参数配置:${t.title}`:`Segment Config: ${t.title}`]}),e.jsxs("span",{className:"hidden sm:inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-[10px] font-black uppercase tracking-wider bg-primary-theme text-white shadow-xs shadow-primary-theme/30 animate-pulse",children:[e.jsx(Te,{size:10}),s==="zh"?"正在聚焦编辑":"Active Editing"]}),e.jsxs("span",{className:"text-[10px] text-muted font-mono opacity-80 bg-surface-secondary/80 px-1.5 py-0.5 rounded-md border border-theme/50",children:["ID: ",t.id]})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx(G,{slot:"editor.timeline.node_badge",slotProps:{segment:t,lang:s,isActive:!0,isCompleted:!1}}),e.jsx(G,{slot:"editor.segment.action",slotProps:{segmentId:t.id,segment:t,lang:s,readOnly:n,onPatch:u}}),n?e.jsx("span",{className:"text-2xs font-semibold text-muted px-2 py-1 rounded-lg border border-theme",children:s==="zh"?"只读":"Read-only"}):e.jsxs("button",{type:"button",onClick:m,className:"px-2.5 py-1 text-xs text-rose-600 hover:text-white bg-rose-500/10 hover:bg-rose-600 border border-rose-500/25 rounded-xl flex items-center gap-1.5 transition-all hover:scale-102 cursor-pointer shadow-2xs shrink-0",title:s==="zh"?"删除当前环节":"Delete Segment",children:[e.jsx(pe,{size:12}),e.jsx("span",{children:s==="zh"?"删除环节":"Delete"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-4 gap-2.5",children:[e.jsxs("label",{className:"flex flex-col gap-1",children:[e.jsxs("span",{className:"text-[11px] font-bold text-muted flex items-center gap-1",children:[e.jsx(Ne,{size:11,className:"text-primary-theme"}),e.jsx("span",{children:s==="zh"?"环节名称":"Title"})]}),e.jsx("input",{type:"text",value:t.title||"",onChange:i=>u({title:i.target.value}),disabled:n,className:"border border-theme/80 px-2.5 py-1.5 rounded-xl bg-surface-secondary/80 focus:bg-surface text-xs text-main font-medium outline-none focus:border-primary-theme focus:ring-2 focus:ring-primary-theme/25 transition-all shadow-2xs"})]}),e.jsxs("label",{className:"flex flex-col gap-1",children:[e.jsxs("span",{className:"text-[11px] font-bold text-muted flex items-center gap-1",children:[e.jsx(xe,{size:11,className:"text-primary-theme"}),e.jsx("span",{children:s==="zh"?"预计用时":"Duration"})]}),e.jsx("input",{type:"text",value:t.duration||"10m",onChange:i=>u({duration:i.target.value}),disabled:n,placeholder:"例如: 10m",className:"border border-theme/80 px-2.5 py-1.5 rounded-xl bg-surface-secondary/80 focus:bg-surface text-xs text-main font-mono outline-none focus:border-primary-theme focus:ring-2 focus:ring-primary-theme/25 transition-all shadow-2xs"})]}),e.jsxs("label",{className:"flex flex-col gap-1",children:[e.jsxs("span",{className:"text-[11px] font-bold text-muted flex items-center gap-1",children:[e.jsx(it,{size:11,className:"text-primary-theme"}),e.jsx("span",{children:s==="zh"?"教学形态":"Instructional Type"})]}),e.jsx("select",{value:t.type||"lecture",onChange:i=>u({type:i.target.value}),disabled:n,className:"border border-theme/80 px-2.5 py-1.5 rounded-xl bg-surface-secondary/80 focus:bg-surface text-xs text-main font-medium outline-none focus:border-primary-theme focus:ring-2 focus:ring-primary-theme/25 transition-all shadow-2xs cursor-pointer",children:a.map(i=>e.jsx("option",{value:i.id,className:"bg-surface text-main",children:s==="zh"?i.labelZh:i.labelEn},i.id))})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("span",{className:"text-[11px] font-bold text-muted flex items-center gap-1",children:[e.jsx(ot,{size:11,className:"text-primary-theme"}),e.jsx("span",{children:s==="zh"?"环节标识色":"Accent Color"})]}),e.jsx("div",{className:"flex items-center gap-1.5 pt-1",children:Be.map(i=>e.jsx("button",{type:"button",onClick:()=>u({color:i.color}),disabled:n,"aria-label":s==="zh"?`选择颜色 ${i.name}`:`Choose color ${i.name}`,className:`w-5 h-5 rounded-full border border-theme/60 transition-all hover:scale-115 cursor-pointer ${i.color.split(" ")[0]} ${t.color===i.color?"ring-2 ring-primary-theme ring-offset-2 scale-110 shadow-xs":""}`,title:i.name},i.name))})]})]}),e.jsxs("div",{className:"flex flex-col gap-1 rounded-xl p-2.5 bg-amber-500/5 dark:bg-amber-500/10 border border-amber-500/20",children:[e.jsxs("span",{className:"text-[11px] font-bold text-amber-700 dark:text-amber-400 flex items-center gap-1.5",children:[e.jsx(Ne,{size:12,className:"text-amber-500"}),e.jsx("span",{children:s==="zh"?"教师备课备忘 & 教学设计要点":"Instructional Notes"})]}),e.jsx("textarea",{rows:2,value:t.notes||"",onChange:i=>u({notes:i.target.value}),disabled:n,placeholder:s==="zh"?"写给自己的教学小抄:本环节核心提问、白板板书重点、容易卡壳的步骤…":"Teaching points, blackboard highlights, key student friction points…",className:"w-full border border-theme/70 px-3 py-1.5 rounded-xl bg-surface/90 focus:bg-surface text-xs text-main placeholder-muted outline-none focus:border-primary-theme focus:ring-2 focus:ring-primary-theme/20 transition-all resize-y shadow-2xs leading-relaxed"})]}),e.jsx(zt,{lang:s,segment:t,readOnly:n,onPatch:u}),e.jsx(G,{slot:"editor.segment.type_config",slotProps:{segmentType:t.type||"lecture",segment:t,lang:s,readOnly:n,onPatch:u}}),e.jsx(G,{slot:"editor.timeline_segment",slotProps:{segment:t,lang:s,readOnly:n,onPatch:u}})]})]})}function Et({config:s,lang:t,initialData:n,onConfirm:u,onCancel:m}){const[a,i]=p.useState(()=>({...n})),[N,f]=p.useState({}),v=s.icon,h=Y[s.color]||Y.indigo,b=Array.isArray(s.editFields)?s.editFields:[];p.useEffect(()=>{let c=!1;const y=b.filter(x=>x.kind==="select"&&x.loadOptions);if(y.length!==0)return Promise.all(y.map(async x=>{try{const S=await x.loadOptions();return[x.key,S]}catch{return[x.key,[]]}})).then(x=>{c||f(Object.fromEntries(x))}),()=>{c=!0}},[s]);const k=(c,y)=>{i(x=>({...x,[c]:y}))},o=Array.isArray(a.options)?a.options:[],w=(c,y)=>{i(x=>({...x,options:o.map((S,P)=>P===c?y:S)}))};return e.jsx("div",{className:"fixed inset-0 bg-gray-900/40 backdrop-blur-sm flex items-center justify-center p-6 z-50",children:e.jsxs("div",{className:"bg-white border text-gray-900 border-gray-200 rounded-2xl shadow-2xl w-full max-w-md flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 flex items-center justify-between bg-gray-50/80",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`p-2 rounded-xl ${h.iconBg} ${h.iconText}`,children:v?e.jsx(v,{size:18}):null}),e.jsx("h2",{className:"font-bold text-gray-800 text-base",children:t==="zh"?`编辑:${s.labelZh}`:`Edit: ${s.labelEn}`})]}),e.jsx("button",{onClick:m,className:"text-gray-400 hover:text-gray-600 font-bold p-1 hover:bg-gray-200 rounded transition-colors text-lg",children:"×"})]}),e.jsx("div",{className:"p-5 space-y-4",children:b.length===0?e.jsx("p",{className:"text-sm text-gray-500 leading-relaxed",children:t==="zh"?"该组件无需预编辑内容,确认后即可添加到画板。":"No content to edit for this component. Confirm to add it to the board."}):b.map(c=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-semibold text-gray-600",children:t==="zh"?c.labelZh:c.labelEn}),c.kind==="options"?e.jsx("div",{className:"grid grid-cols-2 gap-2",children:o.map((y,x)=>e.jsx("input",{value:y,onChange:S=>w(x,S.target.value),placeholder:`${String.fromCharCode(65+x)}`,className:"border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"},x))}):c.kind==="textarea"?e.jsx("textarea",{value:a[c.key]??"",onChange:y=>k(c.key,y.target.value),placeholder:t==="zh"?c.placeholderZh:c.placeholderEn,rows:5,className:`w-full border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 resize-y ${c.key==="code"||c.key==="markdown"?"font-mono text-[12px]":""}`}):c.kind==="select"?e.jsxs("select",{value:a[c.key]??"",onChange:y=>k(c.key,y.target.value),className:"w-full border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 bg-white",children:[e.jsx("option",{value:"",children:t==="zh"?"— 不选择 —":"— None —"}),(N[c.key]??c.options??[]).map(y=>e.jsx("option",{value:y.value,children:y.label},y.value))]}):e.jsx("input",{type:"text",value:a[c.key]??"",onChange:y=>k(c.key,y.target.value),placeholder:t==="zh"?c.placeholderZh:c.placeholderEn,className:"w-full border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"})]},c.key))}),e.jsxs("div",{className:"p-4 border-t border-gray-100 flex justify-end gap-2",children:[e.jsx("button",{onClick:m,className:"px-4 py-2 text-sm rounded-lg border border-gray-200 text-gray-600 hover:bg-gray-100 cursor-pointer",children:t==="zh"?"取消":"Cancel"}),e.jsx("button",{onClick:()=>u(a),className:"px-4 py-2 text-sm rounded-lg bg-indigo-600 text-white hover:bg-indigo-700 cursor-pointer",children:t==="zh"?"添加到画板":"Add to Board"})]})]})})}class Tt{constructor(t){this.lessonId=null,this.debounceDelay=800,this.status="none",this.lastSavedTime=null,this.pendingMap=new Map,this.timer=null,this.isFlushing=!1,this.lastError=null,this.saveHandler=null,this.interceptors=new Set,this.listeners=new Set,t?.debounceDelay!==void 0&&(this.debounceDelay=t.debounceDelay),t?.saveHandler&&(this.saveHandler=t.saveHandler)}setLessonId(t){this.lessonId!==t&&(this.pendingMap.size>0&&this.lessonId&&this.flush(),this.lessonId=t,this.status=t?"saved":"none",this.notifyListeners())}getLessonId(){return this.lessonId}setSaveHandler(t){this.saveHandler=t}setDebounceDelay(t){this.debounceDelay=Math.max(100,t)}getDebounceDelay(){return this.debounceDelay}getStatus(){return this.status}getLastSavedTime(){return this.lastSavedTime}getPendingCount(){return this.pendingMap.size}getLastError(){return this.lastError}registerInterceptor(t){return this.interceptors.add(t),()=>{this.interceptors.delete(t)}}registerListener(t){return this.listeners.add(t),t(this.status,{lessonId:this.lessonId||void 0,lastSavedTime:this.lastSavedTime,count:this.pendingMap.size}),()=>{this.listeners.delete(t)}}notifyListeners(){this.listeners.forEach(t=>{try{t(this.status,{lessonId:this.lessonId||void 0,lastSavedTime:this.lastSavedTime,error:this.lastError,count:this.pendingMap.size})}catch(n){console.error("[WhiteboardAutoSaveManager] Listener error:",n)}})}queueUpdate(t,n){if(!this.lessonId)return;const u=this.pendingMap.get(t)||{};this.pendingMap.set(t,{...u,...n}),this.status="pending",this.notifyListeners(),ie.publish({id:oe(),type:"whiteboard.autosave.pending",source:"whiteboard.autosave",payload:{lessonId:this.lessonId,elementId:t,pendingCount:this.pendingMap.size},timestamp:Date.now(),correlationId:this.lessonId}),this.timer&&clearTimeout(this.timer),this.timer=setTimeout(()=>{this.flush()},this.debounceDelay)}async flush(){if(this.timer&&(clearTimeout(this.timer),this.timer=null),this.pendingMap.size===0||!this.lessonId||!this.saveHandler)return this.status==="pending"&&(this.status="saved",this.notifyListeners()),!0;if(this.isFlushing)return!1;let t=!1;const n={lessonId:this.lessonId,pendingElements:new Map(this.pendingMap),cancel:()=>{t=!0}};for(const i of this.interceptors)try{if(await i(n)===!1||t){t=!0;break}}catch(N){console.error("[WhiteboardAutoSaveManager] Interceptor error:",N)}if(t)return!1;this.isFlushing=!0,this.status="saving",this.notifyListeners(),ie.publish({id:oe(),type:"whiteboard.autosave.saving",source:"whiteboard.autosave",payload:{lessonId:this.lessonId,pendingCount:this.pendingMap.size},timestamp:Date.now(),correlationId:this.lessonId});const u=Array.from(this.pendingMap.entries()),m=[];let a=!1;try{for(const[i,N]of u)await this.saveHandler(this.lessonId,i,N)?(m.push(i),this.pendingMap.get(i)===N&&this.pendingMap.delete(i)):a=!0;if(a)throw new Error("One or more element updates failed to save");return this.lastSavedTime=new Date,this.lastError=null,this.status=this.pendingMap.size>0?"pending":"saved",this.notifyListeners(),ie.publish({id:oe(),type:"whiteboard.autosave.saved",source:"whiteboard.autosave",payload:{lessonId:this.lessonId,savedElementIds:m,lastSavedTime:this.lastSavedTime.toISOString()},timestamp:Date.now(),correlationId:this.lessonId}),!0}catch(i){return this.lastError=i,this.status="error",this.notifyListeners(),ie.publish({id:oe(),type:"whiteboard.autosave.error",source:"whiteboard.autosave",payload:{lessonId:this.lessonId,error:i?.message||String(i)},timestamp:Date.now(),correlationId:this.lessonId}),!1}finally{this.isFlushing=!1,this.pendingMap.size>0&&!this.timer&&(this.timer=setTimeout(()=>{this.flush()},this.debounceDelay))}}cancel(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.pendingMap.clear(),this.status=this.lessonId?"saved":"none",this.lastError=null,this.notifyListeners()}}const L=new Tt;function Dt({lessonId:s,onSaveToServer:t,debounceDelay:n=800,onStatusChange:u}){const[m,a]=p.useState(()=>L.getStatus()),[i,N]=p.useState(()=>L.getLastSavedTime()),[f,v]=p.useState(()=>L.getPendingCount()),h=p.useRef(t);h.current=t;const b=p.useRef(u);b.current=u,p.useEffect(()=>{L.setLessonId(s),L.setDebounceDelay(n),L.setSaveHandler(async(c,y,x)=>h.current(c,y,x))},[s,n]),p.useEffect(()=>{const c=L.registerListener((y,x)=>{a(y),x?.lastSavedTime!==void 0&&N(x.lastSavedTime),x?.count!==void 0&&v(x.count),b.current?.(y,x?.lastSavedTime??null)});return()=>{c()}},[]),p.useEffect(()=>{const c=()=>{L.getPendingCount()>0&&L.flush()};return window.addEventListener("beforeunload",c),()=>{window.removeEventListener("beforeunload",c),L.flush()}},[]);const k=p.useCallback((c,y)=>{L.queueUpdate(c,y)},[]),o=p.useCallback(async()=>L.flush(),[]),w=p.useCallback(()=>{L.cancel()},[]);return{status:m,lastSavedTime:i,pendingCount:f,queueUpdate:k,flush:o,cancel:w,registry:L}}function Ot(){const s=Ge(),{lang:t,session:n,onCopyCourse:u,lessons:m,selectedLesson:a,activeRole:i,setActiveRole:N,editorSaveStatus:f,setEditorSaveStatus:v,editorLastSavedTime:h,setEditorLastSavedTime:b,setTeacherTab:k,handlePaletteActivate:o,timelineSegments:w,activeSegmentId:c,setActiveSegmentId:y,draggedSegmentIdx:x,setDraggedSegmentIdx:S,saveTimeline:P,editorPanelsExpanded:_,setEditorPanelsExpanded:M,fetchElements:g,whiteboardRef:j,elements:C,paletteEdit:F,handlePaletteConfirm:Q,setPaletteEdit:A}=We(),Z=Ce(r=>r.session),E=n||Z,T=m.find(r=>r.id===a),J=E?.username==="admin"||E?.userId==="usr_admin"||E?.role==="administrator"||E?.subRole==="administrator",W=!T?.creator_id||T.creator_id===E?.userId||T.creator_id===E?.username,X=J||W,R=!X||i!=="teacher",[le,ce]=p.useState(!1),[H,te]=p.useState([]),[de,se]=p.useState(0),[V,re]=p.useState(null),B=p.useRef(null),U=p.useRef(null);p.useEffect(()=>{V||(B.current=null,U.current=null)},[V]),p.useEffect(()=>{if(!s)return;const r=s.getDispatcher?.();if(!r)return;const d=r.registerHandler("host:refresh",async z=>{const I=z.action.payload.target;if(I==="lessons"||I==="all")return a&&g&&await g(a),{success:!0,refreshed:["lessons"]}});return()=>{d.dispose()}},[s,a,g]);const K=async(r,d,z)=>{try{return(await fetch(`/api/lessons/${r}/whiteboard/${d}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:z})})).ok}catch(I){return console.error("[LessonEditorView] autosave element failed:",I),!1}},{queueUpdate:O,flush:D,pendingCount:q}=Dt({lessonId:a,onSaveToServer:K,debounceDelay:800,onStatusChange:(r,d)=>{r!=="pending"&&v(r),d&&b(d)}}),ee=p.useCallback((r,d)=>{const z=B.current||U.current;return z?z.type==="page"?((async()=>(await j.current?.moveElementToPage?.(d,z.pageIndex),a&&(await D(),await g(a))))(),!0):z.type==="segment"?((async()=>(await j.current?.moveElementToSegment?.(d,z.segmentId),a&&(await D(),await g(a))))(),!0):!1:!1},[j,a,D,g]);p.useEffect(()=>{if(!a)return;const r=new He;return r.broadcastChangeLesson(a),c&&r.broadcastChangeSegment(c),()=>{r.destroy()}},[a,c]);const l=r=>{if(R){alert(X?t==="zh"?"学生视角预览为只读模式。":"Student preview is read-only.":t==="zh"?"【只读模式】您无法直接修改其他教师创建的课程。请点击上方的「一键克隆为我的备课」生成您的专属教案副本。":"[Read-Only Mode] You cannot modify lessons created by other teachers. Please clone it to your own lessons.");return}o(r)};return e.jsxs("div",{className:"flex-1 flex flex-col min-h-0 min-w-0 bg-surface rounded-2xl border border-theme overflow-hidden shadow-sm text-main transition-colors",children:[e.jsxs("div",{className:"px-4 py-2.5 border-b border-theme flex flex-wrap items-center justify-between gap-3 shrink-0 bg-surface/85 backdrop-blur-md",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("div",{className:"w-8 h-8 rounded-xl bg-primary-theme/10 text-primary-theme border border-primary-theme/20 flex items-center justify-center shrink-0",children:e.jsx(lt,{size:16})}),e.jsxs("div",{className:"flex flex-col min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[10px] font-black uppercase tracking-wider text-primary-theme",children:t==="zh"?"教案与白板编排":"Lesson Orchestrator"}),R&&e.jsx("span",{className:"text-[9px] px-1.5 py-0.2 rounded-full font-bold bg-amber-500/15 text-amber-600 border border-amber-500/30",children:t==="zh"?"只读预览":"Read-Only Preview"})]}),e.jsx("h2",{className:"text-xs sm:text-sm font-black text-main truncate tracking-tight",children:t==="zh"?`课程编辑器: ${T?.title||"未选择课程"}`:`Lesson Editor: ${T?.title||"No Lesson Selected"}`})]})]}),a&&e.jsxs("div",{className:"hidden sm:flex items-center gap-1.5 shrink-0",children:[q>0&&f!=="saving"&&e.jsxs("button",{type:"button",onClick:()=>void D(),title:t==="zh"?"有未保存改动,点击立即写入服务器":"Pending changes, click to sync now",className:"flex items-center gap-1.5 text-xs font-bold text-amber-700 dark:text-amber-300 bg-amber-500/10 hover:bg-amber-500/20 border border-amber-500/30 px-2.5 py-1 rounded-full transition-all cursor-pointer shadow-2xs hover:scale-102",children:[e.jsx(ke,{size:11,className:"animate-spin text-amber-600"}),e.jsx("span",{children:t==="zh"?`${q} 项待写入 (点击立即保存)`:`${q} pending (sync now)`})]}),f==="saving"&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-bold text-amber-700 dark:text-amber-300 bg-amber-500/10 border border-amber-500/30 px-2.5 py-1 rounded-full animate-pulse shadow-2xs",children:[e.jsx(ke,{size:11,className:"animate-spin text-amber-600"}),e.jsx("span",{children:t==="zh"?"同步 SQLite...":"Saving SQLite..."})]}),f==="saved"&&q===0&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-bold text-emerald-700 dark:text-emerald-300 bg-emerald-500/10 border border-emerald-500/30 px-2.5 py-1 rounded-full shadow-2xs",children:[e.jsx(De,{size:11,className:"text-emerald-500"}),e.jsx("span",{children:t==="zh"?"已自动保存":"Auto-Saved"}),h&&e.jsx("span",{className:"text-[11px] font-mono opacity-70",children:h.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})})]}),f==="error"&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-bold text-rose-600 bg-rose-500/10 border border-rose-500/30 px-2.5 py-1 rounded-full shadow-2xs",children:[e.jsx(Ee,{size:11,className:"text-rose-600"}),e.jsx("span",{children:t==="zh"?"写入失败":"Failed to save"})]}),f==="none"&&q===0&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-bold text-muted bg-surface-secondary border border-theme px-2.5 py-1 rounded-full shadow-2xs",children:[e.jsx(ct,{size:11,className:"text-muted"}),e.jsx("span",{children:t==="zh"?"同步就绪":"Ready"})]}),e.jsx(G,{slot:"whiteboard.autosave.status",slotProps:{lessonId:a,status:f,pendingCount:q,lastSavedTime:h}}),e.jsx(G,{slot:"whiteboard.autosave.action",slotProps:{lessonId:a,flush:D,pendingCount:q}})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("div",{className:"bg-surface-secondary border border-theme p-1 rounded-xl flex items-center gap-1 shadow-2xs",children:[e.jsxs("button",{type:"button",onClick:()=>N("teacher"),className:`px-3 py-1 text-xs font-bold rounded-lg transition-all cursor-pointer flex items-center gap-1.5 ${i==="teacher"?"bg-surface text-primary-theme font-black shadow-xs border border-theme/60 scale-102":"text-muted hover:text-main"}`,title:t==="zh"?"在当前窗口切回教师编辑视角":"Switch back to the teacher editor view",children:[e.jsx("span",{children:"👨‍🏫"}),e.jsx("span",{children:t==="zh"?"教师视角":"Teacher"})]}),e.jsxs("button",{type:"button",onClick:()=>{const r=`${window.location.origin}${window.location.pathname}?mode=student_preview&lessonId=${encodeURIComponent(a||"")}#/student_preview`;window.open(r,"_blank")||alert(t==="zh"?"新标签页被浏览器拦截,请允许本站打开弹出窗口后重试。":"The new tab was blocked. Please allow pop-ups for this site and retry.")},className:`px-3 py-1 text-xs font-bold rounded-lg transition-all cursor-pointer flex items-center gap-1.5 ${i==="student"?"bg-primary-theme text-white font-black shadow-xs scale-102":"text-muted hover:text-main"}`,title:t==="zh"?"在新标签页中以学生身份预览本课节(不影响当前备课窗口)":"Open a student-perspective preview of this lesson in a new tab",children:[e.jsx("span",{children:"🎓"}),e.jsx("span",{children:t==="zh"?"学生视角":"Student"})]})]}),e.jsx(G,{slot:"editor.header.action",slotProps:{lessonId:a,currentLesson:T,lang:t,isReadOnly:R,activeRole:i,onSave:K}}),e.jsx("button",{type:"button",onClick:()=>k("courses"),className:"px-3 py-1.5 bg-surface hover:bg-surface-secondary border border-theme text-muted hover:text-main text-xs font-bold rounded-xl transition-all cursor-pointer shadow-2xs hover:scale-102",children:t==="zh"?"返回课程库":"Back to Courses"})]})]}),!X&&T&&e.jsxs("div",{className:"bg-amber-500/10 border-b border-amber-500/20 px-4 py-2.5 flex items-center justify-between text-xs text-amber-800 dark:text-amber-300 backdrop-blur-xs shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(dt,{size:15,className:"text-amber-500 shrink-0"}),e.jsx("span",{children:t==="zh"?`【他人课程只读模式】当前课程由教师「${T.creator_name||T.creator_id}」创建。您拥有完整查看与备课参考权限。如需编辑调整,请克隆为您的专属教案。`:`[Read-Only Mode] This lesson was created by teacher "${T.creator_name||T.creator_id}". To customize, please clone it.`})]}),u&&e.jsxs("button",{onClick:()=>u(T.id),className:"flex items-center gap-1.5 bg-amber-600 hover:bg-amber-500 text-white font-semibold px-3 py-1.5 rounded-xl shadow-xs transition-all hover:scale-102 cursor-pointer shrink-0",children:[e.jsx(ut,{size:13}),e.jsx("span",{children:t==="zh"?"一键克隆为我的备课":"Clone as My Lesson"})]})]}),e.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[e.jsx(vt,{lang:t,onActivate:l,readOnly:R,collapsed:le,onToggleCollapse:ce,pages:H,currentPage:de,onSwitchPage:r=>j.current?.switchPage?.(r),onAddPage:r=>j.current?.addPage?.(r),onDeletePage:r=>j.current?.deletePage?.(r),onRenamePage:(r,d)=>j.current?.renamePage?.(r,d),dragState:V,onHoverDropTarget:r=>{B.current=r}}),e.jsxs("div",{className:"flex-1 relative bg-surface flex flex-col min-w-0",children:[e.jsx(jt,{lang:t,segments:w,activeSegmentId:c,setActiveSegmentId:y,draggedSegmentIdx:x,setDraggedSegmentIdx:S,selectedLesson:a,saveTimeline:P,readOnly:R,editorPanelsExpanded:_,setEditorPanelsExpanded:M,dragState:V,onHoverDropTarget:r=>{U.current=r}}),e.jsxs("div",{className:"flex-1 relative flex flex-col min-w-0 overflow-y-auto",children:[a&&c&&_&&w.some(r=>r.id===c)&&e.jsx(It,{lang:t,segment:w.find(r=>r.id===c),readOnly:R,onPatch:r=>P(a,w.map(d=>d.id===c?{...d,...r}:d)),onDelete:()=>{if(w.length<=1){alert("无法删除!课程必须包含至少一个环节。");return}if(window.confirm(`确定要删除环节"${w.find(r=>r.id===c)?.title}"吗?`)){const r=w.filter(d=>d.id!==c);P(a,r),y(r[0]?.id||null)}}},c),e.jsx("div",{className:"flex-1 min-h-[380px] relative flex flex-col min-w-0",children:a?e.jsxs(e.Fragment,{children:[e.jsx(Ue,{ref:j,lessonId:a,userRole:i,readOnly:R,elements:C,activeSegmentId:c,hidePageBar:!0,onPagesStateChange:({pages:r,currentPage:d})=>{te(r),se(d)},onSegmentSync:r=>y(r),onElementDragChange:re,onElementDropCheck:ee,onElementAdd:async(r,d)=>{if(!R){await D(),v("saving");try{(await fetch(`/api/lessons/${a}/whiteboard`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:r,data:d})})).ok?(v("saved"),b(new Date),g(a)):v("error")}catch{v("error")}}},onElementUpdate:(r,d)=>{R||O(r,d)},onElementDelete:async r=>{if(!R){await D(),v("saving");try{(await fetch(`/api/lessons/${a}/whiteboard/${r}`,{method:"DELETE"})).ok?(v("saved"),b(new Date),g(a)):v("error")}catch{v("error")}}},onClearBoard:async()=>{if(!R){await D(),v("saving");try{(await fetch(`/api/lessons/${a}/whiteboard`,{method:"DELETE"})).ok?(v("saved"),b(new Date),g(a)):v("error")}catch{v("error")}}},onRefresh:()=>g(a)}),F&&!R&&ye(F.type)&&e.jsx(Et,{config:ye(F.type),lang:t,initialData:F.data,onConfirm:Q,onCancel:()=>A(null)})]}):e.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-muted p-8 text-center bg-surface-secondary/50",children:e.jsxs("div",{children:[e.jsx(ht,{size:48,className:"mx-auto mb-4 opacity-30"}),e.jsx("p",{className:"font-medium text-lg text-main mb-2",children:"No active lesson selected"}),e.jsx("p",{className:"text-sm",children:"Please select a lesson from the Dashboard to orchestrate."})]})})})]})]})]})]})}export{Ot as LessonEditorView};