Spaces:
Running
Running
github-actions[bot] commited on
Commit Β·
592cfdf
1
Parent(s): 37583b1
π Auto-deploy frontend from GitHub (4de744c)
Browse filesThis view is limited to 50 files because it contains too many changes. Β See raw diff
- assets/{AIChatPage-DAxLSWfo.js β AIChatPage-DUfoPWot.js} +2 -2
- assets/{AdminDashboard-D4ep7elR.js β AdminDashboard-DdSNmQm3.js} +1 -1
- assets/{AssessmentPage-D95xz_DH.js β AssessmentPage-D5fw57-T.js} +1 -1
- assets/{AvatarShop-DVBimCS2.js β AvatarShop-CiTbxvY9.js} +1 -1
- assets/{ChatMarkdown-3H5bHtZy.js β ChatMarkdown-BAxWaDZo.js} +1 -1
- assets/{CompetencyRadarChart-c4f5tOE1.js β CompetencyRadarChart-CnxqIqQb.js} +1 -1
- assets/{ConfirmModal-CtRcSVjb.js β ConfirmModal-Bjb3K2ht.js} +1 -1
- assets/{DiagnosticBreakdown-Beq-2PZi.js β DiagnosticBreakdown--QQ0WiYU.js} +1 -1
- assets/{FloatingAITutor-CSkan2Lo.js β FloatingAITutor-BkfkayUl.js} +2 -2
- assets/{GradesPage-eugSRvtq.js β GradesPage-eBdPESCo.js} +2 -2
- assets/{HeroBanner-BqAsDsi9.js β HeroBanner-Db1VgQom.js} +1 -1
- assets/{InitialAssessmentModal-BZbG1PlT.js β InitialAssessmentModal-J2vAV5pW.js} +1 -1
- assets/{LeaderboardPage-BSAGck0o.js β LeaderboardPage-Bttk2eAz.js} +1 -1
- assets/{LearningPath-3spRtYqf.js β LearningPath-B5QBkJ31.js} +1 -1
- assets/LoginPage-BHI-A5a1.js +1 -0
- assets/LoginPage-DktsN1Jx.js +0 -1
- assets/{LogoutActionButton-USB3vnm6.js β LogoutActionButton-ynXvSPMf.js} +1 -1
- assets/{ModuleFolderCard-BDMyLDzi.js β ModuleFolderCard-dHGX9Tik.js} +2 -2
- assets/{ModulesPage-TA1UiY8-.js β ModulesPage--hVGaLzB.js} +1 -1
- assets/{NotificationDropdown-CMhB7x-Z.js β NotificationDropdown-DGCnp7MU.js} +1 -1
- assets/{ProfileModal-BDGytXZz.js β ProfileModal-Jm1jfkzc.js} +1 -1
- assets/{ProfilePictureUploader-BaBXPmnP.js β ProfilePictureUploader-CCiptDXE.js} +3 -3
- assets/{QuizBattlePage-BarEesP3.js β QuizBattlePage-mLpt23lk.js} +1 -1
- assets/{RewardsModal-Cur-YLkw.js β RewardsModal-DnABWb4U.js} +1 -1
- assets/{RightSidebar-C3z9K6VT.js β RightSidebar-3FHMx0H9.js} +1 -1
- assets/{ScientificCalculator-Cc_fXNNW.js β ScientificCalculator-Bdrlg1Yp.js} +1 -1
- assets/{SettingsModal-fWJefMB6.js β SettingsModal-B-pY0VOy.js} +3 -3
- assets/{Sidebar-DT74kKuo.js β Sidebar-DjsHKc7l.js} +1 -1
- assets/{SupplementalBanner-Cl_1p9XH.js β SupplementalBanner-DqWH4k4T.js} +1 -1
- assets/{SupplementalPillCarousel-BCZGCjNt.js β SupplementalPillCarousel-CFX0nks9.js} +1 -1
- assets/TeacherDashboard-6v6okHB7.js +0 -0
- assets/TeacherDashboard-MZLi5zPU.js +0 -0
- assets/{XPNotification-Bj_GZruU.js β XPNotification-BlLePAZH.js} +1 -1
- assets/{automationService-aNpxrln-.js β automationService-BaY4ockN.js} +1 -1
- assets/{bell-cxZiilDJ.js β bell-DbwiSyKd.js} +1 -1
- assets/{button-WbM5w2Bp.js β button-DVjn4LkC.js} +1 -1
- assets/{chart-column-DtQRo3DE.js β chart-column-g5DztEPT.js} +1 -1
- assets/{chatService-BKpYR5sK.js β chatService-v4NqPDUe.js} +1 -1
- assets/{check-CAUeuCaw.js β check-BfYhdun3.js} +1 -1
- assets/{chevron-left-DfHtS3Om.js β chevron-left-BuATOj9f.js} +1 -1
- assets/{chevron-right-DL17FiOB.js β chevron-right-C39hNstc.js} +1 -1
- assets/{chevron-up-D9yeZehY.js β chevron-up-B59xV3SY.js} +1 -1
- assets/{circle-alert-DCyh_PVA.js β circle-alert-fZn6_hMx.js} +1 -1
- assets/{circle-check-BjsGkfB1.js β circle-check-BhLH88x1.js} +1 -1
- assets/{circle-check-big-DJBKLvuw.js β circle-check-big-yCNC9yfs.js} +1 -1
- assets/{circle-help-BkKMcGF2.js β circle-help-DMiD6EQw.js} +1 -1
- assets/{clipboard-check-DfL2oC8x.js β clipboard-check-DSPNHJXj.js} +1 -1
- assets/{clock-Dy5eVj9o.js β clock-D2bky9WI.js} +1 -1
- assets/{diagnosticService-ukrfKIf7.js β diagnosticService-DLw8ENQS.js} +2 -2
- assets/{dialog-C4ok-Axi.js β dialog-DDOyFRnI.js} +1 -1
assets/{AIChatPage-DAxLSWfo.js β AIChatPage-DUfoPWot.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
| 2 |
-
import{aE as B,u as z,_ as F,h as S,m as C,J as D}from"./index-dPnhhJ9w.js";import{r as o,j as e}from"./vendor-react-B4AQeu28.js";import{B as O}from"./button-WbM5w2Bp.js";import{I}from"./input-BUQJctP7.js";import H from"./ChatMarkdown-3H5bHtZy.js";import{P as Y}from"./plus-BIEera7J.js";import{S as G}from"./search-DqYX8akO.js";import{T as Q}from"./trash-2-BCXZR1t7.js";import{C as W}from"./chevron-left-DfHtS3Om.js";import{S as q}from"./send-C3s19g5N.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-D7t7JfSr.js";import"./vendor-markdown-yqZQ_iQm.js";function J(r){return r?r instanceof Date?r.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):typeof r=="object"&&"toDate"in r?r.toDate().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):String(r):""}const he=()=>{const{sessions:r,activeSessionId:a,isLoading:l,loadingSessionId:A,setActiveSessionId:n,createNewSession:b,sendMessage:L,deleteSession:T,getActiveSession:_}=B(),{userProfile:c}=z(),[m,P]=o.useState(""),[i,g]=o.useState(""),[y,j]=o.useState(!1),x=o.useRef(null),h=o.useRef(!0),u=o.useRef(!1),d=_(),p=d?.messages||[],E=p.some(t=>t.sender==="ai"&&t.id.startsWith("stream-")),v=l&&a===A&&!E,w=(t="auto")=>{const s=x.current;s&&s.scrollTo({top:s.scrollHeight,behavior:t})},M=()=>{const t=x.current;return t?t.scrollHeight-t.scrollTop-t.clientHeight<=120:!0},R=()=>{h.current=M()};o.useEffect(()=>{F(async()=>{const{warmupBackend:t}=await import("./index-dPnhhJ9w.js").then(s=>s.b6);return{warmupBackend:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])).then(({warmupBackend:t})=>{t()}).catch(t=>{console.warn("AI chat warmup skipped:",t)})},[]),o.useEffect(()=>{if(!h.current)return;const t=window.requestAnimationFrame(()=>w("auto"));return()=>window.cancelAnimationFrame(t)},[p,v]),o.useEffect(()=>{h.current=!0,w("auto")},[a]);const N=async()=>{if(!(!i.trim()||l||y||u.current)){u.current=!0,j(!0);try{let t=a;t||(t=b(),n(t));const s=i.trim();g(""),await L(t,s)}finally{u.current=!1,j(!1)}}},k=()=>{const t=b();n(t)},$=(t,s)=>{s.stopPropagation(),T(t)},f=r.filter(t=>t.title.toLowerCase().includes(m.toLowerCase())||t.preview.toLowerCase().includes(m.toLowerCase()));return e.jsxs("div",{className:"h-full min-h-0 overflow-hidden flex md:gap-4 px-0 md:px-4 sm:px-6 xl:px-10 py-0 md:py-6",children:[e.jsxs("div",{className:`${a?"hidden md:flex":"flex"} w-full md:w-80 min-h-0 flex-col bg-[#f7f9fc] rounded-none md:rounded-3xl border-0 md:border border-[#dde3eb] overflow-hidden`,children:[e.jsxs("div",{className:"p-4 border-b border-[#dde3eb] flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 md:w-12 md:h-12 bg-gradient-to-r from-sky-600 to-sky-500 rounded-xl md:rounded-2xl flex items-center justify-center shrink-0",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-8 h-8 md:w-10 md:h-10 object-contain drop-shadow-md"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm md:text-base font-bold font-display text-[#0a1628]",children:"L.O.L.I."}),e.jsx("p",{className:"text-[10px] text-[#5a6578]",children:"Your AI Math Tutor"})]})]}),e.jsxs("button",{onClick:k,className:"bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white px-3 py-2 rounded-xl text-xs font-bold transition-all shadow-md hover:shadow-lg flex items-center justify-center gap-1.5 shrink-0",children:[e.jsx(Y,{size:14}),"New Chat"]})]}),e.jsxs("div",{className:"relative mt-3",children:[e.jsx(G,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500",size:14}),e.jsx(I,{type:"text",placeholder:"Search conversations...",value:m,onChange:t=>P(t.target.value),className:"w-full pl-9 pr-3 py-2 text-xs rounded-xl border-[#dde3eb] focus:border-sky-600 focus:ring-2 focus:ring-sky-100"})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-2",children:[e.jsx("div",{className:"flex items-center justify-between mb-2 px-2",children:e.jsxs("span",{className:"text-xs font-bold text-[#5a6578]",children:[f.length," Conversations"]})}),e.jsx(S,{children:f.map(t=>e.jsxs(C.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},onClick:()=>n(t.id),className:`group p-3 rounded-2xl cursor-pointer transition-all duration-200 border relative ${a===t.id?"bg-sky-50 border-sky-200 shadow-sm":"bg-[#edf1f7] border-transparent hover:bg-[#dde3eb] hover:border-[#dde3eb]"}`,children:[e.jsxs("div",{className:"flex items-start justify-between mb-1",children:[e.jsx("h3",{className:`text-xs font-bold mb-0.5 pr-6 line-clamp-1 ${a===t.id?"text-sky-700":"text-[#0a1628]"}`,children:t.title}),e.jsx("button",{onClick:s=>$(t.id,s),className:"absolute top-2 right-2 p-1.5 rounded-lg opacity-0 group-hover:opacity-100 hover:bg-red-100 text-slate-500 hover:text-red-600 transition-all",children:e.jsx(Q,{size:12})})]}),e.jsx("p",{className:"text-[10px] text-[#5a6578] mb-2 line-clamp-2",children:t.preview}),e.jsxs("div",{className:"flex items-center justify-between text-[10px]",children:[e.jsx("span",{className:"text-slate-500",children:t.date}),e.jsxs("span",{className:`px-2 py-0.5 rounded-full ${a===t.id?"bg-sky-100 text-sky-600":"bg-[#dde3eb] text-[#5a6578]"}`,children:[t.messageCount," msgs"]})]})]},t.id))}),f.length===0&&e.jsxs("div",{className:"text-center py-8",children:[e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-16 h-16 object-contain mx-auto mb-2 opacity-60 drop-shadow-sm grayscale contrast-50"}),e.jsx("p",{className:"text-sm text-slate-500",children:"No conversations found"}),e.jsx("p",{className:"text-xs text-slate-500/60 mt-1",children:"Start a new chat!"})]})]})]}),e.jsx("div",{className:`${a?"flex":"hidden md:flex"} flex-1 min-h-0 flex-col bg-[#f7f9fc] rounded-none md:rounded-3xl border-0 md:border border-[#dde3eb] overflow-hidden`,children:a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"p-3 md:p-4 border-b border-[#dde3eb] flex items-center justify-between flex-shrink-0 bg-white md:bg-transparent shadow-sm md:shadow-none z-10 relative",children:[e.jsxs("div",{className:"flex items-center gap-2 md:gap-3",children:[e.jsx("button",{onClick:()=>n(null),className:"md:hidden p-1.5 -ml-1 text-slate-500 hover:text-slate-800 rounded-lg hover:bg-slate-100",children:e.jsx(W,{size:20})}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-bold font-display text-[#0a1628] text-sm md:text-base",children:d?.title}),e.jsx("p",{className:"text-[10px] md:text-xs text-[#5a6578]",children:d?.date})]})]}),e.jsx("div",{className:"flex items-center gap-2",children:d?.topics.map((t,s)=>e.jsx("span",{className:"px-3 py-1 bg-sky-50 text-sky-600 text-xs font-bold rounded-lg",children:t},s))})]}),e.jsxs("div",{ref:x,onScroll:R,className:"flex-1 overflow-y-auto overscroll-contain p-4 md:p-6 space-y-4 bg-[#edf1f7] min-h-0",children:[e.jsx(S,{children:p.map(t=>e.jsxs(C.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`flex items-end gap-2 ${t.sender==="user"?"justify-end":"justify-start"}`,children:[t.sender!=="user"&&e.jsx("div",{className:"w-7 h-7 rounded-full bg-gradient-to-r from-sky-600 to-sky-500 flex items-center justify-center flex-shrink-0 mb-1",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI",className:"w-5 h-5 object-contain"})}),e.jsxs("div",{className:`max-w-[70%] rounded-2xl px-5 py-3 ${t.sender==="user"?"bg-gradient-to-r from-sky-600 to-sky-500 text-white":"bg-white text-[#0a1628] shadow-md border border-[#dde3eb]"}`,children:[t.sender==="user"?e.jsx("p",{className:"text-sm whitespace-pre-wrap leading-relaxed",children:t.text}):e.jsx(H,{children:t.text}),e.jsx("p",{className:`text-[10px] mt-1.5 ${t.sender==="user"?"text-sky-200":"text-slate-500"}`,children:J(t.timestamp)})]}),t.sender==="user"&&e.jsx(D,{src:c?.photo,name:c?.name,gender:c?.gender,className:"w-7 h-7 flex-shrink-0 mb-1",fallbackClassName:"text-[10px]"})]},t.id))}),v&&e.jsx("div",{className:"flex justify-start",children:e.jsx("div",{className:"bg-white text-[#0a1628] shadow-md border border-[#dde3eb] rounded-2xl px-5 py-3 max-w-[70%]",children:e.jsxs("div",{className:"flex gap-1",children:[e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:150ms]"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:300ms]"})]})})})]}),e.jsx("div",{className:"p-3 md:p-4 border-t border-[#dde3eb] bg-white flex-shrink-0",children:e.jsxs("div",{className:"flex gap-2 md:gap-3",children:[e.jsx(I,{type:"text",value:i,onChange:t=>g(t.target.value),onKeyPress:t=>t.key==="Enter"&&N(),placeholder:"Ask me anything about math...",className:"flex-1 px-5 py-3 rounded-xl border-[#dde3eb] focus:border-sky-600 focus:ring-2 focus:ring-sky-100 text-sm"}),e.jsx(O,{onClick:N,disabled:!i.trim()||l||y,className:"px-6 bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white rounded-xl transition-all disabled:opacity-50 disabled:cursor-not-allowed shadow-md hover:shadow-lg",children:e.jsx(q,{size:18})})]})})]}):e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center p-8 text-center",children:[e.jsx("div",{className:"w-24 h-24 bg-gradient-to-r from-sky-100 to-cyan-100 rounded-3xl flex items-center justify-center mb-6",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-20 h-20 object-contain drop-shadow-lg"})}),e.jsx("h2",{className:"text-2xl font-bold font-display text-[#0a1628] mb-1",children:"Welcome to L.O.L.I."}),e.jsx("p",{className:"text-sky-600 text-sm font-bold tracking-wide uppercase mb-4",children:"Logical Operations & Learning Intelligence"}),e.jsx("p",{className:"text-[#5a6578] mb-6 max-w-md",children:"Your personal AI math tutor is here to help! Start a new conversation or select one from the sidebar."}),e.jsx("button",{onClick:k,className:"px-6 py-3 bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white rounded-xl font-bold shadow-lg hover:shadow-xl transition-all",children:"Start Your First Chat"}),e.jsx("div",{className:"mt-8 grid grid-cols-3 gap-4 max-w-2xl",children:["Algebra","Geometry","Calculus"].map(t=>e.jsxs("div",{className:"p-4 bg-[#edf1f7] rounded-xl border border-[#dde3eb]",children:[e.jsx("p",{className:"text-sm font-bold text-[#0a1628]",children:t}),e.jsxs("p",{className:"text-xs text-[#5a6578] mt-1",children:["Get help with ",t.toLowerCase()]})]},t))})]})})]})};export{he as default};
|
|
|
|
| 1 |
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CGNBpSmO.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-BPuEd8FG.js","assets/vendor-charts-D7t7JfSr.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-CEL3Ax6X.css"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{aE as B,u as z,_ as F,h as S,m as C,J as D}from"./index-CGNBpSmO.js";import{r as o,j as e}from"./vendor-react-B4AQeu28.js";import{B as O}from"./button-DVjn4LkC.js";import{I}from"./input-CBi6xF4I.js";import H from"./ChatMarkdown-BAxWaDZo.js";import{P as Y}from"./plus-ck_SGnHK.js";import{S as G}from"./search-C_DiQDej.js";import{T as Q}from"./trash-2-BhQyV3WQ.js";import{C as W}from"./chevron-left-BuATOj9f.js";import{S as q}from"./send-DnRgK3MX.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-D7t7JfSr.js";import"./vendor-markdown-yqZQ_iQm.js";function J(r){return r?r instanceof Date?r.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):typeof r=="object"&&"toDate"in r?r.toDate().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):String(r):""}const he=()=>{const{sessions:r,activeSessionId:a,isLoading:l,loadingSessionId:A,setActiveSessionId:n,createNewSession:b,sendMessage:L,deleteSession:T,getActiveSession:_}=B(),{userProfile:c}=z(),[m,P]=o.useState(""),[i,g]=o.useState(""),[y,j]=o.useState(!1),x=o.useRef(null),h=o.useRef(!0),u=o.useRef(!1),d=_(),p=d?.messages||[],E=p.some(t=>t.sender==="ai"&&t.id.startsWith("stream-")),v=l&&a===A&&!E,w=(t="auto")=>{const s=x.current;s&&s.scrollTo({top:s.scrollHeight,behavior:t})},M=()=>{const t=x.current;return t?t.scrollHeight-t.scrollTop-t.clientHeight<=120:!0},R=()=>{h.current=M()};o.useEffect(()=>{F(async()=>{const{warmupBackend:t}=await import("./index-CGNBpSmO.js").then(s=>s.b6);return{warmupBackend:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])).then(({warmupBackend:t})=>{t()}).catch(t=>{console.warn("AI chat warmup skipped:",t)})},[]),o.useEffect(()=>{if(!h.current)return;const t=window.requestAnimationFrame(()=>w("auto"));return()=>window.cancelAnimationFrame(t)},[p,v]),o.useEffect(()=>{h.current=!0,w("auto")},[a]);const N=async()=>{if(!(!i.trim()||l||y||u.current)){u.current=!0,j(!0);try{let t=a;t||(t=b(),n(t));const s=i.trim();g(""),await L(t,s)}finally{u.current=!1,j(!1)}}},k=()=>{const t=b();n(t)},$=(t,s)=>{s.stopPropagation(),T(t)},f=r.filter(t=>t.title.toLowerCase().includes(m.toLowerCase())||t.preview.toLowerCase().includes(m.toLowerCase()));return e.jsxs("div",{className:"h-full min-h-0 overflow-hidden flex md:gap-4 px-0 md:px-4 sm:px-6 xl:px-10 py-0 md:py-6",children:[e.jsxs("div",{className:`${a?"hidden md:flex":"flex"} w-full md:w-80 min-h-0 flex-col bg-[#f7f9fc] rounded-none md:rounded-3xl border-0 md:border border-[#dde3eb] overflow-hidden`,children:[e.jsxs("div",{className:"p-4 border-b border-[#dde3eb] flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 md:w-12 md:h-12 bg-gradient-to-r from-sky-600 to-sky-500 rounded-xl md:rounded-2xl flex items-center justify-center shrink-0",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-8 h-8 md:w-10 md:h-10 object-contain drop-shadow-md"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm md:text-base font-bold font-display text-[#0a1628]",children:"L.O.L.I."}),e.jsx("p",{className:"text-[10px] text-[#5a6578]",children:"Your AI Math Tutor"})]})]}),e.jsxs("button",{onClick:k,className:"bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white px-3 py-2 rounded-xl text-xs font-bold transition-all shadow-md hover:shadow-lg flex items-center justify-center gap-1.5 shrink-0",children:[e.jsx(Y,{size:14}),"New Chat"]})]}),e.jsxs("div",{className:"relative mt-3",children:[e.jsx(G,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500",size:14}),e.jsx(I,{type:"text",placeholder:"Search conversations...",value:m,onChange:t=>P(t.target.value),className:"w-full pl-9 pr-3 py-2 text-xs rounded-xl border-[#dde3eb] focus:border-sky-600 focus:ring-2 focus:ring-sky-100"})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-2",children:[e.jsx("div",{className:"flex items-center justify-between mb-2 px-2",children:e.jsxs("span",{className:"text-xs font-bold text-[#5a6578]",children:[f.length," Conversations"]})}),e.jsx(S,{children:f.map(t=>e.jsxs(C.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},onClick:()=>n(t.id),className:`group p-3 rounded-2xl cursor-pointer transition-all duration-200 border relative ${a===t.id?"bg-sky-50 border-sky-200 shadow-sm":"bg-[#edf1f7] border-transparent hover:bg-[#dde3eb] hover:border-[#dde3eb]"}`,children:[e.jsxs("div",{className:"flex items-start justify-between mb-1",children:[e.jsx("h3",{className:`text-xs font-bold mb-0.5 pr-6 line-clamp-1 ${a===t.id?"text-sky-700":"text-[#0a1628]"}`,children:t.title}),e.jsx("button",{onClick:s=>$(t.id,s),className:"absolute top-2 right-2 p-1.5 rounded-lg opacity-0 group-hover:opacity-100 hover:bg-red-100 text-slate-500 hover:text-red-600 transition-all",children:e.jsx(Q,{size:12})})]}),e.jsx("p",{className:"text-[10px] text-[#5a6578] mb-2 line-clamp-2",children:t.preview}),e.jsxs("div",{className:"flex items-center justify-between text-[10px]",children:[e.jsx("span",{className:"text-slate-500",children:t.date}),e.jsxs("span",{className:`px-2 py-0.5 rounded-full ${a===t.id?"bg-sky-100 text-sky-600":"bg-[#dde3eb] text-[#5a6578]"}`,children:[t.messageCount," msgs"]})]})]},t.id))}),f.length===0&&e.jsxs("div",{className:"text-center py-8",children:[e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-16 h-16 object-contain mx-auto mb-2 opacity-60 drop-shadow-sm grayscale contrast-50"}),e.jsx("p",{className:"text-sm text-slate-500",children:"No conversations found"}),e.jsx("p",{className:"text-xs text-slate-500/60 mt-1",children:"Start a new chat!"})]})]})]}),e.jsx("div",{className:`${a?"flex":"hidden md:flex"} flex-1 min-h-0 flex-col bg-[#f7f9fc] rounded-none md:rounded-3xl border-0 md:border border-[#dde3eb] overflow-hidden`,children:a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"p-3 md:p-4 border-b border-[#dde3eb] flex items-center justify-between flex-shrink-0 bg-white md:bg-transparent shadow-sm md:shadow-none z-10 relative",children:[e.jsxs("div",{className:"flex items-center gap-2 md:gap-3",children:[e.jsx("button",{onClick:()=>n(null),className:"md:hidden p-1.5 -ml-1 text-slate-500 hover:text-slate-800 rounded-lg hover:bg-slate-100",children:e.jsx(W,{size:20})}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-bold font-display text-[#0a1628] text-sm md:text-base",children:d?.title}),e.jsx("p",{className:"text-[10px] md:text-xs text-[#5a6578]",children:d?.date})]})]}),e.jsx("div",{className:"flex items-center gap-2",children:d?.topics.map((t,s)=>e.jsx("span",{className:"px-3 py-1 bg-sky-50 text-sky-600 text-xs font-bold rounded-lg",children:t},s))})]}),e.jsxs("div",{ref:x,onScroll:R,className:"flex-1 overflow-y-auto overscroll-contain p-4 md:p-6 space-y-4 bg-[#edf1f7] min-h-0",children:[e.jsx(S,{children:p.map(t=>e.jsxs(C.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`flex items-end gap-2 ${t.sender==="user"?"justify-end":"justify-start"}`,children:[t.sender!=="user"&&e.jsx("div",{className:"w-7 h-7 rounded-full bg-gradient-to-r from-sky-600 to-sky-500 flex items-center justify-center flex-shrink-0 mb-1",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI",className:"w-5 h-5 object-contain"})}),e.jsxs("div",{className:`max-w-[70%] rounded-2xl px-5 py-3 ${t.sender==="user"?"bg-gradient-to-r from-sky-600 to-sky-500 text-white":"bg-white text-[#0a1628] shadow-md border border-[#dde3eb]"}`,children:[t.sender==="user"?e.jsx("p",{className:"text-sm whitespace-pre-wrap leading-relaxed",children:t.text}):e.jsx(H,{children:t.text}),e.jsx("p",{className:`text-[10px] mt-1.5 ${t.sender==="user"?"text-sky-200":"text-slate-500"}`,children:J(t.timestamp)})]}),t.sender==="user"&&e.jsx(D,{src:c?.photo,name:c?.name,gender:c?.gender,className:"w-7 h-7 flex-shrink-0 mb-1",fallbackClassName:"text-[10px]"})]},t.id))}),v&&e.jsx("div",{className:"flex justify-start",children:e.jsx("div",{className:"bg-white text-[#0a1628] shadow-md border border-[#dde3eb] rounded-2xl px-5 py-3 max-w-[70%]",children:e.jsxs("div",{className:"flex gap-1",children:[e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:150ms]"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:300ms]"})]})})})]}),e.jsx("div",{className:"p-3 md:p-4 border-t border-[#dde3eb] bg-white flex-shrink-0",children:e.jsxs("div",{className:"flex gap-2 md:gap-3",children:[e.jsx(I,{type:"text",value:i,onChange:t=>g(t.target.value),onKeyPress:t=>t.key==="Enter"&&N(),placeholder:"Ask me anything about math...",className:"flex-1 px-5 py-3 rounded-xl border-[#dde3eb] focus:border-sky-600 focus:ring-2 focus:ring-sky-100 text-sm"}),e.jsx(O,{onClick:N,disabled:!i.trim()||l||y,className:"px-6 bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white rounded-xl transition-all disabled:opacity-50 disabled:cursor-not-allowed shadow-md hover:shadow-lg",children:e.jsx(q,{size:18})})]})})]}):e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center p-8 text-center",children:[e.jsx("div",{className:"w-24 h-24 bg-gradient-to-r from-sky-100 to-cyan-100 rounded-3xl flex items-center justify-center mb-6",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-20 h-20 object-contain drop-shadow-lg"})}),e.jsx("h2",{className:"text-2xl font-bold font-display text-[#0a1628] mb-1",children:"Welcome to L.O.L.I."}),e.jsx("p",{className:"text-sky-600 text-sm font-bold tracking-wide uppercase mb-4",children:"Logical Operations & Learning Intelligence"}),e.jsx("p",{className:"text-[#5a6578] mb-6 max-w-md",children:"Your personal AI math tutor is here to help! Start a new conversation or select one from the sidebar."}),e.jsx("button",{onClick:k,className:"px-6 py-3 bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white rounded-xl font-bold shadow-lg hover:shadow-xl transition-all",children:"Start Your First Chat"}),e.jsx("div",{className:"mt-8 grid grid-cols-3 gap-4 max-w-2xl",children:["Algebra","Geometry","Calculus"].map(t=>e.jsxs("div",{className:"p-4 bg-[#edf1f7] rounded-xl border border-[#dde3eb]",children:[e.jsx("p",{className:"text-sm font-bold text-[#0a1628]",children:t}),e.jsxs("p",{className:"text-xs text-[#5a6578] mt-1",children:["Get help with ",t.toLowerCase()]})]},t))})]})})]})};export{he as default};
|
assets/{AdminDashboard-D4ep7elR.js β AdminDashboard-DdSNmQm3.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{j as e,r as l,d as ps}from"./vendor-react-B4AQeu28.js";import{C as Vs,S as Ds}from"./Sidebar-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{j as e,r as l,d as ps}from"./vendor-react-B4AQeu28.js";import{C as Vs,S as Ds}from"./Sidebar-DjsHKc7l.js";import Ws from"./ConfirmModal-Bjb3K2ht.js";import{e as fe,n as Ae,g as q,l as ke,j as w,h as Et,m as se,p as B,R as Ce,N as zt,r as hs,O as Dt,P as Pt,o as Xs,u as Ze,L as Qs,S as us,x as Ks,v as ye,U as Pe,G as Ye,i as Rt,Q as Ps,V as Rs,W as Ts,q as Tt,A as Ms,Z as Re,X as Mt,B as $t,T as Ys,b as Ue,F as Lt,Y as Ut,$ as It,D as Ft,M as Ot,J as _t}from"./index-CGNBpSmO.js";import{B as S}from"./button-DVjn4LkC.js";import{S as Y,a as J,b as ze,c as Z,d as k}from"./select-3FfJraPy.js";import{I as ie}from"./input-CBi6xF4I.js";import{S as Qe}from"./subjects-DP2R71lN.js";import{getDocs as ee,query as Te,collection as Q,orderBy as Ie,deleteDoc as Bt,doc as Gt,limit as Je,where as $s,addDoc as Ht,serverTimestamp as qt}from"./vendor-firebase-firestore-CNv3xXal.js";import{U as He}from"./upload-Daz-vKaw.js";import{D as ge}from"./LogoutActionButton-ynXvSPMf.js";import{F as we,A as Me,I as Js,N as Vt}from"./NotificationDropdown-DGCnp7MU.js";import{T as be}from"./trash-2-BhQyV3WQ.js";import{S as Ls}from"./sparkles-C0ju-UTT.js";import{S as Us,D as Zs,a as et,b as st,c as tt,e as Wt}from"./dialog-DDOyFRnI.js";import{D as fs}from"./download-Dg4u7Zq0.js";import{S as gs}from"./shield-check-h8afT4cG.js";import{S as at}from"./search-C_DiQDej.js";import{C as js}from"./clock-D2bky9WI.js";import{E as lt,a as Xt}from"./eye-_x45syMF.js";import{C as rt}from"./chevron-left-BuATOj9f.js";import{C as it}from"./chevron-right-C39hNstc.js";import{C as Se}from"./circle-alert-fZn6_hMx.js";import{C as Qt,a as Kt}from"./vendor-radix-BPuEd8FG.js";import{C as Yt}from"./check-BfYhdun3.js";import{M as Jt}from"./mail-C1tKDR_N.js";import{P as Is}from"./plus-ck_SGnHK.js";import{S as nt}from"./save-CNayyZ15.js";import{C as Zt}from"./chart-column-g5DztEPT.js";import{u as ea}from"./useQuery-C7Nbsm2w.js";import{X as vs}from"./x-Deb9zs8O.js";import{S as ds}from"./skeleton-C6ieN9wR.js";import{D as sa}from"./dollar-sign-CZpwYJk-.js";import{S as ta}from"./switch-bpTyEA6p.js";import{u as aa,t as la,a as ra}from"./useSubjectAvailability-iyC7Wdl7.js";import{C as ia}from"./circle-help-DMiD6EQw.js";import{B as na}from"./bell-DbwiSyKd.js";import{R as xs,B as ca,C as oa,X as da,Y as xa,T as ma,a as Fs,A as pa,d as ha,P as ua,e as ga,b as Os}from"./vendor-charts-D7t7JfSr.js";import{C as ba}from"./circle-check-BhLH88x1.js";import"./tooltip-A8-ihp1Q.js";import"./shirt-T-KPAkDY.js";import"./log-out-G6mObnLf.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-markdown-yqZQ_iQm.js";import"./chevron-up-B59xV3SY.js";import"./formatDistanceToNow-Csp8CCDy.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{AssessmentPage-D95xz_DH.js β AssessmentPage-D5fw57-T.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{r,j as e}from"./vendor-react-B4AQeu28.js";import{B as Q}from"./button-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{r,j as e}from"./vendor-react-B4AQeu28.js";import{B as Q}from"./button-DVjn4LkC.js";import{s as Y}from"./diagnosticService-DLw8ENQS.js";import{e as J,m as i,Z as O,h as U,T as Z,E as G,q as H}from"./index-CGNBpSmO.js";import{M as W}from"./maximize-2-CwlOKVNo.js";import{X}from"./x-Deb9zs8O.js";import{C as K}from"./clock-D2bky9WI.js";import{C as V}from"./circle-check-big-yCNC9yfs.js";import{C as ee}from"./chevron-right-C39hNstc.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-D7t7JfSr.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-markdown-yqZQ_iQm.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{AvatarShop-DVBimCS2.js β AvatarShop-CiTbxvY9.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{r as i,j as e}from"./vendor-react-B4AQeu28.js";import{e as se,L as ae,g as re,f as oe}from"./vendor-radix-BPuEd8FG.js";import{e as S,u as le,L as w,a4 as R,m as y,h as ie,j as c,aM as ne,aN as ce}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{r as i,j as e}from"./vendor-react-B4AQeu28.js";import{e as se,L as ae,g as re,f as oe}from"./vendor-radix-BPuEd8FG.js";import{e as S,u as le,L as w,a4 as R,m as y,h as ie,j as c,aM as ne,aN as ce}from"./index-CGNBpSmO.js";import{u as de}from"./useFeatureAccess-BUoKpUf3.js";import{T as me,a as ue,b as xe}from"./tooltip-A8-ihp1Q.js";import{C as pe}from"./CompositeAvatar-Col05lJc.js";import{M as j}from"./avatarData-BuQSOXo3.js";import{S as O}from"./save-CNayyZ15.js";import{S as V}from"./sparkles-C0ju-UTT.js";import{S as fe}from"./shirt-T-KPAkDY.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-charts-D7t7JfSr.js";import"./vendor-markdown-yqZQ_iQm.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{ChatMarkdown-3H5bHtZy.js β ChatMarkdown-BAxWaDZo.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-react-B4AQeu28.js","assets/vendor-markdown-CfVKi3_s.css"])))=>i.map(i=>d[i]);
|
| 2 |
-
import{b4 as d,_ as c}from"./index-
|
|
|
|
| 1 |
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-react-B4AQeu28.js","assets/vendor-markdown-CfVKi3_s.css"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{b4 as d,_ as c}from"./index-CGNBpSmO.js";import{r as m,j as r}from"./vendor-react-B4AQeu28.js";import{M as h,r as x,a as y}from"./vendor-markdown-yqZQ_iQm.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-D7t7JfSr.js";let a=null;const p=()=>(a||(a=c(()=>import("./vendor-markdown-yqZQ_iQm.js").then(l=>l.k),__vite__mapDeps([0,1,2]))),a),M=({children:l})=>{if(m.useEffect(()=>{p()},[]),!l||typeof l!="string")return null;const t=d(l);return r.jsx("div",{className:"chat-markdown",children:r.jsx(h,{remarkPlugins:[y],rehypePlugins:[x],components:{a:({href:e,children:s})=>r.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline",children:s}),code:e=>{const{inline:s,className:o,children:n,...i}=e;return r.jsx("code",{className:`${s?"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 text-sm":"block bg-gray-100 dark:bg-gray-900 rounded p-3 overflow-x-auto my-2"} ${o||""}`,...i,children:n})},blockquote:({children:e})=>r.jsx("blockquote",{className:"border-l-4 border-gray-300 dark:border-gray-600 pl-4 italic text-gray-600 dark:text-gray-400 my-2",children:e}),h1:({children:e})=>r.jsx("h1",{className:"text-2xl font-bold my-2",children:e}),h2:({children:e})=>r.jsx("h2",{className:"text-xl font-bold my-2",children:e}),h3:({children:e})=>r.jsx("h3",{className:"text-lg font-bold my-2",children:e}),h4:({children:e})=>r.jsx("h4",{className:"text-base font-bold my-2",children:e}),h5:({children:e})=>r.jsx("h5",{className:"text-sm font-bold my-2",children:e}),h6:({children:e})=>r.jsx("h6",{className:"text-xs font-bold my-2",children:e}),ul:({children:e})=>r.jsx("ul",{className:"list-disc list-inside my-2",children:e}),ol:({children:e})=>r.jsx("ol",{className:"list-decimal list-inside my-2",children:e}),li:({children:e})=>r.jsx("li",{className:"ml-2",children:e}),hr:()=>r.jsx("hr",{className:"my-4 border-t border-gray-300 dark:border-gray-600"}),p:({children:e})=>r.jsx("p",{className:"my-1",children:e})},children:t})})};export{M as default};
|
assets/{CompetencyRadarChart-c4f5tOE1.js β CompetencyRadarChart-CnxqIqQb.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as g,j as t}from"./vendor-react-B4AQeu28.js";import{g as A,ab as I,u as B,m as L,B as O,R as W,a as H}from"./index-dPnhhJ9w.js";import{collection as R,getDocs as q,query as K,orderBy as U,limit as $,Timestamp as G,getDoc as J,doc as V}from"./vendor-firebase-firestore-CNv3xXal.js";import{g as X,s as Y}from"./subjects-DzQfiusb.js";import{S as Z}from"./sparkles-DPFO64ZX.js";import{R as ee,g as te,h as se,i as ne,j as ae,k as oe,T as re}from"./vendor-charts-D7t7JfSr.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-markdown-yqZQ_iQm.js";import"./chart-column-DtQRo3DE.js";const P=["#1FA7E1","#9956DE","#75D06A","#FFB356","#7274ED","#FF8B8B","#6ED1CF","#FB96BB"];async function ie(a){try{const r=R(A,"users",a,"quizResults"),d=K(r,U("timestamp","desc"),$(500)),l=await q(d);return l.empty?F(a):l.docs.map(s=>{const e=s.data();return{quizId:s.id,moduleId:e.moduleId||"",subjectId:e.subjectId||"",score:typeof e.score=="number"?e.score:0,totalQuestions:e.totalQuestions||0,correctAnswers:e.correctAnswers||0,questionType:e.questionType||"multiple_choice",timestamp:e.timestamp instanceof G||e.timestamp?.toDate?e.timestamp.toDate():new Date,timeSpent:e.timeSpent||0}})}catch(r){return console.error("[competencyService] fetchQuizResults failed, falling back:",r),F(a)}}async function F(a){const r=await J(V(A,"progress",a));return r.exists()?(r.data().quizAttempts||[]).map((s,e)=>({quizId:String(s.quizId||`attempt-${e}`),moduleId:String(s.moduleId||s.quizId||""),subjectId:String(s.subjectId||""),score:typeof s.score=="number"?s.score:0,totalQuestions:s.totalQuestions||0,correctAnswers:typeof s.correctAnswers=="number"?s.correctAnswers:0,questionType:s.questionType||"multiple_choice",timestamp:s.completedAt?new Date(s.completedAt):new Date,timeSpent:s.timeSpent||0})):[]}async function ce(a){try{const r=R(A,"users",a,"moduleProgress"),d=await q(r);if(d.empty)return{};const l={};return d.forEach(s=>{const e=s.data();l[s.id]={moduleId:s.id,subjectId:e.subjectId||"",sessionsCompleted:e.sessionsCompleted||0,lastActive:e.lastActive?e.lastActive instanceof G?e.lastActive.toDate():new Date(e.lastActive):new Date,moduleTitle:e.moduleTitle||s.id,lessonsCompleted:e.lessonsCompleted||[],quizzesCompleted:e.quizzesCompleted||[]}}),l}catch(r){return console.error("[competencyService] fetchModuleProgress failed:",r),{}}}function _(a,r,d,l){const s=r.filter(p=>p.moduleId===a),e=s.length>0?s.reduce((p,b)=>p+b.score,0)/s.length:0,h=["identification","multiple_choice"],u=s.filter(p=>h.includes(p.questionType)),i=u.length>0?u.reduce((p,b)=>p+b.score,0)/u.length:e*.9,o=["word_problem","equation_based","enumeration"],n=s.filter(p=>o.includes(p.questionType)),c=n.length>0?n.reduce((p,b)=>p+b.score,0)/n.length:e*.85,m=d,f=m?.lessonsCompleted?.length||0,N=m?.quizzesCompleted?.length||0,D=m?.sessionsCompleted||0,y=l.find(p=>p.id===a),x=y?.lessons?.length||1,k=y?.quizzes?.length||1,z=Math.min(100,f/x*100),C=Math.min(100,N/k*100),v=Math.min(100,(z+C+D*5)/2.5);if(s.length<2){const p=v>50?60+v*.3:v*.8;return{overallMastery:e,conceptGrasp:i,application:c,engagement:v,consistency:Math.min(100,p)}}const w=s.map(p=>p.score),M=w.reduce((p,b)=>p+b,0)/w.length,E=w.reduce((p,b)=>p+Math.pow(b-M,2),0)/w.length,j=Math.sqrt(E)/Math.max(M,1),S=Math.max(0,Math.min(100,(1-j)*100));return{overallMastery:Math.round(e),conceptGrasp:Math.round(i),application:Math.round(c),engagement:Math.round(v),consistency:Math.round(S)}}async function le(a){try{const r=R(A,"users",a,"competencyMatrix"),d=await q(r);if(d.empty)return{};const l={};return d.forEach(s=>{const e=s.data();l[s.id]={moduleId:s.id,moduleName:e.moduleName||s.id,overallMastery:e.overallMastery??0,conceptGrasp:e.conceptGrasp??0,application:e.application??0,engagement:e.engagement??0,consistency:e.consistency??0,computedAt:e.computedAt?.toDate?.()||new Date}}),l}catch(r){return console.error("[competencyService] fetchCachedCompetencyMatrix failed:",r),{}}}const Q=[{key:"progress",label:"Overall Mastery"},{key:"concept",label:"Concept Grasp"},{key:"application",label:"Application"},{key:"engagement",label:"Engagement"},{key:"consistency",label:"Consistency"}];function de(a){const[r,d]=g.useState([]),[l,s]=g.useState([]),[e,h]=g.useState("N/A"),[u,i]=g.useState(!0),[o,n]=g.useState(null),[c,m]=g.useState(!1),f=g.useRef(0),N=g.useCallback(async(y,x)=>{if(x!==f.current)return;const z=X(null)[0]??"gen-math",C=Y.find(j=>j.id===z)?.modules||[],v=C.map((j,S)=>({id:j.id,name:j.title.length>15?j.title.substring(0,15).trim()+"...":j.title,color:P[S%P.length]})),w=await le(a);if(x!==f.current)return;if(Object.keys(w).length>0){ue(w,v,d,h),m(!1),i(!1);return}const M=await ie(a),E=await ce(a);if(x!==f.current)return;const T=M.length>0;m(!T),pe(M,E,v,C,d,h),i(!1)},[a]),D=g.useCallback(async()=>{if(!a){i(!1);return}const y=++f.current;i(!0),n(null);try{const x=await new Promise(k=>{const z=I(a,C=>{z(),k(C)})});if(y!==f.current)return;await N(x,y)}catch(x){console.error("[useCompetencyMatrix] Failed to load:",x),y===f.current&&(n("Failed to load competency data. Please try again."),i(!1))}},[a,N]);return g.useEffect(()=>{if(!a)return;const y=I(a,x=>{const k=++f.current;N(x,k)});return()=>y()},[a,N]),{data:r,modulesList:l,topModule:e,loading:u,error:o,isEmpty:c,refresh:D}}function ue(a,r,d,l){let s=-1,e="N/A";const h=Q.map(u=>{const i={metric:u.label,fullMark:100};return r.forEach(o=>{const n=a[o.id];n&&(u.key==="progress"?i[o.id]=n.overallMastery:u.key==="concept"?i[o.id]=n.conceptGrasp:u.key==="application"?i[o.id]=n.application:u.key==="engagement"?i[o.id]=n.engagement:u.key==="consistency"&&(i[o.id]=n.consistency))}),i});r.forEach(u=>{const i=a[u.id];if(i){const o=(i.overallMastery+i.conceptGrasp+i.application+i.engagement+i.consistency)/5;o>s&&(s=o,e=u.name)}}),l(e),d(h)}function pe(a,r,d,l,s,e){let h=-1,u="N/A";const i=Q.map(o=>{const n={metric:o.label,fullMark:100};return l.forEach(c=>{const m=r[c.id],f=_(c.id,a,m??{moduleId:c.id,sessionsCompleted:0,moduleTitle:c.title,lessonsCompleted:[],quizzesCompleted:[]},l);o.key==="progress"?n[c.id]=f.overallMastery:o.key==="concept"?n[c.id]=f.conceptGrasp:o.key==="application"?n[c.id]=f.application:o.key==="engagement"?n[c.id]=f.engagement:o.key==="consistency"&&(n[c.id]=f.consistency)}),n});l.forEach(o=>{const n=r[o.id],c=_(o.id,a,n??{moduleId:o.id,sessionsCompleted:0,moduleTitle:o.title,lessonsCompleted:[],quizzesCompleted:[]},l),m=(c.overallMastery+c.conceptGrasp+c.application+c.engagement+c.consistency)/5;m>h&&(h=m,u=d.find(f=>f.id===o.id)?.name||"N/A")}),e(u),s(i)}const ze=()=>{const{userProfile:a}=B(),{data:r,modulesList:d,topModule:l,loading:s,error:e,isEmpty:h,refresh:u}=de(a?.uid??""),[i,o]=g.useState(!1);return t.jsxs(L.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,ease:[.22,1,.36,1]},className:"relative overflow-hidden bg-white rounded-[16px] border border-slate-200 shadow-sm p-6 lg:p-8 group",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[t.jsx("div",{className:"absolute -right-12 -bottom-12 w-32 h-32 bg-[#9956DE]/5 rounded-full transition-transform duration-500 group-hover:scale-[1.8] group-hover:-translate-y-4 group-hover:-translate-x-4"}),t.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between mb-6 relative z-10 gap-4",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-10 h-10 rounded-[12px] bg-gradient-to-br from-[#a855f7] to-[#9333ea] flex items-center justify-center shadow-[0_4px_12px_rgba(168,85,247,0.2)]",children:t.jsx(O,{size:20,className:"text-white"})}),t.jsxs("div",{children:[t.jsx("h3",{className:"text-[15px] font-bold text-slate-900",children:"Competency Matrix"}),t.jsx("p",{className:"text-[12px] text-slate-500",children:"Realtime performance across modules"})]})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[!s&&!h&&!e&&t.jsxs("div",{className:"flex items-center gap-2 bg-[#f5f3ff] border border-[#e0e7ff] px-3 py-1.5 rounded-full",children:[t.jsx(Z,{size:12,className:"text-amber-500"}),t.jsx("span",{className:"text-[11px] font-bold text-[#9956DE] uppercase tracking-wider",children:l})]}),!s&&t.jsx("button",{onClick:u,className:"w-8 h-8 rounded-full bg-white border border-slate-200 flex items-center justify-center hover:bg-[#f5f3ff] hover:border-[#9956DE]/30 transition-colors shadow-sm",title:"Refresh",children:t.jsx(W,{size:13,className:"text-slate-400"})})]})]}),t.jsx("div",{className:"h-[300px] sm:h-[360px] w-full relative z-10",children:s?t.jsx("div",{className:"w-full h-full flex items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-3",children:[t.jsx("div",{className:"w-8 h-8 border-4 border-[#9956DE]/20 border-t-[#9956DE] rounded-full animate-spin"}),t.jsx("p",{className:"text-[13px] text-slate-400 font-medium",children:"Analyzing skill vectors..."})]})}):h||e?t.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-4",children:[t.jsx("div",{className:"w-14 h-14 rounded-[16px] bg-gradient-to-br from-slate-100 to-slate-50 flex items-center justify-center border border-slate-200",children:t.jsx(H,{size:24,className:"text-slate-400"})}),t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-[13px] font-semibold text-slate-600 mb-1",children:e?"Unable to load competency data":"No activity yet"}),t.jsx("p",{className:"text-[12px] text-slate-400 max-w-[260px]",children:e||"Complete quizzes and lessons to see your competency matrix here."})]}),e&&t.jsx("button",{onClick:u,className:"px-4 py-2 text-[12px] font-semibold bg-[#9956DE] text-white rounded-full hover:bg-[#8b45d1] transition-colors shadow-md",children:"Try Again"})]}):t.jsx(ee,{width:"100%",height:"100%",children:t.jsxs(te,{cx:"50%",cy:"50%",outerRadius:i?"75%":"70%",data:r,children:[t.jsx(se,{stroke:"#e2e8f0",strokeDasharray:"4 4",polarRadius:[20,40,60,80,100]}),t.jsx(ne,{dataKey:"metric",tick:{fill:"#475569",fontSize:12,fontWeight:600}}),t.jsx(ae,{angle:90,domain:[0,100],tick:{fill:"#94a3b8",fontSize:10},tickCount:6,axisLine:!1}),d.map(n=>t.jsx(oe,{name:n.name,dataKey:n.id,stroke:n.color,strokeWidth:2,fill:n.color,fillOpacity:.3,dot:{r:3,fill:"#fff",stroke:n.color,strokeWidth:2},activeDot:{r:5,fill:n.color,stroke:"#fff",strokeWidth:2},isAnimationActive:!0,animationDuration:1500,animationEasing:"ease-out"},n.id)),t.jsx(re,{cursor:!1,content:({active:n,payload:c})=>n&&c&&c.length?t.jsxs("div",{className:"bg-white/95 backdrop-blur-[12px] shadow-[0_8px_24px_rgba(0,0,0,0.12)] border border-slate-100 rounded-[12px] p-4",children:[t.jsx("p",{className:"font-bold text-slate-800 text-[13px] mb-2",children:c[0].payload.metric}),t.jsx("div",{className:"flex flex-col gap-1.5",children:c.map(m=>t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:m.stroke}}),t.jsx("span",{className:"text-[11px] font-semibold text-slate-600 truncate max-w-[120px]",children:String(m.name)})]}),t.jsxs("span",{className:"text-[13px] font-bold",style:{color:m.stroke},children:[Math.round(m.value),"%"]})]},m.name))})]}):null})]})})}),!s&&!h&&!e&&d.length>0&&t.jsx("div",{className:"flex flex-wrap justify-center items-center gap-3 mt-4 relative z-10",children:d.map(n=>t.jsxs("div",{className:"flex items-center gap-1.5 bg-slate-50 px-2.5 py-1 rounded-full border border-slate-100",children:[t.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:n.color}}),t.jsx("span",{className:"text-[10px] font-bold text-slate-600 uppercase tracking-wider",children:n.name.length>15?n.name.substring(0,12)+"...":n.name})]},n.id))})]})};export{ze as CompetencyRadarChart};
|
|
|
|
| 1 |
+
import{r as g,j as t}from"./vendor-react-B4AQeu28.js";import{g as A,ab as I,u as B,m as L,B as O,R as W,b as H}from"./index-CGNBpSmO.js";import{collection as R,getDocs as q,query as K,orderBy as U,limit as $,Timestamp as G,getDoc as J,doc as V}from"./vendor-firebase-firestore-CNv3xXal.js";import{g as X,s as Y}from"./subjects-DP2R71lN.js";import{S as Z}from"./sparkles-C0ju-UTT.js";import{R as ee,g as te,h as se,i as ne,j as ae,k as oe,T as re}from"./vendor-charts-D7t7JfSr.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-markdown-yqZQ_iQm.js";import"./chart-column-g5DztEPT.js";const P=["#1FA7E1","#9956DE","#75D06A","#FFB356","#7274ED","#FF8B8B","#6ED1CF","#FB96BB"];async function ie(a){try{const r=R(A,"users",a,"quizResults"),d=K(r,U("timestamp","desc"),$(500)),l=await q(d);return l.empty?F(a):l.docs.map(s=>{const e=s.data();return{quizId:s.id,moduleId:e.moduleId||"",subjectId:e.subjectId||"",score:typeof e.score=="number"?e.score:0,totalQuestions:e.totalQuestions||0,correctAnswers:e.correctAnswers||0,questionType:e.questionType||"multiple_choice",timestamp:e.timestamp instanceof G||e.timestamp?.toDate?e.timestamp.toDate():new Date,timeSpent:e.timeSpent||0}})}catch(r){return console.error("[competencyService] fetchQuizResults failed, falling back:",r),F(a)}}async function F(a){const r=await J(V(A,"progress",a));return r.exists()?(r.data().quizAttempts||[]).map((s,e)=>({quizId:String(s.quizId||`attempt-${e}`),moduleId:String(s.moduleId||s.quizId||""),subjectId:String(s.subjectId||""),score:typeof s.score=="number"?s.score:0,totalQuestions:s.totalQuestions||0,correctAnswers:typeof s.correctAnswers=="number"?s.correctAnswers:0,questionType:s.questionType||"multiple_choice",timestamp:s.completedAt?new Date(s.completedAt):new Date,timeSpent:s.timeSpent||0})):[]}async function ce(a){try{const r=R(A,"users",a,"moduleProgress"),d=await q(r);if(d.empty)return{};const l={};return d.forEach(s=>{const e=s.data();l[s.id]={moduleId:s.id,subjectId:e.subjectId||"",sessionsCompleted:e.sessionsCompleted||0,lastActive:e.lastActive?e.lastActive instanceof G?e.lastActive.toDate():new Date(e.lastActive):new Date,moduleTitle:e.moduleTitle||s.id,lessonsCompleted:e.lessonsCompleted||[],quizzesCompleted:e.quizzesCompleted||[]}}),l}catch(r){return console.error("[competencyService] fetchModuleProgress failed:",r),{}}}function _(a,r,d,l){const s=r.filter(p=>p.moduleId===a),e=s.length>0?s.reduce((p,b)=>p+b.score,0)/s.length:0,h=["identification","multiple_choice"],u=s.filter(p=>h.includes(p.questionType)),i=u.length>0?u.reduce((p,b)=>p+b.score,0)/u.length:e*.9,o=["word_problem","equation_based","enumeration"],n=s.filter(p=>o.includes(p.questionType)),c=n.length>0?n.reduce((p,b)=>p+b.score,0)/n.length:e*.85,m=d,f=m?.lessonsCompleted?.length||0,N=m?.quizzesCompleted?.length||0,D=m?.sessionsCompleted||0,y=l.find(p=>p.id===a),x=y?.lessons?.length||1,k=y?.quizzes?.length||1,z=Math.min(100,f/x*100),C=Math.min(100,N/k*100),v=Math.min(100,(z+C+D*5)/2.5);if(s.length<2){const p=v>50?60+v*.3:v*.8;return{overallMastery:e,conceptGrasp:i,application:c,engagement:v,consistency:Math.min(100,p)}}const w=s.map(p=>p.score),M=w.reduce((p,b)=>p+b,0)/w.length,E=w.reduce((p,b)=>p+Math.pow(b-M,2),0)/w.length,j=Math.sqrt(E)/Math.max(M,1),S=Math.max(0,Math.min(100,(1-j)*100));return{overallMastery:Math.round(e),conceptGrasp:Math.round(i),application:Math.round(c),engagement:Math.round(v),consistency:Math.round(S)}}async function le(a){try{const r=R(A,"users",a,"competencyMatrix"),d=await q(r);if(d.empty)return{};const l={};return d.forEach(s=>{const e=s.data();l[s.id]={moduleId:s.id,moduleName:e.moduleName||s.id,overallMastery:e.overallMastery??0,conceptGrasp:e.conceptGrasp??0,application:e.application??0,engagement:e.engagement??0,consistency:e.consistency??0,computedAt:e.computedAt?.toDate?.()||new Date}}),l}catch(r){return console.error("[competencyService] fetchCachedCompetencyMatrix failed:",r),{}}}const Q=[{key:"progress",label:"Overall Mastery"},{key:"concept",label:"Concept Grasp"},{key:"application",label:"Application"},{key:"engagement",label:"Engagement"},{key:"consistency",label:"Consistency"}];function de(a){const[r,d]=g.useState([]),[l,s]=g.useState([]),[e,h]=g.useState("N/A"),[u,i]=g.useState(!0),[o,n]=g.useState(null),[c,m]=g.useState(!1),f=g.useRef(0),N=g.useCallback(async(y,x)=>{if(x!==f.current)return;const z=X(null)[0]??"gen-math",C=Y.find(j=>j.id===z)?.modules||[],v=C.map((j,S)=>({id:j.id,name:j.title.length>15?j.title.substring(0,15).trim()+"...":j.title,color:P[S%P.length]})),w=await le(a);if(x!==f.current)return;if(Object.keys(w).length>0){ue(w,v,d,h),m(!1),i(!1);return}const M=await ie(a),E=await ce(a);if(x!==f.current)return;const T=M.length>0;m(!T),pe(M,E,v,C,d,h),i(!1)},[a]),D=g.useCallback(async()=>{if(!a){i(!1);return}const y=++f.current;i(!0),n(null);try{const x=await new Promise(k=>{const z=I(a,C=>{z(),k(C)})});if(y!==f.current)return;await N(x,y)}catch(x){console.error("[useCompetencyMatrix] Failed to load:",x),y===f.current&&(n("Failed to load competency data. Please try again."),i(!1))}},[a,N]);return g.useEffect(()=>{if(!a)return;const y=I(a,x=>{const k=++f.current;N(x,k)});return()=>y()},[a,N]),{data:r,modulesList:l,topModule:e,loading:u,error:o,isEmpty:c,refresh:D}}function ue(a,r,d,l){let s=-1,e="N/A";const h=Q.map(u=>{const i={metric:u.label,fullMark:100};return r.forEach(o=>{const n=a[o.id];n&&(u.key==="progress"?i[o.id]=n.overallMastery:u.key==="concept"?i[o.id]=n.conceptGrasp:u.key==="application"?i[o.id]=n.application:u.key==="engagement"?i[o.id]=n.engagement:u.key==="consistency"&&(i[o.id]=n.consistency))}),i});r.forEach(u=>{const i=a[u.id];if(i){const o=(i.overallMastery+i.conceptGrasp+i.application+i.engagement+i.consistency)/5;o>s&&(s=o,e=u.name)}}),l(e),d(h)}function pe(a,r,d,l,s,e){let h=-1,u="N/A";const i=Q.map(o=>{const n={metric:o.label,fullMark:100};return l.forEach(c=>{const m=r[c.id],f=_(c.id,a,m??{moduleId:c.id,sessionsCompleted:0,moduleTitle:c.title,lessonsCompleted:[],quizzesCompleted:[]},l);o.key==="progress"?n[c.id]=f.overallMastery:o.key==="concept"?n[c.id]=f.conceptGrasp:o.key==="application"?n[c.id]=f.application:o.key==="engagement"?n[c.id]=f.engagement:o.key==="consistency"&&(n[c.id]=f.consistency)}),n});l.forEach(o=>{const n=r[o.id],c=_(o.id,a,n??{moduleId:o.id,sessionsCompleted:0,moduleTitle:o.title,lessonsCompleted:[],quizzesCompleted:[]},l),m=(c.overallMastery+c.conceptGrasp+c.application+c.engagement+c.consistency)/5;m>h&&(h=m,u=d.find(f=>f.id===o.id)?.name||"N/A")}),e(u),s(i)}const ze=()=>{const{userProfile:a}=B(),{data:r,modulesList:d,topModule:l,loading:s,error:e,isEmpty:h,refresh:u}=de(a?.uid??""),[i,o]=g.useState(!1);return t.jsxs(L.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,ease:[.22,1,.36,1]},className:"relative overflow-hidden bg-white rounded-[16px] border border-slate-200 shadow-sm p-6 lg:p-8 group",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[t.jsx("div",{className:"absolute -right-12 -bottom-12 w-32 h-32 bg-[#9956DE]/5 rounded-full transition-transform duration-500 group-hover:scale-[1.8] group-hover:-translate-y-4 group-hover:-translate-x-4"}),t.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between mb-6 relative z-10 gap-4",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-10 h-10 rounded-[12px] bg-gradient-to-br from-[#a855f7] to-[#9333ea] flex items-center justify-center shadow-[0_4px_12px_rgba(168,85,247,0.2)]",children:t.jsx(O,{size:20,className:"text-white"})}),t.jsxs("div",{children:[t.jsx("h3",{className:"text-[15px] font-bold text-slate-900",children:"Competency Matrix"}),t.jsx("p",{className:"text-[12px] text-slate-500",children:"Realtime performance across modules"})]})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[!s&&!h&&!e&&t.jsxs("div",{className:"flex items-center gap-2 bg-[#f5f3ff] border border-[#e0e7ff] px-3 py-1.5 rounded-full",children:[t.jsx(Z,{size:12,className:"text-amber-500"}),t.jsx("span",{className:"text-[11px] font-bold text-[#9956DE] uppercase tracking-wider",children:l})]}),!s&&t.jsx("button",{onClick:u,className:"w-8 h-8 rounded-full bg-white border border-slate-200 flex items-center justify-center hover:bg-[#f5f3ff] hover:border-[#9956DE]/30 transition-colors shadow-sm",title:"Refresh",children:t.jsx(W,{size:13,className:"text-slate-400"})})]})]}),t.jsx("div",{className:"h-[300px] sm:h-[360px] w-full relative z-10",children:s?t.jsx("div",{className:"w-full h-full flex items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-3",children:[t.jsx("div",{className:"w-8 h-8 border-4 border-[#9956DE]/20 border-t-[#9956DE] rounded-full animate-spin"}),t.jsx("p",{className:"text-[13px] text-slate-400 font-medium",children:"Analyzing skill vectors..."})]})}):h||e?t.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-4",children:[t.jsx("div",{className:"w-14 h-14 rounded-[16px] bg-gradient-to-br from-slate-100 to-slate-50 flex items-center justify-center border border-slate-200",children:t.jsx(H,{size:24,className:"text-slate-400"})}),t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-[13px] font-semibold text-slate-600 mb-1",children:e?"Unable to load competency data":"No activity yet"}),t.jsx("p",{className:"text-[12px] text-slate-400 max-w-[260px]",children:e||"Complete quizzes and lessons to see your competency matrix here."})]}),e&&t.jsx("button",{onClick:u,className:"px-4 py-2 text-[12px] font-semibold bg-[#9956DE] text-white rounded-full hover:bg-[#8b45d1] transition-colors shadow-md",children:"Try Again"})]}):t.jsx(ee,{width:"100%",height:"100%",children:t.jsxs(te,{cx:"50%",cy:"50%",outerRadius:i?"75%":"70%",data:r,children:[t.jsx(se,{stroke:"#e2e8f0",strokeDasharray:"4 4",polarRadius:[20,40,60,80,100]}),t.jsx(ne,{dataKey:"metric",tick:{fill:"#475569",fontSize:12,fontWeight:600}}),t.jsx(ae,{angle:90,domain:[0,100],tick:{fill:"#94a3b8",fontSize:10},tickCount:6,axisLine:!1}),d.map(n=>t.jsx(oe,{name:n.name,dataKey:n.id,stroke:n.color,strokeWidth:2,fill:n.color,fillOpacity:.3,dot:{r:3,fill:"#fff",stroke:n.color,strokeWidth:2},activeDot:{r:5,fill:n.color,stroke:"#fff",strokeWidth:2},isAnimationActive:!0,animationDuration:1500,animationEasing:"ease-out"},n.id)),t.jsx(re,{cursor:!1,content:({active:n,payload:c})=>n&&c&&c.length?t.jsxs("div",{className:"bg-white/95 backdrop-blur-[12px] shadow-[0_8px_24px_rgba(0,0,0,0.12)] border border-slate-100 rounded-[12px] p-4",children:[t.jsx("p",{className:"font-bold text-slate-800 text-[13px] mb-2",children:c[0].payload.metric}),t.jsx("div",{className:"flex flex-col gap-1.5",children:c.map(m=>t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:m.stroke}}),t.jsx("span",{className:"text-[11px] font-semibold text-slate-600 truncate max-w-[120px]",children:String(m.name)})]}),t.jsxs("span",{className:"text-[13px] font-bold",style:{color:m.stroke},children:[Math.round(m.value),"%"]})]},m.name))})]}):null})]})})}),!s&&!h&&!e&&d.length>0&&t.jsx("div",{className:"flex flex-wrap justify-center items-center gap-3 mt-4 relative z-10",children:d.map(n=>t.jsxs("div",{className:"flex items-center gap-1.5 bg-slate-50 px-2.5 py-1 rounded-full border border-slate-100",children:[t.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:n.color}}),t.jsx("span",{className:"text-[10px] font-bold text-slate-600 uppercase tracking-wider",children:n.name.length>15?n.name.substring(0,12)+"...":n.name})]},n.id))})]})};export{ze as CompetencyRadarChart};
|
assets/{ConfirmModal-CtRcSVjb.js β ConfirmModal-Bjb3K2ht.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{j as e}from"./vendor-react-B4AQeu28.js";import{B as i}from"./button-
|
|
|
|
| 1 |
+
import{j as e}from"./vendor-react-B4AQeu28.js";import{B as i}from"./button-DVjn4LkC.js";import{h as u,m as r,x as f}from"./index-CGNBpSmO.js";import{X as y}from"./x-Deb9zs8O.js";import{T as j}from"./trash-2-BhQyV3WQ.js";import{L as w}from"./log-out-G6mObnLf.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-D7t7JfSr.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-markdown-yqZQ_iQm.js";const O=({isOpen:s,onClose:t,onConfirm:n,title:a,message:l,confirmText:c="Confirm",cancelText:d="Cancel",type:x="warning",icon:m="warning",zIndexClass:g="z-50"})=>{const b=()=>{switch(m){case"logout":return e.jsx(w,{size:32});case"delete":return e.jsx(j,{size:32});case"warning":default:return e.jsx(f,{size:32})}},o=(()=>{switch(x){case"danger":return{iconBg:"bg-red-100",iconColor:"text-red-600",buttonBg:"bg-red-600 hover:bg-red-700",buttonText:"text-white"};case"warning":return{iconBg:"bg-rose-100",iconColor:"text-rose-600",buttonBg:"bg-rose-600 hover:bg-rose-700",buttonText:"text-white"};case"info":default:return{iconBg:"bg-sky-100",iconColor:"text-sky-600",buttonBg:"bg-sky-600 hover:bg-sky-700",buttonText:"text-white"}}})(),p=async()=>{try{await n(),t()}catch{}};return e.jsx(u,{children:s&&e.jsx(e.Fragment,{children:e.jsx(r.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:t,className:`fixed inset-0 bg-black/50 backdrop-blur-sm ${g} flex items-center justify-center p-4`,children:e.jsxs(r.div,{initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:20},transition:{type:"spring",damping:25,stiffness:300},onClick:h=>h.stopPropagation(),className:"bg-[#f7f9fc] rounded-3xl shadow-2xl max-w-md w-full overflow-hidden border border-[#dde3eb]",children:[e.jsx("button",{onClick:t,className:"absolute top-4 right-4 p-2 text-slate-500 hover:text-[#0a1628] hover:bg-[#dde3eb] rounded-xl transition-colors z-10",children:e.jsx(y,{size:20})}),e.jsxs("div",{className:"p-8 text-center",children:[e.jsx(r.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.1,type:"spring",damping:15},className:`w-20 h-20 ${o.iconBg} rounded-full flex items-center justify-center mx-auto mb-6 ${o.iconColor}`,children:b()}),e.jsx("h2",{className:"text-2xl font-display font-bold text-[#0a1628] mb-3",children:a}),e.jsx("p",{className:"text-[#5a6578] mb-8 leading-relaxed",children:l}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(i,{onClick:t,variant:"outline",size:"lg",className:"flex-1 h-12 rounded-xl border-[#dde3eb] hover:border-[#d1cec6] hover:bg-[#edf1f7] font-bold",children:d}),e.jsx(i,{onClick:p,size:"lg",className:`flex-1 h-12 rounded-xl font-bold ${o.buttonBg} ${o.buttonText} transition-colors shadow-lg`,children:c})]})]})]})})})})};export{O as default};
|
assets/{DiagnosticBreakdown-Beq-2PZi.js β DiagnosticBreakdown--QQ0WiYU.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as i,j as e}from"./vendor-react-B4AQeu28.js";import{getDoc as y,doc as _}from"./vendor-firebase-firestore-CNv3xXal.js";import{g as k,v as Z,B as H,Z as J,x as C,T as W,q as S,m,h as Y}from"./index-dPnhhJ9w.js";import{X as G}from"./x-Ck4mo_h-.js";import{C as q}from"./clock-Dy5eVj9o.js";import{L as A,C as K}from"./lightbulb-RToQsqFn.js";import{C as T}from"./circle-check-BjsGkfB1.js";import{C as D}from"./chart-column-DtQRo3DE.js";import{a as O,C as V}from"./chevron-up-D9yeZehY.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-D7t7JfSr.js";import"./vendor-markdown-yqZQ_iQm.js";const ge=({userId:d,mode:h,isOpen:c=!0,onClose:p})=>{const[o,P]=i.useState([]),[B,$]=i.useState({}),[r,R]=i.useState({}),[a,E]=i.useState(null),[L,x]=i.useState(!0),[Q,j]=i.useState(!0),[g,z]=i.useState(null);i.useEffect(()=>{!d||!c||M()},[d,c]);const M=async()=>{x(!0);try{const s=await y(_(k,"diagnosticResults",d));if(!s.exists()){x(!1);return}const t=s.data(),U=t.responses||[];$(t.domainScores||{}),R(t.riskProfile||{});const N=t.testId;let v={};if(N){const l=await y(_(k,"diagnosticSessions",N));if(l.exists()){const X=l.data();for(const w of X.questions||[])v[w.question_id]=w.question_text}}P(U.map(l=>({...l,question_text:v[l.question_id]}))),x(!1),j(!0);try{const l=await Z("/api/diagnostic/analyze",{method:"POST",body:JSON.stringify({user_id:d})});l.success&&E(l.analysis)}catch(l){console.error("[DiagnosticBreakdown] AI analysis failed:",l)}finally{j(!1)}}catch(s){console.error("[DiagnosticBreakdown] Failed to load data:",s),x(!1),j(!1)}},b=o.filter(s=>s.is_correct).length,n=o.length,u=o.reduce((s,t)=>s+t.time_spent_seconds,0),F=n>0?Math.round(u/n):0,I=n>0?Math.round(b/n*100):0;if(!c)return null;const f=e.jsxs("div",{className:`${h==="fullscreen"?"min-h-screen bg-gradient-to-br from-slate-50 via-white to-indigo-50/30":""} flex flex-col`,children:[e.jsx("div",{className:"sticky top-0 z-10 bg-white/80 backdrop-blur-xl border-b border-slate-200/60 px-6 py-4",children:e.jsxs("div",{className:"max-w-6xl mx-auto flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-gradient-to-br from-indigo-500 to-purple-600 rounded-xl flex items-center justify-center shadow-lg shadow-indigo-200",children:e.jsx(H,{className:"w-5 h-5 text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-bold text-slate-900",children:"Diagnostic Assessment Breakdown"}),e.jsx("p",{className:"text-xs text-slate-500",children:"AI-powered analysis of your performance"})]})]}),e.jsx("button",{onClick:p,className:"p-2 hover:bg-slate-100 rounded-xl transition-colors",title:"Close",children:e.jsx(G,{className:"w-5 h-5 text-slate-500"})})]})}),e.jsx("div",{className:"max-w-6xl mx-auto w-full px-6 py-8 space-y-8",children:L?e.jsx("div",{className:"space-y-4",children:[1,2,3].map(s=>e.jsx("div",{className:"h-32 bg-slate-100 rounded-2xl animate-pulse"},s))}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"bg-gradient-to-br from-indigo-500 to-purple-600 rounded-2xl p-5 text-white shadow-lg shadow-indigo-200/50",children:[e.jsx("p",{className:"text-indigo-200 text-xs font-medium uppercase",children:"Score"}),e.jsxs("p",{className:"text-3xl font-black mt-1",children:[I,"%"]}),e.jsxs("p",{className:"text-indigo-200 text-sm",children:[b,"/",n," correct"]})]}),e.jsxs("div",{className:"bg-white rounded-2xl p-5 border border-slate-100 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 text-slate-500 mb-1",children:[e.jsx(q,{className:"w-4 h-4"})," ",e.jsx("span",{className:"text-xs font-medium uppercase",children:"Avg Time"})]}),e.jsxs("p",{className:"text-2xl font-bold text-slate-800",children:[F,"s"]}),e.jsx("p",{className:"text-xs text-slate-400",children:"per question"})]}),e.jsxs("div",{className:"bg-white rounded-2xl p-5 border border-slate-100 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 text-slate-500 mb-1",children:[e.jsx(J,{className:"w-4 h-4"})," ",e.jsx("span",{className:"text-xs font-medium uppercase",children:"Total Time"})]}),e.jsxs("p",{className:"text-2xl font-bold text-slate-800",children:[Math.floor(u/60),"m ",u%60,"s"]}),e.jsx("p",{className:"text-xs text-slate-400",children:"assessment duration"})]}),e.jsxs("div",{className:"bg-white rounded-2xl p-5 border border-slate-100 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 text-slate-500 mb-1",children:[e.jsx(C,{className:"w-4 h-4"})," ",e.jsx("span",{className:"text-xs font-medium uppercase",children:"Risk"})]}),e.jsx("p",{className:`text-2xl font-bold ${r.overall_risk==="high"||r.overall_risk==="critical"?"text-red-600":r.overall_risk==="moderate"?"text-amber-600":"text-emerald-600"}`,children:(r.overall_risk||"unknown").charAt(0).toUpperCase()+(r.overall_risk||"unknown").slice(1)}),e.jsx("p",{className:"text-xs text-slate-400",children:"risk level"})]})]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-slate-100 shadow-sm overflow-hidden",children:[e.jsx("div",{className:"px-6 py-4 border-b border-slate-100 bg-gradient-to-r from-amber-50 to-orange-50",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(A,{className:"w-5 h-5 text-amber-500"}),e.jsx("h2",{className:"font-bold text-slate-800",children:"AI Analysis"})]})}),e.jsx("div",{className:"p-6",children:Q?e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"h-4 bg-slate-100 rounded animate-pulse w-3/4"}),e.jsx("div",{className:"h-4 bg-slate-100 rounded animate-pulse w-1/2"}),e.jsx("div",{className:"h-4 bg-slate-100 rounded animate-pulse w-5/6"})]}):a?e.jsxs("div",{className:"space-y-6",children:[e.jsx("p",{className:"text-slate-700 leading-relaxed",children:a.overall_summary}),e.jsxs("div",{className:"bg-sky-50 border border-sky-100 rounded-xl p-4",children:[e.jsxs("h3",{className:"font-semibold text-sky-800 text-sm mb-2 flex items-center gap-2",children:[e.jsx(q,{className:"w-4 h-4"})," Timing Patterns"]}),e.jsx("p",{className:"text-sm text-sky-700",children:a.time_analysis.insight}),a.time_analysis.slow_questions.length>0&&e.jsxs("p",{className:"text-xs text-sky-600 mt-2",children:[e.jsx("span",{className:"font-medium",children:"Took longest on:"})," ",a.time_analysis.slow_questions.join(", ")]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.strength_areas.length>0&&e.jsxs("div",{className:"border border-emerald-100 bg-emerald-50/50 rounded-xl p-4",children:[e.jsxs("h3",{className:"font-semibold text-emerald-800 text-sm mb-3 flex items-center gap-2",children:[e.jsx(W,{className:"w-4 h-4"})," Strengths"]}),e.jsx("ul",{className:"space-y-2",children:a.strength_areas.map((s,t)=>e.jsxs("li",{className:"text-sm text-emerald-700 flex items-start gap-2",children:[e.jsx(T,{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsxs("strong",{children:[s.domain,":"]})," ",s.detail]})]},t))})]}),a.weakness_areas.length>0&&e.jsxs("div",{className:"border border-red-100 bg-red-50/50 rounded-xl p-4",children:[e.jsxs("h3",{className:"font-semibold text-red-800 text-sm mb-3 flex items-center gap-2",children:[e.jsx(S,{className:"w-4 h-4"})," Weak Areas"]}),e.jsx("ul",{className:"space-y-2",children:a.weakness_areas.map((s,t)=>e.jsxs("li",{className:"text-sm text-red-700 flex items-start gap-2",children:[e.jsx(C,{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsxs("strong",{children:[s.domain,":"]})," ",s.detail]})]},t))})]})]}),a.answer_patterns.common_mistakes.length>0&&e.jsxs("div",{className:"bg-amber-50 border border-amber-100 rounded-xl p-4",children:[e.jsx("h3",{className:"font-semibold text-amber-800 text-sm mb-2",children:"Answer Patterns"}),e.jsx("p",{className:"text-sm text-amber-700 mb-2",children:a.answer_patterns.description}),e.jsx("ul",{className:"space-y-1",children:a.answer_patterns.common_mistakes.map((s,t)=>e.jsxs("li",{className:"text-xs text-amber-600",children:["β’ ",s]},t))})]}),a.recommendations.length>0&&e.jsxs("div",{className:"bg-indigo-50 border border-indigo-100 rounded-xl p-4",children:[e.jsxs("h3",{className:"font-semibold text-indigo-800 text-sm mb-3 flex items-center gap-2",children:[e.jsx(A,{className:"w-4 h-4"})," Recommendations"]}),e.jsx("ol",{className:"space-y-2",children:a.recommendations.map((s,t)=>e.jsxs("li",{className:"text-sm text-indigo-700",children:[e.jsxs("span",{className:"font-medium",children:[t+1,". ",s.action]}),e.jsxs("span",{className:"text-indigo-500 text-xs ml-2",children:["β ",s.reason]})]},t))})]}),e.jsxs("div",{className:"bg-slate-50 border border-slate-100 rounded-xl p-4",children:[e.jsxs("h3",{className:"font-semibold text-slate-800 text-sm mb-3 flex items-center gap-2",children:[e.jsx(D,{className:"w-4 h-4"})," Performance by Difficulty"]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xs text-slate-500 uppercase font-medium",children:"Easy"}),e.jsx("p",{className:"text-sm font-bold text-slate-700 mt-1",children:a.difficulty_analysis.easy_performance})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xs text-slate-500 uppercase font-medium",children:"Medium"}),e.jsx("p",{className:"text-sm font-bold text-slate-700 mt-1",children:a.difficulty_analysis.medium_performance})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xs text-slate-500 uppercase font-medium",children:"Hard"}),e.jsx("p",{className:"text-sm font-bold text-slate-700 mt-1",children:a.difficulty_analysis.hard_performance})]})]})]})]}):e.jsx("p",{className:"text-slate-500 text-sm",children:"Analysis unavailable."})})]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-slate-100 shadow-sm overflow-hidden",children:[e.jsx("div",{className:"px-6 py-4 border-b border-slate-100",children:e.jsxs("h2",{className:"font-bold text-slate-800 flex items-center gap-2",children:[e.jsx(D,{className:"w-5 h-5 text-indigo-500"})," Domain Scores"]})}),e.jsx("div",{className:"p-6 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:Object.entries(B).map(([s,t])=>e.jsxs("div",{className:"border border-slate-100 rounded-xl p-4",children:[e.jsx("p",{className:"text-sm font-semibold text-slate-700 mb-2",children:s}),e.jsxs("div",{className:"flex items-end gap-2",children:[e.jsxs("span",{className:"text-2xl font-black text-slate-800",children:[t.percentage,"%"]}),e.jsxs("span",{className:"text-xs text-slate-400 mb-1",children:[t.correct,"/",t.total]})]}),e.jsx("div",{className:"mt-2 h-2 bg-slate-100 rounded-full overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full transition-all ${t.percentage>=80?"bg-emerald-500":t.percentage>=60?"bg-amber-500":"bg-red-500"}`,style:{width:`${t.percentage}%`}})}),e.jsx("p",{className:`text-xs mt-1 font-medium ${t.mastery_level==="mastered"?"text-emerald-600":t.mastery_level==="developing"?"text-amber-600":"text-red-600"}`,children:t.mastery_level})]},s))})]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-slate-100 shadow-sm overflow-hidden",children:[e.jsx("div",{className:"px-6 py-4 border-b border-slate-100",children:e.jsxs("h2",{className:"font-bold text-slate-800 flex items-center gap-2",children:[e.jsx(S,{className:"w-5 h-5 text-indigo-500"})," Question-by-Question Breakdown"]})}),e.jsx("div",{className:"divide-y divide-slate-50",children:o.map((s,t)=>e.jsxs("div",{className:"px-6 py-3 hover:bg-slate-50/50 transition-colors",children:[e.jsxs("button",{onClick:()=>z(g===t?null:t),className:"w-full flex items-center gap-3 text-left",children:[e.jsx("div",{className:`w-7 h-7 rounded-full flex items-center justify-center flex-shrink-0 ${s.is_correct?"bg-emerald-100 text-emerald-600":"bg-red-100 text-red-600"}`,children:s.is_correct?e.jsx(T,{className:"w-4 h-4"}):e.jsx(K,{className:"w-4 h-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-sm font-medium text-slate-700 truncate",children:["Q",t+1,". ",s.question_text||`${s.topic} (${s.domain})`]}),e.jsxs("div",{className:"flex items-center gap-3 mt-0.5",children:[e.jsx("span",{className:"text-xs text-slate-400",children:s.difficulty}),e.jsxs("span",{className:"text-xs text-slate-400",children:[s.time_spent_seconds,"s"]}),e.jsx("span",{className:"text-xs text-slate-400",children:s.domain})]})]}),g===t?e.jsx(O,{className:"w-4 h-4 text-slate-400"}):e.jsx(V,{className:"w-4 h-4 text-slate-400"})]}),g===t&&e.jsxs(m.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"ml-10 mt-2 pb-2 space-y-2",children:[s.question_text&&e.jsx("p",{className:"text-sm text-slate-600",children:s.question_text}),e.jsxs("div",{className:"flex flex-wrap gap-4 text-xs",children:[e.jsxs("span",{className:s.is_correct?"text-emerald-600":"text-red-600",children:["Your answer: ",e.jsx("strong",{children:s.student_answer||"β"})]}),!s.is_correct&&e.jsxs("span",{className:"text-emerald-600",children:["Correct: ",e.jsx("strong",{children:s.correct_answer})]}),e.jsxs("span",{className:"text-slate-500",children:["Time: ",s.time_spent_seconds,"s"]}),e.jsxs("span",{className:"text-slate-500",children:["Bloom: ",s.bloom_level]})]})]})]},t))})]}),e.jsx("div",{className:"flex justify-center pb-8",children:e.jsx("button",{onClick:p,className:"px-8 py-3 bg-indigo-600 hover:bg-indigo-700 text-white font-bold rounded-xl shadow-lg shadow-indigo-200 transition-all",children:h==="fullscreen"?"Continue to Dashboard":"Close"})})]})})]});return h==="modal"?e.jsx(Y,{children:c&&e.jsx(m.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm flex items-center justify-center p-4",onClick:p,children:e.jsx(m.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-white rounded-2xl shadow-2xl w-full max-w-5xl max-h-[90vh] overflow-y-auto",onClick:s=>s.stopPropagation(),children:f})})}):e.jsx(m.div,{initial:{opacity:0},animate:{opacity:1},className:"fixed inset-0 z-50 overflow-y-auto bg-gradient-to-br from-slate-50 via-white to-indigo-50/30",children:f})};export{ge as default};
|
|
|
|
| 1 |
+
import{r as i,j as e}from"./vendor-react-B4AQeu28.js";import{getDoc as y,doc as _}from"./vendor-firebase-firestore-CNv3xXal.js";import{g as k,v as Z,B as H,Z as J,x as C,T as W,q as S,m,h as Y}from"./index-CGNBpSmO.js";import{X as G}from"./x-Deb9zs8O.js";import{C as q}from"./clock-D2bky9WI.js";import{L as A,C as K}from"./lightbulb-CrdekHc8.js";import{C as T}from"./circle-check-BhLH88x1.js";import{C as D}from"./chart-column-g5DztEPT.js";import{a as O,C as V}from"./chevron-up-B59xV3SY.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-D7t7JfSr.js";import"./vendor-markdown-yqZQ_iQm.js";const ge=({userId:d,mode:h,isOpen:c=!0,onClose:p})=>{const[o,P]=i.useState([]),[B,$]=i.useState({}),[r,R]=i.useState({}),[a,E]=i.useState(null),[L,x]=i.useState(!0),[Q,j]=i.useState(!0),[g,z]=i.useState(null);i.useEffect(()=>{!d||!c||M()},[d,c]);const M=async()=>{x(!0);try{const s=await y(_(k,"diagnosticResults",d));if(!s.exists()){x(!1);return}const t=s.data(),U=t.responses||[];$(t.domainScores||{}),R(t.riskProfile||{});const N=t.testId;let v={};if(N){const l=await y(_(k,"diagnosticSessions",N));if(l.exists()){const X=l.data();for(const w of X.questions||[])v[w.question_id]=w.question_text}}P(U.map(l=>({...l,question_text:v[l.question_id]}))),x(!1),j(!0);try{const l=await Z("/api/diagnostic/analyze",{method:"POST",body:JSON.stringify({user_id:d})});l.success&&E(l.analysis)}catch(l){console.error("[DiagnosticBreakdown] AI analysis failed:",l)}finally{j(!1)}}catch(s){console.error("[DiagnosticBreakdown] Failed to load data:",s),x(!1),j(!1)}},b=o.filter(s=>s.is_correct).length,n=o.length,u=o.reduce((s,t)=>s+t.time_spent_seconds,0),F=n>0?Math.round(u/n):0,I=n>0?Math.round(b/n*100):0;if(!c)return null;const f=e.jsxs("div",{className:`${h==="fullscreen"?"min-h-screen bg-gradient-to-br from-slate-50 via-white to-indigo-50/30":""} flex flex-col`,children:[e.jsx("div",{className:"sticky top-0 z-10 bg-white/80 backdrop-blur-xl border-b border-slate-200/60 px-6 py-4",children:e.jsxs("div",{className:"max-w-6xl mx-auto flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-gradient-to-br from-indigo-500 to-purple-600 rounded-xl flex items-center justify-center shadow-lg shadow-indigo-200",children:e.jsx(H,{className:"w-5 h-5 text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-bold text-slate-900",children:"Diagnostic Assessment Breakdown"}),e.jsx("p",{className:"text-xs text-slate-500",children:"AI-powered analysis of your performance"})]})]}),e.jsx("button",{onClick:p,className:"p-2 hover:bg-slate-100 rounded-xl transition-colors",title:"Close",children:e.jsx(G,{className:"w-5 h-5 text-slate-500"})})]})}),e.jsx("div",{className:"max-w-6xl mx-auto w-full px-6 py-8 space-y-8",children:L?e.jsx("div",{className:"space-y-4",children:[1,2,3].map(s=>e.jsx("div",{className:"h-32 bg-slate-100 rounded-2xl animate-pulse"},s))}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"bg-gradient-to-br from-indigo-500 to-purple-600 rounded-2xl p-5 text-white shadow-lg shadow-indigo-200/50",children:[e.jsx("p",{className:"text-indigo-200 text-xs font-medium uppercase",children:"Score"}),e.jsxs("p",{className:"text-3xl font-black mt-1",children:[I,"%"]}),e.jsxs("p",{className:"text-indigo-200 text-sm",children:[b,"/",n," correct"]})]}),e.jsxs("div",{className:"bg-white rounded-2xl p-5 border border-slate-100 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 text-slate-500 mb-1",children:[e.jsx(q,{className:"w-4 h-4"})," ",e.jsx("span",{className:"text-xs font-medium uppercase",children:"Avg Time"})]}),e.jsxs("p",{className:"text-2xl font-bold text-slate-800",children:[F,"s"]}),e.jsx("p",{className:"text-xs text-slate-400",children:"per question"})]}),e.jsxs("div",{className:"bg-white rounded-2xl p-5 border border-slate-100 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 text-slate-500 mb-1",children:[e.jsx(J,{className:"w-4 h-4"})," ",e.jsx("span",{className:"text-xs font-medium uppercase",children:"Total Time"})]}),e.jsxs("p",{className:"text-2xl font-bold text-slate-800",children:[Math.floor(u/60),"m ",u%60,"s"]}),e.jsx("p",{className:"text-xs text-slate-400",children:"assessment duration"})]}),e.jsxs("div",{className:"bg-white rounded-2xl p-5 border border-slate-100 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 text-slate-500 mb-1",children:[e.jsx(C,{className:"w-4 h-4"})," ",e.jsx("span",{className:"text-xs font-medium uppercase",children:"Risk"})]}),e.jsx("p",{className:`text-2xl font-bold ${r.overall_risk==="high"||r.overall_risk==="critical"?"text-red-600":r.overall_risk==="moderate"?"text-amber-600":"text-emerald-600"}`,children:(r.overall_risk||"unknown").charAt(0).toUpperCase()+(r.overall_risk||"unknown").slice(1)}),e.jsx("p",{className:"text-xs text-slate-400",children:"risk level"})]})]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-slate-100 shadow-sm overflow-hidden",children:[e.jsx("div",{className:"px-6 py-4 border-b border-slate-100 bg-gradient-to-r from-amber-50 to-orange-50",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(A,{className:"w-5 h-5 text-amber-500"}),e.jsx("h2",{className:"font-bold text-slate-800",children:"AI Analysis"})]})}),e.jsx("div",{className:"p-6",children:Q?e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"h-4 bg-slate-100 rounded animate-pulse w-3/4"}),e.jsx("div",{className:"h-4 bg-slate-100 rounded animate-pulse w-1/2"}),e.jsx("div",{className:"h-4 bg-slate-100 rounded animate-pulse w-5/6"})]}):a?e.jsxs("div",{className:"space-y-6",children:[e.jsx("p",{className:"text-slate-700 leading-relaxed",children:a.overall_summary}),e.jsxs("div",{className:"bg-sky-50 border border-sky-100 rounded-xl p-4",children:[e.jsxs("h3",{className:"font-semibold text-sky-800 text-sm mb-2 flex items-center gap-2",children:[e.jsx(q,{className:"w-4 h-4"})," Timing Patterns"]}),e.jsx("p",{className:"text-sm text-sky-700",children:a.time_analysis.insight}),a.time_analysis.slow_questions.length>0&&e.jsxs("p",{className:"text-xs text-sky-600 mt-2",children:[e.jsx("span",{className:"font-medium",children:"Took longest on:"})," ",a.time_analysis.slow_questions.join(", ")]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.strength_areas.length>0&&e.jsxs("div",{className:"border border-emerald-100 bg-emerald-50/50 rounded-xl p-4",children:[e.jsxs("h3",{className:"font-semibold text-emerald-800 text-sm mb-3 flex items-center gap-2",children:[e.jsx(W,{className:"w-4 h-4"})," Strengths"]}),e.jsx("ul",{className:"space-y-2",children:a.strength_areas.map((s,t)=>e.jsxs("li",{className:"text-sm text-emerald-700 flex items-start gap-2",children:[e.jsx(T,{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsxs("strong",{children:[s.domain,":"]})," ",s.detail]})]},t))})]}),a.weakness_areas.length>0&&e.jsxs("div",{className:"border border-red-100 bg-red-50/50 rounded-xl p-4",children:[e.jsxs("h3",{className:"font-semibold text-red-800 text-sm mb-3 flex items-center gap-2",children:[e.jsx(S,{className:"w-4 h-4"})," Weak Areas"]}),e.jsx("ul",{className:"space-y-2",children:a.weakness_areas.map((s,t)=>e.jsxs("li",{className:"text-sm text-red-700 flex items-start gap-2",children:[e.jsx(C,{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsxs("strong",{children:[s.domain,":"]})," ",s.detail]})]},t))})]})]}),a.answer_patterns.common_mistakes.length>0&&e.jsxs("div",{className:"bg-amber-50 border border-amber-100 rounded-xl p-4",children:[e.jsx("h3",{className:"font-semibold text-amber-800 text-sm mb-2",children:"Answer Patterns"}),e.jsx("p",{className:"text-sm text-amber-700 mb-2",children:a.answer_patterns.description}),e.jsx("ul",{className:"space-y-1",children:a.answer_patterns.common_mistakes.map((s,t)=>e.jsxs("li",{className:"text-xs text-amber-600",children:["β’ ",s]},t))})]}),a.recommendations.length>0&&e.jsxs("div",{className:"bg-indigo-50 border border-indigo-100 rounded-xl p-4",children:[e.jsxs("h3",{className:"font-semibold text-indigo-800 text-sm mb-3 flex items-center gap-2",children:[e.jsx(A,{className:"w-4 h-4"})," Recommendations"]}),e.jsx("ol",{className:"space-y-2",children:a.recommendations.map((s,t)=>e.jsxs("li",{className:"text-sm text-indigo-700",children:[e.jsxs("span",{className:"font-medium",children:[t+1,". ",s.action]}),e.jsxs("span",{className:"text-indigo-500 text-xs ml-2",children:["β ",s.reason]})]},t))})]}),e.jsxs("div",{className:"bg-slate-50 border border-slate-100 rounded-xl p-4",children:[e.jsxs("h3",{className:"font-semibold text-slate-800 text-sm mb-3 flex items-center gap-2",children:[e.jsx(D,{className:"w-4 h-4"})," Performance by Difficulty"]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xs text-slate-500 uppercase font-medium",children:"Easy"}),e.jsx("p",{className:"text-sm font-bold text-slate-700 mt-1",children:a.difficulty_analysis.easy_performance})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xs text-slate-500 uppercase font-medium",children:"Medium"}),e.jsx("p",{className:"text-sm font-bold text-slate-700 mt-1",children:a.difficulty_analysis.medium_performance})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xs text-slate-500 uppercase font-medium",children:"Hard"}),e.jsx("p",{className:"text-sm font-bold text-slate-700 mt-1",children:a.difficulty_analysis.hard_performance})]})]})]})]}):e.jsx("p",{className:"text-slate-500 text-sm",children:"Analysis unavailable."})})]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-slate-100 shadow-sm overflow-hidden",children:[e.jsx("div",{className:"px-6 py-4 border-b border-slate-100",children:e.jsxs("h2",{className:"font-bold text-slate-800 flex items-center gap-2",children:[e.jsx(D,{className:"w-5 h-5 text-indigo-500"})," Domain Scores"]})}),e.jsx("div",{className:"p-6 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:Object.entries(B).map(([s,t])=>e.jsxs("div",{className:"border border-slate-100 rounded-xl p-4",children:[e.jsx("p",{className:"text-sm font-semibold text-slate-700 mb-2",children:s}),e.jsxs("div",{className:"flex items-end gap-2",children:[e.jsxs("span",{className:"text-2xl font-black text-slate-800",children:[t.percentage,"%"]}),e.jsxs("span",{className:"text-xs text-slate-400 mb-1",children:[t.correct,"/",t.total]})]}),e.jsx("div",{className:"mt-2 h-2 bg-slate-100 rounded-full overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full transition-all ${t.percentage>=80?"bg-emerald-500":t.percentage>=60?"bg-amber-500":"bg-red-500"}`,style:{width:`${t.percentage}%`}})}),e.jsx("p",{className:`text-xs mt-1 font-medium ${t.mastery_level==="mastered"?"text-emerald-600":t.mastery_level==="developing"?"text-amber-600":"text-red-600"}`,children:t.mastery_level})]},s))})]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-slate-100 shadow-sm overflow-hidden",children:[e.jsx("div",{className:"px-6 py-4 border-b border-slate-100",children:e.jsxs("h2",{className:"font-bold text-slate-800 flex items-center gap-2",children:[e.jsx(S,{className:"w-5 h-5 text-indigo-500"})," Question-by-Question Breakdown"]})}),e.jsx("div",{className:"divide-y divide-slate-50",children:o.map((s,t)=>e.jsxs("div",{className:"px-6 py-3 hover:bg-slate-50/50 transition-colors",children:[e.jsxs("button",{onClick:()=>z(g===t?null:t),className:"w-full flex items-center gap-3 text-left",children:[e.jsx("div",{className:`w-7 h-7 rounded-full flex items-center justify-center flex-shrink-0 ${s.is_correct?"bg-emerald-100 text-emerald-600":"bg-red-100 text-red-600"}`,children:s.is_correct?e.jsx(T,{className:"w-4 h-4"}):e.jsx(K,{className:"w-4 h-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-sm font-medium text-slate-700 truncate",children:["Q",t+1,". ",s.question_text||`${s.topic} (${s.domain})`]}),e.jsxs("div",{className:"flex items-center gap-3 mt-0.5",children:[e.jsx("span",{className:"text-xs text-slate-400",children:s.difficulty}),e.jsxs("span",{className:"text-xs text-slate-400",children:[s.time_spent_seconds,"s"]}),e.jsx("span",{className:"text-xs text-slate-400",children:s.domain})]})]}),g===t?e.jsx(O,{className:"w-4 h-4 text-slate-400"}):e.jsx(V,{className:"w-4 h-4 text-slate-400"})]}),g===t&&e.jsxs(m.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"ml-10 mt-2 pb-2 space-y-2",children:[s.question_text&&e.jsx("p",{className:"text-sm text-slate-600",children:s.question_text}),e.jsxs("div",{className:"flex flex-wrap gap-4 text-xs",children:[e.jsxs("span",{className:s.is_correct?"text-emerald-600":"text-red-600",children:["Your answer: ",e.jsx("strong",{children:s.student_answer||"β"})]}),!s.is_correct&&e.jsxs("span",{className:"text-emerald-600",children:["Correct: ",e.jsx("strong",{children:s.correct_answer})]}),e.jsxs("span",{className:"text-slate-500",children:["Time: ",s.time_spent_seconds,"s"]}),e.jsxs("span",{className:"text-slate-500",children:["Bloom: ",s.bloom_level]})]})]})]},t))})]}),e.jsx("div",{className:"flex justify-center pb-8",children:e.jsx("button",{onClick:p,className:"px-8 py-3 bg-indigo-600 hover:bg-indigo-700 text-white font-bold rounded-xl shadow-lg shadow-indigo-200 transition-all",children:h==="fullscreen"?"Continue to Dashboard":"Close"})})]})})]});return h==="modal"?e.jsx(Y,{children:c&&e.jsx(m.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm flex items-center justify-center p-4",onClick:p,children:e.jsx(m.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-white rounded-2xl shadow-2xl w-full max-w-5xl max-h-[90vh] overflow-y-auto",onClick:s=>s.stopPropagation(),children:f})})}):e.jsx(m.div,{initial:{opacity:0},animate:{opacity:1},className:"fixed inset-0 z-50 overflow-y-auto bg-gradient-to-br from-slate-50 via-white to-indigo-50/30",children:f})};export{ge as default};
|
assets/{FloatingAITutor-CSkan2Lo.js β FloatingAITutor-BkfkayUl.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ChatMarkdown-
|
| 2 |
-
import{aE as C,_ as y,m as b,I as A}from"./index-
|
|
|
|
| 1 |
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ChatMarkdown-BAxWaDZo.js","assets/index-CGNBpSmO.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-BPuEd8FG.js","assets/vendor-charts-D7t7JfSr.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-CEL3Ax6X.css"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{aE as C,_ as y,m as b,I as A}from"./index-CGNBpSmO.js";import{r as i,j as e}from"./vendor-react-B4AQeu28.js";import{M}from"./maximize-2-CwlOKVNo.js";import{M as w}from"./minus-DV5fnWn8.js";import{X as g}from"./x-Deb9zs8O.js";import{S as L}from"./send-DnRgK3MX.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-D7t7JfSr.js";import"./vendor-markdown-yqZQ_iQm.js";const E=i.lazy(()=>y(()=>import("./ChatMarkdown-BAxWaDZo.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])));function O(a){return a?a instanceof Date?a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):typeof a=="object"&&"toDate"in a?a.toDate().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):String(a):""}const Q=({constraintsRef:a,onFullScreen:j})=>{const{activeSessionId:r,setActiveSessionId:v,createNewSession:N,getActiveSession:k,sendMessage:I,isLoading:o}=C(),[s,l]=i.useState(!1),[c,u]=i.useState(()=>typeof window>"u"?!1:window.localStorage.getItem("floating_ai_tutor_minimized")==="1"),[n,m]=i.useState(""),h=i.useRef(null);i.useEffect(()=>{typeof window>"u"||window.localStorage.setItem("floating_ai_tutor_minimized",c?"1":"0")},[c]),i.useEffect(()=>{s&&y(async()=>{const{warmupBackend:t}=await import("./index-CGNBpSmO.js").then(d=>d.b6);return{warmupBackend:t}},__vite__mapDeps([1,2,3,4,5,6,7,8,9,10,11,12])).then(({warmupBackend:t})=>{t()}).catch(t=>{console.warn("Floating tutor warmup skipped:",t)})},[s]),i.useEffect(()=>{if(s&&!r){const t={id:"1",sender:"ai",text:"Hi! I'm your AI math tutor. What would you like to learn about today?",timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})},d=N(t);v(d)}},[s]);const x=k()?.messages||[],S=()=>{h.current?.scrollIntoView({behavior:"smooth"})};i.useEffect(()=>{S()},[x]);const p=async()=>{if(!n.trim()||!r||o)return;const t=n.trim();m(""),await I(r,t)},_=()=>{j()},f=()=>{l(!1),u(!0)},z=()=>{u(!1)};return e.jsxs("div",{className:"pointer-events-none flex flex-col items-end",children:[e.jsxs("div",{className:`pointer-events-auto mb-4 w-80 bg-[#f7f9fc] rounded-3xl shadow-2xl border border-[#dde3eb] flex flex-col overflow-hidden transition-all duration-300 origin-bottom-right select-none ${s?"opacity-100 scale-100 translate-y-0":"opacity-0 scale-95 translate-y-10 pointer-events-none h-0"}`,style:{"--max-h":s?"32rem":"0",willChange:"transform, opacity"},children:[e.jsxs("div",{className:"bg-gradient-to-r from-sky-600 to-sky-500 p-4 flex items-center justify-between flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-white/20 rounded-xl flex items-center justify-center backdrop-blur-sm",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-9 h-9 object-contain drop-shadow-md"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-bold text-sm",children:"L.O.L.I."}),e.jsxs("p",{className:"text-sky-100 text-[10px] leading-tight",children:["Logical Operations &",e.jsx("br",{}),"Learning Intelligence"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:_,type:"button","aria-label":"Open fullscreen",className:"p-2 hover:bg-white/20 rounded-lg transition-colors",title:"Open fullscreen",children:e.jsx(M,{size:16,className:"text-white"})}),e.jsx("button",{type:"button","aria-label":"Minimize AI tutor launcher",onClick:f,className:"p-2 hover:bg-white/20 rounded-lg transition-colors",title:"Minimize",children:e.jsx(w,{size:16,className:"text-white"})}),e.jsx("button",{type:"button","aria-label":"Close chat",onClick:()=>l(!1),className:"p-2 hover:bg-white/20 rounded-lg transition-colors",children:e.jsx(g,{size:16,className:"text-white"})})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-3 bg-[#edf1f7]",children:[x.map(t=>e.jsx("div",{className:`flex ${t.sender==="user"?"justify-end":"justify-start"}`,children:e.jsxs("div",{className:`max-w-[75%] rounded-2xl px-4 py-2.5 ${t.sender==="user"?"bg-sky-600 text-white":"bg-white text-[#0a1628] shadow-sm border border-[#dde3eb]"}`,children:[t.sender==="user"?e.jsx("p",{className:"text-sm whitespace-pre-wrap",children:t.text}):e.jsx(i.Suspense,{fallback:e.jsx("p",{className:"text-sm whitespace-pre-wrap",children:t.text}),children:e.jsx(E,{children:t.text})}),e.jsx("p",{className:`text-[10px] mt-1 ${t.sender==="user"?"text-sky-200":"text-slate-500"}`,children:O(t.timestamp)})]})},t.id)),o&&e.jsx("div",{className:"flex justify-start",children:e.jsx("div",{className:"bg-white text-[#0a1628] shadow-sm border border-[#dde3eb] rounded-2xl px-4 py-2.5 max-w-[75%]",children:e.jsxs("div",{className:"flex gap-1",children:[e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:150ms]"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:300ms]"})]})})}),e.jsx("div",{ref:h})]}),e.jsx("div",{className:"p-4 border-t border-[#dde3eb] bg-white flex-shrink-0",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{id:"ai-tutor-input",name:"ai-tutor-input","aria-label":"Ask AI tutor a question",type:"text",value:n,onChange:t=>m(t.target.value),onKeyPress:t=>t.key==="Enter"&&p(),placeholder:"Ask me anything...",className:"flex-1 px-4 py-2.5 rounded-xl border border-[#dde3eb] focus:outline-none focus:ring-2 focus:ring-sky-500 text-sm bg-[#f7f9fc]"}),e.jsx("button",{type:"button","aria-label":"Send message",onClick:p,className:"p-2.5 bg-sky-600 hover:bg-sky-700 text-white rounded-xl transition-colors disabled:opacity-50 disabled:cursor-not-allowed",disabled:!n.trim()||o,children:e.jsx(L,{size:18})})]})})]}),e.jsx("div",{className:"pointer-events-auto relative self-end",children:c?e.jsx(b.button,{type:"button",onClick:z,whileHover:{scale:1.08},whileTap:{scale:.95},transition:{duration:.15,ease:"easeOut"},className:"h-9 w-9 rounded-full bg-slate-900/85 text-white shadow-lg ring-1 ring-white/20 backdrop-blur-sm flex items-center justify-center","aria-label":"Restore AI tutor launcher",title:"Show AI tutor",style:{willChange:"transform"},children:e.jsx(A,{size:14})}):e.jsxs("div",{className:"relative group",children:[!s&&e.jsxs("div",{className:"absolute right-full mr-4 top-1/2 -translate-y-1/2 px-4 py-2 bg-slate-800 text-white text-sm rounded-xl opacity-0 group-hover:opacity-100 transition-opacity duration-300 pointer-events-none whitespace-nowrap shadow-xl z-50",children:["Hello! I'm L.O.L.I., how may I help you?",e.jsx("div",{className:"absolute top-1/2 -translate-y-1/2 -right-1 w-3 h-3 bg-slate-800 rotate-45"})]}),!s&&e.jsx("button",{type:"button","aria-label":"Minimize AI tutor launcher",title:"Minimize",onClick:f,className:"absolute -top-2 -left-2 z-10 h-6 w-6 rounded-full bg-white text-slate-700 border border-slate-200 shadow-md hover:bg-slate-100 transition-colors flex items-center justify-center",children:e.jsx(w,{size:12})}),e.jsx(b.button,{type:"button",onClick:()=>l(!s),whileHover:{scale:1.1},whileTap:{scale:.9},transition:{duration:.15,ease:"easeOut"},className:"w-16 h-16 bg-gradient-to-br from-sky-600 to-sky-500 rounded-xl shadow-2xl flex items-center justify-center text-white hover:shadow-sky-300/50 transition-all","aria-label":s?"Close AI tutor chat":"Open AI tutor chat",style:{willChange:"transform"},children:s?e.jsx(g,{size:28}):e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-14 h-14 object-contain drop-shadow-lg"})})]})})]})};export{Q as default};
|
assets/{GradesPage-eugSRvtq.js β GradesPage-eBdPESCo.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DiagnosticBreakdown-
|
| 2 |
-
import{u as se,aF as te,aG as ae,g as P,F as re,A as le,q as M,T as $,B as ne,_ as oe}from"./index-
|
| 3 |
`),w=new Blob([j],{type:"text/csv;charset=utf-8;"}),u=window.URL.createObjectURL(w),m=document.createElement("a"),ee=a.replace(/[^a-z0-9]+/gi,"-").replace(/^-+|-+$/g,"").toLowerCase()||"student";m.href=u,m.setAttribute("download",`grade-report-${ee}-${i}.csv`),document.body.appendChild(m),m.click(),document.body.removeChild(m),window.URL.revokeObjectURL(u)};return I?e.jsx("div",{className:"p-8 flex justify-center items-center h-full",children:e.jsx("div",{className:"w-10 h-10 border-4 border-indigo-500 border-t-transparent rounded-full animate-spin"})}):e.jsxs("div",{className:"p-4 sm:p-6 lg:p-8 space-y-6 lg:space-y-8 max-w-7xl mx-auto",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 bg-white p-5 sm:p-6 rounded-[1.5rem] sm:rounded-[2rem] shadow-[0_8px_30px_-12px_rgba(0,0,0,0.06)] border border-slate-50",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-display font-black text-slate-800 tracking-tight",children:"Assessment"}),e.jsx("p",{className:"text-slate-400 font-bold mt-1 text-[13px]",children:"Review your performance across subjects"})]}),e.jsxs("div",{className:"flex gap-3 w-full sm:w-auto",children:[e.jsxs(N,{variant:"outline",className:"flex-1 sm:flex-none border-slate-200 text-slate-500 font-bold rounded-xl h-11 px-5 hover:bg-slate-50 hover:text-slate-700",children:[e.jsx(re,{className:"w-4 h-4 mr-2 text-slate-400"}),"This Quarter"]}),e.jsxs(N,{className:"flex-1 sm:flex-none bg-indigo-600 hover:bg-indigo-700 text-white font-bold rounded-xl h-11 px-5 shadow-[0_8px_20px_-8px_rgba(79,70,229,0.5)] hover:-translate-y-0.5 transition-all",onClick:q,children:[e.jsx(ce,{className:"w-4 h-4 mr-2"}),"Report"]})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3 sm:gap-6",children:[e.jsxs("div",{className:"bg-white rounded-[1.2rem] sm:rounded-[2rem] border border-slate-100 p-4 sm:p-8 shadow-[0_8px_24px_-10px_rgba(0,0,0,0.05)] relative overflow-hidden group hover:border-indigo-100 transition-colors",children:[e.jsx("div",{className:"absolute -right-6 -top-6 sm:-right-8 sm:-top-8 w-20 h-20 sm:w-32 sm:h-32 bg-indigo-50 rounded-full group-hover:scale-110 transition-transform duration-500"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-10 h-10 sm:w-14 sm:h-14 bg-indigo-100 text-indigo-600 rounded-xl sm:rounded-2xl flex items-center justify-center mb-3 sm:mb-6 shadow-sm",children:e.jsx(le,{className:"w-5 h-5 sm:w-7 sm:h-7"})}),e.jsxs("p",{className:"text-slate-400 font-bold text-[9px] sm:text-sm tracking-wider sm:tracking-wide uppercase h-6 sm:h-auto flex items-end sm:block",children:[e.jsx("span",{className:"sm:hidden",children:"GPA"}),e.jsx("span",{className:"hidden sm:inline",children:"Overall GPA"})]}),e.jsx("div",{className:"flex items-end gap-2 mt-1 sm:mt-2",children:e.jsx("h3",{className:"text-xl sm:text-4xl font-display font-black text-slate-800",children:W})})]})]}),e.jsxs("div",{className:"bg-white rounded-[1.2rem] sm:rounded-[2rem] border border-slate-100 p-4 sm:p-8 shadow-[0_8px_24px_-10px_rgba(0,0,0,0.05)] relative overflow-hidden group hover:border-emerald-100 transition-colors",children:[e.jsx("div",{className:"absolute -right-6 -top-6 sm:-right-8 sm:-top-8 w-20 h-20 sm:w-32 sm:h-32 bg-emerald-50 rounded-full group-hover:scale-110 transition-transform duration-500"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-10 h-10 sm:w-14 sm:h-14 bg-emerald-100 text-emerald-600 rounded-xl sm:rounded-2xl flex items-center justify-center mb-3 sm:mb-6 shadow-sm",children:e.jsx(M,{className:"w-5 h-5 sm:w-7 sm:h-7"})}),e.jsxs("p",{className:"text-slate-400 font-bold text-[9px] sm:text-sm tracking-wider sm:tracking-wide uppercase h-6 sm:h-auto flex items-end sm:block",children:[e.jsx("span",{className:"sm:hidden",children:"Avg Score"}),e.jsx("span",{className:"hidden sm:inline",children:"Average Score"})]}),e.jsx("div",{className:"flex items-end gap-2 mt-1 sm:mt-2",children:e.jsxs("h3",{className:"text-xl sm:text-4xl font-display font-black text-slate-800",children:[f,"%"]})})]})]}),e.jsxs("div",{className:"bg-white rounded-[1.2rem] sm:rounded-[2rem] border border-slate-100 p-4 sm:p-8 shadow-[0_8px_24px_-10px_rgba(0,0,0,0.05)] relative overflow-hidden group hover:border-violet-100 transition-colors",children:[e.jsx("div",{className:"absolute -right-6 -top-6 sm:-right-8 sm:-top-8 w-20 h-20 sm:w-32 sm:h-32 bg-violet-50 rounded-full group-hover:scale-110 transition-transform duration-500"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-10 h-10 sm:w-14 sm:h-14 bg-violet-100 text-violet-600 rounded-xl sm:rounded-2xl flex items-center justify-center mb-3 sm:mb-6 shadow-sm",children:e.jsx($,{className:"w-5 h-5 sm:w-7 sm:h-7"})}),e.jsxs("p",{className:"text-slate-400 font-bold text-[9px] sm:text-sm tracking-wider sm:tracking-wide uppercase h-6 sm:h-auto flex items-end sm:block",children:[e.jsx("span",{className:"sm:hidden",children:"Quizzes"}),e.jsx("span",{className:"hidden sm:inline",children:"Quizzes Completed"})]}),e.jsx("div",{className:"flex items-end gap-2 mt-1 sm:mt-2",children:e.jsx("h3",{className:"text-xl sm:text-4xl font-display font-black text-slate-800",children:J})})]})]})]}),n&&e.jsxs("div",{className:"bg-white rounded-2xl border border-slate-100 p-6 shadow-sm cursor-pointer hover:shadow-md hover:border-indigo-200 transition-all",onClick:()=>g(!0),role:"button",tabIndex:0,onKeyDown:s=>{s.key==="Enter"&&g(!0)},children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-indigo-100 rounded-xl flex items-center justify-center",children:e.jsx(ne,{className:"w-5 h-5 text-indigo-600"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-slate-800",children:"Diagnostic Assessment Results"}),e.jsx("p",{className:"text-xs text-slate-500",children:"Your initial competency evaluation"})]})]}),e.jsxs("span",{className:`px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1.5 ${n.riskLevel==="Low"?"bg-emerald-100 text-emerald-700":n.riskLevel==="High"||n.riskLevel==="At Risk"?"bg-red-100 text-red-700":"bg-amber-100 text-amber-700"}`,children:[n.riskLevel==="Low"?e.jsx(me,{size:12}):e.jsx(xe,{size:12}),n.riskLevel]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[n.score>0&&e.jsxs("div",{className:"bg-slate-50 rounded-xl p-4",children:[e.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase mb-1",children:"Score"}),e.jsxs("p",{className:"text-2xl font-black text-slate-800",children:[n.score,"%"]})]}),n.weaknesses.length>0&&e.jsxs("div",{className:"bg-amber-50 border border-amber-100 rounded-xl p-4",children:[e.jsx("p",{className:"text-xs font-bold text-amber-600 uppercase mb-2",children:"Focus Areas"}),e.jsx("ul",{className:"space-y-1",children:n.weaknesses.map((s,t)=>e.jsxs("li",{className:"text-sm text-amber-800 flex items-center gap-2",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400"}),s]},t))})]}),n.recommendation&&e.jsxs("div",{className:"bg-indigo-50 border border-indigo-100 rounded-xl p-4",children:[e.jsx("p",{className:"text-xs font-bold text-indigo-600 uppercase mb-2",children:"Recommendation"}),e.jsx("p",{className:"text-sm text-indigo-800",children:n.recommendation})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[e.jsx("div",{className:"lg:col-span-2",children:e.jsxs("div",{className:"bg-white rounded-[1.5rem] sm:rounded-[2rem] border border-slate-100 shadow-[0_8px_30px_-12px_rgba(0,0,0,0.06)] overflow-hidden flex flex-col h-full w-full",children:[e.jsxs("div",{className:"p-5 sm:p-8 border-b border-slate-50 flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 sm:gap-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-display font-black text-xl text-slate-800",children:"Recent Assessments"}),e.jsx("p",{className:"text-slate-400 font-bold text-[13px] mt-1",children:"Your latest quiz and practice results"})]}),e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 w-full sm:w-auto",children:[e.jsxs("div",{className:"relative flex-1 sm:flex-none",children:[e.jsxs("select",{value:d,onChange:s=>S(s.target.value),className:"appearance-none w-full pl-3 pr-8 py-2.5 border-none bg-slate-50 rounded-xl text-xs sm:text-sm font-bold text-slate-600 focus:ring-2 focus:ring-indigo-500/30 transition-all cursor-pointer min-w-0 sm:min-w-[140px] shadow-sm",children:[e.jsx("option",{value:"all",children:"All Subjects"}),c.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx(Q,{className:"w-4 h-4 text-slate-400 absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"})]}),e.jsxs("div",{className:"relative flex-1 sm:flex-none",children:[e.jsxs("select",{value:x,onChange:s=>O(s.target.value),className:"appearance-none w-full pl-3 pr-8 py-2.5 border-none bg-slate-50 rounded-xl text-xs sm:text-sm font-bold text-slate-600 focus:ring-2 focus:ring-indigo-500/30 transition-all cursor-pointer min-w-0 sm:min-w-[120px] shadow-sm",children:[e.jsx("option",{value:"all",children:"All Types"}),e.jsx("option",{value:"module",children:"Module Quiz"}),e.jsx("option",{value:"practice",children:"Practice"})]}),e.jsx(Q,{className:"w-4 h-4 text-slate-400 absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"})]})]})]}),e.jsx("div",{className:"overflow-x-auto no-scrollbar flex-1 px-4 sm:px-6 pb-4 -mx-4 sm:mx-0",children:e.jsxs("table",{className:"w-full text-left border-separate border-spacing-y-2 mb-4 whitespace-nowrap md:whitespace-normal",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider border-b border-transparent",children:"Assessment"}),e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider border-b border-transparent min-w-[120px]",children:"Subject"}),e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider border-b border-transparent",children:"Type"}),e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider text-right border-b border-transparent",children:"Score"})]})}),e.jsx("tbody",{children:p.length>0?p.map(s=>e.jsxs("tr",{className:"group hover:bg-slate-50/70 transition-colors",children:[e.jsxs("td",{className:"px-4 py-4 rounded-l-2xl",children:[e.jsx("p",{className:"text-[14px] font-bold text-slate-800",children:s.title}),e.jsx("p",{className:"text-[11px] font-bold text-slate-400 mt-1",children:s.date})]}),e.jsx("td",{className:"px-4 py-4",children:e.jsx("span",{className:"inline-flex flex-col gap-1 items-start",children:e.jsx("span",{className:"text-[13px] font-bold text-slate-600 truncate max-w-[140px] block",children:s.subject})})}),e.jsx("td",{className:"px-4 py-4",children:e.jsx("span",{className:`inline-flex items-center px-3 py-1.5 rounded-lg text-[11px] font-bold uppercase tracking-wide ${s.type==="practice"?"bg-emerald-100/50 text-emerald-600":"bg-indigo-100/50 text-indigo-600"}`,children:s.type==="practice"?"Practice":"Quiz"})}),e.jsx("td",{className:"px-4 py-4 text-right rounded-r-2xl",children:e.jsxs("span",{className:`inline-flex items-center px-3 py-1.5 rounded-xl text-[13px] font-black ${s.score>=80?"bg-emerald-100 text-emerald-700":s.score>=60?"bg-amber-100 text-amber-700":"bg-rose-100 text-rose-700"}`,children:[s.score,"%"]})})]},s.id)):e.jsx("tr",{children:e.jsx("td",{colSpan:4,className:"px-6 py-16 text-center",children:e.jsxs("div",{className:"flex flex-col items-center justify-center",children:[e.jsx("div",{className:"w-16 h-16 bg-slate-50 rounded-full flex items-center justify-center mb-4",children:e.jsx(M,{className:"w-8 h-8 text-slate-300"})}),e.jsx("p",{className:"text-slate-500 font-bold text-sm",children:"No recent assessments match the selected filters."})]})})})})]})})]})}),e.jsxs("div",{className:"space-y-6 lg:space-y-8 flex flex-col",children:[e.jsxs("div",{className:"bg-white rounded-[1.5rem] sm:rounded-[2rem] border border-slate-100 p-5 sm:p-8 shadow-[0_8px_30px_-12px_rgba(0,0,0,0.06)]",children:[e.jsx("div",{className:"flex items-center justify-between mb-8",children:e.jsx("h3",{className:"font-display font-black text-lg text-slate-800",children:"Subject Performance"})}),e.jsx("div",{className:"space-y-7",children:z.map((s,t)=>{const a=L[s.color]||L.slate;return e.jsxs("div",{className:"group",children:[e.jsxs("div",{className:"flex justify-between items-end mb-3",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-[14px] font-bold text-slate-800 flex items-center gap-2",children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${a.dot} group-hover:scale-125 transition-transform`}),s.subject]}),e.jsxs("p",{className:"text-[11px] text-slate-400 font-bold ml-4 mt-0.5",children:[s.quizzes," activities"]})]}),e.jsxs("span",{className:"text-[15px] font-black text-slate-800",children:[s.average,"%"]})]}),e.jsx("div",{className:"h-2.5 w-full bg-slate-100 rounded-full overflow-hidden shadow-inner",children:e.jsx("div",{className:`h-full rounded-full e-w ${a.bar} shadow-sm relative overflow-hidden transition-all duration-1000`,style:{"--w":`${Math.max(s.average,5)}%`},children:e.jsx("div",{className:"absolute inset-0 bg-white/20 w-1/2 -skew-x-12 translate-x-[-100%] group-hover:animate-[shimmer_1.5s_ease-out]"})})})]},t)})})]}),e.jsxs("div",{className:"relative bg-gradient-to-br from-indigo-600 to-violet-700 rounded-[1.5rem] sm:rounded-[2rem] p-5 sm:p-8 shadow-[0_12px_30px_-10px_rgba(79,70,229,0.5)] text-white overflow-hidden group",children:[e.jsx("div",{className:"absolute top-0 right-0 w-48 h-48 bg-white/10 rounded-full blur-3xl -mt-10 -mr-10 group-hover:bg-white/20 transition-all duration-700 ease-in-out"}),e.jsx("div",{className:"absolute bottom-0 left-0 w-32 h-32 bg-indigo-400/30 rounded-full blur-2xl -mb-10 -ml-10"}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("div",{className:"w-12 h-12 bg-white/10 rounded-2xl flex items-center justify-center mb-5 backdrop-blur-sm border border-white/20 shadow-sm group-hover:scale-110 transition-transform",children:e.jsx($,{className:"w-6 h-6 text-white"})}),e.jsx("h3",{className:"text-2xl font-display font-black tracking-tight mb-2 leading-tight",children:"Keep up the momentum!"}),e.jsxs("p",{className:"text-white/80 text-[13px] font-medium leading-relaxed mb-8 max-w-[90%]",children:["You've completed ",e.jsx("span",{className:"font-black text-white",children:D.length})," activities recently. Try a practice session to boost your lowest scores."]}),e.jsx(N,{onClick:()=>{sessionStorage.setItem("mathpulse_modules_tab","practice"),window.dispatchEvent(new CustomEvent("mathpulse:navigate",{detail:{tab:"Modules"}}))},className:"w-full bg-white text-indigo-600 hover:bg-slate-50 border-0 font-black h-12 rounded-xl shadow-[0_8px_16px_rgba(0,0,0,0.15)] hover:shadow-[0_8px_24px_rgba(0,0,0,0.2)] hover:-translate-y-0.5 transition-all",children:"Start Practice Session"})]})]})]})]}),_&&l?.uid&&e.jsx(r.Suspense,{fallback:null,children:e.jsx(pe,{userId:l.uid,mode:"modal",isOpen:_,onClose:()=>g(!1)})})]})};export{Ee as default};
|
|
|
|
| 1 |
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DiagnosticBreakdown--QQ0WiYU.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/index-CGNBpSmO.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-BPuEd8FG.js","assets/vendor-charts-D7t7JfSr.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-CEL3Ax6X.css","assets/x-Deb9zs8O.js","assets/clock-D2bky9WI.js","assets/lightbulb-CrdekHc8.js","assets/circle-check-BhLH88x1.js","assets/chart-column-g5DztEPT.js","assets/chevron-up-B59xV3SY.js"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{u as se,aF as te,aG as ae,g as P,F as re,A as le,q as M,T as $,B as ne,_ as oe}from"./index-CGNBpSmO.js";import{r,j as e}from"./vendor-react-B4AQeu28.js";import{B as N}from"./button-DVjn4LkC.js";import{g as ie,S as B}from"./subjects-DP2R71lN.js";import{u as de}from"./useCurriculum-cH2ZLq43.js";import{getDoc as F,doc as G}from"./vendor-firebase-firestore-CNv3xXal.js";import{D as ce}from"./download-Dg4u7Zq0.js";import{C as me}from"./circle-check-BhLH88x1.js";import{C as xe}from"./circle-alert-fZn6_hMx.js";import{F as Q}from"./funnel-pOzgdLsf.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-D7t7JfSr.js";import"./vendor-markdown-yqZQ_iQm.js";import"./chart-column-g5DztEPT.js";const pe=r.lazy(()=>oe(()=>import("./DiagnosticBreakdown--QQ0WiYU.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]))),Ee=()=>{const{currentUser:l,userProfile:y}=se(),[d,S]=r.useState("all"),[x,O]=r.useState("all"),[I,h]=r.useState(!0),[b,U]=r.useState(null),[H,V]=r.useState([]),[n,k]=r.useState(null),[_,g]=r.useState(!1),A=y?.grade,C=ie(A),T=new Set(C),{isLoading:Y}=de(A);r.useEffect(()=>{},[Y]);const K=s=>{if(s==null)return"N/A";const t=s instanceof Date?s:new Date(s);return Number.isNaN(t.getTime())?"N/A":t.toISOString().split("T")[0]};r.useEffect(()=>{if(!l)return;h(!0);const s=te(l.uid,a=>{U(a),h(!1)}),t=ae(l.uid,a=>{V(a),h(!1)});return()=>{s(),t()}},[l]),r.useEffect(()=>{l?.uid&&(async()=>{try{const s=await F(G(P,"users",l.uid,"dashboardSummary","heroBannerModal"));if(s.exists()){const a=s.data();if(a.status==="ready"){k({score:a.latestScorePercent||0,riskLevel:a.latestRiskLevel||"Unknown",weaknesses:a.weaknesses||[],recommendation:a.recommendation||""});return}}const t=await F(G(P,"users",l.uid));if(t.exists()){const a=t.data();(a.initialAssessmentCompleted||a.hasCompletedInitialAssessment)&&k({score:0,riskLevel:a.atRiskSubjects?.length>0?"Moderate":"Low",weaknesses:a.atRiskSubjects||[],recommendation:"Continue with your personalized learning path."})}}catch{}})()},[l?.uid]);const f=b?.averageScore?Math.round(b.averageScore):0,J=b?.quizzesCompleted??0,W=f>0?(f/100*4).toFixed(2):"0.00",X={"gen-math":"indigo","stats-prob":"violet"},L={indigo:{dot:"bg-indigo-500",bar:"bg-indigo-500"},violet:{dot:"bg-violet-500",bar:"bg-violet-500"},fuchsia:{dot:"bg-fuchsia-500",bar:"bg-fuchsia-500"},purple:{dot:"bg-purple-500",bar:"bg-purple-500"},slate:{dot:"bg-slate-500",bar:"bg-slate-500"}},R=B.reduce((s,t)=>(s[t.id]={label:t.name,color:X[t.id]||"slate"},s),{}),c=B.filter(s=>T.has(s.id)).map(s=>s.name),E=Object.entries({}).filter(([s])=>T.has(s)).map(([s,t])=>{const a=R[s]||{label:s,color:"slate"},i=[],j=i.length>0?Math.round(i.reduce((w,u)=>w+u.score,0)/i.length):Math.round(t?.progress??0);return{subject:a.label,average:j,quizzes:i.length||t?.completedModules,color:a.color}}),Z=C.map(s=>{const t=R[s]||{label:s,color:"slate"};return{subject:t.label,average:0,quizzes:0,color:t.color}}),z=E.length>0?E:Z,D=H.slice().sort((s,t)=>{const a=s.completedAt?.toDate?.()?.getTime()??0;return(t.completedAt?.toDate?.()?.getTime()??0)-a}).slice(0,10).map((s,t)=>({id:t+1,title:s.title||`Assessment ${t+1}`,subject:s.subject||"General",score:s.score,date:s.completedAt?K(s.completedAt.toDate()):"N/A",type:s.type==="practice"?"practice":(s.type==="diagnostic","module"),status:s.score>=80?"Excellent":s.score>=60?"Passing":"Needs Review"})).filter(s=>c.includes(s.subject)),p=D.filter(s=>{if(!c.includes(s.subject))return!1;const t=d==="all"||s.subject===d,a=x==="all"||s.type===x;return t&&a});r.useEffect(()=>{d!=="all"&&(c.includes(d)||S("all"))},[c,d]);const q=()=>{const s=o=>{const v=String(o??"");return/[",\n]/.test(v)?`"${v.replace(/"/g,'""')}"`:v},t=[],a=y?.name||l?.displayName||l?.email||"Student",i=new Date().toISOString().split("T")[0];t.push("Grade Report"),t.push(`Student,${s(a)}`),t.push(`Export Date,${s(i)}`),t.push(`Subject Filter,${s(d)}`),t.push(`Type Filter,${s(x)}`),t.push(""),t.push("Subject Performance"),t.push("Subject,Average Score"),z.forEach(o=>{t.push([s(o.subject),s(o.average)].join(","))}),t.push(""),t.push("Recent Quizzes"),t.push("Title,Subject,Score,Date,Type,Status"),p.length===0?t.push("No quiz data available for the selected filters"):p.forEach(o=>{t.push([s(o.title),s(o.subject),s(o.score),s(o.date),s(o.type),s(o.status)].join(","))});const j=t.join(`
|
| 3 |
`),w=new Blob([j],{type:"text/csv;charset=utf-8;"}),u=window.URL.createObjectURL(w),m=document.createElement("a"),ee=a.replace(/[^a-z0-9]+/gi,"-").replace(/^-+|-+$/g,"").toLowerCase()||"student";m.href=u,m.setAttribute("download",`grade-report-${ee}-${i}.csv`),document.body.appendChild(m),m.click(),document.body.removeChild(m),window.URL.revokeObjectURL(u)};return I?e.jsx("div",{className:"p-8 flex justify-center items-center h-full",children:e.jsx("div",{className:"w-10 h-10 border-4 border-indigo-500 border-t-transparent rounded-full animate-spin"})}):e.jsxs("div",{className:"p-4 sm:p-6 lg:p-8 space-y-6 lg:space-y-8 max-w-7xl mx-auto",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 bg-white p-5 sm:p-6 rounded-[1.5rem] sm:rounded-[2rem] shadow-[0_8px_30px_-12px_rgba(0,0,0,0.06)] border border-slate-50",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-display font-black text-slate-800 tracking-tight",children:"Assessment"}),e.jsx("p",{className:"text-slate-400 font-bold mt-1 text-[13px]",children:"Review your performance across subjects"})]}),e.jsxs("div",{className:"flex gap-3 w-full sm:w-auto",children:[e.jsxs(N,{variant:"outline",className:"flex-1 sm:flex-none border-slate-200 text-slate-500 font-bold rounded-xl h-11 px-5 hover:bg-slate-50 hover:text-slate-700",children:[e.jsx(re,{className:"w-4 h-4 mr-2 text-slate-400"}),"This Quarter"]}),e.jsxs(N,{className:"flex-1 sm:flex-none bg-indigo-600 hover:bg-indigo-700 text-white font-bold rounded-xl h-11 px-5 shadow-[0_8px_20px_-8px_rgba(79,70,229,0.5)] hover:-translate-y-0.5 transition-all",onClick:q,children:[e.jsx(ce,{className:"w-4 h-4 mr-2"}),"Report"]})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3 sm:gap-6",children:[e.jsxs("div",{className:"bg-white rounded-[1.2rem] sm:rounded-[2rem] border border-slate-100 p-4 sm:p-8 shadow-[0_8px_24px_-10px_rgba(0,0,0,0.05)] relative overflow-hidden group hover:border-indigo-100 transition-colors",children:[e.jsx("div",{className:"absolute -right-6 -top-6 sm:-right-8 sm:-top-8 w-20 h-20 sm:w-32 sm:h-32 bg-indigo-50 rounded-full group-hover:scale-110 transition-transform duration-500"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-10 h-10 sm:w-14 sm:h-14 bg-indigo-100 text-indigo-600 rounded-xl sm:rounded-2xl flex items-center justify-center mb-3 sm:mb-6 shadow-sm",children:e.jsx(le,{className:"w-5 h-5 sm:w-7 sm:h-7"})}),e.jsxs("p",{className:"text-slate-400 font-bold text-[9px] sm:text-sm tracking-wider sm:tracking-wide uppercase h-6 sm:h-auto flex items-end sm:block",children:[e.jsx("span",{className:"sm:hidden",children:"GPA"}),e.jsx("span",{className:"hidden sm:inline",children:"Overall GPA"})]}),e.jsx("div",{className:"flex items-end gap-2 mt-1 sm:mt-2",children:e.jsx("h3",{className:"text-xl sm:text-4xl font-display font-black text-slate-800",children:W})})]})]}),e.jsxs("div",{className:"bg-white rounded-[1.2rem] sm:rounded-[2rem] border border-slate-100 p-4 sm:p-8 shadow-[0_8px_24px_-10px_rgba(0,0,0,0.05)] relative overflow-hidden group hover:border-emerald-100 transition-colors",children:[e.jsx("div",{className:"absolute -right-6 -top-6 sm:-right-8 sm:-top-8 w-20 h-20 sm:w-32 sm:h-32 bg-emerald-50 rounded-full group-hover:scale-110 transition-transform duration-500"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-10 h-10 sm:w-14 sm:h-14 bg-emerald-100 text-emerald-600 rounded-xl sm:rounded-2xl flex items-center justify-center mb-3 sm:mb-6 shadow-sm",children:e.jsx(M,{className:"w-5 h-5 sm:w-7 sm:h-7"})}),e.jsxs("p",{className:"text-slate-400 font-bold text-[9px] sm:text-sm tracking-wider sm:tracking-wide uppercase h-6 sm:h-auto flex items-end sm:block",children:[e.jsx("span",{className:"sm:hidden",children:"Avg Score"}),e.jsx("span",{className:"hidden sm:inline",children:"Average Score"})]}),e.jsx("div",{className:"flex items-end gap-2 mt-1 sm:mt-2",children:e.jsxs("h3",{className:"text-xl sm:text-4xl font-display font-black text-slate-800",children:[f,"%"]})})]})]}),e.jsxs("div",{className:"bg-white rounded-[1.2rem] sm:rounded-[2rem] border border-slate-100 p-4 sm:p-8 shadow-[0_8px_24px_-10px_rgba(0,0,0,0.05)] relative overflow-hidden group hover:border-violet-100 transition-colors",children:[e.jsx("div",{className:"absolute -right-6 -top-6 sm:-right-8 sm:-top-8 w-20 h-20 sm:w-32 sm:h-32 bg-violet-50 rounded-full group-hover:scale-110 transition-transform duration-500"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-10 h-10 sm:w-14 sm:h-14 bg-violet-100 text-violet-600 rounded-xl sm:rounded-2xl flex items-center justify-center mb-3 sm:mb-6 shadow-sm",children:e.jsx($,{className:"w-5 h-5 sm:w-7 sm:h-7"})}),e.jsxs("p",{className:"text-slate-400 font-bold text-[9px] sm:text-sm tracking-wider sm:tracking-wide uppercase h-6 sm:h-auto flex items-end sm:block",children:[e.jsx("span",{className:"sm:hidden",children:"Quizzes"}),e.jsx("span",{className:"hidden sm:inline",children:"Quizzes Completed"})]}),e.jsx("div",{className:"flex items-end gap-2 mt-1 sm:mt-2",children:e.jsx("h3",{className:"text-xl sm:text-4xl font-display font-black text-slate-800",children:J})})]})]})]}),n&&e.jsxs("div",{className:"bg-white rounded-2xl border border-slate-100 p-6 shadow-sm cursor-pointer hover:shadow-md hover:border-indigo-200 transition-all",onClick:()=>g(!0),role:"button",tabIndex:0,onKeyDown:s=>{s.key==="Enter"&&g(!0)},children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-indigo-100 rounded-xl flex items-center justify-center",children:e.jsx(ne,{className:"w-5 h-5 text-indigo-600"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-slate-800",children:"Diagnostic Assessment Results"}),e.jsx("p",{className:"text-xs text-slate-500",children:"Your initial competency evaluation"})]})]}),e.jsxs("span",{className:`px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1.5 ${n.riskLevel==="Low"?"bg-emerald-100 text-emerald-700":n.riskLevel==="High"||n.riskLevel==="At Risk"?"bg-red-100 text-red-700":"bg-amber-100 text-amber-700"}`,children:[n.riskLevel==="Low"?e.jsx(me,{size:12}):e.jsx(xe,{size:12}),n.riskLevel]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[n.score>0&&e.jsxs("div",{className:"bg-slate-50 rounded-xl p-4",children:[e.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase mb-1",children:"Score"}),e.jsxs("p",{className:"text-2xl font-black text-slate-800",children:[n.score,"%"]})]}),n.weaknesses.length>0&&e.jsxs("div",{className:"bg-amber-50 border border-amber-100 rounded-xl p-4",children:[e.jsx("p",{className:"text-xs font-bold text-amber-600 uppercase mb-2",children:"Focus Areas"}),e.jsx("ul",{className:"space-y-1",children:n.weaknesses.map((s,t)=>e.jsxs("li",{className:"text-sm text-amber-800 flex items-center gap-2",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400"}),s]},t))})]}),n.recommendation&&e.jsxs("div",{className:"bg-indigo-50 border border-indigo-100 rounded-xl p-4",children:[e.jsx("p",{className:"text-xs font-bold text-indigo-600 uppercase mb-2",children:"Recommendation"}),e.jsx("p",{className:"text-sm text-indigo-800",children:n.recommendation})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[e.jsx("div",{className:"lg:col-span-2",children:e.jsxs("div",{className:"bg-white rounded-[1.5rem] sm:rounded-[2rem] border border-slate-100 shadow-[0_8px_30px_-12px_rgba(0,0,0,0.06)] overflow-hidden flex flex-col h-full w-full",children:[e.jsxs("div",{className:"p-5 sm:p-8 border-b border-slate-50 flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 sm:gap-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-display font-black text-xl text-slate-800",children:"Recent Assessments"}),e.jsx("p",{className:"text-slate-400 font-bold text-[13px] mt-1",children:"Your latest quiz and practice results"})]}),e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 w-full sm:w-auto",children:[e.jsxs("div",{className:"relative flex-1 sm:flex-none",children:[e.jsxs("select",{value:d,onChange:s=>S(s.target.value),className:"appearance-none w-full pl-3 pr-8 py-2.5 border-none bg-slate-50 rounded-xl text-xs sm:text-sm font-bold text-slate-600 focus:ring-2 focus:ring-indigo-500/30 transition-all cursor-pointer min-w-0 sm:min-w-[140px] shadow-sm",children:[e.jsx("option",{value:"all",children:"All Subjects"}),c.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx(Q,{className:"w-4 h-4 text-slate-400 absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"})]}),e.jsxs("div",{className:"relative flex-1 sm:flex-none",children:[e.jsxs("select",{value:x,onChange:s=>O(s.target.value),className:"appearance-none w-full pl-3 pr-8 py-2.5 border-none bg-slate-50 rounded-xl text-xs sm:text-sm font-bold text-slate-600 focus:ring-2 focus:ring-indigo-500/30 transition-all cursor-pointer min-w-0 sm:min-w-[120px] shadow-sm",children:[e.jsx("option",{value:"all",children:"All Types"}),e.jsx("option",{value:"module",children:"Module Quiz"}),e.jsx("option",{value:"practice",children:"Practice"})]}),e.jsx(Q,{className:"w-4 h-4 text-slate-400 absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"})]})]})]}),e.jsx("div",{className:"overflow-x-auto no-scrollbar flex-1 px-4 sm:px-6 pb-4 -mx-4 sm:mx-0",children:e.jsxs("table",{className:"w-full text-left border-separate border-spacing-y-2 mb-4 whitespace-nowrap md:whitespace-normal",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider border-b border-transparent",children:"Assessment"}),e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider border-b border-transparent min-w-[120px]",children:"Subject"}),e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider border-b border-transparent",children:"Type"}),e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider text-right border-b border-transparent",children:"Score"})]})}),e.jsx("tbody",{children:p.length>0?p.map(s=>e.jsxs("tr",{className:"group hover:bg-slate-50/70 transition-colors",children:[e.jsxs("td",{className:"px-4 py-4 rounded-l-2xl",children:[e.jsx("p",{className:"text-[14px] font-bold text-slate-800",children:s.title}),e.jsx("p",{className:"text-[11px] font-bold text-slate-400 mt-1",children:s.date})]}),e.jsx("td",{className:"px-4 py-4",children:e.jsx("span",{className:"inline-flex flex-col gap-1 items-start",children:e.jsx("span",{className:"text-[13px] font-bold text-slate-600 truncate max-w-[140px] block",children:s.subject})})}),e.jsx("td",{className:"px-4 py-4",children:e.jsx("span",{className:`inline-flex items-center px-3 py-1.5 rounded-lg text-[11px] font-bold uppercase tracking-wide ${s.type==="practice"?"bg-emerald-100/50 text-emerald-600":"bg-indigo-100/50 text-indigo-600"}`,children:s.type==="practice"?"Practice":"Quiz"})}),e.jsx("td",{className:"px-4 py-4 text-right rounded-r-2xl",children:e.jsxs("span",{className:`inline-flex items-center px-3 py-1.5 rounded-xl text-[13px] font-black ${s.score>=80?"bg-emerald-100 text-emerald-700":s.score>=60?"bg-amber-100 text-amber-700":"bg-rose-100 text-rose-700"}`,children:[s.score,"%"]})})]},s.id)):e.jsx("tr",{children:e.jsx("td",{colSpan:4,className:"px-6 py-16 text-center",children:e.jsxs("div",{className:"flex flex-col items-center justify-center",children:[e.jsx("div",{className:"w-16 h-16 bg-slate-50 rounded-full flex items-center justify-center mb-4",children:e.jsx(M,{className:"w-8 h-8 text-slate-300"})}),e.jsx("p",{className:"text-slate-500 font-bold text-sm",children:"No recent assessments match the selected filters."})]})})})})]})})]})}),e.jsxs("div",{className:"space-y-6 lg:space-y-8 flex flex-col",children:[e.jsxs("div",{className:"bg-white rounded-[1.5rem] sm:rounded-[2rem] border border-slate-100 p-5 sm:p-8 shadow-[0_8px_30px_-12px_rgba(0,0,0,0.06)]",children:[e.jsx("div",{className:"flex items-center justify-between mb-8",children:e.jsx("h3",{className:"font-display font-black text-lg text-slate-800",children:"Subject Performance"})}),e.jsx("div",{className:"space-y-7",children:z.map((s,t)=>{const a=L[s.color]||L.slate;return e.jsxs("div",{className:"group",children:[e.jsxs("div",{className:"flex justify-between items-end mb-3",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-[14px] font-bold text-slate-800 flex items-center gap-2",children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${a.dot} group-hover:scale-125 transition-transform`}),s.subject]}),e.jsxs("p",{className:"text-[11px] text-slate-400 font-bold ml-4 mt-0.5",children:[s.quizzes," activities"]})]}),e.jsxs("span",{className:"text-[15px] font-black text-slate-800",children:[s.average,"%"]})]}),e.jsx("div",{className:"h-2.5 w-full bg-slate-100 rounded-full overflow-hidden shadow-inner",children:e.jsx("div",{className:`h-full rounded-full e-w ${a.bar} shadow-sm relative overflow-hidden transition-all duration-1000`,style:{"--w":`${Math.max(s.average,5)}%`},children:e.jsx("div",{className:"absolute inset-0 bg-white/20 w-1/2 -skew-x-12 translate-x-[-100%] group-hover:animate-[shimmer_1.5s_ease-out]"})})})]},t)})})]}),e.jsxs("div",{className:"relative bg-gradient-to-br from-indigo-600 to-violet-700 rounded-[1.5rem] sm:rounded-[2rem] p-5 sm:p-8 shadow-[0_12px_30px_-10px_rgba(79,70,229,0.5)] text-white overflow-hidden group",children:[e.jsx("div",{className:"absolute top-0 right-0 w-48 h-48 bg-white/10 rounded-full blur-3xl -mt-10 -mr-10 group-hover:bg-white/20 transition-all duration-700 ease-in-out"}),e.jsx("div",{className:"absolute bottom-0 left-0 w-32 h-32 bg-indigo-400/30 rounded-full blur-2xl -mb-10 -ml-10"}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("div",{className:"w-12 h-12 bg-white/10 rounded-2xl flex items-center justify-center mb-5 backdrop-blur-sm border border-white/20 shadow-sm group-hover:scale-110 transition-transform",children:e.jsx($,{className:"w-6 h-6 text-white"})}),e.jsx("h3",{className:"text-2xl font-display font-black tracking-tight mb-2 leading-tight",children:"Keep up the momentum!"}),e.jsxs("p",{className:"text-white/80 text-[13px] font-medium leading-relaxed mb-8 max-w-[90%]",children:["You've completed ",e.jsx("span",{className:"font-black text-white",children:D.length})," activities recently. Try a practice session to boost your lowest scores."]}),e.jsx(N,{onClick:()=>{sessionStorage.setItem("mathpulse_modules_tab","practice"),window.dispatchEvent(new CustomEvent("mathpulse:navigate",{detail:{tab:"Modules"}}))},className:"w-full bg-white text-indigo-600 hover:bg-slate-50 border-0 font-black h-12 rounded-xl shadow-[0_8px_16px_rgba(0,0,0,0.15)] hover:shadow-[0_8px_24px_rgba(0,0,0,0.2)] hover:-translate-y-0.5 transition-all",children:"Start Practice Session"})]})]})]})]}),_&&l?.uid&&e.jsx(r.Suspense,{fallback:null,children:e.jsx(pe,{userId:l.uid,mode:"modal",isOpen:_,onClose:()=>g(!1)})})]})};export{Ee as default};
|
assets/{HeroBanner-BqAsDsi9.js β HeroBanner-Db1VgQom.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardAvatar-CbAKGmA6.js","assets/vendor-react-B4AQeu28.js","assets/avatarData-BuQSOXo3.js"])))=>i.map(i=>d[i]);
|
| 2 |
-
import{T as R,g as b,a1 as M,h as _,m as f,a2 as E,A as G,B as S,q as z,Z as Y,
|
| 3 |
${s.latestRiskLevel==="At Risk"?"bg-red-100 text-red-700":s.latestRiskLevel==="Needs Attention"?"bg-amber-100 text-amber-700":"bg-emerald-100 text-emerald-700"}`,children:[s.latestRiskLevel==="At Risk"?e.jsx(V,{className:"w-4 h-4"}):s.latestRiskLevel==="Needs Attention"?e.jsx(H,{className:"w-4 h-4"}):e.jsx(se,{className:"w-4 h-4"}),s.latestRiskLevel]})]}),e.jsx("div",{className:"bg-slate-50 p-5 rounded-2xl border border-slate-100",children:e.jsx("p",{className:"text-slate-700 leading-relaxed",children:s.summary})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.strengths?.length>0&&e.jsxs("div",{className:"border border-emerald-100 bg-emerald-50/30 rounded-xl p-4",children:[e.jsxs("h4",{className:"font-semibold text-emerald-800 mb-3 flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"Strengths"]}),e.jsx("ul",{className:"space-y-2",children:s.strengths.map((a,r)=>e.jsxs("li",{className:"text-sm text-emerald-700 flex items-start gap-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 mt-1.5 flex-shrink-0"}),e.jsx("span",{children:a})]},r))})]}),s.weaknesses?.length>0&&e.jsxs("div",{className:"border border-amber-100 bg-amber-50/30 rounded-xl p-4",children:[e.jsxs("h4",{className:"font-semibold text-amber-800 mb-3 flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"Focus Areas"]}),e.jsx("ul",{className:"space-y-2",children:s.weaknesses.map((a,r)=>e.jsxs("li",{className:"text-sm text-amber-700 flex items-start gap-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 mt-1.5 flex-shrink-0"}),e.jsx("span",{children:a})]},r))})]})]}),s.recommendation&&e.jsxs("div",{className:"bg-gradient-to-br from-indigo-50 to-purple-50 rounded-xl p-5 border border-indigo-100",children:[e.jsxs("h4",{className:"font-semibold text-indigo-900 mb-2 flex items-center gap-2",children:[e.jsx(S,{className:"w-4 h-4 text-indigo-500"}),"Recommended Next Step"]}),e.jsx("p",{className:"text-sm text-indigo-800 leading-relaxed",children:s.recommendation})]})]}),de=({heroBannerSummary:s,latestResult:a,loading:r})=>r?e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"h-32 bg-slate-200 rounded-xl"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-4 bg-slate-200 rounded w-3/4"}),e.jsx("div",{className:"h-4 bg-slate-200 rounded w-1/2"}),e.jsx("div",{className:"h-4 bg-slate-200 rounded w-5/6"})]})]}):!s&&!a?e.jsxs("div",{className:"text-center py-8",children:[e.jsx("div",{className:"w-16 h-16 bg-sky-100 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(S,{className:"w-8 h-8 text-sky-500"})}),e.jsx("h3",{className:"text-lg font-bold text-slate-800 mb-2",children:"Let's personalize your learning"}),e.jsx("p",{className:"text-sm text-slate-500 max-w-xs mx-auto",children:"Complete your diagnostic assessment so I can understand your strengths, weak areas, and the best next lessons for you."})]}):s?.status==="ready"?e.jsx(ie,{summary:s}):a?e.jsx(ne,{result:a}):e.jsxs("div",{className:"text-center py-8",children:[e.jsx("div",{className:"w-16 h-16 bg-amber-100 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(H,{className:"w-8 h-8 text-amber-500"})}),e.jsx("h3",{className:"text-lg font-bold text-slate-800 mb-2",children:"Your learning summary is being prepared"}),e.jsx("p",{className:"text-sm text-slate-500 max-w-xs mx-auto",children:"Please try opening this again in a moment."})]});async function ce(s){const a=await L(C(b,"competencyProfiles",s)).catch(()=>null);if(a?.exists()){const t=a.data(),l=t.primaryStrength?[t.primaryStrength]:[],o=t.primaryWeakness?[t.primaryWeakness]:[];return{status:"ready",headline:t.overallScore>=70?"Good job β keep it up!":"Let's build your foundation",summary:o.length>0?`Focus on strengthening ${o[0]} to improve your overall performance.`:"Keep practicing to maintain and expand your skills.",strengths:l,weaknesses:o,recommendation:t.suggestedModule?`Start with the ${t.suggestedModule} module.`:"Continue with your personalized learning path.",latestAssessmentId:"",latestScorePercent:t.overallScore||0,latestRiskLevel:t.overallScore>=70?"Low":t.overallScore>=50?"Moderate":"High",updatedAt:t.updatedAt?.toDate?.()||new Date}}const r=await A(w(v(b,"assessments",s,"attempts"),k("completedAt","desc"),N(1))).catch(()=>null);if(r&&!r.empty){const t=r.docs[0].data(),l=t.rawScore||t.overallScorePercent||0,o=t.proficiencyProfile;return{status:"ready",headline:l>=70?"Good job β keep it up!":"Let's build your foundation",summary:o?.weaknesses?.length>0?`Focus on strengthening ${o.weaknesses[0]} to improve.`:l>=70?"You have a solid foundation!":"With practice, you'll build confidence.",strengths:o?.strengths||[],weaknesses:o?.weaknesses||[],recommendation:o?.suggestedStartingModule?`Start with ${o.suggestedStartingModule}.`:"Follow your personalized learning path.",latestAssessmentId:t.assessmentId||"",latestScorePercent:l,latestRiskLevel:l>=70?"Low":l>=50?"Moderate":"High",updatedAt:t.completedAt?.toDate?.()||new Date}}const c=await L(C(b,"diagnosticResults",s)).catch(()=>null);if(c?.exists()){const t=c.data(),l=t.overallScorePercent||t.overall_score_percent||0,o=t.riskProfile?.weak_domains||[];return{status:"ready",headline:l>=70?"Good job β keep it up!":"Let's build your foundation",summary:o.length>0?`Areas to focus on: ${o.join(", ")}.`:"Assessment completed. Follow your learning path.",strengths:[],weaknesses:o,recommendation:t.recommended_intervention||"Continue with your personalized learning path.",latestAssessmentId:"",latestScorePercent:l,latestRiskLevel:t.overall_risk||(l>=70?"Low":"Moderate"),updatedAt:t.completedAt?.toDate?.()||new Date}}const i=await A(w(v(b,"users",s,"assessments"),k("completedAt","desc"),N(5))).catch(()=>null);if(i&&!i.empty){const t=i.docs.map(p=>p.data()),l=t[0],o=l.score||l.scorePercent||0,x=t.length,j=Math.round(t.reduce((p,u)=>p+(u.score||u.scorePercent||0),0)/x);return{status:"ready",headline:o>=70?"Good job β keep it up!":"Let's build your foundation",summary:`You've completed ${x} diagnostic assessment${x>1?"s":""}. Your latest score is ${o}% (average: ${j}%).`,strengths:[],weaknesses:l.risk==="At Risk"||l.risk==="High"?[l.subject||"General Mathematics"]:[],recommendation:"Continue with your personalized learning path to strengthen weak areas.",latestAssessmentId:l.testId||"",latestScorePercent:o,latestRiskLevel:l.risk||(o>=70?"Low":o>=50?"Moderate":"High"),updatedAt:l.completedAt?.toDate?.()||new Date}}const n=await L(C(b,"users",s)).catch(()=>null);if(n?.exists()){const t=n.data();if(t.initialAssessmentCompleted||t.hasCompletedInitialAssessment){const l=t.atRiskSubjects||[];return{status:"ready",headline:"Assessment Complete! β",summary:l.length>0?`Areas to focus on: ${l.join(", ")}. Follow your personalized learning path to improve.`:"Your diagnostic assessment is complete. Your personalized learning path is ready.",strengths:[],weaknesses:l,recommendation:"Continue with your recommended lessons to strengthen your skills.",latestAssessmentId:"",latestScorePercent:0,latestRiskLevel:l.length>0?"Moderate":"Low",updatedAt:t.assessmentCompletedAt?.toDate?.()||new Date}}}return null}const me=({isOpen:s,onClose:a,studentId:r,latestResult:c,heroBannerSummary:i})=>{const[n,t]=m.useState("latest"),[l,o]=m.useState(c||null),[x,j]=m.useState([]),[p,u]=m.useState(!1),[g,y]=m.useState(null);m.useEffect(()=>{if(s&&r&&!i){const d=M(r,h=>{y(h)});return()=>d()}},[s,r,i]);const $=i||g;m.useEffect(()=>{s&&r&&(u(!0),(async()=>{try{const[h,T]=await Promise.all([c?Promise.resolve(c):le(r),re(r)]);if(o(h),j(T),!i&&!g){const D=await E(r);if(D)y(D);else{const P=await ce(r);P&&y(P)}}}catch(h){console.error("[AssessmentResultsModal] fetch error:",h)}finally{u(!1)}})())},[s,r,c]);const B=[{key:"latest",label:"Last Results",icon:e.jsx(G,{className:"w-4 h-4"})},{key:"history",label:"History & Trends",icon:e.jsx(R,{className:"w-4 h-4"})}];return e.jsx(W,{open:s,onOpenChange:d=>!d&&a(),children:e.jsxs(q,{className:"max-w-2xl max-h-[85vh] overflow-y-auto p-0 bg-white rounded-2xl shadow-2xl border-0",children:[e.jsxs("div",{className:"sticky top-0 z-10 bg-white border-b border-slate-200 rounded-t-2xl px-6 py-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h2",{className:"text-xl font-bold text-slate-800",children:"Assessment Results"}),e.jsx("button",{onClick:a,className:"p-1.5 rounded-lg hover:bg-slate-100 transition-colors",children:e.jsx(ee,{className:"w-5 h-5 text-slate-400"})})]}),e.jsx("div",{className:"flex gap-1 bg-slate-100 p-1 rounded-lg",children:B.map(d=>e.jsxs("button",{onClick:()=>t(d.key),className:`flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-all ${n===d.key?"bg-white text-sky-600 shadow-sm":"text-slate-600 hover:text-slate-800"}`,children:[d.icon,d.label]},d.key))})]}),e.jsx("div",{className:"px-6 py-5",children:e.jsxs(_,{mode:"wait",children:[n==="latest"&&e.jsx(f.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},children:e.jsx(de,{heroBannerSummary:$,latestResult:l,loading:p})},"latest"),n==="history"&&e.jsxs(f.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},children:[e.jsx(ae,{history:x}),x.length>0&&e.jsxs("div",{className:"mt-6 space-y-2",children:[e.jsx("h3",{className:"font-semibold text-slate-800 mb-3",children:"All Attempts"}),x.map((d,h)=>e.jsxs("div",{className:"flex items-center justify-between p-3 bg-slate-50 rounded-lg",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm font-medium text-slate-700",children:["Attempt ",x.length-h]}),e.jsx("p",{className:"text-xs text-slate-500",children:new Date(d.completedAt).toLocaleDateString()})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("p",{className:"text-sm font-semibold text-sky-600",children:[d.percentage,"%"]}),e.jsx("p",{className:"text-xs text-slate-500",children:d.proficiencyLevel})]})]},h))]})]},"history")]})})]})})},xe=m.lazy(()=>Q(()=>import("./DashboardAvatar-CbAKGmA6.js"),__vite__mapDeps([0,1,2]))),Ce=({userName:s="Student",userLevel:a=1,avatarLayers:r,onContinueLearning:c,showAssessmentTooltip:i,onOpenAssessment:n,studentId:t,assessmentCompleted:l=!1})=>{const[o,x]=m.useState(!1),[j,p]=m.useState(null);m.useEffect(()=>{if(!o||!t)return;const g=M(t,y=>{p(y)});return()=>g()},[o,t]),m.useEffect(()=>{o||p(null)},[o]);const u=()=>{const g=new Date().getHours();return g<12?"Good Morning":g<18?"Good Afternoon":"Good Evening"};return e.jsxs(f.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6,ease:[.22,1,.36,1]},className:"relative w-full mt-0 rounded-2xl md:rounded-[2rem] p-5 md:p-6 lg:p-8 bg-gradient-to-br from-white via-sky-50/50 to-white border border-slate-200/80 card-elevated-lg",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden rounded-2xl md:rounded-[2rem] pointer-events-none",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-sky-400/50 to-transparent"}),e.jsx("div",{className:"absolute top-0 right-0 w-96 h-96 bg-sky-100/40 rounded-full blur-3xl -translate-y-1/2 translate-x-1/4"}),e.jsx("div",{className:"absolute bottom-0 left-0 w-64 h-64 bg-rose-100/30 rounded-full blur-3xl translate-y-1/2 -translate-x-1/4"}),e.jsx("div",{className:"absolute inset-0 bg-dot-pattern opacity-40"})]}),e.jsx("div",{className:"relative z-10 flex flex-col md:flex-row min-h-[140px] lg:min-h-[160px] items-start md:items-center justify-between gap-4 md:gap-6 pb-0",children:e.jsxs("div",{className:"flex-1 w-full md:w-auto min-w-0 pr-0 md:pr-40 lg:pr-[280px] pb-2 md:pb-0 py-1",children:[e.jsxs("div",{className:"flex flex-wrap md:flex-nowrap items-center gap-2 mb-3 md:mb-2",children:[e.jsx("div",{className:"px-3 md:px-4 py-1.5 rounded-full bg-sky-100 border border-sky-200",children:e.jsxs("span",{className:"text-xs md:text-sm font-body font-bold text-sky-700",children:["Level ",a]})}),e.jsxs("div",{className:"px-3 md:px-4 py-1.5 rounded-full bg-rose-50 border border-rose-200",children:[e.jsx(Y,{size:14,className:"inline -mt-0.5 text-rose-500 mr-1"}),e.jsx("span",{className:"text-xs md:text-sm font-body font-bold text-rose-700",children:"Active"})]})]}),e.jsxs("h1",{className:"text-2xl md:text-2xl lg:text-3xl font-display font-black text-[#0a1628] mb-1.5 tracking-tight leading-[1.1]",children:[u(),", ",s,"!"]}),e.jsx("p",{className:"text-slate-500 mb-2 md:mb-1 text-sm md:text-sm font-body font-bold pr-[155px] md:pr-0",children:"Today is a great day to move one step forward in math mastery."}),e.jsx("p",{className:"text-xs md:text-xs text-slate-400 font-body mb-5 md:mb-4 pr-[150px] md:pr-0",children:"Focus on your next recommended lesson and keep your momentum."}),e.jsxs(f.button,{onClick:c,whileHover:{scale:1.03},whileTap:{scale:.97},className:"mt-2 md:mt-2 bg-gradient-to-r from-purple-600 to-[#9956DE] text-white px-5 py-3 md:py-2 rounded-xl font-body font-bold text-base md:text-sm shadow-lg shadow-purple-500/20 hover:shadow-purple-500/30 transition-all flex justify-center md:justify-start items-center gap-2 group w-auto md:w-auto",children:["Continue Learning",e.jsx(F,{size:14,className:"group-hover:translate-x-1 transition-transform"})]})]})}),i&&e.jsx(f.div,{initial:{opacity:0,scale:.9,x:10},animate:{opacity:1,scale:1,x:0},transition:{delay:.5,type:"spring"},onClick:n,className:"absolute hidden md:block right-[150px] lg:right-[250px] bottom-16 lg:bottom-20 z-30 cursor-pointer drop-shadow-lg group",children:e.jsxs("div",{className:"bg-white px-4 py-3 rounded-2xl rounded-br-sm border-2 border-amber-300 relative transition-all group-hover:bg-amber-50 group-hover:border-amber-400 group-hover:-translate-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-amber-500",children:e.jsx(S,{size:16})}),e.jsxs("p",{className:"text-xs lg:text-sm font-bold text-amber-900 leading-tight",children:["Don't forget to take the",e.jsx("br",{}),"Initial Assessment!"]})]}),e.jsx("div",{className:"absolute -right-2 bottom-0 w-4 h-4 bg-white border-2 border-transparent border-r-amber-300 border-b-amber-300 rotate-45 group-hover:bg-amber-50 group-hover:border-r-amber-400 group-hover:border-b-amber-400 transition-colors"})]})}),l&&!i&&e.jsx(f.div,{initial:{opacity:0,scale:.9,x:10},animate:{opacity:1,scale:1,x:0},transition:{delay:.5,type:"spring"},onClick:()=>window.dispatchEvent(new CustomEvent("mathpulse:navigate",{detail:{tab:"Grades"}})),className:"absolute hidden md:block right-[150px] lg:right-[250px] bottom-16 lg:bottom-20 z-30 cursor-pointer drop-shadow-lg group",children:e.jsxs("div",{className:"bg-white px-4 py-3 rounded-2xl rounded-br-sm border-2 border-teal-300 relative transition-all group-hover:bg-teal-50 group-hover:border-teal-400 group-hover:-translate-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-6 h-6 bg-teal-100 rounded-full flex items-center justify-center shrink-0",children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",className:"text-teal-600",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})}),e.jsxs("p",{className:"text-xs lg:text-sm font-bold text-teal-900 leading-tight",children:["Assessment Complete!",e.jsx("br",{}),e.jsx("span",{className:"text-[10px] lg:text-[11px] font-normal text-teal-700",children:"View results & history"})]})]}),e.jsx("div",{className:"absolute -right-2 bottom-0 w-4 h-4 bg-white border-2 border-transparent border-r-teal-300 border-b-teal-300 rotate-45 group-hover:bg-teal-50 group-hover:border-r-teal-400 group-hover:border-b-teal-400 transition-colors"})]})}),o&&t&&e.jsx(me,{isOpen:o,onClose:()=>x(!1),studentId:t,heroBannerSummary:j}),e.jsx("div",{className:"absolute right-0 bottom-0 lg:right-10 w-[160px] md:w-[150px] lg:w-[270px] pointer-events-none z-20",style:{clipPath:"inset(-100% -50% 0 -50%)"},children:e.jsx("div",{className:"relative w-full aspect-[4/5] translate-y-[10%] md:translate-y-[21%] lg:translate-y-[19%] drop-shadow-2xl",children:e.jsx(m.Suspense,{fallback:e.jsx("div",{className:"w-full h-full scale-[1.15] md:scale-[1.25] lg:scale-[1.3] origin-bottom"}),children:e.jsx(xe,{layers:r,className:"w-full h-full scale-[1.35] md:scale-[1.25] lg:scale-[1.3] origin-bottom"})})})})]})};export{Ce as default};
|
|
|
|
| 1 |
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardAvatar-CbAKGmA6.js","assets/vendor-react-B4AQeu28.js","assets/avatarData-BuQSOXo3.js"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{T as R,g as b,a1 as M,h as _,m as f,a2 as E,A as G,B as S,q as z,Z as Y,a as F,_ as Q}from"./index-CGNBpSmO.js";import{j as e,r as m}from"./vendor-react-B4AQeu28.js";import{D as W,a as q,S as V}from"./dialog-DDOyFRnI.js";import{R as K,L as X,C as U,X as Z,Y as O,T as I,f as J}from"./vendor-charts-D7t7JfSr.js";import{collection as v,query as w,limit as N,orderBy as k,getDocs as A,getDoc as L,doc as C}from"./vendor-firebase-firestore-CNv3xXal.js";import{X as ee}from"./x-Deb9zs8O.js";import{C as H}from"./circle-alert-fZn6_hMx.js";import{C as se}from"./circle-check-BhLH88x1.js";import{S as te}from"./sparkles-C0ju-UTT.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-markdown-yqZQ_iQm.js";const ae=({history:s})=>{if(s.length===0)return e.jsxs("div",{className:"text-center py-12 text-slate-400",children:[e.jsx(R,{className:"w-12 h-12 mx-auto mb-3 opacity-40"}),e.jsx("p",{className:"text-sm",children:"Complete more assessments to see your progress history."})]});const a=s.map(r=>({date:new Date(r.completedAt).toLocaleDateString("en-US",{month:"short",day:"numeric"}),score:r.percentage,level:r.proficiencyLevel}));return e.jsx("div",{className:"w-full",children:e.jsx(K,{width:"100%",height:250,children:e.jsxs(X,{data:a,margin:{top:10,right:20,left:0,bottom:5},children:[e.jsx(U,{strokeDasharray:"3 3",stroke:"#e2e8f0"}),e.jsx(Z,{dataKey:"date",tick:{fontSize:12,fill:"#64748b"}}),e.jsx(O,{domain:[0,100],tick:{fontSize:12,fill:"#64748b"}}),e.jsx(I,{contentStyle:{borderRadius:"12px",border:"1px solid #e2e8f0",boxShadow:"0 4px 12px rgba(0,0,0,0.08)"}}),e.jsx(J,{type:"monotone",dataKey:"score",stroke:"#0ea5e9",strokeWidth:3,dot:{fill:"#0ea5e9",strokeWidth:2,r:5},activeDot:{r:7,fill:"#0284c7"}})]})})})};async function re(s){const a=v(b,"assessmentResults",s,"attempts"),r=w(a,k("completedAt","desc"),N(10));return(await A(r)).docs.map(i=>{const n=i.data();return{attemptId:n.attemptId,score:n.score,totalQuestions:n.totalQuestions,percentage:n.percentage,completedAt:n.completedAt?.toDate?.()?.toISOString()||n.completedAt,proficiencyLevel:n.proficiencyLevel}})}async function le(s){const a=v(b,"assessmentResults",s,"attempts"),r=w(a,k("completedAt","desc"),N(1)),c=await A(r);if(c.empty)return null;const n=c.docs[0].data();return{...n,completedAt:n.completedAt?.toDate?.()?.toISOString()||n.completedAt}}const oe={Beginner:"bg-amber-100 text-amber-700 border-amber-300",Developing:"bg-blue-100 text-blue-700 border-blue-300",Proficient:"bg-emerald-100 text-emerald-700 border-emerald-300",Advanced:"bg-violet-100 text-violet-700 border-violet-300"},ne=({result:s})=>e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"bg-gradient-to-br from-sky-500 to-teal-600 rounded-xl p-6 text-white",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sky-200 text-sm font-medium",children:"Total Score"}),e.jsxs("p",{className:"text-4xl font-bold",children:[s.score,"/",s.totalQuestions]}),e.jsxs("p",{className:"text-sky-200 text-sm mt-1",children:[s.percentage,"% Correct"]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("p",{className:"text-sky-200 text-sm font-medium",children:"Proficiency"}),e.jsx("span",{className:`inline-block mt-1 px-3 py-1 rounded-full text-sm font-semibold border ${oe[s.proficiencyLevel]}`,children:s.proficiencyLevel})]})]})}),e.jsxs("div",{children:[e.jsxs("h3",{className:"font-semibold text-slate-800 mb-3 flex items-center gap-2",children:[e.jsx(S,{className:"w-4 h-4 text-sky-500"}),"Competency Breakdown"]}),e.jsx("div",{className:"space-y-2",children:s.competencyBreakdown.map((a,r)=>e.jsxs("div",{className:"flex items-center gap-3 p-3 bg-slate-50 rounded-lg",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm font-medium text-slate-700",children:a.topic}),e.jsxs("p",{className:"text-xs text-slate-500",children:[a.correctAnswers,"/",a.totalQuestions," correct"]})]}),e.jsx("div",{className:"w-20 h-2 bg-slate-200 rounded-full overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full ${a.accuracyPercent>=70?"bg-emerald-500":"bg-red-400"}`,style:{width:`${a.accuracyPercent}%`}})}),e.jsxs("span",{className:"text-sm font-semibold text-slate-600 w-10 text-right",children:[a.accuracyPercent,"%"]})]},r))})]}),s.aiNarrative&&e.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-xl p-4",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(te,{className:"w-4 h-4 text-amber-500 mt-0.5 flex-shrink-0"}),e.jsx("p",{className:"text-sm text-amber-800 leading-relaxed",children:s.aiNarrative})]})}),e.jsxs("div",{children:[e.jsxs("h3",{className:"font-semibold text-slate-800 mb-3 flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4 text-sky-500"}),"Question Breakdown"]}),e.jsx("div",{className:"space-y-3",children:s.answers.map((a,r)=>e.jsxs("div",{className:`p-4 rounded-xl border-2 ${a.isCorrect?"border-emerald-200 bg-emerald-50/30":"border-red-200 bg-red-50/30"}`,children:[e.jsxs("p",{className:"text-sm font-medium text-slate-800 mb-2",children:["Q",r+1,". ",a.questionText]}),e.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[e.jsxs("span",{className:"text-slate-500",children:["Your answer: ",e.jsx("span",{className:a.isCorrect?"text-emerald-600 font-medium":"text-red-500 font-medium",children:a.userAnswer||"β"})]}),!a.isCorrect&&e.jsxs("span",{className:"text-slate-500",children:["Correct: ",e.jsx("span",{className:"text-emerald-600 font-medium",children:a.correctAnswer})]})]}),a.explanation&&e.jsx("p",{className:"text-xs text-slate-500 mt-2 leading-relaxed",children:a.explanation})]},r))})]})]}),ie=({summary:s})=>e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between",children:[e.jsxs("div",{className:"bg-sky-50 border border-sky-100 rounded-2xl p-4 flex items-center gap-4 flex-1",children:[e.jsxs("div",{className:"w-12 h-12 bg-sky-500 rounded-full flex items-center justify-center text-white font-bold text-lg shadow-sm",children:[s.latestScorePercent,"%"]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-slate-500",children:"Latest Score"}),e.jsx("p",{className:"text-slate-800 font-bold",children:s.headline})]})]}),s.latestRiskLevel&&e.jsxs("div",{className:`px-4 py-2 rounded-full text-sm font-semibold flex items-center gap-2
|
| 3 |
${s.latestRiskLevel==="At Risk"?"bg-red-100 text-red-700":s.latestRiskLevel==="Needs Attention"?"bg-amber-100 text-amber-700":"bg-emerald-100 text-emerald-700"}`,children:[s.latestRiskLevel==="At Risk"?e.jsx(V,{className:"w-4 h-4"}):s.latestRiskLevel==="Needs Attention"?e.jsx(H,{className:"w-4 h-4"}):e.jsx(se,{className:"w-4 h-4"}),s.latestRiskLevel]})]}),e.jsx("div",{className:"bg-slate-50 p-5 rounded-2xl border border-slate-100",children:e.jsx("p",{className:"text-slate-700 leading-relaxed",children:s.summary})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.strengths?.length>0&&e.jsxs("div",{className:"border border-emerald-100 bg-emerald-50/30 rounded-xl p-4",children:[e.jsxs("h4",{className:"font-semibold text-emerald-800 mb-3 flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"Strengths"]}),e.jsx("ul",{className:"space-y-2",children:s.strengths.map((a,r)=>e.jsxs("li",{className:"text-sm text-emerald-700 flex items-start gap-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 mt-1.5 flex-shrink-0"}),e.jsx("span",{children:a})]},r))})]}),s.weaknesses?.length>0&&e.jsxs("div",{className:"border border-amber-100 bg-amber-50/30 rounded-xl p-4",children:[e.jsxs("h4",{className:"font-semibold text-amber-800 mb-3 flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"Focus Areas"]}),e.jsx("ul",{className:"space-y-2",children:s.weaknesses.map((a,r)=>e.jsxs("li",{className:"text-sm text-amber-700 flex items-start gap-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 mt-1.5 flex-shrink-0"}),e.jsx("span",{children:a})]},r))})]})]}),s.recommendation&&e.jsxs("div",{className:"bg-gradient-to-br from-indigo-50 to-purple-50 rounded-xl p-5 border border-indigo-100",children:[e.jsxs("h4",{className:"font-semibold text-indigo-900 mb-2 flex items-center gap-2",children:[e.jsx(S,{className:"w-4 h-4 text-indigo-500"}),"Recommended Next Step"]}),e.jsx("p",{className:"text-sm text-indigo-800 leading-relaxed",children:s.recommendation})]})]}),de=({heroBannerSummary:s,latestResult:a,loading:r})=>r?e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"h-32 bg-slate-200 rounded-xl"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-4 bg-slate-200 rounded w-3/4"}),e.jsx("div",{className:"h-4 bg-slate-200 rounded w-1/2"}),e.jsx("div",{className:"h-4 bg-slate-200 rounded w-5/6"})]})]}):!s&&!a?e.jsxs("div",{className:"text-center py-8",children:[e.jsx("div",{className:"w-16 h-16 bg-sky-100 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(S,{className:"w-8 h-8 text-sky-500"})}),e.jsx("h3",{className:"text-lg font-bold text-slate-800 mb-2",children:"Let's personalize your learning"}),e.jsx("p",{className:"text-sm text-slate-500 max-w-xs mx-auto",children:"Complete your diagnostic assessment so I can understand your strengths, weak areas, and the best next lessons for you."})]}):s?.status==="ready"?e.jsx(ie,{summary:s}):a?e.jsx(ne,{result:a}):e.jsxs("div",{className:"text-center py-8",children:[e.jsx("div",{className:"w-16 h-16 bg-amber-100 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(H,{className:"w-8 h-8 text-amber-500"})}),e.jsx("h3",{className:"text-lg font-bold text-slate-800 mb-2",children:"Your learning summary is being prepared"}),e.jsx("p",{className:"text-sm text-slate-500 max-w-xs mx-auto",children:"Please try opening this again in a moment."})]});async function ce(s){const a=await L(C(b,"competencyProfiles",s)).catch(()=>null);if(a?.exists()){const t=a.data(),l=t.primaryStrength?[t.primaryStrength]:[],o=t.primaryWeakness?[t.primaryWeakness]:[];return{status:"ready",headline:t.overallScore>=70?"Good job β keep it up!":"Let's build your foundation",summary:o.length>0?`Focus on strengthening ${o[0]} to improve your overall performance.`:"Keep practicing to maintain and expand your skills.",strengths:l,weaknesses:o,recommendation:t.suggestedModule?`Start with the ${t.suggestedModule} module.`:"Continue with your personalized learning path.",latestAssessmentId:"",latestScorePercent:t.overallScore||0,latestRiskLevel:t.overallScore>=70?"Low":t.overallScore>=50?"Moderate":"High",updatedAt:t.updatedAt?.toDate?.()||new Date}}const r=await A(w(v(b,"assessments",s,"attempts"),k("completedAt","desc"),N(1))).catch(()=>null);if(r&&!r.empty){const t=r.docs[0].data(),l=t.rawScore||t.overallScorePercent||0,o=t.proficiencyProfile;return{status:"ready",headline:l>=70?"Good job β keep it up!":"Let's build your foundation",summary:o?.weaknesses?.length>0?`Focus on strengthening ${o.weaknesses[0]} to improve.`:l>=70?"You have a solid foundation!":"With practice, you'll build confidence.",strengths:o?.strengths||[],weaknesses:o?.weaknesses||[],recommendation:o?.suggestedStartingModule?`Start with ${o.suggestedStartingModule}.`:"Follow your personalized learning path.",latestAssessmentId:t.assessmentId||"",latestScorePercent:l,latestRiskLevel:l>=70?"Low":l>=50?"Moderate":"High",updatedAt:t.completedAt?.toDate?.()||new Date}}const c=await L(C(b,"diagnosticResults",s)).catch(()=>null);if(c?.exists()){const t=c.data(),l=t.overallScorePercent||t.overall_score_percent||0,o=t.riskProfile?.weak_domains||[];return{status:"ready",headline:l>=70?"Good job β keep it up!":"Let's build your foundation",summary:o.length>0?`Areas to focus on: ${o.join(", ")}.`:"Assessment completed. Follow your learning path.",strengths:[],weaknesses:o,recommendation:t.recommended_intervention||"Continue with your personalized learning path.",latestAssessmentId:"",latestScorePercent:l,latestRiskLevel:t.overall_risk||(l>=70?"Low":"Moderate"),updatedAt:t.completedAt?.toDate?.()||new Date}}const i=await A(w(v(b,"users",s,"assessments"),k("completedAt","desc"),N(5))).catch(()=>null);if(i&&!i.empty){const t=i.docs.map(p=>p.data()),l=t[0],o=l.score||l.scorePercent||0,x=t.length,j=Math.round(t.reduce((p,u)=>p+(u.score||u.scorePercent||0),0)/x);return{status:"ready",headline:o>=70?"Good job β keep it up!":"Let's build your foundation",summary:`You've completed ${x} diagnostic assessment${x>1?"s":""}. Your latest score is ${o}% (average: ${j}%).`,strengths:[],weaknesses:l.risk==="At Risk"||l.risk==="High"?[l.subject||"General Mathematics"]:[],recommendation:"Continue with your personalized learning path to strengthen weak areas.",latestAssessmentId:l.testId||"",latestScorePercent:o,latestRiskLevel:l.risk||(o>=70?"Low":o>=50?"Moderate":"High"),updatedAt:l.completedAt?.toDate?.()||new Date}}const n=await L(C(b,"users",s)).catch(()=>null);if(n?.exists()){const t=n.data();if(t.initialAssessmentCompleted||t.hasCompletedInitialAssessment){const l=t.atRiskSubjects||[];return{status:"ready",headline:"Assessment Complete! β",summary:l.length>0?`Areas to focus on: ${l.join(", ")}. Follow your personalized learning path to improve.`:"Your diagnostic assessment is complete. Your personalized learning path is ready.",strengths:[],weaknesses:l,recommendation:"Continue with your recommended lessons to strengthen your skills.",latestAssessmentId:"",latestScorePercent:0,latestRiskLevel:l.length>0?"Moderate":"Low",updatedAt:t.assessmentCompletedAt?.toDate?.()||new Date}}}return null}const me=({isOpen:s,onClose:a,studentId:r,latestResult:c,heroBannerSummary:i})=>{const[n,t]=m.useState("latest"),[l,o]=m.useState(c||null),[x,j]=m.useState([]),[p,u]=m.useState(!1),[g,y]=m.useState(null);m.useEffect(()=>{if(s&&r&&!i){const d=M(r,h=>{y(h)});return()=>d()}},[s,r,i]);const $=i||g;m.useEffect(()=>{s&&r&&(u(!0),(async()=>{try{const[h,T]=await Promise.all([c?Promise.resolve(c):le(r),re(r)]);if(o(h),j(T),!i&&!g){const D=await E(r);if(D)y(D);else{const P=await ce(r);P&&y(P)}}}catch(h){console.error("[AssessmentResultsModal] fetch error:",h)}finally{u(!1)}})())},[s,r,c]);const B=[{key:"latest",label:"Last Results",icon:e.jsx(G,{className:"w-4 h-4"})},{key:"history",label:"History & Trends",icon:e.jsx(R,{className:"w-4 h-4"})}];return e.jsx(W,{open:s,onOpenChange:d=>!d&&a(),children:e.jsxs(q,{className:"max-w-2xl max-h-[85vh] overflow-y-auto p-0 bg-white rounded-2xl shadow-2xl border-0",children:[e.jsxs("div",{className:"sticky top-0 z-10 bg-white border-b border-slate-200 rounded-t-2xl px-6 py-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h2",{className:"text-xl font-bold text-slate-800",children:"Assessment Results"}),e.jsx("button",{onClick:a,className:"p-1.5 rounded-lg hover:bg-slate-100 transition-colors",children:e.jsx(ee,{className:"w-5 h-5 text-slate-400"})})]}),e.jsx("div",{className:"flex gap-1 bg-slate-100 p-1 rounded-lg",children:B.map(d=>e.jsxs("button",{onClick:()=>t(d.key),className:`flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-all ${n===d.key?"bg-white text-sky-600 shadow-sm":"text-slate-600 hover:text-slate-800"}`,children:[d.icon,d.label]},d.key))})]}),e.jsx("div",{className:"px-6 py-5",children:e.jsxs(_,{mode:"wait",children:[n==="latest"&&e.jsx(f.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},children:e.jsx(de,{heroBannerSummary:$,latestResult:l,loading:p})},"latest"),n==="history"&&e.jsxs(f.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},children:[e.jsx(ae,{history:x}),x.length>0&&e.jsxs("div",{className:"mt-6 space-y-2",children:[e.jsx("h3",{className:"font-semibold text-slate-800 mb-3",children:"All Attempts"}),x.map((d,h)=>e.jsxs("div",{className:"flex items-center justify-between p-3 bg-slate-50 rounded-lg",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm font-medium text-slate-700",children:["Attempt ",x.length-h]}),e.jsx("p",{className:"text-xs text-slate-500",children:new Date(d.completedAt).toLocaleDateString()})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("p",{className:"text-sm font-semibold text-sky-600",children:[d.percentage,"%"]}),e.jsx("p",{className:"text-xs text-slate-500",children:d.proficiencyLevel})]})]},h))]})]},"history")]})})]})})},xe=m.lazy(()=>Q(()=>import("./DashboardAvatar-CbAKGmA6.js"),__vite__mapDeps([0,1,2]))),Ce=({userName:s="Student",userLevel:a=1,avatarLayers:r,onContinueLearning:c,showAssessmentTooltip:i,onOpenAssessment:n,studentId:t,assessmentCompleted:l=!1})=>{const[o,x]=m.useState(!1),[j,p]=m.useState(null);m.useEffect(()=>{if(!o||!t)return;const g=M(t,y=>{p(y)});return()=>g()},[o,t]),m.useEffect(()=>{o||p(null)},[o]);const u=()=>{const g=new Date().getHours();return g<12?"Good Morning":g<18?"Good Afternoon":"Good Evening"};return e.jsxs(f.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6,ease:[.22,1,.36,1]},className:"relative w-full mt-0 rounded-2xl md:rounded-[2rem] p-5 md:p-6 lg:p-8 bg-gradient-to-br from-white via-sky-50/50 to-white border border-slate-200/80 card-elevated-lg",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden rounded-2xl md:rounded-[2rem] pointer-events-none",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-sky-400/50 to-transparent"}),e.jsx("div",{className:"absolute top-0 right-0 w-96 h-96 bg-sky-100/40 rounded-full blur-3xl -translate-y-1/2 translate-x-1/4"}),e.jsx("div",{className:"absolute bottom-0 left-0 w-64 h-64 bg-rose-100/30 rounded-full blur-3xl translate-y-1/2 -translate-x-1/4"}),e.jsx("div",{className:"absolute inset-0 bg-dot-pattern opacity-40"})]}),e.jsx("div",{className:"relative z-10 flex flex-col md:flex-row min-h-[140px] lg:min-h-[160px] items-start md:items-center justify-between gap-4 md:gap-6 pb-0",children:e.jsxs("div",{className:"flex-1 w-full md:w-auto min-w-0 pr-0 md:pr-40 lg:pr-[280px] pb-2 md:pb-0 py-1",children:[e.jsxs("div",{className:"flex flex-wrap md:flex-nowrap items-center gap-2 mb-3 md:mb-2",children:[e.jsx("div",{className:"px-3 md:px-4 py-1.5 rounded-full bg-sky-100 border border-sky-200",children:e.jsxs("span",{className:"text-xs md:text-sm font-body font-bold text-sky-700",children:["Level ",a]})}),e.jsxs("div",{className:"px-3 md:px-4 py-1.5 rounded-full bg-rose-50 border border-rose-200",children:[e.jsx(Y,{size:14,className:"inline -mt-0.5 text-rose-500 mr-1"}),e.jsx("span",{className:"text-xs md:text-sm font-body font-bold text-rose-700",children:"Active"})]})]}),e.jsxs("h1",{className:"text-2xl md:text-2xl lg:text-3xl font-display font-black text-[#0a1628] mb-1.5 tracking-tight leading-[1.1]",children:[u(),", ",s,"!"]}),e.jsx("p",{className:"text-slate-500 mb-2 md:mb-1 text-sm md:text-sm font-body font-bold pr-[155px] md:pr-0",children:"Today is a great day to move one step forward in math mastery."}),e.jsx("p",{className:"text-xs md:text-xs text-slate-400 font-body mb-5 md:mb-4 pr-[150px] md:pr-0",children:"Focus on your next recommended lesson and keep your momentum."}),e.jsxs(f.button,{onClick:c,whileHover:{scale:1.03},whileTap:{scale:.97},className:"mt-2 md:mt-2 bg-gradient-to-r from-purple-600 to-[#9956DE] text-white px-5 py-3 md:py-2 rounded-xl font-body font-bold text-base md:text-sm shadow-lg shadow-purple-500/20 hover:shadow-purple-500/30 transition-all flex justify-center md:justify-start items-center gap-2 group w-auto md:w-auto",children:["Continue Learning",e.jsx(F,{size:14,className:"group-hover:translate-x-1 transition-transform"})]})]})}),i&&e.jsx(f.div,{initial:{opacity:0,scale:.9,x:10},animate:{opacity:1,scale:1,x:0},transition:{delay:.5,type:"spring"},onClick:n,className:"absolute hidden md:block right-[150px] lg:right-[250px] bottom-16 lg:bottom-20 z-30 cursor-pointer drop-shadow-lg group",children:e.jsxs("div",{className:"bg-white px-4 py-3 rounded-2xl rounded-br-sm border-2 border-amber-300 relative transition-all group-hover:bg-amber-50 group-hover:border-amber-400 group-hover:-translate-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-amber-500",children:e.jsx(S,{size:16})}),e.jsxs("p",{className:"text-xs lg:text-sm font-bold text-amber-900 leading-tight",children:["Don't forget to take the",e.jsx("br",{}),"Initial Assessment!"]})]}),e.jsx("div",{className:"absolute -right-2 bottom-0 w-4 h-4 bg-white border-2 border-transparent border-r-amber-300 border-b-amber-300 rotate-45 group-hover:bg-amber-50 group-hover:border-r-amber-400 group-hover:border-b-amber-400 transition-colors"})]})}),l&&!i&&e.jsx(f.div,{initial:{opacity:0,scale:.9,x:10},animate:{opacity:1,scale:1,x:0},transition:{delay:.5,type:"spring"},onClick:()=>window.dispatchEvent(new CustomEvent("mathpulse:navigate",{detail:{tab:"Grades"}})),className:"absolute hidden md:block right-[150px] lg:right-[250px] bottom-16 lg:bottom-20 z-30 cursor-pointer drop-shadow-lg group",children:e.jsxs("div",{className:"bg-white px-4 py-3 rounded-2xl rounded-br-sm border-2 border-teal-300 relative transition-all group-hover:bg-teal-50 group-hover:border-teal-400 group-hover:-translate-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-6 h-6 bg-teal-100 rounded-full flex items-center justify-center shrink-0",children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",className:"text-teal-600",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})}),e.jsxs("p",{className:"text-xs lg:text-sm font-bold text-teal-900 leading-tight",children:["Assessment Complete!",e.jsx("br",{}),e.jsx("span",{className:"text-[10px] lg:text-[11px] font-normal text-teal-700",children:"View results & history"})]})]}),e.jsx("div",{className:"absolute -right-2 bottom-0 w-4 h-4 bg-white border-2 border-transparent border-r-teal-300 border-b-teal-300 rotate-45 group-hover:bg-teal-50 group-hover:border-r-teal-400 group-hover:border-b-teal-400 transition-colors"})]})}),o&&t&&e.jsx(me,{isOpen:o,onClose:()=>x(!1),studentId:t,heroBannerSummary:j}),e.jsx("div",{className:"absolute right-0 bottom-0 lg:right-10 w-[160px] md:w-[150px] lg:w-[270px] pointer-events-none z-20",style:{clipPath:"inset(-100% -50% 0 -50%)"},children:e.jsx("div",{className:"relative w-full aspect-[4/5] translate-y-[10%] md:translate-y-[21%] lg:translate-y-[19%] drop-shadow-2xl",children:e.jsx(m.Suspense,{fallback:e.jsx("div",{className:"w-full h-full scale-[1.15] md:scale-[1.25] lg:scale-[1.3] origin-bottom"}),children:e.jsx(xe,{layers:r,className:"w-full h-full scale-[1.35] md:scale-[1.25] lg:scale-[1.3] origin-bottom"})})})})]})};export{Ce as default};
|
assets/{InitialAssessmentModal-BZbG1PlT.js β InitialAssessmentModal-J2vAV5pW.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as l,j as e}from"./vendor-react-B4AQeu28.js";import{B as j}from"./button-
|
|
|
|
| 1 |
+
import{r as l,j as e}from"./vendor-react-B4AQeu28.js";import{B as j}from"./button-DVjn4LkC.js";import{g as y}from"./diagnosticService-DLw8ENQS.js";import{updateDoc as N,doc as v,serverTimestamp as w}from"./vendor-firebase-firestore-CNv3xXal.js";import{m as o,B as k,x as C,p as L,g as z}from"./index-CGNBpSmO.js";import{X as S}from"./x-Deb9zs8O.js";import{C as A}from"./circle-check-big-yCNC9yfs.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-D7t7JfSr.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-markdown-yqZQ_iQm.js";const H=({isOpen:n,onClose:d,onDismiss:m,userId:c,strand:x,gradeLevel:p,onAssessmentStart:u,onAssessmentComplete:I})=>{const[t,a]=l.useState(!1),[r,i]=l.useState(null),h=async()=>{a(!0),i(null);try{const s=await y(x,p);sessionStorage.setItem("mathpulse_diagnostic",JSON.stringify({testId:s.test_id,questions:s.questions,totalItems:s.total_items,estimatedMinutes:s.estimated_minutes})),u(s.test_id,s.questions)}catch(s){const b=s instanceof Error?s.message:"Failed to load assessment";i(b),a(!1)}},f=()=>{sessionStorage.setItem("mathpulse_iar_session_dismissed","true"),d()},g=async()=>{try{await N(v(z,"users",c),{assessmentDismissed:!0,assessmentDismissedAt:w()})}catch(s){console.error("[diagnostic] Failed to save dismiss state:",s)}m()};return n?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:s=>s.stopPropagation(),children:e.jsxs(o.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{type:"spring",damping:25,stiffness:200},className:"bg-white rounded-2xl shadow-2xl max-w-[44rem] w-full flex flex-col overflow-hidden pointer-events-auto",onClick:s=>s.stopPropagation(),style:{willChange:"transform, opacity"},children:[e.jsxs("div",{className:"px-5 py-3 border-b border-[#dde3eb] flex items-center justify-between bg-[#edf1f7] flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 bg-purple-100 rounded-lg flex items-center justify-center text-purple-600",children:e.jsx(k,{size:18})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-bold text-[#0a1628] leading-tight",children:"Initial Assessment"}),e.jsx("p",{className:"text-[11px] text-[#5a6578]",children:"Analyze your strengths & weaknesses"})]})]}),e.jsx("button",{onClick:f,"aria-label":"Close assessment modal",className:"ml-auto w-8 h-8 rounded-lg flex items-center justify-center text-[#5a6578] hover:bg-[#dde3eb] hover:text-[#0a1628] transition-colors",children:e.jsx(S,{size:18})})]}),e.jsx("div",{className:"p-5 text-center space-y-3",children:e.jsxs(o.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.3,ease:"easeOut"},children:[e.jsx("div",{className:"w-20 h-20 bg-purple-50 rounded-full flex items-center justify-center mx-auto mb-3",children:e.jsx("svg",{className:"w-9 h-9 text-purple-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 00-2.455 2.456zM16.894 20.567L16.5 21.75l-.394-1.183a2.25 2.25 0 00-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 001.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 001.423 1.423l1.183.394-1.183.394a2.25 2.25 0 00-1.423 1.423z"})})}),e.jsx("h3",{className:"text-lg font-bold text-[#0a1628]",children:"Welcome to MathPulse AI!"}),e.jsx("p",{className:"text-[13px] text-[#5a6578] max-w-[24rem] mx-auto leading-relaxed",children:"To personalize your learning path, complete a DepEd competency-based SHS diagnostic (15 items, around 11.6 minutes)."}),e.jsxs("div",{className:"grid grid-cols-2 gap-2.5 max-w-[28rem] mx-auto text-left mt-4",children:[e.jsxs("div",{className:"bg-[#edf1f7] p-2.5 rounded-lg border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-bold text-[13px] text-[#0a1628] mb-1",children:[e.jsx(A,{size:14,className:"text-teal-500"}),"Personalized Path"]}),e.jsx("p",{className:"text-[10px] text-[#5a6578] pl-[18px]",children:"Get recommendations based on your level."})]}),e.jsxs("div",{className:"bg-[#edf1f7] p-2.5 rounded-lg border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-bold text-[13px] text-[#0a1628] mb-1",children:[e.jsx(C,{size:14,className:"text-rose-500"}),"Identify Risks"]}),e.jsx("p",{className:"text-[10px] text-[#5a6578] pl-[18px]",children:"Spot areas that need more attention early."})]})]}),r&&e.jsx("div",{className:"mt-3 p-2.5 bg-red-50 border border-red-200 rounded-lg",children:e.jsx("p",{className:"text-xs text-red-700",children:r})}),e.jsxs("div",{className:"pt-3 space-y-2.5",children:[e.jsx(j,{onClick:h,disabled:t,className:"bg-gradient-to-r from-purple-600 to-purple-500 hover:from-purple-700 hover:to-purple-600 text-white px-5 py-3 rounded-xl text-sm font-bold shadow-lg shadow-purple-200 w-full max-w-[380px] mx-auto",children:t?e.jsxs(e.Fragment,{children:[e.jsx(L,{size:16,className:"animate-spin mr-2"}),"Crafting your assessment..."]}):"Start Assessment"}),t&&e.jsx("p",{className:"text-[10px] text-slate-400 max-w-[24rem] mx-auto text-center leading-relaxed",children:"This may take up to 90 seconds while AI generates your personalized test."}),!t&&e.jsx("button",{onClick:g,disabled:t,className:"block mx-auto text-xs text-slate-500 hover:text-[#5a6578] transition-colors font-medium disabled:opacity-40",children:"Skip for now"})]})]})})]})}):null};export{H as default};
|
assets/{LeaderboardPage-BSAGck0o.js β LeaderboardPage-Bttk2eAz.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{r as l,j as e}from"./vendor-react-B4AQeu28.js";import{e as O,aI as W,h as q,m as n,
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{r as l,j as e}from"./vendor-react-B4AQeu28.js";import{e as O,aI as W,h as q,m as n,b as y,q as P,A as k,E as m,T as E,p as _,a4 as I,a5 as H,X as U,u as $,aJ as G,R as J,L as K,z as X}from"./index-CGNBpSmO.js";import{X as Q}from"./x-Deb9zs8O.js";import{C as V}from"./clock-D2bky9WI.js";import{u as Z}from"./useFeatureAccess-BUoKpUf3.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-D7t7JfSr.js";import"./vendor-markdown-yqZQ_iQm.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{LearningPath-3spRtYqf.js β LearningPath-B5QBkJ31.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as p,d as g,j as r}from"./vendor-react-B4AQeu28.js";import{u as b,a9 as j,aa as N,y as k,
|
|
|
|
| 1 |
+
import{r as p,d as g,j as r}from"./vendor-react-B4AQeu28.js";import{u as b,a9 as j,aa as N,y as k,b as P,a as I}from"./index-CGNBpSmO.js";import{M as v}from"./ModuleFolderCard-dHGX9Tik.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-D7t7JfSr.js";import"./vendor-markdown-yqZQ_iQm.js";import"./useSubjectAvailability-iyC7Wdl7.js";import"./clock-D2bky9WI.js";const z=({onNavigateToModules:m,atRiskSubjects:l=[],priorityTopics:o=[],modules:i})=>{const{userProfile:d}=b(),[x,h]=p.useState(null),a=g.useMemo(()=>{const e=o.length>0?o:l.map(s=>j(s)).filter(s=>s!==null),t=new Set;return e.filter(s=>t.has(s)?!1:(t.add(s),!0))},[o,l]),u=g.useMemo(()=>{if(a.length===0)return i.slice(0,3);const e=new Map(a.map((t,s)=>[N[t],s]));return[...i].sort((t,s)=>{const n=e.get(t.id)??Number.POSITIVE_INFINITY,w=e.get(s.id)??Number.POSITIVE_INFINITY;return n-w}).slice(0,3)},[i,a]);p.useEffect(()=>{d?.uid&&k(d.uid).then(h).catch(console.error)},[d?.uid]);const c=u.slice(0,3).map(e=>{const t=x?.subjects?.[e.subject]?.modulesProgress?.[e.id],s=e.lessons.length,n=t?.progress??(s>0?Math.round((t?.lessonsCompleted?.length||0)/s*100):0);return{...e,progress:n,status:n===100?"Completed":n>0?"In Progress":"Not Started"}}),f=c.some(e=>e.progress>0)?"Continue Learning":"Start Learning";return r.jsxs("div",{children:[r.jsxs("div",{className:"flex justify-between items-center mb-4 md:mb-6 px-1",children:[r.jsxs("div",{className:"flex items-center gap-2 md:gap-3",children:[r.jsx("div",{className:"w-8 h-8 md:w-10 md:h-10 shrink-0 rounded-xl md:rounded-[14px] bg-indigo-50 border border-indigo-100 flex items-center justify-center text-indigo-500 shadow-inner",children:r.jsx(P,{className:"w-4 h-4 md:w-5 md:h-5",strokeWidth:2.5})}),r.jsx("h2",{className:"font-display font-black text-lg md:text-[24px] text-slate-800 tracking-tight whitespace-nowrap",children:f})]}),r.jsxs("button",{onClick:()=>m?.(),className:"text-primary font-bold text-xs md:text-sm flex shrink-0 items-center gap-1 hover:gap-2 transition-all bg-primary/10 px-3 py-1.5 md:px-4 md:py-2 rounded-lg md:rounded-xl hover:bg-primary/20 whitespace-nowrap",children:["View All ",r.jsx(I,{className:"w-3.5 h-3.5 md:w-4 md:h-4"})]})]}),r.jsx("div",{className:"flex overflow-x-auto snap-x snap-mandatory scrollbar-hide -mx-4 px-4 pb-4 gap-4 md:grid md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-3 md:gap-6 md:pb-0 md:mx-0 md:px-0 md:overflow-visible",children:c.map((e,t)=>r.jsx("div",{className:"w-[72vw] max-w-[260px] h-[220px] shrink-0 snap-center md:min-w-0 md:max-w-none md:w-auto md:shrink md:h-auto",children:r.jsx(v,{module:e,index:t,onClick:()=>m?.(e.id),isAtRisk:a.length>0,badgeLabel:e.status!=="Not Started"?e.status:void 0})},e.id))})]})};export{z as default};
|
assets/LoginPage-BHI-A5a1.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{r as s,j as e}from"./vendor-react-B4AQeu28.js";import{B as je}from"./button-DVjn4LkC.js";import{I as L}from"./input-CBi6xF4I.js";import{m as i,B as we,T as Ne,A as ke,U as Q,L as X,a as K,G as Se,b as Pe,s as ee,c as Ae,d as te}from"./index-CGNBpSmO.js";import{S as Me}from"./sparkles-C0ju-UTT.js";import{M as Re}from"./mail-C1tKDR_N.js";import{E as Ce,a as Ee}from"./eye-_x45syMF.js";import{S as Te}from"./shield-check-h8afT4cG.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-D7t7JfSr.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-markdown-yqZQ_iQm.js";const se="/assets/shader-bg-DA7bEbBA.mp4",Le=[{id:"length",label:"At least 8 characters",test:a=>a.length>=8},{id:"upper-lower",label:"Contains uppercase and lowercase letters",test:a=>/[A-Z]/.test(a)&&/[a-z]/.test(a)},{id:"number",label:"Contains at least one number",test:a=>/\d/.test(a)},{id:"special",label:"Contains at least one special character",test:a=>/[^A-Za-z0-9]/.test(a)}],I="Use at least 8 characters with uppercase, lowercase, number, and special character.",Ie=a=>{const c=typeof a=="object"&&a!==null?a:null,o=a instanceof Error?a.message:"";if(c?.code&&typeof c.code=="string")return{code:c.code.toLowerCase(),message:o};const n=o.match(/auth\/[a-z-]+/i);return{code:n?n[0].toLowerCase():"",message:o}},ze=a=>a.replace(/^Firebase:\s*/i,"").replace(/\s*\(auth\/[a-z-]+\)\.?/i,"").trim(),ae=(a,c)=>{const{code:o,message:n}=Ie(a),h=ze(n);return o==="auth/invalid-credential"||o==="auth/wrong-password"||o==="auth/user-not-found"?"Invalid email or password. Please check your credentials and try again.":o==="auth/email-already-in-use"?"This email is already registered. Please sign in instead.":o==="auth/weak-password"||o==="auth/password-does-not-meet-requirements"?h?`Password does not meet signup requirements. ${h}`:`Password does not meet signup requirements. ${I}`:o==="auth/too-many-requests"?"Access to this account has been temporarily disabled due to many failed login attempts. You can immediately restore it by resetting your password or you can try again later.":o==="auth/network-request-failed"?"Network error. Please check your internet connection and try again.":o.startsWith("auth/")?h||c:n.includes("Firebase:")||n.includes("auth/")?c:n||c},et=()=>{const a={"Grade 11":["Academic","Tech-Pro"]},[c,o]=s.useState(""),[n,h]=s.useState(""),[S,re]=s.useState(!1),[l,z]=s.useState(!1),[P,ie]=s.useState(""),[y,D]=s.useState("student"),[b,De]=s.useState("Grade 11"),[v,B]=s.useState(a["Grade 11"][0]),[_,x]=s.useState(!1),[f,u]=s.useState(null),[oe,le]=s.useState(!1),[ne,ce]=s.useState(!1),[A,de]=s.useState(16),[q,V]=s.useState("primary"),[O,M]=s.useState(0),R=s.useRef(null),C=s.useRef(null),j=oe&&ne,g=s.useRef("primary"),w=s.useRef(0),N=s.useRef(!1),F=1.1,G=.34,U=t=>{const r=Math.max(0,Math.min(1,t));Math.abs(w.current-r)<.02||(w.current=r,M(r))},$=t=>{!Number.isFinite(t)||t<=0||Math.abs(A-t)>.05&&de(t)},E=s.useMemo(()=>Le.map(t=>({...t,met:t.test(n)})),[n]),W=s.useMemo(()=>E.every(t=>t.met),[E]),me=s.useMemo(()=>{if(!l||!f)return!1;const t=f.toLowerCase();return t.includes("password requirements not met")||t.includes("password does not meet")},[f,l]),ue=()=>{const t=R.current?.duration;t&&Number.isFinite(t)&&t>0&&$(t)},pe=()=>{const t=C.current?.duration;t&&Number.isFinite(t)&&t>0&&$(t)};s.useEffect(()=>{if(!j)return;const t=R.current,r=C.current;if(!t||!r)return;let d=!1,m=0;g.current="primary",V("primary"),N.current=!1,w.current=0,M(0),t.loop=!1,r.loop=!1,t.currentTime=0,r.currentTime=0,r.pause(),t.play().catch(()=>{});const k=()=>{if(d)return;const p=g.current==="primary"?t:r,Z=g.current==="primary"?r:t,ge=Number.isFinite(p.duration)&&p.duration>0?p.duration:A,T=Math.max(ge-p.currentTime,0);if(T<=F){N.current||(N.current=!0,Z.currentTime=0,Z.play().catch(()=>{}));const ve=1-T/F;if(U(ve),T<=.03||p.ended){p.pause(),p.currentTime=0;const J=g.current==="primary"?"secondary":"primary";g.current=J,V(J),N.current=!1,w.current=0,M(0)}}else U(0);m=window.requestAnimationFrame(k)};return m=window.requestAnimationFrame(k),()=>{d=!0,m&&window.cancelAnimationFrame(m)}},[A,j]);const Y=j?G*(1-O):0,H=j?G*O:0,xe=q==="primary"?Y:H,ye=q==="secondary"?Y:H;s.useEffect(()=>{const t=a[b]||[];t.length>0&&!t.includes(v)&&B(t[0])},[b,v]);const he=[{label:"Student",role:"student",email:"teststudent@school.edu",password:"TestPass123!",icon:Se,color:"sky"},{label:"Teacher",role:"teacher",email:"testteacher@school.edu",password:"TestPass123!",icon:Pe,color:"emerald"},{label:"Admin",role:"admin",email:"testadmin@school.edu",password:"TestPass123!",icon:Te,color:"rose"}],be=async(t,r,d)=>{u(null),x(!0),o(t),h(r),D(d),z(!1);try{ee(d),await te(t,r)}catch(m){u(ae(m,"Demo sign-in failed. Please try again.")),x(!1)}},fe=async t=>{t.preventDefault(),u(null),x(!0);try{if(l){if(!P.trim()){u("Please enter your name"),x(!1);return}if(y==="student"&&!b){u("Please select a grade level"),x(!1);return}if(y==="admin"){u("Admin account creation is restricted. Please contact an existing administrator."),x(!1);return}if(!W){u(`Password does not meet signup requirements. ${I}`),x(!1);return}ee(y),await Ae(c,n,P,y,y==="student"?{grade:b,section:v}:{department:"Mathematics"})}else await te(c,n)}catch(r){const d=l?`Sign-up failed. ${I}`:"Sign-in failed. Please check your credentials and try again.";u(ae(r,d)),x(!1)}};return e.jsxs("div",{className:"min-h-screen w-full flex items-center justify-center px-4 sm:px-6 py-8 overflow-y-auto relative login-bg",children:[e.jsx("video",{ref:R,autoPlay:!0,muted:!0,playsInline:!0,preload:"auto",onCanPlay:()=>le(!0),onLoadedMetadata:ue,className:"absolute inset-0 w-full h-full object-cover transition-opacity duration-150 e-opacity",style:{"--o":xe},src:se}),e.jsx("video",{ref:C,autoPlay:!0,muted:!0,playsInline:!0,preload:"auto",onCanPlay:()=>ce(!0),onLoadedMetadata:pe,className:"absolute inset-0 w-full h-full object-cover transition-opacity duration-150 e-opacity",style:{"--o":ye},src:se}),e.jsx("div",{className:"absolute inset-0 pointer-events-none login-frost-overlay"}),e.jsx("div",{className:"absolute top-[10%] left-[-10%] w-[60%] h-[60%] rounded-full blur-[140px] pointer-events-none mix-blend-multiply login-orb-purple"}),e.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[70%] h-[70%] rounded-full blur-[160px] pointer-events-none mix-blend-multiply login-orb-pink"}),e.jsx("div",{className:"absolute top-[40%] left-[40%] w-[40%] h-[40%] rounded-full blur-[120px] pointer-events-none mix-blend-screen login-orb-blue"}),e.jsx("div",{className:"relative z-10 w-full max-w-6xl mx-auto",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 lg:gap-12 items-center",children:[e.jsxs(i.div,{initial:{opacity:0,x:-40},animate:{opacity:1,x:0},transition:{duration:.8,ease:[.22,1,.36,1]},className:"flex flex-col items-center lg:items-start justify-center space-y-5 lg:space-y-8 text-center lg:text-left",children:[e.jsxs(i.div,{className:"flex items-center justify-center lg:justify-start gap-2.5",children:[e.jsx(i.div,{className:"relative flex items-center justify-center drop-shadow-md",children:e.jsx("img",{src:"/mathpulse_final_logo.png",alt:"MathPulse AI Logo",className:"w-10 h-10 lg:w-16 lg:h-16 object-contain flex-shrink-0"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl lg:text-3xl font-display font-black tracking-tight text-slate-900 bg-clip-text text-transparent bg-gradient-to-r from-purple-600 via-pink-600 to-sky-500",children:"MathPulse"}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[e.jsx(Me,{size:12,className:"text-rose-500"}),e.jsx("span",{className:"text-xs text-slate-500 font-body font-medium tracking-wide",children:"Powered by Machine Learning"})]})]})]}),e.jsxs(i.div,{className:"space-y-3 lg:space-y-5",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2,duration:.8},children:[e.jsxs("h2",{className:"text-3xl sm:text-4xl lg:text-5xl xl:text-[3.4rem] font-display font-extrabold leading-[1.1] tracking-tight text-slate-900",children:["Transform Your",e.jsx("br",{}),e.jsx("span",{className:"bg-gradient-to-r from-sky-600 via-cyan-500 to-sky-500 bg-clip-text text-transparent",children:"Math Journey"})]}),e.jsx("p",{className:"text-sm lg:text-base text-slate-500 leading-relaxed max-w-md mx-auto lg:mx-0 font-body",children:"AI-powered predictive system designed to identify at-risk students and provide personalized learning recommendations."})]}),e.jsx("div",{className:"grid grid-cols-3 gap-2 lg:gap-3",children:[{icon:we,label:"AI Predictions",desc:"Smart detection",color:"sky"},{icon:Ne,label:"Analytics",desc:"Real-time data",color:"rose"},{icon:ke,label:"Gamified",desc:"Learn & earn",color:"emerald"}].map((t,r)=>{const d=t.icon,m={sky:"border-sky-200/60 hover:border-sky-300",rose:"border-rose-200/60 hover:border-rose-300",emerald:"border-emerald-200/60 hover:border-emerald-300"},k={sky:"text-sky-600",rose:"text-rose-500",emerald:"text-emerald-600"},p={sky:"bg-sky-100",rose:"bg-rose-100",emerald:"bg-emerald-100"};return e.jsxs(i.div,{className:`bg-white/80 backdrop-blur-xl border ${m[t.color]} rounded-xl p-3 lg:p-4 transition-all cursor-pointer group shadow-md shadow-slate-900/[0.04]`,initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.5+r*.1},whileHover:{scale:1.03,y:-4},children:[e.jsx("div",{className:`w-7 h-7 lg:w-9 lg:h-9 rounded-lg ${p[t.color]} flex items-center justify-center mx-auto lg:mx-0 mb-2 lg:mb-3`,children:e.jsx(d,{size:15,className:k[t.color]})}),e.jsx("h3",{className:"text-xs lg:text-sm font-display font-semibold text-slate-800 mb-0.5",children:t.label}),e.jsx("p",{className:"text-[10px] lg:text-xs text-slate-400 font-body",children:t.desc})]},r)})})]}),e.jsx(i.div,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{duration:.8,delay:.15,ease:[.22,1,.36,1]},className:"relative flex justify-center lg:justify-end",children:e.jsxs("div",{className:"bg-white/85 backdrop-blur-2xl border border-slate-200/60 rounded-3xl p-6 sm:p-7 w-full max-w-md relative overflow-hidden shadow-[0_20px_60px_-15px_rgba(168,85,247,0.15)] max-h-[85vh] overflow-y-auto",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-[3px] bg-gradient-to-r from-purple-500 via-pink-500 to-sky-500"}),e.jsx("div",{className:"absolute -top-40 left-1/2 -translate-x-1/2 w-80 h-80 bg-gradient-to-br from-purple-400/20 to-pink-400/20 rounded-full blur-[60px] pointer-events-none"}),e.jsxs("div",{className:"text-center mb-4 relative",children:[e.jsx(i.h3,{className:"text-2xl font-display font-bold text-slate-900 mb-2",initial:{opacity:0},animate:{opacity:1},transition:{delay:.4},children:l?"Create Account":"Welcome Back"}),e.jsx(i.p,{className:"text-sm text-slate-500 font-body",initial:{opacity:0},animate:{opacity:1},transition:{delay:.5},children:l?"Begin your learning journey":"Sign in to continue learning"})]}),e.jsxs("form",{onSubmit:fe,className:"space-y-3 mb-4 relative",children:[f&&!me&&e.jsx(i.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"bg-rose-50 border border-rose-200 text-rose-600 px-4 py-3 rounded-lg text-sm font-body",children:f}),l&&e.jsxs(i.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Full Name"}),e.jsxs("div",{className:"relative",children:[e.jsx(Q,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(L,{type:"text",placeholder:"Your Name",value:P,onChange:t=>ie(t.target.value),className:"w-full pl-11 pr-4 py-3 rounded-lg bg-slate-100/70 border-slate-200/80 text-slate-900 placeholder:text-slate-400 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all",required:!0})]})]}),l&&e.jsxs(i.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.45},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Account Type"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{role:"student",label:"Student"},{role:"teacher",label:"Teacher"}].map(t=>{const r=y===t.role;return e.jsx("button",{type:"button",onClick:()=>D(t.role),className:`rounded-lg border px-3 py-2.5 text-sm font-body font-semibold transition-all ${r?"border-sky-400 bg-sky-50 text-sky-700":"border-slate-200 bg-slate-50 text-slate-500 hover:border-slate-300"}`,children:t.label},t.role)})})]}),l&&y==="student"&&e.jsx(i.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"space-y-3",children:e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Section"}),e.jsxs("div",{className:"relative",children:[e.jsx(Q,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("select",{value:v,onChange:t=>B(t.target.value),className:"w-full pl-11 pr-4 py-2.5 rounded-lg bg-slate-100/70 border border-slate-200/80 text-slate-900 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all appearance-none",required:!0,children:(a[b]||[]).map(t=>e.jsx("option",{value:t,children:t},t))})]})]})}),e.jsxs(i.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.5},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Email Address"}),e.jsxs("div",{className:"relative",children:[e.jsx(Re,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(L,{type:"email",placeholder:"your.email@school.edu",value:c,onChange:t=>o(t.target.value),className:"w-full pl-11 pr-4 py-3 rounded-lg bg-slate-100/70 border-slate-200/80 text-slate-900 placeholder:text-slate-400 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all",required:!0})]})]}),e.jsxs(i.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.6},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(X,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(L,{type:S?"text":"password",placeholder:"β’β’β’β’β’β’β’β’",value:n,onChange:t=>h(t.target.value),className:"w-full pl-11 pr-11 py-3 rounded-lg bg-slate-100/70 border-slate-200/80 text-slate-900 placeholder:text-slate-400 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all",required:!0,minLength:l?8:6}),e.jsx(i.button,{type:"button",onClick:()=>re(!S),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600 transition-colors",whileTap:{scale:.9},children:S?e.jsx(Ce,{size:16}):e.jsx(Ee,{size:16})})]}),l&&n.length>0&&!W&&e.jsxs("div",{className:"mt-2 rounded-lg border border-sky-100/80 bg-sky-50/70 px-3 py-2",children:[e.jsx("p",{className:"text-[11px] font-body font-semibold uppercase tracking-wider text-slate-600",children:"Password requirements"}),e.jsx("ul",{className:"mt-2 space-y-1",children:E.map(t=>e.jsxs("li",{className:`flex items-center gap-2 text-[11px] font-body ${t.met?"text-emerald-700":"text-slate-500"}`,children:[e.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${t.met?"bg-emerald-500":"bg-slate-300"}`}),e.jsx("span",{children:t.label})]},t.id))})]})]}),e.jsx(i.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.7},children:e.jsxs(je,{type:"submit",disabled:_,className:"w-full bg-gradient-to-r from-purple-600 to-pink-500 hover:from-purple-500 hover:to-pink-400 text-white font-body font-semibold py-3 rounded-xl shadow-lg shadow-purple-600/25 hover:shadow-pink-500/35 hover:scale-[1.02] transition-all text-sm group relative overflow-hidden disabled:opacity-50 disabled:cursor-not-allowed",children:[e.jsx(i.span,{className:"absolute inset-0 bg-gradient-to-r from-white/0 via-white/15 to-white/0",animate:{x:["-100%","100%"]},transition:{duration:3,repeat:1/0,repeatDelay:2}}),e.jsxs("span",{className:"relative flex items-center justify-center gap-2",children:[_?"Please wait...":l?"Create Account":"Sign In",e.jsx(K,{size:16,className:"group-hover:translate-x-1 transition-transform"})]})]})}),e.jsx("div",{className:"text-center",children:e.jsx("button",{type:"button",onClick:()=>{z(!l),u(null)},className:"text-sm text-slate-400 hover:text-sky-500 font-body font-medium transition-colors",children:l?"Already have an account? Sign in":"Don't have an account? Create one"})})]}),!l&&e.jsxs(i.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.85},className:"mb-4 relative",children:[e.jsxs("div",{className:"relative flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"flex-1 h-px bg-slate-200"}),e.jsx("span",{className:"text-[10px] font-body font-semibold text-slate-400 uppercase tracking-widest",children:"Quick Demo Access"}),e.jsx("div",{className:"flex-1 h-px bg-slate-200"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:he.map(t=>{const r=t.icon,d={sky:"bg-sky-100",emerald:"bg-emerald-100",rose:"bg-rose-100"},m={sky:"text-sky-600",emerald:"text-emerald-600",rose:"text-rose-500"};return e.jsxs(i.button,{type:"button",onClick:()=>be(t.email,t.password,t.role),className:"group flex items-center gap-3 w-full px-4 py-2.5 rounded-lg bg-slate-50/80 border border-slate-200/70 hover:border-sky-300 hover:bg-sky-50/80 hover:shadow-sm transition-all text-left",whileHover:{scale:1.01},whileTap:{scale:.99},children:[e.jsx("div",{className:`w-8 h-8 rounded-md flex items-center justify-center shrink-0 ${d[t.color]}`,children:e.jsx(r,{size:15,className:m[t.color]})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-xs font-body font-semibold text-slate-700 group-hover:text-sky-600 transition-colors",children:[t.label," Account"]}),e.jsx("p",{className:"text-[10px] text-slate-400 font-body truncate",children:t.email})]}),e.jsx(K,{size:14,className:"text-slate-300 group-hover:text-sky-500 group-hover:translate-x-0.5 transition-all shrink-0"})]},t.label)})})]}),e.jsxs(i.p,{className:"text-xs text-slate-400 text-center mt-4 font-body relative",initial:{opacity:0},animate:{opacity:1},transition:{delay:1},children:[e.jsx(X,{size:10,className:"inline mr-1 -mt-0.5"})," Your data is encrypted and secure"]})]})})]})})]})};export{et as default};
|
assets/LoginPage-DktsN1Jx.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{r as s,j as e}from"./vendor-react-B4AQeu28.js";import{B as Se}from"./button-WbM5w2Bp.js";import{I as L}from"./input-BUQJctP7.js";import{m as i,B as Pe,T as Ae,A as Ee,U as ee,a as te,L as se,b as ae,G as Me,s as re,c as Te,d as ie}from"./index-dPnhhJ9w.js";import{S as Re}from"./sparkles-DPFO64ZX.js";import{M as Ce}from"./mail-DiIt1YFo.js";import{E as Ie,a as Le}from"./eye-BmZ1sFKD.js";import{S as De}from"./shield-check-CS0qf70Z.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-D7t7JfSr.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-markdown-yqZQ_iQm.js";const le="/assets/shader-bg-DA7bEbBA.mp4",ze=[{id:"length",label:"At least 8 characters",test:a=>a.length>=8},{id:"upper-lower",label:"Contains uppercase and lowercase letters",test:a=>/[A-Z]/.test(a)&&/[a-z]/.test(a)},{id:"number",label:"Contains at least one number",test:a=>/\d/.test(a)},{id:"special",label:"Contains at least one special character",test:a=>/[^A-Za-z0-9]/.test(a)}],D="Use at least 8 characters with uppercase, lowercase, number, and special character.",_e=a=>{const n=typeof a=="object"&&a!==null?a:null,l=a instanceof Error?a.message:"";if(n?.code&&typeof n.code=="string")return{code:n.code.toLowerCase(),message:l};const m=l.match(/auth\/[a-z-]+/i);return{code:m?m[0].toLowerCase():"",message:l}},qe=a=>a.replace(/^Firebase:\s*/i,"").replace(/\s*\(auth\/[a-z-]+\)\.?/i,"").trim(),oe=(a,n)=>{const{code:l,message:m}=_e(a),u=qe(m);return l==="auth/invalid-credential"||l==="auth/wrong-password"||l==="auth/user-not-found"?"Invalid email or password. Please check your credentials and try again.":l==="auth/email-already-in-use"?"This email is already registered. Please sign in instead.":l==="auth/weak-password"||l==="auth/password-does-not-meet-requirements"?u?`Password does not meet signup requirements. ${u}`:`Password does not meet signup requirements. ${D}`:l==="auth/too-many-requests"?"Access to this account has been temporarily disabled due to many failed login attempts. You can immediately restore it by resetting your password or you can try again later.":l==="auth/network-request-failed"?"Network error. Please check your internet connection and try again.":l.startsWith("auth/")?u||n:m.includes("Firebase:")||m.includes("auth/")?n:m||n},at=()=>{const a={"Grade 11":["Academic","Tech-Pro"]},n={teacher:["Mathematics","Science","English","Technology","Humanities"]},[l,m]=s.useState(""),[u,z]=s.useState(""),[P,ne]=s.useState(!1),[o,_]=s.useState(!1),[A,ce]=s.useState(""),[c,q]=s.useState("student"),[f,Be]=s.useState("Grade 11"),[j,B]=s.useState(a["Grade 11"][0]),[b,O]=s.useState("Mathematics"),[V,y]=s.useState(!1),[g,p]=s.useState(null),[de,me]=s.useState(!1),[ue,pe]=s.useState(!1),[E,xe]=s.useState(16),[F,G]=s.useState("primary"),[U,M]=s.useState(0),T=s.useRef(null),R=s.useRef(null),w=de&&ue,v=s.useRef("primary"),N=s.useRef(0),k=s.useRef(!1),$=1.1,W=.34,H=t=>{const r=Math.max(0,Math.min(1,t));Math.abs(N.current-r)<.02||(N.current=r,M(r))},Y=t=>{!Number.isFinite(t)||t<=0||Math.abs(E-t)>.05&&xe(t)},C=s.useMemo(()=>ze.map(t=>({...t,met:t.test(u)})),[u]),Z=s.useMemo(()=>C.every(t=>t.met),[C]),ye=s.useMemo(()=>{if(!o||!g)return!1;const t=g.toLowerCase();return t.includes("password requirements not met")||t.includes("password does not meet")},[g,o]),he=()=>{const t=T.current?.duration;t&&Number.isFinite(t)&&t>0&&Y(t)},fe=()=>{const t=R.current?.duration;t&&Number.isFinite(t)&&t>0&&Y(t)};s.useEffect(()=>{if(!w)return;const t=T.current,r=R.current;if(!t||!r)return;let d=!1,x=0;v.current="primary",G("primary"),k.current=!1,N.current=0,M(0),t.loop=!1,r.loop=!1,t.currentTime=0,r.currentTime=0,r.pause(),t.play().catch(()=>{});const S=()=>{if(d)return;const h=v.current==="primary"?t:r,X=v.current==="primary"?r:t,Ne=Number.isFinite(h.duration)&&h.duration>0?h.duration:E,I=Math.max(Ne-h.currentTime,0);if(I<=$){k.current||(k.current=!0,X.currentTime=0,X.play().catch(()=>{}));const ke=1-I/$;if(H(ke),I<=.03||h.ended){h.pause(),h.currentTime=0;const K=v.current==="primary"?"secondary":"primary";v.current=K,G(K),k.current=!1,N.current=0,M(0)}}else H(0);x=window.requestAnimationFrame(S)};return x=window.requestAnimationFrame(S),()=>{d=!0,x&&window.cancelAnimationFrame(x)}},[E,w]);const J=w?W*(1-U):0,Q=w?W*U:0,be=F==="primary"?J:Q,ge=F==="secondary"?J:Q;s.useEffect(()=>{c==="teacher"&&!n.teacher.includes(b)&&O(n.teacher[0])},[b,c]),s.useEffect(()=>{const t=a[f]||[];t.length>0&&!t.includes(j)&&B(t[0])},[f,j]);const ve=[{label:"Student",role:"student",email:"teststudent@school.edu",password:"TestPass123!",icon:Me,color:"sky"},{label:"Teacher",role:"teacher",email:"testteacher@school.edu",password:"TestPass123!",icon:te,color:"emerald"},{label:"Admin",role:"admin",email:"testadmin@school.edu",password:"TestPass123!",icon:De,color:"rose"}],je=async(t,r,d)=>{p(null),y(!0),m(t),z(r),q(d),_(!1);try{re(d),await ie(t,r)}catch(x){p(oe(x,"Demo sign-in failed. Please try again.")),y(!1)}},we=async t=>{t.preventDefault(),p(null),y(!0);try{if(o){if(!A.trim()){p("Please enter your name"),y(!1);return}if(c==="student"&&!f){p("Please select a grade level"),y(!1);return}if(c!=="student"&&!b){p("Please select a department"),y(!1);return}if(c==="admin"){p("Admin account creation is restricted. Please contact an existing administrator."),y(!1);return}if(!Z){p(`Password does not meet signup requirements. ${D}`),y(!1);return}re(c),await Te(l,u,A,c,c==="student"?{grade:f,section:j}:{department:b})}else await ie(l,u)}catch(r){const d=o?`Sign-up failed. ${D}`:"Sign-in failed. Please check your credentials and try again.";p(oe(r,d)),y(!1)}};return e.jsxs("div",{className:"min-h-screen w-full flex items-center justify-center px-4 sm:px-6 py-8 overflow-y-auto relative login-bg",children:[e.jsx("video",{ref:T,autoPlay:!0,muted:!0,playsInline:!0,preload:"auto",onCanPlay:()=>me(!0),onLoadedMetadata:he,className:"absolute inset-0 w-full h-full object-cover transition-opacity duration-150 e-opacity",style:{"--o":be},src:le}),e.jsx("video",{ref:R,autoPlay:!0,muted:!0,playsInline:!0,preload:"auto",onCanPlay:()=>pe(!0),onLoadedMetadata:fe,className:"absolute inset-0 w-full h-full object-cover transition-opacity duration-150 e-opacity",style:{"--o":ge},src:le}),e.jsx("div",{className:"absolute inset-0 pointer-events-none login-frost-overlay"}),e.jsx("div",{className:"absolute top-[10%] left-[-10%] w-[60%] h-[60%] rounded-full blur-[140px] pointer-events-none mix-blend-multiply login-orb-purple"}),e.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[70%] h-[70%] rounded-full blur-[160px] pointer-events-none mix-blend-multiply login-orb-pink"}),e.jsx("div",{className:"absolute top-[40%] left-[40%] w-[40%] h-[40%] rounded-full blur-[120px] pointer-events-none mix-blend-screen login-orb-blue"}),e.jsx("div",{className:"relative z-10 w-full max-w-6xl mx-auto",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 lg:gap-12 items-center",children:[e.jsxs(i.div,{initial:{opacity:0,x:-40},animate:{opacity:1,x:0},transition:{duration:.8,ease:[.22,1,.36,1]},className:"flex flex-col items-center lg:items-start justify-center space-y-5 lg:space-y-8 text-center lg:text-left",children:[e.jsxs(i.div,{className:"flex items-center justify-center lg:justify-start gap-2.5",children:[e.jsx(i.div,{className:"relative flex items-center justify-center drop-shadow-md",children:e.jsx("img",{src:"/mathpulse_final_logo.png",alt:"MathPulse AI Logo",className:"w-10 h-10 lg:w-16 lg:h-16 object-contain flex-shrink-0"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl lg:text-3xl font-display font-black tracking-tight text-slate-900 bg-clip-text text-transparent bg-gradient-to-r from-purple-600 via-pink-600 to-sky-500",children:"MathPulse"}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[e.jsx(Re,{size:12,className:"text-rose-500"}),e.jsx("span",{className:"text-xs text-slate-500 font-body font-medium tracking-wide",children:"Powered by Machine Learning"})]})]})]}),e.jsxs(i.div,{className:"space-y-3 lg:space-y-5",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2,duration:.8},children:[e.jsxs("h2",{className:"text-3xl sm:text-4xl lg:text-5xl xl:text-[3.4rem] font-display font-extrabold leading-[1.1] tracking-tight text-slate-900",children:["Transform Your",e.jsx("br",{}),e.jsx("span",{className:"bg-gradient-to-r from-sky-600 via-cyan-500 to-sky-500 bg-clip-text text-transparent",children:"Math Journey"})]}),e.jsx("p",{className:"text-sm lg:text-base text-slate-500 leading-relaxed max-w-md mx-auto lg:mx-0 font-body",children:"AI-powered predictive system designed to identify at-risk students and provide personalized learning recommendations."})]}),e.jsx("div",{className:"grid grid-cols-3 gap-2 lg:gap-3",children:[{icon:Pe,label:"AI Predictions",desc:"Smart detection",color:"sky"},{icon:Ae,label:"Analytics",desc:"Real-time data",color:"rose"},{icon:Ee,label:"Gamified",desc:"Learn & earn",color:"emerald"}].map((t,r)=>{const d=t.icon,x={sky:"border-sky-200/60 hover:border-sky-300",rose:"border-rose-200/60 hover:border-rose-300",emerald:"border-emerald-200/60 hover:border-emerald-300"},S={sky:"text-sky-600",rose:"text-rose-500",emerald:"text-emerald-600"},h={sky:"bg-sky-100",rose:"bg-rose-100",emerald:"bg-emerald-100"};return e.jsxs(i.div,{className:`bg-white/80 backdrop-blur-xl border ${x[t.color]} rounded-xl p-3 lg:p-4 transition-all cursor-pointer group shadow-md shadow-slate-900/[0.04]`,initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.5+r*.1},whileHover:{scale:1.03,y:-4},children:[e.jsx("div",{className:`w-7 h-7 lg:w-9 lg:h-9 rounded-lg ${h[t.color]} flex items-center justify-center mx-auto lg:mx-0 mb-2 lg:mb-3`,children:e.jsx(d,{size:15,className:S[t.color]})}),e.jsx("h3",{className:"text-xs lg:text-sm font-display font-semibold text-slate-800 mb-0.5",children:t.label}),e.jsx("p",{className:"text-[10px] lg:text-xs text-slate-400 font-body",children:t.desc})]},r)})})]}),e.jsx(i.div,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{duration:.8,delay:.15,ease:[.22,1,.36,1]},className:"relative flex justify-center lg:justify-end",children:e.jsxs("div",{className:"bg-white/85 backdrop-blur-2xl border border-slate-200/60 rounded-3xl p-6 sm:p-7 w-full max-w-md relative overflow-hidden shadow-[0_20px_60px_-15px_rgba(168,85,247,0.15)] max-h-[85vh] overflow-y-auto",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-[3px] bg-gradient-to-r from-purple-500 via-pink-500 to-sky-500"}),e.jsx("div",{className:"absolute -top-40 left-1/2 -translate-x-1/2 w-80 h-80 bg-gradient-to-br from-purple-400/20 to-pink-400/20 rounded-full blur-[60px] pointer-events-none"}),e.jsxs("div",{className:"text-center mb-4 relative",children:[e.jsx(i.h3,{className:"text-2xl font-display font-bold text-slate-900 mb-2",initial:{opacity:0},animate:{opacity:1},transition:{delay:.4},children:o?"Create Account":"Welcome Back"}),e.jsx(i.p,{className:"text-sm text-slate-500 font-body",initial:{opacity:0},animate:{opacity:1},transition:{delay:.5},children:o?"Begin your learning journey":"Sign in to continue learning"})]}),e.jsxs("form",{onSubmit:we,className:"space-y-3 mb-4 relative",children:[g&&!ye&&e.jsx(i.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"bg-rose-50 border border-rose-200 text-rose-600 px-4 py-3 rounded-lg text-sm font-body",children:g}),o&&e.jsxs(i.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Full Name"}),e.jsxs("div",{className:"relative",children:[e.jsx(ee,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(L,{type:"text",placeholder:"Your Name",value:A,onChange:t=>ce(t.target.value),className:"w-full pl-11 pr-4 py-3 rounded-lg bg-slate-100/70 border-slate-200/80 text-slate-900 placeholder:text-slate-400 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all",required:!0})]})]}),o&&e.jsxs(i.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.45},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Account Type"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{role:"student",label:"Student"},{role:"teacher",label:"Teacher"}].map(t=>{const r=c===t.role;return e.jsx("button",{type:"button",onClick:()=>q(t.role),className:`rounded-lg border px-3 py-2.5 text-sm font-body font-semibold transition-all ${r?"border-sky-400 bg-sky-50 text-sky-700":"border-slate-200 bg-slate-50 text-slate-500 hover:border-slate-300"}`,children:t.label},t.role)})})]}),o&&c==="student"&&e.jsx(i.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"space-y-3",children:e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Section"}),e.jsxs("div",{className:"relative",children:[e.jsx(ee,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("select",{value:j,onChange:t=>B(t.target.value),className:"w-full pl-11 pr-4 py-2.5 rounded-lg bg-slate-100/70 border border-slate-200/80 text-slate-900 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all appearance-none",required:!0,children:(a[f]||[]).map(t=>e.jsx("option",{value:t,children:t},t))})]})]})}),o&&c!=="student"&&e.jsxs(i.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Department"}),e.jsxs("div",{className:"relative",children:[e.jsx(te,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("select",{value:b,onChange:t=>O(t.target.value),className:"w-full pl-11 pr-4 py-2.5 rounded-lg bg-slate-100/70 border border-slate-200/80 text-slate-900 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all appearance-none",required:!0,children:n.teacher.map(t=>e.jsx("option",{value:t,children:t},t))})]})]}),e.jsxs(i.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.5},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Email Address"}),e.jsxs("div",{className:"relative",children:[e.jsx(Ce,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(L,{type:"email",placeholder:"your.email@school.edu",value:l,onChange:t=>m(t.target.value),className:"w-full pl-11 pr-4 py-3 rounded-lg bg-slate-100/70 border-slate-200/80 text-slate-900 placeholder:text-slate-400 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all",required:!0})]})]}),e.jsxs(i.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.6},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(se,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(L,{type:P?"text":"password",placeholder:"β’β’β’β’β’β’β’β’",value:u,onChange:t=>z(t.target.value),className:"w-full pl-11 pr-11 py-3 rounded-lg bg-slate-100/70 border-slate-200/80 text-slate-900 placeholder:text-slate-400 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all",required:!0,minLength:o?8:6}),e.jsx(i.button,{type:"button",onClick:()=>ne(!P),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600 transition-colors",whileTap:{scale:.9},children:P?e.jsx(Ie,{size:16}):e.jsx(Le,{size:16})})]}),o&&u.length>0&&!Z&&e.jsxs("div",{className:"mt-2 rounded-lg border border-sky-100/80 bg-sky-50/70 px-3 py-2",children:[e.jsx("p",{className:"text-[11px] font-body font-semibold uppercase tracking-wider text-slate-600",children:"Password requirements"}),e.jsx("ul",{className:"mt-2 space-y-1",children:C.map(t=>e.jsxs("li",{className:`flex items-center gap-2 text-[11px] font-body ${t.met?"text-emerald-700":"text-slate-500"}`,children:[e.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${t.met?"bg-emerald-500":"bg-slate-300"}`}),e.jsx("span",{children:t.label})]},t.id))})]})]}),e.jsx(i.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.7},children:e.jsxs(Se,{type:"submit",disabled:V,className:"w-full bg-gradient-to-r from-purple-600 to-pink-500 hover:from-purple-500 hover:to-pink-400 text-white font-body font-semibold py-3 rounded-xl shadow-lg shadow-purple-600/25 hover:shadow-pink-500/35 hover:scale-[1.02] transition-all text-sm group relative overflow-hidden disabled:opacity-50 disabled:cursor-not-allowed",children:[e.jsx(i.span,{className:"absolute inset-0 bg-gradient-to-r from-white/0 via-white/15 to-white/0",animate:{x:["-100%","100%"]},transition:{duration:3,repeat:1/0,repeatDelay:2}}),e.jsxs("span",{className:"relative flex items-center justify-center gap-2",children:[V?"Please wait...":o?"Create Account":"Sign In",e.jsx(ae,{size:16,className:"group-hover:translate-x-1 transition-transform"})]})]})}),e.jsx("div",{className:"text-center",children:e.jsx("button",{type:"button",onClick:()=>{_(!o),p(null)},className:"text-sm text-slate-400 hover:text-sky-500 font-body font-medium transition-colors",children:o?"Already have an account? Sign in":"Don't have an account? Create one"})})]}),!o&&e.jsxs(i.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.85},className:"mb-4 relative",children:[e.jsxs("div",{className:"relative flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"flex-1 h-px bg-slate-200"}),e.jsx("span",{className:"text-[10px] font-body font-semibold text-slate-400 uppercase tracking-widest",children:"Quick Demo Access"}),e.jsx("div",{className:"flex-1 h-px bg-slate-200"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:ve.map(t=>{const r=t.icon,d={sky:"bg-sky-100",emerald:"bg-emerald-100",rose:"bg-rose-100"},x={sky:"text-sky-600",emerald:"text-emerald-600",rose:"text-rose-500"};return e.jsxs(i.button,{type:"button",onClick:()=>je(t.email,t.password,t.role),className:"group flex items-center gap-3 w-full px-4 py-2.5 rounded-lg bg-slate-50/80 border border-slate-200/70 hover:border-sky-300 hover:bg-sky-50/80 hover:shadow-sm transition-all text-left",whileHover:{scale:1.01},whileTap:{scale:.99},children:[e.jsx("div",{className:`w-8 h-8 rounded-md flex items-center justify-center shrink-0 ${d[t.color]}`,children:e.jsx(r,{size:15,className:x[t.color]})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-xs font-body font-semibold text-slate-700 group-hover:text-sky-600 transition-colors",children:[t.label," Account"]}),e.jsx("p",{className:"text-[10px] text-slate-400 font-body truncate",children:t.email})]}),e.jsx(ae,{size:14,className:"text-slate-300 group-hover:text-sky-500 group-hover:translate-x-0.5 transition-all shrink-0"})]},t.label)})})]}),e.jsxs(i.p,{className:"text-xs text-slate-400 text-center mt-4 font-body relative",initial:{opacity:0},animate:{opacity:1},transition:{delay:1},children:[e.jsx(se,{size:10,className:"inline mr-1 -mt-0.5"})," Your data is encrypted and secure"]})]})})]})})]})};export{at as default};
|
|
|
|
|
|
assets/{LogoutActionButton-USB3vnm6.js β LogoutActionButton-ynXvSPMf.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{e,m as r,n as l}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{e,m as r,n as l}from"./index-CGNBpSmO.js";import{j as t}from"./vendor-react-B4AQeu28.js";import{L as n}from"./log-out-G6mObnLf.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{ModuleFolderCard-BDMyLDzi.js β ModuleFolderCard-dHGX9Tik.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
-
import{j as e}from"./vendor-react-B4AQeu28.js";import{u}from"./useSubjectAvailability-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
| 5 |
* See the LICENSE file in the root directory of this source tree.
|
| 6 |
-
*/const N=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],B=w("link-2",N),n=[{bg:"bg-[#9956DE]",tab:"bg-[#8544c7]",shadow:"shadow-[#9956DE]/30"},{bg:"bg-[#1FA7E1]",tab:"bg-[#158abf]",shadow:"shadow-[#1FA7E1]/30"},{bg:"bg-[#FFB356]",tab:"bg-[#e69940]",shadow:"shadow-[#FFB356]/30"},{bg:"bg-[#FB96BB]",tab:"bg-[#df7b9e]",shadow:"shadow-[#FB96BB]/30"},{bg:"bg-[#75D06A]",tab:"bg-[#62b658]",shadow:"shadow-[#75D06A]/30"},{bg:"bg-[#FF8B8B]",tab:"bg-[#e67070]",shadow:"shadow-[#FF8B8B]/30"}],E=({module:t,index:x,onClick:l,onPreviewSources:r,isAtRisk:m,badgeLabel:o,precomputedAvailable:
|
|
|
|
| 1 |
+
import{j as e}from"./vendor-react-B4AQeu28.js";import{u}from"./useSubjectAvailability-iyC7Wdl7.js";import{e as w,m as f,b as j,x as v,L as y}from"./index-CGNBpSmO.js";import{C as k}from"./clock-D2bky9WI.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
| 5 |
* See the LICENSE file in the root directory of this source tree.
|
| 6 |
+
*/const N=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],B=w("link-2",N),n=[{bg:"bg-[#9956DE]",tab:"bg-[#8544c7]",shadow:"shadow-[#9956DE]/30"},{bg:"bg-[#1FA7E1]",tab:"bg-[#158abf]",shadow:"shadow-[#1FA7E1]/30"},{bg:"bg-[#FFB356]",tab:"bg-[#e69940]",shadow:"shadow-[#FFB356]/30"},{bg:"bg-[#FB96BB]",tab:"bg-[#df7b9e]",shadow:"shadow-[#FB96BB]/30"},{bg:"bg-[#75D06A]",tab:"bg-[#62b658]",shadow:"shadow-[#75D06A]/30"},{bg:"bg-[#FF8B8B]",tab:"bg-[#e67070]",shadow:"shadow-[#FF8B8B]/30"}],E=({module:t,index:x,onClick:l,onPreviewSources:r,isAtRisk:m,badgeLabel:o,precomputedAvailable:a,isRecommended:c})=>{const i=n[x%n.length],p=`${t.active_grade_level??""} Β· ${t.subject??"Module"} ${t.quarter??""}`.trim(),b=a===void 0,{isSubjectAvailable:h}=u(),g=a!==void 0?a:b?h(t.subjectId):!0,s=t.isAvailable!==!1&&g;return e.jsxs(f.div,{role:s?"button":"img",tabIndex:s?0:-1,whileHover:s?{y:-8}:void 0,onClick:s?l:void 0,onKeyDown:s?d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),l())}:void 0,className:`relative text-left rounded-2xl md:rounded-[1.4rem] overflow-visible h-full min-h-[185px] md:min-h-[290px] bg-transparent group w-full flex flex-col ${s?"cursor-pointer":"cursor-not-allowed"}`,children:[e.jsx("div",{className:`absolute top-0 left-3 md:left-4 h-5 md:h-7 w-20 md:w-32 rounded-t-lg md:rounded-t-xl shadow-sm transition-colors duration-300 ${i.tab}`}),e.jsxs("div",{className:`relative mt-4 md:mt-6 rounded-2xl md:rounded-[1.4rem] p-3.5 md:p-6 transition-all duration-300 overflow-hidden flex flex-col h-[calc(100%-16px)] md:h-[calc(100%-24px)] flex-1 ${i.bg} shadow-[0_18px_30px_-20px_rgba(0,0,0,0.45)] group-hover:shadow-[0_24px_40px_-15px_rgba(0,0,0,0.5)]`,children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1.5 mix-blend-overlay bg-white/40"}),e.jsx("div",{className:"absolute -bottom-8 right-[-20%] w-48 h-48 bg-white opacity-10 rounded-full transition-transform duration-500 group-hover:scale-110"}),e.jsx("div",{className:"absolute bottom-4 right-12 w-32 h-32 bg-white opacity-10 rounded-full transition-transform duration-500 group-hover:scale-110 delay-75"}),e.jsxs("div",{className:"relative z-10 flex-1 flex flex-col h-full",children:[e.jsx("div",{className:"flex items-start justify-end",children:(o||t.status==="Locked")&&e.jsx("span",{className:"px-2.5 py-1 rounded-full bg-black/30 text-white/90 text-[10px] font-black uppercase tracking-wider backdrop-blur-sm",children:o||"Locked"})}),e.jsx("h3",{className:"text-base md:text-[22px] font-display font-black text-white leading-[1.15] md:leading-[1.1] mb-1.5 md:mb-2 drop-shadow-sm pr-4 line-clamp-2",children:t.title}),e.jsxs("div",{className:"mb-2 md:mb-3 flex flex-wrap gap-1 md:gap-1.5",children:[e.jsx("span",{className:"rounded-full border border-white/20 bg-black/15 px-2 md:px-2.5 py-0.5 md:py-1 text-[9px] md:text-[10px] font-bold text-white/95 leading-none",children:p}),t.content_domain&&e.jsx("span",{className:"rounded-full border border-white/20 bg-black/15 px-2 md:px-2.5 py-0.5 md:py-1 text-[9px] md:text-[10px] font-bold text-white/95 leading-none",children:t.content_domain}),c&&e.jsx("span",{className:"rounded-full border border-purple-200 bg-purple-100 px-2 md:px-2.5 py-0.5 md:py-1 text-[9px] md:text-[10px] font-bold text-purple-700 shadow-sm animate-pulse leading-none",children:"Recommended"})]}),e.jsx("p",{className:"text-white/85 text-[10px] md:text-[13px] line-clamp-1 md:line-clamp-2 mb-2 md:mb-4 font-medium leading-snug md:leading-relaxed pr-2",children:t.subtitle||t.description||"Master this module to unlock the next level of your mathematical journey."}),e.jsxs("div",{className:"mt-auto space-y-2 md:space-y-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between text-white font-bold text-[10px] md:text-[12px] mb-1 md:mb-1.5 drop-shadow-sm",children:[e.jsx("span",{className:"opacity-90 uppercase tracking-wider",children:"Progress"}),e.jsxs("span",{children:[t.progress>0?t.progress:0,"%"]})]}),e.jsx("div",{className:"w-full h-1.5 md:h-2 rounded-full bg-black/20 overflow-hidden shadow-inner",children:e.jsx("div",{className:"h-full bg-white rounded-full transition-all duration-1000 ease-out e-w",style:{"--w":`${t.progress>0?t.progress:0}%`}})})]}),e.jsxs("div",{className:"flex items-center justify-between gap-1.5 md:gap-2",children:[e.jsxs("div",{className:"flex flex-wrap md:flex-nowrap items-center gap-1 md:gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1 px-1.5 md:px-2 py-0.5 md:py-1 bg-white/20 rounded-md md:rounded-lg text-white font-bold text-[9px] md:text-[11px] backdrop-blur-sm shadow-sm border border-white/10",children:[e.jsx(j,{size:10,className:"md:w-3 md:h-3 opacity-90"})," ",t.totalLessons||t.lessons?.length||0," lessons"]}),e.jsxs("div",{className:"flex items-center gap-1 px-1.5 md:px-2 py-0.5 md:py-1 bg-white/20 rounded-md md:rounded-lg text-white font-bold text-[9px] md:text-[11px] backdrop-blur-sm shadow-sm border border-white/10",children:[e.jsx(k,{size:10,className:"md:w-3 md:h-3 opacity-90"})," ",t.totalQuizzes||t.quizzes?.length||0," quizzes"]})]}),r&&e.jsxs("button",{type:"button",onClick:d=>{d.stopPropagation(),r()},className:"flex shrink-0 items-center gap-0.5 md:gap-1 rounded-md md:rounded-lg bg-black/20 hover:bg-black/40 px-1.5 md:px-2 py-1 font-bold uppercase tracking-wider text-white transition-all shadow-sm border border-white/10 leading-none text-[7px] md:text-[8px]",children:[e.jsx(B,{size:8,className:"md:w-[10px] md:h-[10px]"}),"SOURCE"]})]})]}),m&&e.jsxs("div",{className:"absolute -top-3 -right-2 bg-rose-500 text-white px-3 py-1.5 rounded-full text-[11px] font-black uppercase tracking-wider flex items-center gap-1.5 shadow-lg border border-rose-400 animate-pulse",children:[e.jsx(v,{size:12,strokeWidth:3})," Review"]}),!s&&e.jsx("div",{className:"absolute inset-0 z-20 flex flex-col items-center justify-center rounded-[1.4rem] bg-black/60 backdrop-blur-[2px]",children:e.jsxs("div",{className:"flex flex-col items-center gap-2 md:gap-3",children:[e.jsx("div",{className:"w-10 h-10 md:w-14 md:h-14 rounded-xl md:rounded-2xl bg-white/10 border border-white/20 flex items-center justify-center backdrop-blur-md",children:e.jsx(y,{className:"w-5 h-5 md:w-7 md:h-7 text-white"})}),e.jsxs("div",{className:"text-center px-2",children:[e.jsx("p",{className:"text-white font-black text-xs md:text-sm tracking-wide",children:"Content Unavailable"}),e.jsx("p",{className:"text-white/70 text-[9px] md:text-[11px] font-semibold mt-0.5 md:mt-1 max-w-[140px] md:max-w-[180px] mx-auto leading-tight",children:"Teaching module PDF not yet loaded."})]})]})})]})]})]})};export{E as M};
|
assets/{ModulesPage-TA1UiY8-.js β ModulesPage--hVGaLzB.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-core-D7GXCeNu.js"])))=>i.map(i=>d[i]);
|
| 2 |
-
import{r as s,j as e,b as Ct,d as Te,c as aa}from"./vendor-react-B4AQeu28.js";import{u as ra}from"./useQuery-
|
| 3 |
* @license lucide-react v0.487.0 - ISC
|
| 4 |
*
|
| 5 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-core-D7GXCeNu.js"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{r as s,j as e,b as Ct,d as Te,c as aa}from"./vendor-react-B4AQeu28.js";import{u as ra}from"./useQuery-C7Nbsm2w.js";import{getDoc as Kt,doc as zt,onSnapshot as ts,runTransaction as la,serverTimestamp as na,query as ia,where as oa,collection as ca}from"./vendor-firebase-firestore-CNv3xXal.js";import{e as pe,m as S,Z as rt,C as Nt,h as tt,X as qs,M as da,a as bt,T as At,q as it,a5 as ss,R as Hs,E as Bt,_ as as,v as qt,I as ma,N as xa,u as Ht,A as Pt,b as Je,n as It,x as Os,ab as hs,ac as ua,ad as fs,ae as pa,p as Qs,af as ha,L as Ws,g as ct,B as fa,ag as ba,ah as ga,ai as Us,aj as wa,ak as ya,al as ja,a9 as va,w as Na,am as bs,an as ka,ao as gs,G as Ca,j as Mt,a7 as Sa,aa as za}from"./index-CGNBpSmO.js";import{M as Zt}from"./ModuleFolderCard-dHGX9Tik.js";import{B as Fe}from"./button-DVjn4LkC.js";import rs from"./ScientificCalculator-Bdrlg1Yp.js";import{C as Dt}from"./check-BfYhdun3.js";import{X as et}from"./x-Deb9zs8O.js";import{V as Ft,a as Rt,M as ls,b as ns}from"./volume-x-BprCnnkN.js";import{C as $t}from"./chevron-left-BuATOj9f.js";import{C as qe}from"./chevron-right-C39hNstc.js";import{C as Gs}from"./circle-help-DMiD6EQw.js";import{P as Xs,A as Jt,b as es,c as Ma,L as _a}from"./quizService-CuH9jeN9.js";import{C as ot}from"./circle-check-big-yCNC9yfs.js";import{C as Et,L as kt}from"./lightbulb-CrdekHc8.js";import{logLessonView as Aa}from"./trackingService-mnaKocvn.js";import{C as St}from"./clock-D2bky9WI.js";import{C as Ea}from"./clipboard-check-DSPNHJXj.js";import{s as Gt,S as ws}from"./subjects-DP2R71lN.js";import{C as Vs}from"./circle-check-BhLH88x1.js";import{C as Ta}from"./chart-column-g5DztEPT.js";import{D as Pa}from"./dollar-sign-CZpwYJk-.js";import{triggerQuizSubmitted as La}from"./automationService-BaY4ockN.js";import ys from"./confetti.module-C94ZD2ww.js";import{u as Ia}from"./useCurriculum-cH2ZLq43.js";import{S as Da}from"./search-C_DiQDej.js";import{F as Fa}from"./funnel-pOzgdLsf.js";import{S as Ra}from"./sparkles-C0ju-UTT.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-D7t7JfSr.js";import"./vendor-markdown-yqZQ_iQm.js";import"./useSubjectAvailability-iyC7Wdl7.js";import"./chevron-up-B59xV3SY.js";/**
|
| 3 |
* @license lucide-react v0.487.0 - ISC
|
| 4 |
*
|
| 5 |
* This source code is licensed under the ISC license.
|
assets/{NotificationDropdown-CMhB7x-Z.js β NotificationDropdown-DGCnp7MU.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{e as a,D as b,u as N,h as w,m as y,
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{e as a,D as b,u as N,h as w,m as y,a as j,U as k}from"./index-CGNBpSmO.js";import{r as _,j as e}from"./vendor-react-B4AQeu28.js";import"./vendor-firebase-firestore-CNv3xXal.js";import{C as g,f as v}from"./formatDistanceToNow-Csp8CCDy.js";import{B as n}from"./bell-DbwiSyKd.js";import{C}from"./circle-check-BhLH88x1.js";import{C as A}from"./circle-alert-fZn6_hMx.js";import{S as M}from"./sparkles-C0ju-UTT.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{ProfileModal-BDGytXZz.js β ProfileModal-Jm1jfkzc.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{r,j as e}from"./vendor-react-B4AQeu28.js";import{e as R,h as U,m as k,U as u,A as x,
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{r,j as e}from"./vendor-react-B4AQeu28.js";import{e as R,h as U,m as k,U as u,A as x,b as w,F as _,$ as D,aJ as T,aS as B,j as $}from"./index-CGNBpSmO.js";import{B as b}from"./button-DVjn4LkC.js";import{I as d}from"./input-CBi6xF4I.js";import{S as q,a as G,c as V,d as p}from"./select-3FfJraPy.js";import{P as X,M as z,V as C}from"./ProfilePictureUploader-CCiptDXE.js";import{X as Y}from"./x-Deb9zs8O.js";import{M as H}from"./mail-C1tKDR_N.js";import{C as L}from"./circle-help-DMiD6EQw.js";import{S as J}from"./save-CNayyZ15.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-D7t7JfSr.js";import"./vendor-markdown-yqZQ_iQm.js";import"./chevron-up-B59xV3SY.js";import"./check-BfYhdun3.js";import"./minus-DV5fnWn8.js";import"./plus-ck_SGnHK.js";import"./upload-Daz-vKaw.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{ProfilePictureUploader-BaBXPmnP.js β ProfilePictureUploader-CCiptDXE.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/index-
|
| 2 |
-
import{e as V,n as B,N as K,_ as $,b1 as ge,b2 as we,u as xe,Q as ye,V as be,W as Ce,h as Pe,m as J,j as Q}from"./index-
|
| 3 |
* @license lucide-react v0.487.0 - ISC
|
| 4 |
*
|
| 5 |
* This source code is licensed under the ISC license.
|
|
@@ -107,4 +107,4 @@ import{e as V,n as B,N as K,_ as $,b1 as ge,b2 as we,u as xe,Q as ye,V as be,W a
|
|
| 107 |
border-left: 0;
|
| 108 |
border-right: 0;
|
| 109 |
}
|
| 110 |
-
`,nt=1,at=3,st=1,ct=(function(a){Ee(o,a);function o(){var e=a!==null&&a.apply(this,arguments)||this;return e.cropperRef=x.createRef(),e.imageRef=x.createRef(),e.videoRef=x.createRef(),e.containerPosition={x:0,y:0},e.containerRef=null,e.styleRef=null,e.containerRect=null,e.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},e.dragStartPosition={x:0,y:0},e.dragStartCrop={x:0,y:0},e.gestureZoomStart=0,e.gestureRotationStart=0,e.isTouching=!1,e.lastPinchDistance=0,e.lastPinchRotation=0,e.rafDragTimeout=null,e.rafPinchTimeout=null,e.wheelTimer=null,e.currentDoc=typeof document<"u"?document:null,e.currentWindow=typeof window<"u"?window:null,e.resizeObserver=null,e.previousCropSize=null,e.isInitialized=!1,e.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},e.initResizeObserver=function(){if(!(typeof window.ResizeObserver>"u"||!e.containerRef)){var t=!0;e.resizeObserver=new window.ResizeObserver(function(r){if(t){t=!1;return}e.computeSizes()}),e.resizeObserver.observe(e.containerRef)}},e.preventZoomSafari=function(t){return t.preventDefault()},e.cleanEvents=function(){e.currentDoc&&(e.currentDoc.removeEventListener("mousemove",e.onMouseMove),e.currentDoc.removeEventListener("mouseup",e.onDragStopped),e.currentDoc.removeEventListener("touchmove",e.onTouchMove),e.currentDoc.removeEventListener("touchend",e.onDragStopped),e.currentDoc.removeEventListener("gesturechange",e.onGestureChange),e.currentDoc.removeEventListener("gestureend",e.onGestureEnd),e.currentDoc.removeEventListener("scroll",e.onScroll))},e.clearScrollEvent=function(){e.containerRef&&e.containerRef.removeEventListener("wheel",e.onWheel),e.wheelTimer&&clearTimeout(e.wheelTimer)},e.onMediaLoad=function(){var t=e.computeSizes();t&&(e.previousCropSize=t,e.emitCropData(),e.setInitialCrop(t),e.isInitialized=!0),e.props.onMediaLoaded&&e.props.onMediaLoaded(e.mediaSize)},e.setInitialCrop=function(t){if(e.props.initialCroppedAreaPercentages){var r=et(e.props.initialCroppedAreaPercentages,e.mediaSize,e.props.rotation,t,e.props.minZoom,e.props.maxZoom),i=r.crop,n=r.zoom;e.props.onCropChange(i),e.props.onZoomChange&&e.props.onZoomChange(n)}else if(e.props.initialCroppedAreaPixels){var s=rt(e.props.initialCroppedAreaPixels,e.mediaSize,e.props.rotation,t,e.props.minZoom,e.props.maxZoom),i=s.crop,n=s.zoom;e.props.onCropChange(i),e.props.onZoomChange&&e.props.onZoomChange(n)}},e.computeSizes=function(){var t,r,i,n,s,c,l=e.imageRef.current||e.videoRef.current;if(l&&e.containerRef){e.containerRect=e.containerRef.getBoundingClientRect(),e.saveContainerPosition();var u=e.containerRect.width/e.containerRect.height,h=((t=e.imageRef.current)===null||t===void 0?void 0:t.naturalWidth)||((r=e.videoRef.current)===null||r===void 0?void 0:r.videoWidth)||0,d=((i=e.imageRef.current)===null||i===void 0?void 0:i.naturalHeight)||((n=e.videoRef.current)===null||n===void 0?void 0:n.videoHeight)||0,m=l.offsetWidth<h||l.offsetHeight<d,w=h/d,v=void 0;if(m)switch(e.state.mediaObjectFit){default:case"contain":v=u>w?{width:e.containerRect.height*w,height:e.containerRect.height}:{width:e.containerRect.width,height:e.containerRect.width/w};break;case"horizontal-cover":v={width:e.containerRect.width,height:e.containerRect.width/w};break;case"vertical-cover":v={width:e.containerRect.height*w,height:e.containerRect.height};break}else v={width:l.offsetWidth,height:l.offsetHeight};e.mediaSize=b(b({},v),{naturalWidth:h,naturalHeight:d}),e.props.setMediaSize&&e.props.setMediaSize(e.mediaSize);var f=e.props.cropSize?e.props.cropSize:Xe(e.mediaSize.width,e.mediaSize.height,e.containerRect.width,e.containerRect.height,e.props.aspect,e.props.rotation);return(((s=e.state.cropSize)===null||s===void 0?void 0:s.height)!==f.height||((c=e.state.cropSize)===null||c===void 0?void 0:c.width)!==f.width)&&e.props.onCropSizeChange&&e.props.onCropSizeChange(f),e.setState({cropSize:f},e.recomputeCropPosition),e.props.setCropSize&&e.props.setCropSize(f),f}},e.saveContainerPosition=function(){if(e.containerRef){var t=e.containerRef.getBoundingClientRect();e.containerPosition={x:t.left,y:t.top}}},e.onMouseDown=function(t){e.currentDoc&&(t.preventDefault(),e.currentDoc.addEventListener("mousemove",e.onMouseMove),e.currentDoc.addEventListener("mouseup",e.onDragStopped),e.saveContainerPosition(),e.onDragStart(o.getMousePoint(t)))},e.onMouseMove=function(t){return e.onDrag(o.getMousePoint(t))},e.onScroll=function(t){e.currentDoc&&(t.preventDefault(),e.saveContainerPosition())},e.onTouchStart=function(t){e.currentDoc&&(e.isTouching=!0,!(e.props.onTouchRequest&&!e.props.onTouchRequest(t))&&(e.currentDoc.addEventListener("touchmove",e.onTouchMove,{passive:!1}),e.currentDoc.addEventListener("touchend",e.onDragStopped),e.saveContainerPosition(),t.touches.length===2?e.onPinchStart(t):t.touches.length===1&&e.onDragStart(o.getTouchPoint(t.touches[0]))))},e.onTouchMove=function(t){t.preventDefault(),t.touches.length===2?e.onPinchMove(t):t.touches.length===1&&e.onDrag(o.getTouchPoint(t.touches[0]))},e.onGestureStart=function(t){e.currentDoc&&(t.preventDefault(),e.currentDoc.addEventListener("gesturechange",e.onGestureChange),e.currentDoc.addEventListener("gestureend",e.onGestureEnd),e.gestureZoomStart=e.props.zoom,e.gestureRotationStart=e.props.rotation)},e.onGestureChange=function(t){if(t.preventDefault(),!e.isTouching){var r=o.getMousePoint(t),i=e.gestureZoomStart-1+t.scale;if(e.setNewZoom(i,r,{shouldUpdatePosition:!0}),e.props.onRotationChange){var n=e.gestureRotationStart+t.rotation;e.props.onRotationChange(n)}}},e.onGestureEnd=function(t){e.cleanEvents()},e.onDragStart=function(t){var r,i,n=t.x,s=t.y;e.dragStartPosition={x:n,y:s},e.dragStartCrop=b({},e.props.crop),(i=(r=e.props).onInteractionStart)===null||i===void 0||i.call(r)},e.onDrag=function(t){var r=t.x,i=t.y;e.currentWindow&&(e.rafDragTimeout&&e.currentWindow.cancelAnimationFrame(e.rafDragTimeout),e.rafDragTimeout=e.currentWindow.requestAnimationFrame(function(){if(e.state.cropSize&&!(r===void 0||i===void 0)){var n=r-e.dragStartPosition.x,s=i-e.dragStartPosition.y,c={x:e.dragStartCrop.x+n,y:e.dragStartCrop.y+s},l=e.props.restrictPosition?N(c,e.mediaSize,e.state.cropSize,e.props.zoom,e.props.rotation):c;e.props.onCropChange(l)}}))},e.onDragStopped=function(){var t,r;e.isTouching=!1,e.cleanEvents(),e.emitCropData(),(r=(t=e.props).onInteractionEnd)===null||r===void 0||r.call(t)},e.onWheel=function(t){if(e.currentWindow&&!(e.props.onWheelRequest&&!e.props.onWheelRequest(t))){t.preventDefault();var r=o.getMousePoint(t),i=Ye(t).pixelY,n=e.props.zoom-i*e.props.zoomSpeed/200;e.setNewZoom(n,r,{shouldUpdatePosition:!0}),e.state.hasWheelJustStarted||e.setState({hasWheelJustStarted:!0},function(){var s,c;return(c=(s=e.props).onInteractionStart)===null||c===void 0?void 0:c.call(s)}),e.wheelTimer&&clearTimeout(e.wheelTimer),e.wheelTimer=e.currentWindow.setTimeout(function(){return e.setState({hasWheelJustStarted:!1},function(){var s,c;return(c=(s=e.props).onInteractionEnd)===null||c===void 0?void 0:c.call(s)})},250)}},e.getPointOnContainer=function(t,r){var i=t.x,n=t.y;if(!e.containerRect)throw new Error("The Cropper is not mounted");return{x:e.containerRect.width/2-(i-r.x),y:e.containerRect.height/2-(n-r.y)}},e.getPointOnMedia=function(t){var r=t.x,i=t.y,n=e.props,s=n.crop,c=n.zoom;return{x:(r+s.x)/c,y:(i+s.y)/c}},e.setNewZoom=function(t,r,i){var n=i===void 0?{}:i,s=n.shouldUpdatePosition,c=s===void 0?!0:s;if(!(!e.state.cropSize||!e.props.onZoomChange)){var l=O(t,e.props.minZoom,e.props.maxZoom);if(c){var u=e.getPointOnContainer(r,e.containerPosition),h=e.getPointOnMedia(u),d={x:h.x*l-u.x,y:h.y*l-u.y},m=e.props.restrictPosition?N(d,e.mediaSize,e.state.cropSize,l,e.props.rotation):d;e.props.onCropChange(m)}e.props.onZoomChange(l)}},e.getCropData=function(){if(!e.state.cropSize)return null;var t=e.props.restrictPosition?N(e.props.crop,e.mediaSize,e.state.cropSize,e.props.zoom,e.props.rotation):e.props.crop;return Ke(t,e.mediaSize,e.state.cropSize,e.getAspect(),e.props.zoom,e.props.rotation,e.props.restrictPosition)},e.emitCropData=function(){var t=e.getCropData();if(t){var r=t.croppedAreaPercentages,i=t.croppedAreaPixels;e.props.onCropComplete&&e.props.onCropComplete(r,i),e.props.onCropAreaChange&&e.props.onCropAreaChange(r,i)}},e.emitCropAreaChange=function(){var t=e.getCropData();if(t){var r=t.croppedAreaPercentages,i=t.croppedAreaPixels;e.props.onCropAreaChange&&e.props.onCropAreaChange(r,i)}},e.recomputeCropPosition=function(){var t,r;if(e.state.cropSize){var i=e.props.crop;if(e.isInitialized&&(!((t=e.previousCropSize)===null||t===void 0)&&t.width)&&(!((r=e.previousCropSize)===null||r===void 0)&&r.height)){var n=Math.abs(e.previousCropSize.width-e.state.cropSize.width)>1e-6||Math.abs(e.previousCropSize.height-e.state.cropSize.height)>1e-6;if(n){var s=e.state.cropSize.width/e.previousCropSize.width,c=e.state.cropSize.height/e.previousCropSize.height;i={x:e.props.crop.x*s,y:e.props.crop.y*c}}}var l=e.props.restrictPosition?N(i,e.mediaSize,e.state.cropSize,e.props.zoom,e.props.rotation):i;e.previousCropSize=e.state.cropSize,e.props.onCropChange(l),e.emitCropData()}},e.onKeyDown=function(t){var r,i,n=e.props,s=n.crop,c=n.onCropChange,l=n.keyboardStep,u=n.zoom,h=n.rotation,d=l;if(e.state.cropSize){t.shiftKey&&(d*=.2);var m=b({},s);switch(t.key){case"ArrowUp":m.y-=d,t.preventDefault();break;case"ArrowDown":m.y+=d,t.preventDefault();break;case"ArrowLeft":m.x-=d,t.preventDefault();break;case"ArrowRight":m.x+=d,t.preventDefault();break;default:return}e.props.restrictPosition&&(m=N(m,e.mediaSize,e.state.cropSize,u,h)),t.repeat||(i=(r=e.props).onInteractionStart)===null||i===void 0||i.call(r),c(m)}},e.onKeyUp=function(t){var r,i;switch(t.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":t.preventDefault();break;default:return}e.emitCropData(),(i=(r=e.props).onInteractionEnd)===null||i===void 0||i.call(r)},e}return o.prototype.componentDidMount=function(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver>"u"&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=it,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef),this.props.setCropperRef&&this.props.setCropperRef(this.cropperRef))},o.prototype.componentWillUnmount=function(){var e,t;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver>"u"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((t=this.styleRef.parentNode)===null||t===void 0||t.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},o.prototype.componentDidUpdate=function(e){var t,r,i,n,s,c,l,u,h;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.objectFit!==this.props.objectFit?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():((t=e.cropSize)===null||t===void 0?void 0:t.height)!==((r=this.props.cropSize)===null||r===void 0?void 0:r.height)||((i=e.cropSize)===null||i===void 0?void 0:i.width)!==((n=this.props.cropSize)===null||n===void 0?void 0:n.width)?this.computeSizes():(((s=e.crop)===null||s===void 0?void 0:s.x)!==((c=this.props.crop)===null||c===void 0?void 0:c.x)||((l=e.crop)===null||l===void 0?void 0:l.y)!==((u=this.props.crop)===null||u===void 0?void 0:u.y))&&this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&((h=this.videoRef.current)===null||h===void 0||h.load());var d=this.getObjectFit();d!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:d},this.computeSizes)},o.prototype.getAspect=function(){var e=this.props,t=e.cropSize,r=e.aspect;return t?t.width/t.height:r},o.prototype.getObjectFit=function(){var e,t,r,i;if(this.props.objectFit==="cover"){var n=this.imageRef.current||this.videoRef.current;if(n&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var s=this.containerRect.width/this.containerRect.height,c=((e=this.imageRef.current)===null||e===void 0?void 0:e.naturalWidth)||((t=this.videoRef.current)===null||t===void 0?void 0:t.videoWidth)||0,l=((r=this.imageRef.current)===null||r===void 0?void 0:r.naturalHeight)||((i=this.videoRef.current)===null||i===void 0?void 0:i.videoHeight)||0,u=c/l;return u<s?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},o.prototype.onPinchStart=function(e){var t=o.getTouchPoint(e.touches[0]),r=o.getTouchPoint(e.touches[1]);this.lastPinchDistance=se(t,r),this.lastPinchRotation=ce(t,r),this.onDragStart(le(t,r))},o.prototype.onPinchMove=function(e){var t=this;if(!(!this.currentDoc||!this.currentWindow)){var r=o.getTouchPoint(e.touches[0]),i=o.getTouchPoint(e.touches[1]),n=le(r,i);this.onDrag(n),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var s=se(r,i),c=t.props.zoom*(s/t.lastPinchDistance);t.setNewZoom(c,n,{shouldUpdatePosition:!1}),t.lastPinchDistance=s;var l=ce(r,i),u=t.props.rotation+(l-t.lastPinchRotation);t.props.onRotationChange&&t.props.onRotationChange(u),t.lastPinchRotation=l})}},o.prototype.render=function(){var e=this,t,r=this.props,i=r.image,n=r.video,s=r.mediaProps,c=r.cropperProps,l=r.transform,u=r.crop,h=u.x,d=u.y,m=r.rotation,w=r.zoom,v=r.cropShape,f=r.showGrid,R=r.roundCropAreaPixels,y=r.style,g=y.containerStyle,E=y.cropAreaStyle,_=y.mediaStyle,P=r.classes,W=P.containerClassName,k=P.cropAreaClassName,D=P.mediaClassName,z=(t=this.state.mediaObjectFit)!==null&&t!==void 0?t:this.getObjectFit();return x.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(U){return e.containerRef=U},"data-testid":"container",style:g,className:L("reactEasyCrop_Container",W)},i?x.createElement("img",b({alt:"",className:L("reactEasyCrop_Image",z==="contain"&&"reactEasyCrop_Contain",z==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",z==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",D)},s,{src:i,ref:this.imageRef,style:b(b({},_),{transform:l||"translate(".concat(h,"px, ").concat(d,"px) rotate(").concat(m,"deg) scale(").concat(w,")")}),onLoad:this.onMediaLoad})):n&&x.createElement("video",b({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:L("reactEasyCrop_Video",z==="contain"&&"reactEasyCrop_Contain",z==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",z==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",D)},s,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:b(b({},_),{transform:l||"translate(".concat(h,"px, ").concat(d,"px) rotate(").concat(m,"deg) scale(").concat(w,")")}),controls:!1}),(Array.isArray(n)?n:[{src:n}]).map(function(T){return x.createElement("source",b({key:T.src},T))})),this.state.cropSize&&x.createElement("div",b({ref:this.cropperRef,style:b(b({},E),{width:R?Math.round(this.state.cropSize.width):this.state.cropSize.width,height:R?Math.round(this.state.cropSize.height):this.state.cropSize.height}),tabIndex:0,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,"data-testid":"cropper",className:L("reactEasyCrop_CropArea",v==="round"&&"reactEasyCrop_CropAreaRound",f&&"reactEasyCrop_CropAreaGrid",k)},c)))},o.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:at,minZoom:nt,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},cropperProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0,keyboardStep:st},o.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},o.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},o})(x.Component);function lt({className:a,defaultValue:o,value:e,min:t=0,max:r=100,...i}){const n=x.useMemo(()=>Array.isArray(e)?e:Array.isArray(o)?o:[t,r],[e,o,t,r]);return p.jsxs(Se,{"data-slot":"slider",defaultValue:o,value:e,min:t,max:r,className:B("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",a),...i,children:[p.jsx(_e,{"data-slot":"slider-track",className:B("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-4 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:p.jsx(ze,{"data-slot":"slider-range",className:B("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:n.length},(s,c)=>p.jsx(De,{"data-slot":"slider-thumb",className:"border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},c))]})}const de=["image/png","image/jpeg","image/webp"],he=2*1024*1024,fe=256,ut=a=>{const o=a.normalize("NFKD").toLowerCase(),e=o.lastIndexOf("."),t=e>0?o.slice(0,e):o,r=e>0?o.slice(e).replace(/[^.a-z0-9]/g,""):"";return`${t.replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")||"profile-picture"}${r}`},pt=(a,o,e=Date.now())=>`profile-pictures/${a}/${e}-${ut(o)}`,me=a=>de.includes(a.type)?a.size>he?"Profile pictures must be 2MB or smaller.":a.name.trim()?null:"Please choose a valid image file.":"Only PNG, JPEG, and WebP images are allowed.",dt=a=>new Promise((o,e)=>{const t=URL.createObjectURL(a),r=new Image,i=setTimeout(()=>{URL.revokeObjectURL(t),e(new Error("Image loading timed out. Please try a different file."))},15e3);r.onload=()=>{clearTimeout(i),URL.revokeObjectURL(t),o(r)},r.onerror=()=>{clearTimeout(i),URL.revokeObjectURL(t),e(new Error("Unable to read the selected image. Please try another file."))},r.crossOrigin="anonymous",r.src=t}),ue=(a,o,e)=>new Promise((t,r)=>{a.toBlob(i=>{if(!i){r(new Error("Failed to prepare the image for upload."));return}t(i)},o,e)}),ht=async(a,o=fe)=>{const e=await dt(a),t=document.createElement("canvas");t.width=o,t.height=o;const r=t.getContext("2d");if(!r)throw new Error("Your browser cannot process image uploads right now.");const i=e.naturalWidth||e.width,n=e.naturalHeight||e.height,s=Math.min(i,n),c=Math.max(0,(i-s)/2),l=Math.max(0,(n-s)/2);r.clearRect(0,0,o,o),r.drawImage(e,c,l,s,s,0,0,o,o);try{return await ue(t,"image/webp",.9)}catch{return await ue(t,"image/jpeg",.9)}},j=(a,o,e)=>{let t;const r=new Promise((i,n)=>{t=setTimeout(()=>n(new Error(`${e} timed out after ${Math.round(o/1e3)}s`)),o)});return Promise.race([a,r]).finally(()=>clearTimeout(t))},ft=async(a,o,e)=>{const t=we.options.projectId;if(!t)throw new Error("Firebase project ID is not configured.");const r=await a.getIdToken(),i=`https://firestore.googleapis.com/v1/projects/${t}/databases/(default)/documents/users/${o}?updateMask.fieldPaths=photo&updateMask.fieldPaths=updatedAt`,n=await fetch(i,{method:"PATCH",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify({fields:{photo:{stringValue:e},updatedAt:{timestampValue:new Date().toISOString()}}})});if(!n.ok){const s=await n.text().catch(()=>"");throw new Error(`Firestore REST update failed (${n.status}): ${s}`)}},mt=async({file:a,uid:o,currentUser:e=K.currentUser,syncFirestore:t=!0})=>{const r=me(a);if(r)throw new Error(r);const i=e??K.currentUser;if(!i)throw new Error("You need to be signed in to change your profile picture.");const n=o||i.uid;if(!n)throw new Error("Unable to determine which profile should be updated.");if(i.uid!==n)throw new Error("The signed-in user does not match the profile being edited.");const s=await j(ht(a,fe),2e4,"Image processing"),c=pt(n,a.name),l=Ae(ge,c),u=await j(Te(l,s,{contentType:s.type||"image/webp",cacheControl:"public, max-age=31536000, immutable"}),3e4,"Storage upload"),h=await j(Ne(u.ref),1e4,"Download URL retrieval");try{await j(Me(i,{photoURL:h}),1e4,"Auth profile update")}catch(d){console.warn("[PROFILE UPLOAD] Auth profile update failed (non-fatal):",d)}if(t){try{await j(ft(i,n,h),1e4,"Firestore profile sync")}catch(d){console.error("[PROFILE UPLOAD] Firestore REST sync failed:",d),console.warn("[PROFILE UPLOAD] Photo was uploaded but the database record may be stale. It will refresh on next login.")}try{const{doc:d,updateDoc:m}=await $(async()=>{const{doc:v,updateDoc:f}=await import("./vendor-firebase-firestore-CNv3xXal.js");return{doc:v,updateDoc:f}},__vite__mapDeps([0,1])),{db:w}=await $(async()=>{const{db:v}=await import("./index-dPnhhJ9w.js").then(f=>f.b5);return{db:v}},__vite__mapDeps([2,3,0,1,4,5,6,7,8,9,10,11]));await m(d(w,"leaderboard",n),{photo:h}).catch(()=>$(async()=>{const{setDoc:v}=await import("./vendor-firebase-firestore-CNv3xXal.js");return{setDoc:v}},__vite__mapDeps([0,1])).then(({setDoc:v})=>v(d(w,"leaderboard",n),{photo:h},{merge:!0})))}catch{}}return h},vt=a=>`${(a/(1024*1024)).toFixed(1)} MB`,gt=a=>{const o=(a||"").trim();return o?o.split(/\s+/).slice(0,2).map(e=>e[0]?.toUpperCase()).join(""):"U"},wt=a=>new Promise((o,e)=>{const t=new Image;t.onload=()=>o(t),t.onerror=()=>e(new Error("Unable to load the image for cropping.")),t.src=a}),pe=(a,o,e)=>new Promise((t,r)=>{a.toBlob(i=>{if(!i){r(new Error("Failed to prepare the cropped image."));return}t(i)},o,e)}),xt=async(a,o,e)=>{const t=await wt(a),r=document.createElement("canvas"),i=640;r.width=i,r.height=i;const n=r.getContext("2d");if(!n)throw new Error("Your browser cannot process the selected image right now.");n.clearRect(0,0,i,i),n.drawImage(t,o.x,o.y,o.width,o.height,0,0,i,i);let s;try{s=await pe(r,"image/webp",.92)}catch{s=await pe(r,"image/jpeg",.92)}if(!s)throw new Error("Could not create an image from the cropped area.");const c=s.type==="image/webp"?"webp":"jpg",u=`${e.name.replace(/\.[^/.]+$/,"")||"profile-picture"}-cropped.${c}`;return new File([s],u,{type:s.type,lastModified:Date.now()})},Nt=({uid:a,photoURL:o,displayName:e,className:t="",onUploaded:r,syncFirestore:i=!0})=>{const{currentUser:n,refreshProfile:s}=xe(),[c,l]=x.useState(null),[u,h]=x.useState(null),[d,m]=x.useState({x:0,y:0}),[w,v]=x.useState(1),[f,R]=x.useState(null),[y,g]=x.useState(""),[E,_]=x.useState(!1),P=x.useRef(null);x.useEffect(()=>{if(!c){h(null);return}const C=URL.createObjectURL(c);return h(C),()=>URL.revokeObjectURL(C)},[c]);const W=u||o||"",k=x.useMemo(()=>`${de.map(S=>S.replace("image/","").toUpperCase()).join(", ")} up to ${vt(he)}. The image will be cropped to a circular avatar.`,[]),D=()=>{l(null),m({x:0,y:0}),v(1),R(null),g(""),P.current&&(P.current.value="")},z=C=>{const S=C.target.files?.[0]||null;if(!S)return;const M=me(S);if(M){g(M),l(null),C.target.value="";return}g(""),l(S),m({x:0,y:0}),v(1),R(null)},T=async()=>{if(!c){g("Choose an image before saving.");return}_(!0),g("");const C=6e4;let S;try{const M=(async()=>{const I=u&&f?await xt(u,f,c):c,Z=a||n?.uid;return mt({file:I,uid:Z,currentUser:n,syncFirestore:i})})(),F=new Promise((I,Z)=>{S=setTimeout(()=>Z(new Error("Upload timed out. Please check your connection and try again.")),C)}),ve=await Promise.race([M,F]);r?.(ve),s().catch(I=>console.warn("[ProfilePictureUploader] refreshProfile failed:",I)),Q.success("Profile picture updated."),D()}catch(M){const F=M instanceof Error?M.message:"Failed to update your profile picture.";g(F),Q.error(F)}finally{clearTimeout(S),_(!1)}},U=()=>{P.current?.click()};return p.jsxs(p.Fragment,{children:[p.jsxs("section",{className:`flex items-center gap-4 rounded-xl border border-slate-200 bg-white p-4 shadow-sm ${t}`,children:[p.jsxs("div",{className:"relative cursor-pointer group",onClick:U,role:"button",tabIndex:0,onKeyDown:C=>C.key==="Enter"&&U(),"aria-label":"Change profile picture",children:[p.jsxs(ye,{className:"size-16 sm:size-20 ring-4 ring-sky-50 shadow-sm transition-transform duration-200 group-hover:scale-105",children:[p.jsx(be,{src:W,alt:`${e||"User"} profile picture`}),p.jsx(Ce,{className:"bg-gradient-to-br from-sky-600 to-cyan-500 text-lg font-semibold text-white",children:gt(e)})]}),p.jsx("span",{className:"absolute -right-1 -top-1 inline-flex items-center justify-center rounded-full bg-slate-900 p-1.5 text-white shadow-md transition-colors group-hover:bg-slate-700",children:p.jsx(Oe,{size:14})})]}),p.jsxs("div",{className:"space-y-1 flex-1",children:[p.jsx("p",{className:"text-sm font-semibold text-slate-900",children:"Profile picture"}),p.jsx("p",{className:"text-xs text-slate-500",children:"Click your avatar to upload a new photo."}),y&&p.jsx("p",{className:"text-xs font-medium text-rose-600 mt-1",children:y})]}),p.jsx("input",{ref:P,type:"file",accept:"image/*",onChange:z,className:"sr-only","aria-label":"Choose profile picture"})]}),p.jsx(Pe,{children:u&&p.jsxs(p.Fragment,{children:[p.jsx(J.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[60]",onClick:D}),p.jsx(J.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},transition:{type:"spring",duration:.5,bounce:.3},className:"fixed inset-0 z-[60] flex items-center justify-center p-4 sm:p-6",onClick:C=>C.stopPropagation(),children:p.jsxs("div",{className:"bg-white rounded-2xl shadow-xl w-full max-w-lg overflow-hidden flex flex-col",children:[p.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-slate-100",children:[p.jsx("h3",{className:"text-lg font-bold text-slate-900",children:"Update profile picture"}),p.jsx("button",{onClick:D,className:"p-2 text-slate-400 hover:text-slate-600 hover:bg-slate-100 rounded-full transition-colors","aria-label":"Close modal",children:p.jsx(je,{size:20})})]}),p.jsxs("div",{className:"p-4 sm:p-6 bg-slate-50 flex flex-col items-center",children:[p.jsx("div",{className:"relative h-[350px] sm:h-[450px] w-[350px] sm:w-[450px] mx-auto overflow-hidden rounded-xl bg-slate-100 ring-1 ring-inset ring-slate-200 shadow-inner",children:p.jsx(ct,{image:u,crop:d,zoom:w,aspect:1,cropShape:"round",showGrid:!1,objectFit:"cover",restrictPosition:!0,onCropChange:m,onZoomChange:v,onCropComplete:(C,S)=>R(S),style:{containerStyle:{backgroundColor:"#f8fafc"}}})}),p.jsxs("div",{className:"mt-6 w-full max-w-xs flex items-center gap-4",children:[p.jsx(Ue,{size:18,className:"text-slate-500"}),p.jsx(lt,{value:[w],min:1,max:3,step:.05,onValueChange:C=>v(C[0]||1),"aria-label":"Profile picture zoom",className:"flex-1 cursor-pointer"}),p.jsx(Fe,{size:18,className:"text-slate-500"})]}),p.jsx("p",{className:"mt-4 text-xs text-slate-500 text-center",children:k})]}),p.jsxs("div",{className:"p-4 border-t border-slate-100 flex items-center justify-end gap-3 bg-white",children:[p.jsx(ee,{type:"button",variant:"ghost",onClick:D,disabled:E,className:"font-medium text-slate-600 hover:text-slate-900 hover:bg-slate-100 px-5",children:"Cancel"}),p.jsx(ee,{type:"button",onClick:T,disabled:E||!c,className:"bg-sky-600 hover:bg-sky-700 text-white min-w-[120px] gap-2 shadow-sm",children:E?p.jsxs(p.Fragment,{children:[p.jsx(Ie,{size:16,className:"animate-pulse"}),"Saving..."]}):"Save picture"})]})]})})]})})]})};export{At as M,Nt as P,Tt as V};
|
|
|
|
| 1 |
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/index-CGNBpSmO.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-BPuEd8FG.js","assets/vendor-charts-D7t7JfSr.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-CEL3Ax6X.css"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{e as V,n as B,N as K,_ as $,b1 as ge,b2 as we,u as xe,Q as ye,V as be,W as Ce,h as Pe,m as J,j as Q}from"./index-CGNBpSmO.js";import{g as Re,r as x,j as p}from"./vendor-react-B4AQeu28.js";import{_ as Ee,o as b,p as Se,q as _e,r as ze,s as De}from"./vendor-radix-BPuEd8FG.js";import{B as ee}from"./button-DVjn4LkC.js";import{updateProfile as Me}from"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-core-D7GXCeNu.js";import{r as Ae,u as Te,a as Ne}from"./vendor-firebase-storage-Bi7H_66d.js";import{X as je}from"./x-Deb9zs8O.js";import{M as Ue}from"./minus-DV5fnWn8.js";import{P as Fe}from"./plus-ck_SGnHK.js";import{U as Ie}from"./upload-Daz-vKaw.js";/**
|
| 3 |
* @license lucide-react v0.487.0 - ISC
|
| 4 |
*
|
| 5 |
* This source code is licensed under the ISC license.
|
|
|
|
| 107 |
border-left: 0;
|
| 108 |
border-right: 0;
|
| 109 |
}
|
| 110 |
+
`,nt=1,at=3,st=1,ct=(function(a){Ee(o,a);function o(){var e=a!==null&&a.apply(this,arguments)||this;return e.cropperRef=x.createRef(),e.imageRef=x.createRef(),e.videoRef=x.createRef(),e.containerPosition={x:0,y:0},e.containerRef=null,e.styleRef=null,e.containerRect=null,e.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},e.dragStartPosition={x:0,y:0},e.dragStartCrop={x:0,y:0},e.gestureZoomStart=0,e.gestureRotationStart=0,e.isTouching=!1,e.lastPinchDistance=0,e.lastPinchRotation=0,e.rafDragTimeout=null,e.rafPinchTimeout=null,e.wheelTimer=null,e.currentDoc=typeof document<"u"?document:null,e.currentWindow=typeof window<"u"?window:null,e.resizeObserver=null,e.previousCropSize=null,e.isInitialized=!1,e.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},e.initResizeObserver=function(){if(!(typeof window.ResizeObserver>"u"||!e.containerRef)){var t=!0;e.resizeObserver=new window.ResizeObserver(function(r){if(t){t=!1;return}e.computeSizes()}),e.resizeObserver.observe(e.containerRef)}},e.preventZoomSafari=function(t){return t.preventDefault()},e.cleanEvents=function(){e.currentDoc&&(e.currentDoc.removeEventListener("mousemove",e.onMouseMove),e.currentDoc.removeEventListener("mouseup",e.onDragStopped),e.currentDoc.removeEventListener("touchmove",e.onTouchMove),e.currentDoc.removeEventListener("touchend",e.onDragStopped),e.currentDoc.removeEventListener("gesturechange",e.onGestureChange),e.currentDoc.removeEventListener("gestureend",e.onGestureEnd),e.currentDoc.removeEventListener("scroll",e.onScroll))},e.clearScrollEvent=function(){e.containerRef&&e.containerRef.removeEventListener("wheel",e.onWheel),e.wheelTimer&&clearTimeout(e.wheelTimer)},e.onMediaLoad=function(){var t=e.computeSizes();t&&(e.previousCropSize=t,e.emitCropData(),e.setInitialCrop(t),e.isInitialized=!0),e.props.onMediaLoaded&&e.props.onMediaLoaded(e.mediaSize)},e.setInitialCrop=function(t){if(e.props.initialCroppedAreaPercentages){var r=et(e.props.initialCroppedAreaPercentages,e.mediaSize,e.props.rotation,t,e.props.minZoom,e.props.maxZoom),i=r.crop,n=r.zoom;e.props.onCropChange(i),e.props.onZoomChange&&e.props.onZoomChange(n)}else if(e.props.initialCroppedAreaPixels){var s=rt(e.props.initialCroppedAreaPixels,e.mediaSize,e.props.rotation,t,e.props.minZoom,e.props.maxZoom),i=s.crop,n=s.zoom;e.props.onCropChange(i),e.props.onZoomChange&&e.props.onZoomChange(n)}},e.computeSizes=function(){var t,r,i,n,s,c,l=e.imageRef.current||e.videoRef.current;if(l&&e.containerRef){e.containerRect=e.containerRef.getBoundingClientRect(),e.saveContainerPosition();var u=e.containerRect.width/e.containerRect.height,h=((t=e.imageRef.current)===null||t===void 0?void 0:t.naturalWidth)||((r=e.videoRef.current)===null||r===void 0?void 0:r.videoWidth)||0,d=((i=e.imageRef.current)===null||i===void 0?void 0:i.naturalHeight)||((n=e.videoRef.current)===null||n===void 0?void 0:n.videoHeight)||0,m=l.offsetWidth<h||l.offsetHeight<d,w=h/d,v=void 0;if(m)switch(e.state.mediaObjectFit){default:case"contain":v=u>w?{width:e.containerRect.height*w,height:e.containerRect.height}:{width:e.containerRect.width,height:e.containerRect.width/w};break;case"horizontal-cover":v={width:e.containerRect.width,height:e.containerRect.width/w};break;case"vertical-cover":v={width:e.containerRect.height*w,height:e.containerRect.height};break}else v={width:l.offsetWidth,height:l.offsetHeight};e.mediaSize=b(b({},v),{naturalWidth:h,naturalHeight:d}),e.props.setMediaSize&&e.props.setMediaSize(e.mediaSize);var f=e.props.cropSize?e.props.cropSize:Xe(e.mediaSize.width,e.mediaSize.height,e.containerRect.width,e.containerRect.height,e.props.aspect,e.props.rotation);return(((s=e.state.cropSize)===null||s===void 0?void 0:s.height)!==f.height||((c=e.state.cropSize)===null||c===void 0?void 0:c.width)!==f.width)&&e.props.onCropSizeChange&&e.props.onCropSizeChange(f),e.setState({cropSize:f},e.recomputeCropPosition),e.props.setCropSize&&e.props.setCropSize(f),f}},e.saveContainerPosition=function(){if(e.containerRef){var t=e.containerRef.getBoundingClientRect();e.containerPosition={x:t.left,y:t.top}}},e.onMouseDown=function(t){e.currentDoc&&(t.preventDefault(),e.currentDoc.addEventListener("mousemove",e.onMouseMove),e.currentDoc.addEventListener("mouseup",e.onDragStopped),e.saveContainerPosition(),e.onDragStart(o.getMousePoint(t)))},e.onMouseMove=function(t){return e.onDrag(o.getMousePoint(t))},e.onScroll=function(t){e.currentDoc&&(t.preventDefault(),e.saveContainerPosition())},e.onTouchStart=function(t){e.currentDoc&&(e.isTouching=!0,!(e.props.onTouchRequest&&!e.props.onTouchRequest(t))&&(e.currentDoc.addEventListener("touchmove",e.onTouchMove,{passive:!1}),e.currentDoc.addEventListener("touchend",e.onDragStopped),e.saveContainerPosition(),t.touches.length===2?e.onPinchStart(t):t.touches.length===1&&e.onDragStart(o.getTouchPoint(t.touches[0]))))},e.onTouchMove=function(t){t.preventDefault(),t.touches.length===2?e.onPinchMove(t):t.touches.length===1&&e.onDrag(o.getTouchPoint(t.touches[0]))},e.onGestureStart=function(t){e.currentDoc&&(t.preventDefault(),e.currentDoc.addEventListener("gesturechange",e.onGestureChange),e.currentDoc.addEventListener("gestureend",e.onGestureEnd),e.gestureZoomStart=e.props.zoom,e.gestureRotationStart=e.props.rotation)},e.onGestureChange=function(t){if(t.preventDefault(),!e.isTouching){var r=o.getMousePoint(t),i=e.gestureZoomStart-1+t.scale;if(e.setNewZoom(i,r,{shouldUpdatePosition:!0}),e.props.onRotationChange){var n=e.gestureRotationStart+t.rotation;e.props.onRotationChange(n)}}},e.onGestureEnd=function(t){e.cleanEvents()},e.onDragStart=function(t){var r,i,n=t.x,s=t.y;e.dragStartPosition={x:n,y:s},e.dragStartCrop=b({},e.props.crop),(i=(r=e.props).onInteractionStart)===null||i===void 0||i.call(r)},e.onDrag=function(t){var r=t.x,i=t.y;e.currentWindow&&(e.rafDragTimeout&&e.currentWindow.cancelAnimationFrame(e.rafDragTimeout),e.rafDragTimeout=e.currentWindow.requestAnimationFrame(function(){if(e.state.cropSize&&!(r===void 0||i===void 0)){var n=r-e.dragStartPosition.x,s=i-e.dragStartPosition.y,c={x:e.dragStartCrop.x+n,y:e.dragStartCrop.y+s},l=e.props.restrictPosition?N(c,e.mediaSize,e.state.cropSize,e.props.zoom,e.props.rotation):c;e.props.onCropChange(l)}}))},e.onDragStopped=function(){var t,r;e.isTouching=!1,e.cleanEvents(),e.emitCropData(),(r=(t=e.props).onInteractionEnd)===null||r===void 0||r.call(t)},e.onWheel=function(t){if(e.currentWindow&&!(e.props.onWheelRequest&&!e.props.onWheelRequest(t))){t.preventDefault();var r=o.getMousePoint(t),i=Ye(t).pixelY,n=e.props.zoom-i*e.props.zoomSpeed/200;e.setNewZoom(n,r,{shouldUpdatePosition:!0}),e.state.hasWheelJustStarted||e.setState({hasWheelJustStarted:!0},function(){var s,c;return(c=(s=e.props).onInteractionStart)===null||c===void 0?void 0:c.call(s)}),e.wheelTimer&&clearTimeout(e.wheelTimer),e.wheelTimer=e.currentWindow.setTimeout(function(){return e.setState({hasWheelJustStarted:!1},function(){var s,c;return(c=(s=e.props).onInteractionEnd)===null||c===void 0?void 0:c.call(s)})},250)}},e.getPointOnContainer=function(t,r){var i=t.x,n=t.y;if(!e.containerRect)throw new Error("The Cropper is not mounted");return{x:e.containerRect.width/2-(i-r.x),y:e.containerRect.height/2-(n-r.y)}},e.getPointOnMedia=function(t){var r=t.x,i=t.y,n=e.props,s=n.crop,c=n.zoom;return{x:(r+s.x)/c,y:(i+s.y)/c}},e.setNewZoom=function(t,r,i){var n=i===void 0?{}:i,s=n.shouldUpdatePosition,c=s===void 0?!0:s;if(!(!e.state.cropSize||!e.props.onZoomChange)){var l=O(t,e.props.minZoom,e.props.maxZoom);if(c){var u=e.getPointOnContainer(r,e.containerPosition),h=e.getPointOnMedia(u),d={x:h.x*l-u.x,y:h.y*l-u.y},m=e.props.restrictPosition?N(d,e.mediaSize,e.state.cropSize,l,e.props.rotation):d;e.props.onCropChange(m)}e.props.onZoomChange(l)}},e.getCropData=function(){if(!e.state.cropSize)return null;var t=e.props.restrictPosition?N(e.props.crop,e.mediaSize,e.state.cropSize,e.props.zoom,e.props.rotation):e.props.crop;return Ke(t,e.mediaSize,e.state.cropSize,e.getAspect(),e.props.zoom,e.props.rotation,e.props.restrictPosition)},e.emitCropData=function(){var t=e.getCropData();if(t){var r=t.croppedAreaPercentages,i=t.croppedAreaPixels;e.props.onCropComplete&&e.props.onCropComplete(r,i),e.props.onCropAreaChange&&e.props.onCropAreaChange(r,i)}},e.emitCropAreaChange=function(){var t=e.getCropData();if(t){var r=t.croppedAreaPercentages,i=t.croppedAreaPixels;e.props.onCropAreaChange&&e.props.onCropAreaChange(r,i)}},e.recomputeCropPosition=function(){var t,r;if(e.state.cropSize){var i=e.props.crop;if(e.isInitialized&&(!((t=e.previousCropSize)===null||t===void 0)&&t.width)&&(!((r=e.previousCropSize)===null||r===void 0)&&r.height)){var n=Math.abs(e.previousCropSize.width-e.state.cropSize.width)>1e-6||Math.abs(e.previousCropSize.height-e.state.cropSize.height)>1e-6;if(n){var s=e.state.cropSize.width/e.previousCropSize.width,c=e.state.cropSize.height/e.previousCropSize.height;i={x:e.props.crop.x*s,y:e.props.crop.y*c}}}var l=e.props.restrictPosition?N(i,e.mediaSize,e.state.cropSize,e.props.zoom,e.props.rotation):i;e.previousCropSize=e.state.cropSize,e.props.onCropChange(l),e.emitCropData()}},e.onKeyDown=function(t){var r,i,n=e.props,s=n.crop,c=n.onCropChange,l=n.keyboardStep,u=n.zoom,h=n.rotation,d=l;if(e.state.cropSize){t.shiftKey&&(d*=.2);var m=b({},s);switch(t.key){case"ArrowUp":m.y-=d,t.preventDefault();break;case"ArrowDown":m.y+=d,t.preventDefault();break;case"ArrowLeft":m.x-=d,t.preventDefault();break;case"ArrowRight":m.x+=d,t.preventDefault();break;default:return}e.props.restrictPosition&&(m=N(m,e.mediaSize,e.state.cropSize,u,h)),t.repeat||(i=(r=e.props).onInteractionStart)===null||i===void 0||i.call(r),c(m)}},e.onKeyUp=function(t){var r,i;switch(t.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":t.preventDefault();break;default:return}e.emitCropData(),(i=(r=e.props).onInteractionEnd)===null||i===void 0||i.call(r)},e}return o.prototype.componentDidMount=function(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver>"u"&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=it,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef),this.props.setCropperRef&&this.props.setCropperRef(this.cropperRef))},o.prototype.componentWillUnmount=function(){var e,t;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver>"u"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((t=this.styleRef.parentNode)===null||t===void 0||t.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},o.prototype.componentDidUpdate=function(e){var t,r,i,n,s,c,l,u,h;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.objectFit!==this.props.objectFit?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():((t=e.cropSize)===null||t===void 0?void 0:t.height)!==((r=this.props.cropSize)===null||r===void 0?void 0:r.height)||((i=e.cropSize)===null||i===void 0?void 0:i.width)!==((n=this.props.cropSize)===null||n===void 0?void 0:n.width)?this.computeSizes():(((s=e.crop)===null||s===void 0?void 0:s.x)!==((c=this.props.crop)===null||c===void 0?void 0:c.x)||((l=e.crop)===null||l===void 0?void 0:l.y)!==((u=this.props.crop)===null||u===void 0?void 0:u.y))&&this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&((h=this.videoRef.current)===null||h===void 0||h.load());var d=this.getObjectFit();d!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:d},this.computeSizes)},o.prototype.getAspect=function(){var e=this.props,t=e.cropSize,r=e.aspect;return t?t.width/t.height:r},o.prototype.getObjectFit=function(){var e,t,r,i;if(this.props.objectFit==="cover"){var n=this.imageRef.current||this.videoRef.current;if(n&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var s=this.containerRect.width/this.containerRect.height,c=((e=this.imageRef.current)===null||e===void 0?void 0:e.naturalWidth)||((t=this.videoRef.current)===null||t===void 0?void 0:t.videoWidth)||0,l=((r=this.imageRef.current)===null||r===void 0?void 0:r.naturalHeight)||((i=this.videoRef.current)===null||i===void 0?void 0:i.videoHeight)||0,u=c/l;return u<s?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},o.prototype.onPinchStart=function(e){var t=o.getTouchPoint(e.touches[0]),r=o.getTouchPoint(e.touches[1]);this.lastPinchDistance=se(t,r),this.lastPinchRotation=ce(t,r),this.onDragStart(le(t,r))},o.prototype.onPinchMove=function(e){var t=this;if(!(!this.currentDoc||!this.currentWindow)){var r=o.getTouchPoint(e.touches[0]),i=o.getTouchPoint(e.touches[1]),n=le(r,i);this.onDrag(n),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var s=se(r,i),c=t.props.zoom*(s/t.lastPinchDistance);t.setNewZoom(c,n,{shouldUpdatePosition:!1}),t.lastPinchDistance=s;var l=ce(r,i),u=t.props.rotation+(l-t.lastPinchRotation);t.props.onRotationChange&&t.props.onRotationChange(u),t.lastPinchRotation=l})}},o.prototype.render=function(){var e=this,t,r=this.props,i=r.image,n=r.video,s=r.mediaProps,c=r.cropperProps,l=r.transform,u=r.crop,h=u.x,d=u.y,m=r.rotation,w=r.zoom,v=r.cropShape,f=r.showGrid,R=r.roundCropAreaPixels,y=r.style,g=y.containerStyle,E=y.cropAreaStyle,_=y.mediaStyle,P=r.classes,W=P.containerClassName,k=P.cropAreaClassName,D=P.mediaClassName,z=(t=this.state.mediaObjectFit)!==null&&t!==void 0?t:this.getObjectFit();return x.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(U){return e.containerRef=U},"data-testid":"container",style:g,className:L("reactEasyCrop_Container",W)},i?x.createElement("img",b({alt:"",className:L("reactEasyCrop_Image",z==="contain"&&"reactEasyCrop_Contain",z==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",z==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",D)},s,{src:i,ref:this.imageRef,style:b(b({},_),{transform:l||"translate(".concat(h,"px, ").concat(d,"px) rotate(").concat(m,"deg) scale(").concat(w,")")}),onLoad:this.onMediaLoad})):n&&x.createElement("video",b({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:L("reactEasyCrop_Video",z==="contain"&&"reactEasyCrop_Contain",z==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",z==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",D)},s,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:b(b({},_),{transform:l||"translate(".concat(h,"px, ").concat(d,"px) rotate(").concat(m,"deg) scale(").concat(w,")")}),controls:!1}),(Array.isArray(n)?n:[{src:n}]).map(function(T){return x.createElement("source",b({key:T.src},T))})),this.state.cropSize&&x.createElement("div",b({ref:this.cropperRef,style:b(b({},E),{width:R?Math.round(this.state.cropSize.width):this.state.cropSize.width,height:R?Math.round(this.state.cropSize.height):this.state.cropSize.height}),tabIndex:0,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,"data-testid":"cropper",className:L("reactEasyCrop_CropArea",v==="round"&&"reactEasyCrop_CropAreaRound",f&&"reactEasyCrop_CropAreaGrid",k)},c)))},o.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:at,minZoom:nt,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},cropperProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0,keyboardStep:st},o.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},o.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},o})(x.Component);function lt({className:a,defaultValue:o,value:e,min:t=0,max:r=100,...i}){const n=x.useMemo(()=>Array.isArray(e)?e:Array.isArray(o)?o:[t,r],[e,o,t,r]);return p.jsxs(Se,{"data-slot":"slider",defaultValue:o,value:e,min:t,max:r,className:B("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",a),...i,children:[p.jsx(_e,{"data-slot":"slider-track",className:B("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-4 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:p.jsx(ze,{"data-slot":"slider-range",className:B("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:n.length},(s,c)=>p.jsx(De,{"data-slot":"slider-thumb",className:"border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},c))]})}const de=["image/png","image/jpeg","image/webp"],he=2*1024*1024,fe=256,ut=a=>{const o=a.normalize("NFKD").toLowerCase(),e=o.lastIndexOf("."),t=e>0?o.slice(0,e):o,r=e>0?o.slice(e).replace(/[^.a-z0-9]/g,""):"";return`${t.replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")||"profile-picture"}${r}`},pt=(a,o,e=Date.now())=>`profile-pictures/${a}/${e}-${ut(o)}`,me=a=>de.includes(a.type)?a.size>he?"Profile pictures must be 2MB or smaller.":a.name.trim()?null:"Please choose a valid image file.":"Only PNG, JPEG, and WebP images are allowed.",dt=a=>new Promise((o,e)=>{const t=URL.createObjectURL(a),r=new Image,i=setTimeout(()=>{URL.revokeObjectURL(t),e(new Error("Image loading timed out. Please try a different file."))},15e3);r.onload=()=>{clearTimeout(i),URL.revokeObjectURL(t),o(r)},r.onerror=()=>{clearTimeout(i),URL.revokeObjectURL(t),e(new Error("Unable to read the selected image. Please try another file."))},r.crossOrigin="anonymous",r.src=t}),ue=(a,o,e)=>new Promise((t,r)=>{a.toBlob(i=>{if(!i){r(new Error("Failed to prepare the image for upload."));return}t(i)},o,e)}),ht=async(a,o=fe)=>{const e=await dt(a),t=document.createElement("canvas");t.width=o,t.height=o;const r=t.getContext("2d");if(!r)throw new Error("Your browser cannot process image uploads right now.");const i=e.naturalWidth||e.width,n=e.naturalHeight||e.height,s=Math.min(i,n),c=Math.max(0,(i-s)/2),l=Math.max(0,(n-s)/2);r.clearRect(0,0,o,o),r.drawImage(e,c,l,s,s,0,0,o,o);try{return await ue(t,"image/webp",.9)}catch{return await ue(t,"image/jpeg",.9)}},j=(a,o,e)=>{let t;const r=new Promise((i,n)=>{t=setTimeout(()=>n(new Error(`${e} timed out after ${Math.round(o/1e3)}s`)),o)});return Promise.race([a,r]).finally(()=>clearTimeout(t))},ft=async(a,o,e)=>{const t=we.options.projectId;if(!t)throw new Error("Firebase project ID is not configured.");const r=await a.getIdToken(),i=`https://firestore.googleapis.com/v1/projects/${t}/databases/(default)/documents/users/${o}?updateMask.fieldPaths=photo&updateMask.fieldPaths=updatedAt`,n=await fetch(i,{method:"PATCH",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify({fields:{photo:{stringValue:e},updatedAt:{timestampValue:new Date().toISOString()}}})});if(!n.ok){const s=await n.text().catch(()=>"");throw new Error(`Firestore REST update failed (${n.status}): ${s}`)}},mt=async({file:a,uid:o,currentUser:e=K.currentUser,syncFirestore:t=!0})=>{const r=me(a);if(r)throw new Error(r);const i=e??K.currentUser;if(!i)throw new Error("You need to be signed in to change your profile picture.");const n=o||i.uid;if(!n)throw new Error("Unable to determine which profile should be updated.");if(i.uid!==n)throw new Error("The signed-in user does not match the profile being edited.");const s=await j(ht(a,fe),2e4,"Image processing"),c=pt(n,a.name),l=Ae(ge,c),u=await j(Te(l,s,{contentType:s.type||"image/webp",cacheControl:"public, max-age=31536000, immutable"}),3e4,"Storage upload"),h=await j(Ne(u.ref),1e4,"Download URL retrieval");try{await j(Me(i,{photoURL:h}),1e4,"Auth profile update")}catch(d){console.warn("[PROFILE UPLOAD] Auth profile update failed (non-fatal):",d)}if(t){try{await j(ft(i,n,h),1e4,"Firestore profile sync")}catch(d){console.error("[PROFILE UPLOAD] Firestore REST sync failed:",d),console.warn("[PROFILE UPLOAD] Photo was uploaded but the database record may be stale. It will refresh on next login.")}try{const{doc:d,updateDoc:m}=await $(async()=>{const{doc:v,updateDoc:f}=await import("./vendor-firebase-firestore-CNv3xXal.js");return{doc:v,updateDoc:f}},__vite__mapDeps([0,1])),{db:w}=await $(async()=>{const{db:v}=await import("./index-CGNBpSmO.js").then(f=>f.b5);return{db:v}},__vite__mapDeps([2,3,0,1,4,5,6,7,8,9,10,11]));await m(d(w,"leaderboard",n),{photo:h}).catch(()=>$(async()=>{const{setDoc:v}=await import("./vendor-firebase-firestore-CNv3xXal.js");return{setDoc:v}},__vite__mapDeps([0,1])).then(({setDoc:v})=>v(d(w,"leaderboard",n),{photo:h},{merge:!0})))}catch{}}return h},vt=a=>`${(a/(1024*1024)).toFixed(1)} MB`,gt=a=>{const o=(a||"").trim();return o?o.split(/\s+/).slice(0,2).map(e=>e[0]?.toUpperCase()).join(""):"U"},wt=a=>new Promise((o,e)=>{const t=new Image;t.onload=()=>o(t),t.onerror=()=>e(new Error("Unable to load the image for cropping.")),t.src=a}),pe=(a,o,e)=>new Promise((t,r)=>{a.toBlob(i=>{if(!i){r(new Error("Failed to prepare the cropped image."));return}t(i)},o,e)}),xt=async(a,o,e)=>{const t=await wt(a),r=document.createElement("canvas"),i=640;r.width=i,r.height=i;const n=r.getContext("2d");if(!n)throw new Error("Your browser cannot process the selected image right now.");n.clearRect(0,0,i,i),n.drawImage(t,o.x,o.y,o.width,o.height,0,0,i,i);let s;try{s=await pe(r,"image/webp",.92)}catch{s=await pe(r,"image/jpeg",.92)}if(!s)throw new Error("Could not create an image from the cropped area.");const c=s.type==="image/webp"?"webp":"jpg",u=`${e.name.replace(/\.[^/.]+$/,"")||"profile-picture"}-cropped.${c}`;return new File([s],u,{type:s.type,lastModified:Date.now()})},Nt=({uid:a,photoURL:o,displayName:e,className:t="",onUploaded:r,syncFirestore:i=!0})=>{const{currentUser:n,refreshProfile:s}=xe(),[c,l]=x.useState(null),[u,h]=x.useState(null),[d,m]=x.useState({x:0,y:0}),[w,v]=x.useState(1),[f,R]=x.useState(null),[y,g]=x.useState(""),[E,_]=x.useState(!1),P=x.useRef(null);x.useEffect(()=>{if(!c){h(null);return}const C=URL.createObjectURL(c);return h(C),()=>URL.revokeObjectURL(C)},[c]);const W=u||o||"",k=x.useMemo(()=>`${de.map(S=>S.replace("image/","").toUpperCase()).join(", ")} up to ${vt(he)}. The image will be cropped to a circular avatar.`,[]),D=()=>{l(null),m({x:0,y:0}),v(1),R(null),g(""),P.current&&(P.current.value="")},z=C=>{const S=C.target.files?.[0]||null;if(!S)return;const M=me(S);if(M){g(M),l(null),C.target.value="";return}g(""),l(S),m({x:0,y:0}),v(1),R(null)},T=async()=>{if(!c){g("Choose an image before saving.");return}_(!0),g("");const C=6e4;let S;try{const M=(async()=>{const I=u&&f?await xt(u,f,c):c,Z=a||n?.uid;return mt({file:I,uid:Z,currentUser:n,syncFirestore:i})})(),F=new Promise((I,Z)=>{S=setTimeout(()=>Z(new Error("Upload timed out. Please check your connection and try again.")),C)}),ve=await Promise.race([M,F]);r?.(ve),s().catch(I=>console.warn("[ProfilePictureUploader] refreshProfile failed:",I)),Q.success("Profile picture updated."),D()}catch(M){const F=M instanceof Error?M.message:"Failed to update your profile picture.";g(F),Q.error(F)}finally{clearTimeout(S),_(!1)}},U=()=>{P.current?.click()};return p.jsxs(p.Fragment,{children:[p.jsxs("section",{className:`flex items-center gap-4 rounded-xl border border-slate-200 bg-white p-4 shadow-sm ${t}`,children:[p.jsxs("div",{className:"relative cursor-pointer group",onClick:U,role:"button",tabIndex:0,onKeyDown:C=>C.key==="Enter"&&U(),"aria-label":"Change profile picture",children:[p.jsxs(ye,{className:"size-16 sm:size-20 ring-4 ring-sky-50 shadow-sm transition-transform duration-200 group-hover:scale-105",children:[p.jsx(be,{src:W,alt:`${e||"User"} profile picture`}),p.jsx(Ce,{className:"bg-gradient-to-br from-sky-600 to-cyan-500 text-lg font-semibold text-white",children:gt(e)})]}),p.jsx("span",{className:"absolute -right-1 -top-1 inline-flex items-center justify-center rounded-full bg-slate-900 p-1.5 text-white shadow-md transition-colors group-hover:bg-slate-700",children:p.jsx(Oe,{size:14})})]}),p.jsxs("div",{className:"space-y-1 flex-1",children:[p.jsx("p",{className:"text-sm font-semibold text-slate-900",children:"Profile picture"}),p.jsx("p",{className:"text-xs text-slate-500",children:"Click your avatar to upload a new photo."}),y&&p.jsx("p",{className:"text-xs font-medium text-rose-600 mt-1",children:y})]}),p.jsx("input",{ref:P,type:"file",accept:"image/*",onChange:z,className:"sr-only","aria-label":"Choose profile picture"})]}),p.jsx(Pe,{children:u&&p.jsxs(p.Fragment,{children:[p.jsx(J.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[60]",onClick:D}),p.jsx(J.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},transition:{type:"spring",duration:.5,bounce:.3},className:"fixed inset-0 z-[60] flex items-center justify-center p-4 sm:p-6",onClick:C=>C.stopPropagation(),children:p.jsxs("div",{className:"bg-white rounded-2xl shadow-xl w-full max-w-lg overflow-hidden flex flex-col",children:[p.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-slate-100",children:[p.jsx("h3",{className:"text-lg font-bold text-slate-900",children:"Update profile picture"}),p.jsx("button",{onClick:D,className:"p-2 text-slate-400 hover:text-slate-600 hover:bg-slate-100 rounded-full transition-colors","aria-label":"Close modal",children:p.jsx(je,{size:20})})]}),p.jsxs("div",{className:"p-4 sm:p-6 bg-slate-50 flex flex-col items-center",children:[p.jsx("div",{className:"relative h-[350px] sm:h-[450px] w-[350px] sm:w-[450px] mx-auto overflow-hidden rounded-xl bg-slate-100 ring-1 ring-inset ring-slate-200 shadow-inner",children:p.jsx(ct,{image:u,crop:d,zoom:w,aspect:1,cropShape:"round",showGrid:!1,objectFit:"cover",restrictPosition:!0,onCropChange:m,onZoomChange:v,onCropComplete:(C,S)=>R(S),style:{containerStyle:{backgroundColor:"#f8fafc"}}})}),p.jsxs("div",{className:"mt-6 w-full max-w-xs flex items-center gap-4",children:[p.jsx(Ue,{size:18,className:"text-slate-500"}),p.jsx(lt,{value:[w],min:1,max:3,step:.05,onValueChange:C=>v(C[0]||1),"aria-label":"Profile picture zoom",className:"flex-1 cursor-pointer"}),p.jsx(Fe,{size:18,className:"text-slate-500"})]}),p.jsx("p",{className:"mt-4 text-xs text-slate-500 text-center",children:k})]}),p.jsxs("div",{className:"p-4 border-t border-slate-100 flex items-center justify-end gap-3 bg-white",children:[p.jsx(ee,{type:"button",variant:"ghost",onClick:D,disabled:E,className:"font-medium text-slate-600 hover:text-slate-900 hover:bg-slate-100 px-5",children:"Cancel"}),p.jsx(ee,{type:"button",onClick:T,disabled:E||!c,className:"bg-sky-600 hover:bg-sky-700 text-white min-w-[120px] gap-2 shadow-sm",children:E?p.jsxs(p.Fragment,{children:[p.jsx(Ie,{size:16,className:"animate-pulse"}),"Saving..."]}):"Save picture"})]})]})})]})})]})};export{At as M,Nt as P,Tt as V};
|
assets/{QuizBattlePage-BarEesP3.js β QuizBattlePage-mLpt23lk.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{e as ma,n as u,m as y,g as et,aK as De,N as st,aL as Q,X as $a,q as St,M as Oa,I as Te,U as ge,h as Ze,p as Ke,u as Ha,_ as Va,a0 as gt,a5 as wt,E as Kt,a4 as Jt}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{e as ma,n as u,m as y,g as et,aK as De,N as st,aL as Q,X as $a,q as St,M as Oa,I as Te,U as ge,h as Ze,p as Ke,u as Ha,_ as Va,a0 as gt,a5 as wt,E as Kt,a4 as Jt}from"./index-CGNBpSmO.js";import{r as i,j as e,d as Mt}from"./vendor-react-B4AQeu28.js";import{q as vt}from"./quiz_battle_avatar-BXHPSput.js";import{g as Ua,s as ea}from"./subjects-DP2R71lN.js";import{doc as Wa,getDoc as Ya,where as ta,orderBy as xa,limit as At,getDocs as zt,query as Ct,collection as It}from"./vendor-firebase-firestore-CNv3xXal.js";import{a4 as q,a5 as pa,a6 as ha,a7 as _e,a8 as Xa}from"./vendor-firebase-core-D7GXCeNu.js";import{B as A}from"./button-DVjn4LkC.js";import{e as Ga,f as Za}from"./vendor-radix-BPuEd8FG.js";import{S as Me,a as Fe,b as Ee,c as Re,d as de}from"./select-3FfJraPy.js";import{I as Ka}from"./input-CBi6xF4I.js";import{S as Ja}from"./switch-bpTyEA6p.js";import{S as xe}from"./skeleton-C6ieN9wR.js";import{V as ba,a as fa,M as es,b as ts}from"./volume-x-BprCnnkN.js";import{C as as}from"./CompositeAvatar-Col05lJc.js";import{S as Je}from"./sparkles-C0ju-UTT.js";import{C as jt}from"./check-BfYhdun3.js";import{H as ss,C as aa}from"./history-Dajczx-K.js";import{C as Ue}from"./chevron-right-C39hNstc.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-charts-D7t7JfSr.js";import"./vendor-markdown-yqZQ_iQm.js";import"./chart-column-g5DztEPT.js";import"./chevron-up-B59xV3SY.js";import"./avatarData-BuQSOXo3.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{RewardsModal-Cur-YLkw.js β RewardsModal-DnABWb4U.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as i,j as e}from"./vendor-react-B4AQeu28.js";import{getDoc as F,doc as S}from"./vendor-firebase-firestore-CNv3xXal.js";import{aO as g,A as u,aP as U,aQ as P,U as $,F as B,i as I,z as R,$ as q,T as j,aR as T,a4 as N,R as L,S as M,a0 as X,X as v,a5 as w,B as G,Z as H,q as Q,E as Z,G as O,
|
|
|
|
| 1 |
+
import{r as i,j as e}from"./vendor-react-B4AQeu28.js";import{getDoc as F,doc as S}from"./vendor-firebase-firestore-CNv3xXal.js";import{aO as g,A as u,aP as U,aQ as P,U as $,F as B,i as I,z as R,$ as q,T as j,aR as T,a4 as N,R as L,S as M,a0 as X,X as v,a5 as w,B as G,Z as H,q as Q,E as Z,G as O,b as V,aI as W,g as J}from"./index-CGNBpSmO.js";import{X as K}from"./x-Deb9zs8O.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-D7t7JfSr.js";import"./vendor-markdown-yqZQ_iQm.js";const Y={BookOpen:V,GraduationCap:O,Trophy:Z,Target:Q,Zap:H,Brain:G,Star:w,Flame:v,Swords:X,Shield:M,RefreshCw:L,Crown:N,Sun:T,TrendingUp:j,Globe:q,User:R,UserPlus:I,Calendar:B,Users:$,Compass:P,Heart:U,Award:u},me=({isOpen:o,onClose:c,userLevel:n,currentXP:x,xpToNextLevel:m,totalXP:p,userId:d})=>{const[y,b]=i.useState(!0),[k,_]=i.useState(new Set),[E,C]=i.useState({});i.useEffect(()=>{if(!o||!d)return;(async()=>{b(!0);try{const t=await W(d);_(new Set(t.map(a=>a.id)));const l=await F(S(J,"progress",d));l.exists()&&C(l.data())}catch(t){console.error("Error loading achievements:",t)}finally{b(!1)}})()},[o,d]);const D=s=>{const{condition:t,threshold:l}=s,a=E;let r=0,f=l??1;switch(t){case"lesson_complete":r=a.totalLessonsCompleted||0;break;case"quiz_complete":r=a.totalQuizzesCompleted||0;break;case"battle_win":case"battle_undefeated":r=a.battleWins||0;break;case"mastery_10":case"social_streak_30":case"social_daily_return":r=a.consecutiveDaysActive||0;break;case"mastery_xp":r=p;break;case"explore_friend_added":case"social_friend":case"explore_social":r=a.friendsAdded||0;break;case"perfect_score":{r=(a.quizAttempts||[]).filter(A=>A.score===100).length;break}default:return}return{progress:Math.min(r,f),total:f}},h=g.map(s=>{const t=Y[s.icon.name]??u,l=k.has(s.id),a=D(s);return{id:s.id,icon:t,title:s.title,description:s.description,progress:a?.progress,total:a?.total,unlocked:l,color:l?s.iconColor:"text-slate-500",bgColor:l?s.iconColor.replace("text-","bg-").replace("-500","/10").replace("-400","/10").replace("-600","/10"):"bg-slate-100"}}),z=h.filter(s=>s.unlocked).length;return o?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-2 sm:p-8",children:[e.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:c}),e.jsxs("div",{className:"relative bg-[#f7f9fc] rounded-2xl shadow-2xl border border-[#dde3eb] w-full max-w-2xl max-h-[90vh] sm:max-h-[85vh] flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"bg-gradient-to-r from-[#9956DE] via-[#7274ED] to-[#1FA7E1] p-4 md:p-6 text-white relative flex-shrink-0",children:[e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_14%_12%,rgba(251,150,187,0.35),transparent_42%),radial-gradient(circle_at_80%_80%,rgba(117,208,106,0.25),transparent_38%)]"}),e.jsxs("div",{className:"flex items-center justify-between mb-4 relative z-10",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl md:text-2xl font-display font-bold",children:"Rewards & Achievements"}),e.jsxs("p",{className:"text-white/90 text-sm font-body",children:[z," / ",g.length," Achievements Unlocked"]})]}),e.jsx("button",{onClick:c,className:"text-white/90 hover:text-white hover:bg-white/20 p-2 rounded-xl transition-colors",children:e.jsx(K,{size:24})})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-2 md:gap-3 relative z-10",children:[e.jsxs("div",{className:"bg-white/15 backdrop-blur-sm rounded-xl p-3 md:p-4 border border-white/25",children:[e.jsxs("div",{className:"flex items-center gap-1 md:gap-2 mb-1",children:[e.jsx(N,{size:16,className:"text-[#FFB356]"}),e.jsx("span",{className:"text-[10px] md:text-xs font-medium text-white/90 font-body",children:"Level"})]}),e.jsx("p",{className:"text-xl md:text-2xl font-bold",children:n})]}),e.jsxs("div",{className:"bg-white/15 backdrop-blur-sm rounded-xl p-3 md:p-4 border border-white/25",children:[e.jsxs("div",{className:"flex items-center gap-1 md:gap-2 mb-1",children:[e.jsx(w,{size:16,className:"text-[#6ED1CF]"}),e.jsx("span",{className:"text-[10px] md:text-xs font-medium text-white/90 font-body",children:"Total XP"})]}),e.jsx("p",{className:"text-xl md:text-2xl font-bold",children:p.toLocaleString()})]}),e.jsxs("div",{className:"bg-white/15 backdrop-blur-sm rounded-xl p-3 md:p-4 border border-white/25",children:[e.jsxs("div",{className:"flex items-center gap-1 md:gap-2 mb-1",children:[e.jsx(v,{size:16,className:"text-[#FF8B8B]"}),e.jsx("span",{className:"text-[10px] md:text-xs font-medium text-white/90 font-body",children:"Daily Rewards"})]}),e.jsx("p",{className:"text-xl md:text-2xl font-bold",children:"Check-in"})]})]}),e.jsxs("div",{className:"mt-4 relative z-10",children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsxs("span",{className:"text-sm font-bold text-white font-body",children:["Level ",n]}),e.jsxs("span",{className:"text-sm font-bold text-white font-body",children:["Level ",n+1]})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"flex justify-between items-center mb-1",children:e.jsxs("span",{className:"text-xs text-white/90",children:[x," / ",m," XP"]})}),e.jsx("div",{className:"h-3 bg-white/20 rounded-full overflow-hidden border border-white/20",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-[#6ED1CF] via-[#75D06A] to-[#FFB356] rounded-full transition-all duration-500 e-w",style:{"--w":`${x/m*100}%`}})})]})]})]}),e.jsx("div",{className:"p-4 md:p-6 overflow-y-auto flex-1",children:y?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-[#9956DE] border-t-transparent rounded-full"})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"text-lg font-display font-bold text-[#0a1628] mb-4",children:"Achievements"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:h.map(s=>{const t=s.icon;return e.jsx("div",{className:`${s.unlocked?"bg-white border-[#9956DE]/25":"bg-[#edf1f7] border-[#dde3eb]"} border-2 rounded-xl p-4 transition-all ${s.unlocked?"shadow-md":"opacity-60"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`w-12 h-12 ${s.bgColor} rounded-xl flex items-center justify-center flex-shrink-0`,children:e.jsx(t,{size:24,className:s.color})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h4",{className:`text-sm font-bold ${s.unlocked?"text-[#0a1628]":"text-slate-500"} font-body`,children:s.title}),s.unlocked&&e.jsx("span",{className:"px-2 py-0.5 bg-[#75D06A] text-white text-[9px] font-bold rounded-full",children:"Unlocked"})]}),e.jsx("p",{className:`text-xs ${s.unlocked?"text-[#5a6578]":"text-slate-500"} mb-2`,children:s.description}),s.progress!==void 0&&s.total!==void 0&&!s.unlocked&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-1",children:[e.jsx("span",{className:"text-[10px] text-slate-500",children:"Progress"}),e.jsxs("span",{className:"text-[10px] font-bold text-[#5a6578]",children:[s.progress," / ",s.total]})]}),e.jsx("div",{className:"h-1.5 bg-[#dde3eb] rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-[#7274ED] to-[#1FA7E1] rounded-full transition-all e-w",style:{"--w":`${s.progress/s.total*100}%`}})})]})]})]})},s.id)})})]}),e.jsxs("div",{className:"bg-white rounded-xl p-5 border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("div",{className:"w-8 h-8 bg-gradient-to-br from-[#7274ED] to-[#1FA7E1] rounded-lg flex items-center justify-center",children:e.jsx(j,{size:16,className:"text-white"})}),e.jsx("h3",{className:"text-base font-display font-bold text-[#0a1628]",children:"How to Earn XP"})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:[{activity:"Complete a video lesson",xp:50},{activity:"Complete exercises",xp:100},{activity:"Perfect quiz score",xp:150},{activity:"Finish a quiz",xp:75},{activity:"Daily check-in",xp:"20-100"}].map((s,t)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 bg-[#1FA7E1] rounded-full"}),e.jsxs("span",{className:"text-xs text-[#5a6578] font-body",children:[s.activity,":"]}),e.jsxs("span",{className:"text-xs font-bold text-[#7274ED]",children:["+",s.xp," XP"]})]},t))})]})]})})]})]}):null};export{me as default};
|
assets/{RightSidebar-C3z9K6VT.js β RightSidebar-3FHMx0H9.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as o,j as e}from"./vendor-react-B4AQeu28.js";import{q as S}from"./quiz_battle_avatar-BXHPSput.js";import{h as B,m as c,Z as _,a0 as q,a3 as P,E as W,a4 as v,a5 as X,p as Y,z as k}from"./index-dPnhhJ9w.js";import{C as M}from"./circle-check-big-DJBKLvuw.js";import{T as O,a as Z,b as H}from"./tooltip-Dz2m8mUv.js";import{C as T}from"./chevron-right-DL17FiOB.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-D7t7JfSr.js";import"./vendor-markdown-yqZQ_iQm.js";const E=[{id:1,title:"Quiz Battle",subtitle:"Challenge players worldwide!",bgColor:"bg-[#9956de]",orbColor:"bg-[#6D28D9]",icon:e.jsx(q,{size:24,className:"text-white"}),buttonText:"Join Battle",actionType:"quiz-battle",avatarText:"Waiting for you to join..."},{id:2,title:"Topic Explorer",subtitle:"Dive into a new math topic today",bgColor:"bg-[#FF8B8B]",orbColor:"bg-[#E06A6A]",icon:e.jsx(_,{size:24,className:"text-white"}),buttonText:"Explore",actionType:"explore",avatarText:"Knowledge is power!"},{id:3,title:"Speed Runner",subtitle:"Finish a quiz in under 5 mins",bgColor:"bg-[#75D06A]",orbColor:"bg-[#58B34D]",icon:e.jsx(M,{size:24,className:"text-white"}),buttonText:null,actionType:null,avatarText:"Ready for action!"}],J=({onNavigateToQuizBattle:s,userPhoto:a})=>{const[x,m]=o.useState(0);o.useEffect(()=>{const r=setInterval(()=>{m(l=>(l+1)%E.length)},5e3);return()=>clearInterval(r)},[]);const t=E[x];return e.jsx("div",{className:"bg-white rounded-[24px] p-4 shadow-sm border border-slate-100 flex flex-col gap-6 mt-4 relative overflow-hidden",children:e.jsx("div",{className:"relative h-[185px] rounded-[-20px] rounded-2xl overflow-hidden cursor-pointer group",children:e.jsx(B,{mode:"wait",children:e.jsxs(c.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.3},className:`absolute inset-0 ${t.bgColor} p-4 sm:p-5 flex flex-col justify-between overflow-hidden`,children:[e.jsxs("div",{className:"absolute top-4 right-4 flex gap-1 items-center z-20",children:[e.jsx("div",{className:"w-3 h-1.5 rounded-full bg-white/60"}),e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-white/40"}),e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-white/40"})]}),t.actionType==="quiz-battle"&&e.jsx("div",{className:"absolute -right-4 -bottom-6 w-32 h-32 opacity-25 mix-blend-overlay pointer-events-none z-0 transform group-hover:scale-105 transition-transform duration-700",children:e.jsx("img",{src:S,alt:"",className:"w-full h-full object-contain"})}),e.jsx("div",{className:`absolute -right-4 -top-8 w-36 h-36 rounded-full ${t.orbColor} opacity-90 blur-2xl group-hover:scale-110 transition-transform duration-700 pointer-events-none`}),e.jsx("div",{className:"absolute right-4 top-1/2 -translate-y-1/2 w-[48px] h-[48px] rounded-2xl rotate-12 bg-white/20 backdrop-blur-md shadow-sm border border-white/20 group-hover:rotate-[25deg] group-hover:scale-110 transition-transform duration-700 flex items-center justify-center z-10",children:t.icon}),e.jsxs("div",{className:"relative z-10 w-full pr-[60px]",children:[e.jsx("h3",{className:"font-display font-bold text-[20px] leading-tight text-white mb-0.5",children:t.title}),e.jsx("p",{className:"text-[12px] font-medium text-white/90 leading-snug",children:t.subtitle}),t.buttonText&&e.jsx("button",{onClick:r=>{r.stopPropagation(),t.actionType==="quiz-battle"&&s&&s()},className:"mt-2.5 bg-white text-[#0a1628] px-2 py-1 rounded-lg font-bold text-xs shadow-sm hover:scale-105 transition-transform uppercase tracking-wider whitespace-nowrap w-fit",children:t.buttonText})]}),e.jsxs("div",{className:"flex items-center gap-2.5 relative z-10 mt-auto pt-2",children:[a?e.jsxs("div",{className:"relative group/avatar shrink-0",children:[e.jsx("div",{className:"absolute inset-0 bg-white/40 blur-md rounded-full animate-pulse"}),e.jsx("img",{src:a,alt:"You",className:"w-8 h-8 rounded-full border-[2px] border-white object-cover relative z-10 shadow-md group-hover/avatar:scale-110 transition-transform"}),t.actionType==="quiz-battle"&&e.jsx("div",{className:"absolute -bottom-1 -right-1 w-[16px] h-[16px] bg-[#75D06A] border-2 border-[#7C3AED] rounded-full z-20 flex items-center justify-center",children:e.jsx(_,{size:8,className:"text-white",fill:"currentColor"})})]}):null,e.jsx("span",{className:"text-[12px] font-bold text-white tracking-wide leading-tight flex-1 pr-[60px]",children:t.avatarText})]})]},t.id)})})})},K=s=>{if(s>=1e3){const a=s/1e3;return a>=10?`${Math.round(a)}k`:`${a.toFixed(1)}k`}return`${s}`},G=({entry:s,rank:a,isYou:x,userPhoto:m,rankColor:t})=>{const r=x?s?.photo||m:s?.photo,l=x?"You":s?.name||"---",h=s?.xp||0;return e.jsxs(e.Fragment,{children:[e.jsxs(c.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.3+a*.1},className:"relative mb-2",children:[a===1&&e.jsx("div",{className:"absolute -top-4 left-1/2 -translate-x-1/2 z-20",children:e.jsx(v,{size:22,className:"text-amber-400 drop-shadow-md mb-1",fill:"#fbbf24",strokeWidth:1.5})}),e.jsx("div",{className:`w-10 h-10 rounded-full border-[3px] ${a===1?"w-[52px] h-[52px]":""} ${t.border} z-10 relative overflow-hidden ${t.shadow} bg-white`,children:r?e.jsx("img",{src:r,alt:l,className:"w-full h-full object-cover",onError:f=>{f.target.style.display="none"}}):e.jsx("div",{className:"w-full h-full bg-gradient-to-br from-slate-200 to-slate-300 flex items-center justify-center",children:e.jsx(k,{size:a===1?22:16,className:"text-slate-400"})})}),e.jsx("div",{className:`absolute -bottom-2 left-1/2 -translate-x-1/2 ${t.badge} text-white text-[10px] font-bold px-2 py-0.5 rounded-full z-20 shadow-sm`,children:a})]}),e.jsxs("div",{className:"mt-2 text-center",children:[e.jsx("span",{className:`block ${a===1?"text-[13px] font-black":"text-[12px] font-bold"} text-[#0a1628] truncate max-w-[80px]`,children:l}),e.jsxs("span",{className:`block ${a===1?"text-[11px]":"text-[10px]"} ${t.badge.replace("bg-","text-").replace("-500","-600").replace("-400","-600").replace("amber","amber")} font-bold`,children:[K(h)," XP"]})]})]})},ce=({currentUserId:s,onOpenRewards:a,onOpenLeaderboard:x,onNavigateToModules:m,onNavigateToQuizBattle:t,userLevel:r,userPhoto:l,currentXP:h,xpToNextLevel:f})=>{const N=h/f*100,[$,D]=o.useState([]),[F,u]=o.useState(!0),[y,g]=o.useState(null),p=o.useRef(null),n=o.useRef(null);o.useEffect(()=>{if(!s){u(!1);return}u(!0),g(null);const d=P(b=>{D(b),u(!1),g(null),n.current&&(clearTimeout(n.current),n.current=null)},s,!1,"all",3);return p.current=d,n.current=setTimeout(()=>{u(!1),g("Leaderboard data unavailable")},15e3),()=>{n.current&&(clearTimeout(n.current),n.current=null),p.current&&(p.current(),p.current=null)}},[s]);const i=$.slice(0,3);i.some(d=>d.userId===s);const z=[{bg:"from-amber-100 to-amber-50",border:"border-amber-400",badge:"bg-amber-500",shadow:"shadow-md"},{bg:"from-slate-200 to-slate-100",border:"border-sky-400",badge:"bg-sky-500",shadow:"shadow-sm"},{bg:"from-orange-50 to-slate-50",border:"border-orange-400",badge:"bg-orange-500",shadow:"shadow-sm"}],A=["74px","54px","38px"],L=["w-[78px]","w-[70px]","w-[70px]"],w=(d,b,C,R,j)=>e.jsxs("div",{className:"flex flex-col items-center relative z-10",children:[e.jsx(G,{entry:d,rank:C,isYou:R==="You",userPhoto:l,rankColor:z[j]}),e.jsxs(c.div,{initial:{height:0},animate:{height:A[b]},transition:{delay:.2+b*.1,duration:.5,ease:"easeOut"},className:`${L[b]} bg-gradient-to-b ${z[j].bg} rounded-t-xl rounded-b-md border-t-2 border-white/20 flex items-center justify-center relative shadow-[inset_0_-4px_6px_rgba(0,0,0,0.05),0_4px_6px_rgba(0,0,0,0.05)]`,children:[e.jsx("span",{className:`${j===0?"text-amber-400 text-3xl":"text-slate-400 text-2xl"} font-black opacity-40 translate-y-1`,children:C}),e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1.5 bg-white/70 rounded-t-xl"})]})]});return e.jsxs("div",{className:"space-y-2.5",children:[e.jsxs(c.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.1,duration:.4,ease:[.22,1,.36,1]},onClick:a,className:"rounded-2xl border border-[#9956DE]/25 cursor-pointer transition-all group relative overflow-hidden bg-gradient-to-br from-[#9956DE] via-[#7274ED] to-[#1FA7E1] hover:shadow-[0_16px_40px_rgba(114,116,237,0.28)] hover:-translate-y-0.5",children:[e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_18%_8%,rgba(251,150,187,0.32),transparent_42%),radial-gradient(circle_at_85%_84%,rgba(117,208,106,0.24),transparent_40%)]"}),e.jsxs("div",{className:"relative z-10 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"shrink-0 w-8 h-8 bg-white/20 rounded-xl flex items-center justify-center border border-white/35 backdrop-blur-sm",children:e.jsx(W,{size:14,className:"text-white"})}),e.jsxs("h3",{className:"font-display font-bold text-[13px] leading-tight text-white tracking-wide",children:["Rewards & ",e.jsx("br",{className:"hidden 2xl:block"})," Achievements"]})]}),e.jsx(T,{size:14,className:"shrink-0 text-white/80 group-hover:text-white group-hover:translate-x-0.5 transition-all"})]}),e.jsxs("div",{className:"flex items-center justify-between gap-1 mb-3 bg-white/10 p-1.5 rounded-xl border border-white/20 backdrop-blur-sm",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-body px-1 text-white",children:[e.jsx(v,{size:12,className:"text-[#FFB356]"}),e.jsxs("span",{className:"font-bold",children:["Lv ",r]})]}),e.jsx("div",{className:"w-px h-3 bg-white/35"}),e.jsxs(O,{children:[e.jsx(Z,{asChild:!0,children:e.jsxs("button",{onClick:d=>{d.stopPropagation(),m?.()},className:"flex items-center gap-1.5 text-xs font-body px-1 text-white cursor-pointer transition-colors active:scale-95",children:[e.jsx(X,{size:12,className:"text-[#6ED1CF]"}),e.jsxs("span",{className:"font-bold whitespace-nowrap",children:[h," XP"]})]})}),e.jsx(H,{side:"top",className:"bg-slate-900 text-white border border-slate-700",children:"Review more lessons to earn more XP!"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-1.5",children:[e.jsxs("span",{className:"text-[11px] font-body text-white/90",children:["Next: Level ",r+1]}),e.jsxs("span",{className:"text-[11px] font-body font-semibold text-white",children:[Math.round(N),"%"]})]}),e.jsx("div",{className:"h-2 bg-white/25 rounded-full overflow-hidden border border-white/20",children:e.jsx(c.div,{initial:{width:0},animate:{width:`${N}%`},transition:{duration:1,ease:"easeOut"},className:"h-full bg-gradient-to-r from-[#6ED1CF] via-[#75D06A] to-[#FFB356] rounded-full"})})]})]})]}),e.jsx(c.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.2,duration:.4,ease:[.22,1,.36,1]},children:e.jsx(J,{onNavigateToQuizBattle:t,userPhoto:l})}),e.jsxs(c.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.3,duration:.4,ease:[.22,1,.36,1]},onClick:x,className:"bg-white rounded-xl border border-slate-200/80 hover:shadow-md hover:border-amber-200/60 transition-all group overflow-hidden cursor-pointer",children:[e.jsxs("div",{className:"p-3 border-b border-slate-100 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-7 h-7 bg-amber-50 rounded-lg flex items-center justify-center border border-amber-200/60 transition-colors group-hover:bg-amber-100/50",children:e.jsx(v,{size:14,className:"text-amber-500"})}),e.jsx("h3",{className:"font-display font-bold text-sm text-[#0a1628]",children:"Leaderboards"})]}),e.jsx(T,{size:14,className:"text-slate-400 group-hover:translate-x-0.5 group-hover:text-amber-500 transition-transform"})]}),e.jsx("div",{className:"pt-8 pb-3 px-2 bg-gradient-to-b from-slate-50/30 to-white flex items-end justify-center gap-1.5 min-h-[170px]",children:F?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-8",children:[e.jsx(Y,{className:"w-5 h-5 animate-spin text-amber-400 mb-2"}),e.jsx("span",{className:"text-xs text-slate-400",children:"Loading rankings..."})]}):y||i.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-8",children:[e.jsx(k,{className:"w-8 h-8 text-slate-300 mb-2"}),e.jsx("span",{className:"text-xs text-slate-400 text-center",children:y||"No rankings available yet"})]}):e.jsxs(e.Fragment,{children:[w(i[1],1,2,i[1]?.name||"---",1),w(i[0],0,1,i[0]?.name||"---",0),w(i[2],2,3,i[2]?.name||"---",2)]})})]})]})};export{ce as default};
|
|
|
|
| 1 |
+
import{r as o,j as e}from"./vendor-react-B4AQeu28.js";import{q as S}from"./quiz_battle_avatar-BXHPSput.js";import{h as B,m as c,Z as _,a0 as q,a3 as P,E as W,a4 as v,a5 as X,p as Y,z as k}from"./index-CGNBpSmO.js";import{C as M}from"./circle-check-big-yCNC9yfs.js";import{T as O,a as Z,b as H}from"./tooltip-A8-ihp1Q.js";import{C as T}from"./chevron-right-C39hNstc.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-D7t7JfSr.js";import"./vendor-markdown-yqZQ_iQm.js";const E=[{id:1,title:"Quiz Battle",subtitle:"Challenge players worldwide!",bgColor:"bg-[#9956de]",orbColor:"bg-[#6D28D9]",icon:e.jsx(q,{size:24,className:"text-white"}),buttonText:"Join Battle",actionType:"quiz-battle",avatarText:"Waiting for you to join..."},{id:2,title:"Topic Explorer",subtitle:"Dive into a new math topic today",bgColor:"bg-[#FF8B8B]",orbColor:"bg-[#E06A6A]",icon:e.jsx(_,{size:24,className:"text-white"}),buttonText:"Explore",actionType:"explore",avatarText:"Knowledge is power!"},{id:3,title:"Speed Runner",subtitle:"Finish a quiz in under 5 mins",bgColor:"bg-[#75D06A]",orbColor:"bg-[#58B34D]",icon:e.jsx(M,{size:24,className:"text-white"}),buttonText:null,actionType:null,avatarText:"Ready for action!"}],J=({onNavigateToQuizBattle:s,userPhoto:a})=>{const[x,m]=o.useState(0);o.useEffect(()=>{const r=setInterval(()=>{m(l=>(l+1)%E.length)},5e3);return()=>clearInterval(r)},[]);const t=E[x];return e.jsx("div",{className:"bg-white rounded-[24px] p-4 shadow-sm border border-slate-100 flex flex-col gap-6 mt-4 relative overflow-hidden",children:e.jsx("div",{className:"relative h-[185px] rounded-[-20px] rounded-2xl overflow-hidden cursor-pointer group",children:e.jsx(B,{mode:"wait",children:e.jsxs(c.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.3},className:`absolute inset-0 ${t.bgColor} p-4 sm:p-5 flex flex-col justify-between overflow-hidden`,children:[e.jsxs("div",{className:"absolute top-4 right-4 flex gap-1 items-center z-20",children:[e.jsx("div",{className:"w-3 h-1.5 rounded-full bg-white/60"}),e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-white/40"}),e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-white/40"})]}),t.actionType==="quiz-battle"&&e.jsx("div",{className:"absolute -right-4 -bottom-6 w-32 h-32 opacity-25 mix-blend-overlay pointer-events-none z-0 transform group-hover:scale-105 transition-transform duration-700",children:e.jsx("img",{src:S,alt:"",className:"w-full h-full object-contain"})}),e.jsx("div",{className:`absolute -right-4 -top-8 w-36 h-36 rounded-full ${t.orbColor} opacity-90 blur-2xl group-hover:scale-110 transition-transform duration-700 pointer-events-none`}),e.jsx("div",{className:"absolute right-4 top-1/2 -translate-y-1/2 w-[48px] h-[48px] rounded-2xl rotate-12 bg-white/20 backdrop-blur-md shadow-sm border border-white/20 group-hover:rotate-[25deg] group-hover:scale-110 transition-transform duration-700 flex items-center justify-center z-10",children:t.icon}),e.jsxs("div",{className:"relative z-10 w-full pr-[60px]",children:[e.jsx("h3",{className:"font-display font-bold text-[20px] leading-tight text-white mb-0.5",children:t.title}),e.jsx("p",{className:"text-[12px] font-medium text-white/90 leading-snug",children:t.subtitle}),t.buttonText&&e.jsx("button",{onClick:r=>{r.stopPropagation(),t.actionType==="quiz-battle"&&s&&s()},className:"mt-2.5 bg-white text-[#0a1628] px-2 py-1 rounded-lg font-bold text-xs shadow-sm hover:scale-105 transition-transform uppercase tracking-wider whitespace-nowrap w-fit",children:t.buttonText})]}),e.jsxs("div",{className:"flex items-center gap-2.5 relative z-10 mt-auto pt-2",children:[a?e.jsxs("div",{className:"relative group/avatar shrink-0",children:[e.jsx("div",{className:"absolute inset-0 bg-white/40 blur-md rounded-full animate-pulse"}),e.jsx("img",{src:a,alt:"You",className:"w-8 h-8 rounded-full border-[2px] border-white object-cover relative z-10 shadow-md group-hover/avatar:scale-110 transition-transform"}),t.actionType==="quiz-battle"&&e.jsx("div",{className:"absolute -bottom-1 -right-1 w-[16px] h-[16px] bg-[#75D06A] border-2 border-[#7C3AED] rounded-full z-20 flex items-center justify-center",children:e.jsx(_,{size:8,className:"text-white",fill:"currentColor"})})]}):null,e.jsx("span",{className:"text-[12px] font-bold text-white tracking-wide leading-tight flex-1 pr-[60px]",children:t.avatarText})]})]},t.id)})})})},K=s=>{if(s>=1e3){const a=s/1e3;return a>=10?`${Math.round(a)}k`:`${a.toFixed(1)}k`}return`${s}`},G=({entry:s,rank:a,isYou:x,userPhoto:m,rankColor:t})=>{const r=x?s?.photo||m:s?.photo,l=x?"You":s?.name||"---",h=s?.xp||0;return e.jsxs(e.Fragment,{children:[e.jsxs(c.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.3+a*.1},className:"relative mb-2",children:[a===1&&e.jsx("div",{className:"absolute -top-4 left-1/2 -translate-x-1/2 z-20",children:e.jsx(v,{size:22,className:"text-amber-400 drop-shadow-md mb-1",fill:"#fbbf24",strokeWidth:1.5})}),e.jsx("div",{className:`w-10 h-10 rounded-full border-[3px] ${a===1?"w-[52px] h-[52px]":""} ${t.border} z-10 relative overflow-hidden ${t.shadow} bg-white`,children:r?e.jsx("img",{src:r,alt:l,className:"w-full h-full object-cover",onError:f=>{f.target.style.display="none"}}):e.jsx("div",{className:"w-full h-full bg-gradient-to-br from-slate-200 to-slate-300 flex items-center justify-center",children:e.jsx(k,{size:a===1?22:16,className:"text-slate-400"})})}),e.jsx("div",{className:`absolute -bottom-2 left-1/2 -translate-x-1/2 ${t.badge} text-white text-[10px] font-bold px-2 py-0.5 rounded-full z-20 shadow-sm`,children:a})]}),e.jsxs("div",{className:"mt-2 text-center",children:[e.jsx("span",{className:`block ${a===1?"text-[13px] font-black":"text-[12px] font-bold"} text-[#0a1628] truncate max-w-[80px]`,children:l}),e.jsxs("span",{className:`block ${a===1?"text-[11px]":"text-[10px]"} ${t.badge.replace("bg-","text-").replace("-500","-600").replace("-400","-600").replace("amber","amber")} font-bold`,children:[K(h)," XP"]})]})]})},ce=({currentUserId:s,onOpenRewards:a,onOpenLeaderboard:x,onNavigateToModules:m,onNavigateToQuizBattle:t,userLevel:r,userPhoto:l,currentXP:h,xpToNextLevel:f})=>{const N=h/f*100,[$,D]=o.useState([]),[F,u]=o.useState(!0),[y,g]=o.useState(null),p=o.useRef(null),n=o.useRef(null);o.useEffect(()=>{if(!s){u(!1);return}u(!0),g(null);const d=P(b=>{D(b),u(!1),g(null),n.current&&(clearTimeout(n.current),n.current=null)},s,!1,"all",3);return p.current=d,n.current=setTimeout(()=>{u(!1),g("Leaderboard data unavailable")},15e3),()=>{n.current&&(clearTimeout(n.current),n.current=null),p.current&&(p.current(),p.current=null)}},[s]);const i=$.slice(0,3);i.some(d=>d.userId===s);const z=[{bg:"from-amber-100 to-amber-50",border:"border-amber-400",badge:"bg-amber-500",shadow:"shadow-md"},{bg:"from-slate-200 to-slate-100",border:"border-sky-400",badge:"bg-sky-500",shadow:"shadow-sm"},{bg:"from-orange-50 to-slate-50",border:"border-orange-400",badge:"bg-orange-500",shadow:"shadow-sm"}],A=["74px","54px","38px"],L=["w-[78px]","w-[70px]","w-[70px]"],w=(d,b,C,R,j)=>e.jsxs("div",{className:"flex flex-col items-center relative z-10",children:[e.jsx(G,{entry:d,rank:C,isYou:R==="You",userPhoto:l,rankColor:z[j]}),e.jsxs(c.div,{initial:{height:0},animate:{height:A[b]},transition:{delay:.2+b*.1,duration:.5,ease:"easeOut"},className:`${L[b]} bg-gradient-to-b ${z[j].bg} rounded-t-xl rounded-b-md border-t-2 border-white/20 flex items-center justify-center relative shadow-[inset_0_-4px_6px_rgba(0,0,0,0.05),0_4px_6px_rgba(0,0,0,0.05)]`,children:[e.jsx("span",{className:`${j===0?"text-amber-400 text-3xl":"text-slate-400 text-2xl"} font-black opacity-40 translate-y-1`,children:C}),e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1.5 bg-white/70 rounded-t-xl"})]})]});return e.jsxs("div",{className:"space-y-2.5",children:[e.jsxs(c.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.1,duration:.4,ease:[.22,1,.36,1]},onClick:a,className:"rounded-2xl border border-[#9956DE]/25 cursor-pointer transition-all group relative overflow-hidden bg-gradient-to-br from-[#9956DE] via-[#7274ED] to-[#1FA7E1] hover:shadow-[0_16px_40px_rgba(114,116,237,0.28)] hover:-translate-y-0.5",children:[e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_18%_8%,rgba(251,150,187,0.32),transparent_42%),radial-gradient(circle_at_85%_84%,rgba(117,208,106,0.24),transparent_40%)]"}),e.jsxs("div",{className:"relative z-10 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"shrink-0 w-8 h-8 bg-white/20 rounded-xl flex items-center justify-center border border-white/35 backdrop-blur-sm",children:e.jsx(W,{size:14,className:"text-white"})}),e.jsxs("h3",{className:"font-display font-bold text-[13px] leading-tight text-white tracking-wide",children:["Rewards & ",e.jsx("br",{className:"hidden 2xl:block"})," Achievements"]})]}),e.jsx(T,{size:14,className:"shrink-0 text-white/80 group-hover:text-white group-hover:translate-x-0.5 transition-all"})]}),e.jsxs("div",{className:"flex items-center justify-between gap-1 mb-3 bg-white/10 p-1.5 rounded-xl border border-white/20 backdrop-blur-sm",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-body px-1 text-white",children:[e.jsx(v,{size:12,className:"text-[#FFB356]"}),e.jsxs("span",{className:"font-bold",children:["Lv ",r]})]}),e.jsx("div",{className:"w-px h-3 bg-white/35"}),e.jsxs(O,{children:[e.jsx(Z,{asChild:!0,children:e.jsxs("button",{onClick:d=>{d.stopPropagation(),m?.()},className:"flex items-center gap-1.5 text-xs font-body px-1 text-white cursor-pointer transition-colors active:scale-95",children:[e.jsx(X,{size:12,className:"text-[#6ED1CF]"}),e.jsxs("span",{className:"font-bold whitespace-nowrap",children:[h," XP"]})]})}),e.jsx(H,{side:"top",className:"bg-slate-900 text-white border border-slate-700",children:"Review more lessons to earn more XP!"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-1.5",children:[e.jsxs("span",{className:"text-[11px] font-body text-white/90",children:["Next: Level ",r+1]}),e.jsxs("span",{className:"text-[11px] font-body font-semibold text-white",children:[Math.round(N),"%"]})]}),e.jsx("div",{className:"h-2 bg-white/25 rounded-full overflow-hidden border border-white/20",children:e.jsx(c.div,{initial:{width:0},animate:{width:`${N}%`},transition:{duration:1,ease:"easeOut"},className:"h-full bg-gradient-to-r from-[#6ED1CF] via-[#75D06A] to-[#FFB356] rounded-full"})})]})]})]}),e.jsx(c.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.2,duration:.4,ease:[.22,1,.36,1]},children:e.jsx(J,{onNavigateToQuizBattle:t,userPhoto:l})}),e.jsxs(c.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.3,duration:.4,ease:[.22,1,.36,1]},onClick:x,className:"bg-white rounded-xl border border-slate-200/80 hover:shadow-md hover:border-amber-200/60 transition-all group overflow-hidden cursor-pointer",children:[e.jsxs("div",{className:"p-3 border-b border-slate-100 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-7 h-7 bg-amber-50 rounded-lg flex items-center justify-center border border-amber-200/60 transition-colors group-hover:bg-amber-100/50",children:e.jsx(v,{size:14,className:"text-amber-500"})}),e.jsx("h3",{className:"font-display font-bold text-sm text-[#0a1628]",children:"Leaderboards"})]}),e.jsx(T,{size:14,className:"text-slate-400 group-hover:translate-x-0.5 group-hover:text-amber-500 transition-transform"})]}),e.jsx("div",{className:"pt-8 pb-3 px-2 bg-gradient-to-b from-slate-50/30 to-white flex items-end justify-center gap-1.5 min-h-[170px]",children:F?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-8",children:[e.jsx(Y,{className:"w-5 h-5 animate-spin text-amber-400 mb-2"}),e.jsx("span",{className:"text-xs text-slate-400",children:"Loading rankings..."})]}):y||i.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-8",children:[e.jsx(k,{className:"w-8 h-8 text-slate-300 mb-2"}),e.jsx("span",{className:"text-xs text-slate-400 text-center",children:y||"No rankings available yet"})]}):e.jsxs(e.Fragment,{children:[w(i[1],1,2,i[1]?.name||"---",1),w(i[0],0,1,i[0]?.name||"---",0),w(i[2],2,3,i[2]?.name||"---",2)]})})]})]})};export{ce as default};
|
assets/{ScientificCalculator-Cc_fXNNW.js β ScientificCalculator-Bdrlg1Yp.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{r as c,j as e}from"./vendor-react-B4AQeu28.js";import{e as Z,l as de,h as U,m as ue}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{r as c,j as e}from"./vendor-react-B4AQeu28.js";import{e as Z,l as de,h as U,m as ue}from"./index-CGNBpSmO.js";import{a as fe,C as pe}from"./chevron-up-B59xV3SY.js";import{X as be}from"./x-Deb9zs8O.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-D7t7JfSr.js";import"./vendor-markdown-yqZQ_iQm.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{SettingsModal-fWJefMB6.js β SettingsModal-B-pY0VOy.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
| 2 |
-
import{e as D,u as Me,aT as Le,aU as De,aV as qe,aW as Ie,aX as Fe,aY as Ve,z as Oe,S as He,$ as Ge,
|
| 3 |
* @license lucide-react v0.487.0 - ISC
|
| 4 |
*
|
| 5 |
* This source code is licensed under the ISC license.
|
|
@@ -24,4 +24,4 @@ import{e as D,u as Me,aT as Le,aU as De,aV as qe,aW as Ie,aX as Fe,aY as Ve,z as
|
|
| 24 |
*
|
| 25 |
* This source code is licensed under the ISC license.
|
| 26 |
* See the LICENSE file in the root directory of this source tree.
|
| 27 |
-
*/const ks=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],ws=D("smartphone",ks),Cs=()=>{const{userProfile:m,userRole:y}=Me(),[r,z]=a.useState(Le),[_,R]=a.useState(De),[k,T]=a.useState(!1),[q,E]=a.useState(null);a.useEffect(()=>{if(!m?.uid)return;(async()=>{T(!0),E(null);try{if(y==="teacher"){const u=await Fe(m.uid);z(u)}if(y==="admin"){const u=await Ve();R(u)}}catch(u){E(u instanceof Error?u.message:"Failed to load settings")}finally{T(!1)}})()},[m?.uid,y]);const o=a.useCallback(async g=>{if(!m?.uid)return;const u=await qe(m.uid,g);z(u)},[m?.uid]),M=a.useCallback(async g=>{const u=await Ie(g);R(u)},[]);return{teacherPrefs:r,adminConfig:_,loading:k,error:q,saveTeacherPrefs:o,saveAdminConfig:M}},ae=()=>JSON.parse(JSON.stringify(We)),rt=({isOpen:m,onClose:y,profileData:r,onSave:z,settingsData:_,onSaveSettings:R,onApplySettingsPreview:k,onExportData:T,onClearCache:q,onResetData:E})=>{const o=r?.role||"student",{teacherPrefs:M,adminConfig:g,saveTeacherPrefs:u,saveAdminConfig:ke}=Cs(),[b,ne]=a.useState("account"),[l,h]=a.useState({}),[i,ie]=a.useState(ae()),[w,C]=a.useState(M),[j,$]=a.useState(g),[X,re]=a.useState(!1),[I,le]=a.useState(!1),[B,ce]=a.useState(!1),[Y,oe]=a.useState(!1),[de,Ss]=a.useState(!1),[we,F]=a.useState(!1),[Ce,V]=a.useState(!1),[Se,P]=a.useState(!1),[L,xe]=a.useState(""),[f,Ae]=a.useState(null),[v,me]=a.useState(!1),[Q,he]=a.useState(!1),[W,ue]=a.useState(""),[O,be]=a.useState(""),J=a.useRef(!1),K=a.useRef(ae());a.useEffect(()=>{if(!m){J.current=!1;return}if(J.current)return;J.current=!0;const s=_?JSON.parse(JSON.stringify(_)):ae();K.current=s,h({uid:r?.uid,name:r?.name||"",email:r?.email||"",phone:r?.phone||"",photo:r?.photo||"",avatarLayers:r?.avatarLayers,role:r?.role,gender:r?.gender,lrn:r?.lrn||"",grade:r?.grade||"",section:r?.section||"",school:r?.school||"",department:r?.department||"",subject:r?.subject||"",yearsOfExperience:r?.yearsOfExperience||"",qualification:r?.qualification||"",position:r?.position||""}),ie(s),C(M),$(g)},[m,r,_,M,g]),a.useEffect(()=>{m&&k?.(i)},[m,i,k]),a.useEffect(()=>{if(!m)return;const s=t=>{t.key==="Escape"&&(k?.(K.current),y())};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[m,y,k]);const Z=a.useMemo(()=>{const s=[{id:"account",label:"Account",icon:Oe},{id:"notifications",label:"Notifications",icon:ge},{id:"appearance",label:"Appearance",icon:gs}];return o==="student"&&(s.push({id:"privacy",label:"Privacy & Security",icon:He}),s.push({id:"learning",label:"Learning",icon:Ge})),o==="teacher"&&s.push({id:"teaching",label:"Teaching",icon:Ue}),o==="admin"&&s.push({id:"system",label:"System",icon:Ns}),s.push({id:"data",label:"Data & Storage",icon:ve}),s},[o]),c=s=>{ie(t=>s(t))},ee=s=>{Ae(s),xe(""),he(!1),s==="password"&&ue(""),s==="email"&&be(l.email||""),P(!0)},fe=async()=>{if(!L.trim()){d.error("Current password is required");return}me(!0);try{if(f==="password"){if(W.length<8){d.error("New password must be at least 8 characters");return}await Ke(L,W),d.success("Password updated")}else if(f==="email"){if(!O.includes("@")){d.error("Enter a valid email");return}await Ze(L,O),h(s=>({...s,email:O})),d.success("Email updated")}else if(f==="delete"){await es(L,l.uid||""),d.success("Account deleted"),y();return}P(!1)}catch(s){d.error(s instanceof Error?s.message:"Authentication failed")}finally{me(!1)}},Ee=async()=>{const s=Je({name:l.name,phone:l.phone});if(s){d.error(s);return}re(!0);try{z&&await z(l),R&&await R(i),o==="teacher"&&await u(w),o==="admin"&&await ke(j),y()}catch(t){d.error(t instanceof Error?t.message:"Failed to save settings")}finally{re(!1)}},se=()=>{P(!1),F(!1),V(!1),k?.(K.current),y()},Pe=async()=>{if(!(!T||B)){ce(!0);try{await T()}catch(s){d.error(s instanceof Error?s.message:"Failed to export data")}finally{ce(!1)}}},ze=async()=>{if(!(!q||Y)){oe(!0);try{await q()}catch(s){d.error(s instanceof Error?s.message:"Failed to clear cache")}finally{oe(!1)}}},_e=async()=>{if(!(!E||I)){F(!1),le(!0);try{await E(),d.success("Testing data reset completed")}catch(s){d.error(s instanceof Error?s.message:"Failed to reset testing data")}finally{le(!1)}}},Re=()=>{V(!1),ee("delete")};return m?e.jsx($e,{children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-end sm:items-center justify-center sm:p-4",children:[e.jsx(G.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:se,className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),e.jsxs(G.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},transition:{duration:.2},className:"relative bg-[#f7f9fc] rounded-t-2xl sm:rounded-2xl shadow-2xl border border-[#dde3eb] w-full sm:max-w-4xl h-[92vh] sm:max-h-[85vh] overflow-hidden flex flex-col sm:flex-row",children:[e.jsxs("div",{className:"hidden sm:flex w-64 flex-shrink-0 bg-slate-50 border-r border-slate-200 flex-col p-6 overflow-y-auto",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-xl font-display font-bold text-[#0a1628]",children:"Settings"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1 font-body",children:"Manage your preferences"})]}),e.jsx("nav",{className:"space-y-1",children:Z.map(s=>{const t=s.icon;return e.jsxs("button",{onClick:()=>ne(s.id),className:`w-full flex items-center gap-3 px-4 py-3 rounded-xl text-left transition-all ${b===s.id?"bg-sky-50 text-sky-700 shadow-sm":"text-slate-500 hover:bg-slate-100 hover:text-sky-700"}`,children:[e.jsx(t,{size:18}),e.jsx("span",{className:"text-sm font-medium",children:s.label})]},s.id)})})]}),e.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[e.jsx("div",{className:"sm:hidden flex items-center border-b border-[#dde3eb] bg-slate-50 overflow-x-auto no-scrollbar px-2",children:Z.map(s=>{const t=s.icon;return e.jsxs("button",{onClick:()=>ne(s.id),className:`flex flex-col items-center gap-0.5 px-3 py-2.5 shrink-0 text-xs font-medium border-b-2 transition-colors ${b===s.id?"border-sky-600 text-sky-700":"border-transparent text-slate-500"}`,children:[e.jsx(t,{size:16}),e.jsx("span",{className:"whitespace-nowrap",children:s.label})]},s.id)})}),e.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-6 py-3 sm:py-4 border-b border-[#dde3eb]",children:[e.jsx("h3",{className:"text-base sm:text-lg font-display font-bold text-[#0a1628]",children:Z.find(s=>s.id===b)?.label}),e.jsx("button",{onClick:se,className:"p-2 hover:bg-[#edf1f7] rounded-xl transition-colors",children:e.jsx(Ne,{size:20,className:"text-[#5a6578]"})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6",children:[b==="account"&&e.jsxs("div",{className:"space-y-6",children:[e.jsx(is,{uid:l.uid,photoURL:l.photo,displayName:l.name,onUploaded:s=>h(t=>({...t,photo:s}))}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Full Name"}),e.jsx(n,{type:"text",value:l.name||"",onChange:s=>h(t=>({...t,name:s.target.value})),maxLength:100,autoComplete:"name",className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Email Address"}),e.jsxs("div",{className:"flex items-center gap-2 max-w-md",children:[e.jsx(n,{type:"email",value:l.email||"",disabled:!0,className:"flex-1 bg-slate-100"}),e.jsx(p,{variant:"outline",size:"sm",onClick:()=>ee("email"),children:"Change"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Phone Number"}),e.jsx(n,{type:"tel",value:l.phone||"",onChange:s=>h(t=>({...t,phone:s.target.value})),maxLength:20,inputMode:"tel",autoComplete:"tel",pattern:"^\\+?[0-9 ()\\-.]{7,20}$",placeholder:"+63 912 345 6789",className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Gender"}),e.jsxs(ss,{value:l.gender||"",onValueChange:s=>h(t=>({...t,gender:s})),children:[e.jsx(ts,{className:"max-w-md bg-white border-[#dde3eb] rounded-lg",children:e.jsx(as,{placeholder:"Select gender (optional)"})}),e.jsxs(ns,{children:[e.jsx(te,{value:"male",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(rs,{className:"size-4 text-blue-500"}),e.jsx("span",{children:"Male"})]})}),e.jsx(te,{value:"female",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ls,{className:"size-4 text-pink-500"}),e.jsx("span",{children:"Female"})]})}),e.jsx(te,{value:"prefer_not_to_say",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(cs,{className:"size-4 text-gray-500"}),e.jsx("span",{children:"Prefer not to say"})]})})]})]})]}),o==="student"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"LRN"}),e.jsx(n,{value:l.lrn||"",onChange:s=>h(t=>({...t,lrn:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Grade Level"}),e.jsx(n,{value:l.grade||"",onChange:s=>h(t=>({...t,grade:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Section"}),e.jsx(n,{value:l.section||"",onChange:s=>h(t=>({...t,section:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"School"}),e.jsx(n,{value:l.school||"",onChange:s=>h(t=>({...t,school:s.target.value})),className:"max-w-md"})]})]}),o==="teacher"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Department"}),e.jsx(n,{value:l.department||"",onChange:s=>h(t=>({...t,department:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Subject"}),e.jsx(n,{value:l.subject||"",onChange:s=>h(t=>({...t,subject:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Years of Experience"}),e.jsx(n,{value:l.yearsOfExperience||"",onChange:s=>h(t=>({...t,yearsOfExperience:s.target.value})),className:"max-w-md"})]})]}),o==="admin"&&e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Position"}),e.jsx(n,{value:l.position||"",onChange:s=>h(t=>({...t,position:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Change Password"}),e.jsxs(p,{variant:"outline",className:"rounded-xl",onClick:()=>ee("password"),children:[e.jsx(Xe,{size:16,className:"mr-2"}),"Update Password"]})]})]}),b==="notifications"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Push Notifications"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Get notified on your device"})]}),e.jsx(x,{checked:i.notifications.pushNotifications,onCheckedChange:s=>c(t=>({...t,notifications:{...t.notifications,pushNotifications:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Sound Effects"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Play sounds for notifications"})]}),e.jsx(x,{checked:i.notifications.soundEnabled,onCheckedChange:s=>c(t=>({...t,notifications:{...t.notifications,soundEnabled:s}}))})]}),o==="teacher"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Student Submissions"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Notify when students submit work"})]}),e.jsx(x,{checked:w.notifyOnSubmission,onCheckedChange:s=>C(t=>({...t,notifyOnSubmission:s}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Student Activity Alerts"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Notify on at-risk student activity"})]}),e.jsx(x,{checked:w.notifyOnStudentActivity,onCheckedChange:s=>C(t=>({...t,notifyOnStudentActivity:s}))})]})]}),e.jsxs("div",{className:"pt-4",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] mb-3 font-body",children:"Notification Types"}),e.jsx("div",{className:"space-y-3",children:[{key:"quizReminders",label:"Quiz Reminders"},{key:"newContent",label:"New Content"},{key:"achievements",label:"Achievements"},{key:"streakAlerts",label:"Streak Alerts"},{key:"weeklySummary",label:"Weekly Summary"}].map(s=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("input",{type:"checkbox",checked:i.notifications.notificationTypes[s.key],onChange:t=>c(N=>({...N,notifications:{...N.notifications,notificationTypes:{...N.notifications.notificationTypes,[s.key]:t.target.checked}}})),className:"w-4 h-4 rounded border-[#dde3eb] text-sky-600 focus:ring-sky-500"}),e.jsx("span",{className:"text-sm text-[#0a1628] font-body",children:s.label})]},s.key))})]}),e.jsxs("div",{className:"pt-4 border-t border-[#dde3eb]",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] mb-1 font-body",children:"Push Notification Categories"}),e.jsx("p",{className:"text-xs text-slate-500 mb-3",children:"Choose which kinds of pushes you want to receive on this device."}),e.jsxs("div",{className:"flex items-center justify-between py-2 mb-2 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h5",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Enable Push (master)"}),e.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:"Turn off to silence ALL push categories."})]}),e.jsx(x,{checked:i.pushPreferences.pushEnabled,onCheckedChange:s=>c(t=>({...t,pushPreferences:{...t.pushPreferences,pushEnabled:s}}))})]}),e.jsx("div",{className:"space-y-2",children:[{key:"achievement",label:"Achievements unlocked",icon:Be},{key:"quiz_battle",label:"Quiz battle invites & results",icon:Ye},{key:"daily_reward",label:"Daily reward reminders",icon:ys},{key:"assignment",label:"New assignments / deadlines",icon:fs},{key:"streak_reminder",label:"Streak reminders",icon:Qe},{key:"leaderboard",label:"Leaderboard updates",icon:os},{key:"system",label:"System announcements",icon:ds}].map(s=>{const t=s.key,N=s.icon;return e.jsxs("label",{className:"flex items-center justify-between py-1.5",children:[e.jsxs("span",{className:"text-sm text-[#0a1628] font-body flex items-center gap-2",children:[e.jsx(N,{className:"h-4 w-4 text-[#6c47ff]"}),s.label]}),e.jsx(x,{checked:!!i.pushPreferences[t],onCheckedChange:pe=>c(H=>({...H,pushPreferences:{...H.pushPreferences,[s.key]:pe}})),disabled:!i.pushPreferences.pushEnabled&&t!=="pushEnabled"})]},s.key)})}),e.jsx("div",{className:"mt-4",children:e.jsxs(p,{type:"button",variant:"outline",size:"sm",onClick:async()=>{try{const{requestPushPermissionAndRegister:s}=await U(async()=>{const{requestPushPermissionAndRegister:S}=await import("./index-dPnhhJ9w.js").then(A=>A.b7);return{requestPushPermissionAndRegister:S}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),{auth:t}=await U(async()=>{const{auth:S}=await import("./index-dPnhhJ9w.js").then(A=>A.b5);return{auth:S}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),N=t.currentUser?.uid;if(!N){d.error("You must be signed in to test push notifications.");return}if(!await s(N)){d.error("Push setup failed. Check that VITE_FIREBASE_VAPID_KEY is configured and notifications are allowed.");return}const{httpsCallable:H}=await U(async()=>{const{httpsCallable:S}=await import("./vendor-firebase-core-D7GXCeNu.js").then(A=>A.a9);return{httpsCallable:S}},[]),{cloudFunctions:Te}=await U(async()=>{const{cloudFunctions:S}=await import("./index-dPnhhJ9w.js").then(A=>A.b5);return{cloudFunctions:S}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),ye=(await H(Te,"sendTestPush")({}))?.data?.sent??0;ye>0?d.success(`Sent test push to ${ye} device(s).`):d.message("No active devices found. Enable browser notifications first.")}catch(s){d.error(s instanceof Error?s.message:"Failed to send test push")}},children:[e.jsx(ge,{size:14,className:"mr-2"}),"Send test push"]})})]}),e.jsxs("div",{className:"pt-4 border-t border-[#dde3eb]",children:[e.jsxs("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:[e.jsx(xs,{size:16,className:"inline mr-2"}),"Quiet Hours"]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(n,{type:"time",value:i.notifications.quietHours.start,onChange:s=>c(t=>({...t,notifications:{...t.notifications,quietHours:{...t.notifications.quietHours,start:s.target.value}}})),className:"w-32"}),e.jsx("span",{className:"text-[#5a6578]",children:"to"}),e.jsx(n,{type:"time",value:i.notifications.quietHours.end,onChange:s=>c(t=>({...t,notifications:{...t.notifications,quietHours:{...t.notifications.quietHours,end:s.target.value}}})),className:"w-32"})]})]})]}),b==="appearance"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Dark Mode"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Toggle dark theme"})]}),e.jsx(x,{checked:i.appearance.darkMode,onCheckedChange:s=>c(t=>({...t,appearance:{...t.appearance,darkMode:s}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-3 block font-body uppercase tracking-wider text-xs",children:"Font Size"}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-xs text-slate-500",children:"Small"}),e.jsx("input",{type:"range",min:"12",max:"20",value:i.appearance.fontSize,onChange:s=>c(t=>({...t,appearance:{...t.appearance,fontSize:Number(s.target.value)}})),className:"flex-1"}),e.jsx("span",{className:"text-xs text-slate-500",children:"Large"}),e.jsxs("span",{className:"text-xs font-mono text-slate-600 w-8",children:[i.appearance.fontSize,"px"]})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Compact View"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Show more content on screen"})]}),e.jsx(x,{checked:i.appearance.compactView,onCheckedChange:s=>c(t=>({...t,appearance:{...t.appearance,compactView:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Reduce Animations"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Minimize motion effects"})]}),e.jsx(x,{checked:i.appearance.reduceAnimations,onCheckedChange:s=>c(t=>({...t,appearance:{...t.appearance,reduceAnimations:s}}))})]})]}),b==="privacy"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Profile Visibility"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Who can see your profile"})]}),e.jsxs("select",{value:i.privacy.profileVisibility,onChange:s=>c(t=>({...t,privacy:{...t.privacy,profileVisibility:s.target.value}})),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm bg-white text-[#0a1628]",children:[e.jsx("option",{value:"everyone",children:"Everyone"}),e.jsx("option",{value:"students_and_staff",children:"Students and Staff"}),e.jsx("option",{value:"private",children:"Private"})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Show Activity Status"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Let others see when you're online"})]}),e.jsx(x,{checked:i.privacy.showActivityStatus,onCheckedChange:s=>c(t=>({...t,privacy:{...t.privacy,showActivityStatus:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Data Sharing"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Share anonymous usage data"})]}),e.jsx(x,{checked:i.privacy.dataSharing,onCheckedChange:s=>c(t=>({...t,privacy:{...t.privacy,dataSharing:s}}))})]})]}),b==="learning"&&o==="student"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Daily XP Goal"}),e.jsx(n,{type:"number",value:i.learning.dailyXpGoal,onChange:s=>c(t=>({...t,learning:{...t.learning,dailyXpGoal:Number(s.target.value||0)}})),className:"max-w-xs"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Preferred Study Time"}),e.jsxs("select",{value:i.learning.preferredStudyTime,onChange:s=>c(t=>({...t,learning:{...t.learning,preferredStudyTime:s.target.value}})),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm w-full max-w-xs bg-white text-[#0a1628]",children:[e.jsx("option",{value:"morning",children:"Morning (6AM - 12PM)"}),e.jsx("option",{value:"afternoon",children:"Afternoon (12PM - 6PM)"}),e.jsx("option",{value:"evening",children:"Evening (6PM - 12PM)"}),e.jsx("option",{value:"night",children:"Night (12AM - 6AM)"})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Auto-play Next Lesson"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Automatically start the next lesson"})]}),e.jsx(x,{checked:i.learning.autoPlayLessons,onCheckedChange:s=>c(t=>({...t,learning:{...t.learning,autoPlayLessons:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Show Hints During Quizzes"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Display helpful hints for questions"})]}),e.jsx(x,{checked:i.learning.showHints,onCheckedChange:s=>c(t=>({...t,learning:{...t.learning,showHints:s}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Quiz Difficulty Preference"}),e.jsxs("select",{value:i.learning.quizDifficultyPreference,onChange:s=>c(t=>({...t,learning:{...t.learning,quizDifficultyPreference:s.target.value}})),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm w-full max-w-xs bg-white text-[#0a1628]",children:[e.jsx("option",{value:"adaptive",children:"Adaptive (Recommended)"}),e.jsx("option",{value:"easy",children:"Easy"}),e.jsx("option",{value:"medium",children:"Medium"}),e.jsx("option",{value:"hard",children:"Hard"})]})]}),e.jsxs("div",{className:"pt-4 border-t border-[#dde3eb]",children:[e.jsxs("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:[e.jsx(ws,{size:16,className:"inline mr-2"}),"Study Reminders"]}),e.jsx(n,{type:"time",value:i.learning.studyReminderTime,onChange:s=>c(t=>({...t,learning:{...t.learning,studyReminderTime:s.target.value}})),className:"w-32"})]})]}),b==="teaching"&&o==="teacher"&&e.jsxs("div",{className:"space-y-6",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Quiz Defaults"}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Time Limit (min)"}),e.jsx(n,{type:"number",value:w.quizDefaults.timeLimitMinutes,onChange:s=>C(t=>({...t,quizDefaults:{...t.quizDefaults,timeLimitMinutes:Number(s.target.value)}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Passing Score (%)"}),e.jsx(n,{type:"number",value:w.quizDefaults.passingScore,onChange:s=>C(t=>({...t,quizDefaults:{...t.quizDefaults,passingScore:Number(s.target.value)}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Max Attempts"}),e.jsx(n,{type:"number",value:w.quizDefaults.maxAttempts,onChange:s=>C(t=>({...t,quizDefaults:{...t.quizDefaults,maxAttempts:Number(s.target.value)}}))})]})]}),e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body pt-4",children:"Class Preferences"}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-t border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Student Analytics Visibility"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Let students see their leaderboard rank"})]}),e.jsx(x,{checked:w.studentAnalyticsVisibility,onCheckedChange:s=>C(t=>({...t,studentAnalyticsVisibility:s}))})]})]}),b==="system"&&o==="admin"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Maintenance Mode"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Disable platform access for non-admins"})]}),e.jsx(x,{checked:j.maintenanceMode,onCheckedChange:s=>$(t=>({...t,maintenanceMode:s}))})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Default Grade Level"}),e.jsx(n,{value:j.defaultGradeLevel,disabled:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Default Curriculum"}),e.jsx(n,{value:j.defaultCurriculum,disabled:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Max Class Size"}),e.jsx(n,{type:"number",value:j.maxClassSize,disabled:!0})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Audit Log Visible"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Show audit logs in admin dashboard"})]}),e.jsx(x,{checked:j.auditLogVisible,onCheckedChange:s=>$(t=>({...t,auditLogVisible:s}))})]}),e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body pt-4",children:"AI Configuration"}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Model Name"}),e.jsx(n,{value:j.aiConfig.modelName,disabled:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Temperature"}),e.jsx(n,{type:"number",value:j.aiConfig.temperature,disabled:!0})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"API Endpoint"}),e.jsx(n,{value:j.aiConfig.endpoint,disabled:!0})]})]})]}),b==="data"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"p-4 bg-sky-50 border border-sky-200 rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-sky-900 mb-1 font-body",children:"Download Your Data"}),e.jsx("p",{className:"text-xs text-sky-700 mb-3",children:"Export all your learning data and progress"}),e.jsxs(p,{variant:"outline",size:"sm",className:"rounded-xl",onClick:Pe,disabled:B,children:[e.jsx(ve,{size:16,className:"mr-2"}),B?"Exporting...":"Request Data Export"]})]}),e.jsxs("div",{className:"p-4 bg-white border border-[#dde3eb] rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] mb-1 font-body",children:"Clear Cache"}),e.jsx("p",{className:"text-xs text-[#5a6578] mb-3",children:"Free up space by clearing cached data"}),e.jsx(p,{variant:"outline",size:"sm",className:"rounded-xl",onClick:ze,disabled:Y,children:Y?"Clearing...":"Clear Cache"})]}),e.jsxs("div",{className:"p-4 bg-rose-50 border border-rose-200 rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-rose-900 mb-1",children:"Reset Progress"}),e.jsxs("p",{className:"text-xs text-rose-700 mb-3",children:[o==="student"&&"Reset quizzes, diagnostic state, XP, and learning progress for retesting.",o==="teacher"&&"Reset imported records, managed classrooms, and teacher-generated quiz artifacts.",o==="admin"&&"Reset admin testing artifacts like personal audit/content update records."]}),e.jsx(p,{variant:"outline",size:"sm",className:"rounded-xl text-rose-700 border-rose-300",disabled:!E||I,onClick:()=>F(!0),children:I?"Resetting...":"Reset Testing Data"})]}),e.jsxs("div",{className:"p-4 bg-red-50 border border-red-200 rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-red-900 mb-1",children:"Delete Account"}),e.jsx("p",{className:"text-xs text-red-700 mb-3",children:"Permanently delete your account and all data"}),e.jsxs(p,{variant:"outline",size:"sm",className:"rounded-xl text-red-700 border-red-300",onClick:()=>V(!0),disabled:de,children:[e.jsx(ms,{size:16,className:"mr-2"}),de?"Deleting...":"Delete Account"]})]})]})]}),e.jsxs("div",{className:"shrink-0 px-4 sm:px-6 py-3 sm:py-4 border-t border-[#dde3eb] bg-[#edf1f7] flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-2 sm:gap-0",children:[e.jsx("p",{className:"text-xs text-slate-500 font-body text-center sm:text-left",children:"MathPulse AI v2.1.0"}),e.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[e.jsx(p,{variant:"outline",onClick:se,className:"rounded-lg border-[#dde3eb] flex-1 sm:flex-none",disabled:X,children:"Cancel"}),e.jsx(p,{onClick:Ee,className:"rounded-lg bg-sky-600 hover:bg-sky-700 text-white flex-1 sm:flex-none",disabled:X,children:X?"Saving...":"Save Changes"})]})]})]})]})]}),Se&&e.jsx(G.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[130] bg-black/50 backdrop-blur-sm flex items-center justify-center p-4",onClick:()=>{v||P(!1)},children:e.jsxs(G.div,{initial:{opacity:0,scale:.95,y:12},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:12},transition:{duration:.2},className:"w-full max-w-md rounded-2xl border border-[#dde3eb] bg-[#f7f9fc] shadow-2xl",onClick:s=>s.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[#dde3eb] px-6 py-4",children:[e.jsxs("h4",{className:"text-lg font-display font-bold text-[#0a1628]",children:[f==="password"&&"Change Password",f==="email"&&"Change Email",f==="delete"&&"Delete Account"]}),e.jsx("button",{onClick:()=>{v||P(!1)},className:"p-2 rounded-xl hover:bg-[#edf1f7] transition-colors","aria-label":"Close",children:e.jsx(Ne,{size:18,className:"text-[#5a6578]"})})]}),e.jsxs("div",{className:"px-6 py-5 space-y-4",children:[e.jsx("p",{className:"text-sm text-[#5a6578]",children:"Enter your current password to continue."}),e.jsxs("div",{className:"relative",children:[e.jsx(n,{type:Q?"text":"password",value:L,onChange:s=>xe(s.target.value),placeholder:"Current password",autoFocus:!0,className:"pr-10",disabled:v,onKeyDown:s=>{s.key==="Enter"&&fe()}}),e.jsx("button",{type:"button",onClick:()=>he(!Q),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600",tabIndex:-1,children:Q?e.jsx(hs,{size:16}):e.jsx(us,{size:16})})]}),f==="password"&&e.jsx("div",{className:"relative",children:e.jsx(n,{type:"password",value:W,onChange:s=>ue(s.target.value),placeholder:"New password (min 8 chars)",disabled:v})}),f==="email"&&e.jsx(n,{type:"email",value:O,onChange:s=>be(s.target.value),placeholder:"New email address",disabled:v}),f==="delete"&&e.jsx("p",{className:"text-sm text-red-600 font-medium",children:"This action is permanent and cannot be undone."}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(p,{variant:"outline",onClick:()=>P(!1),disabled:v,children:"Cancel"}),e.jsx(p,{onClick:()=>void fe(),className:f==="delete"?"bg-red-600 hover:bg-red-700 text-white":"bg-sky-600 hover:bg-sky-700 text-white",disabled:v,children:v?"Processing...":f==="delete"?"Delete Forever":"Confirm"})]})]})]})}),e.jsx(je,{isOpen:we,onClose:()=>F(!1),onConfirm:_e,title:"Reset Testing Data?",message:`Reset ${o} testing data? This will clear quizzes, diagnostic assessments, assessment history, XP, and learning progress. This action cannot be undone.`,confirmText:I?"Resetting...":"Reset Data",cancelText:"Cancel",type:"warning",icon:"warning",zIndexClass:"z-[130]"}),e.jsx(je,{isOpen:Ce,onClose:()=>V(!1),onConfirm:Re,title:"Delete Account?",message:"You will need to re-authenticate to permanently delete your account. This cannot be undone.",confirmText:"Continue",cancelText:"Cancel",type:"danger",icon:"delete",zIndexClass:"z-[130]"})]})}):null};export{rt as default};
|
|
|
|
| 1 |
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CGNBpSmO.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-BPuEd8FG.js","assets/vendor-charts-D7t7JfSr.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-CEL3Ax6X.css"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{e as D,u as Me,aT as Le,aU as De,aV as qe,aW as Ie,aX as Fe,aY as Ve,z as Oe,S as He,$ as Ge,b as Ue,h as $e,m as G,L as Xe,E as Be,a0 as Ye,X as Qe,_ as U,j as d,aZ as We,aS as Je,a_ as Ke,a$ as Ze,b0 as es}from"./index-CGNBpSmO.js";import{r as a,j as e}from"./vendor-react-B4AQeu28.js";import{S as ss,a as ts,b as as,c as ns,d as te}from"./select-3FfJraPy.js";import{B as p}from"./button-DVjn4LkC.js";import{I as n}from"./input-CBi6xF4I.js";import{S as x}from"./switch-bpTyEA6p.js";import je from"./ConfirmModal-Bjb3K2ht.js";import{P as is,M as rs,V as ls}from"./ProfilePictureUploader-CCiptDXE.js";import{B as ge}from"./bell-DbwiSyKd.js";import{D as ve}from"./download-Dg4u7Zq0.js";import{X as Ne}from"./x-Deb9zs8O.js";import{C as cs}from"./circle-help-DMiD6EQw.js";import{C as os}from"./chart-column-g5DztEPT.js";import{M as ds}from"./megaphone-DFHZ2_eA.js";import{C as xs}from"./clock-D2bky9WI.js";import{T as ms}from"./trash-2-BhQyV3WQ.js";import{E as hs,a as us}from"./eye-_x45syMF.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-D7t7JfSr.js";import"./vendor-markdown-yqZQ_iQm.js";import"./chevron-up-B59xV3SY.js";import"./check-BfYhdun3.js";import"./log-out-G6mObnLf.js";import"./minus-DV5fnWn8.js";import"./plus-ck_SGnHK.js";import"./upload-Daz-vKaw.js";/**
|
| 3 |
* @license lucide-react v0.487.0 - ISC
|
| 4 |
*
|
| 5 |
* This source code is licensed under the ISC license.
|
|
|
|
| 24 |
*
|
| 25 |
* This source code is licensed under the ISC license.
|
| 26 |
* See the LICENSE file in the root directory of this source tree.
|
| 27 |
+
*/const ks=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],ws=D("smartphone",ks),Cs=()=>{const{userProfile:m,userRole:y}=Me(),[r,z]=a.useState(Le),[_,R]=a.useState(De),[k,T]=a.useState(!1),[q,E]=a.useState(null);a.useEffect(()=>{if(!m?.uid)return;(async()=>{T(!0),E(null);try{if(y==="teacher"){const u=await Fe(m.uid);z(u)}if(y==="admin"){const u=await Ve();R(u)}}catch(u){E(u instanceof Error?u.message:"Failed to load settings")}finally{T(!1)}})()},[m?.uid,y]);const o=a.useCallback(async g=>{if(!m?.uid)return;const u=await qe(m.uid,g);z(u)},[m?.uid]),M=a.useCallback(async g=>{const u=await Ie(g);R(u)},[]);return{teacherPrefs:r,adminConfig:_,loading:k,error:q,saveTeacherPrefs:o,saveAdminConfig:M}},ae=()=>JSON.parse(JSON.stringify(We)),rt=({isOpen:m,onClose:y,profileData:r,onSave:z,settingsData:_,onSaveSettings:R,onApplySettingsPreview:k,onExportData:T,onClearCache:q,onResetData:E})=>{const o=r?.role||"student",{teacherPrefs:M,adminConfig:g,saveTeacherPrefs:u,saveAdminConfig:ke}=Cs(),[b,ne]=a.useState("account"),[l,h]=a.useState({}),[i,ie]=a.useState(ae()),[w,C]=a.useState(M),[j,$]=a.useState(g),[X,re]=a.useState(!1),[I,le]=a.useState(!1),[B,ce]=a.useState(!1),[Y,oe]=a.useState(!1),[de,Ss]=a.useState(!1),[we,F]=a.useState(!1),[Ce,V]=a.useState(!1),[Se,P]=a.useState(!1),[L,xe]=a.useState(""),[f,Ae]=a.useState(null),[v,me]=a.useState(!1),[Q,he]=a.useState(!1),[W,ue]=a.useState(""),[O,be]=a.useState(""),J=a.useRef(!1),K=a.useRef(ae());a.useEffect(()=>{if(!m){J.current=!1;return}if(J.current)return;J.current=!0;const s=_?JSON.parse(JSON.stringify(_)):ae();K.current=s,h({uid:r?.uid,name:r?.name||"",email:r?.email||"",phone:r?.phone||"",photo:r?.photo||"",avatarLayers:r?.avatarLayers,role:r?.role,gender:r?.gender,lrn:r?.lrn||"",grade:r?.grade||"",section:r?.section||"",school:r?.school||"",department:r?.department||"",subject:r?.subject||"",yearsOfExperience:r?.yearsOfExperience||"",qualification:r?.qualification||"",position:r?.position||""}),ie(s),C(M),$(g)},[m,r,_,M,g]),a.useEffect(()=>{m&&k?.(i)},[m,i,k]),a.useEffect(()=>{if(!m)return;const s=t=>{t.key==="Escape"&&(k?.(K.current),y())};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[m,y,k]);const Z=a.useMemo(()=>{const s=[{id:"account",label:"Account",icon:Oe},{id:"notifications",label:"Notifications",icon:ge},{id:"appearance",label:"Appearance",icon:gs}];return o==="student"&&(s.push({id:"privacy",label:"Privacy & Security",icon:He}),s.push({id:"learning",label:"Learning",icon:Ge})),o==="teacher"&&s.push({id:"teaching",label:"Teaching",icon:Ue}),o==="admin"&&s.push({id:"system",label:"System",icon:Ns}),s.push({id:"data",label:"Data & Storage",icon:ve}),s},[o]),c=s=>{ie(t=>s(t))},ee=s=>{Ae(s),xe(""),he(!1),s==="password"&&ue(""),s==="email"&&be(l.email||""),P(!0)},fe=async()=>{if(!L.trim()){d.error("Current password is required");return}me(!0);try{if(f==="password"){if(W.length<8){d.error("New password must be at least 8 characters");return}await Ke(L,W),d.success("Password updated")}else if(f==="email"){if(!O.includes("@")){d.error("Enter a valid email");return}await Ze(L,O),h(s=>({...s,email:O})),d.success("Email updated")}else if(f==="delete"){await es(L,l.uid||""),d.success("Account deleted"),y();return}P(!1)}catch(s){d.error(s instanceof Error?s.message:"Authentication failed")}finally{me(!1)}},Ee=async()=>{const s=Je({name:l.name,phone:l.phone});if(s){d.error(s);return}re(!0);try{z&&await z(l),R&&await R(i),o==="teacher"&&await u(w),o==="admin"&&await ke(j),y()}catch(t){d.error(t instanceof Error?t.message:"Failed to save settings")}finally{re(!1)}},se=()=>{P(!1),F(!1),V(!1),k?.(K.current),y()},Pe=async()=>{if(!(!T||B)){ce(!0);try{await T()}catch(s){d.error(s instanceof Error?s.message:"Failed to export data")}finally{ce(!1)}}},ze=async()=>{if(!(!q||Y)){oe(!0);try{await q()}catch(s){d.error(s instanceof Error?s.message:"Failed to clear cache")}finally{oe(!1)}}},_e=async()=>{if(!(!E||I)){F(!1),le(!0);try{await E(),d.success("Testing data reset completed")}catch(s){d.error(s instanceof Error?s.message:"Failed to reset testing data")}finally{le(!1)}}},Re=()=>{V(!1),ee("delete")};return m?e.jsx($e,{children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-end sm:items-center justify-center sm:p-4",children:[e.jsx(G.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:se,className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),e.jsxs(G.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},transition:{duration:.2},className:"relative bg-[#f7f9fc] rounded-t-2xl sm:rounded-2xl shadow-2xl border border-[#dde3eb] w-full sm:max-w-4xl h-[92vh] sm:max-h-[85vh] overflow-hidden flex flex-col sm:flex-row",children:[e.jsxs("div",{className:"hidden sm:flex w-64 flex-shrink-0 bg-slate-50 border-r border-slate-200 flex-col p-6 overflow-y-auto",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-xl font-display font-bold text-[#0a1628]",children:"Settings"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1 font-body",children:"Manage your preferences"})]}),e.jsx("nav",{className:"space-y-1",children:Z.map(s=>{const t=s.icon;return e.jsxs("button",{onClick:()=>ne(s.id),className:`w-full flex items-center gap-3 px-4 py-3 rounded-xl text-left transition-all ${b===s.id?"bg-sky-50 text-sky-700 shadow-sm":"text-slate-500 hover:bg-slate-100 hover:text-sky-700"}`,children:[e.jsx(t,{size:18}),e.jsx("span",{className:"text-sm font-medium",children:s.label})]},s.id)})})]}),e.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[e.jsx("div",{className:"sm:hidden flex items-center border-b border-[#dde3eb] bg-slate-50 overflow-x-auto no-scrollbar px-2",children:Z.map(s=>{const t=s.icon;return e.jsxs("button",{onClick:()=>ne(s.id),className:`flex flex-col items-center gap-0.5 px-3 py-2.5 shrink-0 text-xs font-medium border-b-2 transition-colors ${b===s.id?"border-sky-600 text-sky-700":"border-transparent text-slate-500"}`,children:[e.jsx(t,{size:16}),e.jsx("span",{className:"whitespace-nowrap",children:s.label})]},s.id)})}),e.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-6 py-3 sm:py-4 border-b border-[#dde3eb]",children:[e.jsx("h3",{className:"text-base sm:text-lg font-display font-bold text-[#0a1628]",children:Z.find(s=>s.id===b)?.label}),e.jsx("button",{onClick:se,className:"p-2 hover:bg-[#edf1f7] rounded-xl transition-colors",children:e.jsx(Ne,{size:20,className:"text-[#5a6578]"})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6",children:[b==="account"&&e.jsxs("div",{className:"space-y-6",children:[e.jsx(is,{uid:l.uid,photoURL:l.photo,displayName:l.name,onUploaded:s=>h(t=>({...t,photo:s}))}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Full Name"}),e.jsx(n,{type:"text",value:l.name||"",onChange:s=>h(t=>({...t,name:s.target.value})),maxLength:100,autoComplete:"name",className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Email Address"}),e.jsxs("div",{className:"flex items-center gap-2 max-w-md",children:[e.jsx(n,{type:"email",value:l.email||"",disabled:!0,className:"flex-1 bg-slate-100"}),e.jsx(p,{variant:"outline",size:"sm",onClick:()=>ee("email"),children:"Change"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Phone Number"}),e.jsx(n,{type:"tel",value:l.phone||"",onChange:s=>h(t=>({...t,phone:s.target.value})),maxLength:20,inputMode:"tel",autoComplete:"tel",pattern:"^\\+?[0-9 ()\\-.]{7,20}$",placeholder:"+63 912 345 6789",className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Gender"}),e.jsxs(ss,{value:l.gender||"",onValueChange:s=>h(t=>({...t,gender:s})),children:[e.jsx(ts,{className:"max-w-md bg-white border-[#dde3eb] rounded-lg",children:e.jsx(as,{placeholder:"Select gender (optional)"})}),e.jsxs(ns,{children:[e.jsx(te,{value:"male",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(rs,{className:"size-4 text-blue-500"}),e.jsx("span",{children:"Male"})]})}),e.jsx(te,{value:"female",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ls,{className:"size-4 text-pink-500"}),e.jsx("span",{children:"Female"})]})}),e.jsx(te,{value:"prefer_not_to_say",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(cs,{className:"size-4 text-gray-500"}),e.jsx("span",{children:"Prefer not to say"})]})})]})]})]}),o==="student"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"LRN"}),e.jsx(n,{value:l.lrn||"",onChange:s=>h(t=>({...t,lrn:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Grade Level"}),e.jsx(n,{value:l.grade||"",onChange:s=>h(t=>({...t,grade:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Section"}),e.jsx(n,{value:l.section||"",onChange:s=>h(t=>({...t,section:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"School"}),e.jsx(n,{value:l.school||"",onChange:s=>h(t=>({...t,school:s.target.value})),className:"max-w-md"})]})]}),o==="teacher"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Department"}),e.jsx(n,{value:l.department||"",onChange:s=>h(t=>({...t,department:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Subject"}),e.jsx(n,{value:l.subject||"",onChange:s=>h(t=>({...t,subject:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Years of Experience"}),e.jsx(n,{value:l.yearsOfExperience||"",onChange:s=>h(t=>({...t,yearsOfExperience:s.target.value})),className:"max-w-md"})]})]}),o==="admin"&&e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Position"}),e.jsx(n,{value:l.position||"",onChange:s=>h(t=>({...t,position:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Change Password"}),e.jsxs(p,{variant:"outline",className:"rounded-xl",onClick:()=>ee("password"),children:[e.jsx(Xe,{size:16,className:"mr-2"}),"Update Password"]})]})]}),b==="notifications"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Push Notifications"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Get notified on your device"})]}),e.jsx(x,{checked:i.notifications.pushNotifications,onCheckedChange:s=>c(t=>({...t,notifications:{...t.notifications,pushNotifications:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Sound Effects"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Play sounds for notifications"})]}),e.jsx(x,{checked:i.notifications.soundEnabled,onCheckedChange:s=>c(t=>({...t,notifications:{...t.notifications,soundEnabled:s}}))})]}),o==="teacher"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Student Submissions"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Notify when students submit work"})]}),e.jsx(x,{checked:w.notifyOnSubmission,onCheckedChange:s=>C(t=>({...t,notifyOnSubmission:s}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Student Activity Alerts"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Notify on at-risk student activity"})]}),e.jsx(x,{checked:w.notifyOnStudentActivity,onCheckedChange:s=>C(t=>({...t,notifyOnStudentActivity:s}))})]})]}),e.jsxs("div",{className:"pt-4",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] mb-3 font-body",children:"Notification Types"}),e.jsx("div",{className:"space-y-3",children:[{key:"quizReminders",label:"Quiz Reminders"},{key:"newContent",label:"New Content"},{key:"achievements",label:"Achievements"},{key:"streakAlerts",label:"Streak Alerts"},{key:"weeklySummary",label:"Weekly Summary"}].map(s=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("input",{type:"checkbox",checked:i.notifications.notificationTypes[s.key],onChange:t=>c(N=>({...N,notifications:{...N.notifications,notificationTypes:{...N.notifications.notificationTypes,[s.key]:t.target.checked}}})),className:"w-4 h-4 rounded border-[#dde3eb] text-sky-600 focus:ring-sky-500"}),e.jsx("span",{className:"text-sm text-[#0a1628] font-body",children:s.label})]},s.key))})]}),e.jsxs("div",{className:"pt-4 border-t border-[#dde3eb]",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] mb-1 font-body",children:"Push Notification Categories"}),e.jsx("p",{className:"text-xs text-slate-500 mb-3",children:"Choose which kinds of pushes you want to receive on this device."}),e.jsxs("div",{className:"flex items-center justify-between py-2 mb-2 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h5",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Enable Push (master)"}),e.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:"Turn off to silence ALL push categories."})]}),e.jsx(x,{checked:i.pushPreferences.pushEnabled,onCheckedChange:s=>c(t=>({...t,pushPreferences:{...t.pushPreferences,pushEnabled:s}}))})]}),e.jsx("div",{className:"space-y-2",children:[{key:"achievement",label:"Achievements unlocked",icon:Be},{key:"quiz_battle",label:"Quiz battle invites & results",icon:Ye},{key:"daily_reward",label:"Daily reward reminders",icon:ys},{key:"assignment",label:"New assignments / deadlines",icon:fs},{key:"streak_reminder",label:"Streak reminders",icon:Qe},{key:"leaderboard",label:"Leaderboard updates",icon:os},{key:"system",label:"System announcements",icon:ds}].map(s=>{const t=s.key,N=s.icon;return e.jsxs("label",{className:"flex items-center justify-between py-1.5",children:[e.jsxs("span",{className:"text-sm text-[#0a1628] font-body flex items-center gap-2",children:[e.jsx(N,{className:"h-4 w-4 text-[#6c47ff]"}),s.label]}),e.jsx(x,{checked:!!i.pushPreferences[t],onCheckedChange:pe=>c(H=>({...H,pushPreferences:{...H.pushPreferences,[s.key]:pe}})),disabled:!i.pushPreferences.pushEnabled&&t!=="pushEnabled"})]},s.key)})}),e.jsx("div",{className:"mt-4",children:e.jsxs(p,{type:"button",variant:"outline",size:"sm",onClick:async()=>{try{const{requestPushPermissionAndRegister:s}=await U(async()=>{const{requestPushPermissionAndRegister:S}=await import("./index-CGNBpSmO.js").then(A=>A.b7);return{requestPushPermissionAndRegister:S}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),{auth:t}=await U(async()=>{const{auth:S}=await import("./index-CGNBpSmO.js").then(A=>A.b5);return{auth:S}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),N=t.currentUser?.uid;if(!N){d.error("You must be signed in to test push notifications.");return}if(!await s(N)){d.error("Push setup failed. Check that VITE_FIREBASE_VAPID_KEY is configured and notifications are allowed.");return}const{httpsCallable:H}=await U(async()=>{const{httpsCallable:S}=await import("./vendor-firebase-core-D7GXCeNu.js").then(A=>A.a9);return{httpsCallable:S}},[]),{cloudFunctions:Te}=await U(async()=>{const{cloudFunctions:S}=await import("./index-CGNBpSmO.js").then(A=>A.b5);return{cloudFunctions:S}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),ye=(await H(Te,"sendTestPush")({}))?.data?.sent??0;ye>0?d.success(`Sent test push to ${ye} device(s).`):d.message("No active devices found. Enable browser notifications first.")}catch(s){d.error(s instanceof Error?s.message:"Failed to send test push")}},children:[e.jsx(ge,{size:14,className:"mr-2"}),"Send test push"]})})]}),e.jsxs("div",{className:"pt-4 border-t border-[#dde3eb]",children:[e.jsxs("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:[e.jsx(xs,{size:16,className:"inline mr-2"}),"Quiet Hours"]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(n,{type:"time",value:i.notifications.quietHours.start,onChange:s=>c(t=>({...t,notifications:{...t.notifications,quietHours:{...t.notifications.quietHours,start:s.target.value}}})),className:"w-32"}),e.jsx("span",{className:"text-[#5a6578]",children:"to"}),e.jsx(n,{type:"time",value:i.notifications.quietHours.end,onChange:s=>c(t=>({...t,notifications:{...t.notifications,quietHours:{...t.notifications.quietHours,end:s.target.value}}})),className:"w-32"})]})]})]}),b==="appearance"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Dark Mode"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Toggle dark theme"})]}),e.jsx(x,{checked:i.appearance.darkMode,onCheckedChange:s=>c(t=>({...t,appearance:{...t.appearance,darkMode:s}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-3 block font-body uppercase tracking-wider text-xs",children:"Font Size"}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-xs text-slate-500",children:"Small"}),e.jsx("input",{type:"range",min:"12",max:"20",value:i.appearance.fontSize,onChange:s=>c(t=>({...t,appearance:{...t.appearance,fontSize:Number(s.target.value)}})),className:"flex-1"}),e.jsx("span",{className:"text-xs text-slate-500",children:"Large"}),e.jsxs("span",{className:"text-xs font-mono text-slate-600 w-8",children:[i.appearance.fontSize,"px"]})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Compact View"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Show more content on screen"})]}),e.jsx(x,{checked:i.appearance.compactView,onCheckedChange:s=>c(t=>({...t,appearance:{...t.appearance,compactView:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Reduce Animations"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Minimize motion effects"})]}),e.jsx(x,{checked:i.appearance.reduceAnimations,onCheckedChange:s=>c(t=>({...t,appearance:{...t.appearance,reduceAnimations:s}}))})]})]}),b==="privacy"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Profile Visibility"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Who can see your profile"})]}),e.jsxs("select",{value:i.privacy.profileVisibility,onChange:s=>c(t=>({...t,privacy:{...t.privacy,profileVisibility:s.target.value}})),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm bg-white text-[#0a1628]",children:[e.jsx("option",{value:"everyone",children:"Everyone"}),e.jsx("option",{value:"students_and_staff",children:"Students and Staff"}),e.jsx("option",{value:"private",children:"Private"})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Show Activity Status"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Let others see when you're online"})]}),e.jsx(x,{checked:i.privacy.showActivityStatus,onCheckedChange:s=>c(t=>({...t,privacy:{...t.privacy,showActivityStatus:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Data Sharing"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Share anonymous usage data"})]}),e.jsx(x,{checked:i.privacy.dataSharing,onCheckedChange:s=>c(t=>({...t,privacy:{...t.privacy,dataSharing:s}}))})]})]}),b==="learning"&&o==="student"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Daily XP Goal"}),e.jsx(n,{type:"number",value:i.learning.dailyXpGoal,onChange:s=>c(t=>({...t,learning:{...t.learning,dailyXpGoal:Number(s.target.value||0)}})),className:"max-w-xs"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Preferred Study Time"}),e.jsxs("select",{value:i.learning.preferredStudyTime,onChange:s=>c(t=>({...t,learning:{...t.learning,preferredStudyTime:s.target.value}})),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm w-full max-w-xs bg-white text-[#0a1628]",children:[e.jsx("option",{value:"morning",children:"Morning (6AM - 12PM)"}),e.jsx("option",{value:"afternoon",children:"Afternoon (12PM - 6PM)"}),e.jsx("option",{value:"evening",children:"Evening (6PM - 12PM)"}),e.jsx("option",{value:"night",children:"Night (12AM - 6AM)"})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Auto-play Next Lesson"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Automatically start the next lesson"})]}),e.jsx(x,{checked:i.learning.autoPlayLessons,onCheckedChange:s=>c(t=>({...t,learning:{...t.learning,autoPlayLessons:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Show Hints During Quizzes"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Display helpful hints for questions"})]}),e.jsx(x,{checked:i.learning.showHints,onCheckedChange:s=>c(t=>({...t,learning:{...t.learning,showHints:s}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Quiz Difficulty Preference"}),e.jsxs("select",{value:i.learning.quizDifficultyPreference,onChange:s=>c(t=>({...t,learning:{...t.learning,quizDifficultyPreference:s.target.value}})),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm w-full max-w-xs bg-white text-[#0a1628]",children:[e.jsx("option",{value:"adaptive",children:"Adaptive (Recommended)"}),e.jsx("option",{value:"easy",children:"Easy"}),e.jsx("option",{value:"medium",children:"Medium"}),e.jsx("option",{value:"hard",children:"Hard"})]})]}),e.jsxs("div",{className:"pt-4 border-t border-[#dde3eb]",children:[e.jsxs("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:[e.jsx(ws,{size:16,className:"inline mr-2"}),"Study Reminders"]}),e.jsx(n,{type:"time",value:i.learning.studyReminderTime,onChange:s=>c(t=>({...t,learning:{...t.learning,studyReminderTime:s.target.value}})),className:"w-32"})]})]}),b==="teaching"&&o==="teacher"&&e.jsxs("div",{className:"space-y-6",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Quiz Defaults"}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Time Limit (min)"}),e.jsx(n,{type:"number",value:w.quizDefaults.timeLimitMinutes,onChange:s=>C(t=>({...t,quizDefaults:{...t.quizDefaults,timeLimitMinutes:Number(s.target.value)}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Passing Score (%)"}),e.jsx(n,{type:"number",value:w.quizDefaults.passingScore,onChange:s=>C(t=>({...t,quizDefaults:{...t.quizDefaults,passingScore:Number(s.target.value)}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Max Attempts"}),e.jsx(n,{type:"number",value:w.quizDefaults.maxAttempts,onChange:s=>C(t=>({...t,quizDefaults:{...t.quizDefaults,maxAttempts:Number(s.target.value)}}))})]})]}),e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body pt-4",children:"Class Preferences"}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-t border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Student Analytics Visibility"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Let students see their leaderboard rank"})]}),e.jsx(x,{checked:w.studentAnalyticsVisibility,onCheckedChange:s=>C(t=>({...t,studentAnalyticsVisibility:s}))})]})]}),b==="system"&&o==="admin"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Maintenance Mode"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Disable platform access for non-admins"})]}),e.jsx(x,{checked:j.maintenanceMode,onCheckedChange:s=>$(t=>({...t,maintenanceMode:s}))})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Default Grade Level"}),e.jsx(n,{value:j.defaultGradeLevel,disabled:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Default Curriculum"}),e.jsx(n,{value:j.defaultCurriculum,disabled:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Max Class Size"}),e.jsx(n,{type:"number",value:j.maxClassSize,disabled:!0})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Audit Log Visible"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Show audit logs in admin dashboard"})]}),e.jsx(x,{checked:j.auditLogVisible,onCheckedChange:s=>$(t=>({...t,auditLogVisible:s}))})]}),e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body pt-4",children:"AI Configuration"}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Model Name"}),e.jsx(n,{value:j.aiConfig.modelName,disabled:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Temperature"}),e.jsx(n,{type:"number",value:j.aiConfig.temperature,disabled:!0})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"API Endpoint"}),e.jsx(n,{value:j.aiConfig.endpoint,disabled:!0})]})]})]}),b==="data"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"p-4 bg-sky-50 border border-sky-200 rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-sky-900 mb-1 font-body",children:"Download Your Data"}),e.jsx("p",{className:"text-xs text-sky-700 mb-3",children:"Export all your learning data and progress"}),e.jsxs(p,{variant:"outline",size:"sm",className:"rounded-xl",onClick:Pe,disabled:B,children:[e.jsx(ve,{size:16,className:"mr-2"}),B?"Exporting...":"Request Data Export"]})]}),e.jsxs("div",{className:"p-4 bg-white border border-[#dde3eb] rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] mb-1 font-body",children:"Clear Cache"}),e.jsx("p",{className:"text-xs text-[#5a6578] mb-3",children:"Free up space by clearing cached data"}),e.jsx(p,{variant:"outline",size:"sm",className:"rounded-xl",onClick:ze,disabled:Y,children:Y?"Clearing...":"Clear Cache"})]}),e.jsxs("div",{className:"p-4 bg-rose-50 border border-rose-200 rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-rose-900 mb-1",children:"Reset Progress"}),e.jsxs("p",{className:"text-xs text-rose-700 mb-3",children:[o==="student"&&"Reset quizzes, diagnostic state, XP, and learning progress for retesting.",o==="teacher"&&"Reset imported records, managed classrooms, and teacher-generated quiz artifacts.",o==="admin"&&"Reset admin testing artifacts like personal audit/content update records."]}),e.jsx(p,{variant:"outline",size:"sm",className:"rounded-xl text-rose-700 border-rose-300",disabled:!E||I,onClick:()=>F(!0),children:I?"Resetting...":"Reset Testing Data"})]}),e.jsxs("div",{className:"p-4 bg-red-50 border border-red-200 rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-red-900 mb-1",children:"Delete Account"}),e.jsx("p",{className:"text-xs text-red-700 mb-3",children:"Permanently delete your account and all data"}),e.jsxs(p,{variant:"outline",size:"sm",className:"rounded-xl text-red-700 border-red-300",onClick:()=>V(!0),disabled:de,children:[e.jsx(ms,{size:16,className:"mr-2"}),de?"Deleting...":"Delete Account"]})]})]})]}),e.jsxs("div",{className:"shrink-0 px-4 sm:px-6 py-3 sm:py-4 border-t border-[#dde3eb] bg-[#edf1f7] flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-2 sm:gap-0",children:[e.jsx("p",{className:"text-xs text-slate-500 font-body text-center sm:text-left",children:"MathPulse AI v2.1.0"}),e.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[e.jsx(p,{variant:"outline",onClick:se,className:"rounded-lg border-[#dde3eb] flex-1 sm:flex-none",disabled:X,children:"Cancel"}),e.jsx(p,{onClick:Ee,className:"rounded-lg bg-sky-600 hover:bg-sky-700 text-white flex-1 sm:flex-none",disabled:X,children:X?"Saving...":"Save Changes"})]})]})]})]})]}),Se&&e.jsx(G.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[130] bg-black/50 backdrop-blur-sm flex items-center justify-center p-4",onClick:()=>{v||P(!1)},children:e.jsxs(G.div,{initial:{opacity:0,scale:.95,y:12},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:12},transition:{duration:.2},className:"w-full max-w-md rounded-2xl border border-[#dde3eb] bg-[#f7f9fc] shadow-2xl",onClick:s=>s.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[#dde3eb] px-6 py-4",children:[e.jsxs("h4",{className:"text-lg font-display font-bold text-[#0a1628]",children:[f==="password"&&"Change Password",f==="email"&&"Change Email",f==="delete"&&"Delete Account"]}),e.jsx("button",{onClick:()=>{v||P(!1)},className:"p-2 rounded-xl hover:bg-[#edf1f7] transition-colors","aria-label":"Close",children:e.jsx(Ne,{size:18,className:"text-[#5a6578]"})})]}),e.jsxs("div",{className:"px-6 py-5 space-y-4",children:[e.jsx("p",{className:"text-sm text-[#5a6578]",children:"Enter your current password to continue."}),e.jsxs("div",{className:"relative",children:[e.jsx(n,{type:Q?"text":"password",value:L,onChange:s=>xe(s.target.value),placeholder:"Current password",autoFocus:!0,className:"pr-10",disabled:v,onKeyDown:s=>{s.key==="Enter"&&fe()}}),e.jsx("button",{type:"button",onClick:()=>he(!Q),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600",tabIndex:-1,children:Q?e.jsx(hs,{size:16}):e.jsx(us,{size:16})})]}),f==="password"&&e.jsx("div",{className:"relative",children:e.jsx(n,{type:"password",value:W,onChange:s=>ue(s.target.value),placeholder:"New password (min 8 chars)",disabled:v})}),f==="email"&&e.jsx(n,{type:"email",value:O,onChange:s=>be(s.target.value),placeholder:"New email address",disabled:v}),f==="delete"&&e.jsx("p",{className:"text-sm text-red-600 font-medium",children:"This action is permanent and cannot be undone."}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(p,{variant:"outline",onClick:()=>P(!1),disabled:v,children:"Cancel"}),e.jsx(p,{onClick:()=>void fe(),className:f==="delete"?"bg-red-600 hover:bg-red-700 text-white":"bg-sky-600 hover:bg-sky-700 text-white",disabled:v,children:v?"Processing...":f==="delete"?"Delete Forever":"Confirm"})]})]})]})}),e.jsx(je,{isOpen:we,onClose:()=>F(!1),onConfirm:_e,title:"Reset Testing Data?",message:`Reset ${o} testing data? This will clear quizzes, diagnostic assessments, assessment history, XP, and learning progress. This action cannot be undone.`,confirmText:I?"Resetting...":"Reset Data",cancelText:"Cancel",type:"warning",icon:"warning",zIndexClass:"z-[130]"}),e.jsx(je,{isOpen:Ce,onClose:()=>V(!1),onConfirm:Re,title:"Delete Account?",message:"You will need to re-authenticate to permanently delete your account. This cannot be undone.",confirmText:"Continue",cancelText:"Cancel",type:"danger",icon:"delete",zIndexClass:"z-[130]"})]})}):null};export{rt as default};
|
assets/{Sidebar-DT74kKuo.js β Sidebar-DjsHKc7l.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{r as x,j as e}from"./vendor-react-B4AQeu28.js";import{S as H,a as $,L as u,D as B,M as D}from"./LogoutActionButton-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{r as x,j as e}from"./vendor-react-B4AQeu28.js";import{S as H,a as $,L as u,D as B,M as D}from"./LogoutActionButton-ynXvSPMf.js";import{e as G,m as c,n as P,U as S,G as N,b as m,S as U,a0 as q,E as F}from"./index-CGNBpSmO.js";import{T as M,a as L,b as C}from"./tooltip-A8-ihp1Q.js";import{X as Q}from"./x-Deb9zs8O.js";import{C as W}from"./chevron-right-C39hNstc.js";import{C as R}from"./chevron-left-BuATOj9f.js";import{C as A}from"./chart-column-g5DztEPT.js";import{S as X}from"./shirt-T-KPAkDY.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{SupplementalBanner-Cl_1p9XH.js β SupplementalBanner-DqWH4k4T.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{j as e,r as y}from"./vendor-react-B4AQeu28.js";import{h as j,m as p,x as h,
|
|
|
|
| 1 |
+
import{j as e,r as y}from"./vendor-react-B4AQeu28.js";import{h as j,m as p,x as h,b as f,T as m,B as u}from"./index-CGNBpSmO.js";import{X as v}from"./x-Deb9zs8O.js";import{S as w}from"./sparkles-C0ju-UTT.js";import{C as g}from"./chevron-right-C39hNstc.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-D7t7JfSr.js";import"./vendor-markdown-yqZQ_iQm.js";const b={"General Mathematics":[{label:"Functions Deep Dive",description:"Interactive review of function types and graphs",icon:e.jsx(m,{size:14})},{label:"Business Math Basics",description:"Simple & compound interest practice",icon:e.jsx(f,{size:14})}],"Statistics and Probability":[{label:"Distribution Visualizer",description:"Explore normal distribution curves",icon:e.jsx(m,{size:14})},{label:"Hypothesis Practice",description:"Step-by-step hypothesis testing",icon:e.jsx(u,{size:14})}],"Pre-Calculus":[{label:"Conic Sections Explorer",description:"Visual parabola, ellipse, hyperbola tool",icon:e.jsx(m,{size:14})},{label:"Trig Identity Practice",description:"Identity verification drill set",icon:e.jsx(u,{size:14})}],"Basic Calculus":[{label:"Limits Visualizer",description:"Graphical approach to limits",icon:e.jsx(m,{size:14})},{label:"Derivative Rules Drill",description:"Practice chain rule & implicit diff",icon:e.jsx(u,{size:14})}]};function x(i){const s=i.toLowerCase();return s==="functions"||s.includes("function")||s==="businessmath"||s.includes("business")||s==="logic"||s.includes("reason")||s.includes("general")||s.includes("gen-math")||s.includes("gen math")?"General Mathematics":s.includes("stat")||s.includes("prob")?"Statistics and Probability":s.includes("pre-calc")||s.includes("pre calc")||s.includes("precalc")?"Pre-Calculus":s.includes("basic")||s.includes("calc")?"Basic Calculus":null}function N(i){const s=i.trim().toLowerCase();return s==="functions"?"Functions and Graphs":s==="businessmath"?"Business and Financial Mathematics":s==="logic"?"Logic and Reasoning":i}const k=({atRiskSubjects:i=[],onAction:s,onDismiss:n})=>{const[l,a]=y.useState(!1);if(l||i.length===0)return null;const r=()=>{a(!0),n?.()};return e.jsx(j,{children:!l&&e.jsx(p.div,{initial:{opacity:0,y:-10,height:0},animate:{opacity:1,y:0,height:"auto"},exit:{opacity:0,y:-10,height:0},className:"overflow-hidden",children:e.jsxs("div",{className:"relative bg-gradient-to-r from-sky-600 via-sky-500 to-sky-600 rounded-2xl p-5 text-white shadow-lg shadow-sky-500/20",children:[e.jsx("button",{onClick:r,className:"absolute top-3 right-3 w-7 h-7 bg-white/20 hover:bg-white/30 rounded-full flex items-center justify-center transition-colors",children:e.jsx(v,{size:14})}),e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"w-12 h-12 bg-white/20 rounded-xl flex items-center justify-center flex-shrink-0",children:e.jsx(w,{size:24})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"font-bold text-lg mb-1",children:"Supplemental Materials Available"}),e.jsx("p",{className:"text-sky-100 text-sm mb-3",children:"Based on your diagnostic assessment, we've identified topics that could use extra practice. Strengthening these areas will improve your overall performance."}),e.jsx("div",{className:"flex flex-wrap gap-2 mb-3",children:i.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 bg-white/20 backdrop-blur-sm px-3 py-1 rounded-full text-xs font-semibold",children:[e.jsx(h,{size:12}),N(t)]},t))}),e.jsxs("button",{onClick:s,className:"inline-flex items-center gap-2 bg-white text-sky-600 font-bold text-sm px-4 py-2 rounded-xl hover:bg-sky-50 transition-colors",children:["Review Topics",e.jsx(g,{size:16})]})]})]})]})})})},z=({quizSubject:i,atRiskSubjects:s=[]})=>{const n=i?x(i):null;if(!s.some(r=>{const t=x(r);return t&&t===n})||!n)return null;const a=b[n]||[];return e.jsx(p.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},className:"mb-4 overflow-hidden",children:e.jsxs("div",{className:"bg-gradient-to-r from-rose-50 to-orange-50 border border-rose-200 rounded-xl p-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsx(h,{size:14,className:"text-rose-600"}),e.jsxs("span",{className:"text-xs font-bold text-rose-800",children:["Supplemental Focus Area β ",n]})]}),e.jsx("p",{className:"text-xs text-rose-700 mb-2",children:"This topic was flagged in your diagnostic. Take your time and review the explanations carefully."}),a.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.slice(0,2).map((r,t)=>e.jsxs("span",{className:"inline-flex items-center gap-1 bg-rose-100 text-rose-700 px-2 py-0.5 rounded-md text-xs font-medium",children:[r.icon,r.label]},t))})]})})},C=({quizSubject:i,quizScore:s=0,atRiskSubjects:n=[],onAction:l})=>{const a=i?x(i):null,r=n.some(c=>{const d=x(c);return d&&d===a});if(s>=70&&!r)return null;const t=a?b[a]||[]:[],o=s<70;return e.jsx(p.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.5},className:"mt-4",children:e.jsx("div",{className:`rounded-2xl p-4 border-2 ${o?"bg-orange-50 border-orange-200":"bg-sky-50 border-sky-200"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0 ${o?"bg-orange-500":"bg-sky-500"}`,children:e.jsx(f,{size:20,className:"text-white"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"font-display font-bold text-[#0a1628] text-sm mb-1",children:o?"Review Recommended":"Supplemental Materials"}),e.jsx("p",{className:"text-xs text-[#5a6578] mb-2",children:o?`You scored ${s}% on this quiz. We recommend reviewing the following resources to strengthen your understanding.`:"This topic was identified as an area for growth. Check out these additional resources."}),t.length>0&&e.jsx("div",{className:"space-y-1.5 mb-3",children:t.map((c,d)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:`w-5 h-5 rounded flex items-center justify-center ${o?"bg-orange-100 text-orange-600":"bg-sky-100 text-sky-600"}`,children:c.icon}),e.jsx("span",{className:"font-medium text-[#0a1628]",children:c.label}),e.jsxs("span",{className:"text-slate-500",children:["β ",c.description]})]},d))}),l&&e.jsxs("button",{onClick:l,className:`inline-flex items-center gap-1.5 text-xs font-bold px-3 py-1.5 rounded-lg transition-colors ${o?"bg-orange-500 hover:bg-orange-600 text-white":"bg-sky-500 hover:bg-sky-600 text-white"}`,children:["Review Topics",e.jsx(g,{size:12})]})]})]})})})},I=i=>{switch(i.variant){case"compact":return e.jsx(z,{...i});case"results":return e.jsx(C,{...i});case"full":default:return e.jsx(k,{...i})}};export{I as default};
|
assets/{SupplementalPillCarousel-BCZGCjNt.js β SupplementalPillCarousel-CFX0nks9.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{r as a,j as e}from"./vendor-react-B4AQeu28.js";import{m as f,x}from"./index-
|
| 2 |
.scrollbar-hide::-webkit-scrollbar {
|
| 3 |
display: none;
|
| 4 |
}
|
|
|
|
| 1 |
+
import{r as a,j as e}from"./vendor-react-B4AQeu28.js";import{m as f,x}from"./index-CGNBpSmO.js";import{C as n}from"./chevron-right-C39hNstc.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-D7t7JfSr.js";import"./vendor-markdown-yqZQ_iQm.js";const o={pillBg:"#E9D5FF",pillText:"#6B21A8",headerText:"#1F2937",arrowBg:"#F3F4F6"},b={functions:"Functions & Graphs",businessmath:"Business Math",logic:"Logic & Reasoning",statistics:"Statistics",probability:"Probability",precalc:"Pre-Calculus",calculus:"Basic Calculus",geometry:"Geometry",trigonometry:"Trigonometry",algebra:"Algebra"};function g(t){const s=t.toLowerCase().trim();return b[s]||t.split(/[-_]/).map(l=>l.charAt(0).toUpperCase()+l.slice(1)).join(" ")}const L=({atRiskSubjects:t=[],onTopicClick:s})=>{const l=a.useRef(null),[c,m]=a.useState(!1);if(t.length===0)return null;const h=()=>{if(l.current){const{scrollLeft:r,scrollWidth:i,clientWidth:d}=l.current;m(r+d<i-10)}},p=r=>{s?.(r)},u=()=>{l.current&&l.current.scrollBy({left:200,behavior:"smooth"})};return e.jsxs(f.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},className:"mb-4",children:[e.jsx("h3",{className:"text-base font-bold mb-3",style:{color:o.headerText},children:"Recommended for Review"}),e.jsxs("div",{className:"relative flex items-center",children:[e.jsx("div",{ref:l,onScroll:h,className:"flex gap-2 overflow-x-auto scrollbar-hide pb-1",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:t.slice(0,8).map((r,i)=>e.jsxs("button",{onClick:()=>p(r),className:"flex items-center gap-1.5 px-4 py-2 rounded-full text-sm font-semibold transition-all hover:scale-[1.02] whitespace-nowrap",style:{backgroundColor:o.pillBg,color:o.pillText},children:[e.jsx(x,{size:14}),g(r),e.jsx(n,{size:14})]},`${r}-${i}`))}),c&&e.jsx("button",{onClick:u,className:"flex-shrink-0 ml-2 w-8 h-8 rounded-full flex items-center justify-center transition-colors",style:{backgroundColor:o.arrowBg},"aria-label":"Scroll right",children:e.jsx(n,{size:16,className:"text-gray-600"})})]}),e.jsx("style",{children:`
|
| 2 |
.scrollbar-hide::-webkit-scrollbar {
|
| 3 |
display: none;
|
| 4 |
}
|
assets/TeacherDashboard-6v6okHB7.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/TeacherDashboard-MZLi5zPU.js
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/{XPNotification-Bj_GZruU.js β XPNotification-BlLePAZH.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as l,j as e}from"./vendor-react-B4AQeu28.js";import{h as n,m as i,a5 as m}from"./index-
|
|
|
|
| 1 |
+
import{r as l,j as e}from"./vendor-react-B4AQeu28.js";import{h as n,m as i,a5 as m}from"./index-CGNBpSmO.js";import{S as c}from"./sparkles-C0ju-UTT.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-D7t7JfSr.js";import"./vendor-markdown-yqZQ_iQm.js";const b=({xp:r,message:a,show:t,onComplete:s})=>(l.useEffect(()=>{if(t){const o=setTimeout(()=>{s()},3e3);return()=>clearTimeout(o)}},[t,s]),e.jsx(n,{children:t&&e.jsx(i.div,{initial:{opacity:0,y:-50,scale:.8},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-20,scale:.9},transition:{type:"spring",damping:25,stiffness:200},className:"fixed top-8 left-1/2 -translate-x-1/2 z-50",style:{willChange:"transform, opacity"},children:e.jsxs("div",{className:"bg-gradient-to-r from-rose-400 via-orange-500 to-rose-500 text-white px-6 py-4 rounded-2xl shadow-2xl border-2 border-rose-300 flex items-center gap-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-10 h-10 bg-white/20 rounded-xl flex items-center justify-center",children:e.jsx(m,{size:20,className:"text-white",fill:"currentColor"})}),e.jsx(i.div,{className:"absolute -top-1 -right-1",animate:{rotate:[0,360]},transition:{duration:2,repeat:1/0,ease:"linear"},style:{willChange:"transform"},children:e.jsx(c,{size:16,className:"text-rose-200"})})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold",children:a}),e.jsxs("p",{className:"text-2xl font-black",children:["+",r," XP"]})]})]})})}));export{b as default};
|
assets/{automationService-aNpxrln-.js β automationService-BaY4ockN.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{doc as g,collection as a,serverTimestamp as c,setDoc as l,addDoc as D,query as b,where as z,getDocs as A,updateDoc as C,writeBatch as Q}from"./vendor-firebase-firestore-CNv3xXal.js";import{g as r,b3 as $}from"./index-
|
|
|
|
| 1 |
+
import{doc as g,collection as a,serverTimestamp as c,setDoc as l,addDoc as D,query as b,where as z,getDocs as A,updateDoc as C,writeBatch as Q}from"./vendor-firebase-firestore-CNv3xXal.js";import{g as r,b3 as $}from"./index-CGNBpSmO.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-react-B4AQeu28.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-D7t7JfSr.js";import"./vendor-markdown-yqZQ_iQm.js";const m=async(e,n,o,u,i)=>{try{const t=g(a(r,"notifications")),s={id:t.id,userId:e,type:n,title:o,message:u,read:!1,...i?{actionUrl:i}:{},createdAt:new Date},d={id:s.id,userId:s.userId,type:s.type,title:s.title,message:s.message,read:s.read,createdAt:c(),link:i||null};return await l(t,{...d}),s}catch(t){throw console.error("Error creating notification:",t),t}};async function E(e){if(!e)return 0;const n=a(r,"deepDiagnosticAssignments"),o=b(n,z("lrn","==",e));return(await A(o)).docs.filter(i=>{const t=i.data().status;return t==="pending"||t==="queued"||t==="in_progress"||t==="expired"}).length}async function M(e,n,o="Grade 11",u,i="iar_only",t="initial_assessment"){if(t==="followup_diagnostic"){const s=a(r,"deepDiagnosticAssignments"),d=b(s,z("lrn","==",e)),f=await A(d);if(!f.empty){const p=Q(r);let w=!1;for(const h of f.docs){const I=h.data().status;(I==="pending"||I==="queued")&&(p.update(h.ref,{status:"in_progress",startedAt:c()}),w=!0)}w&&await p.commit()}}return await l(g(r,"diagnosticResults",e),{lrn:e,results:n,gradeLevel:o,workflowMode:i,assessmentType:t,questionBreakdown:u||null,completedAt:c(),processed:!1,processing:!1}),{success:!0,event:"diagnostic_completed",lrn:e,message:`Diagnostic submitted for ${e}. Processing will begin automatically.`,remedialQuizzesCreated:0,notifications:["Your diagnostic results are being processed. Check back shortly!"]}}async function x(e){return await D(a(r,"quizResults"),{lrn:e.lrn,studentId:e.lrn,quizId:e.quizId,subject:e.subject,score:e.score,totalQuestions:e.totalQuestions,correctAnswers:e.correctAnswers,timeSpentSeconds:e.timeSpentSeconds,answers:e.answers||null,submittedAt:c()}),{success:!0,event:"quiz_submitted",lrn:e.lrn,message:`Quiz submitted for ${e.lrn}. Risk recalculation will run automatically.`,remedialQuizzesCreated:0,notifications:[`Quiz result recorded for ${e.subject}.`]}}async function N(e){return await $(e.lrn),await m(e.lrn,"reminder","Welcome to MathPulse AI!","Complete your diagnostic assessment to get started with personalised learning."),e.teacherId&&await m(e.teacherId,"message","New Student Enrolled",`${e.name} has joined. Diagnostic assessment is pending.`),{success:!0,event:"student_enrolled",lrn:e.lrn,message:`Student ${e.name} enrolled and initialised`,remedialQuizzesCreated:0,notifications:[`Welcome ${e.name}! Please complete the diagnostic assessment.`]}}async function W(e){return await D(a(r,"dataImports"),{teacherId:e.teacherId,studentCount:e.students.length,columnMapping:e.columnMapping,importedAt:c(),processed:!1}),await m(e.teacherId,"message","Data Import Processed",`Data import complete β ${e.students.length} student records processed.`),{success:!0,event:"data_imported",message:`Data import processed for ${e.students.length} students`,remedialQuizzesCreated:0,notifications:[`Data import complete β ${e.students.length} student records processed.`]}}async function G(e){const n=g(r,"curriculumContent",e.contentId);return e.action==="delete"?await C(n,{deleted:!0,deletedBy:e.adminId,deletedAt:c(),contentType:e.contentType,subjectId:e.subjectId||null}):await l(n,{contentType:e.contentType,subjectId:e.subjectId||null,details:e.details||null,updatedBy:e.adminId,action:e.action,updatedAt:c()},{merge:!0}),{success:!0,event:"content_updated",message:`Content ${e.action} processed for ${e.contentType}`,remedialQuizzesCreated:0,notifications:[]}}export{E as getPendingDeepDiagnosticCount,G as triggerContentUpdated,W as triggerDataImported,M as triggerDiagnosticCompleted,x as triggerQuizSubmitted,N as triggerStudentEnrolled};
|
assets/{bell-cxZiilDJ.js β bell-DbwiSyKd.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{e}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{e}from"./index-CGNBpSmO.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{button-WbM5w2Bp.js β button-DVjn4LkC.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{j as y}from"./vendor-react-B4AQeu28.js";import{S as k}from"./vendor-radix-BPuEd8FG.js";import{c as V}from"./vendor-charts-D7t7JfSr.js";import{n as p}from"./index-
|
|
|
|
| 1 |
+
import{j as y}from"./vendor-react-B4AQeu28.js";import{S as k}from"./vendor-radix-BPuEd8FG.js";import{c as V}from"./vendor-charts-D7t7JfSr.js";import{n as p}from"./index-CGNBpSmO.js";const g=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,m=V,j=(n,r)=>e=>{var o;if(r?.variants==null)return m(n,e?.class,e?.className);const{variants:u,defaultVariants:i}=r,b=Object.keys(u).map(t=>{const a=e?.[t],d=i?.[t];if(a===null)return null;const s=g(a)||g(d);return u[t][s]}),v=e&&Object.entries(e).reduce((t,a)=>{let[d,s]=a;return s===void 0||(t[d]=s),t},{}),f=r==null||(o=r.compoundVariants)===null||o===void 0?void 0:o.reduce((t,a)=>{let{class:d,className:s,...h}=a;return Object.entries(h).every(x=>{let[c,l]=x;return Array.isArray(l)?l.includes({...i,...v}[c]):{...i,...v}[c]===l})?[...t,d,s]:t},[]);return m(n,b,f,e?.class,e?.className)},N=j("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background text-foreground hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9 rounded-md"}},defaultVariants:{variant:"default",size:"default"}});function w({className:n,variant:r,size:e,asChild:o=!1,...u}){const i=o?k:"button";return y.jsx(i,{"data-slot":"button",className:p(N({variant:r,size:e,className:n})),...u})}export{w as B,j as c};
|
assets/{chart-column-DtQRo3DE.js β chart-column-g5DztEPT.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{e as t}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{e as t}from"./index-CGNBpSmO.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{chatService-BKpYR5sK.js β chatService-v4NqPDUe.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{doc as c,collection as u,getDoc as g,serverTimestamp as i,setDoc as w,updateDoc as p,query as l,where as d,orderBy as y,getDocs as A}from"./vendor-firebase-firestore-CNv3xXal.js";import{g as a}from"./index-
|
|
|
|
| 1 |
+
import{doc as c,collection as u,getDoc as g,serverTimestamp as i,setDoc as w,updateDoc as p,query as l,where as d,orderBy as y,getDocs as A}from"./vendor-firebase-firestore-CNv3xXal.js";import{g as a}from"./index-CGNBpSmO.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-react-B4AQeu28.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-D7t7JfSr.js";import"./vendor-markdown-yqZQ_iQm.js";const Q=async(s,t="New Conversation")=>{try{const e=c(u(a,"chatSessions")),n={id:e.id,userId:s,title:t,messages:[],createdAt:new Date,updatedAt:new Date,isActive:!0};return await w(e,{...n,createdAt:i(),updatedAt:i()}),n}catch(e){throw console.error("Error creating chat session:",e),e}},R=async s=>{try{const t=l(u(a,"chatSessions"),d("userId","==",s),d("isActive","==",!0),y("updatedAt","desc"));return(await A(t)).docs.map(n=>{const r=n.data();return{...r,createdAt:r.createdAt?.toDate()||new Date,updatedAt:r.updatedAt?.toDate()||new Date}})}catch(t){return console.error("Error getting chat sessions:",t),[]}},b=async s=>{try{const t=await g(c(a,"chatSessions",s));if(t.exists()){const e=t.data();return{...e,createdAt:e.createdAt?.toDate()||new Date,updatedAt:e.updatedAt?.toDate()||new Date}}return null}catch(t){return console.error("Error getting chat session:",t),null}},q=async(s,t,e,n)=>{try{const r=c(u(a,"chatMessages")),o={id:r.id,userId:"",role:t,content:e,timestamp:new Date,...n?{context:n}:{}},m=await g(c(a,"chatSessions",s));m.exists()&&(o.userId=m.data().userId);const h={id:o.id,userId:o.userId,role:o.role,content:o.content,sessionId:s,timestamp:i()};return o.context&&(h.context=o.context),await w(r,h),await p(c(a,"chatSessions",s),{updatedAt:i()}),o}catch(r){throw console.error("Error adding message:",r),r}},B=async(s,t)=>{try{const e=l(u(a,"chatMessages"),d("sessionId","==",s),d("userId","==",t),y("timestamp","asc"));return(await A(e)).docs.map(r=>{const o=r.data();return{...o,timestamp:o.timestamp?.toDate()||new Date}})}catch(e){return console.error("Error getting session messages:",e),[]}},N=async(s,t)=>{try{await p(c(a,"chatSessions",s),{title:t,updatedAt:i()})}catch(e){throw console.error("Error updating session title:",e),e}},U=async s=>{try{await p(c(a,"chatSessions",s),{isActive:!1,updatedAt:i()})}catch(t){throw console.error("Error deleting session:",t),t}};export{q as addMessageToSession,Q as createChatSession,U as deleteSession,b as getChatSession,B as getSessionMessages,R as getUserChatSessions,N as updateSessionTitle};
|
assets/{check-CAUeuCaw.js β check-BfYhdun3.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{e as c}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{e as c}from"./index-CGNBpSmO.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{chevron-left-DfHtS3Om.js β chevron-left-BuATOj9f.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{e}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{e}from"./index-CGNBpSmO.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{chevron-right-DL17FiOB.js β chevron-right-C39hNstc.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{e as o}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{e as o}from"./index-CGNBpSmO.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{chevron-up-D9yeZehY.js β chevron-up-B59xV3SY.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{e as o}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{e as o}from"./index-CGNBpSmO.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{circle-alert-DCyh_PVA.js β circle-alert-fZn6_hMx.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{e}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{e}from"./index-CGNBpSmO.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{circle-check-BjsGkfB1.js β circle-check-BhLH88x1.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{e as c}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{e as c}from"./index-CGNBpSmO.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{circle-check-big-DJBKLvuw.js β circle-check-big-yCNC9yfs.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{e as c}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{e as c}from"./index-CGNBpSmO.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{circle-help-BkKMcGF2.js β circle-help-DMiD6EQw.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{e as c}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{e as c}from"./index-CGNBpSmO.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{clipboard-check-DfL2oC8x.js β clipboard-check-DSPNHJXj.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{e}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{e}from"./index-CGNBpSmO.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{clock-Dy5eVj9o.js β clock-D2bky9WI.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{e as c}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{e as c}from"./index-CGNBpSmO.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{diagnosticService-ukrfKIf7.js β diagnosticService-DLw8ENQS.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
| 2 |
-
import{_ as w}from"./index-
|
|
|
|
| 1 |
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CGNBpSmO.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-BPuEd8FG.js","assets/vendor-charts-D7t7JfSr.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-CEL3Ax6X.css"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{_ as w}from"./index-CGNBpSmO.js";const y="https://deign86-mathpulse-api-v3test.hf.space";async function P(g,h){const f=`${y}/api/diagnostic/generate`,{auth:i}=await w(async()=>{const{auth:e}=await import("./index-CGNBpSmO.js").then(a=>a.b5);return{auth:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),c=i.currentUser,l=async()=>{const e=new Headers({"Content-Type":"application/json"});if(c){const a=await c.getIdToken(!1);a&&e.set("Authorization",`Bearer ${a}`)}return e},u=async e=>fetch(f,{method:"POST",headers:await l(),body:JSON.stringify({strand:g,grade_level:h}),signal:e}),d=(e,a)=>{let t="Something went wrong. Please try again.";try{const s=JSON.parse(a);if(s.detail){const o=String(s.detail);o.includes("Database unavailable")||o.includes("unavailable")?t="Our servers are temporarily busy. Please try again in a moment.":o.includes("timeout")||o.includes("timed out")?t="The request timed out. Please check your connection and try again.":t=o}}catch{!e.ok&&a&&(t="Failed to start assessment. Please try again.")}return t},n=2,r=3e4;for(let e=1;e<=n;e++){const a=new AbortController,t=setTimeout(()=>a.abort(),r);try{const s=await u(a.signal);if(s.ok)return clearTimeout(t),s.json();if(s.status>=400&&s.status<500){clearTimeout(t);const m=await s.text().catch(()=>"");throw new Error(d(s,m))}const o=await s.text().catch(()=>""),p=d(s,o);if(clearTimeout(t),e<n){const m=e*2e3;console.warn(`[generateDiagnostic] attempt ${e} failed (${s.status}), retrying in ${m}ms...`),await new Promise(T=>setTimeout(T,m));continue}throw new Error(p)}catch(s){if(clearTimeout(t),s instanceof DOMException&&s.name==="AbortError"){if(e<n){console.warn(`[generateDiagnostic] attempt ${e} timed out, retrying...`);continue}throw new Error("The request timed out. Please check your connection and try again.")}throw s}}throw new Error("Failed to generate assessment after multiple attempts.")}async function _(g,h){const f=`${y}/api/diagnostic/submit`,i=new Headers({"Content-Type":"application/json"}),{auth:c}=await w(async()=>{const{auth:n}=await import("./index-CGNBpSmO.js").then(r=>r.b5);return{auth:n}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),l=c.currentUser;if(l){const n=await l.getIdToken(!1);n&&i.set("Authorization",`Bearer ${n}`)}const u=new AbortController,d=setTimeout(()=>u.abort(),6e4);try{const n=await fetch(f,{method:"POST",headers:i,body:JSON.stringify({test_id:g,responses:h}),signal:u.signal});if(!n.ok){const r=await n.text().catch(()=>"");let e="Something went wrong. Please try again.";try{const a=JSON.parse(r);if(a.detail){const t=String(a.detail);t.includes("session")||t.includes("not found")?e="Your assessment session has expired. Please restart the assessment.":t.includes("Database unavailable")||t.includes("unavailable")?e="Our servers are temporarily busy. Please try again in a moment.":t.includes("timeout")||t.includes("timed out")?e="The request timed out. Please check your connection and try again.":e=t}}catch{r.includes("404")||r.includes("not found")?e="Your assessment session has expired. Please restart the assessment.":r&&(e="Something went wrong. Please try again.")}throw new Error(e)}return n.json()}finally{clearTimeout(d)}}export{P as g,_ as s};
|
assets/{dialog-C4ok-Axi.js β dialog-DDOyFRnI.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{e as g,n as s}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{e as g,n as s}from"./index-CGNBpSmO.js";import{j as t,r as d}from"./vendor-react-B4AQeu28.js";import{b as m,c as l,d as p,T as n,D as i,P as u,O as r}from"./vendor-radix-BPuEd8FG.js";import{X as x}from"./x-Deb9zs8O.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|